]> git.saurik.com Git - bison.git/blame - ChangeLog
Do not allow identifiers that start with a dash.
[bison.git] / ChangeLog
CommitLineData
eb8c66bb
JD
12011-01-29 Joel E. Denny <joeldenny@joeldenny.org>
2
3 Do not allow identifiers that start with a dash.
4 This cleans up our previous fixes for a bug whereby Bison
5 discarded `.field' in `$-1.field'. The previous fixes were less
6 restrictive about where a dash could appear in an identifier, but
7 the restrictions were hard to explain. That bug was reported and
8 this final fix was originally suggested by Paul Hilfinger. This
9 also fixes a remaining bug reported by Paul Eggert whereby Bison
10 parses `%token ID -123' as `%token ID - 123' and handles `-' as an
11 identifier. Now, `-' cannot be an identifier. Discussed in
12 threads beginning at
13 <http://lists.gnu.org/archive/html/bug-bison/2011-01/msg00000.html>,
14 <http://lists.gnu.org/archive/html/bug-bison/2011-01/msg00004.html>.
15 * NEWS (2.5): Update entry describing the dash extension to
16 grammar symbol names. Also, move that entry before the named
17 references entry because the latter mentions the former.
18 * doc/bison.texinfo (Symbol): Update documentation for symbol
19 names. As suggested by Paul Eggert, mention the effect of periods
20 and dashes on named references.
21 (Decl Summary): Update documentation for unquoted %define values,
22 which, as a side effect, can no longer start with dashes either.
23 * src/scan-code.l (id): Implement.
24 * src/scan-gram.l (id): Implement.
25 * tests/actions.at (Exotic Dollars): Extend test group to exercise
26 bug reported by Paul Hilfinger.
27 * tests/input.at (Symbols): Update test group, and extend to
28 exercise bug reported by Paul Eggert.
29 * tests/named-refs.at (Stray symbols in brackets): Update test
30 group.
31 ($ or @ followed by . or -): Likewise.
32 * tests/regression.at (Invalid inputs): Likewise.
33
448dc38b
JD
342011-01-24 Joel E. Denny <joeldenny@joeldenny.org>
35
36 * data/yacc.c: Fix last apostrophe warning from xgettext.
37
7e5ef706
PE
382011-01-09 Paul Eggert <eggert@cs.ucla.edu>
39
40 Fix minor problems encountered by a fresh bootstrap.
41 * data/glr.c, data/yacc.c: Do not use apostrophes in '#' comments,
42 as they confuse xgettext, which tries to parse them as C character
43 constants in a preprocessor directive.
44 * data/yacc.c (yy_lac): Don't use printf %d format on *yyesp, as
45 that expression might not promote to int on some platforms.
46 * src/parse-gram.c, src/parse-gram.h: Regenerate.
47
8cbbf178
JD
482011-01-09 Joel E. Denny <joeldenny@joeldenny.org>
49
50 Improve error messages for `$' or `@' followed by `.' or `-'.
51 Previously, for this special case of an invalid reference, the
52 usual "symbol not found in production:" was printed. However,
53 because the symbol name was parsed as the empty string, that
54 message was followed immediately by a newline instead of a symbol
55 name. In reality, this is a syntax error, so the reference is
56 invalid regardless of the symbols actually appearing in the
57 production. Discussed at
58 <http://lists.gnu.org/archive/html/bison-patches/2011-01/msg00012.html>.
59 * src/scan-code.l (parse_ref): Report the above case as a syntax
60 error. Other than that, continue to handle this case like any
61 other invalid reference that Bison manages to parse because
62 "possibly meant" messages can still be helpful to the user.
63 * tests/named-refs.at ($ or @ followed by . or -): New test group.
64
35430378
JD
652011-01-08 Joel E. Denny <joeldenny@joeldenny.org>
66
67 doc: don't use @acronym.
68 Lately, many GNU packages are dropping it. See
69 <http://lists.gnu.org/archive/html/bison-patches/2011-01/msg00003.html>.
70 * doc/bison.texinfo: Remove all uses.
71
d236ad94
AR
722011-01-05 Alex Rozenman <rozenman@gmail.com>
73
74 Do not allow identifiers that start with a negative number.
75 Reported by Paul Hilfinger as a side effect of named references
76 support at
77 <http://lists.gnu.org/archive/html/bug-bison/2011-01/msg00000.html>.
78 Suggested by Paul Eggert.
79 * src/scan-code.l ({letter}, {id}): Adjust lexical definitions.
80 * src/scan-gram.l ({letter}, {id}): Likewise.
81
9a4292e5
JD
822011-01-03 Joel E. Denny <joeldenny@joeldenny.org>
83
84 * ChangeLog (2011-01-02): improve description.
85
17300e83
JD
862011-01-03 Joel E. Denny <joeldenny@joeldenny.org>
87
88 maint: don't update copyright years in bootstrap.
89 * .x-update-copyright: Add entry for bootstrap.
90 * bootstrap: Remove 2011 from copyright years. The bootstrap
91 version we're currently using comes from an older version of
92 gnulib.
93 * bootstrap.conf (bootstrap_sync): Add comments explaining this
94 issue.
95
ea0a7676
JD
962011-01-02 Joel E. Denny <joeldenny@joeldenny.org>
97
98 maint: run "make update-copyright".
99
f52e1e5e
JD
1002011-01-02 Joel E. Denny <joeldenny@joeldenny.org>
101
9a4292e5 102 maint: prepare to use year ranges in copyright notices.
f52e1e5e 103 * README (Copyright statements): New section explaining the range
9a4292e5
JD
104 notation. The GNU maintainers document requires this explanation:
105 <http://www.gnu.org/prep/maintain/maintain.html#Copyright-Notices>.
106 I copied our explanation from coreutils.
f52e1e5e
JD
107 * build-aux/update-b4-copyright: Revert 2010-06-17 changes that
108 disabled Bison's automated use of ranges.
109 * cfg.mk (update-copyright-env): Likewise.
110
210c1eef
JD
1112011-01-02 Joel E. Denny <joeldenny@joeldenny.org>
112
113 Correct my email address.
114 * ChangeLog: In all recent entries.
115 * THANKS (Joel E. Denny): Here.
116
1172010-12-19 Joel E. Denny <joeldenny@joeldenny.org>
6ee881f6
JD
118
119 doc: cleanup.
120 * NEWS (2.5): Try to sort entries according to how interesting
121 users might find them.
122
210c1eef 1232010-12-19 Joel E. Denny <joeldenny@joeldenny.org>
3b1977ea
JD
124
125 doc: cleanup.
126 * NEWS (2.5): Make some minor improvements to wording, and format
127 entries more consistently.
128 * doc/bison.texinfo (Language and Grammar): Point out that IELR
129 and canonical LR are experimental features.
130 (Decl Summary): In list of %define variables, make wording more
131 consistent. Improve discussion of using LALR for GLR.
132
210c1eef 1332010-12-19 Joel E. Denny <joeldenny@joeldenny.org>
4c38b19e
JD
134
135 parse.lac: document.
136 * NEWS (2.5): Add entry for LAC, and mention LAC in entry for
137 other corrections to verbose syntax error messages.
138 * doc/bison.texinfo (Decl Summary): Rewrite entries for
139 lr.default-reductions and lr.type to be clearer, to mention
140 %nonassoc's effect on canonical LR, and to mention LAC. Add entry
141 for parse.lac.
142 (Glossary): Add entry for LAC.
143
210c1eef 1442010-12-11 Joel E. Denny <joeldenny@joeldenny.org>
723fe7d1
JD
145
146 parse.lac: implement exploratory stack reallocations.
147 * data/yacc.c: Rename %define variable parse.lac.es-capacity to
148 parse.lac.es-capacity-initial. Accept parse.lac.memory-trace
149 with values of "failures" (default) or "full".
150 (b4_declare_parser_state_variables): Add yyesa, yyes, and
151 yyes_capacity variables.
152 (YYSTACK_USE_ALLOCA): Ignore it if LAC requested.
153 (YYSTACK_ALLOC, YYSTACK_FREE, YYSTACK_ALLOC_MAXIMUM): Define if
154 LAC requested.
155 (YYCOPY_NEEDED): New cpp macro.
156 (YYCOPY): Define if LAC requested.
157 (yy_lac_stack_realloc): New function implementing stack
158 reallocations. Use YYMAXDEPTH for maximum stack size given that
159 the stack should never need to grow larger than the main state
160 stack needs to grow without LAC.
161 (YY_LAC_ESTABLISH): Update yy_lac invocation.
162 (yy_lac): Add arguments for exploratory stack memory data
163 recorded in the main parser. Invoke yy_lac_stack_realloc when
164 reallocation is necessary.
165 (yysyntax_error): Add the same new arguments and pass them to
166 yy_lac.
167 (yypstate_delete): Free yyes if necessary.
168 (yyesa, yyes, yyes_capacity): #define these to yypstate members
169 in the case of push parsing.
170 (yyparse, yypush_parse): Initialize yyes and yyes_capacity.
171 Update yysyntax_error invocations. At yyreturn, free yyes if
172 necessary.
173 * src/parse-gram.y: %define parse.lac full.
174 * tests/input.at (LAC: errors for %define): Extend for
175 parse.lac-memory-trace.
176 * tests/regression.at (LAC: Exploratory stack): Extend to check
177 that stack reallocs happen when expected.
178 (LAC: Memory exhaustion): Update to use YYMAXDEPTH and
179 parse.lac.es-capacity-initial.
180
210c1eef 1812010-12-11 Joel E. Denny <joeldenny@joeldenny.org>
ea13bea8
JD
182
183 parse.lac: implement as %define variable.
184 LAC = lookahead correction. See discussion at
185 <http://lists.gnu.org/archive/html/bison-patches/2009-09/msg00034.html>.
186 However, one point there must be corrected: because of %nonassoc,
187 LAC is *not* always redundant for lr.type=canonical-lr.
188 * data/yacc.c: Accept values of "none" (default) or "full" for
189 parse.lac. Accept %define parse.lac.es-capacity to specify
190 capacity of LAC's temporary exploratory stack. It defaults to 20
191 and, for now, will not grow dynamically.
192 (b4_lac_flag, b4_lac_if): New m4 macros. Evaluate as true for
193 parse.lac!=none.
194 (YYBACKUP): Invoke YY_LAC_DISCARD.
195 (YY_LAC_ESTABLISH, YY_LAC_DISCARD): New cpp macros that invoke
196 yy_lac and track when it needs to be invoked
197 (yy_lac): New function that, given the current stack, determines
198 whether a token can eventually be shifted. Return status mimics
199 yyparse return status.
200 (yysyntax_error): Change yystate argument to yyssp so stack top
201 can be passed to yy_lac. If LAC is requested, build expected
202 token list by invoking yy_lac for every token instead of just
203 checking the current state for lookaheads. Return 2 if yy_lac
204 exhausts memory.
205 (yyparse, yypush_parse): Use local variable yy_lac_established and
206 cpp macros YY_LAC_ESTABLISH and YY_LAC_DISCARD to implement LAC.
207 Update yysyntax_error invocation. Add yyexhaustedlab code if LAC
208 is requested.
209 * tests/conflicts.at (%nonassoc and eof): Extend to check the
210 effect of each of -Dlr.type=canonical-lr and -Dparse.lac=full.
211 (%error-verbose and consistent errors): Likewise.
212 (LAC: %nonassoc requires splitting canonical LR states): New test
213 group demonstrating how LAC can fix canonical LR.
214 * tests/input.at (LAC: Errors for %define): New test group.
215 * tests/regression.at (LAC: Exploratory stack): New test group.
216 (LAC: Memory exhaustion): New test group.
217
210c1eef 2182010-11-21 Joel E. Denny <joeldenny@joeldenny.org>
dcd39f1d
JD
219
220 build: use gnulib's new bootstrap_sync option.
221 Now, whenever we update bison's copy of gnulib, bootstrap will
222 update itself the next time it's run.
223 * bootstrap: Copy from latest gnulib for bootstrap_sync support.
224 * bootstrap.conf (bootstrap_sync): Set to true.
225 * gnulib: Update to latest so bootstrap is in sync now.
226
210c1eef 2272010-11-07 Joel E. Denny <joeldenny@joeldenny.org>
3b837882
JD
228
229 yysyntax_error: adjust prior fixes for branch-2.5's lalr1.cc.
230 On master, there is no yychar in lalr1.cc, but there is on
231 branch-2.5, and the prior cherry-pick of "Fix handling of yychar
232 manipulation in user semantic actions" wasn't adjusted for that
233 difference.
234 * data/lalr1.cc (yy::parser::parse): Translate yychar before
235 every use of yytoken, and add comments explaining this approach.
236 * tests/conflicts.at (%error-verbose and consistent errors):
237 Extend to test yychar manipulation with lalr1.cc.
238
210c1eef 2392010-11-07 Joel E. Denny <joeldenny@joeldenny.org>
095a1d11
JD
240
241 yysyntax_error: fix for consistent error with lookahead.
242 * NEWS (2.5): Document.
243 * data/yacc.c (yysyntax_error): In a verbose syntax error
244 message while in a consistent state with a default action (which
245 must be an error action given that yysyntax_error is being
246 invoked), continue to drop the expected token list, but don't
247 drop the unexpected token unless there actually is no lookahead.
248 Moreover, handle that internally instead of returning 1 to tell
249 the caller to do it. With that meaning of 1 gone, renumber
250 return codes more usefully.
251 (yyparse, yypush_parse): Update yysyntax_error usage. Most
252 importantly, set yytoken to YYEMPTY when there's no lookahead.
253 * data/glr.c (yyreportSyntaxError): As in yacc.c, don't drop the
254 unexpected token unless there actually is no lookahead.
255 * data/lalr1.cc (yy::parser::parse): If there's no lookahead,
256 set yytoken to yyempty_ before invoking yysyntax_error_.
257 (yy::parser::yysyntax_error_): Again, don't drop the unexpected
258 token unless there actually is no lookahead.
259 * data/lalr1.java (YYParser::parse): If there's no lookahead,
260 set yytoken to yyempty_ before invoking yysyntax_error.
261 (YYParser::yysyntax_error): Again, don't drop the unexpected
262 token unless there actually is no lookahead.
263 * tests/conflicts.at (%error-verbose and consistent
264 errors): Extend test group to further reveal how the previous
265 use of the simple "syntax error" message was too general. Test
266 yacc.c, glr.c, lalr1.cc, and lalr1.java. No longer an expected
267 failure.
268 * tests/java.at (AT_JAVA_COMPILE, AT_JAVA_PARSER_CHECK): Move
269 to...
270 * tests/local.at: ... here.
271 (_AT_BISON_OPTION_PUSHDEFS): Push AT_SKEL_JAVA_IF definition.
272 (AT_BISON_OPTION_POPDEFS): Pop it.
273 (AT_FULL_COMPILE): Extend to handle Java.
274
210c1eef 2752010-11-07 Joel E. Denny <joeldenny@joeldenny.org>
678094a2
JD
276
277 yysyntax_error: more preparation for readability of next patch.
278 There are no behavioral changes here.
279 * data/glr.c (yyreportSyntaxError): Reorganize.
280 * data/lalr1.cc (yy::parser::yysyntax_error_): Reorganize.
281 * tests/conflicts.at (%error-verbose and consistent errors):
282 Reorganize.
283
210c1eef 2842010-11-07 Joel E. Denny <joeldenny@joeldenny.org>
f953cb20
JD
285
286 yysyntax_error: prepare for readability of next patches.
287 These are purely whitespace changes that result in ugly code
288 but that make the next couple of patches much easier to read.
289 * data/glr.c (yyreportSyntaxError): Reindent.
290 * data/lalr1.cc (yy::parser::yysyntax_error_): Reindent.
291 * data/lalr1.java (YYParser::yysyntax_error): Reindent.
292 * data/yacc.c (yysyntax_error): Reindent.
293
0e0f066b
JD
2942010-10-31 Joel E. Denny <joeldenny@joeldenny.org>
295
296 yysyntax_error: improve invocation readability.
297 * data/yacc.c (yyparse, yypush_parse): For yysyntax_error
298 invocation, get rid of the while loop, which is misleading
299 because there are really at most two iterations.
300
5f1485d8
JD
3012010-10-31 Joel E. Denny <joeldenny@joeldenny.org>
302
303 * ChangeLog: Correct some errors in previous entries.
304
2f3fd8f9
JD
3052010-10-17 Joel E. Denny <joeldenny@joeldenny.org>
306
307 maint: re-anchor all .gitignore entries.
308 * bootstrap: Copy from gnulib's latest for the fix to
309 automatically anchor entries it constructs.
310 * gnulib: Update to latest just so it has the same bootstrap.
311 * .gitignore, build-aux/.gitignore, doc/.gitignore:
312 * lib/.gitignore, m4/.gitignore, po/.gitignore:
313 * runtime-po/.gitignore: Re-anchor all entries.
314
86996fca
PE
3152010-10-08 Paul Eggert <eggert@cs.ucla.edu>
316
ea6046b9
PE
317 Fix portability problem on OpenBSD 4.7.
318
319 Jim Meyering reported this in
320 <http://lists.gnu.org/archive/html/bug-bison/2010-10/msg00007.html>.
321 * data/yacc.c: Use EXIT_SUCCESS as a witness for stdlib.h,
322 not _STDLIB_H. EXIT_SUCCESS has been defined by the standard
323 for quite some time.
324 * src/parse-gram.c, src/parse-gram.h: Regenerate.
325 * tests/regression.at: Tamper with the renamed witness.
326
86996fca
PE
327 Adjust to recent changes to gnulib bootstrap.
328
329 * .cvsignore, build-aux/.cvsignore, doc/.cvsignore, etc/.cvsignore:
330 * examples/calc++/.cvsignore, lib/.cvsignore, m4/.cvsignore:
331 * po/.cvsignore, runtime-po/.cvsignore, src/.cvsignore:
332 * tests/.cvsignore: Remove; I don't use CVS to maintain Bison
333 anymore and don't know of anybody else who does. If someone needs
334 these files, they can resurrect them.
335 * .gitignore, build-aux/.gitignore, doc/.gitignore, lib/.gitignore:
336 * m4/.gitignore, po/.gitignore, runtime-po/.gitignore:
337 Omit leading '/', since bootstrap omits it.
338 Adjust file names to match current contents better.
339 * bootstrap: Sync from gnulib: this contains the new gnulib_mk_hook
340 installed just for us.
341 * bootstrap.conf (excluded_files): Don't exclude codeset.m4,
342 glibc21.m4, inttypes_h.m4, size_max.m4, xsize.m4, as they are now
343 needed somehow. Don't have time to look into why.
344 (gnulib_modules): Change malloc to malloc-gnu. Do we really assume
345 the GNU malloc behavior, where malloc (0) != NULL unless we're
346 out of storage? If not, we can omit malloc-gnu; but for now I left
347 it in to be safe.
348 (vc_ignore): Remove.
349 * README-hacking: Renamed from HACKING, since gnulib bootstrap now
350 uses that convention.
351
7527c744
JD
3522010-08-05 Joel E. Denny <joeldenny@joeldenny.org>
353
354 Version 2.4.3.
355 * NEWS (2.4.3): Set date.
356
d034d520
JD
3572010-08-04 Joel E. Denny <joeldenny@joeldenny.org>
358
359 maint: add gettext version to release announcements.
360 Suggested by Paul Hilfinger at
361 <http://lists.gnu.org/archive/html/bison-patches/2010-07/msg00019.html>
362 <http://lists.gnu.org/archive/html/bison-patches/2010-08/msg00002.html>.
363 * cfg.mk (bootstrap-tools): Add gettext.
364
cf22447c
JD
3652010-08-04 Joel E. Denny <joeldenny@joeldenny.org>
366
367 doc: fix -W and %expect documentation some.
368 * NEWS (2.4.3): Mention that there are documentation fixes.
369 * doc/bison.texinfo (Expect Decl): Make it clear that %expect
370 turns conflicts into errors not warnings.
371 (Shift/Reduce): Likewise.
372 (Bison Options): Don't mention -Wsyntax. It doesn't exist.
373
4631c34f
JD
3742010-08-01 Joel E. Denny <joeldenny@joeldenny.org>
375
376 -Werror: fix for rules useless in parser after conflicts.
377 * NEWS (2.4.3): Document fix.
378 * src/complain.c (error_message): Extend to handle incomplete
379 error messages so warn and warn_at can be used in more cases.
380 * src/gram.c (grammar_rules_useless_report): Use warn_at so that
381 -Werror is always obeyed.
382 * src/reduce.c (reduce_print): Use warn so that the "warnings
383 being treated as errors" message is printed consistently before
384 the first warning message. This makes testing easier.
385 * tests/local.at (AT_BISON_WERROR_MSG): New macro.
386 (AT_BISON_CHECK_NO_XML): Extend to check -Werror and
387 --warnings=error when warnings appear in bison's stderr.
388
3e948170
JD
3892010-07-29 Joel E. Denny <joeldenny@joeldenny.org>
390
391 maint: enable gnits only at stable releases.
392 * configure.ac (AM_INIT_AUTOMAKE): Underscore or dash in a
393 version string should disable gnits. Explain in comments.
394
82df2d6d
JD
3952010-07-28 Joel E. Denny <joeldenny@joeldenny.org>
396
397 i18n: update.
398 * po/POTFILES.in: Add src/graphviz.c.
399
6e0ecb9a
JD
4002010-07-28 Joel E. Denny <joeldenny@joeldenny.org>
401
402 i18n: fix for gnulib.
403 * po/POTFILES.in: Add remaining gnulib files that have
404 translatable strings.
405
83e34842
JD
4062010-07-25 Joel E. Denny <joeldenny@joeldenny.org>
407
408 maint: use announce-gen's new --mail-headers.
409 * HACKING (Announce): Update instructions.
410 * cfg.mk (announcement_Cc_): Define.
411 * configure.ac (AM_GNU_GETTEXT_VERSION): Update to 0.18 as
412 required by latest gnulib.
413 * gnulib: Update to latest.
414
0162a44c
JD
4152010-07-24 Joel E. Denny <joeldenny@joeldenny.org>
416
417 tests: handle Valgrind that complains about >&-.
418 * tests/output.at (AT_CHECK_OUTPUT): Extend to accept pre-tests.
419 (Output files: -dv >&-): Skip test group if running
420 maintainer-check-valgrind.
421
241ac701
AD
4222010-06-17 Paul Eggert <eggert@cs.ucla.edu>
423
424 Update from GFDL GFDL 1.2 to 1.3.
425 * doc/bison.texinfo: Update GFDL version number.
426 * doc/fdl.texi: Update to version 1.3, taken from:
427 http://www.gnu.org/licenses/fdl.texi
428
6e30ede8
PE
4292010-06-17 Paul Eggert <eggert@cs.ucla.edu>
430
431 Do not use date ranges in copyright notices.
432 See http://www.gnu.org/prep/maintain/maintain.html#Copyright-Notices
433
434 * HACKING, Makefile.am, NEWS, PACKAGING, README, README-alpha:
435 * TODO, bootstrap, bootstrap.conf:
436 * build-aux/update-b4-copyright, cfg.mk, configure.ac:
437 * data/README, data/bison.m4, data/c++-skel.m4, data/c++.m4:
438 * data/c-skel.m4, data/c.m4, data/glr.c, data/glr.cc:
439 * data/java-skel.m4, data/java.m4, data/lalr1.cc:
440 * data/lalr1.java, data/location.cc:
441 * data/xslt/bison.xsl:
442 * data/xslt/xml2dot.xsl, data/xslt/xml2text.xsl:
443 * data/xslt/xml2xhtml.xsl, data/yacc.c, djgpp/Makefile.maint:
444 * djgpp/README.in, djgpp/config.bat, djgpp/config.sed:
445 * djgpp/config.site, djgpp/config_h.sed, djgpp/djunpack.bat:
446 * djgpp/subpipe.c, djgpp/subpipe.h:
447 * djgpp/testsuite.sed, doc/bison.texinfo:
448 * doc/refcard.tex, etc/README, etc/bench.pl.in:
449 * examples/calc++/Makefile.am, examples/extexi:
450 * lib/abitset.c, lib/abitset.h:
451 * lib/bbitset.h, lib/bitset.c, lib/bitset.h:
452 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
453 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
454 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
455 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
456 * lib/libiberty.h, lib/main.c, lib/timevar.c:
457 * lib/timevar.def, lib/timevar.h, lib/vbitset.c:
458 * lib/vbitset.h, lib/yyerror.c, m4/bison-i18n.m4:
459 * m4/c-working.m4, m4/cxx.m4, m4/subpipe.m4, m4/timevar.m4:
460 * src/AnnotationList.c, src/AnnotationList.h:
461 * src/InadequacyList.c, src/InadequacyList.h, src/LR0.c:
462 * src/LR0.h, src/Sbitset.c, src/Sbitset.h, src/assoc.c:
463 * src/assoc.h, src/closure.c, src/closure.h, src/complain.c:
464 * src/complain.h, src/conflicts.c, src/conflicts.h:
465 * src/derives.c, src/derives.h, src/files.c, src/files.h:
466 * src/flex-scanner.h, src/getargs.c, src/getargs.h:
467 * src/gram.c, src/gram.h, src/graphviz.c, src/ielr.c:
468 * src/ielr.h, src/lalr.c, src/lalr.h:
469 * src/location.c, src/location.h, src/main.c:
470 * src/muscle-tab.c, src/muscle-tab.h, src/named-ref.c:
471 * src/named-ref.h, src/nullable.c, src/nullable.h:
472 * src/output.c, src/output.h, src/parse-gram.y:
473 * src/print-xml.c, src/print-xml.h, src/print.c, src/print.h:
474 * src/print_graph.c, src/print_graph.h, src/reader.c:
475 * src/reader.h, src/reduce.c, src/reduce.h, src/relation.c:
476 * src/relation.h, src/scan-code.h, src/scan-code.l:
477 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
478 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
479 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
480 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
481 * tests/actions.at, tests/atlocal.in, tests/c++.at:
482 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
483 * tests/existing.at, tests/glr-regression.at:
484 * tests/headers.at, tests/input.at, tests/java.at:
485 * tests/local.at, tests/named-refs.at:
486 * tests/output.at, tests/push.at, tests/reduce.at:
487 * tests/regression.at, tests/sets.at, tests/skeletons.at:
488 * tests/synclines.at, tests/testsuite.at, tests/torture.at:
489 * data/Makefile.am, data/location.cc, doc/Makefile.am, src/Makefile.am:
490 * tests/Makefile.am, lib/Makefile.am, examples/Makefile.am:
491 * etc/Makefile.am:
492 Don't use date ranges in copyright notices.
493
3d4a0cad
AD
4942010-05-11 Akim Demaille <demaille@gostai.com>
495
496 lalrl1.cc: give a chance to user defined YYLLOC_DEFAULT.
497 * data/lalr1.cc (YYLLOC_DEFAULT): Move its definition from the
498 header file to the implementation file, after the user %code
499 sections.
500 * NEWS (2.5): Document this.
501
e7bab2df
AD
5022010-05-07 Akim Demaille <demaille@gostai.com>
503
504 c++: use YYRHSLOC.
505 * data/lalr1.cc (YYRHSLOC): New.
506 (YYLLOC_DEFAULT): Use it.
507 * data/glr.cc: If location_type was user defined, do not include
508 location.hh, and do not produce location.hh and position.hh.
509 * tests/calc.at (YYLLOC_DEFAULT): Use YYRHSLOC.
510 Check that glr.cc supports user defined location_type.
511 * NEWS: Document this.
512
baacae49
AD
5132010-05-10 Akim Demaille <demaille@gostai.com>
514
515 doc: fix lalr1.cc documentation.
516 * doc/bison.texinfo (C++ Scanner Interface): Fix yylex signature.
517 (C++ Bison Interface): Fix lalr1.cc skeleton name.
518 (C++ Parser Interface): Fix semantic_type and location_type names.
519 Document yy::parser::token.
520 Reported by Jerry Quinn.
521
95a2de56
AD
5222010-05-04 Akim Demaille <demaille@gostai.com>
523
524 lalr1.cc: don't generate location.hh when location_type is defined
525 * data/bison.m4 (b4_percent_define_use): New.
526 (b4_percent_define_get): Use it.
527 Accept a default value.
528 * data/c++.m4: Do not provide a default value for the %define
529 variable location_type, rather, use b4_percent_define_get with a
530 default argument where its value is needed.
531 * data/lalr1.cc: Do not load location.cc (which outputs both
532 location.hh and position.hh) if the user defined location_type.
533 Do not include location.hh either.
534 * data/glr.cc: Likewise.
535
0f404a0a
AD
5362010-05-04 Akim Demaille <demaille@gostai.com>
537
538 lalr1.cc: location_type: make sure we don't depend on loc.(begin|end).
539 * tests/calc.at (Span): Instead of begin/end, as in the built-in
540 location class, use first and last.
541 Define YYLLOC_DEFAULT to adjust to these changes.
542 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Adjust to the
543 location_type changes.
544
bdc360ae
AD
5452010-05-04 Akim Demaille <demaille@gostai.com>
546
547 tests: enhance AT_SYNCLINES_COMPILE.
548 * tests/synclines.at (AT_TEST_SYNCLINE): Move GCC 4.5 protection
549 into...
550 (AT_SYNCLINES_COMPILE): here.
551 Add more distcc patterns.
552
ca7a59e8
JD
5532010-05-01 Joel E. Denny <joeldenny@joeldenny.org>
554
555 tests: fix maintainer-xml-check.
556 * data/xslt/xml2dot.xsl (xsl:template match="bison-xml-report"):
557 Update output to include comments now produced by --graph.
558 (xsl:template match="automaton"): As for --graph, name the
559 digraph after the grammar file.
560 * src/print-xml.c (escape_bufs): Enlarge array.
561 (print_xml): Add bug-report and url attributes to
562 bison-xml-report element.
563
ad6f84e5
JD
5642010-05-01 Joel E. Denny <joeldenny@joeldenny.org>
565
566 In DOT output, convert from "/*" comments to "//" comments.
567 This handles the possibility that a "*/" might appear in
568 variable portions of those comments at some point in the future.
569 * src/graphviz.c (start_graph): Implement.
570
43fdc9fd
JD
5712010-04-30 Joel E. Denny <joeldenny@joeldenny.org>
572
573 Document that undefined %prec identifier warnings will remain.
574 * NEWS (2.4.3): Here.
575 (2.4.2): Here.
576
e02df72c
JD
5772010-04-30 Joel E. Denny <joeldenny@joeldenny.org>
578
579 Revert 2009-12-30 change for undefined %prec token complaints.
580 That is, keep them as warnings because that should be sufficient
581 to satisfy POSIX without creating backward compatibility issues.
582 Suggested by Richard Stallman at
583 <http://lists.gnu.org/archive/html/bison-patches/2010-03/msg00033.html>.
584 * NEWS (2.5): Remove mention of complaint.
21279295
JD
585 * src/reader.c (grammar_rule_check): Convert complaint back to
586 warning.
e02df72c
JD
587 * tests/input.at (%prec's token must be defined): Update.
588
ba3063f6
JD
5892010-04-25 Joel E. Denny <joeldenny@joeldenny.org>
590
591 build: don't require src/bison during bootstrap.
592 Suggested by Eric Blake at
593 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00003.html>.
594 * bootstrap.conf (bootstrap_epilogue): New function to make sure
595 src/parse-gram.[ch] are stamped later than src/parse-gram.y.
596
e0fda26c
JD
5972010-04-25 Joel E. Denny <joeldenny@joeldenny.org>
598
599 i18n: fix untranslatable string.
600 Reported by Goran Uddeborg at
601 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00000.html>.
602 * src/muscle-tab.c (muscle_percent_define_insert): Here.
603
ecbca7db
AD
6042010-04-13 Akim Demaille <demaille@gostai.com>
605
606 tests: calc: minor refactoring.
607 * tests/calc.at (_AT_DATA_CALC_Y): Simplify yylex.
608
ed228e60
AD
6092010-04-13 Akim Demaille <demaille@gostai.com>
610
611 tests: calc: simplify location management.
612 * tests/local.at (AT_LOC_PUSHDEF, AT_LOC_POPDEF): New.
613 (_AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS): Use them to
614 define the appropriate AT_LOC accessors.
615 * tests/calc.at: Use AT_LOC accessors.
616
cacfdef7
AD
6172010-04-13 Akim Demaille <demaille@gostai.com>
618
619 test location_type.
620 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS):
621 Define AT_LOCATION_TYPE_IF.
622 (_AT_BISON_OPTION_POPDEFS): Undefine AT_LOCATION_TYPE_IF.
623 * tests/calc.at (_AT_DATA_CALC_Y): When %define location_type is
624 used, provide a user location type and use it.
625 (Simple LALR1 C++ Calculator): Add a test case for location_type.
626
2f61c4a2
AD
6272010-04-13 Akim Demaille <demaille@gostai.com>
628
629 tests: check fclose's return value.
630 * tests/calc.at (_AT_DATA_CALC_Y): Check fclose's return status.
631
16d9244d
AD
6322010-04-13 Akim Demaille <demaille@gostai.com>
633
634 tests: don't depend on the actual location type.
635 * tests/calc.at: Use yy::parser::location_type rather than
636 yy::location, since the former is always right, and might point to
637 another type than the latter.
638
3e4a253b
AD
6392010-04-13 Akim Demaille <demaille@gostai.com>
640
641 formatting changes.
642 * tests/calc.at: Formatting changes.
643
df5df58d
AD
6442010-04-13 Akim Demaille <demaille@gostai.com>
645
646 lalr1.cc: remove useless forward declaration.
647 * data/lalr1.cc: Include location.hh before stack.hh.
648 Remove the useless forward declarations of position and location.
649 Reported by Chris Morley.
650 * data/glr.cc: Likewise.
651
88bb35d6
JD
6522010-04-11 Joel E. Denny <joeldenny@joeldenny.org>
653
654 * NEWS (2.4.3): Mention fix for Sun Studio C++.
655
585ef2eb
JD
6562010-04-10 Joel E. Denny <joeldenny@joeldenny.org>
657
658 tests: fix for newer Sun Studio C++.
659 Reported by Dagobert Michelsen at
660 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00023.html>.
661 * THANKS (Dagobert Michelsen): Add.
662 * configure.ac (AC_PREREQ): Set to 2.64 so we get the latest
663 Autoconf macro for handling the restrict keyword.
664 * gnulib: Update to latest, which no longer overrides that macro
665 from Autoconf.
666
a005dbcb
JD
6672010-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
668
669 portability: fix pointer arithmetic to conform to C standard.
670 Reported by Tys Lefering at
671 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00035.html>.
672 This fix is already implemented in glr.c and does not apply to
673 lalr1.java.
674 * data/lalr1.cc (yy::parser::parse): Increase size of
675 yyerror_range and adjust subscripting so you don't have to
676 subtract one from the beginning of the array.
677 * data/yacc.c (b4_declare_parser_state_variables,
678 yyparse, yypush_parse): Likewise.
679
8a8b33e8
AD
6802010-04-05 Akim Demaille <demaille@gostai.com>
681
682 remove useless include.
683 * src/graphviz.h: Don't include stdbool.h.
684
a0279765
AD
6852010-04-05 Akim Demaille <demaille@gostai.com>
686
687 graph: sign the output file.
688 * src/graphviz.c (start_graph): Issue comments about Bison.
689 Suggested by Tys Lefering.
690
132247cd
JD
6912010-03-31 Joel E. Denny <jdenny@ces.clemson.edu>
692
693 portability: fix test suite for GCC 4.5's new #error message.
694 Reported by Tys Lefering at
695 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00030.html>.
696 * NEWS (2.4.3): Mention.
697 * tests/synclines.at (AT_TEST_SYNCLINE): Implement.
698
c0259969
AD
6992010-03-30 Akim Demaille <demaille@gostai.com>
700
701 fix comments.
702 * src/graphviz.h: Add missing license notice.
703 Document.
704
23761f42
AD
7052010-03-25 Akim Demaille <demaille@gostai.com>
706
707 tests: fix 250: parse.error=verbose overflow.
708 * tests/regression.at (parse.error=verbose overflow): Avoid the
709 double inclusion of stdlib.h as it triggers hard errors.
710
9097fda0
JD
7112010-03-23 Joel E. Denny <jdenny@ces.clemson.edu>
712
713 portability: fix for BSD make.
714 Reported by Johan van Selst at
715 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00016.html>.
716 * tests/Makefile.am ($(TESTSUITE)): Qualify package.m4 in
717 this dependency list as in package.m4's target rule.
718
7a9c3cb3
JD
7192010-03-23 Joel E. Denny <jdenny@ces.clemson.edu>
720
721 portability: fix spawning on at least FreeBSD 8 and FreeBSD 9.
722 Reported by Johan van Selst at
723 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00014.html>.
724 * NEWS (2.4.3): New.
725 * THANKS (Johan van Selst): Add.
726 * gnulib: Update to latest.
727
5a3c69f1
JD
7282010-03-20 Joel E. Denny <jdenny@ces.clemson.edu>
729
730 maint: update for changes to gnulib's announce-gen.
731 * HACKING (Announce): RELEASE_TYPE=major must now be written
732 RELEASE_TYPE=stable.
733
ea66d039
JD
7342010-03-20 Joel E. Denny <jdenny@ces.clemson.edu>
735
736 Version 2.4.2.
737 * NEWS (2.4.2): Set version and date. For the recent test suite
738 portability fixes, don't be so optimistic about their success
739 given the lack of feedback on the affected platforms.
740
c50befe6
JD
7412010-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
742
743 tests: fix maintainer-xml-check for recent changes.
744 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Use
745 AT_BISON_CHECK_NO_XML rather than AT_BISON_CHECK because an
746 output file whose name conflicts with a previous output file
747 is now never generated.
748
47fa5747
JD
7492010-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
750
751 portability: fix several issues with M4 subprocess.
752
753 M4's output pipe was not being drained upon fatal errors during
754 scan_skel. As a result, broken-pipe messages from M4 were seen
755 on at least AIX, HP-UX, Solaris, and RHEL4, and this caused a
756 failure in the test suite. The problem was that, on platforms
757 where the default disposition for SIGPIPE is ignore instead of
758 terminate, M4 sometimes saw fwrite fail with errno=EPIPE and
759 then reported it. However, there's some sort of race condition,
760 because the new test group occasionally succeeded.
761 Reported by Albert Chin at
762 <http://lists.gnu.org/archive/html/bug-bison/2010-02/msg00004.html>.
763
764 There were also problems with the test suite livelocking on
765 Tru64 5.1b. Reported by Didier Godefroy at
766 <http://lists.gnu.org/archive/html/bug-bison/2009-05/msg00005.html>.
767 Switching to create_pipe_bidi suggested by Akim Demaille.
768
769 To attempt to solve both of these problems, switch to gnulib's
770 create_pipe_bidi and register M4 process as a slave. Along the
771 way, clean up file name conflict handling, which was affected by
772 the broken-pipe problem before the switch.
773 * NEWS (2.4.2): Document.
774 * THANKS (Didier Godefroy): Add.
775 * bootstrap.conf (gnulib_modules): Add pipe.
776 * gnulib: Update to latest to make sure we have all the latest
777 fixes.
778 * lib/Makefile.am (libbison_a_SOURCES): Remove subpipe.h and
779 subpipe.c.
780 * po/POTFILES.in (lib/subpipe.c): Remove.
781 * src/files.c (compute_output_file_names): Update invocations
782 of output_file_name_check.
783 (output_file_name_check): In the case that the grammar file
784 would be overwritten, use complain instead of fatal, but replace
785 the output file name with /dev/null. Use the /dev/null solution
786 for the case of two conflicting output files as well because it
787 seems safer in case Bison one day tries to open both files at
788 the same time.
789 * src/files.h (output_file_name_check): Update prototype.
790 * src/output.c (output_skeleton): Use create_pipe_bidi and
791 wait_subprocess. Assert that scan_skel completely drains the
792 pipe.
793 * src/scan-skel.l (at_directive_perform): Update
794 output_file_name_check invocation.
795 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Check that the
796 grammar file actually isn't overwritten.
797 (Conflicting output files: -o foo.y): Update expected output.
798 * tests/skeletons.at (Fatal errors but M4 continues producing
799 output): New test group.
800
d67e37a7
JD
8012010-02-04 Joel E. Denny <jdenny@ces.clemson.edu>
802
803 Update POTFILES.
804 * HACKING (Release Procedure): Add reminder about keeping
805 POTFILES files up-to-date.
806 * po/POTFILES.in (src/muscle-tab.c, src/scan-skel.l): Add.
807
0ee1af2e
JD
8082010-02-01 Joel E. Denny <jdenny@clemson.edu>
809
810 Code cleanup.
811 * tests/atlocal.in (abs_top_srcdir): Remove shell variable,
812 which is already defined in atconfig.
813
2655c7cd
JD
8142010-01-21 Joel E. Denny <jdenny@clemson.edu>
815
816 * cfg.mk (gnulib_dir): Assume gnulib is a subdirectory.
817
8ebc7dca
JD
8182010-01-21 Joel E. Denny <jdenny@clemson.edu>
819
820 maint: automate PACKAGE_COPYRIGHT_YEAR update, and update it.
821 * HACKING (Release Procedure): Update notes on copyright years.
822 * Makefile.am (update-package-copyright-year): New target rule.
823 * build-aux/update-package-copyright-year: New file.
824 * cfg.mk (update-copyright): Add update-package-copyright-year
825 as a dependency.
826
f0a43dd1
JD
8272010-01-19 Joel E. Denny <jdenny@clemson.edu>
828
829 * bootstrap: Import improvements from latest gnulib.
830
e4ca7a85
JD
8312010-01-19 Joel E. Denny <jdenny@clemson.edu>
832
833 build: require Automake 1.11.1 to avoid a security flaw.
834 * HACKING (Release Procedure): Don't document Automake security
835 flaw here.
836 * configure.ac (AM_INIT_AUTOMAKE): Require 1.11.1, and explain
837 why here.
838
8d830047
JD
8392010-01-19 Joel E. Denny <jdenny@clemson.edu>
840
841 gnulib: update to latest.
842
e5926647
JD
8432010-01-19 Joel E. Denny <jdenny@clemson.edu>
844
845 ChangeLog (2006-09-15): add Odd Arild Olsen's role for push.c.
846
5a2f6eb4
JD
8472010-01-15 Joel E. Denny <jdenny@clemson.edu>
848
849 Thank the developer of the initial push parser implementation.
850 This unfortunate oversight is several years old.
851 * THANKS (Odd Arild Olsen): Add.
852
1c4ad777
JD
8532010-01-04 Joel E. Denny <jdenny@clemson.edu>
854
855 Fix some comments concerning LR(0) versus LALR(1).
856
857 Stop equating LR(0) with nondeterminism and LALR(1) with
858 determinism. That is, if all states are consistent, then LR(0)
859 tables are deterministic. On the other hand, LALR(1) tables
860 might be nondeterministic before conflict resolution, and GLR
861 permits LALR(1) tables to remain nondeterministic.
862 * src/LR0.c, src/LR0.h: Here.
863 * src/lalr.c, src/lalr.h: Here.
864 * src/main.c (main): Here.
865 * src/state.c, src/state.h: Here.
866
867 * src/ielr.h (ielr): In preconditions, expect LR(0) not LALR(1)
868 parser tables.
869
1462fcee
JD
8702010-01-04 Joel E. Denny <jdenny@clemson.edu>
871
872 maint: run "make update-copyright"
873
510df951
JD
8742009-12-30 Joel E. Denny <jdenny@clemson.edu>
875
876 POSIX: complain if %prec's token was not defined.
877 * NEWS (2.5): Document.
878 * src/reader.c (grammar_rule_check): Convert warning to
879 complaint.
880 * tests/input.at (%prec's token must be defined): Update.
881
2c203528
JD
8822009-12-30 Joel E. Denny <jdenny@clemson.edu>
883
884 POSIX: warn if %prec's token was not defined.
885 Reported by Florian Krohm at
886 <http://lists.gnu.org/archive/html/bug-bison/2009-12/msg00005.html>.
887 * NEWS (2.4.2): Document.
888 * src/reader.c (grammar_rule_check): Implement.
889 (grammar_current_rule_prec_set): Add comments explaining that we
890 here assume a %prec identifier is a token, but we still manage
891 to support POSIX.
892 * tests/input.at (%prec's token must be defined): New test
893 group.
894
a93cdd3d
JD
8952009-12-31 Joel E. Denny <jdenny@clemson.edu>
896
897 * HACKING (Release Procedure): Recommend a secure automake.
898
bb57985c
AD
8992008-12-11 Akim Demaille <demaille@gostai.com>
900
901 Propagate i18n changes into glr.c.
902 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
903 building the error message format dynamically.
904 * data/lalr1.java: Formatting changes.
905
70afaf26
JD
9062009-12-22 Joel E. Denny <jdenny@clemson.edu>
907
908 Port small part of master's 11707b2b so future ports are easier.
909 * data/lalr1.java (YYParser::yysyntax_error): Untabify.
910
8200219a
AD
9112008-12-11 Akim Demaille <demaille@gostai.com>
912
913 Simplify the i18n of the error messages.
914 * data/lalr1.cc: Comment changes.
915
39f6a8d1
AD
9162008-11-11 Akim Demaille <demaille@gostai.com>
917
918 Prefer M4 to CPP.
919 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
920 YYERROR_VERBOSE.
921
e657f369
AD
9222008-11-11 Akim Demaille <demaille@gostai.com>
923
924 Support i18n of the parse error messages.
925 * TODO (lalr1.cc/I18n): Remove.
926 * data/lalr1.cc (yysyntax_error_): Support the translation of the
927 error messages, as done in yacc.c.
928 Stay within the yy* pseudo namespace.
929
1e05521d
JD
9302009-12-22 Joel E. Denny <jdenny@clemson.edu>
931
932 Port small part of master's 8901f32e so future ports are easier.
933 * data/lalr1.cc (yy::parser::yysyntax_error_): Always add second
934 argument, but name it in the function definition only when
935 verbose error messages are enabled and it'll thus be used.
936 (yy::parser::parse): Update use of yysyntax_error_.
937
2728ac7e
JD
9382009-12-29 Joel E. Denny <jdenny@clemson.edu>
939
940 portability: `<' and `>' are not always defined on addresses.
941 Specifically, don't sort objects by their memory addresses when
942 they're not allocated in the same array or other object. Though
943 I haven't found a test case where that fails on my platform, C
944 says the behavior is undefined.
945 * src/AnnotationList.c (AnnotationList__insertInto): Remove
946 FIXME. Use new id field of InadequacyList nodes rather than
947 their memory addresses when sorting.
948 (AnnotationList__compute_from_inadequacies): Add
949 inadequacy_list_node_count argument to pass to
950 InadequacyList__new_conflict.
951 * src/AnnotationList.h
952 (AnnotationList__compute_from_inadequacies): Update prototype
953 and documentation for new argument.
954 * src/InadequacyList.c (InadequacyList__new_conflict): Add
955 node_count argument and use it to assign a unique ID.
956 * src/InadequacyList.h (InadequacyListNodeCount): New typedef.
957 (InadequacyList): Add id field.
958 (InadequacyList__new_conflict): Update prototype and
959 documentation for new argument.
960 * src/ielr.c (ielr_compute_annotation_lists): Update
961 AnnotationList__compute_from_inadequacies invocation.
962
abcc7c03
JD
9632009-12-20 Joel E. Denny <jdenny@clemson.edu>
964
965 Fix handling of yychar manipulation in user semantic actions.
966 The problem was that yacc.c didn't always update the yychar
967 translation afterwards. However, other skeletons appear to be
968 fine. glr.c appears to already translate yychar before every
969 use. lalr1.cc does not define yychar and does not document its
970 replacement, yyla, for users. It does provide yyclearin, but
971 that does not manipulate yyla and thus requires no translation
972 update. In lalr1.java, yychar is out of scope during semantic
973 actions.
974 * NEWS (2.5): Document.
975 * data/yacc.c (YYBACKUP): Don't bother translating yychar into
976 yytoken here.
977 (yyparse, yypush_parse): Instead, translate before every use of
978 yytoken, and add comments explaining this approach.
979 * tests/actions.at (Destroying lookahead assigned by semantic
980 action): New test group checking that translation happens before
981 lookahead destructor calls at parser return. Previously,
982 incorrect destructors were called.
983 * tests/conflicts.at (%error-verbose and consistent
984 errors): New test group checking that translation happens at
985 syntax error detection before the associated verbose error
986 message and the associated lookahead destructor calls. While
987 the destructor call is fixed by this patch, the verbose error
988 message is currently incorrect due to another bug (see
989 comments in test group), so this is an expected failure for now.
990
62efdd2a
JD
9912009-12-21 Joel E. Denny <jdenny@clemson.edu>
992
993 YYFAIL: warn about uses and remove from lalr1.java.
994 * NEWS (2.5): Document.
5f1485d8 995 * data/lalr1.java (YYParser::YYFAIL): Rename to YYERRLAB,
62efdd2a
JD
996 and make it private. Update all uses.
997 * src/scan-code.l (SC_RULE_ACTION): Implement warning.
998
41d35e54
JD
9992009-12-21 Joel E. Denny <jdenny@clemson.edu>
1000
1001 YYFAIL: deprecate.
1002 * NEWS (2.4.2): Document deprecation and the phase-out plan.
5f1485d8 1003 * data/lalr1.java (YYParser::YYFAIL): Add comment about
41d35e54
JD
1004 deprecation.
1005 * data/yacc.c (YYFAIL): Likewise, and suppress warnings about
1006 YYFAIL from GCC cpp's -Wunused-macros.
1007 * doc/bison.texinfo (Java Action Features): Remove YYFAIL
1008 documentation.
1009 (LocalWords): Remove YYFAIL.
1010
692d04cb
JD
10112009-12-17 Joel E. Denny <jdenny@clemson.edu>
1012
1013 Code cleanup.
1014 * src/symtab.c, src/symtab.h (symbol_class_get_string): Remove
1015 function, which is no longer used.
1016
34731471
JD
10172009-12-16 Joel E. Denny <jdenny@clemson.edu>
1018
1019 Add gcc's -Wundef to test suite and fix another warning from it.
1020 * NEWS (2.4.2): Update description of -Wundef fix.
1021 * configure.ac (WARN_CXXFLAGS_TEST): New substitution.
1022 (WARN_CFLAGS_TEST): New substitution.
1023 * data/glr.c: Avoid warning about __STRICT_ANSI__.
1024 * tests/atlocal.in (CFLAGS): Use WARN_CFLAGS_TEST instead of
1025 WARN_CFLAGS.
1026 (NO_WERROR_CFLAGS): Likewise.
1027 (CXXFLAGS): Use WARN_CXXFLAGS_TEST instead of WARN_CXXFLAGS.
1028
3bba2dad
JD
10292009-12-16 Joel E. Denny <jdenny@clemson.edu>
1030
1031 * data/yacc.c: Reformat m4 a little.
1032
af2ffe5c
JD
10332009-12-16 Joel E. Denny <jdenny@clemson.edu>
1034
1035 Document gcc -Wundef fix.
1036 * NEWS (2.4.2): Here.
1037 * THANKS (Jonathan Nieder): Add.
1038
874ac415
JN
10392009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
1040
1041 Simplify y.tab.c when location tracking is disabled.
1042 * data/yacc.c: Do not check YYLTYPE_IS_TRIVIAL if location
1043 tracking is not enabled. Instead, unconditionally define
1044 YY_LOCATION_PRINT as a no-op for backward compatibility.
1045
06caf0e1
JN
10462009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
1047
1048 Avoid warnings from gcc -Wundef y.tab.c.
1049 * data/glr.c: Check if YYENABLE_NLS and YYLTYPE_IS_TRIVIAL are
1050 defined before using them.
1051 * data/lalr1.cc: Likewise.
1052 * data/yacc.c: Likewise.
1053
687f011a
JD
10542009-12-15 Joel E. Denny <jdenny@clemson.edu>
1055
1056 autoconf: update to latest for fix of M4 detection.
1057 Reported by Eric Blake.
1058 * submodules/autoconf: Update.
1059
fb9a3976
JD
10602009-12-15 Joel E. Denny <jdenny@clemson.edu>
1061
1062 portability: use -DGNULIB_POSIXCHECK.
1063 Reported by Eric Blake. See discussions at
1064 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00008.html>
1065 and
1066 <http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00108.html>.
1067 * HACKING (Release checks): Suggest -DGNULIB_POSIXCHECK.
1068 * bootstrap.conf (gnulib_modules): Add all the printf modules
1069 suggested by -DGNULIB_POSIXCHECK. Add realloc-posix as
1070 suggested by -DGNULIB_POSIXCHECK for gnulib's own vasnprintf.c.
1071 (excluded_files): Remove m4/printf-posix.m4.
1072 * tests/atlocal.in (LIBS): As for LDADD in src/local.mk, add
1073 lib/libbison.a so gnulib libraries can be linked.
1074
f1fb412c
JD
10752009-12-14 Joel E. Denny <jdenny@clemson.edu>
1076
1077 Enable assertion output and --disable-assert for configure.
1078 * bootstrap.conf (gnulib_modules): Add assert module.
1079 * src/system.h (aver): Define as assert, and summarize the
1080 discussion on this issue.
1081
51c7ca01
JD
10822009-12-14 Joel E. Denny <jdenny@clemson.edu>
1083
1084 Expand GLR acronym in summary of Bison.
1085 Based on discussion with Akim Demaille starting at
1086 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00087.html>.
1087 * doc/bison.texinfo (Introduction): Here.
1088 * src/getargs.c (usage): Here.
1089
1f68dca5
AR
10902009-10-03 Alex Rozenman <rozenman@gmail.com>
1091
1092 Document named references.
1093 * doc/bison.texinfo (Actions): Add new example and xref to
1094 Using Named References node.
1095 (Using Named References): New node.
1096
aa01d193
JD
10972009-10-16 Joel E. Denny <jdenny@clemson.edu>
1098
1099 cleanup.
1100 * src/Sbitset.c (Sbitset__new_on_obstack): Use Sbitset instead
1101 of char*.
1102 (Sbitset__isEmpty): Use Sbitset instead of char*.
1103 * src/Sbitset.h (Sbitset): Make it a pointer to unsigned char
1104 instead of char. This helps to avoid casting errors.
1105 (Sbitset__or): Use Sbitset instead of char*.
1106
61747047
JD
11072009-10-16 Joel E. Denny <jdenny@clemson.edu>
1108
1109 portability: don't assume 8-bit bytes.
1110 That is, use CHAR_BIT and UCHAR_MAX instead of 8 and 0xff.
1111 * src/Sbitset.h (Sbitset__nbytes): Here.
1112 (Sbitset__byteAddress): Here.
1113 (Sbitset__bit_mask): Here.
1114 (Sbitset__last_byte_mask): Here.
1115 (Sbitset__ones): Here.
1116 (SBITSET__FOR_EACH): Here.
1117
a70596de
JD
11182009-10-11 Joel E. Denny <jdenny@clemson.edu>
1119
1120 portability: use va_start and va_end in the same function.
1121 * src/complain.c (error_message): Move va_end from here...
1122 (ERROR_MESSAGE): ... to here.
1123
51f255a5
JD
11242009-10-08 Joel E. Denny <jdenny@clemson.edu>
1125
1126 * data/bison.m4: Update comments for rename to muscle-tab.h.
1127
23ec25b7
JD
11282009-10-08 Joel E. Denny <jdenny@clemson.edu>
1129
1130 Rename muscle_tab.* to muscle-tab.* for consistency with master.
1131 * src/Makefile.am (bison_SOURCES): Update.
1132 * src/getargs.c, src/ielr.c, src/lalr.c, src/main.c,
1133 src/output.c, src/parse-gram.y, src/print.c, src/reader.c,
1134 src/tables.c: Update include.
1135 * src/muscle_tab.c, src/muscle_tab.h: Rename to...
1136 * src/muscle-tab.c, src/muscle-tab.h: ... these and update
1137 include.
1138
0ab402b4
JD
11392009-10-07 Joel E. Denny <jdenny@clemson.edu>
1140
1141 Minor code cleanup.
1142 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT): Remove macro and
1143 replace all uses with UNIQSTR_CONCAT.
1144 * src/uniqstr.c (uniqstr_vsprintf): New function.
1145 * src/uniqstr.h (uniqstr_vsprintf): Add prototype.
1146 (UNIQSTR_CONCAT, UNIQSTR_GEN_FORMAT, UNIQSTR_GEN_FORMAT_): New
1147 macros.
1148
42ec0ae1
JD
11492009-10-04 Joel E. Denny <jdenny@clemson.edu>
1150
1151 Minor code cleanup.
1152 * src/parse-gram.y: Clean up sorting of declarations.
1153 Use types to simplify %printer declarations where possible.
1154 Provide %printer for BRACKETED_ID and symbol.prec.
1155 * src/symtab.c: Whitespace change.
1156
9637e0ed
JD
11572009-10-04 Joel E. Denny <jdenny@clemson.edu>
1158
1159 tests: skip tests of file names that platform does not support.
1160 Reported by Michael Raskin at
1161 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00001.html>.
1162 * THANKS (Michael Raskin): Add.
1163 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Fix. Cygwin used
1164 to fail at least for file names containing ":" or "\".
1165
69a2ab11
JD
11662009-09-23 Joel E. Denny <jdenny@clemson.edu>
1167
1168 yysyntax_error: avoid duplicate lookahead collection.
1169 Except when memory reallocation is required, this change
1170 eliminates the need to invoke yysyntax_error twice and thus to
1171 repeat the collection of lookaheads. It also prepares for
1172 future extensions that will make those repetitions more
1173 expensive and that will require additional memory management in
1174 yysyntax_error. Finally, it fixes an obscure bug already
1175 exercised in the test suite.
1176 * data/yacc.c (yysyntax_error): Add arguments for message
1177 buffer variables stored in the parser. Instead of size, return
1178 status similar to yyparse status but indicating success of
1179 message creation. Other than the actual reallocation of the
1180 message buffer, import and clean up memory management code
1181 from...
1182 (yyparse, yypush_parse): ... here.
1183 * tests/regression.at (%error-verbose overflow): No longer an
1184 expected failure.
1185
d88cf117
JD
11862009-09-23 Joel E. Denny <jdenny@clemson.edu>
1187
1188 yysyntax_error: test memory management more.
1189 * tests/atlocal.in (NO_WERROR_CFLAGS): New cpp macro.
1190 * tests/regression.at (%error-verbose and YYSTACK_USE_ALLOCA):
1191 New test group.
1192 (%error-verbose overflow): New test group that reveals an
1193 obscure bug. Expected fail for now.
1194
9da640ea
AD
11952008-12-11 Akim Demaille <demaille@gostai.com>
1196
1197 Pass the token type to yysyntax_error.
1198 * data/yacc.c (yysyntax_error): Take the transated token instead
1199 of the raw number.
1200 Adjust callers.
1201
d3d3628b
AD
12022008-12-11 Akim Demaille <demaille@gostai.com>
1203
1204 Simplify the i18n of the error messages.
1205 * data/yacc.c (yysyntax_error): Rewrite, using a switch instead
1206 of building dynamically the format string.
1207
4c6b13f3
JD
12082009-10-03 Joel E. Denny <jdenny@clemson.edu>
1209
1210 Remove dead code.
1211 * src/symtab.c (symbol_pack): Here because every symbol's number
1212 is always defined by this time.
1213
f840c05a
AR
12142009-10-03 Alex Rozenman <rozenman@gmail.com>
1215
1216 Add additional space after periods in NEWS.
1217 * NEWS (2.5): here.
1218
17a407dc
JD
12192009-09-29 Joel E. Denny <jdenny@clemson.edu>
1220
1221 Use the correct conversion specifier for size_t.
1222 Reported by Jim Meyering.
1223 * src/Sbitset.h (SBITSET__INDEX__CONVERSION_SPEC): New, "zu"
1224 because Sbitset__Index is size_t.
1225 * src/Sbitset.c (Sbitset__fprint): Use it instead of %d.
1226
4b7a4c1b
JD
12272009-09-27 Joel E. Denny <jdenny@clemson.edu>
1228
1229 tests: don't abuse AT_BISON_CHECK.
1230 * tests/regression.at (parse-gram.y: LALR = IELR): Move
1231 additional shell commands outside of AT_BISON_CHECK.
1232
873ac263
JD
12332009-09-26 Joel E. Denny <jdenny@clemson.edu>
1234
1235 tests: check that parse-gram.y's IELR and LALR are identical.
1236 * tests/atlocal.in (abs_top_srcdir): New shell variable.
1237 * tests/regression.at (parse-gram.y: LALR = IELR): New test
1238 group.
1239
232be91a
AD
12402009-09-16 Akim Demaille <demaille@gostai.com>
1241
1242 doc: comment changes.
1243 * doc/bison.texinfo: Comment changes.
1244
c781580d
AD
12452009-09-16 Akim Demaille <demaille@gostai.com>
1246
1247 doc: spell checking.
1248 * doc/bison.texinfo: here.
1249
348f5608
AR
12502009-09-19 Alex Rozenman <rozenman@gmail.com>
1251
1252 Keep sub-messages aligned. Fix strings for translation.
f840c05a
AR
1253 * src/location.h (location_print): Add return value.
1254 * src/location.c (location_print): Return number of printed
348f5608 1255 characters.
f840c05a
AR
1256 * src/complain.h (complain_at_indent, warn_at_indent): Prototype
1257 new functions.
1258 * src/complain.cpp (indent_ptr): New static variable.
1259 (error_message, complain_at_indent, warn_at_indent): Implement
1260 the alignment mechanism.
1261 * src/scan-code.l (parse_ref, show_sub_messages): Fix strings
1262 for translations. Use new alignment mechanism.
1263 * tests/named-ref.at: Adjust test-cases.
348f5608
AR
1264 * NEWS (2.5): Add an announcement about named references.
1265
d93b5f50
JD
12662009-09-13 Joel E. Denny <jdenny@clemson.edu>
1267
1268 tests: clean up push.at test group titles.
1269 * tests/push.at: Remove "Push Parsing: " from test group titles
1270 because these are already under the banner "Push Parsing Tests".
1271
4c56b131
AR
12722009-09-12 Alex Rozenman <rozenman@gmail.com>
1273
1274 Provide an additional sub-message for clarity.
1275 Add "symbol not found in production" error message when
1276 an "invalid reference" is detected in named references
1277 resolution.
1278 * src/scan-code.l: Update "invalid reference" case.
1279 * tests/named-ref.at: Adjust test-cases.
1280
93d0103d
JD
12812009-09-10 Joel E. Denny <jdenny@clemson.edu>
1282
1283 Clean up yacc.c a little.
1284 * data/yacc.c: Clean up M4 for readability, and make output
1285 whitespace more consistent. For the main parse function
1286 comment, instead of saying "yyparse or yypush_parse", say either
1287 "yyparse" or "yypush_parse" depending on which it actually is.
1288
628be6c9
JD
12892009-09-03 Joel E. Denny <jdenny@clemson.edu>
1290
1291 Complain about unused %define variables and %code qualifiers.
1292 * NEWS (2.5): Document.
1293 * data/bison.m4 (b4_check_user_names): Complain instead of warn.
1294 * doc/bison.texinfo (Decl Summary): Document complaint, and
1295 improve %define documentation a little otherwise.
1296 * tests/input.at (Reject unused %code qualifiers): Update.
1297 (%define errors): Update.
1298 (%define, --define, --force-define): Update.
1299 (%define backward compatibility): Update.
1300 (Unused %define api.pure): Update.
1301 * tests/push.at (Push Parsing: Unsupported Skeletons): Update.
1302
c842365a
JD
13032009-09-03 Joel E. Denny <jdenny@clemson.edu>
1304
1305 Use aver not assert.
1306 * src/output.c: Don't include assert.h.
1307 (output_skeleton): Use aver not assert.
1308 * src/system.h (aver): In documentation of why, add links to
1309 Paul Eggert's explanations in the mailing lists.
1310
14e568d7
AR
13112009-09-05 Alex Rozenman <rozenman@gmail.com>
1312
1313 Use "Unresolved reference" error message when no symbols were found
1314 in a symbolic reference resolution. Remove .expr and -expr from
1315 the shown reference when the reference is unresolved.
1316 * src/scan-code.l: Change the error message, adjust location columns,
1317 rename variable "exact_mode" to "explicit_bracketing".
1318 * tests/named-ref.at: Adjust existing tests and add a new one.
1319
dac8cc0d
AD
13202009-09-03 Akim Demaille <demaille@gostai.com>
1321
1322 * NEWS (2.4.2): Add "Internationalization" item.
1323
3710dd02
AD
13242009-09-03 Akim Demaille <demaille@gostai.com>
1325
1326 bootstrap: fix/improve find_tool.
1327 * bootstrap (find_tool): Improve error messages.
1328 Fix typo about find_tool_names.
1329
9852b61c
JD
13302009-08-29 Joel E. Denny <jdenny@clemson.edu>
1331
1332 Fix gcc 3.4.4 shadowing warning reported by Eric Blake.
1333 See
1334 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00093.html>.
1335 * src/scan-code.h (code_props_rule_action_init): Rename
1336 named_ref arg to name so it doesn't shadow named_ref type. This
1337 makes it consistent with the function definition in scan-code.l
1338 anyway.
1339
f37495f6
JD
13402009-08-28 Joel E. Denny <jdenny@clemson.edu>
1341
1342 %define: accept unquoted values.
1343 * NEWS (2.5): Group all %define changes together, and document
1344 this one. Remove quotes in IELR and canonical LR entry.
1345 * doc/bison.texinfo: Remove quotes in most examples throughout.
1346 (Decl Summary): Update %define documentation.
1347 (Table of Symbols): Likewise.
1348 * src/ielr.c (LrType): Update documentation.
1349 * src/parse-gram.y (content.opt): Add production for ID.
5bf2bf7a 1350 * tests/calc.at: Remove quotes in most tests.
f37495f6
JD
1351 * tests/existing.at: Likewise.
1352 * tests/input.at: Likewise.
1353 * tests/local.at: Likewise.
1354 * tests/push.at: Likewise.
1355 * tests/reduce.at: Likewise.
1356 * tests/torture.at: Likewise.
1357
3a414bbf
JD
13582009-08-28 Joel E. Denny <jdenny@clemson.edu>
1359
1360 %define lr.type: make values lowercase IDs.
1361 That is, "LALR" => "lalr", "IELR" => "ielr", and
1362 "canonical LR" => "canonical-lr".
1363 * NEWS (2.5): Update documentation.
1364 * doc/bison.texinfo (Decl Summary): Likewise.
1365 * src/ielr.c (ielr): Use new values.
1366 * src/ielr.h (ielr): Update documentation.
1367 * src/reader.c (prepare_percent_define_front_end_variables): Use
1368 and validate new values.
1369 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): Update test
1370 grammars.
1371 * tests/reduce.at (AT_TEST_LR_TYPE): Likewise.
1372
4bb975e1
EB
13732009-08-27 Eric Blake <ebb9@byu.net>
1374
1375 scan-gram: avoid portability trap with ctype usage.
1376 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
1377 Avoid compiler warning.
1378
74baf5c9
JD
13792009-08-27 Joel E. Denny <jdenny@clemson.edu>
1380
1381 tests: use perl for printing special sequences to files.
1382 And skip tests if perl is not available. This is better than
1383 playing tricks with shell portability. Suggested by Akim
1384 Demaille.
1385 * tests/input.at (Bad character literals): Use it here for
1386 omitting final newlines.
1387 (Bad escapes in literals): Use it here for special characters.
1388
d63e1279
JD
13892009-08-26 Joel E. Denny <jdenny@clemson.edu>
1390
1391 tests: show a use of %define lr.default-reductions "consistent"
1392 * tests/conflicts.at (%nonassoc and eof): Extend to test that it
1393 prevents the omission of expected tokens for %error-verbose.
1394
833d1720
AD
13952009-08-26 Akim Demaille <demaille@gostai.com>
1396
1397 tests: portability fix.
1398 * tests/input.at (Bad escapes in literals): Don't expect "echo
1399 '\0'" to output \ then 0.
1400
e4bcae3c
JD
14012009-08-26 Joel E. Denny <jdenny@clemson.edu>
1402
1403 Actually handle the yytable zero value correctly this time.
1404 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c: Don't
1405 mention zero values in the YYTABLE comments.
1406 * data/glr.c (yytable_value_is_error): Don't check for zero
1407 value.
1408 * data/lalr1.cc (yy_table_value_is_error_): Likewise.
1409 * data/yacc.c (yytable_value_is_error): Likewise.
1410 * data/lalr1.java (yy_table_value_is_error_): Likewise.
1411 (yysyntax_error): Fix typo in code: use yytable_ not yycheck_.
1412 * src/tables.h: In header comments, explain why it's useless to
1413 check for a zero value in yytable.
1414
d5eb0826
JD
14152009-08-25 Joel E. Denny <jdenny@clemson.edu>
1416
1417 More fixes related to last two patches.
1418 * data/c.m4 (b4_table_value_equals): Comment that YYID must be
1419 defined.
1420 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c: Fix
1421 yytable comments: zero indicates syntax error not default
1422 action.
1423 * data/glr.c (yyis_pact_ninf): Rename to...
1424 (yypact_value_is_default): ... this.
1425 (yyisDefaultedState): Update for rename.
1426 (yyis_table_ninf): Rename to...
1427 (yytable_value_is_error): ... this, and check for value zero
1428 besides just YYTABLE_NINF.
1429 (yygetLRActions): Check for default value from yypact. It
1430 appears that this check is always performed before this function
1431 is invoked, and so adding the check here is probably redundant.
1432 However, the code may evolve after this subtlety is forgotten.
1433 Also, update for rename to yytable_value_is_error. Because that
1434 macro now checks for zero, a different but equivalent branch of
1435 the if-then-else here is evaluated.
1436 (yyreportSyntaxError): Update for rename to
1437 yytable_value_is_error. The zero condition was mishandled
1438 before.
1439 (yyrecoverSyntaxError): Update for renames. No behavioral
1440 changes.
1441 * data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_):
1442 New function.
1443 (yy_table_value_is_error_): New function.
1444 (parse): Use new functions where possible. No behavioral
1445 changes.
1446 (yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_.
1447 The zero condition was mishandled before.
1448 * data/yacc.c (yyis_pact_ninf): Rename to...
1449 (yypact_value_is_default): ... this.
1450 (yyis_table_ninf): Rename to...
1451 (yytable_value_is_error): ... this, and check for value zero
1452 besides just YYTABLE_NINF.
1453 (yysyntax_error): Update for rename to yytable_value_is_error.
1454 The zero condition was mishandled before.
1455 (yyparse): Update for renames. No behavioral changes.
1456 * src/tables.h: Improve comments about yypact, yytable, etc.
1457 more. Most importantly, say yytable value of zero means syntax
1458 error not default action.
1459
1fa30307
JD
14602009-08-25 Joel E. Denny <jdenny@clemson.edu>
1461
1462 Fix %error-verbose for conflicts resolved by %nonassoc.
1463 * NEWS (2.5): Document.
1464 * data/glr.c (yyreportSyntaxError): Fix this by checking
1465 yyis_table_ninf.
1466 * data/yacc.c (yysyntax_error): Likewise.
1467 * data/lalr1.cc (yysyntax_error_): Fix this by checking
1468 yytable_ninf_.
1469 * data/lalr1.java (yysyntax_error): Likewise.
1470 * tests/conflicts.at (%nonassoc and eof): Update expected output
1471 and remove FIXME.
1472
77373efa
JD
14732009-08-25 Joel E. Denny <jdenny@clemson.edu>
1474
1475 Some code and documentation improvements.
1476 * data/c.m4 (b4_table_value_equals): New macro to capture
1477 some repeated code.
1478 * data/glr.c (yyis_pact_ninf): Use it here.
1479 (yyis_table_ninf): Likewise.
1480 (yyreportSyntaxError): Improve internal comments.
1481 * data/yacc.c (yyis_pact_ninf): New macro copied from glr.c.
1482 Use it everywhere possible.
1483 (yyis_table_ninf): Likewise.
1484 (yysyntax_error): Improve internal comments.
1485 * data/lalr1.cc (yysyntax_error_): Likewise.
1486 * data/lalr1.java (yysyntax_error): Likewise.
1487 * src/tables.h: Improve comments about yypact, yytable, etc.
1488
890ab17c
JD
14892009-08-21 Joel E. Denny <jdenny@clemson.edu>
1490
1491 Use locale when quoting.
1492 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
1493 quote rather than implementing quoting here.
1494
c5196098
EB
14952009-08-20 Eric Blake <ebb9@byu.net>
1496
aa50ba7b
EB
1497 Make previous patch more robust.
1498 * src/output.c (ARRAY_CARDINALITY): New macro, copied from
1499 argmatch.h.
1500 (output_skeleton): Use it.
1501 Suggested by Akim Demaille.
1502
c5196098
EB
1503 Import latest m4/m4.m4.
1504 * submodules/autoconf: Update to autoconf 2.64.
1505 * configure.ac (M4_GNU_OPTION): New define.
1506 * src/output.c (output_skeleton): Use it to resolve FIXME.
1507 * NEWS: Mention this.
1508
39fb7e62
JD
15092009-08-19 Joel E. Denny <jdenny@clemson.edu>
1510
1511 Fix complaints about escape sequences.
1512 Discussed starting at
1513 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
1514 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
1515 For a \0 and similar escape sequences meaning the null
1516 character, report an invalid escape sequence instead of an
1517 invalid null character because the latter does not actually
1518 appear in the user's input.
1519 In all escape sequence complaints, don't escape the initial
1520 backslash, and don't quote when the sequence appears at the end
1521 of the complaint line unless there's whitespace that quotearg
1522 won't escape.
1523 Consistently say "invalid" not "unrecognized".
1524 Consistently prefer "empty character literal" over "extra
1525 characters in character literal" warning for invalid escape
1526 sequences; that is, consistently discard those sequences.
1527 * tests/input.at (Bad escapes in literals): New.
1528
c33bc800
AD
15292009-08-19 Akim Demaille <demaille@gostai.com>
1530
1531 doc: fixes.
1532 * doc/bison.texinfo: Fix minor Texinfo errors.
1533
8fbbeba2
AD
15342009-08-19 Akim Demaille <demaille@gostai.com>
1535
1536 doc: %initial-action to initialize yylloc.
1537 Reported by Bill Allombert.
1538 * doc/bison.texinfo: Set fill-column to 76.
1539 (Location Type): Document the use of %initial-action to initialize
1540 yylloc.
1541
1874a474
JD
15422009-08-18 Joel E. Denny <jdenny@clemson.edu>
1543
1544 maint: update for gnulib's recent update-copyright changes
1545 * gnulib: Update.
1546 * .x-update-copyright (COPYING): Add as it's no longer implied
1547 when .x-update-copyright is present.
1548 * cfg.mk (update-copyright-local): Remove, now ignored.
1549 (update-copyright): Declare update-b4-copyright as a dependency.
1550
f4bfd5a9
AD
15512009-08-17 Akim Demaille <demaille@gostai.com>
1552
1553 build: require gettext 0.17.
1554
1555 Suggested by Bruno Haible.
1556 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
1557 * configure.ac: require gettext 0.17 to ensure compatibility with
1558 gnulib.
1559
2509eba6
AD
15602009-08-17 Akim Demaille <demaille@gostai.com>
1561
1562 build: lower gettext requirements.
1563
1564 Bison was uselessly requiring the formatstring macros from
1565 gettext, which resulted in mo files not being installed on systems
1566 that perfectly supported Bison mo files. Lower the requirement.
1567 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
1568
aa50ba7b
EB
1569 * configure.ac: Require need-ngettext instead of
1570 need-formatstring-macros.
1571 Reported by Martin Jabocs.
1572 Suggested by Bruno Haible.
1573 * INSTALL: Restructure.
1574 (Internationalization): New.
2509eba6 1575
314542f9
JD
15762009-08-14 Joel E. Denny <jdenny@clemson.edu>
1577
1578 maint: fix use of copyright year intervals.
1579 * gnulib: Update.
1580 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
1581 as now recommended in gnulib/NEWS.
1582 * build-aux/update-b4-copyright: Fix.
1583 * cfg.mk (update-copyright-env): Configure update-copyright.
1584
24985964
JD
15852009-08-13 Joel E. Denny <jdenny@clemson.edu>
1586
1587 Make it easier to write deterministic tests.
1588 Continues Akim's work from his 2009-06-10 commits.
1589 * src/reader.c (check_and_convert_grammar): Don't add any
1590 symbols after the first symbols_do invocation.
1591 * src/symtab.c (symbols_sorted): New static global.
1592 (user_token_number_redeclaration): Update comments.
1593 (symbol_from_uniqstr): If a new symbol is being created, assert
1594 that symbols_sorted hasn't been allocated yet.
1595 (symbols_free): Free symbols_sorted.
1596 (symbols_cmp, symbols_cmp_qsort): New functions.
1597 (symbols_do): Sort symbol_table into symbols_sorted on first
1598 invocation.
1599 * tests/input.at (Numbered tokens): Recombine tests now that the
1600 output should be deterministic across multiple numbers.
1601
47076da5
AD
16022009-08-12 Akim Demaille <demaille@gostai.com>
1603
1604 distcheck: fix.
1605
aa50ba7b 1606 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
47076da5 1607
36dfe466
JD
16082009-08-10 Joel E. Denny <jdenny@clemson.edu>
1609
1610 * tests/Makefile.am (TESTSUITE_AT): Add named-refs.at.
1611
07c0db18
JD
16122009-08-10 Joel E. Denny <jdenny@clemson.edu>
1613
1614 Miscellaneous code readability improvements.
1615
1616 * src/reader.c (reader): Move %define front-end variable
1617 defaults and checking into...
1618 (prepare_percent_define_front_end_variables): ... this new
1619 function.
1620
1621 * src/scan-gram.l (INITIAL): For consistency with string
1622 literals, don't store open quote on character literal. It's
1623 discarded before returning anyway.
1624 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
1625 Make length test more readable, and make the character stored
1626 for an empty literal more obvious while consistent with the
1627 previous behavior.
1628
1629 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
1630 USER_NUMBER_HAS_STRING_ALIAS throughout.
1631 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
1632 that is repeated in symtab.h. Improve argument names to make it
1633 clear which side of the symbol-string alias pair is which.
1634 (symbol_check_alias_consistency): Improve local variable names
1635 for the same purpose.
1636 * src/symtab.h (struct symbol): Make comments about aliases
1637 clearer.
1638 (symbol_make_alias): Improve comments and argument name.
1639 * src/output.c (token_definitions_output): Update for rename to
1640 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
1641
1a323c2f
AR
16422009-08-08 Alex Rozenman <rozenman@gmail.com>
1643
1644 Convert "misleading reference" messages to warnings.
1645 * src/scan-code.l: New function 'show_sub_messages', more
1646 factoring.
1647 * tests/named-ref.at: Adjust tests.
1648
38609c34
JD
16492009-08-06 Joel E. Denny <jdenny@clemson.edu>
1650
1651 maint: run "make update-copyright"
1652
642f240e
JD
16532009-08-06 Joel E. Denny <jdenny@clemson.edu>
1654
1655 maint: make update-b4-copyright easier to use
1656 * build-aux/update-b4-copyright: In warnings, report line
1657 numbers rather than character positions.
1658 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
1659 that update-copyright runs it.
1660 * gnulib: Update.
1661
d0caad01
JD
16622009-08-05 Joel E. Denny <jdenny@clemson.edu>
1663
1664 maint: clean up update-b4-copyright code
1665 * build-aux/update-b4-copyright: Do not accept 2-digit
1666 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
1667 Don't accept a `[' in a b4_copyright argument.
1668 Format code more consistently.
1669 Don't assume b4*copyright never occurs.
1670
ac2def56
JD
16712009-08-04 Joel E. Denny <jdenny@clemson.edu>
1672
1673 maint: automate b4_copyright updates.
1674 * Makefile.am (update-b4-copyright): New target rule.
1675 * build-aux/Makefile.am (EXTRA_DIST): Add update-b4-copyright.
1676 * build-aux/update-b4-copyright: New.
1677 * data/yacc.c: Remove stray characters around b4_copyright
1678 invocations.
1679
dbbb64f0
JD
16802009-08-04 Joel E. Denny <jdenny@clemson.edu>
1681
1682 maint: automate annual package-wide copyright-year update.
1683 * .x-update-copyright: New.
1684 * Makefile.am (EXTRA_DIST): Remove maint.mk.
1685 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
1686 update-copyright. Remove gnumakefile, which is implied by
1687 maintainer-makefile.
1688 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
1689 * gnulib: Update.
1690 * maint.mk: Remove, now copied from gnulib.
1691 * examples/extexi: Add missing "(C)" in copyright statement so
1692 update-copyright can recognize it.
1693 * src/LR0.h: Likewise.
1694 * src/print.h: Likewise.
1695 * src/print_graph.h: Likewise.
1696 * src/gram.c: Add missing comma in copyright statement.
1697 * src/gram.h: Likewise.
1698
bfa018d4
JD
16992009-08-04 Joel E. Denny <jdenny@clemson.edu>
1700
1701 Fix "make distcheck".
1702 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
1703 of just calc.stamp.
1704
4521fcdf
JD
17052009-08-01 Joel E. Denny <jdenny@clemson.edu>
1706
1707 Pacify "gcc -Wunused" for the input function from Flex.
1708 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
1709 and later.
1710 * src/scan-code.l: Add "%option noinput", which I cannot find in
1711 the Flex manual, but which Flex has supported since at least as
1712 far back as 2.5.4. However, if any of our developers still use
1713 Flex 2.5.4, they'll need to stop configuring with
1714 --enable-gcc-warnings because "%option noinput" didn't work
1715 correctly until Flex 2.5.6.
1716 * src/scan-gram.l: Likewise.
1717 * src/scan-skel.l: Likewise.
1718
992e874a
AR
17192009-07-31 Alex Rozenman <rozenman@gmail.com>
1720
1721 Fix --enable-gcc-warnings problems.
1722 * src/reader.c: Adjust variable names.
1723 * src/scan-code.l: Fix prototypes and adjust names.
1724 * src/named-ref.c: Remove redundant "if".
1725
a1ed2b71
JD
17262009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1727
1728 Fix a --enable-gcc-warnings problem.
1729 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
1730 variable.
1731
cbc6a70e 17322009-07-24 Alex Rozenman <rozenman@gmail.com>
1e20ad11
AR
1733
1734 Fix some memory leaks.
1735 * src/named-ref.c: Add a pointer check (named_ref_free).
1736 * src/scan-code.l: New function (variant_table_free). Called in
1737 code_scanner_free.
1738 * src/symlist.c: Call to named_ref_free (symbol_list_free).
1739
ac9b0e95
JD
17402009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
1741
1742 Warn about character literals not of length one.
1743 * NEWS (2.5): Document.
1744 * src/scan-gram.l (INITIAL): Remove comment that we don't check
1745 the length.
1746 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
1747 * tests/input.at (Bad character literals): New test group.
1748
2de160e1
JD
17492009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
1750
1751 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
1752
cba97506
JD
17532009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
1754
1755 Some M4 cleanup in the testsuite.
1756 Suggested by Eric Blake at
1757 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
1758 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
1759 complicate the code by distinguishing between a missing value
1760 and an empty string value for an optional argument. This fix is
1761 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
1762 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
1763 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
1764 arguments are not needed because of the following changes.
1765 Fix stale comments.
1766 Bison developers should use GNU M4 and should not use
1767 POSIXLY_CORRECT when building the test suite, so do not
1768 complicate the code by avoiding $10 and above.
1769 Do not quote an empty string value for an optional argument, and
1770 do not distinguish between a missing value and an empty string
1771 value.
1772
62eb2d1b
JD
17732009-07-21 Joel E. Denny <jdenny@ces.clemson.edu>
1774
1775 * m4/m4.m4: Make it a sym link to submodules/autoconf/m4/m4.m4.
1776
620b2e36
JD
17772009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1778
1779 Revert unnecessary column realignment in --help output.
1780 Reported by Akim Demaille at
1781 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
1782 * src/getargs.c (usage): Here.
1783
cbc6a70e 17842009-07-04 Alex Rozenman <rozenman@gmail.com>
dad6544d
AR
1785
1786 Alphabetical order in src/Makefile.am.
1787 * src/Makefile.am: Adjust.
1788
cbc6a70e 17892009-07-04 Alex Rozenman <rozenman@gmail.com>
d5e8574b
AR
1790
1791 Style changes and factoring.
1792 * src/named-ref.h: Add comments.
1793 * src/parse-gram.y: Readability and style changes.
1794 * src/reader.c: Factoring: assign_named_ref function.
1795 * src/scan-code.l: Factoring and style changes. Rename
1796 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
1797 Use "unsigned" type for variant index. Improve readablity.
1798 * src/scan-gram.l: Change error messages and add comments.
1799 * src/symlist.h: symbol_list_null: New function decl.
1800 * src/symlist.c: symbol_list_null: Implement here.
1801 * tests/named-refs.at: Adjust for new error messages.
1802
ae09ec85
EB
18032009-06-29 Eric Blake <ebb9@byu.net>
1804
1805 scan-code: avoid compiler warnings
1806 * src/scan-code.l (parse_named_ref): Use correct specifiers.
1807
80d653fd
AD
18082009-06-29 Akim Demaille <demaille@gostai.com>
1809
1810 build: avoid concurrent extraction of calc++.
1811 * examples/calc++/Makefile.am (calc.stamp): New.
1812 Depend on it to create the sources of calc++ so that concurrent
1813 builds don't launch several "extexi" in parallel.
1814 Not only this is inefficient, this also builds incorrect sources
1815 with several extractions mixed together.
1816
7685e2f7
AR
18172009-06-27 Alex Rozenman <rozenman@gmail.com>
1818
1819 Implement support for named symbol references.
1820 * src/parse-gram.y: Add new syntax (named_ref.opt).
1821 * src/reader.c: Store named refs in symbol lists.
1822 * src/reader.h: New argument for symbol_append and
1823 action_append functions.
1824 * src/scan-code.h: Add new field (named_ref) into
1825 code_props data structure. Keeps named ref of midrule
1826 actions.
1827 * src/scan-code.l: Support for named refs in semantic
1828 action code. New function 'parse_named_ref'.
1829 * src/scan-gram.l: Support bracketed id.
1830 * src/symlist.c: Store named refs in symbol lists.
1831 * src/symlist.h: New field in symbol list: named_ref.
1832 * src/named-ref.h: New file, a struct for named_ref.
1833 * src/named-ref.cp: New file, named_ref_new function.
1834 * src/local.mk: Add two new files.
1835 * tests/testsuite.at: Include new test group:
1836 * tests/named-refs.at: this new file.
1837
67f8cf51
AD
18382009-06-25 Akim Demaille <demaille@gostai.com>
1839
1840 hash: check insertion for memory exhaustion.
1841 * src/uniqstr.c (uniqstr_new): New.
1842
83b66ddd
AD
18432009-06-11 Akim Demaille <demaille@gostai.com>
1844
1845 style changes.
1846 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
1847 * src/print-xml.c: Style changes.
1848 * tests/conflicts.at: Comment changes.
1849
517cb0ad
AD
18502009-06-11 Akim Demaille <demaille@gostai.com>
1851
1852 xml: beware of user strings used to give a %prec to rules.
1853 * tests/conflicts.at (%prec with user strings): New.
1854 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
1855 XML output.
1856
75c7a52a
AD
18572009-06-11 Akim Demaille <demaille@gostai.com>
1858
1859 hash: check insertion for memory exhaustion.
1860 * src/muscle-tab.c (muscle_insert, muscle_grow)
1861 * src/state.c (state_hash_insert): Check the return value of
1862 hash_insert.
1863
66ed9753
AD
18642009-06-10 Akim Demaille <demaille@gostai.com>
1865
1866 deterministic test suite.
1867 Some consistency checks on symbols are performed after all the
1868 symbols were read, by an iteration over the symbol table. This
1869 traversal is nondeterministic, which can be a problem for test
1870 cases.
1871 Avoid this.
1872 Addresses another form of nondeterminism reported by Joel E. Denny.
1873 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
1874
1875 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
1876 test in two.
1877 Use different file names for the three tests to make the
1878 maintenance easier.
1879
ed15d907
AD
18802009-06-10 Akim Demaille <demaille@gostai.com>
1881
95d176ff
AD
1882 deterministic user-token-number redeclaration errors.
1883 Address nondeterminism reported by Joel E. Denny.
1884 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
1885
1886 * src/uniqstr.h: Comment changes.
1887 * src/location.h (boundary_cmp, location_cmp): New.
1888 * src/symtab.c (user_token_number_redeclaration): New.
1889 (symbol_translation): Use it.
1890 * tests/input.at (Numbered tokens): Adjust the expected output.
1891
18922009-05-25 Akim Demaille <demaille@gostai.com>
1893
ed15d907 1894 gnulib: update.
aa50ba7b
EB
1895 * gnulib: Update to latest.
1896 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
1897 * m4/.gitignore: Regen.
1898 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
1899 Call xalloc_die on hash_insert failures.
1900 Requested by the new __warn_unused_result__ attribute of
1901 hash_insert.
ed15d907 1902
e3a33f7c
JD
19032009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1904
1905 Convert multiple variable definition warnings to complaints.
1906 * NEWS (2.5): Add a new entry for that change.
1907 * doc/bison.texinfo (Decl Summary): Update %define entry.
1908 (Bison Options): Update -D/--define/-F/--force-define entry.
1909 * src/muscle_tab.c (muscle_percent_define_insert): Implement.
1910 * src/muscle_tab.h (muscle_percent_define_insert): Update
1911 comments.
1912 * tests/input.at (`%define errors'): Update.
1913 (`%define, --define, --force-define'): Update.
1914
34d41938
JD
19152009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1916
1917 -F/--force-define and relative %define/-D/--define priorities.
1918 * NEWS (2.5): Add documentation to -D/--define entry.
1919 * build-aux/cross-options.pl: Hard-code association of
1920 --force-define with %define.
1921 * doc/bison.texinfo (Decl Summary): In %define entry,
1922 cross-reference command-line options.
1923 (Bison Options): Add documentation to -D/--define entry.
1924 (Option Cross Key): Widen column for --force-define row.
1925 * src/getargs.c (usage): Document -F/--force-define. Realign
1926 options in output.
1927 (short_options, long_options, getargs): Parse -F/--force-define,
1928 and update muscle_percent_define_insert invocation.
1929 * src/muscle_tab.h (muscle_percent_define_how): New enum type.
1930 (muscle_percent_define_insert): Add argument with that type.
1931 * src/muscle_tab.c (muscle_percent_define_insert): Implement
1932 -F/--force-define behavior and priorities.
1933 * src/parse-gram.y (prologue_declaration): Update
1934 muscle_percent_define_insert invocations.
1935 * tests/input.at (`%define, --define'): Rename to...
1936 (`%define, --define, --force-define'): ... this and extend.
1937
246c4efa
JD
19382009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1939
1940 Update some comments to make sense for -D.
1941 * data/bison.m4 (b4_check_user_names): In header comments, say
1942 "user occurrence" instead of "grammar occurrence".
1943 * src/muscle_tab.h (muscle_percent_define_insert): Likewise.
1944 (muscle_percent_code_grow): Likewise just for consistency.
1945
531683e7
JD
19462009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1947
1948 * data/c++.m4: Update copyright year.
1949
e7bfa8b7
JD
19502009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
1951
1952 * data/c++.m4 (b4_namespace_close): Simplify slightly.
1953
8c221795
JD
19542009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
1955
1956 Handle a trailing `:' in a user-supplied C++ namespace better.
1957 * data/c++.m4 (b4_namespace_close): Don't let it be printed
1958 among the closing braces here. This fix might make the
1959 generated code easier to debug, but otherwise it should be
1960 insignificant because a trailing `:' is a C++ error already.
1961
c8bf65f0
AD
19622009-05-19 Akim Demaille <demaille@gostai.com>
1963
1964 remove useless variable.
1965 * src/getargs.c (skeleton_arg): Remove now useless variable.
1966 Should help the compiler see that this printf-like call is sane.
1967
7ac45a46
AD
19682009-05-11 Akim Demaille <demaille@gostai.com>
1969
1970 doc: use C++ headers.
1971 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
1972 headers.
1973
601bdfab
AD
19742009-05-05 Akim Demaille <demaille@gostai.com>
1975
1976 fix hexadecimal token number support.
1977 * src/scan-gram.l: Catch incorrect ids after hexadecimal numbers.
1978
d19123e6
AD
19792009-05-05 Akim Demaille <demaille@gostai.com>
1980
1981 tests: check token numbers.
1982 * tests/input.at (Numbered tokens): New.
1983
ecdfea9a
AD
19842009-05-04 Akim Demaille <demaille@gostai.com>
1985
1986 bison: catch bad symbol names.
1987 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
1988 * tests/input.at: Adjust.
1989
43e6aea5
AD
19902009-05-04 Akim Demaille <demaille@gostai.com>
1991
1992 space changes.
1993 * src/scan-gram.l: Untabify to be robust to zealous editors.
1994
c046698e
AD
19952009-05-04 Akim Demaille <demaille@gostai.com>
1996
1997 identifiers: dashes are letters.
1998 Dashes can now start identifiers (symbols and directives).
b10dd689 1999
c046698e
AD
2000 * src/scan-gram.l ({letter}): Add dash.
2001 ({id}): Remove it.
2002 * tests/input.at (Symbols): Adjust.
2003 Remove stray comment.
2004 * tests/regression.at (Invalid inputs): Adjust error message.
2005 * doc/bison.texinfo (Symbols): Update.
2006
966aba65
JD
20072009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
2008
2009 Declare %code to be a permanent feature.
2010 * NEWS (2.4.2): Here.
2011 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
2012 experimental.
2013 (Decl Summary): Likewise.
2014
812775a0
JD
20152009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
2016
2017 Convert underscores to dashes in some %define variable names.
2018 For now, just api.push-pull and lr.keep-unreachable-states.
2019 Maintain old names for backward compatibility.
2020 * NEWS (2.5): Document.
2021 * data/c.m4 (b4_identification): Update comment.
2022 * data/yacc.c: Update access.
2023 * doc/bison.texinfo: Update.
2024 * etc/bench.pl.in (bench_grammar): Update use.
2025 * src/files.c (tr): Move to...
2026 * src/getargs.c, src/getargs.h (tr): ... here because I can't
2027 think of a better place to expose it. My logic is that, for all
2028 uses of tr so far, command-line arguments can be involved, and
2029 getargs.h is already included.
2030 * src/main.c (main): Update access.
2031 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
2032 variable names to new variable names before assigning value.
2033 * src/reader.c (reader): Update setting default.
2034 * tests/calc.at: Update uses.
2035 * tests/conflicts.at (Unreachable States After Conflict
2036 Resolution): Update use.
2037 * tests/input.at (%define enum variables): Update use.
2038 (%define backward compatibility): New test group.
2039 * tests/push.at: Update uses.
2040 * tests/reduce.at: Update uses.
2041 * tests/torture.at: Update uses.
2042
1c4aa81d
JD
20432009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
2044
2045 Set all front-end %define defaults in one place.
2046 * src/main.c (main): Move lr.keep_unreachable_states default...
2047 * src/reader.c (reader): ... to here.
2048
1d0f55cc
JD
20492009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
2050
2051 Rename lr.default_reductions to lr.default-reductions.
2052 * NEWS (2.5): Here.
2053 * doc/bison.texinfo: Here.
2054 * src/lalr.c (initialize_LA): Here.
2055 * src/print.c (print_reductions): Here.
2056 * src/reader.c (reader): Here.
2057 * src/tables.c (action_row): Here.
2058 * tests/input.at (%define enum variables): Here.
2059 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
2060
0b593457
JD
20612009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
2062
2063 Pacify ./configure --enable-gcc-warnings.
2064 * tests/input.at (Symbols): Prototype yyerror and yylex.
2065
0939aa2d
AD
20662009-04-21 Akim Demaille <demaille@gostai.com>
2067
2068 tests: check the use of dashes and periods in symbols.
2069 * tests/input.at (Symbol): New test group.
2070
0b593457 20712009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
ae618dcc
JD
2072
2073 Document how `%define "var" "value"' is not M4-friendly.
2074 * src/parse-gram.y (variable): In comments here.
2075
0b593457 20762009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
6789b8bd
JD
2077
2078 Add copyright updates missed during previous cherry pick.
2079 * src/output.c: Here.
2080 * src/parse-gram.y: Here.
2081 * src/scan-gram.l: Here.
2082
663ce7bb
AD
20832009-04-20 Akim Demaille <demaille@gostai.com>
2084
2085 variables: accept dashes.
2086 * src/scan-gram.l ({id}): Also accept dashes after the initial
2087 letter.
2088 ({directive}): Use {id}.
2089 * src/parse-gram.y: Comment and formatting changes.
2090 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
2091 symbols.
2092 * src/complain.h, src/complain.c (yacc_at): New.
2093 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
2094 symbol names.
2095 * src/output.c (token_definitions_output): Do not #define token
2096 names with dashes.
2097
379261b3
JD
20982009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
2099
2100 Clean up recent patches a little.
2101 Reported by Akim Demaille.
2102 * doc/bison.texinfo (Understanding): Fix typos.
2103 * src/print.c (print_reductions): Don't use negated variable.
2104
25029e16
JD
21052009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
2106
2107 List accepted values for a %define enum variable with an invalid value.
2108 Suggested by Akim Demaille at
2109 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
2110 * data/bison.m4 (_b4_percent_define_check_values): Implement.
2111 * src/muscle_tab.c (muscle_percent_define_check_values): Implement.
2112 * tests/input.at (%define lr.default_reductions invalid values): Merge
2113 into...
2114 (%define enum variables): ... here, and update output.
2115
620b5727
JD
21162009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
2117
2118 Rename "default rule" to "default reduction".
2119 This includes changing variable names in code, changing
2120 comments, and renaming %define lr.default_rules to %define
2121 lr.default_reductions.
2122 * NEWS (2.5): Update IELR documentation.
2123 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c:
2124 Adjust YYDEFACT and yydefact_ documentation.
2125 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
2126 and lr.type documentation. Make some other wording
2127 improvements.
2128 (Glossary): Adjust cross-references and Default Reduction
2129 definition.
2130 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
2131 Remove a confusing comment pointed out by Akim Demaille.
2132 (initialize_LA): Adjust code.
2133 * src/print-xml.c (print_reductions): Adjust code.
2134 * src/print.c (print_reductions): Adjust code.
2135 * src/reader.c (reader): Adjust code.
2136 * src/tables.c (action_row): Adjust code.
2137 (token_actions): Adjust code.
2138 * src/tables.h: Adjust YYDEFACT documentation.
2139 * tests/input.at (%define lr.default_rules invalid values):
2140 Rename test group to...
2141 (%define lr.default_reductions invalid values): ... this, and
2142 update grammar file and expected output.
2143 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
2144 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
2145
34a6c2d1
JD
21462009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2147
2148 Document %define lr.type and lr.default_rules.
2149 * NEWS (2.5): Add an entry.
2150 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
2151 besides just LALR(1) and GLR(1).
2152 * doc/bison.texinfo (Introduction): Likewise.
2153 (Language and Grammar): Bison is no longer limited to LALR(1)
2154 restrictions.
2155 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
2156 when trying to distinguish from GLR. Talk about LR(1) grammars
2157 rather than LALR(1) grammars.
2158 (Decl Summary): In %define api.push_pull entry, say it applies
2159 to deterministic parsers in C rather than LALR(1) parsers in C.
2160 Add lr.default_rules entry.
2161 Add lr.type entry.
2162 (Mystery Conflicts): Bison is no longer limited to LALR(1)
2163 restrictions.
2164 (Generalized LR Parsing): Same changes as for the previous GLR
2165 section.
2166 (Memory Management): Say deterministic rather than LALR(1).
2167 (Understanding): Correct some bison output.
2168 Index discussion of "accepting state".
2169 Say deterministic rather than LALR(1).
2170 (Bison Options): In --yacc entry, say deterministic rather than
2171 LALR(1).
2172 In --report, --graph, and --xml entries, just don't mention
2173 LALR(1).
2174 (C++ Parsers): Say deterministic rather than LALR(1).
2175 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
2176 (Glossary): Add Accepting State, Consistent State, Default Rule,
2177 and IELR(1) definitions.
2178 In Generalized LR (GLR) definition, make same changes as in
2179 previous GLR sections.
2180 In LALR(1) definition, say Bison uses LALR(1) by default rather
2181 than implying Bison is limited to LALR(1).
2182 (LocalWords): Add IELR.
2183
f805dfcb
JD
21842009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2185
2186 Finish implementing %define lr.type.
2187 Its value can be "LALR", "IELR", or "canonical LR".
2188 * lib/timevar.def (TV_IELR_PHASE1): New var.
2189 (TV_IELR_PHASE2): New var.
2190 (TV_IELR_PHASE3): New var.
2191 (TV_IELR_PHASE4): New var.
2192 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
2193 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
2194 Sbitset.h, ielr.h, and ielr.c.
2195 * src/getargs.h, src/getargs.c (enum trace, trace_args,
2196 trace_types): Add trace_ielr.
2197 * src/lalr.h, src/lalr.c (ngotos): Export it.
2198 (F): Rename to...
2199 (goto_follows): ... this, update all uses, and export it.
2200 (set_goto_map): Export it.
2201 (map_goto): Export it.
2202 (compute_lookahead_tokens): Don't free goto_follows yet. Now
2203 handled in ielr.
2204 (initialize_LA): Export it. Move lookback allocation to...
2205 (lalr): ... here because, for canonical LR, initialize_LA must
2206 be invoked but lookback and much of the rest of LALR isn't
2207 needed.
2208 * main.c (main): Instead of lalr, invoke ielr, which invokes
2209 lalr.
2210 * src/reader.c (reader): Default lr.type to "LALR".
2211 Default lr.default_rules to "accepting" if lr.type is "canonical
2212 LR". Leave the default as "all" otherwise.
2213 Check for a valid lr.type value.
2214 * src/state.h, src/state.c (struct state_list): Add state_list
2215 member.
2216 (state_new): Initialize state_list member to NULL.
2217 (state_new_isocore): New function, exported.
2218 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
2219 exercises all values of lr.type.
2220 (GNU AWK Grammar): Rename test group to...
2221 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
2222 AT_TEST_EXISTING_GRAMMAR.
2223 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
2224 (GNU pic Grammar): Rename test group to...
2225 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
2226 AT_TEST_EXISTING_GRAMMAR.
2227 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
2228 all values of lr.type.
2229 (Single State Split): New test groups using AT_TEST_LR_TYPE.
2230 (Lane Split): Likewise.
2231 (Complex Lane Split): Likewise.
2232 (Split During Added Lookahead Propagation): Likewise.
2233
166366b2
JD
22342009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2235
2236 Add new files for IELR and canonical LR implementation.
2237 * src/AnnotationList.c: New.
2238 * src/AnnotationList.h: New.
2239 * src/InadequacyList.c: New.
2240 * src/InadequacyList.h: New.
2241 * src/Sbitset.c: New.
2242 * src/Sbitset.h: New.
2243 * src/ielr.c: New.
2244 * src/ielr.h: New.
2245
03c07b03
JD
22462009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
2247
2248 Implement %define lr.default_rules.
2249 Its value describes the states that are permitted to contain
2250 default rules: "all", "consistent", or "accepting".
2251 * src/reader.c (reader): Default lr.default_rules to "all".
2252 Check for a valid lr.default_rules value.
2253 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
2254 is "accepting", then only mark the accepting state as
2255 consistent.
2256 (initialize_LA): Tell state_lookahead_tokens_count whether
2257 lr.default_rules is "accepting".
2258 * src/tables.c (action_row): If lr.default_rules is not "all",
2259 then disable default rules in inconsistent states.
2260 * src/print.c (print_reductions): Use this opportunity to
2261 perform some assertions about whether lr.default_rules was
2262 obeyed correctly.
2263 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
2264 helps with checking the parser tables for a grammar.
2265 * tests/input.at (%define lr.default_rules invalid values): New
2266 test group.
2267 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
2268 AT_TEST_TABLES_AND_PARSE.
2269 (`no %define lr.default_rules'): New test group generated by
2270 AT_TEST_LR_DEFAULT_RULES.
2271 (`%define lr.default_rules "all"'): Likewise.
2272 (`%define lr.default_rules "consistent"'): Likewise.
2273 (`%define lr.default_rules "accepting"'): Likewise.
2274
44c124a3
AD
22752009-04-20 Akim Demaille <demaille@gostai.com>
2276
2277 Consistently refer to Yacc, not YACC.
2278 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
2279
42660736
JD
22802009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
2281
2282 Pacify make maintainer-check-posix.
2283 * tests/input.at (%define, --define): Move bison command-line
2284 options before grammar file name.
2285
a2d05674
JD
22862009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
2287
2288 Document semicolon warnings.
2289 * NEWS (2.5): Here.
2290
c4fae1ef
AD
22912008-12-08 Akim Demaille <demaille@gostai.com>
2292
2293 Fix portability issue in the test suite.
2294 * tests/local.at (AT_MATCHES_CHECK): New.
2295 Based on Perl instead of Sed. Sed has too many portability
2296 pitfalls, not ever Sed is GNU Sed.
2297 * tests/actions.at (Fix user actions without a trailing semicolon):
2298 Use it.
2299
42f4393a
DJ
23002008-12-07 Di-an Jan <dianj@freeshell.org>
2301
2302 Implement the FIXME that ends an user action with a semicolon
2303 if it seems necessary.
2304 * src/scan-code.l (flex rules section): Flag cpp directive from
2305 any `#' to the first unescaped end-of-line. Semicolon is not
2306 needed after `;', `{', '}', or cpp directives and is needed after
2307 any other token (whitespaces and comments have no effect).
2308 * tests/actions.at (Fix user actions without a trailing semicolon):
2309 New test.
2310 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
2311 to make user actions complete statements.
2312 Adjust column numbers in error messages.
2313 * tests/regression.at (Fix user actions without a trailing semicolon):
2314 Remove. Covered by new test.
2315
bd5df716
AD
23162009-04-14 Akim Demaille <demaille@gostai.com>
2317
2318 doc: minor fixes.
2319 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
2320 (Table of Symbols): Remove duplicate entry for %debug.
2321
7ba0d59d
EB
23222009-04-10 Eric Blake <ebb9@byu.net>
2323
2324 submodules: update to latest
2325 * submodules/autoconf: Use latest upstream Autoconf.
2326
b4d71a96
EB
23272009-04-06 Eric Blake <ebb9@byu.net>
2328
2329 Work around autoconf 2.63b bug in testsuite.
2330 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
2331 autoconf bug related to # in test.
2332
4ecd3681
JD
23332009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2334
2335 * NEWS (2.5): Describe new -D/--define feature.
2336
c65e5292
AD
23372008-11-10 Akim Demaille <demaille@gostai.com>
2338
2339 --trace=muscles
2340 * src/getargs.h, src/getargs.c (trace_muscle): New.
2341 (trace_types, trace_args): Support it.
2342 * src/output.c (output_skeleton): Use it.
2343
96002de2
AD
23442008-11-10 Akim Demaille <demaille@gostai.com>
2345
2346 muscles_output.
2347 * src/output.c (muscles_output): New, extracted from...
2348 (output_skeleton): here.
2349 Adjust.
2350
fadb13b5
AD
23512008-11-21 Akim Demaille <demaille@gostai.com>
2352
2353 Display the changes in cross-options.texi.
2354 * build-aux/cross-options.pl ($sep): New, to separate items.
2355 * doc/Makefile.am ($(srcdir)/cross-options.texi): Use diff to display
2356 the changes.
2357
72183df4
DJ
23582008-11-20 Di-an Jan <dianj@freeshell.org>
2359
2360 Improves options in the manual.
2361 * doc/bison.texinfo (-g, -x): Add space before argument.
2362 (Option Cross Key): Implement FIXME: listing directives also.
2363 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
2364 (Short Option): Special case -d. Put arguments inside @option.
fadb13b5 2365 (Bison Directive): Add column, automatically extracted from
72183df4
DJ
2366 src/scan-gram.l (actual name passed as the first argument)
2367 with special case for %define.
2368 * doc/Makefile.am (doc/cross-options.texi): Pass src/scan-gram.l
2369 to build-aux/cross-options.pl.
2370 * src/getargs.c (usage): Document limitations of cross-options.pl.
2371 * src/scan-gram.l: Likewise.
2372
e80b068c
AD
23732009-02-25 Akim Demaille <demaille@gostai.com>
2374
2375 Copyright years.
2376 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
2377
e3ee30b8
AD
23782008-12-08 Akim Demaille <demaille@gostai.com>
2379
2380 Install autoconf as a submodule to get m4sugar.
2381 * .gitmodules: Add submodules/autoconf.
2382 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
2383 submodules/autoconf.
2384
c4eb1e84
JD
23852008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2386
2387 Simplify last patch slightly.
2388 * src/getargs.c (getargs): Here.
2389
10fa0146
JD
23902008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2391
2392 Fix last warning from --enable-gcc-warnings.
2393 * src/getargs.c (getargs): Don't assign const address to non-const
2394 pointer.
2395
6f5be1ab
DJ
23962008-11-17 Di-an Jan <dianj@freeshell.org>
2397
2398 Handle --enable-gcc-warnings.
2399 * src/getargs.c (command_line_location): Set parameters to void.
2400
11c4e57d
AD
24012008-11-11 Akim Demaille <demaille@gostai.com>
2402
2403 AT_FULL_COMPILE.
2404 * tests/actions.at, tests/regression.at: Use it.
2405
e186a284
AD
24062008-11-07 Akim Demaille <demaille@gostai.com>
2407
2408 Pass command line location to skeleton_arg and language_argmatch.
2409 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
2410 The location argument is now mandatory.
2411 Adjust all dependencies.
2412 (getargs): Use command_line_location.
2413
e14c6831
AD
24142008-11-07 Akim Demaille <demaille@gostai.com>
2415
2416 -D, --define.
2417 * src/getargs.c (usage): Document -D.
2418 Fix help string for --locations.
2419 (command_line_location): New.
2420 (short_options, long_options, getargs): Support -D, --define.
2421 (getargs): Move -d support at the right place.
2422 * doc/bison.texinfo (Bison Options): Update.
2423 * tests/input.at (%define, --define): New.
2424
75c21b61
AD
24252008-11-07 Akim Demaille <demaille@gostai.com>
2426
2427 Initialize the muscle table before parsing the command line.
2428 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
2429 (getargs): Define file_name.
2430 * src/main.c (main): Initialize muscle_tab before calling
2431 getargs.
2432 * src/muscle_tab.c (muscle_init): No longer define file_name, as
2433 its value is not available yet.
2434
33d2a860
AD
24352008-11-09 Akim Demaille <demaille@gostai.com>
2436
2437 Require the generation of parse-gram.output.
2438 * src/Makefile.am (YACC): Pass --report=all.
2439
006faedf
JD
24402009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2441
2442 * NEWS (2.5): New stub.
2443
ecd1b61c
JD
24442009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2445
2446 Fix options documentation.
2447 * build-aux/cross-options.pl: As in --help output, write optional
2448 arguments as [=ARG] not =[ARG].
2449 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
2450
f67c4037
AD
24512008-11-07 Akim Demaille <demaille@gostai.com>
2452
2453 Fix --help.
2454 * src/getargs.c (usage): Fix help string for -W.
2455
0213d651
AD
24562008-11-07 Akim Demaille <demaille@gostai.com>
2457
2458 Handle more general types of option arguments.
2459 * build-aux/cross-options.pl: The argument ends at the first
2460 space, not the first non-symbol character.
2461 Use @var for each word appearing the argument description.
2462
c19178bf
JD
24632009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
2464
2465 Remove spurious initial empty lines.
2466 * data/location.cc: End the @output lines with an @.
2467
0d2b2ab0
AD
24682008-11-04 Akim Demaille <demaille@gostai.com>
2469
2470 Remove spurious initial empty lines.
2471 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
2472 * data/yacc.c: End the @output lines with an @.
2473
8ba62e3e
JD
24742009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
2475
2476 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
2477 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
2478 requirements for a correct m4 are stricter.
2479 * m4/m4.m4: Replace with Autoconf 2.63's m4/m4.m4.
2480 * configure.ac: Update to use AC_PROG_GNU_M4.
2481 Reported by Eric Blake.
2482
5bc993d9
JD
24832009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2484
2485 Help with updating web manual.
2486 * HACKING: Incorporate instructions from gnulib/doc/README.
2487 * bootstrap.conf (gnulib_modules): Add gendocs.
2488
580c075d
JD
24892009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2490
2491 Fix strange %define locations for default values.
2492 Reported by Akim Demaille at
2493 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
2494 and discussed again starting at
2495 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
2496 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
2497 because location information is bogus.
2498 Use angle brackets to delimit fake file name because square brackets
2499 look like underexpanded m4. Choose a better fake file name.
2500 Use negative line numbers.
2501 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
2502 * src/location.c (location_print): If line for a boundary is negative,
2503 only print that boundary's file name.
2504 * src/location.h: Document that.
2505 * tests/skeletons.at (%define Boolean variables: invalid skeleton
2506 defaults): Update output.
2507
5d3a1ecb
AD
25082008-11-07 Akim Demaille <demaille@gostai.com>
2509
2510 Locations without columns for command line arguments.
2511 * src/location.c (location_print): Don't display negative columns.
2512 * src/location.h: Document this.
2513
015e86a7
JD
25142009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
2515
2516 Add reminder about uploading public key to keys.gnupg.net.
2517 * HACKING (Release Procedure): Here.
2518
c1455bab
AD
25192009-03-31 Akim Demaille <demaille@gostai.com>
2520
2521 bootstrap: --help to stdout.
2522 * bootstrap (usage): Don't send --help to stderr.
2523 Use a here doc instead of a long string.
2524
2075a82a
AD
25252009-03-31 Akim Demaille <demaille@gostai.com>
2526
2527 bootstrap: README-hacking no longer exists
2528 * bootstrap (checkout_only_file): Set to HACKING.
2529
26fccd4d
AD
25302009-03-26 Akim Demaille <demaille@gostai.com>
2531
2532 doc: merge HACKING and README-hacking.
2533 Two files is confusing.
2534 Reported by Alexandre Duret-Lutz.
5bc993d9 2535
26fccd4d
AD
2536 * README-hacking: Merge into...
2537 * HACKING (Working from the repository): here.
2538
6469c4d7
AD
25392009-03-26 Akim Demaille <demaille@gostai.com>
2540
2541 doc: update README-hacking.
2542 * README-hacking: We now use git and git submodules.
2543 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
2544
b328890a
AD
25452009-03-26 Akim Demaille <demaille@gostai.com>
2546
2547 lalr1.cc: avoid GCC 4.3 warnings.
2548 GCC 4.3 now warns about "a || b && c" and asks for explicit
2549 parentheses.
2550 Reported by Alexandre Duret-Lutz.
2551 * data/location.cc: Update copyright years.
2552 (Position::operator==): Use parens to make precedence explicit.
2553 Compare lines and columns first, as they are more likely to be
2554 different, and they are faster to compare.
2555
f3079439
AD
25562009-03-26 Akim Demaille <demaille@gostai.com>
2557
2558 gnulib: update.
2559 * gnulib: Update to latest.
2560 * lib/Makefile.am (AM_CPPFLAGS): It is now defined by gnulib, so
2561 use +=.
2562
8defe11b
AD
25632009-01-08 Akim Demaille <demaille@gostai.com>
2564
2565 Fix grep portability issues.
2566 Grep on Solaris does not support -q.
2567 Reported by Summum Bonum.
5bc993d9 2568
8defe11b
AD
2569 * NEWS: Add a stub for 2.4.2.
2570 * THANKS: Add Summum Bonum.
2571 * tests/atlocal.in (EGREP): New.
2572 (CC, CXX, XSLTPROC): Make it possible to override them via
2573 envvars.
2574 * tests/java.at: Use $EGREP instead of egrep.
2575 Use AT_CHECK's ignore instead of grep's -q.
2576
41930e7a
JD
25772008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
2578
2579 Version 2.4.1.
2580 * NEWS: Set version and date.
2581 * lib/Makefile.am: Update copyright year.
2582 * tests/atlocal.in: Update copyright year.
2583
d07932ef
JD
25842008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
2585
2586 Semicolon feature removal is not about future language support.
2587 * NEWS: The semicolon feature is no longer active for newer languages,
2588 so don't claim that it causes trouble for them.
2589
0364b334
JD
25902008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
2591
2592 * gnulib: Update submodule to HEAD.
2593
876fd835
AD
25942008-12-09 Akim Demaille <demaille@gostai.com>
2595
2596 Update data/README.
2597 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
2598
bee1df15
EB
25992008-12-05 Eric Blake <ebb9@byu.net>
2600
2601 Build testsuite with newer autoconf.
2602 * tests/output.at (m4_expand): Don't override in newer autoconf,
2603 where the underlying implementation changed.
2604 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
2605 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
2606 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
2607 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
2608 since some of them contain unbalanced ')'.
2609
7e6d1e22
JD
26102008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
2611
2612 * NEWS: Clarify a little.
2613
a957d06c
JD
26142008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
2615
2616 * NEWS: Update for recent changes.
2617
462503f8
JD
26182008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
2619
2620 Fix unexpanded macros in GLR defines file.
2621 Reported by Csaba Raduly at
2622 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
2623 * THANKS (Csaba Raduly): Add.
2624 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
2625 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
2626 lexer in a separate module that includes the defines file.
2627 (AT_CHECK_CALC): Use AT_FULL_COMPILE and request compilation of lexer
2628 source.
2629 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
2630 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
2631 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
2632 (AT_DATA_SOURCE_PROLOGUE): New.
2633 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
2634 (AT_DATA_SOURCE): New.
2635 (AT_FULL_COMPILE): New, copied from master branch and extended to
2636 support an additional source file.
2637
bf151b75
JD
26382008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2639
2640 Don't let maintainer-*-check targets force a version update.
2641 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
2642 handled.
2643
f56274a8
DJ
26442008-11-17 Di-an Jan <dianj@freeshell.org>
2645
2646 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
2647 Align menus. Adjust word wrapping. Use node names for menu names.
2648 (Examples): Don't abbreviate node names.
2649 (LocalWords): Remove abbreviations.
2650 (Copying): Make description a sentence.
bf151b75 2651 (Java Action Features): Remove period to match the rest of menu.
f56274a8 2652
b5775a81
PB
26532008-11-11 Paolo Bonzini <bonzini@gnu.org>
2654
2655 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
2656 * configure.ac: Adjust usage.
2657 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
2658 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
2659 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
2660
7ed73f82
JD
26612008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
2662
2663 Don't add a semicolon to actions for %skeleton or %language.
2664 It breaks Java test cases as reported by Akim Demaille.
2665 * src/scan-code.l: Implement.
2666
4b1ebc49
JD
26672008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
2668
2669 Clean up %skeleton and %language priority implementation.
2670 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
2671 remove static qualifier because others will soon need to see it.
2672 (language_prio): Likewise.
2673 (getargs): Use command_line_prio rather than 0.
2674 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
2675 enum fields.
2676 (skeleton_prio): Extern it.
2677 (language_prio): Extern it.
2678 * src/parse-gram.y: Use grammar_prio rather than 1.
2679
738cde3e
AD
26802008-11-04 Akim Demaille <demaille@gostai.com>
2681
2682 * NEWS: Mention the trailing semicolon in action.
2683
d6fb461d
AD
26842008-11-04 Akim Demaille <demaille@gostai.com>
2685
2686 Reformat NEWS.
2687 * NEWS: Use more outline-mode markup.
2688 Suggested by Jim Meyering.
2689
14da0cdd
JD
26902008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
2691
2692 Fix user actions without a trailing semicolon.
2693 Reported by Sergei Steshenko at
2694 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
2695 * THANKS (Sergei Steshenko): Add.
2696 * src/scan-code.l (SC_RULE_ACTION): Fix it.
2697 * tests/regression.at (Fix user actions without a trailing semicolon):
2698 New test case.
2699
c9ba9e59
JD
27002008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2701
2702 Initiate further development.
2703 * NEWS: Create an empty section for new entries.
2704 * gnulib: Update submodule to HEAD.
2705
bfb40910
JD
27062008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2707
2708 * NEWS: Version 2.4.
2709
241fda7a
JD
27102008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2711
2712 Prepare for next release.
2713 * NEWS: Briefly mention changes since 2.3b.
2714 * README: Say GNU m4 1.4.6, which we've been requiring in release
2715 announcements already, not 1.4.3, which breaks the build.
2716
ed4d67dc
JD
27172008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2718
2719 Say %language is experimental.
2720 We're thinking of extending it's effect on output file naming. See the
2721 thread at
2722 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
2723 * NEWS: Say it's experimental.
2724 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
2725 recommend it over %skeleton for now.
2726 (Bison Options): Likewise.
2727 (C++ Bison Interface): Use %skeleton not %language.
2728 (Calc++ Parser): Use %skeleton not %language.
2729 * src/getargs.c (usage): Say it's experimental.
2730
e254a580
DJ
27312008-11-01 Di-an Jan <dianj@freeshell.org>
2732 Paolo Bonzini <bonzini@gnu.org>
2733
2734 Support all Java parser class modifiers.
2735 * data/java.m4 (b4_percent_define_get3): New.
2736 (b4_final_if, b4_strictfp_if): New.
2737 * data/lalr1.java (final, strictfp, extends, implements): Support.
2738 * doc/bison.texinfo (final, strictfp, extends, implements): Add
2739 documentation.
2740 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
2741 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
2742 (AT_CHECK_JAVA_GREP): New.
2743 (Java parser class modifiers): New test.
2744 (Java parser class extends and implements): New test.
2745
2746 Model exception propagation better with throws and lex_throws.
2747 * data/java.m4 (b4_list2): New.
2748 (throws): Change default.
2749 * data/lalr1.java (yyaction): Add throws.
2750 (parse): Add lex_throws in addition to throws.
2751 * doc/bison.texinfo (throws, lex_throws): Add documentation.
2752 * tests/java.at (Java throws specifications): New test.
2753
2754 Improve documentation for Java parsers.
2755 * doc/bison.texinfo (Java Parsers): Add subsections.
2756 Don't quote first argument of %define.
2757 (Java Bison Interface): Document output files. Move documentation
2758 of parser class and merge into Java Parser Interface. Document
2759 features that error out. Document directives with no effect.
2760 Move note about Javadoc higher.
2761 (Java Semantic Values): Explicitly mention stype.
2762 Document that generic types cannot be used.
2763 (Java Location Values): Use @deftypeivar. Document constructors.
2764 Correct return value for toString.
2765 (Java Parser Interface): List undocumented constants/fields.
2766 Move documentation of fields added by %parse-param closer to list
2767 of members. Document that token names are added as fields.
2768 Document constructors accurately. Remove error method.
2769 (Java Scanner Interface): Move note on %pure-parser to Java Bison
2770 Interface. Describe %code lexer and yylex accutately.
2771 Remove documentation that does not match the code.
2772 (Java Action Features): New.
2773 (Java Differences): Add reference. Add item on semantic values.
2774 Add note about @{ ... @}. Clarify %% epilogue placement.
2775 (Java Declarations Summary): New.
2776
2777 Fix Java skeleton.
2778 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
2779 (b4_remove_comma): Quote test argument.
2780 (b4_identification): Remove "bison" field.
2781 * tests/java.at (Java parser class and package names): New test.
2782 (Java %parse-param and %lex-param): New test.
2783 (Java stype, position_class and location_class): New test.
2784
f259e4e6
PB
27852008-10-31 Di-an Jan <dianj@freeshell.org>
2786
2787 * data/lalr1.jave: Update copyright years.
2788 (YYParser): Correct name of "generated from" file in Javadoc:
2789 use b4_file_name instead of @ofile@.
2790 (Location constructor): Correct Javadoc parameter name.
2791 (yylloc): Add missing opening m4 quote after b4_location_if.
2792 This removes a stray [ in the Javadoc of Lexer.getStartPos.
2793 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
2794 (YYParser constructor): Correct Javadoc parameter name.
2795
cae5057f
JD
27962008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
2797
2798 Always put auxiliary code files in the same dir as other output files.
2799 * src/files.c (compute_file_name_parts): When the user specifies
2800 --output but not --file-prefix, extract the directory prefix from the
2801 file prefix not from the grammar file name. This affects the location
2802 of files like location.hh generated by the C++ skeleton. The includes
2803 in the other output files require this fix.
2804 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
2805 for expected output files.
2806 (Output files): Add a test for the above.
2807
4af432ba
JD
28082008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
2809
2810 * gnulib: Update submodule to HEAD.
2811
e26d4e43
JD
28122008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2813
2814 Update copyright year.
2815 * src/files.c: Here.
2816
c0ee9e21
DJ
28172008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
2818
2819 Don't overwrite the input file.
2820 * src/files.c (output_file_name_check): Fatal error if using input file
2821 for output.
2822 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
2823 argument.
2824 (Conflicting output files): Add test.
2825
482dc52f
AD
28262008-10-28 Akim Demaille <demaille@gostai.com>
2827
2828 Space changes.
2829 * data/lalr1.cc: Formatting changes.
2830
52cbbe84
AD
28312008-10-28 Akim Demaille <demaille@gostai.com>
2832
2833 Don't define debugging functions when !YYDEBUG.
2834 * data/lalr1.cc (debug_stream, set_debug_stream)
2835 (debug_level_type, debug_level, set_debug_level): Don't
2836 declare them when YYDEBUG is not defined.
2837 The implementation are already YYDEBUG-aware.
2838
0925d5bf
AD
28392008-10-28 Akim Demaille <demaille@gostai.com>
2840
2841 Prefer "continue" for empty loop bodies.
2842 * etc/bench.pl.in: Use "continue" instead of {}.
2843
cf98343c
AD
28442008-10-28 Akim Demaille <demaille@gostai.com>
2845
2846 Space and comments changes.
2847 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
2848 * data/c.m4, data/lalr1.cc: Space changes.
2849
9f467b7d
AD
28502008-10-28 Akim Demaille <demaille@gostai.com>
2851
2852 Make gnulib a submodule.
2853 * gnulib: New.
2854 * .gitmodules (gnulib): New.
2855
0f0e1ace
JD
28562008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
2857
2858 Fix yyerror_range for user-defined location type in C++. Reported by
2859 Georg Sauthoff at
2860 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
2861 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
2862 * THANKS (Georg Sauthoff): Add.
2863
548e2104
JD
28642008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
2865
2866 Update several administrative files mainly to facilitate releasing.
2867 * HACKING (Administrivia): Make the git-merge-changelog notes more
2868 helpful.
2869 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
2870 (Release Procedure): Update for git and add numerous details that were
2871 previously missing.
2872 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
2873 * maint.mk (announcement): Don't list bison as a bootstrap tool so
2874 that announcements don't claim we bootstrapped with whatever bison
2875 happened to be in PATH. Add flex as a bootstrap tool.
2876 * Makefile.maint: Remove, previously replaced by maint.mk.
2877 * Makefile.cfg: Remove, and migrate settings to...
2878 * cfg.mk: ... here for the sake of `make announcement'.
2879 * bootstrap.conf (gnulib_modules): Add announce-gen.
2880 * README: Say GNU Bison instead of just Bison. Suggested by Karl
2881 Berry.
2882
ddf17a6e
PB
28832008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
2884
2885 Small but important bugfixes for the Java skeleton.
2886 * data/lalr1.java (yyerror): Change Location to b4_location_type.
2887 (yy_symbol_print): Call toString on yyvaluep.
2888
e1145ad8
AD
28892008-08-29 Akim Demaille <demaille@gostai.com>
2890
2891 Clarify UPDATED use.
bee1df15 2892 * doc/bison.texinfo: It refers to the last edition of this file,
e1145ad8 2893 not to the release date of Bison.
bee1df15 2894 Reported by Joel E. Denny.
e1145ad8 2895
0df72d78
AD
28962008-08-29 Akim Demaille <demaille@gostai.com>
2897
2898 * README: Update FAQ pointer.
2899 Reported by Joel E. Denny.
2900
9a90b6bb
EB
29012008-08-27 Eric Blake <ebb9@byu.net>
2902
2903 Resync m4sugar from autoconf.
2904 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
2905 (m4_init): Adjust to latest m4.git changes.
2906 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
2907 effects.
2908 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
2909 (_m4_list_cmp): Reduce side effects.
2910
65015668
AD
29112008-08-27 Akim Demaille <demaille@gostai.com>
2912
2913 Check yyerrok in calc.at.
bee1df15
EB
2914 * tests/calc.at (calc.y): Use yyerrok on "( error )".
2915 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
2916 expected.
65015668 2917
98e26a92
AD
29182008-08-27 Akim Demaille <demaille@gostai.com>
2919
2920 Support yyerrok in lalr1.cc.
2921 YYBACKUP is still to import back into lalr1.cc.
bee1df15 2922 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
98e26a92 2923
86c0e784
JD
29242008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
2925
2926 For maintainer-check*, don't recompile for a $(VERSION) update.
2927 * cfg.mk: New file.
2928 (_is-dist-target): Override the one in GNUmakefile.
2929 * Makefile.am (EXTRA_DIST): Add cfg.mk.
2930
88511166
JD
29312008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
2932
2933 Update for recent change to gnulib.
2934 * src/parse-gram.y: Don't include strverscmp.h. It comes from
2935 string.h now.
2936
6bbb2ed5
EB
29372008-08-15 Eric Blake <ebb9@byu.net>
2938
d67c52e8
EB
2939 Remaining m4sugar merge from autoconf.
2940 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
2941 * data/m4sugar/foreach.m4: New file, copied from autoconf.
2942 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
2943 * src/output.c (output_skeleton): Tell m4 how to find it.
2944
6bbb2ed5
EB
2945 Partial m4sugar merge from autoconf: m4_map.
2946 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
2947 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
2948 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
2949 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
2950 for empty list.
2951 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
2952 Likewise.
2953 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
2954 declares it.
2955
8dce3875
JD
29562008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
2957
2958 Keep .version and PACKAGE_VERSION in sync.
2959 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
2960 dependency, and add comments justifying this in more detail. Discussed
2961 starting at
2962 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
2963
882a1fbf
EB
29642008-08-06 Eric Blake <ebb9@byu.net>
2965
a3764451
EB
2966 Partial m4sugar merge from autoconf: m4_shiftn.
2967 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
2968 (m4_shift2, m4_shift3): New macros.
2969 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
2970 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
2971 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
2972 * data/java.m4 (b4_remove_comma): Likewise.
2973
882a1fbf
EB
2974 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
2975 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
2976 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
2977 (m4_init): Consolidate wrapped text into single m4_wrap.
2978 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
2979 in wrapped text.
2980
a30e920d
EB
29812008-08-05 Eric Blake <ebb9@byu.net>
2982
dfcc5959
EB
2983 Partial m4sugar merge from autoconf: builtins, version.m4.
2984 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
2985 (m4_prepend): Remove, as it is unused and inherently quadratic,
2986 whereas m4_append is linear in newer m4.
2987 (m4_mkstemp): New builtin.
2988 (m4_symbols): Make rename conditional.
2989 (m4_version_prereq): Ensure fatal error if used in bison, which
2990 intentionally lacks version.m4.
2991
a30e920d
EB
2992 Fix comments in m4sugar.
2993 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
2994
445b7470
JD
29952008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
2996
2997 Update for recent .gitignore fix in Gnulib.
2998 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
2999 anchored .gitignore entries.
3000
a1e50014
JD
30012008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
3002
3003 Set gnu or gnits strictness.
3004 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
3005 development and gnits strictness for releases. Based on Eric Blake's
3006 suggestion at
3007 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
3008
d43f77e7
PB
30092008-07-31 Paolo Bonzini <bonzini@gnu.org>
3010
3011 * NEWS: Clarify documentation of %language.
3012
fee2ed87
PB
30132008-07-31 Paolo Bonzini <bonzini@gnu.org>
3014
3015 Support usage of git-merge-changelog.
3016 * .gitattributes: New.
3017 * HACKING: Document usage of git-merge-changelog.
3018 * bootstrap: Install git-merge-changelog entries in .git/config
3019 if appropriate.
3020
78029cd5
JD
30212008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3022
3023 Remove remaining dependence on CVS Id keyword.
3024 * ChangeLog: For the sake of people still using CVS, don't use dollars
3025 when mentioning Id.
3026 * data/xslt/bison.xsl: Remove Id from header comments, where it was
3027 unusual anyway.
3028 * data/xslt/xml2dot.xsl: Likewise.
3029 * data/xslt/xml2text.xsl: Likewise.
3030 * data/xslt/xml2xhtml.xsl: Likewise.
3031 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
3032 * doc/Makefile.am (neutralize): Remove, no longer needed.
3033 (.x.1): Don't use neutralize.
3034 (edit): Don't substitute for ID.
3035 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
3036
c53d18b1
JD
30372008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3038
3039 Fix dependence on computed configure variables.
3040 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
3041 $(top_srcdir)/configure.ac so that changes to computed variables, such
3042 as PACKAGE_VERSION, are seen.
3043 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
3044
5523ac79
JD
30452008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
3046
3047 Update copyright dates for recent changes.
3048 * Makefile.am: Here.
3049 * src/Makefile.am: Here.
3050 * src/reduce.c: Here.
3051 * tests/reduce.at: Here.
3052
8fa36911
JD
30532008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
3054
3055 Use git-version-gen for version names between releases.
3056 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
3057 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
3058 * .prev-version: New.
3059 * .version.in: Remove.
78029cd5 3060 * ChangeLog: Remove the Id previously used for capturing the CVS
8fa36911
JD
3061 revision.
3062 * GNUmakefile: Remove, now copied from Gnulib.
3063 * Makefile.am: Add code suggested by comments in
3064 build-aux/git-version-gen.
3065 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
3066 .prev-version, and .version.
3067 * NEWS (2.3b+): Rename to...
3068 (?.?): ... this because we're dropping the "+" version naming scheme,
3069 but, in general, we still can't be sure of our next release name.
3070 * bootstrap: Add a quick hack to remove from .gitignore the
3071 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
3072 entry. This should really be fixed in gnulib instead.
3073 * bootstrap.conf (gnulib_modules): Add gnumakefile.
3074 * configure.ac (AC_INIT): Set version name by invoking
3075 build-aux/git-version-gen.
3076 (AC_CONFIG_FILES): Remove .version, now generated by
3077 build-aux/git-version-gen.
3078 * maint.mk: New, copied from coreutils.
3079 * doc/.cvsignore (bison.1): Add.
3080 * doc/.gitignore (/bison.1): Add.
3081 * doc/bison.1: Remove, generated.
3082 * src/.cvsignore (revision.c): Remove.
3083 * src/.gitignore (/revision.c): Remove.
3084 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
3085 (BUILT_SOURCES): Remove revision.c.
3086 (revision.c): Remove.
3087 * src/getargs.c (version): Don't print revision after the VERSION.
3088 * src/revision.h: Remove.
3089
bcf07cb7
JD
30902008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
3091
3092 Fix untranslatable composition of sentences. Reported by Goran
3093 Uddeborg at
3094 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
3095 * THANKS (Goran Uddeborg): Add.
3096 * src/reduce.c (reduce_print): Report the number of nonterminals and
3097 rules useless in the grammar in separate sentences.
3098 * tests/reduce.at (Useless Rules): Update output.
3099 (Reduced Automaton): Likewise.
3100 (Underivable Rules): Likewise.
3101 (Empty Language): Likewise.
3102
9aacab9a
JD
31032008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
3104
3105 Fix some .gitignore and .cvsignore problems.
3106 * bootstrap (insert_sorted_if_absent): Replace all uses with...
3107 (insert_vc_ignore): ... this new function, which prepends `/' to all
3108 .gitignore entries before passing them to insert_sorted_if_absent.
3109 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
3110 .cvsignore files are maintained even though Bison developers run
3111 bootstrap while using Git.
3112 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
3113 unneeded by Bison.
3114 (gnulib): Add.
3115 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
3116 unneeded. Reported by Eric Blake.
3117 * lib/.gitignore (/*~): Add.
3118 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
3119 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
3120 Blake.
3121 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
3122
a9fc7990
JD
31232008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
3124
3125 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
3126 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
3127 * bootstrap.conf (gnulib_modules): Add unsetenv.
3128 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
3129 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
3130 (/setenv.m4): Add.
3131 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
3132 the first argument because it may become position-dependent, and unset
3133 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
3134 Add comments explaining these issues in more detail.
3135
0f1d6f10
JD
31362008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
3137
3138 Add .gitignore everywhere based on .cvsignore.
3139 * .gitignore: New.
3140 * build-aux/.gitignore: New.
3141 * data/.gitignore: New.
3142 * doc/.gitignore: New.
3143 * etc/.gitignore: New.
3144 * examples/.gitignore: New.
3145 * examples/calc++/.gitignore: New.
3146 * lib/.gitignore: New.
3147 * m4/.gitignore: New.
3148 * po/.gitignore: New.
3149 * runtime-po/.gitignore: New.
3150 * src/.gitignore: New.
3151 * tests/.gitignore: New.
3152
7bd1665a
JD
31532008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
3154
3155 * NEWS (2.3b+): New section, empty for now.
3156 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
3157
72c5b982
JD
31582008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
3159
3160 * NEWS (2.3b): Update release date since there has been a delay in
3161 getting the announcements and tarballs out.
3162
bd02cd5d
JD
31632008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
3164
3165 * NEWS: Version 2.3b.
3166 * configure.ac (AC_INIT): Likewise.
3167 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
3168
9126263e
JD
31692008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
3170
3171 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
3172 been doing it for years.
3173 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
3174 (Release Procedure): Add FIXME about make alpha being unmaintained.
3175
fa6aa7b3
JD
31762008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
3177
3178 * data/yacc.c: Reformat m4 a little for readability.
3179 * src/lalr.c (build_relations): Correct comment.
3180
d30b312d
JMG
31812008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3182
3183 DJGPP specific issue.
3184 * djgpp/config.sed: Fixes required to run configure scripts generated
3185 by autoconf 2.62.
3186
138d4cd9
JD
31872008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
3188
3189 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
3190 coordinator@translationproject.org.
3191
8f7e2e1f
JD
31922008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3193
3194 * THANKS: Add Eric Blake.
3195
f55efa38
JD
31962008-04-23 Eric Blake <ebb9@byu.net>
3197
3198 Revert prior patch, by working around autoconf regression.
3199 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
3200 ("Output file name: ("): Uncomment test.
3201 ("Output file name: )"): Likewise.
3202 Based on an idea from Noah Misch.
3203
096c9f9d
JD
32042008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
3205
3206 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
3207 2.61. Reported by Juan Manuel Guerrero at
3208 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
3209 * tests/output.at ("Output file name: ("): Comment out test case for
3210 now.
3211 ("Output file name: )"): Likewise.
3212
0f664b89
JD
32132008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
3214
3215 * GNUmakefile: Update git-version-gen invocation so make dist
3216 succeeds.
3217
1cfe6375
JD
32182008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
3219
3220 Update to the current gnulib CVS repository, and fix trigraph handling
3221 in Bison.
3222 * bootstrap: Update gnulib CVS repository URL.
3223 (symlink_to_dir): Encapsulate the code that guarantees the destination
3224 directory exists into...
3225 (check_dst_dir): ... this new function, and...
3226 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
3227 fail when copying files into lib/uniwidth/.
3228 * src/output.c (prepare_symbols): When writing yytname muscles, where
3229 symbol names will be encoded in C-string literals, tell quotearg to
3230 escape trigraphs. This used to be the default in gnulib.
3231 * tests/regression.at (Token definitions): Because of the change in
3232 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
3233 escapes trigraphs in symbol names. Thus, yytname no longer has
3234 trigraphs unnecessarily doubly escaped. Update test case output.
3235 Extend test case to be sure Bison's own error messages will no longer
3236 have trigraphs in symbol names unnecessarily escaped once.
3237
74c52fc8
JD
32382008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
3239
3240 Fix make dist infinite loop reported by Juan Manuel Guerrero at
3241 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
3242 * .cvsignore: Add .version.
3243 * .version.in: New.
3244 * bootstrap.conf (gnulib_modules): Add git-version-gen.
3245 * configure.ac (AC_CONFIG_FILES): Add .version.
3246 * build-aux/.cvsignore: Add git-version-gen.
3247
8e55b3aa
JD
32482008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
3249
3250 * NEWS (2.3a+): Mention that -g now takes an argument.
3251 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
3252 consistency. Update the -g and -x entries now that they take
3253 arguments. Use brackets to indicate optional arguments.
3254 * src/getargs.c (usage): Explain the relationship between arguments of
3255 long and short options more completely. Document --defines and -d
3256 separately since the former takes an argument but, for POSIX Yacc, the
3257 latter does not.
3258 (short_options): Let -W take an optional argument like --warnings.
8452fdd9 3259 (getargs): Sort cases.
8e55b3aa 3260
59c5ac72
AD
32612008-02-28 Akim Demaille <demaille@gostai.com>
3262
3263 * doc/bison.texinfo: Fix a few typos.
3264
118d4978
AD
32652008-02-28 Akim Demaille <akim@epita.fr>
3266
3267 * doc/bison.texinfo (Bison Options): Document -W.
3268 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
3269
7020f1e9
AD
32702008-02-28 Akim Demaille <akim@epita.fr>
3271
3272 * src/getargs.c (short_options): Split and sort for readability.
3273 -g and -x take optional arguments, just like their long options.
3274 * build-aux/cross-options.pl: Use /x to make the regexp easier to
3275 understand.
3276 Fix the handling of $opt which resulted in all the argument to be
3277 considered as optional.
3278
59da312b
JD
32792008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
3280
3281 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
3282 say its interface is experimental.
3283 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
3284 Java.
3285 (Bison Options): In the -L and --language entry, mention Java.
3286 (Java Bison Interface): Say the interface is experimental.
3287 * src/getargs.c (usage): Mention -L and --language.
3288
3289 * NEWS (2.3a+): Say the push parsing interface is experimental.
3290 * doc/bison.texinfo (Push Decl): Likewise.
3291 (Decl Summary): Likewise in the "%define api.push_pull" entry.
3292 (Push Parser Function): Likewise.
3293 (Pull Parser Function): Likewise.
3294 (Parser Create Function): Likewise.
3295 (Parser Delete Function): Likewise.
3296 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
3297 yypull_parse, and yypush_parse entries.
3298
3299 * NEWS (2.3a+): Mention XML support, and say the schema is
3300 experimental.
3301 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
3302 * src/getargs.c (usage): Say the XML schema is experimental.
3303
3304 * NEWS (2.3a+): Say option instead of flag.
3305
2bb3ebec
WP
33062008-02-21 Wojciech Polak <polak@gnu.org>
3307
3308 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
3309 text.
3310
333e670c
JD
33112008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
3312
3313 Fix impure push parser compile error reported by Bob Rossi at
3314 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
3315 * data/yacc.c: Clean up whitespace in the output a little.
3316 (yypstate_allocated): Define for impure push parsers regardless of
3317 whether the pull interface is also requested.
3318 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
3319 check impure push parsers without the pull interface.
3320
3321 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
3322 yyerror takes arguments specified by %parse-param while yypstate_new
3323 does not.
3324 * doc/bison.texinfo (Parser Create Function): Document that
3325 yypstate_new returns 0 for multiple impure parser instances.
3326 * tests/push.at (Push Parsing: Multiple impure instances): Update
3327 expected stderr output.
3328
798096e1
JD
33292008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
3330
3331 * runtime-po/POTFILES.in (push.c): Remove.
3332
9ca7f077
JD
33332008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
3334
3335 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
3336 * data/push.c: Rename to...
3337 * data/yacc.c: ... this, overwriting it.
3338 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
3339 `%push-pull-parser' -> `%define api.push_pull "both"'.
3340 Remove old yacc.c tests, and update push.c tests to yacc.c.
3341
42ee26bb
JD
33422008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
3343
3344 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
3345 `"%code top" blocks' instead of `%code "top" blocks'.
3346 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
3347 Clean up whitespace in the output a little.
3348
b1cc23c4
JD
33492008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
3350
3351 Fix documentation problems reported by Tim Josling at
3352 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
3353 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
3354 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
3355 integers. Explain the effect of literal string aliases on error
3356 messages. Copy token 0 documentation from the C++ skeleton
3357 documentation.
3358
ab7f29f8
JD
33592008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
3360
3361 Accept a token number in a %left, %right, or %nonassoc for POSIX
3362 conformance. Reported by Tim Josling at
3363 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
3364 * NEWS (2.3a+): Mention.
3365 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
3366 and code numbers are treated by precedence declarations.
3367 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
3368 of symbols.1.
3369 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
3370 of symbol.
3371 (symbol.prec): New, just like symbol but allows INT.
3372 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
3373 longer holds.
3374 * tests/regression.at (Token number in precedence declaration): New
3375 test case.
3376
a924ef36
JMG
33772008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3378
3379 DJGPP specific issues.
3380 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
3381 be changed. Copyright timestamp adjusted.
3382 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
3383 be changed. Copyright timestamp adjusted.
3384 * djgpp/config.site: Copyright timestamp adjusted.
3385 * djgpp/config_h.sed: Copyright timestamp adjusted.
3386 * djgpp/djunpack.bat: Copyright timestamp adjusted.
3387 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
3388 filename translation list.
3389 * djgpp/subpipe.c (init_subpipe): Check the environment variables
3390 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
3391 files shall be created. Before trying to use the temp dir where the
3392 environment variable points to check that the dir really exists. If
3393 not default to the cwd as temp dir. Copyright timestamp adjusted.
3394 * djgpp/subpipe.h: Copyright timestamp adjusted.
3395 * djgpp/testsuite.sed: Copyright timestamp adjusted.
3396
389c8cfd
PE
33972008-01-30 Paul Eggert <eggert@cs.ucla.edu>
3398
3399 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
3400
5d1cfef4
PE
34012008-01-09 Paul Eggert <eggert@cs.ucla.edu>
3402
3403 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
3404 Problem reported by Claudio Saavedra in
3405 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
3406
e2dcf996
WP
34072008-01-05 Wojciech Polak <polak@gnu.org>
3408
3409 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
3410 document's title with the input grammar file name.
3411
da730230
JD
34122007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
3413
3414 Automate regression testing of the XML/XSLT implementation. Discussed
3415 starting at
3416 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
3417 * configure.ac (XSLTPROC): New substitution.
3418 * Makefile.am (maintainer-xml-check): New phony target invoking...
3419 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
3420 invoking make maintainer-check with BISON_TEST_XML=1.
3421 * tests/atlocal.in (XSLTPROC): New.
3422 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
3423 not to report reachable memory when Bison is expected to have a
3424 non-zero exit status and (2) to compare XML/XSLT output with --graph
3425 and --report=all output for every working grammar when
3426 BISON_TEST_XML=1.
3427 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
3428 (AT_BISON_CHECK_XML): New.
3429 (AT_QUELL_VALGRIND): New.
3430 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
3431 (AT_CHECK): ... don't redefine this since this was the old way to
3432 quell Valgrind.
3433 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
3434 AT_BISON_CHECK invocations.
3435 * tests/c++.at: Likewise.
3436 * tests/calc.at: Likewise.
3437 * tests/conflicts.at: Likewise.
3438 * tests/cxx-type.at: Likewise.
3439 * tests/existing.at: Likewise.
3440 * tests/glr-regression.at: Likewise.
3441 * tests/headers.at: Likewise.
3442 * tests/input.at: Likewise.
3443 * tests/java.at: Likewise.
3444 * tests/output.at: Likewise.
3445 * tests/push.at: Likewise.
3446 * tests/reduce.at: Likewise.
3447 * tests/regression.at: Likewise.
3448 * tests/sets.at: Likewise.
3449 * tests/skeletons.at: Likewise.
3450 * tests/synclines.at: Likewise.
3451 * tests/torture.at: Likewise.
3452 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
3453 tends to hang xsltproc.
3454 (Big horizontal): Likewise.
3455
408476bc
JD
34562007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
3457
3458 In XML output, remove redundant class attribute on symbol element.
3459 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
3460 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
3461 look up a symbol to determine whether it's a nonterminal or terminal.
3462 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
3463 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
3464
3465 Add prec/assoc information to XML output.
3466 * src/gram.c (grammar_rules_print_xml): For each rule that has a
3467 %prec, add a percent_prec attribute.
3468 * src/print-xml.c (print_grammar): For each terminal that has a
3469 precedence or associativity, add a prec or assoc attribute.
3470 (xml_indent): New.
3471 (xml_puts): Use xml_indent.
3472 (xml_printf): Use xml_indent.
3473 * src/print-xml.h (xml_indent): Prototype.
3474
3475 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
3476 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
3477
d4a26c48
JD
34782007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
3479
3480 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
3481 (bison:ruleByNumber): ... this for clarity.
3482 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
3483 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
3484 (xsl:template match="reduction"): Update.
3485 (xsl:template match="item"): Update.
3486 (xsl:template match="reduction"): Update.
3487
3488 In the XML output, don't print the list of rules where symbols appear.
3489 Compute it in XSLT instead. Discussed at
3490 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
3491 * data/xslt/bison.xsl (bison:ruleByLhs): New.
3492 (bison:ruleByRhs): New.
3493 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
3494 bison:ruleByRhs.
3495 (xsl:template match="terminal/rule"): Remove.
3496 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
3497 bison:ruleByRhs.
3498 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
3499 Remove.
3500 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
3501 bison:ruleByRhs and mode="number-link" for rule template.
3502 (xsl:template match="terminal/rule"): Remove.
3503 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
3504 bison:ruleByRhs and mode="number-link" for rule template.
3505 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
3506 Rewrite as...
3507 (xsl:template match="rule" mode="number-link"): ... this.
3508 * src/print-xml.c (print_grammar): Don't print the list of rules.
3509
ef1b4273
JD
35102007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
3511
3512 Don't let --report affect XML output; always print all information.
3513 Discussed at
3514 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
3515 * src/conflicts.c (log_resolution): Implement.
3516 * src/print-xml.c (print_core): Implement.
3517 (print_state): Implement.
3518 (print_xml): Implement.
3519
3520 * NEWS (2.3a+): Fix quotes.
3521 * src/parse-gram.y (prologue_declaration): For consistency with -v,
3522 don't let %verbose clear the list specified by --report.
3523
0f6cd9e3
AD
35242007-11-26 Akim Demaille <akim@epita.fr>
3525
3526 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
3527
d80fb37a
JD
35282007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
3529
3530 In the XML output, list useless and unused symbols and rules with the
3531 useful ones and add a "usefulness" attribute. Discussed starting at
3532 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
3533 * src/gram.c (grammar_rules_partial_print_xml): Remove.
3534 (grammar_rules_print_xml): Print all rules instead of just those
3535 useful in the grammar, and add a "usefulness" attribute.
3536 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
3537 * src/print-xml.c (print_rules_useless_in_parser): Remove.
3538 (print_grammar): Print all nonterminals instead of just useful ones,
3539 and add a "usefulness" attribute to nonterminals and terminals.
3540 (print_xml): Don't print a separate "reductions" or
3541 "rules-useless-in-parser" element.
3542 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
3543 (reduce_xml): Remove.
3544 (reduce_token_unused_in_grammar): New.
3545 (reduce_nonterminal_useless_in_grammar): New.
3546 * src/reduce.h (reduce_xml): Remove prototype.
3547 (reduce_token_unused_in_grammar): Add prototype.
3548 (reduce_nonterminal_useless_in_grammar): Add prototype.
3549 * data/xslt/xml2text.xsl: Update for XML changes.
3550 * data/xslt/xml2xhtml.xsl: Update for XML changes.
3551 * tests/reduce.at (Useless Terminals): Update output.
3552 (Useless Rules): Update output.
3553 (Reduced Automaton): Update output.
3554
3555 Say "Terminals unused in grammar" instead of "Unused terminals".
3556 * NEWS (2.3a+): Update.
3557 * doc/bison.texinfo (Understanding): Update example output.
3558 * src/reduce.c (reduce_output): Implement.
3559 * data/xslt/xml2text.xsl: Implement.
3560 * data/xslt/xml2xhtml.xsl: Implement.
3561
1bb2bd75
JD
35622007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
3563
3564 Accept --report-file=FILE to override the default `.output' filename.
3565 * NEWS (2.3a+): Mention.
3566 * doc/bison.texinfo (Bison Options): Add an entry.
3567 * src/files.c (compute_output_file_names): Don't override
3568 spec_verbose_file if already set.
3569 * src/getargs.c (usage): Document --report-file.
3570 (REPORT_FILE_OPTION): New anonymous enum member.
3571 (long_options): Add entry for it.
3572 (getargs): Add case for it setting spec_verbose_file.
3573
3574 * build-aux/cross-options.pl: Don't record a short option just because
3575 there's an arg.
3576 * doc/.cvsignore: Add yacc.1.
3577
a005a9c4
AD
35782007-11-14 Akim Demaille <akim@epita.fr>
3579
3580 * doc/yacc.1.in: New.
3581 * configure.ac, doc/Makefile.am: Adjust.
3582 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
3583 config.h symbol.
3584 Use AC_SUBST for assignments too.
3585 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
3586
cff03fb2
JD
35872007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
3588
3589 * src/gram.c: Remove comments that duplicate comments in gram.h.
3590
3591 When reporting useless rules and nonterminals, say "useless in grammar"
3592 instead of "useless", and say "useless in parser" instead of "never
3593 reduced". Discussed starting at
3594 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
3595 * NEWS (2.3a+): Mention this change.
3596 * data/xslt/xml2text.xsl: Update output text and expected input XML
3597 element names to match changes below.
3598 * data/xslt/xml2xhtml.xsl: Likewise.
3599 (xsl:template match="bison-xml-report"): Add missing entry in Table of
3600 Contents: "Rules useless in parser due to conflicts".
3601 * doc/bison.texinfo (Decl Summary): Reword a little.
3602 (Understanding): Update example output for changes below.
3603 * src/gram.c: (rule_useful_p): Rename to...
3604 (rule_useful_in_grammar_p): ... this.
3605 (rule_useless_p): Rename to...
3606 (rule_useless_in_grammar_p): ... this.
3607 (rule_never_reduced_p): Rename to...
3608 (rule_useless_in_parser_p): ... this.
3609 (grammar_rules_print): Update for renames.
3610 (grammar_rules_print_xml): Update for renames.
3611 (grammar_rules_never_reduced_report): Rename to...
3612 (grammar_rules_useless_report): ... this since it is used for either
3613 kind of useless rule.
3614 * src/gram.h: Reword comments and update function names in prototypes.
3615 * src/main.c (main): Say "rule useless in parser due to conflicts".
3616 * src/print-xml.c (print_rules_never_reduced): Rename to...
3617 (print_rules_useless_in_parser): ... this, and rename output XML
3618 element "rules-never-reduced" to "rules-useless-in-parser".
3619 (print_xml): Update for rename.
3620 * src/print.c (print_results): Say "Rules useless in parser due to
3621 conflicts".
3622 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
3623 (nonterminals_reduce): Say "nonterminal useless in grammar".
3624 (reduce_output): Say "Nonterminals useless in grammar".
3625 Say "Rules useless in grammar".
3626 (reduce_xml): Rename output XML element "useless" to
3627 "useless-in-grammar".
3628 (reduce_print): Don't report the count of grammatically useless rules
3629 as "rules never reduced" just because %yacc is specified.
3630 In the correct report of this count, say nonterminal(s) and rule(s)
3631 "useless in grammar".
3632 * tests/conflicts.at (S/R in initial): Update expected output.
3633 (Defaulted Conflicted Reduction): Likewise.
3634 (Unreachable States After Conflict Resolution): Likewise.
3635 * tests/existing.at (GNU pic Grammar): Likewise.
3636 * tests/reduce.at (Useless Nonterminals): Likewise.
3637 (Useless Rules): Likewise.
3638 (Reduced Automaton): Likewise.
3639 (Underivable Rules): Likewise.
3640 (Empty Language): Likewise.
3641
66f0441d
JD
36422007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
3643
3644 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
3645 here document and before the EOF so that BSD's implementation of Bourne
3646 shell doesn't parse the delimiter as part of the here document.
3647 * doc/.cvsignore: Add cross-options.texi.
3648 * src/getargs.c (usage): Add a blank line after the warning categories.
3649
d0ee4105
PB
36502007-11-08 Paolo Bonzini <bonzini@gnu.org>
3651
3652 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
3653
e8b1fb9b
AD
36542007-11-05 Akim Demaille <akim@epita.fr>
3655
3656 Remove Id: from bison.1.
3657 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
3658 (perl -0777 -pi -e 's/\.PP\nId): New.
3659 (.x.1): Use it to ignore the version control revision.
3660
2f7a96b5
AD
36612007-11-05 Akim Demaille <demaille@gostai.com>
3662
3663 * build-aux/Makefile.am: Ship cross-options.pl.
3664 * doc/Makefile.am: Always refer to cross-options.texi with
3665 $(srcdir).
3666 (MAINTAINERCLEANFILES): Add it.
3667
f4101aa6
AD
36682007-11-04 Akim Demaille <demaille@gostai.com>
3669
3670 Generate the long/short option cross-table.
3671 * build-aux/cross-options.pl: New.
3672 * doc/Makefile.am (cross-options.texi): New.
3673 * doc/bison.texinfo: Use it.
3674
727a1401
AD
36752007-11-04 Akim Demaille <demaille@gostai.com>
3676
3677 Generate bison.1 using help2man.
3678 * doc/common.x, doc/bison.x: New.
3679 * doc/Makefile.am (bison.1, .x.1): New.
3680 The code is taken from autoconf-2.61/man/Makefile.am.
3681 * configure.ac: Look for help2man.
3682
6aeb9c57
AD
36832007-11-04 Akim Demaille <demaille@gostai.com>
3684
3685 Complete --help.
3686 * src/getargs.c (usage): Document -W, make it clear that -d,
3687 -g and -x have optional arguments.
3688
d7be4085
AD
36892007-11-04 Akim Demaille <demaille@gostai.com>
3690
3691 Find sha1sum when named gsha1sum.
3692 * bootstrap (find_tool): New.
3693 ($SHA1SUM): New.
3694
d9df47b6
JD
36952007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
3696
3697 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
3698 at
3699 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
3700 * NEWS (2.3a+): Mention.
3701 * data/bison.m4 (b4_pure_if): Don't define it here.
3702 * data/c.m4 (b4_identification): Depend on individual skeletons to
3703 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
3704 values of the %define variables api.pure or api.push_pull. Define
3705 YYPURE, YYPUSH, and YYPULL accordingly.
3706 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
3707 glr.cc has already defined b4_pure_flag.
3708 * data/push.c: Define b4_pure_if based on `%define api.pure'.
3709 Remove YYPUSH and YYPULL since they're back in b4_identification again.
42ee26bb 3710 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
d9df47b6
JD
3711 * doc/bison.texinfo (Pure Decl): Update.
3712 (Push Decl): Update.
3713 (Decl Summary): Add api.pure to %define entry.
3714 In %pure-parser entry, say it's deprecated and reference %define.
3715 (Pure Calling): Update.
3716 (Error Reporting): Update.
3717 (C++ Scanner Interface): Update.
3718 (How Can I Reset the Parser): Update.
3719 (Table of Symbols): In %pure-parser entry, say it's deprecated and
3720 reference %define.
3721 * src/getargs.c (pure_parser): Remove global variable.
3722 * src/getargs.h (pure_parser): Remove extern.
3723 * src/output.c (prepare): Don't define pure_flag muscle.
3724 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
3725 wrapper around `%define api.pure'.
3726 * tests/calc.at (Simple LALR Calculator): Update.
3727 (Simple GLR Calculator): Update.
3728 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
3729 Update.
3730 (GLR: Resolve ambiguity, pure, locations): Update.
3731 (GLR: Merge conflicting parses, pure, no locations): Update.
3732 (GLR: Merge conflicting parses, pure, locations): Update.
3733 * tests/glr-regression.at (Uninitialized location when reporting
3734 ambiguity): Update
3735 * tests/input.at (Unused %define api.pure): New test case.
3736 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
3737 AT_PURE_IF and AT_PURE_AND_LOC_IF.
3738 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
3739
c373bf8b
JD
37402007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
3741
3742 %define push_pull -> %define api.push_pull. Discussed starting at
3743 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
3744 * data/push.c: Expect the new name.
3745 * data/yacc.c: Likewise.
3746 * doc/bison.texinfo (Push Decl): Update.
3747 (Decl Summary): Update %define entry.
3748 (Push Parser Function): Update.
3749 (Pull Parser Function): Update.
3750 (Parser Create Function): Update.
3751 (Parser Delete Function): Update.
3752 * tests/calc.at (Simple LALR Calculator): Update.
3753 * tests/input.at (%define enum variables): Update.
3754 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
3755 (Push Parsing: Multiple impure instances): Update.
3756 (Push Parsing: Unsupported Skeletons): Update.
3757 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
3758 (Exploding the Stack Size with Malloc): Update.
3759
3760 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
3761 other entries some.
3762
32f19b6b
JD
37632007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
3764
3765 For the XML output's terminal element, rename @number to @token-number,
3766 and add @symbol-number. In the nonterminal element, rename @number to
3767 @symbol-number. Discussed starting at
3768 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
3769 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
3770 renames.
3771 (xsl:template match="nonterminal"): Likewise.
3772 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
3773 (xsl:template match="nonterminal"): Likewise.
3774 * src/print-xml.c (print_grammar): Implement.
3775
255a6b90
JD
37762007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
3777
3778 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
3779 2007-10-11 change, the child elements here are items not rules.
408476bc 3780 (xsl:template match="item"): New.
255a6b90
JD
3781 (xsl:template match="rule"): Update for new reduced itemset.
3782 (xsl:template match="point"): Remove.
3783 (xsl:template match="empty"): For consistency with --graph, don't
3784 output "/* empty */".
3785 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
3786 line-wrap, don't pass a negative value as first-line-length since this
3787 won't work with the following changes.
3788 (xsl:template name="line-wrap"): Simplify slightly.
3789 (xsl:template name="ws-search"): Eliminate recursion.
3790 * src/print_graph.c (print_core): Don't print a reduction's lookahead
3791 set next to an item whose dot is not at the end of the RHS even if it
3792 happens to be associated with the same rule.
3793
88c78747
JD
37942007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
3795
31984206
JD
3796 Add %define lr.keep_unreachable_states.
3797 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
3798 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
3799 * src/main.c (main): Implement it.
3800 * tests/conflicts.at (Unreachable States After Conflict Resolution):
3801 Extend to test it, and fix a typo.
3802
38032007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
3804
3805 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
3806 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
3807 the example .output text.
3808 * tests/regression.at (Extra lookahead sets in report): Improve wording
3809 of comments.
3810
b7a70162
WP
38112007-10-17 Wojciech Polak <polak@gnu.org>
3812
3813 * src/print-xml.c (print_grammar): Renamed
3814 <terminal> and <nonterminal> attributes:
3815 "type" to "number" and "symbol" to "name".
3816 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
3817 Use new attribute names.
3818 (xsl:template match="nonterminal"): Likewise.
3819 * data/xslt/xml2xhtml.xsl: Likewise.
3820
a0de5091
JD
38212007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
3822
3823 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
3824 (Option Cross Key): Likewise.
3825
3826 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
3827 next to an item whose dot is not at the end of the RHS even if it
3828 happens to be associated with the same rule.
3829 * src/print.c (print_core): Likewise.
3830 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
3831 (Resolved SR Conflicts): Update output.
3832 * tests/regression.at (Extra lookahead sets in report): New test case.
3833
4c20d18d
WP
38342007-10-11 Wojciech Polak <polak@gnu.org>
3835
3836 * src/print-xml.c (print_core): Remove item set
3837 redundancy.
3838 * data/xslt/bison.xsl (bison:ruleNumber): New key.
3839 Improve processing time. Suggested by Joel E. Denny.
3840 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
3841 Write xsl:param "required" attribute as comment.
3842 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
3843 (xsl:template match="rule"): Support new reduced itemset.
3844 (xsl:template match="point"): Remove.
3845 * data/xslt/xml2xhtml.xsl: Likewise.
3846
f506ad1c
JD
38472007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
3848
3849 * src/getargs.c (version): Update copyright year.
3850
21f1b063
JD
38512007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
3852
3853 Make xml2dot.xsl and --graph produce the same output.
3854 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
3855 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
3856 escaped later.
3857 (xsl:template name="output-node"): Use the new escape template instead
3858 of the string-replace template directly.
3859 (xsl:template name="output-edge"): Likewise.
3860 (xsl:template name="escape"): New, escapes backslashes and newlines in
3861 addition to quotation marks.
3862 * src/graphviz.c (start_graph, output_node, output_edge): Add
3863 whitespace to output for legibility.
3864
3865 Make xml2text.xsl and --report produce the same output, and remove the
3866 XML "conflicts" element since a conflict summary is easily extracted
3867 from the automaton.
3868 * data/xslt/bison.xsl: New.
3869 (xsl:template match="state" mode="bison:count-conflicts): New.
3870 * data/xslt/xml2text.xsl: Import bison.xsl.
3871 (xsl:template match="bison-xml-report"): Instead of styling the
3872 "conflicts" element, style the "automaton" element with mode
3873 "conflicts". Unlike the former, the latter lists S/R and R/R
3874 conflicts for a state on the same line.
3875 (xsl:template match="conflicts"): Remove.
3876 (xsl:template match="conflict"): Remove.
3877 (xsl:template match="terminal"): Line-wrap the list of rules in which
3878 the terminal is used.
3879 (xsl:template match="nonterminal"): Likewise for nonterminals.
3880 (xsl:template match="automaton" mode="conflicts"): New.
3881 (xsl:template match="state" mode="conflicts"): New.
3882 (xsl:template name="line-wrap"): New.
3883 (xsl:template name="ws-search"): New.
3884 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
3885 (xsl:template match="bison-xml-report"): Instead of styling the
3886 "conflicts" element, style the "automaton" element with mode
3887 "conflicts."
3888 (xsl:template match="conflicts"): Remove.
3889 (xsl:template match="conflict"): Remove.
3890 (xsl:template match="automaton" mode="conflicts"): New.
3891 (xsl:template match="state" mode="conflicts): New.
3892 * src/conflicts.c (conflicts_output_xml): Remove.
3893 * src/conflicts.h (conflicts_output_xml): Remove prototype.
3894 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
3895 * src/print.c (print_grammar): Consistently wrap at the 66th column so
3896 the corresponding XSLT is easier. Also, never wrap between a word and
3897 the comma that follows it.
3898
793fbca5
JD
38992007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
3900
3901 Improve C++ namespace support. Discussed starting at
3902 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
3903 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
3904 b4_namespace_close): New macros that interpret the %define variable
3905 "namespace" so its value can contain "::" to indicate nested
3906 namespaces.
3907 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
3908 the above macros.
3909 * data/lalr1.cc (b4_namespace): Likewise.
3910 * data/location.cc (b4_namespace): Likewise.
3911 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
3912 inside a new table in the general %define entry. Document `%define
3913 namespace' there as well. Point the %name-prefix entry to it since it
3914 explains it more completely in the case of C++.
3915 (C++ Bison Interface): Mention `%define namespace' instead of
3916 %name-prefix.
3917 (Table of Symbols): Remove the `%define push_pull' entry. The %define
3918 entry suffices.
3919 * tests/c++.at (Relative namespace references): New test case.
3920 (Absolute namespace references): New test case.
3921 (Syntactically invalid namespace references): New test case.
3922 * tests/input.at (C++ namespace reference errors): New test case.
3923
35b8730d
JD
39242007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
3925
3926 Add syncline support and location accessor to internal %define
3927 interfaces.
3928 * data/bison.m4 (b4_percent_define_get_loc): New.
3929 (b4_percent_define_get_syncline): New.
3930 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
3931 (b4_percent_define_default): Record defining location as line 1 rather
3932 than 0 for the sake of synchronizing #line's, and define
3933 b4_percent_define_syncline(VARIABLE).
3934 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
3935 * src/muscle_tab.c (muscle_syncline_grow): New.
3936 (muscle_code_grow): Use muscle_syncline_grow.
3937 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
3938 define b4_percent_define_syncline(VARIABLE).
3939 (muscle_percent_define_get_loc): New.
3940 (muscle_percent_define_get_syncline): New.
3941 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
3942 remove some unused variables.
3943 (muscle_percent_define_default): Record defining location as line 1
3944 rather than 0 for the sake of synchronizing #line's, and define
3945 b4_percent_define_syncline(VARIABLE).
3946 (muscle_percent_define_check_values): Use
3947 muscle_percent_define_get_loc.
3948 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
3949 (muscle_percent_define_get_syncline): Prototype.
3950 * tests/skeletons.at (%define Boolean variables: invalid skeleton
3951 defaults): Update output for location change.
3952 (Complaining during macro argument expansion): Extend to test
3953 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
3954
7dc4a694
JD
39552007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
3956
3957 Fix some error-reporting macro bugs.
3958 * data/bison.m4 (b4_cat): New.
3959 (b4_error, b4_error_at): Use b4_cat to send error directives directly
3960 to stdout so they don't become arguments to other macros. Update
3961 comments and add examples.
3962 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
3963 add examples.
3964 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
3965 after printing the error directive so that M4 doesn't report subsequent
3966 problems that are induced by this problem.
3967 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
3968 instead of just in them. Recognize @\n in both places. Both expand to
3969 the empty string. Needed by b4_cat.
3970 * tests/skeletons.at (Complaining during macro argument expansion):
3971 New test case.
3972 (Fatal errors make M4 exit immediately): New test case.
3973
d4bd2295
JD
39742007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
3975
3976 Implement --print-datadir.
3977 * src/getargs.c (usage): Mention.
3978 (PRINT_DATADIR_OPTION): New anonymous enum member.
3979 (long_options): Add entry for it.
3980 (getargs): Add case for it calling compute_pkgdatadir.
3981 * src/output.c (output_skeleton): Encapsulate data directory
3982 computation from here...
3983 (prepare): ... and from here...
3984 (compute_pkgdatadir): ... into this new function.
3985 * src/output.h (compute_pkgdatadir): Prototype.
3986
34cdeddf
JD
39872007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
3988
3989 * src/print-xml.c (escape_bufs): New static global variable
3990 replacing...
3991 (xml_escape_n): ... the static local variable buf here.
3992 (print_xml): Free memory for escape_bufs.
3993 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
3994
d782395d
JD
39952007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
3996
3997 Replace `%push-parser' and `%push-pull-parser' with
3998 `%define push_pull "push"' and `%define push_pull "both"'.
3999 `%define push_pull "pull"' is the default.
4000 * doc/bison.texinfo (Push Decl, Push Parser Function,
4001 Pull Parser Function, Parser Create Function, Parser Delete Function):
4002 Update declarations.
4003 (Decl Summary, Table of Symbols): Replace %push-parser and
4004 %push-pull-parser entries with a %define push_pull entry.
4005 * data/bison.m4 (b4_percent_define_check_values): New macro.
4006 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
4007 definitions...
4008 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
4009 definitions...
4010 * data/push.c: ... to here and compute them from the value of the
4011 %define variable push_pull.
4012 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
4013 parsing requests here...
4014 * data/yacc.c: ... hack this to switch to push.c any time
4015 b4_use_push_pull_flag or the %define variable push_pull is set. This
4016 will go away when we mv push.c yacc.c.
4017 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
4018 push parsing is not supported since unused %define variables are
4019 reported anyway.
4020 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
4021 * src/muscle_tab.h (muscle_percent_define_check_values): Update
4022 comments for consistency with b4_percent_define_check_values.
4023 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
4024 muscles.
4025 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
4026 Remove.
4027 (prologue_declaration): Remove %push-parser and %push-pull-parser
4028 rules.
4029 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
4030 * tests/calc.at: Update declarations.
4031 * tests/input.at (%define enum variables): New test case.
4032 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
4033 declaration.
4034 (Push Parsing: Multiple impure instances): Update declaration.
4035 (Push Parsing: Unsupported Skeletons): New test case.
4036 * tests/torture.at (Exploding the Stack Size with Alloca): Update
4037 declaration.
4038 (Exploding the Stack Size with Malloc): Update declaration.
4039
3f999f78
WP
40402007-09-24 Wojciech Polak <polak@gnu.org>
4041
4042 Add XSLT transformations.
4043
4044 * data/xslt/xml2dot.xsl: Transform XML into DOT.
4045 * data/xslt/xml2text.xsl: Transform XML into plain text.
4046 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
4047 * data/Makefile.am (xsltdir): New variable.
4048 (dist_xslt_DATA): Add xslt/*.xsl files.
4049
a4f75309
PE
40502007-09-23 Paul Eggert <eggert@cs.ucla.edu>
4051
4052 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
4053 Problem reported by Wojciech Polak.
4054 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
4055 (xml_printf): Undo change I made on 21 September; that is,
4056 indent 2 spaces, not 1.
4057
ad5feac4
JD
40582007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
4059
4060 Pacify ./configure --enable-gcc-warnings.
4061 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
4062 `char const *' instead of `char *'.
4063 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
4064 local variable `sep'.
4065
41d7a5f2
PE
40662007-09-21 Paul Eggert <eggert@cs.ucla.edu>
4067
4068 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
4069 elsewhere.
4070 * src/print-xml.c: Prefer "const" after types; that's more consistent.
4071 (xml_printf): Indent just 1 space for level.
4072 (e_char, xlate_char): Remove.
4073 (xml_escape_string): Rewrite to avoid undefined behavior (used
4074 storage that was freed from the stack).
4075 (xml_escape_n): Don't bother checking for subscript error.
4076
3f999f78
WP
40772007-09-21 Wojciech Polak <polak@gnu.org>
4078
4079 Add Bison XML Automaton Report.
41d7a5f2
PE
4080
4081 Add support for an -x option to generate an XML report.
4082 It is not documented yet.
4083 * src/print-xml.c: New file.
4084 * src/print-xml.h: Likewise.
4085 * lib/timevar.def (TV_XML): New var.
4086 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
4087 * src/conflicts.c: Include print-xml.h.
4088 (solved_conflicts_xml_obstack): New var.
4089 (log_resolution, conflicts_solve, conflicts_free):
4090 Add support for XML report.
4091 (conflicts_output_val): New function.
4092 * src/conflicts.h (conflicts_output_val): New decl.
4093 * src/files.c (spec_xml_file): New var.
4094 (compute_output_file_names, output_file_names_free): Add XML support.
4095 * src/files.h (spec_xml_file): New decl.
4096 * src/getargs.c (xml_flag): New var.
4097 (usage, short_options, long_options, getargs): Add XML support.
4098 * src/getargs.h (xml_flag): New decl.
4099 * src/gram.c: Include print-xml.h.
4100 (rule_lhs_print_xml, rule_rhs_print_xml):
4101 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
4102 New functions.
4103 * src/gram.h: Declare external ones.
4104 * src/main.c: Include print-xml.h.
4105 (main): Add XML support.
4106 * src/reduce.c: Include print-xml.h.
4107 (reduce_xml): New function.
4108 * src/reduce.h: Declare it.
4109 * src/state.c: Include print-xml.h.
4110 (state_new): Add XML support.
4111 (state_rule_lookahead_tokens_print_xml): New function.
4112 * src/state.h: Declare it.
4113 (struct state): New member solved_conflicts_xml.
4114 * src/symtab.c (symbol_class_get_string): New function.
4115 * src/symtab.h: Declare it.
4116
6d8e724d
PE
41172007-09-21 Paul Eggert <eggert@cs.ucla.edu>
4118
4119 * GNUmakefile: Switch to coreutils's version.
4120 * bootstrap: Likewise.
4121 * Makefile.cfg: Adjust to new GNUmakefile.
4122 * README-hacking: Likewise.
4123
4124 Import from gnulib:
4125
4126 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
4127 Bruno Haible <bruno@clisp.org>
4128
4129 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
4130 and is a script that invokes bison. Tighten the code. Add comments.
4131
922bdd7f
JD
41322007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
4133
4134 Spell "boolean" as "Boolean". Reported by Akim Demaille.
4135 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
4136 * doc/bison.texinfo (Decl Summary): Fix.
4137 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
4138 * tests/input.at (Boolean %define variables): Update output.
4139 * tests/skeletons.at (%define boolean variables: invalid skeleton
4140 defaults): Rename to...
4141 (%define Boolean variables: invalid skeleton defaults): ... this and
4142 update output.
4143
1b17b01d
JD
41442007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
4145
4146 In impure push mode, don't allow more than one yypstate to be allocated
4147 since multiple impure parsers would corrupt yynerrs.
4148 * data/push.c (yypstate_allocated): New static global variable
4149 initialized to 0.
4150 (yypull_parse): If yypstate_new returns 0, don't report it as memory
4151 exhaustion if yypstate_allocated is 1, but still return 2.
4152 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
4153 already 1. Otherwise, set it to 1.
4154 (yypstate_delete): Set it to 0.
4155 * tests/push.at (Push Parsing: Multiple impure instances): New test
4156 case.
4157
9987d1b3
JD
41582007-08-17 Bob Rossi <bob@brasko.net>
4159
4160 * doc/bison.texinfo (Push Decl): Document the push parser.
4161 (Table of Symbols): Ditto.
4162 (Pure Decl): Ditto.
4163 (Decl Summary): Ditto.
4164 (Multiple Parsers, Push Parser Function, Pull Parser Function,
4165 Parser Create Function, Parser Delete Function):
4166 Add new push parser symbols.
4167 (Table of Symbols): Document push-parser, push-pull-parser,
4168 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
4169
f16b0819
PE
41702007-08-15 Paul Eggert <eggert@cs.ucla.edu>
4171
4172 Update to GPLv3.
4173 * doc/gpl-3.0.texi: New file.
4174 * doc/gpl.texi: Remove.
4175 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
4176 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
4177 * README-hacking, TODO, bootstrap, bootstrap.conf:
4178 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
4179 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
4180 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
4181 * data/lalr1.cc, data/lalr1.java, data/location.cc:
4182 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
4183 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
4184 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
4185 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
4186 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
4187 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
4188 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
4189 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
4190 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
4191 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
4192 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
4193 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
4194 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
4195 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
4196 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
4197 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
4198 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
4199 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
4200 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
4201 * src/complain.c, src/complain.h, src/conflicts.c:
4202 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
4203 * src/files.h, src/flex-scanner.h, src/getargs.c:
4204 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
4205 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
4206 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
4207 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
4208 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
4209 * src/print.c, src/print.h, src/print_graph.c:
4210 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
4211 * src/reduce.h, src/relation.c, src/relation.h:
4212 * src/revision.h, src/scan-code.h, src/scan-code.l:
4213 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
4214 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
4215 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
4216 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
4217 * tests/Makefile.am, tests/actions.at, tests/c++.at:
4218 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
4219 * tests/existing.at, tests/glr-regression.at:
4220 * tests/headers.at, tests/input.at, tests/java.at:
4221 * tests/local.at, tests/output.at, tests/push.at:
4222 * tests/reduce.at, tests/regression.at, tests/sets.at:
4223 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
4224 * tests/torture.at:
4225 Update to GPLv3.
4226
728c4be2
JD
42272007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
4228
4229 Get rid of broken %no-parser, -n, and --no-parser implementation and
4230 documentation.
4231 * TODO: Don't mention them.
4232 * doc/bison.1: Likewise.
4233 * doc/bison.texinfo (Decl Summary): Likewise.
4234 (Bison Options): Likewise.
4235 (Option Cross Key): Likewise.
4236 * src/getargs.c (no_parser_flag): Remove global variable.
4237 (usage): Don't print description of -n and --no-parser.
4238 (long_options): Remove --no-parser entry here.
4239 (getargs): Remove -n case in the switch here.
4240 * src/getargs.h (no_parser_flag): Remove extern.
4241 * tests/regression.at (Web2c Actions): Remove comment that mentions
4242 --no-parser.
4243
5d31a216
JD
42442007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
4245
4246 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
4247 name user variables starting with `yy'. Just pass NULL instead of a
4248 dummy local &yylval to yypush_parse.
4249 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
4250 starting with `yy'.
4251
a2ea208d
JD
42522007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
4253
4254 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
4255 true since it's then always used regardless of whether yyoverflow is
4256 defined. Reported by Christian Burger at
4257 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
4258 * THANKS: Add Christian Burger.
4259
91661ebb
JD
4260 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
4261 node names: say "Decl Summary" not "Bison Declaration Summary".
4262
cbd50549
JD
42632007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
4264
4265 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
4266 determine whether this function has already complained about an invalid
4267 value for a %define boolean variable, don't check whether Bison has
4268 ever examined the value. As written, the check was a tautology.
4269 Instead, record and check for this complaint using a separate muscle.
4270
eb1b0740
JD
42712007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4272
4273 Fix push parsing memory leak reported by Brandon Lucia at
4274 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
4275 * THANKS: Add Brandon Lucia.
4276 * data/push.c (yypstate_delete): Free the stack if it was reallocated
4277 but the parse never completed and thus freed it.
4278 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
4279 * tests/testsuite.at: Include push.at.
4280 * test/push.at: New.
4281 (Push Parsing: Memory Leak for Early Deletion): New test case.
4282
9d774aff
JD
42832007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
4284
4285 Improve handling of multiple S/R conflicts in the same state and of S/R
4286 conflicts involving multiple reductions.
4287 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
4288 set for a state here or Bison will abort if it is reassigned on a
4289 later conflicted reduction in the same state.
4290 Similarly, don't finalize and assign the solved conflicts report here
4291 or it will be lost if it is reassigned on a later conflicted reduction
4292 in the same state.
4293 (set_conflicts): Instead, assign them both here after all S/R conflicts
4294 in the state have been fully examined.
4295 * src/print.c (shift_set): Rename to...
4296 (no_reduce_set): ... this.
4297 (print_reductions): Update for rename, and add %nonassoc error action
4298 tokens to no_reduce_set so that, when printing the first remaining
4299 reduction on an error action token, the reduction is enclosed in
4300 brackets.
4301 (print_results): Update for rename.
4302 * tests/conflicts.at (Solved conflicts report for multiple reductions
4303 in a state): New test case.
4304 (%nonassoc error actions for multiple reductions in a state): New test
4305 case.
4306
4307 * src/main.c (main): Don't depend on C99 features.
4308
10159d2a
JD
43092007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
4310
4311 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
4312 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
4313 uniwidth.
10159d2a 4314
953b3935
JD
43152007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
4316
4317 * bootstrap (slurp): Create target directories that don't exist.
4318 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
4319
6ce2d93a
JD
43202007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
4321
4322 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
4323 than item number.
4324 * closure.c (closure): Likewise.
4325 * state.h (reductions): Comment sorting of rules.
4326 (state): Comment sorting of items.
4327
ce3448d5
JD
43282007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
4329
4330 Fix C++ test cases after recent Gnulib changes. Discussed starting at
4331 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
4332 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
4333 definition in order to avoid Gnulib headers since we don't use config.h
4334 here.
4335 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
4336 rather than AT_DATA so that config.h is included.
4337
8a86eef0
JD
43382007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
4339
4340 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
4341 instead of fprintf. Guard these functions with #if YYDEBUG instead of
4342 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
4343 and so that YYFPRINTF is guaranteed to be defined here.
4344
b1a81613
JD
43452007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
4346
4347 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
4348 with...
4349 (muscle_percent_define_check_values): ... this more helpful function.
4350 Again, it's not used yet, but it will be.
4351 * src/muscle_tab.h: Likewise.
4352
71b61d4d
JD
4353 Improve some comments in parser table construction.
4354 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
4355 (generate_states): Don't mention ruleset, which is internal to closure.
4356 * src/closure.c (closure): Explain sorting of core and itemset, which
4357 is required for this function to behave correctly.
4358 * src/closure.h (closure): Mention sorting.
4359
2a6b783d
JD
43602007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
4361
4362 * src/lalr.c (state_lookahead_tokens_count): For code readability,
4363 move the check for disabled transitions to an aver since conflict
4364 resolution hasn't happened yet.
4365
4366 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
4367 labels a state as inconsistent just because it has error transitions.
4368 The original form of this check appeared in revision 1.1 of lalr.c,
4369 which was committed on 1991-12-21. Now (at least), changing the
4370 consistency label on such a state appears to have no useful effect in
4371 any of the places it is examined, which I enumerate below. The key
4372 point to understanding each item in this enumeration is that a state
4373 with an error transition is labelled consistent in the first place only
4374 if it has no rules, so the check cannot matter for states that have
4375 rules. (1) Labelling a state as inconsistent will cause set_conflicts
4376 to try to identify its conflicts, and a state must have *rules* to have
4377 conflicts. (2) Labelling a state as inconsistent will affect how
4378 action_row sets the default *rule* for the state. (3) Labelling a
4379 state as inconsistent will cause build_relations to add lookback edges
4380 to *rules* in that state.
4381 * src/state.h (struct state): Word the comment for member consistent
4382 more carefully.
4383
14462c2b
JD
43842007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4385
4386 Don't depend on C99 features.
4387 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
4388 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
4389 * src/reader.c (check_and_convert_grammar): Fix for-loop.
4390 * src/state.c (state_mark_reachable_states): Fix for-loop.
4391 (state_remove_unreachable_states): Fix for-loop.
4392
4393 Don't widen struct state with member reachable just to temporarily
4394 record reachability. Instead, use a local bitset.
4395 * src/state.h (struct state): Remove member.
4396 * src/state.c (state_new): Don't initialize it.
4397 (state_mark_reachable_states): Rename to...
4398 (state_record_reachable_states): ... this, and use bitset.
4399 (state_remove_unreachable_states): Use bitset.
4400
5a43d418
JD
44012007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
4402
4403 * src/Makefile.am (yacc): Quote target action commands properly so
4404 that the yacc script isn't corrupt. Reported by Hans Aberg at
4405 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
4406
0c650a20
JD
4407 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
4408 the case of pure parsers. Reported by Frans Englich at
4409 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
4410 * THANKS: Add Frans Englich.
4411
61fee93e
JD
4412 * NEWS (2.3a+): In the %code entry, reference section `Bison
4413 Declaration Summary' from the manual now since the %code summary has
4414 moved there.
4415 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
4416 in the rules section must be terminated by semicolons.
4417
f124d423
JD
44182007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
4419
4420 Extend the front-end API for %define variables to more completely
4421 mirror the back-end. This will be useful in the future.
4422 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
4423 Update comments to mention the new front-end counterparts of these
4424 macros.
4425 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
4426 for muscle_string_decode and muscle_location_decode.
4427 (muscle_string_decode): New static function.
4428 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
4429 (muscle_percent_define_get, muscle_percent_define_ifdef): New
4430 functions.
4431 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
4432 muscle_percent_define_get to mimic the b4_percent_define_flag_if
4433 implementation more closely.
4434 (muscle_percent_define_invalid_value): New function.
4435 * src/muscle_tab.h (muscle_percent_define_get,
4436 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
4437 Prototype.
4438
75ad86ee
JD
44392007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
4440
4441 * NEWS (2.3a+): Mention yesterday's state-removal change.
4442 (2.3a): Remove the %language entry, which was added after 2.3a.
4443 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
4444 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
4445 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
4446 tests/existing.at: Update copyright date.
4447
5967f0cf
JD
44482007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4449
4450 If conflict resolution makes states unreachable, remove those states,
4451 report rules that are then unused, and don't report conflicts in those
4452 states.
4453 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
4454 New global function.
4455 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
4456 function.
4457 * src/main.c (main): After conflict resolution, remove the unreachable
4458 states and update all data structures that reference states by number.
4459 * src/state.c (state_new): Initialize each state's reachable member to
4460 false.
4461 (state_mark_reachable_states): New static function.
4462 (state_remove_unreachable_states): New global function.
4463 * src/state.h (struct state): Add member bool reachable.
4464 (state_remove_unreachable_states): Prototype.
4465 * tests/conflicts.at (Unreachable States After Conflict Resolution):
4466 New test case.
4467 * tests/existing.at (GNU pic Grammar): Update test case output now that
4468 an unused rule is discovered.
4469
b09f4f48
JD
44702007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4471
4472 Minor code cleanup in parser table construction.
4473 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
4474 (new_itemsets, save_reductions): Update for rename to nitemset.
4475 * src/closure.c (nritemset): Rename to...
4476 (nitemset): ... this since the "r" appears to meaningless and isn't
4477 used in the comments.
4478 (closure): Update for rename.
4479 * src/closure.h (nritemset): Update extern to...
4480 (nitemset): ... this.
4481 * src/lalr.c (LA): Fix a typo in comments.
4482 * src/print.c (print_core): Update for rename to nitemset.
4483 * src/print_graph.c (print_graph): Likewise.
4484 * src/state.h: Fix some typos in header comments.
4485
bbb44d83
PE
44862007-04-04 Paul Eggert <eggert@cs.ucla.edu>
4487
9b33de72
PE
4488 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
4489 still sticks to ASCII. Sorry!
4490
bbb44d83
PE
4491 * README-hacking: New file, taken mostly from coreutils, with changes
4492 for Bison. Contains much of the contents of:
4493 * README-cvs: Remove.
4494 * bootstrap: Sync from gnulib.
4495 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
4496 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
4497
29553547
JD
44982007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
4499
4500 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
4501 Setzer.
4502 (Java Differences): Fix some typos.
4503 * THANKS: Add Sebastian Setzer.
4504
01b477c6
PB
45052007-03-07 Paolo Bonzini <bonzini@gnu.org>
4506
730739e4
AD
4507 * data/java.m4 (b4_single_class_if): Remove.
4508 (b4_abstract_if): Look at "%define abstract".
4509 (b4_lexer_if): New.
4510 (b4_union_name): Rename...
4511 (b4_yystype): ... to this. Map to "%define stype".
4512 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
4513 b4_maybe_throws): Fix quoting.
4514 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
4515 * data/lalr1.java (Lexer interface): Always define.
4516 (Lexer interface within parser class): Remove.
4517 (YYLexer class): New, used when "%code lexer" is present.
4518 (constructor): When "%code lexer" is used, pass %lex-param
4519 to the lexer constructor.
4520 (yylex, yyparse): Remove %lex-param from method invocations
4521 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
4522
4523 * doc/bison.texinfo (Java Bison Interface): Mention "%define
4524 abstract". Rename "%define union_name" to "%define stype".
4525 Rename method names according to previous patch.
4526 (Java Scanner Interface): Describe "%code lexer" instead of
4527 "%pure-parser" and "%define single_class".
4528 (Java Differences): Mention "%code lexer".
4529
4530 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
4531 Include scanner here, using macros from tests/local.at.
4532 (AT_DATA_CALC_Y): Remove final argument.
4533 (_AT_CHECK_JAVA_CALC): Likewise.
4534 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
4535 of %locations and %error-verbose.
4536 (main): Test with and without %lex-param.
4537 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
4538 (AT_BISON_OPTION_POPDEFS): Pop it.
01b477c6 4539
122bea3a
JMG
45402007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4541
4542 DJGPP spefic issue. Inhibit the use of disallowed characters for
4543 file name genertion on Win98, WinXP, etc. These are |<>":?*\
4544 and concern testsuite case 46.
4545 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
4546 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
4547 * djgpp/config.bat: Inhibit the use of disallowed characters.
4548
9611cfa2
JD
45492007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4550
4551 Miscellaneous %define and %code cleanup.
4552 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
4553 values are interpreted.
4554 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
4555 documentation a little more.
4556 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
4557 muscle_percent_define_insert, muscle_percent_code_grow): New
4558 functions/macros.
4559 * src/muscle_tab.h (muscle_percent_define_insert,
4560 muscle_percent_code_grow): Prototype.
4561 * src/parse-gram.y (prologue_declaration): Use
4562 muscle_percent_define_insert and muscle_percent_code_grow when parsing
4563 %define and %code directives.
4564
4565 Make it easy to share %define boolean variables between the front-end
4566 and back-end. Though not used yet, this will be useful in the future.
4567 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
4568 Bison uses of names rather than just skeleton uses of names.
4569 (b4_percent_define_get, b4_percent_define_ifdef): Rename
4570 b4_percent_define_skeleton_variables(VARIABLE) to
4571 b4_percent_define_bison_variables(VARIABLE).
4572 (b4_percent_code_get, b4_percent_code_ifdef): Rename
4573 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
4574 b4_percent_code_bison_qualifiers(QUALIFIER).
4575 (b4_check_user_names_wrap): Update for renames.
4576 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
4577 muscle_percent_define_default): New functions mimicking
4578 b4_percent_define_flag_if and b4_percent_define_default.
4579
4580 For %define variables, report locations for invalid values and
bbb44d83 4581 redefinitions.
9611cfa2
JD
4582 * data/bison.m4 (b4_percent_define_flag_if): Read
4583 b4_percent_define_loc(VARIABLE) to report the location of an invalid
4584 value for VARIABLE.
4585 (b4_percent_define_default): Save a special location in
4586 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
4587 must later be reported as invalid.
4588 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
4589 functions.
4590 (muscle_percent_define_insert): Record the location of VARIABLE in
4591 muscle percent_define_loc(VARIABLE), and use it to report the previous
4592 location for a redefinition.
4593 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
4594 (muscle_percent_define_default): Update like b4_percent_define_default.
4595 (muscle_grow_user_name_list): Rename to...
4596 (muscle_user_name_list_grow): ... this for consistency and use
4597 muscle_location_grow.
4598 * src/muscle_tab.h (muscle_location_grow): Prototype.
4599 * tests/input.at (%define errors): Update expected output.
4600 * tests/skeletons.at (%define boolean variables: invalid skeleton
4601 defaults): New test case.
4602
0bf92491
JD
46032007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
4604
4605 * src/print.c (lookahead_set, state_default_rule): Remove.
4606 (print_reductions): Replace state_default_rule invocation with
4607 equivalent use of yydefact, which was computed in token_actions in
4608 tables.c.
4609 (print_results): Don't allocate lookahead_set.
4610
d3b12988
PB
46112007-02-27 Paolo Bonzini <bonzini@gnu.org>
4612
4613 * data/lalr1.java: Prefix all private members with yy.
4614
f57a7536
JD
46152007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
4616
4617 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 4618 Sebastien Fricker at
f57a7536 4619 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 4620 * THANKS: Add Sebastien Fricker.
f57a7536
JD
4621 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
4622 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
4623 accept a variable number of arguments.
4624
6404a5bf
JD
46252007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
4626
4627 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
4628
e4e09639
JMG
46292007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4630
4631 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
4632 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
4633 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
4634
d7e0a1a7
PE
46352007-02-11 Paul Eggert <eggert@cs.ucla.edu>
4636
4637 Undo my 2007-02-07 change, switching back to the c-strcase module
4638 introduced in the 2007-02-03 change. Bruno Haible reported that
4639 the 2007-02-07 change would be dangerous in Turkish if we add a
4640 language whose name contains "i", since "i" is not lowercase "I"
4641 in Turkish.
4642 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
4643 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
4644 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
4645 * m4/.cvsignore: Remove strcase.m4.
4646 * src/getargs.c: Revert 2007-02-07 change, as follows.
4647 Include c-strcase.h.
4648 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
4649
deee93a1
JD
46502007-02-11 Bruno Haible <bruno@clisp.org>
4651
4652 Enable the Java related testsuite tests when the only Java compiler
4653 found is a gcj < 4.3. Discussed at
4654 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
4655 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
4656
574add85
JD
46572007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
4658
4659 * data/Makefile.am: Update copyright date.
4660 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
4661 yypstate_new returns NULL.
4662 (yypstate_new): Return NULL if malloc does.
4663 * src/reader.c (packgram): Move translation of rule actions from the
4664 beginning of packgram to...
4665 (check_and_convert_grammar): ... here right before packgram is invoked
4666 so it's easier to write more complete comments, and remove redundant
4667 code.
4668
e785ccf7
JD
46692007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
4670
4671 As in semantic actions, make @$ in %initial-action, %destructor, and
4672 %printer imply %locations.
4673 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
4674 scanning @$.
4675 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
4676 (@$ in %initial-action implies %locations,
4677 @$ in %destructor implies %locations,
4678 @$ in %printer implies %locations): ... these new test cases.
4679
1cfe1ed7
PE
46802007-02-07 Paul Eggert <eggert@cs.ucla.edu>
4681
4682 Undo most of the 2007-02-03 change, switching to the strcase module
4683 now that gnulib strcase has been fixed.
4684 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
4685 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
4686 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
4687 * m4/.cvsignore: Add strcase.m4.
4688 * src/getargs.c: Revert 2007-02-03 change, as follows.
4689 Don't include c-strcase.h.
4690 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
4691 strcasecmp has "unspecified behavior" outside the POSIX locale,
4692 but it works fine in practice if at least one argument is ASCII,
4693 as is the case in Bison.
4694
0049ec86
PB
46952007-02-07 Paolo Bonzini <bonzini@gnu.org>
4696
4697 * tests/java.at: Skip tests if only one of javac/java is present.
4698 Reported by Joel E. Denny.
4699 * tests/atlocal.in: Adjust copyright years.
4700
47012007-02-05 Paolo Bonzini <bonzini@gnu.org>
4702
4703 * data/lalr1.java (Stack): Work around old verifiers that disallow
4704 access to the private fields of an inner class, from the outer class.
4705 We can make Stack's fields public because user code doesn't have access
4706 to the instance of Stack used by parse(). Reported by Paul Eggert.
4707
2c2b7220
PE
47082007-02-03 Paul Eggert <eggert@cs.ucla.edu>
4709
4710 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
4711 the right spot for these files?
4712 * bootstrap.conf (gnulib_modules): Add c-strcase.
4713 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
4714 c-strncasecmp.c.
4715 * src/getargs.c: Include c-strcase.h.
4716 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
4717 to avoid unspecified behavior.
4718
b2b81dae
JD
47192007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
4720
4721 * doc/bison.texinfo (Decl Summary): Correct typo.
4722
c1d19e10
PB
47232007-01-30 Paolo Bonzini <bonzini@gnu.org>
4724
4725 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
4726 Complain if the value does not match empty, "true" or "false".
4727 * data/c++.m4: Adjust default definitions of %define variables.
4728 * data/java.m4: Adjust default definitions of %define variables.
4729 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
4730 to above behavior.
4731 * tests/input.at (Boolean %define variables): Test new behavior.
4732
8405b70c
PB
47332007-01-29 Paolo Bonzini <bonzini@gnu.org>
4734
4735 * NEWS: Mention java.
4736 * TODO: Remove things that are done.
4737 * bootstrap.conf: Add javacomp-script and javaexec-script.
4738 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
4739
4740 * data/Makefile.am: Add new files.
4741 * data/java-skel.m4: New.
4742 * data/java.m4: New.
4743 * data/lalr1.java: New.
4744
4745 * doc/bison.texinfo: Put "A Complete C++ Example" under
4746 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
4747 under Other Languages.
4748
4749 * src/getargs.c (valid_languages): Add Java.
4750 * src/getargs.h (struct bison_language): Update size of string fields.
4751
4752 * tests/Makefile.am: Add java.at.
4753 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
4754 * tests/java.at: New.
4755 * tests/testsuite.at: Include it.
4756
3eb82471
JD
47572007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
4758
4759 Clean up.
4760 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
4761 at_directive_argv arguments so these no longer have to be global
4762 variables. Also, update the implementation for the following changes.
4763 (fail_for_at_directive_too_many_args,
4764 fail_for_at_directive_too_few_args): Add at_directive_name argument.
4765 (at_directive_name): Remove as at_directive_argv[0] will be used for
4766 this now.
4767 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
4768 for the directive name.
4769 (at_directive_argc, at_directive_argv): Make these local within
4770 skel_lex instead of global.
4771 (INITIAL): Update directive start action for above changes.
4772 (SC_AT_DIRECTIVE_ARG): Rename to...
4773 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
4774 (SC_AT_DIRECTIVE_SKIP_WS): Update.
4775 (scan_skel): Move yylex_destroy to...
4776 (skel_scanner_free): ... here.
4777 * tests/skeletons.at (installed skeleton file name): Rename to...
4778 (installed skeleton file names): ... this.
4779
148d66d8
JD
47802007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
4781
4782 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
4783 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
4784 Summary" not "Directives".
4785 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
4786 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
4787 since the former is now the more complete one.
4788 (Prologue Alternatives): Likewise and do the same for %defines.
4789 (Table of Symbols): Add summary of %code, add summary of %define, and
4790 move full %code documentation to...
4791 (Decl Summary): ... here for consistency with other entries in these
4792 sections.
4793 Move %define entry in order to keep this list alphabetized.
4794 Reword %define entry a little to put less emphasis on the skeleton
4795 concept, which most users shouldn't have to think about.
4796
665f0c24
PE
47972007-01-26 Paul Eggert <eggert@cs.ucla.edu>
4798
4799 Adjust to recent gnulib changes.
4800 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
4801 Add string.h, string_.h, unistd_.h, wchar_.h.
4802 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
4803 * src/system.h: Don't include <stpcpy.h>; this is now done by
4804 <string.h>.
4805
592d0b1e
PB
48062007-01-23 Paolo Bonzini <bonzini@gnu.org>
4807
4808 Simplify implementation of unqualified %code, implement macros for
4809 uniform treatment of boolean %define flags. Document %define.
4810 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
4811 b4_percent_code_ifdef): New.
4812 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
4813 * data/c++.m4: Define default value for global_tokens_and_yystype.
4814 * data/glr.cc: Likewise.
4815 * data/location.cc: Use b4_percent_define_flag_if.
4816
148d66d8 4817 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
4818
4819 * src/parse-gram.y (Unqualified %code): Change muscle name to
4820 b4_percent_code().
4821 (content.opt): Default to empty.
4822
a7867f53
JD
48232007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
4824
4825 Implement support for relative and absolute skeleton file names.
4826 Discussed starting at
4827 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
4828 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
4829 (Bison Options): Document in --skeleton entry.
4830 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
4831 full_skeleton can't necessarily hold all of pkgdatadir.
4832 If the specified skeleton file name contains a `/', don't prepend
4833 pkgdatadir.
4834 * src/parse-gram.y (prologue_declaration): If the specified skeleton
4835 file name contains a `/', prepend the grammar file directory.
4836 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
4837 * skeletons.at: New file.
4838 (relative skeleton file names): New test case.
4839 (installed skeleton file names): New test case.
4840 * tests/testsuite.at: Include skeletons.at.
4841
4842 * bootstrap: Update copyright to 2007.
4843
830c9b18
PB
48442007-01-17 Paolo Bonzini <bonzini@gnu.org>
4845
4846 * bootstrap: Remove occurrences of .#bootmp from the files.
4847
a8c2e813
AD
48482007-01-17 Akim Demaille <akim@epita.fr>
4849
4850 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
4851 nonterminals.
4852 Use per-type %printer.
4853
279cabb6
JD
48542007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
4855
4856 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
4857 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
4858 djgpp/config.site, src/files.c, src/files.h, src/main.c,
4859 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
4860 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
4861 tests/glr-regression.at, tests/input.at, tests/local.at,
4862 tests/output.at, tests/torture.at: Update copyright to 2007.
4863
bb32f4f2
AD
48642007-01-16 Akim Demaille <akim@epita.fr>
4865
4866 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
4867 error code.
4868 (Calc++ Scanner): Exit with failure if we can't open the input
4869 file.
4870 Accept "-" standing for stdin.
4871 (Calc++ Top Level): Print the result only if the parsing was
4872 successful.
4873
7cff04b5
AD
48742007-01-16 Akim Demaille <akim@epita.fr>
4875
4876 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
4877
a4e25e1d
JD
48782007-01-15 Paolo Bonzini <bonzini@gnu.org>
4879 and Joel E. Denny <jdenny@ces.clemson.edu>
4880
4881 Clean up %define and %code implementation in M4 some. Most
4882 importantly, rename all related macros to be in the b4_percent_define
4883 and b4_percent_code namespaces. Also, complete support for `.' in
4884 %define variable names and %code qualifiers.
4885 * data/bison.m4 (b4_check_user_names): Check for special
4886 "SKELETON-NAMESPACE(name)" macros instead of using two nested
4887 m4_foreach loops.
4888 (b4_get_percent_define, b4_get_percent_code): Rename to...
4889 (b4_percent_define_get, b4_percent_code_get): ... these.
4890 Extend documentation with examples.
4891 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
4892 b4_percent_define_skeleton_variables and
4893 b4_percent_code_skeleton_qualifiers.
4894 Expect any value for the %define variable `foo' to be stored in the
4895 macro named `b4_percent_define(foo)'; expect any %code blocks for the
4896 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
4897 expect any unqualified %code blocks to be stored in a macro named
4898 `b4_percent_code_unqualified'.
4899 Use m4_indir so that %define variable names and %code qualifiers can
4900 contain `.', which is allowed by the grammar parser.
4901 (b4_percent_define_default): New macro to set a default value for a
4902 %define variable.
4903 (m4_wrap): Update wrapped code, and fix some underquoting.
4904 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
4905 Expect grammar uses of %define variables and %code qualifiers to be
4906 defined in b4_percent_define_user_variables and
4907 b4_percent_code_user_qualifiers.
4908 * data/c++.m4: Use b4_percent_define_default rather than
4909 m4_define_default. Fix some underquoting. Skeleton usage of %define
4910 variable define_location_comparison now implies skeleton usage of
4911 %define variable filename_type.
4912 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
4913 data/push.c, data/yacc.c: Update macro names.
4914 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
4915 muscle names.
4916
e37c665c
JMG
49172007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4918
4919 DJGPP specific issues.
4920
4921 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
4922 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
4923
7d2d521f
JD
49242007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
4925
4926 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
4927 run parsers in all tests so that Valgrind is invoked during
4928 maintainer-check-valgrind.
4929 (Duplicate representation of merged trees): Free all semantic values.
4930 (Duplicated user destructor for lookahead): Likewise.
4931
e0ac9b4b
JD
49322007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
4933
4934 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
4935 command-line prefix.
4936 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
4937 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
4938 miss Valgrind messages.
4939 (Exploding the Stack Size with Malloc): Likewise.
4940
78143faa
JD
49412007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
4942
4943 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
4944 locals. Reported by Juan Manuel Guerrero at
4945 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
4946 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
4947 Fix some indentation also.
4948 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
4949 explaining this issue.
4950
7ecec4dd
JD
49512007-01-09 Paolo Bonzini <bonzini@gnu.org>
4952 and Joel E. Denny <jdenny@ces.clemson.edu>
4953
4954 Simplify union and prologue handling, and escape union and lex/parse
4955 params with digraphs.
4956 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
4957 values to the empty string since these are no longer guaranteed
4958 initialized by the front-end.
4959 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
4960 braces around b4_user_stype since this is no longer done by the
4961 front-end.
4962 * src/files.c, src/files.h (pre_prologue_obstack,
4963 post_prologue_obstack): Remove.
4964 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
4965 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
4966 with digraphs. This fixes lex params and parse params.
4967 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
4968 * src/output.c (prepare): Remove muscle insertion of the prologues.
4969 (output): Remove freeing of pre_prologue_obstack and
4970 post_prologue_obstack.
4971 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
4972 than prologue_augment for prologue parsing so you don't need prologue
4973 obstacks.
5c80250c
JD
4974 (grammar_declaration): For %union RHS, use `braceless' instead of
4975 "{...}" so that braces are already stripped and code is escaped with
4976 digraphs.
7ecec4dd
JD
4977 * src/reader.c (prologue_augment): Remove.
4978 (reader): Remove initialization of pre_prologue_obstack and
4979 post_prologue_obstack.
4980 * src/reader.h (prologue_augment): Remove.
4981
4982 * data/c.m4: Remove stray parenthesis.
4983
16dc6a9e
JD
49842007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
4985
4986 Remove quotes from variables names in %define directives and from
4987 qualifiers in %code directives, and restrict the characters that are
4988 allowed in them to M4-friendly ones. For %define, continue to support
4989 the quoted form as a deprecated feature. Discussed starting at
4990 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
4991 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
4992 %code.
4993 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
4994 (Decl Summary): In %defines entry, update mention of `%code requires'
4995 and `%code provides'.
16dc6a9e
JD
4996 (C++ Location Values): Update %define uses.
4997 (Calc++ Parser Interface): Likewise.
4998 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 4999 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
5000 * src/parse-gram.y (prologue_declaration): For %define variables, use
5001 `variable' instead of `STRING'.
5002 (grammar_declaration): For %code qualifiers, use `ID' instead of
5003 `STRING'.
5004 (variable): New nonterminal that takes an `ID' or a `STRING'.
5005 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
5006 and %define uses.
5007 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
5008 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
5009 (%define errors): Update %define uses.
5010
e9813cd4
JD
50112007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5012
5013 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
5014 instead of muscle_insert for %define values so that M4-special
5015 characters are replaced with digraphs.
5016 * tests/input.at (%define errors): Extend to check weird values.
5017
6afc30cc
JD
50182007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5019
5020 Instead of having skeletons declare all valid %define variables and
5021 %code qualifiers, provide macros that retrieve the associated values
5022 and build these lists automatically. Thus Bison will now warn when a
5023 variable or qualifier is not used by the skeleton in the current
5024 invocation regardless of whether it might sometimes be used by that
5025 skeleton in other invocations. Also, move all %define value macros to
5026 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
5027 form, which is replaced by %code.
5028 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
5029 (b4_check_user_names): ... this, and change the series of valid name
5030 arguments to a single list argument for names used in the skeleton
5031 similar to the existing list argument for names used in the grammar.
5032 Warn instead of complaining.
5033 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
5034 values and %code code, to format %code code properly, and to build
5035 lists of all %define variables and %code qualifiers used in the
5036 skeleton: b4_skeleton_percent_define_variables and
5037 b4_skeleton_percent_code_qualifiers.
5038 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
5039 Remove, and...
5040 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
5041 the skeleton names lists can finish building first. In place of
5042 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
5043 expect the lists b4_user_percent_define_variables and
5044 b4_user_percent_code_qualifiers.
5045 * data/c++.m4: Where setting default values for b4_parser_class_name,
5046 b4_location_type, b4_filename_type, b4_namespace, and
5047 b4_define_location_comparison, update their names to the
5048 b4_percent_define_ namespace.
5049 * data/glr.c: Don't use b4_check_percent_define_variables and
5050 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
5051 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
5052 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 5053 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
5054 * data/location.cc: Use b4_get_percent_define.
5055 * data/push.c: Don't use b4_check_percent_define_variables and
5056 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
5057 * data/yacc.c: Likewise, and don't call m4_exit in
5058 b4_use_push_for_pull_if or m4_wrap code will never execute.
5059 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
5060 Rename to...
5061 (muscle_grow_user_name_list): ... this for consistency with the
5062 terminology used in bison.m4.
5063 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
5064 %define variable names, and rename muscle used_percent_define_variables
5065 to user_percent_define_variables.
5066 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
5067 user_percent_code_qualifiers.
5068 (content): Remove.
5069 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
5070 {CODE} form is no longer accepted.
5071 * tests/input.at (Reject bad %code qualifiers): Rename to...
5072 (Reject unused %code qualifiers): ... this, and update test output.
5073 (%define error): Update test output.
5074
7eb8a0bc
JD
50752007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
5076
5077 Check for unrecognized %define variables similar to checking for
5078 unrecognized %code qualifiers. Check for redefined %define variables.
5079 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
5080 generalizes...
5081 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
5082 (b4_check_percent_define_variables): New, also wraps it.
5083 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
5084 variables using b4_check_percent_define_variables.
5085 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
5086 all those exercised in the test suite and all those listed in the
5087 `Default values' section of c++.m4. Are there others?
5088 * data/push.c, data/yacc.c: Declare no valid %define variables.
5089 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
5090 similar to muscle_find, but it works even when the muscle stores a
5091 const value.
5092 (muscle_grow_used_name_list): New function for constructing the used
5093 name list muscles that b4_check_for_unrecognized_names requires.
5094 * src/parse-gram.y (prologue_declaration): Warn if a variable is
5095 %define'd more than once. Define the b4_used_percent_define_variables
5096 muscle with muscle_grow_used_name_list.
5097 (grammar_declaration): Abbreviate %code code with
5098 muscle_grow_used_name_list.
5099 * tests/input.at (%define errors): New.
5100
3fc65ead
JD
51012007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5102
5103 Provide warn_at, complain_at, and fatal_at function callbacks to the
5104 skeletons, and use this for %code qualifier complaints.
5105 * data/bison.m4 (b4_error_at): New, invoked by...
5106 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
5107 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
5108 @fatal_at(...@) directives.
5109 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
5110 qualifiers in b4_used_percent_code_qualifiers and to use
5111 b4_complain_at.
5112 * src/location.c, src/location.h (boundary_set_from_string): New global
5113 function.
5114 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
5115 function.
5116 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
5117 to b4_used_percent_code_qualifiers.
5118 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
5119 function.
5120 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
5121 (lineno): Rename to...
5122 (out_lineno): ... this so I don't misunderstand it again.
5123 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
5124 here; these newlines are in the input but not the output file.
5125 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
5126 (at_directive_perform): ... this new static function, and add handling
5127 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
5128 directives.
5129 * tests/input.at (Reject bad %code qualifiers): Update test output with
5130 locations and extend.
5131
5132 * tests/output.at (Output file name: [, Output file name: ]): Remove
5133 bogus comment about these tests failing.
5134
1c7b7e1d
JD
51352007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5136
5137 Clean up b4_check_percent_code_qualifiers a little.
5138 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
5139 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
5140 documentation and add examples.
5141 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
5142 qualifiers here.
5143
08af01c2
JD
51442007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
5145
5146 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
5147 unreliable -- especially when they're hidden inside another macro.
5148 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
5149 data/c.m4: Remove m4_divert(-1).
5150 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5151 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
5152 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 5153 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
5154 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
5155 pushed and popped by m4sugar, should be first on the stack.
5156
5157 Provide warn, complain, and fatal function callbacks to the skeletons.
5158 This provides more flexibility than m4_fatal, improves the error
5159 message format, and captures messages for translation. Discussed
5160 starting at
5161 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
5162 * data/bison.m4 (b4_error): New, invoked by...
5163 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
5164 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
5165 directives. Because these M4 macros might be called when the current
5166 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
5167 the previous removal of uses of m4_divert, which caused trouble.
5168 (b4_check_percent_code_qualifiers): Use b4_complain instead of
5169 m4_fatal to report unrecognized %code qualifiers.
5170 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
5171 push parser requests.
5172 * data/glr.c: Use b4_complain instead of m4_fatal to report
5173 non-deterministic push parser requests.
5174 Update @output usage to @output(...@) form.
5175 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
5176 report missing %defines. Update @output usage to @output(...@) form.
5177 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
5178 @output(...@) form.
5179 * src/main.c (main): Invoke skel_scanner_free.
5180 * src/scan-skel.h (skel_scanner_free): Prototype new function.
5181 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
5182 obstack_for_string from flex-scanner.h.
5183 (YY_DECL): Use to declare skel_lex static.
5184 (decode_at_digraphs): Remove; now handled in the new
5185 SC_AT_DIRECTIVE_ARG start condition.
5186 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
5187 functions.
5188 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
5189 at_directive_argv): New static globals.
5190 (INITIAL): Use fail_for_invalid_at.
5191 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
5192 recognize the start of a generalized `@directive(...@)' form and
5193 start...
5194 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
5195 directive args (using the new obstack_for_string), to decode the
5196 contained @ diagraphs, and to perform the directive. It recognizes
5197 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
5198 @output(...@).
5199 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
5200 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
5201 `@,'.
5202 (scan_skel): Initialize obstack_for_string on the first call.
5203 (skel_scanner_free): New function to free obstack_for_string.
5204 * tests/input.at (Reject bad %code qualifiers): Update test output.
5205
8e0a5e9e
JD
52062007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
5207
5208 Consolidate the 4 prologue alternative directives (%code, %requires,
5209 %provides, and %code-top) into a single %code directive with an
5210 optional qualifier field. Discussed at
5211 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
5212 * NEWS (2.3a+): Rewrite the existing entry for the prologue
5213 alternatives.
5214 * doc/bison.texinfo (Prologue Alternatives): Update.
5215 (Decl Summary): Update to %code "requires" and %code "provides".
5216 (Calc++ Parser): Update to %code "requires".
148d66d8 5217 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
5218 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
5219 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
5220 are replaced by b4_percent_code_provides and b4_percent_code_requires,
5221 which are skeleton-specific.
5222 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
5223 declare what %code qualifiers it supports and to complain if any other
5224 qualifiers were used in the grammar.
5225 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
5226 and b4_user_code([b4_percent_code_provides]) in place of
5227 b4_user_requires and b4_user_provides.
5228 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
5229 Add b4_user_code([b4_percent_code_top]) and
5230 b4_user_code([b4_percent_code]).
5231 Invoke b4_check_percent_code_qualifiers.
5232 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
5233 PERCENT_REQUIRES): Remove.
5234 (grammar_declaration): Remove RHS's for %code-top, %provides, and
5235 %requires. Rewrite the %code RHS as the unqualified form defining the
5236 muscle b4_percent_code. Add another RHS for the qualified %code form,
5237 which defines muscles of the form b4_percent_code_QUALIFIER and the
5238 b4_used_percent_code_qualifiers muscle.
5239 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
5240 PERCENT_REQUIRES): Remove.
5241 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
5242 %code "requires" and %code "provides".
5243 * tests/input.at (Reject bad %code qualifiers): New.
5244
95021767
JD
52452007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
5246
5247 Use the new code_props interface for destructors and printers.
5248 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
5249 printer_location members, and change the type of the destructor and
5250 printer members to code_props.
5251 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
5252 symbol_printer_get, semantic_type_destructor_set,
5253 semantic_type_printer_set, default_tagged_destructor_set,
5254 default_tagless_destructor_set, default_tagged_printer_set,
5255 default_tagless_printer_set): Use code_props in arguments and return
5256 types in place of char const * and location.
5257 (symbol_destructor_location_get, symbol_printer_location_get): Remove
5258 since the locations are now contained in the return of
5259 symbol_destructor_get and symbol_printer_get.
5260 * src/output.c (symbol_destructors_output, symbol_printers_output):
5261 Replace with...
5262 (symbol_code_props_output): ... this to eliminate duplicate code.
5263 (output_skeleton): Update to use symbol_code_props_output.
5264 * src/reader.c (symbol_should_be_used): Update use of
5265 symbol_destructor_get.
5266 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
5267 Update uses of the various _destructor_set and _printer_set functions.
5268 * src/symtab.c: (default_tagged_destructor_location,
5269 default_tagless_destructor_location, default_tagged_printer_location,
5270 default_tagless_printer_location): Remove since we...
5271 (default_tagged_destructor, default_tagless_destructor,
5272 default_tagged_printer, default_tagless_printer): ... change the type
5273 of these to code_props.
5274 (symbol_new, semantic_type_new, symbol_destructor_set,
5275 semantic_type_destructor_set, symbol_destructor_get,
5276 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
5277 symbol_check_alias_consistency, default_tagged_destructor_set,
5278 default_tagless_destructor_set, default_tagged_printer_set,
5279 default_tagless_printer_set): Update.
5280 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
5281 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
5282 code_props members.
5283 (symbol_print): Use SYMBOL_CODE_PRINT.
5284
f6857bbf
JD
52852007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
5286
5287 Use the new code_props interface for rule actions.
5288 * src/symlist.h (symbol_list): Replace action, action_location, and
5289 used members with a code_props action_props member.
5290 * src/reader.c (symbol_should_be_used, grammar_rule_check,
5291 grammar_midrule_action, grammar_current_rule_merge_set,
5292 grammar_current_rule_symbol_append, packgram): Update.
5293 * src/scan-code.h (translate_rule_action): Remove, no longer used.
5294 * src/scan-code.l (handle_action_dollar): Update.
5295 (translate_rule_action): Remove, no longer used.
5296 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
5297
7c0c6181
JD
52982007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5299
5300 Use the new code_props interface in parse-gram.y.
5301 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
5302 Update all uses of translate_* functions to use the new code_props
5303 interface and to use gram_scanner_last_string_free and
5304 code_scanner_last_string_free where possible.
5305 (grammar_declaration): symbol_list_destructor_set and
5306 symbol_list_printer_set now perform the translation, so don't do it
5307 here. Use gram_scanner_last_string_free where possible.
5308 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
5309 translate_code): Remove, no longer used.
5310 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
5311 symbol_list_printer_set): Perform code translation here rather than
5312 depending on the caller to do so.
5313
5314 * src/symlist.h (struct symbol_list): Correct some documentation typos.
5315 * src/scan-gram.h (gram_last_string): Remove declaration.
5316 * src/scan-gram.l (last_string): Declare it static.
5317
28e52c0d
JD
53182007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5319
5320 Encapsulate code properties and related functionality for the various
5321 destructors, printers, and actions into a code_props structure and
5322 interface. This patch merely implements code_props in scan-code.h and
5323 scan-code.l. Future patches will rewrite other modules to use it.
5324 Discussed starting at
5325 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
5326 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
5327 consistently initialize const structs that have an empty location
5328 field.
5329 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
5330 to ensure consistency.
5331 * src/scan-code.h (code_props): New structure.
5332 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
5333 function, macro, and const global variable for initializing a
5334 code_props with no code.
5335 (code_props_plain_init, code_props_symbol_action_init,
5336 code_props_rule_action_init, code_props_translate_code): The rest of
5337 the new code_props functional interface. Among other things, the init
5338 functions set the code_props kind field so that
5339 code_props_translate_code will know whether to behave like
5340 translate_symbol_action, translate_rule_action, or translate_code.
5341 These old translate functions must remain until all other modules are
5342 updated to use the new code_props interface.
5343 (code_scanner_last_string_free): New function similar to
5344 gram_scanner_last_string_free.
5345 (code_scanner_free): Add documentation.
5346 * src/scan-code.l: Implement the new interface.
5347 (code_lex): Make it static, add a code_props* argument, and remove the
5348 rule argument.
5349 (last_string): New static global similar to the one in scan-gram.l.
5350 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
5351 instead of rule.
5352 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
5353 code_props since Bison may one day use this information for destructors
5354 and printers.
5355 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
5356 (handle_action_dollar): Use symbol_list_n_get and set used flag
5357 directly since symbol_list_n_used_set is removed.
5358 (translate_action): Add a code_props* argument and remove the rule,
5359 action, and location arguments. Pass the code_props* on to code_lex.
5360 (translate_rule_action, translate_symbol_action, translate_code):
5361 Rewrite as wrappers around the new code_props interface.
5362 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
5363 it would eventually need to break the encapsulation of code_props.
5364
96034983
JD
53652007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
5366
5367 * etc/.cvsignore: New.
5368
945e396c
JD
53692007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
5370
5371 Add maintainer-push-check to run maintainer-check using push parsing in
5372 place of pull parsing where available.
5373 * Makefile.am (maintainer-push-check): New.
5374 * data/bison.m4 (b4_use_push_for_pull_if): New.
5375 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
5376 appropriately based on their existing values.
5377 (yypush_parse): Don't print push-parser-specific diagnostics if push
5378 parsing is being used in place of pull parsing.
5379 * data/yacc.c: If push parsing should replace pull parsing, redirect to
5380 push.c.
5381 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
5382 variable, and insert b4_use_push_for_pull_flag into muscles.
5383 * tests/Makefile.am (maintainer-push-check): New.
5384
7d596384
JD
53852006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
5386
5387 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
5388 (whether successful or failed) so that yypush_parse can be invoked
5389 again to start a new parse using the same yypstate.
5390 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
5391 check multiple yypull_parse invocations on the same yypstate. For pull
5392 mode, extend to check multiple yyparse invocations.
5393 (Exploding the Stack Size with Alloca): Extend to try with
5394 %push-pull-parser.
5395 (Exploding the Stack Size with Malloc): Likewise.
5396
5397 * tests/calc.at (Simple LALR Calculator): Don't specify
5398 %skeleton "push.c" since %push-pull-parser implies that now.
5399 * tests/headers.at (export YYLTYPE): Don't check for the push
5400 declarations. Otherwise, this test case can't be used to see if push
5401 mode can truly emulate pull mode.
5402 * tests/input.at (Torturing the Scanner): Likewise.
5403 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
5404 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
5405 AT_YACC_IF, which now includes the case of push mode since %skeleton
5406 need not be used for push mode. This will be more intuitive once
5407 push.c is renamed to yacc.c.
5408
7172e23e
JD
54092006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
5410
5411 For push mode, convert yyparse from a macro to a function, invoke yylex
5412 instead of passing a yylexp argument to yypull_parse, and don't
5413 generate yypull_parse or yyparse unless %push-pull-parser is declared.
5414 Discussed starting at
5415 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
5416 * data/bison.m4 (b4_pull_if): New.
5417 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
5418 * data/push.c: Improve M4 quoting a little.
5419 (b4_generate_macro_args, b4_parenthesize): Remove.
5420 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
5421 any time a pull parser is requested.
5422 Don't #define this as a wrapper around yypull_parse. Instead, when
5423 both push and pull are requested, make it a function that does that
5424 same thing.
5425 (yypull_parse): If there's a b4_prefix, #define this to
5426 b4_prefix[pull_parse] when both push and pull are requested.
5427 Don't define this as a function unless both push and pull are
5428 requested.
5429 Remove the yylexp argument and hard-code yylex invocation instead.
5430 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
5431 %push-parser.
5432 * src/getargs.c (pull_parser): New global initialized to true.
5433 * getargs.h (pull_parser): extern it.
5434 * src/output.c (prepare): Insert pull_flag muscle.
5435 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
5436 (prologue_declaration): Set both push_parser and pull_parser = true for
5437 %push-pull-parser. Set push_parser = true and pull_parser = false for
5438 %push-parser.
5439 * src/scan-gram.l: Don't accept %push_parser as an alternative to
5440 %push-parser since there's no backward-compatibility concern here.
5441 Scan %push-pull-parser.
5442 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
5443 instead of %push-parser.
5444 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
5445 prototype it in the module that calls yyparse.
5446 * tests/input.at (Torturing the Scanner): Likewise.
5447 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
5448
2e7944cb
JD
54492006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
5450
5451 Update etc/bench.pl. Optimize push mode a little (the yyn change
5452 deserves most of the credit).
5453 * Makefile.am (SUBDIRS): Add etc subdirectory.
5454 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
5455 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
5456 yytoken, yyval, and yyloc declarations to...
5457 (yyparse or yypush_parse): ... here to improve performance. For
5458 yypush_parse invocations after the first, be sure to assign yyn its old
5459 value again.
5460 (yypstate_new): Don't bother initializing the yyresult field since the
5461 initial value isn't used.
5462 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
5463 remove the #define that, in push mode, set it to yyps->NAME.
5464 * etc/Makefile.am: New.
5465 * etc/bench.pl: Remove and build it instead from...
5466 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
5467 "tests/bison" from the build directory by default rather than just
5468 invoking "bison" from $PATH.
5469 (calc_grammar): Update push parser code: don't declare yylval globally,
5470 don't define yyparse_wrapper, and don't #define yyparse.
5471 (bench_grammar): Update to check all working combinations of yacc.c,
5472 push.c, impure, pure, pull, and push.
5473
c3d50342
JD
54742006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
5475
5476 For push mode, add pull wrappers around yypush_parse.
5477 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
5478 (yypull_parse): New function wrapping yypush_parse.
5479 (yyparse): New #define wrapping yypull_parse.
5480 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
5481 is declared.
5482 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
5483 prototype yylex in the module that calls yyparse, and don't prototype
5484 yyparse there. Otherwise, the yyparse expansion won't compile.
5485 * tests/input.at (Torturing the Scanner): Likewise.
5486
94ebeba5
JD
54872006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
5488
5489 Enable push parsers to operate in impure mode. Thus, %push-parser no
5490 longer implies %pure-parser. The point of this change is to move
5491 towards being able to test the push parser code by running the entire
5492 test suite as if %push-parser had been declared.
5493 * data/push.c (yypush_parse): For impure mode, remove the
5494 yypushed_char, yypushed_val, and yypushed_loc arguments.
5495 Instead, declare these as local variables initialized to the global
5496 yychar, yylval, and yylloc.
5497 For the first yypush_parse invocation only, restore the initial values
5498 of these global variables when it's time to read a token since they
5499 have been overwritten.
5500 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
5501 %push-parser.
5502 * tests/calc.at (Simple LALR(1) Calculator): Always declare
5503 %pure-parser along with %push-parser since this test case was designed
5504 for pure push parsers.
5505 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
5506 (AT_YACC_OR_PUSH_IF): New.
5507 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
5508 add a note that it's still wrong for some cases (as it has been for a
5509 while).
5510 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
5511 %push-parser no longer implies %pure-parser.
5512
a0633178
JD
55132006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5514
5515 Remove some unnecessary differences between the pull parser code and
5516 the push parser code. This patch enables yynerrs in push mode.
5517 * data/push.c: Reformat M4 a little.
5518 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
5519 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
5520 because push mode is on. Instead, if pure mode is on, move yynerrs
5521 to...
5522 (b4_declare_parser_state_variables): ... here.
5523 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
5524 to yyps->NAME so it can be used in yypush_parse.
5525 (yypush_parse): Don't omit uses of yynerrs in push mode.
5526
8646b6a3
JD
55272006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5528
5529 Fix bug such that the first pushed token's value and location are
5530 sometimes overwritten (sometimes by %initial-action) before being used.
5531 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
5532 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
5533 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
5534 more closely mimic the pull parser logic.
5535 Don't copy the pushed token to yychar, yylval, and yylloc until it's
5536 time to read a token, which is after any initialization of yylval and
5537 yylloc.
5538 (gottoken): Rename label to...
5539 (yyread_pushed_token): ... for clarity and to avoid infringing on the
5540 user namespace.
5541
9baf4d74
JD
55422006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5543
5544 Rearrange initialization of the parser state variables so that the
5545 skeleton doesn't have to have a copy for pull mode and another for push
5546 mode. This patch also fixes at least a bug such that yylloc was not
5547 initialized (with b4_location_initial_line and
5548 b4_location_initial_column) upon calling yypush_parse. However, that
5549 initialization now overwrites the first token's location;
5550 %initial-action assigning @$ already did the same thing, and both bugs
5551 will be fixed in a later patch.
5552 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
5553 (b4_declare_parser_state_variables): Remove initialization of yytoken,
5554 yyss, yyvs, yyls, and yystacksize.
5555 (yypstate_new): Remove initialization of some yypstate fields: yystate,
5556 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
5557 yylsp.
5558 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
5559 yyps->NAME so it can be used in yypush_parse.
5560 (yyparse or yypush_parse): For yypush_parse, don't print the
5561 "Starting parse" diagnostic for invocations after the first.
5562 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
5563 yypush_parse, only do it for the first invocation.
5564 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
5565 initialization to occur in yypush_parse but only on the first
5566 invocation.
5567
23522164
JD
55682006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5569
5570 * data/push.c: Add CPP guards around push parser declarations in both
5571 the header and the code file.
5572 In the code file, move the push parser declarations to the same place
5573 they appear in the header file.
5574 Clean up the M4 some, especially the inconsistent underquoting in
5575 some b4_c_function_def and b4_c_function_decl uses.
5576
bb010fe5
JD
55772006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5578
5579 Encapsulate the push parser state variables into an M4 macro so the
5580 push skeleton doesn't have to list them again for pull mode's yyparse.
5581 For push mode, remove yypush_parse's local equivalents of these
5582 variables to eliminate unnecessary copying between the two sets at
5583 run-time. This patch also fixes at least a bug related to multiple
5584 %initial-action invocations in push mode.
5585 * data/push.c (b4_declare_parser_variables): Rename to...
5586 (b4_declare_scanner_communication_variables): ... this for clarity and
5587 update both uses.
5588 (b4_declare_yyparse_variables): Remove and move its contents to the one
5589 spot where it was invoked.
5590 (b4_declare_parser_state_variables): New macro containing the parser
5591 state variables required by push mode.
5592 (struct yypstate): Replace all fields but yynew with
5593 b4_declare_parser_state_variables.
5594 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
5595 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
5596 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
5597 (yyparse or yypush_parse): For yyparse in pull mode, replace local
5598 parser state variable declarations with
5599 b4_declare_parser_state_variables.
5600 Don't initialize parser state variables when calling yypush_parse since
5601 yypstate_new already does that.
5602 Invoke the user's initial action only upon the first yypush_parse
5603 invocation.
5604 Remove all code that copies between the local parser state variables
5605 and the yypstate.
5606
2d212f8c
JD
56072006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5608
5609 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
5610 prevent a name collision in a future patch where these names will
5611 sometimes be #define'd.
5612 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
5613 since it no longer has the same name as the existing argument.
5614 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
5615
e6e704dc
JD
56162006-12-19 Paolo Bonzini <bonzini@gnu.org>
5617 and Joel E. Denny <jdenny@ces.clemson.edu>
5618
5619 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
5620 that the argument is case-insensitive, and there's no `=' here.
5621 For the %skeleton entry, mention that %language is better.
5622 (Bison Options): Likewise for --language and --skeleton. Move the
5623 --skeleton entry so that the `Tuning the parser' section is sorted
5624 alphabetically on long options.
5625 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
5626 %language directive in detail here; cross-reference the %language
5627 documentation instead.
5628 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
5629 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 5630 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
5631 * examples/extexi (normalize): Instead of replacing every %require
5632 argument with the current Bison version, just substitute for
5633 `@value{VERSION}'. This guarantees that we're testing what actually
5634 appears in the documentation.
5635 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
5636 rather than `@VERSION@'.
5637
0e021770
PE
56382006-12-18 Paul Eggert <eggert@cs.ucla.edu>
5639
fd575f05
PE
5640 * NEWS: Reword the %language news a bit, and put it earlier.
5641
0e021770
PE
5642 * src/getargs.c (skeleton_arg): Last arg is now location const *.
5643 Rewrite to simplify the logic.
5644 (language_argmatch): Likewise.
fd575f05
PE
5645 (program_name): We now own this var.
5646 * src/getargs.h (struct bison_language): Use char[] rather than
5647 const char *.
0e021770
PE
5648
5649 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
5650 Java is supported.
5651 * src/complain.c (program_name): Remove decl; no longer needed.
5652 * src/main.c (program_name): Remove; now belongs to getargs.
5653
56542006-12-18 Paolo Bonzini <bonzini@gnu.org>
5655
5656 * NEWS: Document %language.
5657
5658 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
5659
5660 * data/c-skel.m4, data/c++-skel.m4: New files.
5661 * data/glr.c: Complain on push parsers.
5662
5663 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
5664 over %skeleton.
148d66d8 5665 (Decl Summary): Document %language and %skeleton.
0e021770
PE
5666 (Command line): Document -L.
5667
5668 * examples/extexi: Rewrite %require directive.
5669 * examples/calc++/Makefile.am: Pass VERSION to extexi.
5670
5671 * src/files.c (compute_exts_from_gc): Look in language structure
5672 for .y extension.
5673 (compute_file_name_parts): Check whether .tab should be added.
5674 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
5675 (language, skeleton_arg, language_argmatch): New.
5676 (long_options): Add --language.
5677 (getargs): Use skeleton_arg, add -L/--language.
5678 * src/getargs.h: Include location.h.
5679 (struct bison_language, language, skeleton_arg, language_argmatch): New.
5680 * src/output.c (prepare): Pick default skeleton from struct language.
5681 Don't dispatch C skeletons here.
5682 * src/parse-gram.y (PERCENT_LANGUAGE): New.
5683 (prologue_declaration): Add "%language" rule, use skeleton_arg.
5684 * src/scan-gram.l ("%language"): New rule.
5685
5686 * tests/calc.at: Test %skeleton and %language.
5687 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
5688 (AT_GLR_IF): Look for %skeleton "glr.cc".
5689 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
5690 (AT_YACC_IF): Reject %language.
5691
5691bf57
PE
56922006-12-18 Paul Eggert <eggert@cs.ucla.edu>
5693
db06f0ce
PE
5694 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
5695 since it wasn't used; only the typedef name 'semantic_type' is needed.
5696 Also, omit trailing white space.
5697
5691bf57
PE
5698 * bootstrap: Sync from coreutils.
5699 (gnulib_extra_files): Add build-aux/announce.gen.
5700 (slurp): Adjust .gitignore files like .cvsignore files.
5701 * build-aux/announce-gen: Remove from CVS, since bootstrap
5702 now creates this.
5703
791934e4
JD
57042006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
5705
5706 Make %push-parser imply %pure-parser. This fixes several bugs; see
5707 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
5708 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
5709 pure_parser = true.
5710 * data/push.c: Don't bother testing b4_push_if when deciding whether
5711 to expand b4_declare_parser_variables globally.
5712 (yypush_parse): Likewise in here.
5713
5714 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
5715 (yy_reduce_print): Reformat M4 for readability.
5716
ee5abb37
JD
57172006-12-15 Bob Rossi <bob@brasko.net>
5718 and Joel Denny <jdenny@ces.clemson.edu>
5719
5720 * data/push.c (yypstate): Add typedef, and update all uses of
5721 struct yypstate to just yypstate.
5722 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
5723
16ca01f9
JD
57242006-12-14 Bob Rossi <bob@brasko.net>
5725
5726 * data/push.c (yypush_parse): Declare prototype regardless of
5727 %locations option.
5728
ab8e7e1a
JD
57292006-12-14 Bob Rossi <bob@brasko.net>
5730
5731 * data/push.c (yyparse): Remove the prototype and the #define when in
5732 push-parser mode.
5733
9bf32be3
JD
57342006-12-13 Bob Rossi <bob@brasko.net>
5735
5736 * data/push.c (yypstate_init): Rename to...
5737 (yypstate_new): ... this and use b4_c_function_def.
5738 (yypstate_delete): New.
5739 (yypush_parse): Change parameters yynval and yynlloc to be const.
5740 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
5741 yypstate_delete functions.
5742
f02e2948
JD
57432006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
5744
5745 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
5746 strange test case titles. Reported by Bob Rossi.
5747
38eb7751
PE
57482006-12-13 Paul Eggert <eggert@cs.ucla.edu>
5749
5750 * TODO: Add pointer to Sylvain Schmitz's work on static detection
5751 of potential ambiguities in GLR grammers.
5752
bd9d212b
JD
57532006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
5754
5755 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
5756 `bison ', use m4_index instead of m4_substr since chopping up a string
5757 containing M4-special characters causes problems here.
5758
5759 Fix a couple of bugs related to special characters in user-specified
5760 file names, and make it easier for skeletons to compute output file
5761 names with the same file name prefix as Bison-computed output file
5762 names.
5763 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
5764 b4_parser_file_name and b4_spec_defines_file instead of
5765 @output_parser_name@ and @output_header_name@, which are now redundant.
5766 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
5767 b4_parser_file_name, b4_spec_defines_file, and the new
5768 @basename(FILENAME@) instead of @output_parser_name@ and
5769 @output_header_name@, which inappropriately escaped the file names as
5770 C string literals.
5771 * src/files.c (all_but_ext): Remove static qualifier.
5772 (compute_output_file_names): Move `free (all_but_ext)' to...
5773 (output_file_names_free): ... here since all_but_ext is needed later.
5774 * src/files.h (all_but_ext): Extern.
5775 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
5776 exactly what MUSCLE_INSERT_STRING used to do.
5777 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
5778 characters are escaped properly.
5779 * src/output.c (prepare): Define muscle file_name_all_but_ext as
5780 all_but_ext.
5781 For pkgdatadir muscle, maintain previous functionality by using
5782 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
5783 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
5784 digraphs would never be expanded. Hopefully no one has M4-special
5785 characters in his Bison installation path.
5786 * src/scan-skel.l: Don't parse @output_header_name@ and
5787 @output_parser_name@ anymore since they're now redundant.
5788 In @output, use decode_at_digraphs.
5789 Parse a new @basename command that invokes last_component.
5790 (decode_at_digraphs): New.
5791 (BASE_QPUTS): Remove unused.
5792 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
5793 (Output file name): New tests.
5794
3f7ca628
JD
57952006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
5796
5797 Warn about output files that are generated by the skeletons and that
5798 conflict with other output files.
5799 * data/glr.c: Don't generate the header file here when glr.cc does.
5800 * src/files.c (file_names, file_names_count): New static globals.
5801 (compute_output_file_names): Invoke output_file_name_check for files
5802 not generated by the skeletons and remove existing checks.
5803 (output_file_name_check): New function that warns about conflicting
5804 output file names.
5805 (output_file_names_free): Free file_names.
5806 * src/files.h (output_file_name_check): Declare.
5807 * src/scan-skel.l: Invoke output_file_name_check for files generated by
5808 the skeletons.
5809 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
5810 (Conflicting output files): New tests.
5811
178e123e
PE
58122006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5813
5814 * doc/bison.texinfo: Fix a couple of typos.
5815
58162006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
5817
5818 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
5819 Rename to...
5820 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
5821 update all uses.
5822 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
5823 (yypush_parse): Rename yypvars argument to yyps and remove redundant
5824 local pv.
5825 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
5826 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
5827
ea17f233
JD
58282006-12-07 Bob Rossi <bob@brasko.net>
5829 and Joel Denny <jdenny@ces.clemson.edu>
5830
5831 * data/push.c (yypvarsinit): Change return type from void* to struct
5832 yypvars*. No longer cast to void* on return.
5833 (struct yypvars): Remove yylen since it need not be remembered between
5834 yypushparse invocations.
5835 (yypushparse): Don't copy between yylen and pv->yylen.
5836
55a30bda
JD
58372006-12-05 Bob Rossi <bob@brasko.net>
5838
5839 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
5840 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
5841 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
5842 (struct yypvars): Remove b4_declare_parser_variables.
5843 (yypvarsinit): Remove init code for removed variables.
5844 (global scope): Do not declare b4_declare_parser_variables if
5845 push or pure mode.
5846 (yypushparse): Add b4_declare_parser_variables.
5847 Init new local variables, and remove init code for removed
5848 yypvars variables.
5849 (yyparse): Delete.
5850 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
5851 and yyparse for other modes.
5852 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
5853 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
5854 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
5855 (AT_PURE_LEX_IF): True if pure or push parser.
5856
85894313
JD
58572006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
5858
5859 Document Yacc prologue alternatives and default %destructor's and
5860 %printer's as experimental. Don't mention Java yet. Discussed at
5861 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
5862 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
5863 (2.3a): Annotate this entry to say the old forms of these features were
5864 also experimental.
5865 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 5866 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
5867 of Java (we'll want this back eventually).
5868
02975b9a
JD
58692006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
5870
5871 Support a file name argument to %defines. Deprecate `=' in
5872 %file-prefix, %name-prefix, and %output. Discussed at
5873 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
5874 * NEWS (2.3a+): Mention.
148d66d8 5875 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
5876 form of %defines, and remove `=' from entries for %file-prefix,
5877 %name-prefix, and %output.
5878 * src/parse-gram.y (prologue_declaration): Implement.
5879 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
5880 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
5881 all but one occurrence of %name-prefix.
5882 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
5883 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
5884 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
5885 occurrence of each of %file-prefix and %output. Add check for %defines
5886 with argument.
5887 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
5888 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
5889 Remove the `=' from %output.
5890
287b314e
JD
58912006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
5892
5893 Don't escape $ in test case titles since Autoconf 2.61 now does that
5894 correctly.
5895 * tests/actions.at (Default %printer and %destructor are not for error
5896 or $undefined): Here.
5897 (Default %printer and %destructor are not for $accept): Here.
5898 * tests/input.at (Invalid $n and @n): Here.
5899
3ebecc24
JD
59002006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
5901
5902 Rename <!> to <>. Discussed starting at
5903 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
5904 * NEWS (2.3a+): Update.
148d66d8 5905 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
5906 Update.
5907 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
5908 * src/scan-gram.l (INITIAL): Implement.
5909 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
5910 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
5911 comment.
5912 * tests/actions.at (Default tagless %printer and %destructor,
5913 Default tagged and per-type %printer and %destructor,
5914 Default %printer and %destructor are not for error or $undefined,
5915 Default %printer and %destructor are not for $accept,
5916 Default %printer and %destructor for mid-rule values): Update.
5917 * tests/input.at (Default %printer and %destructor redeclared,
5918 Unused values with default %destructor): Update.
5919
26b8a438
JD
59202006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
5921
5922 Don't let %prec take a nonterminal.
5923 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
5924 token.
5925 * tests/input.at (%prec takes a token): New test checking that %prec
5926 won't take a nonterminal.
5927
07c39ae9
JD
59282006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
5929
405d53b7
JD
5930 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
5931 it was double-quoted.
07c39ae9
JD
5932 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
5933 grammar is maintained with Bison's highest standards.
5934 * src/getargs.c: Fix some typos in Doxygen comments.
5935
580b8926
JD
59362006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
5937
5938 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
5939 later. Reported by Paul Eggert in
5940 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
5941 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
5942 * src/scan-code.l (translate_action): Don't bother invoking
5943 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
5944 (code_scanner_free): Instead of invoking
5945 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
5946 which frees more.
5947 * src/scan-gram.l (gram_scanner_free): Likewise.
5948 * src/scan-skel.l (scan_skel): Likewise.
5949
4502eadc
JD
59502006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
5951
5952 * src/files.c (tr): Change return type to void.
5953 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
5954 has been called previously for the same key.
5955 (muscle_find): Return storage instead of value so that
5956 --enable-gcc-warnings doesn't produce warnings that the return discards
5957 const. aver that the value and storage are the same since storage
5958 could potentially be NULL when value is not.
5959 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
5960 same as 0.
5961
7746c8f6
PE
59622006-11-08 Paul Eggert <eggert@cs.ucla.edu>
5963
5964 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
5965 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
5966 us a slightly cleaner distribution, and also works.
5967 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
5968 gnulib changes.
5969
eb095650
PE
59702006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
5971 and Paul Eggert <eggert@cs.ucla.edu>
5972
5973 Don't let Bison leak memory except when it complains.
5974 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
5975 (spec_defines_file, dir_prefix): Now char *, not const char *,
5976 since they are freed.
5977 * src/files.c: Likewise.
5978 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
5979 Likewise.
5980 (tr): Now operates in-place. All uses changed.
5981 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
5982 values.
5983 (compute_file_name_parts, compute_output_file_names): Don't store
5984 read-only data in variables that will be freed.
5985 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
5986 src_extension, and header_extension.
5987 (output_file_names_free): New public function to free
5988 spec_verbose_file, spec_graph_file, spec_defines_file,
5989 parser_file_name, and dir_prefix.
5990 * src/getargs.c (getargs): Don't store read-only data in variables that
5991 will be freed.
5992 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
5993 (which previously existed but was unused), and quotearg_free.
5994 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
5995 * src/muscle_tab.c: Likewise.
5996 (muscle_entry): Make the value char const *,
5997 and add a new storage member that is char * and can be freed.
5998 (muscle_entry_free): New private function.
5999 (muscle_init): Use it instead of free.
6000 (muscle_insert, muscle_grow): Update and use new storage member.
6001 (muscle_code_grow): Free the string passed to muscle_grow
6002 since it's not needed anymore.
6003 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
6004 add a new `char *code' member.
6005 ("{...}"): Declare semantic type as code.
6006 * src/scan-code.h (translate_rule_action):
6007 (translate_symbol_action, translate_code, translate_action): Return
6008 `char const *' rather than `char *' since external code should not free
6009 these strings.
6010 * src/scan-code.l: Likewise.
6011 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
6012 which is "{...}" in the parser.
6013 * tests/Makefile.am (maintainer-check-valgrind): Set
6014 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
6015 Valgrind.
6016 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
6017 complain.
6018 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
6019 expecting a non-zero exit status sets --leak-check=summary and
6020 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
6021 this case, and we don't want to hear about it.
6022
ac564be4
PE
60232006-11-08 Paul Eggert <eggert@cs.ucla.edu>
6024
6025 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
6026 instead of from the template, to simplify configuration a bit.
6027 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
6028 and m4/wint_t.m4, as they are needed with the latest gnulib.
6029
17bd8a73
JD
60302006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6031
6032 Disable unset/unused mid-rule value warnings by default, and recognize
6033 --warnings=midrule-values to enable them. Discussed starting at
6034 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
6035 * NEWS (2.3a+): Mention.
6036 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
6037 warnings): Add entry for midrule-values subargument.
6038 * src/reader.c (symbol_should_be_used): Don't return true just because
6039 the value is a set/used mid-rule value unless
6040 --warnings=midrule-values was specified.
6041 * tests/input.at (Unused values, Unused values before symbol
6042 declarations): Run tests with and without --warnings=midrule-values.
6043
6044 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
6045 than LIST_FREE directly.
6046
89eb3c76
JD
60472006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6048
6049 Finish implementing --warnings=error, which should not be implied by
6050 --warnings=all (or by its synonyms -W and --warnings without
6051 subarguments).
6052 * src/complain.c (set_warning_issued): New function to report that
6053 warnings are being treated as errors and to record an error if so.
6054 Invoke...
6055 (warn_at, warn): ... here.
6056 * src/getargs.c (warnings_args, warnings_types): Reorder so that
6057 "error - warnings are errors" does not appear above "all - all of the
6058 above".
6059 (getargs): For -W and --warnings without subarguments, don't let
6060 FLAGS_ARGMATCH set warnings_error in warnings_flag.
6061 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
6062
ba7560e2
JD
60632006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6064
6065 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
6066 empty subargument list. For example: `bison --warnings= parser.y'.
6067
31283fc3
JD
60682006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6069
6070 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
6071 the parser header file so that gcc doesn't warn.
6072
12e35840
JD
60732006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6074
6075 Split the default %destructor/%printer into two kinds: <*> and <!>.
6076 Discussed starting at
6077 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
6078 * NEWS (2.3a+): Mention.
6079 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
6080 previous change today related to mid-rules.
148d66d8 6081 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 6082 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
6083 (TYPE_TAG_ANY): Add as <*>.
6084 (TYPE_TAG_NONE): Add as <!>.
6085 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
6086 for <*> and <!>.
6087 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
6088 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
6089 * src/symlist.c (symbol_list_default_new): Split into tagged and
6090 tagless versions.
6091 (symbol_list_destructor_set, symbol_list_printer_set): Split
6092 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
6093 SYMLIST_DEFAULT_TAGLESS.
6094 * src/symlist.h: Update symbol_list_default*_new prototypes.
6095 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
6096 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
6097 * src/symtab.c (default_destructor, default_destructor_location,
6098 default_printer, default_printer_location): Split each into tagged and
6099 tagless versions.
6100 (symbol_destructor_get, symbol_destructor_location_get,
6101 symbol_printer_get, symbol_printer_location_get): Implement tagged
6102 default and tagless default cases.
6103 (default_destructor_set, default_printer_set): Split each into tagged
6104 and tagless versions.
6105 * src/symtab.h: Update prototypes.
6106 * tests/actions.at (Default %printer and %destructor): Rename to...
6107 (Default tagless %printer and %destructor): ... this, and extend.
6108 (Per-type %printer and %destructor): Rename to...
6109 (Default tagged and per-type %printer and %destructor): ... this, and
6110 extend.
6111 (Default %printer and %destructor for user-defined end token): Extend.
6112 (Default %printer and %destructor are not for error or $undefined):
6113 Update.
6114 (Default %printer and %destructor are not for $accept): Update.
6115 (Default %printer and %destructor for mid-rule values): Extend.
6116 * tests/input.at (Default %printer and %destructor redeclared): Extend.
6117 (Unused values with default %destructor): Extend.
6118
f91b1629
JD
61192006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6120
6121 Don't apply the default %destructor/%printer to an unreferenced midrule
6122 value. Mentioned at
6123 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
6124 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
6125 like $@n instead of just @n so that the default %destructor/%printer
6126 logic doesn't see them as user-defined symbols.
6127 (symbol_is_dummy): Check for both forms of the name.
6128 * src/reader.c (packgram): Remove the `$' from each midrule symbol
6129 name for which the midrule value is referenced in any action.
6130 * tests/actions.at (Default %printer and %destructor for mid-rule
6131 values): New test.
6132 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
6133 for change to dummy symbol names.
6134
519d0004
JD
61352006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
6136
6137 Warn about unset midrule $$ if the corresponding $n is used.
6138 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
6139 $n usage.
6140 (packgram): Before invoking grammar_rule_check on any rule, make sure
6141 all actions have already been scanned in order to set `used' flags.
6142 Otherwise, checking that a midrule's $$ is set will not always work
6143 properly because the midrule check must forward-reference the midrule's
6144 parent rule.
6145 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
6146 warning.
6147
a501eca9
JD
61482006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
6149
6150 More improvements to the documentation of the prologue alternatives:
6151 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
6152 Bison manual.
6153 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
6154 some text to clarify the relative importance of the new directives and
6155 to show how these directives may be viewed as code labels.
6156
2cbe6b7f
JD
61572006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
6158
6159 Similar to the recently removed %before-header, add %code-top as the
6160 alternative to the pre-prologue. Mentioned at
6161 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
6162 Also, let the prologue alternatives appear in the grammar section.
6163 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
6164 (prologue_declaration): Move the existing prologue alternatives to...
6165 (grammar_declaration): ... here and add %code-top.
6166 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
6167
6168 Clean up and extend documentation for the prologue alternatives.
6169 * NEWS (2.3a+): Describe prologue alternatives.
6170 * doc/bison.texinfo (Prologue): Move discussion of prologue
6171 alternatives to...
6172 (Prologue Alternatives): ... this new section, and extend it to discuss
6173 all 4 directives in detail.
148d66d8
JD
6174 (Table of Symbols): Clean up discussion of prologue alternatives and
6175 add %code-top.
2cbe6b7f 6176
e557d3ea
JMG
61772006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6178
6179 DJGPP specific issues.
6180
6181 * djgpp/config.bat: config.hin has been moved to lib. Adjust
6182 config.bat accordingly.
6183 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
6184 * djgpp/config.site: Likewise.
6185
136a0f76
PB
61862006-10-16 Paolo Bonzini <bonzini@gnu.org>
6187
27bd5d67
PB
6188 Replace %*-header with %provides, %requires, %code. See discussion at
6189 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
6190
136a0f76
PB
6191 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
6192 (b4_user_start_header): Remove.
6193 * data/glr.c: Use new macros instead of b4_*start_header
6194 and b4_*end_header.
6195 * data/glr.cc: Likewise.
6196 * data/lalr1.cc: Likewise.
6197 * data/push.c: Likewise.
6198 * data/yacc.c: Likewise.
6199
6200 * doc/bison.texinfo: Remove %before-header, rename
6201 %{start,end,after}-header to %requires, %provides, %code.
6202
6203 * src/parse-gram.y: Likewise (also rename token names accordingly).
6204 * src/scan-gram.l: Likewise.
6205 * tests/actions.at: Likewise.
6206
10f429ef
PE
62072006-10-14 Paul Eggert <eggert@cs.ucla.edu>
6208
6209 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
6210 Problem reported by Joel E. Denny.
6211
62122006-10-14 Jim Meyering <jim@meyering.net>
6213
6214 (Sync from coreutils.)
6215 Work also when the working directory (with e.g. coreutils sources)
6216 is version controlled with git, rather than CVS.
6217 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
6218 rather than CVS.
6219 In messages and comments, say e.g., "checked-out sources",
6220 rather than "CVS sources".
6221 (version_controlled_file): New function. Work for git as well as
6222 for CVS. Don't use grep's -q option.
6223 (slurp): Call it here, in place of CVS-specific code.
6224
c4bd5bf7
JD
62252006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
6226
6227 Fix testsuite for ./configure --enable-gcc-warnings:
6228 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
6229 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
6230 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
6231 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
6232 * test/regression.at (Diagnostic that expects two alternatives):
6233 Likewise.
6234
46356ea4
PE
62352006-10-12 Paul Eggert <eggert@cs.ucla.edu>
6236
231ed89a
PE
6237 * bootstrap.conf (gnulib_modules): Add config-h.
6238 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
6239 worry about HAVE_CONFIG_H.
6240 * lib/abitset.c: Likewise.
6241 * lib/bitset.c: Likewise.
6242 * lib/bitset_stats.c: Likewise.
6243 * lib/bitsetv-print.c: Likewise.
6244 * lib/bitsetv.c: Likewise.
6245 * lib/ebitset.c: Likewise.
6246 * lib/get-errno.c: Likewise.
6247 * lib/lbitset.c: Likewise.
6248 * lib/subpipe.c: Likewise.
6249 * lib/timevar.c: Likewise.
6250 * lib/vbitset.c: Likewise.
6251 * lib/bitset.c: Include "bitset.h" first, to test interface.
6252 * lib/bitset_stats.c: Include "bitset_stats.h" first.
6253 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
6254 * lib/bitsetv.c: Include "bitsetv.h" first.
6255 * lib/get-errno.c: Include "get-errno.h" first.
6256 * m4/.cvsignore: Add config-h.m4.
6257 * tests/actions.at (Default %printer and %destructor for ...):
6258 Adjust expected line numbers in output to reflect removal of #if
6259 HAVE_CONFIG_H lines.
6260 * tests/glr-regression.at (Missed %merge type warnings when ...):
6261 Likewise.
6262 * tests/regression.at (Braced code in declaration in rules section):
6263 Likewise.
6264 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
6265 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
6266 Include <config.h> unconditionally.
6267
46356ea4
PE
6268 * bootstrap: Sync from coreutils, as follows:
6269
6270 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
6271
6272 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
6273 variable was sometimes used without being initialized. This
6274 messed up the installation of the INSTALL file in some cases.
6275
6276 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
6277
6278 * bootstrap (usage, main program, symlink_to_gnulib): Add option
6279 --copy. Inspired by a suggestion from Bruno Haible.
6280
6281 2006-10-03 Jim Meyering <jim@meyering.net>
6282
6283 * bootstrap: Undo last change to this file, since now gnulib-tool
6284 sticks with the automake default in generating dependencies.
6285
dd4bf078
PE
62862006-10-12 Paul Eggert <eggert@cs.ucla.edu>
6287
cf2a5f7c
PE
6288 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
6289 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
6290
6291 * doc/bison.1: Add copyright notice.
6292
6293 * data/glr.c: Don't include <stdarg.h>; not used.
6294
35fe0834
PE
6295 * NEWS: The -g and --graph options now output graphs in Graphviz
6296 DOT format, not VCG format.
6297 * doc/bison.1: Likewise.
6298 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
6299 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
6300 of this change in
6301 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
6302 * TODO: Remove Graphviz entry.
6303 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
6304 remove vcg.c, vcg.h, vcg_defaults.h.
6305 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
6306 * src/graphviz.c, src/graphviz.h: New files.
6307 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
6308 * src/files.h: Make comment more generic.
6309 * src/main.c (main): Likewise.
6310 * src/print_graph.h: Likewise.
6311 * src/getargs.c (usage): Make usage description more generic.
6312 * src/print_graph.c: Include graphviz.h rather than vcg.h.
6313 (static_graph, fgraph): Remove. All uses changed to pass
6314 arguments instead of sharing a static var.
6315 (print_core, print_actions, print_state, print_graph):
6316 Output graphviz format rather than VCG format.
6317 * tests/.cvsignore: Remove *.vcg; add *.dot.
6318 * tests/output.at: Expect *.dot files, not *.vcg files.
6319
dd4bf078
PE
6320 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
6321 accommodates the 2006-10-08 change.
6322
efdd7421
PE
63232006-10-11 Bob Rossi <bob@brasko.net>
6324
6325 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
6326 (b4_yyssa, b4_yyerror_range): New macros.
6327 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
6328 (yypvarsinit): Remove init of removed fields.
6329 (yypushparse): Remove use of removed fields; use new macros instead.
6330
96a1981a
PE
63312006-10-11 Paul Eggert <eggert@cs.ucla.edu>
6332
6333 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
6334 in a push parser. Reindent slightly to match yacc.c better.
6335
63362006-10-11 Bob Rossi <bob@brasko.net>
6337
46356ea4
PE
6338 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
6339 yymsg_alloc fields.
6340 (yypvarsinit, yypushparse): Remove init of removed fields.
6341 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 6342
c1630a8b
PE
63432006-10-09 Paul Eggert <eggert@cs.ucla.edu>
6344
6345 * THANKS: Add Paolo Bonzini and Bob Rossi.
6346
90b9908d
PB
63472006-10-08 Paolo Bonzini <bonzini@gnu.org>
6348
6349 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
6350 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
6351 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
6352 b4_define_user_cde and uses): Remove.
6353 (b4_comment, b4_prefix, b4_sync_start): New.
6354 * data/bison.m4: New file, with most of the content removed from c.m4.
6355 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
6356 * src/output.c (output_skeleton): Pass bison.m4.
6357 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
6358 only if specified.
6359
cf806753
PE
63602006-10-05 Paul Eggert <eggert@cs.ucla.edu>
6361
6362 Fix test failure reported by Tom Lane in
6363 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
6364 and try to make such failures easier to catch in the future.
6365 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
6366 that's now the caller's responsibility.
6367 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
6368 Set yychar = YYEOF if it's negative.
6369 * tests/actions.at (yylex): Abort if asked to read past EOF.
6370 * tests/conflicts.at (yylex): Likewise.
6371 * tests/cxx-type.at (yylex): Likewise.
6372 * tests/glr-regression.at (yylex): Likewise.
6373 * tests/input.at (yylex): Likewise.
6374 * tests/regression.at (yylex): Likewise.
6375 * tests/torture.at (yylex): Likewise.
6376
0e2f006a
PE
63772006-10-01 Paul Eggert <eggert@cs.ucla.edu>
6378
6379 Fix problems with translating English-language diagnostics.
6380 * bootstrap: Fix bug introduced in recent bootstrap changes, with
6381 respect to bison-runtime pot generation. The YY_ stuff
6382 wasn't being captured.
6383 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
6384 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
6385 * runtime-po/POTFILES.in: Add data/push.c.
6386
e3ddc1e3
PE
63872006-09-29 Paul Eggert <eggert@cs.ucla.edu>
6388
6389 Merge bootstrap changes from coreutils.
6390
6391 2006-09-28 Jim Meyering <jim@meyering.net>
6392
6393 Automatically generated dependencies are important even
6394 when all of the sources in a directory come from gnulib.
6395 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
6396 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
6397
6398 2006-09-23 Jim Meyering <jim@meyering.net>
6399
6400 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
6401
6402 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6403
6404 * bootstrap: Add support for --force.
6405 (usage): New function. Describe usage less tersely.
6406 (CVS_only_file): New var.
6407
01e972b3
PE
64082006-09-21 Paul Eggert <eggert@cs.ucla.edu>
6409
6410 * data/push.c (YYPUSH_MORE): Make it an enum instead.
6411 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
6412 Adjust white space and comments to match GNU style better.
6413
c63d3e90
PE
64142006-09-20 Bob Rossi <bob@brasko.net>
6415
6416 * data/push.c (yyresult_get): Remove function.
6417 (YYPUSH_MORE): Add #define.
6418 (yypushparse): Modify return value.
6419
e70f46d1
PE
64202006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6421
6422 * stamp-h.in: Remove; no longer needed.
6423 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
6424 Remove config.h, config.hin, intl (no longer created).
6425 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
6426 stamp-h1.
6427
6428 Sync bootstrap from coreutils, as follows:
6429
6430 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
6431
6432 * bootstrap (symlink_to_gnulib): New function.
6433 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
6434 to copies-of-gnulib.
6435 (cp_mark_as_generated, slurp, gnulib_files):
6436 Avoid making a copy if it's the same as the old version.
6437 (gnulib_files): Add support for this variable (used by Bison).
6438
a92be413
PE
64392006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6440
6441 * src/getargs.c (usage): Rework to use conventions similar to
6442 coreutils, to make translation a bit easier and the code a bit
6443 smaller. Problem reported by Tim Van Holder.
6444
4f82b42a
PE
64452006-09-15 Paul Eggert <eggert@cs.ucla.edu>
6446
3b2942e6
PE
6447 Use some of gnulib's new modules, taken from coreutils.
6448
6449 * bootstrap: Sync from coreutils, except add support for gnulib_files.
6450 * bootstrap.conf: New file.
6451 (gnulib_modules): Add configmake, inttypes, unistd.
6452 (XGETTEXT_OPTIONS): Add complain, complain_at,
6453 fatal, fatal_at, warn, warn_at, unexpected_end.
6454 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
6455 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
6456 (gl_EARLY): Add.
6457 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
6458 (gl_INIT): Add
6459 (GNULIB_AUTOCONF_SNIPPET): Remove.
6460 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
6461 the pickiest.
6462 * lib/.cvsignore: Add inttypes_.h.
6463 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
6464 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
6465 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
6466 no-longer-necessary initializations.
6467 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
6468 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
6469 use the unistd module.
6470 * src/system.h: Likewise.
6471 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
6472 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
6473 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
6474 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
6475 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
6476 * src/system.h: Include inttypes.h unconditionally, now that we
6477 use the inttypes module. Don't bother to include stdint.h, since
6478 inttypes.h now does that for us.
6479 (LOCALEDIR): Remove, now that we use the configmake module.
6480 * src/getargs.c: Include configmake.h.
6481 * src/main.c: Likewise.
6482 * src/output.c: Likewise.
6483 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
6484 not from $abs_top_builddir, since config.h moved.
6485
6486
4f82b42a
PE
6487 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
6488 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
6489
6490 * src/parse-gram.y (symbol_declaration): Don't put statements
6491 before declarations; it's not portable to C89.
6492 * src/scan-code.l (handle_action_at): Likewise.
6493
6494 * src/scan-code.l: Always initialize braces_level; the old code
6495 left it uninitialized and therefore had undefined behavior.
6496
6497 Don't attempt to redefine 'assert', since it runs afoul of
6498 systems where standard headers (mistakenly) include <assert.h>.
6499 Instead, define and use our own alternative, called 'aver'.
6500 * src/reader.c: Don't include assert.h, since we no longer
6501 use assert.
6502 * src/scan-code.l: Likewise.
6503 * src/system.h (assert): Remove, replacing with....
6504 (aver): New function, taking a bool arg. All uses changed.
6505 * src/tables.c (pack_vector): Ensure that aver arg is bool,
6506 not merely an integer.
6507
31c10e38
PE
65082006-09-15 Bob Rossi <bob@brasko.net>
6509
e5926647
JD
6510 Add support for push parsing. Based on the original work of
6511 Odd Arild Olsen <oao@fibula.no>.
31c10e38
PE
6512 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
6513 * data/c.m4 (YYPUSH): New.
6514 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
e5926647 6515 * data/push.c: New file.
31c10e38
PE
6516 * src/getargs.c (push_parser): New var.
6517 * src/getargs.h (push_parser): New declaration.
6518 * src/output.c (prepare): Add macro insertion of `push_flag'.
6519 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
6520 (prologue_declaration): Parse %push-parser.
6521 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
6522 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
6523 list of removed lines from the traces observed.
6524 (AT_CHECK_CALC_LALR): Added push parser tests.
6525
fa7b79c0
PE
65262006-09-13 Paul Eggert <eggert@cs.ucla.edu>
6527
21fe08ca
PE
6528 * NEWS: Version 2.3a.
6529 * configure.ac (AC_INIT): Likewise.
6530
e8ec4d9b
PE
6531 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
6532 "#define YYSTYPE int" that caused "make maintainer-check" to fail
6533 due to header ordering dependencies. I don't know why the #define
6534 was there.
6535
fa7b79c0
PE
6536 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
6537 runtime cost when YYDEBUG is not defined, and so that some tests
6538 that used to fail now work. Problem and initial suggestion by
6539 Paolo Bonzini.
6540 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
6541 * data/glr.cc (b4_parser_class_name):
6542 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
6543 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
6544 (yydebug_) [YYDEBUG]: New member.
6545 (yycdebug_): Now defined only if YYDEBUG.
6546 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
6547 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
6548 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
6549 if YYYDEBUG.
6550 (debug_stream, set_debug_stream, debug_level, set_debug_level):
6551 Define only if YYDEBUG.
6552 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
6553 set_debug_level.
6554 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
6555 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
6556 AT_CHECK_CALC_GLR_CC that are working now.
6557
4ec13d60
PE
65582006-09-12 Paul Eggert <eggert@cs.ucla.edu>
6559
6560 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
6561 We don't need them in glr.cc, and glr.c defines them.
6562 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
6563 assumes that defining it to anything is the same as defining
6564 it to 1. Problem reported by Paolo Bonzini.
6565
8e1687ae
PE
65662006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
6567
6568 * data/c.m4 (b4_null, b4_case): Define.
6569 * src/output.c (prepare_symbols): Use b4_null.
6570 (user_actions_output): Use b4_case.
6571
3dc5e96b
PE
65722006-09-11 Paul Eggert <eggert@cs.ucla.edu>
6573
aef3da86
PE
6574 * data/glr.c (b4_shared_declarations): Put start-header first,
6575 before any #includes that we generate, so that feature-test
6576 macros work. Problem reported by Michael Deutschmann in
6577 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
6578 * data/lalr1.cc: Likewise.
6579 * doc/bison.texinfo (Prologue): Document that feature-test macros
6580 should be defined before any Bison declarations.
6581 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
6582 that depend on location.hh after, not before, Bison decls, since
6583 we now include location.hh after the first user prologue.
6584
3dc5e96b
PE
6585 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
6586 Sander Brandenburg in
6587 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
6588 Also, fix minor white space and comment issues.
aef3da86
PE
6589 (Prologue): Mention that it's better to define feature-test macros
6590 before Bison declarations. Problem reported by Michael Deutschmann.
6591
6592 * README-cvs: Fix typo: "&" should be "&&". Problem reported
6593 by Jim Meyering.
6594 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
6595 This adjusts to recent gnulib changes.
3dc5e96b 6596
b2a0b7ca
JD
65972006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
6598
6599 Finish implementation of per-type %destructor/%printer. Discussed
6600 starting at
6601 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
6602 and
6603 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
6604 * NEWS (2.3+): Add a description of this feature to the default
6605 %destructor/%printer description.
6606 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
6607 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
6608 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
6609 list node contains a semantic type.
6610 * src/symtab.c, src/symtab.h: Extend with a table that associates
6611 semantic types with their %destructor's and %printer's.
6612 (semantic_type_from_uniqstr, semantic_type_get,
6613 semantic_type_destructor_set, semantic_type_printer_set): New functions
6614 composing the public interface of that table.
6615 (symbol_destructor_get, symbol_destructor_location_get,
6616 symbol_printer_get, symbol_printer_location_get): If there's no
6617 per-symbol %destructor/%printer, look up the per-type before trying
6618 the default.
6619 * tests/actions.at (Per-type %printer and %destructor): New test case.
6620 * tests/input.at (Default %printer and %destructor redeclared):
6621 Extend to check that multiple occurrences of %symbol-default in a
6622 single %destructor/%printer declaration is an error.
6623 (Per-type %printer and %destructor redeclared, Unused values with
6624 per-type %destructor): New test cases.
6625
3be03b13
JD
66262006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
6627
6628 Require default %destructor/%printer to be declared using
6629 %symbol-default instead of an empty symbol list, and start working on
6630 new per-type %destructor/%printer. Discussed at
6631 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
6632 * NEWS (2.3+): Add %symbol-default to example.
6633 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 6634 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
6635 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
6636 (generic_symlist, generic_symlist_item): New nonterminals for creating
6637 a list in which each item is a symbol, semantic type, or
6638 %symbol-default.
6639 (grammar_declaration): Use generic_symlist in %destructor and %printer
6640 declarations instead of symbols.1 or an empty list.
6641 (symbol_declaration, precedence_declaration, symbols.1): Update actions
6642 for changes to symbol_list.
6643 * src/reader.c: Update for changes to symbol_list.
6644 * src/scan-code.l: Likewise.
6645 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
6646 * src/symlist.c, src/symlist.h: Extend such that a list node may
6647 represent a semantic type or a %symbol-default in addition to just an
6648 ordinary symbol. Add switched functions for setting %destructor's and
6649 %printer's.
6650 * tests/actions.at, tests/input.at: Add %symbol-default to all default
6651 %destructor/%printer declarations.
6652
3508ce36
JD
66532006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
6654
6655 Whether the default %destructor/%printer applies to a particular symbol
6656 isn't a question of whether the user *declares* that symbol (in %token,
6657 for example). It's a question of whether the user by any means
6658 *defines* the symbol at all (by simply using a char token, for
6659 example). $end is defined by Bison whereas any other token with token
6660 number 0 is defined by the user. The error token is always defined by
6661 Bison regardless of whether the user declares it with %token, but we
6662 may one day let the user define error as a nonterminal instead.
6663 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
6664 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
6665 the meaning of "user-defined".
6666 * tests/actions.at (Default %printer and %destructor for user-declared
6667 end token): Rename to...
6668 (Default %printer and %destructor for user-defined end token): ...
6669 this.
6670
6671 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
6672 computation of whether to apply the default, don't maintain a list of
6673 every Bison-defined symbol. Instead, just check for a first character
6674 of '$', which a user symbol cannot have, and check for the error token.
6675
9350499c
JD
66762006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
6677
6678 Don't apply the default %destructor or %printer to the error token,
6679 $undefined, or $accept. This change fits the general rule that the
6680 default %destructor and %printer are only for user-declared symbols,
6681 and it solves several difficulties that are described in the new test
6682 cases listed below.
6683 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
6684 * tests/actions.at (Default %printer and %destructor are not for error
6685 or $undefined, Default %printer and %destructor are not for $accept):
6686 New test cases.
6687
4d7370cb
JD
66882006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
6689
6690 Allow %start after the first rule.
6691 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
6692 when parsing the first rule.
6693 (check_and_convert_grammar): Search for it here after all grammar
6694 declarations have been parsed. Skip midrules, which have dummy LHS
6695 nonterminals.
6696 * src/symtab.c (symbol_is_dummy): New function.
6697 * src/symtab.h (symbol_is_dummy): Declare it.
6698 * tests/input.at (%start after first rule): New test.
6699
6d0ef4ec
JD
67002006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
6701
6702 Redo some of the previous commit: add back the ability to use
6703 non-aliased/undeclared string literals since it might be useful to
6704 those declaring %token-table.
6705 * src/reader.c (check_and_convert_grammar): Undo changes in previous
6706 commit: don't worry about complaints from symbols_pack.
6707 * src/symtab.c (symbol_new, symbol_class_set,
6708 symbol_check_alias_consistency): Undo changes in previous commit: count
6709 each string literal as a new symbol and token, assign it a symbol
6710 number, and don't complain about non-aliased string literals.
6711 (symbols_pack): Since symbol_make_alias still does not decrement symbol
6712 and token counts but does still set aliased tokens to the same number,
6713 symbol_pack_processor now leaves empty slots in the symbols array.
6714 Remove those slots.
6715 * tests/regression.at (Undeclared string literal): Remove test case
6716 added in previous commit since non-aliased string literals are allowed
6717 again.
6718 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
6719 remove unnecessary string literal declarations.
6720 * tests/sets.at (Firsts): Likewise.
6721
965537bc
JD
67222006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
6723
6724 Don't allow an undeclared string literal, but allow a string literal to
6725 be used before its declaration.
6726 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
6727 symbols_pack complained.
6728 * src/symtab.c (symbol_new): Don't count a string literal as a new
6729 symbol.
6730 (symbol_class_set): Don't count a string literal as a new token, and
6731 don't assign it a symbol number since symbol_make_alias does that.
6732 (symbol_make_alias): It's not necessary to decrement the symbol and
6733 token counts anymore. Don't assume that an alias declaration occurs
6734 before any uses of the identifier or string, and thus don't assert that
6735 one of them has the highest symbol number so far.
6736 (symbol_check_alias_consistency): Complain if there's a string literal
6737 that wasn't declared as an alias.
6738 (symbols_pack): Bail if symbol_check_alias_consistency failed since
6739 symbol_pack asserts that every token has been assigned a symbol number
6740 although undeclared string literals have not.
6741 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 6742 string literal): New test cases.
965537bc
JD
6743 (Characters Escapes, Web2c Actions): Declare string literals as
6744 aliases.
6745 * tests/sets.at (Firsts): Likewise.
6746
47aee066
JD
67472006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
6748
6749 In the grammar scanner, STRING_FINISH unclosed constructs and return
6750 them to the parser in order to improve error messages.
6751 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
6752 SC_BRACED_CODE, SC_PROLOGUE): Implement.
6753 * tests/input.at (Unclosed constructs): New test case.
6754 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
6755 seen.
6756
6757 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
6758 unused global.
6759
1f6b3679
JD
67602006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
6761
6762 Handle string aliases for character tokens correctly.
6763 * src/symtab.c (symbol_user_token_number_set): If the token has an
6764 alias, check and set its alias's user token number instead of its own,
6765 which is set to indicate the alias. Previously, every occurrence of
6766 the character token in the grammar overwrote that alias indicator with
6767 the character code.
6768 * tests/input.at (String aliases for character tokens): New test.
6769
219741d8
JD
67702006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
6771
6772 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
6773
11daa4e7
PE
67742006-08-11 Paul Eggert <eggert@cs.ucla.edu>
6775
6776 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
6777 to prevent failures when building on older platforms.
6778 Check for autopoint failure.
6779 Set XGETTEXT_OPTIONS to values that check for C format strings,
6780 so that translators are warned about them (this also helps
6781 prevent core dumps).
6782
6783 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
6784 function, since it simplifies our code a bit.
6785
6786 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
6787 rather than -W, so we don't get bogus warnings about sign comparisons.
6788 Add -Wpointer-arith, since that warning is useful (it reports code
6789 that does not conform to C89 and that some compilers reject).
6790 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
6791 since it's no longer needed.
6792
f9bfc42a
JD
67932006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
6794
6795 Clean up scanners a bit.
6796 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
6797 definitions so gcc won't warn when obstack_for_string is unused.
6798 * src/scan-code.l: config.h and system.h are already #include'd by
6799 scan-code-c.c, so get rid of them here.
6800 * src/scan-gram.l: Likewise.
6801 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
6802 definitions rather than duplicating the rest of it.
6803 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
6804
06e8700a
JD
68052006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
6806
6807 Suppress signed/unsigned comparison warnings for yycheck.
6808 * data/c.m4 (b4_safest_int_type): New macro.
6809 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
6810 a signed int type, cast it to b4_safest_int_type first.
6811 * data/yacc.c: Likewise.
6812 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
6813 also overwritten.
6814
9c437126
PE
68152006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
6816
6817 * doc/bison.texinfo: Fix some typos.
6818
284d8a13
PE
68192006-08-02 Paul Eggert <eggert@cs.ucla.edu>
6820
6821 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
6822 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
6823
6824 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
6825 the latest gnulib does this a different way.
6826 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
6827 translation was patched, so stop omitting it.
6828
ec5479ce
JD
68292006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
6830
6831 Enable declaration of default %printer/%destructor. Make the parser
6832 use these for all user-declared grammar symbols for which the user does
6833 not declare a specific %printer/%destructor. Thus, the parser uses it
6834 for token 0 if the user declares it but not if Bison generates it as
6835 $end. Discussed starting at
6836 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
6837 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
6838 and
6839 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
6840 * NEWS (2.3+): Mention.
6841 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
6842 declare a %destructor for a mid-rule's semantic value. It's just
6843 impossible to declare one specific to it.
6844 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
6845 code. Describe default %destructor form.
6846 * src/parse-gram.y (grammar_declaration): Parse default
6847 %printer/%destructor declarations.
6848 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
6849 and symbol_destructor_location_get rather than accessing the destructor
6850 and destructor_location members of struct symbol.
6851 (symbol_printers_output): Likewise but for %printer's.
6852 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
6853 again.
6854 * src/symtab.c (default_destructor, default_destructor_location,
6855 default_printer, default_printer_location): New static global
6856 variables to record the default %destructor and %printer.
6857 (symbol_destructor_get, symbol_destructor_location_get,
6858 symbol_printer_get, symbol_printer_location_get): New functions to
6859 compute the appropriate %destructor and %printer for a symbol.
6860 (default_destructor_set, default_printer_set): New functions to set the
6861 default %destructor and %printer.
6862 * src/symtab.h: Prototype all those new functions.
6863 * tests/actions.at (Default %printer and %destructor): New test to
6864 check that the right %printer and %destructor are called, that they're
6865 not called for $end, and that $$ and @$ work correctly.
6866 (Default %printer and %destructor for user-declared end token): New
6867 test to check that the default %printer and %destructor are called for
6868 a user-declared end token.
6869 * tests/input.at (Default %printer and %destructor redeclared, Unused
6870 values with default %destructor): New tests to check related grammar
6871 warnings and errors.
6872
868d2d96
JD
68732006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
6874
6875 Clean up handling of %destructor for the end token (token 0).
6876 Discussed starting at
6877 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
6878 and
6879 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
6880
6881 Make the skeletons consistent in how they pop the end token and invoke
6882 its %destructor.
6883 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
6884 state, which has token number 0, since this would invoke the
6885 %destructor for the end token.
6886 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
6887 until after shifting the end token, or else it won't be popped.
6888 * data/yacc.c (yyparse): Likewise.
6889
6890 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
6891 it's the end token. Upon termination, destroy an unshifted lookahead
6892 even when it's the end token.
6893 * data/lalr1.cc (yy::parser::parse): Likewise.
6894 * data/yacc.c (yyparse): Likewise.
6895
6896 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
6897 value warnings for the end token when the user gives the end token a
6898 %destructor.
6899
6900 * tests/actions.at (Printers and Destructors): Test all the above.
6901
62a9592d
PE
69022006-07-24 Paul Eggert <eggert@cs.ucla.edu>
6903
6904 Update to latest gnulib and gettext versions.
6905 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
6906 Add fopen-safer.
6907 (gnulib_files): Add m4/warning.m4. Don't worry about files
6908 overwritten by autopoint.
6909 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
6910 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
6911 rejects them.
6912 Don't use autoreconf; instead, invoke autopoint etc. by hand,
6913 so that we can remove the intl files at a better time.
6914 (intl_files_to_remove): Remove aclocal.m4, since it gets
6915 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
6916 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
6917 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
6918 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
6919 Remove datarootdir hack; no longer needed.
6920 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
6921 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
6922 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
6923 strdup.h.
6924 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
6925 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
6926
10d6970f
PE
69272006-07-20 Paul Eggert <eggert@cs.ucla.edu>
6928
6929 * bootstrap: Adjust to today's change to gnulib-tool by invoking
6930 it with --assume-autoconf='latest-stable'.
6931
50a33993
JD
69322006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
6933
6934 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
6935 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
6936 YYSTYPE' and `{'.
6937 * src/muscle_tab.h (muscle_grow): Replace the header comments with
6938 those from muscle_tab.c since the old ones are misleading.
6939
2ce4ed68
AD
69402006-07-13 Akim Demaille <akim@epita.fr>
6941
6942 Support %define "KEY" {VALUE}.
6943 * src/scan-code.h, src/scan-code.l (translate_action)
6944 (translate_rule_action, translate_symbol_action, translate_code):
6945 Return char *, not const char *.
6946 * src/parse-gram.y (declaration): Rename as...
6947 (prologue_declaration): this.
6948 (string_content): Remove this nonterminal, use STRING.
6949 (braceless, content, content.opt): New nonterminal.
6950 Use them.
6951 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
6952 as value.
6953 * src/scan-gram.l (getargs.h): Don't include it.
6954
db7e5eb5
PE
69552006-07-12 Paul Eggert <eggert@cs.ucla.edu>
6956
6957 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
6958 rather than a for-loop that declares a local bool variable. This
6959 should work around a compatibility problem with a Cray x1e C++
6960 compiler reported by Hung Nguyen in
6961 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
6962 The for-loop was introduced in the 2004-11-17 change but I don't
6963 know why it was needed.
6964
a5d80ba5
AD
69652006-07-12 Akim Demaille <akim@epita.fr>
6966
6967 * data/c.m4: Comment changes.
6968
23eb2a69
AD
69692006-07-10 Akim Demaille <akim@lrde.epita.fr>
6970
6971 * src/complain.c (error_message, ERROR_MESSAGE): New.
6972 To factor...
6973 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
6974 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
6975
ddc8ede1
PE
69762006-07-09 Paul Eggert <eggert@cs.ucla.edu>
6977
6978 * NEWS: Instead of %union, you can define and use your own union type
6979 YYSTYPE if your grammar contains at least one <type> tag.
6980 Your YYSTYPE need not be a macro; it can be a typedef.
6981 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
6982 (Union Decl, Decl Summary): Document this.
6983 * data/glr.c (YYSTYPE): Implement this.
6984 * data/glr.cc (YYSTYPE): Likewise.
6985 * data/lalr1.cc (YYSTYPE): Likewise.
6986 * data/yacc.c (YYSTYPE): Likewise.
6987 * src/output.c (prepare): Output tag_seen_flag.
6988 * src/parse-gram.y (declaration, grammar_declaration):
6989 Use 'union_seen' rather than 'typed' to determine whether
6990 %union has been seen, since grammars can now be typed without
6991 %union.
6992 (symbol_declaration, type.opt, symbol_def):
6993 Keep track of whether a tag has been seen.
6994 * src/reader.c (union_seen, tag_seen): New vars.
6995 (typed): remove.
6996 * src/reader.h (union_seen, tag_seen, typed): Likewise.
6997 * src/scan-code.l (untyped_var_seen): New variable.
6998 (handle_action_dollar): Adjust to above changes.
6999 (handle_action_dollar, handle_action_at):
7000 Improve overflow checking for outlandish numbers.
7001 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
7002 avoid new diagnostics generated by above changes.
7003 * tests/regression.at (YYSTYPE typedef): Add test to check
7004 for type tags without %union.
7005
7006 * src/symlist.c (symbol_list_length): Return int, not unsigned
7007 int, since callers expect int. This may need to get revisited
7008 once we have proper integer overflow checking.
7009
7010 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
7011 object is now static.
7012
7013 * src/getargs.c (flags_argmatch): Return void, not int,
7014 to pacify ./configure --enable-gcc-warnings.
7015
7016 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
7017 since last_string is already defined to FLEX_PREFIX (last_string).
7018
7b42569e
AD
70192006-07-09 Akim Demaille <akim@lrde.epita.fr>
7020
7021 Implement --warnings/-W.
7022 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
7023 replaced by...
7024 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
7025 Adjust callers.
7026 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
7027 (warnings_args, warnings_types): New.
7028 (getargs, short_options, long_options): Accept -W/--warnings.
7029 Sort the options by alphabetical order, upper case letter right
7030 before its lower case.
7031
3b452f4e
JD
70322006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
7033
7034 Change %merge result type clash warnings to errors. Discussed at
7035 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
7036 * src/reader.c (record_merge_function_type): Use complain_at.
7037 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7038 declared later): Update test case results.
7039
b8a41559
AD
70402006-07-09 Akim Demaille <akim@lrde.epita.fr>
7041
7042 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
7043 to be in alphabetical order.
7044 (trace_args): Spelling fixes.
7045
cd9e1ba2
PE
70462006-07-09 Paul Eggert <eggert@cs.ucla.edu>
7047
7048 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
7049 so they don't collide with user-defined macros.
7050 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
7051 this was never guaranteed, and now that we're using gnulib stdint,
7052 which defines int_fast16_t to long int, the problem is exposed.
7053
cb48f191
PE
70542006-07-08 Paul Eggert <eggert@cs.ucla.edu>
7055
b8445a15
PE
7056 * data/c.m4 (b4_basename): Simplify a bit, since we don't
7057 need the full POSIX semantics (and weren't implementing them
7058 anyway).
7059
cb48f191
PE
7060 Adjust to Autoconf 2.60 and today's gnulib.
7061 * bootstrap (gnulib_modules): Add stdint.
7062 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
7063 no longer copies it.
7064 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
7065 since stdint needs the former and wcwidth (which is now required
7066 by mbswidth) needs the latter.
7067 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
7068 work around a compatibility glitch between gettext 0.14.6 and
7069 Autoconf 2.60.
7070 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
7071 Do not check for uintptr_t, since new stdint module does the right
7072 thing.
7073 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
7074 Add stdint.h, stdint_.h, wcwidth.h.
7075 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
7076 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
7077 stdint.m4, wchar_t.m4, wcwidth.m4.
7078 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
7079 usual order for ../lib/*.h files.
7080 (file_name_split): Use last_component, not base_name, to adjust
7081 to gnulib changes.
7082 * src/parse-gram.h: Include <strverscmp.h> in the usual order
7083 for ../lib/*.h files.
7084 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
7085 Define unconditionally, since we now assume the stdint module.
7086 * src/scan-skel.l: Include <dirname.h>.
7087 (BASE_QPUTS): Use last_component, not base_name.
7088 * src/system.h: Include <unlocked-io.h> in the usual order
7089 for ../lib/*.h files. Include <stdint.h> unconditionally,
7090 since we now use the stdint module.
7091 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
7092 HAVE_UINTPTR_T, since we now use the stdint module.
7093 (base_name): Remove decl, since files now include <dirname.h>
7094 to get the decl.
7095
cd48d21d
AD
70962006-07-08 Akim Demaille <akim@lrde.epita.fr>
7097
7098 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
7099 New, default to 1.
7100 * data/yacc.c, data/glr.c, data/location.cc: Use them.
7101 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
7102 default.
7103 * tests/calc.at: Adjust.
7104
8ec0a172
AD
71052006-07-08 Akim Demaille <akim@lrde.epita.fr>
7106
b8445a15 7107 * data/c.m4 (b4_basename): New.
8ec0a172
AD
7108 (b4_syncline): Also output the location of its invocation (from
7109 the skeleton).
7110 (b4_user_action, b4_define_user_action, b4_user_actions)
7111 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
7112 (b4_user_stype): New.
7113 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
7114
4a678af8
JD
71152006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
7116
7117 In the grammar file, the first column is 1 not 0 on the first line as
7118 on every other line.
7119 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
7120 * tests/input.at (Torturing the Scanner): Update output.
7121
7122 * src/scan-gram.l (scanner_cursor): Declare it static.
7123
dd60572a
JD
71242006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
7125
7126 In warnings, say "previous declaration" rather than "first
7127 declaration".
7128 * src/symtab.c (redeclaration): Do that here.
7129 * src/reader.c (record_merge_function_type): In the case of a result
7130 type clash, report the previous declaration rather than the very first
7131 one in the grammar file.
7132 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7133 declared later): Add a third declaration to check this behavior.
7134 * tests/input.at (Incompatible Aliases): Update output.
7135
2073e1b6
AD
71362006-06-27 Akim Demaille <akim@epita.fr>
7137
7138 * doc/Doxyfile.in: New.
7139 * doc/Makefile.am: Use it.
7140 * src/lalr.h, src/symtab.h: Initial doxygenation.
7141
8ee5b538
JD
71422006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7143
7144 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
7145 declared after the %merge. This continues the effort of the previous
7146 patch.
8ee5b538
JD
7147 * src/reader.c (get_merge_function): Don't set the merger type yet.
7148 (record_merge_function_type): New function for setting the merger type
7149 and checking for clashes.
7150 (grammar_current_rule_merge_set): Set the location of the %merge for
7151 the current rule.
7152 (packgram): Invoke record_merge_function_type for each rule now that
7153 all symbol type declarations have been parsed.
7154 * src/reader.h (merger_list.type_declaration_location): New member
7155 storing the location of the first %merge from which the type for this
7156 merging function was derived.
7157 * src/symlist.h (symbol_list.merger_declaration_location): New member
7158 storing the location of a rule's %merge, if any.
7159 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7160 declared later): New test to catch the error fixed by the above patch.
7161
ffa4ba3a
JD
71622006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7163
7164 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
7165 declarations appear after the rules. Discussed at
7166 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
7167 and
7168 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
7169 Don't mistake the type of $$ in a midrule to be that of its parent
7170 rule's $$.
ffa4ba3a
JD
7171 * src/reader.c (grammar_current_rule_end): Don't invoke
7172 grammar_rule_check yet since not all symbol declarations may have been
7173 parsed yet.
7174 (grammar_midrule_action): Likewise.
7175 Don't record whether the midrule's $$ has been used yet since actions
7176 haven't been translated yet.
7177 Record the midrule's parent rule and its RHS index within the parent
7178 rule.
7179 (grammar_current_rule_action_append): Don't translate the action yet
7180 since not all symbol declarations may have been parsed yet and, thus,
7181 warnings about types for $$, $n, @$, and @n can't be reported yet.
7182 (packgram): Translate the action and invoke grammar_rule_check now that
7183 all symbol declarations have been parsed.
7184 * src/scan-code.l (handle_action_dollar): Now that this is invoked
7185 after parsing the entire grammar file, the symbol list here in the case
7186 of a midrule is actually the midrule's empty RHS, so reference its
7187 parent rule's RHS where necessary.
7188 On the other hand, now that you can already know it's a midrule, you
7189 aren't forced to think $$ has the same type as its parent rule's $$.
7190 (handle_action_at): In the case of a midrule, reference the parent rule
7191 where necessary.
7192 * src/symlist.c (symbol_list_new): Initialize new midrule-related
7193 members.
7194 (symbol_list_length): Now that this is invoked after all rules have
7195 been parsed, a NULL symbol (rather than a NULL symbol list node)
7196 terminates a rule. symbol_list_print already does this correctly.
7197 * src/symlist.h (symbol_list.midrule_parent_rule,
7198 symbol_list.midrule_parent_rhs_index): New members so that midrules can
7199 remember their relationships with their parents.
7200 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
7201 fixed by the above patch.
7202 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
7203 implementing...
7204 (Unused values): ... this old test case and...
7205 (Unused values before symbol declarations): ... this new test case.
7206 This one is the same as `Unused values' except that all symbol
7207 declarations appear after the rules in order to catch the rest of the
7208 errors fixed by the above patch.
7209
e256e17f
JD
72102006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7211
300a1930
JD
7212 More cleanup.
7213 * src/reader.c (current_rule): Declare it static since it's no longer
7214 used outside this file.
7215 (grammar_current_rule_action_append): Remove redundant arguments from
7216 translate_rule_action invocation.
7217 * src/reader.h (current_rule): Remove this unused extern.
7218 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
7219 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 7220
381ecb06
JD
72212006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
7222
7223 Clean up yesterday's patch.
7224 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
7225 to...
7226 * src/reader.c (grammar_current_rule_action_append): ... here for
7227 consistency with grammar_current_rule_symbol_append.
7228 * tests/regression.at (Braced code in declaration in rules section):
7229 Make yyerror and yylex static as usual.
7230
4210cd0b
JD
72312006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
7232
7233 Fix bug that mistakes braced code in a declaration in the rules section
7234 to be a rule action. Mentioned at
7235 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
7236 * src/scan-gram.l: Move midrule action detection from the start of the
7237 scanning of any braced code to...
7238 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
7239 action. For readability, use $2 and @2 rather than the equivalent
7240 global variables.
7241 * tests/regression.at (Braced code in declaration in rules section):
7242 New test to catch the error fixed by the above patch.
7243
7244 Work on code readability some.
7245 * src/scan-code.l (current_rule): Get rid of this misleading and
7246 redundant declaration: it's actually extern'ed in reader.h.
7247 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
7248 translate_action): Add a rule argument and use it instead of the global
7249 current_rule.
7250 (translate_rule_action): This already receives current_rule through an
7251 argument, so pass it on to translate_action instead of assigning
7252 current_rule to current_rule.
7253 (translate_symbol_action, translate_code): Pass rule = NULL to
7254 translate_action.
7255
34f98f46
JD
72562006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
7257
7258 Rename %before-definitions to %start-header and %after-definitions to
7259 %end-header. Don't use these declarations to separate pre-prologue
7260 blocks from post-prologue blocks. Add new order-independent
7261 declarations %before-header and %after-header as alternatives to the
7262 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
7263 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
7264 * NEWS (2.3+): Update for these changes.
7265 * data/glr.c (b4_before_definitions): Update to...
7266 (b4_start_header): ... this.
7267 (b4_after_definitions): Update to...
7268 (b4_end_header): ... this.
7269 * data/glr.cc: Likewise.
7270 * data/lalr1.cc: Likewise.
7271 * data/yacc.c: Likewise.
7272 * doc/bison.texinfo (The prologue): Update names, and replace remaining
7273 prologue blocks with %*-header declarations.
7274 (Calc++ Parser): Likewise.
91661ebb 7275 (Decl Summary): Update names.
148d66d8 7276 (Table of Symbols): Update description.
34f98f46
JD
7277 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
7278 (PERCENT_END_HEADER): ... this.
7279 (PERCENT_BEFORE_DEFINITIONS): Update to...
7280 (PERCENT_START_HEADER): ... this.
7281 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
7282 (declaration): Update token names and m4 macro names.
7283 When parsing %end-header and %start-header, invoke translate_code
7284 before muscle_code_grow, and no longer set global booleans to remember
7285 whether these declarations have been seen.
7286 Parse new %after-header and %before-header.
7287 * src/reader.c (before_definitions, after_definitions): Remove.
7288 (prologue_augment): Accept a new bool argument to specify whether to
7289 augment the pre-prologue or post-prologue.
7290 * src/reader.h (before_definitions, after_definitions): Remove these
7291 extern's.
7292 (prologue_augment): Add new bool argument.
7293 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
7294 (PERCENT_END_HEADER): ... this.
7295 (PERCENT_BEFORE_DEFINITIONS): Update to...
7296 (PERCENT_START_HEADER): ... this.
7297 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
7298 * tests/actions.at (Printers and Destructors): Update names.
7299
31b2b07e
JD
73002006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
7301
7302 Add comparison operators for C++ location classes. Discussed at
7303 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
7304 * data/c++.m4 (b4_define_location_comparison): New boolean %define
7305 declaration indicating whether filename_type has an operator==. If
7306 filename_type is `std::string', it defaults to `1', `0' otherwise.
7307 * data/location.cc: Iff b4_define_location_comparison is `1', add
7308 operator== and operator!= for class position and for class location.
7309
7310 Some minor fixes.
7311 * src/scan-action.l: Remove unused file.
7312 * src/symtab.c (symbol_printer_set): Use printer_location not
7313 destructor_location.
7314 * src/symtab.h (struct symbol): Replace incorrect source comment for
7315 printer members.
7316 * tests/input.at (Incompatible Aliases): Update output with correct
7317 printer location.
7318
9bc0dd67
JD
73192006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
7320
7321 Don't put the pre-prologue in the header file. For the yacc.c code
7322 file and the glr.c header and code files, move the pre-prologue before
7323 the token definitions. Add new %before-definitions and
7324 %after-definitions to declare code that will go in both the header file
7325 and code file. Discussed at
7326 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
7327 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
7328 and
7329 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
7330 * NEWS (2.3+): Describe these changes.
7331 * data/glr.c (b4_pre_prologue): Move from within to before...
7332 (b4_shared_declarations): ... this.
7333 Add new b4_before_definitions before b4_token_enums.
7334 Add new b4_after_definitions at the end.
7335 * data/glr.cc (b4_pre_prologue): Replace with...
7336 (b4_before_definitions): ... this in the header file.
7337 (b4_after_definitions): New near the end of the header file.
7338 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
7339 code file right before including the header file.
7340 (b4_before_definitions): New in the previous position of
7341 b4_pre_prologue in the header file.
7342 (b4_after_definitions): New near the end of the header file.
7343 * data/yacc.c: Clean up some m4 quoting especially in the header file.
7344 (b4_token_enums_defines): In the code file, move to right before
7345 YYSTYPE for consistency with the header file.
7346 (b4_before_definitions): New right before b4_token_enums_defines in
7347 both the header and code file.
7348 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
7349 header and code file.
7350 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
7351 of prologues for %union dependencies.
91661ebb
JD
7352 (Decl Summary): In %defines description, mention the effect of
7353 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
7354 (Calc++ Parser): Forward declare driver in a %before-definitions rather
7355 than in the pre-prologue so that make check succeeds.
148d66d8 7356 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
7357 %after-definitions.
7358 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
7359 %before-definitions.
7360 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
7361 (declaration): Parse those declarations and append to
7362 b4_before_definitions and b4_after_definitions, respectively.
7363 * src/reader.c (before_definitions, after_definitions): New bools to
7364 track whether those declarations have been seen.
7365 (prologue_augment): Add to the post-prologue if %union,
7366 %before-definitions, or %after-definitions has been seen.
7367 * src/reader.h (before_definitions, after_definitions): New extern's.
7368 * src/scan-gram.l: Scan the new declarations.
7369 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
7370 prologue block in a %before-definitions or a %after-definitions based
7371 on whether the %union is declared.
7372 * tests/regression.at (Early token definitions with --yacc, Early token
7373 definitions without --yacc): Move tests for token definitions into the
7374 post-prologue since token names are no longer defined in the
7375 pre-prologue.
7376
203b9274
AD
73772006-06-20 Akim Demaille <akim@epita.fr>
7378
7379 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
7380 (symbol_get): Use it.
7381 * src/parse-gram.y: Use it.
7382
a7ee59cf
JD
73832006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
7384
7385 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
7386 build succeeds when configured with --enable-gcc-warnings.
7387
5a2baae7
PE
73882006-06-19 Paul Eggert <eggert@cs.ucla.edu>
7389
33ad1a9c
PE
7390 * src/parse-gram.y (char_name): New function.
7391 (CHAR, STRING, string_content): For %printer, properly escape.
7392 (ID): Prefer fputs to fprintf.
7393 (id): Reindent to be consistent with other rules.
7394 Properly quote char.
7395
5a2baae7
PE
7396 The Translation Project changed its way of publishing translations
7397 to maintainers. I haven't received any responses to my request
7398 for supporting the old way, or for documenting the new way. I
7399 have modified 'bootstrap' to use screen scraping
7400 (in this case, HTML scraping). This is unreliable and inelegant,
7401 but I don't see any better way. Yuck.
7402 * bootstrap (TP_URL, WGET_COMMAND): New vars.
7403 (get_translations): New function, which uses HTML scraping to
7404 deduce locations of latest translations.
7405 Use this function to grab both bison and bison-runtime .po files.
7406 Don't bother priming the pump for the runtime-po domain any more,
7407 as it's now translated better than bison is.
7408
58d7a1a1
AD
74092006-06-19 Akim Demaille <akim@epita.fr>
7410
7411 * src/scan-gram.l: No longer "parse" things after `%union' until
7412 `{'. Rather, return a single "%union" token.
7413 No longer make symbols: return strings, and leave the conversion
7414 to symbols to the parser.
7415 (SC_PRE_CODE, token_type): Remove.
7416 * src/parse-gram.y (%union): New field `character'.
7417 Sort tokens.
7418 (CHAR): New token.
7419 (ID, ID_COLON): Now that the scanner no longer makes them
7420 identifiers, adjust all uses to invoke symbol_get.
7421 (id_colon): New, wraps the conversion from string to symbol.
7422 (%union): Accept a possible union_name.
7423 (symbol): Now can be a char.
7424 * data/c.m4 (b4_union_name): Leave a default value.
7425 * data/glr.c, data/yacc.c: Use it.
7426
b931235e
JD
74272006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
7428
7429 For associating token numbers with token names for "yacc.c", don't use
7430 #define statements unless `--yacc' is specified; always use enum
7431 yytokentype. Most important discussions start at:
7432 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
7433 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
7434 and
7435 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
7436 * NEWS (2.3+): Mention.
7437 * data/c.m4 (b4_yacc_if): New.
7438 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
7439 token #define's.
7440 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
7441 on token name definitions.
7442 * src/getargs.c (usage): Capitalize `Yacc' in English.
7443 * src/output.c (prepare): Define b4_yacc_flag.
7444 * tests/regression.at (Early token definitions): Test that tokens names
7445 are defined before the pre-prologue not just before the post-prologue.
7446 Remove this test case and copy to...
7447 (Early token definitions with --yacc): ... this to test #define's.
7448 (Early token definitions without --yacc): ... and this to test enums.
7449
9e6e7ed2
PE
74502006-06-11 Paul Eggert <eggert@cs.ucla.edu>
7451
7452 * NEWS: Reword the post-2.3 change to not be so optimistic about
7453 removing the old "look-ahead" spelling.
7454 Update previous look-ahead/lookahead change reports.
7455 * REFERENCES: look-ahead -> lookahead (since that's
7456 what he actually wrote).
7457 * doc/refcard.tex: look ahead -> lookahead,
7458 look-ahead -> lookahead
7459
742e4900
JD
74602006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
7461
7462 For consistency, use `lookahead' instead of `look-ahead' or
7463 `look_ahead'. Discussed starting at
7464 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
7465 and then at
7466 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
7467 * NEWS: For the next release, note the change to `--report'.
7468 * TODO, doc/bison.1: Update English.
7469 * doc/bison.texinfo: Update English.
7470 (Understanding Your Parser, Bison Options): Document as
7471 `--report=lookahead' rather than `--report=look-ahead'.
7472 * src/conflicts.c: Update English in comments.
7473 (lookahead_set): Rename from look_ahead_set.
7474 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
7475 (resolve_sr_conflict): Rename local look_ahead_tokens to
7476 lookahead_tokens, and update other uses.
7477 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
7478 count_rr_conflicts, conflicts_free): Update uses.
7479 * src/getargs.c (report_args): Move "lookahead" before alternate
7480 spellings.
7481 (report_types): Update uses.
7482 (usage): For `--report' usage description, state `lookahead' spelling
7483 rather than `look-ahead'.
7484 * src/getargs.h (report.report_lookahead_tokens): Rename from
7485 report_look_ahead_tokens.
7486 * src/lalr.c: Update English in comments.
7487 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
7488 (state_lookahead_tokens_count): Rename from
7489 state_look_ahead_tokens_count.
7490 Rename local n_look_ahead_tokens to n_lookahead_tokens.
7491 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
7492 Rename local n_look_ahead_tokens to n_lookahead_tokens.
7493 Update other uses.
7494 Update English in output.
7495 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
7496 * src/print.c: Update English in comments.
7497 (lookahead_set): Rename from look_ahead_set.
7498 (print_reduction): Rename argument lookahead_token from
7499 look_ahead_token.
7500 (print_core, state_default_rule, print_reductions, print_results):
7501 Update uses.
7502 * src/print_graph.c: Update English in comments.
7503 (print_core): Update uses.
7504 * src/state.c: Update English in comments.
7505 (reductions_new): Update uses.
7506 (state_rule_lookahead_tokens_print): Rename from
7507 state_rule_look_ahead_tokens_print, and update other uses.
7508 * src/state.h: Update English in comments.
7509 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
7510 (state_rule_lookahead_tokens_print): Rename from
7511 state_rule_look_ahead_tokens_print.
7512 * src/tables.c: Update English in comments.
7513 (conflict_row, action_row): Update uses.
7514 * tests/glr-regression.at
7515 (Incorrect lookahead during deterministic GLR,
7516 Incorrect lookahead during nondeterministic GLR): Rename
7517 print_look_ahead to print_lookahead.
7518 * tests/torture.at: Update English in comments.
7519 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
7520 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
7521 (Many lookahead tokens): Update uses.
7522 * data/glr.c: Update English in comments.
7523 * lalr1.cc: Likewise.
7524 * yacc.c: Likewise.
7525 * src/conflicts.h: Likewise.
7526 * src/lalr.h: Likewise.
7527 * src/main.c: Likewise.
7528 * src/output.c: Likewise.
7529 * src/parse-gram.c: Likewise.
7530 * src/tables.h: Likewise.
7531 * tests/calc.at: Likewise.
7532
3c40d0b5
JD
75332006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
7534
7535 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
7536
5d278082
PE
75372006-06-07 Paul Eggert <eggert@cs.ucla.edu>
7538
7539 * TODO: Add request from Nelson H. F. Beebe to be able to install
7540 Bison without installing the yacc script.
7541
9e668899
JD
75422006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
7543
7544 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
7545 and yytext if they're already #define'd.
7546 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
7547 * src/scan-code-c.c: ... here.
7548 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
7549 <config.h>.
7550
0c8e079f
JD
75512006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
7552
7553 Get Bison to build again when configured with --enable-gcc-warnings.
7554 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
7555 missing #include's.
7556 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
7557 loc argument as it shadows a global.
7558 * src/scan-gram.l: Remove stray comma that prevents boundary_set
7559 invocation.
7560
7561 * src/.cvsignore: Add scan-code.c.
7562
2346344a
AD
75632006-06-07 Akim Demaille <akim@epita.fr>
7564
7565 * src/scan-gram.l: Move the "add a trailing ; to actions" code
7566 to...
7567 * src/scan-code.l: here.
7568 * tests/input.at (Torturing the Scanner): Fix another location
7569 error.
7570
4862bdfd
AD
75712006-06-07 Akim Demaille <akim@epita.fr>
7572
7573 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
7574
e9071366
AD
75752006-06-06 Akim Demaille <akim@epita.fr>
7576
7577 Extract the parsing of user actions from the grammar scanner.
7578 As a consequence, the relation between the grammar scanner and
7579 parser is much simpler. We can also split "composite tokens" back
7580 into simple tokens.
7581 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
7582 * src/scan-gram.l (add_column_width, adjust_location): Move to and
7583 rename as...
7584 * src/location.h, src/location.c (add_column_width)
7585 (location_compute): these.
7586 Fix the column count: the initial column is 0.
7587 (location_print): Be robust to ending column being 0.
7588 * src/location.h (boundary_set): New.
7589 * src/main.c: Adjust to scanner_free being renamed as
7590 gram_scanner_free.
7591 * src/output.c: Include scan-code.h.
7592 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
7593 Use boundary_set.
7594 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
7595 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
7596 which is now, again, a separate token.
7597 Adjust all dependencies.
7598 Whereever actions with $ and @ are used, use translate_code.
7599 (action): Remove this nonterminal which is now useless.
7600 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
7601 (grammar_current_rule_action_append): Use translate_code.
7602 (packgram): Bound check ruleno, itemno, and rule_length.
7603 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
7604 (last_string, last_braced_code_loc, max_left_semantic_context)
7605 (scanner_initialize, scanner_free, scanner_last_string_free)
7606 (gram_out, gram_lineno, YY_DECL_): Move to...
7607 * src/scan-gram.h: this new file.
7608 (YY_DECL): Rename as...
7609 (GRAM_DECL): this.
7610 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
7611 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
7612 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
7613 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
7614 Move these declarations, and...
7615 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
7616 these to...
7617 * src/flex-scanner.h: this new file.
7618 * src/scan-gram.l (rule_length, rule_length_overflow)
7619 (increment_rule_length): Remove.
7620 (last_braced_code_loc): Rename as...
7621 (gram_last_braced_code_loc): this.
7622 Adjust to the changes of the parser.
7623 Move all the handling of $ and @ into...
7624 * src/scan-code.l: here.
7625 * src/scan-gram.l (handle_dollar, handle_at): Remove.
7626 (handle_action_dollar, handle_action_at): Move to...
7627 * src/scan-code.l: here.
7628 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
7629 scan-code.h, scan-code-c.c, scan-gram.h.
7630 (EXTRA_bison_SOURCES): Add scan-code.l.
7631 (BUILT_SOURCES): Add scan-code.c.
7632 (yacc): Be robust to white spaces.
7633
7634 * tests/conflicts.at, tests/input.at, tests/reduce.at,
7635 * tests/regression.at: Adjust the column numbers.
7636 * tests/regression.at: Adjust the error message.
7891a7c4 7637
184e42f0
JD
76382006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
7639
7640 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
7641 Use Akim's wording from
7642 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
7643
7891a7c4
JD
76442006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
7645
7646 Between Bison releases, manually append `+' to the previous Bison
7647 release number, and use that as a signal to automatically print the
7648 ChangeLog's CVS Id keyword from --version. Discussed starting at
7649 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
7650 * ChangeLog: Add Id header.
7651 * configure.ac (AC_INIT): Append `+' to `2.3'.
7652 * src/.cvsignore: Add revision.c.
7653 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
7654 (BUILT_SOURCES): Add revision.c.
7655 (revision.c): New target rule. This file defines a new global variable
7656 named revision. It initializes it with either the Id from ChangeLog
7657 or, if VERSION doesn't contain `+', with the empty string.
7658 * src/getargs.c (version): Print the value of revision.
7659 * src/revision.h: Extern revision.
7660
4ad3ed84
PE
76612006-06-05 Paul Eggert <eggert@cs.ucla.edu>
7662
7663 * NEWS: Version 2.3.
7664 * configure.ac (AC_INIT): Likewise.
7665
02103984
PE
76662006-05-30 Paul Eggert <eggert@cs.ucla.edu>
7667
7668 * data/glr.c (YYRECOVERING): Define to be a function-like macro
7669 with no arguments, not as an object-like macro. This is for
7670 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
7671 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
7672 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
7673 Document this.
7674
2c08afa5
JD
76752006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
7676
7677 * src/getargs.c (usage): Back out yesterday's modification of the
7678 --help output so that we don't have to wait for translation before
7679 releasing 2.3.
7680
6077da58
PE
76812006-05-29 Paul Eggert <eggert@cs.ucla.edu>
7682
7683 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
7684 Problem reported by Akim Demaille.
7685
2a26b6c2
JD
76862006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
7687
7688 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
7689
aefef0d6
PE
76902006-05-26 Paul Eggert <eggert@cs.ucla.edu>
7691
7692 * data/yacc.c (yy_reduce_print): Omit trailing white space in
7693 generated source code. Problem reported by Frans Englich in
7694 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
7695
fcd8e201
PE
76962006-05-22 Paul Eggert <eggert@cs.ucla.edu>
7697
7698 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
7699 shell, not within 'make', so that 'make' by an ordinary builder
7700 (using GNU make) does not worry about configuring gzip. This also
7701 works around a bug reported independently by Keith Thompson and by
7702 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
7703 stderr rather than stdout, messing up the build logs.
7704
7b5cdcbd
JD
77052006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
7706
7707 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
7708 to make sure that YYID will never be unused. This fixes a 'make
7709 maintainer-check' failure caused by the recent changes to the 'Trivial
7710 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
7711 not used.
7712 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
7713
5ad0a449
JD
77142006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
7715
7716 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
7717 state before an empty RHS is always resolved here. Only the location
7718 of that state is guaranteed to be resolved, and that's enough. This
7719 fixes the remaining bug reported by Derek M. Jones in
7720 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
7721 * tests/glr-regression.at (Uninitialized location when reporting
7722 ambiguity): Test the above case.
7723 Also, the embedded comments in this test case claim it checks the case
7724 of an empty RHS that has inherited the initial location. However, the
7725 corresponding LHS was already resolved, so yyresolveLocations didn't
7726 actually have reason to modify it. Fix this by forcing
7727 nondeterministic operation at the beginning of the parse.
7728
50cce58e
PE
77292006-05-20 Paul Eggert <eggert@cs.ucla.edu>
7730
7731 * data/c.m4 (b4_yy_symbol_print_generate):
7732 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
7733 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
7734 of the bugs reported today by Derek M Jones in
7735 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
7736 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
7737 defined to be a type name without parens or brackets.
7738 (Location Type): Similarly for YYLTYPE.
7739 * tests/regression.at (Trivial grammars): Put in a test for this
7740 bug that will be caught by 'make maintainer-check' (though not,
7741 alas, by 'make check' unless your compiler is picky).
7742
ab8d9dc5
PE
77432006-05-19 Paul Eggert <eggert@cs.ucla.edu>
7744
0d2c8934 7745 * NEWS: Version 2.2.
ab8d9dc5
PE
7746 * configure.ac (AC_INIT): Likewise.
7747
9138c575
JD
77482006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
7749
7750 * data/glr.c (yyreportTree): Make room in yystates for the state
7751 preceding the RHS. This fixes the segmentation fault reported by Derek
7752 M. Jones in
7753 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
7754 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
7755 to the user. Reported for yyreportTree by Derek M. Jones later in the
7756 same thread.
7757 * THANKS: Add Derek M. Jones.
7758 Update my email address.
7759 Fix typo in Steve Murphy's name.
7760
276f48df
PE
77612006-05-14 Paul Eggert <eggert@cs.ucla.edu>
7762
d6645148
PE
7763 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
7764 checking against YYLAST that caused the parser to miss a potential
7765 alternative in its diagnostic.
7766 Problem reported by Maria Jose Moron Fernandez in
7767 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
7768 * data/lalr1.cc (yysyntax_error_): Likewise.
7769 * data/yacc.c (yysyntax_error): Likewise.
7770 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
7771 tokens, in case we run into an older C compiler.
7772 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
7773 Use them to check for the off-by-one error fixed above.
7774
276f48df
PE
7775 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
7776 YYSIZE_T, not size_t.
7777 * tests/regression.at (Trivial grammars): New test, to catch
7778 the error fixed by the above patch.
7779
cd8b5791
AD
77802006-05-14 Akim Demaille <akim@lrde.epita.fr>
7781
7782 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
7783 scheme.
7784 Reported by Steve Murphy.
7785
34376418
AD
77862006-05-14 Akim Demaille <akim@lrde.epita.fr>
7787
7788 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
7789 * data/glr.cc: b4_location_flag is now b4_locations_flag.
7790
327afc7c
AD
77912006-05-14 Akim Demaille <akim@lrde.epita.fr>
7792
7793 Implement --trace=m4.
7794 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
7795 * src/output.c (output_skeleton): When set, pass -dV to m4.
7796
7797 Factor the handling of flags in m4.
7798 * src/output.c (prepare): Rename the muscle names debug, defines,
7799 error_verbose to debug_flag, defines_flag, error_verbose_flag.
7800 * data/c.m4: Adjust.
7801 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
7802 Use b4_define_flag_if to define other b4_FLAG_if macros.
7803 (b4_location_if): As a consequence, rename as...
7804 (b4_locations_if): this, for consistency.
7805 Adjust all the skeletons.
7806
ba9ecd19
AD
78072006-05-14 Akim Demaille <akim@lrde.epita.fr>
7808
7809 * etc/bench.pm: Shorten bench names.
7810
4e83ea15
AD
78112006-05-14 Akim Demaille <akim@lrde.epita.fr>
7812
7813 * src/output.h, src/output.c (error_verbose): Move to...
7814 * src/getargs.h, src/getargs.c: here.
7815 Sort the flags.
7816 Adjust dependencies.
7817
6e93d810
PE
78182006-05-13 Paul Eggert <eggert@cs.ucla.edu>
7819
7820 * data/c.m4 (b4_copyright): Put the special exception for Bison
7821 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
7822 uses changed. Suggested by Akim Demaille. Also, wrap the
7823 copyright notice, in case it is longer than 80 columns. Replace
7824 comma by newline after title.
6e93d810 7825
eaea13f5
PE
78262006-05-11 Paul Eggert <eggert@cs.ucla.edu>
7827
7828 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
7829 incompatibility, not a bug. Mention that it wasn't fixed as of
7830 flex 2.5.33.
7831
3cf084ec
AD
78322006-05-11 Akim Demaille <akim@lrde.epita.fr>
7833
7834 * examples/extexi: Enforce the precedence of concatenation over
7835 >>.
0a9f1c7d 7836 Reported by Tommy Nordgren.
3cf084ec 7837
32c96bd7
AD
78382006-05-11 Akim Demaille <akim@lrde.epita.fr>
7839
7840 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
7841 with the member "token".
f94705b2 7842 Reported by Martin Nylin.
32c96bd7 7843
eaea13f5
PE
78442006-05-08 Paul Eggert <eggert@cs.ucla.edu>
7845
7846 * data/glr.c: Switch to Bison 2.2 special-exception language in
7847 the copyright notice. Use more-regular format for titles and
7848 copyright notices.
7849 * data/glr.cc: Likewise.
7850 * data/location.cc: Likewise.
7851 * data/yacc.cc: Likewise.
7852 * doc/bison.texinfo (Conditions): Document this.
7853 * NEWS: likewise. Upgrade version to 2.2.
7854
6e2d1146
AD
78552006-04-27 Akim Demaille <akim@lrde.epita.fr>
7856
7857 * data/glr.cc: Remove dead code.
7858
47671055
PE
78592006-04-25 Paul Eggert <eggert@cs.ucla.edu>
7860
7861 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
7862 that variable and the line breaks the bootstrap. Problem reported
7863 by Juan M. Guerrero.
7864
ed2e6384
AD
78652006-04-24 Akim Demaille <akim@lrde.epita.fr>
7866
7867 * doc/bison.texinfo (Multiple start-symbols): New.
7868
3cedc2dc
AD
78692006-04-24 Akim Demaille <akim@lrde.epita.fr>
7870
7871 * etc/README, etc/bench.pl: New.
7872
b2ddc3f3
AD
78732006-04-03 Akim Demaille <akim@lrde.epita.fr>
7874
7875 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
7876 rule.
7877 Reported by Mickael Labau.
7878 * tests/input.at (Torturing the Scanner): Test it.
7879
91e3ac9a
PE
78802006-03-16 Paul Eggert <eggert@cs.ucla.edu>
7881
7882 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
7883 Problem reported by Bob Rossi.
7884
78852006-03-13 Paul Eggert <eggert@cs.ucla.edu>
7886
7887 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
7888 and didn't really work.
7889 For the index, use @ifnotinfo, not @iftex.
7890 Minor cleanups of spacing and terminology.
7891
5cf61e93
AD
78922006-03-12 Akim Demaille <akim@lrde.epita.fr>
7893
7894 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
7895 of AT_NAME_PREFIX when %name-prefix is not used.
7896
aa08666d
AD
78972006-03-12 Akim Demaille <akim@lrde.epita.fr>
7898
7899 Apply --prefix to C++ skeletons too: they change the namespace.
7900 The test suite already exercize these cases.
7901 * data/c++.m4 (b4_namespace): New.
7902 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
7903 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
7904 * data/yacc.c, data/glr.c: Remove a useless `[]'.
7905 * doc/bison.texinfo: Document it.
7906 (Option Cross Key): Use @multitable in all formats. It looks
7907 nicer, even in TeX outputs.
7908 (Rules): Use the same code whatever the output type is.
7909 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
7910 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
7911 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 7912
45567173
AD
79132006-03-10 Akim Demaille <akim@lrde.epita.fr>
7914
7915 * TODO: Remove dead items.
7916
e9d8f881 79172006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
7918
7919 * doc/FAQ: Remove, merged into...
7920 * doc/bison.texinfo (FAQ): this.
7921 * doc/Makefile.am (EXTRA_DIST): Adjust.
7922
c095d689
AD
79232006-03-10 Akim Demaille <akim@lrde.epita.fr>
7924
7925 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
7926 even if empty.
7927 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
7928 * doc/bison.texinfo (Calc++ Scanner): Use it.
7929
6e0f8287
PE
79302006-03-09 Paul Eggert <eggert@cs.ucla.edu>
7931
7932 Fix two nits reported by twlevo, plus one more that I discovered.
7933
7934 * src/assoc.h (assoc_to_string): Give a name to the arg, as
7935 this is the usual Bison style.
7936 * src/location.h (location_print): Likewise.
7937
7938 * src/reader.h (token_name): Likewise.
7939
d6b771c3
PE
79402006-03-08 Paul Eggert <eggert@cs.ucla.edu>
7941
7942 Fix some nits reported by twlevo.
7943 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
7944 and "POSIX". Use more-modern syntax for URLs. Mention C++
7945 and ask for Java. Don't hardwire OS version numbers. Add
7946 copyright notice.
7947 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
7948 * src/conflicts.c (solved_conflicts_obstack): Now static.
7949
1e137b71
JD
79502006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
7951
7952 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
7953 page. Say "you can use it" not "you may use it" as on the web page;
7954 we're describing capabilities not granting permission.
7955
73f2e47e
PE
79562006-03-06 Paul Eggert <eggert@cs.ucla.edu>
7957
6d05403d
PE
7958 * data/glr.c (yyresolveLocations): Rename local variables to avoid
7959 shadowing warnings. Use usual patter for iterating through RHS.
7960 * tests/glr-regression.at
7961 (Uninitialized location when reporting ambiguity):
7962 Modify yylex so that it uses its argument, rather than trying
7963 to rely on ARGSUSED (which doesn't work for gcc with warnings).
7964 const char -> char const.
7965
73f2e47e
PE
7966 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
7967 Don't use tabs inside commands; it messes up 'ps'.
7968 Problem reported by twlevo.
7969
8710fc41
JD
79702006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
7971
7972 * tests/glr-regression.at (Uninitialized location when reporting
7973 ambiguity): New test case.
7974 * data/glr.c (yyresolveLocations): New function, which uses
7975 YYLLOC_DEFAULT.
7976 (yyresolveValue): Invoke yyresolveLocations before reporting an
7977 ambiguity.
7978 * doc/bison.texinfo (Default Action for Locations): Note
7979 YYLLOC_DEFAULT's usage for ambiguity locations.
7980 (GLR Semantic Actions): Cross-reference those notes.
7981
ae952af2
JD
79822006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
7983
7984 * tests/glr-regression.at (Leaked semantic values when reporting
7985 ambiguity): Remove unnecessary union and type declarations.
7986 (Leaked lookahead after nondeterministic parse syntax error): New test
7987 case.
7988 * data/glr.c (yyparse): Check for zero stacks remaining before
7989 attempting to shift the lookahead so that you don't lose it.
7990
35ee866a
JD
79912006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
7992
7993 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
7994 * tests/glr-regression.at (Leaked semantic values when reporting
7995 ambiguity): New test case.
7996 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
7997 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
7998 now unnecessary yystackp parameter.
7999 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
8000 destructors can be called.
8001
8002 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
8003 in existing testcases.
8004
520181ab
JD
80052006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
8006
8007 Don't leak semantic values for parent RHS when a user action cuts the
8008 parser, and clean up related code a bit.
8009 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
8010 cuts parse): Rename to...
8011 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
8012 for leaked parent RHS values.
8013 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
8014 between an unresolved state (non-empty chain of semantic options) and
8015 an incomplete one (signaled by an empty chain).
ae952af2 8016 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
8017 successfully or unsuccessfully resolved yyGLRState to...
8018 (yyresolveValue): ... here so that yyresolveValue always leaves a
8019 yyGLRState with consistent data and thus is easier to understand.
8020 Remove the yyvalp and yylocp parameters since they are always just
8021 taken from the yys parameter. When reporting a discarded merged value
8022 in debugging output, note that it is incompletely merged. Document the
8023 interface.
8024 (yyresolveAction): If resolving any of the RHS states fails, destroy
8025 them all rather than leaking them. Thus, as long as user actions are
8026 written to clean up the RHS correctly, yyresolveAction always cleans up
8027 the RHS of a semantic option. Document the interface.
8028
18d9185c
PE
80292006-02-27 Paul Eggert <eggert@cs.ucla.edu>
8030
8031 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
8032 led to a segmentation fault in GNU Pascal. Problem reported
8033 by Waldek Hebisch.
8034
841a7737
JD
80352006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
8036
8037 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
8038 mid-rule action inside a nonterminal symbol in order to declare a
8039 destructor for its semantic value.
8040
fc3f467f
PE
80412006-02-16 Paul Eggert <eggert@cs.ucla.edu>
8042
8043 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
8044 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
8045 __cplusplus && ! defined _STDLIB_H && !
8046 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
8047 defined free))]: Include <stdlib.h> rather than rolling our own
8048 declarations of malloc and free, to avoid problems with
8049 incompatible declarations (using 'throw') C++'s stdlib.h. This
8050 should fix Debian bug 340012
8051 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
8052 reported by Guillaume Melquiond.
8053
a3af26dd
PE
80542006-02-13 Paul Eggert <eggert@cs.ucla.edu>
8055
4d7bc38c
PE
8056 * NEWS: Clarify symbols versus types in unused-value warnings.
8057
a3af26dd
PE
8058 * configure.ac (AC_INIT): Bump version number.
8059
4e26c69e
PE
80602006-02-13 Paul Eggert <eggert@cs.ucla.edu>
8061
8062 * NEWS: Version 2.1a.
8063 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
8064 since C99 requires this.
8065
498e897c
PE
80662006-02-11 Paul Eggert <eggert@cs.ucla.edu>
8067
8068 * m4/c-working.m4: New file.
8069 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
8070
57bb17ca
PE
80712006-02-10 Paul Eggert <eggert@cs.ucla.edu>
8072
8073 * Makefile.maint: Merge from coreutils.
8074
0be105dc
PE
80752006-02-09 Paul Eggert <eggert@cs.ucla.edu>
8076
8077 More portability fixes for problems summarized by Nelson H. F. Beebe.
8078
8079 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
8080 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
8081 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
8082 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
8083 messes up because C++ code is compiled in 32-bit mode but linked
8084 in 64-bit mode.
8085
6fc0c024
PE
80862006-02-08 Paul Eggert <eggert@cs.ucla.edu>
8087
8088 More portability fixes for problems summarized by Nelson H. F. Beebe.
8089
7870f699
PE
8090 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
8091 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
8092
6fc0c024
PE
8093 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
8094 nodist_PROGRAMS, since we don't need to actually compile the
8095 example if we're just doing a plain 'make'. This avoids bothering
8096 the installer unnecessarily about problems due to weird C++
8097 compilers.
8098
fe6c2fde
PE
80992006-02-06 Paul Eggert <eggert@cs.ucla.edu>
8100
8101 More portability fixes for problems summarized by Nelson H. F. Beebe.
8102
8103 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
8104 than #include "...", and compile with -I'.'. The old method was
8105 not portable, according to Posix and the C standard, and it does
8106 not work with Sun C 5.7, where previous #line directives affect
8107 the working directory used in later #include "..." directives.
8108
927b425b
JMG
81092006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8110
8111 Various DJGGP specific issues in /djgpp
8112
d9735e9e
PE
81132006-02-02 Paul Eggert <eggert@cs.ucla.edu>
8114
8115 More portability fixes for problems summarized by Nelson H. F. Beebe.
8116
8117 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
8118 '#include <map>' works and that you can apply ++ to iterators.
8119
5a6755af
PE
81202006-02-01 Paul Eggert <eggert@cs.ucla.edu>
8121
67a0dc4f
PE
8122 Work around portability problems summarized by Nelson H. F. Beebe in
8123 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
8124
8c86f0ef
PE
8125 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
8126 that '#include <string>' works.
8127
de35dd59
PE
8128 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
8129 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
8130 "warning: sorry: semantics of inline function static data `const
8131 unsigned char translate_table[262]' are wrong (you'll wind up with
8132 multiple copies)".
8133
67a0dc4f
PE
8134 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
8135 or, xor to not_, and_, or_, and xor_, respectively. This works
8136 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
8137 random system header somewhere that includes the equivalent of
8138 <iso646.h>.
8139
5a6755af
PE
8140 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
8141 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 8142 Suite Version 2.0.
5a6755af 8143
3f001415
JD
81442006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
8145
8146 During deterministic GLR operation, user actions should be able to
8147 influence the parse by changing yychar. To make this easier to fix and
8148 to make glr.c easier to evolve in general, don't maintain yytoken in
8149 parallel with yychar; just compute yytoken when needed.
8150 * tests/glr-regression.at (Incorrect lookahead during deterministic
8151 GLR): Check that setting yychar in a user action has the intended
8152 effect.
8153 * data/glr.c (yyGLRStack): Remove yytokenp member.
8154 (yyclearin): Don't set *yytokenp.
8155 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
8156 yychar rather than *yytokenp to determine the current lookahead.
8157 Compute yytoken locally when needed.
8158 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
8159 point to.
8160
8161 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
8162 after `--report' documentation.
8163
e2a8c0f5
PE
81642006-01-30 Paul Eggert <eggert@cs.ucla.edu>
8165
8166 * src/parse-gram.y (grammar_declaration): Location of printer
8167 symbol is @1, not list->location. Bug reported by twlevo.
8168 * tests/input.at (Incompatible Aliases): Adjust to above change.
8169
6b702268
PE
81702006-01-29 Paul Eggert <eggert@cs.ucla.edu>
8171
27622431
PE
8172 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
8173 all the test at once. This makes the output easier to read in the
8174 normal case.
8175
6b702268
PE
8176 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
8177 got from <http://bro-ids.org/download.html>. The bug is that
8178 when two actions appeared in succession, the second one was
8179 scanned before the first one was added to the grammar rule
8180 as a midrule action. Bison then output the incorrect warning
8181 "parse.y:905.17-906.36: warning: unused value: $3".
8182 * src/parse-gram.y (BRACED_CODE, action): These are no longer
8183 associated with a value.
8184 (rhs): Don't invoke grammar_current_rule_action_append.
8185 (action): Invoke it here instead.
8186 * src/reader.c (grammar_midrule_action): Now extern.
8187 (grammar_current_rule_action_append): Don't invoke
8188 grammar_midrule_action; that is now the scanner's job.
8189 * src/reader.h (last_string, last_braced_code_loc):
8190 (grammar_midrule_action): New decls.
8191 * src/scan-gram.l (last_string): Now extern, sigh.
8192 (last_braced_code_loc): New extern variable.
8193 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
8194 rule already has an action.
8195 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
8196 * tests/input.at (AT_CHECK_UNUSED_VALUES):
8197 Add some tests to check that the above changes fixed the bug.
8198
d40ba6c2
PE
81992006-01-27 Paul Eggert <eggert@cs.ucla.edu>
8200
8201 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
8202 All used changed. Check whether the symbol has a destructor,
8203 not whether it is typed.
8204 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
8205 that the values are still reported as unused. All line numbers
8206 adjusted.
8207
401aace6
PE
82082006-01-23 Paul Eggert <eggert@cs.ucla.edu>
8209
8210 Work around a bug in bro 0.8, which underparenthesizes its
8211 definition of YYLLOC_DEFAULT.
8212 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
8213 their arguments.
8214 * data/lalr1.cc: Likewise.
8215 * data/yacc.cc: Likewise.
8216
06f01bc4
PE
82172006-01-22 Paul Eggert <eggert@cs.ucla.edu>
8218
401aace6
PE
8219 Work around a bug in Pike 7.0, and give the Pike folks a
8220 better way to override the usual int widths.
8221 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
8222 user can override the types.
8223 (short): #undef, to work around a bug in Pike 7.0.
8224 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
8225 (union yyalloc.yyss): Use yytype_int16 rather than short.
8226 All uses changed.
8227 (yysigned_char): Remove.
8228 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
8229 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
8230 * tests/regression.at (Web2c Actions): Adjust to above changes.
8231
8232 * src/reader.c (check_and_convert_grammar): New function.
8233 (reader): Close the input file even if something went wrong during
8234 parsing. Minor file descriptor leak reported by twlevo.
8235
06f01bc4
PE
8236 * src/assoc.c (assoc_to_string): Use a default: abort (); case
8237 to pacify gcc -Wswitch-default.
8238 * src/scan-gram.l (adjust_location): Use a default: break; case
8239 to pacify gcc -Wswitch-default.
8240 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
8241 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
8242 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
8243 Move these decls to scan-skel.l, since they don't need to be
8244 visible elsewhere.
8245 * src/scan-skel.l: Accept the above decls.
8246 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
8247 is used.
8248
02650b7f
PE
82492006-01-21 Paul Eggert <eggert@cs.ucla.edu>
8250
8251 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
8252 since we don't want to insist on a version number at the start
8253 of the changelog every time.
8254 * Makefile.maint: Sync from coreutils a bit better.
8255 (sc_trailing_blank): Renamed from sc_trailing_space.
8256 All uses changed.
8257 (sc_no_if_have_config_h, sc_require_config_h):
8258 (sc_prohibit_assert_without_use): New rules.
8259 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
8260 (sc_dd_max_sym_length): Fix leading spaces in rule.
8261 (sc_system_h_headers): Prefix with @.
8262 (sc_useless_cpp_parens, m4-check): Output line numbers.
8263 (changelog-check): Allow version only in head.
8264 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
8265 satisfy new Makefile.maint rule.
8266 * data/glr.c: Likewise.
8267 * data/glr.cc: Likewise.
8268 * data/lalr1.cc: Likewise.
8269 * data/yacc.c: Likewise.
8270 * lib/ebitsetv.c: Likewise.
8271 * lib/lbitset.c: Likewise.
8272 * lib/subpipe.c: Likewise.
8273 * lib/timevar.c: Likewise.
8274 * src/system.h: Likewise.
8275 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
8276 * djgpp/Makefile.maint: Add copyright notice.
8277 * djgpp/README.in: Likewise.
8278 * djgpp/config.bat: Likewise.
8279 * djgpp/config.site: Likewise.
8280 * djgpp/config_h.sed: Likewise.
8281 * djgpp/djunpack.bat: Likewise.
8282 * djgpp/config.sed: Fix copyright notice to match standard format.
8283 * djgpp/subpipe.h: Likewise.
8284 * lib/bitsetv-print.c: Likewise.
8285 * lib/bitsetv.c: Likewise.
8286 * lib/subpipe.h: Likewise.
8287 * lib/timevar.c: Likewise.
8288 * lib/timevar.h: Likewise.
8289 * djgpp/subpipe.c: Use standard recipe for config.h.
8290 * lib/abitset.c: Likewise.
8291 * lib/bitset.c: Likewise.
8292 * lib/bitset_stats.c: Likewise.
8293 * lib/bitsetv-print.c: Likewise.
8294 * lib/bitsetv.c: Likewise.
8295 * lib/ebitsetv.c: Likewise.
8296 * lib/get-errno.c: Likewise.
8297 * lib/lbitset.c: Likewise.
8298 * lib/subpipe.c: Likewise.
8299 * lib/timevar.c: Likewise.
8300 * lib/vbitset.c: Likewise.
8301 * tests/local.at: Likewise.
8302 * src/scan-gram.l: Don't include verify.h, since system.h does
8303 that for us.
8304 * .x-sc_require_config_h: New file.
8305 * .x-sc_unmarked_diagnostics: New file.
8306
287c78f6
PE
83072006-01-20 Paul Eggert <eggert@cs.ucla.edu>
8308
287c78f6
PE
8309 Be a bit more systematic about using 'abort'.
8310 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
8311 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
8312 Put 'default: abort ();' before some other case, to satisfy older
8313 pedantic compilers.
8314 * lib/bitset_stats.c (bitset_stats_init): Likewise.
8315 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
8316 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
8317 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
8318 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
8319 (get_decision_str, get_orientation_str, get_node_alignment_str):
8320 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
8321 (get_linestyle_str, get_arrowstyle_str): Likewise.
8322 * src/conflicts.c (resolve_sr_conflict):
8323 Use a default case rather than one for the one remaining enum
8324 value, to catch invalid enum values as well.
8325 * src/lalr.c (set_goto_map, map_goto):
8326 Prefer "assert (FOO);" to "if (!FOO) abort ();".
8327 * src/nullable.c (nullable_compute, token_definitions_output):
8328 Likewise.
8329 * src/reader.c (packgram, reader): Likewise.
8330 * src/state.c (transitions_to, state_new, state_reduction_find):
8331 Likewise.
8332 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
8333 (symbol_pack): Likewise.
8334 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
8335 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
8336 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
8337 * src/system.h: Don't include <assert.h>.
8338 (assert): New macro.
8339
8340 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
8341 (Destructor Decl, Parser Function, Pure Calling):
8342 Describe rules for braces inside C code more carefully.
287c78f6 8343
c66dfadd
PE
83442006-01-19 Paul Eggert <eggert@cs.ucla.edu>
8345
c21493b8
PE
8346 Fix some porting glitches found by Nelson H. F. Beebe.
8347 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
8348 compilers that don't understand that abort () does not return.
8349 * src/state.c (transitions_to): Likewise.
8350 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
8351 that '#include <cstdlib>' works.
8352 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
8353 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
8354 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
8355 for the benefit of some pre-C99 compilers.
8356
b6e3facf
PE
8357 * bootstrap: Undo changes to gnulib files that autoreconf made.
8358
c66dfadd
PE
8359 Minor fixups to get 'make maintainer-check' to work.
8360 * configure.ac: Don't use -Wnested-externs, as it's incompatible
8361 with the new verify.h implementation.
8362 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
8363 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
8364 * data/yacc.c (YYUSE): Likewise.
8365 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
8366 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
8367 * src/parse-gram.y (declaration): Don't pass a string constant
8368 to a function that expects char *, since GCC might complain
8369 about the constant value.
8370 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
8371 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
8372 before #defining them.
8373 * tests/glr-regression.at
8374 (Incorrectly initialized location for empty right-hand side in GLR):
8375 In yyerror, use the msg arg.
8376 (Corrupted semantic options if user action cuts parse):
8377 (Incorrect lookahead during deterministic GLR):
8378 (Incorrect lookahead during nondeterministic GLR):
8379 Don't name a local var 'index'; it shadows string.h's 'index'.
8380
ed94ef2a
AD
83812006-01-19 Akim Demaille <akim@epita.fr>
8382
8383 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
8384 location, not just parts of it.
8385
e9ad4aec
PE
83862006-01-18 Paul Eggert <eggert@cs.ucla.edu>
8387
d6ca7905
PE
8388 * NEWS: Document the fact that multiple %unions are now allowed.
8389 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
8390 * TODO: This feature is now implemented, so remove it from
8391 the wishlist.
d6ca7905 8392
ef1b70e0
PE
8393 * Makefile.maint: Merge with coreutils Makefile.maint.
8394 (CVS_LIST): Use build-aux version if available.
8395 (VERSION_REGEXP): New macro.
8396 (syntax-check-rules): Add sc_no_if_have_config_h,
8397 sc_prohibit_assert_without_use, sc_require_config_h,
8398 sc_useless_cpp_parens.
8399 (sc_obsolete_symbols): Check for O_NDELAY.
8400 (sc_dd_max_sym_length): Track coreutils.
8401 (sc_unmarked_diagnostics): Look in all files, not just *.c.
8402 (sc_useless_cpp_parens): New rule.
8403 (news-date-check): Look for version or today's date.
8404 (changelog-check): Don't require version number near head.
8405 (copyright-check): Use current year instead of hardwiring 2005.
8406 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
8407 (announcement): Add --gpg-key-ID.
8408
8409 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
8410 with "file system".
8411
2073ce56 8412 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
8413 array. Problem reported by twlevo.
8414 * src/reader.c (packgram): Prepend a new sentinel before ritem.
8415 * src/lalr.c (build_relations): Rely on new sentinel.
8416 * src/gram.c (gram_free): Adjust to new sentinel.
8417
b7691f15
JD
84182006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
8419
8420 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
8421 yylookaheadNeeds. All uses updated.
8422 (yysplitStack): Rename local yynewLookaheadStatuses to
8423 yynewLookaheadNeeds.
8424 * data/glr-regression.at (Incorrect lookahead during nondeterministic
8425 GLR): In comments, change `lookahead status' to `lookahead need'.
8426
ddee1b06
PH
84272006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8428
8429 * data/glr.c (yysplitStack): A little stylistic rewrite.
8430
12f4614d
PH
84312006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8432
8433 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
8434
32c29292
JD
84352006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
8436
8437 * doc/bison.texinfo: Fix some typos.
8438 (GLR Semantic Actions): New subsection discussing special
8439 considerations because GLR semantic actions might be deferred.
8440 (Actions): Mention look-ahead usage of yylval.
8441 (Actions and Locations): Mention look-ahead usage of yylloc.
8442 (Special Features for Use in Actions): Add YYEOF entry and mention it
8443 in the yychar entry.
8444 In the yychar entry, remove mention of the local yychar case (pure
8445 parser) since this is irrelevant information when writing semantic
148d66d8 8446 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
8447 yychar is otherwise described as an external variable.
8448 In the yychar entry, don't call it the `current' look-ahead since it
8449 isn't when semantic actions are deferred.
8450 In the yychar and yyclearin entries, add note about deferred semantic
8451 actions.
8452 Add yylloc and yylval entries discussing look-ahead usage.
8453 (Look-Ahead Tokens): When discussing yychar, don't call it the
8454 `current' look-ahead, and do mention yylval and yylloc.
8455 (Error Recovery): Cross-reference `Action Features' when mentioning
8456 yyclearin.
148d66d8 8457 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
8458 look-ahead.
8459 In the yylloc and yylval entries, mention look-ahead usage.
8460
de366a2f 84612006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
8462
8463 * tests/glr-regression.at: Update copyright year to 2006.
8464
bf70fa87
JD
84652006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8466
8467 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
8468 use during nondeterministic operation to track which stacks have
8469 actually needed the current lookahead.
8470 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
8471 Allocate, deallocate, resize, and otherwise shuffle space for
8472 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
8473 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
8474 appropriately during nondeterministic operation.
8475 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
8476 members to store the current lookahead to be used by the deferred
8477 user action.
8478 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
8479 from which the RHS is taken. Set the lookahead members of the new
8480 yySemanticOption according to the lookahead status for stack yyk.
8481 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
8482 yyaddDeferredAction.
8483 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
8484 members of yySemanticOption before invoking yyuserAction, and then set
8485 them back to their current values afterward.
8486 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
8487 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
8488 * tests/glr-regression.at: Remove `.' from the ends of recent test case
8489 titles for consistency.
8490 (Leaked merged semantic value if user action cuts parse): In order to
8491 suppress lint warnings, use arguments in merge function, and assign
8492 char value < 128 in main.
8493 (Incorrect lookahead during deterministic GLR): New test case.
8494 (Incorrect lookahead during nondeterministic GLR): New test case.
8495
05449a2c
JD
84962006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8497
de366a2f 8498 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
8499 !yyvaluep as signal that no semantic value is available to print.
8500 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
8501 to print a semantic value.
8502
4158e0a1 85032006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 8504
4158e0a1
JD
8505 * tests/glr-regression.at: For consistency with my newer test cases,
8506 don't thank myself.
8507
d659304d
JD
85082006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
8509
8510 * data/glr.c (yyresolveValue): When merging semantic options, if at
8511 least one user action succeeds but a later one cuts the parse, then
8512 destroy the semantic value before returning rather than leaking it.
8513 (yyresolveStates): If a user action cuts the parse and thus
8514 yyresolveValue fails, ignore the (unset) semantic value rather than
8515 corrupting the yyGLRState, and empty the semantic options list since
8516 the user actions should have called all necessary destructors.
8517 Simplify code with YYCHK.
8518 * tests/glr-regression.at (Corrupted semantic options if user action
8519 cuts parse): New test case.
8520 (Undesirable destructors if user action cuts parse): New test case.
8521 Before applying any of this patch, this test case never actually failed
8522 for me... but only because the corrupted semantic options usually
8523 masked this bug.
8524 (Leaked merged semantic value if user action cuts parse): New test
8525 case.
8526
6ec2c0f2
AD
85272006-01-05 Akim Demaille <akim@epita.fr>
8528
8529 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
8530
1b9c21fb
PE
85312006-01-04 Paul Eggert <eggert@cs.ucla.edu>
8532
8533 * data/c.m4 (b4_c_modern): New macro, with a new provision for
8534 _MSC_VER. Problem reported by Cenzato Marco.
8535 (b4_c_function_def): Use it.
8536 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
8537 b4_c_modern.
8538 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
8539 than rolling our own.
8540
84866159
AD
85412006-01-04 Akim Demaille <akim@epita.fr>
8542
8543 Also warn about non-used mid-rule values.
8544 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
8545 member.
8546 (symbol_list_new): Adjust.
8547 * src/reader.c (symbol_typed_p): New.
8548 (grammar_rule_check): Use it.
8549 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
8550 Check its rule.
8551 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
8552 Use it.
8553 * tests/actions.at (Exotic Dollars): Adjust.
8554
378f4bd8
AD
85552006-01-04 Akim Demaille <akim@epita.fr>
8556
8557 * src/reader.c (grammar_midrule_action): If $$ is set in a
8558 mid-rule, move the `used' bit to its lhs.
8559 * tests/input.at (Unused values): New.
8560 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
8561
e2a21b6f
PE
85622006-01-03 Paul Eggert <eggert@cs.ucla.edu>
8563
54662697
PE
8564 * doc/bison.texinfo (Bison Options): Say more accurately what
8565 --yacc does.
8566 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
8567 about declarations in the grammar when in Yacc mode, as POSIX does
8568 not require a diagnostic when the grammar uses extensions.
8569
8570 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
8571
073f9288
PE
8572 Warn about dubious constructions like "%token T T".
8573 Reported by twlevo.
8574 * src/symtab.h (struct symbol.declared): New member.
8575 * src/symtab.c (symbol_new): Initialize it to false.
8576 (symbol_class_set): New arg DECLARING, specifying whether
8577 this is a declaration that we want to warn about, if there
8578 is more than one of them. All uses changed.
8579
1221b78a
PE
8580 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
8581 Allow multiple %union directives, whose contents concatenate.
8582 * src/parse-gram.y (grammar_declaration): Likewise.
8583 Use muscle_code_grow, so that we don't need stype_line any more.
8584 All uses changed.
8585
8586 * src/muscle_tab.c (muscle_grow): Fix comment.
8587
e2a21b6f
PE
8588 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
8589 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
8590 Update copyright year to 2006.
8591
8f7e3cf9
AD
85922006-01-03 Akim Demaille <akim@epita.fr>
8593
8594 Have glr.cc pass (some of) the calc.at tests.
8595 * data/glr.cc (b4_parse_param_orig): New.
8596 (b4_parse_param): Improve its definition, and bound it more
8597 clearly in the skeleton.
8598 (b4_epilogue): Append, instead of prepending, in order to keep
8599 #line consistency.
8600 Simplify the generation of auxiliary functions: locations and
8601 purity are mandated.
8602 (b4_global_tokens_and_yystype): Honor it.
8603 * data/location.cc (c++.m4): Don't include it.
8604 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
8605 and AT_SKEL_CC_IF.
8606 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
8607 AT_LALR1_CC_IF.
8608 Be sure to initialize the first position's filename.
8609 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
8610 mandated anyway.
8611 (AT_CHECK_CALC_GLR_CC): New.
8612 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
8613
3953ed88
AD
86142006-01-02 Akim Demaille <akim@epita.fr>
8615
8616 * src/output.c (output_skeleton): Don't hard wire the inclusion of
8617 c.m4.
0a96ba81 8618 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
8619 * data/glr.cc: Do not include stack.hh.
8620
9ecafbbf
AD
86212006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
8622
8623 * data/glr.c: Reformat whitespace with tabs.
8624 (b4_lpure_formals): Remove this unused m4 macro.
8625 * tests/cxx-type.at: Reformat whitespace with tabs.
8626 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
8627 since it's a member. Rename type to isNterm for clarity.
8628
c4d497a0
AD
86292005-12-29 Akim <akim@sulaco.local>
8630
8631 Let glr.cc catch up with symbol_value_print.
8632 * data/glr.cc (b4_yysymprint_generate): Replace by...
8633 (b4_yy_symbol_print_generate): this.
8634 (yy_symbol_print, yy_symbol_value_print): Declare them.
8635
4517da37
PE
86362005-12-28 Paul Eggert <eggert@cs.ucla.edu>
8637
8638 * src/location.h (boundary): Note that a line or column equal
8639 to INT_MAX indicates an overflow.
8640 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
8641 (rule_length_overflow, increment_rule_length, add_column_width):
8642 New functions.
8643 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
8644 (<SC_BRACED_CODE>"}"):
8645 Use increment_rule_length rather than incrementing it by hand.
8646 (adjust_location, handle_syncline): Diagnose overflow.
8647 (handle_action_dollar, handle_action_at):
8648 Fix bug with monstrosities like $-2147483648.
8649 Remove now-unnecessary checks.
8650 (scan_integer): Verify assumptions and remove now-unnecessary checks.
8651 (convert_ucn_to_byte): Verify assumptions.
8652 (handle_syncline): New arg LOC. All callers changed.
8653 Don't store through a value derived from char const * pointer.
8654
8655 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
8656 GCC warnings.
8657
e3233bf6
PE
86582005-12-27 Paul Eggert <eggert@cs.ucla.edu>
8659
8660 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
8661 Remove unnecessary forward static decls.
8662
8f3596a6
AD
86632005-12-27 Akim Demaille <akim@epita.fr>
8664
8665 * src/reader.c (grammar_current_rule_check): Also check that $$
8666 is used.
8667 Take the rule to check as argument, hence rename as...
8668 (grammar_rule_check): this.
8669 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
8670 Rename as...
8671 (grammar_rule_begin, grammar_rule_end): these, for consistency.
8672 (grammar_midrule_action, grammar_symbol_append): Now static.
8673 * tests/torture.at (input): Don't rely on the default action
8674 being always performed.
8675 * tests/calc.at: "Set" $$ even when the action is "cut" with
8676 YYERROR or other.
8677 * tests/actions.at (Exotic Dollars): Instead of using unused
8678 values, check that the warning is issued.
8679
721be13c
PE
86802005-12-22 Paul Eggert <eggert@cs.ucla.edu>
8681
8682 * NEWS: Improve wording for unused-value warnings.
8683
a0af42fc
AD
86842005-12-22 Akim Demaille <akim@epita.fr>
8685
8686 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
8687 (b4_yysymprint_generate): Rename as...
8688 (b4_yy_symbol_print_generate): this.
8689 Generate yy_symbol_print instead of yysymprint.
8690 Generate also yy_symbol_value_print, and use it.
8691
affac613
AD
86922005-12-22 Akim Demaille <akim@epita.fr>
8693
721be13c 8694 * NEWS: Warn about unused values.
affac613
AD
8695 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
8696 a `used' member.
8697 (symbol_list_n_get, symbol_list_n_used_set): New.
8698 (symbol_list_n_type_name_get): Use symbol_list_n_get.
8699 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
8700 * src/reader.c (grammar_current_rule_check): Check that values are
8701 used.
8702 * src/symtab.c (symbol_print): Accept 0.
8703 * tests/existing.at: Remove the type information.
8704 Empty the actions.
8705 Remove useless actions (beware of mid-rule actions: perl -000
8706 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
8707 * tests/actions.at (Exotic Dollars): Use unused values.
8708 * tests/calc.at: Likewise.
8709 * tests/glr-regression.at (No users destructors if stack 0 deleted):
8710 Likewise.
8711
8712 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
8713 rule_useful_p.
8714
9d9b8b70
PE
87152005-12-21 Paul Eggert <eggert@cs.ucla.edu>
8716
8bb4c753
PE
8717 Undo 2005-12-01 tentative license wording change. The wording is
8718 still being reviewed by the lawyers, and we don't want to wait for
8719 them before publishing a test release. For now, revert to the
8720 previous wording.
8721 * NEWS: Undo 2005-12-01 change.
8722 * data/glr.c: Revert to previous license wording.
8723 * data/glr.cc: Likewise.
8724 * data/lalr1.cc: Likewise.
8725 * data/location.cc: Likewise.
8726 * data/yacc.c: Likewise.
8727
9d9b8b70
PE
8728 * NEWS: Reword %destructor vs YYABORT etc.
8729 * data/glr.c: Use American spacing, for consistency.
8730 * data/glr.cc: Likewise.
8731 * data/lalr1.cc: Likewise.
8732 * data/yacc.c: Likewise.
8733 * data/yacc.c: Reformat comments slightly.
8734 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
8735 for consistency. Fix some spelling errors and reword recently-included
8736 text slightly.
8737 * tests/cxx-type.at: Cast results of malloc, for C++.
8738
2c3b392a
AD
87392005-12-21 Joel E. Denny <address@hidden>
8740
8741 * tests/cxx-type.at: Construct a tree, count the parents of shared
8742 nodes, and free each node once and only once. Previously, the memory
8743 for semantic values was leaked instead.
8744
d6cff4dc
AD
87452005-12-21 Joel E. Denny <address@hidden>
8746
8747 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
8748 (yylval, yylloc): If pure, #define to yystackp->yyval and
8749 yystackp->yyloc similar to yychar and yynerrs.
8750 (yyparse): If pure, remove local yylval and yylloc. Add local
8751 yystackp to accommodate pure definitions of yylval and yylloc.
8752 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
8753 yylvalp and yyllocp to &yylval and &yylloc.
8754 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
8755 namespace. Previously, nerrs and char were missing, but lval and lloc
8756 weren't necessary.
8757 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
8758 yylvalp and yyllocp parameters since, if pure, these are now always
8759 accessible through yystackp. If not pure, they are still accessible
8760 globally.
8761 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
8762 `if (YYID (N))' to pacify lint.
8763
a85284cf
AD
87642005-12-21 Akim Demaille <akim@epita.fr>
8765
8766 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
8767 destroy the RHS symbols of a rule.
8768 * data/yacc.c (yylen): Initialize to 0.
8769 Keep its value to the number of items to possibly shift.
8770 In particular, a regular successful parse that ends on YYFINAL by
8771 a (internal) YYACCEPT must not have yylen != 0.
8772 (yyerrorlab, yyreturn): Pop the RHS.
8773 Reorder a bit to emphasize the `shifting' bits of code.
8774 (YYPOPSTACK): Now accept a number of items to pop.
8775 * data/lalr1.cc: Likewise.
8776 * data/glr.c: Formatting changes.
8777 Use goto instead of fall through.
8778 * doc/bison.texinfo (Destructor Decl): Complete.
8779
d508c281
JMG
87802005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8781
8782 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
8783 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
8784 * djgpp/config.bat: Replace every occurence of the file name
8785 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
8786 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
8787 * djgpp/config.sed: Replace every occurence of the file name
8788 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
8789 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
8790 * djgpp/djunpack.bat: DJGPP specific file.
8791 * djgpp/fnchange.lst: DJGPP specific file.
8792 * djgpp/README.in: Add new information about how to unpack the bison
8793 source on MSDOS and other systems which have 8.3 file name restrictions
8794 using djunpack.bat and fnchange.lst.
8795
3e7a2cd9
PE
87962005-12-12 Paul Eggert <eggert@cs.ucla.edu>
8797
8798 * bootstrap (build_cvs_prefix): Remove; unused.
8799 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
8800 when getting gnulib.
8801
88022005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
8803
8804 * data/glr.c: Reorder typedef declarations for structs to match order
8805 of struct declarations.
8806 Rename yystack everywhere to yystackp except in yyparse where it's not
8807 a pointer.
8808 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
8809 consistency.
8810 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
8811 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
8812 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
8813 lint.
8814
877519f8
PE
88152005-12-09 Paul Eggert <eggert@cs.ucla.edu>
8816
0eca5a39
PE
8817 * tests/sets.at (Accept): Fix typos in regular expression used to
8818 sed out the final state number.
8819
2cec9080
PE
8820 Work around portability problem on Solaris 10: flex-generated
8821 files include <stdio.h> before <config.h>, which messes up
8822 because the latter defines __EXTENSIONS__. Address the problem
8823 by creating two new little files that include <config.h> first,
8824 then include the flex-generated files. Rewrite everyone else
8825 to include <config.h> first, as well.
8826 * lib/timevar.c: Always include "config.h".
8827 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
8828 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
8829 (EXTRA_bison_SOURCES): New macro.
8830 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
8831 * src/system.h: Don't include config.h.
8832 * src/LR0.c: Include <config.h> first.
8833 * src/assoc.c: Likewise.
8834 * src/closure.c: Likewise.
8835 * src/complain.c: Likewise.
8836 * src/conflicts.c: Likewise.
8837 * src/derives.c: Likewise.
8838 * src/files.c: Likewise.
8839 * src/getargs.c: Likewise.
8840 * src/gram.c: Likewise.
8841 * src/lalr.c: Likewise.
8842 * src/location.c: Likewise.
8843 * src/main.c: Likewise.
8844 * src/muscle_tab.c: Likewise.
8845 * src/nullable.c: Likewise.
8846 * src/output.c: Likewise.
8847 * src/parse-gram.y: Likewise.
8848 * src/print.c: Likewise.
8849 * src/print_graph.c: Likewise.
8850 * src/reader.c: Likewise.
8851 * src/reduce.c: Likewise.
8852 * src/relation.c: Likewise.
8853 * src/state.c: Likewise.
8854 * src/symlist.c: Likewise.
8855 * src/symtab.c: Likewise.
8856 * src/tables.c: Likewise.
8857 * src/uniqstr.c: Likewise.
8858 * src/vcg.c: Likewise.
8859
877519f8
PE
8860 * src/parse-gram.y: Fix minor problems uncovered by lint.
8861 (current_lhs, current_lhs_location): Now static.
8862 (current_assoc): Remove unused variable.
8863
8864 Cleanups so that Bison-generated parsers have less lint.
8865 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
8866 Prepend /*ARGSUSED*/, for lint's sake.
8867 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
8868 definition if 'lint' is defined.
8869 (YYID): New macro (or function, if lint).
8870 All uses of /*CONSTCOND*/0 replaced by YYID(0).
8871 * data/yacc.c: Likewise.
8872 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
8873 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
8874 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
8875 is C++ only.
8876 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
8877 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
8878 Use YYID(0) rather than 0, for lint.
8879 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
8880 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
8881
f5228370
PE
88822005-12-07 Paul Eggert <eggert@cs.ucla.edu>
8883
8884 * tests/glr-regression.at
8885 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
8886 Close memory leak reported by twlevo.
8887
69ce078b
PE
88882005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
8889
6ff99711
PE
8890 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
8891 all stacks.
8892 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
8893 * tests/glr-regression.at (No users destructors if stack 0 deleted):
8894 New test case.
8895 (Duplicated user destructor for lookahead): This test now is expected
8896 to succeed.
8897
af3412cd
PE
88982005-12-01 Paul Eggert <eggert@cs.ucla.edu>
8899
32b5b719 8900 * NEWS: Document the following change.
af3412cd
PE
8901 * data/yacc.c: Say "parser skeleton" rather than "file", since
8902 it's no longer just a file.
8903 * data/glr.c: Grant a special exception for C GLR parsers, that
8904 reads like the already-existing exception for C LALR(1) parsers.
8905 * data/glr.cc: Likewise.
8906 * data/lalr1.cc: Likewise.
8907 * data/location.cc: Likewise.
8908 * data/yacc.c: Reword the "written by" statement to clarify that
8909 it was the parser skeleton, not the entire output file.
8910 * data/glr.c: Written by Paul Hilfinger.
8911 * data/glr.cc: Written by Akim Demaille.
8912 * data/lalr1.cc: Likewise.
8913
035aa4a0
PE
89142005-11-18 Paul Eggert <eggert@cs.ucla.edu>
8915
d9963c85
PE
8916 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
8917 Fix typos in previous change that broke 'make check'.
8918 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
8919 supported in C.
8920 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
8921 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
8922 We can revert this once things settle down.
8923
035aa4a0
PE
8924 * src/conflicts.c (conflicts_print): Don't print file name twice
8925 when %expect fails because there were no conflicts.
8926 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
8927 change.
8928 * tests/conflicts.at (%expect not enough, %expect too much):
8929 (%expect with reduce conflicts): Adjust to new behavior.
8930
89312005-11-18 Akim Demaille <akim@epita.fr>
8932
8933 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
8934 errors.
8935 * NEWS: Document this.
8936 * doc/bison.texinfo (Expect Decl): Likewise.
8937
d1ff7a7c
AD
89382005-11-16 Akim Demaille <akim@epita.fr>
8939
8940 Generalize the display of semantic values and locations in traces.
8941 * data/glr.c (yy_reduce_print): Fix indices (again).
8942 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
8943 literal integers.
8944 * data/lalr1.cc (yyreduce_print): Rename as...
8945 (yy_reduce_print): this.
8946 Display values and locations.
8947 * data/yacc.c (yy_reduce_print): Likewise.
8948 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
8949 (yysymprint): Move higher to be visible from yy_reduce_print).
8950 (yyparse): Adjust.
8951 * tests/calc.at: Adjust the expected length of the traces.
8952
6de5398d
AD
89532005-11-14 Akim Demaille <akim@epita.fr>
8954
8955 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
8956 from 1 to N, while values and location start at 0.
8957 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
8958
a1373f55
AD
89592005-11-14 Akim Demaille <akim@epita.fr>
8960
8961 * data/glr.c (yy_reduce_print): Fix the $ number.
8962
613d8952
AD
89632005-11-14 Akim Demaille <akim@epita.fr>
8964
8965 "Use" parse parameters.
8966 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
8967 * data/glr.c, data/glr.cc: Use them.
8968 * data/glr.c (YYUSE): Have a C++ definition that supports
8969 non-pointer types.
8970
b2741627
AD
89712005-11-14 Akim Demaille <akim@epita.fr>
8972
8973 * data/glr.c (yyexpandGLRStack): Declare only if defined.
8974
5059b5c8
AD
89752005-11-14 Akim Demaille <akim@epita.fr>
8976
42249483
AD
8977 * data/glr.cc: New.
8978 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 8979
4626a15d
AD
89802005-11-12 Akim Demaille <akim@epita.fr>
8981
8982 Let position and location be PODs.
8983 * data/location.cc (position::initialize, location::initialize): New.
8984 (position::position, location::location): Define only if
8985 b4_location_constructors is defined.
8986 * data/lalr1.cc (b4_location_constructors): Define it for backward
8987 compatibility.
8988 * doc/bison.texinfo (Initial Action Decl): Use initialize.
8989
89902005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
8991
8992 * data/lalr1.cc: Move the body of the ctor and dtor into the
8993 parser file (instead of the header).
8994 Wrap the implementations in a "namespace yy".
8995
89962005-11-12 Akim Demaille <akim@epita.fr>
8997
8998 Have glr.c include its header file when created.
8999 * data/glr.c (b4_shared_declarations): New.
9000 Output them verbatim in the parser if !%defines, otherwise
9001 output then in the header file, and include it instead.
9002
1989d947
AD
90032005-11-11 Akim Demaille <akim@epita.fr>
9004
9005 * data/glr.c: Comment changes.
9006
90072005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
9008
9009 When yydebug, report semantic and location values for reductions.
9010 * data/glr.c (yy_reduce_print): Report the semantic values and the
9011 locations.
9012 (YY_REDUCE_PRINT): Adjust.
9013 (yyglrReduce): Use them.
9014 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
9015 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
9016 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
9017 traces.
9018
02998094
AD
90192005-11-10 Akim Demaille <akim@epita.fr>
9020
9021 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
9022 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
9023 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
9024
5210672f
PE
90252005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
9026
9027 * m4/cxx.m4, examples/Makefile.am: Don't build
9028 examples/calc++ if no C++ compiler is available. (trivial change)
9029
a8991a1d
AD
90302005-11-09 Akim Demaille <akim@epita.fr>
9031
9032 * src/scan-skel.l: Use a couple of asserts.
9033
36b5e963
AD
90342005-11-03 Akim Demaille <akim@epita.fr>
9035
9036 In some (weird) cases, the final state number is incorrect.
9037 Reported by Alexandre Duret-Lutz.
9038 * src/LR0.c (state_list_append): Remove the computation of
9039 final_state.
9040 (save_reductions): Do it here.
9041 (get_state): Alpha conversion.
9042 (generate_states): Use a for loop.
9043 * src/gram.h (item_number_is_rule_number)
9044 (item_number_is_symbol_number): New.
9045 * src/state.c: Use assert.
9046 * src/system.h: Include assert.h.
9047 * tests/sets.at (Accept): New.
9048
44e7ead1
PH
90492005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9050
9051 * data/glr.c (yyfill): Adjust comment.
36b5e963 9052 (yyresolveAction): Initialize default location properly
44e7ead1
PH
9053 for empty right-hand sides.
9054 (yydoAction): Ditto.
9055 Add comment explaining apparently dead code.
36b5e963
AD
9056 * tests/glr-regression.at
9057 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 9058 New test.
36b5e963 9059
e10a80ee
PE
90602005-10-30 Paul Eggert <eggert@cs.ucla.edu>
9061
9062 * bootstrap (cleanup_gnulib): New function. Use it to clean up
9063 gnulib when interrupted. This fixes some race conditions and
9064 works around some portability problems (one noted by Paul
9065 Hilfinger).
9066
067b32ee
AD
90672005-10-22 Akim <akim@epita.fr>
9068
9069 * Makefile.cfg: Adjust to config -> build-aux.
9070 Reported by twledo.
9071
4b367315
AD
90722005-10-21 Akim Demaille <akim@epita.fr>
9073
9074 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
9075 the %parse-params.
9076 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
9077 * data/yacc.c (b4_Pure_if): Rename as...
9078 (b4_yacc_pure_if): this.
9079 (YY_SYMBOL_PRINT, yyparse): Adjust.
9080 * doc/bison.texinfo: Formatting changes.
9081
24cc23d9
AD
90822005-10-21 Akim Demaille <akim@epita.fr>
9083
9084 Finish the transition config -> build-aux.
9085 * configure.ac, Makefile.am: Use build-aux.
9086 * config/prev-version, config/announce-gen, config/Makefile.am:
9087 Move to...
9088 * build-aux/prev-version, build-aux/announce-gen,
9089 * build-aux/Makefile.am: here.
9090
d4476375
AD
90912005-10-14 Akim Demaille <akim@epita.fr>
9092
9093 * examples/calc++/test: Use set -x only when VERBOSE.
9094
302c0aee
PE
90952005-10-13 Paul Eggert <eggert@cs.ucla.edu>
9096
9097 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
9098 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
9099
7625ec2c
AD
91002005-10-13 Akim Demaille <akim@epita.fr>
9101
9102 * src/scan-skel.l: Output the base name parts of the parser and
9103 header file names.
302c0aee 9104 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
9105 additional checks.
9106 Use this to exercise C++ outputs in subdirs.
9107 Reported by Oleg Smolsky.
9108
ba0fe3c7
PE
91092005-10-12 Paul Eggert <eggert@cs.ucla.edu>
9110
9111 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
9112 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
9113 Problem reported by John P. Hartmann.
9114 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
9115 already defined it.
9116
9b8a5ce0
AD
91172005-10-12 Akim Demaille <akim@epita.fr>
9118
9119 * src/parse-gram.y (version_check): Exit 63 to please missing
9120 (stands for "version mismatch).
9121 * tests/input.at, doc/bison.texinfo: Adjust.
9122
4f6e011e
PE
91232005-10-10 Paul Eggert <eggert@cs.ucla.edu>
9124
9125 Work around portability problems with Visual Age C compiler
9126 (xlc and xlC_r) reported by John P. Hartmann.
9127 * data/location.cc (initial_column, initial_line): Remove.
9128 All uses replaced by 0 and 1.
9129 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
9130 that xlc complains about.
9131 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 9132 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 9133 as __STDC__.
4d7aa45e
PE
9134 * data/yacc.c (YYMODERN_C): New macro, which also looks at
9135 __STDC_VERSION__. Use it everywhere instead of looking at
9136 __STDC__ and __cplusplus.
4f6e011e 9137
a1b3bf8c
AD
91382005-10-10 Akim Demaille <akim@epita.fr>
9139
9140 * examples/calc++/test: Be quiet unless VERBOSE.
9141
412e44aa
PE
91422005-10-05 Paul Eggert <eggert@cs.ucla.edu>
9143
2a4647a3
PE
9144 * data/c.m4 (yydestruct, yysymprint):
9145 Use YYUSE instead of casting to void.
9146 * data/glr.c (YYUSE): New macro.
9147 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
9148 Use it instead of rolling our own.
9149 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
9150 (YYCHK1):
9151 Use /*CONSTCOND*/ to suppress lint warnings.
9152 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
9153 (YY_STACK_PRINT): Use 'false' not '0'.
9154 (YYUSE): New macro.
9155 (yysymprint_, yydestruct_): Use it instead of rolling our own.
9156 * data/yacc.c (YYUSE): New macro.
9157 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
9158 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
9159 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
9160
9161
412e44aa
PE
9162 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
9163 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
9164
88c6637f
PE
91652005-10-04 Paul Eggert <eggert@cs.ucla.edu>
9166
2f4f028d
PE
9167 Undo the parts of the unlocked-I/O change that substituted
9168 putc or puts for printf. This might hurt performance a bit,
9169 but some people prefer the printf style.
9170 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
9171 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
9172 All uses replaced by YYFPRINTF and YYDPRINTF.
9173 * data/yacc.c: Likewise.
9174 * lib/bitset.c (bitset_print): Likewise.
9175 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
9176 putc and puts.
9177 * lib/lbitset.c (debug_lbitset): Likewise.
9178 * src/closure.c (print_firsts, print_fderives): Likewise.
9179 * src/gram.c (grammar_dump): Likewise.
9180 * src/lalr.c (look_ahead_tokens_print): Likewise.
9181 * src/output.c (escaped_output): Likewise.
9182 (user_actions_output): Break apart two printfs.
9183 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
9184 * src/reduce.c (reduce_print): Likewise.
9185 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
9186 * src/system.h: Include unlocked-io.h rathe than stdio.h.
9187
88c6637f
PE
9188 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
9189 Use assignments rather than casts-to-void to suppress
9190 unused-variable warnings. This pacifies 'lint'.
9191 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
9192 unused-variable warnings.
9193
fb32e373
JMG
91942005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9195
9196 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
9197
edb8f44f
PE
91982005-10-02 Paul Eggert <eggert@cs.ucla.edu>
9199
fb9c0b33
PE
9200 Use unlocked I/O for a minor performance improvement on hosts like
9201 GNU/Linux and Solaris that support unlocked I/O. The basic idea
9202 is to use the gnlib unlocked-io module, and to prefer putc and
9203 puts to printf when either will work (since the latter doesn't
9204 come in an unlocked flavor).
9205 * bootstrap (gnulib_modules): Add unlocked-io.
9206 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
9207 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
9208 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
9209 and similarly for puts and putc and printf.
9210 * data/yacc.c: Likewise.
9211 * lib/bitset.c (bitset_print): Likewise.
9212 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
9213 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
9214 to printf.
9215 * lib/lbitset.c (debug_lbitset): Likewise.
9216 * src/closure.c (print_firsts, print_fderives): Likewise.
9217 * src/gram.c (grammar_dump): Likewise.
9218 * src/lalr.c (look_ahead_tokens_print): Likewise.
9219 * src/output.c (escaped_output): Likewise.
9220 (user_actions_output): Coalesce two printfs.
2f4f028d 9221 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
9222 * src/reduce.c (reduce_print): Likewise.
9223 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 9224 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 9225
edb8f44f
PE
9226 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
9227 this confuses xgettext.
9228
b50d2359
AD
92292005-10-02 Akim Demaille <akim@epita.fr>
9230
9231 * bootstrap (gnulib_modules): Add strverscmp.
9232 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
9233 * m4/.cvsignore: Add strverscmp.m4.
9234 * src/parse-gram.y (%require): New token, new rule.
9235 (version_check): New.
9236 * src/scan-gram.l (%require): Adjust.
9237 * tests/input.at (AT_REQUIRE): New.
9238 Use it.
9239 * doc/bison.texinfo (Require Decl): New.
9240 (Calc++ Parser): Use %require.
9241
21667f64
AD
92422005-10-02 Akim Demaille <akim@epita.fr>
9243
9244 * data/location.cc: New.
9245
2b81e969
AD
92462005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
9247 Akim Demaille <akim@epita.fr>
9248
9249 Make sure -odir/foo.cc creates dir/location.hh etc.
9250 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
9251 (spec_file_prefix, spec_verbose_file, spec_graph_file)
9252 (spec_defines_file): Now const.
9253 (dir_prefix): New.
9254 (short_base_name): Remove.
9255 * src/files.c: Adjust.
9256 (dirname.h): Include.
9257 (base_name): Don't prototype it.
9258 (finput): Remove, duplicates gram_in.
9259 (full_base_name, short_base_name): Replace by...
9260 (all_but_ext, all_but_tab_ext): these.
9261 (compute_base_names): Rename as...
9262 (compute_file_name_parts): this.
9263 Update to compute the new variables, including dir_prefix.
9264 Adjust dependencies.
9265 * src/output.c (prepare): Output them.
9266 * src/reader.c: Adjust to use gram_in, not finput.
9267 * src/scan-skel.l (@dir_prefix@): New.
9268
ad6a9b97
JMG
92692005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9270
9271 * lib/subpipe.c: New function end_of_output_subpipe() added
9272 to allow support for non-posix systems. This is a no-op function
9273 for posix systems.
9274
9275 * lib/subpipe.h: New function end_of_output_subpipe() added
9276 to allow support for non-posix systems. This is a no-op function
9277 for posix systems.
9278
9279 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
9280 handle the lack of pipe/fork functionality on non-posix systems.
9281
9282 * djgpp/Makefile.maint: DJGPP specific file.
9283
9284 * djgpp/README.in: DJGPP specific file.
9285
9286 * djgpp/config.bat: DJGPP specific configuration file.
9287
9288 * djgpp/config.sed: DJGPP specific configuration file.
9289
9290 * djgpp/config.site: DJGPP specific configuration file.
9291
9292 * djgpp/config_h.sed: DJGPP specific configuration file.
9293
9294 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
9295
9296 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
9297
fc695704
AD
92982005-10-02 Akim Demaille <akim@epita.fr>
9299
9300 * data/location.cc: New, extract from...
9301 * data/lalr1.cc: here.
9302 (location.hh): Include it after the user prologue, in case the
9303 filename type is defined by the user.
9304 Forward declation location and position before the pre-prologue.
9305 (yyresult_): Rename as...
9306 (yyresult): this, it's a local variable, not an attribute.
9307 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
9308
93092005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
9310
9311 * examples/extexi: Restore the #line generation.
9312
fb9712a9
AD
93132005-09-30 Akim Demaille <akim@epita.fr>,
9314 Alexandre Duret-Lutz <adl@gnu.org>
9315
9316 Move the token type and YYSTYPE in the parser class.
9317 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
9318 (parser::token): New, from the moved free definition of tokens.
9319 (parser::semantic_value): Now a full definition instead of an
9320 indirection to YYSTYPE.
9321 (b4_post_prologue): No longer included in the header file, but
9322 in the implementation file.
9323 * doc/bison.texi (C+ Language Interface): Update.
9324 * src/parse-gram.y: Support unary %define.
9325 * tests/actions.at: Define global_tokens_and_yystype for backward
9326 compatibility until we update the tests.
9327 * tests/calc.at: Idem.
9328 (first_line, first_column, last_line, last_column): Define for lalr1.cc
9329 to simplify the code.
9330
55f0c7b1
PE
93312005-09-29 Paul Eggert <eggert@cs.ucla.edu>
9332
9333 Port to SunOS 4.1.4, which lacks strtoul and strerror.
9334 Ah, the good old days! Problem reported by Peter Klein.
9335 * bootstrap (gnulib_modules): Add strerror, strtoul.
9336 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
9337 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
9338
fb9712a9 93392005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
9340
9341 * data/c.m4 (b4_error_verbose_if): New.
9342 * data/lalr1.cc: Use it.
9343 (YYERROR_VERBOSE_IF): Remove.
9344 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
9345 parser members, replaced by...
9346 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
9347 local variables.
9348 (yysyntax_error_): Takes the state number as argument.
9349 (yyreduce_print_): Use the argument yyrule, not the former
9350 attribute yyn_.
9351
8a6f72f3
PE
93522005-09-26 Paul Eggert <eggert@cs.ucla.edu>
9353
9354 * bootstrap (gnulib_modules): Add verify.
9355 * lib/.cvsignore: Add verify.h.
9356 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
9357 * src/system.h (verify): Remove.
9358 Include verify.h instead.
9359 * src/tables.c (tables_generate): Use new API for 'verify'.
9360
0d50976f
PE
93612005-09-21 Paul Eggert <eggert@cs.ucla.edu>
9362
ebc3737e
PE
9363 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
9364 local variables whose names begin with 'yy'.
9365 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
9366 Trivial changes from Joel E. Denny.
9367
0d50976f
PE
9368 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
9369 it itself.
9370 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
9371 don't use alloca any more.
9372
9373 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
9374 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 9375 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
9376 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
9377 to match yacc.c, to test more hosts.
9378
a05b79df
PE
93792005-09-20 Paul Eggert <eggert@cs.ucla.edu>
9380
55289366
PE
9381 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
9382 doesn't affect behavior.
9383 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
9384 Solaris, AIX, MSC.
9385 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
9386 This works a bit better with glibc, if user code has already included
9387 stdlib.h.
9388 * doc/bison.texinfo (Bison Parser): Document that users can't
9389 arbitrarily use malloc and free for other purposes. Document
9390 that <alloca.h> and <malloc.h> might be included.
9391 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
9392 user must declare alloca.
9393
a05b79df
PE
9394 * HACKING (release): Forwarn the Translation Project about
9395 stable releses.
9396
3ab2ca22
AD
93972005-09-20 Akim Demaille <akim@epita.fr>
9398
9399 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
9400
a9739e7c
PE
94012005-09-19 Paul Eggert <eggert@cs.ucla.edu>
9402
a702593e
PE
9403 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
9404 (YYSTACK_ALLOC_MAXIMUM): Use it.
9405 (yysyntax_error): New function.
9406 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
9407 multiple syntax errors are reported, and alloca is being used.
9408 Instead, reallocate buffers twice as big each time, so that
9409 we waste at most half the allocated memory. Start with a small
9410 (128-byte) buffer that will suffice in most cases anyway.
9411 Use yysyntax_error to do most of the work.
9412
9413 * doc/bison.texinfo (Error Reporting, Table of Symbols):
9414 yynerrs is the number of errors reported, not the number of
9415 errors encountered.
9416
a9739e7c
PE
9417 * tests/glr-regression.at (Duplicated user destructor for lookahead):
9418 Mark it as expected to fail.
9419 Cast result of malloc; problem reported by twlevo@xs4all.nl.
9420 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
9421 Don't start user-code symbols with "yy", to avoid name space problems.
9422
f479c6c6
AD
94232005-09-19 Akim Demaille <akim@epita.fr>
9424
9425 Remove the traits, failed experiment.
9426 It never proved useful, and anyway because of the current
9427 definition, it was not possible to have several specialization of
9428 this traits, making it useless.
9429 * data/lalr1.cc (yy:traits): Remove.
9430 Inline its definitions in the parser class.
9431
e2586f82
AD
94322005-09-19 Akim Demaille <akim@epita.fr>
9433
9434 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
9435 least Mac OSX with a /usr/local install of gettext.
9436
2e8cf949
AD
94372005-09-19 Akim Demaille <akim@epita.fr>
9438
9439 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
9440 and yytoken for similarity with the other skeletons.
9441
c7fb0b90
AD
94422005-09-19 Akim Demaille <akim@epita.fr>
9443
4e26c69e 9444 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 9445
1bd0deda
PE
94462005-09-16 Paul Eggert <eggert@cs.ucla.edu>
9447
9448 * NEWS: Version 2.1.
9449
9450 * NEWS: Remove notice of yytname change, since it was never in an
9451 official release.
9452 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
9453 diagnostic.
9454 * src/output.c (prepare): Likewise.
9455 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
9456 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
9457 is not defined. This is an awful hack, but it's enough for now.
9458 All callers changed.
9459 * tests/glr-regression-at (make_value): Args are const pointers now,
9460 to avoid GCC warning.
9461 (Duplicated user destructor for lookahead): New test. Currently
9462 skipped. It fails on my host but I'm not sure it'll always fail.
9463
94642005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
9465
9466 * src/symtab.h (struct symbol): Declare the printer and destructor
9467 as const, to avoid accidental calls to free.
9468 (symbol_destructor_set, symbol_printer_set): Adjust.
9469 * src/symtab.c: Adjust.
9470
1bd0deda 94712005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
9472
9473 * data/c.m4 (b4_token_enums): New.
9474 (b4_token_defines): Rename as...
9475 (b4_token_enums_defines): this.
9476 (b4_token_defines): New, output only the #defines.
9477 * data/yacc.c, data/glr.c: Adjust.
9478 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
9479 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
9480 as default values.
9481
dbcdae2d
AD
94822005-09-16 Akim Demaille <akim@epita.fr>
9483
9484 * data/lalr1.cc (yylex_): Remove, inline its code.
9485 (yyreport_syntax_error_): Remove, replaced by...
9486 (yysyntax_error_): this which returns a string and leaves to the
9487 caller the call to the users' error function.
9488 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
9489 Move from members of the parser object...
9490 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
9491 to local variables of the parse function.
9492
70d8f291
AD
94932005-09-16 Akim Demaille <akim@epita.fr>
9494
9495 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
9496 since it's in Bison's name space.
9497
b47dbebe
PE
94982005-09-15 Paul Eggert <eggert@cs.ucla.edu>
9499
ae199bf1
PE
9500 * data/glr.c (yyresolveValue): Add default case to pacify
9501 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
9502
b47dbebe
PE
9503 * NEWS: Document when yyparse started to return 2.
9504 * doc/bison.texinfo (Parser Function): Document when yyparse
9505 returns 2.
9506
9507 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
9508 (b4_filename_type): Renamed back from b4_file_name_type. All uses
9509 changed.
9510 (class position): file_name -> filename (reverting). All uses changed.
9511
95122005-09-14 Paul Eggert <eggert@cs.ucla.edu>
9513
9514 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
9515 do anything if $@ exists. This reverts part of the 2005-07-07
9516 patch.
9517
00292f66
PE
95182005-09-11 Paul Eggert <eggert@cs.ucla.edu>
9519
9520 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
9521 contains obsolete information and isn't worth distributing as a
9522 separate file anyway.
9523 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
9524 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
9525 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
9526 (yyparse): Abort if user code uses longjmp to throw an unexpected
9527 value.
9528
a420f962
PE
95292005-09-09 Paul Eggert <eggert@cs.ucla.edu>
9530
00292f66
PE
9531 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
9532 Suggested by twlevo@xs4all.nl.
9533
127287e9
PE
9534 * data/glr.c (YYCHK1): Do not assume YYE is in range.
9535 This avoids a diagnostic from gcc -Wswitch-enum.
9536 Problem reported by twlevo@xs4all.nl.
9537
a420f962
PE
9538 * doc/bison.texinfo: Don't use "filename", as per GNU coding
9539 standards. Use "file name" or "file" or "name", depending on
9540 the context.
9541 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
9542 not to hack/foo.tab.c.
9543 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
9544 * data/glr.c: b4_filename -> b4_file_name.
9545 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
9546 All uses changed.
9547 (class position): filename -> file_name. All uses changed.
9548 * data/yacc.c: b4_filename -> b4_file_name.
9549 * lib/bitset.h: filename -> file_name in local vars.
9550 * lib/bitset_stats.c: Likewise.
9551 * src/files.c: Likewise.
9552 * src/scan-skel.l ("@output ".*\n): Likewise.
9553 * src/files.c (file_name_split): Renamed from filename_split.
9554 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
9555
95562005-09-08 Paul Eggert <eggert@cs.ucla.edu>
9557
9558 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
9559 to accommodate latest gnulib.
9560
9561 * tests/glr-regression.at (Duplicate representation of merged trees):
9562 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
9563
9564 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
9565 needed.
9566
42a6501d
PE
95672005-08-26 Paul Eggert <eggert@cs.ucla.edu>
9568
9569 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
9570 All uses changed. Invoke user destructor after an error during a
9571 split parse (trivial change from Joel E. Denny).
9572
9573 * tests/glr-regression.at
9574 (User destructor after an error during a split parse): New test case.
9575 Problem reported by Joel E. Denny in:
9576 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
9577
ef9a1faf
PE
95782005-08-25 Paul Eggert <eggert@cs.ucla.edu>
9579
5b4aaf78
PE
9580 * README-cvs: Give URLs for recommended tools.
9581 Mention Gzip version problem, and bootstrapping issues.
9582 Remove troubleshooting section, as it's somewhat obsolete.
9583
b5240ba5
PE
9584 * bootstrap (no_cache): New var, to accommodate different wget
9585 variants. Use it instead of '-C off'. Problem reported by
9586 twlevo@xs4all.nl.
9587
ef9a1faf
PE
9588 * data/glr.c (yydestroyStackItem): New function.
9589 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
9590 debugging information. Problem reported by Joel E. Denny.
9591
e6efa9da
AD
95922005-08-25 Akim Demaille <akim@epita.fr>
9593
9594 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
9595
adc90f13
PE
95962005-08-24 Paul Eggert <eggert@cs.ucla.edu>
9597
9598 * data/glr.c (yyrecoverSyntaxError, yyreturn):
9599 Don't invoke destructor on unresolved entries.
9600 * tests/glr-regression.at
9601 (User destructor for unresolved GLR semantic value): New test case.
9602 Problem reported by Joel E. Denny in:
9603 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
9604
f9315de5
PE
96052005-08-21 Paul Eggert <eggert@cs.ucla.edu>
9606
15d29c1f
PE
9607 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
9608 Add strnlen.c.
9609 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
9610 lib-prefix.m4, po.m4.
9611
dd5f2af2
PE
9612 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
9613 in yydestruct diagnostic, since it might not be an error.
9614 Problem reported by Joel Denny near end of
9615 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 9616 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
9617 * data/yacc.c (yyreturn): Likewise.
9618 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
9619
9620 * src/files.c: Remove obsolete FIXME comment.
9621
9622 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
9623 with the other templates, and to fix bogus run-on messages such
9624 as the one reported at the end of
9625 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
9626 All callers changed to avoid the newline.
9627 (yyprocessOneStack): Output two lines rather than one, to accommodate
9628 the above change. This changes the debug output format slightly.
9629
f9315de5
PE
9630 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
9631 reported by Joel E. Denny in
9632 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
9633 (trivial change).
9634 * tests/glr-regression.at (Duplicate representation of merged trees):
9635 New test, from Joel E. Denny in:
9636 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
9637 * THANKS: Add Joel E. Denny.
9638
9639 * configure.ac (AC_INIT): Bump to 2.0c.
9640
04098407
PE
96412005-07-24 Paul Eggert <eggert@cs.ucla.edu>
9642
9643 * NEWS: Version 2.0b.
9644
ca5d2013
PE
9645 * Makefile.am (SUBDIRS): Put examples before tests, so that
9646 "make check" doesn't finish with "All 1 tests passed".
9647
3d54b576
PE
9648 * tests/regression.at (Token definitions): Don't rely on
9649 AT_PARSER_CHECK for data that contains backslashes. It currently
9650 uses 'echo', and 'echo' isn't portable if its argument contains
9651 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
9652 that the byte '\0xff' is not printable in the C locale; it is,
9653 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
9654 not printable, so use '\0x81' to test.
9655
d53ae497
PE
9656 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
9657 version of GCC, since the macro is used with non-GCC compilers.
9658
fc01665e
PE
9659 Fix core dump reported by Pablo De Napoli in
9660 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
9661 * tests/regression.at (Invalid inputs with {}): New test.
9662 * src/parse-gram.y (token_name): Translate type before using
9663 it as an index.
9664
04098407
PE
9665 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
9666 the user's name space. All uses changed to __attribute__
9667 ((__unused__)).
9668 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
9669 Add __attribute__ ((__noreturn__)).
9670
9671 * etc/clcommit: Remove. We weren't using it, and it failed
9672 "make maintainer-distcheck".
9673 * Makefile.maint: Merge from coreutils.
9674 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
9675 (syntax-check-rules): Change list of rules as described below.
9676 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
9677 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
9678 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
9679 (sc_trailing_space): New rules.
9680 (sc_xalloc_h_in_src): Remove.
9681 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
9682 (sc_space_tab, sc_error_exit_success, sc_changelog):
9683 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
9684 (makefile-check, po-check, author_mark_check):
9685 (makefile_path_separator_check, copyright-check):
9686 Use grep -n, to make it easier to find violations.
9687 Use CVS_LIST and CVS_LIST_EXCEPT.
9688 (header_regexp, h_re): Remove.
9689 (dd_c): New macro.
9690 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
9691 (my-distcheck): Use more-modern GCC flags.
9692 (signatures, %.asc): Remove.
9693 (rel-files, announcement): Remove signatures.
9694 Restore old updating code, even though we don't use it, so
9695 that we're the same as coreutils.
9696 (alpha, beta, major): Depend on news-date-check.
9697 Make the upload commands.
9698
9699 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
9700 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
9701 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
9702 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
9703 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
9704 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
9705 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
9706 * tests/sets.at: Likewise.
9707
9708 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
9709 we comment out the Autoconf version number.
9710 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
9711 it's error-prone and "make maintainer-distcheck" rejects it.
9712
9713 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
9714 Indent calls to "error" to pacify "make maintainer-distcheck",
9715 when the calls are not intended to be translated.
9716 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
9717
9718 * src/Makefile.am (DEFS): Use +=, to pacify
9719 "make maintainer-distcheck".
9720 (bison_SOURCES): Add scan-skel.h.
9721 (sc_tight_scope): New rule, from coreutils.
9722
9723 * src/files.c (src_extension, header_extension):
9724 Now static, not extern.
9725 * src/getargs.c (short_options): Likewise.
9726 * src/muscle_tab.c (muscle_table): Likewise.
9727 * src/parse-gram.y (current_class, current_type, current_prec):
9728 Likewise.
9729 * src/reader.c (grammar_end, previous_rule_end): Likewise.
9730 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
9731 * src/main.c (main): Cast bindtextdomain and textdomain calls to
9732 void, to avoid warning when NLS is disabled.
9733 * src/output.c: Include scan-skel.h.
9734 (scan_skel): Remove decl, since scan-skel.h does this.
9735 (output_skeleton):
9736 Indent calls to "error" to pacify "make maintainer-distcheck".
9737 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
9738 * src/reader.h (gram_end, gram_lineno): New decls to pacify
9739 "make maintainer-distcheck".
9740 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
9741 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
9742 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
9743 (skel_lex_destroy, scan_skel): Move these decls to...
9744 * src/scan-skel.h: New file.
9745 * src/uniqstr.c (uniqstr_assert):
9746 Indent calls to "error" to pacify "make maintainer-distcheck".
9747
9748 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
9749 not @VAR@.
9750
9751 * tests/torture.at: Revamp to avoid misuse of atoi that
9752 "make maintainer-distcheck" complained about.
9753
9754 * examples/extexi (message): Don't print a message more than once,
9755 and omit line-number decoration that makes Emacs compile think
9756 that informative messages are worth worrying about.
9757
97582005-07-22 Paul Eggert <eggert@cs.ucla.edu>
9759
9760 * configure.ac: Update version number.
9761
9762 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
9763 accidentally.
9764 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
9765 autogenerated by the maintainer.
9766 * examples/calc++/.cvsignore: Add *.yy.
9767
9768 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
9769 * lib/bitset_stats.c (bitset_stats_init): Likewise.
9770 * lib/bitsetv.c (bitsetv_alloc): Likewise.
9771
9772 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
9773
9774 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
9775 from maintainer-distcheck about casting the argument of 'free'.
9776
9777 * NEWS: Mention recent yytname changes.
9778 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
9779
9780 * bootstrap: For translations that have not yet been upgraded to
9781 the new runtime-po domain, prime the pump by extracting the
9782 relevant strings from the obsolete translations. This code can be
9783 removed once the bison-runtime domain has been translated by each
9784 team.
9785
9786 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
9787 now that token names are already quoted.
9788
9789 Fix problem reported by Anthony Heading.
9790 * data/glr.c (YYTOKEN_TABLE): New macro.
9791 (yytname): Define if YYTOKEN_TABLE.
9792 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
9793 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
9794 (YYERROR_VERBOSE): Define the same way the other skeletons do.
9795 * src/output.c (prepare_symbols): Output token_table_flag.
9796
0ffda363
PE
97972005-07-21 Paul Eggert <eggert@cs.ucla.edu>
9798
9799 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
9800 again if the first call fails.
9801
9802 * data/glr.c (yytnamerr): New function.
9803 (yyreportSyntaxError): Use it to dequote most string literals.
9804 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
9805 with other skeletons. All uses changed.
9806 (yytnameerr_): New function.
9807 (yyreport_syntax_error): Use it to dequote most string literals.
9808 * data/yacc.c (yytnamerr): New function.
9809 (yyerrlab): Use it to decode most string literals.
9810 * doc/bison.texinfo (Decl Summary, Calling Convention):
9811 Clarify quoting convention of yytname.
9812 * src/output.c (prepare_symbols): Quote all names. This undoes
9813 the 2005-04-17 change, which is now accomplished (mostly) via
9814 changes in the parsers as described above.
9815 * tests/regression.at (Token definitions, Web2c Actions):
9816 Undo most 2005-04-17 change here, too.
9817
98182005-07-20 Paul Eggert <eggert@cs.ucla.edu>
9819
9820 Fix more problems reported by twlevo@xs4all.nl.
9821 * tests/cxx-type.at: Don't pipe output of ./types through sed to
9822 remove trailing spaces. This loses the exit status of ./types,
9823 and isn't needed since ./types shouldn't be emitting trailing
9824 spaces.
9825 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
9826 as the stack isn't valid in that case.
9827
9828 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
9829 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
9830 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
9831 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
9832 is used.
9833 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
9834 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
9835 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
9836 Likewise.
9837
9838 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
9839 overly-picky compilers that reject 'char *foo = "bar";'.
9840
9841 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
9842 to FILE * parameter, not to stderr. This fixes a typo introduced
9843 in the 2005-07-12 change.
9844
9845 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
9846 warnings from GCC 4.
9847
9848 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
9849 (yyglrShiftDefer, yysplitStack):
9850 Remove unused parameters b4_pure_formals. All uses changed.
9851 (yyglrShift): Remove unused parameters b4_user_formals.
9852 All uses changed.
9853 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
9854
6100a9aa
PE
98552005-07-18 Paul Eggert <eggert@cs.ucla.edu>
9856
258b75ca
PE
9857 Destructor cleanups and regularization among the three skeletons.
9858 * NEWS: Document the behavior changes.
9859 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
9860 stack before failing, as the cleanup code will do it for us now.
9861 * data/lalr1.cc (yyerrlab): Likewise.
9862 * data/glr.c (yyparse): Pop everything off the stack before
9863 freeing it, so that destructors get called properly.
9864 * data/lalr1.cc (yyreturn): Likewise.
9865 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
9866 This is more consistent.
9867 * doc/bison.texinfo (Destructor Decl): Mention more reasons
9868 why destructors might be called. 1.875 -> 2.1.
9869 (Destructor Decl, Decl Summary, Table of Symbols):
9870 Some English-language cleanups for %destructor.
9871 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
9872 Add output line for destructor of start symbol.
9873 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
9874 because of that same extra output line.
9875
1a059451
PE
9876 * NEWS: Document minor wording changes in diagnostics of
9877 Bison-generated parsers.
9878 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
9879 Remove unused formals. All uses changed.
9880 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
9881 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
9882 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
9883 Rename yyoverflowab to yyexhaustedlab.
9884 When memory exhaustion occurs during syntax-error reporting,
9885 report it separately rather than in a single diagnostic; this
9886 eases translation.
9887 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
9888 (Memory Exhausted): Renamed from Parser Stack Overflow.
9889 Revamp wording slightly to prefer "memory exhaustion".
9890 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
9891
97460c78
PE
9892 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
9893
30757c8c
PE
9894 Add i18n support to the GLR skeleton. Partially fix the C++
9895 skeleton; a C++ expert needs to finish this. Remove debugging
9896 msgids; there's little point to having them translated, since they
9897 can be understood only by someone who can read the
9898 (English-language) source code.
9899
9900 Generate runtime-po/bison-runtime.pot automatically, so that we
9901 don't have to worry about garbage getting in that file. We'll
9902 make sure after the next official release that old msgids don't
9903 get lost. See
9904 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
9905
9906 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
9907 Now auto-generated.
9908 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
9909 Fix typos in explanations of the runtime file.
9910 * bootstrap: Change gettext keyword from YYI18N to YY_.
9911 Use standard Makefile.in.in in runtime-po, since we'll arrange
9912 for backward-compatible bison-runtime.po files in a different way.
9913 * data/glr.c (YY_): New macro, from yacc.c.
9914 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
9915 Translate messages intended for users.
9916 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
9917 the wording in the other skeletons. We don't know that the memory
9918 is virtual.
9919 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
9920 Use same method that yacc.c uses.
9921 Don't translate debugging messages.
9922 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
9923 it doesn't work (yet), and requires C++ expertise to fix.
9924 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
9925 Move defn to a more logical place, to be consistent with other
9926 skeletons.
9927 Don't translate debugging messages.
9928 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
9929 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
9930 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
9931 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
9932
ac8c5689
PE
9933 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
9934 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
9935 void, not int.
9936 * tests/glr-regression.at (Badly Collapsed GLR States):
9937 Likewise.
9938 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
9939 yylex should return 0 at EOF rather than aborting.
9940
6100a9aa
PE
9941 Improve tests for stack overflow in GLR parser.
9942 Problem reported by twlevo@xs4all.nl.
9943 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
9944 All uses removed.
9945 (yyStackOverflow): Just longjmp, but with value 2 so that caller
9946 can handle the problem.
9947 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
9948 (yyparse): New local variable yyresult to record the result.
9949 Use result of setjmp to set it, rather than storing itinto
9950 struct.
9951 (yyDone): Remove label.
9952 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
9953 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
9954 if YYABORT is used).
9955 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
9956 yyparse status; put status > 1 into diagnostic.
9957 Check that status==2 works.
9958 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
9959 Use exit status 3 for failure to open (which shouldn't happen).
9960
15f40952
PE
99612005-07-17 Paul Eggert <eggert@cs.ucla.edu>
9962
67fd79c4
PE
9963 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
9964 1 on syntax error; just let yyparse do its thing.
9965 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
9966 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
9967 (Exploding the Stack Size with Alloca):
9968 (Exploding the Stack Size with Malloc):
9969 Expect exit status 2, not 1, since the parser is supposed to blow
9970 its stack. Problem reported by twlevo@xs4all.nl.
9971
15f40952
PE
9972 * data/glr.c (yyparse): Don't assume that the initial calls
9973 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
9974 Print a stack-overflow message and fail instead.
9975 Initialize the line-number information before creating the stack,
9976 so that the stack-overflow message can report line zero safely.
9977
f32c66b5
PE
99782005-07-14 Paul Eggert <eggert@cs.ucla.edu>
9979
a22ff96f 9980 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
9981 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
9982 (yyuserMerge): Provide a default case if b4_mergers is empty.
9983 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
9984 * tests/glr-regression.at
9985 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 9986 Add casts to pacify C++ compilers.
1beb0b24
PE
9987 * tests/glr-regression.at (Improper merging of GLR delayed action
9988 sets): Declare yylex before using it.
f32c66b5 9989 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
9990 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
9991 test for valgrind; valgrind is independent of g++.
9992 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
9993 for compatibility with POSIX 1003.1-2001 (if running coreutils).
9994 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
9995 Use a destructor, so that we can expand the stack. Change
9996 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 9997
d741bd1b
PE
99982005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9999
10000 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
10001 a valgrind failure. Problem reported by twlevo@xs4all.nl.
10002
0410a6e0
PE
100032005-07-13 Paul Eggert <eggert@cs.ucla.edu>
10004
10005 * PACKAGING: New file, suggested by Bruno Haible and taken from
10006 similar wording in gettext's PACKAGING file.
10007 * NEWS: Mention PACKAGING.
10008 * Makefile.am (EXTRA_DIST): Add PACKAGING.
10009
f7ab6a50
PE
100102005-07-12 Paul Eggert <eggert@cs.ucla.edu>
10011
baf785db 10012 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
10013 * bootstrap: Get runtime translations into runtime-po.
10014 Create runtime-po files automatically, if possible.
10015 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
10016 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
10017 does not infringe on the user's name space.
10018 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
10019 * doc/bison.texinfo (Internationalization): Revamp the English
10020 and Texinfo syntax a bit, to try to make it clearer.
10021 (Bison Options, Option Cross Key): Mention --print-localedir.
10022 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
10023 YYENABLE_NLS. Quote a bit more.
10024 * runtime-po/.cvsignore: New file.
10025 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
10026 * runtime-po/Rules-quot: Remove; now created by bootstrap.
10027 * runtime-po/quot.sed: Likewise.
10028 * runtime-po/boldquot.sed: Likewise.
10029 * runtime-po/en@quot.header: Likewise.
10030 * runtime-po/en@boldquot.header: Likewise.
10031 * runtime-po/insert-header.sin: Likewise.
10032 * runtime-po/remove-potcdate.sin: Likewise.
10033 * runtime-po/Makevars: Likewise.
10034 * runtime-po/LINGUAS: Likewise.
10035 * runtime-po/de.po: Likewise; we will rely on the translation project
10036 to maintain this, so "bootstrap" should get it.
0410a6e0 10037 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
10038 its value.
10039 * src/main.c (main): Bind the bison-runtime domain, too.
10040
100412005-07-12 Bruno Haible <bruno@clisp.org>
10042
10043 * data/yacc.c: Include <libintl.h> when NLS is enabled.
10044 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
10045 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
10046 * runtime-po: New directory.
10047 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
10048 $(DOMAIN).pot-update rule, so that old messages are never dropped.
10049 * runtime-po/Rules-quot: New file, copied from po/.
10050 * runtime-po/quot.sed: Likewise.
10051 * runtime-po/boldquot.sed: Likewise.
10052 * runtime-po/en@quot.header: Likewise.
10053 * runtime-po/en@boldquot.header: Likewise.
10054 * runtime-po/insert-header.sin: Likewise.
10055 * runtime-po/remove-potcdate.sin: Likewise.
10056 * runtime-po/Makevars: New file.
10057 * runtime-po/POTFILES.in: New file.
10058 * runtime-po/LINGUAS: New file.
10059 * runtime-po/bison-runtime.pot: New file.
10060 * runtime-po/de.po: New file.
10061 * m4/bison.m4: New file.
10062 * Makefile.am (SUBDIRS): Add runtime-po.
10063 (aclocaldir, aclocal_DATA): New variables.
10064 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
10065 Define aclocaldir.
10066 * src/getargs.c (usage): Document --print-localedir option.
10067 (PRINT_LOCALEDIR_OPTION): New enum item.
10068 (long_options): Add --print-localedir option.
10069 (getargs): Handle --print-localedir option.
10070 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
10071 (Internationalization): New section.
10072
22dda0f0
AD
100732005-07-12 Akim Demaille <akim@epita.fr>
10074
10075 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
10076 for consistency with the rest of the code.
10077 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
10078 Add separators.
10079
82b248ad
AD
100802005-07-12 Akim Demaille <akim@epita.fr>
10081
10082 * src/parse-gram.y: Use %printer instead of YYPRINT.
10083
fa0e9314
AD
100842005-07-12 Akim Demaille <akim@epita.fr>
10085
867a3e00
AD
10086 * src/symtab.h, src/symtab.c (symbol_print): New.
10087 * src/symlist.h, src/symlist.c (symbol_list_print): New.
10088 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
10089
100902005-07-12 Akim Demaille <akim@epita.fr>
10091
10092 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
10093 b4_at_dollar and b4_dollar_dollar.
10094
e054b190
PE
100952005-07-11 Paul Eggert <eggert@cs.ucla.edu>
10096
10097 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
10098 and Pennello's paper.
10099
34160ec4
PE
101002005-07-09 Paul Eggert <eggert@cs.ucla.edu>
10101
407d4a75
PE
10102 * data/yacc.c (yyparse): Undo previous patch. Instead,
10103 set yylsp[0] and yyvsp[0] only if the initial action
10104 sets yylloc and yylval, respectively.
10105
34160ec4
PE
10106 * data/yacc.c (yyparse): In the initial action, set
10107 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
10108 This avoids the use of undefined variables if the initial
10109 action does not set yylloc and/or yylval.
10110
c3d5a4a7
PE
101112005-07-07 Paul Eggert <eggert@cs.ucla.edu>
10112
b34d96c1
PE
10113 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
10114 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
10115 Remove from CVS. These files are automatically generated.
10116 * examples/extexi: Clarify that this file is now part of Bison,
10117 not GNU M4, and that it works with any POSIX-compatible Awk.
10118 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
10119 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
10120 so that we also get calc++-parser.yy. Geneate it.
10121 Use $(AWK), not gawk, since any conforming Awk will do.
10122 Put comment before action, since older 'make' can't handle comment
10123 in action.
10124 $(BUILT_SOURCES): List all built sources, not just some of them.
10125 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
10126 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
10127 $($(calc_sources_generated)): Remove unnecessary test for existence
10128 of target. (This had a shell syntax error anyway; a stray "x".)
10129 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
10130 calc++-parser.yy.
10131 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
10132
c3d5a4a7
PE
10133 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
10134 implied by the other modules.
10135
828c373b
AD
101362005-07-06 Akim Demaille <akim@epita.fr>
10137
10138 Bind examples/calc++ to the package.
10139 * examples/calc++/Makefile: Remove, replaced by...
10140 * examples/calc++/Makefile.am: ... this new file.
10141 * examples/calc++/test: Remove input.
10142 * examples/calc++/compile: Remove.
10143 * examples/Makefile.am: New.
10144 * configure.ac, Makefile.am: Adjust.
10145 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
10146
63cb01d6
PE
101472005-07-05 Paul Eggert <eggert@cs.ucla.edu>
10148
fd2df2ed
PE
10149 * data/glr.c (yyFail): Drastically simplify; since the format argument
10150 never had any % directives, we can simply pass it to yyerror.
10151 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
10152 be modified later, as that is the usual style in glr.c.
10153 Problems reported by Paul Hilfinger.
10154
63cb01d6
PE
10155 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
10156 and size overflow errors.
10157 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
10158 in case the user prolog sets feature-test macros like _GNU_SOURCE.
10159 (YYSIZEMAX): New macro.
10160 (yystpcpy): New function, taken from yacc.c.
10161 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
10162 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
10163 so that we don't have to maintain their signatures.
10164 (yyFail): Check for buffer overflow, by using vsnprintf rather
10165 than vsprintf. Allocate a bigger buffer if possible.
10166 Report an error if buffer allocation fails.
10167 (yyStackOverflow): New function.
10168 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
10169 the initialization was successful. It might fail if storage was
10170 exhausted.
10171 (yyexpandGLRStack): Add more checks for storage allocation failure.
10172 Use yyStackOverflow to report failures.
10173 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
10174 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
10175 Don't assume stack number fits in int.
10176 (yysplitStack): Check for storage allocation failure.
10177 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
10178 can print diagnostics on storage allocation failure. All callers
10179 changed.
10180 (yyresolveValue): Use yybool for boolean.
10181 (yyreportSyntaxError): Check for size-calculation overflow.
10182 This code is taken from yacc.c.
10183 (yyparse): Check for storage allocation errors when allocating
10184 the initial stack.
10185
1c59e0a1
AD
101862005-07-05 Akim Demaille <akim@epita.fr>
10187
10188 Extract calc++ from the documentation.
10189 * doc/bison.texinfo (Calc++): Add the extraction marks.
10190 * examples/extexi: New, from the aborted GNU Programming 2E.
10191 Separate the different paragraph of a file with empty lines.
10192 * examples/Makefile: Use it to extract the whole calc++ example.
10193
8a0adb01
AD
101942005-06-24 Akim Demaille <akim@epita.fr>
10195
10196 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
10197 class typedefs.
10198
12545799
AD
101992005-06-22 Akim Demaille <akim@epita.fr>
10200
10201 * doc/bison.texinfo (C++ Language Interface): First stab.
10202 (C++ Parsers): Remove.
10203
99be0235
AD
102042005-06-22 Akim Demaille <akim@epita.fr>
10205
10206 * data/lalr1.cc (yylex_): Honor %lex-param.
10207
0ffd4fd1
AD
102082005-06-22 Akim Demaille <akim@epita.fr>
10209
10210 Start a set of simple examples.
10211 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
10212 * examples/calc++/calc++-driver.hh,
10213 * examples/calc++/calc++-parser.yy,
10214 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
10215 * examples/calc++/compile, examples/calc++/test: New.
10216
0925ebb4
PE
102172005-06-09 Paul Eggert <eggert@cs.ucla.edu>
10218
10219 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
10220 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
10221 which stems from the 2005-05-27 patch.
10222
43d3b664
PH
102232005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10224
10225 * data/glr.c: Modify treatment of unused parameters to permit use
10226 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
10227
3062864d
PE
102282005-05-30 Paul Eggert <eggert@cs.ucla.edu>
10229
10230 Fix infringement on user name space reported by Janos Zoltan Szabo.
10231 * data/yacc.c (yyparse): strlen -> yystrlen.
10232
989b5b8e
AD
102332005-05-30 Akim Demaille <akim@epita.fr>
10234
10235 * data/lalr1.cc (_): New.
10236 Translate the various messages.
10237
bedf57f5
PE
102382005-05-27 Paul Eggert <eggert@cs.ucla.edu>
10239
10240 Fix infringement on user name space reported by Bruno Haible.
10241 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
10242 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
10243 the user's name space.
10244 (alloca): Include <stdlib.h> to get it, if it's not built in.
10245 (YYMALLOC, YYFREE): Define only if needed.
10246 (malloc, free): Declare, but only if needed, as this infringes on
10247 the user name space.
10248
4d1801f1
PE
102492005-05-25 Paul Eggert <eggert@cs.ucla.edu>
10250
10251 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
10252 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
10253 with %d format.
10254 * lib/ebitset.c (min, max): Undef before defining.
10255 * lib/vbitset.c (min, max): Likewise.
10256 * lib/subpipe.c (create_subpipe): Save local variables in case
10257 vfork clobbers them.
10258
102592005-05-24 Bruno Haible <bruno@clisp.org>
10260
10261 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
10262 error message syntax used by gcc-4.0.
10263
b94a9e1e
PE
102642005-05-23 Paul Eggert <eggert@cs.ucla.edu>
10265
85ac3861
PE
10266 * README: Mention m4 1.4.3. Remove obsolete advice about
10267 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
10268
b94a9e1e
PE
10269 * bootstrap: Remove workaround for problem I encountered with
10270 gettext 0.14.1; it seems to be fixed now.
10271
51c30d21
PE
102722005-05-22 Paul Eggert <eggert@cs.ucla.edu>
10273
009ce67d
PE
10274 * NEWS: Version 2.0a.
10275
f2a97c62
PE
10276 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
10277 the previous change.
10278
c8775f93
PE
10279 Various maintainer cleanups.
10280 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
10281 conftest*, for benefit of CVS commands run at the same time as
10282 "configure". Add build-aux, since "bootstrap" now creates it and
10283 its subfiles.
10284 * Makefile.cfg (move_if_change): Remove.
10285 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
10286 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
10287 (po_repo, do-po-update, po-update, wget_files, get-targets):
10288 (config.guess-url_prefix, config.sub-url_prefix):
10289 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
10290 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
10291 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
10292 Remove.
10293 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
10294 this is now the recommended name.
10295 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
10296 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
10297 ylwrap. These files now go into build-aux.
10298 * config/move-if-change: Remove.
10299 * config/prev-version.txt: Bump from 1.75 to 2.0.
10300
3ea5f0ec
PE
10301 * bootstrap: Add stdio-safer, unistd-safer modules.
10302 Remove m4/glibc2.m4 (introduced by latest gnulib, but
10303 we don't need it).
10304 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
10305 fopen-safer.c, stdio-safer.h, unistd-safer.h.
10306 * lib/subpipe.c: Include "unistd-safer.h".
10307 (create_subpipe): Make sure all the newly-created
10308 file descriptors are > 2, so that diagnostics don't
10309 get sent down them (which might cause Bison to hang, in theory).
10310 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
10311 * src/files.c (xfopen): Use fopen_safer, not fopen.
10312
51c30d21
PE
10313 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
10314 yesterday's yacc.c fix.
10315
cea1469d
PE
103162005-05-21 Paul Eggert <eggert@cs.ucla.edu>
10317
3ea5f0ec
PE
10318 * data/glr.c, data/lalr1.cc: Update copyright date.
10319
cea1469d
PE
10320 Fix a destructor bug reported by Wolfgang Spraul in
10321 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
10322 * data/yacc.c (yyabortlab): Don't call destructor, and
10323 don't set yychar to EMPTY.
10324 (yyoverflowlab): Don't call destructor.
10325 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
10326 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
10327 since we no longer output the message "discarding lookahead token
10328 end of input ()".
10329
5e6f62f2
PH
103302005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10331
10332 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
10333 fix a small glitch in debugging output.
10334 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
10335 after YY_SYMBOL_PRINT where needed.
10336
10337 (struct yyGLRState): Add some comments.
10338 (struct yySemanticOption): Add some comments.
10339 (union yyGLRStackItem): Add comment.
10340
10341 (yymergeOptionSets): Correct this to properly perform the union,
10342 avoiding infinite reported by Michael Rosien.
10343 Update comment.
10344
10345 * tests/glr-regression.at: Add test for GLR merging error reported
10346 by M. Rosien.
cea1469d 10347
0fb669f9
PE
103482005-05-13 Paul Eggert <eggert@cs.ucla.edu>
10349
10350 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
10351 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
10352 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
10353 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
10354 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
10355 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
10356 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
10357 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
10358 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
10359 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
10360 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
10361 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
10362 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
10363 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
10364 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
10365 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
10366 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
10367 src/derives.h, src/files.c, src/files.h, src/getargs.c,
10368 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
10369 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
10370 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
10371 src/output.h, src/parse-gram.c, src/parse-gram.h,
10372 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
10373 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
10374 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
10375 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
10376 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
10377 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
10378 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
10379 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
10380 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
10381 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
10382 tests/reduce.at, tests/regression.at, tests/sets.at,
10383 tests/synclines.at, tests/testsuite.at, tests/torture.at:
10384 Update FSF postal mail address.
10385
51f4735e
PE
103862005-05-11 Paul Eggert <eggert@cs.ucla.edu>
10387
10388 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
10389 Problem reported by Ralf Menzel.
10390
80ce3401
PE
103912005-05-01 Paul Eggert <eggert@cs.ucla.edu>
10392
10393 * tests/actions.at: Test that stack overflow invokes destructors.
10394 From Marcus Holland-Moritz.
10395 * data/yacc.c (yyerrlab): Move the code that destroys the stack
10396 from here....
10397 (yyreturn): to here. That way, destructors are called properly
10398 even if the stack overflows, or the user calls YYACCEPT or
10399 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
10400 (yyoverflowlab): Destroy the lookahead.
10401
104022005-04-24 Paul Eggert <eggert@cs.ucla.edu>
10403
10404 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
10405
72f000b0
PE
104062005-04-17 Paul Eggert <eggert@cs.ucla.edu>
10407
10408 * NEWS: Bison-generated C parsers no longer quote literal strings
10409 associated with tokens.
10410 * src/output.c (prepare_symbols): Don't escape strings,
10411 since users don't want to see C escapes.
10412 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
10413 in diagnostics.
c19683bb 10414 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
10415 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
10416
1094323f
PE
104172005-04-16 Paul Eggert <eggert@cs.ucla.edu>
10418
10419 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
10420 the data size is known to be too small and we can't increase it.
10421 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
10422
ca407bdf
PE
104232005-04-15 Paul Eggert <eggert@cs.ucla.edu>
10424
10425 * src/parse-gram.y: Include quotearg.h.
10426 (string_as_id): Quote $1 before using it as a key, since the
10427 lexer no longer quotes it for us.
10428 (string_content): Don't strip quotes, since lexer no longer
10429 quotes it for us.
10430 * src/scan-gram.l: Include quotearg.h.
10431 ("\""): Omit quote.
10432 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
10433 a key, since the rest of the lexer doesn't quote it.
10434 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
10435 * tests/regression.at (Token definitions): Check for backslashes
10436 in token strings.
10437
10438 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
10439 (YYSIZE_T): Define to unsigned long int when using an older compiler.
10440 (yyparse): Revamp code to generate long syntax error message, to
10441 make it easier to translate, and to avoid problems with arithmetic
10442 overflow. Change "virtual memory" to "memory" in diagnostic, since
10443 we don't know whether the memory is virtual.
10444
1ce59070
PE
104452005-04-13 Paul Eggert <eggert@cs.ucla.edu>
10446
10447 * NEWS: Bison-generated C parsers now use the _ macro to
10448 translate strings.
10449 * data/yacc.c (_) [!defined _]: New macro.
10450 All English strings wrapped inside this macro.
10451 * doc/bison.texinfo (Bison Parser): Document _.
10452 * po/POTFILES.in: Include src/parse-gram.c, since it now
10453 includes translateable strings that parse-gram.y doesn't.
10454
a749a695
PE
104552005-04-12 Paul Eggert <eggert@cs.ucla.edu>
10456
10457 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
10458 reverting the 2004-10-11 change to this function.
10459 (symbol_check_alias_consistency): Don't call symbol_type_set
10460 if the type name is already correct.
10461 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
10462
8fb1053b
PE
104632005-03-25 Paul Eggert <eggert@cs.ucla.edu>
10464
10465 * tests/regression.at (Token definitions): Don't use a token named
10466 c, as that generates a "#define c ..." that runs afoul of buggy
10467 stdlib.h that uses the identifier c as a member of struct
10468 drand48_data. Problem reported by Horst Wente.
10469
ff498c4a
PE
104702005-03-21 Paul Eggert <eggert@cs.ucla.edu>
10471
10472 * bootstrap: Change translation URL from
10473 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
10474 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
10475 redirection glitches. Problem reported by twlevo@xs4all.nl.
10476
65211d70
PE
104772005-03-20 Paul Eggert <eggert@cs.ucla.edu>
10478
10479 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
10480 after operands; POSIX says this isn't portable for the c99 command.
10481
9577fb1f
PE
104822005-03-18 Paul Eggert <eggert@cs.ucla.edu>
10483
10484 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
10485 immediately if a data overrun has occurred; this may help us track
10486 down what may be a spurious failure on MacOS.
10487
78b178f7
PE
104882005-03-17 Paul Eggert <eggert@cs.ucla.edu>
10489
a2599d0f
PE
10490 Respond to problems reported by twlevo@xs4all.nl.
10491
10492 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
10493
78b178f7
PE
10494 * src/vcg.h: Comment fix.
10495 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
10496 (G_CMAX): Change to -1 instead of INT_MAX.
10497
10498 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 10499
7296e729
PE
105002005-03-15 Paul Eggert <eggert@cs.ucla.edu>
10501
10502 * src/tables.c (state_number_to_vector_number): Put it inside an
10503 "#if 0", since it's not currently used. Problem reported by
10504 Roland McGrath.
10505
05ac60f3
PE
105062005-03-06 Paul Eggert <eggert@cs.ucla.edu>
10507
10508 * src/output.c (escaped_output): Renamed from
10509 escaped_file_name_output, since we now use it for symbol tags as
10510 well. All uses changed.
10511 (symbol_destructors_output, symbol_printers_output):
10512 Escape symbol tags too.
10513 Problem reported by Matyas Forstner in
10514 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
10515
10516 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
10517 not needed.
10518 * src/output.c (user_actions_output, token_definitions_output,
10519 symbol_destructors_output, symbol_printers_output): Likewise.
10520 * src/reader.c (prologue_augment): Likewise.
10521 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
10522
10523 * src/vcg.c (output_edge): Don't quote linestyle arg.
10524 Problem reported by twlevo@xs4all.nl.
10525
7eb453ac
PE
105262005-02-28 Paul Eggert <eggert@cs.ucla.edu>
10527
10528 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
10529 example, reported by Derek M Jones. Also, make the example even
10530 more outrageous, to better illustrate how bad the problem is.
10531
4c04c52a
PE
105322005-02-24 Paul Eggert <eggert@cs.ucla.edu>
10533
10534 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
10535 putsym. Typo reported by Sebastian Piping.
10536
a61e1620
PE
105372005-02-23 Paul Eggert <eggert@cs.ucla.edu>
10538
10539 * doc/bison.texinfo (Language and Grammar): some -> same
10540 (Epilogue): int he -> in the
10541 Typos reported by Sebastian Piping via Justin Pence.
10542
9ec93868
PE
105432005-02-07 Paul Eggert <eggert@cs.ucla.edu>
10544
10545 * tests/glr-regression.at (Improper handling of embedded actions
10546 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
10547 embedded actions and $-N in GLR parsers", work around an Autoconf bug
10548 with dollar signs in test names.
10549 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
10550 for a similar reason.
10551
73ce7e7e
PE
105522005-01-28 Paul Eggert <eggert@cs.ucla.edu>
10553
10554 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
10555 wants to redefine G_VIEW.
10556
2e72b98e
PE
105572005-01-27 Paul Eggert <eggert@cs.ucla.edu>
10558
10559 * src/vcg.c (get_view_str): Remove case for normal_view.
10560 Problem reported by twlevo@xs4all.nl.
10561
e0d634e5
PE
105622005-01-24 Paul Eggert <eggert@cs.ucla.edu>
10563
ccf830a4
PE
10564 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
10565 Problem reported by twlevo@xs4all.nl.
10566
e0d634e5
PE
10567 * doc/bison.texinfo: Change @dircategory from "GNU programming
10568 tools" to "Software development". Requested by Richard Stallman
10569 via Karl Berry.
10570
7bbc8cb0
PE
105712005-01-23 Paul Eggert <eggert@cs.ucla.edu>
10572
10573 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
10574 Problem reported by twlevo@xs4all.nl.
10575
08b770bc
PE
105762005-01-21 Paul Eggert <eggert@cs.ucla.edu>
10577
10578 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
10579 keyword; it's not needed with modern compilers, and it doesn't
10580 affect correctness with older compilers. Suggested by
10581 twlevo@xs4all.nl.
10582
95f22ad2
PE
105832005-01-17 Paul Eggert <eggert@cs.ucla.edu>
10584
10585 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
10586 gcc -Wswitch-default.
10587 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
10588 * data/yacc.c (yyparse): Likewise.
10589
d229d15c
PE
105902005-01-12 Paul Eggert <eggert@cs.ucla.edu>
10591
10592 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
10593 already. Let config.h define any nonstandard values.
10594
ecadd90f
PE
105952005-01-10 Paul Eggert <eggert@cs.ucla.edu>
10596
10597 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
10598 for the benefit of slower hosts. Problem reported by
10599 Nelson H. F. Beebe.
10600
213744b5
PE
106012005-01-07 Paul Eggert <eggert@cs.ucla.edu>
10602
10603 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
10604 being defined and not used.
10605 * data/lalr1.cc (yyparse): Likewise.
10606 Use "if (false)" rather than "if (0)".
10607
249d3236
PE
106082005-01-05 Paul Eggert <eggert@cs.ucla.edu>
10609
10610 * TODO: Mention that we should allow NUL bytes in tokens.
10611
987cc1fb
PE
106122005-01-02 Paul Eggert <eggert@cs.ucla.edu>
10613
10614 * src/scan-skel.l (<<EOF>>): Don't close standard output.
10615 Problem reported by Hans Aberg.
10616
08fe02d9
PE
106172005-01-01 Paul Eggert <eggert@cs.ucla.edu>
10618
10619 * src/getargs.c (version): Happy new year; update overall
10620 program copyright date from 2004 to 2005.
10621
10622 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
10623 Problem reported by Hans Aberg.
10624 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
10625 (Output file names.): Add a test for the case when standard output
10626 is closed.
10627
010c0266
PE
106282004-12-26 Paul Eggert <eggert@cs.ucla.edu>
10629
10630 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
10631 to fix an oversight in the Bison 2.0 manual.
10632
da12206a
PE
106332004-12-25 Paul Eggert <eggert@cs.ucla.edu>
10634
10635 * NEWS: Version 2.0. Reformat the existing news items since
10636 1.875, so that related items are grouped together.
3a4734aa 10637 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
10638 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
10639
c935d934
PE
10640 * tests/torture.at (Exploding the Stack Size with Alloca): Set
10641 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
10642 otherwise, we're not testing alloca. Unfortunately there's no
10643 simple way to consult HAVE_ALLOCA here.
10644
da12206a
PE
10645 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
10646 for yymsg, too.
10647
10648 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
10649 hand. This avoids a warning about comparing int to size_t when
10650 GCC warnings are enabled.
10651
0a2c5137
PE
106522004-12-22 Paul Eggert <eggert@cs.ucla.edu>
10653
d7e14fc0
PE
10654 * NEWS: Bison-generated parsers no longer default to using the
10655 alloca function (when available) to extend the parser stack, due
10656 to widespread problems in unchecked stack-overflow detection.
10657 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
10658 responsibility to set it to a positive value. This lets the user
10659 specify a value that is not a preprocessor constant.
10660 * data/yacc.c (YYMAXDEPTH): Likewise.
10661 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
10662 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
10663 to be a compile-time constant. However, explain the constraints on it.
10664 Also, explain the constraints on YYINITDEPTH.
10665 (Table of Symbols): Explain that alloca is no longer the default.
10666 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
10667 to 1.
10668
0a2c5137
PE
10669 * doc/bison.texinfo (Location Default Action): Mention that n must
10670 be zero when k is zero. Suggested by Frank Heckenbach.
10671
e019c247
AD
106722004-12-22 Akim Demaille <akim@epita.fr>
10673
10674 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
10675 (parser::state_type, parser::semantic_type, parser::location_type):
10676 Private, not public.
10677 (parser::parse): Return ints, not bool.
10678 Returning a bool introduces a problem: 0 corresponds to false, and
10679 it seems weird to return false on success. Returning true changes
10680 the conventions for yyparse.
10681 Alternatively we could return void and send an exception.
10682 There is no clear consensus (yet?).
10683 (state_stack, semantic_stack, location_stack): Rename as...
10684 (state_stack_type, semantic_stack_type, location_stack_type): these.
10685 Private, not public.
10686 * tests/c++.at: New.
10687 * tests/testsuite.at, tests/Makefile.am: Adjust.
10688
72731bb7
AD
106892004-12-21 Akim Demaille <akim@epita.fr>
10690
10691 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
10692
9a0d8bec
AD
106932004-12-21 Akim Demaille <akim@epita.fr>
10694
10695 Don't impose std::string for filenames.
10696
10697 * data/lalr1.cc (b4_filename_type): New.
10698 (position::filename): Use it.
10699 (parser.hh): Move the inclusion of stack.hh and location.hh below
10700 the user code, so that needed headers for the filename type can be
10701 included first.
72731bb7
AD
10702 Forward declare them before the user code.
10703 * tests/Makefile.am (check-local, installcheck-local): Pass
10704 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 10705
99880de5
AD
107062004-12-20 Akim Demaille <akim@epita.fr>
10707
10708 Use more STL like names: my_class instead of MyClass.
10709
10710 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
10711 (SemanticStack, SemanticType, StateStack, StateType)
10712 (TokenNumberType, Stack, Slice, Traits, Parser::location)
10713 (Parser::value): Rename as...
10714 (location_stack, location_type, rhs_number_type, semantic_stack)
10715 (semantic_type, state_stack, state_type, token_number_type, stack)
10716 (slice, traits, parser::yylloc, parser::yylval): these.
10717
10718 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
10719
9bec482e
PE
107202004-12-19 Paul Eggert <eggert@cs.ucla.edu>
10721
10722 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
10723 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
10724
f6fbd3da
PE
107252004-12-17 Paul Eggert <eggert@cs.ucla.edu>
10726
10727 Remove uses of 'short int' and 'unsigned short int'. This raises
10728 some arbitrary limits. It uses more memory but nowadays that's
10729 not much of an issue.
10730
10731 This change does not affect the generated parsers; that's a different
10732 task, as some users will want to conserve memory there.
10733
10734 Ideally we should use size_t to represent all object counts, and
10735 something like ptrdiff_t to represent signed differences of object
10736 counts; but that will require more code-cleanup than I have the
10737 time to do right now.
10738
10739 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
10740 Use size_t, not int or short int, to count objects.
10741 * src/closure.c (nritemset, closure): Likewise.
10742 * src/closure.h (nritemset, closure): Likewise.
10743 * src/nullable.c (nullable_compute): Likewise.
10744 * src/print.c (print_core): Likewise.
10745 * src/print_graph.c (print_core): Likewise.
10746 * src/state.c (state_compare, state_hash): Likewise.
10747 * src/state.h (struct state): Likewise.
10748 * src/tables.c (default_goto, goto_actions): Likewise.
10749
10750 * src/gram.h (rule_number, rule): Use int, not short int.
10751 * src/output.c (prepare_rules): Likewise.
10752 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
10753 errs, reductions): Likewise.
10754 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
10755 Likewise.
10756 * src/tables.c (vector_number, tally, action_number,
10757 ACTION_NUMBER_MINIMUM): Likewise.
10758 * src/output.c (muscle_insert_short_int_table): Remove.
10759
efeed023
AD
107602004-12-17 Akim Demaille <akim@epita.fr>
10761
10762 * data/lalr1.cc: Extensive Doxygenation.
10763 (error_): Rename as...
10764 (error): this, since it is visible to the user.
10765 Adjust callers.
10766 (Parser::message): Now an automatic variable from...
10767 (Parser::yyreport_syntax_error_): here.
10768 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
10769 Parser::error.
10770 * tests/input.at: Escape $.
10771
bc82c5a5
PE
107722004-12-16 Paul Eggert <eggert@cs.ucla.edu>
10773
10774 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
10775 Parenthesize rhs to avoid obscure problems with mistakes like
10776 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
10777 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
10778 b4_rhs_location): Likewise.
10779 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
10780 b4_rhs_location): Likewise.
10781
fd19f271
AD
107822004-12-16 Akim Demaille <akim@epita.fr>
10783
10784 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
10785 yacc.c: be sure to stay within yycheck_.
10786 * tests/actions.at: Re-enable C++ tests.
10787
10454ea4
AD
107882004-12-16 Akim Demaille <akim@epita.fr>
10789
10790 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
10791 real.
10792
c5b95ccf
AD
107932004-12-16 Akim Demaille <akim@epita.fr>
10794
10795 Use #define to handle the %name-prefix.
10796
10797 * data/glr.c, data/yacc.c: Comment changes.
10798 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
10799 so that one can refer to yylex in the parser file, and have it
10800 renamed, as is the case with other skeletons.
10801
617a8f12
AD
108022004-12-16 Akim Demaille <akim@epita.fr>
10803
10804 Move lalr1.cc internals into yy*.
10805
10806 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
10807 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
10808 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
10809 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
10810 (empty_, final_, terror_, errcode_, ntokens_)
10811 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
10812 (looka_, ilooka_, error_range_, nerrs_):
10813 Rename as...
10814 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
10815 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
10816 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
10817 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
10818 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
10819 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
10820 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
10821 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
10822 these.
10823
1e547e6e
PE
108242004-12-15 Paul Eggert <eggert@cs.ucla.edu>
10825
10826 Fix some problems reported by twlevo at xs4all.
10827 * src/symtab.c (symbol_new): Report an error if the input grammar
10828 contains too many symbols. This is better than calling abort() later.
10829 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
10830 (struct node, struct graph):
10831 Rename member expand to stretch. All uses changed.
10832 (struct graph): Remove member layoutalgorithm. All uses removed.
10833 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
10834 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
10835 All uses changed.
10836 (N_STRETCH): Rename from N_EXPAND. All uses changed.
10837
735d6bd4
AD
108382004-12-15 Akim Demaille <akim@epita.fr>
10839
10840 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
10841 Add more Doxygen comments.
10842 (symprint_, stack_print_, reduce_print_, destruct_, pop)
10843 (report_syntax_error_, translate_): Rename as...
10844 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
10845 (yypop_, yyreport_syntax_error_, yytranslate_): this.
10846
2e1f5829
AD
108472004-12-15 Akim Demaille <akim@epita.fr>
10848
10849 * data/lalr1.cc (lex_): Rename as...
10850 (yylex_): this.
10851 Move the trace here.
10852 Take the %name-prefix into account.
10853 Reported by Alexandre Duret-Lutz.
10854
a3cb6248
AD
108552004-12-15 Akim Demaille <akim@epita.fr>
10856
10857 Simplify the C++ parser constructor.
10858
10859 * data/lalr1.cc (debug_): Rename as...
10860 (yydebug_): so that the parser's internals are always in the yy*
10861 pseudo namespace.
10862 Adjust uses.
10863 (b4_parse_param_decl): Remove the leading comma as it is now only
10864 called as unique argument list.
10865 (Parser::Parser): Remove the constructor accepting a location and
10866 an initial debugging level.
10867 Remove from the other ctor the argument for the debugging level.
10868 (debug_level_type, debug_level, set_debug_level): New.
10869
10870 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
10871 constructor calls.
10872
07fed891
AD
108732004-12-15 Akim Demaille <akim@epita.fr>
10874
10875 Remove b4_root related material: failure experiment
a3cb6248 10876 (which goal was to allow to derive from a class).
07fed891
AD
10877
10878 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
10879 definitions and uses.
10880
e603eaa5
PE
108812004-12-14 Paul Eggert <eggert@cs.ucla.edu>
10882
10883 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
10884 not 2, since it's not portable to subtract 1 from the start of an
10885 array. The new item 0 is never set or used. All uses changed.
10886
10887 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
10888 the default definition of YYLLOC_DEFAULT. Problem reported
10889 by Frank Heckenbach.
10890
fafb007d
PE
108912004-12-12 Paul Eggert <eggert@cs.ucla.edu>
10892
10893 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
10894 the normal case and one for the error case. Just use the
10895 first one uniformly. Problem reported by Frank Heckenbach.
10896 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
10897 use exactly the same macro in both places.
10898 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
10899 so that the normal-case YYRHSLOC works for the error case too.
10900 All uses changed.
10901 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
10902 (YYLLOC_DEFAULT): Use the same macro as glr.c.
10903 * doc/bison.texinfo (Location Default Action): Don't claim that
10904 we have an array of locations. Use the same macro for both glr
10905 and lalr parsers. Mention YYRHSLOC. Mention what happens when
10906 the index is 0.
10907
48814dcd
PE
109082004-12-10 Paul Eggert <eggert@cs.ucla.edu>
10909
a4e1a53b
PE
10910 * HACKING: Update email addresses to send announcements to.
10911
48814dcd
PE
10912 * configure.ac (AC_INIT): Bump version to 1.875f.
10913
337116ba
PE
109142004-12-10 Paul Eggert <eggert@cs.ucla.edu>
10915
10916 * NEWS: Version 1.875e.
10917 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
10918
10919 * src/scan-skel.l: Include "complain.h", for "fatal".
10920
10921 * src/relation.h (relation_print, relation_digraph):
10922 Relation sizes are of type relation_node, not size_t (this is
10923 merely a doc fix, since the two types are equivalent).
10924 (relation_transpose): Relation sizes are of type relation_node,
10925 not int.
10926 * src/relation.c: Likewise.
10927 (top, infinity): Now of type relation_node, not int.
10928 (traverse, relation_transpose): Use relation_node, not int.
10929
10930 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
10931 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
10932 (yyparse): Remove unused local introduced in 2004-10-25 patch.
10933
10934 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 10935 specifying whether the test should be skipped. Use it tp
337116ba 10936 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 10937 fail on some hosts, and should be skipped.
337116ba 10938
da2a7671
PE
109392004-12-08 Paul Eggert <eggert@cs.ucla.edu>
10940
10941 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
10942 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
10943 unless otherwise specified below.
10944
10945 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
10946 to allocate kernel_base, kernel_items, kernel_size, since
10947 they needn't be initialized to 0.
10948 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
10949 * src/closure.c (new_closure): Likewise, for itemset.
10950 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
10951 * src/lalr.c (set_goto_map): Likewise, for temp_map.
10952 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
10953 (build_relations): Likewise for edge, states1, includes.
10954 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
10955 * src/reader.c (packgram): Likewise, for ritem, rules.
10956 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
10957 * src/relation.c (relation_digraph): Likewise for VERTICES.
10958 (relation_transpose): Likewise for new_R, end_R.
10959 * src/symtab.c (symbols_token_translations_init): Likewise for
10960 token_translations.
10961 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
10962 (token_actions): Likewise for yydefact, actrow, conflrow,
10963 conflict_list.
10964 (save_column): Likewise for froms[symno], tos[symno].
10965 (goto_actions): Likewise for state_count.
10966 (pack_table): Likewise for base, pos, check.
10967 (tables_generate): Likewise for width.
10968
10969 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
10970 for initial core. Just have a separate core, so we needn't worry
10971 about whether kernel_size and kernel_base are initialized.
10972
10973 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
10974 kernel_size, kernel_items): Remove unnecessary initialization.
10975 * src/conflicts.c (conflicts): Likewise.
10976 * src/derives.c (derives): Likewise.
10977 * src/muscle_tablc (muscle_insert): Likewise.
10978 * src/relation.c (relation_digraph): Likewise.
10979 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
10980 conflrow, conflict_table, conflict_list, table, check):
10981 Likewise.
10982
10983 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
10984 This is because all callers pass unsigned int.
10985 * src/closure.h (new_closure): Likewise.
10986
10987 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
10988 (build_relations): Initialize includes[i] in all cases.
10989 * src/reader.c (packgram): Always initialize rules[ruleno].prec
10990 and rules[ruleno].precsym. Initialize members in order.
10991 * src/relation.c (relation_transpose): Always initialize new_R[i]
10992 and end_R[i].
10993 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
10994
10995 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
10996 conflict_list[0] was always 0, but now it isn't initialized.
10997
10998 * src/table.c (table_grow): When conflict_table grew, the grown
10999 area wasn't cleared. Fix this.
11000
11001 * lib/.cvsignore: Add strdup.c, strdup.h.
11002 * m4/.cvsignore: Add strdup.m4.
11003
00baeeac
PE
110042004-12-07 Paul Eggert <eggert@cs.ucla.edu>
11005
11006 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
11007 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
11008 GOTO_NUMBER_MAXIMUM, since we occasionally compute
11009 ngotos + 1 without checking for overflow.
11010 (build_relations): Use END_NODE, not -1, to denote end of edges.
11011 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
11012 build_relations): Use goto_number, not int, for goto numbers.
11013 * src/tables.c (save_column, default_goto): Likewise.
11014
be3d9d42
AD
110152004-11-23 Akim Demaille <akim@epita.fr>
11016
11017 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
11018 of #defining from yystype.
11019 Don't typedef yystype, C++ does not need it.
11020 This lets it possible to forward declare it as union.
11021
78e526d5
PE
110222004-11-23 Paul Eggert <eggert@cs.ucla.edu>
11023
11024 * bootstrap (gnulib_modules): Add extensions.
11025 Problem reported by Jim Meyering.
11026
afbb696d
PE
110272004-11-22 Paul Eggert <eggert@cs.ucla.edu>
11028
11029 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
11030 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
11031 src/system.h, src/tables.c: XFREE -> free, to accommodate
11032 recent change to gnulib xalloc.h.
78e526d5 11033 Problem reported by Jim Meyering.
afbb696d 11034
c1f8f16a
AD
110352004-11-17 Akim Demaille <akim@epita.fr>
11036
11037 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
11038
db7e5eb5 110392004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
11040 Alexandre Duret-Lutz <adl@gnu.org>
11041
11042 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
11043 changes.
11044 (YYCDEBUG): Adjust.
11045 Use it instead of cdebug_.
11046 (Parser::debug_stream, Parser::set_debug_stream): New.
11047 (Parser::symprint_): Define cdebug_ for temporary backward
11048 compatibility.
11049 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
11050 debug_stream ().
11051
68e11668
AD
110522004-11-17 Akim Demaille <akim@epita.fr>
11053
11054 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
11055 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
11056 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
11057 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
11058
97cbc73e
PE
110592004-10-27 Paul Eggert <eggert@cs.ucla.edu>
11060
11061 * data/glr.c (yyloc_default): Remove; not used.
11062 Problem reported by Frank Heckenbach.
11063
e342c3be
AD
110642004-10-25 Akim Demaille <akim@epita.fr>
11065
11066 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
11067 Introduce another definition to address simple location arrays.
11068 (yyGLRStack): New member: yyerror_range.
11069 (yyrecoverSyntaxError, yyparse): Update it.
11070 (yyrecoverSyntaxError): Use it when shifting the error token to
11071 have an accurate range, equivalent to the one computed by both
11072 yacc.c and lalr1.cc.
11073 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
11074 that column numbers start at column 0, as per GNU Coding
11075 Standards, the others tests, and the doc.
11076 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
11077 Adjust to the above change (first column is 0).
11078 And adjust the location of the "<error>", now covering the whole
11079 line.
11080
93602feb 110812004-10-22 Akim Demaille <akim@epita.fr>
04098407 11082 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
11083
11084 Remove some arbitrary limits on goto numbers and relations.
11085 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
11086 initial values, since they're never used.
11087 (set_goto_map): ngotos is now unsigned, so test for overflow
11088 by seeing whether it wraps around to zero.
11089 * src/lalr.h (goto_number): Now size_t, not short int.
11090 (GOTO_NUMBER_MAXIMUM): Remove.
11091 * src/relation.c (relation_print, traverse, relation_transpose):
11092 Check for END_NODE rather than looking at sign.
11093 * src/relation.h (END_NODE): New macro.
11094 (relation_node): Now size_t, not short int.
11095
dba08b04
PE
110962004-10-22 Paul Eggert <eggert@cs.ucla.edu>
11097
11098 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
11099 keyword, not an identifier. Problem reported by Baron Schwartz in
11100 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
11101
df09ef2e
AD
111022004-10-11 Akim Demaille <akim@epita.fr>
11103
11104 * src/symtab.c (symbol_check_alias_consistency): Also check
11105 type names, destructors, and printers.
11106 Reported by Alexandre Duret-Lutz.
11107 Recode the handling of associativity and precedence in terms
11108 of symbol_precedence_set.
11109 Accept no redeclaration at all, not even equal to the previous
11110 value.
11111 (redeclaration): New.
11112 Use it to factor redeclaration complaints.
11113 (symbol_make_alias): Don't set the type of the alias, let
11114 symbol_check_alias_consistency do it as for other features.
11115 * src/symtab.h (symbol): Add new member prec_location, and
11116 type_location.
11117 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
11118 * tests/input.at (Incompatible Aliases): New.
11119
146bc99d
PE
111202004-10-09 Paul Eggert <eggert@cs.ucla.edu>
11121
11122 .cvsignore fixes to accommodate gnulib changes,
11123 and the practice of naming build directories "_build".
11124 * .cvsignore: Add "_*". Sort.
11125 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
11126 * m4/.cvsignore: Add "*_gl.m4".
11127
e503aa60
AD
111282004-10-06 Akim Demaille <akim@epita.fr>
11129
11130 * src/parse-gram.y (add_param): Fix the truncation of trailing
11131 spaces.
11132
b4a20338
AD
111332004-10-05 Akim Demaille <akim@epita.fr>
11134
11135 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
11136 whether the reducion was empty or not. This leaves room to
11137 improve the use of YYLLOC_DEFAULT in such a case.
11138 lalr1.cc is still experimental, so changing this is acceptable.
11139 And finally, there are probably not many users who changed the
11140 handling of locations in GLR, so changing is admissible too.
11141
11142 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
11143 empty reduction, set @$ to an empty location ending the previously
11144 stacked symbol.
11145 Adjust uses to make sure the code is triggered on empty
11146 reductions.
11147 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
11148 expected output: empty reductions have empty locations.
11149
f85a5e6f
AD
111502004-09-29 Akim Demaille <akim@epita.fr>
11151
11152 * data/lalr1.cc: Move towards a more standard C++ coding style
11153 for templates: Class < T > -> Class<T>.
11154
b203fc2c
AD
111552004-09-29 Akim Demaille <akim@epita.fr>
11156
11157 * data/lalr1.cc: Reinstall the former ctor, for sake of
11158 compatibility, but warn it will be removed.
11159 Move towards a more standard C++ coding style (i.e., type *var ->
11160 type* var).
11161
5b7e1e73
PE
111622004-09-27 Paul Eggert <eggert@cs.ucla.edu>
11163
3fee967f
PE
11164 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
11165 since it's less likely to work if NULs are involved in the future.
5b7e1e73 11166
0dcca5c2
AD
111672004-09-27 Akim Demaille <akim@epita.fr>
11168
11169 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
11170
6dde1c82
AD
111712004-09-27 Akim Demaille <akim@epita.fr>
11172
11173 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 11174 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
11175 and argument names.
11176 (b4_cc_constructor_call): Likewise.
11177
b233d555
AD
111782004-09-24 Akim Demaille <akim@epita.fr>
11179
11180 * src/parse-gram.y (add_param): Strip the leading and trailing
11181 blanks from a formal argument declaration.
11182 (YY_LOCATION_PRINT): New.
11183
619404e3
AD
111842004-09-24 Akim Demaille <akim@epita.fr>
11185
11186 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
11187 after the location.
11188
dd8d9022
AD
111892004-09-24 Akim Demaille <akim@epita.fr>
11190
11191 * doc/bison.texinfo (Table of Symbols): Sort.
11192
0092f063
AD
111932004-09-21 Akim Demaille <akim@epita.fr>
11194
11195 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
11196 the useless parentheses.
11197 Suggested by Paul Eggert.
11198
451364ed
AD
111992004-09-20 Akim Demaille <akim@epita.fr>
11200
11201 Let the initial-action act on the look-ahead, and use it for the
11202 "initial push" (corresponding to an hypothetical beginning-of-file).
11203 And let lalr1.cc honor %initial-action.
11204
11205 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
11206 example.
11207 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
11208 (Parser::Parser): Remove the ctor that used to initialize it.
11209 (Parser::parse): Like in the other skeletons, issue the "starting
11210 parse" message before any action.
11211 Honor %initial-action.
11212 Initialize the stacks with the lookahead.
11213 * data/yacc.c: Let $$ and @$ in %initial-action designate the
11214 look-ahead.
11215 Push them in the stacks.
11216 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
11217
18d192f0
AD
112182004-09-20 Akim Demaille <akim@epita.fr>
11219
11220 * doc/bison.texinfo (Initial Action Decl): New.
11221
b8458aa5
AD
112222004-09-20 Akim Demaille <akim@epita.fr>
11223
11224 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
11225 clearer criterion to define it.
11226 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
11227 When reducing on an empty RHS, use the latest stacked location as
11228 location.
11229 yylloc is not always available.
11230 * data/glr.c: Likewise.
11231 Also, honor initial-actions.
11232
3fc16193
AD
112332004-09-20 Akim Demaille <akim@epita.fr>
11234
11235 * data/yacc.c (YY_LOCATION_PRINT): New.
11236 Define when we know YYLTYPE's structure, i.e., when the default
11237 YYLLOC_DEFAULT is used.
11238 * data/c.m4 (b4_yysymprint_generate): Use it.
11239 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
11240 value of the result.
11241 (error_start_): Replace with...
11242 (error_range_): this location array.
11243 This allows to replace code relying on the implementation of
11244 locations by portable code.
11245 * data/yacc.c (yylerrsp): Replace with...
11246 (yyerror_range): this.
11247 Every time a token is popped, update yyerror_range[0], to have an
11248 accurate location for the error token.
11249 * data/glr.c (YY_LOCATION_PRINT): New.
11250 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
11251 deference a pointer.
11252 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
11253 report the location in %printers.
11254
11255 * src/scan-skel.l: Instead of abort, report error messages to ease
11256 understanding skeleton scanning failures.
11257
ecfe33e7
AD
112582004-09-16 Akim Demaille <akim@epita.fr>
11259
11260 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
11261 (iterator, const_iterator): these, to be more in the C++ spirit.
11262 Also, return reverse iterators so that when displaying the stack
11263 we display its bottom first.
11264 (Parser::stack_print_, Parser::reduce_print_): Match the messages
11265 from yacc.c.
11266 We should probably use vector here though.
11267
1576d44d
AD
112682004-09-16 Akim Demaille <akim@epita.fr>
11269
11270 Have more complete shift traces.
11271
11272 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
11273 to report Shifts instead of ad hoc YYDPRINTF invocations,
11274 including for the error token.
11275 * data/lalr1.cc (symprint_): Output the location.
11276 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
11277 output the location within the %printer.
11278 Activate GLR tests, at least to make sure they compile properly.
11279 They still don't pass though.
11280 * tests/calc.at: Adjust expect verbose output, since now "Entering
11281 state..." is on a different line than the "Shifting" message.
11282
9c66f418
AD
112832004-09-08 Akim Demaille <akim@epita.fr>
11284
11285 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
11286 Bison directive from the Bison file to the invocation of this
11287 macro, so that these directives are passed to
11288 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
11289 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
11290 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
11291 the extra Bison directives instead of the whole series.
11292 Change the grammar so that there are recoverable errors, and
11293 unrecoverable errors. Now we can have the parser give up before
11294 consuming the whole input. As a result we now can observe that
11295 the lookahead is freed when needed.
11296 Change the parser source to parse argv[1] instead of a hard coded
11297 string.
11298 Simplify yylex, and give a value and location to EOF.
11299 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
11300 passed directives already coded in the file.
11301 Add some tests to check the location of "error".
11302 For some tests, the C++ parser is correct, and not yacc.c.
11303 For other tests, they provide different, but unsatisfying, values,
11304 so keep the C++ value so that at least one parser is "correct"
11305 according to the test suite.
11306 (Actions after errors): Remove, this is subsumed by the
11307 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
11308
52d5733f
AD
113092004-09-06 Akim Demaille <akim@epita.fr>
11310
11311 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 11312 (Parser::pop): New.
52d5733f
AD
11313 Use it.
11314
a0e68930
AD
113152004-09-06 Akim Demaille <akim@epita.fr>
11316
11317 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
11318 argument, an informative message.
11319 Call YY_SYMBOL_PRINT.
11320 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
11321 * data/lalr1.cc (destruct_): Likewise.
11322 In addition, no longer depend on b4_yysymprint_generate and
11323 b4_yydestruct_generate to generate these functions, do it "by
11324 hand".
11325
e757bb10
AD
113262004-09-03 Akim Demaille <akim@epita.fr>
11327
11328 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
11329 invoked, yydestruct the lookahead.
11330 * tests/calc.at (Calculator $1): Update the expected lengths of
11331 traces: there is an added line for the discarded lookahead.
11332 * doc/bison.texinfo (Destructor Decl): Some rewording.
11333 Define "discarded" symbols.
11334
0fe1f06d
AD
113352004-09-02 Akim Demaille <akim@epita.fr>
11336
11337 * data/lalr1.cc (translate_, destruct_): No reason to be static.
11338
284acc8b
AD
113392004-09-02 Akim Demaille <akim@epita.fr>
11340
11341 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
11342 (YYDSYMPRINTF): Rename as...
11343 (YY_SYMBOL_PRINT): this.
11344 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
11345 two.
11346 Use it instead of direct symprint_ calls.
11347 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
11348 one.
11349
a5eb1ed2
AD
113502004-09-02 Akim Demaille <akim@epita.fr>
11351
b7c72fe1
AD
11352 * data/lalr1.cc (b4_yysymprint_generate): New.
11353 (symprint_): New member function, defined when YYDEBUG.
11354 Use it consistently instead of token/nterm debugging output by
11355 hand.
a5eb1ed2
AD
11356 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
11357 %printer calls to use cdebug_ when using lalr1.cc.
11358
417141dd
AD
113592004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
11360
11361 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
11362 with #ifdef YYDEBUG.
11363
2fa09258
AD
113642004-08-26 Akim Demaille <akim@epita.fr>
11365
11366 * doc/bison.texinfo (Implementing Loops): Rename as...
11367 (Implementing Gotos/Loops): this.
11368
9378b508
PE
113692004-08-13 Paul Eggert <eggert@cs.ucla.edu>
11370
11371 Adjust to latest gnulib.
11372 * bootstrap (gnulib_modules): Add xalloc-die.
11373 Set LC_ALL=C so that file names sort consistently.
11374 Prefer the gnulib copies of gettext.m4, glibc21.m4,
11375 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
11376 uintmax_t.m4, ulonglong.m4.
11377 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
11378 po.m4 since we are now using _gl.m4 instead.
11379
87a8ad5c
PE
113802004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
11381
11382 * src/scan-action.l: Remove. Scanning of semantic actions is
11383 handled in scan-gram.l.
11384
dca81a78
PE
113852004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
11386
11387 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
11388
11389 * src/location.h (struct): The file member is a uniqstr.
11390 (equal_boundaries): Use UNIQSTR_EQ for comparison.
11391
c9cbf7c5
PE
113922004-07-22 Paul Eggert <eggert@cs.ucla.edu>
11393
11394 Fix bug with non-%union parsers that have printers or destructors,
11395 which led to a Bison core dump. Reported by Peter Fales in
11396 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 11397
c9cbf7c5
PE
11398 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
11399 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
11400 not to our own type.
11401 * src/output.c (symbol_destructors_output, symbol_printers_output):
11402 Don't assume %union.
11403 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
11404 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
11405 UNION-FLAG. All callers changed.
11406 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
11407 Use type char, not unsigned int, when declaring an array of char;
11408 this lets us remove a cast.
11409 (Printers and Destructors): Add non-%union test cases.
11410
fa7e68c3
PE
114112004-06-21 Paul Eggert <eggert@cs.ucla.edu>
11412
11413 * doc/bison.texinfo: Minor editorial changes, mostly to the new
11414 GLR writeups. E.g., avoid frenchspacing and the future tense,
11415 change "lookahead" to "look-ahead", and change "wrt" to "with
11416 respect to".
2fa09258 11417
fa7e68c3
PE
114182004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11419
11420 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
11421 New sections, split off from the GLR Parsers section. Put the new
11422 Simple GLR Parser near the start of the GLR section, for clarity.
11423 Rewrite connective text.
11424
99a9344e
PE
114252004-06-21 Frank Heckenbach <frank@g-n-u.de>
11426
11427 * doc/bison.texinfo (Simple GLR Parsers): New section.
11428
8dd162d3
PE
114292004-06-21 Paul Eggert <eggert@cs.ucla.edu>
11430
11431 * NEWS, TODO, doc/bison.texinfo:
11432 Use "look-ahead" instead of "lookahead", to be consistent.
11433 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
11434 while we're fixing "look-ahead".
11435 * src/conflicts.c (shift_set): Renamed from shiftset.
11436 (look_ahead_set): Renamed from lookaheadset.
11437 * src/print.c: Likewise.
11438 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
11439 name for "lookahead".
11440 (report_types, usage): Likewise.
11441 * src/getargs.h (report_look_ahead_tokens): Renamed from
11442 report_lookaheads.
11443 * src/lalr.c (compute_look_ahead_tokens): Renamed from
11444 compute_lookaheads.
11445 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
11446 (look_ahead_tokens_print): Renamed from lookaheads_print.
11447 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
11448 state_rule_lookaheads_print.
11449 * src/state.h: Likewise.
11450 (reductions.look_ahead_tokens): Renamed from lookaheads.
11451 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
11452 AT_DATA_LOOKAHEADS_GRAMMAR.
11453
57a90331
PE
114542004-06-03 Paul Eggert <eggert@cs.ucla.edu>
11455
11456 * README: Update location of patched M4 distribution.
11457
8ed3234a
PE
114582004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
11459
11460 Don't assume the C++ compiler takes the same arguments as the C compiler
11461 (trivial change).
11462 * configure.ac (O0CXXFLAGS): New var.
11463 * tests/atlocal.in (CXXFLAGS): Use it.
11464
07971983
PE
114652004-05-29 Paul Eggert <eggert@cs.ucla.edu>
11466
11467 Fix some "make check" problems with C++ reported by
11468 Albert Chin-A-Young for Tru64 C++ in this thread:
11469 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
11470
11471 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
11472 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11473 Output to a .cc file for C++, not to a .c file.
11474 * tests/calc.at (AT_CHECK_CALC): Likewise.
11475 * tests/regression.at (AT_CHECK_DANCER): Likewise.
11476 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
11477
29058652
PE
114782004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
11479
11480 * tests/calc.at, tests/actions.at: Workaround for SGI
11481 C++ compiler. (trivial change)
11482
62cb8a99
PE
114832004-05-27 Paul Eggert <eggert@cs.ucla.edu>
11484
fd418816
PE
11485 Spent a few hours checking out which prerequisite versions the
11486 current sources actually require. I went all the way back to
11487 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
11488 a seemingly endless set of combinations of versions more recent
11489 than that. The bottom line is that the current sources require
11490 fairly recent versions of the build tools, and it'll be some work
11491 to change this.
11492 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
11493 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
11494 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
11495 Add comments explaining why those particular versions are
11496 currently needed.
2fa09258 11497
62cb8a99
PE
11498 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
11499 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 11500 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
11501
11502 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
11503 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
11504
caa52c10
PE
115052004-05-26 Paul Eggert <eggert@cs.ucla.edu>
11506
11507 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
11508 0.11.5. Suggested by Bruno Haible.
11509 * bootstrap: Remove gettext version checking.
11510
11511 * doc/bison.texinfo (Decl Summary): Also mention that %union
11512 can depend on prerequisite types. Problem reported by Tim
11513 Van Holder.
11514
4bfd5e4e
PE
115152004-05-25 Paul Eggert <eggert@cs.ucla.edu>
11516
2cef3017
PE
11517 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
11518 * README-alpha: Don't tell people not to package this.
11519
b9c85d5c
PE
11520 * bootstrap: Don't assume $(...) works; use `...` instead.
11521 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
11522 gettext better.
11523
4bfd5e4e
PE
11524 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
11525 put into the -d output file, and mention what to do if YYSTYPE is
11526 defined as a macro.
11527
6a36ff94
PE
115282004-05-24 Paul Eggert <eggert@cs.ucla.edu>
11529
6712933e
PE
11530 Undo change made earlier today: it caused autopoint to not bring
11531 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
11532 autopoint's.
11533
11534 * bootstrap: Check that gettext version matches what's in
11535 configure.ac. Warn users to ignore robots.txt ERROR 404.
11536 * bootstrap: Undo today's earlier change (logged below).
11537 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 11538
6a36ff94
PE
11539 The gettext version checking is causing more trouble than it's
11540 curing; remove it. Problem reported by Paul Hilfinger.
11541
11542 * bootstrap: Issue a warning that one can expect a message
11543 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
11544 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
11545
209ea708
PE
115462004-05-23 Paul Eggert <eggert@cs.ucla.edu>
11547
11548 Ensure that the C++ compiler used for testing actually works on a
11549 simple test program; if not, skip the C++-related tests. Problem
11550 reported by Vin Shelton in:
161a71f3 11551 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
11552
11553 * m4/cxx.m4: New file.
11554 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
11555 * tests/atlocal.in (BISON_CXX_WORKS): Add.
11556 * tests/local.at (AT_COMPILE_CXX): Use it.
11557
41ca2549
PE
115582004-05-21 Paul Eggert <eggert@cs.ucla.edu>
11559
383e69dc
PE
11560 * data/glr.c (yylloc): Output this macro even if locations are not
11561 being generated, as the GLR parser needs it even in that case.
11562 Problem reported by Troy A. Johnson
11563 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
11564
41ca2549
PE
11565 * configure.ac (AC_INIT): Update to 1.875e.
11566
e476c87d
PE
115672004-05-21 Paul Eggert <eggert@cs.ucla.edu>
11568
11569 * NEWS: Version 1.875d.
11570 * configure.ac (AC_INIT): Likewise.
11571 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
11572
11573 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
11574 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
11575 lalr1.cc runs afoul of the first, and the last two are no longer
11576 supported by GCC 3.4.0.
11577 * README: Mention GNU m4 1.4 or later; mention m4 patches.
11578 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
11579
233a88ad
PE
115802004-05-06 Paul Eggert <eggert@cs.ucla.edu>
11581
11582 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
11583 unsigned int, for compatibility with latest gnulib hash module.
11584 * src/state.c (state_hash, state_hasher): Likewise.
11585 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
11586 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 11587
12ffdd28
PE
115882004-05-03 Paul Eggert <eggert@cs.ucla.edu>
11589
11590 * NEWS: Unescaped newlines are no longer allowed in char & strings.
11591
11592 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
11593 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
11594 character and string literals.
11595 (unexpected_end): New function.
11596 (unexpected_eof): Use it.
11597 (unexpected_newline): New function.
11598 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
11599 actions.
e476c87d 11600
12ffdd28
PE
11601 * NEWS: Document %expect-rr.
11602
11603 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
11604 Fix typo by replacing $1 with $option.
11605 Remove more 'intl'-related files.
9668e2be 11606 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
11607
11608 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
11609 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
11610 strtoul.c.
11611 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
11612 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
11613 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
11614 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
11615 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
11616 * src/.cvsignore: Add *.output.
11617
11618 * src/parse-gram.y: Put copyright notice inside %{ %} so it
11619 gets copied to the output file.
e476c87d 11620
1f65350a
PE
116212004-04-28 Paul Eggert <eggert@twinsun.com>
11622
11623 Get files from the gnulib and po repositories, instead of relying
11624 on them being in our CVS. Upgrade to latest versions of gnulib
11625 and Automake.
11626
11627 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
11628 * bootstrap: Bootstrap from gnulib and po repositories.
11629 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
11630 * README-cvs: Document these changes. Remove version numbers from
11631 mentions of build tools, since they change so often. Mention Flex.
11632
11633 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
11634 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
11635 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
11636 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 11637 does this for us.
12ffdd28
PE
11638 (AC_ISC_POSIX): Remove; we no longer support this
11639 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
11640 (AC_HEADER_STDC): Remove: we now assume C89 or better.
11641 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
11642 Do not check for C89 headers, except for locale.h which is used
11643 by the Yacc library and must port to K&R hosts.
11644 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
11645 Do not check for C89 functions, except for setlocale which is
11646 used by the Yacc library.
11647 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
11648 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
11649 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
11650 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
11651 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
11652 AM_GNU_GETTEXT): Remove; now done by:
11653 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
11654 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
11655 for us.
11656
11657 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
11658 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
11659 Define to empty, as gnulib.mk will do the rest for us.
11660 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
11661 for us.
11662 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
11663 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
11664
11665 * src/files.c: Include gnulib's xstrndup.h.
11666
11667 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
11668 (REALLOC): Use xnrealloc, for likewise.
11669 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
11670 (strnlen, memrchr): Remove decls; functions no longer used.
11671 Include <stpcpy.h>.
11672
11673 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
11674 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
11675 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
11676 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
11677 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
11678 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
11679 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
11680 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
11681 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
11682 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
11683 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
11684 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
11685 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
11686 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
11687 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
11688 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
11689 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
11690 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
11691 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
11692 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
11693 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
11694 Remove, as these files are now generated automatically
11695 by bootstrap or automake.
11696
11697 * po/ChangeLog: Remove: all but one entry was a duplicate
11698 of this file, and I moved that 2000-11-02 entry here.
11699
11700 * config/.cvsignore: Add Makefile, depcomp, install-sh.
11701 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
11702 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
11703 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
11704 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
11705 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
11706 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
11707 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
11708 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
11709 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
11710 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
11711 xstrndup.h.
11712 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
11713 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
11714 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
11715 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
11716 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
11717 * src/.cvsignore: Remove *_.c.
11718
11719
11720 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
11721 support it. (The latest stable gzip doesn't.)
11722
117232004-04-27 Paul Eggert <eggert@twinsun.com>
11724
11725 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
11726 case, as stos_ is now used by destructors due to the 2004-02-09
11727 change.
11728
11729 Remove more K&R C support.
11730 * lib/libiberty.y (PARAMS): Remove. All uses removed.
11731 * lib/subpipe.c (errno): Remove decl.
11732 Include <stdlib.h> unconditionally.
11733 (EXIT_FAILURE): Remove macro.
11734 * src/complain.c (vfprintf, strerror): Remove.
11735 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
11736 unconditionally.
11737 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
11738 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
11739 (strchr, strspn, memchr): Remove decls.
11740 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
11741 unconditionally. Do not declare perror.
11742 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
11743 unconditionally.
11744
11745 * src/complain.c (_): Remove useless defn, as system.h defines this.
11746
11747 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
11748 with latest obstack.h.
11749 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
11750 to procedure types, as obstack.h now does that for us.
11751 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
11752
11753 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
11754 so that this include file can stand alone.
11755 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
11756 does this now. Include subpipe.h first after config.h, to
11757 test whether it can stand alone.
11758
11759 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
11760 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
11761 unused declaration.
11762
11763 * tests/synclines.at (%union synch line): Put a dummy member in
11764 the union, because empty unions aren't allowed in C. Caught
11765 by GCC 3.4.0.
11766
4f16766c
PE
117672004-04-13 Jim Meyering <jim@meyering.net>
11768
11769 * src/conflicts.c (conflicts_print): Correct format string typo:
11770 use `%%' to produce literal `%'. (trivial change)
11771
779e7ceb
PE
117722004-03-30 Paul Eggert <eggert@twinsun.com>
11773
11774 * src/getargs.c (version): Update copyright year to 2004.
11775
11776 * data/c.m4 (b4_int_type): Use 'short int' rather than
11777 'short', and similarly for 'long', 'unsigned', etc.
11778 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
11779 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
11780 yy_yypstack, yydumpstack): Likewise.
11781 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
11782 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
11783 Likewise.
11784 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
11785 yy_stack_print, yyparse): Likewise.
11786 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
11787 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
11788 * lib/bitset.c (bitset_print): Likewise.
11789 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
11790 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
11791 * lib/bitsetv.c (bitsetv_dump): Likewise.
11792 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
11793 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
11794 Likewise.
11795 * src/LR0.c (allocate_itemsets): Likewise.
11796 * src/gram.h (rule_number, rule): Likewise.
11797 * src/lalr.h (goto_number): Likewise.
11798 * src/nullable.c (nullable_compute): Likewise.
11799 * src/output.c (prepare_rules): Likewise.
11800 * src/relation.c (relation_print, relation_digraph): Likewise.
11801 * src/relation.h (relation_node): Likewise.
11802 * src/state.h (state_number, transitions, errs, reductions,
11803 struct state): Likewise.
11804 * src/symtab.h (symbol_number, struct symbol): Likewise.
11805 * src/tables.c (vector_number, tally, action_number,
11806 default_goto, goto_actions): Likewise.
11807 * tests/existing.at (GNU Cim Grammar): Likewise.
11808 * tests/regression.at (Web2c Actions): Likewise.
11809
11810 * src/output.c (muscle_insert_short_int_table): Renamed from
11811 muscle_insert_short_table. All uses changed.
11812
d6328241
PH
118132004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
11814
11815 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
11816 (declaration): Replace expected_conflicts with expected_sr_conflicts.
11817 Add %expect-rr rule.
4f16766c 11818
d6328241
PH
11819 * src/scan-gram.l: Recognize %expect-rr.
11820
4f16766c 11821 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 11822 expected_conflicts.
4f16766c 11823 (expected_rr_conflicts): Declare.
d6328241
PH
11824
11825 * src/conflicts.c (expected_sr_conflicts): Rename from
11826 expected_conflicts.
11827 (expected_rr_conflicts): Define.
11828 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
11829 for GLR parsers.
11830 Use expected_sr_conflicts in place of expected_conflicts.
11831 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 11832
d6328241 11833 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 11834
1452af69
PE
118352004-03-08 Paul Eggert <eggert@gnu.org>
11836
11837 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 11838 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
11839
11840 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
11841 in lalr1.cc.
11842 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
11843 * src/scan-gram.l (scan_integer): New function.
11844 ({int}): Use it.
11845 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
11846 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
11847 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
11848 Say "long int", not "long", for uniformity with GNU style.
11849
006d217d
PE
118502004-02-25 Paul Eggert <eggert@twinsun.com>
11851
11852 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
11853 compilers. This fixes a problem with Intel's C++ compiler being
11854 chatty, reported by Guido Trentalancia in
161a71f3 11855 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 11856
c2729758
ADL
118572004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
11858
11859 Support %destructor and merge error locations in lalr1.cc.
11860
11861 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
11862 (Parser::stos_): Define unconditionally.
11863 (Parser::destruct_): New method. Generate its body with
11864 b4_yydestruct_generate.
11865 (Parser::error_start_): New attribute.
11866 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
11867 token which are discarded.
11868 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
11869 error_start_ when erroneous token are discarded.
11870 (Parser::parse) <yyerrlab1>: Compute the location of the error
11871 token so that it covers all the discarded tokens.
11872 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
11873 it can be called with `%skeleton "lalr1.cc"', and do that.
11874
dd0e0635
PE
118752004-02-02 Paul Eggert <eggert@twinsun.com>
11876
11877 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
11878 $(top_srcdir)/lib and ../lib. This fixes a bug reported
11879 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
11880 There's no need to mention top_builddir since Automake does that
11881 for us.
11882 (INCLUDES): Remove, as Automake says it's obsolescent.
11883 Contents migrated into AM_CPPFLAGS as described above.
11884 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
11885
118862004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11887
11888 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
11889 (yyreportSyntaxError): Handle case where lookahead token is
11890 YYEMPTY.
11891
be16239b
PH
118922004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11893
11894 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
11895 resulting parsers are compilable with C++.
11896
5fa90832
PE
118972003-12-23 Paul Eggert <eggert@twinsun.com>
11898
11899 * config/depcomp, config/install-sh: Sync with Automake 1.8.
11900 * src/output.c (output_skeleton): Rename local var.
11901 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
11902 Bison tokens, as this runs afoul of the 2003-10-07 change that
11903 disallowed NUL bytes in character constants or string literals.
11904
11905 * tests/local.at: Require Autoconf 2.59's Autotest.
11906 * tests/testsuite.at: Don't include local.at, since we now assume
11907 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
11908 including it.
11909 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
11910 multiple inclusion warnings.
dd0e0635 11911
b165c324
AD
119122003-12-02 Akim Demaille <akim@epita.fr>
11913
11914 * doc/bison.texinfo (How Can I Reset the Parser): More about start
11915 conditions.
11916 From Bruno Haible.
11917
26e06a21
ADL
119182003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
11919
11920 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
11921
92ac3705
PE
119222003-10-07 Paul Eggert <eggert@twinsun.com>
11923
6a5ecb38
PE
11924 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
11925 if testsuite doesn't exist.
11926
92ac3705
PE
11927 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
11928 literals, unfortunately.
11929 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
11930 Complain about NUL bytes in character constants or string literals.
11931
91d2c560
PE
119322003-10-05 Paul Eggert <eggert@twinsun.com>
11933
11934 * NEWS: Don't document %no-default-prec, as it's still
11935 too experimental.
11936 * doc/bison.texinfo: Document %no-default-prec only if
11937 the defaultprec flag is set. Normally it's not.
11938
0cc3da3a
PE
119392003-10-04 Paul Eggert <eggert@twinsun.com>
11940
11941 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
11942 non-modifiable lvalue, instead of a modifiable one.
11943 * doc/bison.texinfo (Actions): Document that $$ can
11944 be assigned to. Do not claim that $$ and $N are
11945 array element references: user code should not rely on this.
11946
22fccf95
PE
119472003-10-01 Paul Eggert <eggert@twinsun.com>
11948
11949 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
11950 (grammar_declaration): Use it.
11951 * src/scan-gram.l: New token %no-default-prec.
11952 * tests/conflicts.at: Revamp tests to use %no-default-prec.
11953 * NEWS, doc/bison.texinfo: Document the above.
11954
fc8f2965
AD
119552003-10-01 Akim Demaille <akim@epita.fr>
11956
11957 VCG no longer supports long_straight_phase.
11958
11959 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
11960 * src/print_graph.c (print_graph): Adjust.
11961
39a06c25
PE
119622003-09-30 Frank Heckenbach <frank@g-n-u.de>
11963 and Paul Eggert <eggert@twinsun.com>
11964
11965 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
11966 Table of Symbols): Document %default-prec.
11967 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
11968 (grammar_declaration): Set default_prec on %default-prec.
11969 * src/scan-gram.l (%default-prec): New token.
11970 * src/reader.h (default_prec): New flag.
11971 * src/reader.c: Likewise.
11972 (packgram): Handle it.
11973 * tests/conflicts.at (%default-prec without %prec,
11974 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 11975
39a06c25
PE
119762003-09-30 Paul Eggert <eggert@twinsun.com>
11977
11978 * tests/testsuite.at: Include local.at, not input.at, fixing
11979 a typo in the 2003-08-25 patch.
11980
62b6aef9
AD
119812003-08-27 Akim Demaille <akim@epita.fr>
11982
11983 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
11984 GCC warnings.
11985
89e1cc61
AD
119862003-08-26 Akim Demaille <akim@epita.fr>
11987
11988 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
11989 "<\#" to avoid magic from Gnus when posting parts of this script.
11990
a08460b0
AD
119912003-08-26 Akim Demaille <akim@epita.fr>
11992
11993 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
11994 (Parser::parse): here.
11995 Adjust: nerrs and errstatus is now replaced by...
11996 (Parser::nerrs_, Parser::errstatus_): New.
11997
603f1cfd
AD
119982003-08-25 Akim Demaille <akim@epita.fr>
11999
12000 * config/announce-gen, Makefile.cfg: New.
12001 * Makefile.am: Adjust.
12002 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
12003 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
12004
cd3684cf
AD
120052003-08-25 Akim Demaille <akim@epita.fr>
12006
12007 When reducing initial empty rules, Bison parser read an initial
12008 location that is not defined. This results in garbage, and that
12009 affects Bison's own parser. Therefore we need (i) to extend Bison
12010 to support a means to initialize this location, and (ii) to use
12011 this CVS Bison to fix CVS Bison's parser.
12012
12013 * src/reader.h, reader.c (epilogue_augment): Remove, replace
12014 with...
12015 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
12016 * src/parse-gram.y: Adjust.
12017 (%initial-action): New.
12018 (%error-verbose): Since we require CVS Bison, there is no reason
12019 not to use it.
12020 * src/scan-gram.l: Adjust.
12021 * src/Makefile.am (YACC): New, to make sure we use our own parser.
12022 * data/yacc.c (yyparse): Use b4_initial_action.
12023
4e03e201
AD
120242003-08-25 Akim Demaille <akim@epita.fr>
12025
12026 * doc/bison.texinfo: Don't promote stdout for error messages.
12027
8c182d05
AD
120282003-08-25 Akim Demaille <akim@epita.fr>
12029
12030 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
12031 From Alexandre Duret-Lutz.
12032
6a60c4cf
PE
120332003-08-25 Akim Demaille <akim@epita.fr>
12034
12035 Version 1.875c.
12036
25f66e1a
AD
120372003-08-25 Akim Demaille <akim@epita.fr>
12038
12039 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
12040 Use them.
12041
5348bfbe
AD
120422003-08-25 Akim Demaille <akim@epita.fr>
12043
12044 * data/lalr1.cc (Parser::reduce_print_): New.
12045 Use it.
12046
47301314
AD
120472003-08-25 Akim Demaille <akim@epita.fr>
12048
12049 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
12050 error recovery loops. This patch is based on
161a71f3 12051 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
12052 Also, augment the similarity between lalr1.cc and yacc.c.
12053 Note: the locations of error recovery rules are not correct yet.
12054
12055 * data/lalr1.cc: Comment changes to augment the similarity between
12056 lalr1.cc and yacc.c.
12057 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
12058 (yyerrlab1): Remove, but where it used to be (now the bottom part of
12059 yyerrlab), when hitting EOF, pop the whole stack here instead of
12060 merely falling thru the default error handling mechanism.
12061 (yyerrorlab): New label, with the old contents of YYERROR,
12062 plus the following change: pop the stack of rhs corresponding
12063 to the production that invoked YYERROR. That is how Yacc
12064 behaves (required by POSIX).
12065 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
12066 fail.
12067
1f7a61ff
AD
120682003-08-25 Akim Demaille <akim@epita.fr>
12069
12070 Tune local.at so that people can "autom4te -l autotest calc.at -o
12071 calc" for instance, to extract a sub test suite.
12072
12073 * tests/testsuite.at: Move the initialization, Autotest version
12074 requirement, and AT_TESTED invocation into...
12075 * tests/local.at: here.
12076 * tests/testsuite.at: Include it for compatibility with Autoconf
12077 2.57.
12078 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
12079 be ignore.
12080
327b5b56
PE
120812003-08-04 Paul Eggert <eggert@twinsun.com>
12082
12083 Rework code slightly to avoid gcc -Wtraditional warnings.
12084 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
12085 The returned value is now stored in *YY0. All callers changed.
12086 * src/output.c (merge_output): Adjust to the above change.
12087
0051e3ed
PE
120882003-07-26 Paul Eggert <eggert@twinsun.com>
12089
12090 * data/glr.c (YYASSERT): New macro.
12091 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
12092 yyresolveStates, yyprocessOneStack):
12093 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
12094 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 12095
137437c6
PE
120962003-07-25 Paul Eggert <eggert@twinsun.com>
12097
5b620e06
PE
12098 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
12099 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 12100 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
12101 by Frank Heckenbach, though I have omitted the structure-initialization
12102 part of his glr-knr.diff patch since I recall that the Portable
12103 C Compiler didn't require that change.
12104
137437c6
PE
12105 Let the user specify how to allocate and free memory.
12106 Derived from a suggestion by Frank Heckenbach in
161a71f3 12107 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
12108 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
12109 All uses of free, malloc, realloc changed to use these macros,
12110 and unnecessary casts removed.
12111 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
12112
ddb85ca5
PE
121132003-07-06 Matthias Mann <MatthiasMann@gmx.de>
12114
12115 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
12116 use s.empty() rather than s == "" to test for empty string; see
161a71f3 12117 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
12118 (trivial change)
12119
39910e09
AD
121202003-06-25 Akim Demaille <akim@epita.fr>
12121
12122 * config/depcomp, config/install-sh: Update from masters.
12123
0ae99356
PE
121242003-06-20 Paul Eggert <eggert@twinsun.com>
12125
12126 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
12127 and return properly parenthesized result.
12128 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
12129 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
12130 Remove unnecessary parentheses from uses.
12131 * doc/bison.texinfo (Location Default Action): Describe the
12132 conventions for parentheses.
12133
cd05d13c
PE
121342003-06-19 Paul Eggert <eggert@twinsun.com>
12135
81fd08ca
PE
12136 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
12137 yyreportTree): Do not assume that size_t is the same width as int,
12138 when printing sizes. Print sizes using an unsigned format.
12139 Problem reported by Frank Heckenbach in
161a71f3 12140 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 12141
cd05d13c
PE
12142 Port to Forte Developer 7 C compiler.
12143 * data/glr.c (struct YYLTYPE): If locations are not being used,
12144 declare a single dummy member, as empty structs do not conform
12145 to the C standard.
12146 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
12147 the Forte Developer 7 C compiler complains that end-of-loop
12148 code is not reached.
12149
4dcf140b
PE
121502003-06-17 Paul Eggert <eggert@twinsun.com>
12151
12152 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
12153 avoid warnings from picky compilers about redefinition of PARAMS.
12154
8dd76bee
PE
121552003-06-17 Paul Eggert <eggert@twinsun.com>
12156
12157 Version 1.875b.
12158
12159 * NEWS: Document 1.875b.
12160
12161 * lib/bbitset.h: Do not include config.h; that's the includer's job.
12162 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
12163 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
12164 Don't use 'index' in comments, as it's a builtin fn on some hosts.
12165 * lib/bitset_stats.c: Include gettext.h unconditionally, as
12166 per recent gettext manual's suggestion.
12167 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
12168 Use prototypes, not old-style definitions.
12169 * lib/lbitset.c (lbitset_unused_clear): Likewise.
12170 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
12171 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
12172 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
12173 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
12174 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
12175 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
12176 vbitset_or_and_cmp, vbitset_copy): Likewise.
12177
12178 * lib/libiberty.h: Do not include config.h; that's the includer's job.
12179 Do not include <stdlib.h>.
12180 (PARAMS): Define unconditionally for C89.
12181 (ATTRIBUTE_NORETURN): Remove.
12182 (ATTRIBUTE_UNUSED): Define unconditionally.
12183
12184 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 12185 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
12186 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
12187 * lib/vbitset.c, lib/vbitset.h: New files.
12188 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
12189 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
12190 from libbitset.
12191
12192 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
12193 `How Can I Reset @code{yyparse}', since texinfo does not allow
12194 arbitrary @ in node names.
12195
12196 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
12197 shouldn't be needed according to the gettext 0.12.1 documentation
12198 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 12199 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 12200 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 12201 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 12202
8dd76bee
PE
12203 * lib/.cvsignore: Add stdbool.h.
12204 * m4/.cvsignore: Add nls.m4, po.m4.
12205
12206 Upgrade to CVS gnulib.
12207 * stdbool_.h: File renamed from stdbool.h.in.
12208 * configure.ac (AM_STDBOOL_H): Invoke this instead of
12209 AC_HEADER_STDBOOL.
12210 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
12211 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
12212 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
12213 (MOSTLYCLEANFILES): New var.
12214 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
12215 (stdbool.h): New rule.
12216 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
12217 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
12218 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
12219 m4/quote.m4: Upgrade to today's gnulib.
12220
12221 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
12222 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
12223 the tests right now.
12224 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
12225 yyerror are declared before use; C99 requires this.
12226
25005f6a
PH
122272003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12228
12229 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
12230 first.
12231 (yyrecoverSyntaxError): Correct the logic for setting and testing
12232 yyerrState.
12233 Correct comment on handling EOF.
12234 Allow states with only a default reduction, rather than failing
8dd76bee 12235 (I can't quite reconstruct why these were not allowed before).
25005f6a 12236
137437c6 12237 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 12238 buffer overruns, corrupting state.
8dd76bee
PE
12239
12240 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
12241 definition.
12242 * src/reader.h (max_left_semantic_context): New variable declaration.
12243 * src/scan-gram.l (max_left_semantic_context): Define.
12244 (handle_action_dollar): Update max_left_semantic_context.
12245 * data/glr.c (YYMAXLEFT): New definition.
12246 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
12247 (yyresolveAction): Ditto.
12248
12249 Fixes to problems with location handling in GLR parsers reported by
12250 Frank Heckenbach (2003/06/05).
12251
12252 * data/glr.c (YYLTYPE): Make trivial if locations not used.
12253 (YYRHSLOC): Add parentheses, and define only if locations used.
12254 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
12255 locations not used.
12256 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
12257 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 12258
25005f6a
PH
12259 * tests/cxx-type.at: Exercise location information; update tests
12260 to differentiate output with and without locations.
8dd76bee 12261 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
12262 because default YYLTYPE not yet defined.
12263 Change semantic actions to compute strings, rather than printing
12264 them directly (to test proper passing of semantics values). Change
12265 output to prefix notation and update test data and expected results.
12266 (yylex): Track locations.
12267 (stmtMerge): Return value rather than printing, and include arguments
12268 in value.
8dd76bee 12269
711f40b7
PE
122702003-06-03 Paul Eggert <eggert@twinsun.com>
12271
12272 Avoid warnings generated by GCC 2.95.4 when Bison is
12273 configured with --enable-gcc-warnings.
12274 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
12275 yy::]b4_parser_class_name[::translate_,
12276 yy::Stack::operator[] (unsigned),
12277 yy::Stack::operator[] (unsigned) const,
12278 yy::Slice::operator[] (unsigned),
12279 yy::Slice::operator[] (unsigned) const):
12280 Rename local vars to avoid warnings.
12281 * tests/glr-regression.at (Improper handling of embedded actions
12282 and $-N in GLR parsers): Remove unused local variable from yylex.
12283 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
12284 (void) as arg when not pure, since we now assume C89 when building
12285 Bison. Pacify GCC by using parameter.
12286
ac695f7d
PE
122872003-06-02 Paul Eggert <eggert@twinsun.com>
12288
12289 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
12290 yy::Location::lines, yy::Location::columns): Rename arguments
12291 to avoid shadowing; this removes a warning generated by GCC 3.3.
12292
26ec81e0
PE
122932003-06-01 Paul Eggert <eggert@twinsun.com>
12294
12295 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
12296 to g++, as GCC 3.3 complains if you do it.
12297 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
12298 everything that WARNING_CFLAGS has, except omit warnings
12299 not suitable for C++.
12300 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
12301 * tests/atlocal.in (CXXFLAGS): New var.
12302 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
12303
12304 Fix a GLR parser bug I reported in February; see
161a71f3 12305 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
12306 The problem was that GLR parsers did not conform to the C standard,
12307 because actions like { $1 = $2 + $3; } expanded to expressions
12308 that invoked YYFILL in separate subexpressions, and YYFILL assigned
12309 to a local variable. The C standard says that expressions
12310 like (var = f ()) + (var = f ()) have undefined behavior.
12311 Another problem was that GCC sometimes issues warnings that
12312 yyfill and its parameters are unused.
12313
12314 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
12315 as possibly unused.
12316 (yyfill): New function.
12317 (YYFILL): Use it.
12318 (yyuserAction): Change type of yynormal to bool, so that it matches
12319 the new yyfill signature. Mark it as possibly unused.
12320
12321
12322 Follow up on a bug I reported in February, where a Bison-generated
12323 parser can loop. Provide a test case and a fix for yacc.c. I
12324 don't have a fix for lalr1.cc or for glr.c, unfortunately.
12325 The original bug report is in:
161a71f3 12326 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
12327
12328 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
12329 macro's size was becoming unwieldy.
12330 (yyerrlab): Do not discard an empty lookahead symbol, as this
12331 might destroy garbage.
12332 (yyerrorlab): New label, with the old contents of YYERROR,
12333 plus the following change: pop the stack of rhs corresponding
12334 to the production that invoked YYERROR. That is how Yacc
12335 behaves, and POSIX requires this behavior.
12336 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
12337 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
12338 Define 'alarm' to do nothing if unistd.h is not available.
12339 Add a new rule "exp: '-' error;" to test the above change to
12340 data/yacc.c. Use 'alarm' to abort any test taking longer than
12341 10 seconds, as it's probably looping.
12342 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
12343 Also, the new yacc.c generates two fewer diagnostics for an
12344 existing test.
12345
d0829076
PE
123462003-05-24 Paul Eggert <eggert@twinsun.com>
12347
c6ae27df
PE
12348 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
12349 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
12350 This fixes a problem reported by John Bowman when the Compaq/HP
12351 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
12352 -ansi -Wall -gall).
12353 * data/yacc.c (union yyalloc): Likewise.
12354 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 12355
d0829076
PE
12356 Switch from 'int' to 'bool' where that makes sense.
12357
12358 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
12359 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
12360 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
12361 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
12362 Return or accept bool, not int. All callers changed.
12363 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
12364 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
12365 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
12366 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
12367 bitset_or_and_cmp_): Likewise.
12368 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
12369 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
12370 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
12371 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
12372 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
12373 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
12374 bitset_stats_or_and_cmp): Likewise.
12375 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
12376 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
12377 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
12378 ebitset_xor_cmp): Likewise.
12379 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
12380 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
12381 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
12382 lbitset_xor_cmp): Likewise.
12383 * lib/bbitset.h: Include <stdbool.h>.
12384 (struct bitset_vtable): The following members now return bool, not
12385 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
12386 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
12387 or_and_cmp).
12388 * src/conflicts.c (count_rr_conflicts): Likewise.
12389 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
12390 All uses changed.
12391 * lib/ebitset.c (ebitset_obstack_init): Likewise.
12392 * lib/lbitset.c (lbitset_obstack_init): Likewise.
12393 * src/getargs.c (debug_flag, defines_flag, locations_flag,
12394 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
12395 graph_flag): Likewise.
12396 * src/getargs.h (debug_flag, defines_flag, locations_flag,
12397 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
12398 graph_flag): Likewise.
12399 * src/output.c (error_verbose): Likewise.
12400 * src/output.h (error_verbose): Likewise.
12401 * src/reader.c (start_flag, typed): Likewise.
12402 * src/reader.h (typed): Likewise.
12403 * src/getargs.c (LOCATIONS_OPTION): New constant.
12404 (long_options, getargs): Use it.
12405 * src/lalr.c (build_relations): Use bool, not int.
12406 * src/nullable.c (nullable_compute): Likewise.
12407 * src/print.c (print_reductions): Likewise.
12408 * src/tables.c (action_row, pack_vector): Likewise.
12409 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
12410 * src/output.c (prepare): Use it.
12411 * src/output.c (token_definitions_output,
12412 symbol_destructors_output, symbol_destructors_output): Use string,
12413 not boolean integer, to keep track of whether to output separator.
12414 * src/print_graph.c (print_core): Likewise.
12415 * src/state.c (state_rule_lookaheads_print): Likewise.
12416
12417 * config/install-sh: Sync from automake 1.7.5.
12418
6b2584b7
PE
124192003-05-14 Paul Eggert <eggert@twinsun.com>
12420
12421 * src/parse-gram.y (rules_or_grammar_declaration): Require a
12422 semicolon after a grammar declaration, in the interest of possible
12423 future changes to the Bison input language.
12424 Do not allow a stray semicolon at the start of the grammar.
12425 (rhses.1): Allow one or more semicolons after any rule, including
12426 just before "|" as required by POSIX.
12427 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
12428 grammar.
12429
caf37a36
ADL
124302003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
12431
12432 %parse-param support for lalr1.cc.
12433
12434 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
12435 b4_cc_constructor_calls, b4_cc_constructor_call,
12436 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
12437 definitions.
12438 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
12439 parse-param arguments.
12440 (yy::b4_parser_class_name): Declare instance variables to
12441 hold parse-param arguments.
12442 * tests/calc.at: s/value/semantic_value/ because value clashes
12443 with a member of yy::b4_parser_class_name. Adjust C++ code
12444 to handle %parse-param. Enable %parse-param test in C++.
12445
3ab37077
PE
124462003-05-12 Paul Eggert <eggert@twinsun.com>
12447
12448 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
12449 English a bit. Fix fclose typo. Change "const char" to "char
12450 const", and use ANSI C rather than K&R for "main". Suggest
12451 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
12452 and suggest yy_switch_to_buffer.
12453
124542003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
12455
12456 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
12457 C89. This avoids a diagnostic on compilers that define __STDC__
12458 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 12459 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 12460
e743727f
PE
124612003-05-03 Paul Eggert <eggert@twinsun.com>
12462
12463 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
12464 Do not overrun array bounds.
12465 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 12466 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 12467
916708d5
AD
124682003-04-29 Akim Demaille <akim@epita.fr>
12469
12470 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
12471 * src/getargs.c, src/getargs.h: here, as bool, not int.
12472 (nondeterministic_parser): New.
12473 * src/parse-gram.y, src/scan-gram.l: Support
12474 %nondeterministic-parser.
12475 * src/output.c (prepare): Use nondeterministic_parser instead
12476 of glr_parser where appropriate.
12477 * src/tables.c (conflict_row, action_row, save_row)
12478 (token_actions, token_actions, pack_vector): Ditto.
12479
a06ea4aa
AD
124802003-04-29 Akim Demaille <akim@epita.fr>
12481
12482 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
12483
211074ca
AD
124842003-04-29 Akim Demaille <akim@epita.fr>
12485
12486 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
12487 with %pure-parser and %locations to exercise the patch from Yakov
12488 Markovitch below.
12489
6175ffe3
PE
124902003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
12491
12492 * data/yacc.c: (b4_lex_param): Corrected for the case where
12493 %lex-param is provided and %pure-parser isn't.
12494
b1e95857
PE
124952003-04-27 Paul Eggert <eggert@twinsun.com>
12496
12497 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 12498 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
12499 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
12500 if it is not defined.
12501 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
12502
acda9df6
PE
125032003-04-26 Paul Eggert <eggert@twinsun.com>
12504
3470c57b
PE
12505 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
12506 Declare to be of type suitable for the ninf value itself, not of
12507 type suitable for the corresponding table, since the latter might
12508 be unsigned but the ninf value might be negative. This fixes a
12509 bug reported by Alexandre Duret-Lutz in
161a71f3 12510 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 12511
acda9df6
PE
12512 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
12513 invokes it. We shouldn't invoke it twice because it will attempt
12514 to put error.o in the archive twice. This fixes a glitch reported
12515 by Martin Mokrejs in
161a71f3 12516 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 12517
b5250f26
PE
125182003-04-21 Paul Eggert <eggert@twinsun.com>
12519
12520 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
12521 to gnulib.
12522
089ac0f1
PE
125232003-04-21 Yakov Markovitch <Markovitch@iso.ru>
12524
12525 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
12526 Fix obvious typo that results in uncompilable GLR parsers
12527 when both %pure-parser and %locations are used. (trivial change)
12528
5ededac6
PE
125292003-04-17 Paul Eggert <eggert@twinsun.com>
12530
1b8f2fff
PE
12531 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
12532 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
12533 Do not insert the expected token via unput, as this runs afoul
12534 of a POSIX-compatibility bug in flex 2.5.31.
12535 All uses changed to BEGIN the parent state,
12536 since we no longer insert the expected token via unput.
12537 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
12538 that is no longer emitted after the above change.
12539
5ededac6
PE
12540 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
12541 the first one. This change is from Paul Hilfinger, and it fixes
12542 regression reported by Werner Lemberg in
161a71f3 12543 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
12544
12545 (resolve_sr_conflict): Don't invoke state_errs_set
12546 unless one or more tokens have been explicitly made errors.
12547 Otherwise, the above change causes Bison to abort.
12548
12549 * tests/existing.at (GNU pic Grammar): New test case, taken from
12550 Lemberg's email.
12551
b8be9132
AD
125522003-03-31 Akim Demaille <akim@epita.fr>
12553
12554 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
12555
d423d460
AD
125562003-03-31 Akim Demaille <akim@epita.fr>
12557
12558 * src/output.c (prepare_symbols): Avoid trailing spaces in the
12559 output.
12560
c7e441b4
AD
125612003-03-31 Akim Demaille <akim@epita.fr>
12562
12563 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
12564 From Paul Hilfinger.
12565
231897ad
AD
125662003-03-29 Akim Demaille <akim@epita.fr>
12567
12568 * m4/error.m4: Do not put under dynamic conditions some code which
12569 expansion is under static control.
12570
5b066063
AD
125712003-03-29 Akim Demaille <akim@epita.fr>
12572
12573 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
12574
22a74fec
AD
125752003-03-29 Akim Demaille <akim@epita.fr>
12576
12577 * doc/bison.texinfo (Strings are Destroyed): New.
12578
0eee27e7
PE
125792003-03-13 Paul Eggert <eggert@twinsun.com>
12580
12581 * .cvsignore: Add configure.lineno.
12582 * src/.cvsignore: Add yacc.
12583 * tests/.cvsignore: Add testsuite.log.
12584 * doc/fdl.texi: Sync with latest FSF version.
12585
f61aad93
PE
125862003-03-12 Paul Eggert <eggert@twinsun.com>
12587
537636c7
PE
12588 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
12589 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
12590 cursor, instead of leaving it undefined. This fixes a bug
12591 reported by Tim Van Holder in
161a71f3 12592 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
12593 * tests/input.at (Torturing the Scanner): Test the scanner on
12594 an empty input file, which was Tim Van Holder's test case.
12595
12596 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
12597 <sys/resource.h> can be included, include sys/time.h and
12598 sys/times.h first, if available. This works around the SunOS
12599 4.1.4 porting bug reported by Bruce Becker in
161a71f3 12600 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
12601
12602 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
12603 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
12604 AC_HEADER_SYS_WAIT.
12605
f61aad93
PE
12606 Merge changes from gnulib. This was prompted because the CVS
12607 snapshot didn't build on Solaris 7 due to strnlen problems.
12608
12609 These changes need to be merged back into gnulib:
12610 * lib/hash.c: Include <stdbool.h> unconditionally.
12611 * m4/onceonly.m4 (m4_quote): New macro.
12612 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
12613 Quote AC_FOREACH variable-expansions properly.
12614 The 2003-01-03 obstack.h change also needs merging.
12615 {end of changes requiring merging}
5b066063 12616
f61aad93
PE
12617 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
12618 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
12619 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
12620 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
12621 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
12622 New files, imported from gnulib.
12623 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
12624 above.
12625
12626 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
12627 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
12628 gnulib sources.
12629
12630 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
12631 Add.
12632 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
12633 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
12634 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
12635 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
12636 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
12637 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
12638 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
12639 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
12640 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
12641 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
12642 (jm_PREREQ_ARGMATCH): Remove.
12643 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
12644 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
12645
12646 * src/system.h: Include <stdbool.h> unconditionally.
12647
12648 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
12649 assuming at least C89 in the bitset code for some time now.
12650
d2ffe116
AD
126512003-03-03 Akim Demaille <akim@epita.fr>
12652
12653 * ro.po: New.
12654
052826fd
AD
126552003-03-02 Akim Demaille <akim@epita.fr>
12656
12657 * doc/bison.texinfo (Table of Symbols): Reactivate the
12658 documentation for %lex-param, and %parse-param.
12659
c4749565
AD
126602003-03-02 Akim Demaille <akim@epita.fr>
12661
12662 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
12663 generate verbose error messages.
12664 Use the number of tokens as an upper bound in yytname, as it
12665 cannot be a non terminal.
12666
d5286af1
AD
126672003-03-02 Akim Demaille <akim@epita.fr>
12668
12669 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
12670 message.
12671
22e304a6
AD
126722003-03-02 Akim Demaille <akim@epita.fr>
12673
22e304a6
AD
12674 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
12675 Use them to exercise yycheck overrun.
12676 Based on Andrew Suffield's grammar.
12677
67a25fed
AD
126782003-03-02 Akim Demaille <akim@epita.fr>
12679
12680 Create tests/local.at for Bison generic testing macros.
12681
12682 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
12683 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
12684 This new file.
12685 * tests/calc.at (AT_CHECK_CALC): Adjust.
12686 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
12687 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
12688 * tests/local.at: here.
12689 (AT_COMPILE_CXX): Tags the tests using it as c++.
12690 Ignore the test if CXX is not functional.
12691
9c2b381f
PE
126922003-03-01 Paul Eggert <eggert@twinsun.com>
12693
12694 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
12695 not loc->end, since loc->end might contain garbage and this leads
12696 to undefined behavior on some platforms.
12697 (id_loc, token_start): Use (IF_LINTed) initial values that do not
12698 depend on *loc, so that the reader doesn't give the the false
12699 impression that *loc is initialized.
12700 (<INITIAL>"%%"): Do not bother setting code_start, since its value
12701 does not survive the return.
12702
0433ba88
AD
127032003-03-01 Akim Demaille <akim@epita.fr>
12704
12705 * src/scan-gram.l (code_start): Always initialize it when entering
12706 into yylex, as SC_EPILOGUE is activated *before* the corresponding
12707 yylex invocation. An alternative would be making it static, but
12708 then it starts with the second %%'s beginning, instead of its end.
12709
b305ea69
PE
127102003-02-28 Paul Eggert <eggert@twinsun.com>
12711
12712 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
12713 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 12714 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 12715
c3d25e01
PE
127162003-02-26 Paul Eggert <eggert@twinsun.com>
12717
12718 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
12719 Remove Sequent/Pyramid discussion (nobody uses them any more).
12720 Merge VMS and MS-DOS discussion; these ports may well be dead
12721 but let's keep mentioning them for now. Put <> around email
12722 addresses. Add copyright notice.
12723
c267ffbc
PE
127242003-02-24 Paul Eggert <eggert@twinsun.com>
12725
12726 * data/glr.c (yy_reduce_print): yylineno -> yylno,
12727 to avoid collision with flex use of yylineno.
12728 Problem reported by Bruce Lilly in
161a71f3 12729 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
12730 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
12731 * data/yacc.c (yy_reduce_print): Likewise.
12732
12733 * config/depcomp: Sync with Automake 1.7.3.
12734
f939fc12
AD
127352003-02-21 Akim Demaille <akim@epita.fr>
12736
12737 * data/lalr1.cc: Use temporary variables instead of casts to
12738 change integer types.
12739 Suggested by Paul Eggert.
12740
95923bd6
AD
127412003-02-21 Akim Demaille <akim@epita.fr>
12742
12743 * doc/bison.texinfo: Use "location" consistently to refer to @n,
12744 to avoid confusions with lalr1.cc's notion of Position.
12745 Suggested by Paul Eggert.
12746
2cdc240e
AD
127472003-02-20 Akim Demaille <akim@epita.fr>
12748
12749 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
12750 before initial_columns.
12751 (location.hh): Use consistent variable names when defining the
12752 operator<<.
12753 Use "last" so that we subtract from Positions, not from unsigned.
12754
5d003116
AD
127552003-02-20 Akim Demaille <akim@epita.fr>
12756
12757 * data/lalr1.cc (position.hh): New subfile, including the extended
12758 and Doxygen'ed documentation of class Position.
12759 (location.hh): Use it.
12760 Document a` la Doxygen.
ba1ecc07 12761 With the help of Benoit Perrot.
5d003116 12762
d02b25f9
AD
127632003-02-20 Akim Demaille <akim@epita.fr>
12764
12765 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
12766 AT_YACC_IF.
12767 Redefine AT_YYERROR_SEES_LOC_IF using it.
12768 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
12769 not defined.
12770 Don't use the location in yy::Parser::error_ and
12771 yy::Parser::print_ when not %locations.
12772 Activate more lalr1.cc tests.
12773
0d1c3a04
AD
127742003-02-19 Akim Demaille <akim@epita.fr>
12775
12776 * data/lalr1.cc: When displaying a line number, be sure to make it
12777 an int.
12778
60a777aa
AD
127792003-02-19 Akim Demaille <akim@epita.fr>
12780
12781 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
12782 Remove, useless.
12783 (YYABORT, YYACCEPT, YYERROR): New.
12784 * tests/calc.at: Renable the lalr1.cc test.
12785
0b86fc41
AD
127862003-02-19 Akim Demaille <akim@epita.fr>
12787
12788 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
12789 error recovery, mixing with/without pops and discarding of the
12790 lookahead.
12791 Exercise YYERROR.
12792 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
12793
da99a5dc
PE
127942003-02-17 Paul Eggert <eggert@twinsun.com>
12795
12796 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
12797 * tests/testsuite.at (AT_COMPILE): Use them.
12798 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 12799 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 12800
93b8c255
PE
128012003-02-12 Paul Eggert <eggert@twinsun.com>
12802
12803 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
12804 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 12805 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
12806 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
12807 Check for malloc failure, for consistency with yacc.c.
12808 (yytname_size): Remove, for consistency with yacc.c.
12809
12810 The bug still remains in data/lalr1.cc, as I didn't have time
12811 to fix it there.
12812
7548fed2
AD
128132003-02-06 Akim Demaille <akim@epita.fr>
12814
12815 * configure.ac (GXX): Rename as...
12816 (CXX): this, to keep the original Autoconf semantics.
12817 Require 2.57.
12818 * data/lalr1.cc: Fix b4_copyright invocations.
12819 If YYDEBUG is not defined, don't depend upon name_ being defined.
12820 (location.hh): Include string and iostream.
12821 (Position::filename): New member.
12822 (Position::Position ()): New.
12823 (operator<< (Position)): New.
12824 (operator- (Position, int)): New.
12825 (Location::first, Location::last): Rename as...
12826 (Location::begin, Location::end): these, to mock the conventional
12827 iterator names.
12828 (operator<< (Location)): New.
12829 * tests/atlocal.in (CXX): New.
12830 * tests/testsuite.at (AT_COMPILE_CXX): New.
12831 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
12832 locations in a more synthetic way.
12833 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
12834 lalr1.cc is used.
12835 Adjust the C locations to match those from Emacs: first column is
12836 column 0.
12837 Change all the expected results.
12838 Conform to the GCS: simplify the locations when applicable.
12839 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
12840 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
12841 these CPP macros with the m4 macros new defined by...
12842 (AT_CHECK_PUSHDEFS): this, i.e.:
12843 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 12844 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
12845 New macros.
12846 (AT_CHECK_POPDEFS): Undefine them.
12847 (AT_CHECK_CALC_LALR1_CC): New.
12848 Use it for the first lalr1.cc test.
12849
43a176ef
AD
128502003-02-04 Akim Demaille <akim@epita.fr>
12851
12852 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
12853 Location as is defined.
12854
fc049e9c
AD
128552003-02-04 Akim Demaille <akim@epita.fr>
12856
12857 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
12858 name_ being defined.
12859
a737b216
PE
128602003-02-03 Paul Eggert <eggert@twinsun.com>
12861
12862 * src/gram.h (start_symbol): Remove unused decl.
12863
12864 Use more-consistent naming conventions for local vars.
12865
12866 * src/derives.c (derives_compute): Change type of local var from
12867 int to rule_number.
12868 * src/gram.c (grammar_rules_partial_print): Likewise.
12869 * src/print.c (print_core): Likewise.
12870 * src/reduce.c (reduce_grammar_tables): Likewise.
12871
12872 * src/gram.c (grammar_dump): Change name of item_number *
12873 local var from r to rp.
12874 * src/nullable.c (nullable_compute): Likewise.
12875
12876 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
12877
12878 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
12879 for symbol or symbol_number var.
12880 * src/reader.c (grammar_start_symbol_set): Likewise.
12881 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
12882 Likewise.
12883 * src/state.c (transitions_to): Likewise.
12884 * src/state.h: Likewise.
12885 * src/tables.c (symbol_number_to_vector_number): Likewise.
12886
12887 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
12888 char * var.
12889
12890 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
12891 var.
12892
12893 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
12894 var.
12895
12896 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
12897 Use str, not s, for char * var. Use ch, not c, for character var.
12898 Use size for size var.
12899
12900 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
12901 char * var.
12902 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
12903 uniqstr var.
12904 * src/uniqstr.h: Likewise.
12905
12906 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
12907 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
12908 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
12909 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
12910 param to have same name as that of enum, so that we don't use
12911 "s" to stand for a non-state.
12912
68e93ad5
AD
129132003-02-02 Akim Demaille <akim@epita.fr>
12914
12915 * src/scan-skel.l: Scan more than one inert character per yylex
12916 invocation.
12917
92898986
PE
129182003-02-01 Paul Eggert <eggert@twinsun.com>
12919
12920 Version 1.875a.
12921
1d9d5d71
PE
12922 * po/LINGUAS: Add ms.
12923
0435d061
AD
129242003-01-30 Akim Demaille <akim@epita.fr>
12925
12926 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
12927
6029a57f
PH
129282003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12929
12930 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
12931 of $1.
0435d061
AD
12932
12933 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 12934 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 12935 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 12936
6029a57f
PH
12937 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
12938 (b4_rhs_location): Ditto.
0435d061 12939 (yyfill): New function to copy from stack tree into array
6029a57f 12940 incrementally.
0435d061
AD
12941 (yyuserAction): Modify to allow incremental move of semantic values
12942 to rhs array when in GLR mode.
12943 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
12944 as needed.
12945 Remove dummy use of yystack, as there is now a guaranteed use.
12946 (yydoAction): Modify to allow incremental move of semantic values
12947 to rhs array when in GLR mode.
12948 (yyresolveAction): Ditto.
12949 (yyglrShiftDefer): Update comment.
0435d061 12950 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
12951 (yyglrReduce): Ditto.
12952 (yydoAction): Ditto
0435d061 12953
6029a57f
PH
12954 * tests/glr-regr1.at: Rename to ...
12955 * tests/glr-regression.at: Add new regression test for the problems
12956 described above (adapted from S. Eken).
12957 Update copyright notice.
12958 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
12959 * tests/Makefile.am: Ditto.
12960
6cee6297
PE
129612003-01-28 Paul Eggert <eggert@twinsun.com>
12962
12963 * data/lalr1.cc: Do not use @output_header_name@ unless
12964 b4_defines_flag is set. This fixes two bugs reported by
12965 Tim Van Holder in
161a71f3
PE
12966 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
12967 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 12968
b2a836b5
PE
129692003-01-21 Paul Eggert <eggert@twinsun.com>
12970
12971 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
12972 we don't need to worry about yyerrlab1 being reported as an
12973 "unused label" by non-GCC C compilers. The downside is that if
12974 locations are used then a couple of statements are duplicated each
12975 time YYERROR is invoked, but the upside is that the warnings
12976 should vanish.
12977 (yyerrlab1): Move code to YERROR.
12978 (yyerrlab2): Remove. Change uses back to yyerrlab1.
12979 This reverts some of the 2002-12-27 change.
12980
4196b931
PE
129812003-01-17 Paul Eggert <eggert@twinsun.com>
12982
12983 * src/output.c (symbol_printers_output): Fix typo that led
12984 to core dump. Problem reported by Antonio Rus in
161a71f3 12985 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 12986
3ae831b4
AD
129872003-01-13 Akim Demaille <akim@epita.fr>,
12988 Quoc Peyrot <chojin@lrde.epita.fr>,
12989 Robert Anisko <anisko_r@lrde.epita.fr>
12990
12991 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
12992 when the stacks contain one element, as the loop would otherwise
12993 free the last state, and then use the top state (the one we just
12994 popped). This means that the initial elements will not be freed
12995 explicitly, as is the case in yacc.c; it is not a problem, as
12996 these elements have fake values.
12997
e3aa65c5
PE
129982003-01-11 Paul Eggert <eggert@twinsun.com>
12999
13000 * NEWS: %expect-violations are now just warnings, reverting
13001 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
13002 bootstrapping problem reported by Matthias Klose; see
161a71f3 13003 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
13004 * src/conflicts.c (conflicts_print): Likewise.
13005 * tests/conflicts.at (%expect not enough, %expect too much,
13006 %expect with reduce conflicts): Likewise.
13007 * doc/bison.texinfo (Expect Decl): Document this. Also mention
13008 that the warning is enabled if the number of conflicts changes
13009 (not necessarily increases).
13010
13011 * src/getargs.c (version): Update copyright year.
13012
f0057011
AD
130132003-01-09 Akim Demaille <akim@epita.fr>
13014
13015 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
13016
1ee6d2a0
PE
130172003-01-08 Paul Eggert <eggert@twinsun.com>
13018
13019 * Makefile.maint (WGETFLAGS):
13020 New macro, containing "-C off" to disable proxy caches.
13021 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
13022 (rel-check): Use $(WGET) instead of wget.
13023
d4fd77c4
PE
130242003-01-06 Paul Eggert <eggert@twinsun.com>
13025
13026 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
13027 the GLR paper of Scott, Johnstone and Hussain.
13028
464c6927
PE
130292003-01-04 Paul Eggert <eggert@twinsun.com>
13030
d600ee67
PE
13031 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
13032 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
13033 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
13034 (EXTRA_LIBRARIES): New var, for liby.a.
13035 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
13036 (EXTRA_SCRIPTS): New var, for yacc.
13037
464c6927
PE
13038 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
13039 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
13040 Problem reported by Nelson H. F. Beebe.
13041
130422003-01-03 Paul Eggert <eggert@twinsun.com>
13043
13044 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
13045 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
13046 when compiling Bison 1.875's `bitset bset = obstack_alloc
13047 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
13048
13049 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
13050 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
13051 grow to a huge size with typical invocation.
d600ee67 13052
464c6927
PE
13053 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
13054 Use the pattern recommended by Autoconf 2.57, except also protect
13055 against double-definition.
13056 * src/system.h: Likewise.
13057 Portability issues reported by Nelson H. F. Beebe.
d600ee67 13058
464c6927
PE
13059 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
13060 All uses changed. Provide a definition in both C and C++.
13061 (yytrue, yyfalse): Define even if defined (__cplusplus).
13062
13063 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
13064 Reported by Nelson H. F. Beebe.
d600ee67 13065
464c6927
PE
13066 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
13067
0f42c7d5
PE
130682003-01-02 Paul Eggert <eggert@twinsun.com>
13069
13070 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
13071 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
13072 Bug reported by Nelson H. F. Beebe.
13073
dc546b0f
PE
130742003-01-01 Paul Eggert <eggert@twinsun.com>
13075
13076 * Version 1.875.
13077
2c09b6a7
PE
130782002-12-30 Paul Eggert <eggert@twinsun.com>
13079
13080 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
13081 Moved here from...
13082 (<INITIAL>","): Here. This causes stray "," to be treated
13083 more uniformly.
13084
dc546b0f 13085 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
13086 last brace in braced code when not in Yacc mode, for compatibility
13087 with Bison 1.35. This resurrects the 2001-12-15 patch to
13088 src/reader.c.
13089
13090 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
13091 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
13092
535c0f63
PE
130932002-12-28 Paul Eggert <eggert@twinsun.com>
13094
13095 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
13096 that of SYM's type. This fixes Debian bug 168069, reported by
13097 Thomas Olsson.
d600ee67 13098
963fcc17
PE
130992002-12-28 Paul Eggert <eggert@twinsun.com>
13100
13101 Version 1.75f.
13102
13103 Switch back to the Yacc style of conflict reports, undoing some
13104 of the 2002-07-30 change.
13105 * doc/bison.texinfo (Understanding): Use Yacc style for
13106 conflict reports. Also, use new way of locating rules.
13107 * src/conflicts.c (conflict_report):
13108 Renamed from conflict_report_yacc, removing the old
13109 'conflict_report'. Translate the entire conflict report at once,
13110 so that we don't assume that "," has the same interpretation in
13111 all languages.
13112 (conflicts_output): Use Yacc-style conflict report for each state,
13113 instead of our more-complicated style.
13114 (conflicts_print): Use Yacc-style conflict report, except print
13115 the input file name when not emulating Yacc.
13116 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
13117 Conflicted Reduction, %expect not enough, %expect too much,
13118 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
13119 * tests/existing.at (GNU Cim Grammar): Likewise.
13120 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
13121
13122 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
13123 fatal): Don't invoke fflush; it's not needed and it might even be
13124 harmful for stdout, as stdout might not be open.
13125 * src/reduce.c (reduce_print): Likewise.
13126
b1efe548
PE
131272002-12-27 Paul Eggert <eggert@twinsun.com>
13128
13129 Fix a bug where error locations were not being recorded correctly.
13130 This problem was originally reported by Paul Hilfinger in
161a71f3 13131 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
13132
13133 * data/yacc.c (yyparse): New local var yylerrsp, to record the
13134 top of the location stack's error locations.
13135 (yyerrlab): Set it. When discarding a token, push its location
13136 onto yylerrsp so that we don't lose track of the error's end.
13137 (yyerrlab1): Now is only the target of YYERROR, so that we can
13138 properly record the location of the action that failed. For GCC
13139 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
13140 GCC warning about yyerrlab1 being unused if YYERROR is unused.
13141 (yyerrlab2): New label, which yyerrlab now falls through to.
13142 Compute the error's location by applying YYLLOC_DEFAULT to
13143 the locations of all the symbols that went into the error.
13144 * doc/bison.texinfo (Location Default Action): Mention that
13145 YYLLOC_DEFAULT is also invoked for syntax errors.
13146 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
13147 Error locations include the locations of all the tokens that were
13148 discarded, not just the last token.
d600ee67 13149
983c5c2c
PE
131502002-12-26 Paul Eggert <eggert@twinsun.com>
13151
b1efe548
PE
13152 * src/files.c: Include quote.h.
13153 (compute_output_file_names): Warn if we detect conflicting
13154 outputs to the same file. This should catch the misunderstanding
13155 exemplified by Debian Bug 165349, reported by Bruce Stephens..
13156
13157 * src/conflicts.c (conflicts_print): If the user specifies
13158 "%expect N", report an error if there are any reduce/reduce
13159 conflicts. This is what the manual says should happen.
13160 This fixes Debian bug 130890, reported by Anthony DeRobertis.
13161 * tests/conflicts.at (%expect with reduce conflicts): New test.
13162
983c5c2c
PE
13163 Don't use m4_include on relative file names, as it doesn't work as
13164 desired if there happens to be a file with that name under ".".
d600ee67 13165
983c5c2c
PE
13166 * m4sugar/version.m4: Remove; it was included but it wasn't used.
13167 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
13168 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
13169 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
13170 * src/output.c (output_skeleton): Use full path names when
13171 specifying a file to include; don't rely on include path, as
13172 it's unreliable when the working file contains a file with
13173 that name.
d600ee67 13174
983c5c2c
PE
131752002-12-25 Paul Eggert <eggert@twinsun.com>
13176
13177 Remove obsolete references to bison.simple and bison.hairy.
13178 Problem mentioned by Aubin Mahe in
161a71f3 13179 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
13180 * data/glr.c: Comment fix.
13181 * doc/bison.1: Remove references. Also, mention "yacc".
13182
13183 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
13184 with -g option.
13185
13186 * src/parse-gram.y (declaration): Use enum "report_states" rather
13187 than its numeric value 1.
13188
13189 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
13190 opening a new one. This fixes Debian bug 165349, reported by
13191 Bruce Stephens.
13192
23f2d9dc
PE
131932002-12-24 Paul Eggert <eggert@twinsun.com>
13194
13195 Version 1.75e.
13196
13197 * Makefile.maint (cvs-update): Don't assume that the shell
13198 supports $(...), as Solaris sh doesn't.
13199
13200 * src/parse-gram.y (lloc_default): Remove test for empty
13201 nonterminals at the end, since it didn't change the result.
13202
132032002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
13204
13205 If the user does not define YYSTYPE as a macro, Bison now declares it
13206 using typedef instead of defining it as a macro. POSIX requires this.
13207 For consistency, YYLTYPE is also declared instead of defined.
13208
13209 %union directives can now have a tag before the `{', e.g., the
13210 directive `%union foo {...}' now generates the C code
13211 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
13212 The default union tag is `YYSTYPE', for compatibility with Solaris 9
13213 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
13214 instead of `yyltype'.
13215
13216 `yystype' and `yyltype' are now obsolescent macros instead of being
13217 typedefs or tags; they are no longer documented and will be
13218 withdrawn in a future release.
13219
13220 * data/glr.c (b4_location_type): Remove.
13221 (YYSTYPE): Renamed from yystype.
13222 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
13223 (struct YYLTYPE): Renamed from struct yyltype.
13224 (YYLTYPE): Renamed from yyltype.
13225 (yyltype, yystype): New (and obsolescent) macros,
13226 for backward compatibility.
13227 * data/yacc.c: Likewise.
13228
13229 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
13230 does not specify a union tag. This is for compatibility with
13231 Solaris 9 yacc.
13232
13233 * src/parse-gram.y (add_param): 2nd arg is now char * not char
13234 const *, since it is now modified by stripping surrounding { }.
13235 (current_braced_code): Remove.
13236 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
13237 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
13238 trailing " {...}". Now of type <chars>.
13239 (grammar_declaration): Adjust to bundled tokens.
13240 (code_content): Remove; stripping is now done by add_param.
13241 (print_token_value): Print contents of bundled tokens.
13242 (token_name): New function.
13243
13244 * src/reader.h (braced_code, current_braced_code): Remove.
13245 (token_name): New decl.
13246
13247 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
13248 token_type, not braced_code code_kind. All uses changed.
13249 (SC_PRE_CODE): New state, for scanning after a keyword that
13250 has (or usually has) an immediately-following braced code.
13251 (token_type): New local var, to keep track of which token type
13252 to return when scanning braced code.
13253 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 13254 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
13255 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
13256 instead of returning a token type immediately.
13257 (<INITIAL>"{"): Set token type.
13258 (<SC_BRACED_CODE>"}"): Use it.
13259 (handle_action_dollar, handle_action_at): Now returns bool
13260 indicating success. Fail if ! current_rule; this prevents a core dump.
13261 (handle_symbol_code_dollar, handle_symbol_code_at):
13262 Remove; merge body into caller.
13263 (handle_dollar, handle_at): Complain in invalid contexts.
13264
13265 * NEWS, doc/bison.texinfo: Document the above.
13266 * NEWS: Fix years and program names in copyright notice.
13267
879ca4f8
PE
132682002-12-17 Paul Eggert <eggert@twinsun.com>
13269
13270 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
13271 Reporting, Table of Symbols): Omit mentions of %lex-param and
13272 %parse-param from the documentation for now.
13273
1c5fe69d
PE
132742002-12-15 Paul Eggert <eggert@twinsun.com>
13275
13276 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
13277 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
13278 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
13279 disagreed with the Bison documentation. Bug
13280 reported by Andrew Walrond.
d600ee67 13281
1c5fe69d
PE
13282 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
13283 as the caller now does that.
13284 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
13285 (YYEMPTY): Parenthesize right hand side, since others use it.
13286 (yyparse): Don't assume that our generated code is the only code
13287 that sets yychar.
13288
d1de5372
PE
132892002-12-13 Paul Eggert <eggert@twinsun.com>
13290
13291 Version 1.75d.
13292
13293 POSIX requires a "yacc" command.
13294 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
13295 (MOSTLYCLEANFILES): Add yacc.
13296 (yacc): New rule.
1c5fe69d 13297 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
13298 as an alias for bison y.
13299
13300 * po/LINGUAS: Add da.
d600ee67 13301
d1de5372
PE
13302 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
13303 problem with latest <getopt.h>.
13304 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
13305
13306 * doc/fdl.texi: Upgrade to 1.2.
13307 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
13308 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
13309 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
13310 gnulib.
13311 * config/install-sh: Sync with autotools.
13312
13313 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 13314 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
13315 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
13316 locations are requested.
13317 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
13318 locations are requested.
13319
d0f3fe23
PE
133202002-12-12 Paul Eggert <eggert@twinsun.com>
13321
13322 Remove unportable casts and storage allocation tricks.
13323 While we're at it, remove almost all casts, since they
13324 usually aren't needed and are a sign of trouble.
13325
13326 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
13327
13328 * src/derives.c (derives_compute): Do not subtract NTOKENS from
13329 the pointer DSET returned by malloc; this isn't portable.
13330 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
13331 Similarly for DERIVES.
13332 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
13333 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
13334 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
13335
13336 * src/derives.c (derives_compute): Do not bother invoking
13337 int_of_rule_number, since rule numbers are integers.
13338
13339 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
13340 rather than XMALLOC (char, N).
13341
13342 * src/files.c (filename_split): Rewrite to avoid cast.
13343
13344 * src/gram.h (symbol_number_as_item_number,
13345 item_number_as_symbol_number, rule_number_as_item_number,
13346 item_number_as_rule_number):
13347 Now inline functions rather than macros, to avoid casts.
13348 * src/state.h (state_number_as_int): Likewise.
13349 * src/tables.c (state_number_to_vector_number,
13350 symbol_number_to_vector_number): Likewise.
13351
13352 * src/gram.h (int_of_rule_number): Remove; no longer used.
13353
13354 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
13355 since the resulting storage is always stored into.
13356
13357 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
13358 where it's needed.
13359
13360 * src/muscle_tab.c (muscle_m4_output):
13361 Now inline. Return bool, not int.
13362 * src/state.c (state_compare): Likewise.
13363 * src/symtab.c (symbol_check_defined,
13364 symbol_check_alias_consistency, symbol_pack, symbol_translation,
13365 hash_compare_symbol, hash_symbol):
13366 Likewise.
13367 * src/uniqstr.c (uniqstr_print): Likewise.
13368 * src/muscle_tab.c (muscle_m4_output_processor):
13369 New function, to avoid casts.
13370 * src/state.c (state_comparator, stage_hasher): Likewise.
13371 * src/symtab.c (symbol_check_defined_processor,
13372 symbol_check_alias_consistency_processor, symbol_pack_processor,
13373 symbol_translation_processor, hash_symbol_comparator,
13374 hash_symbol_hasher): Likewise.
13375 * src/uniqstr.c (uniqstr_print_processor): Likewise.
13376 * src/muscle_tab.c (muscles_m4_output):
13377 Use new functions instead of casting old functions unportably.
13378 * src/state.c (state_hash_new): Likewise.
13379 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
13380 symbols_token_translations_init):
13381 Likewise.
13382 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
13383
13384 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
13385 var instead of casting to long, to avoid casts.
13386 (prepare_states): Use MALLOC rather than alloca, so that we don't
13387 have to worry about alloca.
13388 * src/state.c (state_hash_lookup): Likewise.
13389
13390 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
13391 local var instead of casting to unsigned char, to avoid casts.
13392
13393 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
13394 STATE_ALLOC): Remove.
13395 (transitions_new, errs_new, reductions_new, state_new): Use malloc
13396 rather than calloc, and use offsetof to avoid allocating slightly
13397 too much storage.
13398 (state_new): Initialize all members.
13399
13400 * src/state.c (state_hash): Use unsigned accumulator, not signed.
13401
13402 * src/symtab.c (symbol_free): Remove; unused.
13403 (symbol_get): Remove cast in lhs of assignment.
13404 (symbols_do): Now static. Accept generic arguments, not
13405 hashing-related ones.
13406
13407 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
13408 (symbol_processor): Remove.
13409 (symbols_do): Remove decl; now static.
13410
13411 * src/system.h (alloca): Remove; decl no longer needed.
13412 (<stddef.h>): Include, for offsetof.
13413 (<inttypes.>, <stdint.h>): Include if available.
13414 (uintptr_t): New type, if system lacks it.
13415 (CALLOC, MALLOC, REALLOC): New macros.
13416 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
13417 new macros.
13418
13419 * src/tables.c (table_size): Now int, to pacify GCC.
13420 (table_grow, table_ninf_remap): Use signed table size.
13421 (save_row): Don't bother initializing locals when not needed.
13422 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
13423 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
13424
13425 * src/vcg.h: Correct misspellings.
13426
13427 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
13428
13429
13430 * src/getargs.c (getargs): Don't assume EOF == -1.
13431
26b4a969
PE
134322002-12-09 Paul Eggert <eggert@twinsun.com>
13433
13434 Change identifier spellings to avoid collisions with names
13435 that are reserved by POSIX.
13436
13437 Don't use names ending in _t, since POSIX reserves them.
13438 For consistency, remove _e and _s endings -- they're weren't
13439 needed to remove ambiguity. All uses changed.
13440 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
13441 turn was just renamed from struniq_t.
13442 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
13443 which in turn was just renamed from struniq_processor_t.
13444 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
13445 in turn was renamed from hash_compare_struniq_t.
13446 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
13447 (state_list): Renamed from state_list_t.
13448 * src/assoc.h (assoc): Renamed from assoc_t.
13449 * src/conflicts.c (enum conflict_resolution): Renamed from
13450 enum conflict_resolution_e.
13451 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
13452 (rule_list): Renamed from rule_list_t.
13453 * src/getargs.h (enum trace): Renamed from enum trace_e.
13454 (enum report): Renamed from enum report_e.
13455 * src/gram.h (item_number): Renamed from item_number_t.
13456 (rule_number): Renamed from rule_number_t.
13457 (struct rule_s): Remove the "rule_s" part; not used.
13458 (rule): Renamed from rule_t.
13459 (rule_filter): Renamed from rule_filter_t.
13460 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
13461 (goto_list): Renamed from goto_list_t.
13462 * src/lalr.h (goto_number): Renamed from goto_number_t.
13463 * src/location.h (location): Renamed from location_t.
13464 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
13465 and moved here from:
13466 * src/muscle_tab.h (muscle_entry_t): here.
13467 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
13468 (rule_list): Renamed from rule_list_t.
13469 * src/print_graph.c (static_graph): Renamed from graph.
13470 * src/reader.h (braced_code): Renamed from braced_code_t.
13471 Remove brace_code_e tag.
13472 * src/relation.h (relation_node): Renamed from relation_node_t.
13473 (relation_nodes): Renamed from relation_nodes_t.
13474 (relation): Renamed from relation_t.
13475 * src/state.h (state_number): Renamed from state_number_t.
13476 (struct state): Renamed from struct state_s.
13477 (state): Renamed from state_t.
13478 (transitions): Renamed from transitions_t. Unused (and
13479 misspelled) transtion_s tag removed.
13480 (errs): Renamed from errs_t. Unused errs_s tag removed.
13481 (reductions): Renamed from reductions_t. Unused tag
13482 reductions_s removed.
13483 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
13484 (struct symbol_list): Renamed from struct symbol_list_s.
13485 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
13486 (struct symbol): Renamed from struct symbol_s.
13487 (symbol): Renamed from symbol_t.
13488 * src/tables.c (vector_number): Renamed from vector_number_t.
13489 (action_number): Renamed from action_t.
13490 * src/tables.h (base_number): Renamed from base_t.
13491 * src/vcg.h (enum color): Renamed from enum color_e.
13492 (enum textmode): Renamed from enum textmode_e.
13493 (enum shape): Renamed from enum shape_e.
13494 (struct colorentry): Renamed from struct colorentry_s.
13495 (struct classname): Renamed from struct classname_s.
13496 (struct infoname): Renamed from struct infoname_s.
13497 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
13498 (enum decision): Renamed from enum decision_e.
13499 (enum orientation): Renamed from enum orientation_e.
13500 (enum alignment): Renamed from enum alignment_e.
13501 (enum arrow_mode): Renamed from enum arrow_mode_e.
13502 (enum crossing_type): Renamed from enum crossing_type_e.
13503 (enum view): Renamed from enum view_e.
13504 (struct node): Renamed from struct node_s.
13505 (node): Renamed from node_t.
13506 (enum linestyle): Renamed from enum linestyle_e.
13507 (enum arrowstyle): Renamed from enum arrowstyle_e.
13508 (struct edge): Renamed from struct edge.
13509 (edge): Renamed from edge_t.
13510 (struct graph): Renamed from struct graph_s.
13511 (graph): Renamed from graph_t.
13512 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
13513 Rename value_t -> value.
13514 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
13515 value_t_as_yystype -> value_as_yystype.
13516
13517 Don't include <errno.h> in the mainstream code, since it
13518 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
13519 * lib/get-errno.c, lib/get-errno.h: New files.
13520 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
13521 get-errno.c.
13522 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
13523 * src/output.c (output_skeleton): Likewise.
13524 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
13525 instead of errno.
13526 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
13527 Likewise.
13528 (handle_action_dollar, handle_action_at): Likewise.
13529 * src/system.h: Do not include <errno.h>.
13530 (TAB_EXT): Renamed from EXT_TAB.
13531 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
13532
13533 Avoid str[a-z]*, since <string.h> reserves that name space.
13534 Change all instances of "struniq" in names to "uniqstr", and
13535 likewise for "STRUNIQ" and "UNIQSTR".
13536 * src/uniqstr.c: Renamed from src/struniq.c.
13537 * src/uniqstr.h: Renamed from src/struniq.h.
13538 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
13539 * src/files.c (strsuffix): Remove; unused.
13540 (concat2): Renamed from stringappend. Now static.
13541 * src/files.h (strsuffix, stringappend): Remove; unused.
13542 * src/parse-gram.y (<chars>): Renamed from <string>.
13543 (<uniqstr>): Renamed from <struniq>.
13544 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
13545 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
13546 (struct graph_s.expand): Renamed from struct graph_s.stretch.
13547 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
13548 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
13549 (N_EXPAND): Renamed from N_STRETCH.
13550
13551 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
13552 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
13553 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
13554 Remove; unused.
13555 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
13556 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
13557 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
13558 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
13559 (BASE_MAXIMUM): Renamed from BASE_MAX.
13560 (BASE_MINIMUM): Renamed from BASE_MIN.
13561 (ACTION_MAX): Remove; unused.
13562 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
13563 Unnecessary casts removed from above defines.
13564
13565
13566 Fix misspelling in names.
13567 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
13568 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
13569 G_NODE_ALIGNEMENT.
13570
13571
13572 * lib/timevar.c (timevar_report): Renamed from time_report,
13573 for consistency with other names.
13574 * lib/timevar.h (timevar_report): New decl.
13575 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
13576
13577
13578 Sort include-file uses.
13579
13580 Reorder all include files under src to be in the order "system.h".
13581 then the ../lib include files in angle brackets (alphabetized),
13582 then the . include files in double-quotes (alphabetized). Fix
13583 dependency breakages encountered in this process, as follows:
13584 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
13585 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
13586 * src/state.h: Include "symtab.h".
13587
996b1c7e
PE
135882002-12-08 Paul Eggert <eggert@twinsun.com>
13589
13590 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
13591 since this causes problems when __file__ contains character
13592 sequences like "@" that are treated specially by src/scan-skel.l.
13593 Instead, just use the file's basename. This fixes the bug
13594 reported by Martin Mokrejs in
161a71f3 13595 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 13596
e19c4e5d
PE
135972002-12-06 Paul Eggert <eggert@twinsun.com>
13598
13599 Add support for rules that do not have trailing semicolons, as
13600 POSIX requires. Improve the quality of locations in Bison
13601 diagnostics.
26b4a969 13602
e19c4e5d
PE
13603 * src/location.c: Include <quotearg.h>.
13604 (empty_location): Now const.
13605 (location_print): New function. Follow the recommendation of the
13606 GNU Coding Standards for locations that span file boundaries.
13607 * src/location.h: Do not include <quotearg.h>; no longer needed.
13608 (boundary): New type.
13609 (location_t): Use it. This allows locations to span file boundaries.
13610 All member uses changed: file -> start.file or end.file (as needed),
13611 first_line -> start.line, first_column -> start.column,
13612 last_line -> end.line, last_column -> end.column.
13613 (equal_boundaries): New function.
13614 (LOCATION_RESET, LOCATION_STEP): Remove.
13615 (LOCATION_PRINT): Remove. All callers changed to use location_print.
13616 (empty_location): Now const.
13617 (location_print): New decl.
13618 * src/parse-gram.y (lloc_default): New function, which handles
13619 empty locations more accurately.
13620 (YYLLOC_DEFAULT): Use it.
13621 (%token COLON): Remove.
13622 (%token ID_COLON): New token.
26b4a969 13623 (rules): Use it.
e19c4e5d
PE
13624 (declarations, rules): Remove trailing semicolon.
13625 (declaration, rules_or_grammar_declaration):
13626 Allow empty (";") declaration.
13627 (symbol_def): Remove empty actions; no longer needed.
13628 (rules_or_grammar_declaration): Remove trailing semicolon.
13629 (semi_colon.opt): Remove.
13630 * src/reader.h: Include location.h.
13631 (scanner_cursor): New decl.
13632 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
13633 rolling our own.
13634 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
13635 of *loc.
13636 (STEP): Remove. No longer needed, now that adjust_location does
13637 the work. All uses removed.
13638 (scanner_cursor): New var.
13639 (adjust_location): Renamed from extend_location. It now sets
13640 *loc and adjusts the scanner cursor. All uses changed.
13641 Don't bother testing for CR.
13642 (handle_syncline): Remove location arg; now updates scanner cursor.
13643 All callers changed.
13644 (unexpected_end_of_file): Now accepts start boundary of token or
13645 comment, not location. All callers changed. Update scanner cursor,
13646 not the location.
13647 (SC_AFTER_IDENTIFIER): New state.
13648 (context_state): Renamed from c_context. All uses changed.
13649 (id_loc, code_start, token_start): New local vars.
13650 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
13651 processing of Yacc white space and equivalents here.
13652 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
13653 instead of returning ID immediately, since we need to search for
13654 a subsequent colon.
13655 (<INITIAL>"'", "\""): Save token_start.
13656 (<INITIAL>"%{", "{", "%%"): Save code_start.
13657 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
13658 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
13659 BEGIN context_state at end, not INITIAL.
13660 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
13661 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
13662 Return correct token start.
13663 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
13664 the start of a character, string or multiline comment is found.
13665 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
13666 Reduction): Adjust reported locations to match the more-precise
13667 results now expected.
13668 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
13669 * tests/reduce.at (Useless Rules, Reduced Automaton,
13670 Underivable Rules): Likewise.
13671 * tests/regression.at (Invalid inputs): No longer `expecting ";"
13672 or "|"' now that so many other tokens are allowed by the new grammar.
13673
13674 * src/complain.h (current_file): Remove duplicate decl;
13675 current_file is now owned by files.h.
13676 * src/complain.c, src/scan-gram.l: Include files.h.
13677
136782002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 13679
e19c4e5d
PE
13680 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
13681 promotes to int; it might be unsigned int.
13682 * data/yacc.c (yy_reduce_print): Likewise.
13683
13684 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
13685 be #defined in the prologue, not in the Bison declarations.
13686 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 13687
b64755e3
PE
136882002-12-02 Paul Eggert <eggert@twinsun.com>
13689
13690 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
13691 * lib/strtoul.c: New file, from gnulib.
13692 This fixes a porting bug reported by Peter Klein in
161a71f3 13693 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 13694
6e746484
PE
136952002-11-30 Paul Eggert <eggert@twinsun.com>
13696
b64755e3
PE
13697 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
13698 and put only a forward declaration in the prologue. This is for
13699 consistency with the other scanner helper functions.
13700
6ba55592
PE
13701 Type clashes now generate warnings, not errors, since it
13702 appears that POSIX may allow some grammars with type clashes.
13703 * src/reader.c (grammar_current_rule_check): Warn about
13704 type clashes instead of complaining.
13705 * tests/input.at (Type Clashes): Expect warnings, not complaints.
13706
6e746484
PE
13707 Add Yacc library, since POSIX requires it.
13708 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
13709 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
13710 * lib/main.c, lib/yyerror.c: New files.
13711
13712 gram_error can be static; it need not be extern.
13713 * src/reader.h (gram_error): Remove decl.
13714 * src/parse-gram.y (gram_error): Now static. Add static decl.
13715 (print_token_value): Omit parameter names from forward decl,
13716 for consistency.
13717
88510f9c
PE
137182002-11-29 Paul Eggert <eggert@twinsun.com>
13719
6e746484
PE
13720 * doc/bison.texinfo: Emphasize that yylex and yyerror must
13721 be declared before being used. E.g., one should typically
13722 declare them in the prologue. Use GNU coding style in examples.
13723 Put "const" consistently after the type it modifies. Mention
13724 that C99 supports "inline". Mention that yyerror traditionally
13725 returns "int".
13726
88510f9c
PE
13727 %parse-param and %lex-param now take just one argument, the
13728 declaration; the argument name is deduced from the declaration.
13729
13730 * doc/bison.texinfo (Parser Function, Pure Calling, Error
13731 Reporting, Table of Symbols): Document this.
13732 * src/parse-gram.y (add_param): New function.
13733 (COMMA): Remove.
13734 (declaration): Implement new rule for %parse-param and %lex-param.
13735 * src/scan-gram.l: "," now elicits a warning, rather than being
13736 a token; this is more compatible with byacc.
13737 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
13738
bb92250c
PE
137392002-11-27 Paul Eggert <eggert@twinsun.com>
13740
13741 Rename identifiers to avoid real and potential collisions.
13742
13743 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
13744 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 13745 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
13746 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
13747 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
13748 * src/parse-gram.y (print_token_value): Renamed from yyprint.
13749 All uses changed.
13750 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
13751 The name "yycontrol" violates the name space rules, and this stuff
13752 wasn't being used anyway.
13753 (input): Remove action; this stuff wasn't being used.
13754 (gram_error): Rename local variable yylloc -> loc.
13755 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
13756 (YY_DECL): Don't use "yy" at start of local variables.
13757 All uses changed, e.g., yylloc -> loc.
13758 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
13759 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
13760 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
13761 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
13762
13763 * src/parse-gram.y (gram_error): loc is now const *.
13764 * src/reader.h (gram_error): Likewise.
13765
3af4feb2
PE
137662002-11-24 Paul Eggert <eggert@twinsun.com>
13767
13768 Version 1.75c.
13769
13770 * tests/actions.at (Actions after errors): Use an output format
13771 more similar to that of the Printers and Destructors test.
13772 Test the position of the ';' token too.
13773 (Printers and Destructors): Likewise.
13774 (Printers and Destructors: %glr-parser): Remove for now, to avoid
13775 unnecessarily alarming people when the test fails.
13776
13777 * data/yacc.c (yyerrlab1): Move this label down, so that the
13778 parser does not discard the lookahead token if the user code
13779 invokes YYERROR. This change is required for POSIX conformance.
13780
13781 * lib/error.c: Sync with gnulib.
13782
137832002-11-22 Paul Eggert <eggert@twinsun.com>
13784
13785 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
13786 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
13787 * lib/xmalloc.c: Likewise.
26b4a969 13788
58004308
PE
137892002-11-20 Paul Eggert <eggert@twinsun.com>
13790
13791 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
13792
137932002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 13794
58004308
PE
13795 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
13796 should use `if (! x) abort ();' rather than `assert (x);', and
13797 anyway it's one less thing to worry about configuring.
13798
13799 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
13800 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
13801 and replace all instances of assert with abort.
13802 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
13803 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
13804
13805 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
13806 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
13807 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
13808 hash_find_entry, hash_rehash, hash_insert): Likewise.
13809 * src/conflicts.c (resolve_sr_conflict): Likewise.
13810 * src/lalr.c (set_goto_map, map_goto): Likewise.
13811 * src/nullable.c (nullable_compute): Likewise.
13812 * src/output.c (prepare_rules, token_definitions_output): Likewise.
13813 * src/reader.c (packgram, reader): Likewise.
13814 * src/state.c (state_new, state_free, state_transitions_set,
13815 state_reduction_find): Likewise.
13816 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
13817 symbol_pack): Likewise.
13818 * src/tables.c (conflict_row, pack_vector): Likewise.
13819 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
13820 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
13821 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
13822 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
13823
13824 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
13825 (ARGMATCH_CONSTRAINT): New macro.
13826 (ARGMATCH_ASSERT): Use it.
13827
13828 * src/system.h (verify): New macro.
13829 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
13830 rather than assert.
13831 * src/tables.c (tables_generate): Likewise.
13832
13833 * src/struniq.c (struniq_assert): Now returns void, and aborts
13834 if the assertion is false.
13835 (struniq_assert_p): Remove.
13836 * src/struniq.h: Likewise.
13837
76ae8198
PE
138382002-11-18 Paul Eggert <eggert@twinsun.com>
13839
13840 * data/glr.c (yygetLRActions): Replace `yyindex' with
13841 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
13842 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 13843 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 13844
d3c4e709
AD
138452002-11-18 Akim Demaille <akim@epita.fr>
13846
13847 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
13848 space.
13849 From Tim Van Holder.
13850
8d8a7238
PE
138512002-11-17 Paul Eggert <eggert@twinsun.com>
13852
13853 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
13854 to "SyntaxError" for consistency with my 2002-11-15 change.
13855
13856 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
13857 not define to {}, since this breaks the common use of `YYDPRINTF
13858 ((...));' if a single statement is desired (e.g. before `else').
13859 Work around GCC warnings by surrounding corresponding calls with
13860 {} if needed.
13861 (yyhasResolvedValue): Remove unused function.
13862 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
13863 loop body.
13864 (yyreportSyntaxError): Renamed from yyreportParseError.
13865 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
13866 All uses changed.
13867 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
13868 extern when possible. Remove unused initializations.
13869
b0937b22
AD
138702002-11-16 Akim Demaille <akim@epita.fr>
13871
13872 Augment the similarity between GLR and LALR traces.
13873
13874 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
13875 (YY_REDUCE_PRINT): New.
13876 (yyparse): Use them.
13877 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
13878 YYDPRINT here.
13879 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
13880 state reached after the reduction/recovery, since...
13881 (yyparse, yyprocessOneStack): Report the state we are entering in.
13882
c5e3e510
AD
138832002-11-16 Akim Demaille <akim@epita.fr>
13884
13885 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
13886 Add support for --trace=skeleton.
13887 * src/scan-skel.l: %option debug.
13888 Scan strings of non-@ or \n instead of character by character.
13889 (scan_skel): Handle trace_skeleton.
13890 (QPUTS): New.
13891 (@output_parser_name@, @output_header_name@): ``Restore'' their
13892 support (used to be M4 macros).
13893 * data/yacc.c: Quote larger chunks, a la glr.c.
13894 * data/lalr1.cc: Likewise.
13895 The header guards are no longer available, so use some other
13896 string than `YYLSP_NEEDED'.
13897
4c6cc1db
AD
138982002-11-16 Akim Demaille <akim@epita.fr>
13899
13900 Make the ``Printers and Destructors'' test more verbose, taking
13901 `yacc.c''s behavior as (possibly wrong) reference.
13902
13903 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
13904 instead of fprint on stdout.
13905 Set and report the last_line of the symbols.
13906 Consistently display values and locations.
13907
6d9e8019
PE
139082002-11-16 Paul Eggert <eggert@twinsun.com>
13909
13910 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
13911
6e649e65
PE
139122002-11-15 Paul Eggert <eggert@twinsun.com>
13913
b25d88f6
PE
13914 * tests/actions.at (Actions after errors): New test case.
13915
6e649e65
PE
13916 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
13917 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
13918 tests/action.at, tests/calc.at, tests/conflicts.at,
13919 tests/cxx-type.at, tests/regression.at:
13920 "parse error" -> "syntax error" for POSIX compatibility.
13921 "parsing stack overflow..." -> "parser stack overflow" so
13922 that code matches Bison documentation.
13923
0f39aab9
AD
139242002-11-15 Akim Demaille <akim@epita.fr>
13925
13926 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
13927 take two BRACED_CODE, not two string_content.
13928 Free the scanner's obstack when we are done.
13929 (code_content): New.
13930 * tests/calc.at: Adjust.
13931 * doc/bison.texinfo: Adjust.
13932 Also, make sure to include the `,' for these declarations.
13933
761c1926
AD
139342002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
13935
13936 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
13937 definition; avoids potential autoreconf problems.
13938
b0f98b10
AD
139392002-11-15 Akim Demaille <akim@epita.fr>
13940
13941 Always check the value returned by yyparse.
13942
13943 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
13944 returned by yyparse.
13945 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
13946 Adjust calls.
13947 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
13948 returned by yyparse.
13949
970785f1
PH
139502002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13951
13952 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
13953 on input.at test.
13954
8fcc7db1
PE
139552002-11-14 Paul Eggert <eggert@twinsun.com>
13956
7ec1b48e
PE
13957 * src/output.c (output_skeleton): Call xfopen instead of
13958 duplicating xfopen's body.
13959
cfff7583 13960 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 13961 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 13962
8fcc7db1
PE
13963 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
13964 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
13965 Group compiler. Instead, use "$CC -E bar.c". Include the .h
13966 file twice in the grammar, as an extra check.
13967
13968 * tests/input.at (Torturing the Scanner): Surround the
13969 backslash-newline tests with "#if 0", to make it less likely that
13970 we'll run into compiler bugs. Bring back solitary \ inside
13971 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 13972 test backslash-newline in C character constant.
8fcc7db1 13973
4e8d992c
AD
139742002-11-14 Akim Demaille <akim@epita.fr>
13975
13976 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
13977 status of the compiler.
f32b346d 13978 Calling `exit 1' is no longer needed.
4e8d992c
AD
13979 Reported by Nelson H. F. Beebe.
13980
9501dc6e
AD
139812002-11-14 Akim Demaille <akim@epita.fr>
13982
13983 * tests/atlocal.in (CPPFLAGS): We have config.h.
13984 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
13985 New.
13986 * tests/actions.at, tests/calc.at, tests/conflicts.at,
13987 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
13988 * tests/regression.at, tests/torture.at: Use them for all the
13989 grammars that are to be compiled.
13990 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
13991 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
13992 * doc/bison.texinfo (GLR Parsers): Document `inline'.
13993
18b519c0
AD
139942002-11-14 Akim Demaille <akim@epita.fr>
13995
13996 * doc/bison.texinfo: Various formatting changes (alignments in
13997 samples, additional @group/@end group, GCS in samples.
13998 Use @deffn instead of simple @table to define the directives,
13999 macros, variables etc.
14000
9a86cdb9
PE
140012002-11-13 Paul Eggert <eggert@twinsun.com>
14002
daa33def 14003 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 14004 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 14005
daa33def 14006 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 14007 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
14008 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
14009 * tests/headers.at (export YYLTYPE): Likewise.
14010
14011 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 14012 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 14013
9a86cdb9
PE
14014 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
14015 comments, since they're not portable. Use GNU coding style.
14016
9c1e26bd
AD
140172002-11-13 Akim Demaille <akim@epita.fr>
14018
14019 * data/yacc.c: Leave bigger chunks of quoted text.
14020 (YYDSYMPRINTF): New.
14021 Use it to report symbol activities.
14022 * data/glr.c (YYDSYMPRINTF): New.
14023 Use it.
14024
87f721cc
PE
140252002-11-12 Paul Eggert <eggert@twinsun.com>
14026
14027 Version 1.75b.
14028
14029 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
14030 (yyglrReduce): Return yyok, not 0.
14031 This should avoid the enumerated-type warnings reported
464c6927 14032 by Nelson H. F. Beebe in
161a71f3 14033 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
14034
14035 * lib/bbitset.h (BITSET_INLINE): Remove.
14036 * lib/bitset.h [! BITSET_INLINE]: Remove.
14037 (bitset_set, bitset_reset, bitset_test): Rename local vars
14038 to avoid shadowing warnings by GCC.
14039
14040 * data/glr.c (inline): Remove #define. It's the user's
14041 responsibility to #define it away, just like 'const'.
464c6927 14042 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 14043 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 14044
87f721cc
PE
14045 * Makefile.maint (po-check): Scan .l and .y files instead of the
14046 .c and the .h files that they generate. This fixes the bug
14047 reported by Tim Van Holder in:
161a71f3 14048 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
14049 Look for N_ as well as for _. Try to avoid matching #define for
14050 N_ and _.
14051 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
14052 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
14053 * src/scan-gram.l: Revamp regular expressions so that " and '
14054 do not confuse xgettext.
14055
14056 * src/struniq.h (struniq_new): Do not declare the return type
14057 to be 'const'; this violates the C standard.
14058 * src/struniq.c (struniq_new): Likewise.
14059
be14ade5
AD
140602002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
14061
14062 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
14063 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
14064 linker.
14065
05291fbc
AD
140662002-11-12 Akim Demaille <akim@epita.fr>
14067
14068 * Makefile.maint: Sync with Autoconf:
14069 (local_updates): New.
14070
1f5fd52e
AD
140712002-11-12 Akim Demaille <akim@epita.fr>
14072
14073 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
14074
283f1e64
AD
140752002-11-12 Akim Demaille <akim@epita.fr>
14076
14077 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
14078 locations.
14079
886b69d1
AD
140802002-11-12 Akim Demaille <akim@epita.fr>
14081
14082 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
14083 not yyvalue.
14084
3df37415
AD
140852002-11-12 Akim Demaille <akim@epita.fr>
14086
14087 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
14088 Use it to test the GLR parser.
14089
7bd6c77e
AD
140902002-11-12 Akim Demaille <akim@epita.fr>
14091
14092 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
14093 defines it.
14094 * data/glr.c (yystos): New.
14095 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
14096 (YYDSYMPRINT): New.
14097 (yyval): Don't define it, it is handled via M4.
14098 (yyrecoverParseError): Free verbosely the discarded symbols.
14099 * data/yacc.c (yysymprint): Remove, rather...
14100 (b4_yysymprint_generate): invoke.
14101 * data/c.m4 (b4_yysymprint_generate): New.
14102 Accept pointers as arguments, as opposed to the version from
14103 yacc.c.
14104 (b4_yydestruct_generate): Likewise.
14105 * tests/cations.at (Printers and Destructors): Use Bison directives
14106 instead of CPP macros.
14107 Don't rely on internal details.
14108
b0400cc6
AD
141092002-11-12 Akim Demaille <akim@epita.fr>
14110
14111 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
14112 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
14113 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
14114 it against YYEMPTY and so forth), work on yytoken (i.e., set
14115 it to YYEMPTY etc.).
14116 (yydestruct): Replace with a b4_yydestruct_generate invocation.
14117 (b4_symbol_actions): Remove.
14118 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
14119 for 0, end-of-input.
14120
72f889cc
AD
141212002-11-12 Akim Demaille <akim@epita.fr>
14122
14123 * doc/bison.texinfo (Destructor Decl): New.
14124
b1ae9233
AD
141252002-11-12 Akim Demaille <akim@epita.fr>
14126
14127 * src/tables.c (tables_generate): Use free for pointers that
14128 cannot be NULL, not XFREE.
14129 (pack_vector): Use assert, not fatal, for bound violations.
14130 * src/state.c (state_new): Likewise.
14131 * src/reader.c (reader): Likewise.
14132 * src/lalr.c (set_goto_map): Likewise.
72f889cc 14133 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
14134 the file name.
14135
7ec2d4cd
AD
141362002-11-12 Akim Demaille <akim@epita.fr>
14137
14138 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
14139 Restore.
14140 * src/scan-gram.l (last_string): Is global to the file, not to
14141 yylex.
14142 * src/parse-gram.y (input): Don't append the epilogue here,
14143 (epilogue.opt): do it here, and free the scanner's obstack.
14144 * src/reader.c (epilogue_set): Rename as...
14145 (epilogue_augment): this.
14146 * data/c.m4 (b4_epilogue): Defaults to empty.
14147
573a6cd3
AD
141482002-11-12 Akim Demaille <akim@epita.fr>
14149
14150 * src/getargs.c (long_options): Remove duplicates.
14151 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
14152 Remove.
14153 * doc/bison.rnh: Remove.
14154 * doc/bison.texinfo (VMS Invocation): Remove.
14155
95612cfa
AD
141562002-11-12 Akim Demaille <akim@epita.fr>
14157
14158 * src/struniq.h, src/struniq.c (struniq_t): Is const.
14159 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
14160
14161 Use struniq for symbols.
14162
14163 * src/symtab.h (symbol_t): The tag member is a struniq.
14164 (symbol_type_set): Adjust.
14165 * src/symtab.c (symbol_new): Takes a struniq.
14166 (symbol_free): Don't free the tag member.
14167 (hash_compare_symbol_t, hash_symbol_t): Rename as...
14168 (hash_compare_symbol, hash_symbol): these.
14169 Use the fact that tags as struniqs.
14170 (symbol_get): Use struniq_new.
14171 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
14172 Returns a strniq.
14173 * src/reader.h (merger_list, grammar_currentmerge_set): The name
14174 and type members are struniqs.
14175 * src/reader.c (get_merge_function)
14176 (grammar_current_rule_merge_set): Adjust.
14177 (TYPE, current_type): Are struniq.
14178
14179 Use struniq for file names.
14180
14181 * src/files.h, src/files.c (infile): Split into...
14182 (grammar_file, current_file): these.
14183 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
14184 * src/reduce.c (reduce_print): Likewise.
14185 * src/getargs.c (getargs): Likewise.
14186 * src/complain.h, src/complain.c: Likewise.
14187 * src/main.c (main): Call struniqs_new early enough to use it for
14188 file names.
14189 Don't free the input file name.
14190
3e6656f9
AD
141912002-11-12 Akim Demaille <akim@epita.fr>
14192
14193 * src/symtab.c (symbol_free): Remove dead deactivated code:
14194 type_name are properly removed.
14195 Don't use XFREE to free items that cannot be NULL.
14196 * src/struniq.h, src/struniq.c: New.
14197 * src/main.c (main): Initialize/free struniqs.
14198 * src/parse-gram.y (%union): Add astruniq member.
14199 (yyprint): Adjust.
14200 * src/scan-gram.l (<{tag}>): Return a struniq.
14201 Free the obstack bit that used to store it.
14202 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
14203
7672019c
PE
142042002-11-11 Paul Eggert <eggert@twinsun.com>
14205
14206 Revamp to fix many (but not all) of the C- and M4-related quoting
14207 problems. Among other things, this fixes the Bison bug reported
14208 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 14209 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
14210
14211 Use new @ escapes consistently. Represent brackets with @{ and @}
14212 rather than @<:@ and @:>@, since this works a bit better with dumb
14213 editors like vi. Represent @ with @@, since @ is now consistently
14214 an escape. Use @oline@ and @ofile@ rather than __oline__ and
14215 __ofile__, to avoid unexpected expansions. Similarly, use @output
14216 rather than #output.
14217
14218 * data/c.m4 (b4_copyright): Omit file name from comment, since
14219 the file name could contain "*/".
14220 (b4_synclines_flag): Don't quote the 2nd argument; it should already
14221 be quoted. All uses changed.
14222
14223 * data/glr.c: Use new @ escapes consistently.
14224 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
14225 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
14226 Remove, since they couldn't handle arbitrary characters in file
14227 names.
14228 * data/lalr1.cc: Likewise.
14229 * data/yacc.c: Likewise.
14230
14231 * src/files.c (output_infix): Remove; all uses removed.
14232 * src/files.h: Likewise.
14233
14234 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
14235 mishandled funny characters in file names, and anyway it isn't
14236 needed any more.
14237 * data/yacc.c: Likewise.
14238 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
14239
14240 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
14241 * data/yacc.c: Likewise.
14242
14243 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
14244 strings now.
14245 (muscle_init): Quote filename as a C string.
14246 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
14247 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
14248 * src/output.c (escaped_file_name_output): New function.
14249 (prepare_symbols): Quote tokens for M4.
14250 (prepare): Don't insert output_infix, output_prefix,
14251 output_parser_name, output_header_name; this is now down by scan-skel.
14252 Insert skeleton as a C string.
14253
14254 * src/output.c (user_actions_output, symbol_destructors_output,
14255 symbol_printers_output): Quote filenames for C and M4.
14256 * src/reader.c (prologue_augment, epilogue_set): Likewise.
14257
14258 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
14259 escapes other than \\ and \'; this simplifies the code.
14260 (<SC_STRING>): Likewise, for \\ and \".
14261 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
14262 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
14263 Use new escapes @{ and @} for [ and ].
14264
14265 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
14266 them with auto vars.
14267 Switch to new escape scheme, where @ is the escape character uniformly.
14268 Abort if a stray escape character is found. Avoid unbounded input
14269 buffer when parsing non-escaped text.
14270
14271 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
14272 __oline__, #output, $@, and @{ do not have unintended meanings.
14273
acea4f3b
PE
142742002-11-09 Paul Eggert <eggert@twinsun.com>
14275
14276 Fix the test failure due to GCC warnings described in
161a71f3 14277 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
14278 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
14279 evaluate to 0 if it's impossible for NINF to be in the respective
14280 table.
14281 (yygetLRActions, yyrecoverParseError): Use them.
14282
14283 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
14284 counted in the token inserted at end of file. Now takes
14285 location_t *, not location_t, so that the location can be
14286 adjusted. All uses changed.
14287
14288 * tests/regression.at (Invalid inputs): Adjust wording in
14289 diagnostic to match the new behavior.
14290
14291 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
14292 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
14293 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
14294 abort ();'. This reduces the runtime of the "Many lookaheads"
14295 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
14296 GCC 3.2.
14297
20ef1ad5
PE
142982002-11-07 Paul Eggert <eggert@twinsun.com>
14299
14300 * src/parse-gram.y (CHARACTER): Remove unused token.
14301 All uses removed.
14302
14303 * src/scan-gram.l: Remove stack option. We no longer use the
14304 stack, since the stack was never deeper than 1; instead, use the
14305 new auto var c_context to record the stacked value.
14306
14307 Remove nounput option. At an unexpected end of file, we now unput
14308 the minimal input necessary to end cleanly; this simplifies the
14309 code.
14310
14311 Avoid unbounded token sizes where this is easy.
14312
14313 (unexpected_end_of_file): New function.
14314 Use it to systematize the error message on unexpected EOF.
14315 (last-string): Now auto, not static.
14316 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
14317 (scanner_last_string_free): Remove; not used.
14318 (percent_percent_count): Move decl to just before use.
14319 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
14320 not the (never otherwised-used) CHARACTER.
14321
93724f13
AD
143222002-11-07 Akim Demaille <akim@epita.fr>
14323
14324 Let yyerror always receive the msg as last argument, so that
14325 yyerror can be variadic.
14326
14327 * data/yacc.c (b4_yyerror_args): New.
14328 Use it when calling yyerror.
14329 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
14330 Use it when calling yyerror.
14331 * doc/bison.texinfo (Error Reporting): Adjust.
14332 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
14333 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
14334
6e40b4eb
AD
143352002-11-06 Akim Demaille <akim@epita.fr>
14336
14337 #line should have quoted strings.
14338 Ideally, this should be done by m4_quotearg.
14339
14340 * src/scan-skel.l: Include quotearg.h.
14341 Quote __ofile__.
14342 * src/output.c (symbol_printers_output)
14343 (symbol_destructors_output): Quote the file name.
14344
2dfbfc12
AD
143452002-11-06 Akim Demaille <akim@epita.fr>
14346
14347 * tests/regression.at (Invalid inputs): Adjust to the recent
14348 messages.
14349
437c2d80
AD
143502002-11-06 Akim Demaille <akim@epita.fr>
14351
14352 Restore --no-lines.
14353 Reported by Jim Kent.
14354
14355 * data/c.m4 (b4_syncline): New.
14356 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
14357 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
14358 * src/output.c (user_actions_output): Likewise.
14359 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 14360 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 14361
900c5db5
AD
143622002-11-06 Akim Demaille <akim@epita.fr>
14363
14364 * src/main.c (main): Free `infile'.
14365 * src/scan-gram.l (handle_syncline): New.
14366 Recognize `#line'.
14367 * src/output.c (user_actions_output, symbol_destructors_output)
14368 (symbol_printers_output): Use the location's file name, not
14369 infile.
14370 * src/reader.c (prologue_augment, epilogue_set): Likewise.
14371
e183b123 143722002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 14373
e183b123 14374 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 14375 either has GLR conflict entries.
e183b123 14376
193eb6b7
PE
143772002-11-05 Paul Eggert <eggert@twinsun.com>
14378
e183b123
PE
14379 * src/scan-gram.l: Use more accurate diagnostics, e.g.
14380 "integer out of range" rather than "invalid value".
14381 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
14382 accordingly.
14383
193eb6b7
PE
14384 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
14385 Also, remove one static variable in the scanner.
14386
14387 * src/scan-gram.l (braces_level): Now auto, not static.
14388 Initialize to zero if the compiler is being picky.
14389 (INITIAL): Clear braces_level instead of incrementing it.
14390 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
14391 as POSIX 1003.1-2001 requires.
14392 * src/system.h (IF_LINT): New macro, taken from coreutils.
14393 * configure.ac: Define "lint" if --enable-gcc-warnings.
14394
29c01725
AD
143952002-11-05 Akim Demaille <akim@epita.fr>
14396
14397 * src/scan-gram.l: When it starts with `%', complain about the
14398 whole directive, not just that `invalid character: %'.
14399
8aeac3ca
AD
144002002-11-04 Akim Demaille <akim@epita.fr>
14401
14402 * Makefile.maint: Update from Autoconf.
14403 (update, cvs-update, po-update, do-po-update): New.
14404
793a58bb
AD
144052002-11-04 Akim Demaille <akim@epita.fr>
14406
14407 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
14408 and yyerror.
14409 Have yyerror `use' its arguments.
14410 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
14411 returns true when location & yacc & pure & parse-param.
14412 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
14413
c4d720cd
AD
144142002-11-04 Akim Demaille <akim@epita.fr>
14415
14416 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
14417 clashes.
14418 * src/scan-gram.l: Use [\'] instead of ['] to pacify
14419 font-lock-mode.
14420 Use complain_at.
14421 Use quote, not quote_n since LOCATION_PRINT no longer uses the
14422 slot 0.
14423
613a0dc5
PE
144242002-11-03 Paul Eggert <eggert@twinsun.com>
14425
14426 * src/reader.c (get_merge_function, grammar_current_rule_check):
14427 Use consistent diagnostics for reporting type name clashes.
14428 Quote the types with <>, for consistency with Yacc.
14429 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
14430
2a8d363a
AD
144312002-11-03 Akim Demaille <akim@epita.fr>
14432
14433 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
14434 New.
14435 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
14436 (b4_parse_param): Remove.
14437 Use b4_identification.
14438 Propagate b4_pure_args where needed to pass them to yyerror.
14439 * data/glr.m4 (b4_parse_param): Remove.
14440 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
14441 (b4_lpure_formals): New.
14442 Use b4_identification.
14443 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
14444 b4_user_formals and b4_user_args.
14445 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
14446 (yyreportAmbiguity): When using a pure parser, also need
14447 the location, and the parse-params.
14448 Adjust callers.
14449 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
14450 When using a pure parser, also need the parse-params.
14451 Adjust callers.
14452 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
14453 (%pure-parser + %parse-param) LALR and GLR parsers.
14454 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
14455 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
14456 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
14457 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
14458 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
14459 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
14460 * doc/bison.texinfo: Untabify the whole file.
14461 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
14462 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
14463 (Error Reporting): Adjust to these new directives.
14464 Document %error-verbose, deprecate YYERROR_VERBOSE.
14465
9e32add8
AD
144662002-11-03 Akim Demaille <akim@epita.fr>
14467
14468 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
14469 AT_CHECK_CALC_GLR invocations to use % directives, instead of
14470 command line options.
14471 * tests/cxx-type.at: Formatting changes.
14472
b02d90a5
PE
144732002-11-03 Paul Eggert <eggert@twinsun.com>
14474
14475 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
14476 to count columns correctly, and to check for invalid inputs.
9e32add8 14477
b02d90a5
PE
14478 Use mbsnwidth to count columns correctly. Account for tabs, too.
14479 Include mbswidth.h.
14480 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
14481 (extend_location): New function.
14482 (YY_LINES): Remove.
14483
14484 Handle CRLF in C code rather than in Lex code.
14485 (YY_INPUT): New macro.
14486 (no_cr_read): New function.
14487
14488 Scan UCNs, even though we don't fully handle them yet.
14489 (convert_ucn_to_byte): New function.
14490
14491 Handle backslash-newline correctly in C code.
14492 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
14493 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
14494 all uses changed.
14495 (tag, splice): New EREs. Do not allow NUL or newline in tags.
14496 Use {splice} wherever C allows backslash-newline.
14497 YY_STEP after space, newline, vertical-tab.
14498 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 14499
b02d90a5
PE
14500 (letter, id): Don't assume ASCII; e.g., spell out a-z.
14501
14502 ({int}, handle_action_dollar, handle_action_at): Check for integer
14503 overflow.
9e32add8 14504
b02d90a5
PE
14505 (YY_STEP): Omit trailing semicolon, so that it's more like C.
14506
14507 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
14508 as well as \000. Check for UCHAR_MAX, not 255.
14509 Allow \x with an arbitrary positive number of digits, as in C.
14510 Check for overflow here.
14511 Allow \? and UCNs, for compatibility with C.
14512
14513 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
14514 with quote slot used by complain_at.
14515
14516 * tests/input.at: Add tests for backslash-newline, m4 quotes
14517 in symbols, long literals, and funny escapes in strings.
14518
14519 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
14520 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
14521 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
14522 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
14523 * m4/mbswidth.m4: New file, from GNU coreutils.
14524
14525 * doc/bison.texinfo (Grammar Outline): Document // comments.
14526 (Symbols): Document that trigraphs have no special meaning in Bison,
14527 nor is backslash-newline allowed.
14528 (Actions): Document that trigraphs have no special meaning.
14529
14530 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
14531 no longer used.
14532
145332002-11-02 Paul Eggert <eggert@twinsun.com>
14534
14535 * src/reader.c: Don't include quote.h; not needed.
14536 (get_merge_function): Reword warning to be consistent with
14537 type clash diagnostic in grammar_current_rule_check.
14538
14539 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
14540 bug in trigraph handling.
14541
14542 * src/output.c (prepare_symbols): When printing token names,
14543 escape "[" as "@<:@" and likewise for "]".
14544
14545 * src/system.h (errno): Remove declaration, as we are now
14546 assuming C89 or better, and C89 guarantees errno.
14547
762b212b
PE
145482002-10-30 Paul Eggert <eggert@twinsun.com>
14549
14550 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
14551 Check for close failures.
14552 * src/files.h (xfclose): Return void, not int, since it always
14553 returned zero.
14554 * src/files.c (xfclose): Likewise. Report I/O error if ferror
14555 indicates one.
14556 * src/output.c (output_skeleton): Use xfclose rather than fclose
14557 and ferror. xfclose now checks ferror.
14558
14559 * data/glr.c (YYLEFTMOST_STATE): Remove.
14560 (yyreportTree): Use a stack-based leftmost state. This avoids
14561 our continuing battles with bogus warnings about initializers.
14562
56100c60
AD
145632002-10-30 Akim Demaille <akim@epita.fr>
14564
14565 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
14566 #if.
14567
51b4a04c
PH
145682002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14569
14570 * tests/glr-regr1.at: New test for reported regressions.
14571 * tests/testsuite.at: Add glr-regr1.at test.
14572 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 14573
bf1ebda2
PE
145742002-10-24 Paul Eggert <eggert@twinsun.com>
14575
5c16c6b1
PE
14576 Version 1.75a.
14577
bf1ebda2
PE
14578 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
14579 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
14580 we use malloc. Don't assume 'A' through 'Z' are contiguous.
14581 Don't assume strdup exists; POSIX says its an XSI extension.
14582 Check for buffer overflow on input.
14583
b526ee61
AD
145842002-10-24 Akim Demaille <akim@epita.fr>
14585
14586 * src/output.c (output_skeleton): Don't disable M4sugar comments
14587 too soon: it results in comments being expanded.
14588 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
14589 first output.
14590
f1886bb2
AD
145912002-10-24 Akim Demaille <akim@epita.fr>
14592
14593 * data/yacc.c (m4_int_type): New.
14594 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
14595 char' as only yacc.c wants K&R portability.
14596 * data/glr.c (yysigned_char): Remove.
14597 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
14598 Reported by Quoc Peyrot.
14599
c5576256
PE
146002002-10-23 Paul Eggert <eggert@twinsun.com>
14601
14602 * src/main.c (main): With --trace=time, report times even if a
14603 non-fatal error occurs. Formerly, the times were reported in some
14604 such cases but not in others.
14605 * src/reader.c (reader): Just return if a complaint has been issued,
14606 instead of exiting, so that 'main' can report times.
14607
27b0ffea
AD
146082002-10-22 Akim Demaille <akim@epita.fr>
14609
14610 * src/system.h: Include sys/types.
14611 Reported by Bert Deknuydt.
14612
223a7883
PE
146132002-10-23 Paul Eggert <eggert@twinsun.com>
14614
14615 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
14616 Suggested by Art Haas.
14617
146182002-10-22 Paul Eggert <eggert@twinsun.com>
14619
14620 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
14621 decl; not needed any more.
14622 * src/main.c (main): Use return to exit, undoing yesterday's change.
14623 The last OS that we could find where this wouldn't work is
14624 SunOS 3.5, and that's too old to worry about now.
14625
14626 * data/glr.c (struct yyltype): Define members even when not
14627 doing locations. This is more consistent with yacc.c, and it
14628 works around the following bug reports:
161a71f3
PE
14629 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
14630 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 14631
223a7883
PE
14632 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
14633 @acronym consistently. Standardize on "Yacc" instead of "YACC",
14634 "Algol" instead of "ALGOL". Give a bit more history about BNF.
14635
8b76775a
AD
146362002-10-22 Akim Demaille <akim@epita.fr>
14637
14638 * data/README: New.
14639
6db10d14
PE
146402002-10-21 Paul Eggert <eggert@twinsun.com>
14641
14642 Be consistent about 'bool'; the old code used an enum in one
14643 module and an int in another, and this violates the C standard.
14644 * m4/stdbool.m4: New file, from coreutils 4.5.3.
14645 * configure.ac (AC_HEADER_STDBOOL): Add.
14646 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
14647 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
14648 * src/symtab.c (hash_compare_symbol_t): Likewise.
14649 * src/system.h (bool, false, true): Use a definition consistent
14650 with ../lib/hash.c. All uses changed.
14651
14652 * src/complain.c (warning_issued): Renamed from warn_message_count,
14653 so that we needn't worry about integer overflow (!).
14654 Now of type bool. All uses changed.
14655 (complaint_issued): Renamed from complain_message_count; likewise.
14656
14657 * src/main.c (main): Use exit to exit with failure.
27b0ffea 14658
6db10d14
PE
14659 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
14660 rather than 1 and 0.
14661 * src/main.c (main): Likewise.
14662 * src/getargs.c (getargs): Likewise.
14663 * src/reader.c (reader): Likewise.
14664
14665 * src/getarg.c (getargs): Remove duplicate code for
14666 "Try `bison --help'".
14667
14668 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
14669 What was that "2" for?
14670
14671 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
14672 * src/getargs.c (usage): Likewise.
14673
14674 * src/getargs.c (getargs): When there are too few operands, report
14675 the last one. When there are too many, report the first extra
14676 one. This is how diffutils does it.
14677
92a060fd
PE
146782002-10-20 Paul Eggert <eggert@twinsun.com>
14679
14680 Remove K&R vestiges.
14681 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
14682 * src/complain.c (VA_START): Remove. Assume prototypes.
14683 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
14684 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
14685 fatal): Assume prototypes.
14686 * src/complain.h: Assume prototypes.
14687 * src/system.h (PARAMS): Remove.
14688 Include <limits.h> unconditionally, since it's guaranteeed even
14689 for a freestanding C89 compiler.
14690 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
14691 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 14692
e7cb57c0
AD
146932002-10-20 Akim Demaille <akim@epita.fr>
14694
14695 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
14696 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
14697 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
14698 (yyresolveStates, yyresolveAction, yyresolveStack)
14699 (yyprocessOneStack): Use them.
14700 (yy_reduce_print): New.
14701 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
14702
0245f82d
AD
147032002-10-20 Akim Demaille <akim@epita.fr>
14704
14705 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
14706 arguments and output `void'.
14707 (b4_c_function): Rename as...
14708 (b4_c_function_def): this.
14709 (b4_c_function_decl, b4_c_ansi_function_def)
14710 (b4_c_ansi_function_decl): New.
14711 Change the interpretation of the arguments: before `int, foo', now
14712 `int foo, foo'.
14713 * data/yacc.c (yyparse): Prototype and define thanks to these.
14714 Adjust b4_c_function_def uses.
14715 * data/glr.c (yyparse): Likewise, but ANSI only.
14716
39912f52
AD
147172002-10-20 Akim Demaille <akim@epita.fr>
14718
14719 * src/output.c (prepare): Move the definition of `tokens_number',
14720 `nterms_number', `undef_token_number', `user_token_number_max'
14721 to...
14722 (prepare_tokens): Here.
14723 (prepare_tokens): Rename as...
14724 (prepare_symbols): this.
14725 (prepare): Move the definition of `rules_number' to...
14726 (prepare_rules): here.
14727 (prepare): Move the definition of `last', `final_state_number',
14728 `states_number' to...
14729 (prepare_states): here.
14730 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
14731
20c1e2ad
AD
147322002-10-20 Akim Demaille <akim@epita.fr>
14733
14734 * src/tables.h, src/tables.c, src/output.c: Comment changes.
14735
21964f43
AD
147362002-10-20 Akim Demaille <akim@epita.fr>
14737
14738 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
14739 * data/c.m4: here.
14740
66d30cd4
AD
147412002-10-20 Akim Demaille <akim@epita.fr>
14742
14743 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
14744 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
14745 `pair'.
14746 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
14747 `name' to...
14748 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
14749 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
14750 These.
14751
95f2c9fe
PE
147522002-10-19 Paul Eggert <eggert@twinsun.com>
14753
14754 Do not create a temporary file, as that involves security and
14755 cleanup headaches. Instead, use a pair of pipes.
14756 Derived from a suggestion by Florian Krohm.
14757 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
14758 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
14759 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
14760 (BISON_PREREQ_SUBPIPE): Add.
14761 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
14762 Add subpipe.h, subpipe.c.
14763 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
14764 * po/POTFILES.in: Add lib/subpipe.c.
14765 * src/output.c: Include "subpipe.h".
14766 (m4_invoke): Remove decl.
14767 (scan_skel): New decl.
14768 (output_skeleton): Use pipe rather than temporary file for m4 input.
14769 Check that m4sugar.m4 is readable, to avoid deadlock.
14770 Check for pipe I/O error.
14771 * src/scan-skel.l (readpipe): Remove decl.
14772 (scan_skel): New function, to be used in place of m4_invoke.
14773 Read from stream rather than file.
66d30cd4 14774
95f2c9fe
PE
14775 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
14776 float, as this generates a warning on Solaris 8 + GCC 3.2 with
14777 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
14778 this generates a more-accurate value anyway.
14779
14780 * lib/timevar.c (timervar_accumulate): Rename locals to
14781 avoid confusion with similarly-named more-global.
14782 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
14783
14784 * src/output.c (prepare): Use xstrdup to convert char const *
14785 to char *, to avoid GCC warning.
14786
c19988b7
AD
147872002-10-19 Akim Demaille <akim@epita.fr>
14788
14789 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
14790 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
14791 Use them to have `calc.y' ready for %pure-parser.
14792 * data/yacc.c (YYLEX): Pass a yylex return type to
14793 b4_c_function_call.
14794
ae7453f2
AD
147952002-10-19 Akim Demaille <akim@epita.fr>
14796
14797 Prototype support of %lex-param and %parse-param.
14798
14799 * src/parse-gram.y: Add the definition of the %lex-param and
14800 %parse-param tokens, plus their rules.
14801 Drop the `_' version of %glr-parser.
14802 Add the "," token.
14803 * src/scan-gram.l (INITIAL): Scan them.
14804 * src/muscle_tab.c: Comment changes.
14805 (muscle_insert, muscle_find): Rename `pair' as `probe'.
14806 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
14807 (muscle_entry_s): The `value' member is no longer const.
14808 Adjust all dependencies.
14809 * src/muscle_tab.c (muscle_init): Adjust: use
14810 MUSCLE_INSERT_STRING.
14811 Initialize the obstack earlier.
14812 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
14813 (muscle_pair_list_grow): New.
14814 * data/c.m4 (b4_c_function_call, b4_c_args): New.
14815 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
14816 * tests/calc.at: Use %locations, not --locations.
14817 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
14818
0e575721
AD
148192002-10-19 Akim Demaille <akim@epita.fr>
14820
14821 * src/getargs.c (usage): Take status as argument and exit
14822 accordingly.
14823 Report the traditional `Try ... --help' message when status != 0.
14824 (usage, version): Don't take a FILE * as arg, it is pointless.
14825 (getargs): When there is an incorrect number of arguments, make it
14826 an error, and report it GNUlically thanks to `usage ()'.
14827
724ce7f5
PE
148282002-10-18 Paul Eggert <eggert@twinsun.com>
14829
3a781eb2
PE
14830 * data/glr.c (yyreportParseError): Don't assume that sprintf
14831 yields the length of the printed string, as this is not true
14832 on SunOS 4.1.4. Reported by Peter Klein.
14833
724ce7f5
PE
14834 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
14835 * tests/conflicts.at (%nonassoc and eof): Likewise.
14836 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
14837
473d0a75
AD
148382002-10-17 Akim Demaille <akim@epita.fr>
14839
14840 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
14841 * src/getargs.c (trace_types, trace_args): Adjust.
14842 * src/reader.c (grammar_current_rule_prec_set)
14843 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
14844 Standardize error messages.
14845 And s/@prec/%prec/!
14846 (reader): Use trace_flag to enable scanner/parser debugging,
14847 instead of an adhoc scheme.
14848 * src/scan-gram.l: Remove trailing debugging code.
14849
e76d2469
PE
148502002-10-16 Paul Eggert <eggert@twinsun.com>
14851
93e2236a
PE
14852 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
14853 MUSCLE_TAB_H.
14854
e76d2469
PE
14855 * NEWS: Officially drop support for building Bison with K&R C,
14856 since it didn't work anyway and it's not worth worrying about.
14857 * Makefile.maint (wget_files): Remove ansi2knr.c.
14858 (ansi2knr.c-url_prefix): Remove.
14859 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
14860 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
14861 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
14862
5bd1c419
PE
148632002-10-15 Paul Eggert <eggert@twinsun.com>
14864
14865 Stop using the "enum_" trick for K&R-style function definitions;
14866 it confused me, and I was the author! Instead, assume that people
14867 who want to use K&R C compilers (when using these modules in GCC,
14868 perhaps?) will run ansi2knr.
14869
14870 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
14871 All uses of "enum_" changed to "enum ".
14872 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
14873 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 14874
5bd1c419
PE
14875 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
14876 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
14877 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
14878 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
14879 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
14880 abitset_not, abitset_ones, abitset_or, abitset_or_and,
14881 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
14882 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
14883 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
14884 Use function prototypes; this removes the need for declaring
14885 static functions simply to provide their prototypes.
14886 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
14887 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
14888 bitset_count_, bitset_create, bitset_dump, bitset_first,
14889 bitset_free, bitset_init, bitset_last, bitset_next,
14890 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
14891 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
14892 bitset_print, bitset_release_memory, bitset_toggle_,
14893 bitset_type_choose, bitset_type_get, bitset_type_name_get,
14894 debug_bitset): Likewise.
14895 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
14896 * lib/bitset_stats.c (bitset_log_histogram_print,
14897 bitset_percent_histogram_print, bitset_stats_and,
14898 bitset_stats_and_cmp, bitset_stats_and_or,
14899 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
14900 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
14901 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
14902 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
14903 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
14904 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
14905 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
14906 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
14907 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
14908 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
14909 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
14910 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
14911 bitset_stats_zero): Likewise.
14912 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
14913 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
14914 bitsetv_dump, debug_bitsetv): Likewise.
14915 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
14916 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
14917 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
14918 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
14919 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
14920 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
14921 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
14922 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
14923 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
14924 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
14925 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
14926 Likewise.
14927 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
14928 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
14929 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
14930 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
14931 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
14932 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
14933 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
14934 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
14935 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
14936 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
14937 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 14938
ae26e1f0
AD
149392002-10-14 Akim Demaille <akim@epita.fr>
14940
14941 Version 1.75.
14942
d43baf71
AD
149432002-10-14 Akim Demaille <akim@epita.fr>
14944
14945 * tests/Makefile.am (maintainer-check-posix): New.
14946
7ebc83e3
AD
149472002-10-14 Akim Demaille <akim@epita.fr>
14948
14949 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
14950 member.
14951
05846dae
AD
149522002-10-14 Akim Demaille <akim@epita.fr>
14953
14954 * src/tables.c (table_ninf_remap): base -> tab.
14955 Reported by Matt Rosing.
14956
1318e37d
PE
149572002-10-14 Paul Eggert <eggert@twinsun.com>
14958
447fbb17
PE
14959 * tests/action.at, tests/calc.at, tests/conflicts.at,
14960 tests/cxx-type.at, tests/headers.at, tests/input.at,
14961 tests/regression.at, tests/synclines.at, tests/torture.at:
14962 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
14963 so that the tests still work even if POSIXLY_CORRECT is set.
14964 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 14965
1318e37d
PE
14966 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
14967 for portability to K&R hosts. Fix typo: signed char is guaranteed
14968 only to 127, not to 128.
14969 * data/glr.c (yysigned_char): New type.
14970 * data/yacc.c (yysigned_char): Likewise.
14971 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
14972
cc0f0794
PE
149732002-10-13 Paul Eggert <eggert@twinsun.com>
14974
5038f418
PE
14975 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
14976 true due to limited range of data type" warning from GCC.
14977
cc0f0794
PE
14978 * data/c.m4 (b4_token_defines): Protect against double-inclusion
14979 by wrapping enum yytokentype's definition inside #ifndef
14980 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
14981
6fed0802
AD
149822002-10-13 Akim Demaille <akim@epita.fr>
14983
14984 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
14985 Un yy- yyrhs to avoid the name clash with the global YYRHS.
14986
32f0598d
AD
149872002-10-13 Akim Demaille <akim@epita.fr>
14988
14989 * Makefile.maint: Update from Autoconf 2.54.
14990 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
14991
7ea9a33f
AD
149922002-10-13 Akim Demaille <akim@epita.fr>
14993
14994 * src/print.c (print_state): Separate the list of solved conflicts
14995 from the other items.
14996 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
14997
ea99527d
AD
149982002-10-13 Akim Demaille <akim@epita.fr>
14999
15000 Let nondeterministic skeletons be usable with deterministic
15001 tables.
15002
15003 With the patch, GAWK compiled by GCC without -O2 passes its test
15004 suite using a GLR parser driven by LALR tables. It fails with -O2
15005 because `struct stat' gives two different answers on my machine:
15006 88 (definition of an auto var) and later 96 (memset on this var).
15007 Hence the stack is badly corrumpted. The headers inclusion is to
15008 blame: if I move the awk.h inclusion before GLR's system header
15009 inclusion, the two struct stat have the same size.
15010
15011 * src/tables.c (pack_table): Always create conflict_table.
15012 (token_actions): Always create conflict_list.
15013 * data/glr.c (YYFLAG): Remove, unused.
15014
f377f69f
AD
150152002-10-13 Akim Demaille <akim@epita.fr>
15016
15017 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
15018 (O0FLAGS): New.
15019 (VALGRIND, GXX): New.
15020 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
15021 * tests/bison.in: Run $PREBISON a pre-command.
15022 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
15023 (maintainer-check-g++): New.
15024 * Makefile.am (maintainer-check): New.
15025
2a1fe6ed
AD
150262002-10-13 Akim Demaille <akim@epita.fr>
15027
15028 * data/glr.c: Formatting changes.
15029 Tweak some trace messages to match yacc.c's.
15030
f50adbbd
AD
150312002-10-13 Akim Demaille <akim@epita.fr>
15032
15033 GLR parsers sometimes raise parse errors instead of performing the
15034 default reduction.
15035 Reported by Charles-Henry de Boysson.
15036
15037 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 15038 check the length of the traces when %glr.
f50adbbd
AD
15039 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
15040 GLR's traces.
15041 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
15042 Test GLR parsers.
15043 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
15044 (yyltype): Remove the yy prefix from the member names.
15045 (yytable): Complete its comment.
15046 (yygetLRActions): Map error action number from YYTABLE from
15047 YYTABLE_NINF to 0.
15048 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
15049 (which was a bug: it should have been YYTABEL_NINF, and yet it was
15050 not satisfying as we could compare an YYACTION computed from
15051 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
15052 only value for error actions.
15053 (yyreportParseError): In verbose parse error messages, don't issue
15054 `error' in the list of expected tokens.
15055 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
15056 next action to perform to match glr.c's decoding.
15057 (yytable): Complete its comment.
15058
bcbad5b9
PE
150592002-10-13 Paul Eggert <eggert@twinsun.com>
15060
15061 Fix problem reported by Henrik Grubbstroem in
161a71f3 15062 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
15063 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
15064 because the Bison parser reads the second action before reducing
15065 the first one.
15066 * src/scan-gram.l (rule_length): New static var.
15067 Use it to keep track of the rule length in the scanner, since
15068 we can't expect the parser to be in lock-step sync with the scanner.
15069 (handle_action_dollar, handle_action_at): Use this var.
15070 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 15071
14904b89
PE
150722002-10-12 Paul Eggert <eggert@twinsun.com>
15073
1fe611e5
PE
15074 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
15075 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
15076 Include <sys/time.h> when checking for clock_t and struct tms.
15077 Use same include order as source.
15078 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 15079 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 15080
1fe611e5
PE
15081 * lib/timevar.c: Update copyright date and clarify comments.
15082 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 15083
1fe611e5
PE
15084 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
15085 GCC version as of today, then merge Bison's changes.
15086 Change "GCC" to "Bison" in copyright notice. timevar.def's
15087 author is Akim, so change that too.
15088
98194095
PE
15089 * src/reader.c (grammar_current_rule_check):
15090 Don't worry about the default action if $$ is untyped.
15091 Prevents bogus warnings reported by Jim Gifford in
161a71f3 15092 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 15093
14904b89
PE
15094 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
15095 * data/glr.c, data/lalr1.cc, data/yacc.c:
15096 Output token definitions before the first part of user declarations.
15097 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 15098 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 15099
ff6dca18
PE
151002002-10-11 Paul Eggert <eggert@twinsun.com>
15101
15102 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
15103 (yyparse): here. This undoes some of the 2002-07-25 change.
15104 Compatibility problem reported by Ralf S. Engelschall with
15105 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
15106
eb714592
AD
151072002-10-11 Akim Demaille <akim@epita.fr>
15108
15109 * tests/regression.at Characters Escapes): New.
15110 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
15111 characters.
15112 Reported by Jan Nieuwenhuizen.
15113
b7195100
AD
151142002-10-11 Akim Demaille <akim@epita.fr>
15115
15116 * po/id.po: New.
15117
f28a0f2d
PE
151182002-10-10 Paul Eggert <eggert@twinsun.com>
15119
15120 Portability fixes for bitsets; this also avoids several GCC
15121 warnings.
15122
15123 * lib/abitset.c: Include <stddef.h>, for offsetof.
15124 * lib/lbitset.c: Likewise.
15125
15126 * lib/abitset.c (abitset_bytes): Return a size that is aligned
15127 properly for vectors of objects. Do not assume that adding a
15128 header size to a multiple of a word size yields a value that is
15129 properly aligned for the whole union.
15130 * lib/bitsetv.c (bitsetv_alloc): Likewise.
15131
15132 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
15133 unique names for structures.
15134 * lib/ebitset.c (ebitset_bytes): Likewise.
15135 * lib/lbitset.c (lbitset_bytes): Likewise.
15136
15137 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
15138 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
15139 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
15140 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
15141 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
15142 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
15143 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
15144 to improve the type-checking that GCC can do.
15145 * lib/bitset.c (bitset_op4_cmp): Likewise.
15146 * lib/bitset_stats.c (bitset_stats_count,
15147 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
15148 bitset_stats_copy, bitset_stats_disjoint_p,
15149 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
15150 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
15151 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
15152 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
15153 bitset_stats_and_or_cmp, bitset_stats_andn_or,
15154 bitset_stats_andn_or_cmp, bitset_stats_or_and,
15155 bitset_stats_or_and_cmp): Likewise.
15156 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
15157 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
15158 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
15159 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
15160
15161 * lib/abitset.h: Include bitset.h, not bbitset.h.
15162 * lib/ebitset.h: Likewise.
15163 * lib/lbitset.h: Likewise.
15164
15165 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
15166 All instances of parameters of type enum bitset_opts are now of
15167 type enum_bitset_opts, to conform to the C Standard, and similarly
15168 for enum_bitset_type.
15169 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
15170 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
15171
15172 Do not use "struct bitset_struct" to mean different things in
15173 different modules. Not only is this confusing, it violates
15174 the C Standard, which requires that structure types in different
15175 modules must be compatible if one is to be passed to the other.
15176 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
15177 All instances of "struct bitset_struct *" replaced with "bitset".
15178 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
15179 (union bitset_union, struct abitset_struct, struct ebitset_struct,
15180 struct lbitset_struct, struct bitset_stats_struct): New types.
15181 All uses of struct bitset_struct changed to union bitset_union,
15182 etc.
ba0fe3c7 15183 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
15184 struct bitset_struct): Remove.
15185 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
15186 struct bitset_struct): Remove.
15187 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
15188 bitset_struct): Remove.
15189 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
15190 Likewise.
15191
15192 Do not call a function of type T using a call that assumes the
15193 function is of a different type U. Standard C requires that a
15194 function must be called with a type that is compatible with its
15195 definition.
15196 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
15197 New decls.
15198 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
15199 New functions.
15200 * lib/ebitset.c (PFV): Remove.
15201 * lib/lbitset.c (PFV): Likewise.
15202 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
15203 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
15204 decls.
15205 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
15206 (ebitset_vtable): Use them.
15207 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
15208 lbitset_xor): New functions.
15209 (lbitset_vtable): Use them.
15210
15211 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
15212 Declare.
15213
15214 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
15215 GCC warning.
15216 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
15217 Use offsetof, for simplicity.
15218
6fbe4984
PE
152192002-10-06 Paul Eggert <eggert@twinsun.com>
15220
15221 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
15222 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 15223 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
15224 which was inadvertently undone by the 2002-09-30 patch.
15225 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
15226 the same width as int.
15227
420f93c8
PE
152282002-10-04 Paul Eggert <eggert@twinsun.com>
15229
15230 Version 1.50.
15231
15232 * configure.ac (AC_INIT), NEWS: Increment version number.
15233
15234 * doc/bison.texinfo: Minor spelling, grammar, and white space
15235 fixes.
15236 (Symbols): Mention that any negative value returned from yylex
15237 signifies end-of-input. Warn about negative chars. Mention
15238 the portable Standard C character set.
15239
15240 The GNU coding standard says CFLAGS and YFLAGS are reserved
15241 for the installer to set.
15242 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
15243 * src/Makefile.am (AM_CFLAGS): Likewise.
15244 (AM_YFLAGS): Renamed from YFLAGS.
15245
15246 Fix some MAX and MIN problems.
15247 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
15248 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
15249 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
15250 * src/reader.c (reader): Use it.
15251
15252 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
15253 POSIX 1003.1-2001 has removed fgrep.
15254
152552002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
15256
15257 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
15258 interpreted as signed.
15259 * lib/ebitset.c (ebitset_list): Fix bug.
15260
ff68026d
PE
152612002-10-01 Paul Eggert <eggert@twinsun.com>
15262
15263 More fixes for 64-bit hosts and large bitsets.
15264
15265 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
15266 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
15267 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
15268 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
15269 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
15270 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
15271 bitset_count_): Likewise.
15272 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
15273 bitset_first, bitset_last): Likewise.
15274 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
15275 bitset_stats_list_reverse, bitset_stats_size,
15276 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
15277 Likewise.
15278 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
15279 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
15280 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
15281 bitsetv_reflexive_transitive_closure): Likewise.
15282 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
15283 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
15284 Likewise.
15285 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
15286 Likewise.
420f93c8 15287
ff68026d
PE
15288 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
15289 Use size_t, not unsigned int, to count bytes.
15290 * lib/abitset.h (abitset_bytes): Likewise.
15291 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
15292 Likewise.
15293 * lib/bitset.h (bitset_bytes): Likewise.
15294 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
15295 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
15296 * lib/bitsetv.c (bitsetv_alloc): Likewise.
15297 * lib/ebitset.c (ebitset_bytes): Likewise.
15298 * lib/ebitset.h (ebitset_bytes): Likewise.
15299 * lib/lbitset.c (lbitset_bytes): Likewise.
15300 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 15301
ff68026d
PE
15302 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
15303 abitset_subset_p, abitset_disjoint_p, abitset_and,
15304 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
15305 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
15306 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
15307 abitset_or_and, abitset_or_and_cmp):
15308 Use bitset_windex instead of unsigned int.
15309 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
15310 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
15311 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
15312 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
15313 Likewise.
15314 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 15315
ff68026d
PE
15316 * lib/bitset.c (bitset_print):
15317 Use proper printf formats for widths of integer types.
15318 * lib/bitset_stats.c (bitset_percent_histogram_print,
15319 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
15320 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
15321 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
15322 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 15323
ff68026d
PE
15324 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
15325 BITSET_SIZE_MAX): New macros.
15326 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
15327 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
15328 to BITSET_WINDEX_MAX.
15329
15330 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
15331 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
15332 since we now return the bitset_bindex type (not int).
15333
15334 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
15335 when computing sizes.
15336 * lib/ebitset.c (ebitset_elts_grow): Likewise.
15337
15338 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
15339 and avoid cast to unsigned.
15340
6aa452a6
AD
153412002-09-30 Akim Demaille <akim@epita.fr>
15342
15343 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
15344 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
15345 Updates from Michael Hayes.
15346
927f7817
AD
153472002-09-30 Art Haas <ahaas@neosoft.com>
15348
15349 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
15350 invocations.
15351 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
15352 defined.
15353
9738f41e
AD
153542002-09-27 Akim Demaille <akim@epita.fr>
15355
15356 Version 1.49c.
15357
a5c75d7f
AD
153582002-09-27 Akim Demaille <akim@epita.fr>
15359
15360 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
15361 (Because of AC_LIBSOURCE).
15362
8280e179
AD
153632002-09-27 Akim Demaille <akim@epita.fr>
15364
15365 Playing with Autoscan.
15366
15367 * configure.ac: Remove the old LIBOBJ tweaks.
15368 (AC_REPLACE_FUNCS): Add strrchr and strtol.
15369 * lib/strrchr.c: New.
15370 * lib/strtol.c: New, from the Coreutils 4.5.1.
15371
ae64af35
AD
153722002-09-27 Akim Demaille <akim@epita.fr>
15373
15374 Playing with Autoscan.
15375
15376 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
15377 * lib/Makefile.am (libbison_a_SOURCES): No longer include
15378 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
15379 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
15380 Coreutils 4.5.1.
15381
d1a1114f
AD
153822002-09-24 Akim Demaille <akim@epita.fr>
15383
15384 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
15385 (Frequently Asked Questions, Parser Stack Overflow): New.
15386
b906441c
AD
153872002-09-13 Akim Demaille <akim@epita.fr>
15388
15389 Playing with autoscan.
15390
15391 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
15392 * src/files.c (skeleton_find): Remove, unused.
15393 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
15394 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
15395
bd701811
AD
153962002-09-13 Akim Demaille <akim@epita.fr>
15397
15398 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
15399 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
15400
e0a13e7b
AD
154012002-09-13 Akim Demaille <akim@epita.fr>
15402
15403 * configure.ac: Require 2.54.
15404 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
15405 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
15406 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
15407 Remove, provided by Autoconf macros.
15408
c97011bf
AD
154092002-09-12 Akim Demaille <akim@epita.fr>
15410
15411 * m4/prereq.m4: Update, from Coreutils 4.5.1.
15412
d862b1be
AD
154132002-09-12 Akim Demaille <akim@epita.fr>
15414
15415 * m4/prereq.m4: Update, from Fileutils 4.1.5.
15416 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
15417 Reported by Martin Mokrejs.
15418
3d38c03a
AD
154192002-09-10 Akim Demaille <akim@epita.fr>
15420
15421 * src/parse-gram.y: Associate a human readable string to each
15422 token type.
15423 * tests/regression.at (Invalid inputs): Adjust.
15424
b6347355
AD
154252002-09-10 Gary V. Vaughan <gary@gnu.org>
15426
15427 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
15428 with an Autoconf-2.5x style configure.ac.
15429
09ba4ab2
PE
154302002-09-06 Paul Eggert <eggert@twinsun.com>
15431
15432 * doc/bison.texinfo (Conditions): Make explicit that the GPL
15433 exception applies only to yacc.c. This is a modification of a
15434 patch originally suggested by Akim Demaille.
15435
21846f69
AD
154362002-09-06 Akim Demaille <akim@epita.fr>
15437
09ba4ab2
PE
15438 * data/c.m4 (b4_copyright): Move the GPL exception comment from
15439 here to...
15440 * data/yacc.c: here.
15441
21846f69
AD
15442 * data/lalr1.cc (struct yyltype): Don't define it, since we use
15443 LocationType.
15444 (b4_ltype): Default to yy::Location from location.hh.
15445
c0ad8bf3
AD
154462002-09-04 Jim Meyering <jim@meyering.net>
15447
15448 * data/yacc.c: Guard the declaration of yytoknum also with
15449 `#ifdef YYPRINT', so it is declared only when used.
15450
3a93251e
AD
154512002-09-04 Akim Demaille <akim@epita.fr>
15452
15453 * configure.in: Rename as...
15454 * configure.ac: this.
15455 Bump to 1.49c.
15456
427c0dda
AD
154572002-09-04 Akim Demaille <akim@epita.fr>
15458
15459 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
15460 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
15461 translate maintainer only messages.
15462
6a254321
PE
154632002-08-12 Paul Eggert <eggert@twinsun.com>
15464
645e30d1
PE
15465 Version 1.49b.
15466
6a254321
PE
15467 * Makefile.am (SUBDIRS): Remove intl.
15468 (DISTCLEANFILES): Remove.
15469 * NEWS: Mention that GNU M4 is now required. Clarify what is
15470 meant by "larger grammars". Mention the pt_BR translation.
15471 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
15472 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
15473 Bump version from 0.11.2 to 0.11.5.
15474 (BISON_PREREQ_STAGE): Remove.
15475 (AM_GNU_GETTEXT): Use external gettext.
15476 (AC_OUTPUT): Remove intl/Makefile.
15477
15478 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
15479
15480 * data/glr.c: Include string.h, for strlen.
15481 (yyreportParseError): Use size_t for yysize.
15482 (yy_yypstack): No longer nested inside yypstates, as nested
15483 functions are not portable. Do not assume size_t is the
15484 same width as int.
15485 (yypstates): Do not assume that ptrdiff_t is the same width
15486 as int, and similarly for yyposn and YYINDEX.
15487
15488 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
15489
15490 * lib/Makefile.am (INCLUDES): Do not include from the intl
15491 directory, which has been removed.
15492 * src/Makefile.am (INCLUDES): Likewise.
15493
15494 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
15495 (bitsets_sources, additional_bitsets_sources, timevars_sources):
15496 New vars.
15497
15498 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
15499 * tests/Makefile.am (EXTRA_DIST): Likewise.
15500
15501 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
15502 Do not assume that bitset_windex is the same width as unsigned.
15503
15504 * lib/abitset.c (abitset_unused_clear): Do not assume that
15505 bitset_word is the same width as int.
15506 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
15507 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
15508 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
15509 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
15510 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
15511
15512 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
15513 portability to one's complement hosts!).
15514 * lib/ebitset.c (ebitset_op1): Likewise.
15515 * lib/lbitset.c (lbitset_op1): Likewise.
15516
15517 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
15518 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
15519 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
15520 Sync with fileutils.
15521 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
15522 lib/gettext.h: Sync with diffutils.
15523
15524 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
15525 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
15526
15527 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
15528 PROTOTYPES to check for prototypes, and "defined __STDC__" to
15529 check for void *.
15530
15531 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
15532 size_t; the old version tried to do this but casted improperly.
15533 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
15534 (bitset_test): Now returns int, not unsigned long.
15535
15536 * lib/bitset_stats.c: Include "gettext.h".
15537 (_): New macro.
15538 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
15539 name locals "index", as it generates unnecessary warnings on some
15540 hosts that have an "index" function.
15541
15542 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
15543 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
15544 they need translation.
15545 * src/LR0.c (state_list_append, new_itemsets, get_state,
15546 append_states, generate_states): Likewise.
15547 * src/assoc.c (assoc_to_string): Likewise.
15548 * src/closure.c (print_closure, set_firsts, closure): Likewise.
15549 * src/gram.c (grammar_dump): Likewise.
15550 * src/injections.c (injections_compute): Likewise.
15551 * src/lalr.c (lookaheads_print): Likewise.
15552 * src/relation.c (relation_transpose): Likewise.
15553 * src/scan-gram.l: Likewise.
15554 * src/tables.c (table_grow, pack_vector): Likewise.
15555
15556 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
15557 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
15558 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
15559 * m4/mbstate_t.m4: Sync with fileutils.
15560 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
15561
15562 * po/LINGUAS: Add pt_BR.
15563 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
15564 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
15565 lib/timevar.c.
15566 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
15567 manual recommends.
15568 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
15569
15570 * src/complain.c (strerror_r): Remove decl; not needed.
15571 (strerror): Use same pattern as ../lib/error.c.
15572
15573 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
15574
15575 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
15576
15577 * src/main.c (main): Cast result of bindtextdomain and textdomain
15578 to void, to avoid a GCC warning when --disable-nls is in effect.
15579
15580 * src/scan-gram.l: Use strings rather than escapes when possible,
15581 to minimize the number of warnings from xgettext.
15582 (handle_action_dollar, handle_action_at): Don't use isdigit,
15583 as it mishandles negative chars and it may not work as expected
15584 outside the C locale.
15585
15586 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
15587 this is a GCC extension and is not portable to other compilers.
15588
15589 * src/system.h (alloca): Use same pattern as ../lib/error.c.
15590 Do not include <ctype.h>; no longer needed.
15591 Do not include <malloc.h>; no longer needed (and generates
15592 warnings on OpenBSD 3.0).
15593
15594 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
15595 it's not portable.
15596
15597 * tests/regression.at: Do not use 'cc -c input.c -o input';
15598 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
15599
15600 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
15601 exit status as failure, not just exit status 1. Sun C exits
15602 with status 2 sometimes.
15603
15604 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
15605 Use it for the two large tests.
15606
c8f002c7
AD
156072002-08-02 Akim Demaille <akim@epita.fr>
15608
15609 * src/conflicts.c (conflicts_output): Don't output rules never
15610 reduced here, since anyway that computation doesn't work.
15611 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
15612 (rule_useless_p, rule_never_reduced_p): New.
15613 (grammar_rules_partial_print): Use a filter instead of a range.
15614 Display the title only if needed.
15615 (grammar_rules_print): Adjust.
15616 (grammar_rules_never_reduced_report): New.
15617 * src/tables.c (action_row): Move the computation of rules never
15618 reduced to...
15619 (token_actions): here.
15620 * src/main.c (main): Make the parser before making the report, so
15621 that rules never reduced are computed.
15622 Call grammar_rules_never_reduced_report.
15623 * src/print.c (print_results): Report rules never reduced.
15624 * tests/conflicts.at, tests/reduce.at: Adjust.
15625
cd08e51e
AD
156262002-08-01 Akim Demaille <akim@epita.fr>
15627
15628 Instead of attaching lookaheads and duplicating the rules being
15629 reduced by a state, attach the lookaheads to the reductions.
15630
15631 * src/state.h (state_t): Remove the `lookaheads',
15632 `lookaheads_rule' member.
15633 (reductions_t): Add a `lookaheads' member.
15634 Use a regular array for the `rules'.
15635 * src/state.c (reductions_new): Initialize the lookaheads member
15636 to 0.
15637 (state_rule_lookaheads_print): Adjust.
15638 * src/state.h, src/state.c (state_reductions_find): New.
15639 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
15640 (count_rr_conflicts): Adjust.
15641 * src/lalr.c (LArule): Remove.
15642 (add_lookback_edge): Adjust.
15643 (state_lookaheads_count): New.
15644 (states_lookaheads_initialize): Merge into...
15645 (initialize_LA): this.
15646 (lalr_free): Adjust.
15647 * src/main.c (main): Don't free nullable and derives too early: it
15648 is used by --verbose.
15649 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
15650
bb0027a9
AD
156512002-08-01 Akim Demaille <akim@epita.fr>
15652
15653 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
15654 `rule_number_t**'.
15655 (set_derives, free_derives): Rename as...
15656 (derives_compute, derives_free): this.
15657 Adjust all dependencies.
15658 * src/nullable.c (set_nullable, free_nullable): Rename as...
15659 (nullable_compute, nullable_free): these.
15660 (rule_list_t): Store rule_t *, not rule_number_t.
15661 * src/state.c (state_rule_lookaheads_print): Directly compare rule
15662 pointers, instead of their numbers.
15663 * src/main.c (main): Call nullable_free, and derives_free earlier,
15664 as they were lo longer used.
15665
3325ddc4
AD
156662002-08-01 Akim Demaille <akim@epita.fr>
15667
15668 * lib/timevar.c (get_time): Include children time.
15669 * src/lalr.h (LA, LArule): Don't export them: used with the
15670 state_t.
15671 * src/lalr.c (LA, LArule): Static.
15672 * src/lalr.h, src/lalr.c (lalr_free): New.
15673 * src/main.c (main): Call it.
15674 * src/tables.c (pack_vector): Check whether loc is >= to the
15675 table_size, not >.
15676 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
15677 (tables_generate): do it, since that's also it which allocates
15678 them.
15679 Don't free LA and LArule, main does.
15680
c6f1a33c
AD
156812002-07-31 Akim Demaille <akim@epita.fr>
15682
15683 Separate parser tables computation and output.
15684
15685 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
15686 (conflict_list, conflict_list_cnt, table, check, table_ninf)
15687 (yydefgoto, yydefact, high): Move to...
15688 * src/tables.h, src/tables.c: here.
15689 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
15690 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
15691 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
15692 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
15693 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
15694 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
15695 (action_row, save_row, token_actions, save_column, default_goto)
15696 (goto_actions, sort_actions, matching_state, pack_vector)
15697 (table_ninf_remap, pack_table, prepare_actions): Move to...
15698 * src/tables.c: here.
15699 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
15700 * src/output.c (token_actions, output_base, output_conflicts)
15701 (output_check): Merge into...
15702 (prepare_actions): this.
15703 (actions_output): Rename as...
15704 (user_actions_output): this.
15705 * src/main.c (main): Call tables_generate and tables_free.
15706
1509d42f
AD
157072002-07-31 Akim Demaille <akim@epita.fr>
15708
15709 Steal GCC's --time-report support.
15710
15711 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
15712 stolen/adjusted from GCC.
15713 * m4/stage.m4: Remove time related checks.
15714 * m4/timevar.m4: New.
15715 * configure.in: Adjust.
15716 * src/system.h: Adjust to using timevar.h.
15717 * src/getargs.h, src/getargs.c: Support trace_time for
15718 --trace=time.
15719 * src/main.c (stage): Remove.
15720 (main): Replace `stage' invocations with timevar calls.
15721 * src/output.c: Insert pertinent timevar calls.
15722
273a74fa
AD
157232002-07-31 Akim Demaille <akim@epita.fr>
15724
15725 Let --trace have arguments.
15726
15727 * src/getargs.h (enum trace_e): New.
15728 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
15729 (long_options, short_options): --trace/-T takes an optional
15730 argument.
15731 Change all the uses of trace_flag to reflect the new flags.
15732 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
15733
15734 Strengthen `stage' portability.
15735
15736 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
15737 * configure.in: Use it.
15738 Don't check for malloc.h and sys/times.h.
15739 * src/system.h: Include them when appropriate.
15740 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
15741 times and struct tms are available.
15742
217598da
AD
157432002-07-30 Akim Demaille <akim@epita.fr>
15744
15745 In verbose parse error message, don't report `error' as an
15746 expected token.
15747 * tests/actions.at (Printers and Destructors): Adjust.
15748 * tests/calc.at (Calculator $1): Adjust.
15749 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
15750 error message, do not report the parser accepts the error token in
15751 that state.
15752
52489d44
AD
157532002-07-30 Akim Demaille <akim@epita.fr>
15754
15755 Normalize conflict related messages.
15756
15757 * src/complain.h, src/complain.c (warn, complain): New.
15758 * src/conflicts.c (conflicts_print): Use them.
15759 (conflict_report_yacc): New, extracted from...
15760 (conflicts_print): here.
15761 * tests/conflicts.at, tests/existing.at: Adjust.
15762
e8832397
AD
157632002-07-30 Akim Demaille <akim@epita.fr>
15764
15765 Report rules which are never reduced by the parser: those hidden
15766 by conflicts.
15767
15768 * src/LR0.c (save_reductions): Don't make the final state too
15769 different: save its reduction (accept) instead of having a state
15770 without any action (no shift or goto, no reduce).
15771 Note: the final state is now a ``regular'' state, i.e., the
15772 parsers now contain `reduce 0' as default reduction.
15773 Nevertheless, since they decide to `accept' when yystate =
15774 final_state, they still will not reduce rule 0.
15775 * src/print.c (print_actions, print_reduction): Adjust.
15776 * src/output.c (action_row): Track reduced rules.
15777 (token_actions): Report rules never reduced.
15778 * tests/conflicts.at, tests/regression.at: Adjust.
15779
caf23d24
AD
157802002-07-30 Akim Demaille <akim@epita.fr>
15781
15782 `stage' was accidently included in a previous patch.
15783 Initiate its autoconfiscation.
15784
15785 * configure.in: Look for malloc.h and sys/times.h.
15786 * src/main.c (stage): Adjust.
15787 Report only when trace_flag.
15788
640748ee
AD
157892002-07-29 Akim Demaille <akim@epita.fr>
15790
15791 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
15792 state_number_t.
15793 (errs_t): symbol_t*, not symbol_number_t.
15794 (reductions_t): rule_t*, not rule_number_t.
15795 (FOR_EACH_SHIFT): New.
15796 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
15797 * src/print.c, src/print_graph.c: Adjust.
15798
88bce5a2
AD
157992002-07-29 Akim Demaille <akim@epita.fr>
15800
15801 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
15802
15803 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
15804 (endtoken, accept): these.
15805 * src/reader.c (reader): Set endtoken's default tag to "$end".
15806 Set undeftoken's tag to "$undefined" instead of "$undefined.".
15807 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
15808 Adjust.
15809
1bfb97db
AD
158102002-07-29 Akim Demaille <akim@epita.fr>
15811
15812 * src/reduce.c (reduce_grammar): When the language is empty,
15813 complain about the start symbol, not the axiom.
15814 Use its location.
15815 * tests/reduce.at (Empty Language): New.
15816
fc5734fe
AD
158172002-07-26 Akim Demaille <akim@epita.fr>
15818
15819 * src/reader.h, src/reader.c (gram_error): ... can't get
15820 yycontrol without making too strong assumptions on the parser
15821 itself.
15822 * src/output.c (prepare_tokens): Use the real 0th value of
15823 token_translations instead of `0'.
15824 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
15825 visible here.
15826 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
15827 for the time being: %locations ought to provide it to yyerror.
15828
3650b4b8
AD
158292002-07-25 Akim Demaille <akim@epita.fr>
15830
15831 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
15832 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
15833 * tests/regression.at (Web2c Actions): Adjust.
15834
4b3d3a8e
AD
158352002-07-25 Akim Demaille <akim@epita.fr>
15836
15837 Stop storing rules from 1 to nrules + 1.
15838
15839 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
15840 * src/nullable.c, src/output.c, src/print.c, src/reader.c
15841 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
15842 Iterate from 0 to nrules.
15843 Use rule_number_as_item_number and item_number_as_rule_number.
15844 Adjust to `derive' now containing possibly 0.
15845 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
15846 Handle the `- 1' part in rule numbers from/to item numbers.
15847 * src/conflicts.c (log_resolution): Fix the message which reversed
15848 shift and reduce.
15849 * src/output.c (action_row): Initialize default_rule to -1.
15850 (token_actions): Adjust.
15851 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
15852 expected output.
15853 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
15854
4a2a22f4
AD
158552002-07-25 Akim Demaille <akim@epita.fr>
15856
15857 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
15858 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
15859 (b4_c_knr_arg_decl): New.
15860 * data/yacc.c: Use it to define yysymprint, yydestruct, and
15861 yyreport_parse_error.
15862
b8df3223
AD
158632002-07-25 Akim Demaille <akim@epita.fr>
15864
15865 * data/yacc.c (yyreport_parse_error): New, extracted from...
15866 (yyparse): here.
15867 (yydestruct, yysymprint): Move above yyparse.
15868 Be K&R compliant.
15869
a762e609
AD
158702002-07-25 Akim Demaille <akim@epita.fr>
15871
15872 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
15873 replace...
15874 (b4_sint_type, b4_uint_type): these.
15875 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
15876 * tests/regression.at (Web2c Actions): Adjust.
15877
12b0043a
AD
158782002-07-25 Akim Demaille <akim@epita.fr>
15879
15880 * src/gram.h (TIEM_NUMBER_MAX): New.
15881 (item_number_of_rule_number, rule_number_of_item_number): Rename
15882 as...
15883 (rule_number_as_item_number, item_number_as_rule_number): these.
15884 Adjust dependencies.
15885 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
15886 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
15887 (symbol_number_to_vector_number): New.
15888 (order): Of vector_number_t* type.
15889 (base_t, BASE_MAX, BASE_MIN): New.
15890 (froms, tos, width, pos, check): Of base_t type.
15891 (action_number_t, ACTION_MIN, ACTION_MAX): New.
15892 (actrow): Of action_number_t type.
15893 (conflrow): Of unsigned int type.
15894 (table_ninf, base_ninf): New.
15895 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
15896 (muscle_insert_int_table, muscle_insert_base_table)
15897 (muscle_insert_rule_number_table): New.
15898 (prepare_tokens): Output `toknum' as int_table.
15899 (action_row): Returns a rule_number_t.
15900 Use ACTION_MIN, not SHRT_MIN.
15901 (token_actions): yydefact is rule_number_t*.
15902 (table_ninf_remap): New.
15903 (pack_table): Use it for `base' and `table'.
15904 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
15905 replaced with...
15906 (YYPACT_NINF, YYTABLE_NINF): these.
15907 (yypact, yytable): Compute their types instead of hard-coded
15908 `short'.
15909 * tests/regression.at (Web2c Actions): Adjust.
15910
5dde258a
AD
159112002-07-19 Akim Demaille <akim@epita.fr>
15912
15913 * src/scan-gram.l (id): Can start with an underscore.
15914
a945ec39
AD
159152002-07-16 Akim Demaille <akim@epita.fr>
15916
15917 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
15918 Adjust all former `associativity' dependencies.
15919 * src/symtab.c (symbol_new): Default associativity is `undef', not
15920 `right'.
15921 (symbol_check_alias_consistence): Adjust.
15922
fae437e8
AD
159232002-07-09 Akim Demaille <akim@epita.fr>
15924
15925 * doc/bison.texinfo: Properly set the ``header'' part.
15926 Use @dircategory ``GNU programming tools'' as per Texinfo's
15927 documentation.
15928 Use @copying.
15929
1a715ef2
AD
159302002-07-09 Akim Demaille <akim@epita.fr>
15931
15932 * lib/quotearg.h: Protect against multiple inclusions.
15933 * src/location.h (location_t): Add a `file' member.
15934 (LOCATION_RESET, LOCATION_PRINT): Adjust.
15935 * src/complain.c (warn_at, complain_at, fatal_at): Drop
15936 `error_one_per_line' support.
15937
a5d50994
AD
159382002-07-09 Akim Demaille <akim@epita.fr>
15939
15940 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
15941 * src/reader.c (lineno): Remove.
15942 Adjust all dependencies.
15943 (get_merge_function): Take a location and use complain_at.
15944 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
15945 * tests/regression.at (Invalid inputs, Mixing %token styles):
15946 Adjust.
15947
b275314e
AD
159482002-07-09 Akim Demaille <akim@epita.fr>
15949
15950 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
15951 recovery rule, and forbid extensions when --yacc.
15952 (gram_error): Use complain_at.
15953 * src/reader.c (reader): Exit if there were parse errors.
15954
865b9df1
AD
159552002-07-09 Akim Demaille <akim@epita.fr>
15956
15957 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
15958 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
15959 Reported by R Blake <blakers@mac.com>.
15960
c76e14da
AD
159612002-07-09 Akim Demaille <akim@epita.fr>
15962
15963 * data/yacc.c: Output the copyright notive in the header.
15964
7db2ed2d
AD
159652002-07-03 Akim Demaille <akim@epita.fr>
15966
15967 * src/output.c (froms, tos): Are state_number_t.
15968 (save_column): sp, sp1, and sp2 are state_number_t.
15969 (prepare): Rename `final' as `final_state_number', `nnts' as
15970 `nterms_number', `nrules' as `rules_number', `nstates' as
15971 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
15972 unused.
15973 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
15974 * data/lalr1.cc (nsym_): Remove, unused.
15975
e68e0410
AD
159762002-07-03 Akim Demaille <akim@epita.fr>
15977
15978 * src/lalr.h, src/lalr.c (goto_number_t): New.
15979 * src/lalr.c (goto_list_t): New.
15980 Propagate them.
15981 * src/nullable.c (rule_list_t): New.
15982 Propagate.
15983 * src/types.h: Remove.
15984
e1a4f3a4
AD
159852002-07-03 Akim Demaille <akim@epita.fr>
15986
15987 * src/closure.c (print_fderives): Use rule_rhs_print.
15988 * src/derives.c (print_derives): Use rule_rhs_print.
15989 (rule_list_t): New, replaces `shorts'.
15990 (set_derives): Add comments.
15991 * tests/sets.at (Nullable, Firsts): Adjust.
15992
536545f3
AD
159932002-07-03 Akim Demaille <akim@epita.fr>
15994
15995 * src/output.c (prepare_actions): Free `tally' and `width'.
15996 (prepare_actions): Allocate and free `order'.
15997 * src/symtab.c (symbols_free): Free `symbols'.
15998 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
15999 * src/output.c (m4_invoke): Move to...
16000 * src/scan-skel.l: here.
16001 (<<EOF>>): Close yyout, and free its name.
16002
8b752b00
AD
160032002-07-03 Akim Demaille <akim@epita.fr>
16004
16005 Fix some memory leaks, and fix a bug: state 0 was examined twice.
16006
16007 * src/LR0.c (new_state): Merge into...
16008 (state_list_append): this.
16009 (new_states): Merge into...
16010 (generate_states): here.
16011 (set_states): Don't ensure a proper `errs' state member here, do it...
16012 * src/conflicts.c (conflicts_solve): here.
16013 * src/state.h, src/state.c: Comment changes.
16014 (state_t): Rename member `shifts' as `transitions'.
16015 Adjust all dependencies.
16016 (errs_new): For consistency, also take the values as argument.
16017 (errs_dup): Remove.
16018 (state_errs_set): New.
16019 (state_reductions_set, state_transitions_set): Assert that no
16020 previous value was assigned.
16021 (state_free): New.
16022 (states_free): Use it.
16023 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
16024 temporary storage: use `errs' and `nerrs' as elsewhere.
16025 (set_conflicts): Allocate and free this `errs'.
16026
613f5e1a
AD
160272002-07-02 Akim Demaille <akim@epita.fr>
16028
16029 * lib/libiberty.h: New.
16030 * lib: Update the bitset implementation from upstream.
16031 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
16032 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
16033 * src/main.c: Adjust bitset stats calls.
16034
26e0cadc
PE
160352002-07-01 Paul Eggert <eggert@twinsun.com>
16036
16037 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
16038 char, so that negative chars don't collide with $.
16039
1154cced
AD
160402002-06-30 Akim Demaille <akim@epita.fr>
16041
16042 Have the GLR tests be `warning' checked, and fix the warnings.
16043
16044 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
16045 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
16046 (yyremoveDeletes): `yyi' and `yyj' are size_t.
16047 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
16048 (yyaddDeferredAction): static.
16049 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
16050 (yyreportParseError): yyprefix is const.
16051 yytokenp is used only when verbose.
16052 (yy__GNUC__): Replace with __GNUC__.
16053 (yypdumpstack): yyi is size_t.
16054 (yypreference): Un-yy local variables and arguments, to avoid
16055 clashes with `yyr1'. Anyway, we are not in the user name space.
16056 (yytname_size): be an int, as is compared with ints.
16057 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
16058 Use them.
16059 * tests/cxx-gram.at: Use quotation to protect $1.
16060 Use AT_COMPILE to enable warnings hunts.
16061 Prototype yylex and yyerror.
16062 `Use' argc.
16063 Include `string.h', not `strings.h'.
16064 Produce and prototype stmtMerge only when used.
16065 yylex takes a location.
16066
97650f4e
AD
160672002-06-30 Akim Demaille <akim@epita.fr>
16068
16069 We spend a lot of time in quotearg, in particular when --verbose.
16070
16071 * src/symtab.c (symbol_get): Store a quoted version of the key.
16072 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
16073 Adjust all callers.
16074
d2576365
AD
160752002-06-30 Akim Demaille <akim@epita.fr>
16076
16077 * src/state.h (reductions_t): Rename member `nreds' as num.
16078 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
16079 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
16080
ccaf65bc
AD
160812002-06-30 Akim Demaille <akim@epita.fr>
16082
16083 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
16084 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
16085 (shifts_to): Rename as...
16086 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
16087 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
16088 (TRANSITION_IS_DISABLED, transitions_to): these.
16089
87675353
AD
160902002-06-30 Akim Demaille <akim@epita.fr>
16091
16092 * src/print.c (print_shifts, print_gotos): Merge into...
16093 (print_transitions): this.
16094 (print_transitions, print_errs, print_reductions): Align the
16095 lookaheads columns.
16096 (print_core, print_transitions, print_errs, print_state,
16097 print_grammar): Output empty lines separator before, not after.
16098 (state_default_rule_compute): Rename as...
16099 (state_default_rule): this.
16100 * tests/conflicts.at (Defaulted Conflicted Reduction),
16101 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
16102 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
16103
ce4ccb4b
AD
161042002-06-30 Akim Demaille <akim@epita.fr>
16105
16106 Display items as we display rules.
16107
16108 * src/gram.h, src/gram.c (rule_lhs_print): New.
16109 * src/gram.c (grammar_rules_partial_print): Use it.
16110 * src/print.c (print_core): Likewise.
16111 * tests/conflicts.at (Defaulted Conflicted Reduction),
16112 (Unresolved SR Conflicts): Adjust.
16113 (Unresolved SR Conflicts): Adjust and rename as...
16114 (Resolved SR Conflicts): this, as was meant.
16115 * tests/regression.at (Web2c Report): Adjust.
16116
bc933ef1
AD
161172002-06-30 Akim Demaille <akim@epita.fr>
16118
16119 * src/print.c (state_default_rule_compute): New, extracted from...
16120 (print_reductions): here.
16121 Pessimize, but clarify the code.
16122 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
16123
53d4308d
AD
161242002-06-30 Akim Demaille <akim@epita.fr>
16125
16126 * src/output.c (action_row): Let default_rule be always a rule
16127 number.
16128
574fb2d5
AD
161292002-06-30 Akim Demaille <akim@epita.fr>
16130
16131 * src/closure.c (print_firsts, print_fderives, closure):
16132 Use BITSET_EXECUTE.
16133 * src/lalr.c (lookaheads_print): Likewise.
16134 * src/state.c (state_rule_lookaheads_print): Likewise.
16135 * src/print_graph.c (print_core): Likewise.
16136 * src/print.c (print_reductions): Likewise.
16137 * src/output.c (action_row): Likewise.
16138 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
16139
05811fd7
AD
161402002-06-30 Akim Demaille <akim@epita.fr>
16141
16142 * src/print_graph.c: Use report_flag.
16143
0e4d5753
AD
161442002-06-30 Akim Demaille <akim@epita.fr>
16145
16146 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
16147 to...
16148 * src/relation.h, src/relation.c (traverse, relation_digraph)
16149 (relation_print, relation_transpose): New.
16150
24c7d800
AD
161512002-06-30 Akim Demaille <akim@epita.fr>
16152
16153 * src/state.h, src/state.c (shifts_to): New.
16154 * src/lalr.c (build_relations): Use it.
16155
9222837b
AD
161562002-06-30 Akim Demaille <akim@epita.fr>
16157
16158 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
16159 (item_number_of_rule_number, rule_number_of_item_number): New.
16160 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
16161 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
16162 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
16163 Propagate their use.
16164 Much remains to be done, in particular wrt `shorts' from types.h.
16165
260008e5
AD
161662002-06-30 Akim Demaille <akim@epita.fr>
16167
16168 * src/symtab.c (symbol_new): Initialize the `printer' member.
16169
8a731ca8
AD
161702002-06-30 Akim Demaille <akim@epita.fr>
16171
16172 * src/LR0.c (save_reductions): Remove, replaced by...
16173 * src/state.h, src/state.c (state_reductions_set): New.
16174 (reductions, errs): Rename as...
16175 (reductions_t, errs_t): these.
16176 Adjust all dependencies.
16177
32e1e0a4
AD
161782002-06-30 Akim Demaille <akim@epita.fr>
16179
16180 * src/LR0.c (state_list_t, state_list_append): New.
16181 (first_state, last_state): Now symbol_list_t.
16182 (this_state): Remove.
16183 (new_itemsets, append_states, save_reductions): Take a state_t as
16184 argument.
16185 (set_states, generate_states): Adjust.
16186 (save_shifts): Remove, replaced by...
16187 * src/state.h, src/state.c (state_shifts_set): New.
16188 (shifts): Rename as...
16189 (shifts_t): this.
16190 Adjust all dependencies.
16191 * src/state.h (state_t): Remove the `next' member.
16192
e5fb6710
AD
161932002-06-30 Akim Demaille <akim@epita.fr>
16194
16195 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
16196 escaped in slot 0.
16197
c7ca99d4
AD
161982002-06-30 Akim Demaille <akim@epita.fr>
16199
16200 Use hash.h for the state hash table.
16201
16202 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
16203 (allocate_storage): Use state_hash_new.
16204 (free_storage): Use state_hash_free.
16205 (new_state, get_state): Adjust.
16206 * src/lalr.h, src/lalr.c (states): Move to...
16207 * src/states.h (state_t): Remove the `link' member, no longer
16208 used.
16209 * src/states.h, src/states.c: here.
16210 (state_hash_new, state_hash_free, state_hash_lookup)
16211 (state_hash_insert, states_free): New.
16212 * src/states.c (state_table, state_compare, state_hash): New.
16213 * src/output.c (output_actions): Do not free states now, since we
16214 still need to know the final_state number in `prepare', called
16215 afterwards. Do it...
16216 * src/main.c (main): here: call states_free after `output'.
16217
df0e7316
AD
162182002-06-30 Akim Demaille <akim@epita.fr>
16219
16220 * src/state.h, src/state.c (state_new): New, extracted from...
16221 * src/LR0.c (new_state): here.
16222 * src/state.h (STATE_ALLOC): Move to...
16223 * src/state.c: here.
16224 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
16225 * src/state.h, src/state.c: here.
16226
39f41916
AD
162272002-06-30 Akim Demaille <akim@epita.fr>
16228
16229 * src/reader.c (gensym): Rename as...
16230 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
16231 (getsym): Rename as...
16232 (symbol_get): this.
16233
d57650a5
AD
162342002-06-30 Akim Demaille <akim@epita.fr>
16235
16236 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
16237 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
16238 * src/output.c, src/print.c, src/print_graph.c: Propagate.
16239 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
16240
5a08f1ce
AD
162412002-06-30 Akim Demaille <akim@epita.fr>
16242
16243 Make the test suite pass with warnings checked.
16244
16245 * tests/actions.at (Printers and Destructors): Improve.
16246 Avoid unsigned vs. signed issues.
16247 * tests/calc.at: Don't exercise the scanner here, do it...
16248 * tests/input.at (Torturing the Scanner): here.
16249
720623af
PH
162502002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16251
88e7e941 16252 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
16253 reorganize first lines parallel to yacc.c.
16254
fb8135fa
AD
162552002-06-28 Akim Demaille <akim@epita.fr>
16256
16257 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
16258 (b4_token_enum, b4_token_defines): New, factored from...
16259 * data/lalr1.cc, data/yacc.c, glr.c: here.
16260
41442480
AD
162612002-06-28 Akim Demaille <akim@epita.fr>
16262
16263 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
16264 unused variables.
16265 * src/output.c (merger_output): static.
16266
e0e5bf84
AD
162672002-06-28 Akim Demaille <akim@epita.fr>
16268
ba0fe3c7 16269 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
16270 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
16271 pacify GCC.
16272 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 16273
676385e2
PH
162742002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16275
16276 Accumulated changelog for new GLR parsing features.
16277
6a254321 16278 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
16279 conflicts_total_count.
16280 * src/conflicts.h: Ditto.
16281 * src/output.c (token_actions): Use the new name.
16282 (output_conflicts): Change conflp => conflict_list_heads, and
16283 confl => conflict_list for better readability.
16284 * data/glr.c: Use the new names.
16285 * NEWS: Add self to GLR announcement.
e0e5bf84 16286
676385e2
PH
16287 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
16288
16289 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
16290 Akim Demaille.
16291
16292 * data/bison.glr: Change name to glr.c
16293 * data/glr.c: Renamed from bison.glr.
16294 * data/Makefile.am: Add glr.c
e0e5bf84
AD
16295
16296 * src/getargs.c:
16297
676385e2 16298 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 16299 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 16300
676385e2
PH
16301 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16302
16303 * data/bison.glr: Be sure to restore the
16304 current #line when returning to the skeleton contents after having
16305 exposed the input file's #line.
16306
16307 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16308
16309 * data/bison.glr: Bring up to date with changes to bison.simple.
16310
16311 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16312
16313 * data/bison.glr: Correct definitions that use b4_prefix.
16314 Various reformatting.
16315 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
16316 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
16317 yytokenp argument; now part of stack.
16318 (yychar): Define to behave as documented.
16319 (yyclearin): Ditto.
e0e5bf84 16320
676385e2
PH
16321 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16322
16323 * src/reader.h: Add declaration for free_merger_functions.
16324
16325 * src/reader.c (merge_functions): New variable.
16326 (get_merge_function): New function.
16327 (free_merger_functions): New function.
16328 (readgram): Check for %prec that is not followed by a symbol.
16329 Handle %dprec and %merge declarations.
16330 (packgram): Initialize dprec and merger fields in rules array.
16331
16332 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
16333 conflict_list_cnt, conflict_list_free): New variables.
16334 (table_grow): Also grow conflict_table.
e0e5bf84 16335 (prepare_rules): Output dprec and merger tables.
676385e2 16336 (conflict_row): New function.
e0e5bf84 16337 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
16338 default reduction in conflicted states for GLR parser so that there
16339 are spaces for the conflict lists.
16340 (save_row): Also save conflict information.
16341 (token_actions): Allocate conflict list.
16342 (merger_output): New function.
16343 (pack_vector): Pack conflict table, too.
16344 (output_conflicts): New function to output yyconflp and yyconfl.
16345 (output_check): Allocate conflict_tos.
16346 (output_actions): Output conflict tables, also.
16347 (output_skeleton): Output b4_mergers definition.
16348 (prepare): Output b4_max_rhs_length definition.
16349 Use 'bison.glr' as default skeleton for GLR parsers.
16350
16351 * src/gram.c (glr_parser): New flag.
16352 (grammar_free): Call free_merger_functions.
16353
16354 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
16355 all pairs of conflicting reductions, rather than just all tokens
16356 causing conflicts. Needed to size conflict tables.
e0e5bf84 16357 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
16358 interface.
16359 (conflicts_print): Ditto.
16360 (count_total_conflicts): New function.
16361
16362 * src/reader.h (merger_list): New type.
16363 (merge_functions): New variable.
16364
16365 * src/lex.h (tok_dprec, tok_merge): New token types.
16366
16367 * src/gram.h (rule_s): Add dprec and merger fields.
16368 (glr_parser): New flag.
16369
16370 * src/conflicts.h (count_total_conflicts): New function.
16371
16372 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
16373
16374 * doc/bison.texinfo (Generalized LR Parsing): New section.
16375 (GLR Parsers): New section.
16376 (Language and Grammar): Mention GLR parsing.
16377 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
16378 Correct typo ("tge" -> "the").
16379
16380 * data/bison.glr: New skeleton for GLR parsing.
16381
16382 * tests/cxx-gram.at: New tests for GLR parsing.
16383
16384 * tests/testsuite.at: Include cxx-gram.at.
16385
16386 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 16387
676385e2
PH
16388 * src/parse-gram.y:
16389
16390 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
16391
16392 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 16393
b5480d74 163942002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
16395
16396 * src/options.h, src/options.c: Remove.
16397 * src/getargs.c (short_options, long_options): New.
16398
60491a94
AD
163992002-06-27 Akim Demaille <akim@epita.fr>
16400
16401 * data/bison.simple, data/bison.c++: Rename as...
16402 * data/yacc.c, data/lalr1.cc: these.
16403 * doc/bison.texinfo (Environment Variables): Remove.
16404
9be0c25b
AD
164052002-06-25 Raja R Harinath <harinath@cs.umn.edu>
16406
16407 * src/getargs.c (report_argmatch): Initialize strtok().
16408
1ae72863
AD
164092002-06-20 Akim Demaille <akim@epita.fr>
16410
16411 * data/bison.simple (b4_symbol_actions): New, replaces...
16412 (b4_symbol_destructor, b4_symbol_printer): these.
16413 (yysymprint): Be sure to call YYPRINT only for tokens, and using
16414 user token numbers.
16415
87542d29
AD
164162002-06-20 Akim Demaille <akim@epita.fr>
16417
16418 * data/bison.simple (yydestructor): Rename as...
16419 (yydestruct): this.
16420
1a31ed21
AD
164212002-06-20 Akim Demaille <akim@epita.fr>
16422
16423 * src/symtab.h, src/symtab.c (symbol_type_set)
16424 (symbol_destructor_set, symbol_precedence_set): The location is
16425 the last argument.
16426 Adjust all callers.
16427
e776192e
AD
164282002-06-20 Akim Demaille <akim@epita.fr>
16429
16430 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
16431 internals.
16432 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
16433 Takes a location.
16434 * src/symtab.h, src/symtab.c (symbol_class_set)
16435 (symbol_user_token_number_set): Likewise.
16436 Adjust all callers.
16437 Promote complain_at.
16438 * tests/input.at (Type Clashes): Adjust.
16439
5c1180b3
AD
164402002-06-20 Akim Demaille <akim@epita.fr>
16441
16442 * data/bison.simple (YYLEX): Fix the declaration when
16443 %pure-parser.
16444
e3170060
AD
164452002-06-20 Akim Demaille <akim@epita.fr>
16446
16447 * data/bison.simple (yysymprint): Don't print the token number,
16448 just its name.
16449 * tests/actions.at (Destructors): Rename as...
16450 (Printers and Destructors): this.
16451 Also exercise %printer.
16452
253862fd
AD
164532002-06-20 Akim Demaille <akim@epita.fr>
16454
16455 * data/bison.simple (YYDSYMPRINT): New.
16456 Use it to remove many of the #if YYDEBUG/if (yydebug).
16457
366eea36
AD
164582002-06-20 Akim Demaille <akim@epita.fr>
16459
16460 * src/symtab.h, src/symtab.c (symbol_t): printer and
16461 printer_location are new members.
16462 (symbol_printer_set): New.
16463 * src/parse-gram.y (PERCENT_PRINTER): New token.
16464 Handle its associated rule.
16465 * src/scan-gram.l: Adjust.
16466 (handle_destructor_at, handle_destructor_dollar): Rename as...
16467 (handle_symbol_code_at, handle_symbol_code_dollar): these.
16468 * src/output.c (symbol_printers_output): New.
16469 (output_skeleton): Call it.
16470 * data/bison.simple (yysymprint): New. Cannot be named yyprint
16471 since there are already many grammar files with a user `yyprint'.
16472 Replace the calls to YYPRINT to calls to yysymprint.
16473 * tests/calc.at: Adjust.
16474 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
16475 taking advantage of parser very internal details (stack size!).
16476
4f25ebb0
AD
164772002-06-20 Akim Demaille <akim@epita.fr>
16478
16479 * src/scan-gram.l: Complete the scanner with the missing patterns
16480 to pacify Flex.
16481 Use `quote' and `symbol_tag_get' where appropriate.
16482
93b68a0e
AD
164832002-06-19 Akim Demaille <akim@epita.fr>
16484
16485 * tests/actions.at (Destructors): Augment to test locations.
16486 * data/bison.simple (yydestructor): Pass it the current location
16487 if locations are enabled.
16488 Prototype only when __STDC__ or C++.
16489 Change the argument names to move into the yy name space: there is
16490 user code here.
16491
58612f1d
AD
164922002-06-19 Akim Demaille <akim@epita.fr>
16493
74310291
AD
16494 * data/bison.simple (b4_pure_if): New.
16495 Use it instead of #ifdef YYPURE.
16496
164972002-06-19 Akim Demaille <akim@epita.fr>
16498
16499 * data/bison.simple (b4_location_if): New.
58612f1d
AD
16500 Use it instead of #ifdef YYLSP_NEEDED.
16501
f25bfb75
AD
165022002-06-19 Akim Demaille <akim@epita.fr>
16503
16504 Prepare @$ in %destructor, but currently don't bind it in the
16505 skeleton, as %location use is not cleaned up yet.
16506
16507 * src/scan-gram.l (handle_dollar, handle_destructor_at)
16508 (handle_action_at): New.
16509 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
16510 a braced_code_t and a location as additional arguments.
16511 (handle_destructor_dollar): Instead of requiring `b4_eval', just
16512 unquote one when outputting `b4_dollar_dollar'.
16513 Adjust callers.
16514 * data/bison.simple (b4_eval): Remove.
16515 (b4_symbol_destructor): Adjust.
16516 * tests/input.at (Invalid @n): Adjust.
16517
c732d2c6
AD
165182002-06-19 Zack Weinberg <zack@codesourcery.com>
16519
16520 * doc/bison.texinfo: Document ability to have multiple
16521 prologue sections.
16522
8c165d89
AD
165232002-06-18 Akim Demaille <akim@epita.fr>
16524
16525 * src/files.c (compute_base_names): When computing the output file
16526 names from the input file name, strip the directory part.
16527
ca98bf57
AD
165282002-06-18 Akim Demaille <akim@epita.fr>
16529
16530 * data/bison.simple.new: Comment changes.
16531 Reported by Andreas Schwab.
16532
0bfb02ff
AD
165332002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
16534
16535 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
16536 there are no `label `yyoverflowlab' defined but not used' warnings
16537 when yyoverflow is defined.
16538
24c0aad7
AD
165392002-06-18 Akim Demaille <akim@epita.fr>
16540
16541 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
16542 new member.
16543 (symbol_destructor_set): Adjust.
16544 * src/output.c (symbol_destructors_output): Output the destructor
16545 locations.
16546 Output the symbol name.
16547 * data/bison.simple (b4_symbol_destructor): Adjust.
16548
5719c109
AD
165492002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
16550 and Akim Demaille <akim@epita.fr>
16551
16552 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
16553 what's left on the stack when the error recovery hits EOF.
16554 * tests/actions.at (Destructors): Complete to exercise this case.
16555
9280d3ef
AD
165562002-06-17 Akim Demaille <akim@epita.fr>
16557
16558 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
16559 arguments is really empty, not only equal to `[]'.
16560 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
16561 member.
16562 (symbol_destructor_set): New.
16563 * src/output.c (symbol_destructors_output): New.
16564 * src/reader.h (brace_code_t, current_braced_code): New.
16565 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
16566 (handle_dollar): Rename as...
16567 (handle_action_dollar): this.
16568 (handle_destructor_dollar): New.
16569 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
16570 (grammar_declaration): Use it.
16571 * data/bison.simple (yystos): Is always defined.
16572 (yydestructor): New.
16573 * tests/actions.at (Destructors): New.
16574 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
16575
dafdc66f
AD
165762002-06-17 Akim Demaille <akim@epita.fr>
16577
16578 * src/symlist.h, src/symlist.c (symbol_list_length): New.
16579 * src/scan-gram.l (handle_dollar, handle_at): Compute the
16580 rule_length only when needed.
16581 * src/output.c (actions_output, token_definitions_output): Output
16582 the full M4 block.
16583 * src/symtab.c: Don't access directly to the symbol tag, use
16584 symbol_tag_get.
16585 * src/parse-gram.y: Use symbol_list_free.
16586
56c47203
AD
165872002-06-17 Akim Demaille <akim@epita.fr>
16588
16589 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
16590 (symbol_list_prepend, get_type_name): Move to...
16591 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
16592 (symbol_list_prepend, symbol_list_n_type_name_get): here.
16593 Adjust all callers.
16594 (symbol_list_free): New.
16595 * src/scan-gram.l (handle_dollar): Takes a location.
16596 * tests/input.at (Invalid $n): Adjust.
16597
1e0bab92
AD
165982002-06-17 Akim Demaille <akim@epita.fr>
16599
16600 * src/reader.h, src/reader.c (symbol_list_new): Export it.
16601 (symbol_list_prepend): New.
16602 * src/parse-gram.y (%union): `list' is a new member.
16603 (symbols.1): New, replaces...
16604 (terms_to_prec.1, nterms_to_type.1): these.
16605 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
16606 Take a location as additional argument.
16607 Adjust all callers.
16608
04e60654
AD
166092002-06-15 Akim Demaille <akim@epita.fr>
16610
16611 * src/parse-gram.y: Move %token in the declaration section so that
16612 we don't depend upon CVS Bison.
16613
10e5b8bd
AD
166142002-06-15 Akim Demaille <akim@epita.fr>
16615
16616 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
16617 * src/print.c (print_core): Use it.
16618
9801d40c
AD
166192002-06-15 Akim Demaille <akim@epita.fr>
16620
16621 * src/conflicts.c (log_resolution): Accept the rule involved in
16622 the sr conflicts instead of the lookahead number that points to
16623 that rule.
16624 (flush_reduce): Accept the current lookahead vector as argument,
16625 instead of the index in LA.
16626 (resolve_sr_conflict): Accept the current number of lookahead
16627 bitset to consider for the STATE, instead of the index in LA.
16628 (set_conflicts): Adjust.
16629 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
16630
c0263492
AD
166312002-06-15 Akim Demaille <akim@epita.fr>
16632
16633 * src/state.h (state_t): Replace the `lookaheadsp' member, a
16634 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
16635 Adjust all dependencies.
16636 * src/lalr.c (initialize_lookaheads): Split into...
16637 (states_lookaheads_count, states_lookaheads_initialize): these.
16638 (lalr): Adjust.
16639
9757c359
AD
166402002-06-15 Akim Demaille <akim@epita.fr>
16641
16642 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
16643 out of...
16644 (grammar_rules_print): here.
16645 * src/reduce.c (reduce_output): Use it.
16646 * tests/reduce.at (Useless Rules, Reduced Automaton)
16647 (Underivable Rules): Adjust.
16648
6b98e4b5
AD
166492002-06-15 Akim Demaille <akim@epita.fr>
16650
16651 Copy BYacc's nice way to report the grammar.
16652
16653 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
16654 New.
16655 Don't print the rules' location, it is confusing and useless.
16656 (rule_print): Use grammar_rhs_print.
16657 * src/print.c (print_grammar): Use grammar_rules_print.
16658
6b98e4b5
AD
166592002-06-15 Akim Demaille <akim@epita.fr>
16660
16661 Complete and rationalize `useless thing' warnings.
16662
16663 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
16664 (symbol_tag_print): New.
16665 Use them everywhere in place of accessing directly the tag member.
16666 * src/gram.h, src/gram.c (rule_print): New.
16667 Use it where a rule used to be printed `by hand'.
16668 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
16669 (reduce_grammar_tables): Report the useless rules.
16670 (reduce_print): Useless things are a warning, not an error.
16671 Report it as such.
16672 * tests/reduce.at (Useless Nonterminals, Useless Rules):
16673 (Reduced Automaton, Underivable Rules): Adjust.
16674 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
16675 * tests/conflicts.at (Unresolved SR Conflicts)
16676 (Solved SR Conflicts): Adjust.
16677
ee000ba4
AD
166782002-06-15 Akim Demaille <akim@epita.fr>
16679
16680 Let symbols have a location.
16681
16682 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
16683 (getsym): Adjust.
16684 Adjust all callers.
16685 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
16686 Use location_t, not int.
16687 * src/symtab.c (symbol_check_defined): Take advantage of the
16688 location.
16689 * tests/regression.at (Invalid inputs): Adjust.
16690
8efe435c
AD
166912002-06-15 Akim Demaille <akim@epita.fr>
16692
16693 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
16694 (input): Don't try to initialize yylloc here, do it in the
16695 scanner.
16696 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
16697 * src/gram.h (rule_t): Change line and action_line into location
16698 and action_location, of location_t type.
16699 Adjust all dependencies.
16700 * src/location.h, src/location.c (empty_location): New.
16701 * src/reader.h, src/reader.c (grammar_start_symbol_set)
16702 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
16703 (grammar_current_rule_symbol_append)
16704 (grammar_current_rule_action_append): Expect a location as argument.
16705 * src/reader.c (grammar_midrule_action): Adjust to attach an
16706 action's location as dummy symbol location.
16707 * src/symtab.h, src/symtab.c (startsymbol_location): New.
16708 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
16709 the line numbers.
16710
1921f1d7
AD
167112002-06-14 Akim Demaille <akim@epita.fr>
16712
16713 Grammar declarations may be found in the grammar section.
16714
16715 * src/parse-gram.y (rules_or_grammar_declaration): New.
16716 (declarations): Each declaration may end with a semicolon, not
16717 just...
16718 (grammar_declaration): `"%union"'.
16719 (grammar): Branch to rules_or_grammar_declaration.
16720
4515534c
AD
167212002-06-14 Akim Demaille <akim@epita.fr>
16722
16723 * src/main.c (main): Invoke scanner_free.
16724
f958596b
AD
167252002-06-14 Akim Demaille <akim@epita.fr>
16726
16727 * src/output.c (m4_invoke): Extracted from...
16728 (output_skeleton): here.
16729 Free tempfile.
16730
2c569025
AD
167312002-06-14 Akim Demaille <akim@epita.fr>
16732
16733 * src/parse-gram.y (directives, directive, gram)
16734 (grammar_directives, precedence_directives, precedence_directive):
16735 Rename as...
16736 (declarations, declaration, grammar, grammar_declaration)
16737 (precedence_declaration, precedence_declarator): these.
16738 (symbol_declaration): New.
16739
592e8d4d
AD
167402002-06-14 Akim Demaille <akim@epita.fr>
16741
16742 * src/files.c (action_obstack): Remove, unused.
16743 (output_obstack): Remove it, and all its dependencies, as it is no
16744 longer needed.
16745 * src/reader.c (epilogue_set): Build the epilogue in the
16746 muscle_obstack.
16747 * src/output.h, src/output.c (muscle_obstack): Move to...
16748 * src/muscle_tab.h, src/muscle_tab.h: here.
16749 (muscle_init): Initialize muscle_obstack.
16750 (muscle_free): New.
16751 * src/main.c (main): Call it.
16752
0c15323d
AD
167532002-06-14 Akim Demaille <akim@epita.fr>
16754
16755 * src/location.h: New, extracted from...
16756 * src/reader.h: here.
16757 * src/Makefile.am (noinst_HEADERS): Merge into
16758 (bison_SOURCES): this.
16759 Add location.h.
16760 * src/parse-gram.y: Use location_t instead of Bison's.
16761 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
16762 Use location_t instead of ints.
16763
e96c9728
AD
167642002-06-14 Akim Demaille <akim@epita.fr>
16765
16766 * data/bison.simple, data/bison.c++: Be sure to restore the
16767 current #line when returning to the skeleton contents after having
16768 exposed the input file's #line.
16769
75d1fe16
AD
167702002-06-12 Akim Demaille <akim@epita.fr>
16771
16772 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
16773 eager.
16774 * tests/actions.at (Exotic Dollars): New.
16775
6c35d22c
AD
167762002-06-12 Akim Demaille <akim@epita.fr>
16777
16778 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
16779 ['"/] too eagerly.
16780 * tests/input.at (Torturing the Scanner): New.
16781
1d6412ad
AD
167822002-06-11 Akim Demaille <akim@epita.fr>
16783
16784 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
16785 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
16786 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
16787 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
16788 * src/reader.c (reader): Use it.
16789
4cdb01db
AD
167902002-06-11 Akim Demaille <akim@epita.fr>
16791
16792 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
16793 Adjust all callers.
16794 (scanner_last_string_free): New.
16795
44995b2e
AD
167962002-06-11 Akim Demaille <akim@epita.fr>
16797
16798 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
16799 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
16800 (last_string, YY_OBS_FREE): New.
16801 Use them when returning an ID.
16802
e9955c83
AD
168032002-06-11 Akim Demaille <akim@epita.fr>
16804
16805 Have Bison grammars parsed by a Bison grammar.
16806
16807 * src/reader.c, src/reader.h (prologue_augment): New.
16808 * src/reader.c (copy_definition): Remove.
16809
16810 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
16811 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
16812 (grammar_current_rule_prec_set, grammar_current_rule_check)
16813 (grammar_current_rule_symbol_append)
16814 (grammar_current_rule_action_append): Export.
16815 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
16816 (symbol_list_action_append): Remove.
16817 Hook the routines from reader.
16818 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
16819 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
16820
16821 * src/reader.c (read_declarations): Remove, unused.
16822
16823 * src/parse-gram.y: Handle the epilogue.
16824 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
16825 (grammar_start_symbol_set): this.
16826 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
16827 * src/reader.c (readgram): Remove, unused.
16828 (reader): Adjust to insert eoftoken and axiom where appropriate.
16829
16830 * src/reader.c (copy_dollar): Replace with...
16831 * src/scan-gram.h (handle_dollar): this.
16832 * src/parse-gram.y: Remove `%thong'.
16833
16834 * src/reader.c (copy_at): Replace with...
16835 * src/scan-gram.h (handle_at): this.
16836
16837 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
16838 New.
16839
16840 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
16841 time being.
16842
16843 * src/reader.h, src/reader.c (grammar_rule_end): New.
16844
16845 * src/parse.y (current_type, current_class): New.
16846 Implement `%nterm', `%token' support.
16847 Merge `%term' into `%token'.
16848 (string_as_id): New.
16849 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
16850 type name.
16851
16852 * src/parse-gram.y: Be sure to handle properly the beginning of
16853 rules.
16854
16855 * src/parse-gram.y: Handle %type.
16856 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
16857
16858 * src/parse-gram.y: More directives support.
16859 * src/options.c: No longer handle source directives.
16860
16861 * src/parse-gram.y: Fix %output.
16862
16863 * src/parse-gram.y: Handle %union.
16864 Use the prologue locations.
16865 * src/reader.c (parse_union_decl): Remove.
16866
16867 * src/reader.h, src/reader.c (epilogue_set): New.
16868 * src/parse-gram.y: Use it.
16869
16870 * data/bison.simple, data/bison.c++: b4_stype is now either not
16871 defined, then default to int, or to the contents of %union,
16872 without `union' itself.
16873 Adjust.
16874 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
16875
16876 * src/output.c (actions_output): Don't output braces, as they are
16877 already handled by the scanner.
16878
16879 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
16880 characters to themselves.
16881
16882 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
16883 that the epilogue has a proper #line.
16884
16885 * src/parse-gram.y: Handle precedence/associativity.
16886
16887 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
16888 a terminal.
16889 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
16890 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
16891 at all to define terminals that cannot be emitted.
16892
16893 * src/scan-gram.l: Escape M4 characters.
16894
16895 * src/scan-gram.l: Working properly with escapes in user
16896 strings/characters.
16897
16898 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
16899 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
16900 grammar.
16901 Use more modest sizes, as for the time being the parser does not
16902 release memory, and therefore the process swallows a huge amount
16903 of memory.
16904
16905 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
16906 stricter %token grammar.
16907
16908 * src/symtab.h (associativity): Add `undef_assoc'.
16909 (symbol_precedence_set): Do nothing when passed an undef_assoc.
16910 * src/symtab.c (symbol_check_alias_consistence): Adjust.
16911
16912 * tests/regression.at (Invalid %directive): Remove, as it is now
16913 meaningless.
16914 (Invalid inputs): Adjust to the new error messages.
16915 (Token definitions): The new grammar doesn't allow too many
16916 eccentricities.
16917
16918 * src/lex.h, src/lex.c: Remove.
16919 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
16920 (copy_character, copy_string2, copy_string, copy_identifier)
16921 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
16922 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
16923 (parse_action): Remove.
16924 * po/POTFILES.in: Adjust.
16925
2e047461
AD
169262002-06-11 Akim Demaille <akim@epita.fr>
16927
cd05d13c 16928 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
16929 rule's action member: return the action as a string.
16930 Don't require `rule_length' as an argument: compute it.
16931 (grammar_current_rule_symbol_append)
16932 (grammar_current_rule_action_append): New, eved out from
16933 (readgram): here.
16934 Remove `action_flag', `rulelength', unused now.
16935
9af3fbce
AD
169362002-06-11 Akim Demaille <akim@epita.fr>
16937
16938 * src/reader.c (grammar_current_rule_prec_set).
16939 (grammar_current_rule_check): New, eved out from...
16940 (readgram): here.
16941 Remove `xaction', `first_rhs': useless.
16942 * tests/input.at (Type clashes): New.
16943 * tests/existing.at (GNU Cim Grammar): Adjust.
16944
1485e106
AD
169452002-06-11 Akim Demaille <akim@epita.fr>
16946
16947 * src/reader.c (grammar_midrule_action): New, Eved out from
16948 (readgram): here.
16949
da4160c3
AD
169502002-06-11 Akim Demaille <akim@epita.fr>
16951
16952 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
16953 New.
16954 (readgram): Use them as replacement of inlined code, crule and
16955 crule1.
16956
f6d0f937
AD
169572002-06-11 Akim Demaille <akim@epita.fr>
16958
16959 * src/reader.c (grammar_end, grammar_symbol_append): New.
16960 (readgram): Use them.
16961 Make the use of `p' as local as possible.
16962
69078d4b
AD
169632002-06-10 Akim Demaille <akim@epita.fr>
16964
16965 GCJ's parser requires the tokens to be defined before the prologue.
16966
16967 * data/bison.simple: Output the token definition before the user's
16968 prologue.
16969 * tests/regression.at (Braces parsing, Duplicate string)
16970 (Mixing %token styles): Check the output from bison.
16971 (Early token definitions): New.
16972
5e424082
AD
169732002-06-10 Akim Demaille <akim@epita.fr>
16974
16975 * src/symtab.c (symbol_user_token_number_set): Don't complain when
16976 assigning twice the same user number to a token, so that we can
16977 use it in...
16978 * src/lex.c (lex): here.
16979 Also use `symbol_class_set' instead of hand written code.
16980 * src/reader.c (parse_assoc_decl): Likewise.
16981
44536b35
AD
169822002-06-10 Akim Demaille <akim@epita.fr>
16983
16984 * src/symtab.c, src/symtab.c (symbol_class_set)
16985 (symbol_user_token_number_set): New.
16986 * src/reader.c (parse_token_decl): Use them.
16987 Use a switch instead of ifs.
16988 Use a single argument.
16989
8b9f2372
AD
169902002-06-10 Akim Demaille <akim@epita.fr>
16991
16992 Remove `%thong' support as it is undocumented, unused, duplicates
16993 `%token's job, and creates useless e-mail traffic with people who
16994 want to know what it is, why it is undocumented, unused, and
16995 duplicates `%token's job.
16996
16997 * src/reader.c (parse_thong_decl): Remove.
16998 * src/options.c (option_table): Remove "thong".
16999 * src/lex.h (tok_thong): Remove.
17000
3ae2b51f
AD
170012002-06-10 Akim Demaille <akim@epita.fr>
17002
17003 * src/symtab.c, src/symtab.c (symbol_type_set)
17004 (symbol_precedence_set): New.
17005 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
17006 (value_components_used): Remove, unused.
17007
2f1afb73
AD
170082002-06-09 Akim Demaille <akim@epita.fr>
17009
17010 Move symbols handling code out of the reader.
17011
17012 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
17013 (axiom): Move to...
17014 * src/symtab.h, src/symtab.c: here.
17015
17016 * src/gram.c (start_symbol): Remove: use startsymbol->number.
17017 * src/reader.c (startval): Rename as...
17018 * src/symtab.h, src/symtab.c (startsymbol): this.
17019 * src/reader.c: Adjust.
17020
17021 * src/reader.c (symbol_check_defined, symbol_make_alias)
17022 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
17023 (token_translations_init)
17024 Move to...
17025 * src/symtab.c: here.
17026 * src/reader.c (packsymbols): Move to...
17027 * src/symtab.h, src/symtab.c (symbols_pack): here.
17028 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
17029 argument.
17030
e9bca3ad
AD
170312002-06-03 Akim Demaille <akim@epita.fr>
17032
17033 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
17034 then statements.
17035
86eff183
AD
170362002-06-03 Akim Demaille <akim@epita.fr>
17037
17038 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
17039 structs with non literals.
17040 * src/scan-skel.l: never-interactive.
17041 * src/conflicts.c (enum conflict_resolution_e): No trailing
17042 comma.
17043 * src/getargs.c (usage): Split long literal strings.
17044 Reported by Hans Aberg.
17045
717be197
AD
170462002-05-28 Akim Demaille <akim@epita.fr>
17047
17048 * data/bison.c++: Use C++ ostreams.
17049 (cdebug_): New member.
17050
670ddffd
AD
170512002-05-28 Akim Demaille <akim@epita.fr>
17052
17053 * src/output.c (output_skeleton): Be sure to allocate enough room
17054 for `/' _and_ for `\0' in full_skeleton.
17055
769b430f
AD
170562002-05-28 Akim Demaille <akim@epita.fr>
17057
17058 * data/bison.c++: Catch up with bison.simple:
17059 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17060 and Paul Eggert <eggert@twinsun.com>: `error' handing.
17061 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
17062 and popping traces.
17063
7067cb36
PH
170642002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17065
17066 * src/output.c (output_skeleton): Put an explicit path in front of
17067 the skeleton file name, rather than relying on the -I directory,
17068 to partially alleviate effects of having a skeleton file lying around
17069 in the current directory.
769b430f 17070
4a713ec2
PH
170712002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17072
769b430f 17073 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
17074 obstack_printf should be obstack_fgrow1.
17075
b408954b
AD
170762002-05-26 Akim Demaille <akim@epita.fr>
17077
17078 * src/state.h (state_t): `solved_conflicts' is a new member.
17079 * src/LR0.c (new_state): Set it to 0.
17080 * src/conflicts.h, src/conflicts.c (print_conflicts)
17081 (free_conflicts, solve_conflicts): Rename as...
17082 (conflicts_print, conflicts_free, conflicts_solve): these.
17083 Adjust callers.
17084 * src/conflicts.c (enum conflict_resolution_e)
17085 (solved_conflicts_obstack): New, used by...
17086 (log_resolution): this.
17087 Adjust to attach the conflict resolution to each state.
17088 Complete the description with the precedence/associativity
17089 information.
17090 (resolve_sr_conflict): Adjust.
17091 * src/print.c (print_state): Output its solved_conflicts.
17092 * tests/conflicts.at (Unresolved SR Conflicts)
17093 (Solved SR Conflicts): Exercise --report=all.
17094
a49aecd5
AD
170952002-05-26 Akim Demaille <akim@epita.fr>
17096
17097 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
17098 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
17099 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
17100 (token_number_t, item_number_as_token_number)
17101 (token_number_as_item_number, muscle_insert_token_number_table):
17102 Rename as...
17103 (symbol_number_t, item_number_as_symbol_number)
17104 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
17105 these, since it is more appropriate.
17106
5504898e
AD
171072002-05-26 Akim Demaille <akim@epita.fr>
17108
17109 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
17110 `Error:' lines.
17111 * data/bison.simple (yystos) [YYDEBUG]: New.
17112 (yyparse) [YYDEBUG]: Display the symbols which are popped during
17113 error recovery.
17114 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
17115
ec3bc396
AD
171162002-05-25 Akim Demaille <akim@epita.fr>
17117
17118 * doc/bison.texinfo (Debugging): Split into...
17119 (Tracing): this new section, its former contents, and...
17120 (Understanding): this new section.
17121 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
17122 by...
17123 (report_flag): this.
17124 Adjust all dependencies.
17125 (report_args, report_types, report_argmatch): New.
17126 (usage, getargs): Report/support -r, --report.
17127 * src/options.h
17128 (struct option_table_struct): Rename as..,
17129 (struct option_table_s): this.
17130 Rename the `set_flag' member to `flag' to match with getopt_long's
17131 struct.
17132 * src/options.c (option_table): Split verbose into an entry for
17133 %verbose, and another for --verbose.
17134 Support --report/-r, so remove -r from the obsolete --raw.
17135 * src/print.c: Attach full item sets and lookaheads reports to
17136 report_flag instead of trace_flag.
17137 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
17138
78df8250
PE
171392002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17140 and Paul Eggert <eggert@twinsun.com>
769b430f 17141
78df8250
PE
17142 * data/bison.simple (yyparse): Correct error handling to conform to
17143 POSIX and yacc. Specifically, after syntax error is discovered,
17144 do not reduce further before shifting the error token.
17145 Clean up the code a bit by removing the labels yyerrdefault,
17146 yyerrhandle, yyerrpop.
17147 * NEWS: Document the above.
17148
c0c9ea05
PH
171492002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17150
17151 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
17152 type; it isn't always big enough, since it doesn't necessarily
17153 include non-terminals.
769b430f 17154 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
17155 the latter can be removed.
17156 (yy_token_number_type): Remove, only one use.
17157 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
17158 don't use TokenNumberType as element type.
769b430f 17159
c0c9ea05
PH
17160 * tests/regression.at: Modify expected output to agree with change
17161 to yyr1 and yytranslate.
769b430f 17162
6390a83f
FK
171632002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
17164
17165 * src/reader.c (parse_action): Use copy_character instead of
17166 obstack_1grow.
17167
db7c8e9a
AD
171682002-05-13 Akim Demaille <akim@epita.fr>
17169
17170 * tests/regression.at (Token definitions): Prototype yylex and
17171 yyerror.
17172
fcc61800
PH
171732002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17174
158c687b 17175 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
17176 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
17177 32-bit arithmetic.
17178 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
17179
5683e9b2
AD
171802002-05-07 Akim Demaille <akim@epita.fr>
17181
17182 * tests/synclines.at: Be sure to prototype yylex and yyerror to
17183 avoid GCC warnings.
17184
0c2d3f4c
AD
171852002-05-07 Akim Demaille <akim@epita.fr>
17186
17187 Kill GCC warnings.
17188
17189 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
17190 over the RHS of each rule.
17191 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
17192 * src/state.h (state_t): Member `nitems' is unsigned short.
17193 * src/LR0.c (get_state): Adjust.
17194 * src/reader.c (packgram): Likewise.
17195 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
17196 `Type'.
17197 (muscle_insert_int_table): Remove, unused.
17198 (prepare_rules): Remove `max'.
17199
1565b720
AD
172002002-05-06 Akim Demaille <akim@epita.fr>
17201
17202 * src/closure.c (print_firsts): Display of the symbol tags.
17203 (bitmatrix_print): Move to...
17204 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
17205 here.
17206 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
17207
cfaee611
AD
172082002-05-06 Akim Demaille <akim@epita.fr>
17209
17210 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
17211 hash_do_for_each.
17212
458be8e0
AD
172132002-05-06 Akim Demaille <akim@epita.fr>
17214
17215 * src/LR0.c (new_state, get_state): Instead of using the global
17216 `kernel_size' and `kernel_base', have two new arguments:
17217 `core_size' and `core'.
17218 Adjust callers.
17219
a900a624
AD
172202002-05-06 Akim Demaille <akim@epita.fr>
17221
17222 * src/reader.c (packgram): No longer end `ritem' with a 0
17223 sentinel: it is not used.
17224
d4e7d3a1
AD
172252002-05-05 Akim Demaille <akim@epita.fr>
17226
17227 New experimental feature: display the lookaheads in the report and
17228 graph.
17229
17230 * src/print (print_core): When --trace-flag, display the rules
17231 lookaheads.
17232 * src/print_graph.c (print_core): Likewise.
17233 Swap the arguments.
17234 Adjust caller.
17235
39ceb25b
AD
172362002-05-05 Akim Demaille <akim@epita.fr>
17237
17238 * tests/torture.at (Many lookaheads): New test.
17239
5372019f
AD
172402002-05-05 Akim Demaille <akim@epita.fr>
17241
17242 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
17243 (GENERATE_MUSCLE_INSERT_TABLE): this.
17244 (output_int_table, output_unsigned_int_table, output_short_table)
17245 (output_token_number_table, output_item_number_table): Replace with...
17246 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
17247 (muscle_insert_short_table, muscle_insert_token_number_table)
17248 (muscle_insert_item_number_table): these.
17249 Adjust all callers.
17250 (prepare_tokens): Don't free `translations', since...
17251 * src/reader.h, src/reader.c (grammar_free): do it.
17252 Move to...
17253 * src/gram.h, src/gram.c (grammar_free): here.
17254 * data/bison.simple, data/bison.c++: b4_token_number_max is now
17255 b4_translate_max.
17256
5df5f6d5
AD
172572002-05-05 Akim Demaille <akim@epita.fr>
17258
17259 * src/output.c (output_unsigned_int_table): New.
17260 (prepare_rules): `i' is unsigned.
17261 `prhs', `rline', `r2' are unsigned int.
17262 Rename muscle `rhs_number_max' as `rhs_max'.
17263 Output muscles `prhs_max', `rline_max', and `r2_max'.
17264 Free rline and r1.
17265 * data/bison.simple, data/bison.c++: Adjust to use these muscles
17266 to compute types instead of constant types.
17267 * tests/regression.at (Web2c Actions): Adjust.
17268
b87f8b21
AD
172692002-05-04 Akim Demaille <akim@epita.fr>
17270
17271 * src/symtab.h (SALIAS, SUNDEF): Rename as...
17272 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
17273 Adjust dependencies.
17274 * src/output.c (token_definitions_output): Be sure not to output a
17275 `#define 'a'' when fed with `%token 'a' "a"'.
17276 * tests/regression.at (Token definitions): New.
17277
8bb936e4
PE
172782002-05-03 Paul Eggert <eggert@twinsun.com>
17279
17280 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
17281 for K&R C.
17282
172832002-05-03 gettextize <bug-gnu-gettext@gnu.org>
17284
17285 * Makefile.am (SUBDIRS): Remove intl.
17286 (EXTRA_DIST): Add config/config.rpath.
17287
53c71a12
AD
172882002-05-03 Akim Demaille <akim@epita.fr>
17289
17290 * data/bison.simple (m4_if): Don't output empty enums.
17291 And actually, output valid enum definitions :(.
17292
289dd0cf
AD
172932002-05-03 Akim Demaille <akim@epita.fr>
17294
17295 * configure.bat: Remove, completely obsolete.
17296 * Makefile.am (EXTRA_DIST): Adjust.
17297 Don't distribute config.rpath...
17298 * config/Makefile.am (EXTRA_DIST): Do it.
17299
db85e524
AD
173002002-05-03 Akim Demaille <akim@epita.fr>
17301
17302 * configure.in (GETTEXT_VERSION): New.
17303 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
17304
83ccf991
AD
173052002-05-03 Akim Demaille <akim@epita.fr>
17306
17307 * data/bison.simple (b4_token_enum): New.
17308 (b4_token_defines): Use it to output tokens both as #define and
17309 enums.
17310 Suggested by Paul Eggert.
17311 * src/output.c (token_definitions_output): Don't output spurious
17312 white spaces.
17313
1f418995
AD
173142002-05-03 Akim Demaille <akim@epita.fr>
17315
17316 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
17317
45119f04
RA
173182002-05-02 Robert Anisko <robert@lrde.epita.fr>
17319
17320 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
17321 Update the stack class, give a try to deque as the default container.
17322
b2d52318
AD
173232002-05-02 Akim Demaille <akim@epita.fr>
17324
17325 * data/bison.simple (yyparse): Do not implement @$ = @1.
17326 (YYLLOC_DEFAULT): Adjust to do it.
17327 * doc/bison.texinfo (Location Default Action): Fix.
17328
3a8b4109
AD
173292002-05-02 Akim Demaille <akim@epita.fr>
17330
17331 * src/reader.c (parse_braces): Merge into...
17332 (parse_action): this.
17333
84614e13
AD
173342002-05-02 Akim Demaille <akim@epita.fr>
17335
17336 * configure.in (ALL_LINGUAS): Remove.
17337 * po/LINGUAS, hr.po: New.
17338
fdbcd8e2
AD
173392002-05-02 Akim Demaille <akim@epita.fr>
17340
17341 Remove the so called hairy (semantic) parsers.
17342
17343 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
17344 * src/gram.h, src/gram.c (semantic_parser): Remove.
17345 (rule_t): Remove the guard and guard_line members.
17346 * src/lex.h (token_t): remove tok_guard.
17347 * src/options.c (option_table): Remove %guard and %semantic_parser
17348 support.
17349 * src/output.c, src/output.h (guards_output): Remove.
17350 (prepare): Adjust.
17351 (token_definitions_output): Don't output the `T'
17352 tokens (???).
17353 (output_skeleton): Don't output the guards.
17354 * src/files.c, src/files.c (attrsfile): Remove.
17355 * src/reader.c (symbol_list): Remove the guard and guard_line
17356 members.
17357 Adjust dependencies.
17358 (parse_guard): Remove.
17359 * data/bison.hairy: Remove.
17360 * doc/bison.texinfo (Environment Variables): Remove occurrences of
17361 BISON_HAIRY.
17362
82b6cb3f
AD
173632002-05-02 Akim Demaille <akim@epita.fr>
17364
17365 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
17366 (parse_guard): Rename the formal argument `stack_offset' as
17367 `rule_length', which is more readable.
17368 Adjust callers.
17369 (copy_at, copy_dollar): Instead of outputting the hard coded
17370 values of $$, $n and so forth, output invocation to b4_lhs_value,
17371 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
17372 Note: this patch partially drops `semantic-parser' support: it
17373 always does `rule_length - n', where semantic parsers ought to
17374 always use `-n'.
82b6cb3f
AD
17375 * data/bison.simple, data/bison.c++ (b4_lhs_value)
17376 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
17377
6cbfbcc5
AD
173782002-05-02 Akim Demaille <akim@epita.fr>
17379
17380 * configure.in (AC_INIT): Bump to 1.49b.
17381 (AM_INIT_AUTOMAKE): Short invocation.
17382
b8548114
AD
173832002-05-02 Akim Demaille <akim@epita.fr>
17384
17385 Version 1.49a.
17386
c20cd1fa
AD
173872002-05-01 Akim Demaille <akim@epita.fr>
17388
17389 * src/skeleton.h: Remove.
17390
8a9566d4
AD
173912002-05-01 Akim Demaille <akim@epita.fr>
17392
17393 * src/skeleton.h: Fix the #endif.
17394 Reported by Magnus Fromreide.
17395
8c6d399a
PE
173962002-04-26 Paul Eggert <eggert@twinsun.com>
17397
17398 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
17399 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 17400 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 17401
2b7ed18a
RA
174022002-04-25 Robert Anisko <robert@lrde.epita.fr>
17403
17404 * src/scan-skel.l: Postprocess quadrigraphs.
17405
17406 * src/reader.c (copy_character): New function, used to output
17407 single characters while replacing `[' and `]' with quadrigraphs, to
17408 avoid troubles with M4 quotes.
17409 (copy_comment): Output characters with copy_character.
17410 (read_additionnal_code): Likewise.
17411 (copy_string2): Likewise.
17412 (copy_definition): Likewise.
17413
17414 * tests/calc.at: Exercise M4 quoting.
17415
34a89c50
AD
174162002-04-25 Akim Demaille <akim@epita.fr>
17417
17418 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
17419 between `!' and the command.
17420 Reported by Paul Eggert.
17421
0dd1580a
RA
174222002-04-24 Robert Anisko <robert@lrde.epita.fr>
17423
17424 * tests/calc.at: Exercise prologue splitting.
17425
17426 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
17427 `b4_post_prologue' instead of `b4_prologue'.
17428
17429 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
17430 muscles.
17431 (output): Free pre_prologue_obstack and post_prologue_obstack.
17432 * src/files.h, src/files.c (attrs_obstack): Remove.
17433 (pre_prologue_obstack, post_prologue_obstack): New.
17434 * src/reader.c (copy_definition): Add a parameter to specify the
17435 obstack to fill, instead of using attrs_obstack unconditionally.
17436 (read_declarations): Pass pre_prologue_obstack to copy_definition if
17437 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
17438
83c1796f
PE
174392002-04-23 Paul Eggert <eggert@twinsun.com>
17440
17441 * data/bison.simple: Remove unnecessary commentary and white
17442 space differences from 1_29-branch.
17443 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
17444
17445 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
17446 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
17447 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
17448 constructors or destructors.
17449
17450 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
17451
1207eeac
AD
174522002-04-23 Akim Demaille <akim@epita.fr>
17453
17454 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
17455 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
17456 location with columns.
17457 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
17458 All reported by Paul Eggert.
17459
78ab8f67
AD
174602002-04-22 Akim Demaille <akim@epita.fr>
17461
17462 * src/reduce.c (dump_grammar): Move to...
17463 * src/gram.h, src/gram.c (grammar_dump): here.
17464 Be sure to separate long item numbers.
17465 Don't read the members of a rule's prec if its nil.
17466
133c20e2
AD
174672002-04-22 Akim Demaille <akim@epita.fr>
17468
17469 * src/output.c (table_size, table_grow): New.
17470 (MAXTABLE): Remove, replace uses with table_size.
17471 (pack_vector): Instead of dying when the table is too big, grow it.
17472
9515e8a7
AD
174732002-04-22 Akim Demaille <akim@epita.fr>
17474
17475 * data/bison.simple (yyr1): Its type is that of a token number.
17476 * data/bison.c++ (r1_): Likewise.
17477 * tests/regression.at (Web2c Actions): Adjust.
17478
23c5a174
AD
174792002-04-22 Akim Demaille <akim@epita.fr>
17480
17481 * src/reader.c (token_translations_init): 256 is now the default
17482 value for the error token, i.e., it will be assigned another
17483 number if the user assigned 256 to one of her tokens.
17484 (reader): Don't force 256 to error.
17485 * doc/bison.texinfo (Symbols): Adjust.
17486 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
17487 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
17488 etc. instead of 10, 20, 30 (which was used to `jump' over error
17489 (256) and undefined (2)).
17490
5fbb0954
AD
174912002-04-22 Akim Demaille <akim@epita.fr>
17492
17493 Propagate more token_number_t.
17494
17495 * src/gram.h (token_number_as_item_number)
17496 (item_number_as_token_number): New.
17497 * src/output.c (GENERATE_OUTPUT_TABLE): New.
17498 Use it to create output_item_number_table and
17499 output_token_number_table.
17500 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
17501 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
17502 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
17503 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
17504
4f940944
AD
175052002-04-22 Akim Demaille <akim@epita.fr>
17506
17507 * src/output.h, src/output.c (get_lines_number): Remove.
17508
3ded9a63
AD
175092002-04-19 Akim Demaille <akim@epita.fr>
17510
17511 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
17512 as Lex/Flex'.
17513 (Debugging): More details about enabling the debugging features.
17514 (Table of Symbols): Describe $$, $n, @$, and @n.
17515 Suggested by Tim Josling.
17516
e0c471a9
AD
175172002-04-19 Akim Demaille <akim@epita.fr>
17518
17519 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
17520
fecc10cd
AD
175212002-04-10 Akim Demaille <akim@epita.fr>
17522
17523 * src/system.h: Rely on HAVE_LIMITS_H.
17524 Suggested by Paul Eggert.
17525
51dec47b
AD
175262002-04-09 Akim Demaille <akim@epita.fr>
17527
17528 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
17529 full stderr, and strip it according to the bison options, instead
17530 of composing the error message from different bits.
17531 This makes it easier to check for several error messages.
17532 Adjust all the invocations.
17533 Add an invocation exercising the error token.
17534 Add an invocation demonstrating a stupid error message.
17535 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
17536 Adjust the tests.
17537 Error message are for stderr, not stdout.
17538
007a50a4
AD
175392002-04-09 Akim Demaille <akim@epita.fr>
17540
17541 * src/gram.h, src/gram.c (error_token_number): Remove, use
17542 errtoken->number.
17543 * src/reader.c (reader): Don't specify the user token number (2)
17544 for $undefined, as it uselessly prevents using it.
17545 * src/gram.h (token_number_t): Move to...
17546 * src/symtab.h: here.
17547 (state_t.number): Is a token_number_t.
17548 * src/print.c, src/reader.c: Use undeftoken->number instead of
17549 hard coded 2.
17550 (Even though this 2 is not the same as above: the number of the
17551 undeftoken remains being 2, it is its user token number which
17552 might not be 2).
17553 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
17554 `user_token_number_max'.
17555 Output `undef_token_number'.
17556 * data/bison.simple, data/bison.c++: Use them.
17557 Be sure to map invalid yylex return values to
17558 `undef_token_number'. This saves us from gratuitous SEGV.
17559
17560 * tests/conflicts.at (Solved SR Conflicts)
17561 (Unresolved SR Conflicts): Adjust.
17562 * tests/regression.at (Web2c Actions): Adjust.
17563
06446ccf
AD
175642002-04-08 Akim Demaille <akim@epita.fr>
17565
17566 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
17567 Adding #line.
17568 Remove the duplicate `typedefs'.
17569 (RhsNumberType): Fix the declaration and various other typos.
17570 Use __ofile__.
17571 * data/bison.simple: Use __ofile__.
17572 * src/scan-skel.l: Handle __ofile__.
17573
62a3e4f0
AD
175742002-04-08 Akim Demaille <akim@epita.fr>
17575
17576 * src/gram.h (item_number_t): New, the type of item numbers in
17577 RITEM. Note that it must be able to code symbol numbers as
17578 positive number, and the negation of rule numbers as negative
17579 numbers.
17580 Adjust all dependencies (pretty many).
17581 * src/reduce.c (rule): Remove this `short *' pointer: use
17582 item_number_t.
17583 * src/system.h (MINSHORT, MAXSHORT): Remove.
17584 Include `limits.h'.
17585 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
17586 (shortcpy): Remove.
17587 (MAXTABLE): Move to...
17588 * src/output.c (MAXTABLE): here.
17589 (prepare_rules): Use output_int_table to output rhs.
17590 * data/bison.simple, data/bison.c++: Adjust.
17591 * tests/torture.at (Big triangle): Move the limit from 254 to
17592 500.
17593 * tests/regression.at (Web2c Actions): Ajust.
17594
17595 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
17596 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
17597 passes, but produces negative #line number, once fixed, GCC is
17598 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
17599 C), it passes.
17600 * src/state.h (state_h): Code input lines on ints, not shorts.
17601
bb88b0fc
AD
176022002-04-08 Akim Demaille <akim@epita.fr>
17603
17604 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
17605 and then the grammar.
17606
9a636f47
AD
176072002-04-08 Akim Demaille <akim@epita.fr>
17608
17609 * src/system.h: No longer using strndup.
17610
680e8701
AD
176112002-04-07 Akim Demaille <akim@epita.fr>
17612
17613 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
17614 * src/output.c (output_table_data): Return the longest number.
17615 (prepare_tokens): Output `token_number_max').
17616 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
17617 New.
17618 Use them to define yy_token_number_type/TokenNumberType.
17619 Use this type for yytranslate.
17620 * tests/torture.at (Big triangle): Push the limit from 124 to
17621 253.
17622 * tests/regression.at (Web2c Actions): Adjust.
17623
817e9f41
AD
176242002-04-07 Akim Demaille <akim@epita.fr>
17625
17626 * tests/torture.at (Big triangle): New.
17627 (GNU AWK Grammar, GNU Cim Grammar): Move to...
17628 * tests/existing.at: here.
17629
5123689b
AD
176302002-04-07 Akim Demaille <akim@epita.fr>
17631
17632 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
17633 nritems.
17634 Adjust dependencies.
17635
f3849179
AD
176362002-04-07 Akim Demaille <akim@epita.fr>
17637
17638 * src/reader.c: Normalize increments to prefix form.
17639
bd02036a
AD
176402002-04-07 Akim Demaille <akim@epita.fr>
17641
17642 * src/reader.c, symtab.c: Remove debugging code.
17643
db8837cb
AD
176442002-04-07 Akim Demaille <akim@epita.fr>
17645
17646 Rename all the `bucket's as `symbol_t'.
17647
17648 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
17649 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
17650 * src/symtab.c, src/symtab.h (bucket): Rename as...
17651 (symbol_t): this.
17652 (symbol_list_new, bucket_check_defined, bucket_make_alias)
17653 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
17654 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
17655 (buckets_new, buckets_free, buckets_do): Rename as...
17656 (symbol_list_new, symbol_check_defined, symbol_make_alias)
17657 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
17658 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
17659 (symbols_new, symbols_free, symbols_do): these.
17660
72a23c97
AD
176612002-04-07 Akim Demaille <akim@epita.fr>
17662
17663 Use lib/hash for the symbol table.
17664
17665 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
17666 EOF.
17667 * src/lex.c (lex): Set the `number' member of new terminals.
17668 * src/reader.c (bucket_check_defined, bucket_make_alias)
17669 (bucket_check_alias_consistence, bucket_translation): New.
17670 (reader, grammar_free, readgram, token_translations_init)
17671 (packsymbols): Adjust.
17672 (reader): Number the predefined tokens.
17673 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
17674 for predefined tokens.
17675 * src/symtab.h (bucket): Remove all the hash table related
17676 members.
17677 * src/symtab.c (symtab): Replace by...
17678 (bucket_table): this.
17679 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
17680 (buckets_new, buckets_do): New.
17681
280a38c3
AD
176822002-04-07 Akim Demaille <akim@epita.fr>
17683
17684 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
17685 (start_symbol, max_user_token_number, semantic_parser)
17686 (error_token_number): Initialize.
17687 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
17688 Initialize.
17689 (reader): Don't.
17690 (errtoken, eoftoken, undeftoken, axiom): Extern.
17691
03b31c0c
AD
176922002-04-07 Akim Demaille <akim@epita.fr>
17693
17694 * src/gram.h (rule_s): prec and precsym are now pointers
17695 to the bucket giving the priority/associativity.
17696 Member `associativity' removed: useless.
17697 * src/reduce.c, src/conflicts.c: Adjust.
17698
8b3df748
AD
176992002-04-07 Akim Demaille <akim@epita.fr>
17700
17701 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
17702 Properly escape the symbols' TAG when outputting them.
17703
e601aa1d
AD
177042002-04-07 Akim Demaille <akim@epita.fr>
17705
17706 * src/lalr.h (LA): Is a bitsetv, not bitset*.
17707
b0299a2e
AD
177082002-04-07 Akim Demaille <akim@epita.fr>
17709
17710 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
17711 (LArule): this, which is an array to rule_t*.
17712 * src/print.c, src/conflicts.c: Adjust.
17713
d7e1f00c
AD
177142002-04-07 Akim Demaille <akim@epita.fr>
17715
17716 * src/gram.h (rule_t): Rename `number' as `user_number'.
17717 `number' is a new member.
17718 Adjust dependencies.
17719 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
17720
cc9305dd
AD
177212002-04-07 Akim Demaille <akim@epita.fr>
17722
17723 As a result of the previous patch, it is no longer needed
17724 to reorder ritem itself.
17725
17726 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
17727
b0940840
AD
177282002-04-07 Akim Demaille <akim@epita.fr>
17729
17730 Be sure never to walk through RITEMS, but use only data related to
17731 the rules themselves. RITEMS should be banished.
17732
17733 * src/output.c (output_token_translations): Rename as...
17734 (prepare_tokens): this.
17735 In addition to `translate', prepare the muscles `tname' and
17736 `toknum', which were handled by...
17737 (output_rule_data): this.
17738 Remove, and move the remainder of its outputs into...
17739 (prepare_rules): this new routines, which also merges content from
17740 (output_gram): this.
17741 (prepare_rules): Be sure never to walk through RITEMS.
17742 (output_stos): Rename as...
17743 (prepare_stos): this.
17744 (output): Always invoke prepare_states, after all, just don't use it
17745 in the output if you don't need it.
17746
643a5994
AD
177472002-04-07 Akim Demaille <akim@epita.fr>
17748
17749 * src/LR0.c (new_state): Display `nstates' as the name of the
17750 newly created state.
17751 Adjust to initialize first_state and last_state if needed.
17752 Be sure to distinguish the initial from the final state.
17753 (new_states): Create the itemset of the initial state, and use
17754 new_state.
17755 * src/closure.c (closure): Now that the initial state has its
17756 items properly set, there is no need for a special case when
17757 creating `ruleset'.
17758
17759 As a result, now the rule 0, reducing to $axiom, is visible in the
17760 outputs. Adjust the test suite.
17761
17762 * tests/conflicts.at (Solved SR Conflicts)
17763 (Unresolved SR Conflicts): Adjust.
17764 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
17765 * tests/conflicts.at (S/R in initial): New.
17766
b4c4ccc2
AD
177672002-04-07 Akim Demaille <akim@epita.fr>
17768
17769 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
17770 the RHS of the rules.
17771 * src/output.c (output_gram): Likewise.
17772
bba97eb2
AD
177732002-04-07 Akim Demaille <akim@epita.fr>
17774
17775 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
17776 bucket.
17777 Adjust all dependencies.
17778 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
17779 `number' of the buckets too.
17780 * src/gram.h: Include `symtab.h'.
17781 (associativity): Move to...
17782 * src/symtab.h: here.
17783 No longer include `gram.h'.
17784
c3b407f4
AD
177852002-04-07 Akim Demaille <akim@epita.fr>
17786
17787 * src/gram.h, src/gram.c (rules_rhs_length): New.
17788 (ritem_longest_rhs): Use it.
17789 * src/gram.h (rule_t): `number' is a new member.
17790 * src/reader.c (packgram): Set it.
17791 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
17792 the end of `rules', and count them out of `nrules'.
17793 (reduce_output, dump_grammar): Adjust.
17794 * src/print.c (print_grammar): It is no longer needed to check for
17795 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
17796 * tests/reduce.at (Reduced Automaton): New test.
17797
11652ab3
AD
177982002-04-07 Akim Demaille <akim@epita.fr>
17799
17800 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
17801 lacking `+ 1' to nrules, Bison reported as useless a token if it
17802 was used solely to set the precedence of the last rule...
17803
26b23c1a
AD
178042002-04-07 Akim Demaille <akim@epita.fr>
17805
17806 * data/bison.c++, data/bison.simple: Don't output the current file
17807 name in #line, to avoid useless diffs between two identical
17808 outputs under different names.
17809
18bcecb0
AD
178102002-04-07 Akim Demaille <akim@epita.fr>
17811
17812 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
17813 Normalize loops to using `< nrules + 1', not `<= nrules'.
17814
fa770c86
AD
178152002-04-07 Akim Demaille <akim@epita.fr>
17816
17817 * TODO: Update.
17818
d9b739c3
AD
178192002-04-07 Akim Demaille <akim@epita.fr>
17820
17821 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
17822 bucket.value as bucket.number.
17823
99013900
AD
178242002-04-07 Akim Demaille <akim@epita.fr>
17825
17826 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
17827 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
17828 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
17829 RHS, instead of being an index in RITEMS.
17830
e966383b
PE
178312002-04-04 Paul Eggert <eggert@twinsun.com>
17832
17833 * doc/bison.texinfo: Update copyright date.
17834 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
17835 (Symbols): Warn about running Bison in one character set,
17836 but compiling and/or running in an incompatible one.
17837 Warn about character code 256, too.
17838
178392002-04-03 Paul Eggert <eggert@twinsun.com>
17840
17841 * src/bison.data (YYSTACK_ALLOC): Depend on whether
17842 YYERROR_VERBOSE is nonzero, not whether it is defined.
17843
17844 Merge changes from bison-1_29-branch.
c307773e 17845
8d6c48b9
PE
178462002-03-20 Paul Eggert <eggert@twinsun.com>
17847
17848 Merge fixes from Debian bison_1.34-1.diff.
17849
17850 * configure.in (AC_PREREQ): 2.53.
17851
e53c6322
AD
178522002-03-20 Akim Demaille <akim@epita.fr>
17853
17854 * src/conflicts.c (log_resolution): Argument `resolution' is const.
17855
9ffbeca7
PE
178562002-03-19 Paul Eggert <eggert@twinsun.com>
17857
21db0b2a
PE
17858 * src/bison.simple (YYCOPY): New macro.
17859 (YYSTACK_RELOCATE): Use it.
17860 Remove Type arg; no longer needed. All callers changed.
17861 (yymemcpy): Remove; no longer needed.
17862
9ffbeca7
PE
17863 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
17864 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
17865
642cb8f8
AD
178662002-03-19 Akim Demaille <akim@epita.fr>
17867
17868 Test and fix the #line outputs.
17869
17870 * tests/atlocal.at (GCC): New.
17871 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 17872 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
17873 (Action synch line, Epilogue synch line): New tests.
17874 * src/reader.c (parse_union_decl): Define the muscle stype_line.
17875 * data/bison.simple, data/bison.c++: Use it.
17876
3c31a486
AD
178772002-03-19 Akim Demaille <akim@epita.fr>
17878
17879 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
17880 (Solved SR Conflicts, %expect not enough, %expect right)
17881 (%expect too much): Move to...
17882 * tests/conflicts.at: this new file.
17883
0d8bed56
AD
178842002-03-19 Akim Demaille <akim@epita.fr>
17885
17886 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
17887 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
17888 that we can move to enums for instance.
17889 * src/output.c (token_definitions_output): Output a list of
17890 `token-name, token-number' instead of the #define.
17891 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
17892
9208d17f
AD
178932002-03-14 Akim Demaille <akim@epita.fr>
17894
17895 Use Gettext 0.11.1.
17896
af27eacb
RA
178972002-03-09 Robert Anisko <robert@lrde.epita.fr>
17898
17899 * data/bison.c++: Make the user able to add members to the generated
17900 parser by subclassing.
17901
9101a310
RA
179022002-03-05 Robert Anisko <robert@lrde.epita.fr>
17903
17904 * src/reader.c (read_additionnal_code): `c' should be an integer, not
17905 a character.
17906 Reported by Nicolas Tisserand and Nicolas Burrus.
17907
fff9bf0b
RA
179082002-03-04 Robert Anisko <robert@lrde.epita.fr>
17909
17910 * src/reader.c: Warn about lacking semi-colons, do not complain.
17911
64dba31e
RA
179122002-03-04 Robert Anisko <robert@lrde.epita.fr>
17913
17914 * data/bison.c++: Remove a debug line.
17915
374f5a14
RA
179162002-03-04 Robert Anisko <robert@lrde.epita.fr>
17917
17918 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
17919 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
17920 provide a default implementation.
17921
bfcf1f3a
AD
179222002-03-04 Akim Demaille <akim@epita.fr>
17923
17924 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
17925 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
17926 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
17927 * tests/semantic.at (Parsing Guards): Similarly.
17928 * src/reader.at (readgram): Complain if the last rule is not ended
17929 with a semi-colon.
17930
65ccf9fc
AD
179312002-03-04 Akim Demaille <akim@epita.fr>
17932
17933 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
17934 * src/closure.c: here.
17935 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
17936 RTC.
17937 * src/warshall.h, src/warshall.c: Remove.
17938 * tests/sets.at (Broken Closure): Adjust.
17939
d0039cbc
AD
179402002-03-04 Akim Demaille <akim@epita.fr>
17941
17942 * src/output.c (output_skeleton): tempdir is const.
17943 bytes_read is unused.
17944
345cea78
AD
179452002-03-04 Akim Demaille <akim@epita.fr>
17946
17947 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
17948 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
17949 Update.
17950 From Michael Hayes.
17951
564801f7
AD
179522002-03-04 Akim Demaille <akim@epita.fr>
17953
17954 * src/closure.c (closure): `r' is unused.
17955
e5352bc7
AD
179562002-03-04 Akim Demaille <akim@epita.fr>
17957
17958 * tests/sets.at (Broken Closure): Add the ending `;'.
17959 * src/reader.at (readgram): Complain if a rule is not ended with a
17960 semi-colon.
17961
914feea9
AD
179622002-03-04 Akim Demaille <akim@epita.fr>
17963
17964 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
17965 (count_sr_conflicts): Use bitset_count.
17966 * src/reduce.c (inaccessable_symbols): Ditto.
17967 (bits_size): Remove.
17968 * src/warshall.h, src/warshall.c: Convert to bitsetv.
17969
f0250de6
AD
179702002-03-04 Akim Demaille <akim@epita.fr>
17971
17972 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
17973 * src/reduce.c: Remove the `bitset_zero's following the
17974 `bitset_create's, as now it is performed by the latter.
17975
ef017502
AD
179762002-03-04 Akim Demaille <akim@epita.fr>
17977
17978 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
17979 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
17980 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
17981 latest sources from Michael.
17982
76514394
AD
179832002-03-04 Akim Demaille <akim@epita.fr>
17984
17985 * src/output.c (output): Don't free the grammar.
17986 * src/reader.c (grammar_free): New.
17987 * src/main.c (main): Call it and don't free symtab here.
17988
55024580
AD
179892002-03-04 Akim Demaille <akim@epita.fr>
17990
17991 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
17992 before returning.
17993 Reported by Benoit Perrot.
17994
f9abaa2c
AD
179952002-03-04 Akim Demaille <akim@epita.fr>
17996
17997 Use bitset operations when possible, not loops over bits.
17998
17999 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
18000 bitset_or.
18001 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
18002 * src/reduce.c (useless_nonterminals): Formatting changes.
18003 * src/warshall.c (TC): Use bitset_or.
18004
0e721e75
AD
180052002-03-04 Akim Demaille <akim@epita.fr>
18006
18007 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
18008 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
18009 Ditto.
18010
0fb1ffb1
AD
180112002-03-04 Akim Demaille <akim@epita.fr>
18012
18013 * src/lalr.c (F): Now a bitset*.
18014 Adjust all dependencies.
18015
b86796bf
AD
180162002-03-04 Akim Demaille <akim@epita.fr>
18017
18018 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
18019 Adjust all dependencies.
18020
602bbf31
AD
180212002-03-04 Akim Demaille <akim@epita.fr>
18022
18023 * src/L0.c, src/LR0.h (nstates): Be size_t.
18024 Adjust comparisons (signed vs unsigned).
18025 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
18026 bitset*.
18027 Adjust all dependencies.
18028
d8a0245c
AD
180292002-03-04 Akim Demaille <akim@epita.fr>
18030
18031 * src/closure.c (firsts): Now, also a bitset.
18032 Adjust all dependencies.
18033 (varsetsize): Remove, now unused.
18034 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
18035
34ba9743
AD
180362002-03-04 Akim Demaille <akim@epita.fr>
18037
18038 * src/print.c: Convert to use bitset.h, not hand coded iterations
18039 over ints.
18040
ed86e78c
AD
180412002-03-04 Akim Demaille <akim@epita.fr>
18042
18043 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
18044
dfdb1797
AD
180452002-03-04 Akim Demaille <akim@epita.fr>
18046
18047 * src/closure.c (ruleset): Be a bitset.
18048 (rulesetsize): Remove.
18049
7086e707
AD
180502002-03-04 Akim Demaille <akim@epita.fr>
18051
18052 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
18053 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
18054 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
18055 * src/closure.c (fderives): Be an array of bitsets.
18056
98254360
RA
180572002-02-28 Robert Anisko <robert@lrde.epita.fr>
18058
18059 * data/bison.c++: Merge the two generated headers. Insert a copyright
18060 notice in each output file.
18061
a75c057f
AD
180622002-02-28 Akim Demaille <akim@epita.fr>
18063
18064 * data/bison.c++: Copy the prologue of bison.simple to fetch
18065 useful M4 definitions, such as b4_header_guard.
18066
06b00abc
AD
180672002-02-25 Akim Demaille <akim@epita.fr>
18068
18069 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
18070 translator friendly scheme for the bgr
18071 copyright notice.
06b00abc 18072
70e7d534
AD
180732002-02-25 Akim Demaille <akim@epita.fr>
18074
18075 * src/output.c (header_output): Remove, now handled completely via
18076 M4.
18077
abe017f6
AD
180782002-02-25 Akim Demaille <akim@epita.fr>
18079
18080 * m4/m4.m4: New, from CVS Autoconf.
18081 * configure.in: Invoke it.
18082 * src/output.c (output_skeleton): Use its result instead of the
18083 hard coded name.
18084
381fb12e
AD
180852002-02-25 Akim Demaille <akim@epita.fr>
18086
18087 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
18088 Fileutils 4.1.5.
18089 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
18090 * src/output.c (output_skeleton): Use mkstemp to create a real
18091 temporary file.
18092 Move the filling of `skeleton' and its muscle to...
18093 (prepare): here.
18094 (output): Move the definition of the prologue muscle to...
18095 (prepare): here.
18096 * src/system.h (DEFAULT_TMPDIR): New.
18097
6f38107f
PE
180982002-02-14 Paul Eggert <eggert@twinsun.com>
18099
18100 Remove the support for C++ namespace cleanliness; it was
18101 causing more problems than it was curing, since it didn't work
18102 properly on some nonstandard C++ compilers. This can wait
18103 for a proper C++ parser.
18104
18105 * NEWS: Document this.
18106 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
18107 of C++, as it's treated like C now.
18108 * src/bison.simple (YYSTD): Remove.
18109 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
18110 Treat C++ just like Standard C instead of trying to support
18111 namespace cleanliness.
18112
80cce3da
AD
181132002-02-14 Akim Demaille <akim@epita.fr>
18114
18115 * tests/regression.at (else): Adjust to Andreas' change.
18116
842e8679
AD
181172002-02-14 Akim Demaille <akim@epita.fr>
18118
18119 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
18120
4bda3f10
AD
181212002-02-13 Andreas Schwab <schwab@suse.de>
18122
18123 * src/output.c (output_rule_data): Don't output NULL, it might
18124 not be defined yet.
18125
4162fa07 181262002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 18127
4162fa07
RA
18128 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
18129 (Copyright notice): Update.
b418ecd8 18130
bd16a5dc
AD
181312002-02-11 Akim Demaille <akim@epita.fr>
18132
18133 * tests/regression.at (%nonassoc and eof): Don't include
18134 nonportable headers.
18135
8d69a1a3
RA
181362002-02-08 Robert Anisko <robert@lrde.epita.fr>
18137
18138 * data/bison.c++: Correct error recovery. Make the user able to
18139 initialize the starting location.
18140
9b2d0677
AD
181412002-02-07 Akim Demaille <akim@epita.fr>
18142
18143 * tests/input.at: New.
18144
69e2658b
RA
181452002-02-07 Robert Anisko <robert@lrde.epita.fr>
18146
18147 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 18148 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
18149 directives around tables only needed for debugging.
18150
4aacc3a7
RA
181512002-02-07 Robert Anisko <robert@lrde.epita.fr>
18152
18153 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
18154 C++ parsers.
18155 (yy::b4_name::parse): Use print_.
18156
762a801e
RA
181572002-02-07 Robert Anisko <robert@lrde.epita.fr>
18158
18159 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
18160
4bb2bc3f
RA
181612002-02-07 Robert Anisko <robert@lrde.epita.fr>
18162
18163 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
18164 C++ parsers.
18165 (yy::b4_name::parse): Build verbose error messages, and use error_.
18166
6b45a3ca
RA
181672002-02-06 Robert Anisko <robert@lrde.epita.fr>
18168
18169 * data/bison.c++: Fix m4 quoting in comments.
18170
50997c6e
RA
181712002-02-06 Robert Anisko <robert@lrde.epita.fr>
18172
18173 * data/bison.c++: Adjust the parser code. Fix some muscles that were
18174 not expanded by m4.
18175
3f3eed27
AD
181762002-02-05 Akim Demaille <akim@epita.fr>
18177
18178 * data/bison.c++: Adjust to the M4 back end.
18179 More is certainly needed.
18180
be2a1a68
AD
181812002-02-05 Akim Demaille <akim@epita.fr>
18182
18183 Give a try to M4 as a back end.
18184
18185 * lib/readpipe.c: New, from wdiff.
18186 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
18187 BISON_HAIRY.
18188 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
18189 specific values. Now it is m4 that performs the lookup.
18190 * src/parse-skel.y: Remove.
18191 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
18192 * src/output.c (actions_output, guards_output)
18193 (token_definitions_output): No longer keeps track of the output
18194 line number, hence remove the second argument.
18195 (guards_output): Check against the guard member of a rule, not the
18196 action member.
18197 Adjust callers.
18198 (output_skeleton): Don't look for the skeleton location, let m4 do
18199 that.
18200 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
18201 file will be used.
18202 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
18203 (prepare): Given that for the time being changesyntax is not
18204 usable in M4, rename the muscles using `-' to `_'.
18205 Define `defines_flag', `output_parser_name' and `output_header_name'.
18206 * src/output.h (actions_output, guards_output)
18207 (token_definitions_output): Adjust prototypes.
18208 * src/scan-skel.l: Instead of scanning the skeletons, it now
18209 processes the output of m4: `__oline__' and `#output'.
18210 * data/bison.simple: Adjust to be used by M4(sugar).
18211 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
18212 to date.
18213 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
18214 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
18215 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
18216 shamelessly stolen from CVS Autoconf.
18217
beda758b
AD
182182002-02-05 Akim Demaille <akim@epita.fr>
18219
18220 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
18221 * configure.in: Check for the declarations of free and malloc.
18222 * src/muscle_tab.c: Adjust.
18223
5ece6d43
AD
182242002-02-05 Akim Demaille <akim@epita.fr>
18225
18226 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
18227 which have no values.
18228
5bb18f9a
AD
182292002-02-05 Akim Demaille <akim@epita.fr>
18230
18231 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
18232 * data/: here.
18233
894dd62e
PE
182342002-01-29 Paul Eggert <eggert@twinsun.com>
18235
18236 * src/bison.simple (YYSIZE_T): Do not define merely because
18237 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
18238 On some platforms, <alloca.h> does not declare YYSTD (size_t).
18239
82841af7
AD
182402002-01-27 Akim Demaille <akim@epita.fr>
18241
18242 Fix `%nonassoc and eof'.
18243
18244 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
18245 which were not properly copied! Replace
18246 memcpy (res->errs, src->errs, src->nerrs);
18247 with
18248 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
18249 !!!
18250 * tests/regression.at (%nonassoc and eof): Adjust to newest
18251 Autotest: `.' is not in the PATH.
18252
318b76e9
AD
182532002-01-27 Akim Demaille <akim@epita.fr>
18254
18255 * tests/sets.at (AT_EXTRACT_SETS): New.
18256 (Nullable): Use it.
18257 (Firsts): New.
18258
30d2f3d5
AD
182592002-01-26 Akim Demaille <akim@epita.fr>
18260
18261 * tests/actions.at, tests/calc.at, tests/headers.at,
18262 * tests/torture.at: Adjust to the newest Autotest which no longer
18263 forces `.' in the PATH.
18264
30f8c395
AD
182652002-01-25 Akim Demaille <akim@epita.fr>
18266
18267 * tests/regression.at (%nonassoc and eof): New.
18268 Suggested by Robert Anisko.
18269
29ae55f1
AD
182702002-01-24 Akim Demaille <akim@epita.fr>
18271
18272 Bison dumps core when trying to complain about broken input files.
18273 Reported by Cris van Pelt.
18274
18275 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
18276 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
18277 into...
18278 (Invalid inputs): Strengthen: exercise parse_percent_token.
18279
2b548aa6
RA
182802002-01-24 Robert Anisko <robert.anisko@epita.fr>
18281
18282 * src/Makefile.am: Add bison.c++.
18283 * src/bison.c++: New skeleton.
18284
bb0146c2
AD
182852002-01-21 Paolo Bonzini <bonzini@gnu.org>
18286
18287 * po/it.po: New.
18288
bec30531
AD
182892002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
18290
18291 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
18292
fc6edc45
MA
182932002-01-20 Marc Autret <marc@gnu.org>
18294
18295 * src/files.c (compute_output_file_names): Fix
18296
5e5d5415
MA
182972002-01-20 Marc Autret <marc@gnu.org>
18298
18299 * tests/output.at: New test.
18300 * src/files.c (compute_base_names): Don't map extensions when
18301 the YACC flag is set, use defaults.
18302 Reported by Evgeny Stambulchik.
18303
44ea3fbd
MA
183042002-01-20 Marc Autret <marc@gnu.org>
18305
ba0fe3c7
PE
18306 * src/system.h: Need to define __attribute__ away for non-GCC
18307 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
18308 Suggested by Albert Chin-A-Young.
18309
338963d1
TVH
183102002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
18311
18312 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
18313 canonical definition.
18314 * src/system.h: Use the canonical definition for PARAMS (avoids
18315 a conflict with the macro from lib/hash.h).
18316
c57b2479
AD
183172002-01-11 Akim Demaille <akim@epita.fr>
18318
18319 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 18320 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 18321
b85810ae
AD
183222002-01-09 Akim Demaille <akim@epita.fr>
18323
18324 * src/files.c, src/files.h (output_infix): New.
18325 (tab_extension): Remove.
18326 (compute_base_names): Compute the former, drop the latter.
18327 * src/output.c (prepare): Insert the muscles `output-infix', and
18328 `output-suffix'.
18329 * src/parse-skel.y (string, string.1): New.
18330 (section.header): Use it.
18331 (section.yacc): Remove.
18332 (prefix): Remove too.
18333 * src/scan-skel.l: Adjust.
18334 * src/bison.simple, src/bison.hairy: Adjust.
18335
cae60122
AD
183362002-01-09 Akim Demaille <akim@epita.fr>
18337
18338 * configure.in (WERROR_CFLAGS): Compute it.
18339 * src/Makefile.am (CFLAGS): Pass it.
18340 * tests/atlocal.in (CFLAGS): Idem.
18341 * src/files.c: Fix a few warnings.
18342 (get_extension_index): Remove, unused.
18343
ae404801
AD
183442002-01-08 Akim Demaille <akim@epita.fr>
18345
18346 * src/getargs.c (AS_FILE_NAME): New.
18347 (getargs): Use it to convert DOSish file names.
18348 * src/files.c (base_name): Rename as full_base_name to avoid
18349 clashes with `base_name ()'.
18350 (filename_split): New.
18351 (compute_base_names): N-th rewrite, using filename_split.
18352
22312b71
AD
183532002-01-08 Akim Demaille <akim@epita.fr>
18354
18355 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
18356 New, stolen from the Fileutils 4.1.
18357 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
18358 * configure.in: Check for the presence of memrchr, and of its
18359 prototype.
18360
a67cef01
TVH
183612002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
18362
18363 * lib/hash.h (__P): Added definition for this macro.
18364 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
18365 BUILT_SOURCES, to ensure they are generated first.
18366 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
18367 %error-verbose to allow bootstrapping with bison 1.30x.
18368
2b25d624
AD
183692002-01-06 Akim Demaille <akim@epita.fr>
18370
18371 * src/reader.c (parse_braces): Don't fetch the next char, the
18372 convention is to fetch on entry.
18373 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
18374 'switch' without a following semicolon.
18375 * tests/regression.at (braces parsing): New.
18376
3460813b
AD
183772002-01-06 Akim Demaille <akim@epita.fr>
18378
18379 Bison is dead wrong in its RR conflict reports.
18380
18381 * tests/torture.at (GNU Cim Grammar): New.
18382 * src/conflicts.c (count_rr_conflicts): Fix.
18383
73784c64
AD
183842002-01-06 Akim Demaille <akim@epita.fr>
18385
18386 Creating package.m4 from configure.ac causes too many problems.
18387
18388 * tests/Makefile.am (package.m4): Create it by hand,
18389 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
18390
25d81090
AD
183912002-01-06 Akim Demaille <akim@epita.fr>
18392
18393 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
18394 skeleton.h.
18395
a9b8959e
PE
183962002-01-04 Paul Eggert <eggert@twinsun.com>
18397
18398 * doc/bison.texinfo (Debugging):
18399 Remove YYSTDERR; it's no longer defined or used.
18400 Also, s/cstdio.h/cstdio/.
18401
25d81090
AD
184022002-01-03 Akim Demaille <akim@epita.fr>
18403
18404 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
18405
1109455c
AD
184062002-01-03 Akim Demaille <akim@epita.fr>
18407
18408 * src/parse-skel.y (process_skeleton): Don't bind the parser's
18409 tracing code to --trace, wait for a better --trace option, with
18410 args.
18411
7ea5e977
AD
184122002-01-03 Akim Demaille <akim@epita.fr>
18413
18414 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
18415 The ISO C++ standard is extremely clear about it: stderr is
18416 considered a macro, not a regular symbol (see table 94 `Header
18417 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
18418 Therefore std:: does not apply to it. It still does with fprintf.
18419 Also, s/cstdio.h/cstdio/.
18420
fab5b110
AD
184212002-01-03 Akim Demaille <akim@epita.fr>
18422
18423 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
18424 for non system headers.
18425
aed7fd9b
AD
184262002-01-02 Akim Demaille <akim@epita.fr>
18427
18428 Equip the skeleton chain with location tracking, runtime trace,
18429 pure parser and scanner.
18430
18431 * src/parse-skel.y: Request a pure parser, locations, and prefix
18432 renaming.
18433 (%union): Having several members with the same type does not help
18434 type mismatches, simplify.
18435 (YYPRINT, yyprint): New.
18436 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
18437 (skel_error): this.
18438 Handle locations.
18439 * src/scan-skel.l: Adjust to these changes.
18440 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
18441 (LOCATION_PRINT, skel_control_t): New.
18442
24fad99e
AD
184432001-12-30 Akim Demaille <akim@epita.fr>
18444
18445 * src/parse-skel.y: Get rid of the shift/reduce conflict:
18446 replace `gb' with BLANKS.
18447 * src/scan-skel.l: Adjust.
18448
a4b36db4
AD
184492001-12-30 Akim Demaille <akim@epita.fr>
18450
18451 * src/system.h: We don't need nor want bcopy.
18452 Throw away MS-DOS crap: we don't need getpid.
18453 * configure.in: We don't need strndup. It was even causing
18454 problems: because Flex includes the headers *before* us,
18455 _GNU_SOURCE is not defined by config.h, and therefore strndup was
18456 not visible.
18457 * lib/xstrndup.c: New.
18458 * src/scan-skel.l: Use it.
18459 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
18460 * src/parse-skel.y: Use %directives instead of #defines.
18461
1239777d
AD
184622001-12-30 Akim Demaille <akim@epita.fr>
18463
18464 * src/skeleton.h: New.
18465 * src/output.c (output_parser, output_master_parser): Remove, dead
18466 code.
18467 * src/output.h (get_lines_number, actions_output, guards_output)
18468 (token_definitions_output): Prototype them.
18469 * src/parse-skel.y: Add the license notice.
18470 Include output.h and skeleton.h.
18471 (process_skeleton): Returns void, and takes a single parameter.
18472 * src/scan-skel.l: Add the license notice.
18473 Include skeleton.h.
18474 Don't use %option yylineno: it seems that then Flex imagines
18475 REJECT has been used, and therefore it won't reallocate its
18476 buffers (which makes no other sense to me than a bug). It results
18477 in warnings for `unused: yy_flex_realloc'.
18478
9b3add5b
RA
184792001-12-30 Robert Anisko <robert.anisko@epita.fr>
18480
18481 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
18482 (MUSCLE_INSERT_PREFIX): ...to there.
18483 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
18484 (MUSCLE_INSERT_PREFIX): Move from here...
18485
18486 * src/bison.hairy: Add a section directive. Put braces around muscle
18487 names. This parser skeleton is still broken, but Bison should not
18488 choke on a bad muscle 'syntax'.
18489 * src/bison.simple: Add a section directive. Put braces around muscle
18490 names.
18491
18492 * src/files.h (strsuffix, stringappend): Add declarations.
18493 (tab_extension): Add declaration.
18494 (short_base_name): Add declaration.
18495
18496 * src/files.c (strsuffix, stringappend): No longer static. These
18497 functions are used in the skeleton parser.
18498 (tab_extension): New.
18499 (compute_base_names): Use the computations done in this function
fab5b110 18500 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
18501 names.
18502 (short_base_name): No longer static.
18503
18504 * src/output.c (output_skeleton): New.
18505 (output): Disable call to output_master_parser, and give a try to
18506 a new skeleton handling system.
18507 (guards_output, actions_output): No longer static.
18508 (token_definitions_output, get_lines_number): No longer static.
18509
18510 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
18511
fab5b110 18512 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
18513 parse-skel.y.
18514
18515 * src/parse-skel.y: New file.
18516 * src/scan-skel.l: New file.
18517
b5b61c61
AD
185182001-12-29 Akim Demaille <akim@epita.fr>
18519
18520 %name-prefix is broken.
18521
18522 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
18523 Adjust all dependencies.
18524 * tests/headers.at (export YYLTYPE): Strengthen this test: use
18525 %name-prefix.
18526
18527 Renaming yylval but not yylloc is not consistent. Now we do.
18528
18529 * src/bison.simple: Prefix yylloc if used.
18530 * doc/bison.texinfo (Decl Summary): Document that.
18531
8c9a50be
AD
185322001-12-29 Akim Demaille <akim@epita.fr>
18533
18534 * doc/bison.texinfo: Promote `%long-directive' over
18535 `%long_directive'.
18536 Remove all references to fixed-output-files, yacc is enough.
18537
d99361e6
AD
185382001-12-29 Akim Demaille <akim@epita.fr>
18539
18540 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
18541 user prologue. These are defaults.
18542 * tests/actions.at (Mid-rule actions): Make sure the user can
18543 define YYDEBUG and YYERROR_VERBOSE.
18544
b9cecb91
AD
185452001-12-29 Akim Demaille <akim@epita.fr>
18546
18547 * src/output.c (header_output): Don't forget to export YYLTYPE and
18548 yylloc.
18549 * tests/headers.at (export YYLTYPE): New, make sure it does.
18550 * tests/regression.at (%union and --defines, Invalid CPP headers):
18551 Move to...
18552 * tests/headers.at: here.
18553
aea13e97
AD
185542001-12-29 Akim Demaille <akim@epita.fr>
18555
18556 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
18557
931394cb
AD
185582001-12-29 Akim Demaille <akim@epita.fr>
18559
18560 * tests/actions.at (Mid-rule actions): Output on a single line
18561 instead of several.
18562
704a47c4
AD
185632001-12-29 Akim Demaille <akim@epita.fr>
18564
18565 * doc/bison.texinfo: Formatting changes.
18566
091e20bb
AD
185672001-12-29 Akim Demaille <akim@epita.fr>
18568
18569 Don't store the token defs in a muscle, just be ready to output it
18570 on command. Now possible via `symbols'. Fixes a memory leak.
18571
18572 * src/output.c (token_definitions_output): New.
18573 (output_parser, header_output): Use it.
18574 * src/reader.c (symbols_save): Remove.
18575
cce71710
AD
185762001-12-29 Akim Demaille <akim@epita.fr>
18577
18578 * src/bison.simple: Do not provide a default for YYSTYPE and
18579 YYLTYPE before the user's prologue. Otherwise it's hardly... a
18580 default.
18581
82c035a8
AD
185822001-12-29 Akim Demaille <akim@epita.fr>
18583
18584 Mid-rule actions are simply... ignored!
18585
18586 * src/reader.c (readgram): Be sure to attach mid-rule actions to
18587 the empty-rule associated to the dummy symbol, not to the host
18588 rule.
18589 * tests/actions.at (Mid-rule actions): New.
18590
8419d367
AD
185912001-12-29 Akim Demaille <akim@epita.fr>
18592
18593 Memory leak.
18594
18595 * src/reader.c (reader): Free grammar.
18596
375d5806
AD
185972001-12-29 Akim Demaille <akim@epita.fr>
18598
18599 Memory leak.
18600
18601 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
18602 since it allocates it for each state, although only one is needed.
18603 (allocate_storage): Do it here.
18604
f51cb8ff
AD
186052001-12-29 Akim Demaille <akim@epita.fr>
18606
18607 * src/options.h, src/options.c (create_long_option_table): Rename
18608 as...
18609 (long_option_table_new): this, with a clearer prototype.
18610 (percent_table): Remove, unused,
18611 * src/getargs.c (getargs): Adjust.
18612
29e88316
AD
186132001-12-29 Akim Demaille <akim@epita.fr>
18614
18615 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
18616 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
18617 as states.
18618
b9f71f19
AD
186192001-12-29 Akim Demaille <akim@epita.fr>
18620
18621 * src/lalr.c (build_relations): Rename `states' as `states1'.
18622 Sorry, I don't understand exactly what it is, no better name...
18623
1a2b5d37
AD
186242001-12-29 Akim Demaille <akim@epita.fr>
18625
18626 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
18627 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
18628 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
18629 as rules.
18630
1cca533e
AD
186312001-12-29 Akim Demaille <akim@epita.fr>
18632
18633 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
18634 ago.
18635
c03ae966
AD
186362001-12-29 Akim Demaille <akim@epita.fr>
18637
18638 * src/reader.c, src/reader.h (user_toknums): Remove.
18639 Adjust all users to use symbols[i]->user_token_number.
18640
5a670b1e
AD
186412001-12-29 Akim Demaille <akim@epita.fr>
18642
18643 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
18644 Adjust all users to use symbols[i]->prec or ->assoc.
18645
ad949da9
AD
186462001-12-29 Akim Demaille <akim@epita.fr>
18647
18648 * src/reader.c, src/reader.h (tags): Remove.
18649 Adjust all users to use symbols[i]->tag.
18650
0e78e603
AD
186512001-12-29 Akim Demaille <akim@epita.fr>
18652
18653 * src/gram.h, src/gram.c (symbols): New, similar to state_table
18654 and rule_table.
18655 * src/reader.c (packsymbols): Fill this table.
18656 Drop sprec.
18657 * src/conflicts.c (resolve_sr_conflict): Adjust.
18658 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
18659 single table.
18660 Use symbols[i]->tag instead of tags[i].
18661
213e640e
AD
186622001-12-29 Akim Demaille <akim@epita.fr>
18663
18664 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
18665 In addition, put a comment in there, to replace...
18666 * tests/regression.at (%union and C comments): Remove.
18667
e7b8bef1
AD
186682001-12-29 Akim Demaille <akim@epita.fr>
18669
18670 * tests/regression.at (Web2c Actions): Blindly move the actual
18671 output as expected output. The contents *seem* right to me, but I
18672 can't pretend reading perfectly parser tables... Nonetheless, all
18673 the other tests pass correctly, the table look OK, even though the
18674 presence of `$axiom' is to be noted: AFAICS it is useless (but
18675 harmless).
18676
b68e7744
AD
186772001-12-29 Akim Demaille <akim@epita.fr>
18678
18679 * src/reader.c (readgram): Don't add the rule 0 if there were no
18680 rules read. In other words, add it _after_ having performed
18681 grammar sanity checks.
18682 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
18683
78d5bae9
AD
186842001-12-29 Akim Demaille <akim@epita.fr>
18685
18686 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
18687 visible, and some states have now a different number.
18688
ff442794
AD
186892001-12-29 Akim Demaille <akim@epita.fr>
18690
18691 * src/reader.c (readgram): Bind the initial rule's lineno to that
18692 of the first rule.
18693 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
18694 (Solved SR Conflicts): Adjust rule 0's line number.
18695
610ab194
AD
186962001-12-29 Akim Demaille <akim@epita.fr>
18697
18698 Fix the `GAWK Grammar' failure.
18699
18700 * src/LR0.c (final_state): Initialize to -1 so that we do compute
18701 the reductions of the first state which was mistakenly confused
18702 with the final state because precisely final_state was initialized
18703 to 0.
18704 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
18705 now noticed by Bison.
18706 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
18707 have a reduction on $default.
18708
29d29c8f
AD
187092001-12-29 Akim Demaille <akim@epita.fr>
18710
18711 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
18712 rule line numbers.
18713 * src/closure.c (print_closure): Likewise.
18714 * src/derives.c (print_derives): Likewise.
18715 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
18716 now.
18717
7c6b64d0
AD
187182001-12-29 Akim Demaille <akim@epita.fr>
18719
18720 * src/lalr.c (lookaheads_print): New.
18721 (lalr): Call it when --trace-flag.
18722 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
18723 are dumped.
18724
3d4daee3
AD
187252001-12-29 Akim Demaille <akim@epita.fr>
18726
18727 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
18728 when walking through ritem, even via rule->rhs.
18729 * src/reduce.c (dump_grammar, useful_production, reduce_output)
18730 (useful_production, useless_nonterminals): Likewise.
18731 (reduce_grammar_tables): Likewise, plus update nritems.
18732 * src/nullable.c (set_nullable): Likewise.
18733 * src/lalr.c (build_relations): Likewise.
18734 * tests/sets.at (Nullable): Adjust.
18735 Fortunately, now, the $axiom is no longer nullable.
18736
9e7f6bbd
AD
187372001-12-29 Akim Demaille <akim@epita.fr>
18738
18739 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
18740 the 0-sentinel.
18741 * src/gram.c (ritem_longest_rhs): Likewise.
18742 * src/reduce.c (nonterminals_reduce): Likewise.
18743 * src/print_graph.c (print_graph): Likewise.
18744 * src/output.c (output_rule_data): Likewise.
18745 * src/nullable.c (set_nullable): Likewise.
18746
255ef638
AD
187472001-12-29 Akim Demaille <akim@epita.fr>
18748
18749 * src/output.c: Comment changes.
18750
0d8a7363
AD
187512001-12-27 Paul Eggert <eggert@twinsun.com>
18752
18753 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
18754 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
18755 Sparc, as they were causing more porting problems than the
18756 (minor) performance improvement was worth.
18757
18758 Also, catch up with 1.31's YYSTD.
18759
3db472b9
AD
187602001-12-27 Akim Demaille <akim@epita.fr>
18761
18762 * src/output.c (output_gram): Rely on nritems, not the
18763 0-sentinel. See below.
18764 Use -1 as separator, not 0.
18765 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
18766 Rely on -1 as separator in yyrhs, instead of 0.
18767 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
18768 twice `Now at end of input', therefore there are two lines less to
18769 expect.
18770
b365aa05
AD
187712001-12-27 Akim Demaille <akim@epita.fr>
18772
18773 * tests/regression.at (Unresolved SR Conflicts):
18774 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
18775 below.
18776
30171f79
AD
187772001-12-27 Akim Demaille <akim@epita.fr>
18778
18779 * src/LR0.c (new_state): Recognize the final state by the fact it
18780 is reached by eoftoken.
18781 (insert_start_shifting_state, insert_eof_shifting_state)
18782 (insert_accepting_state, augment_automaton): Remove, since now
18783 these states are automatically computed from the initial state.
18784 (generate_states): Adjust.
18785 * src/print.c: When reporting a rule number to the user, substract
18786 1, so that the axiom rule is rule 0, and the first user rule is 1.
18787 * src/reduce.c: Likewise.
18788 * src/print_graph.c (print_core): For the time being, just as for
18789 the report, depend upon --trace-flags to dump the full set of
18790 items.
18791 * src/reader.c (readgram): Once the grammar read, insert the rule
18792 0: `$axiom: START-SYMBOL $'.
18793 * tests/set.at: Adjust: rule 0 is now displayed, and since the
18794 number of the states has changed (the final state is no longer
18795 necessarily the last), catch up.
18796
75142d45
AD
187972001-12-27 Akim Demaille <akim@epita.fr>
18798
18799 Try to make the use of the eoftoken valid. Given that its value
18800 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
18801 is used instead of > 0 where appropriate, (ii), depend upon nritems
18802 instead of the 0-sentinel.
18803
18804 * src/gram.h, src/gram.c (nritems): New.
18805 Expected to be duplication of nitems, but for the time being...
18806 * src/reader.c (packgram): Assert nritems and nitems are equal.
18807 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
18808 * src/closure.c (print_closure, print_fderives): Likewise.
18809 * src/gram.c (ritem_print): Likewise.
18810 * src/print.c (print_core, print_grammar): Likewise.
18811 * src/print_graph.c: Likewise.
18812
b7c49edf
AD
188132001-12-27 Akim Demaille <akim@epita.fr>
18814
18815 * src/main.c (main): If there are complains after grammar
18816 reductions, then output the report anyway if requested, then die.
18817 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
18818 * src/reader.c (eoftoken): New.
18819 (parse_token_decl): If the token being defined has value `0', it
18820 is the eoftoken.
18821 (packsymbols): No longer hack `tags' to insert `$' by hand.
18822 Be sure to preserve the value of the eoftoken.
18823 (reader): Make sure eoftoken is defined.
18824 Initialize nsyms to 0: now eoftoken is created just like the others.
18825 * src/print.c (print_grammar): Don't special case the eof token.
18826 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
18827 lie anyway, albeit pleasant.
18828 * tests/calc.at: Exercise error messages with eoftoken.
18829 Change the grammar so that empty input is invalid.
18830 Adjust expectations.
18831 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
18832
ec2da99f
AD
188332001-12-27 Akim Demaille <akim@epita.fr>
18834
18835 * configure.in: Check the protos of strchr ans strspn.
18836 Replace strchr if needed.
18837 * src/system.h: Provide the protos of strchr, strspn and memchr if
18838 missing.
18839 * lib/strchr.c: New.
18840 * src/reader.c (symbols_save): Use strchr.
18841
8adfa272
AD
188422001-12-27 Akim Demaille <akim@epita.fr>
18843
18844 * src/print.c, src/print_graph.c (escape): New.
18845 Use it to quote the TAGS outputs.
18846 * src/print_graph.c (print_state): Now errors are in red, and
18847 reductions in green.
18848 Prefer high to wide: output the state number on a line of its own.
18849
80dac38c
AD
188502001-12-27 Akim Demaille <akim@epita.fr>
18851
18852 * src/state.h, src/state.c (reductions_new): New.
18853 * src/LR0.c (set_state_table): Let all the states have a
18854 `reductions', even if reduced to 0.
18855 (save_reductions): Adjust.
18856 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
18857 * src/print.c (print_reductions, print_actions): Adjust.
18858 * src/output.c (action_row): Adjust.
18859
2cec70b9
AD
188602001-12-27 Akim Demaille <akim@epita.fr>
18861
18862 * src/state.h, src/state.c (errs_new, errs_dup): New.
18863 * src/LR0.c (set_state_table): Let all the states have an errs,
18864 even if reduced to 0.
18865 * src/print.c (print_errs, print_reductions): Adjust.
18866 * src/output.c (output_actions, action_row): Adjust.
18867 * src/conflicts.c (resolve_sr_conflict): Adjust.
18868
13ca549a
AD
188692001-12-27 Akim Demaille <akim@epita.fr>
18870
18871 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
18872
5092aba5
AD
188732001-12-27 Akim Demaille <akim@epita.fr>
18874
18875 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
18876 * src/print.c: here.
18877 (lookaheadset, shiftset): New, used as additional storage by
18878 print_reductions.
18879 (print_results): Adjust.
18880 (print_shifts, print_gotos, print_errs): New, extracted from...
18881 (print_actions): here.
18882 * src/print_graph.c (print_actions): Remove dead code.
18883
11e2beca
AD
188842001-12-27 Akim Demaille <akim@epita.fr>
18885
18886 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
18887 `$n' and `@n'.
18888
dac3c910
AD
188892001-12-27 Akim Demaille <akim@epita.fr>
18890
18891 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
18892 (build_relations): Adjust.
18893
d0b0fefa
AD
188942001-12-27 Akim Demaille <akim@epita.fr>
18895
18896 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
18897 duplication.
18898
adc8c848
AD
188992001-12-27 Akim Demaille <akim@epita.fr>
18900
18901 * src/reader.c (packgram): Catch nitems overflows.
18902
14d293ac
AD
189032001-12-27 Akim Demaille <akim@epita.fr>
18904
18905 * src/files.c, src/files.h (guard_obstack): Remove.
18906 * src/output.c (output): Adjust.
18907 * src/reader.c (parse_braces): New, factoring...
18908 (copy_action, copy_guard): these two which are renamed as...
18909 (parse_action, parse_guard): these.
18910 As a voluntary consequence, using braces around guards is now
18911 mandatory.
18912
f499b062
AD
189132001-12-27 Akim Demaille <akim@epita.fr>
18914
18915 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
18916 * src/reader.c (symbol_list): `guard' and `guard_line' are new
18917 members.
18918 (symbol_list_new): Adjust.
18919 (copy_action): action_line is the first line, not the last.
18920 (copy_guard): Just as for actions, store the `action' only, not
18921 the switch/case/break flesh.
18922 Don't parse the user action that might follow the guard, let...
18923 (readgram): do it, i.e., now, there can be an action after a
18924 guard.
18925 In other words the guard is just explicitly optional.
18926 (packgram): Adjust.
18927 * src/output.c (guards_output): New.
18928 (output_parser): Call it when needed.
18929 (output): Also free the guard and attrs obstacks.
18930 * src/files.c, src/files.h (obstack_save): Remove.
18931 (output_files): Remove.
18932 As a result, if one needs the former `.act' file, using an
18933 appropriate skeleton which requires actions and guards is now
18934 required.
18935 * src/main.c (main): Adjust.
18936 * tests/semantic.at: New.
18937 * tests/regression.at: Use `input.y' as input file name.
18938 Avoid 8+3 problems by requiring input.c when the test needs the
18939 parser.
18940
d945f5cd
AD
189412001-12-27 Akim Demaille <akim@epita.fr>
18942
18943 * src/reader.c (symbol_list_new): Be sure to initialize all the
18944 fields.
18945
d200e455
AD
189462001-12-27 Akim Demaille <akim@epita.fr>
18947
18948 All the hacks using a final pseudo state are now useless.
18949
18950 * src/LR0.c (set_state_table): state_table holds exactly nstates.
18951 * src/lalr.c (nLA): New.
18952 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
18953 instead of lookaheadsp from the pseudo state (nstate + 1).
18954
f9507c28
AD
189552001-12-27 Akim Demaille <akim@epita.fr>
18956
18957 * src/output.c (action_row, token_actions): Use a state_t instead
18958 of a integer, and nlookaheads instead of the following state's
18959 lookaheadsp.
18960
065fbd27
AD
189612001-12-27 Akim Demaille <akim@epita.fr>
18962
18963 * src/conflicts.c (log_resolution, flush_shift)
18964 (resolve_sr_conflict, set_conflicts, solve_conflicts)
18965 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
18966 (conflicts_print, print_reductions): Use a state_t instead of an
18967 integer when referring to a state.
18968 As much as possible, depend upon nlookaheads, instead of the
18969 `lookaheadsp' member of the following state (since lookaheads of
18970 successive states are successive, the difference between state n + 1
18971 and n served as the number of lookaheads for state n).
18972 * src/lalr.c (add_lookback_edge): Likewise.
18973 * src/print.c (print_core, print_actions, print_state)
18974 (print_results): Likewise.
18975 * src/print_graph.c (print_core, print_actions, print_state)
18976 (print_graph): Likewise.
18977 * src/conflicts.h: Adjust.
18978
1b177bd7
AD
189792001-12-27 Akim Demaille <akim@epita.fr>
18980
18981 * src/bison.hairy: Formatting/comment changes.
18982 ANSIfy.
18983 Remove `register' indications.
18984 Add plenty of `static'.
18985
7742ddeb
AD
189862001-12-27 Akim Demaille <akim@epita.fr>
18987
18988 * src/output.c (prepare): Drop the muscle `ntbase' which
18989 duplicates ntokens.
18990 * src/bison.simple: Formatting/comment changes.
18991 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
18992 is an undocumented synonym.
18993
1fa14068
AD
189942001-12-22 Akim Demaille <akim@epita.fr>
18995
18996 * src/output.c (output_table_data): Change the prototype to use
18997 `int' for array ranges: some invocations do pass an int, not a
18998 short.
18999 Reported by Wayne Green.
19000
b9752825
AD
190012001-12-22 Akim Demaille <akim@epita.fr>
19002
19003 Some actions of web2c.y are improperly triggered.
19004 Reported by Mike Castle.
19005
19006 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
19007 * tests/regression.at (Web2c): Rename as...
19008 (Web2c Report): this.
19009 (Web2c Actions): New.
19010
776209d6
AD
190112001-12-22 Akim Demaille <akim@epita.fr>
19012
19013 Reductions in web2c.y are improperly reported.
19014 Reported by Mike Castle.
19015
19016 * src/conflicts.c (print_reductions): Fix.
19017 * tests/regression.at (Web2c): New.
19018
275fc3ad
AD
190192001-12-18 Akim Demaille <akim@epita.fr>
19020
19021 Some host fail on `assert (!"foo")', which expands to
19022 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
19023 Reported by Nelson Beebee.
19024
19025 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
19026 `#define it_succeeded 0' and `assert (it_succeeded)'.
19027
897668ee
MA
190282001-12-17 Marc Autret <autret_m@epita.fr>
19029
19030 * src/bison.simple: Don't hard code the skeleton line and filename.
19031 * src/output.c (output_parser): Rename 'line' as 'output_line'.
19032 New line counter 'skeleton_line' (skeleton-line muscle).
19033
ab3399e0
PE
190342001-12-17 Paul Eggert <eggert@twinsun.com>
19035
19036 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
19037 YYDEBUG must be defined to a nonzero value.
19038
19039 * src/bison.simple (yytname): Do not assume that the user defines
19040 YYDEBUG to a properly parenthesized expression.
19041
3877f72b
AD
190422001-12-17 Akim Demaille <akim@epita.fr>
19043
19044 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
19045 nlookaheads is a new member.
19046 Adjust all users.
19047 * src/lalr.h (nlookaheads): Remove this orphan declaration.
19048 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
19049 state.
776209d6 19050
331dbc1b
AD
190512001-12-17 Akim Demaille <akim@epita.fr>
19052
19053 * src/files.h, src/files.c (open_files, close_files): Remove.
19054 * src/main.c (main): Don't open/close files, nor invoke lex_free,
19055 let...
19056 * src/reader.c (reader): Do it.
776209d6 19057
be750e4c
AD
190582001-12-17 Akim Demaille <akim@epita.fr>
19059
19060 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 19061
709ae8c6
AD
190622001-12-17 Akim Demaille <akim@epita.fr>
19063
19064 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
19065 (flush_reduce): New.
19066 (resolve_sr_conflict): Adjust.
776209d6 19067
f87685c3
AD
190682001-12-17 Akim Demaille <akim@epita.fr>
19069
19070 * src/output.c (output_obstack): Be static and rename as...
19071 (format_obstack): this, to avoid any confusion with files.c's
19072 output_obstack.
19073 * src/reader.h (muscle_obstack): Move to...
19074 * src/output.h: here, since it's defined in output.c.
19075
837491d8
AD
190762001-12-17 Akim Demaille <akim@epita.fr>
19077
19078 * src/output.c (action_row, save_column, default_goto)
19079 (sort_actions, matching_state, pack_vector): Better variable
19080 locality.
19081
796d61fb
AD
190822001-12-17 Akim Demaille <akim@epita.fr>
19083
19084 * src/output.c: Various formatting changes.
776209d6 19085
64d15509
AD
190862001-12-17 Akim Demaille <akim@epita.fr>
19087
19088 * src/files.c (output_files): Free the output_obstack.
19089 * src/main.c (main): Call print and print_graph conditionally.
19090 * src/print.c (print): Work unconditionally.
19091 * src/print_graph.c (print_graph): Work unconditionally.
19092 * src/conflicts.c (log_resolution): Output only if verbose_flag.
19093
fbc8ecb7
MA
190942001-12-16 Marc Autret <autret_m@epita.fr>
19095
19096 * src/output.c (actions_output): Fix. When we use %no-lines,
19097 there is one less line per action.
19098
f0440388
MA
190992001-12-16 Marc Autret <autret_m@epita.fr>
19100
19101 * src/bison.simple: Remove a useless #line directive.
19102 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
19103 * src/output.c (get_lines_number): New.
776209d6 19104 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
19105 output muscles.
19106 Fix line numbering.
19107 (actions_output): Computes the number of lines taken by actions.
19108 (output_master_parser): Insert new skeleton which is the name of
19109 the output parser file name.
19110
a79986b8
MA
191112001-12-15 Marc Autret <autret_m@epita.fr>
19112
19113 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
19114
4ec8e00f
MA
191152001-12-15 Marc Autret <autret_m@epita.fr>
19116
19117 * src/output.c (output_gram): Keep track of the hairy one.
19118
1a4648ff
AD
191192001-12-15 Akim Demaille <akim@epita.fr>
19120
19121 Make `make distcheck' work.
19122
19123 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
19124 system.h which uses libgettext.h.
19125
9c2c67e6
AD
191262001-12-15 Akim Demaille <akim@epita.fr>
19127
19128 * src/nullable.c (set_nullable): Useless rules must be skipped,
19129 otherwise, since we range over their symbols, we might look at a
19130 nonterminal which no longer ``exists'', i.e., it is not counted in
19131 `nvars', hence we overflow our arrays.
19132
93ede233
AD
191332001-12-15 Akim Demaille <akim@epita.fr>
19134
19135 The header can also be produced directly, without any obstack!
19136 Yahoo!
19137
19138 * src/files.c, src/files.h (defines_obstack): Remove.
19139 (compute_header_macro): Global.
19140 (defines_obstack_save): Remove.
19141 * src/reader.c (parse_union_decl): No longer output to
19142 defines_obstack: its content can be found in the `stype' muscle
19143 anyway.
19144 (output_token_translations): Merge into...
19145 (symbols_output): this.
19146 Rename as...
19147 (symbols_save): this.
19148 (reader): Adjust.
19149 * src/output.c (header_output): New.
19150 (output): Call it.
19151
2666f928
AD
191522001-12-15 Akim Demaille <akim@epita.fr>
19153
19154 * src/reader.c (parse_union_decl): Instead of handling two obstack
19155 simultaneously, use one to define the `stype' muscle, and use the
19156 value of the latter to fill defines_obstack.
19157 (copy_comment): Remove.
19158 (copy_comment2): Work for a single obstack.
19159 Rename as...
19160 (copy_comment): this.
19161
428046f8
AD
191622001-12-15 Akim Demaille <akim@epita.fr>
19163
19164 * src/lex.c, src/lex.h (xgetc): No longer static.
19165 * src/reader.c (parse_union_decl): Revamp.
19166
ea52d706
AD
191672001-12-15 Akim Demaille <akim@epita.fr>
19168
19169 Still making progress in separating Bison into (i) input, (ii)
19170 process, (iii) output: now we can directly output the parser file
19171 without using table_obstack at all.
19172
19173 * src/files.c, src/files.h (table_obstack): Bye bye.
19174 (parser_file_name): New.
19175 * src/files.c (compute_output_file_names): Compute it.
19176 * src/output.c (actions_output, output_parser)
19177 (output_master_parser): To a file instead of an obstack.
19178
3f96f4dc
AD
191792001-12-15 Akim Demaille <akim@epita.fr>
19180
19181 Attach actions to rules, instead of pre-outputting them to
19182 actions_obstack.
19183
19184 * src/gram.h (rule_t): action and action_line are new members.
19185 * src/reader.c (symbol_list): Likewise.
19186 (copy_action): Save the actions within the rule.
19187 (packgram): Save them in rule_table.
19188 * src/output.c (actions_output): New.
19189 (output_parser): Use it on `%%actions'.
19190 (output_rule_data): Don't free rule_table.
19191 (output): Do it.
19192 (prepare): Don't save the `action' muscle.
19193 * src/bison.simple: s/%%action/%%actions/.
19194
51576fb3
AD
191952001-12-15 Akim Demaille <akim@epita.fr>
19196
19197 * src/reader.c (copy_action): When --yacc, don't append a `;'
19198 to the user action: let it fail if lacking.
dee049eb 19199 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 19200
2648a72d
AD
192012001-12-14 Akim Demaille <akim@epita.fr>
19202
19203 * src/lex.c (literalchar): Simply return the char you decoded, non
19204 longer mess around with obstacks and int pointers.
19205 Adjust all callers.
19206
92790e5b
AD
192072001-12-14 Akim Demaille <akim@epita.fr>
19208
19209 * src/lex.c (literalchar): Don't escape the special characters,
19210 just decode them, and keep them as char (before, eol was output as
19211 the 2 char string `\n' etc.).
19212 * src/output.c (output_rule_data): Use quotearg to output the
19213 token strings.
19214
927c1557
PE
192152001-12-13 Paul Eggert <eggert@twinsun.com>
19216
19217 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
19218 Do not infringe on the global user namespace when using C++.
19219 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
19220 All uses of `fprintf' and `stderr' changed.
19221
19222 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
19223
ed8e1f68
AD
192242001-12-13 Akim Demaille <akim@epita.fr>
19225
19226 The computation of nullable is broken: it doesn't handle empty
19227 RHS's properly.
19228
19229 * tests/torture.at (GNU AWK Grammar): New.
19230 * tests/sets.at (Nullable): New.
19231 * src/nullable.c (set_nullable): Instead of blindly looping over
19232 `ritems', loop over the rules, and then over their rhs's.
19233
19234 Work around Autotest bugs.
19235
19236 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
19237 frame, because Autotest understand lines starting with a `+' as
19238 traces from the shell. Then, they are not processed properly.
19239 Admittedly an Autotest bug, but we don't have time to wait for
19240 Autotest to catch up.
19241 * tests/regression.at (Broken Closure): Adjust to the new table
19242 frames.
19243 Move to...
19244 * tests/sets.at: here.
19245
cb581495
AD
192462001-12-13 Akim Demaille <akim@epita.fr>
19247
19248 * src/closure.c (closure): Use nrules instead of playing tricks
19249 with BITS_PER_WORD.
19250
2e729273
AD
192512001-12-13 Akim Demaille <akim@epita.fr>
19252
19253 * src/print.c (print_actions): Output the handling of `$' as the
19254 traces do: shifting the token EOF. Before EOF was treated as a
19255 nonterminal.
19256 * tests/regression.at: Adjust some tests.
19257 * src/print_graph.c (print_core): Complete the set of items via
19258 closure. The next-to-final and final states are still unsatisfying,
19259 but that's to be addressed elsewhere.
19260 No longer output the rule numbers, but do output the state number.
19261 A single loop for the shifts + gotos is enough, but picked a
19262 distinct color for each.
19263 (print_graph): Initialize and finalize closure.
19264
107f7dfb
AD
192652001-12-13 Akim Demaille <akim@epita.fr>
19266
19267 * src/reader.c (readgram): Remove dead code, an strip useless
19268 braces.
19269 (get_type): Remove, unused.
19270
9b53a24f
AD
192712001-12-12 Akim Demaille <akim@epita.fr>
19272
19273 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
19274 on that of lib/error.c.
19275
dbfb6dcd
AD
192762001-12-12 Akim Demaille <akim@epita.fr>
19277
19278 Some hosts don't like `/' in includes.
19279
19280 * src/system.h: Include libgettext.h without qualifying the path.
19281 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
19282 $(top_srcdir).
19283
c25fb648
MA
192842001-12-11 Marc Autret <autret_m@epita.fr>
19285
19286 * src/output.c (output_parser): Remove useless muscle.
19287
710ddc4f
MA
192882001-12-11 Marc Autret <autret_m@epita.fr>
19289
19290 * src/bison.simple: Remove #line just before %%epilogue. It
19291 is now handled in ...
19292 * src/reader.c (read_additionnal_code): Add the output of a
19293 #line for the epilogue.
19294
e83d80b8
MA
192952001-12-10 Marc Autret <autret_m@epita.fr>
19296
927c1557 19297 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
19298 replace precedent remove.
19299 * src/bison.simple: Remove #line before %%prologue because
19300 %%input-line is wrong at this time.
19301
971d5158
MA
193022001-12-10 Marc Autret <autret_m@epita.fr>
19303
19304 * src/reader.c (symbols_output): Clean up.
927c1557 19305 * src/output.c (output_gram, output): Clean up.
971d5158 19306
5edafffd
AD
193072001-12-10 Akim Demaille <akim@epita.fr>
19308
19309 * src/lalr.c (initialize_lookaheads): New. Extracted from...
19310 * src/LR0.c (set_state_table): here.
19311 * src/lalr.c (lalr): Call it.
19312
0279f8e9
AD
193132001-12-10 Akim Demaille <akim@epita.fr>
19314
19315 * src/state.h (shifts): Remove the `number' member: shifts are
19316 attached to state, hence no longer need to be labelled with a
19317 state number.
19318
190c4f5f
AD
193192001-12-10 Akim Demaille <akim@epita.fr>
19320
19321 Now that states have a complete set of members, the linked list of
19322 shifts is useless: just fill directly the state's shifts member.
19323
19324 * src/state.h (shifts): Remove the `next' member.
19325 * src/LR0.c (first_state, last_state): Remove.
19326 Adjust the callers.
19327 (augment_automaton): Don't look for the shifts that must be added
19328 a shift on EOF: it is those of the state we looked for! But now,
19329 since shifts are attached, it is no longer needed to looking
19330 merely by its id: its number.
19331
2a73b93d
AD
193322001-12-10 Akim Demaille <akim@epita.fr>
19333
19334 * src/LR0.c (augment_automaton): Better variable locality.
19335 Remove an impossible branch: if there is a state corresponding to
19336 the start symbol being shifted, then there is shift for the start
19337 symbol from the initial state.
19338
74392f6a
AD
193392001-12-10 Akim Demaille <akim@epita.fr>
19340
19341 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
19342 only when appropriate: when insert_start_shifting_state' is not
19343 invoked.
19344 * tests/regression.at (Rule Line Numbers): Adjust.
19345
37c82725
AD
193462001-12-10 Akim Demaille <akim@epita.fr>
19347
19348 * src/LR0.c (augment_automaton): Now that all states have shifts,
19349 merge the two cases addition shifts to the initial state.
19350
6a164e0c
AD
193512001-12-10 Akim Demaille <akim@epita.fr>
19352
19353 * src/lalr.c (set_state_table): Move to...
19354 * src/LR0.c: here.
19355 * src/lalr.c (lalr): Don't call it...
19356 * src/LR0.c (generate_states): do it.
19357 * src/LR0.h (first_state): Remove, only the table is used.
19358
7215de24
AD
193592001-12-10 Akim Demaille <akim@epita.fr>
19360
19361 * src/LR0.h (first_shift, first_reduction): Remove.
19362 * src/lalr.c: Don't use first_shift: find shifts through the
19363 states.
19364
80e25d4d
AD
193652001-12-10 Akim Demaille <akim@epita.fr>
19366
19367 * src/LR0.c: Attach shifts to states as soon as they are
19368 computed.
19369 * src/lalr.c (set_state_table): Instead of assigning shifts to
19370 state, just assert that the mapping was properly done.
19371
0ab3728b
AD
193722001-12-10 Akim Demaille <akim@epita.fr>
19373
19374 * src/LR0.c (insert_start_shift): Rename as...
19375 (insert_start_shifting_state): this.
19376 (insert_eof_shifting_state, insert_accepting_state): New.
19377 (augment_automaton): Adjust.
19378 Better locality of the variables.
19379 When looking if the start_symbol is shifted from the initial
19380 state, using `while (... symbol != start_symbol ...)' sounds
19381 better than `while (... symbol < start_symbol ...)': If fail
19382 to see how the order between symbols could be relevant!
19383
78af9bbc
AD
193842001-12-10 Akim Demaille <akim@epita.fr>
19385
19386 * src/getargs.h: Don't declare `spec_name_prefix' and
19387 `spec_file_prefix', declared by src/files.h.
19388 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
19389 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
19390 * src/output.c (prepare): Adjust.
19391 * src/reader.c (symbols_output): Likewise.
19392 * src/vmsgetargs.c: Vaguely adjust, but who cares?
19393
bdef2a41
AD
193942001-12-10 Akim Demaille <akim@epita.fr>
19395
19396 * src/muscle_tab.c (muscle_init): NULL is a better default than
19397 `"0"'.
19398
3735969c
AD
193992001-12-10 Akim Demaille <akim@epita.fr>
19400
19401 * src/reader.c (reader): Calling symbols_output once is enough.
19402
49701457
AD
194032001-12-10 Akim Demaille <akim@epita.fr>
19404
19405 Now that states have a complete set of members, the linked list of
19406 reductions is useless: just fill directly the state's reductions
19407 member.
19408
19409 * src/state.h (struct reductions): Remove member `number' and
19410 `next'.
19411 * src/LR0.c (first_reduction, last_reduction): Remove.
19412 (save_reductions): Don't link the new reductions, store them in
19413 this_state.
19414 * src/lalr.c (set_state_table): No need to attach reductions to
19415 states, it's already done.
19416 * src/output.c (output_actions): No longer free the shifts, then
19417 the reductions, then the states: free all the states and their
19418 members.
19419
0edad749
AD
194202001-12-10 Akim Demaille <akim@epita.fr>
19421
19422 * src/options.c (OPTN, DRTV, BOTH): New.
19423 (option_table): Use them.
19424
0edad749
AD
19425 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
19426 the job of system.h.
19427 * src/options.c: Don't include stdio.h and xalloc.h for the same
19428 reasons.
19429
5449dd0f
AD
194302001-12-10 Akim Demaille <akim@epita.fr>
19431
19432 * src/output.c (output, prepare): Make sure the values of the
19433 muscles `action' and `prologue' are 0-terminated.
19434
a870c567
AD
194352001-12-10 Akim Demaille <akim@epita.fr>
19436
19437 Clean up GCC warnings.
19438
19439 * src/reader.c (copy_action): `buf' is not used.
19440 (parse_skel_decl): Be static.
19441 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
19442 * src/options.h (create_long_option_table): Have a real prototype.
19443 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
19444 (hash_delete_at): Return const void *.
19445 Adjust casts to preserve the const.
19446
80df8768
AD
194472001-12-10 Akim Demaille <akim@epita.fr>
19448
19449 * configure.in: Require 2.52g.
19450 M4 is not needed, but AUTOM4TE is.
19451 * m4/m4.m4: Remove.
19452 * tests/Makefile.am: Adjust.
19453
f693ad14
AD
194542001-12-10 Akim Demaille <akim@epita.fr>
19455
19456 One structure for states is enough, even though theoretically
19457 there are LR(0) states and LALR(1) states.
19458
19459 * src/lalr.h (state_t): Remove.
19460 (state_table): Be state_t **, not state_t *.
19461 * src/state.h (core, CORE_ALLOC): Rename as...
19462 (state_t, STATE_ALLOC): this.
19463 Add the LALR(1) members: shifts, reductions, errs.
19464 * src/LR0.c (state_table): Rename as...
19465 (state_hash): this, to avoid name clashes with the global
19466 `state_table'.
19467 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
19468 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
19469
74ffbcb6
AD
194702001-12-10 Akim Demaille <akim@epita.fr>
19471
19472 Bison dumps core on bash.y.
19473 Reported by Pascal Bart.
19474
19475 * src/warshall.c (bitmatrix_print): New.
19476 (TC): Use it.
ba0fe3c7 19477 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
19478 j must be the outer loop.
19479 * tests/regression.at (Broken Closure): New.
19480
07708e19
AD
194812001-12-05 Akim Demaille <akim@epita.fr>
19482
19483 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
19484 its argument.
ba1ecc07 19485 Reported by Peter Hamorsky.
07708e19 19486
92b16366
AD
194872001-12-05 Akim Demaille <akim@epita.fr>
19488
19489 * src/conflicts.c (err_table): Remove.
19490 (resolve_sr_conflict): Adjust.
19491 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
19492 Rename as...
19493 (state_t.reductions, state_t.shifts): this.
19494
076ab033
AD
194952001-12-05 Akim Demaille <akim@epita.fr>
19496
19497 * src/reduce.c (reduce_grammar_tables): No longer disable the
19498 removal of useless rules via CPP but via `if (0)', so that the
19499 compiler still check the code is valid.
19500 For instance, it should have noticed `rline' no longer exists: use
19501 the `line' member of rule_t.
19502 * src/gram.c (dummy, rline): Remove, unused.
19503
3843c413
AD
195042001-12-05 Akim Demaille <akim@epita.fr>
19505
19506 * src/output.c (pack_vector): Use assert, not berror.
19507 * src/main.c (berror): Remove, unused.
19508
43168960
AD
195092001-12-05 Akim Demaille <akim@epita.fr>
19510
19511 New experimental feature: if --verbose --trace output all the
19512 items of a state, not only its kernel.
19513
19514 * src/print.c (print_core): If `trace_flag', then invoke closure
19515 before outputting the items of the state (print_core is no longer
19516 a correct name them).
19517 (print_results): Invoke new_closure/free_closure if needed.
19518
b2872512
AD
195192001-12-05 Akim Demaille <akim@epita.fr>
19520
19521 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
19522 * src/closure.c, src/closure.h (itemsetsize): Rename as...
19523 (nitemset): for consistency with the rest of the project.
19524
23cbcc6c
AD
195252001-12-05 Akim Demaille <akim@epita.fr>
19526
19527 * src/closure.c (print_closure): Improve.
19528 (closure): Use it for printing input and output.
19529
03ec521c
AD
195302001-12-05 Akim Demaille <akim@epita.fr>
19531
19532 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
19533 indexed by nonterminals.
19534
3a7456dd
AD
195352001-12-05 Akim Demaille <akim@epita.fr>
19536
19537 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
19538 what it was!).
19539 * src/warshall.h: Remove accidental duplication of the content.
19540
1cbcf2e7
AD
195412001-12-05 Akim Demaille <akim@epita.fr>
19542
19543 * src/closure.c (set_fderives): De-obfuscate.
19544
84182270
AD
195452001-12-05 Akim Demaille <akim@epita.fr>
19546
19547 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
19548
3f6f053c
AD
195492001-12-05 Akim Demaille <akim@epita.fr>
19550
19551 * src/closure.c (set_firsts): De-obfuscate.
19552
7a5350ba
AD
195532001-12-05 Akim Demaille <akim@epita.fr>
19554
19555 * src/output.c (action_row): De-obfuscate
19556 using the good o' techniques: arrays not pointers, variable
19557 locality, BITISSET, RESETBIT etc.
19558
d954473d
AD
195592001-12-05 Akim Demaille <akim@epita.fr>
19560
19561 Pessimize the code to simplify it: from now on, all the states
19562 have a valid SHIFTS, which NSHIFTS is possibly 0.
19563
19564 * src/LR0.c (shifts_new): Be global and move to..
19565 * src/state.c, src/state.h: here.
19566 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
19567 * src/print_graph: Adjust.
19568
9839bbe5
AD
195692001-12-05 Akim Demaille <akim@epita.fr>
19570
19571 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
19572 * src/conflicts.c: Use it.
19573 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
19574 incorrectly ``simplified''.
19575
9f136c07
AD
195762001-12-05 Akim Demaille <akim@epita.fr>
19577
19578 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
19579 using the good o' techniques: arrays not pointers, variable
19580 locality, BITISSET, RESETBIT etc.
19581
b608206e
AD
195822001-12-05 Akim Demaille <akim@epita.fr>
19583
19584 * src/state.h (SHIFT_SYMBOL): New.
19585 * src/conflicts.c: Use it to deobfuscate.
19586
52afa962
AD
195872001-12-05 Akim Demaille <akim@epita.fr>
19588
19589 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
19590 (print_reductions): De-obfuscate using the good o' techniques:
19591 arrays not pointers, variable locality, BITISSET.
19592
e74dc321
AD
195932001-12-05 Akim Demaille <akim@epita.fr>
19594
19595 * src/conflicts.c (print_reductions): Arrays, not pointers.
19596 Use BITISSET.
19597
768fca83
AD
195982001-12-05 Akim Demaille <akim@epita.fr>
19599
19600 * src/conflicts.c (print_reductions): Pessimize, but clarify.
19601
a17e599f
AD
196022001-12-05 Akim Demaille <akim@epita.fr>
19603
19604 * src/conflicts.c (print_reductions): Improve variable locality.
19605
a04bc341
AD
196062001-12-05 Akim Demaille <akim@epita.fr>
19607
19608 * src/conflicts.c (print_reductions): Pessimize, but clarify.
19609
c8ea038e
AD
196102001-12-05 Akim Demaille <akim@epita.fr>
19611
19612 * src/conflicts.c (print_reductions): Improve variable locality.
19613
aa2aab3c
AD
196142001-12-05 Akim Demaille <akim@epita.fr>
19615
19616 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
19617 * src/lalr.c: Use them.
19618
b178c8cc
AD
196192001-12-05 Akim Demaille <akim@epita.fr>
19620
19621 * src/LR0.c (augment_automaton): Formatting changes.
19622 Better variable locality.
19623
f67d13aa
AD
196242001-12-05 Akim Demaille <akim@epita.fr>
19625
19626 * src/lalr.c (matrix_print): New.
19627 (transpose): Use it.
19628 Use arrays instead of pointers.
19629
c2713865
AD
196302001-12-05 Akim Demaille <akim@epita.fr>
19631
19632 * src/lalr.c (maxrhs): Move to...
19633 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
19634 * src/lalr.c (build_relations): Adjust.
19635
9887c18a
AD
196362001-12-05 Akim Demaille <akim@epita.fr>
19637
19638 * src/lalr.c (transpose): Free the memory allocated to the
19639 argument, as it is replaced by the results by the unique caller.
19640 (build_relations): Merely invoke transpose: it handles the memory
19641 deallocation.
19642 Improve variable locality.
19643 Avoid variables used as mere abbreviations.
19644 (compute_lookaheads): Use arrays instead of pointers.
19645
4d4f699c
AD
196462001-12-05 Akim Demaille <akim@epita.fr>
19647
19648 * src/lalr.c (initialize_F): Improve variable locality.
19649 Avoid variables used as mere abbreviations.
19650
80a69750
AD
196512001-12-05 Akim Demaille <akim@epita.fr>
19652
19653 * src/derives.c (print_derives): Display the ruleno.
19654 * src/lalr.c (initialize_F, transpose): Better variable locality
19655 to improve readability.
19656 Avoid variables used as mere abbreviations.
19657
fe961097
AD
196582001-12-05 Akim Demaille <akim@epita.fr>
19659
19660 * src/lalr.c (traverse): Use arrays instead of pointers.
19661
e3e4e814
AD
196622001-12-05 Akim Demaille <akim@epita.fr>
19663
19664 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
19665 the handling of squeue.
19666 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
19667
630e182b
AD
196682001-12-05 Akim Demaille <akim@epita.fr>
19669
19670 Because useless nonterminals are now kept alive (instead of being
19671 `destroyed'), we now sometimes examine them, and store information
19672 related to them. Hence we need to know their number, and adjust
19673 memory allocations.
19674
19675 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
19676 static.
19677 * src/LR0.c (allocate_itemsets): The memory allocated to
19678 `symbol_count' was used for two different purpose: once to count
19679 the number of occurrences of each symbol, and later reassigned to
19680 `shift_symbol', containing the symbol that can be shifted from a
19681 given state.
19682 Deobfuscate, i.e., allocate, use and free `symbol_count' here
19683 only, and...
19684 (new_itemsets): Allocate `shift_symbol' here.
19685 (allocate_itemsets): symbol_count includes useless nonterminals.
19686 Make room for them.
19687 (free_storage): Use `free', not `XFREE', for pointers that cannot
19688 be null.
19689
81b51460
AD
196902001-12-05 Akim Demaille <akim@epita.fr>
19691
19692 * src/nullable.c (set_nullable): Deobfuscate the handling of
19693 ritem.
19694 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
19695
3067fbef
AD
196962001-12-05 Akim Demaille <akim@epita.fr>
19697
19698 * src/gram.c, src/gram.h (ritem_print): New.
19699 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
19700 (This useless function was defined only to work around VMS linkers
19701 that can't handle compilation units with variables only).
19702 * src/reduce.c (dump_grammar): Use it to trace the construction of
19703 ritem.
19704
c2bea5f9
PE
197052001-12-04 Paul Eggert <eggert@twinsun.com>
19706
7d27c823
PE
19707 * src/bison.simple (union yyalloc): Change member names
19708 to be the same as the stack names.
19709 (yyparse): yyptr is now union yyalloc *, not char *.
19710 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
19711 and may generate better code on some machines.
c2bea5f9
PE
19712 (yystpcpy): Use prototype if __STDC__ is defined, not just
19713 if __cplusplus is defined.
35687a9d 19714
2c8a9dfa
AD
197152001-11-30 Akim Demaille <akim@epita.fr>
19716
19717 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
19718 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
19719 Gettext doesn't compile cleanly, and dies with -Werror.
19720 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
19721 Include WARNING_CFLAGS here.
19722 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
19723 before being defined.
19724
f4e421e6
AD
197252001-11-27 Paul Eggert <eggert@twinsun.com>
19726
19727 * lib/quotearg.h (quotearg_n, quotearg_n_style):
19728 First arg is int, not unsigned.
19729 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
19730 (SIZE_MAX, UINT_MAX): New macros.
19731 (quotearg_n_options): Abort if N is negative.
19732 Avoid overflow check on hosts where size_t is 64 bits and int
19733 is 32 bits, as overflow is impossible there.
19734 Fix off-by-one typo that caused unnecessary reallocation.
19735
7093d0f5
AD
197362001-11-29 Paul Eggert <eggert@twinsun.com>
19737
19738 Name space cleanup in generated parser.
19739
19740 * doc/bison.texinfo (Bison Parser): Discuss system headers
19741 and their effect on the user name space.
19742
19743 * src/bison.simple:
19744 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
19745 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
19746 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
19747
19748 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
19749 on user names when possible.
19750
19751 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
19752 Simplify test for whather <alloca.h> exists.
19753
19754 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
19755
19756 (<stdio.h>): Include if YYDEBUG.
19757
19758 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
19759 ! defined (yyoverflow) && ! defined (yymemcpy).
19760
19761 (yymemcpy, yyparse): Rename local variables as needed so that
19762 they all begin with 'yy'.
19763
19764 (yystrlen, yystpcpy): New functions.
19765
19766 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
19767 All uses changed.
19768
19769 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
19770 instead of relying on string.h functions. Use YYSTACK_ALLOC
19771 and YYSTACK_FREE instead of malloc and free.
19772
fd51e5ff
AD
197732001-11-30 Akim Demaille <akim@epita.fr>
19774
19775 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
19776 before their first uses.
19777 (YYBISON, YYPURE): Move to the top of the output.
19778
7d13ff5f
AD
197792001-11-30 Akim Demaille <akim@epita.fr>
19780
19781 * tests/reduce.at (Useless Nonterminals): Fix.
19782
892a3995
AD
197832001-11-30 Akim Demaille <akim@epita.fr>
19784
19785 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
19786 if body instead of `;' to pacify GCC's warnings.
19787
68f1e3ed
AD
197882001-11-30 Akim Demaille <akim@epita.fr>
19789
19790 Instead of mapping the LHS of unused rules to -1, keep the LHS
19791 valid, but flag the rules as invalid.
19792
19793 * src/gram.h (rule_t): `useful' is a new member.
19794 * src/print.c (print_grammar): Adjust.
19795 * src/derives.c (set_derives): Likewise.
19796 * src/reader.c (packgram, reduce_output): Likewise.
19797 * src/reduce.c (reduce_grammar_tables): Likewise.
19798 * tests/reduce.at (Underivable Rules, Useless Rules): New.
19799
d2d1b42b
AD
198002001-11-30 Akim Demaille <akim@epita.fr>
19801
19802 * src/reduce.c (reduce_output): Formatting changes.
19803 * src/print.c (print_results, print_grammar): Likewise.
19804 * tests/regression.at (Rule Line Numbers)
19805 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
19806
760b53a8
AD
198072001-11-30 Akim Demaille <akim@epita.fr>
19808
19809 * src/reduce.c (nonterminals_reduce): Instead of throwing away
19810 useless nonterminals, move them at the end of the symbol arrays.
19811 (reduce_output): Adjust.
19812 * tests/reduce.at (Useless Nonterminals): Adjust.
19813
00238958
AD
198142001-11-30 Akim Demaille <akim@epita.fr>
19815
19816 * src/reduce.c: Various comment/formatting changes.
19817 (nonterminals_reduce): New, extracted from...
19818 (reduce_grammar_tables): here.
19819 (reduce_grammar): Call nonterminals_reduce.
19820
396452de
PE
198212001-11-29 Paul Eggert <eggert@twinsun.com>
19822
19823 * src/bison.simple (YYSTACK_REALLOC): Remove.
19824 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
19825 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
19826 New macros.
19827 (union yyalloc): New type.
19828 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
19829 an arbitrary restriction on hosts where size_t is wider than int.
19830
19831 (yyparse): Don't dump core if alloca or malloc fails; instead, report
19832 a parser stack overflow. Allocate just one block of memory for all
19833 three stacks, instead of allocating three blocks; this typically is
19834 faster and reduces fragmentation.
19835
19836 Do not limit the number of items in the stack to a value that fits
19837 in 'int', as this is an arbitrary limit on hosts with 64-bit
19838 size_t and 32-bit int.
19839
147e184c
MA
198402001-11-29 Marc Autret <autret_m@epita.fr>
19841
19842 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
19843 of defining YYERROR_VERBOSE.
19844 [AT_DATA]: $4 is now out of C declarations in the prologue.
19845
426cf563
MA
198462001-11-28 Marc Autret <autret_m@epita.fr>
19847
19848 * src/reader.c (parse_dquoted_param): New.
19849 (parse_skel_decl): Use it.
19850 * src/lex.h: Add its prototype.
19851 * src/lex.c (literalchar): Become not static.
19852
c7925b99
MA
198532001-11-28 Marc Autret <autret_m@epita.fr>
19854
19855 * src/output.h: And put its extern declaration here.
19856 * src/output.c (error_verbose): Define here.
19857 (prepare): Echo name modification.
19858 * src/getargs.h: Clean its extern declaration.
19859 * src/getargs.c (error_verbose_flag): Remove.
19860 (getargs): Remove case 'e'.
19861 * src/options.c (option_table): 'error-verbose' is now seen as simple
19862 percent option.
19863 Include output.h.
19864
19865 * src/reader.c (read_declarations): Remove case tok_include.
19866 (parse_include_decl): Remove.
19867 * src/lex.h (token_t): Remove tok_include.
19868 * src/options.c (option_table): 'include' is now a simple command line
19869 option.
19870
5b5d1929
MA
198712001-11-28 Marc Autret <autret_m@epita.fr>
19872
19873 * src/bison.simple: Adjust muscle names.
19874 * src/muscle_tab.c (muscle_init): Also rename the muscles.
19875 * src/output.c (prepare): s/_/-/ for the muscles names.
19876 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
19877
8850be4b
MA
198782001-11-28 Marc Autret <autret_m@epita.fr>
19879
19880 * src/bison.simple: Fix debug.
19881 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
19882
4a38e613
AD
198832001-11-28 Akim Demaille <akim@epita.fr>
19884
19885 * src/LR0.c (shifts_new): New.
19886 (save_shifts, insert_start_shift, augment_automaton): Use it.
19887
4b35e1c1
AD
198882001-11-28 Akim Demaille <akim@epita.fr>
19889
19890 * src/closure.c (closure): `b' and `ruleno' denote the same value:
19891 keep ruleno only.
19892
d2b04478
AD
198932001-11-28 Akim Demaille <akim@epita.fr>
19894
19895 * src/closure.c (closure): Instead of looping over word in array
19896 then bits in words, loop over bits in array.
19897
2c4c30aa
AD
198982001-11-28 Akim Demaille <akim@epita.fr>
19899
19900 * src/closure.c (closure): No longer optimize the special case
19901 where all the bits of `ruleset[r]' are set to 0, to make the code
19902 clearer.
19903
576890b7
AD
199042001-11-28 Akim Demaille <akim@epita.fr>
19905
19906 * src/closure.c (closure): `r' and `c' are new variables, used to
19907 de-obfuscate accesses to RULESET and CORE.
19908
cb487d7d
AD
199092001-11-28 Akim Demaille <akim@epita.fr>
19910
19911 * src/reduce.c (reduce_print): Use ngettext.
19912 (dump_grammar): Improve the trace accuracy.
19913
6013d43f
AD
199142001-11-28 Akim Demaille <akim@epita.fr>
19915
19916 * src/reduce.c (dump_grammar): Don't translate trace messages.
19917
cb4956ee
AD
199182001-11-28 Akim Demaille <akim@epita.fr>
19919
19920 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
19921 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
19922 as all tags are free'ed afterwards.
19923 From Enrico Scholz.
19924
648185ab
PE
199252001-11-27 Paul Eggert <eggert@twinsun.com>
19926
19927 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
19928 use alloca when we didn't want to, and vice versa.
19929
68254a03
MA
199302001-11-27 Marc Autret <autret_m@epita.fr>
19931
9113b58f
AD
19932 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
19933 initialization.
68254a03
MA
19934 * src/output.c (prepare): Remove its update.
19935
04d843a2
MA
199362001-11-27 Marc Autret <autret_m@epita.fr>
19937
19938 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
19939 Use %error-verbose.
19940
d2079671 199412001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
19942
19943 * src/bison.simple: Remove YYERROR_VERBOSE using.
19944 Use %%error_verbose.
19945 (yyparse): Likewise.
19946 * src/output.c (prepare): Give its final value.
19947 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
19948 * src/getargs.h: Add its extern declaration.
19949 * src/getargs.c (error_verbose_flag): New int.
19950 (getargs): Update to catch new case.
19951 * src/options.c (option_table): 'error-verbose' is a new option.
19952 (shortopts): Update.
19953
e0327bc8
AD
199542001-11-27 Akim Demaille <akim@epita.fr>
19955
19956 * src/system.h: Use intl/libgettext.h.
19957 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
19958
000f1a3c
AD
199592001-11-27 Akim Demaille <akim@epita.fr>
19960
19961 * tests/torture.at (Exploding the Stack Size with Malloc):
19962 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
19963
26cfe0be
AD
199642001-11-27 Akim Demaille <akim@epita.fr>
19965
19966 * src/files.c: Include error.h.
19967 Reported by Hans Aberg.
19968
f6bd5427
MA
199692001-11-26 Marc Autret <autret_m@epita.fr>
19970
d2079671 19971 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
19972 (read_declarations): Add case tok_include.
19973 * src/getargs.h (include): Add its extern definition.
19974 * src/getargs.c (include): New const char *.
19975 (getargs): Add case '-I'.
19976 * src/options.c (option_table): Add include as command line and
19977 percent option.
19978 * src/lex.h (token_t): Add tok_include.
19979
2ca209c1
AD
199802001-11-26 Akim Demaille <akim@epita.fr>
19981
19982 * src/reader.c (readgram): Make sure rules for mid-rule actions
19983 have a lineno equal to that of their host rule.
19984 Reported by Hans Aberg.
19985 * tests/regression.at (Rule Line Numbers): New.
19986
0e41b407
AD
199872001-11-26 Akim Demaille <akim@epita.fr>
19988
19989 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
19990 size_ts.
19991
199922001-11-26 Akim Demaille <akim@epita.fr>
19993
19994 * src/complain.c, src/complain.h (error): Remove, provided by
19995 lib/error.[ch].
19996
e0c40012
AD
199972001-11-26 Akim Demaille <akim@epita.fr>
19998
19999 * src/reader.c (read_declarations): Don't abort on tok_illegal,
20000 issue an error message.
20001 * tests/regression.at (Invalid %directive): New.
20002 Reported by Hans Aberg.
20003
5e147124
AD
200042001-11-26 Akim Demaille <akim@epita.fr>
20005
20006 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
20007 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
20008
a034c8b8
AD
200092001-11-26 Akim Demaille <akim@epita.fr>
20010
20011 * src/conflicts.c (conflicts_print): Don't complain at all when
20012 there are no reduce/reduce conflicts, and as many shift/reduce
20013 conflicts as expected.
20014 * tests/regression.at (%expect right): Adjust.
20015
c64a20f3
AD
200162001-11-23 Akim Demaille <akim@epita.fr>
20017
20018 * lib/alloca.c: Update, from fileutils.
20019
5b0d29bb
AD
200202001-11-23 Akim Demaille <akim@epita.fr>
20021
20022 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
20023
722c4bfe
AD
200242001-11-23 Akim Demaille <akim@epita.fr>
20025
20026 * src/system.h: Include alloca.h.
20027 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
20028
6255b435
AD
200292001-11-23 Akim Demaille <akim@epita.fr>
20030
20031 * src/print_graph.c (print_actions): Remove `rule', unused.
20032 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
20033 pacify GCC's signed < unsigned warnings.
20034 * src/closure.c (itemsetsize): Likewise.
20035 * src/reader.c (symbol_list_new): Static.
20036
b29b2ed5
AD
200372001-11-23 Akim Demaille <akim@epita.fr>
20038
20039 Attaching lineno to buckets is stupid, since only one copy of each
20040 symbol is kept, only the line of the first occurrence is kept too.
20041
20042 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
20043 * src/reader.c (rline_allocated): Remove, unused.
20044 (symbol_list): Have a `line' member.
20045 (symbol_list_new): New.
20046 (readgram): Use it.
20047 * src/print.c (print_grammar): Output the rule line numbers.
20048 * tests/regression.at (Solved SR Conflicts)
20049 (Unresolved SR Conflicts): Adjust.
20050 Reported by Hans Aberg.
20051
a81b1d4a
MA
200522001-11-22 Marc Autret <autret_m@epita.fr>
20053
20054 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
20055
c1ecb3c1
MA
200562001-11-22 Marc Autret <autret_m@epita.fr>
20057
20058 * src/muscle_tab.c (muscle_init): Remove initialization of
20059 skeleton muscle.
20060 * src/output.c (output_master_parser): Do it here.
20061
fbe01355
AD
200622001-11-20 Akim Demaille <akim@epita.fr>
20063
20064 * po/sv.po: New.
20065 * configure.in (ALL_LINGUAS): Adjust.
20066 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
20067 longer contains strings to translate.
20068
81e895c0
AD
200692001-11-19 Akim Demaille <akim@epita.fr>
20070
20071 * src/conflicts.c (conflicts_print): Add a missing \n.
20072
6bb1878b
AD
200732001-11-19 Akim Demaille <akim@epita.fr>
20074
20075 * src/nullable.c (nullable_print): New.
20076 (set_nullable): Call it when tracing.
20077 Better locality of variables.
20078
d9ec2d07
AD
200792001-11-19 Akim Demaille <akim@epita.fr>
20080
20081 * src/print.c (print_actions): Better locality of variables.
20082
720e5c1b
AD
200832001-11-19 Akim Demaille <akim@epita.fr>
20084
20085 * src/derives.c (print_derives): Fix and enrich.
20086 * src/closure.c (print_fderives): Likewise.
20087
fb908786
AD
200882001-11-19 Akim Demaille <akim@epita.fr>
20089
20090 * src/closure.c (itemsetend): Remove, replaced with...
20091 (itemsetsize): new.
20092
125ecb56
AD
200932001-11-19 Akim Demaille <akim@epita.fr>
20094
20095 * src/LR0.c (kernel_end): Remove, replaced with...
20096 (kernel_size): new.
20097
d8cf039f
AD
200982001-11-19 Akim Demaille <akim@epita.fr>
20099
20100 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
20101 to clarify.
20102
7bec0760
AD
201032001-11-19 Akim Demaille <akim@epita.fr>
20104
20105 * src/closure.c (closure): Use arrays instead of pointers to clarify.
20106
c87d4863
AD
201072001-11-19 Akim Demaille <akim@epita.fr>
20108
20109 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
20110 trace messages.
20111 * src/LR0.c: Likewise.
20112 (allocate_itemsets): Use arrays instead of pointers to clarify.
20113
9bfe901c
AD
201142001-11-19 Akim Demaille <akim@epita.fr>
20115
20116 * src/getargs.c (statistics_flag): Replace with...
20117 (trace_flag): New.
20118 (longopts): Accept --trace instead of --statistics.
20119 * src/getargs.h, src/options.c: Adjust.
20120 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
20121 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
20122
97db7bd4
AD
201232001-11-19 Akim Demaille <akim@epita.fr>
20124
cc72668c 20125 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
20126 pointers to clarify the code.
20127 (save_reductions, save_shifts): Factor common parts of alternatives.
20128
2c5f66ed
AD
201292001-11-19 Akim Demaille <akim@epita.fr>
20130
20131 * src/LR0.c (new_state, get_state): Complete TRACE code.
20132 * src/closure.c: Include `reader.h' to get `tags', needed by the
20133 trace code.
20134 Rename the conditional DEBUG as TRACE.
20135 Output consistently TRACEs to stderr, not stdout.
20136 * src/derives.c: Likewise.
20137 * src/reduce.c: (inaccessable_symbols): Using if is better style
20138 than goto.
20139 Use `#if TRACE' instead of `#if 0' for tracing code.
20140
300f275f
AD
201412001-11-19 Akim Demaille <akim@epita.fr>
20142
20143 * src/system.h (LIST_FREE, shortcpy): New.
20144 * src/LR0.c: Use them.
20145 * src/output.c (free_itemsets, free_reductions, free_shifts):
20146 Remove, replaced by LIST_FREE.
20147
f59c437a
AD
201482001-11-19 Akim Demaille <akim@epita.fr>
20149
20150 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
20151 (REDUCTIONS_ALLOC): New.
20152 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
20153 allocation.
20154
6986fd9e
AD
201552001-11-19 Akim Demaille <akim@epita.fr>
20156
20157 * src/LR0.c (new_state): Complete trace code.
20158 * src/nullable.c (set_nullable): Don't translate traces.
20159
4bc30f78
AD
201602001-11-19 Akim Demaille <akim@epita.fr>
20161
20162 * src/print_graph.c (print_core): Better locality of variables.
20163 * src/print.c (print_core): Likewise.
20164
08a946e0
AD
201652001-11-19 Akim Demaille <akim@epita.fr>
20166
20167 * src/vcg.c: You do the output, so you are responsible of the
20168 handling of VCG syntax, in particular: use quotearg.
20169 * src/print_graph.c: Don't.
20170 (print_actions): Don't output the actions as part of the nodes,
20171 since that's the job of the edges.
20172 (print_state): Don't output by hand: fill the node description,
9bfe901c 20173 and ask for its output.
08a946e0 20174
f0473484
AD
201752001-11-19 Akim Demaille <akim@epita.fr>
20176
cc72668c
AD
20177 * src/bison.simple (yyparse): When verbosely reporting an error,
20178 no longer put additional quotes around token names.
f0473484
AD
20179 * tests/calc.at: Adjust.
20180
e41dc700
AD
201812001-11-19 Akim Demaille <akim@epita.fr>
20182
20183 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
20184 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
20185 * src/output.c: Adjust.
20186
652a871c
AD
201872001-11-19 Akim Demaille <akim@epita.fr>
20188
20189 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
20190 (rule_t): this.
20191 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
20192
b2ed6e58
AD
201932001-11-19 Akim Demaille <akim@epita.fr>
20194
20195 * src/gram.h (rule_t): New.
20196 (rule_table): New.
20197 (rrhs, rlhs): Remove, part of state_t.
20198 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
20199 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
20200 * src/reader.c, src/reduce.c: Adjust.
20201
edad7067
AD
202022001-11-19 Akim Demaille <akim@epita.fr>
20203
20204 * src/reader.c (symbols_output): New, extracted from...
20205 (packsymbols): Here.
20206 (reader): Call it.
20207
3feec034
AD
202082001-11-19 Akim Demaille <akim@epita.fr>
20209
20210 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
20211 (maxrhs): this new function.
20212
ddcd5fdf
AD
202132001-11-19 Akim Demaille <akim@epita.fr>
20214
cc72668c 20215 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
20216 Adjust.
20217
bb527fc2
AD
202182001-11-19 Akim Demaille <akim@epita.fr>
20219
cc72668c 20220 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
20221 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20222 * src/lalr.c: Adjust.
20223
a845a697
AD
202242001-11-19 Akim Demaille <akim@epita.fr>
20225
20226 * src/lalr.c (initialize_LA): Only initialize LA. Let...
20227 (set_state_table): handle the `lookaheads' members.
20228
f004bf6a
AD
202292001-11-19 Akim Demaille <akim@epita.fr>
20230
cc72668c
AD
20231 * src/lalr.h (lookaheads): Removed array, whose contents is now
20232 a member of...
f004bf6a
AD
20233 (state_t): this structure.
20234 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20235 Adjust.
20236
de326cc0
AD
202372001-11-19 Akim Demaille <akim@epita.fr>
20238
cc72668c
AD
20239 * src/lalr.h (consistent): Removed array, whose contents is now
20240 a member of...
de326cc0
AD
20241 (state_t): this structure.
20242 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20243 Adjust.
20244
90b4416b
AD
202452001-11-19 Akim Demaille <akim@epita.fr>
20246
cc72668c
AD
20247 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
20248 contents are now members of...
90b4416b
AD
20249 (state_t): this structure.
20250 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20251 Adjust.
20252
9703cc49
AD
202532001-11-19 Akim Demaille <akim@epita.fr>
20254
20255 * src/lalr.h (state_t): New.
20256 (state_table): Be a state_t * instead of a core **.
20257 (accessing_symbol): Remove, part of state_t.
20258 * src/lalr.c: Adjust.
20259 (set_accessing_symbol): Merge into...
20260 (set_state_table): this.
20261 * src/print_graph.c, src/conflicts.c: Adjust.
20262
d803322e
AD
202632001-11-14 Akim Demaille <akim@epita.fr>
20264
20265 * tests/calc.at, tests/output.at, tests/regression.at,
20266 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
20267 now the tests are run in private dirs, therefore AC_CLEANUP and
20268 family can be simplified to 0-ary.
20269 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
20270 use abs. path to find config.h.
20271 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
20272 stderr, there can be way too much random noise.
20273 Instead pass -Werror to GCC and rely on the exit status.
20274 Reported by Wolfram Wagner.
20275
3d76b07d
AD
202762001-11-14 Akim Demaille <akim@epita.fr>
20277
20278 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
20279 defined only if yyoverflow is defined, to avoid `warning: unused
20280 variable `yyvs1''.
20281 Reported by The Test Suite.
20282
09b503c8
AD
202832001-11-14 Akim Demaille <akim@epita.fr>
20284
20285 * src/print.c: Include reduce.h.
20286 Reported by Hans Aberg.
20287
202882001-11-14 Akim Demaille <akim@epita.fr>
20289
20290 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
20291 Revert a previous patch: these are really const.
20292 * src/conflicts.c (conflict_report): Additional useless pair of
20293 braces to pacify GCC's warnings for `if () if () {} else {}'.
20294 * src/lex.c (parse_percent_token): Replace equal_offset with
20295 arg_offset.
20296 arg is const.
20297 Be sure to strdup `arg' when used, since there is no reason for
20298 token_buffer not to change.
20299
0f37a994
AD
203002001-11-14 Akim Demaille <akim@epita.fr>
20301
20302 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
20303 definition.
20304 * src/main.c (main): Use them.
20305 Suggested by Hans Aberg.
20306
d39d93b8
AD
203072001-11-12 Akim Demaille <akim@epita.fr>
20308
20309 * src/system.h (ngettext): Now that we use ngettext, be sure to
20310 provide a default definition when NLS are not used.
20311
9edcd895
AD
203122001-11-12 Akim Demaille <akim@epita.fr>
20313
20314 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
20315 Use @kbd to denote user input.
20316 (Language and Grammar): ANSIfy the example.
20317 Adjust its layout for info/notinfo.
20318 (Location Tracking Calc): Output error messages to stderr.
20319 Output locations in a more GNUtically correct way.
20320 Fix a couple of Englishos.
20321 Adjust @group/@end group pairs.
20322
7da99ede
AD
203232001-11-12 Akim Demaille <akim@epita.fr>
20324
e3aa65c5 20325 %expect was not functioning at all.
7da99ede
AD
20326
20327 * src/conflicts.c (expected_conflicts): Set to -1.
20328 (conflict_report): Use ngettext.
20329 (conflicts_print): Check %expect and make its violation an error.
20330 * doc/bison.texinfo (Expect Decl): Adjust.
20331 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
20332 * tests/regression.at (%expect not enough, %expect right)
20333 (%expect too much): New.
20334
ba9dda1a
AD
203352001-11-12 Akim Demaille <akim@epita.fr>
20336
20337 * tests/regression.at (Conflicts): Rename as...
20338 (Unresolved SR Conflicts): this.
20339 (Solved SR Conflicts): New.
20340
337c5bd1
AD
203412001-11-12 Akim Demaille <akim@epita.fr>
20342
20343 * src/reduce.c (print_results): Rename as...
20344 (reduce_output): This.
20345 Output to OUT, passed as argument, instead of output_obstack.
20346 (dump_grammar): Likewise.
20347 (reduce_free): New.
20348 Also free V1.
20349 (reduce_grammar): No longer call reduce_output, since...
20350 * src/print.c (print_results): do it.
20351 * src/main.c (main): Call reduce_free;
20352
c73a41af
AD
203532001-11-12 Akim Demaille <akim@epita.fr>
20354
20355 * src/conflicts.c (print_reductions): Accept OUT as argument.
20356 Output to it, not to output_obstack.
20357 * src/print.c (print_actions): Adjust.
20358
0df87bb6
AD
203592001-11-12 Akim Demaille <akim@epita.fr>
20360
20361 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
20362 the result instead of using...
20363 (src_total, rrc_total, src_count, rrc_count): Remove.
20364 (any_conflicts): Remove.
20365 (print_conflicts): Split into...
20366 (conflicts_print, conflicts_output): New.
20367 * src/conflicts.h: Adjust.
20368 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 20369 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
20370 * tests/regression.at (Conflicts): New.
20371 Reported by Tom Lane.
20372
e4d3d4de
AD
203732001-11-12 Akim Demaille <akim@epita.fr>
20374
20375 * tests/regression.at (Invalid input): Remove, duplicate with
20376 ``Invalid input: 1''.
20377
6d7d248e
AD
203782001-11-12 Akim Demaille <akim@epita.fr>
20379
20380 * tests/torture.at (AT_DATA_STACK_TORTURE)
20381 (Exploding the Stack Size with Alloca)
20382 (Exploding the Stack Size with Malloc): New.
20383
e9e4c321
AD
203842001-11-12 Akim Demaille <akim@epita.fr>
20385
20386 * src/bison.simple (YYSTACK_REALLOC): New.
20387 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 20388 Reported by Per Allansson.
e9e4c321 20389
5f7e0832
AD
203902001-11-12 Pascal Bart <pascal.bart@epita.fr>
20391
20392 * src/bison.simple: Define type yystype instead of YYSTYPE, and
20393 define CPP macro, which substitute YYSTYPE by yystype.
20394 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
20395 with yyltype/YYLTYPE. This allows inclusion of the generated
20396 header within the parser if the compiler, such as GGC, accepts
20397 multiple equivalent #defines.
20398 From Akim.
20399
e3f1699f
AD
204002001-11-05 Akim Demaille <akim@epita.fr>
20401
20402 * src/reader.c (symbols_output): New, extracted from...
20403 (packsymbols): here.
20404 (reader): Adjust.
20405
65be0866
AD
204062001-11-05 Akim Demaille <akim@epita.fr>
20407
20408 * src/lex.c (parse_percent_token): s/quotearg/quote/.
20409
e4d910bf
AD
204102001-11-05 Akim Demaille <akim@epita.fr>
20411
20412 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
20413 pattern.
20414
951366c1
AD
204152001-11-05 Akim Demaille <akim@epita.fr>
20416
20417 * src/options.h (struct option_table_struct): set_flags is void*.
20418 * src/options.c (longopts): Support `--output' and `%output'.
20419 (usage): Adjust.
20420 * src/lex.h (tok_setopt): Remove, replaced with...
20421 (tok_intopt, tok_stropt): these new guys.
20422 * src/lex.c (getopt.h): Not needed.
20423 (token_buffer, unlexed_token_buffer): Not const.
20424 (percent_table): Promote `-' over `_' in directive names.
20425 Active `%name-prefix', `file-prefix', and `output'.
20426 (parse_percent_token): Accept possible arguments to directives.
20427 Promote `-' over `_' in directive names.
20428
d8988b2f
AD
204292001-11-04 Akim Demaille <akim@epita.fr>
20430
20431 * doc/bison.texinfo (Decl Summary): Split the list into
20432 `directives for grammars' and `directives for bison'.
20433 Sort'em.
20434 Add description of `%name-prefix', `file-prefix', and `output'.
20435 Promote `-' over `_' in directive names.
20436 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
20437 Simplify the description of `--name-prefix'.
20438 Promote `-' over `_' in directive names.
20439 Promote `--output' over `--output-file'.
20440 Fix the description of `--defines'.
20441 * tests/output.at: Exercise %file-prefix and %output.
20442
6468d18e
AD
204432001-11-02 Akim Demaille <akim@epita.fr>
20444
20445 * doc/refcard.tex: Update.
20446
6b7e85b9
AD
204472001-11-02 Akim Demaille <akim@epita.fr>
20448
20449 * src/symtab.h (SUNDEF): New.
20450 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
20451 stand for `uninitialized', instead of 0.
20452 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
20453 * src/lex.c (lex): Adjust.
20454
20455 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
20456 Number it 0.
20457 Let yylex return it instead of a plain 0.
20458 Reported by Dick Streefland.
20459
cd5aafcf
AD
204602001-11-02 Akim Demaille <akim@epita.fr>
20461
20462 * tests/regression.at (Mixing %token styles): New test.
20463
037ca2f1
AD
204642001-11-02 Akim Demaille <akim@epita.fr>
20465
20466 * src/reader.c (parse_thong_decl): Formatting changes.
20467 (token_translations_init): New, extracted from...
20468 (packsymbols): Here.
20469 Adjust.
20470
270a173c
AD
204712001-11-01 Akim Demaille <akim@epita.fr>
20472
20473 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
20474 Check that `9foo.y' produces correct cpp guards.
20475 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
20476 guards.
20477 Reported by Wwp.
20478
561f9a30
AD
204792001-11-01 Akim Demaille <akim@epita.fr>
20480
20481 * tests/regression.at (Invalid input: 2): New.
20482 * src/lex.c (unlexed_token_buffer): New.
20483 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
20484 too.
20485 Reported by Wwp.
20486
f987e9d2
AD
204872001-11-01 Akim Demaille <akim@epita.fr>
20488
20489 * tests/calc.at: Catch up with 1.30.
20490 * configure.in: Bump to 1.49a.
20491 Adjust to newer Autotest.
20492
0846f581
PB
204932001-10-19 Pascal Bart <pascal.bart@epita.fr>
20494
20495 * src/conflicts.c: Move global variables rrc_total and src_total ...
20496 (print_conflicts): here.
20497 * src/output.c (output): Free global variable user_toknums.
20498 * src/lex.c (token_obstack): Become static.
20499
3c1a79b3
AD
205002001-10-18 Akim Demaille <akim@epita.fr>
20501
20502 * tests/atlocal.in (GCC): Add.
20503 * tests/calc.at: s/m4_match/m4_bmatch/.
20504 s/m4_patsubst/m4_bpatsubst/.
20505 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
20506 * configure.in: AC_SUBST(GCC).
20507
5d52e7d0
MA
205082001-10-14 Marc Autret <autret_m@epita.fr>
20509
20510 * src/options.c (create_long_option_table): Fix.
20511
631aa1d3
AD
205122001-10-10 Akim Demaille <akim@epita.fr>
20513
20514 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
20515
f6ec6d13
AD
205162001-10-04 Akim Demaille <akim@epita.fr>
20517
20518 * src/reader.c (parse_union_decl): Push the caracters in
20519 union_obstack, not attrs_obstack.
20520
342b8b6e
AD
205212001-10-04 Akim Demaille <akim@epita.fr>
20522
20523 Merge in the branch 1.29.
20524
20525 * src/reader.c (packsymbols): Use a temporary obstack for
20526 `%%tokendef', since output_stack is already used elsewhere.
20527
20528 2001-10-02 Akim Demaille <akim@epita.fr>
20529
20530 Bump 1.29d.
20531
20532 2001-10-02 Akim Demaille <akim@epita.fr>
20533
20534 Version 1.29c.
20535
20536 2001-10-02 Akim Demaille <akim@epita.fr>
20537
20538 * tests/regression.at (Invalid CPP headers): New.
20539 From Alexander Belopolsky.
20540 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
20541
20542 2001-10-02 Akim Demaille <akim@epita.fr>
20543
20544 * tests/regression.at (Invalid input): New.
20545 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
20546 Reported by Shura.
20547
20548 2001-10-02 Akim Demaille <akim@epita.fr>
20549
20550 * tests/calc.at: Now that --debug works, the tests must be adjusted.
20551
20552 2001-10-02 Akim Demaille <akim@epita.fr>
20553
20554 * src/output.c (output_parser): Assert `skeleton'.
20555 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
20556 systems.
20557 From Shura.
20558
20559 2001-10-01 Marc Autret <autret_m@epita.fr>
20560
20561 * src/lex.h: Echo modifications.
20562 * src/lex.c (unlex): Parameter is now token_t.
20563 From Hans Aberg.
20564
20565 2001-10-01 Marc Autret <autret_m@epita.fr>
20566
20567 * src/main.c: Include lex.h.
20568 From Hans Aberg.
20569
20570 2001-09-29 Akim Demaille <akim@epita.fr>
20571
20572 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
20573
20574 2001-09-28 Akim Demaille <akim@epita.fr>
20575
20576 * tests/testsuite.at: Update to newer Autotest.
20577 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
20578
20579 2001-09-27 Akim Demaille <akim@epita.fr>
20580
20581 Position independent wrapper.
20582
20583 * tests/bison: Remove.
20584 * tests/bison.in: New.
20585 * configure.in: Adjust.
20586
20587 2001-09-27 Paul Eggert <eggert@twinsun.com>
20588
20589 Port quotearg fixes from tar 1.13.24.
20590
20591 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
20592 tm to be declared.
20593 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
20594 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
20595
20596 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
20597 * m4/mbrtowc.m4: New file.
20598 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
20599 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
20600
20601 2001-09-27 Akim Demaille <akim@epita.fr>
20602
20603 Bump to 1.29c.
20604
20605 2001-09-27 Akim Demaille <akim@epita.fr>
20606
20607 Version 1.29b.
20608
20609 2001-09-25 Akim Demaille <akim@epita.fr>
20610
20611 * src/system.h: Include `xalloc.h'.
20612 Remove it from the C files.
20613 * src/files.c (output_files): Free the obstacks.
20614 * src/lex.c (init_lex): Rename as...
20615 (lex_init): this.
20616 (lex_free): New.
20617 * src/main.c (main): Use it.
20618
20619 2001-09-24 Marc Autret <autret_m@epita.fr>
20620
20621 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
20622 to output informations in fout (FILE*).
20623 (open_graph, close_graph): Likewise.
20624 (output_graph, output_edge, output_node): Likewise.
20625 * src/vcg.h: Update function prototypes.
20626 * src/print_graph.c (print_graph): Open output graph file.
20627 (print_actions): Adjust.
20628 * src/files.h: Remove extern declaration.
20629 * src/files.c: Remove graph_obstack declaration.
20630 (open_files): Remove graph_obstack initialization.
20631 (output_files): Remove graph_obstack saving.
20632
20633 2001-09-24 Marc Autret <autret_m@epita.fr>
20634
20635 * src/files.c (compute_output_file_names): Fix.
20636
20637 2001-09-24 Marc Autret <autret_m@epita.fr>,
20638 Akim Demaille <akim@epita.fr>
20639
20640 * src/reader.c (reader): Remove call to free_symtab ().
20641 * src/main.c (main): Call it here.
20642 Include symtab.h.
20643 * src/conflicts.c (initialize_conflicts): Rename as...
20644 (solve_conflicts): this.
20645 * src/print.c (print_core, print_actions, print_state)
20646 (print_grammar): Dump to a file instead a `output_obstack'.
20647 (print_results): Dump `output_obstack', and then proceed with the
20648 FILE *.
20649 * src/files.c (compute_output_file_names, close_files): New.
20650 (output_files): Adjust.
20651 * src/main.c (main): Adjust.
20652
20653 2001-09-23 Marc Autret <autret_m@epita.fr>
20654
20655 * src/files.c (compute_header_macro): Computes header macro name
20656 from spec_defines_file when given.
20657
20658 2001-09-23 Marc Autret <autret_m@epita.fr>
20659
20660 * src/files.c (output_files): Add default extensions.
20661
20662 2001-09-22 Akim Demaille <akim@epita.fr>
20663
20664 * src/conflicts.c (finalize_conflicts): Rename as...
20665 (free_conflicts): this.
20666
20667 2001-09-22 Akim Demaille <akim@epita.fr>
20668
20669 * src/gram.c (gram_free): Rename back as...
20670 (dummy): this.
20671 (output_token_translations): Free `token_translations'.
20672 * src/symtab.c (free_symtab): Free the tag field.
20673
20674 2001-09-22 Akim Demaille <akim@epita.fr>
20675
20676 Remove `translations' as it is always set to true.
20677
20678 * src/gram.h: Adjust.
20679 * src/reader.c (packsymbols, parse_token_decl): Adjust
20680 * src/print.c (print_grammar): Adjust.
20681 * src/output.c (output_token_translations): Adjust.
20682 * src/lex.c (lex): Adjust.
20683 * src/gram.c: Be sure the set pointers to NULL.
20684 (dummy): Rename as...
20685 (gram_free): this.
20686
20687 2001-09-22 Akim Demaille <akim@epita.fr>
20688
20689 * configure.in: Invoke AM_LIB_DMALLOC.
20690 * src/system.h: Use dmalloc.
20691 * src/LR0.c: Be sure to have pointers initialized to NULL.
20692 (allocate_itemsets): Allocate kernel_items only if needed.
20693
20694 2001-09-22 Akim Demaille <akim@epita.fr>
20695
20696 * configure.in: Bump to 1.29b.
20697 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
20698 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
20699 need xmalloc.c in calc.y.
20700 From Pascal Bart.
20701
20702 2001-09-21 Akim Demaille <akim@epita.fr>
20703
20704 Version 1.29a.
20705 * Makefile.maint, config/config.guess, config/config.sub,
20706 * config/missing: Update from masters.
20707 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
20708 upon package.m4.
20709 * configure.in (ALL_LINGUAS): Add `tr'.
20710
20711 2001-09-21 Akim Demaille <akim@epita.fr>
20712
20713 * tests/Makefile.am (package.m4): Move to...
20714 ($(srcdir)/$(TESTSUITE)): here.
20715
20716 2001-09-20 Akim Demaille <akim@epita.fr>
20717
20718 * src/complain.c: No longer try to be standalone: use system.h.
20719 Don't assume __STDC__ is defined to 1. Just test if it is defined.
20720 * src/complain.h: Likewise.
20721 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
20722 Remove the unused variable `n'.
20723 From Albert Chin-A-Young.
20724
20725 2001-09-18 Marc Autret <autret_m@epita.fr>
20726
20727 * doc/bison.1: Update.
20728 * doc/bison.texinfo (Bison Options): Update --defines and --graph
20729 descriptions.
20730 (Option Cross Key): Update.
20731 Add --graph.
20732
20733 2001-09-18 Marc Autret <autret_m@epita.fr>
20734
20735 * tests/regression.at: New test (comment in %union).
20736
20737 2001-09-18 Marc Autret <autret_m@epita.fr>
20738
20739 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
20740 do that.
20741 Reported by Keith Browne.
20742
20743 2001-09-18 Marc Autret <autret_m@epita.fr>
20744
20745 * tests/output.at: Add tests for --defines and --graph.
20746
20747 2001-09-18 Marc Autret <autret_m@epita.fr>
20748
20749 * tests/output.at: Removes tests of %{header,src}_extension features.
20750
20751 2001-09-18 Akim Demaille <akim@epita.fr>
20752
20753 * tests/Makefile.am (package.m4): New.
20754 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
20755 (_AT_CHECK_CALC_ERROR): Likewise.
20756 Factor the `, ' part of verbose error messages.
20757
20758 2001-09-18 Marc Autret <autret_m@epita.fr>
20759
20760 * src/getargs.c (longopts): Declare --defines and --graph as options
20761 with optional arguments.
20762 * src/files.h: Add extern declarations.
20763 * src/files.c (spec_graph_file, spec_defines_file): New.
20764 (output_files): Update.
20765 Remove CPP-outed code.
20766
20767 2001-09-18 Marc Autret <autret_m@epita.fr>
20768
20769 Turn off %{source,header}_extension feature.
20770
20771 * src/files.c (compute_exts_from_gf): Update.
20772 (compute_exts_from_src): Update.
20773 (output_files): CPP-out useless code.
20774 * src/files.h: Remove {header,source}_extension extern declarations.
20775 * src/reader.c (parse_dquoted_param): CPP-out.
20776 (parse_header_extension_decl): Remove.
20777 (parse_source_extension_decl): Remove.
20778 (read_declarations): Remove cases tok_{hdrext,srcext}.
20779 * src/lex.c (percent_table): Remove {header,source}_extension entries.
20780 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
20781
20782 2001-09-10 Akim Demaille <akim@epita.fr>
20783
20784 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
20785 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
20786 (AT_CHECK_OUTPUT): this.
20787 Merely check ls' exit status, its output is useless.
20788
20789 2001-09-10 Akim Demaille <akim@epita.fr>
20790
20791 * tests/calc.at: Use m4_match.
20792 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
20793
20794 2001-09-10 Marc Autret <autret_m@epita.fr>,
20795 Akim Demaille <akim@epita.fr>
20796
20797 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
20798 enum color_e.
20799 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
20800 to `normal'.
20801 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
20802 * src/lex.h: Adjust prototype.
20803 (token_t): Add `tok_undef'.
20804 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
20805 (parse_percent_token): Now returns token_t.
20806 Add default statement in switch.
20807 (lex): Separate `c' as an input variable, from the token_t result
20808 part.
20809 (unlexed): Is a token_t.
20810
20811 2001-09-10 Akim Demaille <akim@epita.fr>
20812
20813 * configure.in: Bump to 1.29a.
20814
20815 2001-09-07 Akim Demaille <akim@epita.fr>
20816
20817 Version 1.29.
20818
20819 2001-08-30 Akim Demaille <akim@epita.fr>
20820
20821 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
20822 * m4/atconfig.m4: Remove.
20823 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
20824 * tests/bison: New.
20825 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
20826 m4_if, m4_patsubst, and m4_regexp.
20827 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
20828 `input' file instead of echo.
20829
20830 2001-08-29 Akim Demaille <akim@epita.fr>
20831
20832 Bump to 1.28e.
20833
20834 2001-08-29 Akim Demaille <akim@epita.fr>
20835
20836 Version 1.28d.
20837
20838 2001-08-29 Paul Eggert <eggert@twinsun.com>
20839
20840 * src/bison.simple (yyparse): Don't take the address of an
20841 item before the start of an array, as that doesn't conform to
20842 the C Standard.
20843
20844 2001-08-29 Robert Anisko <anisko_r@epita.fr>
20845
20846 * doc/bison.texinfo (Location Tracking Calc): New node.
20847
20848 2001-08-29 Paul Eggert <eggert@twinsun.com>
20849
20850 * src/output.c (output): Do not define const, as this now
20851 causes more problems than it cures.
20852
20853 2001-08-29 Akim Demaille <akim@epita.fr>
20854
20855 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
20856 the nodes.
20857 Be sure to tag the `detailmenu'.
20858
20859 2001-08-29 Akim Demaille <akim@epita.fr>
20860
20861 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
20862 download in a tmp dir.
20863
20864 2001-08-28 Marc Autret <autret_m@epita.fr>
20865
20866 * config/depcomp: New file.
20867
20868 2001-08-28 Marc Autret <autret_m@epita.fr>
20869
20870 * doc/bison.1 (mandoc): Adjust.
20871 From Juan Manuel Guerrero.
20872
20873 2001-08-28 Marc Autret <autret_m@epita.fr>
20874
20875 * src/print_graph.c (print_state): Fix.
20876
20877 2001-08-27 Marc Autret <autret_m@epita.fr>
20878
20879 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
20880 char * members.
20881 Echo modifications to the functions prototypes.
20882 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
20883
20884 2001-08-27 Marc Autret <autret_m@epita.fr>
20885
20886 * src/vcg.c: Include `xalloc.h'.
20887 (add_colorentry): New.
20888 (add_classname): New.
20889 (add_infoname): New.
20890 * src/vcg.h: Add new prototypes.
20891
20892 2001-08-27 Akim Demaille <akim@epita.fr>
20893
20894 * Makefile.maint: Sync. again with CVS Autoconf.
20895
20896 2001-08-27 Akim Demaille <akim@epita.fr>
20897
20898 * Makefile.maint: Formatting changes.
20899 (po-update, cvs-update, update): New targets.
20900 (AMTAR): Remove.
20901
20902 2001-08-27 Akim Demaille <akim@epita.fr>
20903
20904 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
20905 * Makefile.maint: Sync. with CVS Autoconf.
20906
20907 2001-08-27 Marc Autret <autret_m@epita.fr>
20908
20909 * src/vcg.h (struct infoname_s): New.
20910 (struct colorentry_s): New.
20911 (graph_s): New fields {vertical,horizontal}_order in structure.
20912 Add `infoname' field.
20913 Add `colorentry' field;
20914 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
20915 (G_HORIZONTAL_ORDER): New.
20916 (G_INFONAME): New.
20917 (G_COLORENTRY): New.
20918 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
20919 Add output of `infoname'.
20920 Add output of `colorentry'.
20921
20922 2001-08-27 Marc Autret <autret_m@epita.fr>
20923
20924 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
20925 This one shadowed a global parameter.
20926
20927 2001-08-24 Marc Autret <autret_m@epita.fr>
20928
20929 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
20930 instead of `unsigned'.
20931 (print_state): Do not call obstack_object_size () in obstack_grow ()
20932 to avoid macro variables shadowing.
20933
20934 2001-08-23 Marc Autret <autret_m@epita.fr>
20935
20936 * src/lex.c (percent_table): Typo: s/naem/name/.
20937 Add graph option.
20938 Normalize new options declarations.
20939
20940 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
20941
20942 * tests/suite.at: Exercise %header_extension and %source_extension.
20943
20944 2001-08-16 Marc Autret <autret_m@epita.fr>
20945
20946 * src/reader.c (parse_dquoted_param): New.
20947 (parse_header_extension_decl): Use it.
20948 (parse_source_extension_decl): Likewise.
20949
20950 2001-08-16 Marc Autret <autret_m@epita.fr>
20951
20952 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
20953 (get_xxxx_str): Use assert () instead of complain ().
20954 Remove return invokations in default cases.
20955 (get_decision_str): Modify default behaviour. Remove second argument.
20956 Echo modifications on calls.
20957 (output_graph): Fix.
20958
20959 2001-08-16 Marc Autret <autret_m@epita.fr>
20960
20961 * src/getargs.c (usage): Update with ``-g, --graph''.
20962
20963 2001-08-16 Marc Autret <autret_m@epita.fr>
20964
20965 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
20966 (Option Cross Key): Likewise.
20967 * doc/bison.1: Update.
20968
1c8c2190
PB
209692001-09-25 Pascal Bart <pascal.bart@epita.fr>
20970
20971 * src/output.c (output_master_parser): Don't finish action_obstack.
20972 (output_parser): Don't care about the muscle action, here.
20973 (prepare): Copy the action_obstack in the action muscle.
20974 (output): Free action_obstack.
20975
180d45ba
PB
209762001-09-23 Pascal Bart <pascal.bart@epita.fr>
20977
20978 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
20979 will contain `%union' declaration.
20980 (parse_union_decl): Delete #line directive output.
20981 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
20982 informations about %union.
20983 (parse_union_decl): Copy the union_obstack in the muscle stype.
20984 * src/bison.simple: Add new #line directive.
20985 Add typdef %%stype YYSTYPE.
20986
c51d1a19
PB
209872001-09-23 Pascal Bart <pascal.bart@epita.fr>
20988
20989 * src/bison.simple: Add new `#line' directive.
20990
6f9344da
PB
209912001-09-22 Pascal Bart <pascal.bart@epita.fr>
20992
20993 * src/bison.simple: New `#line' directive.
20994 * src/output.c (output_parser): Support new dynamic muscle input_line.
20995
652def80
MA
209962001-09-22 Marc Autret <autret_m@epita.fr>
20997
20998 * src/output.c (output_master_parser): New.
20999 (output_parser): Be more re-entrant.
21000
25b222fa
MA
210012001-09-21 Marc Autret <autret_m@epita.fr>
21002
21003 * src/reader.c (copy_definition, parse_union_decl): Update and use
21004 `linef' muscle.
21005 (copy_action): Likewise.
21006 Use obstack_1grow ().
21007 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
21008
6bc35ae5
MA
210092001-09-21 Marc Autret <autret_m@epita.fr>
21010
21011 * src/options.c (option_table): Adjust.
21012 * src/lex.c (parse_percent_token): Fix.
21013
c0629aa1
PB
210142001-09-20 Pascal Bart <pascal.bart@epita.fr>
21015
21016 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 21017
82b6d266
PB
210182001-09-20 Pascal Bart <pascal.bart@epita.fr>
21019
21020 * src/lex.c (parse_percent_token): Change type of variable `tx', which
21021 is now an option_table_struct*.
21022 (option_strcmp): New function option_strcmp.
21023 (parse_percent_token): Call option_strcmp.
21024 * src/getargs.c (xalloc.h, options.h): Include it.
21025 (getargs): Call create_long_option_table.
21026 (getargs): Free longopts at the end of the function.
21027 (shortopts): Move in options.c.
21028 * src/options.c (create_long_option_table): New function. Convert
21029 information from option_table to option structure.
21030 * src/reader.c (options.h): Include it.
21031
21032 * src/Makefile.am: Adjust.
21033 * src/options.c (option_table): Create from longopts and percent_table.
21034 * src/getargs.c (longopts): Delete.
21035 * src/lex.c (struct percent_table_struct): Delete.
21036 (percent_table): Delete.
21037 (options.h): Include it.
21038 * src/options.c: Create.
21039 * src/options.h: Create.
21040 Declare enum opt_access_e.
21041 Define struct option_table_struct.
21042
75f5aaea
MA
210432001-09-20 Marc Autret <autret_m@epita.fr>
21044
21045 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
21046 sections of Bison.
21047
f508cb0a
PB
210482001-09-19 Pascal Bart <pascal.bart@epita.fr>
21049
21050 * src/bison.simple: s/%%filename/%%skeleton.
21051 * src/muscle_tab.c (getargs.h): Include it.
21052 (muscle_init): Insert new muscle skeleton.
21053
13105fc1
PB
210542001-09-18 Pascal Bart <pascal.bart@epita.fr>
21055
21056 * src/output.c (output_parser): Delete unused variable actions_dumped.
21057
b0c4483e
PB
210582001-09-07 Pascal Bart <pascal.bart@epita.fr>
21059
21060 * src/output.c (output): Delete call to reader_output_yylsp.
21061 * src/reader.c (reader): Likewise.
ba0fe3c7 21062 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 21063
11d82f03
MA
210642001-09-02 Marc Autret <autret_m@epita.fr>
21065
21066 * src/reader.c: Include muscle_tab.h.
21067 (parse_union_decl): Update.
21068 (parse_macro_decl): Rename parse_muscle_decl.
21069 Update to use renamed functions and variable.
21070 (read_declarations, copy_action, read_additionnal_code, : Updated
21071 with correct variables and functions names.
21072 (packsymbols, reader): Likewise.
342b8b6e 21073
11d82f03 21074 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 21075
11d82f03
MA
21076 * src/output.c: Include muscle_tab.h
21077 In all functions using macro_insert, change by using muscle_insert ().
21078 (macro_obstack): Rename muscle_obstack.
21079 Echo modifications in the whole file.
21080 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
21081 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
21082 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
21083
21084 * src/muscle_tab.h: Update double inclusion macros.
21085 (macro_entry_s): Rename muscle_entry_s.
21086 Update prototypes.
342b8b6e 21087
11d82f03
MA
21088 * src/muscle_tab.c: Include muscle_tab.h.
21089 Rename macro_tabble to muscle_table.
21090 (mhash1, mhash2, mcmp): Use muscle_entry.
21091 (macro_init): Rename muscle_init. Update.
21092 (macro_insert): Rename muscle_insert. Update.
21093 (macro_find): Rename muscle_find. Update.
21094
21095 * src/main.c: Include muscle_tab.h.
21096 (main): Call muscle_init ().
21097 * src/Makefile.am (bison_SOURCES): Echo modifications.
21098
93a37297
MA
210992001-09-02 Marc Autret <autret_m@epita.fr>
21100
f753cd62 21101 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 21102
f753cd62
MA
21103 * src/muscle_tab.c, src/muscle_tab.h: Add files.
21104
211052001-09-02 Marc Autret <autret_m@epita.fr>
21106
21107 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 21108
682d48cd
PB
211092001-09-01 Pascal Bart <pascal.bart@epita.fr>
21110
342b8b6e 21111 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
21112 filename.
21113
087c8fda
MA
211142001-09-01 Marc Autret <autret_m@epita.fr>
21115
21116 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
21117 to an explicit value to activate the feature. We do it here.
21118
dda680cb
PB
211192001-08-31 Pascal Bart <pascal.bart@epita.fr>
21120
21121 * src/output.c (prepare): Delete the `filename' muscule insertion.
21122 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
21123 (parse_union_decl): Likewise.
21124 * src/macrotab.c (macro_init): Initialize filename by infile.
21125
9e644e64
MA
211262001-08-31 Marc Autret <autret_m@epita.fr>
21127
21128 * src/bison.simple (YYLSP_NEEDED): New definition.
21129 * src/output.c (prepare): Add macro insertion of `locations_flag'
21130
17da6427
PB
211312001-08-31 Pascal Bart <pascal.bart@epita.fr>
21132
21133 * src/output.c (prepare): Delete insertion of previous muscles,
21134 and insert the `prefix' muscles.
21135 * src/macrotab.c (macro_init): Likewise.
21136 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 21137 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
21138 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
21139 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 21140 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
21141 name_prefix.
21142
e8cb70b9
PB
211432001-08-31 Pascal Bart <pascal.bart@epita.fr>
21144
21145 * src/main.c (main): Standardize.
21146 * src/output.c (output_table_data, output_parser): Likewise.
21147 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
21148
63c2d5de
MA
211492001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
21150
342b8b6e 21151 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
21152 %%epilogue.
21153 * src/output.c (output): Rename %%declarations to %%prologue.
21154 * src/bison.simple: Echo modifications.
342b8b6e 21155
d8cb5183
MA
211562001-08-31 Marc Autret <autret_m@epita.fr>
21157
21158 * src/reader.c (readgram): CleanUp.
21159 (output_token_defines): Likewise.
21160 (packsymbols): Likewise.
21161 (reader): Likewise.
21162 * src/output.c (output): CPP-out useless code.
21163
6c686258
PB
211642001-08-31 Pascal Bart <pascal.bart@epita.fr>
21165
342b8b6e 21166 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
21167 output_trailers and output_headers.
21168 * src/output.h: Remove obsolete functions prototypes of output_headers
21169 and output_trailers.
21170
8f451ef7
PB
211712001-08-30 Pascal Bart <pascal.bart@epita.fr>
21172
21173 * src/main.c: Include macrotab.h.
342b8b6e 21174 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
21175 Adjust functions prototypes.
21176 * src/macrotab.c (macro_insert): Constify key and value.
21177 (macro_find): Constify key.
21178 (macro_insert): Include 'xalloc.h'
21179 (macro_insert): Use XMALLOC.
21180 (macro_find): Constify return value.
21181 * src/output.c (output_table_data): Rename table to table_data.
21182 (output_parser): Constify macro_key, macro_value.
21183
997b6fd0 211842001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
21185
21186 * src/reader.c (parse_skel_decl): New.
342b8b6e 21187 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
21188 * src/lex.h (token_t): New token `tok_skel'.
21189 * src/lex.c (percent_table): Add skeleton option entry.
21190 Standardize.
21191
ff48177d
MA
211922001-08-29 Marc Autret <autret_m@epita.fr>
21193
21194 * src/bison.simple: Add %%user_code directive at the end.
21195 * src/reader.c (read_additionnal_code): New.
21196 (reader): Use it.
21197 * src/output.c (output_program): Remove.
21198 (output): Update.
21199
b33160bf
MA
212002001-08-28 Marc Autret <autret_m@epita.fr>
21201
21202 * src/output.c (output_actions): Clean up.
4e5caae2 21203 (output_gram): CPP-out useless code.
b33160bf
MA
21204 * src/reader.c (reader): Clean up, CPP-out useless code.
21205
d1a2daf7
PB
212062001-08-28 Pascal Bart <pascal.bart@epita.fr>
21207
342b8b6e 21208 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 21209 directive.
d1a2daf7
PB
21210 * src/bison.simple: Add `%%definitions'.
21211
2b763dfe
MA
212122001-08-28 Marc Autret <autret_m@epita.fr>
21213
21214 * config/depcomp: New file.
21215
f1a87ef6
PE
212162001-08-27 Paul Eggert <eggert@twinsun.com>
21217
21218 * src/bison.simple (yyparse): Don't take the address of an
21219 item before the start of an array, as that doesn't conform to
21220 the C Standard.
21221
82e236e2
RA
212222001-08-27 Robert Anisko <robert.anisko@epita.fr>
21223
f1a87ef6 21224 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
21225 obstack. It was done too late here.
21226
21227 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
21228 completely wrong.
21229 (reader): Initialize the macro obstack here, since we need it to grow
21230 '%define' directives.
21231
21232 * src/reader.h: Declare the macro obstack as extern.
21233
b0cfa28a
RA
212342001-08-27 Robert Anisko <robert.anisko@epita.fr>
21235
21236 * src/output.c (output_parser): Fix. Store single '%' characters in
21237 the output obstack instead of throwing them away.
21238
6fc74234
AD
212392001-08-27 Akim Demaille <akim@epita.fr>
21240
21241 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
21242
9c76d118
RA
212432001-08-25 Robert Anisko <robert.anisko@epita.fr>
21244
21245 * lib/Makefile.am: Adjust.
21246
a8289c62
RA
212472001-08-25 Robert Anisko <robert.anisko@epita.fr>
21248
21249 * src/bison.simple: Update and add '%%' directives.
21250
b6610515
RA
212512001-08-25 Robert Anisko <robert.anisko@epita.fr>
21252
21253 * src/reader.c (reader): Remove calls to 'output_headers' and
21254 'output_trailers'. Remove some C output.
21255 (readgram): Disable a piece of code that was writing a default
21256 definition for 'YYSTYPE'.
21257 (reader_output_yylsp): Remove.
21258 (packsymbols): Output token defintions to a macro.
21259 (copy_definition): Disable C output.
6fc74234 21260
b6610515
RA
21261 * src/reader.c (parse_macro_decl): New function used to parse macro
21262 declarations.
21263 (copy_string2): Put the body of copy_string into this new function.
21264 Add a parameter to let the caller choose whether he wants to copy the
21265 string delimiters or not.
21266 (copy_string): Be a simple call to copy_string2 with the last argument
21267 bound to true.
21268 (read_declarations): Add case for macro definition.
21269 (copy_identifier): New.
6fc74234 21270 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
21271 rather than lex.
21272
26f609ff
RA
212732001-08-25 Robert Anisko <robert.anisko@epita.fr>
21274
21275 * src/output.c (prepare): Add prefixed names.
21276 (output_parser): Output semantic actions.
21277 (output_parser): Fix bug on '%%line' directives.
6fc74234 21278
26f609ff
RA
21279 * src/output.c (output_headers): Remove. The C code printed by this
21280 function should now be in the skeletons.
21281 (output_trailers): Remove.
21282 (output): Disable call to 'reader_output_yylsp'.
21283 (output_rule_data): Do not output tables to the table obstack.
21284
21285 * src/output.c: Remove some C dedicated output.
21286 Improve the use of macro and output obstacks.
21287 (output_defines): Remove.
6fc74234 21288
26f609ff
RA
21289 * src/output.c (output_token_translations): Associate 'translate'
21290 table with a macro. No output to the table obstack.
21291 (output_gram): Same for 'rhs' and 'prhs'.
21292 (output_stos): Same for 'stos'.
21293 (output_rule_data): Same for 'r1' and 'r2'.
21294 (token_actions): Same for 'defact'.
21295 (goto_actions): Same for 'defgoto'.
21296 (output_base): Same for 'pact' and 'pgoto'.
21297 (output_table): Same for 'table'.
21298 (output_check): Same for 'check'.
6fc74234 21299
26f609ff
RA
21300 * src/output.c (output_table_data): New function.
21301 (output_short_table): Remove.
21302 (output_short_or_char_table): Remove.
6fc74234 21303
26f609ff
RA
21304 * src/output.c (output_parser): Replace most of the skeleton copy code
21305 with something new. Skeletons are now processed character by character
21306 rather than line by line, and Bison looks for '%%' macros. This is the
21307 first step in making Bison's output process (a lot) more flexible.
21308 (output_parser): Use the macro table.
21309
6f43b113
RA
213102001-08-25 Robert Anisko <robert.anisko@epita.fr>
21311
21312 * src/main.c (main): Initialize the macro table.
21313
dd3127cf
RA
213142001-08-25 Robert Anisko <robert.anisko@epita.fr>
21315
21316 * src/lex.c (percent_table): Add tok_define.
21317 * src/lex.h: Add tok_define.
21318
aa321494
RA
213192001-08-25 Robert Anisko <robert.anisko@epita.fr>
21320
21321 * src/macrotab.c: New file.
21322 * src/macrotab.h: New file.
21323 * src/Makefile.am: Update.
21324
68bd3b6b
RA
213252001-08-25 Robert Anisko <robert.anisko@epita.fr>
21326
21327 * lib/hash.c: New file.
21328 * lib/hash.h: New file.
21329 * lib/Makefile.am: Update.
21330
45f8dd1e
AD
213312001-08-15 Akim Demaille <akim@epita.fr>
21332
21333 Version 1.28c.
21334
40a64a7a 213352001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
21336
21337 * src/reader.c (readgram): Indent output macro YYSTYPE.
21338 (packsymbols): Likewise.
21339 (output_token_defines): Likewise.
21340 * src/files.c: Standardize.
21341 (compute_header_macro): New.
21342 (defines_obstack_save): New. Use compute_header_macro.
21343 (output_files): Update. Use defines_obstack_save.
21344
f9a8293a
AD
213452001-08-15 Akim Demaille <akim@epita.fr>
21346
21347 * doc/bison.texinfo (Table of Symbols): Document
21348 YYSTACK_USE_ALLOCA.
21349
150ca7a7
AD
213502001-08-15 Akim Demaille <akim@epita.fr>
21351
21352 * missing: Update from CVS Automake.
21353 * config/config.guess, config/config.sub, config/texinfo.tex:
21354 Update from gnu.org.
21355
69b5cec4
AD
213562001-08-15 Akim Demaille <akim@epita.fr>
21357
21358 * Makefile.maint: Sync with CVS Autoconf.
21359
f2b5126e
PB
213602001-08-14 Pascal Bart <pascal.bart@epita.fr>
21361
69b5cec4 21362 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
21363 `fdl.texi'.
21364 * doc/fdl.texi: Add to package.
21365
4ecbf796
MA
213662001-08-14 Marc Autret <autret_m@epita.fr>
21367
21368 Turn on %{source,header}_extension features.
21369
69b5cec4 21370 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
21371 source_extension.
21372 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 21373 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
21374 between options.
21375
95fb5662
MA
213762001-08-14 Marc Autret <autret_m@epita.fr>
21377
21378 * src/files.c (compute_base_names): Add extensions computing when
21379 `--file-prefix' used.
21380 Standardize function calls.
21381
78d09da9
MA
213822001-08-13 Marc Autret <autret_m@epita.fr>
21383
69b5cec4 21384 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
21385 defining it (defined but null disables alloca).
21386
5a009f2c
MA
213872001-08-13 Marc Autret <autret_m@epita.fr>
21388
21389 * src/bison.simple (_yy_memcpy): CPP reformat.
21390
1e41465a
PB
213912001-08-13 Pascal Bart <pascal.bart@epita.fr>
21392
21393 * tests/atconfig.in (CPPFLAGS): Fix.
21394
c67a198d
PB
213952001-08-10 Pascal Bart <pascal.bart@epita.fr>
21396
79282c6c 21397 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
21398 `gpl.texi'.
21399 * doc/gpl.texi: Add to package.
21400
09a6de7e
MA
214012001-08-10 Marc Autret <autret_m@epita.fr>
21402
21403 * src/print_graph.h: Fix.
21404 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
21405
b77b9ee0
AD
214062001-08-10 Akim Demaille <akim@epita.fr>
21407
21408 * src/system.h: Provide default declarations for stpcpy, strndup,
21409 and strnlen.
21410
3e259915
MA
214112001-08-10 Robert Anisko <anisko_r@epita.fr>
21412
21413 * doc/bison.texinfo (Locations): Update @$ stuff.
21414
ca96bc2d
MA
214152001-08-09 Robert Anisko <anisko_r@epita.fr>
21416
21417 * src/bison.simple (YYLLOC_DEFAULT): Update.
21418 (yyparse): Adjust.
21419
fdc6758b
MA
214202001-08-08 Marc Autret <autret_m@epita.fr>
21421
b77b9ee0 21422 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
21423 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
21424 Reported by Fabrice Bauzac.
957d4dbf 21425
600cad3b
MA
214262001-08-08 Marc Autret <autret_m@epita.fr>
21427
21428 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
21429 * src/vcg.c (output_node): Fix.
21430 * src/vcg.h: Cleanup.
21431 * src/print_graph.c: Add comments.
b77b9ee0 21432 (node_output_size): New global variable. Simplify the formatting of
600cad3b 21433 the VCG graph output.
b77b9ee0 21434 (print_actions): Unused code is now used. It notifies the final state
600cad3b 21435 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 21436 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
21437 blue.
21438 Get the current node name and node_obstack by argument.
21439 (node_obstack): New variable.
21440 (print_state): Manage node_obstack.
21441 (print_core): Use node_obstack given by argument.
21442 A node is not only computed here but in print_actions also.
21443 (print_graph): CPP out useless code instead of commenting it.
21444
976e528f
AD
214452001-08-07 Pascal Bart <pascal.bart@epita.fr>
21446
21447 * tests/atconfig.in (CPPFLAGS): Fix.
21448
20e8e5ca
AD
214492001-08-07 Akim Demaille <akim@epita.fr>
21450
21451 * src/print_graph.c (quote): New.
21452 (print_core): Use it.
21453
957d4dbf 214542001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 21455
3e3da797
AD
21456 * src/vcg.c (complain.h): Include it.
21457 Unepitaize `return' invocations.
c4b66126 21458 [NDEBUG] (main): Remove.
79282c6c 21459 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
21460 * src/files.c (open_files): Initialize graph_obstack.
21461 * src/print_graph.c (print_actions): CPP out useless code.
21462 (print_core): Don't output the last `\n' in labels.
21463 Use `quote'.
21464 * src/files.c (output_files): Output the VCG file.
21465 * src/main.c (main): Invoke print_graph ();
3e3da797 21466
957d4dbf 214672001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
21468
21469 Automaton VCG graph output.
21470 Using option ``-g'' or long option ``--graph'', you can generate
21471 a gram_filename.vcg file containing a VCG description of the LALR (1)
21472 automaton of your grammar.
21473
21474 * src/main.c: Call to print_graph() function.
21475 * src/getargs.h: Update.
21476 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
21477 (graph_flag): New flag.
21478 (longopts): Update.
21479 (getargs): Add case `g'.
21480 * src/files.c (graph_obstack): New obstack struct.
21481 (open_files): Initialize new obstack.
21482 (output_files): Saves graph_obstack if required.
21483 * src/files.h (graph_obstack): New extern declaration.
21484 * src/Makefile.am: Add new source files.
21485
927c1557 214862001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
21487
21488 * src/print_graph.c, src/print_graph.h (graph): New.
21489 * src/vcg.h: New file.
21490 * src/vcg.c: New file, VCG graph handling.
21491
7333d403
AD
214922001-08-06 Marc Autret <autret_m@epita.fr>
21493
21494 Add of %source_extension and %header_extension which specify
21495 the source or/and the header output file extension.
21496
21497 * src/files.c (compute_base_names): Remove initialisation of
21498 src_extension and header_extension.
21499 (compute_exts_from_gf): Update.
21500 (compute_exts_from_src): Update.
21501 (output_files): Update.
21502 * src/reader.c (parse_header_extension_decl): New.
21503 (parse_source_extension_decl): New.
21504 (read_declarations): New case statements for the new tokens.
21505 * src/lex.c (percent_table): Add entries for %source_extension
21506 and %header_extension.
21507 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
21508
84163231
AD
215092001-08-06 Marc Autret <autret_m@epita.fr>
21510
21511 * configure.in: Bump to 1.28c.
21512 * doc/bison.texinfo: Texinfo thingies.
21513
8303fc42
AD
215142001-08-04 Pascal Bart <pascal.bart@epita.fr>
21515
21516 * tests/atconfig.in (CPPFLAGS): Add.
21517 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
21518
70a84437
AD
215192001-08-03 Akim Demaille <akim@epita.fr>
21520
21521 Version 1.28b.
21522
2ce10144
AD
215232001-08-03 Akim Demaille <akim@epita.fr>
21524
21525 * tests/Makefile.am (check-local): Ship testsuite.
21526 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
21527 Include `string.h'.
21528
1e3e4bc1
AD
215292001-08-03 Akim Demaille <akim@epita.fr>
21530
21531 * configure.in: Try using -Wformat when compiling.
21532
42b45b7f
AD
215332001-08-03 Akim Demaille <akim@epita.fr>
21534
21535 * configure.in: Bump to 1.28b.
21536
8f13fe33
AD
215372001-08-03 Akim Demaille <akim@epita.fr>
21538
21539 * src/complain.c: Adjust strerror_r portability issues.
21540
b37ba92c
AD
215412001-08-03 Akim Demaille <akim@epita.fr>
21542
21543 Version 1.28a.
21544
b0ce6046
AD
215452001-08-03 Akim Demaille <akim@epita.fr>
21546
21547 * src/getargs.c, src/getarg.h (skeleton)): Constify.
21548 * src/lex.c (literalchar): Avoid name clashes on `buf'.
21549 * src/getargs.c: Include complain.h.
21550 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
21551 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
21552
d01c415b
AD
215532001-08-03 Akim Demaille <akim@epita.fr>
21554
21555 * src/reader.c (readgram): Display hidden chars in error messages.
21556
459dd1a6
AD
215572001-08-03 Akim Demaille <akim@epita.fr>
21558
21559 Update to gettext 0.10.39.
21560
53b74c0c
AD
215612001-08-03 Akim Demaille <akim@epita.fr>
21562
21563 * lib/strspn.c: New.
21564
234a3be3
AD
215652001-08-01 Marc Autret <autret_m@epita.fr>
21566
21567 * doc/bison.texinfo: Update.
21568 * doc/bison.1 (mandoc): Update.
21569 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
21570 * src/files.c: Support output files extensions computing.
21571 (src_extension): New static variable.
21572 (header_extension): New static variable.
21573 (tr): New function.
21574 (get_extension_index): New function, gets the index of an extension
21575 filename in a string.
21576 (compute_exts_from_gf): New function, computes extensions from the
21577 grammar file extension.
21578 (compute_exts_from_src): New functions, computes extensions from the
21579 C source file extension, file given by ``-o'' option.
21580 (compute_base_names): Update.
21581 (output_files): Update.
21582
847bf1f5
AD
215832001-08-01 Robert Anisko <anisko_r@epita.fr>
21584
d995fee7 21585 * doc/bison.texi: Document @$.
847bf1f5
AD
21586 (Locations): New section.
21587
d074a105
AD
215882001-07-18 Akim Demaille <akim@epita.fr>
21589
21590 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
21591 * config/prev-version.txt, config/move-if-change: New.
21592 * Makefile.am: Adjust.
21593
3419715d
AD
215942001-07-08 Pascal Bart <pascal.bart@epita.fr>
21595
21596 * src/bison.simple (yyparse): Suppress warning `comparaison
21597 between signed and unsigned'.
21598
62ab6972
AD
215992001-07-05 Pascal Bart <pascal.bart@epita.fr>
21600
21601 * src/getargs.h (raw_flag): Remove.
21602 * src/getargs.c: Die on `-r'/`--raw'.
21603 * src/lex.c (parse_percent_token): Die on `%raw'.
21604 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
21605 * tests/calc.at: Suppress test with option `--raw'.
21606
1e24cc5b
AD
216072001-07-14 Akim Demaille <akim@epita.fr>
21608
21609 * config/: New.
21610 * configure.in: Require Autoconf 2.50.
21611 Update to gettext 0.10.38.
21612
32dfccf8
AD
216132001-03-16 Akim Demaille <akim@epita.fr>
21614
21615 * doc/bison.texinfo: ANSIfy the examples.
21616
cd5bd6ac
AD
216172001-03-16 Akim Demaille <akim@epita.fr>
21618
21619 * getargs.c (skeleton): New variable.
21620 (longopts): --skeleton is a new option.
21621 (shortopts, getargs): -S is a new option.
21622 * getargs.h: Declare skeleton.
21623 * output.c (output_parser): Use it.
21624
5141b016
AD
216252001-03-16 Akim Demaille <akim@epita.fr>
21626
21627 * m4/strerror_r.m4: New.
21628 * m4/error.m4: Run AC_FUNC_STRERROR_R.
21629 * lib/error.h, lib/error.c: Update.
21630
447992b9
AD
216312001-03-16 Akim Demaille <akim@epita.fr>
21632
21633 * src/getargs.c (longopts): Clean up.
21634
274d42ce
AD
216352001-02-21 Akim Demaille <akim@epita.fr>
21636
21637 * src/reader.c (gensym): `gensym_count' is your own.
21638 Use a static buf to create the symbol name, as token_buffer is no
21639 longer a buffer.
21640
22c821f3
AD
216412001-02-08 Akim Demaille <akim@epita.fr>
21642
21643 * src/conflicts.c (conflict_report): Be sure not to append to res
21644 between two calls, which could happen if both first sprintf were
21645 skipped, but not the first cp += strlen.
21646
18569462
AD
216472001-02-08 Akim Demaille <akim@epita.fr>
21648
21649 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
21650 New, from fileutils 4.0.37.
21651 * configure.in: Require Autoconf 2.49c. I took some time before
21652 making this decision. This is the only way out for portability
21653 issues in Bison, it would mean way too much duplicate effort to
21654 import in Bison features implemented in 2.49c since 2.13.
21655 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
21656
0d8f3c8a
AD
216572001-02-02 Akim Demaille <akim@epita.fr>
21658
21659 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 21660 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 21661
f17bcd1f
AD
216622001-01-19 Akim Demaille <akim@epita.fr>
21663
21664 Get rid of the ad hoc handling of token_buffer in the scanner: use
21665 the obstacks.
21666
21667 * src/lex.c (token_obstack): New.
21668 (init_lex): Initialize it. No longer call...
21669 (grow_token_buffer): this. Remove it.
21670 Adjust all the places which used it to use the obstack.
21671
511e79b3
AD
216722001-01-19 Akim Demaille <akim@epita.fr>
21673
21674 * src/lex.h: Rename all the tokens:
21675 s/\bENDFILE\b/tok_eof/g;
21676 s/\bIDENTIFIER\b/tok_identifier/g;
21677 etc.
21678 Let them be enums, not #define, to ease debugging.
21679 Adjust all the code.
21680
0d6508ef
AD
216812001-01-18 Akim Demaille <akim@epita.fr>
21682
21683 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
21684 * src/lex.c (maxtoken, grow_token_buffer): Static.
21685
6deb4447
AD
216862001-01-18 Akim Demaille <akim@epita.fr>
21687
21688 Since we now use obstacks, more % directives can be enabled.
21689
21690 * src/lex.c (percent_table): Also accept `%yacc',
21691 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
21692 `%debug'.
21693 Handle the actions for `%semantic_parser' and `%pure_parser' here,
21694 instead of returning a token.
21695 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
21696 * src/reader.c (read_declarations): Adjust.
21697 * src/files.c (open_files): Don't call `compute_base_names', don't
21698 compute `attrsfile' since they depend upon data which might be
21699 *in* the input file now.
21700 (output_files): Do it here.
21701 * src/output.c (output_headers): Document the fact that this patch
21702 introduces a guaranteed SEGV for semantic parsers.
21703 * doc/bison.texinfo: Document them.
21704 * tests/suite.at: Exercise these %options.
21705
ff4423cc
AD
217062000-12-20 Akim Demaille <akim@epita.fr>
21707
21708 Also handle the output file (--verbose) with obstacks.
21709
21710 * files.c (foutput): Remove.
21711 (output_obstack): New.
21712 Adjust all dependencies.
21713 * src/conflicts.c: Return a string.
21714 * src/system.h (obstack_grow_string): Rename as...
21715 (obstack_sgrow): this. Be ready to work with non literals.
21716 (obstack_fgrow4): New.
21717
956dba3a
AD
217182000-12-20 Akim Demaille <akim@epita.fr>
21719
21720 * src/files.c (open_files): Fix the computation of short_base_name
21721 in the case of `-o foo.tab.c'.
21722
337bab46
AD
217232000-12-20 Akim Demaille <akim@epita.fr>
21724
21725 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
21726 (copy_dollar): Now that everything uses obstacks, get rid of the
21727 FILE * parameters.
21728
5d3214b8
AD
217292000-12-20 Akim Demaille <akim@epita.fr>
21730
21731 * src/files.c (open_files): Actually the `.output' file is based
21732 on the short_base_name, not base_name.
21733 * tests/suite.at (Checking output file names): Adjust.
21734
29092a57
AD
217352000-12-20 Akim Demaille <akim@epita.fr>
21736
21737 * src/bison.s1: Remove, we now use directly...
21738 * src/bison.simple: this.
21739 * src/Makefile.am: Use pkgdata instead of data.
21740
ea5607fd
AD
217412000-12-20 Akim Demaille <akim@epita.fr>
21742
21743 * src/files.c (guard_obstack): New.
21744 (open_files): Initialize it.
21745 (output_files): Dump it...
21746 * src/files.h: Export it.
21747 * src/reader.c (copy_guard): Use it.
21748
27110317
AD
217492000-12-19 Akim Demaille <akim@epita.fr>
21750
21751 * src/files.c (outfile, defsfile, actfile): Removed as global
21752 vars.
21753 (open_files): Don't compute them.
21754 (output_files): Adjust.
21755 (base_name, short_base_name): Be global.
21756 Adjust dependencies.
21757
19c50364
AD
217582000-12-19 Akim Demaille <akim@epita.fr>
21759
21760 * src/files.c (strsuffix): New.
21761 (stringappend): Be just like strcat but allocate.
21762 (base_names): Eve out from open_files.
21763 Try to simplify the rather hairy computation of base_name and
21764 short_base_name.
21765 (open_files): Use it.
21766 * tests/suite.at (Checking output file names): New test.
21767
573c1d9f
AD
217682000-12-19 Akim Demaille <akim@epita.fr>
21769
21770 * src/system.h (obstack_grow_literal_string): Rename as...
21771 (obstack_grow_string): this.
21772 * src/output.c (output_parser): Recognize `%% actions' instead of
21773 `$'.
21774 * src/bison.s1: s/$/%% actions/.
21775 * src/bison.hairy: Likewise.
21776
ef7ddedd
AD
217772000-12-19 Akim Demaille <akim@epita.fr>
21778
21779 * src/output.c (output_parser): Compute the `#line' lines when
21780 there are.
21781 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
21782 Suggested by Hans Aberg.
21783
ff61dabd
AD
217842000-12-19 Akim Demaille <akim@epita.fr>
21785
21786 Let the handling of the skeleton files be local to the procedures
21787 that use it.
21788
21789 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
21790 longer static.
21791 (fparser, open_extra_files): Remove.
21792 (open_files, output_files): Don't take care of fparser.
21793 * src/files.h: Adjust.
21794 * src/output.c (output_parser): Open and close the file to the
21795 skeleton.
21796 * src/reader.c (read_declarations): When %semantic_parser, open
21797 fguard.
21798
55b96341
AD
217992000-12-19 Akim Demaille <akim@epita.fr>
21800
21801 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
21802 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
21803
358c15b7
AD
218042000-12-19 Akim Demaille <akim@epita.fr>
21805
21806 * src/files.c (open_files): Yipee! We no longer need all the code
21807 looking for `/tmp' since we have no tmp file.
21808
7de3329e
AD
218092000-12-19 Akim Demaille <akim@epita.fr>
21810
21811 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
21812 New macros.
21813 * src/files.c (open_files): Less dependency on MSDOS etc.
21814
3abcd459
AD
218152000-12-14 Akim Demaille <akim@epita.fr>
21816
21817 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
21818 Provide a default definition.
21819 Use it when executing the default @ action.
21820 * src/reader.c (reader_output_yylsp): No longer include
21821 `timestamp' and `text' in the default YYLTYPE.
21822
2a91a95e
AD
218232000-12-12 Akim Demaille <akim@epita.fr>
21824
21825 * src/reader.c (copy_definition, parse_union_decl, copy_action)
21826 (copy_guard): Quote the file names.
21827 Reported by Laurent Mascherpa.
21828
14d3eb9b
AD
218292000-12-12 Akim Demaille <akim@epita.fr>
21830
21831 * src/output.c (output_headers, output_program, output): Be sure
21832 to escape special characters when outputting filenames.
21833 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
21834 (output_headers): Don't depend on them, Use ACTSTR.
21835
d7045ec6
AD
218362000-11-17 Akim Demaille <akim@epita.fr>
21837
21838 * lib/obstack.h: Formatting changes.
21839 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
21840 prevents type checking.
21841 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
21842 cast the value to (void *): assigning a `foo *' to a `void *'
21843 variable is valid.
21844 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
21845 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
21846 append characters.
21847
6fd54b73
AD
218482000-11-17 Akim Demaille <akim@epita.fr>
21849
21850 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
21851 as...
21852 (suite.m4, regression.m4, calc.m4): these.
21853 * tests/atgeneral.m4: Update from CVS Autoconf.
21854
4c50eae6
AD
218552000-11-17 Akim Demaille <akim@epita.fr>
21856
21857 * tests/regression.m4 (%union and --defines): New test,
21858 demonstrating a current bug in the obstack implementation.
21859
a35f64ea
AD
218602000-11-17 Akim Demaille <akim@epita.fr>
21861
21862 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
21863 macros.
21864 Use them to declare the variables which are global or local to
21865 `yyparse'.
21866
7de23534
AD
218672000-11-17 Akim Demaille <akim@epita.fr>
21868
21869 * acconfig.h: Remove, no longer used.
21870
aa7815f5
AD
218712000-11-07 Akim Demaille <akim@epita.fr>
21872
21873 * src: s/Copyright (C)/Copyright/g.
21874
5af1f549
AD
218752000-11-07 Akim Demaille <akim@epita.fr>
21876
21877 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
21878 defining.
21879 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
21880
553e2b22
AD
218812000-11-07 Akim Demaille <akim@epita.fr>
21882
21883 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
21884 Merge in a single CPP if/else.
21885
8a4f41d6
AD
218862000-11-07 Akim Demaille <akim@epita.fr>
21887
21888 * src/output.c (output): Remove useless variables.
21889 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
21890 argument `data' for consistency with the prototypes.
21891 Qualify it `const'.
21892 (obstack_copy, obstack_copy0): Rename the second argument as
21893 `address' for consistency. Qualify it `const'.
21894 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
21895 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
21896 `const' their input argument (`data' or `address').
21897 Adjust the corresponding macros to include `const' in casts.
21898
095a3fb5
AD
218992000-11-03 Akim Demaille <akim@epita.fr>
21900
21901 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
21902 s/PFILE1/BISON_HAIRY/.
21903 Adjust dependencies.
21904
d1cdce7c
AD
219052000-11-03 Akim Demaille <akim@epita.fr>
21906
090c5ebf 21907 For some reason, this was not applied.
d1cdce7c
AD
21908
21909 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
21910 `unlink': it's no longer used.
21911
9311529b
AD
219122000-11-03 Akim Demaille <akim@epita.fr>
21913
21914 * src/files.c (skeleton_find): New function, eved out of...
21915 (open_files, open_extra_files): here.
21916
d8880f69
AD
219172000-11-03 Akim Demaille <akim@epita.fr>
21918
21919 Don't use `atexit'.
21920
21921 * src/files.c (obstack_save): New function.
21922 (done): Rename as...
21923 (output_files): this.
21924 Use `obstack_save'.
21925 * src/main.c (main): Don't use `atexit' to register `done', since
21926 it no longer has to remove tmp files, just call `output_files'
21927 when there are no errors.
21928
0dbb648e
AD
219292000-11-02 Akim Demaille <akim@epita.fr>
21930
21931 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
21932 `unlink': it's no longer used.
21933 * src/files.h: Formatting changes.
21934
896fe5c1
AD
219352000-11-02 Akim Demaille <akim@epita.fr>
21936
21937 Remove the last uses of mktemp and unlink/delete.
21938
21939 * src/files.c (fdefines, ftable): Removed.
21940 (defines_ostack, table_obstack): New.
21941 Adjust dependencies of the former into uses of the latter.
21942 * src/output.c (output_short_or_char_table, output_short_table):
21943 Convert to using obstacks.
21944 * src/reader.c (copy_comment2): Accept one FILE * and two
21945 obstacks.
21946 (output_token_defines, reader_output_yylsp): Use obstacks.
21947 * src/system.h (obstack_fgrow3): New.
1f65350a 21948 * po/POTFILES.in: Adjust.
896fe5c1 21949
dd60faec
AD
219502000-11-01 Akim Demaille <akim@epita.fr>
21951
21952 Change each use of `fattrs' into a use of `attrs_obstack'.
21953
21954 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
21955 * src/files.c (fattrs): Remove.
21956 (attrs_obstack): New.
21957 Adjust all dependencies.
21958 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
21959
8c7ebe49
AD
219602000-11-01 Akim Demaille <akim@epita.fr>
21961
21962 Introduce obstacks.
21963 Change each use of `faction' into a use of `action_obstack'.
21964
21965 * lib/obstack.h, lib/obstack.c: New files.
21966 * src/files.c (faction): Remove.
21967 (action_obstack): New.
21968 Adjust all dependencies.
21969
77aee789
AD
219702000-10-20 Akim Demaille <akim@epita.fr>
21971
21972 * lib/quote.h (PARAMS): New macro. Use it.
21973
43591cec
AD
219742000-10-16 Akim Demaille <akim@epita.fr>
21975
21976 * src/output.c (output_short_or_char_table): New function.
21977 (output_short_table, output_token_translations): Use it.
21978 (goto_actions): Use output_short_table.
21979
1e9798d5
AD
219802000-10-16 Akim Demaille <akim@epita.fr>
21981
21982 * src/symtab.c (bucket_new): New function.
21983 (getsym): Use it.
21984
21985 * src/output.c (output_short_table): New argument to display the
21986 comment associated with the table.
21987 Adjust dependencies.
21988 (output_gram): Use it.
21989 (output_rule_data): Nicer output layout for YYTNAME.
21990
f282676b
AD
219912000-10-16 Akim Demaille <akim@epita.fr>
21992
21993 * src/lex.c (read_typename): New function.
21994 (lex): Use it.
21995 * src/reader.c (copy_dollar): Likewise.
21996
550a72a3
AD
219972000-10-16 Akim Demaille <akim@epita.fr>
21998
21999 * src/reader.c (copy_comment2): Expect the input stream to be on
22000 the `/' which is suspected to open a comment, instead of being
22001 called after `//' or `/*' was read.
22002 (copy_comment, copy_definition, parse_union_decl, copy_action)
22003 (copy_guard): Adjust.
22004
131e2fef
AD
220052000-10-16 Akim Demaille <akim@epita.fr>
22006
22007 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
22008 `read_signed_integer'.
22009
79282c5a
AD
220102000-10-16 Akim Demaille <akim@epita.fr>
22011
22012 * src/reader.c (copy_dollar): New function.
22013 (copy_guard, copy_action): Use it.
22014
ff4a34be
AD
220152000-10-16 Akim Demaille <akim@epita.fr>
22016
22017 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
22018 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
22019 New files, from Fileutils 4.0.27.
22020 * src/main.c (printable_version): Remove.
22021 * src/lex.c, src/reader.c: Use `quote'.
22022
220232000-10-04 Akim Demaille <akim@epita.fr>
22024
22025 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
22026
14ded682
AD
220272000-10-04 Akim Demaille <akim@epita.fr>
22028
22029 * doc/bison.texinfo: Various typos spotted by Neil Booth.
22030
8e03724b
AD
220312000-10-04 Akim Demaille <akim@epita.fr>
22032
22033 When a literal string is used to define two different tokens,
22034 `bison -v' segfaults.
22035 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
22036
22037 * tests/regression.m4: New file.
22038 Include the core of the sample provided by Piotr Gackiewicz.
22039 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
22040 properly.
22041
a9e64249
AD
220422000-10-04 Akim Demaille <akim@epita.fr>
22043
22044 * src/reader.c (parse_expect_decl): Keep `count' within the size
22045 of `buffer'.
22046 From Neil Booth.
22047
da9abf43
AD
220482000-10-02 Paul Eggert <eggert@twinsun.com>
22049
22050 * bison.s1 (yyparse): Assign the default value
22051 unconditionally, to avoid a GCC warning and make the parser a
22052 tad smaller.
22053
c33638bb
AD
220542000-10-02 Akim Demaille <akim@epita.fr>
22055
22056 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
22057 options.
22058
444c570a
AD
220592000-10-02 Akim Demaille <akim@epita.fr>
22060
22061 * src/derives.c, src/print.c, src/reduce.c: To ease the
22062 translation, move some `\n' out of the translated strings.
22063
89cab50d
AD
220642000-10-02 Akim Demaille <akim@epita.fr>
22065
22066 The location tracking mechanism is precious for parse error
22067 messages. Nevertheless, it is enabled only when `@n' is used in
22068 the grammar, which is a different issue (you can use it in error
22069 message, but not in the grammar per se). Therefore, there should
22070 be another means to enable it.
22071
22072 * src/getargs.c (getargs): Support `--locations'.
22073 (usage): Report it.
22074 * src/getargs.h (locationsflag): Export it.
22075 * src/lex.c (percent_table): Support `%locations'.
22076 * src/reader.c (yylsp_needed): Remove this variable, now replaced
22077 with `locationsflag'.
22078 * doc/bison.texinfo: Document `--locations' and `%locations'.
22079 Sort the options.
22080 * tests/calc.m4: Test it.
22081
22082 For regularity of the names, replace each
22083 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
22084 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
22085 In addition replace each `flag' with `_flag'.
22086
d6c2cba0
AD
220872000-10-02 Akim Demaille <akim@epita.fr>
22088
22089 Also test parse error messages, including with YYERROR_VERBOSE.
22090
22091 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
22092 associative).
22093 Use it to check the computations.
22094 Use it to check `nonassoc' is honored.
22095 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
22096 `--yyerror-verbose'.
22097 (_AT_CHECK_CALC): Adjust to this option.
22098 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
22099
5a35a6cb
AD
221002000-10-02 Akim Demaille <akim@epita.fr>
22101
22102 Test also `--verbose', `--defines' and `--name-prefix'. Testing
22103 the latter demonstrates a flaw in the handling of non debugging
22104 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
22105 was used in order to simplify:
22106
22107 #if YYDEBUG
22108 if (yydebug)
22109 {
22110 ...
22111 }
22112 #endif
22113
22114 into
22115
22116 if (yydebug)
22117 {
22118 ...
22119 }
22120
22121 unfortunately this leads to a CPP conflict when
22122 `--name-prefix=foo' is used since it produces `#define yydebug
22123 foodebug'.
22124
22125 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
22126 (YYDPRINTF): New macro.
22127 Spread its use.
22128 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
22129 the bison options.
22130 Also test `--verbose', `--defines' and `--name-prefix'.
22131
71da9eea
AD
221322000-10-02 Akim Demaille <akim@epita.fr>
22133
22134 Improve the readability of the produced parsers.
22135
22136 * src/bison.s1: Formatting changes.
22137 Improve the comment related to the `$' mark.
22138 (yydefault): Don't fall through to `yyresume': `goto' there.
22139 * src/output.c (output_parser): When the `$' is met, skip the end
22140 of its line.
22141 New variable, `number_of_dollar_signs', to check there's exactly
22142 one `$' in the parser skeleton.
22143
95e36146
AD
221442000-10-02 Akim Demaille <akim@epita.fr>
22145
22146 * lib/xstrdup.c: New file, from the fileutils.
22147 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
22148 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
22149 instead of strlen + xmalloc + strcpy.
22150 * src/symtab.c (copys): Remove, use xstrdup instead.
22151
d7020c20
AD
221522000-10-02 Akim Demaille <akim@epita.fr>
22153
22154 * src/gram.h (associativity): New enum type which replaces the
22155 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
22156 `right_assoc', `left_assoc' and `non_assoc'.
22157 Adjust all dependencies.
22158 * src/reader.c: Formatting changes.
22159 (LTYPESTR): Don't define it, use it as a literal in
22160 `reader_output_yylsp'.
22161 * src/symtab.h (symbol_class): New enum type which replaces the
22162 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
22163 `sunknown', `stoken and `snterm'.
22164
1916f98e
AD
221652000-10-02 Akim Demaille <akim@epita.fr>
22166
22167 * src/getargs.c (fixed_outfiles): Rename as...
22168 (yaccflag): for consistency and accuracy.
22169 Adjust dependencies.
22170
d7913476
AD
221712000-10-02 Akim Demaille <akim@epita.fr>
22172
22173 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
22174 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
22175 difficult and introduced a lot of core dump. It turns out that
22176 Bison used an implementation of `xmalloc' based on `calloc', and
22177 at various places it does depend upon the initialization to 0. I
22178 have not tried to isolate the pertinent places, and all the former
22179 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
22180 someone should address this issue.
22181
22182 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
22183 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
22184 files.
22185 Adjust dependencies.
22186 * src/warshall.h: New file.
22187 Propagate.
22188
340ef489
AD
221892000-10-02 Akim Demaille <akim@epita.fr>
22190
22191 Various anti-`extern in *.c' changes.
22192
22193 * src/system.h: Include `assert.h'.
22194
b2ca4022
AD
221952000-10-02 Akim Demaille <akim@epita.fr>
22196
22197 * src/state.h (nstates, final_state, first_state, first_shift)
22198 (first_reduction): Move their exportation from here...
22199 * src/LR0.h: to here.
22200 Adjust dependencies.
22201 * src/getargs.c (statisticsflag): New variable.
22202 Add support for `--statistics'.
22203 Adjust dependencies.
22204
22205 Remove a lot of now useless `extern' statements in most files.
22206
403b315b
AD
222072000-10-02 Akim Demaille <akim@epita.fr>
22208
22209 * src/LR0.h: New file.
22210 Propagate its use.
22211
07a58c13
AD
222122000-10-02 Akim Demaille <akim@epita.fr>
22213
22214 * src/print.h: New file.
22215 Propagate its use.
22216 * src/print.c: Formatting and ordering changes.
22217 (verbose, terse): Replace with...
22218 (print_results): this new function.
22219 Adjust dependencies.
22220
0619caf0
AD
222212000-10-02 Akim Demaille <akim@epita.fr>
22222
22223 * src/conflicts.c (conflict_report): New function.
22224 (conflict_log, verbose_conflict_log): Replace with...
22225 (print_conflicts): this function.
22226 Adjust dependencies.
22227 * src/conflicts.h: New file.
22228 Propagate its inclusion.
22229
3519ec76
AD
222302000-10-02 Akim Demaille <akim@epita.fr>
22231
22232 * src/nullable.h: New file.
22233 Propagate its inclusion.
22234 * src/nullable.c: Formatting changes.
22235
015acc48
AD
222362000-10-02 Akim Demaille <akim@epita.fr>
22237
22238 * src/reduce.h: New file.
22239 Propagate its inclusion.
22240 * src/reduce.c: Topological sort and other formatting changes.
22241 (bool, TRUE, FALSE): Move their definition to...
22242 * src/system.h: here.
22243
8963a27b
AD
222442000-10-02 Akim Demaille <akim@epita.fr>
22245
22246 * src/files.c: Formatting changes.
22247 (tryopen, tryclose, openfiles): Rename as...
22248 (xfopen, xfclose, open_files): this.
22249 (stringappend): static.
22250 * src/files.h: Complete the list of exported symbols.
22251 Propagate its use.
22252
a70083a3
AD
222532000-10-02 Akim Demaille <akim@epita.fr>
22254
22255 * src/reader.h: New file.
22256 Propagate its use instead of tedious list of `extern' and
22257 prototypes.
22258 * src/reader.c: Formatting changes, topological sort,
22259 s/register//.
22260
abadc117
AD
222612000-10-02 Akim Demaille <akim@epita.fr>
22262
22263 * src/lex.h: Prototype `lex.c' exported functions.
22264 * src/reader.c: Adjust.
22265 * src/lex.c: Formatting changes.
22266 (safegetc): Rename as...
22267 (xgetc): this.
22268
720d742f
AD
222692000-10-02 Akim Demaille <akim@epita.fr>
22270
22271 * src/lalr.h: New file.
22272 Propagate its inclusion instead of prototypes and `extern'.
22273 * src/lalr.c: Formatting changes, topological sorting etc.
22274
f2acea59
AD
222752000-10-02 Akim Demaille <akim@epita.fr>
22276
22277 * src/output.c (token_actions): Introduce a temporary array,
22278 YYDEFACT, that makes it possible for this function to use
22279 output_short_table.
22280
d019d655
AD
222812000-10-02 Akim Demaille <akim@epita.fr>
22282
22283 `user_toknums' is output as a `short[]' in `output.c', while it is
22284 defined as a `int[]' in `reader.c'. For consistency with the
22285 other output tables, `user_toknums' is now defined as a table of
22286 shorts.
22287
22288 * src/reader.c (user_toknums): Be a short table instead of an int
22289 table.
22290 Adjust dependencies.
22291
22292 Factor the short table outputs.
22293
22294 * src/output.c (output_short_table): New function.
22295 * src/output.c (output_gram, output_stos, output_rule_data)
22296 (output_base, output_table, output_check): Use it.
22297
6c89f1c1
AD
222982000-10-02 Akim Demaille <akim@epita.fr>
22299
22300 * src/output.c (output): Topological sort of the functions, in
22301 order to get rid of the `static' prototypes.
22302 No longer use `register'.
22303 * src/output.h: New file.
22304 Propagate its inclusion in files explicitly prototyping functions
22305 from output.c.
22306
d9efd181
AD
223072000-09-21 Akim Demaille <akim@epita.fr>
22308
22309 * src/atgeneral.m4: Update from Autoconf.
22310
c29240e7 223112000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
22312
22313 * src/closure.h: New file.
22314 * src/closure.c: Formatting changes, topological sort over the
22315 functions, use of closure.h.
22316 (initialize_closure, finalize_closure): Rename as...
22317 (new_closure, free_closure): these. Adjust dependencies.
22318 * src/LR0.c: Formatting changes, topological sort, use of
22319 cloture.h.
22320 (initialize_states): Rename as...
22321 (new_states): this.
22322 * src/Makefile.am (noinst_HEADERS): Adjust.
22323
499daa50
AD
223242000-09-20 Akim Demaille <akim@epita.fr>
22325
22326 * src/acconfig.h: Don't protect config.h against multiple
22327 inclusion.
22328 Don't define PARAMS.
22329 * src/system.h: Define PARAMS.
22330 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
22331 purpose of config.h. system.h must not try to fix wrong
22332 definitions in config.h.
22333
cc84fd5d
AD
223342000-09-20 Akim Demaille <akim@epita.fr>
22335
22336 * src/derives.h: New file.
22337 * src/main.c, src/derives.h: Use it.
22338 Formatting changes.
22339 * src/Makefile.am (noinst_HEADERS): Adjust.
22340
db5b3a89
AD
223412000-09-20 Akim Demaille <akim@epita.fr>
22342
22343 * tests/atgeneral.m4: Update from Autoconf.
22344 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
22345 (AT_CHECK_CALC): New macros.
22346 Use these macros to test bison with options `', `--raw',
22347 `--debug', `--yacc', `--yacc --debug'.
22348
ceed8467
AD
223492000-09-19 Akim Demaille <akim@epita.fr>
22350
22351 * src/output.c: Formatting changes.
22352 * src/machine.h: Remove, leaving its contents in...
22353 * src/system.h: here.
22354 Include stdio.h.
22355 Adjust all dependencies on stdio.h and machine.h.
22356 * src/getargs.h: New file.
22357 Let all `extern' declarations about getargs.c be replaced with
22358 inclusion of `getargs.h'.
22359 * src/Makefile.am (noinst_HEADERS): Adjust.
22360
22361 * tests/calc.m4 (yyin): Be initialized in main, not on the global
22362 scope.
22363 (yyerror): Returns void, not int.
22364 * doc/bison.texinfo: Formatting changes.
22365
05a1d24b
AD
223662000-09-19 Akim Demaille <akim@epita.fr>
22367
22368 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
22369 portable.
22370
cbd25751
AD
223712000-09-18 Akim Demaille <akim@epita.fr>
22372
22373 * configure.in: Append WARNING_CFLAGS to CFLAGS.
22374 * src/Makefile.am (INCLUDES): Don't.
22375 Be ready to fetch headers in lib/.
22376
13863333
AD
223772000-09-18 Akim Demaille <akim@epita.fr>
22378
22379 * doc/bison.texinfo: Update the copyright.
22380 ANSIfy and GNUify the examples.
22381 Remove the old menu.
22382
0d533154
AD
223832000-09-18 Akim Demaille <akim@epita.fr>
22384
22385 First set of tests: use the `calc' example from the documentation.
22386
22387 * src/bison.s1 (yyparse): Condition the code using `yytname' which
22388 is defined only when YYDEBUG is.
22389 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
22390 * src/files.c (tryopen, tryclose): Formatting changes.
22391 Move to the top and be static.
22392 * src/reader.c (read_signed_integer): Likewise.
22393 * tests/calc.m4: New file.
22394 * Makefile.am, suite.m4: Adjust.
22395 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
22396
e79137ac
AD
223972000-09-18 Akim Demaille <akim@epita.fr>
22398
22399 Add support for an Autotest test suite for Bison.
22400
22401 * m4/m4.m4, m4/atconfig.m4: New files.
22402 * m4/Makefile.am (EXTRA_DIST): Adjust.
22403 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
22404 files.
22405 * src/getargs.c: Display a more standard --version message.
22406 * src/reader.c (reader): Formatting changes.
22407 No longer depend upon VERSION_STRING.
22408 * configure.in: No longer use `dnl'.
22409 Set up the test suite and the new directory `tests/.
22410 (VERSION_STRING): Remove.
22411
27821bff
AD
224122000-04-14 Akim Demaille <akim@epita.fr>
22413
22414 * src/reader.c (copy_comment2): New function, same as former
22415 `copy_comment', but outputs into two FILE *.
22416 (copy_comment): Use it.
22417 (parse_union_decl): Use it.
22418 (get_type, parse_start_decl): Use the same `invalid' message.
22419 (parse_start_decl, parse_union_decl): Use the same `multiple'
22420 message.
22421 (parse_union_decl, copy_guard, copy_action): Use the same
22422 `unmatched' message.
22423 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
22424
cfe5fbc0
AD
224252000-03-31 Akim Demaille <akim@epita.fr>
22426
22427 * src/files.c (tryopen, tryclose): Move to the top.
22428 Be static.
22429
cb7db13e
AD
224302000-03-31 Akim Demaille <akim@epita.fr>
22431
22432 * src/main.c (main): Don't call `done', exit does it.
22433
a0f6b076
AD
224342000-03-31 Akim Demaille <akim@epita.fr>
22435
36281465
AD
22436 * allocate.c: s/return (foo)/return foo/.
22437 * lalr.c: Likewise.
22438 * LR0.c: Likewise.
22439 * output.c: Likewise.
22440 * reader.c: Likewise.
22441 * symtab.c: Likewise.
22442 * vmsgetargs.c: Likewise.
22443
224442000-03-31 Akim Demaille <akim@epita.fr>
22445
22446 Clean up the error reporting functions.
a0f6b076
AD
22447
22448 * src/report.c: New file.
22449 * src/report.h: Likewise.
22450 * src/Makefile.am: Adjust.
22451 * m4/error.m4: New file.
22452 * m4/Makefile.am: Adjust.
22453 * configure.in (jm_PREREQ_ERROR): Call it.
22454 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
22455 Remove.
22456 (fatal, fatals): Remove. All callers use complain.c::fatal.
22457 (warn, warni, warns, warnss, warnss): Remove. All callers use
22458 complain.c::complain.
22459 (toomany): Remove, use fatal instead.
22460 * src/files.c (done): No argument, use complain_message_count.
22461 * src/main.c (main): Register `done' to `atexit'.
22462
22463 * src/getargs.c (usage): More `fputs', less `fprintf'.
22464
18539825
AD
224652000-03-28 Akim Demaille <akim@epita.fr>
22466
22467 * lib/: New directory.
22468 * Makefile.am (SUBDIRS): Adjust.
22469 * configure.in: Adjust.
22470 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
22471 useless.
22472 * src/alloca.c: Moved to lib/.
22473 * src/getopt.c: Likewise.
22474 * src/getopt1.c: Likewise.
22475 * src/getopt.h: Likewise.
22476 * src/ansi2knr.c: Likewise.
22477 * src/ansi2knr.1: Likewise.
22478 * src/Makefile.am: Adjust.
22479 * lib/Makefile.am: New file.
22480
9f306f2a
AD
224812000-03-28 Akim Demaille <akim@epita.fr>
22482
22483 * src/getargs.c (usage): Refresh the help message.
22484
0ba347b6
AD
224852000-03-17 Akim Demaille <akim@epita.fr>
22486
22487 * src/getopt1.c: Updated from textutils 2.0e
22488 * src/getopt.c: Likewise.
22489 * src/getopt.h: Likewise.
22490
dbe7f271
AD
224912000-03-17 Akim Demaille <akim@epita.fr>
22492
22493 * src/Makefile.am (bison.simple): Fix the awk program: quote only
22494 the file name, not the whole `#line LINE FILE'.
22495
75bbe78d
AD
224962000-03-17 Akim Demaille <akim@epita.fr>
22497
22498 On syntax errors, report the token on which we choked.
22499
aa5fd0ee
AD
22500 * src/bison.s1 (yyparse): In the label yyerrlab, when
22501 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 22502
7b306f52
AD
225032000-03-17 Akim Demaille <akim@epita.fr>
22504
aa5fd0ee 22505 * src/reader.c (copy_at): New function.
7b306f52
AD
22506 (copy_guard): Use it.
22507 (copy_action): Use it.
22508
e87b5700
AD
225092000-03-17 Akim Demaille <akim@epita.fr>
22510
22511 Be kind to translators, save some useless translations.
22512
aa5fd0ee 22513 * src/main.c (banner): New function.
e87b5700
AD
22514 (fatal_banner): Use it.
22515 (warn_banner): Use it.
22516
ae3c3164
AD
225172000-03-17 Akim Demaille <akim@epita.fr>
22518
aa5fd0ee
AD
22519 * src/reader.c (copy_definition): Use copy_string and
22520 copy_comment. Removed now unused `match', `ended',
22521 `cplus_comment'.
ae3c3164
AD
22522 (copy_comment, copy_string): Moved, to be visible from
22523 copy_definition.
22524
4dc58e7c
AD
225252000-03-17 Akim Demaille <akim@epita.fr>
22526
aa5fd0ee
AD
22527 * src/reader.c (copy_string): Declare `static inline'. No
22528 problems with inline, since it is checked by configure.
4dc58e7c
AD
22529 (copy_comment): Likewise.
22530
0a6384c4
AD
225312000-03-17 Akim Demaille <akim@epita.fr>
22532
aa5fd0ee 22533 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 22534
3cef001a
AD
225352000-03-17 Akim Demaille <akim@epita.fr>
22536
aa5fd0ee 22537 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
22538 (copy_action): Use it. Removed now unused `match', `ended',
22539 `cplus_comment'.
22540 (copy_guard): Likewise.
22541
ca36d2ef
AD
225422000-03-17 Akim Demaille <akim@epita.fr>
22543
aa5fd0ee 22544 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
22545 (copy_action): Use it.
22546 (copy_guard): Likewise.
22547
6666f98f
AD
225482000-03-17 Akim Demaille <akim@epita.fr>
22549
22550 Change the handling of @s so that they behave exactly like $s.
22551 There is now a pseudo variable @$ (readble and writable), location
22552 of the lhs of the rule (by default ranging from the location of
22553 the first symbol of the rhs, to the location of the last symbol,
22554 or, if the rhs is empty, YYLLOC).
22555
22556 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
22557 yyval.
22558 (yyparse): When providing a default semantic action, provide a
22559 default location action.
22560 (after the $): No longer change `*YYLSP', just stack YYLOC the
22561 same way you stack YYVAL.
22562 * src/reader.c (read_declarations): Use warns.
22563 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
22564 (copy_action, case '@'): Likewise.
22565 Use a standard error message, to save useless work from
22566 translators.
22567
41aca2e0
AD
225682000-03-17 Akim Demaille <akim@epita.fr>
22569
aa5fd0ee
AD
22570 * src/bison.s1: Formatting and cosmetics changes.
22571 * src/reader.c: Likewise.
41aca2e0
AD
22572 Update the Copyright notice.
22573
dc08c1d5
AD
225742000-03-17 Akim Demaille <akim@epita.fr>
22575
aa5fd0ee
AD
22576 * src/bison.s1 (#line): All set to `#line' only, since the
22577 Makefile now handles them.
dc08c1d5 22578
9ee3c97b
AD
225792000-03-16 Akim Demaille <akim@epita.fr>
22580
22581 * src/output.c (output_rule_data): Output the documentation of
22582 some of the tables.
22583 (Copyright notice): Update.
22584 Formatting changes.
22585
0de741ca
AD
225862000-03-16 Akim Demaille <akim@epita.fr>
22587
22588 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
22589 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
22590 One `#if YYDEBUG' remains, since it uses variables which are
22591 defined only if `YYDEBUG != 0'.
22592
bb10be54
AD
225932000-03-16 Akim Demaille <akim@epita.fr>
22594
22595 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
22596 and related variables so that the similarities are highlighted.
22597
b07b484a
AD
225982000-03-16 Akim Demaille <akim@epita.fr>
22599
22600 * src/bison.s1: Properly indent CPP directives.
22601
361f60b3
AD
226022000-03-16 Akim Demaille <akim@epita.fr>
22603
22604 * src/bison.s1: Properly indent the `alloca' CPP section.
22605
8c44d3ec
AD
226062000-03-16 Akim Demaille <akim@epita.fr>
22607
22608 Do not hard code values of directories in `configure.in'.
22609 Update the `configure' tool chain.
22610
22611 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
22612 src/makefile.am.
22613 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
22614 (AC_OUTPUT): Add m4/Makefile.
22615 Bump to bison 1.28a, 1.29 has never been released.
22616 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
22617 handled via src/Makefile.am.
22618 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
22619 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
22620 autoheader.
22621 * Makefile.am (SUBDIRS): Add m4.
22622 (ACLOCAL_AM_FLAGS): New variable.
22623 (AUTOMAKE_OPTIONS): Add check-news.
22624 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
22625 the proper line number and file name.
22626 (DEFS): Propagate the location of bison library files and of the
22627 locale files.
22628 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
22629 builddir.
22630 * acinclude.m4: Remove, replaced by the directory m4.
22631 * m4/Makefile.am (EXTRA_DIST): New variable.
22632 * m4/gettext.m4: New file, from the fileutils.
22633 * m4/lcmessage.m4: Likewise
22634 * m4/progtest.m4: Likewise.
22635 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
22636
f95997e7
AD
226372000-03-10 Akim Demaille <akim@epita.fr>
22638
22639 * src/closure.c:
22640 Formatting changes of various comments.
22641 Respect the GNU coding standards at various places.
22642 Don't use `_()' when no translation is needed.
22643
226441999-12-13 Jesse Thilo <jthilo@gnu.org>
22645
22646 * src/files.c:
22647 OS/2 honors TMPDIR environment variable.
22648
226491999-12-13 Jesse Thilo <jthilo@gnu.org>
22650
22651 * doc/bison.texinfo: Tweaked spelling and grammar.
22652 Updated ISBN.
22653 Removed reference to price of printed copy.
22654 Mention BISON_SIMPLE and BISON_HAIRY.
22655
226561999-12-13 Jesse Thilo <jthilo@gnu.org>
22657
22658 * configure.in, NEWS:
22659 Bison 1.29 released.
22660
226611999-10-27 Jesse Thilo <jthilo@gnu.org>
22662
22663 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
22664 Added reference card.
22665
226661999-07-26 Jesse Thilo <jthilo@gnu.org>
22667
22668 * po/ru.po: Added Russian translation.
22669
226701999-07-26 Jesse Thilo <jthilo@gnu.org>
22671
22672 * configure.in: Added Russian translation.
22673
226741999-07-06 Jesse Thilo <jthilo@gnu.org>
22675
22676 * configure.in, NEWS, README:
22677 Released version 1.28.
22678
226791999-06-14 Jesse Thilo <jthilo@gnu.org>
22680
22681 * src/system.h:
22682 Squashed redefinition warning on some systems.
22683
22684 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
22685 Have configure build version string instead of relying on ANSI string
22686 concatentation.
22687
226881999-06-14 Jesse Thilo <jthilo@gnu.org>
22689
22690 * po/POTFILES.in: Got rid of version.c.
22691
226921999-06-14 Jesse Thilo <jthilo@gnu.org>
22693
22694 * acconfig.h, configure.in:
22695 Have configure build version string instead of relying on ANSI string
22696 concatentation.
22697
226981999-06-08 Jesse Thilo <jthilo@gnu.org>
22699
22700 * doc/bison.1:
22701 Dropped mention of `+' for long-named options.
22702
227031999-05-30 Jesse Thilo <jthilo@gnu.org>
22704
22705 * src/files.c: Added <unistd.h> for unlink().
22706
22707 * src/Makefile.am, src/system.h:
22708 I18n fixes.
22709
227101999-05-30 Jesse Thilo <jthilo@gnu.org>
22711
22712 * README: Added a FAQ list.
22713
22714 * configure.in, acconfig.h:
22715 I18n fixes.
22716
227171999-05-30 Jesse Thilo <jthilo@gnu.org>
22718
22719 * doc/FAQ, doc/Makefile.am:
22720 Added a FAQ list.
22721
227221999-05-19 Jesse Thilo <jthilo@gnu.org>
22723
22724 * src/alloc.h, src/symtab.h, src/version.c:
22725 Protected inclusion of "config.h" with HAVE_CONFIG_H.
22726
227271999-04-18 Jesse Thilo <jthilo@gnu.org>
22728
22729 * src/.cvsignore, src/Makefile.am:
22730 Reorganized: sources in `src', documentation in `doc'.
22731
22732 * src/lex.c (literalchar):
22733 fixed the code for escaping double quotes (thanks
22734 Jonathan Czisny.)
22735
227361999-04-18 Jesse Thilo <jthilo@gnu.org>
22737
22738 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
22739 Adjusted paths to reflect directory reorganization.
22740
227411999-04-18 Jesse Thilo <jthilo@gnu.org>
22742
22743 * doc/.cvsignore, doc/Makefile.am:
22744 Reorganized: sources in `src', documentation in `doc'.
22745
227461999-04-18 Jesse Thilo <jthilo@gnu.org>
22747
22748 * configure.in:
22749 Updated AC_INIT file to reflect directory reorganization.
22750
22751 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
22752 Reorganized: sources in `src', documentation in `doc'.
22753
227541999-04-13 Jesse Thilo <jthilo@gnu.org>
22755
22756 * src/allocate.c:
22757 Don't declare calloc() and realloc() if not necessary.
22758
227591999-04-13 Jesse Thilo <jthilo@gnu.org>
22760
22761 * configure.in, acconfig.h, acinclude.m4:
22762 Don't declare calloc() and realloc() if not necessary.
22763
227641999-03-23 Jesse Thilo <jthilo@gnu.org>
22765
22766 * po/.cvsignore: Added i18n support.
22767
227681999-03-23 Jesse Thilo <jthilo@gnu.org>
22769
22770 * acconfig.h, configure.in, Makefile.am:
22771 Added i18n support.
22772
227731999-03-22 Jesse Thilo <jthilo@gnu.org>
22774
22775 * src/bison.s1: Fixed #line numbers.
22776
227771999-03-15 Jesse Thilo <jthilo@gnu.org>
22778
22779 * po/es.po, po/fr.po, po/nl.po, po/de.po:
22780 Added PO files from Translation Project.
22781
227821999-03-03 Jesse Thilo <jthilo@gnu.org>
22783
22784 * Makefile.am:
22785 Added support for non-ANSI compilers (ansi2knr).
22786
227871999-02-16 Jesse Thilo <jthilo@gnu.org>
22788
22789 * configure.in: Bumped version number to 1.27.
22790
22791 * Makefile.am:
22792 Added `bison.simple' to list of files removed by `make distclean'.
22793
227941999-02-12 Jesse Thilo <jthilo@gnu.org>
22795
22796 * src/files.c, src/files.h:
22797 Defined locations of parser files in config.h instead of Makefile.
22798
227991999-02-12 Jesse Thilo <jthilo@gnu.org>
22800
22801 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
22802 Defined locations of parser files in config.h instead of Makefile.
22803
228041999-02-09 Jesse Thilo <jthilo@gnu.org>
22805
22806 * Makefile.am:
22807 Removed inappropriate use of $< macro.
22808
228091999-02-05 Jesse Thilo <jthilo@gnu.org>
22810
22811 * po/Makefile.in.in, po/POTFILES.in:
22812 Add `po' directory skeleton.
22813
228141999-01-27 Jesse Thilo <jthilo@gnu.org>
22815
22816 * README: Document help-bison list.
22817
22818 * configure.in: Add check for mkstemp().
22819
228201999-01-20 Jesse Thilo <jthilo@gnu.org>
22821
22822 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
22823 Hush a few compiler warnings.
22824
22825 * src/files.c:
22826 Add tryclose(), which verifies that fclose was successful.
22827 Hush a couple of compiler warnings.
22828
228291999-01-20 Jesse Thilo <jthilo@gnu.org>
22830
22831 * Makefile.am, OChangeLog:
22832 ChangeLog is now automatically generated. Include the old version as
22833 OChangeLog.
22834
228351999-01-14 Jesse Thilo <jthilo@gnu.org>
22836
22837 * 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:
22838 Update FSF address.
22839
228401999-01-14 Jesse Thilo <jthilo@gnu.org>
22841
22842 * doc/bison.texinfo: Fix formatting glitch.
22843
22844 * doc/bison.texinfo: Update FSF address.
22845
228461999-01-14 Jesse Thilo <jthilo@gnu.org>
22847
22848 * acconfig.h: Update FSF address.
22849
228501999-01-08 Jesse Thilo <jthilo@gnu.org>
22851
22852 * src/system.h:
22853 Don't define PACKAGE here, since config.h defines it.
22854
228551998-12-30 Jesse Thilo <jthilo@gnu.org>
22856
22857 * src/reader.c: Update copyright date.
22858
22859 * src/main.c:
22860 Ditch sprintf to statically-sized buffers in fatal/warn functions in
22861 favor of output directly to stderr (avoids buffer overruns).
22862
22863 * src/reader.c: Some checks for premature EOF.
22864
22865 * 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:
22866 Use prototypes if the compiler understands them.
22867
22868 * src/files.c: Honor TMPDIR on Unix hosts.
22869 Use prototypes if the compiler understands them.
22870
22871 * src/reader.c:
22872 Fix a couple of buffer overrun bugs.
22873 Use prototypes if the compiler understands them.
22874
22875 * src/system.h: Include unistd.h and ctype.h.
22876 Use #ifdef instead of #if for NLS symbols.
22877
228781998-12-30 Jesse Thilo <jthilo@gnu.org>
22879
22880 * doc/bison.texinfo:
22881 Delete comment "consider using @set for edition number, etc..." since
22882 we now are doing so.
22883
228841998-12-30 Jesse Thilo <jthilo@gnu.org>
22885
22886 * configure.in:
22887 Use prototypes if the compiler understands them.
22888
22889 * NEWS: Document 1.26 highlights.
22890
22891 * Makefile.am: Require Automake 1.3 or later.
22892
22893 * acconfig.h:
22894 Use prototypes if the compiler understands them.
22895
228961998-12-29 Jesse Thilo <jthilo@gnu.org>
22897
22898 * src/version.c:
22899 Use VERSION symbol from automake for version number.
22900
229011998-12-29 Jesse Thilo <jthilo@gnu.org>
22902
22903 * acconfig.h, configure.in, version.cin:
22904 Use VERSION symbol from automake for version number.
22905
229061998-11-28 Jesse Thilo <jthilo@gnu.org>
22907
22908 * Makefile.am:
22909 Distribute original version of simple parser (bison.s1), not built
22910 version (bison.simple).
22911
229121998-11-28 Jesse Thilo <jthilo@gnu.org>
22913
22914 * doc/bison.texinfo: Add info dir entry.
22915
22916 * doc/bison.texinfo:
22917 Let automake put version number into documentation.
22918
229191998-11-26 Jesse Thilo <jthilo@gnu.org>
22920
22921 * src/bison.cld, src/build.com, src/vmshlp.mar:
22922 Add non-RCS files from /gd/gnu/bison.
22923
229241998-11-26 Jesse Thilo <jthilo@gnu.org>
22925
22926 * doc/bison.1:
22927 Document the BISON_HAIRY and BISON_SIMPLE variables.
22928
229291998-11-25 Jesse Thilo <jthilo@gnu.org>
22930
22931 * src/version.c: Build version.c automatically.
22932
22933 * src/reader.c:
22934 Fix token numbering (used to start at 258, not 257).
22935
22936 * src/system.h: Include config.h.
22937
22938 * src/getargs.c: Update bug report address.
22939
22940 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
22941 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
22942
229431998-11-25 Jesse Thilo <jthilo@gnu.org>
22944
22945 * Makefile.am:
22946 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
22947
22948 * configure.in, version.cin:
22949 Build version.c automatically.
22950
22951 * AUTHORS: Add AUTHORS file.
22952
22953 * README: Update bug report address.
22954
22955 * bison.simple:
22956 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
22957
22958 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
22959 Add automake stuff.
22960
229611998-11-25 Jesse Thilo <jthilo@gnu.org>
22962
22963 * doc/bison.texinfo: Clean up some formatting.
22964
229651998-05-05 Richard Stallman <rms@gnu.org>
22966
22967 * doc/bison.texinfo:
22968 Explain better why to make a pure parser.
22969
229701998-01-05 Richard Stallman <rms@gnu.org>
22971
22972 * src/files.c (openfiles):
22973 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
22974 find a temporary directory, if possible. Do not unlink files while
22975 they are open.
22976
229771997-08-25 Richard Stallman <rms@gnu.org>
22978
22979 * src/reader.c (stack_offset;):
22980 Change some warni to warns.
22981
22982 * src/lex.c (literalchar): Use warns, not warni.
22983
229841997-06-28 Richard Stallman <rms@gnu.org>
22985
22986 * src/bison.s1: Add a Bison version comment.
22987
22988 * src/main.c (fatal, warn, berror):
22989 Use program_name.
22990
229911997-06-28 Richard Stallman <rms@gnu.org>
22992
22993 * Makefile.in (bison_version): New variable.
22994 (dist): Use that variable.
22995 (bison.s1): Substitute the Bison version into bison.simple.
22996
22997 * bison.simple: Add a Bison version comment.
22998
229991997-06-18 Richard Stallman <rms@gnu.org>
23000
23001 * src/main.c (fatal, warn, berror):
23002 Make error messages standard.
23003 (toomany): Improve error message text.
23004
23005 * 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:
23006 new.h renamed to alloc.h.
23007
230081997-06-18 Richard Stallman <rms@gnu.org>
23009
23010 * Makefile.in: new.h renamed to alloc.h.
23011
230121997-05-24 Richard Stallman <rms@gnu.org>
23013
23014 * src/lex.c (literalchar):
23015 Fix the code for escaping \, " and '.
23016
23017 (lex): Avoid trouble when there are many chars
23018 to discard in a char literal with just several chars in it.
23019
230201997-05-17 Richard Stallman <rms@gnu.org>
23021
23022 * src/bison.s1:
23023 Use malloc, if using alloca is troublesome.
23024 (YYSTACK_USE_ALLOCA): New flag macro.
23025 Define it for some systems and compilers.
23026 (YYSTACK_ALLOC): New macro.
23027 (yyparse): Use YYSTACK_ALLOC to allocate stack.
23028 If it was malloc'd, free it.
23029
230301997-05-17 Richard Stallman <rms@gnu.org>
23031
23032 * bison.simple:
23033 Use malloc, if using alloca is troublesome.
23034 (YYSTACK_USE_ALLOCA): New flag macro.
23035 Define it for some systems and compilers.
23036 (YYSTACK_ALLOC): New macro.
23037 (yyparse): Use YYSTACK_ALLOC to allocate stack.
23038 If it was malloc'd, free it.
23039
230401997-04-23 Richard Stallman <rms@gnu.org>
23041
23042 * src/bison.s1:
23043 (alloca) [__hpux]: Always define as __builtin_alloca.
23044
230451997-04-23 Richard Stallman <rms@gnu.org>
23046
23047 * bison.simple:
23048 (alloca) [__hpux]: Always define as __builtin_alloca.
23049
230501997-04-22 Richard Stallman <rms@gnu.org>
23051
23052 * src/bison.s1:
23053 [__hpux]: Include alloca.h (right for HPUX 10)
23054 instead of declaring alloca (right for HPUX 9).
23055
23056 * src/bison.s1 (__yy_memcpy):
23057 Declare arg `count' as unsigned int.
23058 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
23059
230601997-04-22 Richard Stallman <rms@gnu.org>
23061
23062 * bison.simple:
23063 [__hpux]: Include alloca.h (right for HPUX 10)
23064 instead of declaring alloca (right for HPUX 9).
23065
23066 * bison.simple (__yy_memcpy):
23067 Declare arg `count' as unsigned int.
23068 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
23069
230701997-01-03 Richard Stallman <rms@gnu.org>
23071
23072 * src/allocate.c: [__STDC__ or _MSC_VER]:
23073 Declare calloc and realloc to return void *.
23074
230751997-01-02 Richard Stallman <rms@gnu.org>
23076
23077 * src/system.h:
23078 [_MSC_VER]: Include stdlib.h and process.h.
23079 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
23080
23081 * src/main.c (main): Return FAILURE as a value.
23082 (printable_version): Declare arg as int, not char.
23083
230841997-01-02 Richard Stallman <rms@gnu.org>
23085
23086 * Makefile.in (dist):
23087 Explicitly check for symlinks, and copy them.
23088
230891996-12-19 Richard Stallman <rms@gnu.org>
23090
23091 * src/files.c:
23092 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
23093
230941996-12-18 Paul Eggert <eggert@gnu.org>
23095
23096 * src/bison.s1 (yyparse):
23097 If __GNUC__ and YYPARSE_PARAM are both defined,
23098 declare yyparse to have a void * argument.
23099
231001996-12-18 Paul Eggert <eggert@gnu.org>
23101
23102 * bison.simple (yyparse):
23103 If __GNUC__ and YYPARSE_PARAM are both defined,
23104 declare yyparse to have a void * argument.
23105
231061996-12-17 Richard Stallman <rms@gnu.org>
23107
23108 * src/reduce.c (nbits): Add some casts.
23109
231101996-08-12 Richard Stallman <rms@gnu.org>
23111
23112 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
23113
231141996-08-12 Richard Stallman <rms@gnu.org>
23115
23116 * bison.simple: Test _MSDOS as well as _MSDOS_.
23117
231181996-07-31 Richard Stallman <rms@gnu.org>
23119
23120 * src/bison.s1:
23121 [__sun && __i386]: Include alloca.h.
23122
231231996-07-31 Richard Stallman <rms@gnu.org>
23124
23125 * bison.simple:
23126 [__sun && __i386]: Include alloca.h.
23127
231281996-07-30 Richard Stallman <rms@gnu.org>
23129
23130 * src/bison.s1: Comment change.
23131
23132 * src/bison.s1: Test _MSDOS_, not MSDOS.
23133
231341996-07-30 Richard Stallman <rms@gnu.org>
23135
23136 * bison.simple: Comment change.
23137
23138 * bison.simple: Test _MSDOS_, not MSDOS.
23139
231401996-06-01 Richard Stallman <rms@gnu.org>
23141
23142 * 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:
23143 Insert `_' macro around many string constants.
23144
23145 * src/main.c:
23146 Insert `_' macro around many string constants.
23147
23148 (main): Call setlocale, bindtextdomain and textdomain.
23149
23150 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
23151 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
23152 [ENABLE_NLS]: Include libintl.h.
23153 [ENABLE_NLS] (gettext): Define.
23154 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
23155 (N_, PACKAGE, LOCALEDIR): New macros.
23156
231571996-06-01 Richard Stallman <rms@gnu.org>
23158
23159 * POTFILES.in: New file.
23160
23161 * Makefile.in (allocate.o):
23162 Define target explicitly.
23163
23164 * Makefile.in (CFLAGS): Set to @CFLAGS@.
23165 (LDFLAGS): Set to @LDFLAGS@.
23166 (configure): Run autoconf only if preceding `cd' succeeds.
23167 (bison.s1): Redirect output to temporary file then move the
23168 temporary to the target, rather than redirecting directly to bison.s1.
23169 (clean): Remove config.status and config.log.
23170 (distclean): Don't remove config.status here.
23171
231721996-05-12 Richard Stallman <rms@gnu.org>
23173
23174 * src/bison.s1:
23175 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
23176
231771996-05-12 Richard Stallman <rms@gnu.org>
23178
23179 * bison.simple:
23180 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
23181
231821996-05-11 Richard Stallman <rms@gnu.org>
23183
23184 * src/bison.s1 (__yy_memcpy):
23185 Really reorder the args, as was supposedly done on Feb 14 1995.
23186 (yyparse): Calls changed accordingly.
23187
231881996-05-11 Richard Stallman <rms@gnu.org>
23189
23190 * Makefile.in (dist): Don't use $(srcdir).
23191
23192 * bison.simple (__yy_memcpy):
23193 Really reorder the args, as was supposedly done on Feb 14 1995.
23194 (yyparse): Calls changed accordingly.
23195
231961996-01-27 Richard Stallman <rms@gnu.org>
23197
23198 * src/output.c (output_rule_data):
23199 Test YYERROR_VERBOSE in the conditional
23200 around the definition of ttyname.
23201
232021995-12-29 Richard Stallman <rms@gnu.org>
23203
23204 * src/bison.s1:
23205 Fix line numbers in #line commands.
23206
232071995-12-29 Richard Stallman <rms@gnu.org>
23208
23209 * bison.simple:
23210 Fix line numbers in #line commands.
23211
232121995-12-27 Richard Stallman <rms@gnu.org>
23213
23214 * src/bison.s1 (YYPARSE_PARAM_DECL):
23215 In C++, make it always null.
23216 (YYPARSE_PARAM_ARG): New macro.
23217 (yyparse): Use YYPARSE_PARAM_ARG.
23218
232191995-12-27 Richard Stallman <rms@gnu.org>
23220
23221 * bison.simple (YYPARSE_PARAM_DECL):
23222 In C++, make it always null.
23223 (YYPARSE_PARAM_ARG): New macro.
23224 (yyparse): Use YYPARSE_PARAM_ARG.
23225
232261995-11-29 Richard Stallman <rms@gnu.org>
23227
23228 * doc/bison.texinfo:
23229 Describe literal string tokens, %raw, %no_lines, %token_table.
23230
232311995-11-29 Daniel Hagerty <hag@gnu.org>
23232
23233 * doc/bison.texinfo: Fixed update date
23234
232351995-10-16 Richard Stallman <rms@gnu.org>
23236
23237 * src/version.c: Version 1.25.
23238
232391995-10-16 Richard Stallman <rms@gnu.org>
23240
23241 * NEWS: *** empty log message ***
23242
232431995-10-16 Richard Stallman <rms@gnu.org>
23244
23245 * doc/bison.1, doc/bison.rnh:
23246 Add new options.
23247
232481995-10-15 Richard Stallman <rms@gnu.org>
23249
23250 * src/vmsgetargs.c, src/getargs.c:
23251 Added -n, -k, and -raw switches.
23252 (noparserflag, toknumflag, rawtoknumflag): New variables.
23253
23254 * src/symtab.h (SALIAS):
23255 New #define for adding aliases to %token.
23256 (struct bucket): Added `alias' field.
23257
23258 * src/reduce.c (reduce_grammar):
23259 Revise error message.
23260 (print_notices): Remove final `.' from error message.
23261
23262 * src/reader.c (reader_output_yylsp):
23263 New function.
23264 (readgram): Use `#if 0' around code that accepted %command
23265 inside grammar rules: The documentation doesn't allow it,
23266 and it will fail since the %command processors scan for the next %.
23267 (parse_token_decl): Extended the %token
23268 declaration to allow a multi-character symbol as an alias.
23269 (parse_thong_decl): New function.
23270 (read_declarations): Added %thong declarations.
23271 (read_declarations): Handle NOOP to deal with allowing
23272 % declarations as another means to specify the flags.
23273 (readgram): Allow %prec prior to semantics embedded in a rule.
23274 (skip_to_char, read_declarations, copy_definition)
23275 (parse_token_decl, parse_start_decl, parse_type_decl)
23276 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
23277 (get_type_name, copy_guard, copy_action, readgram)
23278 (get_type, packsymbols): Revised most error messages.
23279 Changed `fatal' to `warnxxx' to avoid aborting for error.
23280 Revised and use multiple warnxxx functions to avoid using VARARGS1.
23281 (read_declarations): Improve the error message for
23282 an invalid character. Do not abort.
23283 (read_declarations, copy_guard, copy_action): Use
23284 printable_version to avoid unprintable characters in printed output.
23285 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
23286 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
23287 Allow the type of a non-terminal can be given
23288 more than once, as long as all specifications give the same type.
23289
23290 * src/output.c:
23291 (output_headers, output_trailers, output, output_gram)
23292 (output_rule_data): Implement noparserflag variable.
23293 Implement toknumflag variable.
23294 (output): Call reader_output_yylsp to output LTYPESTR.
23295
23296 * src/main.c (main):
23297 If reader sees an error, don't process the grammar.
23298 (fatals): Updated to not use VARARGS1.
23299 (printable_version, int_to_string, warn, warni, warns, warnss)
23300 (warnsss): New error reporting functions. Avoid abort for error.
23301
23302 * src/lex.h:
23303 Added THONG and NOOP for alias processing.
23304 Added SETOPT for the new code that allows setting options with %flags.
23305
23306 * src/lex.c:
23307 Include getopt.h. Add some extern decls.
23308 (safegetc): New function to deal with EOF gracefully.
23309 (literalchar); new function to deal with reading \ escapes.
23310 (lex): Use literalchar.
23311 (lex): Implemented "..." tokens.
23312 (literalchar, lex, parse_percent_token): Made tokenbuffer
23313 always contain the token. This includes growing the token
23314 buffer while reading an integer.
23315 (parse_percent_token): Replaced if-else statement with percent_table.
23316 (parse_percent_token): Added % declarations as another
23317 way to specify the flags -n, -l, and -r. Also added hooks for
23318 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
23319 major changes to files.c.
23320 (lex) Retain in the incoming stream a character following
23321 an incorrect '/'.
23322 (skip_white_space, lex): Revised most error messages
23323 and changed fatal to warn to avoid aborting.
23324 (percent_table): Added %thong declarations.
23325
23326 * src/gram.h: Comment changes.
23327
23328 * src/files.c (openfiles, open_extra_files, done):
23329 Add faction flag
23330 and actfile file. Handle noparserflag. Both for -n switch.
23331
23332 * src/conflicts.c (resolve_sr_conflict):
23333 Remove use of alloca.
23334
233351995-06-01 Jim Meyering <meyering@gnu.org>
23336
23337 * doc/bison.texinfo: *** empty log message ***
23338
233391995-05-06 Richard Stallman <rms@gnu.org>
23340
23341 * src/bison.s1: Comment change.
23342
233431995-05-06 Richard Stallman <rms@gnu.org>
23344
23345 * bison.simple: Comment change.
23346
233471995-05-03 Richard Stallman <rms@gnu.org>
23348
23349 * src/version.c: Version now 1.24.
23350
23351 * src/bison.s1: Change distribution terms.
23352
23353 * src/version.c: Version now 1.23.
23354
233551995-05-03 Richard Stallman <rms@gnu.org>
23356
23357 * doc/bison.texinfo:
23358 Rewrite "Conditions for Using Bison".
23359 Update version to 1.24.
23360
233611995-05-03 Richard Stallman <rms@gnu.org>
23362
23363 * bison.simple: Change distribution terms.
23364
233651995-02-23 Richard Stallman <rms@gnu.org>
23366
23367 * src/files.c: Test __VMS_POSIX as well as VMS.
23368
233691995-02-14 Jim Meyering <meyering@gnu.org>
23370
23371 * src/bison.s1 (__yy_memcpy):
23372 Renamed from __yy_bcopy to avoid
23373 confusion. Reverse FROM and TO arguments to be consistent with
23374 those of memcpy.
23375
233761995-02-14 Jim Meyering <meyering@gnu.org>
23377
23378 * bison.simple (__yy_memcpy):
23379 Renamed from __yy_bcopy to avoid
23380 confusion. Reverse FROM and TO arguments to be consistent with
23381 those of memcpy.
23382
233831994-11-10 David J. MacKenzie <djm@gnu.org>
23384
23385 * NEWS: reformat
23386
23387 * NEWS: New file.
23388
23389 * Makefile.in (DISTFILES): Include NEWS.
23390
23391 * Makefile.in (DISTFILES):
23392 Include install-sh, not install.sh.
23393
23394 * configure.in: Update to Autoconf v2 macro names.
23395
233961994-10-05 David J. MacKenzie <djm@gnu.org>
23397
23398 * Makefile.in: fix typo
23399
23400 * Makefile.in (prefix, exec_prefix):
23401 Let configure set them.
23402
234031994-09-28 David J. MacKenzie <djm@gnu.org>
23404
23405 * Makefile.in: Set datadir to $(prefix)/share.
23406
234071994-09-15 Richard Stallman <rms@gnu.org>
23408
23409 * src/bison.s1:
23410 Update copyright notice and GPL version.
23411
234121994-09-15 Richard Stallman <rms@gnu.org>
23413
23414 * bison.simple:
23415 Update copyright notice and GPL version.
23416
234171994-07-12 Richard Stallman <rms@gnu.org>
23418
23419 * src/reduce.c, src/reader.c:
23420 entered into RCS
23421
234221994-05-05 David J. MacKenzie <djm@gnu.org>
23423
23424 * Makefile.in: entered into RCS
23425
234261994-03-26 Richard Stallman <rms@gnu.org>
23427
23428 * src/bison.s1: entered into RCS
23429
234301994-03-26 Richard Stallman <rms@gnu.org>
23431
23432 * bison.simple: entered into RCS
23433
234341994-03-25 Richard Stallman <rms@gnu.org>
23435
23436 * src/main.c: entered into RCS
23437
234381994-03-24 Richard Stallman <rms@gnu.org>
23439
23440 * src/conflicts.c: entered into RCS
23441
234421994-01-02 Richard Stallman <rms@gnu.org>
23443
23444 * Makefile.in: *** empty log message ***
23445
234461993-11-21 Richard Stallman <rms@gnu.org>
23447
23448 * src/bison.s1: *** empty log message ***
23449
234501993-11-21 Richard Stallman <rms@gnu.org>
23451
23452 * doc/bison.texinfo: entered into RCS
23453
23454 * doc/bison.texinfo: *** empty log message ***
23455
234561993-11-21 Richard Stallman <rms@gnu.org>
23457
23458 * bison.simple: *** empty log message ***
23459
234601993-10-25 David J. MacKenzie <djm@gnu.org>
23461
23462 * doc/bison.texinfo: *** empty log message ***
23463
234641993-10-19 Richard Stallman <rms@gnu.org>
23465
23466 * src/bison.s1: *** empty log message ***
23467
234681993-10-19 Richard Stallman <rms@gnu.org>
23469
23470 * bison.simple: *** empty log message ***
23471
234721993-10-14 Richard Stallman <rms@gnu.org>
23473
23474 * src/bison.s1: *** empty log message ***
23475
234761993-10-14 Richard Stallman <rms@gnu.org>
23477
23478 * bison.simple: *** empty log message ***
23479
234801993-09-14 David J. MacKenzie <djm@gnu.org>
23481
23482 * doc/bison.texinfo: *** empty log message ***
23483
234841993-09-13 Noah Friedman <friedman@gnu.org>
23485
23486 * Makefile.in: *** empty log message ***
23487
234881993-09-10 Richard Stallman <rms@gnu.org>
23489
23490 * src/conflicts.c: *** empty log message ***
23491
23492 * src/system.h: entered into RCS
23493
234941993-09-10 Richard Stallman <rms@gnu.org>
23495
23496 * doc/bison.1: entered into RCS
23497
234981993-09-06 Noah Friedman <friedman@gnu.org>
23499
23500 * src/version.c: entered into RCS
23501
235021993-09-06 Noah Friedman <friedman@gnu.org>
23503
23504 * Makefile.in: *** empty log message ***
23505
235061993-07-30 David J. MacKenzie <djm@gnu.org>
23507
23508 * Makefile.in: *** empty log message ***
23509
235101993-07-24 Richard Stallman <rms@gnu.org>
23511
23512 * src/bison.s1: *** empty log message ***
23513
235141993-07-24 Richard Stallman <rms@gnu.org>
23515
23516 * bison.simple: *** empty log message ***
23517
235181993-07-08 David J. MacKenzie <djm@gnu.org>
23519
23520 * Makefile.in: *** empty log message ***
23521
235221993-07-04 Richard Stallman <rms@gnu.org>
23523
23524 * src/bison.s1: *** empty log message ***
23525
235261993-07-04 Richard Stallman <rms@gnu.org>
23527
23528 * bison.simple: *** empty log message ***
23529
235301993-06-26 David J. MacKenzie <djm@gnu.org>
23531
23532 * src/getargs.c: entered into RCS
23533
235341993-06-26 David J. MacKenzie <djm@gnu.org>
23535
23536 * doc/bison.texinfo: *** empty log message ***
23537
23538 * doc/bison.1: New file.
23539
235401993-06-25 Richard Stallman <rms@gnu.org>
23541
23542 * src/getargs.c: New file.
23543
235441993-06-16 Richard Stallman <rms@gnu.org>
23545
23546 * src/bison.s1: *** empty log message ***
23547
235481993-06-16 Richard Stallman <rms@gnu.org>
23549
23550 * bison.simple: *** empty log message ***
23551
235521993-06-03 Richard Stallman <rms@gnu.org>
23553
23554 * src/bison.s1: New file.
23555
235561993-06-03 Richard Stallman <rms@gnu.org>
23557
23558 * doc/bison.texinfo: *** empty log message ***
23559
235601993-06-03 Richard Stallman <rms@gnu.org>
23561
23562 * bison.simple: New file.
23563
235641993-05-19 Richard Stallman <rms@gnu.org>
23565
23566 * doc/bison.texinfo: New file.
23567
235681993-05-07 Noah Friedman <friedman@gnu.org>
23569
23570 * Makefile.in: *** empty log message ***
23571
235721993-04-28 Noah Friedman <friedman@gnu.org>
23573
23574 * src/reader.c: *** empty log message ***
23575
235761993-04-23 Noah Friedman <friedman@gnu.org>
23577
23578 * src/alloc.h: entered into RCS
23579
235801993-04-20 David J. MacKenzie <djm@gnu.org>
23581
23582 * src/version.c: *** empty log message ***
23583
23584 * src/files.c, src/allocate.c:
23585 entered into RCS
23586
23587 * src/reader.c: *** empty log message ***
23588
23589 * src/lex.c: entered into RCS
23590
23591 * src/conflicts.c: New file.
23592
23593 * src/symtab.c: entered into RCS
23594
23595 * src/alloc.h: New file.
23596
23597 * src/LR0.c: entered into RCS
23598
235991993-04-18 Noah Friedman <friedman@gnu.org>
23600
23601 * src/reader.c: New file.
23602
23603 * src/version.c: *** empty log message ***
23604
236051993-04-18 Noah Friedman <friedman@gnu.org>
23606
23607 * Makefile.in: *** empty log message ***
23608
236091993-04-17 Noah Friedman <friedman@gnu.org>
23610
23611 * Makefile.in: *** empty log message ***
23612
236131993-04-15 Richard Stallman <rms@gnu.org>
23614
23615 * src/main.c, src/files.c:
23616 New file.
23617
236181993-04-15 Noah Friedman <friedman@gnu.org>
23619
23620 * configure.in: entered into RCS
23621
23622 * configure.in: *** empty log message ***
23623
23624 * configure.in: New file.
23625
236261993-04-14 Richard Stallman <rms@gnu.org>
23627
23628 * Makefile.in: New file.
23629
236301993-04-13 Richard Stallman <rms@gnu.org>
23631
23632 * src/version.c: New file.
23633
236341993-03-25 Richard Stallman <rms@gnu.org>
23635
23636 * src/output.c: entered into RCS
23637
236381992-09-25 Richard Stallman <rms@gnu.org>
23639
23640 * configure.bat: entered into RCS
23641
236421992-06-22 Richard Stallman <rms@gnu.org>
23643
23644 * src/vmsgetargs.c: entered into RCS
23645
236461992-06-22 Richard Stallman <rms@gnu.org>
23647
23648 * doc/bison.rnh: entered into RCS
23649
236501992-04-20 David J. MacKenzie <djm@gnu.org>
23651
23652 * README: entered into RCS
23653
236541992-01-22 Richard Stallman <rms@gnu.org>
23655
23656 * src/machine.h: entered into RCS
23657
236581991-12-21 Richard Stallman <rms@gnu.org>
23659
23660 * src/lalr.c, src/closure.c:
23661 entered into RCS
23662
236631991-12-20 Richard Stallman <rms@gnu.org>
23664
23665 * src/state.h: entered into RCS
23666
236671991-12-18 Richard Stallman <rms@gnu.org>
23668
23669 * src/print.c, src/nullable.c, src/derives.c:
23670 entered into RCS
23671
236721991-11-03 David J. MacKenzie <djm@gnu.org>
23673
23674 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
23675 entered into RCS
23676
236771988-09-09 Richard Stallman <rms@gnu.org>
23678
23679 * src/bison.hairy: entered into RCS
23680
236811987-12-16 Richard Stallman <rms@gnu.org>
23682
23683 * REFERENCES: entered into RCS
dc546b0f 23684
f294a2c2 23685
04098407 23686 -----
f294a2c2 23687
ea0a7676
JD
23688 Copyright (C) 1987-1988, 1991-2011 Free Software Foundation,
23689 Inc.
f294a2c2 23690
04098407
PE
23691 Copying and distribution of this file, with or without
23692 modification, are permitted provided the copyright notice and this
23693 notice are preserved.