]> git.saurik.com Git - bison.git/blob - ChangeLog
Do not allow identifiers that start with a dash.
[bison.git] / ChangeLog
1 2011-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
34 2011-01-24 Joel E. Denny <joeldenny@joeldenny.org>
35
36 * data/yacc.c: Fix last apostrophe warning from xgettext.
37
38 2011-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
48 2011-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
65 2011-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
72 2011-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
82 2011-01-03 Joel E. Denny <joeldenny@joeldenny.org>
83
84 * ChangeLog (2011-01-02): improve description.
85
86 2011-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
96 2011-01-02 Joel E. Denny <joeldenny@joeldenny.org>
97
98 maint: run "make update-copyright".
99
100 2011-01-02 Joel E. Denny <joeldenny@joeldenny.org>
101
102 maint: prepare to use year ranges in copyright notices.
103 * README (Copyright statements): New section explaining the range
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.
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
111 2011-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
117 2010-12-19 Joel E. Denny <joeldenny@joeldenny.org>
118
119 doc: cleanup.
120 * NEWS (2.5): Try to sort entries according to how interesting
121 users might find them.
122
123 2010-12-19 Joel E. Denny <joeldenny@joeldenny.org>
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
133 2010-12-19 Joel E. Denny <joeldenny@joeldenny.org>
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
144 2010-12-11 Joel E. Denny <joeldenny@joeldenny.org>
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
181 2010-12-11 Joel E. Denny <joeldenny@joeldenny.org>
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
218 2010-11-21 Joel E. Denny <joeldenny@joeldenny.org>
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
227 2010-11-07 Joel E. Denny <joeldenny@joeldenny.org>
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
239 2010-11-07 Joel E. Denny <joeldenny@joeldenny.org>
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
275 2010-11-07 Joel E. Denny <joeldenny@joeldenny.org>
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
284 2010-11-07 Joel E. Denny <joeldenny@joeldenny.org>
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
294 2010-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
301 2010-10-31 Joel E. Denny <joeldenny@joeldenny.org>
302
303 * ChangeLog: Correct some errors in previous entries.
304
305 2010-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
315 2010-10-08 Paul Eggert <eggert@cs.ucla.edu>
316
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
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
352 2010-08-05 Joel E. Denny <joeldenny@joeldenny.org>
353
354 Version 2.4.3.
355 * NEWS (2.4.3): Set date.
356
357 2010-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
365 2010-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
374 2010-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
389 2010-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
395 2010-07-28 Joel E. Denny <joeldenny@joeldenny.org>
396
397 i18n: update.
398 * po/POTFILES.in: Add src/graphviz.c.
399
400 2010-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
406 2010-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
415 2010-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
422 2010-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
429 2010-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
494 2010-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
502 2010-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
513 2010-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
522 2010-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
536 2010-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
545 2010-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
553 2010-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
564 2010-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
571 2010-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
577 2010-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.
585 * src/reader.c (grammar_rule_check): Convert complaint back to
586 warning.
587 * tests/input.at (%prec's token must be defined): Update.
588
589 2010-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
597 2010-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
604 2010-04-13 Akim Demaille <demaille@gostai.com>
605
606 tests: calc: minor refactoring.
607 * tests/calc.at (_AT_DATA_CALC_Y): Simplify yylex.
608
609 2010-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
617 2010-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
627 2010-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
632 2010-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
639 2010-04-13 Akim Demaille <demaille@gostai.com>
640
641 formatting changes.
642 * tests/calc.at: Formatting changes.
643
644 2010-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
652 2010-04-11 Joel E. Denny <joeldenny@joeldenny.org>
653
654 * NEWS (2.4.3): Mention fix for Sun Studio C++.
655
656 2010-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
667 2010-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
680 2010-04-05 Akim Demaille <demaille@gostai.com>
681
682 remove useless include.
683 * src/graphviz.h: Don't include stdbool.h.
684
685 2010-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
691 2010-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
699 2010-03-30 Akim Demaille <demaille@gostai.com>
700
701 fix comments.
702 * src/graphviz.h: Add missing license notice.
703 Document.
704
705 2010-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
711 2010-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
719 2010-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
728 2010-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
734 2010-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
741 2010-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
749 2010-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
801 2010-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
808 2010-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
814 2010-01-21 Joel E. Denny <jdenny@clemson.edu>
815
816 * cfg.mk (gnulib_dir): Assume gnulib is a subdirectory.
817
818 2010-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
827 2010-01-19 Joel E. Denny <jdenny@clemson.edu>
828
829 * bootstrap: Import improvements from latest gnulib.
830
831 2010-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
839 2010-01-19 Joel E. Denny <jdenny@clemson.edu>
840
841 gnulib: update to latest.
842
843 2010-01-19 Joel E. Denny <jdenny@clemson.edu>
844
845 ChangeLog (2006-09-15): add Odd Arild Olsen's role for push.c.
846
847 2010-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
853 2010-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
870 2010-01-04 Joel E. Denny <jdenny@clemson.edu>
871
872 maint: run "make update-copyright"
873
874 2009-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
882 2009-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
895 2009-12-31 Joel E. Denny <jdenny@clemson.edu>
896
897 * HACKING (Release Procedure): Recommend a secure automake.
898
899 2008-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
906 2009-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
911 2008-12-11 Akim Demaille <demaille@gostai.com>
912
913 Simplify the i18n of the error messages.
914 * data/lalr1.cc: Comment changes.
915
916 2008-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
922 2008-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
930 2009-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
938 2009-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
963 2009-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
991 2009-12-21 Joel E. Denny <jdenny@clemson.edu>
992
993 YYFAIL: warn about uses and remove from lalr1.java.
994 * NEWS (2.5): Document.
995 * data/lalr1.java (YYParser::YYFAIL): Rename to YYERRLAB,
996 and make it private. Update all uses.
997 * src/scan-code.l (SC_RULE_ACTION): Implement warning.
998
999 2009-12-21 Joel E. Denny <jdenny@clemson.edu>
1000
1001 YYFAIL: deprecate.
1002 * NEWS (2.4.2): Document deprecation and the phase-out plan.
1003 * data/lalr1.java (YYParser::YYFAIL): Add comment about
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
1011 2009-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
1017 2009-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
1029 2009-12-16 Joel E. Denny <jdenny@clemson.edu>
1030
1031 * data/yacc.c: Reformat m4 a little.
1032
1033 2009-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
1039 2009-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
1046 2009-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
1054 2009-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
1060 2009-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
1075 2009-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
1082 2009-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
1090 2009-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
1097 2009-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
1107 2009-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
1118 2009-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
1124 2009-10-08 Joel E. Denny <jdenny@clemson.edu>
1125
1126 * data/bison.m4: Update comments for rename to muscle-tab.h.
1127
1128 2009-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
1139 2009-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
1149 2009-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
1157 2009-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
1166 2009-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
1186 2009-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
1195 2008-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
1202 2008-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
1208 2009-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
1214 2009-10-03 Alex Rozenman <rozenman@gmail.com>
1215
1216 Add additional space after periods in NEWS.
1217 * NEWS (2.5): here.
1218
1219 2009-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
1227 2009-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
1233 2009-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
1240 2009-09-16 Akim Demaille <demaille@gostai.com>
1241
1242 doc: comment changes.
1243 * doc/bison.texinfo: Comment changes.
1244
1245 2009-09-16 Akim Demaille <demaille@gostai.com>
1246
1247 doc: spell checking.
1248 * doc/bison.texinfo: here.
1249
1250 2009-09-19 Alex Rozenman <rozenman@gmail.com>
1251
1252 Keep sub-messages aligned. Fix strings for translation.
1253 * src/location.h (location_print): Add return value.
1254 * src/location.c (location_print): Return number of printed
1255 characters.
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.
1264 * NEWS (2.5): Add an announcement about named references.
1265
1266 2009-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
1272 2009-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
1281 2009-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
1289 2009-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
1303 2009-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
1311 2009-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
1320 2009-09-03 Akim Demaille <demaille@gostai.com>
1321
1322 * NEWS (2.4.2): Add "Internationalization" item.
1323
1324 2009-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
1330 2009-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
1340 2009-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.
1350 * tests/calc.at: Remove quotes in most tests.
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
1358 2009-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
1373 2009-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
1379 2009-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
1389 2009-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
1395 2009-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
1401 2009-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
1415 2009-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
1460 2009-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
1473 2009-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
1489 2009-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
1495 2009-08-20 Eric Blake <ebb9@byu.net>
1496
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
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
1509 2009-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
1529 2009-08-19 Akim Demaille <demaille@gostai.com>
1530
1531 doc: fixes.
1532 * doc/bison.texinfo: Fix minor Texinfo errors.
1533
1534 2009-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
1542 2009-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
1551 2009-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
1560 2009-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
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.
1575
1576 2009-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
1585 2009-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
1602 2009-08-12 Akim Demaille <demaille@gostai.com>
1603
1604 distcheck: fix.
1605
1606 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
1607
1608 2009-08-10 Joel E. Denny <jdenny@clemson.edu>
1609
1610 * tests/Makefile.am (TESTSUITE_AT): Add named-refs.at.
1611
1612 2009-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
1642 2009-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
1649 2009-08-06 Joel E. Denny <jdenny@clemson.edu>
1650
1651 maint: run "make update-copyright"
1652
1653 2009-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
1662 2009-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
1671 2009-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
1680 2009-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
1699 2009-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
1705 2009-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
1719 2009-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
1726 2009-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
1732 2009-07-24 Alex Rozenman <rozenman@gmail.com>
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
1740 2009-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
1749 2009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
1750
1751 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
1752
1753 2009-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
1773 2009-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
1777 2009-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
1784 2009-07-04 Alex Rozenman <rozenman@gmail.com>
1785
1786 Alphabetical order in src/Makefile.am.
1787 * src/Makefile.am: Adjust.
1788
1789 2009-07-04 Alex Rozenman <rozenman@gmail.com>
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
1803 2009-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
1808 2009-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
1817 2009-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
1838 2009-06-25 Akim Demaille <demaille@gostai.com>
1839
1840 hash: check insertion for memory exhaustion.
1841 * src/uniqstr.c (uniqstr_new): New.
1842
1843 2009-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
1850 2009-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
1857 2009-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
1864 2009-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
1880 2009-06-10 Akim Demaille <demaille@gostai.com>
1881
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
1892 2009-05-25 Akim Demaille <demaille@gostai.com>
1893
1894 gnulib: update.
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.
1902
1903 2009-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
1915 2009-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
1938 2009-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
1946 2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1947
1948 * data/c++.m4: Update copyright year.
1949
1950 2009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
1951
1952 * data/c++.m4 (b4_namespace_close): Simplify slightly.
1953
1954 2009-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
1962 2009-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
1968 2009-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
1974 2009-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
1979 2009-05-05 Akim Demaille <demaille@gostai.com>
1980
1981 tests: check token numbers.
1982 * tests/input.at (Numbered tokens): New.
1983
1984 2009-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
1990 2009-05-04 Akim Demaille <demaille@gostai.com>
1991
1992 space changes.
1993 * src/scan-gram.l: Untabify to be robust to zealous editors.
1994
1995 2009-05-04 Akim Demaille <demaille@gostai.com>
1996
1997 identifiers: dashes are letters.
1998 Dashes can now start identifiers (symbols and directives).
1999
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
2007 2009-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
2015 2009-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
2043 2009-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
2049 2009-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
2061 2009-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
2066 2009-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
2071 2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
2072
2073 Document how `%define "var" "value"' is not M4-friendly.
2074 * src/parse-gram.y (variable): In comments here.
2075
2076 2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
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
2083 2009-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
2098 2009-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
2105 2009-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
2116 2009-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
2146 2009-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
2184 2009-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
2234 2009-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
2246 2009-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
2275 2009-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
2280 2009-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
2286 2009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
2287
2288 Document semicolon warnings.
2289 * NEWS (2.5): Here.
2290
2291 2008-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
2300 2008-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
2316 2009-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
2322 2009-04-10 Eric Blake <ebb9@byu.net>
2323
2324 submodules: update to latest
2325 * submodules/autoconf: Use latest upstream Autoconf.
2326
2327 2009-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
2333 2009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2334
2335 * NEWS (2.5): Describe new -D/--define feature.
2336
2337 2008-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
2344 2008-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
2351 2008-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
2358 2008-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.
2365 (Bison Directive): Add column, automatically extracted from
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
2373 2009-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
2378 2008-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
2385 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2386
2387 Simplify last patch slightly.
2388 * src/getargs.c (getargs): Here.
2389
2390 2008-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
2396 2008-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
2401 2008-11-11 Akim Demaille <demaille@gostai.com>
2402
2403 AT_FULL_COMPILE.
2404 * tests/actions.at, tests/regression.at: Use it.
2405
2406 2008-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
2414 2008-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
2425 2008-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
2435 2008-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
2440 2009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2441
2442 * NEWS (2.5): New stub.
2443
2444 2009-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
2451 2008-11-07 Akim Demaille <demaille@gostai.com>
2452
2453 Fix --help.
2454 * src/getargs.c (usage): Fix help string for -W.
2455
2456 2008-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
2463 2009-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
2468 2008-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
2474 2009-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
2483 2009-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
2489 2009-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
2508 2008-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
2514 2009-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
2519 2009-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
2525 2009-03-31 Akim Demaille <demaille@gostai.com>
2526
2527 bootstrap: README-hacking no longer exists
2528 * bootstrap (checkout_only_file): Set to HACKING.
2529
2530 2009-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.
2535
2536 * README-hacking: Merge into...
2537 * HACKING (Working from the repository): here.
2538
2539 2009-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
2545 2009-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
2556 2009-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
2563 2009-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.
2568
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
2577 2008-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
2584 2008-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
2590 2008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
2591
2592 * gnulib: Update submodule to HEAD.
2593
2594 2008-12-09 Akim Demaille <demaille@gostai.com>
2595
2596 Update data/README.
2597 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
2598
2599 2008-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
2610 2008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
2611
2612 * NEWS: Clarify a little.
2613
2614 2008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
2615
2616 * NEWS: Update for recent changes.
2617
2618 2008-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
2638 2008-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
2644 2008-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.
2651 (Java Action Features): Remove period to match the rest of menu.
2652
2653 2008-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
2661 2008-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
2667 2008-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
2680 2008-11-04 Akim Demaille <demaille@gostai.com>
2681
2682 * NEWS: Mention the trailing semicolon in action.
2683
2684 2008-11-04 Akim Demaille <demaille@gostai.com>
2685
2686 Reformat NEWS.
2687 * NEWS: Use more outline-mode markup.
2688 Suggested by Jim Meyering.
2689
2690 2008-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
2700 2008-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
2706 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2707
2708 * NEWS: Version 2.4.
2709
2710 2008-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
2717 2008-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
2731 2008-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
2785 2008-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
2796 2008-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
2808 2008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
2809
2810 * gnulib: Update submodule to HEAD.
2811
2812 2008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2813
2814 Update copyright year.
2815 * src/files.c: Here.
2816
2817 2008-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
2826 2008-10-28 Akim Demaille <demaille@gostai.com>
2827
2828 Space changes.
2829 * data/lalr1.cc: Formatting changes.
2830
2831 2008-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
2839 2008-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
2844 2008-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
2850 2008-10-28 Akim Demaille <demaille@gostai.com>
2851
2852 Make gnulib a submodule.
2853 * gnulib: New.
2854 * .gitmodules (gnulib): New.
2855
2856 2008-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
2864 2008-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
2883 2008-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
2889 2008-08-29 Akim Demaille <demaille@gostai.com>
2890
2891 Clarify UPDATED use.
2892 * doc/bison.texinfo: It refers to the last edition of this file,
2893 not to the release date of Bison.
2894 Reported by Joel E. Denny.
2895
2896 2008-08-29 Akim Demaille <demaille@gostai.com>
2897
2898 * README: Update FAQ pointer.
2899 Reported by Joel E. Denny.
2900
2901 2008-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
2911 2008-08-27 Akim Demaille <demaille@gostai.com>
2912
2913 Check yyerrok in calc.at.
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.
2917
2918 2008-08-27 Akim Demaille <demaille@gostai.com>
2919
2920 Support yyerrok in lalr1.cc.
2921 YYBACKUP is still to import back into lalr1.cc.
2922 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
2923
2924 2008-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
2931 2008-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
2937 2008-08-15 Eric Blake <ebb9@byu.net>
2938
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
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
2956 2008-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
2964 2008-08-06 Eric Blake <ebb9@byu.net>
2965
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
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
2981 2008-08-05 Eric Blake <ebb9@byu.net>
2982
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
2992 Fix comments in m4sugar.
2993 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
2994
2995 2008-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
3001 2008-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
3009 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
3010
3011 * NEWS: Clarify documentation of %language.
3012
3013 2008-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
3021 2008-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
3037 2008-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
3045 2008-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
3053 2008-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.
3060 * ChangeLog: Remove the Id previously used for capturing the CVS
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
3090 2008-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
3103 2008-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
3123 2008-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
3136 2008-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
3153 2008-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
3158 2008-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
3163 2008-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
3169 2008-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
3176 2008-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
3181 2008-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
3187 2008-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
3192 2008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3193
3194 * THANKS: Add Eric Blake.
3195
3196 2008-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
3204 2008-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
3213 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
3214
3215 * GNUmakefile: Update git-version-gen invocation so make dist
3216 succeeds.
3217
3218 2008-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
3238 2008-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
3248 2008-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.
3259 (getargs): Sort cases.
3260
3261 2008-02-28 Akim Demaille <demaille@gostai.com>
3262
3263 * doc/bison.texinfo: Fix a few typos.
3264
3265 2008-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
3270 2008-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
3279 2008-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
3306 2008-02-21 Wojciech Polak <polak@gnu.org>
3307
3308 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
3309 text.
3310
3311 2008-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
3329 2008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
3330
3331 * runtime-po/POTFILES.in (push.c): Remove.
3332
3333 2008-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
3342 2008-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
3349 2008-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
3359 2008-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
3377 2008-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
3397 2008-01-30 Paul Eggert <eggert@cs.ucla.edu>
3398
3399 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
3400
3401 2008-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
3407 2008-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
3412 2007-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
3456 2007-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
3478 2007-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
3510 2007-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
3524 2007-11-26 Akim Demaille <akim@epita.fr>
3525
3526 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
3527
3528 2007-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
3562 2007-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
3578 2007-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
3587 2007-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
3642 2007-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
3650 2007-11-08 Paolo Bonzini <bonzini@gnu.org>
3651
3652 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
3653
3654 2007-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
3661 2007-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
3668 2007-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
3675 2007-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
3683 2007-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
3689 2007-11-04 Akim Demaille <demaille@gostai.com>
3690
3691 Find sha1sum when named gsha1sum.
3692 * bootstrap (find_tool): New.
3693 ($SHA1SUM): New.
3694
3695 2007-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.
3710 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
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
3740 2007-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
3763 2007-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
3776 2007-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.
3780 (xsl:template match="item"): New.
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
3794 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
3795
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
3803 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
3804
3805 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
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
3811 2007-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
3821 2007-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
3834 2007-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
3847 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
3848
3849 * src/getargs.c (version): Update copyright year.
3850
3851 2007-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
3899 2007-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
3924 2007-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
3955 2007-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
3974 2007-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
3987 2007-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
3995 2007-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
4040 2007-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
4050 2007-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
4058 2007-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
4066 2007-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
4077 2007-09-21 Wojciech Polak <polak@gnu.org>
4078
4079 Add Bison XML Automaton Report.
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
4117 2007-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
4132 2007-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
4144 2007-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
4158 2007-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
4170 2007-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
4227 2007-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
4244 2007-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
4252 2007-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
4260 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
4261 node names: say "Decl Summary" not "Bison Declaration Summary".
4262
4263 2007-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
4271 2007-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
4283 2007-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
4309 2007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
4310
4311 * build-aux/.cvsignore: Add compile.
4312 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
4313 uniwidth.
4314
4315 2007-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
4320 2007-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
4328 2007-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
4338 2007-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
4345 2007-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
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
4360 2007-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
4384 2007-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
4401 2007-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
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
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
4418 2007-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
4439 2007-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
4448 2007-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
4470 2007-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
4486 2007-04-04 Paul Eggert <eggert@cs.ucla.edu>
4487
4488 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
4489 still sticks to ASCII. Sorry!
4490
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
4498 2007-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
4505 2007-03-07 Paolo Bonzini <bonzini@gnu.org>
4506
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.
4539
4540 2007-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
4549 2007-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
4581 redefinitions.
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
4603 2007-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
4611 2007-02-27 Paolo Bonzini <bonzini@gnu.org>
4612
4613 * data/lalr1.java: Prefix all private members with yy.
4614
4615 2007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
4616
4617 Use YYFPRINTF instead of fprintf where appropriate. Reported by
4618 Sebastien Fricker at
4619 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
4620 * THANKS: Add Sebastien Fricker.
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
4625 2007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
4626
4627 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
4628
4629 2007-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
4635 2007-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
4650 2007-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
4657 2007-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
4669 2007-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
4680 2007-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
4695 2007-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
4701 2007-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
4708 2007-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
4719 2007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
4720
4721 * doc/bison.texinfo (Decl Summary): Correct typo.
4722
4723 2007-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
4733 2007-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
4757 2007-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
4780 2007-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
4797 2007-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
4806 2007-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
4817 * doc/bison.texinfo (Decl Summary): Document %define.
4818
4819 * src/parse-gram.y (Unqualified %code): Change muscle name to
4820 b4_percent_code().
4821 (content.opt): Default to empty.
4822
4823 2007-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
4844 2007-01-17 Paolo Bonzini <bonzini@gnu.org>
4845
4846 * bootstrap: Remove occurrences of .#bootmp from the files.
4847
4848 2007-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
4854 2007-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
4864 2007-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
4874 2007-01-16 Akim Demaille <akim@epita.fr>
4875
4876 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
4877
4878 2007-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
4917 2007-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
4924 2007-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
4932 2007-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
4941 2007-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
4951 2007-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.
4974 (grammar_declaration): For %union RHS, use `braceless' instead of
4975 "{...}" so that braces are already stripped and code is escaped with
4976 digraphs.
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
4984 2007-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.
4994 (Decl Summary): In %defines entry, update mention of `%code requires'
4995 and `%code provides'.
4996 (C++ Location Values): Update %define uses.
4997 (Calc++ Parser Interface): Likewise.
4998 (Calc++ Parser): Likewise, and update `%code requires' uses.
4999 (Table of Symbols): Update %code documentation.
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
5011 2007-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
5018 2007-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
5053 b4_get_percent_define for parser_class_name and namespace.
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
5075 2007-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
5101 2007-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
5135 2007-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
5144 2007-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).
5153 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
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
5206 2007-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".
5217 (Table of Symbols): Remove entries for %requires, %provides, and
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
5245 2007-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
5285 2007-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
5298 2007-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
5318 2007-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
5365 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
5366
5367 * etc/.cvsignore: New.
5368
5369 2007-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
5385 2006-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
5409 2006-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
5449 2006-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
5474 2006-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
5487 2006-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
5513 2006-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
5527 2006-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
5542 2006-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
5568 2006-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
5577 2006-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
5607 2006-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
5616 2006-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.
5630 (Table of Symbols): Add entries for %language and %skeleton.
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
5638 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
5639
5640 * NEWS: Reword the %language news a bit, and put it earlier.
5641
5642 * src/getargs.c (skeleton_arg): Last arg is now location const *.
5643 Rewrite to simplify the logic.
5644 (language_argmatch): Likewise.
5645 (program_name): We now own this var.
5646 * src/getargs.h (struct bison_language): Use char[] rather than
5647 const char *.
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
5654 2006-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.
5665 (Decl Summary): Document %language and %skeleton.
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
5692 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
5693
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
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
5704 2006-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
5717 2006-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
5724 2006-12-14 Bob Rossi <bob@brasko.net>
5725
5726 * data/push.c (yypush_parse): Declare prototype regardless of
5727 %locations option.
5728
5729 2006-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
5734 2006-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
5743 2006-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
5748 2006-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
5753 2006-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
5795 2006-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
5812 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5813
5814 * doc/bison.texinfo: Fix a couple of typos.
5815
5816 2006-12-08 Bob Rossi <bob@brasko.net>
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
5828 2006-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
5837 2006-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
5857 2006-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,
5866 Table of Symbols): Say they're experimental. Comment out any mention
5867 of Java (we'll want this back eventually).
5868
5869 2006-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.
5875 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
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
5891 2006-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
5900 2006-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.
5905 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
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
5920 2006-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
5928 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
5929
5930 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
5931 it was double-quoted.
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
5936 2006-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
5950 2006-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
5962 2006-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
5970 2006-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
6023 2006-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
6030 2006-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
6047 2006-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
6063 2006-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
6068 2006-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
6073 2006-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.
6081 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
6082 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
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
6119 2006-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
6135 2006-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
6148 2006-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
6157 2006-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.
6174 (Table of Symbols): Clean up discussion of prologue alternatives and
6175 add %code-top.
6176
6177 2006-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
6186 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
6187
6188 Replace %*-header with %provides, %requires, %code. See discussion at
6189 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
6190
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
6207 2006-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
6212 2006-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
6225 2006-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
6235 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
6236
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
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
6286 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
6287
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
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.
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>.
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
6320 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
6321 accommodates the 2006-10-08 change.
6322
6323 2006-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
6331 2006-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
6336 2006-10-11 Bob Rossi <bob@brasko.net>
6337
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.
6342
6343 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
6344
6345 * THANKS: Add Paolo Bonzini and Bob Rossi.
6346
6347 2006-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
6360 2006-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
6377 2006-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
6387 2006-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
6408 2006-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
6414 2006-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
6420 2006-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
6439 2006-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
6445 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
6446
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
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
6508 2006-09-15 Bob Rossi <bob@brasko.net>
6509
6510 Add support for push parsing. Based on the original work of
6511 Odd Arild Olsen <oao@fibula.no>.
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.
6515 * data/push.c: New file.
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
6526 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
6527
6528 * NEWS: Version 2.3a.
6529 * configure.ac (AC_INIT): Likewise.
6530
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
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
6558 2006-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
6566 2006-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
6572 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
6573
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
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.
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.
6596
6597 2006-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
6626 2006-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.
6634 (Table of Symbols): Add entry for %symbol-default.
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
6653 2006-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
6676 2006-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
6688 2006-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
6700 2006-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
6722 2006-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
6742 string literal): New test cases.
6743 (Characters Escapes, Web2c Actions): Declare string literals as
6744 aliases.
6745 * tests/sets.at (Firsts): Likewise.
6746
6747 2006-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
6760 2006-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
6770 2006-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
6774 2006-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
6793 2006-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
6805 2006-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
6815 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
6816
6817 * doc/bison.texinfo: Fix some typos.
6818
6819 2006-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
6829 2006-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
6873 2006-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
6902 2006-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
6927 2006-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
6932 2006-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
6940 2006-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
6955 2006-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
6965 2006-07-12 Akim Demaille <akim@epita.fr>
6966
6967 * data/c.m4: Comment changes.
6968
6969 2006-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
6976 2006-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
7019 2006-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
7032 2006-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
7040 2006-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
7046 2006-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
7054 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
7055
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
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
7096 2006-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
7105 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
7106
7107 * data/c.m4 (b4_basename): New.
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
7115 2006-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
7124 2006-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
7136 2006-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
7142 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7143
7144 Don't miss %merge result type warnings just because the LHS types are
7145 declared after the %merge. This continues the effort of the previous
7146 patch.
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
7162 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7163
7164 Get action warnings (grammar_rule_check) right even when symbol
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 $$.
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
7210 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7211
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.
7220
7221 2006-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
7231 2006-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
7256 2006-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.
7275 (Decl Summary): Update names.
7276 (Table of Symbols): Update description.
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
7300 2006-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
7319 2006-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.
7352 (Decl Summary): In %defines description, mention the effect of
7353 %before-definitions and %after-definitions on the header file.
7354 (Calc++ Parser): Forward declare driver in a %before-definitions rather
7355 than in the pre-prologue so that make check succeeds.
7356 (Table of Symbols): Add entries for %before-definitions and
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
7377 2006-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
7383 2006-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
7388 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
7389
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
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
7409 2006-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
7427 2006-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
7450 2006-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
7460 2006-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
7533 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
7534
7535 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
7536
7537 2006-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
7542 2006-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
7551 2006-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
7563 2006-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
7571 2006-06-07 Akim Demaille <akim@epita.fr>
7572
7573 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
7574
7575 2006-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.
7637
7638 2006-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
7644 2006-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
7661 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
7662
7663 * NEWS: Version 2.3.
7664 * configure.ac (AC_INIT): Likewise.
7665
7666 2006-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
7675 2006-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
7681 2006-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
7686 2006-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
7690 2006-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
7696 2006-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
7705 2006-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
7714 2006-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
7729 2006-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
7743 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
7744
7745 * NEWS: Version 2.2.
7746 * configure.ac (AC_INIT): Likewise.
7747
7748 2006-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
7761 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
7762
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
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
7780 2006-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
7786 2006-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
7791 2006-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
7807 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
7808
7809 * etc/bench.pm: Shorten bench names.
7810
7811 2006-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
7818 2006-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
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.
7825
7826 2006-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
7832 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
7833
7834 * examples/extexi: Enforce the precedence of concatenation over
7835 >>.
7836 Reported by Tommy Nordgren.
7837
7838 2006-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".
7842 Reported by Martin Nylin.
7843
7844 2006-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
7855 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
7856
7857 * data/glr.cc: Remove dead code.
7858
7859 2006-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
7865 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
7866
7867 * doc/bison.texinfo (Multiple start-symbols): New.
7868
7869 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
7870
7871 * etc/README, etc/bench.pl: New.
7872
7873 2006-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
7880 2006-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
7885 2006-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
7892 2006-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
7897 2006-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'.
7912
7913 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
7914
7915 * TODO: Remove dead items.
7916
7917 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
7918
7919 * doc/FAQ: Remove, merged into...
7920 * doc/bison.texinfo (FAQ): this.
7921 * doc/Makefile.am (EXTRA_DIST): Adjust.
7922
7923 2006-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
7930 2006-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
7940 2006-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
7950 2006-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
7956 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
7957
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
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
7970 2006-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
7982 2006-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
7991 2006-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
8005 2006-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
8010 cuts parse): Rename to...
8011 (Leaked semantic values if user action cuts parse): ... this. Add check
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).
8016 (yyresolveStates): Document the interface. Move all manipulation of a
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
8029 2006-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
8035 2006-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
8041 2006-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
8054 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
8055
8056 * NEWS: Clarify symbols versus types in unused-value warnings.
8057
8058 * configure.ac (AC_INIT): Bump version number.
8059
8060 2006-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
8066 2006-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
8071 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
8072
8073 * Makefile.maint: Merge from coreutils.
8074
8075 2006-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
8086 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
8087
8088 More portability fixes for problems summarized by Nelson H. F. Beebe.
8089
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
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
8099 2006-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
8109 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8110
8111 Various DJGGP specific issues in /djgpp
8112
8113 2006-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
8120 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
8121
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
8125 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
8126 that '#include <string>' works.
8127
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
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
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
8142 Suite Version 2.0.
8143
8144 2006-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
8164 2006-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
8170 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
8171
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
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
8199 2006-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
8208 2006-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
8217 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
8218
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
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
8249 2006-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
8307 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
8308
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.
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.
8335 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
8336 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
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.
8343
8344 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
8345
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
8357 * bootstrap: Undo changes to gnulib files that autoreconf made.
8358
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
8381 2006-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
8386 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
8387
8388 * NEWS: Document the fact that multiple %unions are now allowed.
8389 * doc/bison.texinfo (Union Decl): Likewise.
8390 * TODO: This feature is now implemented, so remove it from
8391 the wishlist.
8392
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
8412 Avoid undefined behavior that addressed just before the start of an
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
8418 2006-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
8427 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8428
8429 * data/glr.c (yysplitStack): A little stylistic rewrite.
8430
8431 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8432
8433 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
8434
8435 2006-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
8446 actions and since it's already discussed in `Table of Symbols' where
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.
8457 (Table of Symbols): In the yychar entry, don't call it the `current'
8458 look-ahead.
8459 In the yylloc and yylval entries, mention look-ahead usage.
8460
8461 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
8462
8463 * tests/glr-regression.at: Update copyright year to 2006.
8464
8465 2006-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
8496 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8497
8498 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
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
8503 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8504
8505 * tests/glr-regression.at: For consistency with my newer test cases,
8506 don't thank myself.
8507
8508 2006-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
8527 2006-01-05 Akim Demaille <akim@epita.fr>
8528
8529 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
8530
8531 2006-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
8541 2006-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
8555 2006-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
8562 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
8563
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
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
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
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
8592 2006-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
8614 2006-01-02 Akim Demaille <akim@epita.fr>
8615
8616 * src/output.c (output_skeleton): Don't hard wire the inclusion of
8617 c.m4.
8618 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
8619 * data/glr.cc: Do not include stack.hh.
8620
8621 2006-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
8629 2005-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
8636 2005-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
8658 2005-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
8663 2005-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
8680 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
8681
8682 * NEWS: Improve wording for unused-value warnings.
8683
8684 2005-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
8692 2005-12-22 Akim Demaille <akim@epita.fr>
8693
8694 * NEWS: Warn about unused values.
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
8715 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
8716
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
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
8739 2005-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
8745 2005-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
8764 2005-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
8780 2005-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
8796 2005-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
8802 2005-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
8815 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
8816
8817 * tests/sets.at (Accept): Fix typos in regular expression used to
8818 sed out the final state number.
8819
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
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
8882 2005-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
8888 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
8889
8890 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
8891 all stacks.
8892 (yyparse): Iterate another stack in order to call user destructors.
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
8898 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
8899
8900 * NEWS: Document the following change.
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
8914 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
8915
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
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
8931 2005-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
8938 2005-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
8953 2005-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
8959 2005-11-14 Akim Demaille <akim@epita.fr>
8960
8961 * data/glr.c (yy_reduce_print): Fix the $ number.
8962
8963 2005-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
8971 2005-11-14 Akim Demaille <akim@epita.fr>
8972
8973 * data/glr.c (yyexpandGLRStack): Declare only if defined.
8974
8975 2005-11-14 Akim Demaille <akim@epita.fr>
8976
8977 * data/glr.cc: New.
8978 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
8979
8980 2005-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
8990 2005-11-12 Akim Demaille <akim@epita.fr>
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
8996 2005-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
9003 2005-11-11 Akim Demaille <akim@epita.fr>
9004
9005 * data/glr.c: Comment changes.
9006
9007 2005-11-11 Akim Demaille <akim@epita.fr>
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
9019 2005-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
9025 2005-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
9030 2005-11-09 Akim Demaille <akim@epita.fr>
9031
9032 * src/scan-skel.l: Use a couple of asserts.
9033
9034 2005-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
9049 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9050
9051 * data/glr.c (yyfill): Adjust comment.
9052 (yyresolveAction): Initialize default location properly
9053 for empty right-hand sides.
9054 (yydoAction): Ditto.
9055 Add comment explaining apparently dead code.
9056 * tests/glr-regression.at
9057 (Incorrectly initialized location for empty right-hand side in GLR):
9058 New test.
9059
9060 2005-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
9067 2005-10-22 Akim <akim@epita.fr>
9068
9069 * Makefile.cfg: Adjust to config -> build-aux.
9070 Reported by twledo.
9071
9072 2005-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
9082 2005-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
9091 2005-10-14 Akim Demaille <akim@epita.fr>
9092
9093 * examples/calc++/test: Use set -x only when VERBOSE.
9094
9095 2005-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
9100 2005-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.
9104 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
9105 additional checks.
9106 Use this to exercise C++ outputs in subdirs.
9107 Reported by Oleg Smolsky.
9108
9109 2005-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
9117 2005-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
9123 2005-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.
9132 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
9133 as __STDC__.
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.
9137
9138 2005-10-10 Akim Demaille <akim@epita.fr>
9139
9140 * examples/calc++/test: Be quiet unless VERBOSE.
9141
9142 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
9143
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
9162 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
9163 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
9164
9165 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
9166
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
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
9194 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9195
9196 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
9197
9198 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
9199
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.
9221 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
9222 * src/reduce.c (reduce_print): Likewise.
9223 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
9224 * src/system.h: Include unlocked-io.h rather than stdio.h.
9225
9226 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
9227 this confuses xgettext.
9228
9229 2005-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
9242 2005-10-02 Akim Demaille <akim@epita.fr>
9243
9244 * data/location.cc: New.
9245
9246 2005-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
9269 2005-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
9298 2005-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
9309 2005-10-01 Akim Demaille <akim@epita.fr>
9310
9311 * examples/extexi: Restore the #line generation.
9312
9313 2005-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
9331 2005-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
9339 2005-09-29 Akim Demaille <akim@epita.fr>
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
9352 2005-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
9361 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
9362
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
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 &&
9375 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
9376 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
9377 to match yacc.c, to test more hosts.
9378
9379 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
9380
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
9394 * HACKING (release): Forwarn the Translation Project about
9395 stable releses.
9396
9397 2005-09-20 Akim Demaille <akim@epita.fr>
9398
9399 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
9400
9401 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
9402
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
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
9423 2005-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
9432 2005-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
9437 2005-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
9442 2005-09-19 Akim Demaille <akim@epita.fr>
9443
9444 * NEWS, configure.ac: update version number to 2.1a.
9445
9446 2005-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
9464 2005-09-16 Akim Demaille <akim@epita.fr>
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
9471 2005-09-16 Akim Demaille <akim@epita.fr>
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
9482 2005-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
9493 2005-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
9498 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
9499
9500 * data/glr.c (yyresolveValue): Add default case to pacify
9501 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
9502
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
9512 2005-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
9518 2005-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
9529 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
9530
9531 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
9532 Suggested by twlevo@xs4all.nl.
9533
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
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.
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.
9555
9556 2005-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
9567 2005-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
9578 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
9579
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
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
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
9592 2005-08-25 Akim Demaille <akim@epita.fr>
9593
9594 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
9595
9596 2005-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
9605 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
9606
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
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>.
9616 * data/lalr1.cc (yyerturn): Likewise.
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
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
9641 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
9642
9643 * NEWS: Version 2.0b.
9644
9645 * Makefile.am (SUBDIRS): Put examples before tests, so that
9646 "make check" doesn't finish with "All 1 tests passed".
9647
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
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
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
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
9758 2005-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
9797 2005-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
9818 2005-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
9855 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
9856
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
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
9892 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
9893
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
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
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
9961 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
9962
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
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
9978 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
9979
9980 Fix problems reported by twlevo@xs4all.nl.
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):
9986 Add casts to pacify C++ compilers.
9987 * tests/glr-regression.at (Improper merging of GLR delayed action
9988 sets): Declare yylex before using it.
9989 * tests/Makefile.am (maintainer-check-g++): Fix a stray
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.
9997
9998 2005-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
10003 2005-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
10010 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
10011
10012 * NEWS: Document recent i18n improvements.
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.
10037 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
10038 its value.
10039 * src/main.c (main): Bind the bison-runtime domain, too.
10040
10041 2005-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
10073 2005-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
10080 2005-07-12 Akim Demaille <akim@epita.fr>
10081
10082 * src/parse-gram.y: Use %printer instead of YYPRINT.
10083
10084 2005-07-12 Akim Demaille <akim@epita.fr>
10085
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
10090 2005-07-12 Akim Demaille <akim@epita.fr>
10091
10092 * data/glr.c (b4_syncline): Fix (swap) the definitions of
10093 b4_at_dollar and b4_dollar_dollar.
10094
10095 2005-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
10100 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
10101
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
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
10111 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
10112
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
10133 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
10134 implied by the other modules.
10135
10136 2005-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
10147 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
10148
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
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
10186 2005-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
10194 2005-06-24 Akim Demaille <akim@epita.fr>
10195
10196 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
10197 class typedefs.
10198
10199 2005-06-22 Akim Demaille <akim@epita.fr>
10200
10201 * doc/bison.texinfo (C++ Language Interface): First stab.
10202 (C++ Parsers): Remove.
10203
10204 2005-06-22 Akim Demaille <akim@epita.fr>
10205
10206 * data/lalr1.cc (yylex_): Honor %lex-param.
10207
10208 2005-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
10217 2005-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
10223 2005-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
10228 2005-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
10233 2005-05-30 Akim Demaille <akim@epita.fr>
10234
10235 * data/lalr1.cc (_): New.
10236 Translate the various messages.
10237
10238 2005-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
10249 2005-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
10259 2005-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
10264 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
10265
10266 * README: Mention m4 1.4.3. Remove obsolete advice about
10267 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
10268
10269 * bootstrap: Remove workaround for problem I encountered with
10270 gettext 0.14.1; it seems to be fixed now.
10271
10272 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
10273
10274 * NEWS: Version 2.0a.
10275
10276 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
10277 the previous change.
10278
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
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
10313 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
10314 yesterday's yacc.c fix.
10315
10316 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
10317
10318 * data/glr.c, data/lalr1.cc: Update copyright date.
10319
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
10330 2005-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.
10347
10348 2005-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
10386 2005-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
10391 2005-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
10402 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
10403
10404 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
10405
10406 2005-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.
10414 * tests/input.at (Torturing the Scanner): Likewise.
10415 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
10416
10417 2005-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
10423 2005-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
10445 2005-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
10455 2005-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
10463 2005-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
10470 2005-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
10477 2005-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
10482 2005-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
10488 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
10489
10490 Respond to problems reported by twlevo@xs4all.nl.
10491
10492 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
10493
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.
10499
10500 2005-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
10506 2005-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
10526 2005-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
10532 2005-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
10537 2005-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
10543 2005-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
10552 2005-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
10557 2005-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
10562 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
10563
10564 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
10565 Problem reported by twlevo@xs4all.nl.
10566
10567 * doc/bison.texinfo: Change @dircategory from "GNU programming
10568 tools" to "Software development". Requested by Richard Stallman
10569 via Karl Berry.
10570
10571 2005-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
10576 2005-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
10583 2005-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
10590 2005-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
10595 2005-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
10601 2005-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
10608 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
10609
10610 * TODO: Mention that we should allow NUL bytes in tokens.
10611
10612 2005-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
10617 2005-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
10628 2004-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
10633 2004-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.
10637 * configure.ac (AC_INIT): Bump version to 2.0.
10638 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
10639
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
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
10652 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
10653
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
10669 * doc/bison.texinfo (Location Default Action): Mention that n must
10670 be zero when k is zero. Suggested by Frank Heckenbach.
10671
10672 2004-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
10689 2004-12-21 Akim Demaille <akim@epita.fr>
10690
10691 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
10692
10693 2004-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.
10702 Forward declare them before the user code.
10703 * tests/Makefile.am (check-local, installcheck-local): Pass
10704 TESTSUITEFLAGS to the TESTSUITE.
10705
10706 2004-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
10720 2004-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
10725 2004-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
10760 2004-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
10772 2004-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
10782 2004-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
10788 2004-12-16 Akim Demaille <akim@epita.fr>
10789
10790 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
10791 real.
10792
10793 2004-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
10802 2004-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
10824 2004-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
10838 2004-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
10847 2004-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
10855 2004-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
10873 2004-12-15 Akim Demaille <akim@epita.fr>
10874
10875 Remove b4_root related material: failure experiment
10876 (which goal was to allow to derive from a class).
10877
10878 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
10879 definitions and uses.
10880
10881 2004-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
10891 2004-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
10908 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
10909
10910 * HACKING: Update email addresses to send announcements to.
10911
10912 * configure.ac (AC_INIT): Bump version to 1.875f.
10913
10914 2004-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
10935 specifying whether the test should be skipped. Use it tp
10936 specify that the [%defines %skeleton "lalr1.cc"] tests currently
10937 fail on some hosts, and should be skipped.
10938
10939 2004-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
11004 2004-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
11015 2004-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
11022 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
11023
11024 * bootstrap (gnulib_modules): Add extensions.
11025 Problem reported by Jim Meyering.
11026
11027 2004-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.
11033 Problem reported by Jim Meyering.
11034
11035 2004-11-17 Akim Demaille <akim@epita.fr>
11036
11037 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
11038
11039 2004-11-17 Akim Demaille <akim@epita.fr>,
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
11052 2004-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
11059 2004-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
11064 2004-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
11081 2004-10-22 Akim Demaille <akim@epita.fr>
11082 and Paul Eggert <eggert@cs.ucla.edu>
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
11096 2004-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
11102 2004-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
11120 2004-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
11128 2004-10-06 Akim Demaille <akim@epita.fr>
11129
11130 * src/parse-gram.y (add_param): Fix the truncation of trailing
11131 spaces.
11132
11133 2004-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
11150 2004-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
11155 2004-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
11162 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
11163
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.
11166
11167 2004-09-27 Akim Demaille <akim@epita.fr>
11168
11169 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
11170
11171 2004-09-27 Akim Demaille <akim@epita.fr>
11172
11173 * data/lalr1.cc (b4_parse_param_decl_1): New.
11174 (b4_parse_param_decl): Use it to have different names between attribute
11175 and argument names.
11176 (b4_cc_constructor_call): Likewise.
11177
11178 2004-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
11184 2004-09-24 Akim Demaille <akim@epita.fr>
11185
11186 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
11187 after the location.
11188
11189 2004-09-24 Akim Demaille <akim@epita.fr>
11190
11191 * doc/bison.texinfo (Table of Symbols): Sort.
11192
11193 2004-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
11199 2004-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
11218 2004-09-20 Akim Demaille <akim@epita.fr>
11219
11220 * doc/bison.texinfo (Initial Action Decl): New.
11221
11222 2004-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
11233 2004-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
11258 2004-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
11268 2004-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
11283 2004-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
11309 2004-09-06 Akim Demaille <akim@epita.fr>
11310
11311 * data/lalr1.cc: Adjust the indentation of the labels.
11312 (Parser::pop): New.
11313 Use it.
11314
11315 2004-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
11326 2004-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
11335 2004-09-02 Akim Demaille <akim@epita.fr>
11336
11337 * data/lalr1.cc (translate_, destruct_): No reason to be static.
11338
11339 2004-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
11350 2004-09-02 Akim Demaille <akim@epita.fr>
11351
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.
11356 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
11357 %printer calls to use cdebug_ when using lalr1.cc.
11358
11359 2004-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
11364 2004-08-26 Akim Demaille <akim@epita.fr>
11365
11366 * doc/bison.texinfo (Implementing Loops): Rename as...
11367 (Implementing Gotos/Loops): this.
11368
11369 2004-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
11380 2004-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
11385 2004-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
11392 2004-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>.
11397
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
11411 2004-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".
11417
11418 2004-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
11425 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
11426
11427 * doc/bison.texinfo (Simple GLR Parsers): New section.
11428
11429 2004-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
11454 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
11455
11456 * README: Update location of patched M4 distribution.
11457
11458 2004-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
11465 2004-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
11478 2004-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
11483 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
11484
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.
11497
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
11500 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
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
11505 2004-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
11515 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
11516
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
11520 * bootstrap: Don't assume $(...) works; use `...` instead.
11521 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
11522 gettext better.
11523
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
11528 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
11529
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.
11538
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
11546 2004-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:
11551 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
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
11558 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
11559
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
11565 * configure.ac (AC_INIT): Update to 1.875e.
11566
11567 2004-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
11580 2004-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.
11587
11588 2004-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.
11600
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.
11606 Don't DEFUN AM_INTL_SUBDIR twice.
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.
11620
11621 2004-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.
11635 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
11636 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
11637 does this for us.
11638 (AC_ISC_POSIX): Remove; we no longer support this
11639 ancient OS, as it gets in the way of latest Autoconf & gnulib.
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
11723 2004-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
11767 2004-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
11772 2004-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
11813 2004-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.
11818
11819 * src/scan-gram.l: Recognize %expect-rr.
11820
11821 * src/conflicts.h (expected_sr_conflicts): Rename from
11822 expected_conflicts.
11823 (expected_rr_conflicts): Declare.
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.
11832
11833 * doc/bison.texinfo: Add documentation for %expect-rr.
11834
11835 2004-03-08 Paul Eggert <eggert@gnu.org>
11836
11837 Add support for hex token numbers. Suggested by Odd Arild Olsen in
11838 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
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
11850 2004-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
11855 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
11856
11857 2004-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
11875 2004-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
11886 2004-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
11892 2004-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
11897 2003-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.
11911
11912 2003-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
11918 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
11919
11920 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
11921
11922 2003-10-07 Paul Eggert <eggert@twinsun.com>
11923
11924 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
11925 if testsuite doesn't exist.
11926
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
11932 2003-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
11939 2003-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
11947 2003-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
11955 2003-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
11962 2003-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.
11975
11976 2003-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
11981 2003-08-27 Akim Demaille <akim@epita.fr>
11982
11983 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
11984 GCC warnings.
11985
11986 2003-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
11991 2003-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
11998 2003-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
12005 2003-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
12024 2003-08-25 Akim Demaille <akim@epita.fr>
12025
12026 * doc/bison.texinfo: Don't promote stdout for error messages.
12027
12028 2003-08-25 Akim Demaille <akim@epita.fr>
12029
12030 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
12031 From Alexandre Duret-Lutz.
12032
12033 2003-08-25 Akim Demaille <akim@epita.fr>
12034
12035 Version 1.875c.
12036
12037 2003-08-25 Akim Demaille <akim@epita.fr>
12038
12039 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
12040 Use them.
12041
12042 2003-08-25 Akim Demaille <akim@epita.fr>
12043
12044 * data/lalr1.cc (Parser::reduce_print_): New.
12045 Use it.
12046
12047 2003-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
12051 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
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
12068 2003-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
12081 2003-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
12088 2003-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.
12095
12096 2003-07-25 Paul Eggert <eggert@twinsun.com>
12097
12098 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
12099 for portability to K&R C (after ansi2knr, presumably). See
12100 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
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
12105 Let the user specify how to allocate and free memory.
12106 Derived from a suggestion by Frank Heckenbach in
12107 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
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
12113 2003-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
12117 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
12118 (trivial change)
12119
12120 2003-06-25 Akim Demaille <akim@epita.fr>
12121
12122 * config/depcomp, config/install-sh: Update from masters.
12123
12124 2003-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
12134 2003-06-19 Paul Eggert <eggert@twinsun.com>
12135
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
12140 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
12141
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
12150 2003-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
12155 2003-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:
12185 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
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
12199 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
12200 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
12201 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
12202
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
12227 2003-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
12235 (I can't quite reconstruct why these were not allowed before).
12236
12237 Fixes to avoid problem that $-N rules in GLR parsers can cause
12238 buffer overruns, corrupting state.
12239
12240 * src/output.c (prepare_rules): Output max_left_semantic_context
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.
12258
12259 * tests/cxx-type.at: Exercise location information; update tests
12260 to differentiate output with and without locations.
12261 Remove forward declarations of yylex and yyerror---caused errors
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.
12269
12270 2003-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
12287 2003-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
12293 2003-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
12305 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
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:
12326 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
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
12346 2003-05-24 Paul Eggert <eggert@twinsun.com>
12347
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.
12355
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
12419 2003-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
12430 2003-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
12446 2003-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
12454 2003-05-05 Paul Eggert <eggert@twinsun.com>
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
12459 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
12460
12461 2003-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
12466 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
12467
12468 2003-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
12480 2003-04-29 Akim Demaille <akim@epita.fr>
12481
12482 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
12483
12484 2003-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
12490 2003-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
12495 2003-04-27 Paul Eggert <eggert@twinsun.com>
12496
12497 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
12498 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
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
12503 2003-04-26 Paul Eggert <eggert@twinsun.com>
12504
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
12510 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
12511
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
12516 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
12517
12518 2003-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
12523 2003-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
12529 2003-04-17 Paul Eggert <eggert@twinsun.com>
12530
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
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
12543 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
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
12552 2003-03-31 Akim Demaille <akim@epita.fr>
12553
12554 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
12555
12556 2003-03-31 Akim Demaille <akim@epita.fr>
12557
12558 * src/output.c (prepare_symbols): Avoid trailing spaces in the
12559 output.
12560
12561 2003-03-31 Akim Demaille <akim@epita.fr>
12562
12563 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
12564 From Paul Hilfinger.
12565
12566 2003-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
12571 2003-03-29 Akim Demaille <akim@epita.fr>
12572
12573 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
12574
12575 2003-03-29 Akim Demaille <akim@epita.fr>
12576
12577 * doc/bison.texinfo (Strings are Destroyed): New.
12578
12579 2003-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
12586 2003-03-12 Paul Eggert <eggert@twinsun.com>
12587
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
12592 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
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
12600 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
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
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}
12616
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
12651 2003-03-03 Akim Demaille <akim@epita.fr>
12652
12653 * ro.po: New.
12654
12655 2003-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
12660 2003-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
12667 2003-03-02 Akim Demaille <akim@epita.fr>
12668
12669 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
12670 message.
12671
12672 2003-03-02 Akim Demaille <akim@epita.fr>
12673
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
12678 2003-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
12692 2003-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
12703 2003-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
12710 2003-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
12714 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
12715
12716 2003-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
12724 2003-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
12729 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
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
12735 2003-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
12741 2003-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
12747 2003-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
12755 2003-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.
12761 With the help of Benoit Perrot.
12762
12763 2003-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
12774 2003-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
12779 2003-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
12786 2003-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
12794 2003-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
12799 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
12800
12801 2003-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
12805 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
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
12813 2003-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)
12844 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
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
12850 2003-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
12855 2003-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
12860 2003-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
12913 2003-02-02 Akim Demaille <akim@epita.fr>
12914
12915 * src/scan-skel.l: Scan more than one inert character per yylex
12916 invocation.
12917
12918 2003-02-01 Paul Eggert <eggert@twinsun.com>
12919
12920 Version 1.875a.
12921
12922 * po/LINGUAS: Add ms.
12923
12924 2003-01-30 Akim Demaille <akim@epita.fr>
12925
12926 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
12927
12928 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12929
12930 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
12931 of $1.
12932
12933 Changes in response to error report by S. Eken: GLR mode does not
12934 handle negative $ indices or $ indices in embedded rules correctly.
12935 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
12936
12937 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
12938 (b4_rhs_location): Ditto.
12939 (yyfill): New function to copy from stack tree into array
12940 incrementally.
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
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.
12950 (yyresolveStates): Use X == NULL for pointers, not !X.
12951 (yyglrReduce): Ditto.
12952 (yydoAction): Ditto
12953
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
12961 2003-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
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>.
12968
12969 2003-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
12981 2003-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
12985 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
12986
12987 2003-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
12998 2003-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
13003 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
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
13013 2003-01-09 Akim Demaille <akim@epita.fr>
13014
13015 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
13016
13017 2003-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
13024 2003-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
13029 2003-01-04 Paul Eggert <eggert@twinsun.com>
13030
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
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
13042 2003-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.
13052
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.
13058
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.
13065
13066 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
13067
13068 2003-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
13074 2003-01-01 Paul Eggert <eggert@twinsun.com>
13075
13076 * Version 1.875.
13077
13078 2002-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
13085 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
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
13093 2002-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.
13098
13099 2002-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
13127 2002-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
13131 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
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.
13149
13150 2002-12-26 Paul Eggert <eggert@twinsun.com>
13151
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
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 ".".
13165
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.
13174
13175 2002-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
13179 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
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
13193 2002-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
13203 2002-12-24 Paul Eggert <eggert@twinsun.com>
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",
13254 <INITIAL>"%parse-param", <INITIAL>"%printer",
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
13268 2002-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
13274 2002-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
13279 disagreed with the Bison documentation. Bug
13280 reported by Andrew Walrond.
13281
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
13289 2002-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.
13297 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
13298 as an alias for bison y.
13299
13300 * po/LINGUAS: Add da.
13301
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
13314 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
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
13320 2002-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
13432 2002-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
13588 2002-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
13595 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
13596
13597 2002-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.
13602
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.
13623 (rules): Use it.
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
13678 2002-12-06 Paul Eggert <eggert@twinsun.com>
13679
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.
13687
13688 2002-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
13693 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
13694
13695 2002-11-30 Paul Eggert <eggert@twinsun.com>
13696
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
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
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
13718 2002-11-29 Paul Eggert <eggert@twinsun.com>
13719
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
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
13739 2002-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
13745 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
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
13766 2002-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
13783 2002-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.
13788
13789 2002-11-20 Paul Eggert <eggert@twinsun.com>
13790
13791 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
13792
13793 2002-11-20 Paul Eggert <eggert@twinsun.com>
13794
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
13838 2002-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
13843 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
13844
13845 2002-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
13851 2002-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
13870 2002-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
13883 2002-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
13898 2002-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
13908 2002-11-16 Paul Eggert <eggert@twinsun.com>
13909
13910 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
13911
13912 2002-11-15 Paul Eggert <eggert@twinsun.com>
13913
13914 * tests/actions.at (Actions after errors): New test case.
13915
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
13924 2002-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
13934 2002-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
13939 2002-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
13950 2002-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
13955 2002-11-14 Paul Eggert <eggert@twinsun.com>
13956
13957 * src/output.c (output_skeleton): Call xfopen instead of
13958 duplicating xfopen's body.
13959
13960 Fix bugs reported by Nelson H. F. Beebe in
13961 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
13962
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
13972 test backslash-newline in C character constant.
13973
13974 2002-11-14 Akim Demaille <akim@epita.fr>
13975
13976 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
13977 status of the compiler.
13978 Calling `exit 1' is no longer needed.
13979 Reported by Nelson H. F. Beebe.
13980
13981 2002-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
13994 2002-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
14001 2002-11-13 Paul Eggert <eggert@twinsun.com>
14002
14003 Fix some bugs reported by Albert Chin-A-Young in
14004 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
14005
14006 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
14007 -o c"; the HP C compiler chatters during compilation.
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
14012 solitary backslashes, as they tickle a bug in the HP C compiler.
14013
14014 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
14015 comments, since they're not portable. Use GNU coding style.
14016
14017 2002-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
14025 2002-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
14032 by Nelson H. F. Beebe in
14033 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
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'.
14042 This fixes one of the bugs reported by Nelson H. F. Beebe in
14043 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
14044
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:
14048 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
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
14060 2002-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
14066 2002-11-12 Akim Demaille <akim@epita.fr>
14067
14068 * Makefile.maint: Sync with Autoconf:
14069 (local_updates): New.
14070
14071 2002-11-12 Akim Demaille <akim@epita.fr>
14072
14073 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
14074
14075 2002-11-12 Akim Demaille <akim@epita.fr>
14076
14077 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
14078 locations.
14079
14080 2002-11-12 Akim Demaille <akim@epita.fr>
14081
14082 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
14083 not yyvalue.
14084
14085 2002-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
14090 2002-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
14109 2002-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
14121 2002-11-12 Akim Demaille <akim@epita.fr>
14122
14123 * doc/bison.texinfo (Destructor Decl): New.
14124
14125 2002-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.
14133 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
14134 the file name.
14135
14136 2002-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
14148 2002-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
14156 2002-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
14191 2002-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
14204 2002-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:
14209 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
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
14274 2002-11-09 Paul Eggert <eggert@twinsun.com>
14275
14276 Fix the test failure due to GCC warnings described in
14277 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
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
14298 2002-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
14322 2002-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
14335 2002-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
14345 2002-11-06 Akim Demaille <akim@epita.fr>
14346
14347 * tests/regression.at (Invalid inputs): Adjust to the recent
14348 messages.
14349
14350 2002-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'.
14360 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
14361
14362 2002-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
14372 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14373
14374 * src/tables.c (matching_state): Don't allow states to match if
14375 either has GLR conflict entries.
14376
14377 2002-11-05 Paul Eggert <eggert@twinsun.com>
14378
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
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
14395 2002-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
14400 2002-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
14405 2002-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
14414 2002-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
14424 2002-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
14431 2002-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
14466 2002-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
14473 2002-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.
14477
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).
14499
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.
14504
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
14533 2002-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
14548 2002-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
14563 2002-10-30 Akim Demaille <akim@epita.fr>
14564
14565 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
14566 #if.
14567
14568 2002-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.
14573
14574 2002-10-24 Paul Eggert <eggert@twinsun.com>
14575
14576 Version 1.75a.
14577
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
14584 2002-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
14591 2002-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
14600 2002-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
14608 2002-10-22 Akim Demaille <akim@epita.fr>
14609
14610 * src/system.h: Include sys/types.
14611 Reported by Bert Deknuydt.
14612
14613 2002-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
14618 2002-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:
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
14631
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
14636 2002-10-22 Akim Demaille <akim@epita.fr>
14637
14638 * data/README: New.
14639
14640 2002-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.
14658
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
14678 2002-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.
14692
14693 2002-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
14703 2002-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
14717 2002-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
14732 2002-10-20 Akim Demaille <akim@epita.fr>
14733
14734 * src/tables.h, src/tables.c, src/output.c: Comment changes.
14735
14736 2002-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
14741 2002-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
14752 2002-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.
14774
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
14787 2002-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
14795 2002-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
14819 2002-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
14828 2002-10-18 Paul Eggert <eggert@twinsun.com>
14829
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
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
14838 2002-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
14850 2002-10-16 Paul Eggert <eggert@twinsun.com>
14851
14852 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
14853 MUSCLE_TAB_H.
14854
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
14863 2002-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.
14874
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.
14938
14939 2002-10-14 Akim Demaille <akim@epita.fr>
14940
14941 Version 1.75.
14942
14943 2002-10-14 Akim Demaille <akim@epita.fr>
14944
14945 * tests/Makefile.am (maintainer-check-posix): New.
14946
14947 2002-10-14 Akim Demaille <akim@epita.fr>
14948
14949 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
14950 member.
14951
14952 2002-10-14 Akim Demaille <akim@epita.fr>
14953
14954 * src/tables.c (table_ninf_remap): base -> tab.
14955 Reported by Matt Rosing.
14956
14957 2002-10-14 Paul Eggert <eggert@twinsun.com>
14958
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.
14965
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
14973 2002-10-13 Paul Eggert <eggert@twinsun.com>
14974
14975 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
14976 true due to limited range of data type" warning from GCC.
14977
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
14982 2002-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
14987 2002-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
14992 2002-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
14998 2002-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
15015 2002-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
15026 2002-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
15031 2002-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
15038 check the length of the traces when %glr.
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
15059 2002-10-13 Paul Eggert <eggert@twinsun.com>
15060
15061 Fix problem reported by Henrik Grubbstroem in
15062 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
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.
15071
15072 2002-10-12 Paul Eggert <eggert@twinsun.com>
15073
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
15079 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
15080
15081 * lib/timevar.c: Update copyright date and clarify comments.
15082 (get_time) [IN_GCC]: Keep the GCC version for reference.
15083
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
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
15092 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
15093
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
15098 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
15099
15100 2002-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
15107 2002-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
15114 2002-10-11 Akim Demaille <akim@epita.fr>
15115
15116 * po/id.po: New.
15117
15118 2002-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.
15183 * lib/abitset.c (struct abitset_struct, abitset,
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
15219 2002-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
15223 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
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
15228 2002-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
15255 2002-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
15261 2002-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.
15287
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.
15301
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.
15315
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.
15323
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
15341 2002-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
15347 2002-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
15354 2002-09-27 Akim Demaille <akim@epita.fr>
15355
15356 Version 1.49c.
15357
15358 2002-09-27 Akim Demaille <akim@epita.fr>
15359
15360 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
15361 (Because of AC_LIBSOURCE).
15362
15363 2002-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
15372 2002-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
15382 2002-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
15387 2002-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
15396 2002-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
15401 2002-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
15409 2002-09-12 Akim Demaille <akim@epita.fr>
15410
15411 * m4/prereq.m4: Update, from Coreutils 4.5.1.
15412
15413 2002-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
15419 2002-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
15425 2002-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
15430 2002-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
15436 2002-09-06 Akim Demaille <akim@epita.fr>
15437
15438 * data/c.m4 (b4_copyright): Move the GPL exception comment from
15439 here to...
15440 * data/yacc.c: here.
15441
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
15446 2002-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
15451 2002-09-04 Akim Demaille <akim@epita.fr>
15452
15453 * configure.in: Rename as...
15454 * configure.ac: this.
15455 Bump to 1.49c.
15456
15457 2002-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
15463 2002-08-12 Paul Eggert <eggert@twinsun.com>
15464
15465 Version 1.49b.
15466
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
15607 2002-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
15626 2002-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
15651 2002-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
15666 2002-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
15681 2002-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
15707 2002-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
15723 2002-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
15743 2002-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
15753 2002-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
15763 2002-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
15780 2002-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
15789 2002-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
15799 2002-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
15810 2002-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
15817 2002-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
15829 2002-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
15835 2002-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
15855 2002-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
15863 2002-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
15870 2002-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
15878 2002-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
15911 2002-07-19 Akim Demaille <akim@epita.fr>
15912
15913 * src/scan-gram.l (id): Can start with an underscore.
15914
15915 2002-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
15923 2002-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
15930 2002-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
15938 2002-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
15948 2002-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
15955 2002-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
15961 2002-07-09 Akim Demaille <akim@epita.fr>
15962
15963 * data/yacc.c: Output the copyright notive in the header.
15964
15965 2002-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
15976 2002-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
15985 2002-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
15993 2002-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
16003 2002-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
16027 2002-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
16035 2002-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
16040 2002-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
16067 2002-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
16075 2002-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
16081 2002-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
16090 2002-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
16104 2002-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
16117 2002-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
16124 2002-06-30 Akim Demaille <akim@epita.fr>
16125
16126 * src/output.c (action_row): Let default_rule be always a rule
16127 number.
16128
16129 2002-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
16140 2002-06-30 Akim Demaille <akim@epita.fr>
16141
16142 * src/print_graph.c: Use report_flag.
16143
16144 2002-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
16151 2002-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
16156 2002-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
16166 2002-06-30 Akim Demaille <akim@epita.fr>
16167
16168 * src/symtab.c (symbol_new): Initialize the `printer' member.
16169
16170 2002-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
16178 2002-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
16193 2002-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
16198 2002-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
16218 2002-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
16227 2002-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
16234 2002-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
16241 2002-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
16250 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16251
16252 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
16253 reorganize first lines parallel to yacc.c.
16254
16255 2002-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
16261 2002-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
16267 2002-06-28 Akim Demaille <akim@epita.fr>
16268
16269 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
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.
16273
16274 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16275
16276 Accumulated changelog for new GLR parsing features.
16277
16278 * src/conflicts.c (count_total_conflicts): Change name to
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.
16286
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
16295
16296 * src/getargs.c:
16297
16298 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
16299 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
16300
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.
16320
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.
16335 (prepare_rules): Output dprec and merger tables.
16336 (conflict_row): New function.
16337 (action_row): Output conflict lists for GLR parser. Don't use
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.
16357 (conflicts_output): Modify call to count_rr_conflicts for new
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.
16387
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.
16393
16394 2002-06-27 Akim Demaille <akim@epita.fr>
16395
16396 * src/options.h, src/options.c: Remove.
16397 * src/getargs.c (short_options, long_options): New.
16398
16399 2002-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
16405 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
16406
16407 * src/getargs.c (report_argmatch): Initialize strtok().
16408
16409 2002-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
16416 2002-06-20 Akim Demaille <akim@epita.fr>
16417
16418 * data/bison.simple (yydestructor): Rename as...
16419 (yydestruct): this.
16420
16421 2002-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
16428 2002-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
16440 2002-06-20 Akim Demaille <akim@epita.fr>
16441
16442 * data/bison.simple (YYLEX): Fix the declaration when
16443 %pure-parser.
16444
16445 2002-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
16453 2002-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
16458 2002-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
16477 2002-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
16483 2002-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
16492 2002-06-19 Akim Demaille <akim@epita.fr>
16493
16494 * data/bison.simple (b4_pure_if): New.
16495 Use it instead of #ifdef YYPURE.
16496
16497 2002-06-19 Akim Demaille <akim@epita.fr>
16498
16499 * data/bison.simple (b4_location_if): New.
16500 Use it instead of #ifdef YYLSP_NEEDED.
16501
16502 2002-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
16518 2002-06-19 Zack Weinberg <zack@codesourcery.com>
16519
16520 * doc/bison.texinfo: Document ability to have multiple
16521 prologue sections.
16522
16523 2002-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
16528 2002-06-18 Akim Demaille <akim@epita.fr>
16529
16530 * data/bison.simple.new: Comment changes.
16531 Reported by Andreas Schwab.
16532
16533 2002-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
16539 2002-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
16549 2002-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
16556 2002-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
16576 2002-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
16587 2002-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
16598 2002-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
16609 2002-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
16614 2002-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
16619 2002-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
16631 2002-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
16640 2002-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
16649 2002-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
16659 2002-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
16678 2002-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
16691 2002-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
16711 2002-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
16721 2002-06-14 Akim Demaille <akim@epita.fr>
16722
16723 * src/main.c (main): Invoke scanner_free.
16724
16725 2002-06-14 Akim Demaille <akim@epita.fr>
16726
16727 * src/output.c (m4_invoke): Extracted from...
16728 (output_skeleton): here.
16729 Free tempfile.
16730
16731 2002-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
16740 2002-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
16753 2002-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
16764 2002-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
16770 2002-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
16776 2002-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
16782 2002-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
16790 2002-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
16796 2002-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
16803 2002-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
16926 2002-06-11 Akim Demaille <akim@epita.fr>
16927
16928 * src/reader.c (parse_action): Don't store directly into the
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
16936 2002-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
16945 2002-06-11 Akim Demaille <akim@epita.fr>
16946
16947 * src/reader.c (grammar_midrule_action): New, Eved out from
16948 (readgram): here.
16949
16950 2002-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
16957 2002-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
16963 2002-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
16973 2002-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
16982 2002-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
16990 2002-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
17001 2002-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
17008 2002-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
17031 2002-06-03 Akim Demaille <akim@epita.fr>
17032
17033 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
17034 then statements.
17035
17036 2002-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
17046 2002-05-28 Akim Demaille <akim@epita.fr>
17047
17048 * data/bison.c++: Use C++ ostreams.
17049 (cdebug_): New member.
17050
17051 2002-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
17056 2002-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
17064 2002-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.
17070
17071 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17072
17073 * src/conflicts.c (log_resolution): Correct typo:
17074 obstack_printf should be obstack_fgrow1.
17075
17076 2002-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
17095 2002-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
17107 2002-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
17116 2002-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
17139 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17140 and Paul Eggert <eggert@twinsun.com>
17141
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
17149 2002-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.
17154 (yytranslate): Expand definition of yy_token_number_type, so that
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.
17159
17160 * tests/regression.at: Modify expected output to agree with change
17161 to yyr1 and yytranslate.
17162
17163 2002-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
17168 2002-05-13 Akim Demaille <akim@epita.fr>
17169
17170 * tests/regression.at (Token definitions): Prototype yylex and
17171 yyerror.
17172
17173 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17174
17175 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
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
17180 2002-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
17185 2002-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
17200 2002-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
17208 2002-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
17213 2002-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
17220 2002-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
17225 2002-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
17236 2002-05-05 Akim Demaille <akim@epita.fr>
17237
17238 * tests/torture.at (Many lookaheads): New test.
17239
17240 2002-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
17257 2002-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
17269 2002-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
17278 2002-05-03 Paul Eggert <eggert@twinsun.com>
17279
17280 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
17281 for K&R C.
17282
17283 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
17284
17285 * Makefile.am (SUBDIRS): Remove intl.
17286 (EXTRA_DIST): Add config/config.rpath.
17287
17288 2002-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
17293 2002-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
17300 2002-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
17305 2002-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
17314 2002-05-03 Akim Demaille <akim@epita.fr>
17315
17316 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
17317
17318 2002-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
17323 2002-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
17329 2002-05-02 Akim Demaille <akim@epita.fr>
17330
17331 * src/reader.c (parse_braces): Merge into...
17332 (parse_action): this.
17333
17334 2002-05-02 Akim Demaille <akim@epita.fr>
17335
17336 * configure.in (ALL_LINGUAS): Remove.
17337 * po/LINGUAS, hr.po: New.
17338
17339 2002-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
17363 2002-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.
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'.
17375 * data/bison.simple, data/bison.c++ (b4_lhs_value)
17376 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
17377
17378 2002-05-02 Akim Demaille <akim@epita.fr>
17379
17380 * configure.in (AC_INIT): Bump to 1.49b.
17381 (AM_INIT_AUTOMAKE): Short invocation.
17382
17383 2002-05-02 Akim Demaille <akim@epita.fr>
17384
17385 Version 1.49a.
17386
17387 2002-05-01 Akim Demaille <akim@epita.fr>
17388
17389 * src/skeleton.h: Remove.
17390
17391 2002-05-01 Akim Demaille <akim@epita.fr>
17392
17393 * src/skeleton.h: Fix the #endif.
17394 Reported by Magnus Fromreide.
17395
17396 2002-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.
17400 (YYCOPY): Fix [] quoting problem in the non-GCC case.
17401
17402 2002-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
17416 2002-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
17422 2002-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
17439 2002-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
17452 2002-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
17460 2002-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
17467 2002-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
17473 2002-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
17479 2002-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
17491 2002-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
17505 2002-04-22 Akim Demaille <akim@epita.fr>
17506
17507 * src/output.h, src/output.c (get_lines_number): Remove.
17508
17509 2002-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
17517 2002-04-19 Akim Demaille <akim@epita.fr>
17518
17519 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
17520
17521 2002-04-10 Akim Demaille <akim@epita.fr>
17522
17523 * src/system.h: Rely on HAVE_LIMITS_H.
17524 Suggested by Paul Eggert.
17525
17526 2002-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
17539 2002-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
17564 2002-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
17574 2002-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
17602 2002-04-08 Akim Demaille <akim@epita.fr>
17603
17604 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
17605 and then the grammar.
17606
17607 2002-04-08 Akim Demaille <akim@epita.fr>
17608
17609 * src/system.h: No longer using strndup.
17610
17611 2002-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
17624 2002-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
17630 2002-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
17636 2002-04-07 Akim Demaille <akim@epita.fr>
17637
17638 * src/reader.c: Normalize increments to prefix form.
17639
17640 2002-04-07 Akim Demaille <akim@epita.fr>
17641
17642 * src/reader.c, symtab.c: Remove debugging code.
17643
17644 2002-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
17661 2002-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
17682 2002-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
17692 2002-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
17699 2002-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
17704 2002-04-07 Akim Demaille <akim@epita.fr>
17705
17706 * src/lalr.h (LA): Is a bitsetv, not bitset*.
17707
17708 2002-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
17714 2002-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
17721 2002-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
17728 2002-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
17747 2002-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
17767 2002-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
17773 2002-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
17785 2002-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
17798 2002-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
17804 2002-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
17810 2002-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
17815 2002-04-07 Akim Demaille <akim@epita.fr>
17816
17817 * TODO: Update.
17818
17819 2002-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
17824 2002-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
17831 2002-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
17839 2002-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.
17845
17846 2002-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
17852 2002-03-20 Akim Demaille <akim@epita.fr>
17853
17854 * src/conflicts.c (log_resolution): Argument `resolution' is const.
17855
17856 2002-03-19 Paul Eggert <eggert@twinsun.com>
17857
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
17863 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
17864 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
17865
17866 2002-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.
17872 (Prologue synch line, %union synch line, Postprologue synch line)
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
17877 2002-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
17884 2002-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
17893 2002-03-14 Akim Demaille <akim@epita.fr>
17894
17895 Use Gettext 0.11.1.
17896
17897 2002-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
17902 2002-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
17908 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
17909
17910 * src/reader.c: Warn about lacking semi-colons, do not complain.
17911
17912 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
17913
17914 * data/bison.c++: Remove a debug line.
17915
17916 2002-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
17922 2002-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
17931 2002-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
17940 2002-03-04 Akim Demaille <akim@epita.fr>
17941
17942 * src/output.c (output_skeleton): tempdir is const.
17943 bytes_read is unused.
17944
17945 2002-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
17952 2002-03-04 Akim Demaille <akim@epita.fr>
17953
17954 * src/closure.c (closure): `r' is unused.
17955
17956 2002-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
17962 2002-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
17970 2002-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
17976 2002-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
17983 2002-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
17989 2002-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
17995 2002-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
18005 2002-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
18011 2002-03-04 Akim Demaille <akim@epita.fr>
18012
18013 * src/lalr.c (F): Now a bitset*.
18014 Adjust all dependencies.
18015
18016 2002-03-04 Akim Demaille <akim@epita.fr>
18017
18018 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
18019 Adjust all dependencies.
18020
18021 2002-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
18029 2002-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
18036 2002-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
18041 2002-03-04 Akim Demaille <akim@epita.fr>
18042
18043 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
18044
18045 2002-03-04 Akim Demaille <akim@epita.fr>
18046
18047 * src/closure.c (ruleset): Be a bitset.
18048 (rulesetsize): Remove.
18049
18050 2002-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
18057 2002-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
18062 2002-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
18067 2002-02-25 Akim Demaille <akim@epita.fr>
18068
18069 * src/getargs.c (version): Give the name of the authors, and use a
18070 translator friendly scheme for the bgr
18071 copyright notice.
18072
18073 2002-02-25 Akim Demaille <akim@epita.fr>
18074
18075 * src/output.c (header_output): Remove, now handled completely via
18076 M4.
18077
18078 2002-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
18085 2002-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
18098 2002-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
18113 2002-02-14 Akim Demaille <akim@epita.fr>
18114
18115 * tests/regression.at (else): Adjust to Andreas' change.
18116
18117 2002-02-14 Akim Demaille <akim@epita.fr>
18118
18119 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
18120
18121 2002-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
18126 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
18127
18128 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
18129 (Copyright notice): Update.
18130
18131 2002-02-11 Akim Demaille <akim@epita.fr>
18132
18133 * tests/regression.at (%nonassoc and eof): Don't include
18134 nonportable headers.
18135
18136 2002-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
18141 2002-02-07 Akim Demaille <akim@epita.fr>
18142
18143 * tests/input.at: New.
18144
18145 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
18146
18147 * data/bison.c++: Replace some direct m4 expansions by constants. Be
18148 more consistent when naming methods and variables. Put preprocessor
18149 directives around tables only needed for debugging.
18150
18151 2002-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
18157 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
18158
18159 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
18160
18161 2002-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
18167 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
18168
18169 * data/bison.c++: Fix m4 quoting in comments.
18170
18171 2002-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
18176 2002-02-05 Akim Demaille <akim@epita.fr>
18177
18178 * data/bison.c++: Adjust to the M4 back end.
18179 More is certainly needed.
18180
18181 2002-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
18218 2002-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
18224 2002-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
18229 2002-02-05 Akim Demaille <akim@epita.fr>
18230
18231 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
18232 * data/: here.
18233
18234 2002-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
18240 2002-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
18253 2002-01-27 Akim Demaille <akim@epita.fr>
18254
18255 * tests/sets.at (AT_EXTRACT_SETS): New.
18256 (Nullable): Use it.
18257 (Firsts): New.
18258
18259 2002-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
18265 2002-01-25 Akim Demaille <akim@epita.fr>
18266
18267 * tests/regression.at (%nonassoc and eof): New.
18268 Suggested by Robert Anisko.
18269
18270 2002-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
18280 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
18281
18282 * src/Makefile.am: Add bison.c++.
18283 * src/bison.c++: New skeleton.
18284
18285 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
18286
18287 * po/it.po: New.
18288
18289 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
18290
18291 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
18292
18293 2002-01-20 Marc Autret <marc@gnu.org>
18294
18295 * src/files.c (compute_output_file_names): Fix
18296
18297 2002-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
18304 2002-01-20 Marc Autret <marc@gnu.org>
18305
18306 * src/system.h: Need to define __attribute__ away for non-GCC
18307 compilers as well (i.e., the vendor C compiler).
18308 Suggested by Albert Chin-A-Young.
18309
18310 2002-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
18317 2002-01-11 Akim Demaille <akim@epita.fr>
18318
18319 * configure.in: Use AC_FUNC_STRNLEN.
18320 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
18321
18322 2002-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
18336 2002-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
18344 2002-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
18353 2002-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
18361 2002-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
18369 2002-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
18377 2002-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
18384 2002-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
18391 2002-01-06 Akim Demaille <akim@epita.fr>
18392
18393 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
18394 skeleton.h.
18395
18396 2002-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
18402 2002-01-03 Akim Demaille <akim@epita.fr>
18403
18404 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
18405
18406 2002-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
18412 2002-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
18421 2002-01-03 Akim Demaille <akim@epita.fr>
18422
18423 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
18424 for non system headers.
18425
18426 2002-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
18443 2001-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
18449 2001-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
18462 2001-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
18479 2001-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
18500 to guess if the generated parsers should have '.tab' in their
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
18512 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
18513 parse-skel.y.
18514
18515 * src/parse-skel.y: New file.
18516 * src/scan-skel.l: New file.
18517
18518 2001-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
18532 2001-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
18538 2001-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
18545 2001-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
18554 2001-12-29 Akim Demaille <akim@epita.fr>
18555
18556 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
18557
18558 2001-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
18563 2001-12-29 Akim Demaille <akim@epita.fr>
18564
18565 * doc/bison.texinfo: Formatting changes.
18566
18567 2001-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
18576 2001-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
18582 2001-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
18591 2001-12-29 Akim Demaille <akim@epita.fr>
18592
18593 Memory leak.
18594
18595 * src/reader.c (reader): Free grammar.
18596
18597 2001-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
18605 2001-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
18613 2001-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
18619 2001-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
18624 2001-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
18631 2001-12-29 Akim Demaille <akim@epita.fr>
18632
18633 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
18634 ago.
18635
18636 2001-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
18641 2001-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
18646 2001-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
18651 2001-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
18662 2001-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
18668 2001-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
18677 2001-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
18684 2001-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
18689 2001-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
18696 2001-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
18709 2001-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
18718 2001-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
18725 2001-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
18737 2001-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
18747 2001-12-29 Akim Demaille <akim@epita.fr>
18748
18749 * src/output.c: Comment changes.
18750
18751 2001-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
18760 2001-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
18771 2001-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
18777 2001-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
18797 2001-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
18813 2001-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
18833 2001-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
18842 2001-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
18850 2001-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
18860 2001-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
18869 2001-12-27 Akim Demaille <akim@epita.fr>
18870
18871 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
18872
18873 2001-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
18884 2001-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
18889 2001-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
18894 2001-12-27 Akim Demaille <akim@epita.fr>
18895
18896 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
18897 duplication.
18898
18899 2001-12-27 Akim Demaille <akim@epita.fr>
18900
18901 * src/reader.c (packgram): Catch nitems overflows.
18902
18903 2001-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
18913 2001-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
18941 2001-12-27 Akim Demaille <akim@epita.fr>
18942
18943 * src/reader.c (symbol_list_new): Be sure to initialize all the
18944 fields.
18945
18946 2001-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
18955 2001-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
18961 2001-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
18979 2001-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
18986 2001-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
18994 2001-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
19001 2001-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
19011 2001-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
19019 2001-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
19028 2001-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
19034 2001-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
19042 2001-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.
19050
19051 2001-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.
19057
19058 2001-12-17 Akim Demaille <akim@epita.fr>
19059
19060 * src/conflicts.c (print_reductions): Formatting changes.
19061
19062 2001-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.
19067
19068 2001-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
19076 2001-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
19082 2001-12-17 Akim Demaille <akim@epita.fr>
19083
19084 * src/output.c: Various formatting changes.
19085
19086 2001-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
19094 2001-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
19099 2001-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.
19104 (output_parser): Adjust, now takes care about the lines of a
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
19111 2001-12-15 Marc Autret <autret_m@epita.fr>
19112
19113 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
19114
19115 2001-12-15 Marc Autret <autret_m@epita.fr>
19116
19117 * src/output.c (output_gram): Keep track of the hairy one.
19118
19119 2001-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
19126 2001-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
19133 2001-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
19152 2001-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
19162 2001-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
19167 2001-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
19179 2001-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
19195 2001-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.
19199 Suggested by Arnold Robbins and Tom Tromey.
19200
19201 2001-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
19207 2001-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
19215 2001-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
19224 2001-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
19246 2001-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
19251 2001-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
19265 2001-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
19271 2001-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
19276 2001-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
19284 2001-12-11 Marc Autret <autret_m@epita.fr>
19285
19286 * src/output.c (output_parser): Remove useless muscle.
19287
19288 2001-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
19295 2001-12-10 Marc Autret <autret_m@epita.fr>
19296
19297 * src/reader.c (copy_definition): Re-use CPP-outed code which
19298 replace precedent remove.
19299 * src/bison.simple: Remove #line before %%prologue because
19300 %%input-line is wrong at this time.
19301
19302 2001-12-10 Marc Autret <autret_m@epita.fr>
19303
19304 * src/reader.c (symbols_output): Clean up.
19305 * src/output.c (output_gram, output): Clean up.
19306
19307 2001-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
19313 2001-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
19319 2001-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
19332 2001-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
19339 2001-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
19346 2001-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
19351 2001-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
19359 2001-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
19365 2001-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
19372 2001-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
19384 2001-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
19394 2001-12-10 Akim Demaille <akim@epita.fr>
19395
19396 * src/muscle_tab.c (muscle_init): NULL is a better default than
19397 `"0"'.
19398
19399 2001-12-10 Akim Demaille <akim@epita.fr>
19400
19401 * src/reader.c (reader): Calling symbols_output once is enough.
19402
19403 2001-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
19420 2001-12-10 Akim Demaille <akim@epita.fr>
19421
19422 * src/options.c (OPTN, DRTV, BOTH): New.
19423 (option_table): Use them.
19424
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
19430 2001-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
19435 2001-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
19447 2001-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
19454 2001-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
19470 2001-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.
19477 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
19478 j must be the outer loop.
19479 * tests/regression.at (Broken Closure): New.
19480
19481 2001-12-05 Akim Demaille <akim@epita.fr>
19482
19483 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
19484 its argument.
19485 Reported by Peter Hamorsky.
19486
19487 2001-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
19495 2001-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
19504 2001-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
19509 2001-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
19519 2001-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
19525 2001-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
19530 2001-12-05 Akim Demaille <akim@epita.fr>
19531
19532 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
19533 indexed by nonterminals.
19534
19535 2001-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
19541 2001-12-05 Akim Demaille <akim@epita.fr>
19542
19543 * src/closure.c (set_fderives): De-obfuscate.
19544
19545 2001-12-05 Akim Demaille <akim@epita.fr>
19546
19547 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
19548
19549 2001-12-05 Akim Demaille <akim@epita.fr>
19550
19551 * src/closure.c (set_firsts): De-obfuscate.
19552
19553 2001-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
19559 2001-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
19569 2001-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
19576 2001-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
19582 2001-12-05 Akim Demaille <akim@epita.fr>
19583
19584 * src/state.h (SHIFT_SYMBOL): New.
19585 * src/conflicts.c: Use it to deobfuscate.
19586
19587 2001-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
19593 2001-12-05 Akim Demaille <akim@epita.fr>
19594
19595 * src/conflicts.c (print_reductions): Arrays, not pointers.
19596 Use BITISSET.
19597
19598 2001-12-05 Akim Demaille <akim@epita.fr>
19599
19600 * src/conflicts.c (print_reductions): Pessimize, but clarify.
19601
19602 2001-12-05 Akim Demaille <akim@epita.fr>
19603
19604 * src/conflicts.c (print_reductions): Improve variable locality.
19605
19606 2001-12-05 Akim Demaille <akim@epita.fr>
19607
19608 * src/conflicts.c (print_reductions): Pessimize, but clarify.
19609
19610 2001-12-05 Akim Demaille <akim@epita.fr>
19611
19612 * src/conflicts.c (print_reductions): Improve variable locality.
19613
19614 2001-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
19619 2001-12-05 Akim Demaille <akim@epita.fr>
19620
19621 * src/LR0.c (augment_automaton): Formatting changes.
19622 Better variable locality.
19623
19624 2001-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
19630 2001-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
19636 2001-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
19646 2001-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
19651 2001-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
19658 2001-12-05 Akim Demaille <akim@epita.fr>
19659
19660 * src/lalr.c (traverse): Use arrays instead of pointers.
19661
19662 2001-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
19668 2001-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
19690 2001-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
19696 2001-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
19705 2001-12-04 Paul Eggert <eggert@twinsun.com>
19706
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.
19712 (yystpcpy): Use prototype if __STDC__ is defined, not just
19713 if __cplusplus is defined.
19714
19715 2001-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
19725 2001-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
19736 2001-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
19773 2001-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
19779 2001-11-30 Akim Demaille <akim@epita.fr>
19780
19781 * tests/reduce.at (Useless Nonterminals): Fix.
19782
19783 2001-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
19788 2001-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
19800 2001-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
19807 2001-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
19814 2001-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
19821 2001-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
19840 2001-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
19846 2001-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
19853 2001-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
19871 2001-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
19878 2001-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
19883 2001-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
19888 2001-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
19893 2001-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
19898 2001-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
19904 2001-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
19909 2001-11-28 Akim Demaille <akim@epita.fr>
19910
19911 * src/reduce.c (reduce_print): Use ngettext.
19912 (dump_grammar): Improve the trace accuracy.
19913
19914 2001-11-28 Akim Demaille <akim@epita.fr>
19915
19916 * src/reduce.c (dump_grammar): Don't translate trace messages.
19917
19918 2001-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
19925 2001-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
19930 2001-11-27 Marc Autret <autret_m@epita.fr>
19931
19932 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
19933 initialization.
19934 * src/output.c (prepare): Remove its update.
19935
19936 2001-11-27 Marc Autret <autret_m@epita.fr>
19937
19938 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
19939 Use %error-verbose.
19940
19941 2001-11-27 Marc Autret <autret_m@epita.fr>
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
19954 2001-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
19959 2001-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
19964 2001-11-27 Akim Demaille <akim@epita.fr>
19965
19966 * src/files.c: Include error.h.
19967 Reported by Hans Aberg.
19968
19969 2001-11-26 Marc Autret <autret_m@epita.fr>
19970
19971 * src/reader.c (parse_include_decl): New, not yet implemented.
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
19980 2001-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
19987 2001-11-26 Akim Demaille <akim@epita.fr>
19988
19989 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
19990 size_ts.
19991
19992 2001-11-26 Akim Demaille <akim@epita.fr>
19993
19994 * src/complain.c, src/complain.h (error): Remove, provided by
19995 lib/error.[ch].
19996
19997 2001-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
20004 2001-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
20009 2001-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
20016 2001-11-23 Akim Demaille <akim@epita.fr>
20017
20018 * lib/alloca.c: Update, from fileutils.
20019
20020 2001-11-23 Akim Demaille <akim@epita.fr>
20021
20022 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
20023
20024 2001-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
20029 2001-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
20037 2001-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
20052 2001-11-22 Marc Autret <autret_m@epita.fr>
20053
20054 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
20055
20056 2001-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
20062 2001-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
20069 2001-11-19 Akim Demaille <akim@epita.fr>
20070
20071 * src/conflicts.c (conflicts_print): Add a missing \n.
20072
20073 2001-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
20079 2001-11-19 Akim Demaille <akim@epita.fr>
20080
20081 * src/print.c (print_actions): Better locality of variables.
20082
20083 2001-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
20088 2001-11-19 Akim Demaille <akim@epita.fr>
20089
20090 * src/closure.c (itemsetend): Remove, replaced with...
20091 (itemsetsize): new.
20092
20093 2001-11-19 Akim Demaille <akim@epita.fr>
20094
20095 * src/LR0.c (kernel_end): Remove, replaced with...
20096 (kernel_size): new.
20097
20098 2001-11-19 Akim Demaille <akim@epita.fr>
20099
20100 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
20101 to clarify.
20102
20103 2001-11-19 Akim Demaille <akim@epita.fr>
20104
20105 * src/closure.c (closure): Use arrays instead of pointers to clarify.
20106
20107 2001-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
20114 2001-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
20123 2001-11-19 Akim Demaille <akim@epita.fr>
20124
20125 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
20126 pointers to clarify the code.
20127 (save_reductions, save_shifts): Factor common parts of alternatives.
20128
20129 2001-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
20141 2001-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
20148 2001-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
20155 2001-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
20160 2001-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
20165 2001-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,
20173 and ask for its output.
20174
20175 2001-11-19 Akim Demaille <akim@epita.fr>
20176
20177 * src/bison.simple (yyparse): When verbosely reporting an error,
20178 no longer put additional quotes around token names.
20179 * tests/calc.at: Adjust.
20180
20181 2001-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
20187 2001-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
20193 2001-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
20202 2001-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
20208 2001-11-19 Akim Demaille <akim@epita.fr>
20209
20210 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
20211 (maxrhs): this new function.
20212
20213 2001-11-19 Akim Demaille <akim@epita.fr>
20214
20215 * src/lalr.c (F): New macro to access the variable F.
20216 Adjust.
20217
20218 2001-11-19 Akim Demaille <akim@epita.fr>
20219
20220 * src/lalr.h (LA): New macro to access the variable LA.
20221 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20222 * src/lalr.c: Adjust.
20223
20224 2001-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
20229 2001-11-19 Akim Demaille <akim@epita.fr>
20230
20231 * src/lalr.h (lookaheads): Removed array, whose contents is now
20232 a member of...
20233 (state_t): this structure.
20234 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20235 Adjust.
20236
20237 2001-11-19 Akim Demaille <akim@epita.fr>
20238
20239 * src/lalr.h (consistent): Removed array, whose contents is now
20240 a member of...
20241 (state_t): this structure.
20242 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20243 Adjust.
20244
20245 2001-11-19 Akim Demaille <akim@epita.fr>
20246
20247 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
20248 contents are now members of...
20249 (state_t): this structure.
20250 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20251 Adjust.
20252
20253 2001-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
20263 2001-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
20276 2001-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
20283 2001-11-14 Akim Demaille <akim@epita.fr>
20284
20285 * src/print.c: Include reduce.h.
20286 Reported by Hans Aberg.
20287
20288 2001-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
20300 2001-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
20307 2001-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
20312 2001-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
20323 2001-11-12 Akim Demaille <akim@epita.fr>
20324
20325 %expect was not functioning at all.
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
20335 2001-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
20341 2001-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
20353 2001-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
20359 2001-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.
20369 * src/print.c (print_grammar): Issue `\n' between two rules.
20370 * tests/regression.at (Conflicts): New.
20371 Reported by Tom Lane.
20372
20373 2001-11-12 Akim Demaille <akim@epita.fr>
20374
20375 * tests/regression.at (Invalid input): Remove, duplicate with
20376 ``Invalid input: 1''.
20377
20378 2001-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
20384 2001-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.
20388 Reported by Per Allansson.
20389
20390 2001-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
20400 2001-11-05 Akim Demaille <akim@epita.fr>
20401
20402 * src/reader.c (symbols_output): New, extracted from...
20403 (packsymbols): here.
20404 (reader): Adjust.
20405
20406 2001-11-05 Akim Demaille <akim@epita.fr>
20407
20408 * src/lex.c (parse_percent_token): s/quotearg/quote/.
20409
20410 2001-11-05 Akim Demaille <akim@epita.fr>
20411
20412 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
20413 pattern.
20414
20415 2001-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
20429 2001-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
20443 2001-11-02 Akim Demaille <akim@epita.fr>
20444
20445 * doc/refcard.tex: Update.
20446
20447 2001-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
20460 2001-11-02 Akim Demaille <akim@epita.fr>
20461
20462 * tests/regression.at (Mixing %token styles): New test.
20463
20464 2001-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
20471 2001-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
20479 2001-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
20487 2001-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
20493 2001-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
20500 2001-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
20508 2001-10-14 Marc Autret <autret_m@epita.fr>
20509
20510 * src/options.c (create_long_option_table): Fix.
20511
20512 2001-10-10 Akim Demaille <akim@epita.fr>
20513
20514 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
20515
20516 2001-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
20521 2001-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
20969 2001-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
20976 2001-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
20987 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
20988
20989 * src/bison.simple: Add new `#line' directive.
20990
20991 2001-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
20996 2001-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
21001 2001-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
21009 2001-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
21014 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
21015
21016 * src/options.c (symtab.h): Include it, need by lex.h.
21017
21018 2001-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
21043 2001-09-20 Marc Autret <autret_m@epita.fr>
21044
21045 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
21046 sections of Bison.
21047
21048 2001-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
21054 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
21055
21056 * src/output.c (output_parser): Delete unused variable actions_dumped.
21057
21058 2001-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.
21062 * src/reader.h: Delete declaration of reader_output_yylsp.
21063
21064 2001-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.
21073
21074 * src/reader.h (muscle_obstack): Extern declaration update.
21075
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.
21087
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
21099 2001-09-02 Marc Autret <autret_m@epita.fr>
21100
21101 Now the files macro_tab.[ch] are named muscle_tab.[ch].
21102
21103 * src/muscle_tab.c, src/muscle_tab.h: Add files.
21104
21105 2001-09-02 Marc Autret <autret_m@epita.fr>
21106
21107 * src/macrotab.c, src/macrotab.h: Remove.
21108
21109 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
21110
21111 * src/reader.c (copy_guard): Use muscle to specify the `#line'
21112 filename.
21113
21114 2001-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
21119 2001-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
21126 2001-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
21131 2001-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'.
21137 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
21138 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
21139 yylval, yydebug, yyerror, yynerrs and yyparse.
21140 New directive `#define' to substitute yydebug, ... with option
21141 name_prefix.
21142
21143 2001-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
21149 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
21150
21151 * src/reader.c (read_additionnal_code): Rename %%user_code to
21152 %%epilogue.
21153 * src/output.c (output): Rename %%declarations to %%prologue.
21154 * src/bison.simple: Echo modifications.
21155
21156 2001-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
21164 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
21165
21166 * src/reader.c (reader): Delete obsolete call to function
21167 output_trailers and output_headers.
21168 * src/output.h: Remove obsolete functions prototypes of output_headers
21169 and output_trailers.
21170
21171 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
21172
21173 * src/main.c: Include macrotab.h.
21174 * src/macrotab.h (macro_entry_s): Constify fields.
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
21184 2001-08-30 Marc Autret <autret_m@epita.fr>
21185
21186 * src/reader.c (parse_skel_decl): New.
21187 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
21188 * src/lex.h (token_t): New token `tok_skel'.
21189 * src/lex.c (percent_table): Add skeleton option entry.
21190 Standardize.
21191
21192 2001-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
21200 2001-08-28 Marc Autret <autret_m@epita.fr>
21201
21202 * src/output.c (output_actions): Clean up.
21203 (output_gram): CPP-out useless code.
21204 * src/reader.c (reader): Clean up, CPP-out useless code.
21205
21206 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
21207
21208 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
21209 directive.
21210 * src/bison.simple: Add `%%definitions'.
21211
21212 2001-08-28 Marc Autret <autret_m@epita.fr>
21213
21214 * config/depcomp: New file.
21215
21216 2001-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
21222 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
21223
21224 * src/output.c (output): Remove the initialization of the macro
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
21234 2001-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
21239 2001-08-27 Akim Demaille <akim@epita.fr>
21240
21241 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
21242
21243 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
21244
21245 * lib/Makefile.am: Adjust.
21246
21247 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
21248
21249 * src/bison.simple: Update and add '%%' directives.
21250
21251 2001-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.
21260
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.
21270 (parse_macro_decl): Read macro identifiers using copy_identifier
21271 rather than lex.
21272
21273 2001-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.
21278
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.
21288
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'.
21299
21300 * src/output.c (output_table_data): New function.
21301 (output_short_table): Remove.
21302 (output_short_or_char_table): Remove.
21303
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
21310 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
21311
21312 * src/main.c (main): Initialize the macro table.
21313
21314 2001-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
21319 2001-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
21325 2001-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
21331 2001-08-15 Akim Demaille <akim@epita.fr>
21332
21333 Version 1.28c.
21334
21335 2001-08-15 Marc Autret <autret_m@epita.fr>
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
21345 2001-08-15 Akim Demaille <akim@epita.fr>
21346
21347 * doc/bison.texinfo (Table of Symbols): Document
21348 YYSTACK_USE_ALLOCA.
21349
21350 2001-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
21356 2001-08-15 Akim Demaille <akim@epita.fr>
21357
21358 * Makefile.maint: Sync with CVS Autoconf.
21359
21360 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
21361
21362 * doc/bison.texinfo: Include GNU Free Documentation License from
21363 `fdl.texi'.
21364 * doc/fdl.texi: Add to package.
21365
21366 2001-08-14 Marc Autret <autret_m@epita.fr>
21367
21368 Turn on %{source,header}_extension features.
21369
21370 * src/lex.c (percent_table): Un-CPP out header_extension and
21371 source_extension.
21372 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
21373 (compute_exts_from_src): Remove conditions. It restores priorities
21374 between options.
21375
21376 2001-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
21382 2001-08-13 Marc Autret <autret_m@epita.fr>
21383
21384 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
21385 defining it (defined but null disables alloca).
21386
21387 2001-08-13 Marc Autret <autret_m@epita.fr>
21388
21389 * src/bison.simple (_yy_memcpy): CPP reformat.
21390
21391 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
21392
21393 * tests/atconfig.in (CPPFLAGS): Fix.
21394
21395 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
21396
21397 * doc/bison.texinfo: Include GNU General Public License from
21398 `gpl.texi'.
21399 * doc/gpl.texi: Add to package.
21400
21401 2001-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
21406 2001-08-10 Akim Demaille <akim@epita.fr>
21407
21408 * src/system.h: Provide default declarations for stpcpy, strndup,
21409 and strnlen.
21410
21411 2001-08-10 Robert Anisko <anisko_r@epita.fr>
21412
21413 * doc/bison.texinfo (Locations): Update @$ stuff.
21414
21415 2001-08-09 Robert Anisko <anisko_r@epita.fr>
21416
21417 * src/bison.simple (YYLLOC_DEFAULT): Update.
21418 (yyparse): Adjust.
21419
21420 2001-08-08 Marc Autret <autret_m@epita.fr>
21421
21422 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
21423 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
21424 Reported by Fabrice Bauzac.
21425
21426 2001-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.
21432 (node_output_size): New global variable. Simplify the formatting of
21433 the VCG graph output.
21434 (print_actions): Unused code is now used. It notifies the final state
21435 and no action states in the VCG graph. It also give the reduce actions.
21436 The `shift and goto' edges are red and the `go to state' edges are
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
21445 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
21446
21447 * tests/atconfig.in (CPPFLAGS): Fix.
21448
21449 2001-08-07 Akim Demaille <akim@epita.fr>
21450
21451 * src/print_graph.c (quote): New.
21452 (print_core): Use it.
21453
21454 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
21455
21456 * src/vcg.c (complain.h): Include it.
21457 Unepitaize `return' invocations.
21458 [NDEBUG] (main): Remove.
21459 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
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 ();
21466
21467 2001-08-06 Marc Autret <autret_m@epita.fr>
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
21486 2001-08-06 Marc Autret <autret_m@epita.fr>
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
21492 2001-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
21509 2001-08-06 Marc Autret <autret_m@epita.fr>
21510
21511 * configure.in: Bump to 1.28c.
21512 * doc/bison.texinfo: Texinfo thingies.
21513
21514 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
21515
21516 * tests/atconfig.in (CPPFLAGS): Add.
21517 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
21518
21519 2001-08-03 Akim Demaille <akim@epita.fr>
21520
21521 Version 1.28b.
21522
21523 2001-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
21529 2001-08-03 Akim Demaille <akim@epita.fr>
21530
21531 * configure.in: Try using -Wformat when compiling.
21532
21533 2001-08-03 Akim Demaille <akim@epita.fr>
21534
21535 * configure.in: Bump to 1.28b.
21536
21537 2001-08-03 Akim Demaille <akim@epita.fr>
21538
21539 * src/complain.c: Adjust strerror_r portability issues.
21540
21541 2001-08-03 Akim Demaille <akim@epita.fr>
21542
21543 Version 1.28a.
21544
21545 2001-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
21553 2001-08-03 Akim Demaille <akim@epita.fr>
21554
21555 * src/reader.c (readgram): Display hidden chars in error messages.
21556
21557 2001-08-03 Akim Demaille <akim@epita.fr>
21558
21559 Update to gettext 0.10.39.
21560
21561 2001-08-03 Akim Demaille <akim@epita.fr>
21562
21563 * lib/strspn.c: New.
21564
21565 2001-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
21583 2001-08-01 Robert Anisko <anisko_r@epita.fr>
21584
21585 * doc/bison.texi: Document @$.
21586 (Locations): New section.
21587
21588 2001-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
21594 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
21595
21596 * src/bison.simple (yyparse): Suppress warning `comparaison
21597 between signed and unsigned'.
21598
21599 2001-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
21607 2001-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
21613 2001-03-16 Akim Demaille <akim@epita.fr>
21614
21615 * doc/bison.texinfo: ANSIfy the examples.
21616
21617 2001-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
21625 2001-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
21631 2001-03-16 Akim Demaille <akim@epita.fr>
21632
21633 * src/getargs.c (longopts): Clean up.
21634
21635 2001-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
21641 2001-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
21647 2001-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
21657 2001-02-02 Akim Demaille <akim@epita.fr>
21658
21659 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
21660 * lib/xalloc.h, lib/xmalloc.c: Update.
21661
21662 2001-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
21672 2001-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
21681 2001-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
21686 2001-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
21706 2000-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
21718 2000-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
21723 2000-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
21729 2000-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
21735 2000-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
21741 2000-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
21749 2000-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
21758 2000-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
21768 2000-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
21777 2000-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
21784 2000-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
21799 2000-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
21804 2000-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
21809 2000-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
21815 2000-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
21823 2000-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
21829 2000-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
21836 2000-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
21848 2000-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
21855 2000-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
21860 2000-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
21867 2000-11-17 Akim Demaille <akim@epita.fr>
21868
21869 * acconfig.h: Remove, no longer used.
21870
21871 2000-11-07 Akim Demaille <akim@epita.fr>
21872
21873 * src: s/Copyright (C)/Copyright/g.
21874
21875 2000-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
21881 2000-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
21886 2000-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
21899 2000-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
21905 2000-11-03 Akim Demaille <akim@epita.fr>
21906
21907 For some reason, this was not applied.
21908
21909 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
21910 `unlink': it's no longer used.
21911
21912 2000-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
21917 2000-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
21929 2000-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
21935 2000-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.
21948 * po/POTFILES.in: Adjust.
21949
21950 2000-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
21960 2000-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
21970 2000-10-20 Akim Demaille <akim@epita.fr>
21971
21972 * lib/quote.h (PARAMS): New macro. Use it.
21973
21974 2000-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
21980 2000-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
21991 2000-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
21997 2000-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
22005 2000-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
22010 2000-10-16 Akim Demaille <akim@epita.fr>
22011
22012 * src/reader.c (copy_dollar): New function.
22013 (copy_guard, copy_action): Use it.
22014
22015 2000-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
22023 2000-10-04 Akim Demaille <akim@epita.fr>
22024
22025 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
22026
22027 2000-10-04 Akim Demaille <akim@epita.fr>
22028
22029 * doc/bison.texinfo: Various typos spotted by Neil Booth.
22030
22031 2000-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
22042 2000-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
22048 2000-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
22054 2000-10-02 Akim Demaille <akim@epita.fr>
22055
22056 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
22057 options.
22058
22059 2000-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
22064 2000-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
22087 2000-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
22100 2000-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
22132 2000-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
22144 2000-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
22152 2000-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
22165 2000-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
22171 2000-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
22189 2000-10-02 Akim Demaille <akim@epita.fr>
22190
22191 Various anti-`extern in *.c' changes.
22192
22193 * src/system.h: Include `assert.h'.
22194
22195 2000-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
22207 2000-10-02 Akim Demaille <akim@epita.fr>
22208
22209 * src/LR0.h: New file.
22210 Propagate its use.
22211
22212 2000-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
22221 2000-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
22230 2000-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
22236 2000-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
22244 2000-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
22253 2000-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
22261 2000-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
22269 2000-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
22275 2000-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
22281 2000-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
22298 2000-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
22307 2000-09-21 Akim Demaille <akim@epita.fr>
22308
22309 * src/atgeneral.m4: Update from Autoconf.
22310
22311 2000-09-21 Akim Demaille <akim@epita.fr>
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
22324 2000-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
22334 2000-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
22341 2000-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
22349 2000-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
22366 2000-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
22371 2000-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
22377 2000-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
22383 2000-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
22397 2000-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
22412 2000-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
22425 2000-03-31 Akim Demaille <akim@epita.fr>
22426
22427 * src/files.c (tryopen, tryclose): Move to the top.
22428 Be static.
22429
22430 2000-03-31 Akim Demaille <akim@epita.fr>
22431
22432 * src/main.c (main): Don't call `done', exit does it.
22433
22434 2000-03-31 Akim Demaille <akim@epita.fr>
22435
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
22444 2000-03-31 Akim Demaille <akim@epita.fr>
22445
22446 Clean up the error reporting functions.
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
22465 2000-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
22481 2000-03-28 Akim Demaille <akim@epita.fr>
22482
22483 * src/getargs.c (usage): Refresh the help message.
22484
22485 2000-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
22491 2000-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
22496 2000-03-17 Akim Demaille <akim@epita.fr>
22497
22498 On syntax errors, report the token on which we choked.
22499
22500 * src/bison.s1 (yyparse): In the label yyerrlab, when
22501 YYERROR_VERBOSE, add yychar in msg.
22502
22503 2000-03-17 Akim Demaille <akim@epita.fr>
22504
22505 * src/reader.c (copy_at): New function.
22506 (copy_guard): Use it.
22507 (copy_action): Use it.
22508
22509 2000-03-17 Akim Demaille <akim@epita.fr>
22510
22511 Be kind to translators, save some useless translations.
22512
22513 * src/main.c (banner): New function.
22514 (fatal_banner): Use it.
22515 (warn_banner): Use it.
22516
22517 2000-03-17 Akim Demaille <akim@epita.fr>
22518
22519 * src/reader.c (copy_definition): Use copy_string and
22520 copy_comment. Removed now unused `match', `ended',
22521 `cplus_comment'.
22522 (copy_comment, copy_string): Moved, to be visible from
22523 copy_definition.
22524
22525 2000-03-17 Akim Demaille <akim@epita.fr>
22526
22527 * src/reader.c (copy_string): Declare `static inline'. No
22528 problems with inline, since it is checked by configure.
22529 (copy_comment): Likewise.
22530
22531 2000-03-17 Akim Demaille <akim@epita.fr>
22532
22533 * src/reader.c (packsymbols): Formatting changes.
22534
22535 2000-03-17 Akim Demaille <akim@epita.fr>
22536
22537 * src/reader.c (copy_comment): New function, factored out from:
22538 (copy_action): Use it. Removed now unused `match', `ended',
22539 `cplus_comment'.
22540 (copy_guard): Likewise.
22541
22542 2000-03-17 Akim Demaille <akim@epita.fr>
22543
22544 * src/reader.c (copy_string): New function, factored out from:
22545 (copy_action): Use it.
22546 (copy_guard): Likewise.
22547
22548 2000-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
22568 2000-03-17 Akim Demaille <akim@epita.fr>
22569
22570 * src/bison.s1: Formatting and cosmetics changes.
22571 * src/reader.c: Likewise.
22572 Update the Copyright notice.
22573
22574 2000-03-17 Akim Demaille <akim@epita.fr>
22575
22576 * src/bison.s1 (#line): All set to `#line' only, since the
22577 Makefile now handles them.
22578
22579 2000-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
22586 2000-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
22593 2000-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
22598 2000-03-16 Akim Demaille <akim@epita.fr>
22599
22600 * src/bison.s1: Properly indent CPP directives.
22601
22602 2000-03-16 Akim Demaille <akim@epita.fr>
22603
22604 * src/bison.s1: Properly indent the `alloca' CPP section.
22605
22606 2000-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
22637 2000-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
22644 1999-12-13 Jesse Thilo <jthilo@gnu.org>
22645
22646 * src/files.c:
22647 OS/2 honors TMPDIR environment variable.
22648
22649 1999-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
22656 1999-12-13 Jesse Thilo <jthilo@gnu.org>
22657
22658 * configure.in, NEWS:
22659 Bison 1.29 released.
22660
22661 1999-10-27 Jesse Thilo <jthilo@gnu.org>
22662
22663 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
22664 Added reference card.
22665
22666 1999-07-26 Jesse Thilo <jthilo@gnu.org>
22667
22668 * po/ru.po: Added Russian translation.
22669
22670 1999-07-26 Jesse Thilo <jthilo@gnu.org>
22671
22672 * configure.in: Added Russian translation.
22673
22674 1999-07-06 Jesse Thilo <jthilo@gnu.org>
22675
22676 * configure.in, NEWS, README:
22677 Released version 1.28.
22678
22679 1999-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
22688 1999-06-14 Jesse Thilo <jthilo@gnu.org>
22689
22690 * po/POTFILES.in: Got rid of version.c.
22691
22692 1999-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
22698 1999-06-08 Jesse Thilo <jthilo@gnu.org>
22699
22700 * doc/bison.1:
22701 Dropped mention of `+' for long-named options.
22702
22703 1999-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
22710 1999-05-30 Jesse Thilo <jthilo@gnu.org>
22711
22712 * README: Added a FAQ list.
22713
22714 * configure.in, acconfig.h:
22715 I18n fixes.
22716
22717 1999-05-30 Jesse Thilo <jthilo@gnu.org>
22718
22719 * doc/FAQ, doc/Makefile.am:
22720 Added a FAQ list.
22721
22722 1999-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
22727 1999-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
22736 1999-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
22741 1999-04-18 Jesse Thilo <jthilo@gnu.org>
22742
22743 * doc/.cvsignore, doc/Makefile.am:
22744 Reorganized: sources in `src', documentation in `doc'.
22745
22746 1999-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
22754 1999-04-13 Jesse Thilo <jthilo@gnu.org>
22755
22756 * src/allocate.c:
22757 Don't declare calloc() and realloc() if not necessary.
22758
22759 1999-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
22764 1999-03-23 Jesse Thilo <jthilo@gnu.org>
22765
22766 * po/.cvsignore: Added i18n support.
22767
22768 1999-03-23 Jesse Thilo <jthilo@gnu.org>
22769
22770 * acconfig.h, configure.in, Makefile.am:
22771 Added i18n support.
22772
22773 1999-03-22 Jesse Thilo <jthilo@gnu.org>
22774
22775 * src/bison.s1: Fixed #line numbers.
22776
22777 1999-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
22782 1999-03-03 Jesse Thilo <jthilo@gnu.org>
22783
22784 * Makefile.am:
22785 Added support for non-ANSI compilers (ansi2knr).
22786
22787 1999-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
22794 1999-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
22799 1999-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
22804 1999-02-09 Jesse Thilo <jthilo@gnu.org>
22805
22806 * Makefile.am:
22807 Removed inappropriate use of $< macro.
22808
22809 1999-02-05 Jesse Thilo <jthilo@gnu.org>
22810
22811 * po/Makefile.in.in, po/POTFILES.in:
22812 Add `po' directory skeleton.
22813
22814 1999-01-27 Jesse Thilo <jthilo@gnu.org>
22815
22816 * README: Document help-bison list.
22817
22818 * configure.in: Add check for mkstemp().
22819
22820 1999-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
22829 1999-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
22835 1999-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
22840 1999-01-14 Jesse Thilo <jthilo@gnu.org>
22841
22842 * doc/bison.texinfo: Fix formatting glitch.
22843
22844 * doc/bison.texinfo: Update FSF address.
22845
22846 1999-01-14 Jesse Thilo <jthilo@gnu.org>
22847
22848 * acconfig.h: Update FSF address.
22849
22850 1999-01-08 Jesse Thilo <jthilo@gnu.org>
22851
22852 * src/system.h:
22853 Don't define PACKAGE here, since config.h defines it.
22854
22855 1998-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
22878 1998-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
22884 1998-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
22896 1998-12-29 Jesse Thilo <jthilo@gnu.org>
22897
22898 * src/version.c:
22899 Use VERSION symbol from automake for version number.
22900
22901 1998-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
22906 1998-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
22912 1998-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
22919 1998-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
22924 1998-11-26 Jesse Thilo <jthilo@gnu.org>
22925
22926 * doc/bison.1:
22927 Document the BISON_HAIRY and BISON_SIMPLE variables.
22928
22929 1998-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
22943 1998-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
22961 1998-11-25 Jesse Thilo <jthilo@gnu.org>
22962
22963 * doc/bison.texinfo: Clean up some formatting.
22964
22965 1998-05-05 Richard Stallman <rms@gnu.org>
22966
22967 * doc/bison.texinfo:
22968 Explain better why to make a pure parser.
22969
22970 1998-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
22977 1997-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
22984 1997-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
22991 1997-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
22999 1997-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
23008 1997-06-18 Richard Stallman <rms@gnu.org>
23009
23010 * Makefile.in: new.h renamed to alloc.h.
23011
23012 1997-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
23020 1997-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
23030 1997-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
23040 1997-04-23 Richard Stallman <rms@gnu.org>
23041
23042 * src/bison.s1:
23043 (alloca) [__hpux]: Always define as __builtin_alloca.
23044
23045 1997-04-23 Richard Stallman <rms@gnu.org>
23046
23047 * bison.simple:
23048 (alloca) [__hpux]: Always define as __builtin_alloca.
23049
23050 1997-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
23060 1997-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
23070 1997-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
23075 1997-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
23084 1997-01-02 Richard Stallman <rms@gnu.org>
23085
23086 * Makefile.in (dist):
23087 Explicitly check for symlinks, and copy them.
23088
23089 1996-12-19 Richard Stallman <rms@gnu.org>
23090
23091 * src/files.c:
23092 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
23093
23094 1996-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
23100 1996-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
23106 1996-12-17 Richard Stallman <rms@gnu.org>
23107
23108 * src/reduce.c (nbits): Add some casts.
23109
23110 1996-08-12 Richard Stallman <rms@gnu.org>
23111
23112 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
23113
23114 1996-08-12 Richard Stallman <rms@gnu.org>
23115
23116 * bison.simple: Test _MSDOS as well as _MSDOS_.
23117
23118 1996-07-31 Richard Stallman <rms@gnu.org>
23119
23120 * src/bison.s1:
23121 [__sun && __i386]: Include alloca.h.
23122
23123 1996-07-31 Richard Stallman <rms@gnu.org>
23124
23125 * bison.simple:
23126 [__sun && __i386]: Include alloca.h.
23127
23128 1996-07-30 Richard Stallman <rms@gnu.org>
23129
23130 * src/bison.s1: Comment change.
23131
23132 * src/bison.s1: Test _MSDOS_, not MSDOS.
23133
23134 1996-07-30 Richard Stallman <rms@gnu.org>
23135
23136 * bison.simple: Comment change.
23137
23138 * bison.simple: Test _MSDOS_, not MSDOS.
23139
23140 1996-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
23157 1996-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
23172 1996-05-12 Richard Stallman <rms@gnu.org>
23173
23174 * src/bison.s1:
23175 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
23176
23177 1996-05-12 Richard Stallman <rms@gnu.org>
23178
23179 * bison.simple:
23180 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
23181
23182 1996-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
23188 1996-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
23196 1996-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
23202 1995-12-29 Richard Stallman <rms@gnu.org>
23203
23204 * src/bison.s1:
23205 Fix line numbers in #line commands.
23206
23207 1995-12-29 Richard Stallman <rms@gnu.org>
23208
23209 * bison.simple:
23210 Fix line numbers in #line commands.
23211
23212 1995-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
23219 1995-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
23226 1995-11-29 Richard Stallman <rms@gnu.org>
23227
23228 * doc/bison.texinfo:
23229 Describe literal string tokens, %raw, %no_lines, %token_table.
23230
23231 1995-11-29 Daniel Hagerty <hag@gnu.org>
23232
23233 * doc/bison.texinfo: Fixed update date
23234
23235 1995-10-16 Richard Stallman <rms@gnu.org>
23236
23237 * src/version.c: Version 1.25.
23238
23239 1995-10-16 Richard Stallman <rms@gnu.org>
23240
23241 * NEWS: *** empty log message ***
23242
23243 1995-10-16 Richard Stallman <rms@gnu.org>
23244
23245 * doc/bison.1, doc/bison.rnh:
23246 Add new options.
23247
23248 1995-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
23335 1995-06-01 Jim Meyering <meyering@gnu.org>
23336
23337 * doc/bison.texinfo: *** empty log message ***
23338
23339 1995-05-06 Richard Stallman <rms@gnu.org>
23340
23341 * src/bison.s1: Comment change.
23342
23343 1995-05-06 Richard Stallman <rms@gnu.org>
23344
23345 * bison.simple: Comment change.
23346
23347 1995-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
23355 1995-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
23361 1995-05-03 Richard Stallman <rms@gnu.org>
23362
23363 * bison.simple: Change distribution terms.
23364
23365 1995-02-23 Richard Stallman <rms@gnu.org>
23366
23367 * src/files.c: Test __VMS_POSIX as well as VMS.
23368
23369 1995-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
23376 1995-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
23383 1994-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
23396 1994-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
23403 1994-09-28 David J. MacKenzie <djm@gnu.org>
23404
23405 * Makefile.in: Set datadir to $(prefix)/share.
23406
23407 1994-09-15 Richard Stallman <rms@gnu.org>
23408
23409 * src/bison.s1:
23410 Update copyright notice and GPL version.
23411
23412 1994-09-15 Richard Stallman <rms@gnu.org>
23413
23414 * bison.simple:
23415 Update copyright notice and GPL version.
23416
23417 1994-07-12 Richard Stallman <rms@gnu.org>
23418
23419 * src/reduce.c, src/reader.c:
23420 entered into RCS
23421
23422 1994-05-05 David J. MacKenzie <djm@gnu.org>
23423
23424 * Makefile.in: entered into RCS
23425
23426 1994-03-26 Richard Stallman <rms@gnu.org>
23427
23428 * src/bison.s1: entered into RCS
23429
23430 1994-03-26 Richard Stallman <rms@gnu.org>
23431
23432 * bison.simple: entered into RCS
23433
23434 1994-03-25 Richard Stallman <rms@gnu.org>
23435
23436 * src/main.c: entered into RCS
23437
23438 1994-03-24 Richard Stallman <rms@gnu.org>
23439
23440 * src/conflicts.c: entered into RCS
23441
23442 1994-01-02 Richard Stallman <rms@gnu.org>
23443
23444 * Makefile.in: *** empty log message ***
23445
23446 1993-11-21 Richard Stallman <rms@gnu.org>
23447
23448 * src/bison.s1: *** empty log message ***
23449
23450 1993-11-21 Richard Stallman <rms@gnu.org>
23451
23452 * doc/bison.texinfo: entered into RCS
23453
23454 * doc/bison.texinfo: *** empty log message ***
23455
23456 1993-11-21 Richard Stallman <rms@gnu.org>
23457
23458 * bison.simple: *** empty log message ***
23459
23460 1993-10-25 David J. MacKenzie <djm@gnu.org>
23461
23462 * doc/bison.texinfo: *** empty log message ***
23463
23464 1993-10-19 Richard Stallman <rms@gnu.org>
23465
23466 * src/bison.s1: *** empty log message ***
23467
23468 1993-10-19 Richard Stallman <rms@gnu.org>
23469
23470 * bison.simple: *** empty log message ***
23471
23472 1993-10-14 Richard Stallman <rms@gnu.org>
23473
23474 * src/bison.s1: *** empty log message ***
23475
23476 1993-10-14 Richard Stallman <rms@gnu.org>
23477
23478 * bison.simple: *** empty log message ***
23479
23480 1993-09-14 David J. MacKenzie <djm@gnu.org>
23481
23482 * doc/bison.texinfo: *** empty log message ***
23483
23484 1993-09-13 Noah Friedman <friedman@gnu.org>
23485
23486 * Makefile.in: *** empty log message ***
23487
23488 1993-09-10 Richard Stallman <rms@gnu.org>
23489
23490 * src/conflicts.c: *** empty log message ***
23491
23492 * src/system.h: entered into RCS
23493
23494 1993-09-10 Richard Stallman <rms@gnu.org>
23495
23496 * doc/bison.1: entered into RCS
23497
23498 1993-09-06 Noah Friedman <friedman@gnu.org>
23499
23500 * src/version.c: entered into RCS
23501
23502 1993-09-06 Noah Friedman <friedman@gnu.org>
23503
23504 * Makefile.in: *** empty log message ***
23505
23506 1993-07-30 David J. MacKenzie <djm@gnu.org>
23507
23508 * Makefile.in: *** empty log message ***
23509
23510 1993-07-24 Richard Stallman <rms@gnu.org>
23511
23512 * src/bison.s1: *** empty log message ***
23513
23514 1993-07-24 Richard Stallman <rms@gnu.org>
23515
23516 * bison.simple: *** empty log message ***
23517
23518 1993-07-08 David J. MacKenzie <djm@gnu.org>
23519
23520 * Makefile.in: *** empty log message ***
23521
23522 1993-07-04 Richard Stallman <rms@gnu.org>
23523
23524 * src/bison.s1: *** empty log message ***
23525
23526 1993-07-04 Richard Stallman <rms@gnu.org>
23527
23528 * bison.simple: *** empty log message ***
23529
23530 1993-06-26 David J. MacKenzie <djm@gnu.org>
23531
23532 * src/getargs.c: entered into RCS
23533
23534 1993-06-26 David J. MacKenzie <djm@gnu.org>
23535
23536 * doc/bison.texinfo: *** empty log message ***
23537
23538 * doc/bison.1: New file.
23539
23540 1993-06-25 Richard Stallman <rms@gnu.org>
23541
23542 * src/getargs.c: New file.
23543
23544 1993-06-16 Richard Stallman <rms@gnu.org>
23545
23546 * src/bison.s1: *** empty log message ***
23547
23548 1993-06-16 Richard Stallman <rms@gnu.org>
23549
23550 * bison.simple: *** empty log message ***
23551
23552 1993-06-03 Richard Stallman <rms@gnu.org>
23553
23554 * src/bison.s1: New file.
23555
23556 1993-06-03 Richard Stallman <rms@gnu.org>
23557
23558 * doc/bison.texinfo: *** empty log message ***
23559
23560 1993-06-03 Richard Stallman <rms@gnu.org>
23561
23562 * bison.simple: New file.
23563
23564 1993-05-19 Richard Stallman <rms@gnu.org>
23565
23566 * doc/bison.texinfo: New file.
23567
23568 1993-05-07 Noah Friedman <friedman@gnu.org>
23569
23570 * Makefile.in: *** empty log message ***
23571
23572 1993-04-28 Noah Friedman <friedman@gnu.org>
23573
23574 * src/reader.c: *** empty log message ***
23575
23576 1993-04-23 Noah Friedman <friedman@gnu.org>
23577
23578 * src/alloc.h: entered into RCS
23579
23580 1993-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
23599 1993-04-18 Noah Friedman <friedman@gnu.org>
23600
23601 * src/reader.c: New file.
23602
23603 * src/version.c: *** empty log message ***
23604
23605 1993-04-18 Noah Friedman <friedman@gnu.org>
23606
23607 * Makefile.in: *** empty log message ***
23608
23609 1993-04-17 Noah Friedman <friedman@gnu.org>
23610
23611 * Makefile.in: *** empty log message ***
23612
23613 1993-04-15 Richard Stallman <rms@gnu.org>
23614
23615 * src/main.c, src/files.c:
23616 New file.
23617
23618 1993-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
23626 1993-04-14 Richard Stallman <rms@gnu.org>
23627
23628 * Makefile.in: New file.
23629
23630 1993-04-13 Richard Stallman <rms@gnu.org>
23631
23632 * src/version.c: New file.
23633
23634 1993-03-25 Richard Stallman <rms@gnu.org>
23635
23636 * src/output.c: entered into RCS
23637
23638 1992-09-25 Richard Stallman <rms@gnu.org>
23639
23640 * configure.bat: entered into RCS
23641
23642 1992-06-22 Richard Stallman <rms@gnu.org>
23643
23644 * src/vmsgetargs.c: entered into RCS
23645
23646 1992-06-22 Richard Stallman <rms@gnu.org>
23647
23648 * doc/bison.rnh: entered into RCS
23649
23650 1992-04-20 David J. MacKenzie <djm@gnu.org>
23651
23652 * README: entered into RCS
23653
23654 1992-01-22 Richard Stallman <rms@gnu.org>
23655
23656 * src/machine.h: entered into RCS
23657
23658 1991-12-21 Richard Stallman <rms@gnu.org>
23659
23660 * src/lalr.c, src/closure.c:
23661 entered into RCS
23662
23663 1991-12-20 Richard Stallman <rms@gnu.org>
23664
23665 * src/state.h: entered into RCS
23666
23667 1991-12-18 Richard Stallman <rms@gnu.org>
23668
23669 * src/print.c, src/nullable.c, src/derives.c:
23670 entered into RCS
23671
23672 1991-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
23677 1988-09-09 Richard Stallman <rms@gnu.org>
23678
23679 * src/bison.hairy: entered into RCS
23680
23681 1987-12-16 Richard Stallman <rms@gnu.org>
23682
23683 * REFERENCES: entered into RCS
23684
23685
23686 -----
23687
23688 Copyright (C) 1987-1988, 1991-2011 Free Software Foundation,
23689 Inc.
23690
23691 Copying and distribution of this file, with or without
23692 modification, are permitted provided the copyright notice and this
23693 notice are preserved.