]> git.saurik.com Git - bison.git/blame - ChangeLog
doc: finish splitting apart the manual's Decl Summary section.
[bison.git] / ChangeLog
CommitLineData
2f4518a1
JD
12011-02-06 Joel E. Denny <joeldenny@joeldenny.org>
2
3 doc: finish splitting apart the manual's Decl Summary section.
4 Suggested by Akim Demaille at
5 <http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00013.html>.
6 * doc/bison.texinfo (Decl Summary): Extract most of the %define
7 entry into...
8 (%define Summary): ... this new subsection, and update all
9 cross-references. For readability of the patches, rewriting of
10 the text so it makes sense as a separate subsection will come in a
11 later patch. Moreover, the majority of the text describing the
12 various new LR features should likely move to another new section
13 somewhere.
14
8e6f2266
JD
152011-02-06 Joel E. Denny <joeldenny@joeldenny.org>
16
17 doc: begin to split apart the manual's Decl Summary section.
18 Discussed in thread starting at
19 <http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00013.html>.
20 * doc/bison.texinfo (Decl Summary): Extract most of the %code
21 entry into...
22 (%code Summary): ... this new subsection, and update all
23 cross-references. For readability of the patches, rewriting of
24 the text so it makes sense as a separate subsection will come in a
25 later patch.
26
9913d6e4
JD
272011-02-06 Joel E. Denny <joeldenny@joeldenny.org>
28
29 doc: clean up naming of various Bison files.
30 The Bison manual's names for various files associated with a Bison
31 parser has devolved into inconsistency. This patch makes the
32 naming consistent for the most important files. First, it chooses
33 "grammar file" over "input file". The former appears to be more
34 traditional in the Bison manual, and Bison has other input
35 files (skeletons). Second, it chooses "parser implementation
36 file" over names like "parser file", "parser source file", "parser
37 source code file", and "parser output file". The new name makes
38 it clearer where Bison generates the main parser implementation,
39 and it is easily distinguishable from "parser header file".
40 * doc/bison.texinfo: Implement throughout.
41
840341d6
JD
422011-02-06 Joel E. Denny <joeldenny@joeldenny.org>
43
44 doc: give credit to more of Bison's developers.
45 * doc/bison.texinfo (Introduction): Don't imply that only Robert
46 Corbett, Richard Stallman, and Wilfred Hansen have contributed to
47 Bison. However, I don't have time to write a full history, so
48 just point readers to THANKS and ChangeLog.
49
d89e48b3
JD
502011-02-06 Joel E. Denny <joeldenny@joeldenny.org>
51
52 doc: document experimental features better.
53 * doc/bison.texinfo (Introduction): Say that IELR(1) and canonical
54 LR(1) are experimental. Mention Java. Normally experimental
55 features probably shouldn't be mentioned in the introduction.
56 However, if Bison's limitations to LALR(1), C, and C++ are so
57 important that they should be mentioned here, then it's important
58 to point out that Bison is beginning to escape those limitations.
59 Moreover, these particular experimental features have very little
60 chance of being removed.
61 * src/getargs.c (usage): Say that IELR(1) and canonical LR(1) are
62 experimental.
63
eb8c66bb
JD
642011-01-29 Joel E. Denny <joeldenny@joeldenny.org>
65
66 Do not allow identifiers that start with a dash.
67 This cleans up our previous fixes for a bug whereby Bison
68 discarded `.field' in `$-1.field'. The previous fixes were less
69 restrictive about where a dash could appear in an identifier, but
70 the restrictions were hard to explain. That bug was reported and
71 this final fix was originally suggested by Paul Hilfinger. This
72 also fixes a remaining bug reported by Paul Eggert whereby Bison
73 parses `%token ID -123' as `%token ID - 123' and handles `-' as an
74 identifier. Now, `-' cannot be an identifier. Discussed in
75 threads beginning at
76 <http://lists.gnu.org/archive/html/bug-bison/2011-01/msg00000.html>,
77 <http://lists.gnu.org/archive/html/bug-bison/2011-01/msg00004.html>.
78 * NEWS (2.5): Update entry describing the dash extension to
79 grammar symbol names. Also, move that entry before the named
80 references entry because the latter mentions the former.
81 * doc/bison.texinfo (Symbol): Update documentation for symbol
82 names. As suggested by Paul Eggert, mention the effect of periods
83 and dashes on named references.
84 (Decl Summary): Update documentation for unquoted %define values,
85 which, as a side effect, can no longer start with dashes either.
86 * src/scan-code.l (id): Implement.
87 * src/scan-gram.l (id): Implement.
88 * tests/actions.at (Exotic Dollars): Extend test group to exercise
89 bug reported by Paul Hilfinger.
90 * tests/input.at (Symbols): Update test group, and extend to
91 exercise bug reported by Paul Eggert.
92 * tests/named-refs.at (Stray symbols in brackets): Update test
93 group.
94 ($ or @ followed by . or -): Likewise.
95 * tests/regression.at (Invalid inputs): Likewise.
96
448dc38b
JD
972011-01-24 Joel E. Denny <joeldenny@joeldenny.org>
98
99 * data/yacc.c: Fix last apostrophe warning from xgettext.
100
7e5ef706
PE
1012011-01-09 Paul Eggert <eggert@cs.ucla.edu>
102
103 Fix minor problems encountered by a fresh bootstrap.
104 * data/glr.c, data/yacc.c: Do not use apostrophes in '#' comments,
105 as they confuse xgettext, which tries to parse them as C character
106 constants in a preprocessor directive.
107 * data/yacc.c (yy_lac): Don't use printf %d format on *yyesp, as
108 that expression might not promote to int on some platforms.
109 * src/parse-gram.c, src/parse-gram.h: Regenerate.
110
8cbbf178
JD
1112011-01-09 Joel E. Denny <joeldenny@joeldenny.org>
112
113 Improve error messages for `$' or `@' followed by `.' or `-'.
114 Previously, for this special case of an invalid reference, the
115 usual "symbol not found in production:" was printed. However,
116 because the symbol name was parsed as the empty string, that
117 message was followed immediately by a newline instead of a symbol
118 name. In reality, this is a syntax error, so the reference is
119 invalid regardless of the symbols actually appearing in the
120 production. Discussed at
121 <http://lists.gnu.org/archive/html/bison-patches/2011-01/msg00012.html>.
122 * src/scan-code.l (parse_ref): Report the above case as a syntax
123 error. Other than that, continue to handle this case like any
124 other invalid reference that Bison manages to parse because
125 "possibly meant" messages can still be helpful to the user.
126 * tests/named-refs.at ($ or @ followed by . or -): New test group.
127
35430378
JD
1282011-01-08 Joel E. Denny <joeldenny@joeldenny.org>
129
130 doc: don't use @acronym.
131 Lately, many GNU packages are dropping it. See
132 <http://lists.gnu.org/archive/html/bison-patches/2011-01/msg00003.html>.
133 * doc/bison.texinfo: Remove all uses.
134
d236ad94
AR
1352011-01-05 Alex Rozenman <rozenman@gmail.com>
136
137 Do not allow identifiers that start with a negative number.
138 Reported by Paul Hilfinger as a side effect of named references
139 support at
140 <http://lists.gnu.org/archive/html/bug-bison/2011-01/msg00000.html>.
141 Suggested by Paul Eggert.
142 * src/scan-code.l ({letter}, {id}): Adjust lexical definitions.
143 * src/scan-gram.l ({letter}, {id}): Likewise.
144
9a4292e5
JD
1452011-01-03 Joel E. Denny <joeldenny@joeldenny.org>
146
147 * ChangeLog (2011-01-02): improve description.
148
17300e83
JD
1492011-01-03 Joel E. Denny <joeldenny@joeldenny.org>
150
151 maint: don't update copyright years in bootstrap.
152 * .x-update-copyright: Add entry for bootstrap.
153 * bootstrap: Remove 2011 from copyright years. The bootstrap
154 version we're currently using comes from an older version of
155 gnulib.
156 * bootstrap.conf (bootstrap_sync): Add comments explaining this
157 issue.
158
ea0a7676
JD
1592011-01-02 Joel E. Denny <joeldenny@joeldenny.org>
160
161 maint: run "make update-copyright".
162
f52e1e5e
JD
1632011-01-02 Joel E. Denny <joeldenny@joeldenny.org>
164
9a4292e5 165 maint: prepare to use year ranges in copyright notices.
f52e1e5e 166 * README (Copyright statements): New section explaining the range
9a4292e5
JD
167 notation. The GNU maintainers document requires this explanation:
168 <http://www.gnu.org/prep/maintain/maintain.html#Copyright-Notices>.
169 I copied our explanation from coreutils.
f52e1e5e
JD
170 * build-aux/update-b4-copyright: Revert 2010-06-17 changes that
171 disabled Bison's automated use of ranges.
172 * cfg.mk (update-copyright-env): Likewise.
173
210c1eef
JD
1742011-01-02 Joel E. Denny <joeldenny@joeldenny.org>
175
176 Correct my email address.
177 * ChangeLog: In all recent entries.
178 * THANKS (Joel E. Denny): Here.
179
1802010-12-19 Joel E. Denny <joeldenny@joeldenny.org>
6ee881f6
JD
181
182 doc: cleanup.
183 * NEWS (2.5): Try to sort entries according to how interesting
184 users might find them.
185
210c1eef 1862010-12-19 Joel E. Denny <joeldenny@joeldenny.org>
3b1977ea
JD
187
188 doc: cleanup.
189 * NEWS (2.5): Make some minor improvements to wording, and format
190 entries more consistently.
191 * doc/bison.texinfo (Language and Grammar): Point out that IELR
192 and canonical LR are experimental features.
193 (Decl Summary): In list of %define variables, make wording more
194 consistent. Improve discussion of using LALR for GLR.
195
210c1eef 1962010-12-19 Joel E. Denny <joeldenny@joeldenny.org>
4c38b19e
JD
197
198 parse.lac: document.
199 * NEWS (2.5): Add entry for LAC, and mention LAC in entry for
200 other corrections to verbose syntax error messages.
201 * doc/bison.texinfo (Decl Summary): Rewrite entries for
202 lr.default-reductions and lr.type to be clearer, to mention
203 %nonassoc's effect on canonical LR, and to mention LAC. Add entry
204 for parse.lac.
205 (Glossary): Add entry for LAC.
206
210c1eef 2072010-12-11 Joel E. Denny <joeldenny@joeldenny.org>
723fe7d1
JD
208
209 parse.lac: implement exploratory stack reallocations.
210 * data/yacc.c: Rename %define variable parse.lac.es-capacity to
211 parse.lac.es-capacity-initial. Accept parse.lac.memory-trace
212 with values of "failures" (default) or "full".
213 (b4_declare_parser_state_variables): Add yyesa, yyes, and
214 yyes_capacity variables.
215 (YYSTACK_USE_ALLOCA): Ignore it if LAC requested.
216 (YYSTACK_ALLOC, YYSTACK_FREE, YYSTACK_ALLOC_MAXIMUM): Define if
217 LAC requested.
218 (YYCOPY_NEEDED): New cpp macro.
219 (YYCOPY): Define if LAC requested.
220 (yy_lac_stack_realloc): New function implementing stack
221 reallocations. Use YYMAXDEPTH for maximum stack size given that
222 the stack should never need to grow larger than the main state
223 stack needs to grow without LAC.
224 (YY_LAC_ESTABLISH): Update yy_lac invocation.
225 (yy_lac): Add arguments for exploratory stack memory data
226 recorded in the main parser. Invoke yy_lac_stack_realloc when
227 reallocation is necessary.
228 (yysyntax_error): Add the same new arguments and pass them to
229 yy_lac.
230 (yypstate_delete): Free yyes if necessary.
231 (yyesa, yyes, yyes_capacity): #define these to yypstate members
232 in the case of push parsing.
233 (yyparse, yypush_parse): Initialize yyes and yyes_capacity.
234 Update yysyntax_error invocations. At yyreturn, free yyes if
235 necessary.
236 * src/parse-gram.y: %define parse.lac full.
237 * tests/input.at (LAC: errors for %define): Extend for
238 parse.lac-memory-trace.
239 * tests/regression.at (LAC: Exploratory stack): Extend to check
240 that stack reallocs happen when expected.
241 (LAC: Memory exhaustion): Update to use YYMAXDEPTH and
242 parse.lac.es-capacity-initial.
243
210c1eef 2442010-12-11 Joel E. Denny <joeldenny@joeldenny.org>
ea13bea8
JD
245
246 parse.lac: implement as %define variable.
247 LAC = lookahead correction. See discussion at
248 <http://lists.gnu.org/archive/html/bison-patches/2009-09/msg00034.html>.
249 However, one point there must be corrected: because of %nonassoc,
250 LAC is *not* always redundant for lr.type=canonical-lr.
251 * data/yacc.c: Accept values of "none" (default) or "full" for
252 parse.lac. Accept %define parse.lac.es-capacity to specify
253 capacity of LAC's temporary exploratory stack. It defaults to 20
254 and, for now, will not grow dynamically.
255 (b4_lac_flag, b4_lac_if): New m4 macros. Evaluate as true for
256 parse.lac!=none.
257 (YYBACKUP): Invoke YY_LAC_DISCARD.
258 (YY_LAC_ESTABLISH, YY_LAC_DISCARD): New cpp macros that invoke
259 yy_lac and track when it needs to be invoked
260 (yy_lac): New function that, given the current stack, determines
261 whether a token can eventually be shifted. Return status mimics
262 yyparse return status.
263 (yysyntax_error): Change yystate argument to yyssp so stack top
264 can be passed to yy_lac. If LAC is requested, build expected
265 token list by invoking yy_lac for every token instead of just
266 checking the current state for lookaheads. Return 2 if yy_lac
267 exhausts memory.
268 (yyparse, yypush_parse): Use local variable yy_lac_established and
269 cpp macros YY_LAC_ESTABLISH and YY_LAC_DISCARD to implement LAC.
270 Update yysyntax_error invocation. Add yyexhaustedlab code if LAC
271 is requested.
272 * tests/conflicts.at (%nonassoc and eof): Extend to check the
273 effect of each of -Dlr.type=canonical-lr and -Dparse.lac=full.
274 (%error-verbose and consistent errors): Likewise.
275 (LAC: %nonassoc requires splitting canonical LR states): New test
276 group demonstrating how LAC can fix canonical LR.
277 * tests/input.at (LAC: Errors for %define): New test group.
278 * tests/regression.at (LAC: Exploratory stack): New test group.
279 (LAC: Memory exhaustion): New test group.
280
210c1eef 2812010-11-21 Joel E. Denny <joeldenny@joeldenny.org>
dcd39f1d
JD
282
283 build: use gnulib's new bootstrap_sync option.
284 Now, whenever we update bison's copy of gnulib, bootstrap will
285 update itself the next time it's run.
286 * bootstrap: Copy from latest gnulib for bootstrap_sync support.
287 * bootstrap.conf (bootstrap_sync): Set to true.
288 * gnulib: Update to latest so bootstrap is in sync now.
289
210c1eef 2902010-11-07 Joel E. Denny <joeldenny@joeldenny.org>
3b837882
JD
291
292 yysyntax_error: adjust prior fixes for branch-2.5's lalr1.cc.
293 On master, there is no yychar in lalr1.cc, but there is on
294 branch-2.5, and the prior cherry-pick of "Fix handling of yychar
295 manipulation in user semantic actions" wasn't adjusted for that
296 difference.
297 * data/lalr1.cc (yy::parser::parse): Translate yychar before
298 every use of yytoken, and add comments explaining this approach.
299 * tests/conflicts.at (%error-verbose and consistent errors):
300 Extend to test yychar manipulation with lalr1.cc.
301
210c1eef 3022010-11-07 Joel E. Denny <joeldenny@joeldenny.org>
095a1d11
JD
303
304 yysyntax_error: fix for consistent error with lookahead.
305 * NEWS (2.5): Document.
306 * data/yacc.c (yysyntax_error): In a verbose syntax error
307 message while in a consistent state with a default action (which
308 must be an error action given that yysyntax_error is being
309 invoked), continue to drop the expected token list, but don't
310 drop the unexpected token unless there actually is no lookahead.
311 Moreover, handle that internally instead of returning 1 to tell
312 the caller to do it. With that meaning of 1 gone, renumber
313 return codes more usefully.
314 (yyparse, yypush_parse): Update yysyntax_error usage. Most
315 importantly, set yytoken to YYEMPTY when there's no lookahead.
316 * data/glr.c (yyreportSyntaxError): As in yacc.c, don't drop the
317 unexpected token unless there actually is no lookahead.
318 * data/lalr1.cc (yy::parser::parse): If there's no lookahead,
319 set yytoken to yyempty_ before invoking yysyntax_error_.
320 (yy::parser::yysyntax_error_): Again, don't drop the unexpected
321 token unless there actually is no lookahead.
322 * data/lalr1.java (YYParser::parse): If there's no lookahead,
323 set yytoken to yyempty_ before invoking yysyntax_error.
324 (YYParser::yysyntax_error): Again, don't drop the unexpected
325 token unless there actually is no lookahead.
326 * tests/conflicts.at (%error-verbose and consistent
327 errors): Extend test group to further reveal how the previous
328 use of the simple "syntax error" message was too general. Test
329 yacc.c, glr.c, lalr1.cc, and lalr1.java. No longer an expected
330 failure.
331 * tests/java.at (AT_JAVA_COMPILE, AT_JAVA_PARSER_CHECK): Move
332 to...
333 * tests/local.at: ... here.
334 (_AT_BISON_OPTION_PUSHDEFS): Push AT_SKEL_JAVA_IF definition.
335 (AT_BISON_OPTION_POPDEFS): Pop it.
336 (AT_FULL_COMPILE): Extend to handle Java.
337
210c1eef 3382010-11-07 Joel E. Denny <joeldenny@joeldenny.org>
678094a2
JD
339
340 yysyntax_error: more preparation for readability of next patch.
341 There are no behavioral changes here.
342 * data/glr.c (yyreportSyntaxError): Reorganize.
343 * data/lalr1.cc (yy::parser::yysyntax_error_): Reorganize.
344 * tests/conflicts.at (%error-verbose and consistent errors):
345 Reorganize.
346
210c1eef 3472010-11-07 Joel E. Denny <joeldenny@joeldenny.org>
f953cb20
JD
348
349 yysyntax_error: prepare for readability of next patches.
350 These are purely whitespace changes that result in ugly code
351 but that make the next couple of patches much easier to read.
352 * data/glr.c (yyreportSyntaxError): Reindent.
353 * data/lalr1.cc (yy::parser::yysyntax_error_): Reindent.
354 * data/lalr1.java (YYParser::yysyntax_error): Reindent.
355 * data/yacc.c (yysyntax_error): Reindent.
356
0e0f066b
JD
3572010-10-31 Joel E. Denny <joeldenny@joeldenny.org>
358
359 yysyntax_error: improve invocation readability.
360 * data/yacc.c (yyparse, yypush_parse): For yysyntax_error
361 invocation, get rid of the while loop, which is misleading
362 because there are really at most two iterations.
363
5f1485d8
JD
3642010-10-31 Joel E. Denny <joeldenny@joeldenny.org>
365
366 * ChangeLog: Correct some errors in previous entries.
367
2f3fd8f9
JD
3682010-10-17 Joel E. Denny <joeldenny@joeldenny.org>
369
370 maint: re-anchor all .gitignore entries.
371 * bootstrap: Copy from gnulib's latest for the fix to
372 automatically anchor entries it constructs.
373 * gnulib: Update to latest just so it has the same bootstrap.
374 * .gitignore, build-aux/.gitignore, doc/.gitignore:
375 * lib/.gitignore, m4/.gitignore, po/.gitignore:
376 * runtime-po/.gitignore: Re-anchor all entries.
377
86996fca
PE
3782010-10-08 Paul Eggert <eggert@cs.ucla.edu>
379
ea6046b9
PE
380 Fix portability problem on OpenBSD 4.7.
381
382 Jim Meyering reported this in
383 <http://lists.gnu.org/archive/html/bug-bison/2010-10/msg00007.html>.
384 * data/yacc.c: Use EXIT_SUCCESS as a witness for stdlib.h,
385 not _STDLIB_H. EXIT_SUCCESS has been defined by the standard
386 for quite some time.
387 * src/parse-gram.c, src/parse-gram.h: Regenerate.
388 * tests/regression.at: Tamper with the renamed witness.
389
86996fca
PE
390 Adjust to recent changes to gnulib bootstrap.
391
392 * .cvsignore, build-aux/.cvsignore, doc/.cvsignore, etc/.cvsignore:
393 * examples/calc++/.cvsignore, lib/.cvsignore, m4/.cvsignore:
394 * po/.cvsignore, runtime-po/.cvsignore, src/.cvsignore:
395 * tests/.cvsignore: Remove; I don't use CVS to maintain Bison
396 anymore and don't know of anybody else who does. If someone needs
397 these files, they can resurrect them.
398 * .gitignore, build-aux/.gitignore, doc/.gitignore, lib/.gitignore:
399 * m4/.gitignore, po/.gitignore, runtime-po/.gitignore:
400 Omit leading '/', since bootstrap omits it.
401 Adjust file names to match current contents better.
402 * bootstrap: Sync from gnulib: this contains the new gnulib_mk_hook
403 installed just for us.
404 * bootstrap.conf (excluded_files): Don't exclude codeset.m4,
405 glibc21.m4, inttypes_h.m4, size_max.m4, xsize.m4, as they are now
406 needed somehow. Don't have time to look into why.
407 (gnulib_modules): Change malloc to malloc-gnu. Do we really assume
408 the GNU malloc behavior, where malloc (0) != NULL unless we're
409 out of storage? If not, we can omit malloc-gnu; but for now I left
410 it in to be safe.
411 (vc_ignore): Remove.
412 * README-hacking: Renamed from HACKING, since gnulib bootstrap now
413 uses that convention.
414
7527c744
JD
4152010-08-05 Joel E. Denny <joeldenny@joeldenny.org>
416
417 Version 2.4.3.
418 * NEWS (2.4.3): Set date.
419
d034d520
JD
4202010-08-04 Joel E. Denny <joeldenny@joeldenny.org>
421
422 maint: add gettext version to release announcements.
423 Suggested by Paul Hilfinger at
424 <http://lists.gnu.org/archive/html/bison-patches/2010-07/msg00019.html>
425 <http://lists.gnu.org/archive/html/bison-patches/2010-08/msg00002.html>.
426 * cfg.mk (bootstrap-tools): Add gettext.
427
cf22447c
JD
4282010-08-04 Joel E. Denny <joeldenny@joeldenny.org>
429
430 doc: fix -W and %expect documentation some.
431 * NEWS (2.4.3): Mention that there are documentation fixes.
432 * doc/bison.texinfo (Expect Decl): Make it clear that %expect
433 turns conflicts into errors not warnings.
434 (Shift/Reduce): Likewise.
435 (Bison Options): Don't mention -Wsyntax. It doesn't exist.
436
4631c34f
JD
4372010-08-01 Joel E. Denny <joeldenny@joeldenny.org>
438
439 -Werror: fix for rules useless in parser after conflicts.
440 * NEWS (2.4.3): Document fix.
441 * src/complain.c (error_message): Extend to handle incomplete
442 error messages so warn and warn_at can be used in more cases.
443 * src/gram.c (grammar_rules_useless_report): Use warn_at so that
444 -Werror is always obeyed.
445 * src/reduce.c (reduce_print): Use warn so that the "warnings
446 being treated as errors" message is printed consistently before
447 the first warning message. This makes testing easier.
448 * tests/local.at (AT_BISON_WERROR_MSG): New macro.
449 (AT_BISON_CHECK_NO_XML): Extend to check -Werror and
450 --warnings=error when warnings appear in bison's stderr.
451
3e948170
JD
4522010-07-29 Joel E. Denny <joeldenny@joeldenny.org>
453
454 maint: enable gnits only at stable releases.
455 * configure.ac (AM_INIT_AUTOMAKE): Underscore or dash in a
456 version string should disable gnits. Explain in comments.
457
82df2d6d
JD
4582010-07-28 Joel E. Denny <joeldenny@joeldenny.org>
459
460 i18n: update.
461 * po/POTFILES.in: Add src/graphviz.c.
462
6e0ecb9a
JD
4632010-07-28 Joel E. Denny <joeldenny@joeldenny.org>
464
465 i18n: fix for gnulib.
466 * po/POTFILES.in: Add remaining gnulib files that have
467 translatable strings.
468
83e34842
JD
4692010-07-25 Joel E. Denny <joeldenny@joeldenny.org>
470
471 maint: use announce-gen's new --mail-headers.
472 * HACKING (Announce): Update instructions.
473 * cfg.mk (announcement_Cc_): Define.
474 * configure.ac (AM_GNU_GETTEXT_VERSION): Update to 0.18 as
475 required by latest gnulib.
476 * gnulib: Update to latest.
477
0162a44c
JD
4782010-07-24 Joel E. Denny <joeldenny@joeldenny.org>
479
480 tests: handle Valgrind that complains about >&-.
481 * tests/output.at (AT_CHECK_OUTPUT): Extend to accept pre-tests.
482 (Output files: -dv >&-): Skip test group if running
483 maintainer-check-valgrind.
484
241ac701
AD
4852010-06-17 Paul Eggert <eggert@cs.ucla.edu>
486
487 Update from GFDL GFDL 1.2 to 1.3.
488 * doc/bison.texinfo: Update GFDL version number.
489 * doc/fdl.texi: Update to version 1.3, taken from:
490 http://www.gnu.org/licenses/fdl.texi
491
6e30ede8
PE
4922010-06-17 Paul Eggert <eggert@cs.ucla.edu>
493
494 Do not use date ranges in copyright notices.
495 See http://www.gnu.org/prep/maintain/maintain.html#Copyright-Notices
496
497 * HACKING, Makefile.am, NEWS, PACKAGING, README, README-alpha:
498 * TODO, bootstrap, bootstrap.conf:
499 * build-aux/update-b4-copyright, cfg.mk, configure.ac:
500 * data/README, data/bison.m4, data/c++-skel.m4, data/c++.m4:
501 * data/c-skel.m4, data/c.m4, data/glr.c, data/glr.cc:
502 * data/java-skel.m4, data/java.m4, data/lalr1.cc:
503 * data/lalr1.java, data/location.cc:
504 * data/xslt/bison.xsl:
505 * data/xslt/xml2dot.xsl, data/xslt/xml2text.xsl:
506 * data/xslt/xml2xhtml.xsl, data/yacc.c, djgpp/Makefile.maint:
507 * djgpp/README.in, djgpp/config.bat, djgpp/config.sed:
508 * djgpp/config.site, djgpp/config_h.sed, djgpp/djunpack.bat:
509 * djgpp/subpipe.c, djgpp/subpipe.h:
510 * djgpp/testsuite.sed, doc/bison.texinfo:
511 * doc/refcard.tex, etc/README, etc/bench.pl.in:
512 * examples/calc++/Makefile.am, examples/extexi:
513 * lib/abitset.c, lib/abitset.h:
514 * lib/bbitset.h, lib/bitset.c, lib/bitset.h:
515 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
516 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
517 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
518 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
519 * lib/libiberty.h, lib/main.c, lib/timevar.c:
520 * lib/timevar.def, lib/timevar.h, lib/vbitset.c:
521 * lib/vbitset.h, lib/yyerror.c, m4/bison-i18n.m4:
522 * m4/c-working.m4, m4/cxx.m4, m4/subpipe.m4, m4/timevar.m4:
523 * src/AnnotationList.c, src/AnnotationList.h:
524 * src/InadequacyList.c, src/InadequacyList.h, src/LR0.c:
525 * src/LR0.h, src/Sbitset.c, src/Sbitset.h, src/assoc.c:
526 * src/assoc.h, src/closure.c, src/closure.h, src/complain.c:
527 * src/complain.h, src/conflicts.c, src/conflicts.h:
528 * src/derives.c, src/derives.h, src/files.c, src/files.h:
529 * src/flex-scanner.h, src/getargs.c, src/getargs.h:
530 * src/gram.c, src/gram.h, src/graphviz.c, src/ielr.c:
531 * src/ielr.h, src/lalr.c, src/lalr.h:
532 * src/location.c, src/location.h, src/main.c:
533 * src/muscle-tab.c, src/muscle-tab.h, src/named-ref.c:
534 * src/named-ref.h, src/nullable.c, src/nullable.h:
535 * src/output.c, src/output.h, src/parse-gram.y:
536 * src/print-xml.c, src/print-xml.h, src/print.c, src/print.h:
537 * src/print_graph.c, src/print_graph.h, src/reader.c:
538 * src/reader.h, src/reduce.c, src/reduce.h, src/relation.c:
539 * src/relation.h, src/scan-code.h, src/scan-code.l:
540 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
541 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
542 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
543 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
544 * tests/actions.at, tests/atlocal.in, tests/c++.at:
545 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
546 * tests/existing.at, tests/glr-regression.at:
547 * tests/headers.at, tests/input.at, tests/java.at:
548 * tests/local.at, tests/named-refs.at:
549 * tests/output.at, tests/push.at, tests/reduce.at:
550 * tests/regression.at, tests/sets.at, tests/skeletons.at:
551 * tests/synclines.at, tests/testsuite.at, tests/torture.at:
552 * data/Makefile.am, data/location.cc, doc/Makefile.am, src/Makefile.am:
553 * tests/Makefile.am, lib/Makefile.am, examples/Makefile.am:
554 * etc/Makefile.am:
555 Don't use date ranges in copyright notices.
556
3d4a0cad
AD
5572010-05-11 Akim Demaille <demaille@gostai.com>
558
559 lalrl1.cc: give a chance to user defined YYLLOC_DEFAULT.
560 * data/lalr1.cc (YYLLOC_DEFAULT): Move its definition from the
561 header file to the implementation file, after the user %code
562 sections.
563 * NEWS (2.5): Document this.
564
e7bab2df
AD
5652010-05-07 Akim Demaille <demaille@gostai.com>
566
567 c++: use YYRHSLOC.
568 * data/lalr1.cc (YYRHSLOC): New.
569 (YYLLOC_DEFAULT): Use it.
570 * data/glr.cc: If location_type was user defined, do not include
571 location.hh, and do not produce location.hh and position.hh.
572 * tests/calc.at (YYLLOC_DEFAULT): Use YYRHSLOC.
573 Check that glr.cc supports user defined location_type.
574 * NEWS: Document this.
575
baacae49
AD
5762010-05-10 Akim Demaille <demaille@gostai.com>
577
578 doc: fix lalr1.cc documentation.
579 * doc/bison.texinfo (C++ Scanner Interface): Fix yylex signature.
580 (C++ Bison Interface): Fix lalr1.cc skeleton name.
581 (C++ Parser Interface): Fix semantic_type and location_type names.
582 Document yy::parser::token.
583 Reported by Jerry Quinn.
584
95a2de56
AD
5852010-05-04 Akim Demaille <demaille@gostai.com>
586
587 lalr1.cc: don't generate location.hh when location_type is defined
588 * data/bison.m4 (b4_percent_define_use): New.
589 (b4_percent_define_get): Use it.
590 Accept a default value.
591 * data/c++.m4: Do not provide a default value for the %define
592 variable location_type, rather, use b4_percent_define_get with a
593 default argument where its value is needed.
594 * data/lalr1.cc: Do not load location.cc (which outputs both
595 location.hh and position.hh) if the user defined location_type.
596 Do not include location.hh either.
597 * data/glr.cc: Likewise.
598
0f404a0a
AD
5992010-05-04 Akim Demaille <demaille@gostai.com>
600
601 lalr1.cc: location_type: make sure we don't depend on loc.(begin|end).
602 * tests/calc.at (Span): Instead of begin/end, as in the built-in
603 location class, use first and last.
604 Define YYLLOC_DEFAULT to adjust to these changes.
605 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Adjust to the
606 location_type changes.
607
bdc360ae
AD
6082010-05-04 Akim Demaille <demaille@gostai.com>
609
610 tests: enhance AT_SYNCLINES_COMPILE.
611 * tests/synclines.at (AT_TEST_SYNCLINE): Move GCC 4.5 protection
612 into...
613 (AT_SYNCLINES_COMPILE): here.
614 Add more distcc patterns.
615
ca7a59e8
JD
6162010-05-01 Joel E. Denny <joeldenny@joeldenny.org>
617
618 tests: fix maintainer-xml-check.
619 * data/xslt/xml2dot.xsl (xsl:template match="bison-xml-report"):
620 Update output to include comments now produced by --graph.
621 (xsl:template match="automaton"): As for --graph, name the
622 digraph after the grammar file.
623 * src/print-xml.c (escape_bufs): Enlarge array.
624 (print_xml): Add bug-report and url attributes to
625 bison-xml-report element.
626
ad6f84e5
JD
6272010-05-01 Joel E. Denny <joeldenny@joeldenny.org>
628
629 In DOT output, convert from "/*" comments to "//" comments.
630 This handles the possibility that a "*/" might appear in
631 variable portions of those comments at some point in the future.
632 * src/graphviz.c (start_graph): Implement.
633
43fdc9fd
JD
6342010-04-30 Joel E. Denny <joeldenny@joeldenny.org>
635
636 Document that undefined %prec identifier warnings will remain.
637 * NEWS (2.4.3): Here.
638 (2.4.2): Here.
639
e02df72c
JD
6402010-04-30 Joel E. Denny <joeldenny@joeldenny.org>
641
642 Revert 2009-12-30 change for undefined %prec token complaints.
643 That is, keep them as warnings because that should be sufficient
644 to satisfy POSIX without creating backward compatibility issues.
645 Suggested by Richard Stallman at
646 <http://lists.gnu.org/archive/html/bison-patches/2010-03/msg00033.html>.
647 * NEWS (2.5): Remove mention of complaint.
21279295
JD
648 * src/reader.c (grammar_rule_check): Convert complaint back to
649 warning.
e02df72c
JD
650 * tests/input.at (%prec's token must be defined): Update.
651
ba3063f6
JD
6522010-04-25 Joel E. Denny <joeldenny@joeldenny.org>
653
654 build: don't require src/bison during bootstrap.
655 Suggested by Eric Blake at
656 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00003.html>.
657 * bootstrap.conf (bootstrap_epilogue): New function to make sure
658 src/parse-gram.[ch] are stamped later than src/parse-gram.y.
659
e0fda26c
JD
6602010-04-25 Joel E. Denny <joeldenny@joeldenny.org>
661
662 i18n: fix untranslatable string.
663 Reported by Goran Uddeborg at
664 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00000.html>.
665 * src/muscle-tab.c (muscle_percent_define_insert): Here.
666
ecbca7db
AD
6672010-04-13 Akim Demaille <demaille@gostai.com>
668
669 tests: calc: minor refactoring.
670 * tests/calc.at (_AT_DATA_CALC_Y): Simplify yylex.
671
ed228e60
AD
6722010-04-13 Akim Demaille <demaille@gostai.com>
673
674 tests: calc: simplify location management.
675 * tests/local.at (AT_LOC_PUSHDEF, AT_LOC_POPDEF): New.
676 (_AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS): Use them to
677 define the appropriate AT_LOC accessors.
678 * tests/calc.at: Use AT_LOC accessors.
679
cacfdef7
AD
6802010-04-13 Akim Demaille <demaille@gostai.com>
681
682 test location_type.
683 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS):
684 Define AT_LOCATION_TYPE_IF.
685 (_AT_BISON_OPTION_POPDEFS): Undefine AT_LOCATION_TYPE_IF.
686 * tests/calc.at (_AT_DATA_CALC_Y): When %define location_type is
687 used, provide a user location type and use it.
688 (Simple LALR1 C++ Calculator): Add a test case for location_type.
689
2f61c4a2
AD
6902010-04-13 Akim Demaille <demaille@gostai.com>
691
692 tests: check fclose's return value.
693 * tests/calc.at (_AT_DATA_CALC_Y): Check fclose's return status.
694
16d9244d
AD
6952010-04-13 Akim Demaille <demaille@gostai.com>
696
697 tests: don't depend on the actual location type.
698 * tests/calc.at: Use yy::parser::location_type rather than
699 yy::location, since the former is always right, and might point to
700 another type than the latter.
701
3e4a253b
AD
7022010-04-13 Akim Demaille <demaille@gostai.com>
703
704 formatting changes.
705 * tests/calc.at: Formatting changes.
706
df5df58d
AD
7072010-04-13 Akim Demaille <demaille@gostai.com>
708
709 lalr1.cc: remove useless forward declaration.
710 * data/lalr1.cc: Include location.hh before stack.hh.
711 Remove the useless forward declarations of position and location.
712 Reported by Chris Morley.
713 * data/glr.cc: Likewise.
714
88bb35d6
JD
7152010-04-11 Joel E. Denny <joeldenny@joeldenny.org>
716
717 * NEWS (2.4.3): Mention fix for Sun Studio C++.
718
585ef2eb
JD
7192010-04-10 Joel E. Denny <joeldenny@joeldenny.org>
720
721 tests: fix for newer Sun Studio C++.
722 Reported by Dagobert Michelsen at
723 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00023.html>.
724 * THANKS (Dagobert Michelsen): Add.
725 * configure.ac (AC_PREREQ): Set to 2.64 so we get the latest
726 Autoconf macro for handling the restrict keyword.
727 * gnulib: Update to latest, which no longer overrides that macro
728 from Autoconf.
729
a005dbcb
JD
7302010-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
731
732 portability: fix pointer arithmetic to conform to C standard.
733 Reported by Tys Lefering at
734 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00035.html>.
735 This fix is already implemented in glr.c and does not apply to
736 lalr1.java.
737 * data/lalr1.cc (yy::parser::parse): Increase size of
738 yyerror_range and adjust subscripting so you don't have to
739 subtract one from the beginning of the array.
740 * data/yacc.c (b4_declare_parser_state_variables,
741 yyparse, yypush_parse): Likewise.
742
8a8b33e8
AD
7432010-04-05 Akim Demaille <demaille@gostai.com>
744
745 remove useless include.
746 * src/graphviz.h: Don't include stdbool.h.
747
a0279765
AD
7482010-04-05 Akim Demaille <demaille@gostai.com>
749
750 graph: sign the output file.
751 * src/graphviz.c (start_graph): Issue comments about Bison.
752 Suggested by Tys Lefering.
753
132247cd
JD
7542010-03-31 Joel E. Denny <jdenny@ces.clemson.edu>
755
756 portability: fix test suite for GCC 4.5's new #error message.
757 Reported by Tys Lefering at
758 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00030.html>.
759 * NEWS (2.4.3): Mention.
760 * tests/synclines.at (AT_TEST_SYNCLINE): Implement.
761
c0259969
AD
7622010-03-30 Akim Demaille <demaille@gostai.com>
763
764 fix comments.
765 * src/graphviz.h: Add missing license notice.
766 Document.
767
23761f42
AD
7682010-03-25 Akim Demaille <demaille@gostai.com>
769
770 tests: fix 250: parse.error=verbose overflow.
771 * tests/regression.at (parse.error=verbose overflow): Avoid the
772 double inclusion of stdlib.h as it triggers hard errors.
773
9097fda0
JD
7742010-03-23 Joel E. Denny <jdenny@ces.clemson.edu>
775
776 portability: fix for BSD make.
777 Reported by Johan van Selst at
778 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00016.html>.
779 * tests/Makefile.am ($(TESTSUITE)): Qualify package.m4 in
780 this dependency list as in package.m4's target rule.
781
7a9c3cb3
JD
7822010-03-23 Joel E. Denny <jdenny@ces.clemson.edu>
783
784 portability: fix spawning on at least FreeBSD 8 and FreeBSD 9.
785 Reported by Johan van Selst at
786 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00014.html>.
787 * NEWS (2.4.3): New.
788 * THANKS (Johan van Selst): Add.
789 * gnulib: Update to latest.
790
5a3c69f1
JD
7912010-03-20 Joel E. Denny <jdenny@ces.clemson.edu>
792
793 maint: update for changes to gnulib's announce-gen.
794 * HACKING (Announce): RELEASE_TYPE=major must now be written
795 RELEASE_TYPE=stable.
796
ea66d039
JD
7972010-03-20 Joel E. Denny <jdenny@ces.clemson.edu>
798
799 Version 2.4.2.
800 * NEWS (2.4.2): Set version and date. For the recent test suite
801 portability fixes, don't be so optimistic about their success
802 given the lack of feedback on the affected platforms.
803
c50befe6
JD
8042010-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
805
806 tests: fix maintainer-xml-check for recent changes.
807 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Use
808 AT_BISON_CHECK_NO_XML rather than AT_BISON_CHECK because an
809 output file whose name conflicts with a previous output file
810 is now never generated.
811
47fa5747
JD
8122010-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
813
814 portability: fix several issues with M4 subprocess.
815
816 M4's output pipe was not being drained upon fatal errors during
817 scan_skel. As a result, broken-pipe messages from M4 were seen
818 on at least AIX, HP-UX, Solaris, and RHEL4, and this caused a
819 failure in the test suite. The problem was that, on platforms
820 where the default disposition for SIGPIPE is ignore instead of
821 terminate, M4 sometimes saw fwrite fail with errno=EPIPE and
822 then reported it. However, there's some sort of race condition,
823 because the new test group occasionally succeeded.
824 Reported by Albert Chin at
825 <http://lists.gnu.org/archive/html/bug-bison/2010-02/msg00004.html>.
826
827 There were also problems with the test suite livelocking on
828 Tru64 5.1b. Reported by Didier Godefroy at
829 <http://lists.gnu.org/archive/html/bug-bison/2009-05/msg00005.html>.
830 Switching to create_pipe_bidi suggested by Akim Demaille.
831
832 To attempt to solve both of these problems, switch to gnulib's
833 create_pipe_bidi and register M4 process as a slave. Along the
834 way, clean up file name conflict handling, which was affected by
835 the broken-pipe problem before the switch.
836 * NEWS (2.4.2): Document.
837 * THANKS (Didier Godefroy): Add.
838 * bootstrap.conf (gnulib_modules): Add pipe.
839 * gnulib: Update to latest to make sure we have all the latest
840 fixes.
841 * lib/Makefile.am (libbison_a_SOURCES): Remove subpipe.h and
842 subpipe.c.
843 * po/POTFILES.in (lib/subpipe.c): Remove.
844 * src/files.c (compute_output_file_names): Update invocations
845 of output_file_name_check.
846 (output_file_name_check): In the case that the grammar file
847 would be overwritten, use complain instead of fatal, but replace
848 the output file name with /dev/null. Use the /dev/null solution
849 for the case of two conflicting output files as well because it
850 seems safer in case Bison one day tries to open both files at
851 the same time.
852 * src/files.h (output_file_name_check): Update prototype.
853 * src/output.c (output_skeleton): Use create_pipe_bidi and
854 wait_subprocess. Assert that scan_skel completely drains the
855 pipe.
856 * src/scan-skel.l (at_directive_perform): Update
857 output_file_name_check invocation.
858 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Check that the
859 grammar file actually isn't overwritten.
860 (Conflicting output files: -o foo.y): Update expected output.
861 * tests/skeletons.at (Fatal errors but M4 continues producing
862 output): New test group.
863
d67e37a7
JD
8642010-02-04 Joel E. Denny <jdenny@ces.clemson.edu>
865
866 Update POTFILES.
867 * HACKING (Release Procedure): Add reminder about keeping
868 POTFILES files up-to-date.
869 * po/POTFILES.in (src/muscle-tab.c, src/scan-skel.l): Add.
870
0ee1af2e
JD
8712010-02-01 Joel E. Denny <jdenny@clemson.edu>
872
873 Code cleanup.
874 * tests/atlocal.in (abs_top_srcdir): Remove shell variable,
875 which is already defined in atconfig.
876
2655c7cd
JD
8772010-01-21 Joel E. Denny <jdenny@clemson.edu>
878
879 * cfg.mk (gnulib_dir): Assume gnulib is a subdirectory.
880
8ebc7dca
JD
8812010-01-21 Joel E. Denny <jdenny@clemson.edu>
882
883 maint: automate PACKAGE_COPYRIGHT_YEAR update, and update it.
884 * HACKING (Release Procedure): Update notes on copyright years.
885 * Makefile.am (update-package-copyright-year): New target rule.
886 * build-aux/update-package-copyright-year: New file.
887 * cfg.mk (update-copyright): Add update-package-copyright-year
888 as a dependency.
889
f0a43dd1
JD
8902010-01-19 Joel E. Denny <jdenny@clemson.edu>
891
892 * bootstrap: Import improvements from latest gnulib.
893
e4ca7a85
JD
8942010-01-19 Joel E. Denny <jdenny@clemson.edu>
895
896 build: require Automake 1.11.1 to avoid a security flaw.
897 * HACKING (Release Procedure): Don't document Automake security
898 flaw here.
899 * configure.ac (AM_INIT_AUTOMAKE): Require 1.11.1, and explain
900 why here.
901
8d830047
JD
9022010-01-19 Joel E. Denny <jdenny@clemson.edu>
903
904 gnulib: update to latest.
905
e5926647
JD
9062010-01-19 Joel E. Denny <jdenny@clemson.edu>
907
908 ChangeLog (2006-09-15): add Odd Arild Olsen's role for push.c.
909
5a2f6eb4
JD
9102010-01-15 Joel E. Denny <jdenny@clemson.edu>
911
912 Thank the developer of the initial push parser implementation.
913 This unfortunate oversight is several years old.
914 * THANKS (Odd Arild Olsen): Add.
915
1c4ad777
JD
9162010-01-04 Joel E. Denny <jdenny@clemson.edu>
917
918 Fix some comments concerning LR(0) versus LALR(1).
919
920 Stop equating LR(0) with nondeterminism and LALR(1) with
921 determinism. That is, if all states are consistent, then LR(0)
922 tables are deterministic. On the other hand, LALR(1) tables
923 might be nondeterministic before conflict resolution, and GLR
924 permits LALR(1) tables to remain nondeterministic.
925 * src/LR0.c, src/LR0.h: Here.
926 * src/lalr.c, src/lalr.h: Here.
927 * src/main.c (main): Here.
928 * src/state.c, src/state.h: Here.
929
930 * src/ielr.h (ielr): In preconditions, expect LR(0) not LALR(1)
931 parser tables.
932
1462fcee
JD
9332010-01-04 Joel E. Denny <jdenny@clemson.edu>
934
935 maint: run "make update-copyright"
936
510df951
JD
9372009-12-30 Joel E. Denny <jdenny@clemson.edu>
938
939 POSIX: complain if %prec's token was not defined.
940 * NEWS (2.5): Document.
941 * src/reader.c (grammar_rule_check): Convert warning to
942 complaint.
943 * tests/input.at (%prec's token must be defined): Update.
944
2c203528
JD
9452009-12-30 Joel E. Denny <jdenny@clemson.edu>
946
947 POSIX: warn if %prec's token was not defined.
948 Reported by Florian Krohm at
949 <http://lists.gnu.org/archive/html/bug-bison/2009-12/msg00005.html>.
950 * NEWS (2.4.2): Document.
951 * src/reader.c (grammar_rule_check): Implement.
952 (grammar_current_rule_prec_set): Add comments explaining that we
953 here assume a %prec identifier is a token, but we still manage
954 to support POSIX.
955 * tests/input.at (%prec's token must be defined): New test
956 group.
957
a93cdd3d
JD
9582009-12-31 Joel E. Denny <jdenny@clemson.edu>
959
960 * HACKING (Release Procedure): Recommend a secure automake.
961
bb57985c
AD
9622008-12-11 Akim Demaille <demaille@gostai.com>
963
964 Propagate i18n changes into glr.c.
965 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
966 building the error message format dynamically.
967 * data/lalr1.java: Formatting changes.
968
70afaf26
JD
9692009-12-22 Joel E. Denny <jdenny@clemson.edu>
970
971 Port small part of master's 11707b2b so future ports are easier.
972 * data/lalr1.java (YYParser::yysyntax_error): Untabify.
973
8200219a
AD
9742008-12-11 Akim Demaille <demaille@gostai.com>
975
976 Simplify the i18n of the error messages.
977 * data/lalr1.cc: Comment changes.
978
39f6a8d1
AD
9792008-11-11 Akim Demaille <demaille@gostai.com>
980
981 Prefer M4 to CPP.
982 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
983 YYERROR_VERBOSE.
984
e657f369
AD
9852008-11-11 Akim Demaille <demaille@gostai.com>
986
987 Support i18n of the parse error messages.
988 * TODO (lalr1.cc/I18n): Remove.
989 * data/lalr1.cc (yysyntax_error_): Support the translation of the
990 error messages, as done in yacc.c.
991 Stay within the yy* pseudo namespace.
992
1e05521d
JD
9932009-12-22 Joel E. Denny <jdenny@clemson.edu>
994
995 Port small part of master's 8901f32e so future ports are easier.
996 * data/lalr1.cc (yy::parser::yysyntax_error_): Always add second
997 argument, but name it in the function definition only when
998 verbose error messages are enabled and it'll thus be used.
999 (yy::parser::parse): Update use of yysyntax_error_.
1000
2728ac7e
JD
10012009-12-29 Joel E. Denny <jdenny@clemson.edu>
1002
1003 portability: `<' and `>' are not always defined on addresses.
1004 Specifically, don't sort objects by their memory addresses when
1005 they're not allocated in the same array or other object. Though
1006 I haven't found a test case where that fails on my platform, C
1007 says the behavior is undefined.
1008 * src/AnnotationList.c (AnnotationList__insertInto): Remove
1009 FIXME. Use new id field of InadequacyList nodes rather than
1010 their memory addresses when sorting.
1011 (AnnotationList__compute_from_inadequacies): Add
1012 inadequacy_list_node_count argument to pass to
1013 InadequacyList__new_conflict.
1014 * src/AnnotationList.h
1015 (AnnotationList__compute_from_inadequacies): Update prototype
1016 and documentation for new argument.
1017 * src/InadequacyList.c (InadequacyList__new_conflict): Add
1018 node_count argument and use it to assign a unique ID.
1019 * src/InadequacyList.h (InadequacyListNodeCount): New typedef.
1020 (InadequacyList): Add id field.
1021 (InadequacyList__new_conflict): Update prototype and
1022 documentation for new argument.
1023 * src/ielr.c (ielr_compute_annotation_lists): Update
1024 AnnotationList__compute_from_inadequacies invocation.
1025
abcc7c03
JD
10262009-12-20 Joel E. Denny <jdenny@clemson.edu>
1027
1028 Fix handling of yychar manipulation in user semantic actions.
1029 The problem was that yacc.c didn't always update the yychar
1030 translation afterwards. However, other skeletons appear to be
1031 fine. glr.c appears to already translate yychar before every
1032 use. lalr1.cc does not define yychar and does not document its
1033 replacement, yyla, for users. It does provide yyclearin, but
1034 that does not manipulate yyla and thus requires no translation
1035 update. In lalr1.java, yychar is out of scope during semantic
1036 actions.
1037 * NEWS (2.5): Document.
1038 * data/yacc.c (YYBACKUP): Don't bother translating yychar into
1039 yytoken here.
1040 (yyparse, yypush_parse): Instead, translate before every use of
1041 yytoken, and add comments explaining this approach.
1042 * tests/actions.at (Destroying lookahead assigned by semantic
1043 action): New test group checking that translation happens before
1044 lookahead destructor calls at parser return. Previously,
1045 incorrect destructors were called.
1046 * tests/conflicts.at (%error-verbose and consistent
1047 errors): New test group checking that translation happens at
1048 syntax error detection before the associated verbose error
1049 message and the associated lookahead destructor calls. While
1050 the destructor call is fixed by this patch, the verbose error
1051 message is currently incorrect due to another bug (see
1052 comments in test group), so this is an expected failure for now.
1053
62efdd2a
JD
10542009-12-21 Joel E. Denny <jdenny@clemson.edu>
1055
1056 YYFAIL: warn about uses and remove from lalr1.java.
1057 * NEWS (2.5): Document.
5f1485d8 1058 * data/lalr1.java (YYParser::YYFAIL): Rename to YYERRLAB,
62efdd2a
JD
1059 and make it private. Update all uses.
1060 * src/scan-code.l (SC_RULE_ACTION): Implement warning.
1061
41d35e54
JD
10622009-12-21 Joel E. Denny <jdenny@clemson.edu>
1063
1064 YYFAIL: deprecate.
1065 * NEWS (2.4.2): Document deprecation and the phase-out plan.
5f1485d8 1066 * data/lalr1.java (YYParser::YYFAIL): Add comment about
41d35e54
JD
1067 deprecation.
1068 * data/yacc.c (YYFAIL): Likewise, and suppress warnings about
1069 YYFAIL from GCC cpp's -Wunused-macros.
1070 * doc/bison.texinfo (Java Action Features): Remove YYFAIL
1071 documentation.
1072 (LocalWords): Remove YYFAIL.
1073
692d04cb
JD
10742009-12-17 Joel E. Denny <jdenny@clemson.edu>
1075
1076 Code cleanup.
1077 * src/symtab.c, src/symtab.h (symbol_class_get_string): Remove
1078 function, which is no longer used.
1079
34731471
JD
10802009-12-16 Joel E. Denny <jdenny@clemson.edu>
1081
1082 Add gcc's -Wundef to test suite and fix another warning from it.
1083 * NEWS (2.4.2): Update description of -Wundef fix.
1084 * configure.ac (WARN_CXXFLAGS_TEST): New substitution.
1085 (WARN_CFLAGS_TEST): New substitution.
1086 * data/glr.c: Avoid warning about __STRICT_ANSI__.
1087 * tests/atlocal.in (CFLAGS): Use WARN_CFLAGS_TEST instead of
1088 WARN_CFLAGS.
1089 (NO_WERROR_CFLAGS): Likewise.
1090 (CXXFLAGS): Use WARN_CXXFLAGS_TEST instead of WARN_CXXFLAGS.
1091
3bba2dad
JD
10922009-12-16 Joel E. Denny <jdenny@clemson.edu>
1093
1094 * data/yacc.c: Reformat m4 a little.
1095
af2ffe5c
JD
10962009-12-16 Joel E. Denny <jdenny@clemson.edu>
1097
1098 Document gcc -Wundef fix.
1099 * NEWS (2.4.2): Here.
1100 * THANKS (Jonathan Nieder): Add.
1101
874ac415
JN
11022009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
1103
1104 Simplify y.tab.c when location tracking is disabled.
1105 * data/yacc.c: Do not check YYLTYPE_IS_TRIVIAL if location
1106 tracking is not enabled. Instead, unconditionally define
1107 YY_LOCATION_PRINT as a no-op for backward compatibility.
1108
06caf0e1
JN
11092009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
1110
1111 Avoid warnings from gcc -Wundef y.tab.c.
1112 * data/glr.c: Check if YYENABLE_NLS and YYLTYPE_IS_TRIVIAL are
1113 defined before using them.
1114 * data/lalr1.cc: Likewise.
1115 * data/yacc.c: Likewise.
1116
687f011a
JD
11172009-12-15 Joel E. Denny <jdenny@clemson.edu>
1118
1119 autoconf: update to latest for fix of M4 detection.
1120 Reported by Eric Blake.
1121 * submodules/autoconf: Update.
1122
fb9a3976
JD
11232009-12-15 Joel E. Denny <jdenny@clemson.edu>
1124
1125 portability: use -DGNULIB_POSIXCHECK.
1126 Reported by Eric Blake. See discussions at
1127 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00008.html>
1128 and
1129 <http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00108.html>.
1130 * HACKING (Release checks): Suggest -DGNULIB_POSIXCHECK.
1131 * bootstrap.conf (gnulib_modules): Add all the printf modules
1132 suggested by -DGNULIB_POSIXCHECK. Add realloc-posix as
1133 suggested by -DGNULIB_POSIXCHECK for gnulib's own vasnprintf.c.
1134 (excluded_files): Remove m4/printf-posix.m4.
1135 * tests/atlocal.in (LIBS): As for LDADD in src/local.mk, add
1136 lib/libbison.a so gnulib libraries can be linked.
1137
f1fb412c
JD
11382009-12-14 Joel E. Denny <jdenny@clemson.edu>
1139
1140 Enable assertion output and --disable-assert for configure.
1141 * bootstrap.conf (gnulib_modules): Add assert module.
1142 * src/system.h (aver): Define as assert, and summarize the
1143 discussion on this issue.
1144
51c7ca01
JD
11452009-12-14 Joel E. Denny <jdenny@clemson.edu>
1146
1147 Expand GLR acronym in summary of Bison.
1148 Based on discussion with Akim Demaille starting at
1149 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00087.html>.
1150 * doc/bison.texinfo (Introduction): Here.
1151 * src/getargs.c (usage): Here.
1152
1f68dca5
AR
11532009-10-03 Alex Rozenman <rozenman@gmail.com>
1154
1155 Document named references.
1156 * doc/bison.texinfo (Actions): Add new example and xref to
1157 Using Named References node.
1158 (Using Named References): New node.
1159
aa01d193
JD
11602009-10-16 Joel E. Denny <jdenny@clemson.edu>
1161
1162 cleanup.
1163 * src/Sbitset.c (Sbitset__new_on_obstack): Use Sbitset instead
1164 of char*.
1165 (Sbitset__isEmpty): Use Sbitset instead of char*.
1166 * src/Sbitset.h (Sbitset): Make it a pointer to unsigned char
1167 instead of char. This helps to avoid casting errors.
1168 (Sbitset__or): Use Sbitset instead of char*.
1169
61747047
JD
11702009-10-16 Joel E. Denny <jdenny@clemson.edu>
1171
1172 portability: don't assume 8-bit bytes.
1173 That is, use CHAR_BIT and UCHAR_MAX instead of 8 and 0xff.
1174 * src/Sbitset.h (Sbitset__nbytes): Here.
1175 (Sbitset__byteAddress): Here.
1176 (Sbitset__bit_mask): Here.
1177 (Sbitset__last_byte_mask): Here.
1178 (Sbitset__ones): Here.
1179 (SBITSET__FOR_EACH): Here.
1180
a70596de
JD
11812009-10-11 Joel E. Denny <jdenny@clemson.edu>
1182
1183 portability: use va_start and va_end in the same function.
1184 * src/complain.c (error_message): Move va_end from here...
1185 (ERROR_MESSAGE): ... to here.
1186
51f255a5
JD
11872009-10-08 Joel E. Denny <jdenny@clemson.edu>
1188
1189 * data/bison.m4: Update comments for rename to muscle-tab.h.
1190
23ec25b7
JD
11912009-10-08 Joel E. Denny <jdenny@clemson.edu>
1192
1193 Rename muscle_tab.* to muscle-tab.* for consistency with master.
1194 * src/Makefile.am (bison_SOURCES): Update.
1195 * src/getargs.c, src/ielr.c, src/lalr.c, src/main.c,
1196 src/output.c, src/parse-gram.y, src/print.c, src/reader.c,
1197 src/tables.c: Update include.
1198 * src/muscle_tab.c, src/muscle_tab.h: Rename to...
1199 * src/muscle-tab.c, src/muscle-tab.h: ... these and update
1200 include.
1201
0ab402b4
JD
12022009-10-07 Joel E. Denny <jdenny@clemson.edu>
1203
1204 Minor code cleanup.
1205 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT): Remove macro and
1206 replace all uses with UNIQSTR_CONCAT.
1207 * src/uniqstr.c (uniqstr_vsprintf): New function.
1208 * src/uniqstr.h (uniqstr_vsprintf): Add prototype.
1209 (UNIQSTR_CONCAT, UNIQSTR_GEN_FORMAT, UNIQSTR_GEN_FORMAT_): New
1210 macros.
1211
42ec0ae1
JD
12122009-10-04 Joel E. Denny <jdenny@clemson.edu>
1213
1214 Minor code cleanup.
1215 * src/parse-gram.y: Clean up sorting of declarations.
1216 Use types to simplify %printer declarations where possible.
1217 Provide %printer for BRACKETED_ID and symbol.prec.
1218 * src/symtab.c: Whitespace change.
1219
9637e0ed
JD
12202009-10-04 Joel E. Denny <jdenny@clemson.edu>
1221
1222 tests: skip tests of file names that platform does not support.
1223 Reported by Michael Raskin at
1224 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00001.html>.
1225 * THANKS (Michael Raskin): Add.
1226 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Fix. Cygwin used
1227 to fail at least for file names containing ":" or "\".
1228
69a2ab11
JD
12292009-09-23 Joel E. Denny <jdenny@clemson.edu>
1230
1231 yysyntax_error: avoid duplicate lookahead collection.
1232 Except when memory reallocation is required, this change
1233 eliminates the need to invoke yysyntax_error twice and thus to
1234 repeat the collection of lookaheads. It also prepares for
1235 future extensions that will make those repetitions more
1236 expensive and that will require additional memory management in
1237 yysyntax_error. Finally, it fixes an obscure bug already
1238 exercised in the test suite.
1239 * data/yacc.c (yysyntax_error): Add arguments for message
1240 buffer variables stored in the parser. Instead of size, return
1241 status similar to yyparse status but indicating success of
1242 message creation. Other than the actual reallocation of the
1243 message buffer, import and clean up memory management code
1244 from...
1245 (yyparse, yypush_parse): ... here.
1246 * tests/regression.at (%error-verbose overflow): No longer an
1247 expected failure.
1248
d88cf117
JD
12492009-09-23 Joel E. Denny <jdenny@clemson.edu>
1250
1251 yysyntax_error: test memory management more.
1252 * tests/atlocal.in (NO_WERROR_CFLAGS): New cpp macro.
1253 * tests/regression.at (%error-verbose and YYSTACK_USE_ALLOCA):
1254 New test group.
1255 (%error-verbose overflow): New test group that reveals an
1256 obscure bug. Expected fail for now.
1257
9da640ea
AD
12582008-12-11 Akim Demaille <demaille@gostai.com>
1259
1260 Pass the token type to yysyntax_error.
1261 * data/yacc.c (yysyntax_error): Take the transated token instead
1262 of the raw number.
1263 Adjust callers.
1264
d3d3628b
AD
12652008-12-11 Akim Demaille <demaille@gostai.com>
1266
1267 Simplify the i18n of the error messages.
1268 * data/yacc.c (yysyntax_error): Rewrite, using a switch instead
1269 of building dynamically the format string.
1270
4c6b13f3
JD
12712009-10-03 Joel E. Denny <jdenny@clemson.edu>
1272
1273 Remove dead code.
1274 * src/symtab.c (symbol_pack): Here because every symbol's number
1275 is always defined by this time.
1276
f840c05a
AR
12772009-10-03 Alex Rozenman <rozenman@gmail.com>
1278
1279 Add additional space after periods in NEWS.
1280 * NEWS (2.5): here.
1281
17a407dc
JD
12822009-09-29 Joel E. Denny <jdenny@clemson.edu>
1283
1284 Use the correct conversion specifier for size_t.
1285 Reported by Jim Meyering.
1286 * src/Sbitset.h (SBITSET__INDEX__CONVERSION_SPEC): New, "zu"
1287 because Sbitset__Index is size_t.
1288 * src/Sbitset.c (Sbitset__fprint): Use it instead of %d.
1289
4b7a4c1b
JD
12902009-09-27 Joel E. Denny <jdenny@clemson.edu>
1291
1292 tests: don't abuse AT_BISON_CHECK.
1293 * tests/regression.at (parse-gram.y: LALR = IELR): Move
1294 additional shell commands outside of AT_BISON_CHECK.
1295
873ac263
JD
12962009-09-26 Joel E. Denny <jdenny@clemson.edu>
1297
1298 tests: check that parse-gram.y's IELR and LALR are identical.
1299 * tests/atlocal.in (abs_top_srcdir): New shell variable.
1300 * tests/regression.at (parse-gram.y: LALR = IELR): New test
1301 group.
1302
232be91a
AD
13032009-09-16 Akim Demaille <demaille@gostai.com>
1304
1305 doc: comment changes.
1306 * doc/bison.texinfo: Comment changes.
1307
c781580d
AD
13082009-09-16 Akim Demaille <demaille@gostai.com>
1309
1310 doc: spell checking.
1311 * doc/bison.texinfo: here.
1312
348f5608
AR
13132009-09-19 Alex Rozenman <rozenman@gmail.com>
1314
1315 Keep sub-messages aligned. Fix strings for translation.
f840c05a
AR
1316 * src/location.h (location_print): Add return value.
1317 * src/location.c (location_print): Return number of printed
348f5608 1318 characters.
f840c05a
AR
1319 * src/complain.h (complain_at_indent, warn_at_indent): Prototype
1320 new functions.
1321 * src/complain.cpp (indent_ptr): New static variable.
1322 (error_message, complain_at_indent, warn_at_indent): Implement
1323 the alignment mechanism.
1324 * src/scan-code.l (parse_ref, show_sub_messages): Fix strings
1325 for translations. Use new alignment mechanism.
1326 * tests/named-ref.at: Adjust test-cases.
348f5608
AR
1327 * NEWS (2.5): Add an announcement about named references.
1328
d93b5f50
JD
13292009-09-13 Joel E. Denny <jdenny@clemson.edu>
1330
1331 tests: clean up push.at test group titles.
1332 * tests/push.at: Remove "Push Parsing: " from test group titles
1333 because these are already under the banner "Push Parsing Tests".
1334
4c56b131
AR
13352009-09-12 Alex Rozenman <rozenman@gmail.com>
1336
1337 Provide an additional sub-message for clarity.
1338 Add "symbol not found in production" error message when
1339 an "invalid reference" is detected in named references
1340 resolution.
1341 * src/scan-code.l: Update "invalid reference" case.
1342 * tests/named-ref.at: Adjust test-cases.
1343
93d0103d
JD
13442009-09-10 Joel E. Denny <jdenny@clemson.edu>
1345
1346 Clean up yacc.c a little.
1347 * data/yacc.c: Clean up M4 for readability, and make output
1348 whitespace more consistent. For the main parse function
1349 comment, instead of saying "yyparse or yypush_parse", say either
1350 "yyparse" or "yypush_parse" depending on which it actually is.
1351
628be6c9
JD
13522009-09-03 Joel E. Denny <jdenny@clemson.edu>
1353
1354 Complain about unused %define variables and %code qualifiers.
1355 * NEWS (2.5): Document.
1356 * data/bison.m4 (b4_check_user_names): Complain instead of warn.
1357 * doc/bison.texinfo (Decl Summary): Document complaint, and
1358 improve %define documentation a little otherwise.
1359 * tests/input.at (Reject unused %code qualifiers): Update.
1360 (%define errors): Update.
1361 (%define, --define, --force-define): Update.
1362 (%define backward compatibility): Update.
1363 (Unused %define api.pure): Update.
1364 * tests/push.at (Push Parsing: Unsupported Skeletons): Update.
1365
c842365a
JD
13662009-09-03 Joel E. Denny <jdenny@clemson.edu>
1367
1368 Use aver not assert.
1369 * src/output.c: Don't include assert.h.
1370 (output_skeleton): Use aver not assert.
1371 * src/system.h (aver): In documentation of why, add links to
1372 Paul Eggert's explanations in the mailing lists.
1373
14e568d7
AR
13742009-09-05 Alex Rozenman <rozenman@gmail.com>
1375
1376 Use "Unresolved reference" error message when no symbols were found
1377 in a symbolic reference resolution. Remove .expr and -expr from
1378 the shown reference when the reference is unresolved.
1379 * src/scan-code.l: Change the error message, adjust location columns,
1380 rename variable "exact_mode" to "explicit_bracketing".
1381 * tests/named-ref.at: Adjust existing tests and add a new one.
1382
dac8cc0d
AD
13832009-09-03 Akim Demaille <demaille@gostai.com>
1384
1385 * NEWS (2.4.2): Add "Internationalization" item.
1386
3710dd02
AD
13872009-09-03 Akim Demaille <demaille@gostai.com>
1388
1389 bootstrap: fix/improve find_tool.
1390 * bootstrap (find_tool): Improve error messages.
1391 Fix typo about find_tool_names.
1392
9852b61c
JD
13932009-08-29 Joel E. Denny <jdenny@clemson.edu>
1394
1395 Fix gcc 3.4.4 shadowing warning reported by Eric Blake.
1396 See
1397 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00093.html>.
1398 * src/scan-code.h (code_props_rule_action_init): Rename
1399 named_ref arg to name so it doesn't shadow named_ref type. This
1400 makes it consistent with the function definition in scan-code.l
1401 anyway.
1402
f37495f6
JD
14032009-08-28 Joel E. Denny <jdenny@clemson.edu>
1404
1405 %define: accept unquoted values.
1406 * NEWS (2.5): Group all %define changes together, and document
1407 this one. Remove quotes in IELR and canonical LR entry.
1408 * doc/bison.texinfo: Remove quotes in most examples throughout.
1409 (Decl Summary): Update %define documentation.
1410 (Table of Symbols): Likewise.
1411 * src/ielr.c (LrType): Update documentation.
1412 * src/parse-gram.y (content.opt): Add production for ID.
5bf2bf7a 1413 * tests/calc.at: Remove quotes in most tests.
f37495f6
JD
1414 * tests/existing.at: Likewise.
1415 * tests/input.at: Likewise.
1416 * tests/local.at: Likewise.
1417 * tests/push.at: Likewise.
1418 * tests/reduce.at: Likewise.
1419 * tests/torture.at: Likewise.
1420
3a414bbf
JD
14212009-08-28 Joel E. Denny <jdenny@clemson.edu>
1422
1423 %define lr.type: make values lowercase IDs.
1424 That is, "LALR" => "lalr", "IELR" => "ielr", and
1425 "canonical LR" => "canonical-lr".
1426 * NEWS (2.5): Update documentation.
1427 * doc/bison.texinfo (Decl Summary): Likewise.
1428 * src/ielr.c (ielr): Use new values.
1429 * src/ielr.h (ielr): Update documentation.
1430 * src/reader.c (prepare_percent_define_front_end_variables): Use
1431 and validate new values.
1432 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): Update test
1433 grammars.
1434 * tests/reduce.at (AT_TEST_LR_TYPE): Likewise.
1435
4bb975e1
EB
14362009-08-27 Eric Blake <ebb9@byu.net>
1437
1438 scan-gram: avoid portability trap with ctype usage.
1439 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
1440 Avoid compiler warning.
1441
74baf5c9
JD
14422009-08-27 Joel E. Denny <jdenny@clemson.edu>
1443
1444 tests: use perl for printing special sequences to files.
1445 And skip tests if perl is not available. This is better than
1446 playing tricks with shell portability. Suggested by Akim
1447 Demaille.
1448 * tests/input.at (Bad character literals): Use it here for
1449 omitting final newlines.
1450 (Bad escapes in literals): Use it here for special characters.
1451
d63e1279
JD
14522009-08-26 Joel E. Denny <jdenny@clemson.edu>
1453
1454 tests: show a use of %define lr.default-reductions "consistent"
1455 * tests/conflicts.at (%nonassoc and eof): Extend to test that it
1456 prevents the omission of expected tokens for %error-verbose.
1457
833d1720
AD
14582009-08-26 Akim Demaille <demaille@gostai.com>
1459
1460 tests: portability fix.
1461 * tests/input.at (Bad escapes in literals): Don't expect "echo
1462 '\0'" to output \ then 0.
1463
e4bcae3c
JD
14642009-08-26 Joel E. Denny <jdenny@clemson.edu>
1465
1466 Actually handle the yytable zero value correctly this time.
1467 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c: Don't
1468 mention zero values in the YYTABLE comments.
1469 * data/glr.c (yytable_value_is_error): Don't check for zero
1470 value.
1471 * data/lalr1.cc (yy_table_value_is_error_): Likewise.
1472 * data/yacc.c (yytable_value_is_error): Likewise.
1473 * data/lalr1.java (yy_table_value_is_error_): Likewise.
1474 (yysyntax_error): Fix typo in code: use yytable_ not yycheck_.
1475 * src/tables.h: In header comments, explain why it's useless to
1476 check for a zero value in yytable.
1477
d5eb0826
JD
14782009-08-25 Joel E. Denny <jdenny@clemson.edu>
1479
1480 More fixes related to last two patches.
1481 * data/c.m4 (b4_table_value_equals): Comment that YYID must be
1482 defined.
1483 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c: Fix
1484 yytable comments: zero indicates syntax error not default
1485 action.
1486 * data/glr.c (yyis_pact_ninf): Rename to...
1487 (yypact_value_is_default): ... this.
1488 (yyisDefaultedState): Update for rename.
1489 (yyis_table_ninf): Rename to...
1490 (yytable_value_is_error): ... this, and check for value zero
1491 besides just YYTABLE_NINF.
1492 (yygetLRActions): Check for default value from yypact. It
1493 appears that this check is always performed before this function
1494 is invoked, and so adding the check here is probably redundant.
1495 However, the code may evolve after this subtlety is forgotten.
1496 Also, update for rename to yytable_value_is_error. Because that
1497 macro now checks for zero, a different but equivalent branch of
1498 the if-then-else here is evaluated.
1499 (yyreportSyntaxError): Update for rename to
1500 yytable_value_is_error. The zero condition was mishandled
1501 before.
1502 (yyrecoverSyntaxError): Update for renames. No behavioral
1503 changes.
1504 * data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_):
1505 New function.
1506 (yy_table_value_is_error_): New function.
1507 (parse): Use new functions where possible. No behavioral
1508 changes.
1509 (yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_.
1510 The zero condition was mishandled before.
1511 * data/yacc.c (yyis_pact_ninf): Rename to...
1512 (yypact_value_is_default): ... this.
1513 (yyis_table_ninf): Rename to...
1514 (yytable_value_is_error): ... this, and check for value zero
1515 besides just YYTABLE_NINF.
1516 (yysyntax_error): Update for rename to yytable_value_is_error.
1517 The zero condition was mishandled before.
1518 (yyparse): Update for renames. No behavioral changes.
1519 * src/tables.h: Improve comments about yypact, yytable, etc.
1520 more. Most importantly, say yytable value of zero means syntax
1521 error not default action.
1522
1fa30307
JD
15232009-08-25 Joel E. Denny <jdenny@clemson.edu>
1524
1525 Fix %error-verbose for conflicts resolved by %nonassoc.
1526 * NEWS (2.5): Document.
1527 * data/glr.c (yyreportSyntaxError): Fix this by checking
1528 yyis_table_ninf.
1529 * data/yacc.c (yysyntax_error): Likewise.
1530 * data/lalr1.cc (yysyntax_error_): Fix this by checking
1531 yytable_ninf_.
1532 * data/lalr1.java (yysyntax_error): Likewise.
1533 * tests/conflicts.at (%nonassoc and eof): Update expected output
1534 and remove FIXME.
1535
77373efa
JD
15362009-08-25 Joel E. Denny <jdenny@clemson.edu>
1537
1538 Some code and documentation improvements.
1539 * data/c.m4 (b4_table_value_equals): New macro to capture
1540 some repeated code.
1541 * data/glr.c (yyis_pact_ninf): Use it here.
1542 (yyis_table_ninf): Likewise.
1543 (yyreportSyntaxError): Improve internal comments.
1544 * data/yacc.c (yyis_pact_ninf): New macro copied from glr.c.
1545 Use it everywhere possible.
1546 (yyis_table_ninf): Likewise.
1547 (yysyntax_error): Improve internal comments.
1548 * data/lalr1.cc (yysyntax_error_): Likewise.
1549 * data/lalr1.java (yysyntax_error): Likewise.
1550 * src/tables.h: Improve comments about yypact, yytable, etc.
1551
890ab17c
JD
15522009-08-21 Joel E. Denny <jdenny@clemson.edu>
1553
1554 Use locale when quoting.
1555 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
1556 quote rather than implementing quoting here.
1557
c5196098
EB
15582009-08-20 Eric Blake <ebb9@byu.net>
1559
aa50ba7b
EB
1560 Make previous patch more robust.
1561 * src/output.c (ARRAY_CARDINALITY): New macro, copied from
1562 argmatch.h.
1563 (output_skeleton): Use it.
1564 Suggested by Akim Demaille.
1565
c5196098
EB
1566 Import latest m4/m4.m4.
1567 * submodules/autoconf: Update to autoconf 2.64.
1568 * configure.ac (M4_GNU_OPTION): New define.
1569 * src/output.c (output_skeleton): Use it to resolve FIXME.
1570 * NEWS: Mention this.
1571
39fb7e62
JD
15722009-08-19 Joel E. Denny <jdenny@clemson.edu>
1573
1574 Fix complaints about escape sequences.
1575 Discussed starting at
1576 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
1577 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
1578 For a \0 and similar escape sequences meaning the null
1579 character, report an invalid escape sequence instead of an
1580 invalid null character because the latter does not actually
1581 appear in the user's input.
1582 In all escape sequence complaints, don't escape the initial
1583 backslash, and don't quote when the sequence appears at the end
1584 of the complaint line unless there's whitespace that quotearg
1585 won't escape.
1586 Consistently say "invalid" not "unrecognized".
1587 Consistently prefer "empty character literal" over "extra
1588 characters in character literal" warning for invalid escape
1589 sequences; that is, consistently discard those sequences.
1590 * tests/input.at (Bad escapes in literals): New.
1591
c33bc800
AD
15922009-08-19 Akim Demaille <demaille@gostai.com>
1593
1594 doc: fixes.
1595 * doc/bison.texinfo: Fix minor Texinfo errors.
1596
8fbbeba2
AD
15972009-08-19 Akim Demaille <demaille@gostai.com>
1598
1599 doc: %initial-action to initialize yylloc.
1600 Reported by Bill Allombert.
1601 * doc/bison.texinfo: Set fill-column to 76.
1602 (Location Type): Document the use of %initial-action to initialize
1603 yylloc.
1604
1874a474
JD
16052009-08-18 Joel E. Denny <jdenny@clemson.edu>
1606
1607 maint: update for gnulib's recent update-copyright changes
1608 * gnulib: Update.
1609 * .x-update-copyright (COPYING): Add as it's no longer implied
1610 when .x-update-copyright is present.
1611 * cfg.mk (update-copyright-local): Remove, now ignored.
1612 (update-copyright): Declare update-b4-copyright as a dependency.
1613
f4bfd5a9
AD
16142009-08-17 Akim Demaille <demaille@gostai.com>
1615
1616 build: require gettext 0.17.
1617
1618 Suggested by Bruno Haible.
1619 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
1620 * configure.ac: require gettext 0.17 to ensure compatibility with
1621 gnulib.
1622
2509eba6
AD
16232009-08-17 Akim Demaille <demaille@gostai.com>
1624
1625 build: lower gettext requirements.
1626
1627 Bison was uselessly requiring the formatstring macros from
1628 gettext, which resulted in mo files not being installed on systems
1629 that perfectly supported Bison mo files. Lower the requirement.
1630 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
1631
aa50ba7b
EB
1632 * configure.ac: Require need-ngettext instead of
1633 need-formatstring-macros.
1634 Reported by Martin Jabocs.
1635 Suggested by Bruno Haible.
1636 * INSTALL: Restructure.
1637 (Internationalization): New.
2509eba6 1638
314542f9
JD
16392009-08-14 Joel E. Denny <jdenny@clemson.edu>
1640
1641 maint: fix use of copyright year intervals.
1642 * gnulib: Update.
1643 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
1644 as now recommended in gnulib/NEWS.
1645 * build-aux/update-b4-copyright: Fix.
1646 * cfg.mk (update-copyright-env): Configure update-copyright.
1647
24985964
JD
16482009-08-13 Joel E. Denny <jdenny@clemson.edu>
1649
1650 Make it easier to write deterministic tests.
1651 Continues Akim's work from his 2009-06-10 commits.
1652 * src/reader.c (check_and_convert_grammar): Don't add any
1653 symbols after the first symbols_do invocation.
1654 * src/symtab.c (symbols_sorted): New static global.
1655 (user_token_number_redeclaration): Update comments.
1656 (symbol_from_uniqstr): If a new symbol is being created, assert
1657 that symbols_sorted hasn't been allocated yet.
1658 (symbols_free): Free symbols_sorted.
1659 (symbols_cmp, symbols_cmp_qsort): New functions.
1660 (symbols_do): Sort symbol_table into symbols_sorted on first
1661 invocation.
1662 * tests/input.at (Numbered tokens): Recombine tests now that the
1663 output should be deterministic across multiple numbers.
1664
47076da5
AD
16652009-08-12 Akim Demaille <demaille@gostai.com>
1666
1667 distcheck: fix.
1668
aa50ba7b 1669 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
47076da5 1670
36dfe466
JD
16712009-08-10 Joel E. Denny <jdenny@clemson.edu>
1672
1673 * tests/Makefile.am (TESTSUITE_AT): Add named-refs.at.
1674
07c0db18
JD
16752009-08-10 Joel E. Denny <jdenny@clemson.edu>
1676
1677 Miscellaneous code readability improvements.
1678
1679 * src/reader.c (reader): Move %define front-end variable
1680 defaults and checking into...
1681 (prepare_percent_define_front_end_variables): ... this new
1682 function.
1683
1684 * src/scan-gram.l (INITIAL): For consistency with string
1685 literals, don't store open quote on character literal. It's
1686 discarded before returning anyway.
1687 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
1688 Make length test more readable, and make the character stored
1689 for an empty literal more obvious while consistent with the
1690 previous behavior.
1691
1692 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
1693 USER_NUMBER_HAS_STRING_ALIAS throughout.
1694 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
1695 that is repeated in symtab.h. Improve argument names to make it
1696 clear which side of the symbol-string alias pair is which.
1697 (symbol_check_alias_consistency): Improve local variable names
1698 for the same purpose.
1699 * src/symtab.h (struct symbol): Make comments about aliases
1700 clearer.
1701 (symbol_make_alias): Improve comments and argument name.
1702 * src/output.c (token_definitions_output): Update for rename to
1703 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
1704
1a323c2f
AR
17052009-08-08 Alex Rozenman <rozenman@gmail.com>
1706
1707 Convert "misleading reference" messages to warnings.
1708 * src/scan-code.l: New function 'show_sub_messages', more
1709 factoring.
1710 * tests/named-ref.at: Adjust tests.
1711
38609c34
JD
17122009-08-06 Joel E. Denny <jdenny@clemson.edu>
1713
1714 maint: run "make update-copyright"
1715
642f240e
JD
17162009-08-06 Joel E. Denny <jdenny@clemson.edu>
1717
1718 maint: make update-b4-copyright easier to use
1719 * build-aux/update-b4-copyright: In warnings, report line
1720 numbers rather than character positions.
1721 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
1722 that update-copyright runs it.
1723 * gnulib: Update.
1724
d0caad01
JD
17252009-08-05 Joel E. Denny <jdenny@clemson.edu>
1726
1727 maint: clean up update-b4-copyright code
1728 * build-aux/update-b4-copyright: Do not accept 2-digit
1729 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
1730 Don't accept a `[' in a b4_copyright argument.
1731 Format code more consistently.
1732 Don't assume b4*copyright never occurs.
1733
ac2def56
JD
17342009-08-04 Joel E. Denny <jdenny@clemson.edu>
1735
1736 maint: automate b4_copyright updates.
1737 * Makefile.am (update-b4-copyright): New target rule.
1738 * build-aux/Makefile.am (EXTRA_DIST): Add update-b4-copyright.
1739 * build-aux/update-b4-copyright: New.
1740 * data/yacc.c: Remove stray characters around b4_copyright
1741 invocations.
1742
dbbb64f0
JD
17432009-08-04 Joel E. Denny <jdenny@clemson.edu>
1744
1745 maint: automate annual package-wide copyright-year update.
1746 * .x-update-copyright: New.
1747 * Makefile.am (EXTRA_DIST): Remove maint.mk.
1748 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
1749 update-copyright. Remove gnumakefile, which is implied by
1750 maintainer-makefile.
1751 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
1752 * gnulib: Update.
1753 * maint.mk: Remove, now copied from gnulib.
1754 * examples/extexi: Add missing "(C)" in copyright statement so
1755 update-copyright can recognize it.
1756 * src/LR0.h: Likewise.
1757 * src/print.h: Likewise.
1758 * src/print_graph.h: Likewise.
1759 * src/gram.c: Add missing comma in copyright statement.
1760 * src/gram.h: Likewise.
1761
bfa018d4
JD
17622009-08-04 Joel E. Denny <jdenny@clemson.edu>
1763
1764 Fix "make distcheck".
1765 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
1766 of just calc.stamp.
1767
4521fcdf
JD
17682009-08-01 Joel E. Denny <jdenny@clemson.edu>
1769
1770 Pacify "gcc -Wunused" for the input function from Flex.
1771 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
1772 and later.
1773 * src/scan-code.l: Add "%option noinput", which I cannot find in
1774 the Flex manual, but which Flex has supported since at least as
1775 far back as 2.5.4. However, if any of our developers still use
1776 Flex 2.5.4, they'll need to stop configuring with
1777 --enable-gcc-warnings because "%option noinput" didn't work
1778 correctly until Flex 2.5.6.
1779 * src/scan-gram.l: Likewise.
1780 * src/scan-skel.l: Likewise.
1781
992e874a
AR
17822009-07-31 Alex Rozenman <rozenman@gmail.com>
1783
1784 Fix --enable-gcc-warnings problems.
1785 * src/reader.c: Adjust variable names.
1786 * src/scan-code.l: Fix prototypes and adjust names.
1787 * src/named-ref.c: Remove redundant "if".
1788
a1ed2b71
JD
17892009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1790
1791 Fix a --enable-gcc-warnings problem.
1792 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
1793 variable.
1794
cbc6a70e 17952009-07-24 Alex Rozenman <rozenman@gmail.com>
1e20ad11
AR
1796
1797 Fix some memory leaks.
1798 * src/named-ref.c: Add a pointer check (named_ref_free).
1799 * src/scan-code.l: New function (variant_table_free). Called in
1800 code_scanner_free.
1801 * src/symlist.c: Call to named_ref_free (symbol_list_free).
1802
ac9b0e95
JD
18032009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
1804
1805 Warn about character literals not of length one.
1806 * NEWS (2.5): Document.
1807 * src/scan-gram.l (INITIAL): Remove comment that we don't check
1808 the length.
1809 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
1810 * tests/input.at (Bad character literals): New test group.
1811
2de160e1
JD
18122009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
1813
1814 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
1815
cba97506
JD
18162009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
1817
1818 Some M4 cleanup in the testsuite.
1819 Suggested by Eric Blake at
1820 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
1821 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
1822 complicate the code by distinguishing between a missing value
1823 and an empty string value for an optional argument. This fix is
1824 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
1825 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
1826 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
1827 arguments are not needed because of the following changes.
1828 Fix stale comments.
1829 Bison developers should use GNU M4 and should not use
1830 POSIXLY_CORRECT when building the test suite, so do not
1831 complicate the code by avoiding $10 and above.
1832 Do not quote an empty string value for an optional argument, and
1833 do not distinguish between a missing value and an empty string
1834 value.
1835
62eb2d1b
JD
18362009-07-21 Joel E. Denny <jdenny@ces.clemson.edu>
1837
1838 * m4/m4.m4: Make it a sym link to submodules/autoconf/m4/m4.m4.
1839
620b2e36
JD
18402009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1841
1842 Revert unnecessary column realignment in --help output.
1843 Reported by Akim Demaille at
1844 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
1845 * src/getargs.c (usage): Here.
1846
cbc6a70e 18472009-07-04 Alex Rozenman <rozenman@gmail.com>
dad6544d
AR
1848
1849 Alphabetical order in src/Makefile.am.
1850 * src/Makefile.am: Adjust.
1851
cbc6a70e 18522009-07-04 Alex Rozenman <rozenman@gmail.com>
d5e8574b
AR
1853
1854 Style changes and factoring.
1855 * src/named-ref.h: Add comments.
1856 * src/parse-gram.y: Readability and style changes.
1857 * src/reader.c: Factoring: assign_named_ref function.
1858 * src/scan-code.l: Factoring and style changes. Rename
1859 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
1860 Use "unsigned" type for variant index. Improve readablity.
1861 * src/scan-gram.l: Change error messages and add comments.
1862 * src/symlist.h: symbol_list_null: New function decl.
1863 * src/symlist.c: symbol_list_null: Implement here.
1864 * tests/named-refs.at: Adjust for new error messages.
1865
ae09ec85
EB
18662009-06-29 Eric Blake <ebb9@byu.net>
1867
1868 scan-code: avoid compiler warnings
1869 * src/scan-code.l (parse_named_ref): Use correct specifiers.
1870
80d653fd
AD
18712009-06-29 Akim Demaille <demaille@gostai.com>
1872
1873 build: avoid concurrent extraction of calc++.
1874 * examples/calc++/Makefile.am (calc.stamp): New.
1875 Depend on it to create the sources of calc++ so that concurrent
1876 builds don't launch several "extexi" in parallel.
1877 Not only this is inefficient, this also builds incorrect sources
1878 with several extractions mixed together.
1879
7685e2f7
AR
18802009-06-27 Alex Rozenman <rozenman@gmail.com>
1881
1882 Implement support for named symbol references.
1883 * src/parse-gram.y: Add new syntax (named_ref.opt).
1884 * src/reader.c: Store named refs in symbol lists.
1885 * src/reader.h: New argument for symbol_append and
1886 action_append functions.
1887 * src/scan-code.h: Add new field (named_ref) into
1888 code_props data structure. Keeps named ref of midrule
1889 actions.
1890 * src/scan-code.l: Support for named refs in semantic
1891 action code. New function 'parse_named_ref'.
1892 * src/scan-gram.l: Support bracketed id.
1893 * src/symlist.c: Store named refs in symbol lists.
1894 * src/symlist.h: New field in symbol list: named_ref.
1895 * src/named-ref.h: New file, a struct for named_ref.
1896 * src/named-ref.cp: New file, named_ref_new function.
1897 * src/local.mk: Add two new files.
1898 * tests/testsuite.at: Include new test group:
1899 * tests/named-refs.at: this new file.
1900
67f8cf51
AD
19012009-06-25 Akim Demaille <demaille@gostai.com>
1902
1903 hash: check insertion for memory exhaustion.
1904 * src/uniqstr.c (uniqstr_new): New.
1905
83b66ddd
AD
19062009-06-11 Akim Demaille <demaille@gostai.com>
1907
1908 style changes.
1909 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
1910 * src/print-xml.c: Style changes.
1911 * tests/conflicts.at: Comment changes.
1912
517cb0ad
AD
19132009-06-11 Akim Demaille <demaille@gostai.com>
1914
1915 xml: beware of user strings used to give a %prec to rules.
1916 * tests/conflicts.at (%prec with user strings): New.
1917 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
1918 XML output.
1919
75c7a52a
AD
19202009-06-11 Akim Demaille <demaille@gostai.com>
1921
1922 hash: check insertion for memory exhaustion.
1923 * src/muscle-tab.c (muscle_insert, muscle_grow)
1924 * src/state.c (state_hash_insert): Check the return value of
1925 hash_insert.
1926
66ed9753
AD
19272009-06-10 Akim Demaille <demaille@gostai.com>
1928
1929 deterministic test suite.
1930 Some consistency checks on symbols are performed after all the
1931 symbols were read, by an iteration over the symbol table. This
1932 traversal is nondeterministic, which can be a problem for test
1933 cases.
1934 Avoid this.
1935 Addresses another form of nondeterminism reported by Joel E. Denny.
1936 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
1937
1938 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
1939 test in two.
1940 Use different file names for the three tests to make the
1941 maintenance easier.
1942
ed15d907
AD
19432009-06-10 Akim Demaille <demaille@gostai.com>
1944
95d176ff
AD
1945 deterministic user-token-number redeclaration errors.
1946 Address nondeterminism reported by Joel E. Denny.
1947 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
1948
1949 * src/uniqstr.h: Comment changes.
1950 * src/location.h (boundary_cmp, location_cmp): New.
1951 * src/symtab.c (user_token_number_redeclaration): New.
1952 (symbol_translation): Use it.
1953 * tests/input.at (Numbered tokens): Adjust the expected output.
1954
19552009-05-25 Akim Demaille <demaille@gostai.com>
1956
ed15d907 1957 gnulib: update.
aa50ba7b
EB
1958 * gnulib: Update to latest.
1959 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
1960 * m4/.gitignore: Regen.
1961 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
1962 Call xalloc_die on hash_insert failures.
1963 Requested by the new __warn_unused_result__ attribute of
1964 hash_insert.
ed15d907 1965
e3a33f7c
JD
19662009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1967
1968 Convert multiple variable definition warnings to complaints.
1969 * NEWS (2.5): Add a new entry for that change.
1970 * doc/bison.texinfo (Decl Summary): Update %define entry.
1971 (Bison Options): Update -D/--define/-F/--force-define entry.
1972 * src/muscle_tab.c (muscle_percent_define_insert): Implement.
1973 * src/muscle_tab.h (muscle_percent_define_insert): Update
1974 comments.
1975 * tests/input.at (`%define errors'): Update.
1976 (`%define, --define, --force-define'): Update.
1977
34d41938
JD
19782009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1979
1980 -F/--force-define and relative %define/-D/--define priorities.
1981 * NEWS (2.5): Add documentation to -D/--define entry.
1982 * build-aux/cross-options.pl: Hard-code association of
1983 --force-define with %define.
1984 * doc/bison.texinfo (Decl Summary): In %define entry,
1985 cross-reference command-line options.
1986 (Bison Options): Add documentation to -D/--define entry.
1987 (Option Cross Key): Widen column for --force-define row.
1988 * src/getargs.c (usage): Document -F/--force-define. Realign
1989 options in output.
1990 (short_options, long_options, getargs): Parse -F/--force-define,
1991 and update muscle_percent_define_insert invocation.
1992 * src/muscle_tab.h (muscle_percent_define_how): New enum type.
1993 (muscle_percent_define_insert): Add argument with that type.
1994 * src/muscle_tab.c (muscle_percent_define_insert): Implement
1995 -F/--force-define behavior and priorities.
1996 * src/parse-gram.y (prologue_declaration): Update
1997 muscle_percent_define_insert invocations.
1998 * tests/input.at (`%define, --define'): Rename to...
1999 (`%define, --define, --force-define'): ... this and extend.
2000
246c4efa
JD
20012009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
2002
2003 Update some comments to make sense for -D.
2004 * data/bison.m4 (b4_check_user_names): In header comments, say
2005 "user occurrence" instead of "grammar occurrence".
2006 * src/muscle_tab.h (muscle_percent_define_insert): Likewise.
2007 (muscle_percent_code_grow): Likewise just for consistency.
2008
531683e7
JD
20092009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
2010
2011 * data/c++.m4: Update copyright year.
2012
e7bfa8b7
JD
20132009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
2014
2015 * data/c++.m4 (b4_namespace_close): Simplify slightly.
2016
8c221795
JD
20172009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
2018
2019 Handle a trailing `:' in a user-supplied C++ namespace better.
2020 * data/c++.m4 (b4_namespace_close): Don't let it be printed
2021 among the closing braces here. This fix might make the
2022 generated code easier to debug, but otherwise it should be
2023 insignificant because a trailing `:' is a C++ error already.
2024
c8bf65f0
AD
20252009-05-19 Akim Demaille <demaille@gostai.com>
2026
2027 remove useless variable.
2028 * src/getargs.c (skeleton_arg): Remove now useless variable.
2029 Should help the compiler see that this printf-like call is sane.
2030
7ac45a46
AD
20312009-05-11 Akim Demaille <demaille@gostai.com>
2032
2033 doc: use C++ headers.
2034 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
2035 headers.
2036
601bdfab
AD
20372009-05-05 Akim Demaille <demaille@gostai.com>
2038
2039 fix hexadecimal token number support.
2040 * src/scan-gram.l: Catch incorrect ids after hexadecimal numbers.
2041
d19123e6
AD
20422009-05-05 Akim Demaille <demaille@gostai.com>
2043
2044 tests: check token numbers.
2045 * tests/input.at (Numbered tokens): New.
2046
ecdfea9a
AD
20472009-05-04 Akim Demaille <demaille@gostai.com>
2048
2049 bison: catch bad symbol names.
2050 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
2051 * tests/input.at: Adjust.
2052
43e6aea5
AD
20532009-05-04 Akim Demaille <demaille@gostai.com>
2054
2055 space changes.
2056 * src/scan-gram.l: Untabify to be robust to zealous editors.
2057
c046698e
AD
20582009-05-04 Akim Demaille <demaille@gostai.com>
2059
2060 identifiers: dashes are letters.
2061 Dashes can now start identifiers (symbols and directives).
b10dd689 2062
c046698e
AD
2063 * src/scan-gram.l ({letter}): Add dash.
2064 ({id}): Remove it.
2065 * tests/input.at (Symbols): Adjust.
2066 Remove stray comment.
2067 * tests/regression.at (Invalid inputs): Adjust error message.
2068 * doc/bison.texinfo (Symbols): Update.
2069
966aba65
JD
20702009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
2071
2072 Declare %code to be a permanent feature.
2073 * NEWS (2.4.2): Here.
2074 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
2075 experimental.
2076 (Decl Summary): Likewise.
2077
812775a0
JD
20782009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
2079
2080 Convert underscores to dashes in some %define variable names.
2081 For now, just api.push-pull and lr.keep-unreachable-states.
2082 Maintain old names for backward compatibility.
2083 * NEWS (2.5): Document.
2084 * data/c.m4 (b4_identification): Update comment.
2085 * data/yacc.c: Update access.
2086 * doc/bison.texinfo: Update.
2087 * etc/bench.pl.in (bench_grammar): Update use.
2088 * src/files.c (tr): Move to...
2089 * src/getargs.c, src/getargs.h (tr): ... here because I can't
2090 think of a better place to expose it. My logic is that, for all
2091 uses of tr so far, command-line arguments can be involved, and
2092 getargs.h is already included.
2093 * src/main.c (main): Update access.
2094 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
2095 variable names to new variable names before assigning value.
2096 * src/reader.c (reader): Update setting default.
2097 * tests/calc.at: Update uses.
2098 * tests/conflicts.at (Unreachable States After Conflict
2099 Resolution): Update use.
2100 * tests/input.at (%define enum variables): Update use.
2101 (%define backward compatibility): New test group.
2102 * tests/push.at: Update uses.
2103 * tests/reduce.at: Update uses.
2104 * tests/torture.at: Update uses.
2105
1c4aa81d
JD
21062009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
2107
2108 Set all front-end %define defaults in one place.
2109 * src/main.c (main): Move lr.keep_unreachable_states default...
2110 * src/reader.c (reader): ... to here.
2111
1d0f55cc
JD
21122009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
2113
2114 Rename lr.default_reductions to lr.default-reductions.
2115 * NEWS (2.5): Here.
2116 * doc/bison.texinfo: Here.
2117 * src/lalr.c (initialize_LA): Here.
2118 * src/print.c (print_reductions): Here.
2119 * src/reader.c (reader): Here.
2120 * src/tables.c (action_row): Here.
2121 * tests/input.at (%define enum variables): Here.
2122 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
2123
0b593457
JD
21242009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
2125
2126 Pacify ./configure --enable-gcc-warnings.
2127 * tests/input.at (Symbols): Prototype yyerror and yylex.
2128
0939aa2d
AD
21292009-04-21 Akim Demaille <demaille@gostai.com>
2130
2131 tests: check the use of dashes and periods in symbols.
2132 * tests/input.at (Symbol): New test group.
2133
0b593457 21342009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
ae618dcc
JD
2135
2136 Document how `%define "var" "value"' is not M4-friendly.
2137 * src/parse-gram.y (variable): In comments here.
2138
0b593457 21392009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
6789b8bd
JD
2140
2141 Add copyright updates missed during previous cherry pick.
2142 * src/output.c: Here.
2143 * src/parse-gram.y: Here.
2144 * src/scan-gram.l: Here.
2145
663ce7bb
AD
21462009-04-20 Akim Demaille <demaille@gostai.com>
2147
2148 variables: accept dashes.
2149 * src/scan-gram.l ({id}): Also accept dashes after the initial
2150 letter.
2151 ({directive}): Use {id}.
2152 * src/parse-gram.y: Comment and formatting changes.
2153 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
2154 symbols.
2155 * src/complain.h, src/complain.c (yacc_at): New.
2156 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
2157 symbol names.
2158 * src/output.c (token_definitions_output): Do not #define token
2159 names with dashes.
2160
379261b3
JD
21612009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
2162
2163 Clean up recent patches a little.
2164 Reported by Akim Demaille.
2165 * doc/bison.texinfo (Understanding): Fix typos.
2166 * src/print.c (print_reductions): Don't use negated variable.
2167
25029e16
JD
21682009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
2169
2170 List accepted values for a %define enum variable with an invalid value.
2171 Suggested by Akim Demaille at
2172 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
2173 * data/bison.m4 (_b4_percent_define_check_values): Implement.
2174 * src/muscle_tab.c (muscle_percent_define_check_values): Implement.
2175 * tests/input.at (%define lr.default_reductions invalid values): Merge
2176 into...
2177 (%define enum variables): ... here, and update output.
2178
620b5727
JD
21792009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
2180
2181 Rename "default rule" to "default reduction".
2182 This includes changing variable names in code, changing
2183 comments, and renaming %define lr.default_rules to %define
2184 lr.default_reductions.
2185 * NEWS (2.5): Update IELR documentation.
2186 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c:
2187 Adjust YYDEFACT and yydefact_ documentation.
2188 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
2189 and lr.type documentation. Make some other wording
2190 improvements.
2191 (Glossary): Adjust cross-references and Default Reduction
2192 definition.
2193 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
2194 Remove a confusing comment pointed out by Akim Demaille.
2195 (initialize_LA): Adjust code.
2196 * src/print-xml.c (print_reductions): Adjust code.
2197 * src/print.c (print_reductions): Adjust code.
2198 * src/reader.c (reader): Adjust code.
2199 * src/tables.c (action_row): Adjust code.
2200 (token_actions): Adjust code.
2201 * src/tables.h: Adjust YYDEFACT documentation.
2202 * tests/input.at (%define lr.default_rules invalid values):
2203 Rename test group to...
2204 (%define lr.default_reductions invalid values): ... this, and
2205 update grammar file and expected output.
2206 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
2207 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
2208
34a6c2d1
JD
22092009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2210
2211 Document %define lr.type and lr.default_rules.
2212 * NEWS (2.5): Add an entry.
2213 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
2214 besides just LALR(1) and GLR(1).
2215 * doc/bison.texinfo (Introduction): Likewise.
2216 (Language and Grammar): Bison is no longer limited to LALR(1)
2217 restrictions.
2218 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
2219 when trying to distinguish from GLR. Talk about LR(1) grammars
2220 rather than LALR(1) grammars.
2221 (Decl Summary): In %define api.push_pull entry, say it applies
2222 to deterministic parsers in C rather than LALR(1) parsers in C.
2223 Add lr.default_rules entry.
2224 Add lr.type entry.
2225 (Mystery Conflicts): Bison is no longer limited to LALR(1)
2226 restrictions.
2227 (Generalized LR Parsing): Same changes as for the previous GLR
2228 section.
2229 (Memory Management): Say deterministic rather than LALR(1).
2230 (Understanding): Correct some bison output.
2231 Index discussion of "accepting state".
2232 Say deterministic rather than LALR(1).
2233 (Bison Options): In --yacc entry, say deterministic rather than
2234 LALR(1).
2235 In --report, --graph, and --xml entries, just don't mention
2236 LALR(1).
2237 (C++ Parsers): Say deterministic rather than LALR(1).
2238 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
2239 (Glossary): Add Accepting State, Consistent State, Default Rule,
2240 and IELR(1) definitions.
2241 In Generalized LR (GLR) definition, make same changes as in
2242 previous GLR sections.
2243 In LALR(1) definition, say Bison uses LALR(1) by default rather
2244 than implying Bison is limited to LALR(1).
2245 (LocalWords): Add IELR.
2246
f805dfcb
JD
22472009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2248
2249 Finish implementing %define lr.type.
2250 Its value can be "LALR", "IELR", or "canonical LR".
2251 * lib/timevar.def (TV_IELR_PHASE1): New var.
2252 (TV_IELR_PHASE2): New var.
2253 (TV_IELR_PHASE3): New var.
2254 (TV_IELR_PHASE4): New var.
2255 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
2256 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
2257 Sbitset.h, ielr.h, and ielr.c.
2258 * src/getargs.h, src/getargs.c (enum trace, trace_args,
2259 trace_types): Add trace_ielr.
2260 * src/lalr.h, src/lalr.c (ngotos): Export it.
2261 (F): Rename to...
2262 (goto_follows): ... this, update all uses, and export it.
2263 (set_goto_map): Export it.
2264 (map_goto): Export it.
2265 (compute_lookahead_tokens): Don't free goto_follows yet. Now
2266 handled in ielr.
2267 (initialize_LA): Export it. Move lookback allocation to...
2268 (lalr): ... here because, for canonical LR, initialize_LA must
2269 be invoked but lookback and much of the rest of LALR isn't
2270 needed.
2271 * main.c (main): Instead of lalr, invoke ielr, which invokes
2272 lalr.
2273 * src/reader.c (reader): Default lr.type to "LALR".
2274 Default lr.default_rules to "accepting" if lr.type is "canonical
2275 LR". Leave the default as "all" otherwise.
2276 Check for a valid lr.type value.
2277 * src/state.h, src/state.c (struct state_list): Add state_list
2278 member.
2279 (state_new): Initialize state_list member to NULL.
2280 (state_new_isocore): New function, exported.
2281 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
2282 exercises all values of lr.type.
2283 (GNU AWK Grammar): Rename test group to...
2284 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
2285 AT_TEST_EXISTING_GRAMMAR.
2286 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
2287 (GNU pic Grammar): Rename test group to...
2288 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
2289 AT_TEST_EXISTING_GRAMMAR.
2290 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
2291 all values of lr.type.
2292 (Single State Split): New test groups using AT_TEST_LR_TYPE.
2293 (Lane Split): Likewise.
2294 (Complex Lane Split): Likewise.
2295 (Split During Added Lookahead Propagation): Likewise.
2296
166366b2
JD
22972009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2298
2299 Add new files for IELR and canonical LR implementation.
2300 * src/AnnotationList.c: New.
2301 * src/AnnotationList.h: New.
2302 * src/InadequacyList.c: New.
2303 * src/InadequacyList.h: New.
2304 * src/Sbitset.c: New.
2305 * src/Sbitset.h: New.
2306 * src/ielr.c: New.
2307 * src/ielr.h: New.
2308
03c07b03
JD
23092009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
2310
2311 Implement %define lr.default_rules.
2312 Its value describes the states that are permitted to contain
2313 default rules: "all", "consistent", or "accepting".
2314 * src/reader.c (reader): Default lr.default_rules to "all".
2315 Check for a valid lr.default_rules value.
2316 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
2317 is "accepting", then only mark the accepting state as
2318 consistent.
2319 (initialize_LA): Tell state_lookahead_tokens_count whether
2320 lr.default_rules is "accepting".
2321 * src/tables.c (action_row): If lr.default_rules is not "all",
2322 then disable default rules in inconsistent states.
2323 * src/print.c (print_reductions): Use this opportunity to
2324 perform some assertions about whether lr.default_rules was
2325 obeyed correctly.
2326 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
2327 helps with checking the parser tables for a grammar.
2328 * tests/input.at (%define lr.default_rules invalid values): New
2329 test group.
2330 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
2331 AT_TEST_TABLES_AND_PARSE.
2332 (`no %define lr.default_rules'): New test group generated by
2333 AT_TEST_LR_DEFAULT_RULES.
2334 (`%define lr.default_rules "all"'): Likewise.
2335 (`%define lr.default_rules "consistent"'): Likewise.
2336 (`%define lr.default_rules "accepting"'): Likewise.
2337
44c124a3
AD
23382009-04-20 Akim Demaille <demaille@gostai.com>
2339
2340 Consistently refer to Yacc, not YACC.
2341 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
2342
42660736
JD
23432009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
2344
2345 Pacify make maintainer-check-posix.
2346 * tests/input.at (%define, --define): Move bison command-line
2347 options before grammar file name.
2348
a2d05674
JD
23492009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
2350
2351 Document semicolon warnings.
2352 * NEWS (2.5): Here.
2353
c4fae1ef
AD
23542008-12-08 Akim Demaille <demaille@gostai.com>
2355
2356 Fix portability issue in the test suite.
2357 * tests/local.at (AT_MATCHES_CHECK): New.
2358 Based on Perl instead of Sed. Sed has too many portability
2359 pitfalls, not ever Sed is GNU Sed.
2360 * tests/actions.at (Fix user actions without a trailing semicolon):
2361 Use it.
2362
42f4393a
DJ
23632008-12-07 Di-an Jan <dianj@freeshell.org>
2364
2365 Implement the FIXME that ends an user action with a semicolon
2366 if it seems necessary.
2367 * src/scan-code.l (flex rules section): Flag cpp directive from
2368 any `#' to the first unescaped end-of-line. Semicolon is not
2369 needed after `;', `{', '}', or cpp directives and is needed after
2370 any other token (whitespaces and comments have no effect).
2371 * tests/actions.at (Fix user actions without a trailing semicolon):
2372 New test.
2373 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
2374 to make user actions complete statements.
2375 Adjust column numbers in error messages.
2376 * tests/regression.at (Fix user actions without a trailing semicolon):
2377 Remove. Covered by new test.
2378
bd5df716
AD
23792009-04-14 Akim Demaille <demaille@gostai.com>
2380
2381 doc: minor fixes.
2382 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
2383 (Table of Symbols): Remove duplicate entry for %debug.
2384
7ba0d59d
EB
23852009-04-10 Eric Blake <ebb9@byu.net>
2386
2387 submodules: update to latest
2388 * submodules/autoconf: Use latest upstream Autoconf.
2389
b4d71a96
EB
23902009-04-06 Eric Blake <ebb9@byu.net>
2391
2392 Work around autoconf 2.63b bug in testsuite.
2393 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
2394 autoconf bug related to # in test.
2395
4ecd3681
JD
23962009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2397
2398 * NEWS (2.5): Describe new -D/--define feature.
2399
c65e5292
AD
24002008-11-10 Akim Demaille <demaille@gostai.com>
2401
2402 --trace=muscles
2403 * src/getargs.h, src/getargs.c (trace_muscle): New.
2404 (trace_types, trace_args): Support it.
2405 * src/output.c (output_skeleton): Use it.
2406
96002de2
AD
24072008-11-10 Akim Demaille <demaille@gostai.com>
2408
2409 muscles_output.
2410 * src/output.c (muscles_output): New, extracted from...
2411 (output_skeleton): here.
2412 Adjust.
2413
fadb13b5
AD
24142008-11-21 Akim Demaille <demaille@gostai.com>
2415
2416 Display the changes in cross-options.texi.
2417 * build-aux/cross-options.pl ($sep): New, to separate items.
2418 * doc/Makefile.am ($(srcdir)/cross-options.texi): Use diff to display
2419 the changes.
2420
72183df4
DJ
24212008-11-20 Di-an Jan <dianj@freeshell.org>
2422
2423 Improves options in the manual.
2424 * doc/bison.texinfo (-g, -x): Add space before argument.
2425 (Option Cross Key): Implement FIXME: listing directives also.
2426 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
2427 (Short Option): Special case -d. Put arguments inside @option.
fadb13b5 2428 (Bison Directive): Add column, automatically extracted from
72183df4
DJ
2429 src/scan-gram.l (actual name passed as the first argument)
2430 with special case for %define.
2431 * doc/Makefile.am (doc/cross-options.texi): Pass src/scan-gram.l
2432 to build-aux/cross-options.pl.
2433 * src/getargs.c (usage): Document limitations of cross-options.pl.
2434 * src/scan-gram.l: Likewise.
2435
e80b068c
AD
24362009-02-25 Akim Demaille <demaille@gostai.com>
2437
2438 Copyright years.
2439 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
2440
e3ee30b8
AD
24412008-12-08 Akim Demaille <demaille@gostai.com>
2442
2443 Install autoconf as a submodule to get m4sugar.
2444 * .gitmodules: Add submodules/autoconf.
2445 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
2446 submodules/autoconf.
2447
c4eb1e84
JD
24482008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2449
2450 Simplify last patch slightly.
2451 * src/getargs.c (getargs): Here.
2452
10fa0146
JD
24532008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2454
2455 Fix last warning from --enable-gcc-warnings.
2456 * src/getargs.c (getargs): Don't assign const address to non-const
2457 pointer.
2458
6f5be1ab
DJ
24592008-11-17 Di-an Jan <dianj@freeshell.org>
2460
2461 Handle --enable-gcc-warnings.
2462 * src/getargs.c (command_line_location): Set parameters to void.
2463
11c4e57d
AD
24642008-11-11 Akim Demaille <demaille@gostai.com>
2465
2466 AT_FULL_COMPILE.
2467 * tests/actions.at, tests/regression.at: Use it.
2468
e186a284
AD
24692008-11-07 Akim Demaille <demaille@gostai.com>
2470
2471 Pass command line location to skeleton_arg and language_argmatch.
2472 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
2473 The location argument is now mandatory.
2474 Adjust all dependencies.
2475 (getargs): Use command_line_location.
2476
e14c6831
AD
24772008-11-07 Akim Demaille <demaille@gostai.com>
2478
2479 -D, --define.
2480 * src/getargs.c (usage): Document -D.
2481 Fix help string for --locations.
2482 (command_line_location): New.
2483 (short_options, long_options, getargs): Support -D, --define.
2484 (getargs): Move -d support at the right place.
2485 * doc/bison.texinfo (Bison Options): Update.
2486 * tests/input.at (%define, --define): New.
2487
75c21b61
AD
24882008-11-07 Akim Demaille <demaille@gostai.com>
2489
2490 Initialize the muscle table before parsing the command line.
2491 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
2492 (getargs): Define file_name.
2493 * src/main.c (main): Initialize muscle_tab before calling
2494 getargs.
2495 * src/muscle_tab.c (muscle_init): No longer define file_name, as
2496 its value is not available yet.
2497
33d2a860
AD
24982008-11-09 Akim Demaille <demaille@gostai.com>
2499
2500 Require the generation of parse-gram.output.
2501 * src/Makefile.am (YACC): Pass --report=all.
2502
006faedf
JD
25032009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2504
2505 * NEWS (2.5): New stub.
2506
ecd1b61c
JD
25072009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2508
2509 Fix options documentation.
2510 * build-aux/cross-options.pl: As in --help output, write optional
2511 arguments as [=ARG] not =[ARG].
2512 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
2513
f67c4037
AD
25142008-11-07 Akim Demaille <demaille@gostai.com>
2515
2516 Fix --help.
2517 * src/getargs.c (usage): Fix help string for -W.
2518
0213d651
AD
25192008-11-07 Akim Demaille <demaille@gostai.com>
2520
2521 Handle more general types of option arguments.
2522 * build-aux/cross-options.pl: The argument ends at the first
2523 space, not the first non-symbol character.
2524 Use @var for each word appearing the argument description.
2525
c19178bf
JD
25262009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
2527
2528 Remove spurious initial empty lines.
2529 * data/location.cc: End the @output lines with an @.
2530
0d2b2ab0
AD
25312008-11-04 Akim Demaille <demaille@gostai.com>
2532
2533 Remove spurious initial empty lines.
2534 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
2535 * data/yacc.c: End the @output lines with an @.
2536
8ba62e3e
JD
25372009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
2538
2539 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
2540 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
2541 requirements for a correct m4 are stricter.
2542 * m4/m4.m4: Replace with Autoconf 2.63's m4/m4.m4.
2543 * configure.ac: Update to use AC_PROG_GNU_M4.
2544 Reported by Eric Blake.
2545
5bc993d9
JD
25462009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2547
2548 Help with updating web manual.
2549 * HACKING: Incorporate instructions from gnulib/doc/README.
2550 * bootstrap.conf (gnulib_modules): Add gendocs.
2551
580c075d
JD
25522009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2553
2554 Fix strange %define locations for default values.
2555 Reported by Akim Demaille at
2556 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
2557 and discussed again starting at
2558 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
2559 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
2560 because location information is bogus.
2561 Use angle brackets to delimit fake file name because square brackets
2562 look like underexpanded m4. Choose a better fake file name.
2563 Use negative line numbers.
2564 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
2565 * src/location.c (location_print): If line for a boundary is negative,
2566 only print that boundary's file name.
2567 * src/location.h: Document that.
2568 * tests/skeletons.at (%define Boolean variables: invalid skeleton
2569 defaults): Update output.
2570
5d3a1ecb
AD
25712008-11-07 Akim Demaille <demaille@gostai.com>
2572
2573 Locations without columns for command line arguments.
2574 * src/location.c (location_print): Don't display negative columns.
2575 * src/location.h: Document this.
2576
015e86a7
JD
25772009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
2578
2579 Add reminder about uploading public key to keys.gnupg.net.
2580 * HACKING (Release Procedure): Here.
2581
c1455bab
AD
25822009-03-31 Akim Demaille <demaille@gostai.com>
2583
2584 bootstrap: --help to stdout.
2585 * bootstrap (usage): Don't send --help to stderr.
2586 Use a here doc instead of a long string.
2587
2075a82a
AD
25882009-03-31 Akim Demaille <demaille@gostai.com>
2589
2590 bootstrap: README-hacking no longer exists
2591 * bootstrap (checkout_only_file): Set to HACKING.
2592
26fccd4d
AD
25932009-03-26 Akim Demaille <demaille@gostai.com>
2594
2595 doc: merge HACKING and README-hacking.
2596 Two files is confusing.
2597 Reported by Alexandre Duret-Lutz.
5bc993d9 2598
26fccd4d
AD
2599 * README-hacking: Merge into...
2600 * HACKING (Working from the repository): here.
2601
6469c4d7
AD
26022009-03-26 Akim Demaille <demaille@gostai.com>
2603
2604 doc: update README-hacking.
2605 * README-hacking: We now use git and git submodules.
2606 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
2607
b328890a
AD
26082009-03-26 Akim Demaille <demaille@gostai.com>
2609
2610 lalr1.cc: avoid GCC 4.3 warnings.
2611 GCC 4.3 now warns about "a || b && c" and asks for explicit
2612 parentheses.
2613 Reported by Alexandre Duret-Lutz.
2614 * data/location.cc: Update copyright years.
2615 (Position::operator==): Use parens to make precedence explicit.
2616 Compare lines and columns first, as they are more likely to be
2617 different, and they are faster to compare.
2618
f3079439
AD
26192009-03-26 Akim Demaille <demaille@gostai.com>
2620
2621 gnulib: update.
2622 * gnulib: Update to latest.
2623 * lib/Makefile.am (AM_CPPFLAGS): It is now defined by gnulib, so
2624 use +=.
2625
8defe11b
AD
26262009-01-08 Akim Demaille <demaille@gostai.com>
2627
2628 Fix grep portability issues.
2629 Grep on Solaris does not support -q.
2630 Reported by Summum Bonum.
5bc993d9 2631
8defe11b
AD
2632 * NEWS: Add a stub for 2.4.2.
2633 * THANKS: Add Summum Bonum.
2634 * tests/atlocal.in (EGREP): New.
2635 (CC, CXX, XSLTPROC): Make it possible to override them via
2636 envvars.
2637 * tests/java.at: Use $EGREP instead of egrep.
2638 Use AT_CHECK's ignore instead of grep's -q.
2639
41930e7a
JD
26402008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
2641
2642 Version 2.4.1.
2643 * NEWS: Set version and date.
2644 * lib/Makefile.am: Update copyright year.
2645 * tests/atlocal.in: Update copyright year.
2646
d07932ef
JD
26472008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
2648
2649 Semicolon feature removal is not about future language support.
2650 * NEWS: The semicolon feature is no longer active for newer languages,
2651 so don't claim that it causes trouble for them.
2652
0364b334
JD
26532008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
2654
2655 * gnulib: Update submodule to HEAD.
2656
876fd835
AD
26572008-12-09 Akim Demaille <demaille@gostai.com>
2658
2659 Update data/README.
2660 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
2661
bee1df15
EB
26622008-12-05 Eric Blake <ebb9@byu.net>
2663
2664 Build testsuite with newer autoconf.
2665 * tests/output.at (m4_expand): Don't override in newer autoconf,
2666 where the underlying implementation changed.
2667 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
2668 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
2669 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
2670 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
2671 since some of them contain unbalanced ')'.
2672
7e6d1e22
JD
26732008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
2674
2675 * NEWS: Clarify a little.
2676
a957d06c
JD
26772008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
2678
2679 * NEWS: Update for recent changes.
2680
462503f8
JD
26812008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
2682
2683 Fix unexpanded macros in GLR defines file.
2684 Reported by Csaba Raduly at
2685 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
2686 * THANKS (Csaba Raduly): Add.
2687 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
2688 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
2689 lexer in a separate module that includes the defines file.
2690 (AT_CHECK_CALC): Use AT_FULL_COMPILE and request compilation of lexer
2691 source.
2692 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
2693 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
2694 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
2695 (AT_DATA_SOURCE_PROLOGUE): New.
2696 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
2697 (AT_DATA_SOURCE): New.
2698 (AT_FULL_COMPILE): New, copied from master branch and extended to
2699 support an additional source file.
2700
bf151b75
JD
27012008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2702
2703 Don't let maintainer-*-check targets force a version update.
2704 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
2705 handled.
2706
f56274a8
DJ
27072008-11-17 Di-an Jan <dianj@freeshell.org>
2708
2709 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
2710 Align menus. Adjust word wrapping. Use node names for menu names.
2711 (Examples): Don't abbreviate node names.
2712 (LocalWords): Remove abbreviations.
2713 (Copying): Make description a sentence.
bf151b75 2714 (Java Action Features): Remove period to match the rest of menu.
f56274a8 2715
b5775a81
PB
27162008-11-11 Paolo Bonzini <bonzini@gnu.org>
2717
2718 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
2719 * configure.ac: Adjust usage.
2720 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
2721 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
2722 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
2723
7ed73f82
JD
27242008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
2725
2726 Don't add a semicolon to actions for %skeleton or %language.
2727 It breaks Java test cases as reported by Akim Demaille.
2728 * src/scan-code.l: Implement.
2729
4b1ebc49
JD
27302008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
2731
2732 Clean up %skeleton and %language priority implementation.
2733 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
2734 remove static qualifier because others will soon need to see it.
2735 (language_prio): Likewise.
2736 (getargs): Use command_line_prio rather than 0.
2737 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
2738 enum fields.
2739 (skeleton_prio): Extern it.
2740 (language_prio): Extern it.
2741 * src/parse-gram.y: Use grammar_prio rather than 1.
2742
738cde3e
AD
27432008-11-04 Akim Demaille <demaille@gostai.com>
2744
2745 * NEWS: Mention the trailing semicolon in action.
2746
d6fb461d
AD
27472008-11-04 Akim Demaille <demaille@gostai.com>
2748
2749 Reformat NEWS.
2750 * NEWS: Use more outline-mode markup.
2751 Suggested by Jim Meyering.
2752
14da0cdd
JD
27532008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
2754
2755 Fix user actions without a trailing semicolon.
2756 Reported by Sergei Steshenko at
2757 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
2758 * THANKS (Sergei Steshenko): Add.
2759 * src/scan-code.l (SC_RULE_ACTION): Fix it.
2760 * tests/regression.at (Fix user actions without a trailing semicolon):
2761 New test case.
2762
c9ba9e59
JD
27632008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2764
2765 Initiate further development.
2766 * NEWS: Create an empty section for new entries.
2767 * gnulib: Update submodule to HEAD.
2768
bfb40910
JD
27692008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2770
2771 * NEWS: Version 2.4.
2772
241fda7a
JD
27732008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2774
2775 Prepare for next release.
2776 * NEWS: Briefly mention changes since 2.3b.
2777 * README: Say GNU m4 1.4.6, which we've been requiring in release
2778 announcements already, not 1.4.3, which breaks the build.
2779
ed4d67dc
JD
27802008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2781
2782 Say %language is experimental.
2783 We're thinking of extending it's effect on output file naming. See the
2784 thread at
2785 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
2786 * NEWS: Say it's experimental.
2787 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
2788 recommend it over %skeleton for now.
2789 (Bison Options): Likewise.
2790 (C++ Bison Interface): Use %skeleton not %language.
2791 (Calc++ Parser): Use %skeleton not %language.
2792 * src/getargs.c (usage): Say it's experimental.
2793
e254a580
DJ
27942008-11-01 Di-an Jan <dianj@freeshell.org>
2795 Paolo Bonzini <bonzini@gnu.org>
2796
2797 Support all Java parser class modifiers.
2798 * data/java.m4 (b4_percent_define_get3): New.
2799 (b4_final_if, b4_strictfp_if): New.
2800 * data/lalr1.java (final, strictfp, extends, implements): Support.
2801 * doc/bison.texinfo (final, strictfp, extends, implements): Add
2802 documentation.
2803 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
2804 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
2805 (AT_CHECK_JAVA_GREP): New.
2806 (Java parser class modifiers): New test.
2807 (Java parser class extends and implements): New test.
2808
2809 Model exception propagation better with throws and lex_throws.
2810 * data/java.m4 (b4_list2): New.
2811 (throws): Change default.
2812 * data/lalr1.java (yyaction): Add throws.
2813 (parse): Add lex_throws in addition to throws.
2814 * doc/bison.texinfo (throws, lex_throws): Add documentation.
2815 * tests/java.at (Java throws specifications): New test.
2816
2817 Improve documentation for Java parsers.
2818 * doc/bison.texinfo (Java Parsers): Add subsections.
2819 Don't quote first argument of %define.
2820 (Java Bison Interface): Document output files. Move documentation
2821 of parser class and merge into Java Parser Interface. Document
2822 features that error out. Document directives with no effect.
2823 Move note about Javadoc higher.
2824 (Java Semantic Values): Explicitly mention stype.
2825 Document that generic types cannot be used.
2826 (Java Location Values): Use @deftypeivar. Document constructors.
2827 Correct return value for toString.
2828 (Java Parser Interface): List undocumented constants/fields.
2829 Move documentation of fields added by %parse-param closer to list
2830 of members. Document that token names are added as fields.
2831 Document constructors accurately. Remove error method.
2832 (Java Scanner Interface): Move note on %pure-parser to Java Bison
2833 Interface. Describe %code lexer and yylex accutately.
2834 Remove documentation that does not match the code.
2835 (Java Action Features): New.
2836 (Java Differences): Add reference. Add item on semantic values.
2837 Add note about @{ ... @}. Clarify %% epilogue placement.
2838 (Java Declarations Summary): New.
2839
2840 Fix Java skeleton.
2841 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
2842 (b4_remove_comma): Quote test argument.
2843 (b4_identification): Remove "bison" field.
2844 * tests/java.at (Java parser class and package names): New test.
2845 (Java %parse-param and %lex-param): New test.
2846 (Java stype, position_class and location_class): New test.
2847
f259e4e6
PB
28482008-10-31 Di-an Jan <dianj@freeshell.org>
2849
2850 * data/lalr1.jave: Update copyright years.
2851 (YYParser): Correct name of "generated from" file in Javadoc:
2852 use b4_file_name instead of @ofile@.
2853 (Location constructor): Correct Javadoc parameter name.
2854 (yylloc): Add missing opening m4 quote after b4_location_if.
2855 This removes a stray [ in the Javadoc of Lexer.getStartPos.
2856 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
2857 (YYParser constructor): Correct Javadoc parameter name.
2858
cae5057f
JD
28592008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
2860
2861 Always put auxiliary code files in the same dir as other output files.
2862 * src/files.c (compute_file_name_parts): When the user specifies
2863 --output but not --file-prefix, extract the directory prefix from the
2864 file prefix not from the grammar file name. This affects the location
2865 of files like location.hh generated by the C++ skeleton. The includes
2866 in the other output files require this fix.
2867 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
2868 for expected output files.
2869 (Output files): Add a test for the above.
2870
4af432ba
JD
28712008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
2872
2873 * gnulib: Update submodule to HEAD.
2874
e26d4e43
JD
28752008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2876
2877 Update copyright year.
2878 * src/files.c: Here.
2879
c0ee9e21
DJ
28802008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
2881
2882 Don't overwrite the input file.
2883 * src/files.c (output_file_name_check): Fatal error if using input file
2884 for output.
2885 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
2886 argument.
2887 (Conflicting output files): Add test.
2888
482dc52f
AD
28892008-10-28 Akim Demaille <demaille@gostai.com>
2890
2891 Space changes.
2892 * data/lalr1.cc: Formatting changes.
2893
52cbbe84
AD
28942008-10-28 Akim Demaille <demaille@gostai.com>
2895
2896 Don't define debugging functions when !YYDEBUG.
2897 * data/lalr1.cc (debug_stream, set_debug_stream)
2898 (debug_level_type, debug_level, set_debug_level): Don't
2899 declare them when YYDEBUG is not defined.
2900 The implementation are already YYDEBUG-aware.
2901
0925d5bf
AD
29022008-10-28 Akim Demaille <demaille@gostai.com>
2903
2904 Prefer "continue" for empty loop bodies.
2905 * etc/bench.pl.in: Use "continue" instead of {}.
2906
cf98343c
AD
29072008-10-28 Akim Demaille <demaille@gostai.com>
2908
2909 Space and comments changes.
2910 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
2911 * data/c.m4, data/lalr1.cc: Space changes.
2912
9f467b7d
AD
29132008-10-28 Akim Demaille <demaille@gostai.com>
2914
2915 Make gnulib a submodule.
2916 * gnulib: New.
2917 * .gitmodules (gnulib): New.
2918
0f0e1ace
JD
29192008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
2920
2921 Fix yyerror_range for user-defined location type in C++. Reported by
2922 Georg Sauthoff at
2923 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
2924 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
2925 * THANKS (Georg Sauthoff): Add.
2926
548e2104
JD
29272008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
2928
2929 Update several administrative files mainly to facilitate releasing.
2930 * HACKING (Administrivia): Make the git-merge-changelog notes more
2931 helpful.
2932 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
2933 (Release Procedure): Update for git and add numerous details that were
2934 previously missing.
2935 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
2936 * maint.mk (announcement): Don't list bison as a bootstrap tool so
2937 that announcements don't claim we bootstrapped with whatever bison
2938 happened to be in PATH. Add flex as a bootstrap tool.
2939 * Makefile.maint: Remove, previously replaced by maint.mk.
2940 * Makefile.cfg: Remove, and migrate settings to...
2941 * cfg.mk: ... here for the sake of `make announcement'.
2942 * bootstrap.conf (gnulib_modules): Add announce-gen.
2943 * README: Say GNU Bison instead of just Bison. Suggested by Karl
2944 Berry.
2945
ddf17a6e
PB
29462008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
2947
2948 Small but important bugfixes for the Java skeleton.
2949 * data/lalr1.java (yyerror): Change Location to b4_location_type.
2950 (yy_symbol_print): Call toString on yyvaluep.
2951
e1145ad8
AD
29522008-08-29 Akim Demaille <demaille@gostai.com>
2953
2954 Clarify UPDATED use.
bee1df15 2955 * doc/bison.texinfo: It refers to the last edition of this file,
e1145ad8 2956 not to the release date of Bison.
bee1df15 2957 Reported by Joel E. Denny.
e1145ad8 2958
0df72d78
AD
29592008-08-29 Akim Demaille <demaille@gostai.com>
2960
2961 * README: Update FAQ pointer.
2962 Reported by Joel E. Denny.
2963
9a90b6bb
EB
29642008-08-27 Eric Blake <ebb9@byu.net>
2965
2966 Resync m4sugar from autoconf.
2967 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
2968 (m4_init): Adjust to latest m4.git changes.
2969 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
2970 effects.
2971 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
2972 (_m4_list_cmp): Reduce side effects.
2973
65015668
AD
29742008-08-27 Akim Demaille <demaille@gostai.com>
2975
2976 Check yyerrok in calc.at.
bee1df15
EB
2977 * tests/calc.at (calc.y): Use yyerrok on "( error )".
2978 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
2979 expected.
65015668 2980
98e26a92
AD
29812008-08-27 Akim Demaille <demaille@gostai.com>
2982
2983 Support yyerrok in lalr1.cc.
2984 YYBACKUP is still to import back into lalr1.cc.
bee1df15 2985 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
98e26a92 2986
86c0e784
JD
29872008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
2988
2989 For maintainer-check*, don't recompile for a $(VERSION) update.
2990 * cfg.mk: New file.
2991 (_is-dist-target): Override the one in GNUmakefile.
2992 * Makefile.am (EXTRA_DIST): Add cfg.mk.
2993
88511166
JD
29942008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
2995
2996 Update for recent change to gnulib.
2997 * src/parse-gram.y: Don't include strverscmp.h. It comes from
2998 string.h now.
2999
6bbb2ed5
EB
30002008-08-15 Eric Blake <ebb9@byu.net>
3001
d67c52e8
EB
3002 Remaining m4sugar merge from autoconf.
3003 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
3004 * data/m4sugar/foreach.m4: New file, copied from autoconf.
3005 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
3006 * src/output.c (output_skeleton): Tell m4 how to find it.
3007
6bbb2ed5
EB
3008 Partial m4sugar merge from autoconf: m4_map.
3009 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
3010 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
3011 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
3012 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
3013 for empty list.
3014 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
3015 Likewise.
3016 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
3017 declares it.
3018
8dce3875
JD
30192008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
3020
3021 Keep .version and PACKAGE_VERSION in sync.
3022 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
3023 dependency, and add comments justifying this in more detail. Discussed
3024 starting at
3025 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
3026
882a1fbf
EB
30272008-08-06 Eric Blake <ebb9@byu.net>
3028
a3764451
EB
3029 Partial m4sugar merge from autoconf: m4_shiftn.
3030 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
3031 (m4_shift2, m4_shift3): New macros.
3032 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
3033 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
3034 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
3035 * data/java.m4 (b4_remove_comma): Likewise.
3036
882a1fbf
EB
3037 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
3038 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
3039 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
3040 (m4_init): Consolidate wrapped text into single m4_wrap.
3041 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
3042 in wrapped text.
3043
a30e920d
EB
30442008-08-05 Eric Blake <ebb9@byu.net>
3045
dfcc5959
EB
3046 Partial m4sugar merge from autoconf: builtins, version.m4.
3047 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
3048 (m4_prepend): Remove, as it is unused and inherently quadratic,
3049 whereas m4_append is linear in newer m4.
3050 (m4_mkstemp): New builtin.
3051 (m4_symbols): Make rename conditional.
3052 (m4_version_prereq): Ensure fatal error if used in bison, which
3053 intentionally lacks version.m4.
3054
a30e920d
EB
3055 Fix comments in m4sugar.
3056 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
3057
445b7470
JD
30582008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
3059
3060 Update for recent .gitignore fix in Gnulib.
3061 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
3062 anchored .gitignore entries.
3063
a1e50014
JD
30642008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
3065
3066 Set gnu or gnits strictness.
3067 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
3068 development and gnits strictness for releases. Based on Eric Blake's
3069 suggestion at
3070 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
3071
d43f77e7
PB
30722008-07-31 Paolo Bonzini <bonzini@gnu.org>
3073
3074 * NEWS: Clarify documentation of %language.
3075
fee2ed87
PB
30762008-07-31 Paolo Bonzini <bonzini@gnu.org>
3077
3078 Support usage of git-merge-changelog.
3079 * .gitattributes: New.
3080 * HACKING: Document usage of git-merge-changelog.
3081 * bootstrap: Install git-merge-changelog entries in .git/config
3082 if appropriate.
3083
78029cd5
JD
30842008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3085
3086 Remove remaining dependence on CVS Id keyword.
3087 * ChangeLog: For the sake of people still using CVS, don't use dollars
3088 when mentioning Id.
3089 * data/xslt/bison.xsl: Remove Id from header comments, where it was
3090 unusual anyway.
3091 * data/xslt/xml2dot.xsl: Likewise.
3092 * data/xslt/xml2text.xsl: Likewise.
3093 * data/xslt/xml2xhtml.xsl: Likewise.
3094 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
3095 * doc/Makefile.am (neutralize): Remove, no longer needed.
3096 (.x.1): Don't use neutralize.
3097 (edit): Don't substitute for ID.
3098 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
3099
c53d18b1
JD
31002008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3101
3102 Fix dependence on computed configure variables.
3103 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
3104 $(top_srcdir)/configure.ac so that changes to computed variables, such
3105 as PACKAGE_VERSION, are seen.
3106 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
3107
5523ac79
JD
31082008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
3109
3110 Update copyright dates for recent changes.
3111 * Makefile.am: Here.
3112 * src/Makefile.am: Here.
3113 * src/reduce.c: Here.
3114 * tests/reduce.at: Here.
3115
8fa36911
JD
31162008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
3117
3118 Use git-version-gen for version names between releases.
3119 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
3120 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
3121 * .prev-version: New.
3122 * .version.in: Remove.
78029cd5 3123 * ChangeLog: Remove the Id previously used for capturing the CVS
8fa36911
JD
3124 revision.
3125 * GNUmakefile: Remove, now copied from Gnulib.
3126 * Makefile.am: Add code suggested by comments in
3127 build-aux/git-version-gen.
3128 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
3129 .prev-version, and .version.
3130 * NEWS (2.3b+): Rename to...
3131 (?.?): ... this because we're dropping the "+" version naming scheme,
3132 but, in general, we still can't be sure of our next release name.
3133 * bootstrap: Add a quick hack to remove from .gitignore the
3134 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
3135 entry. This should really be fixed in gnulib instead.
3136 * bootstrap.conf (gnulib_modules): Add gnumakefile.
3137 * configure.ac (AC_INIT): Set version name by invoking
3138 build-aux/git-version-gen.
3139 (AC_CONFIG_FILES): Remove .version, now generated by
3140 build-aux/git-version-gen.
3141 * maint.mk: New, copied from coreutils.
3142 * doc/.cvsignore (bison.1): Add.
3143 * doc/.gitignore (/bison.1): Add.
3144 * doc/bison.1: Remove, generated.
3145 * src/.cvsignore (revision.c): Remove.
3146 * src/.gitignore (/revision.c): Remove.
3147 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
3148 (BUILT_SOURCES): Remove revision.c.
3149 (revision.c): Remove.
3150 * src/getargs.c (version): Don't print revision after the VERSION.
3151 * src/revision.h: Remove.
3152
bcf07cb7
JD
31532008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
3154
3155 Fix untranslatable composition of sentences. Reported by Goran
3156 Uddeborg at
3157 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
3158 * THANKS (Goran Uddeborg): Add.
3159 * src/reduce.c (reduce_print): Report the number of nonterminals and
3160 rules useless in the grammar in separate sentences.
3161 * tests/reduce.at (Useless Rules): Update output.
3162 (Reduced Automaton): Likewise.
3163 (Underivable Rules): Likewise.
3164 (Empty Language): Likewise.
3165
9aacab9a
JD
31662008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
3167
3168 Fix some .gitignore and .cvsignore problems.
3169 * bootstrap (insert_sorted_if_absent): Replace all uses with...
3170 (insert_vc_ignore): ... this new function, which prepends `/' to all
3171 .gitignore entries before passing them to insert_sorted_if_absent.
3172 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
3173 .cvsignore files are maintained even though Bison developers run
3174 bootstrap while using Git.
3175 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
3176 unneeded by Bison.
3177 (gnulib): Add.
3178 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
3179 unneeded. Reported by Eric Blake.
3180 * lib/.gitignore (/*~): Add.
3181 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
3182 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
3183 Blake.
3184 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
3185
a9fc7990
JD
31862008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
3187
3188 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
3189 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
3190 * bootstrap.conf (gnulib_modules): Add unsetenv.
3191 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
3192 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
3193 (/setenv.m4): Add.
3194 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
3195 the first argument because it may become position-dependent, and unset
3196 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
3197 Add comments explaining these issues in more detail.
3198
0f1d6f10
JD
31992008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
3200
3201 Add .gitignore everywhere based on .cvsignore.
3202 * .gitignore: New.
3203 * build-aux/.gitignore: New.
3204 * data/.gitignore: New.
3205 * doc/.gitignore: New.
3206 * etc/.gitignore: New.
3207 * examples/.gitignore: New.
3208 * examples/calc++/.gitignore: New.
3209 * lib/.gitignore: New.
3210 * m4/.gitignore: New.
3211 * po/.gitignore: New.
3212 * runtime-po/.gitignore: New.
3213 * src/.gitignore: New.
3214 * tests/.gitignore: New.
3215
7bd1665a
JD
32162008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
3217
3218 * NEWS (2.3b+): New section, empty for now.
3219 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
3220
72c5b982
JD
32212008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
3222
3223 * NEWS (2.3b): Update release date since there has been a delay in
3224 getting the announcements and tarballs out.
3225
bd02cd5d
JD
32262008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
3227
3228 * NEWS: Version 2.3b.
3229 * configure.ac (AC_INIT): Likewise.
3230 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
3231
9126263e
JD
32322008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
3233
3234 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
3235 been doing it for years.
3236 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
3237 (Release Procedure): Add FIXME about make alpha being unmaintained.
3238
fa6aa7b3
JD
32392008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
3240
3241 * data/yacc.c: Reformat m4 a little for readability.
3242 * src/lalr.c (build_relations): Correct comment.
3243
d30b312d
JMG
32442008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3245
3246 DJGPP specific issue.
3247 * djgpp/config.sed: Fixes required to run configure scripts generated
3248 by autoconf 2.62.
3249
138d4cd9
JD
32502008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
3251
3252 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
3253 coordinator@translationproject.org.
3254
8f7e2e1f
JD
32552008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3256
3257 * THANKS: Add Eric Blake.
3258
f55efa38
JD
32592008-04-23 Eric Blake <ebb9@byu.net>
3260
3261 Revert prior patch, by working around autoconf regression.
3262 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
3263 ("Output file name: ("): Uncomment test.
3264 ("Output file name: )"): Likewise.
3265 Based on an idea from Noah Misch.
3266
096c9f9d
JD
32672008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
3268
3269 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
3270 2.61. Reported by Juan Manuel Guerrero at
3271 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
3272 * tests/output.at ("Output file name: ("): Comment out test case for
3273 now.
3274 ("Output file name: )"): Likewise.
3275
0f664b89
JD
32762008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
3277
3278 * GNUmakefile: Update git-version-gen invocation so make dist
3279 succeeds.
3280
1cfe6375
JD
32812008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
3282
3283 Update to the current gnulib CVS repository, and fix trigraph handling
3284 in Bison.
3285 * bootstrap: Update gnulib CVS repository URL.
3286 (symlink_to_dir): Encapsulate the code that guarantees the destination
3287 directory exists into...
3288 (check_dst_dir): ... this new function, and...
3289 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
3290 fail when copying files into lib/uniwidth/.
3291 * src/output.c (prepare_symbols): When writing yytname muscles, where
3292 symbol names will be encoded in C-string literals, tell quotearg to
3293 escape trigraphs. This used to be the default in gnulib.
3294 * tests/regression.at (Token definitions): Because of the change in
3295 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
3296 escapes trigraphs in symbol names. Thus, yytname no longer has
3297 trigraphs unnecessarily doubly escaped. Update test case output.
3298 Extend test case to be sure Bison's own error messages will no longer
3299 have trigraphs in symbol names unnecessarily escaped once.
3300
74c52fc8
JD
33012008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
3302
3303 Fix make dist infinite loop reported by Juan Manuel Guerrero at
3304 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
3305 * .cvsignore: Add .version.
3306 * .version.in: New.
3307 * bootstrap.conf (gnulib_modules): Add git-version-gen.
3308 * configure.ac (AC_CONFIG_FILES): Add .version.
3309 * build-aux/.cvsignore: Add git-version-gen.
3310
8e55b3aa
JD
33112008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
3312
3313 * NEWS (2.3a+): Mention that -g now takes an argument.
3314 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
3315 consistency. Update the -g and -x entries now that they take
3316 arguments. Use brackets to indicate optional arguments.
3317 * src/getargs.c (usage): Explain the relationship between arguments of
3318 long and short options more completely. Document --defines and -d
3319 separately since the former takes an argument but, for POSIX Yacc, the
3320 latter does not.
3321 (short_options): Let -W take an optional argument like --warnings.
8452fdd9 3322 (getargs): Sort cases.
8e55b3aa 3323
59c5ac72
AD
33242008-02-28 Akim Demaille <demaille@gostai.com>
3325
3326 * doc/bison.texinfo: Fix a few typos.
3327
118d4978
AD
33282008-02-28 Akim Demaille <akim@epita.fr>
3329
3330 * doc/bison.texinfo (Bison Options): Document -W.
3331 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
3332
7020f1e9
AD
33332008-02-28 Akim Demaille <akim@epita.fr>
3334
3335 * src/getargs.c (short_options): Split and sort for readability.
3336 -g and -x take optional arguments, just like their long options.
3337 * build-aux/cross-options.pl: Use /x to make the regexp easier to
3338 understand.
3339 Fix the handling of $opt which resulted in all the argument to be
3340 considered as optional.
3341
59da312b
JD
33422008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
3343
3344 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
3345 say its interface is experimental.
3346 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
3347 Java.
3348 (Bison Options): In the -L and --language entry, mention Java.
3349 (Java Bison Interface): Say the interface is experimental.
3350 * src/getargs.c (usage): Mention -L and --language.
3351
3352 * NEWS (2.3a+): Say the push parsing interface is experimental.
3353 * doc/bison.texinfo (Push Decl): Likewise.
3354 (Decl Summary): Likewise in the "%define api.push_pull" entry.
3355 (Push Parser Function): Likewise.
3356 (Pull Parser Function): Likewise.
3357 (Parser Create Function): Likewise.
3358 (Parser Delete Function): Likewise.
3359 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
3360 yypull_parse, and yypush_parse entries.
3361
3362 * NEWS (2.3a+): Mention XML support, and say the schema is
3363 experimental.
3364 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
3365 * src/getargs.c (usage): Say the XML schema is experimental.
3366
3367 * NEWS (2.3a+): Say option instead of flag.
3368
2bb3ebec
WP
33692008-02-21 Wojciech Polak <polak@gnu.org>
3370
3371 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
3372 text.
3373
333e670c
JD
33742008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
3375
3376 Fix impure push parser compile error reported by Bob Rossi at
3377 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
3378 * data/yacc.c: Clean up whitespace in the output a little.
3379 (yypstate_allocated): Define for impure push parsers regardless of
3380 whether the pull interface is also requested.
3381 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
3382 check impure push parsers without the pull interface.
3383
3384 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
3385 yyerror takes arguments specified by %parse-param while yypstate_new
3386 does not.
3387 * doc/bison.texinfo (Parser Create Function): Document that
3388 yypstate_new returns 0 for multiple impure parser instances.
3389 * tests/push.at (Push Parsing: Multiple impure instances): Update
3390 expected stderr output.
3391
798096e1
JD
33922008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
3393
3394 * runtime-po/POTFILES.in (push.c): Remove.
3395
9ca7f077
JD
33962008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
3397
3398 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
3399 * data/push.c: Rename to...
3400 * data/yacc.c: ... this, overwriting it.
3401 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
3402 `%push-pull-parser' -> `%define api.push_pull "both"'.
3403 Remove old yacc.c tests, and update push.c tests to yacc.c.
3404
42ee26bb
JD
34052008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
3406
3407 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
3408 `"%code top" blocks' instead of `%code "top" blocks'.
3409 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
3410 Clean up whitespace in the output a little.
3411
b1cc23c4
JD
34122008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
3413
3414 Fix documentation problems reported by Tim Josling at
3415 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
3416 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
3417 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
3418 integers. Explain the effect of literal string aliases on error
3419 messages. Copy token 0 documentation from the C++ skeleton
3420 documentation.
3421
ab7f29f8
JD
34222008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
3423
3424 Accept a token number in a %left, %right, or %nonassoc for POSIX
3425 conformance. Reported by Tim Josling at
3426 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
3427 * NEWS (2.3a+): Mention.
3428 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
3429 and code numbers are treated by precedence declarations.
3430 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
3431 of symbols.1.
3432 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
3433 of symbol.
3434 (symbol.prec): New, just like symbol but allows INT.
3435 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
3436 longer holds.
3437 * tests/regression.at (Token number in precedence declaration): New
3438 test case.
3439
a924ef36
JMG
34402008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3441
3442 DJGPP specific issues.
3443 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
3444 be changed. Copyright timestamp adjusted.
3445 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
3446 be changed. Copyright timestamp adjusted.
3447 * djgpp/config.site: Copyright timestamp adjusted.
3448 * djgpp/config_h.sed: Copyright timestamp adjusted.
3449 * djgpp/djunpack.bat: Copyright timestamp adjusted.
3450 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
3451 filename translation list.
3452 * djgpp/subpipe.c (init_subpipe): Check the environment variables
3453 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
3454 files shall be created. Before trying to use the temp dir where the
3455 environment variable points to check that the dir really exists. If
3456 not default to the cwd as temp dir. Copyright timestamp adjusted.
3457 * djgpp/subpipe.h: Copyright timestamp adjusted.
3458 * djgpp/testsuite.sed: Copyright timestamp adjusted.
3459
389c8cfd
PE
34602008-01-30 Paul Eggert <eggert@cs.ucla.edu>
3461
3462 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
3463
5d1cfef4
PE
34642008-01-09 Paul Eggert <eggert@cs.ucla.edu>
3465
3466 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
3467 Problem reported by Claudio Saavedra in
3468 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
3469
e2dcf996
WP
34702008-01-05 Wojciech Polak <polak@gnu.org>
3471
3472 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
3473 document's title with the input grammar file name.
3474
da730230
JD
34752007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
3476
3477 Automate regression testing of the XML/XSLT implementation. Discussed
3478 starting at
3479 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
3480 * configure.ac (XSLTPROC): New substitution.
3481 * Makefile.am (maintainer-xml-check): New phony target invoking...
3482 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
3483 invoking make maintainer-check with BISON_TEST_XML=1.
3484 * tests/atlocal.in (XSLTPROC): New.
3485 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
3486 not to report reachable memory when Bison is expected to have a
3487 non-zero exit status and (2) to compare XML/XSLT output with --graph
3488 and --report=all output for every working grammar when
3489 BISON_TEST_XML=1.
3490 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
3491 (AT_BISON_CHECK_XML): New.
3492 (AT_QUELL_VALGRIND): New.
3493 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
3494 (AT_CHECK): ... don't redefine this since this was the old way to
3495 quell Valgrind.
3496 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
3497 AT_BISON_CHECK invocations.
3498 * tests/c++.at: Likewise.
3499 * tests/calc.at: Likewise.
3500 * tests/conflicts.at: Likewise.
3501 * tests/cxx-type.at: Likewise.
3502 * tests/existing.at: Likewise.
3503 * tests/glr-regression.at: Likewise.
3504 * tests/headers.at: Likewise.
3505 * tests/input.at: Likewise.
3506 * tests/java.at: Likewise.
3507 * tests/output.at: Likewise.
3508 * tests/push.at: Likewise.
3509 * tests/reduce.at: Likewise.
3510 * tests/regression.at: Likewise.
3511 * tests/sets.at: Likewise.
3512 * tests/skeletons.at: Likewise.
3513 * tests/synclines.at: Likewise.
3514 * tests/torture.at: Likewise.
3515 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
3516 tends to hang xsltproc.
3517 (Big horizontal): Likewise.
3518
408476bc
JD
35192007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
3520
3521 In XML output, remove redundant class attribute on symbol element.
3522 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
3523 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
3524 look up a symbol to determine whether it's a nonterminal or terminal.
3525 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
3526 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
3527
3528 Add prec/assoc information to XML output.
3529 * src/gram.c (grammar_rules_print_xml): For each rule that has a
3530 %prec, add a percent_prec attribute.
3531 * src/print-xml.c (print_grammar): For each terminal that has a
3532 precedence or associativity, add a prec or assoc attribute.
3533 (xml_indent): New.
3534 (xml_puts): Use xml_indent.
3535 (xml_printf): Use xml_indent.
3536 * src/print-xml.h (xml_indent): Prototype.
3537
3538 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
3539 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
3540
d4a26c48
JD
35412007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
3542
3543 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
3544 (bison:ruleByNumber): ... this for clarity.
3545 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
3546 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
3547 (xsl:template match="reduction"): Update.
3548 (xsl:template match="item"): Update.
3549 (xsl:template match="reduction"): Update.
3550
3551 In the XML output, don't print the list of rules where symbols appear.
3552 Compute it in XSLT instead. Discussed at
3553 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
3554 * data/xslt/bison.xsl (bison:ruleByLhs): New.
3555 (bison:ruleByRhs): New.
3556 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
3557 bison:ruleByRhs.
3558 (xsl:template match="terminal/rule"): Remove.
3559 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
3560 bison:ruleByRhs.
3561 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
3562 Remove.
3563 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
3564 bison:ruleByRhs and mode="number-link" for rule template.
3565 (xsl:template match="terminal/rule"): Remove.
3566 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
3567 bison:ruleByRhs and mode="number-link" for rule template.
3568 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
3569 Rewrite as...
3570 (xsl:template match="rule" mode="number-link"): ... this.
3571 * src/print-xml.c (print_grammar): Don't print the list of rules.
3572
ef1b4273
JD
35732007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
3574
3575 Don't let --report affect XML output; always print all information.
3576 Discussed at
3577 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
3578 * src/conflicts.c (log_resolution): Implement.
3579 * src/print-xml.c (print_core): Implement.
3580 (print_state): Implement.
3581 (print_xml): Implement.
3582
3583 * NEWS (2.3a+): Fix quotes.
3584 * src/parse-gram.y (prologue_declaration): For consistency with -v,
3585 don't let %verbose clear the list specified by --report.
3586
0f6cd9e3
AD
35872007-11-26 Akim Demaille <akim@epita.fr>
3588
3589 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
3590
d80fb37a
JD
35912007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
3592
3593 In the XML output, list useless and unused symbols and rules with the
3594 useful ones and add a "usefulness" attribute. Discussed starting at
3595 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
3596 * src/gram.c (grammar_rules_partial_print_xml): Remove.
3597 (grammar_rules_print_xml): Print all rules instead of just those
3598 useful in the grammar, and add a "usefulness" attribute.
3599 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
3600 * src/print-xml.c (print_rules_useless_in_parser): Remove.
3601 (print_grammar): Print all nonterminals instead of just useful ones,
3602 and add a "usefulness" attribute to nonterminals and terminals.
3603 (print_xml): Don't print a separate "reductions" or
3604 "rules-useless-in-parser" element.
3605 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
3606 (reduce_xml): Remove.
3607 (reduce_token_unused_in_grammar): New.
3608 (reduce_nonterminal_useless_in_grammar): New.
3609 * src/reduce.h (reduce_xml): Remove prototype.
3610 (reduce_token_unused_in_grammar): Add prototype.
3611 (reduce_nonterminal_useless_in_grammar): Add prototype.
3612 * data/xslt/xml2text.xsl: Update for XML changes.
3613 * data/xslt/xml2xhtml.xsl: Update for XML changes.
3614 * tests/reduce.at (Useless Terminals): Update output.
3615 (Useless Rules): Update output.
3616 (Reduced Automaton): Update output.
3617
3618 Say "Terminals unused in grammar" instead of "Unused terminals".
3619 * NEWS (2.3a+): Update.
3620 * doc/bison.texinfo (Understanding): Update example output.
3621 * src/reduce.c (reduce_output): Implement.
3622 * data/xslt/xml2text.xsl: Implement.
3623 * data/xslt/xml2xhtml.xsl: Implement.
3624
1bb2bd75
JD
36252007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
3626
3627 Accept --report-file=FILE to override the default `.output' filename.
3628 * NEWS (2.3a+): Mention.
3629 * doc/bison.texinfo (Bison Options): Add an entry.
3630 * src/files.c (compute_output_file_names): Don't override
3631 spec_verbose_file if already set.
3632 * src/getargs.c (usage): Document --report-file.
3633 (REPORT_FILE_OPTION): New anonymous enum member.
3634 (long_options): Add entry for it.
3635 (getargs): Add case for it setting spec_verbose_file.
3636
3637 * build-aux/cross-options.pl: Don't record a short option just because
3638 there's an arg.
3639 * doc/.cvsignore: Add yacc.1.
3640
a005a9c4
AD
36412007-11-14 Akim Demaille <akim@epita.fr>
3642
3643 * doc/yacc.1.in: New.
3644 * configure.ac, doc/Makefile.am: Adjust.
3645 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
3646 config.h symbol.
3647 Use AC_SUBST for assignments too.
3648 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
3649
cff03fb2
JD
36502007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
3651
3652 * src/gram.c: Remove comments that duplicate comments in gram.h.
3653
3654 When reporting useless rules and nonterminals, say "useless in grammar"
3655 instead of "useless", and say "useless in parser" instead of "never
3656 reduced". Discussed starting at
3657 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
3658 * NEWS (2.3a+): Mention this change.
3659 * data/xslt/xml2text.xsl: Update output text and expected input XML
3660 element names to match changes below.
3661 * data/xslt/xml2xhtml.xsl: Likewise.
3662 (xsl:template match="bison-xml-report"): Add missing entry in Table of
3663 Contents: "Rules useless in parser due to conflicts".
3664 * doc/bison.texinfo (Decl Summary): Reword a little.
3665 (Understanding): Update example output for changes below.
3666 * src/gram.c: (rule_useful_p): Rename to...
3667 (rule_useful_in_grammar_p): ... this.
3668 (rule_useless_p): Rename to...
3669 (rule_useless_in_grammar_p): ... this.
3670 (rule_never_reduced_p): Rename to...
3671 (rule_useless_in_parser_p): ... this.
3672 (grammar_rules_print): Update for renames.
3673 (grammar_rules_print_xml): Update for renames.
3674 (grammar_rules_never_reduced_report): Rename to...
3675 (grammar_rules_useless_report): ... this since it is used for either
3676 kind of useless rule.
3677 * src/gram.h: Reword comments and update function names in prototypes.
3678 * src/main.c (main): Say "rule useless in parser due to conflicts".
3679 * src/print-xml.c (print_rules_never_reduced): Rename to...
3680 (print_rules_useless_in_parser): ... this, and rename output XML
3681 element "rules-never-reduced" to "rules-useless-in-parser".
3682 (print_xml): Update for rename.
3683 * src/print.c (print_results): Say "Rules useless in parser due to
3684 conflicts".
3685 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
3686 (nonterminals_reduce): Say "nonterminal useless in grammar".
3687 (reduce_output): Say "Nonterminals useless in grammar".
3688 Say "Rules useless in grammar".
3689 (reduce_xml): Rename output XML element "useless" to
3690 "useless-in-grammar".
3691 (reduce_print): Don't report the count of grammatically useless rules
3692 as "rules never reduced" just because %yacc is specified.
3693 In the correct report of this count, say nonterminal(s) and rule(s)
3694 "useless in grammar".
3695 * tests/conflicts.at (S/R in initial): Update expected output.
3696 (Defaulted Conflicted Reduction): Likewise.
3697 (Unreachable States After Conflict Resolution): Likewise.
3698 * tests/existing.at (GNU pic Grammar): Likewise.
3699 * tests/reduce.at (Useless Nonterminals): Likewise.
3700 (Useless Rules): Likewise.
3701 (Reduced Automaton): Likewise.
3702 (Underivable Rules): Likewise.
3703 (Empty Language): Likewise.
3704
66f0441d
JD
37052007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
3706
3707 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
3708 here document and before the EOF so that BSD's implementation of Bourne
3709 shell doesn't parse the delimiter as part of the here document.
3710 * doc/.cvsignore: Add cross-options.texi.
3711 * src/getargs.c (usage): Add a blank line after the warning categories.
3712
d0ee4105
PB
37132007-11-08 Paolo Bonzini <bonzini@gnu.org>
3714
3715 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
3716
e8b1fb9b
AD
37172007-11-05 Akim Demaille <akim@epita.fr>
3718
3719 Remove Id: from bison.1.
3720 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
3721 (perl -0777 -pi -e 's/\.PP\nId): New.
3722 (.x.1): Use it to ignore the version control revision.
3723
2f7a96b5
AD
37242007-11-05 Akim Demaille <demaille@gostai.com>
3725
3726 * build-aux/Makefile.am: Ship cross-options.pl.
3727 * doc/Makefile.am: Always refer to cross-options.texi with
3728 $(srcdir).
3729 (MAINTAINERCLEANFILES): Add it.
3730
f4101aa6
AD
37312007-11-04 Akim Demaille <demaille@gostai.com>
3732
3733 Generate the long/short option cross-table.
3734 * build-aux/cross-options.pl: New.
3735 * doc/Makefile.am (cross-options.texi): New.
3736 * doc/bison.texinfo: Use it.
3737
727a1401
AD
37382007-11-04 Akim Demaille <demaille@gostai.com>
3739
3740 Generate bison.1 using help2man.
3741 * doc/common.x, doc/bison.x: New.
3742 * doc/Makefile.am (bison.1, .x.1): New.
3743 The code is taken from autoconf-2.61/man/Makefile.am.
3744 * configure.ac: Look for help2man.
3745
6aeb9c57
AD
37462007-11-04 Akim Demaille <demaille@gostai.com>
3747
3748 Complete --help.
3749 * src/getargs.c (usage): Document -W, make it clear that -d,
3750 -g and -x have optional arguments.
3751
d7be4085
AD
37522007-11-04 Akim Demaille <demaille@gostai.com>
3753
3754 Find sha1sum when named gsha1sum.
3755 * bootstrap (find_tool): New.
3756 ($SHA1SUM): New.
3757
d9df47b6
JD
37582007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
3759
3760 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
3761 at
3762 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
3763 * NEWS (2.3a+): Mention.
3764 * data/bison.m4 (b4_pure_if): Don't define it here.
3765 * data/c.m4 (b4_identification): Depend on individual skeletons to
3766 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
3767 values of the %define variables api.pure or api.push_pull. Define
3768 YYPURE, YYPUSH, and YYPULL accordingly.
3769 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
3770 glr.cc has already defined b4_pure_flag.
3771 * data/push.c: Define b4_pure_if based on `%define api.pure'.
3772 Remove YYPUSH and YYPULL since they're back in b4_identification again.
42ee26bb 3773 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
d9df47b6
JD
3774 * doc/bison.texinfo (Pure Decl): Update.
3775 (Push Decl): Update.
3776 (Decl Summary): Add api.pure to %define entry.
3777 In %pure-parser entry, say it's deprecated and reference %define.
3778 (Pure Calling): Update.
3779 (Error Reporting): Update.
3780 (C++ Scanner Interface): Update.
3781 (How Can I Reset the Parser): Update.
3782 (Table of Symbols): In %pure-parser entry, say it's deprecated and
3783 reference %define.
3784 * src/getargs.c (pure_parser): Remove global variable.
3785 * src/getargs.h (pure_parser): Remove extern.
3786 * src/output.c (prepare): Don't define pure_flag muscle.
3787 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
3788 wrapper around `%define api.pure'.
3789 * tests/calc.at (Simple LALR Calculator): Update.
3790 (Simple GLR Calculator): Update.
3791 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
3792 Update.
3793 (GLR: Resolve ambiguity, pure, locations): Update.
3794 (GLR: Merge conflicting parses, pure, no locations): Update.
3795 (GLR: Merge conflicting parses, pure, locations): Update.
3796 * tests/glr-regression.at (Uninitialized location when reporting
3797 ambiguity): Update
3798 * tests/input.at (Unused %define api.pure): New test case.
3799 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
3800 AT_PURE_IF and AT_PURE_AND_LOC_IF.
3801 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
3802
c373bf8b
JD
38032007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
3804
3805 %define push_pull -> %define api.push_pull. Discussed starting at
3806 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
3807 * data/push.c: Expect the new name.
3808 * data/yacc.c: Likewise.
3809 * doc/bison.texinfo (Push Decl): Update.
3810 (Decl Summary): Update %define entry.
3811 (Push Parser Function): Update.
3812 (Pull Parser Function): Update.
3813 (Parser Create Function): Update.
3814 (Parser Delete Function): Update.
3815 * tests/calc.at (Simple LALR Calculator): Update.
3816 * tests/input.at (%define enum variables): Update.
3817 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
3818 (Push Parsing: Multiple impure instances): Update.
3819 (Push Parsing: Unsupported Skeletons): Update.
3820 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
3821 (Exploding the Stack Size with Malloc): Update.
3822
3823 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
3824 other entries some.
3825
32f19b6b
JD
38262007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
3827
3828 For the XML output's terminal element, rename @number to @token-number,
3829 and add @symbol-number. In the nonterminal element, rename @number to
3830 @symbol-number. Discussed starting at
3831 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
3832 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
3833 renames.
3834 (xsl:template match="nonterminal"): Likewise.
3835 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
3836 (xsl:template match="nonterminal"): Likewise.
3837 * src/print-xml.c (print_grammar): Implement.
3838
255a6b90
JD
38392007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
3840
3841 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
3842 2007-10-11 change, the child elements here are items not rules.
408476bc 3843 (xsl:template match="item"): New.
255a6b90
JD
3844 (xsl:template match="rule"): Update for new reduced itemset.
3845 (xsl:template match="point"): Remove.
3846 (xsl:template match="empty"): For consistency with --graph, don't
3847 output "/* empty */".
3848 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
3849 line-wrap, don't pass a negative value as first-line-length since this
3850 won't work with the following changes.
3851 (xsl:template name="line-wrap"): Simplify slightly.
3852 (xsl:template name="ws-search"): Eliminate recursion.
3853 * src/print_graph.c (print_core): Don't print a reduction's lookahead
3854 set next to an item whose dot is not at the end of the RHS even if it
3855 happens to be associated with the same rule.
3856
88c78747
JD
38572007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
3858
31984206
JD
3859 Add %define lr.keep_unreachable_states.
3860 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
3861 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
3862 * src/main.c (main): Implement it.
3863 * tests/conflicts.at (Unreachable States After Conflict Resolution):
3864 Extend to test it, and fix a typo.
3865
38662007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
3867
3868 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
3869 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
3870 the example .output text.
3871 * tests/regression.at (Extra lookahead sets in report): Improve wording
3872 of comments.
3873
b7a70162
WP
38742007-10-17 Wojciech Polak <polak@gnu.org>
3875
3876 * src/print-xml.c (print_grammar): Renamed
3877 <terminal> and <nonterminal> attributes:
3878 "type" to "number" and "symbol" to "name".
3879 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
3880 Use new attribute names.
3881 (xsl:template match="nonterminal"): Likewise.
3882 * data/xslt/xml2xhtml.xsl: Likewise.
3883
a0de5091
JD
38842007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
3885
3886 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
3887 (Option Cross Key): Likewise.
3888
3889 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
3890 next to an item whose dot is not at the end of the RHS even if it
3891 happens to be associated with the same rule.
3892 * src/print.c (print_core): Likewise.
3893 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
3894 (Resolved SR Conflicts): Update output.
3895 * tests/regression.at (Extra lookahead sets in report): New test case.
3896
4c20d18d
WP
38972007-10-11 Wojciech Polak <polak@gnu.org>
3898
3899 * src/print-xml.c (print_core): Remove item set
3900 redundancy.
3901 * data/xslt/bison.xsl (bison:ruleNumber): New key.
3902 Improve processing time. Suggested by Joel E. Denny.
3903 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
3904 Write xsl:param "required" attribute as comment.
3905 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
3906 (xsl:template match="rule"): Support new reduced itemset.
3907 (xsl:template match="point"): Remove.
3908 * data/xslt/xml2xhtml.xsl: Likewise.
3909
f506ad1c
JD
39102007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
3911
3912 * src/getargs.c (version): Update copyright year.
3913
21f1b063
JD
39142007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
3915
3916 Make xml2dot.xsl and --graph produce the same output.
3917 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
3918 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
3919 escaped later.
3920 (xsl:template name="output-node"): Use the new escape template instead
3921 of the string-replace template directly.
3922 (xsl:template name="output-edge"): Likewise.
3923 (xsl:template name="escape"): New, escapes backslashes and newlines in
3924 addition to quotation marks.
3925 * src/graphviz.c (start_graph, output_node, output_edge): Add
3926 whitespace to output for legibility.
3927
3928 Make xml2text.xsl and --report produce the same output, and remove the
3929 XML "conflicts" element since a conflict summary is easily extracted
3930 from the automaton.
3931 * data/xslt/bison.xsl: New.
3932 (xsl:template match="state" mode="bison:count-conflicts): New.
3933 * data/xslt/xml2text.xsl: Import bison.xsl.
3934 (xsl:template match="bison-xml-report"): Instead of styling the
3935 "conflicts" element, style the "automaton" element with mode
3936 "conflicts". Unlike the former, the latter lists S/R and R/R
3937 conflicts for a state on the same line.
3938 (xsl:template match="conflicts"): Remove.
3939 (xsl:template match="conflict"): Remove.
3940 (xsl:template match="terminal"): Line-wrap the list of rules in which
3941 the terminal is used.
3942 (xsl:template match="nonterminal"): Likewise for nonterminals.
3943 (xsl:template match="automaton" mode="conflicts"): New.
3944 (xsl:template match="state" mode="conflicts"): New.
3945 (xsl:template name="line-wrap"): New.
3946 (xsl:template name="ws-search"): New.
3947 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
3948 (xsl:template match="bison-xml-report"): Instead of styling the
3949 "conflicts" element, style the "automaton" element with mode
3950 "conflicts."
3951 (xsl:template match="conflicts"): Remove.
3952 (xsl:template match="conflict"): Remove.
3953 (xsl:template match="automaton" mode="conflicts"): New.
3954 (xsl:template match="state" mode="conflicts): New.
3955 * src/conflicts.c (conflicts_output_xml): Remove.
3956 * src/conflicts.h (conflicts_output_xml): Remove prototype.
3957 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
3958 * src/print.c (print_grammar): Consistently wrap at the 66th column so
3959 the corresponding XSLT is easier. Also, never wrap between a word and
3960 the comma that follows it.
3961
793fbca5
JD
39622007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
3963
3964 Improve C++ namespace support. Discussed starting at
3965 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
3966 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
3967 b4_namespace_close): New macros that interpret the %define variable
3968 "namespace" so its value can contain "::" to indicate nested
3969 namespaces.
3970 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
3971 the above macros.
3972 * data/lalr1.cc (b4_namespace): Likewise.
3973 * data/location.cc (b4_namespace): Likewise.
3974 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
3975 inside a new table in the general %define entry. Document `%define
3976 namespace' there as well. Point the %name-prefix entry to it since it
3977 explains it more completely in the case of C++.
3978 (C++ Bison Interface): Mention `%define namespace' instead of
3979 %name-prefix.
3980 (Table of Symbols): Remove the `%define push_pull' entry. The %define
3981 entry suffices.
3982 * tests/c++.at (Relative namespace references): New test case.
3983 (Absolute namespace references): New test case.
3984 (Syntactically invalid namespace references): New test case.
3985 * tests/input.at (C++ namespace reference errors): New test case.
3986
35b8730d
JD
39872007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
3988
3989 Add syncline support and location accessor to internal %define
3990 interfaces.
3991 * data/bison.m4 (b4_percent_define_get_loc): New.
3992 (b4_percent_define_get_syncline): New.
3993 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
3994 (b4_percent_define_default): Record defining location as line 1 rather
3995 than 0 for the sake of synchronizing #line's, and define
3996 b4_percent_define_syncline(VARIABLE).
3997 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
3998 * src/muscle_tab.c (muscle_syncline_grow): New.
3999 (muscle_code_grow): Use muscle_syncline_grow.
4000 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
4001 define b4_percent_define_syncline(VARIABLE).
4002 (muscle_percent_define_get_loc): New.
4003 (muscle_percent_define_get_syncline): New.
4004 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
4005 remove some unused variables.
4006 (muscle_percent_define_default): Record defining location as line 1
4007 rather than 0 for the sake of synchronizing #line's, and define
4008 b4_percent_define_syncline(VARIABLE).
4009 (muscle_percent_define_check_values): Use
4010 muscle_percent_define_get_loc.
4011 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
4012 (muscle_percent_define_get_syncline): Prototype.
4013 * tests/skeletons.at (%define Boolean variables: invalid skeleton
4014 defaults): Update output for location change.
4015 (Complaining during macro argument expansion): Extend to test
4016 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
4017
7dc4a694
JD
40182007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
4019
4020 Fix some error-reporting macro bugs.
4021 * data/bison.m4 (b4_cat): New.
4022 (b4_error, b4_error_at): Use b4_cat to send error directives directly
4023 to stdout so they don't become arguments to other macros. Update
4024 comments and add examples.
4025 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
4026 add examples.
4027 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
4028 after printing the error directive so that M4 doesn't report subsequent
4029 problems that are induced by this problem.
4030 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
4031 instead of just in them. Recognize @\n in both places. Both expand to
4032 the empty string. Needed by b4_cat.
4033 * tests/skeletons.at (Complaining during macro argument expansion):
4034 New test case.
4035 (Fatal errors make M4 exit immediately): New test case.
4036
d4bd2295
JD
40372007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
4038
4039 Implement --print-datadir.
4040 * src/getargs.c (usage): Mention.
4041 (PRINT_DATADIR_OPTION): New anonymous enum member.
4042 (long_options): Add entry for it.
4043 (getargs): Add case for it calling compute_pkgdatadir.
4044 * src/output.c (output_skeleton): Encapsulate data directory
4045 computation from here...
4046 (prepare): ... and from here...
4047 (compute_pkgdatadir): ... into this new function.
4048 * src/output.h (compute_pkgdatadir): Prototype.
4049
34cdeddf
JD
40502007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
4051
4052 * src/print-xml.c (escape_bufs): New static global variable
4053 replacing...
4054 (xml_escape_n): ... the static local variable buf here.
4055 (print_xml): Free memory for escape_bufs.
4056 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
4057
d782395d
JD
40582007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
4059
4060 Replace `%push-parser' and `%push-pull-parser' with
4061 `%define push_pull "push"' and `%define push_pull "both"'.
4062 `%define push_pull "pull"' is the default.
4063 * doc/bison.texinfo (Push Decl, Push Parser Function,
4064 Pull Parser Function, Parser Create Function, Parser Delete Function):
4065 Update declarations.
4066 (Decl Summary, Table of Symbols): Replace %push-parser and
4067 %push-pull-parser entries with a %define push_pull entry.
4068 * data/bison.m4 (b4_percent_define_check_values): New macro.
4069 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
4070 definitions...
4071 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
4072 definitions...
4073 * data/push.c: ... to here and compute them from the value of the
4074 %define variable push_pull.
4075 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
4076 parsing requests here...
4077 * data/yacc.c: ... hack this to switch to push.c any time
4078 b4_use_push_pull_flag or the %define variable push_pull is set. This
4079 will go away when we mv push.c yacc.c.
4080 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
4081 push parsing is not supported since unused %define variables are
4082 reported anyway.
4083 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
4084 * src/muscle_tab.h (muscle_percent_define_check_values): Update
4085 comments for consistency with b4_percent_define_check_values.
4086 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
4087 muscles.
4088 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
4089 Remove.
4090 (prologue_declaration): Remove %push-parser and %push-pull-parser
4091 rules.
4092 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
4093 * tests/calc.at: Update declarations.
4094 * tests/input.at (%define enum variables): New test case.
4095 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
4096 declaration.
4097 (Push Parsing: Multiple impure instances): Update declaration.
4098 (Push Parsing: Unsupported Skeletons): New test case.
4099 * tests/torture.at (Exploding the Stack Size with Alloca): Update
4100 declaration.
4101 (Exploding the Stack Size with Malloc): Update declaration.
4102
3f999f78
WP
41032007-09-24 Wojciech Polak <polak@gnu.org>
4104
4105 Add XSLT transformations.
4106
4107 * data/xslt/xml2dot.xsl: Transform XML into DOT.
4108 * data/xslt/xml2text.xsl: Transform XML into plain text.
4109 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
4110 * data/Makefile.am (xsltdir): New variable.
4111 (dist_xslt_DATA): Add xslt/*.xsl files.
4112
a4f75309
PE
41132007-09-23 Paul Eggert <eggert@cs.ucla.edu>
4114
4115 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
4116 Problem reported by Wojciech Polak.
4117 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
4118 (xml_printf): Undo change I made on 21 September; that is,
4119 indent 2 spaces, not 1.
4120
ad5feac4
JD
41212007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
4122
4123 Pacify ./configure --enable-gcc-warnings.
4124 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
4125 `char const *' instead of `char *'.
4126 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
4127 local variable `sep'.
4128
41d7a5f2
PE
41292007-09-21 Paul Eggert <eggert@cs.ucla.edu>
4130
4131 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
4132 elsewhere.
4133 * src/print-xml.c: Prefer "const" after types; that's more consistent.
4134 (xml_printf): Indent just 1 space for level.
4135 (e_char, xlate_char): Remove.
4136 (xml_escape_string): Rewrite to avoid undefined behavior (used
4137 storage that was freed from the stack).
4138 (xml_escape_n): Don't bother checking for subscript error.
4139
3f999f78
WP
41402007-09-21 Wojciech Polak <polak@gnu.org>
4141
4142 Add Bison XML Automaton Report.
41d7a5f2
PE
4143
4144 Add support for an -x option to generate an XML report.
4145 It is not documented yet.
4146 * src/print-xml.c: New file.
4147 * src/print-xml.h: Likewise.
4148 * lib/timevar.def (TV_XML): New var.
4149 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
4150 * src/conflicts.c: Include print-xml.h.
4151 (solved_conflicts_xml_obstack): New var.
4152 (log_resolution, conflicts_solve, conflicts_free):
4153 Add support for XML report.
4154 (conflicts_output_val): New function.
4155 * src/conflicts.h (conflicts_output_val): New decl.
4156 * src/files.c (spec_xml_file): New var.
4157 (compute_output_file_names, output_file_names_free): Add XML support.
4158 * src/files.h (spec_xml_file): New decl.
4159 * src/getargs.c (xml_flag): New var.
4160 (usage, short_options, long_options, getargs): Add XML support.
4161 * src/getargs.h (xml_flag): New decl.
4162 * src/gram.c: Include print-xml.h.
4163 (rule_lhs_print_xml, rule_rhs_print_xml):
4164 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
4165 New functions.
4166 * src/gram.h: Declare external ones.
4167 * src/main.c: Include print-xml.h.
4168 (main): Add XML support.
4169 * src/reduce.c: Include print-xml.h.
4170 (reduce_xml): New function.
4171 * src/reduce.h: Declare it.
4172 * src/state.c: Include print-xml.h.
4173 (state_new): Add XML support.
4174 (state_rule_lookahead_tokens_print_xml): New function.
4175 * src/state.h: Declare it.
4176 (struct state): New member solved_conflicts_xml.
4177 * src/symtab.c (symbol_class_get_string): New function.
4178 * src/symtab.h: Declare it.
4179
6d8e724d
PE
41802007-09-21 Paul Eggert <eggert@cs.ucla.edu>
4181
4182 * GNUmakefile: Switch to coreutils's version.
4183 * bootstrap: Likewise.
4184 * Makefile.cfg: Adjust to new GNUmakefile.
4185 * README-hacking: Likewise.
4186
4187 Import from gnulib:
4188
4189 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
4190 Bruno Haible <bruno@clisp.org>
4191
4192 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
4193 and is a script that invokes bison. Tighten the code. Add comments.
4194
922bdd7f
JD
41952007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
4196
4197 Spell "boolean" as "Boolean". Reported by Akim Demaille.
4198 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
4199 * doc/bison.texinfo (Decl Summary): Fix.
4200 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
4201 * tests/input.at (Boolean %define variables): Update output.
4202 * tests/skeletons.at (%define boolean variables: invalid skeleton
4203 defaults): Rename to...
4204 (%define Boolean variables: invalid skeleton defaults): ... this and
4205 update output.
4206
1b17b01d
JD
42072007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
4208
4209 In impure push mode, don't allow more than one yypstate to be allocated
4210 since multiple impure parsers would corrupt yynerrs.
4211 * data/push.c (yypstate_allocated): New static global variable
4212 initialized to 0.
4213 (yypull_parse): If yypstate_new returns 0, don't report it as memory
4214 exhaustion if yypstate_allocated is 1, but still return 2.
4215 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
4216 already 1. Otherwise, set it to 1.
4217 (yypstate_delete): Set it to 0.
4218 * tests/push.at (Push Parsing: Multiple impure instances): New test
4219 case.
4220
9987d1b3
JD
42212007-08-17 Bob Rossi <bob@brasko.net>
4222
4223 * doc/bison.texinfo (Push Decl): Document the push parser.
4224 (Table of Symbols): Ditto.
4225 (Pure Decl): Ditto.
4226 (Decl Summary): Ditto.
4227 (Multiple Parsers, Push Parser Function, Pull Parser Function,
4228 Parser Create Function, Parser Delete Function):
4229 Add new push parser symbols.
4230 (Table of Symbols): Document push-parser, push-pull-parser,
4231 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
4232
f16b0819
PE
42332007-08-15 Paul Eggert <eggert@cs.ucla.edu>
4234
4235 Update to GPLv3.
4236 * doc/gpl-3.0.texi: New file.
4237 * doc/gpl.texi: Remove.
4238 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
4239 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
4240 * README-hacking, TODO, bootstrap, bootstrap.conf:
4241 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
4242 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
4243 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
4244 * data/lalr1.cc, data/lalr1.java, data/location.cc:
4245 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
4246 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
4247 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
4248 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
4249 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
4250 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
4251 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
4252 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
4253 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
4254 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
4255 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
4256 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
4257 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
4258 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
4259 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
4260 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
4261 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
4262 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
4263 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
4264 * src/complain.c, src/complain.h, src/conflicts.c:
4265 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
4266 * src/files.h, src/flex-scanner.h, src/getargs.c:
4267 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
4268 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
4269 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
4270 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
4271 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
4272 * src/print.c, src/print.h, src/print_graph.c:
4273 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
4274 * src/reduce.h, src/relation.c, src/relation.h:
4275 * src/revision.h, src/scan-code.h, src/scan-code.l:
4276 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
4277 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
4278 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
4279 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
4280 * tests/Makefile.am, tests/actions.at, tests/c++.at:
4281 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
4282 * tests/existing.at, tests/glr-regression.at:
4283 * tests/headers.at, tests/input.at, tests/java.at:
4284 * tests/local.at, tests/output.at, tests/push.at:
4285 * tests/reduce.at, tests/regression.at, tests/sets.at:
4286 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
4287 * tests/torture.at:
4288 Update to GPLv3.
4289
728c4be2
JD
42902007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
4291
4292 Get rid of broken %no-parser, -n, and --no-parser implementation and
4293 documentation.
4294 * TODO: Don't mention them.
4295 * doc/bison.1: Likewise.
4296 * doc/bison.texinfo (Decl Summary): Likewise.
4297 (Bison Options): Likewise.
4298 (Option Cross Key): Likewise.
4299 * src/getargs.c (no_parser_flag): Remove global variable.
4300 (usage): Don't print description of -n and --no-parser.
4301 (long_options): Remove --no-parser entry here.
4302 (getargs): Remove -n case in the switch here.
4303 * src/getargs.h (no_parser_flag): Remove extern.
4304 * tests/regression.at (Web2c Actions): Remove comment that mentions
4305 --no-parser.
4306
5d31a216
JD
43072007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
4308
4309 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
4310 name user variables starting with `yy'. Just pass NULL instead of a
4311 dummy local &yylval to yypush_parse.
4312 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
4313 starting with `yy'.
4314
a2ea208d
JD
43152007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
4316
4317 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
4318 true since it's then always used regardless of whether yyoverflow is
4319 defined. Reported by Christian Burger at
4320 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
4321 * THANKS: Add Christian Burger.
4322
91661ebb
JD
4323 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
4324 node names: say "Decl Summary" not "Bison Declaration Summary".
4325
cbd50549
JD
43262007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
4327
4328 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
4329 determine whether this function has already complained about an invalid
4330 value for a %define boolean variable, don't check whether Bison has
4331 ever examined the value. As written, the check was a tautology.
4332 Instead, record and check for this complaint using a separate muscle.
4333
eb1b0740
JD
43342007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4335
4336 Fix push parsing memory leak reported by Brandon Lucia at
4337 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
4338 * THANKS: Add Brandon Lucia.
4339 * data/push.c (yypstate_delete): Free the stack if it was reallocated
4340 but the parse never completed and thus freed it.
4341 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
4342 * tests/testsuite.at: Include push.at.
4343 * test/push.at: New.
4344 (Push Parsing: Memory Leak for Early Deletion): New test case.
4345
9d774aff
JD
43462007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
4347
4348 Improve handling of multiple S/R conflicts in the same state and of S/R
4349 conflicts involving multiple reductions.
4350 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
4351 set for a state here or Bison will abort if it is reassigned on a
4352 later conflicted reduction in the same state.
4353 Similarly, don't finalize and assign the solved conflicts report here
4354 or it will be lost if it is reassigned on a later conflicted reduction
4355 in the same state.
4356 (set_conflicts): Instead, assign them both here after all S/R conflicts
4357 in the state have been fully examined.
4358 * src/print.c (shift_set): Rename to...
4359 (no_reduce_set): ... this.
4360 (print_reductions): Update for rename, and add %nonassoc error action
4361 tokens to no_reduce_set so that, when printing the first remaining
4362 reduction on an error action token, the reduction is enclosed in
4363 brackets.
4364 (print_results): Update for rename.
4365 * tests/conflicts.at (Solved conflicts report for multiple reductions
4366 in a state): New test case.
4367 (%nonassoc error actions for multiple reductions in a state): New test
4368 case.
4369
4370 * src/main.c (main): Don't depend on C99 features.
4371
10159d2a
JD
43722007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
4373
4374 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
4375 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
4376 uniwidth.
10159d2a 4377
953b3935
JD
43782007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
4379
4380 * bootstrap (slurp): Create target directories that don't exist.
4381 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
4382
6ce2d93a
JD
43832007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
4384
4385 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
4386 than item number.
4387 * closure.c (closure): Likewise.
4388 * state.h (reductions): Comment sorting of rules.
4389 (state): Comment sorting of items.
4390
ce3448d5
JD
43912007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
4392
4393 Fix C++ test cases after recent Gnulib changes. Discussed starting at
4394 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
4395 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
4396 definition in order to avoid Gnulib headers since we don't use config.h
4397 here.
4398 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
4399 rather than AT_DATA so that config.h is included.
4400
8a86eef0
JD
44012007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
4402
4403 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
4404 instead of fprintf. Guard these functions with #if YYDEBUG instead of
4405 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
4406 and so that YYFPRINTF is guaranteed to be defined here.
4407
b1a81613
JD
44082007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
4409
4410 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
4411 with...
4412 (muscle_percent_define_check_values): ... this more helpful function.
4413 Again, it's not used yet, but it will be.
4414 * src/muscle_tab.h: Likewise.
4415
71b61d4d
JD
4416 Improve some comments in parser table construction.
4417 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
4418 (generate_states): Don't mention ruleset, which is internal to closure.
4419 * src/closure.c (closure): Explain sorting of core and itemset, which
4420 is required for this function to behave correctly.
4421 * src/closure.h (closure): Mention sorting.
4422
2a6b783d
JD
44232007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
4424
4425 * src/lalr.c (state_lookahead_tokens_count): For code readability,
4426 move the check for disabled transitions to an aver since conflict
4427 resolution hasn't happened yet.
4428
4429 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
4430 labels a state as inconsistent just because it has error transitions.
4431 The original form of this check appeared in revision 1.1 of lalr.c,
4432 which was committed on 1991-12-21. Now (at least), changing the
4433 consistency label on such a state appears to have no useful effect in
4434 any of the places it is examined, which I enumerate below. The key
4435 point to understanding each item in this enumeration is that a state
4436 with an error transition is labelled consistent in the first place only
4437 if it has no rules, so the check cannot matter for states that have
4438 rules. (1) Labelling a state as inconsistent will cause set_conflicts
4439 to try to identify its conflicts, and a state must have *rules* to have
4440 conflicts. (2) Labelling a state as inconsistent will affect how
4441 action_row sets the default *rule* for the state. (3) Labelling a
4442 state as inconsistent will cause build_relations to add lookback edges
4443 to *rules* in that state.
4444 * src/state.h (struct state): Word the comment for member consistent
4445 more carefully.
4446
14462c2b
JD
44472007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4448
4449 Don't depend on C99 features.
4450 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
4451 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
4452 * src/reader.c (check_and_convert_grammar): Fix for-loop.
4453 * src/state.c (state_mark_reachable_states): Fix for-loop.
4454 (state_remove_unreachable_states): Fix for-loop.
4455
4456 Don't widen struct state with member reachable just to temporarily
4457 record reachability. Instead, use a local bitset.
4458 * src/state.h (struct state): Remove member.
4459 * src/state.c (state_new): Don't initialize it.
4460 (state_mark_reachable_states): Rename to...
4461 (state_record_reachable_states): ... this, and use bitset.
4462 (state_remove_unreachable_states): Use bitset.
4463
5a43d418
JD
44642007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
4465
4466 * src/Makefile.am (yacc): Quote target action commands properly so
4467 that the yacc script isn't corrupt. Reported by Hans Aberg at
4468 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
4469
0c650a20
JD
4470 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
4471 the case of pure parsers. Reported by Frans Englich at
4472 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
4473 * THANKS: Add Frans Englich.
4474
61fee93e
JD
4475 * NEWS (2.3a+): In the %code entry, reference section `Bison
4476 Declaration Summary' from the manual now since the %code summary has
4477 moved there.
4478 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
4479 in the rules section must be terminated by semicolons.
4480
f124d423
JD
44812007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
4482
4483 Extend the front-end API for %define variables to more completely
4484 mirror the back-end. This will be useful in the future.
4485 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
4486 Update comments to mention the new front-end counterparts of these
4487 macros.
4488 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
4489 for muscle_string_decode and muscle_location_decode.
4490 (muscle_string_decode): New static function.
4491 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
4492 (muscle_percent_define_get, muscle_percent_define_ifdef): New
4493 functions.
4494 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
4495 muscle_percent_define_get to mimic the b4_percent_define_flag_if
4496 implementation more closely.
4497 (muscle_percent_define_invalid_value): New function.
4498 * src/muscle_tab.h (muscle_percent_define_get,
4499 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
4500 Prototype.
4501
75ad86ee
JD
45022007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
4503
4504 * NEWS (2.3a+): Mention yesterday's state-removal change.
4505 (2.3a): Remove the %language entry, which was added after 2.3a.
4506 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
4507 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
4508 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
4509 tests/existing.at: Update copyright date.
4510
5967f0cf
JD
45112007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4512
4513 If conflict resolution makes states unreachable, remove those states,
4514 report rules that are then unused, and don't report conflicts in those
4515 states.
4516 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
4517 New global function.
4518 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
4519 function.
4520 * src/main.c (main): After conflict resolution, remove the unreachable
4521 states and update all data structures that reference states by number.
4522 * src/state.c (state_new): Initialize each state's reachable member to
4523 false.
4524 (state_mark_reachable_states): New static function.
4525 (state_remove_unreachable_states): New global function.
4526 * src/state.h (struct state): Add member bool reachable.
4527 (state_remove_unreachable_states): Prototype.
4528 * tests/conflicts.at (Unreachable States After Conflict Resolution):
4529 New test case.
4530 * tests/existing.at (GNU pic Grammar): Update test case output now that
4531 an unused rule is discovered.
4532
b09f4f48
JD
45332007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4534
4535 Minor code cleanup in parser table construction.
4536 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
4537 (new_itemsets, save_reductions): Update for rename to nitemset.
4538 * src/closure.c (nritemset): Rename to...
4539 (nitemset): ... this since the "r" appears to meaningless and isn't
4540 used in the comments.
4541 (closure): Update for rename.
4542 * src/closure.h (nritemset): Update extern to...
4543 (nitemset): ... this.
4544 * src/lalr.c (LA): Fix a typo in comments.
4545 * src/print.c (print_core): Update for rename to nitemset.
4546 * src/print_graph.c (print_graph): Likewise.
4547 * src/state.h: Fix some typos in header comments.
4548
bbb44d83
PE
45492007-04-04 Paul Eggert <eggert@cs.ucla.edu>
4550
9b33de72
PE
4551 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
4552 still sticks to ASCII. Sorry!
4553
bbb44d83
PE
4554 * README-hacking: New file, taken mostly from coreutils, with changes
4555 for Bison. Contains much of the contents of:
4556 * README-cvs: Remove.
4557 * bootstrap: Sync from gnulib.
4558 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
4559 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
4560
29553547
JD
45612007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
4562
4563 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
4564 Setzer.
4565 (Java Differences): Fix some typos.
4566 * THANKS: Add Sebastian Setzer.
4567
01b477c6
PB
45682007-03-07 Paolo Bonzini <bonzini@gnu.org>
4569
730739e4
AD
4570 * data/java.m4 (b4_single_class_if): Remove.
4571 (b4_abstract_if): Look at "%define abstract".
4572 (b4_lexer_if): New.
4573 (b4_union_name): Rename...
4574 (b4_yystype): ... to this. Map to "%define stype".
4575 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
4576 b4_maybe_throws): Fix quoting.
4577 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
4578 * data/lalr1.java (Lexer interface): Always define.
4579 (Lexer interface within parser class): Remove.
4580 (YYLexer class): New, used when "%code lexer" is present.
4581 (constructor): When "%code lexer" is used, pass %lex-param
4582 to the lexer constructor.
4583 (yylex, yyparse): Remove %lex-param from method invocations
4584 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
4585
4586 * doc/bison.texinfo (Java Bison Interface): Mention "%define
4587 abstract". Rename "%define union_name" to "%define stype".
4588 Rename method names according to previous patch.
4589 (Java Scanner Interface): Describe "%code lexer" instead of
4590 "%pure-parser" and "%define single_class".
4591 (Java Differences): Mention "%code lexer".
4592
4593 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
4594 Include scanner here, using macros from tests/local.at.
4595 (AT_DATA_CALC_Y): Remove final argument.
4596 (_AT_CHECK_JAVA_CALC): Likewise.
4597 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
4598 of %locations and %error-verbose.
4599 (main): Test with and without %lex-param.
4600 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
4601 (AT_BISON_OPTION_POPDEFS): Pop it.
01b477c6 4602
122bea3a
JMG
46032007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4604
4605 DJGPP spefic issue. Inhibit the use of disallowed characters for
4606 file name genertion on Win98, WinXP, etc. These are |<>":?*\
4607 and concern testsuite case 46.
4608 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
4609 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
4610 * djgpp/config.bat: Inhibit the use of disallowed characters.
4611
9611cfa2
JD
46122007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4613
4614 Miscellaneous %define and %code cleanup.
4615 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
4616 values are interpreted.
4617 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
4618 documentation a little more.
4619 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
4620 muscle_percent_define_insert, muscle_percent_code_grow): New
4621 functions/macros.
4622 * src/muscle_tab.h (muscle_percent_define_insert,
4623 muscle_percent_code_grow): Prototype.
4624 * src/parse-gram.y (prologue_declaration): Use
4625 muscle_percent_define_insert and muscle_percent_code_grow when parsing
4626 %define and %code directives.
4627
4628 Make it easy to share %define boolean variables between the front-end
4629 and back-end. Though not used yet, this will be useful in the future.
4630 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
4631 Bison uses of names rather than just skeleton uses of names.
4632 (b4_percent_define_get, b4_percent_define_ifdef): Rename
4633 b4_percent_define_skeleton_variables(VARIABLE) to
4634 b4_percent_define_bison_variables(VARIABLE).
4635 (b4_percent_code_get, b4_percent_code_ifdef): Rename
4636 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
4637 b4_percent_code_bison_qualifiers(QUALIFIER).
4638 (b4_check_user_names_wrap): Update for renames.
4639 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
4640 muscle_percent_define_default): New functions mimicking
4641 b4_percent_define_flag_if and b4_percent_define_default.
4642
4643 For %define variables, report locations for invalid values and
bbb44d83 4644 redefinitions.
9611cfa2
JD
4645 * data/bison.m4 (b4_percent_define_flag_if): Read
4646 b4_percent_define_loc(VARIABLE) to report the location of an invalid
4647 value for VARIABLE.
4648 (b4_percent_define_default): Save a special location in
4649 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
4650 must later be reported as invalid.
4651 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
4652 functions.
4653 (muscle_percent_define_insert): Record the location of VARIABLE in
4654 muscle percent_define_loc(VARIABLE), and use it to report the previous
4655 location for a redefinition.
4656 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
4657 (muscle_percent_define_default): Update like b4_percent_define_default.
4658 (muscle_grow_user_name_list): Rename to...
4659 (muscle_user_name_list_grow): ... this for consistency and use
4660 muscle_location_grow.
4661 * src/muscle_tab.h (muscle_location_grow): Prototype.
4662 * tests/input.at (%define errors): Update expected output.
4663 * tests/skeletons.at (%define boolean variables: invalid skeleton
4664 defaults): New test case.
4665
0bf92491
JD
46662007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
4667
4668 * src/print.c (lookahead_set, state_default_rule): Remove.
4669 (print_reductions): Replace state_default_rule invocation with
4670 equivalent use of yydefact, which was computed in token_actions in
4671 tables.c.
4672 (print_results): Don't allocate lookahead_set.
4673
d3b12988
PB
46742007-02-27 Paolo Bonzini <bonzini@gnu.org>
4675
4676 * data/lalr1.java: Prefix all private members with yy.
4677
f57a7536
JD
46782007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
4679
4680 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 4681 Sebastien Fricker at
f57a7536 4682 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 4683 * THANKS: Add Sebastien Fricker.
f57a7536
JD
4684 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
4685 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
4686 accept a variable number of arguments.
4687
6404a5bf
JD
46882007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
4689
4690 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
4691
e4e09639
JMG
46922007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4693
4694 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
4695 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
4696 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
4697
d7e0a1a7
PE
46982007-02-11 Paul Eggert <eggert@cs.ucla.edu>
4699
4700 Undo my 2007-02-07 change, switching back to the c-strcase module
4701 introduced in the 2007-02-03 change. Bruno Haible reported that
4702 the 2007-02-07 change would be dangerous in Turkish if we add a
4703 language whose name contains "i", since "i" is not lowercase "I"
4704 in Turkish.
4705 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
4706 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
4707 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
4708 * m4/.cvsignore: Remove strcase.m4.
4709 * src/getargs.c: Revert 2007-02-07 change, as follows.
4710 Include c-strcase.h.
4711 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
4712
deee93a1
JD
47132007-02-11 Bruno Haible <bruno@clisp.org>
4714
4715 Enable the Java related testsuite tests when the only Java compiler
4716 found is a gcj < 4.3. Discussed at
4717 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
4718 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
4719
574add85
JD
47202007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
4721
4722 * data/Makefile.am: Update copyright date.
4723 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
4724 yypstate_new returns NULL.
4725 (yypstate_new): Return NULL if malloc does.
4726 * src/reader.c (packgram): Move translation of rule actions from the
4727 beginning of packgram to...
4728 (check_and_convert_grammar): ... here right before packgram is invoked
4729 so it's easier to write more complete comments, and remove redundant
4730 code.
4731
e785ccf7
JD
47322007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
4733
4734 As in semantic actions, make @$ in %initial-action, %destructor, and
4735 %printer imply %locations.
4736 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
4737 scanning @$.
4738 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
4739 (@$ in %initial-action implies %locations,
4740 @$ in %destructor implies %locations,
4741 @$ in %printer implies %locations): ... these new test cases.
4742
1cfe1ed7
PE
47432007-02-07 Paul Eggert <eggert@cs.ucla.edu>
4744
4745 Undo most of the 2007-02-03 change, switching to the strcase module
4746 now that gnulib strcase has been fixed.
4747 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
4748 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
4749 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
4750 * m4/.cvsignore: Add strcase.m4.
4751 * src/getargs.c: Revert 2007-02-03 change, as follows.
4752 Don't include c-strcase.h.
4753 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
4754 strcasecmp has "unspecified behavior" outside the POSIX locale,
4755 but it works fine in practice if at least one argument is ASCII,
4756 as is the case in Bison.
4757
0049ec86
PB
47582007-02-07 Paolo Bonzini <bonzini@gnu.org>
4759
4760 * tests/java.at: Skip tests if only one of javac/java is present.
4761 Reported by Joel E. Denny.
4762 * tests/atlocal.in: Adjust copyright years.
4763
47642007-02-05 Paolo Bonzini <bonzini@gnu.org>
4765
4766 * data/lalr1.java (Stack): Work around old verifiers that disallow
4767 access to the private fields of an inner class, from the outer class.
4768 We can make Stack's fields public because user code doesn't have access
4769 to the instance of Stack used by parse(). Reported by Paul Eggert.
4770
2c2b7220
PE
47712007-02-03 Paul Eggert <eggert@cs.ucla.edu>
4772
4773 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
4774 the right spot for these files?
4775 * bootstrap.conf (gnulib_modules): Add c-strcase.
4776 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
4777 c-strncasecmp.c.
4778 * src/getargs.c: Include c-strcase.h.
4779 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
4780 to avoid unspecified behavior.
4781
b2b81dae
JD
47822007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
4783
4784 * doc/bison.texinfo (Decl Summary): Correct typo.
4785
c1d19e10
PB
47862007-01-30 Paolo Bonzini <bonzini@gnu.org>
4787
4788 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
4789 Complain if the value does not match empty, "true" or "false".
4790 * data/c++.m4: Adjust default definitions of %define variables.
4791 * data/java.m4: Adjust default definitions of %define variables.
4792 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
4793 to above behavior.
4794 * tests/input.at (Boolean %define variables): Test new behavior.
4795
8405b70c
PB
47962007-01-29 Paolo Bonzini <bonzini@gnu.org>
4797
4798 * NEWS: Mention java.
4799 * TODO: Remove things that are done.
4800 * bootstrap.conf: Add javacomp-script and javaexec-script.
4801 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
4802
4803 * data/Makefile.am: Add new files.
4804 * data/java-skel.m4: New.
4805 * data/java.m4: New.
4806 * data/lalr1.java: New.
4807
4808 * doc/bison.texinfo: Put "A Complete C++ Example" under
4809 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
4810 under Other Languages.
4811
4812 * src/getargs.c (valid_languages): Add Java.
4813 * src/getargs.h (struct bison_language): Update size of string fields.
4814
4815 * tests/Makefile.am: Add java.at.
4816 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
4817 * tests/java.at: New.
4818 * tests/testsuite.at: Include it.
4819
3eb82471
JD
48202007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
4821
4822 Clean up.
4823 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
4824 at_directive_argv arguments so these no longer have to be global
4825 variables. Also, update the implementation for the following changes.
4826 (fail_for_at_directive_too_many_args,
4827 fail_for_at_directive_too_few_args): Add at_directive_name argument.
4828 (at_directive_name): Remove as at_directive_argv[0] will be used for
4829 this now.
4830 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
4831 for the directive name.
4832 (at_directive_argc, at_directive_argv): Make these local within
4833 skel_lex instead of global.
4834 (INITIAL): Update directive start action for above changes.
4835 (SC_AT_DIRECTIVE_ARG): Rename to...
4836 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
4837 (SC_AT_DIRECTIVE_SKIP_WS): Update.
4838 (scan_skel): Move yylex_destroy to...
4839 (skel_scanner_free): ... here.
4840 * tests/skeletons.at (installed skeleton file name): Rename to...
4841 (installed skeleton file names): ... this.
4842
148d66d8
JD
48432007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
4844
4845 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
4846 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
4847 Summary" not "Directives".
4848 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
4849 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
4850 since the former is now the more complete one.
4851 (Prologue Alternatives): Likewise and do the same for %defines.
4852 (Table of Symbols): Add summary of %code, add summary of %define, and
4853 move full %code documentation to...
4854 (Decl Summary): ... here for consistency with other entries in these
4855 sections.
4856 Move %define entry in order to keep this list alphabetized.
4857 Reword %define entry a little to put less emphasis on the skeleton
4858 concept, which most users shouldn't have to think about.
4859
665f0c24
PE
48602007-01-26 Paul Eggert <eggert@cs.ucla.edu>
4861
4862 Adjust to recent gnulib changes.
4863 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
4864 Add string.h, string_.h, unistd_.h, wchar_.h.
4865 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
4866 * src/system.h: Don't include <stpcpy.h>; this is now done by
4867 <string.h>.
4868
592d0b1e
PB
48692007-01-23 Paolo Bonzini <bonzini@gnu.org>
4870
4871 Simplify implementation of unqualified %code, implement macros for
4872 uniform treatment of boolean %define flags. Document %define.
4873 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
4874 b4_percent_code_ifdef): New.
4875 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
4876 * data/c++.m4: Define default value for global_tokens_and_yystype.
4877 * data/glr.cc: Likewise.
4878 * data/location.cc: Use b4_percent_define_flag_if.
4879
148d66d8 4880 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
4881
4882 * src/parse-gram.y (Unqualified %code): Change muscle name to
4883 b4_percent_code().
4884 (content.opt): Default to empty.
4885
a7867f53
JD
48862007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
4887
4888 Implement support for relative and absolute skeleton file names.
4889 Discussed starting at
4890 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
4891 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
4892 (Bison Options): Document in --skeleton entry.
4893 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
4894 full_skeleton can't necessarily hold all of pkgdatadir.
4895 If the specified skeleton file name contains a `/', don't prepend
4896 pkgdatadir.
4897 * src/parse-gram.y (prologue_declaration): If the specified skeleton
4898 file name contains a `/', prepend the grammar file directory.
4899 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
4900 * skeletons.at: New file.
4901 (relative skeleton file names): New test case.
4902 (installed skeleton file names): New test case.
4903 * tests/testsuite.at: Include skeletons.at.
4904
4905 * bootstrap: Update copyright to 2007.
4906
830c9b18
PB
49072007-01-17 Paolo Bonzini <bonzini@gnu.org>
4908
4909 * bootstrap: Remove occurrences of .#bootmp from the files.
4910
a8c2e813
AD
49112007-01-17 Akim Demaille <akim@epita.fr>
4912
4913 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
4914 nonterminals.
4915 Use per-type %printer.
4916
279cabb6
JD
49172007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
4918
4919 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
4920 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
4921 djgpp/config.site, src/files.c, src/files.h, src/main.c,
4922 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
4923 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
4924 tests/glr-regression.at, tests/input.at, tests/local.at,
4925 tests/output.at, tests/torture.at: Update copyright to 2007.
4926
bb32f4f2
AD
49272007-01-16 Akim Demaille <akim@epita.fr>
4928
4929 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
4930 error code.
4931 (Calc++ Scanner): Exit with failure if we can't open the input
4932 file.
4933 Accept "-" standing for stdin.
4934 (Calc++ Top Level): Print the result only if the parsing was
4935 successful.
4936
7cff04b5
AD
49372007-01-16 Akim Demaille <akim@epita.fr>
4938
4939 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
4940
a4e25e1d
JD
49412007-01-15 Paolo Bonzini <bonzini@gnu.org>
4942 and Joel E. Denny <jdenny@ces.clemson.edu>
4943
4944 Clean up %define and %code implementation in M4 some. Most
4945 importantly, rename all related macros to be in the b4_percent_define
4946 and b4_percent_code namespaces. Also, complete support for `.' in
4947 %define variable names and %code qualifiers.
4948 * data/bison.m4 (b4_check_user_names): Check for special
4949 "SKELETON-NAMESPACE(name)" macros instead of using two nested
4950 m4_foreach loops.
4951 (b4_get_percent_define, b4_get_percent_code): Rename to...
4952 (b4_percent_define_get, b4_percent_code_get): ... these.
4953 Extend documentation with examples.
4954 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
4955 b4_percent_define_skeleton_variables and
4956 b4_percent_code_skeleton_qualifiers.
4957 Expect any value for the %define variable `foo' to be stored in the
4958 macro named `b4_percent_define(foo)'; expect any %code blocks for the
4959 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
4960 expect any unqualified %code blocks to be stored in a macro named
4961 `b4_percent_code_unqualified'.
4962 Use m4_indir so that %define variable names and %code qualifiers can
4963 contain `.', which is allowed by the grammar parser.
4964 (b4_percent_define_default): New macro to set a default value for a
4965 %define variable.
4966 (m4_wrap): Update wrapped code, and fix some underquoting.
4967 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
4968 Expect grammar uses of %define variables and %code qualifiers to be
4969 defined in b4_percent_define_user_variables and
4970 b4_percent_code_user_qualifiers.
4971 * data/c++.m4: Use b4_percent_define_default rather than
4972 m4_define_default. Fix some underquoting. Skeleton usage of %define
4973 variable define_location_comparison now implies skeleton usage of
4974 %define variable filename_type.
4975 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
4976 data/push.c, data/yacc.c: Update macro names.
4977 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
4978 muscle names.
4979
e37c665c
JMG
49802007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4981
4982 DJGPP specific issues.
4983
4984 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
4985 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
4986
7d2d521f
JD
49872007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
4988
4989 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
4990 run parsers in all tests so that Valgrind is invoked during
4991 maintainer-check-valgrind.
4992 (Duplicate representation of merged trees): Free all semantic values.
4993 (Duplicated user destructor for lookahead): Likewise.
4994
e0ac9b4b
JD
49952007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
4996
4997 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
4998 command-line prefix.
4999 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
5000 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
5001 miss Valgrind messages.
5002 (Exploding the Stack Size with Malloc): Likewise.
5003
78143faa
JD
50042007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5005
5006 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
5007 locals. Reported by Juan Manuel Guerrero at
5008 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
5009 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
5010 Fix some indentation also.
5011 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
5012 explaining this issue.
5013
7ecec4dd
JD
50142007-01-09 Paolo Bonzini <bonzini@gnu.org>
5015 and Joel E. Denny <jdenny@ces.clemson.edu>
5016
5017 Simplify union and prologue handling, and escape union and lex/parse
5018 params with digraphs.
5019 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
5020 values to the empty string since these are no longer guaranteed
5021 initialized by the front-end.
5022 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
5023 braces around b4_user_stype since this is no longer done by the
5024 front-end.
5025 * src/files.c, src/files.h (pre_prologue_obstack,
5026 post_prologue_obstack): Remove.
5027 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
5028 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
5029 with digraphs. This fixes lex params and parse params.
5030 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
5031 * src/output.c (prepare): Remove muscle insertion of the prologues.
5032 (output): Remove freeing of pre_prologue_obstack and
5033 post_prologue_obstack.
5034 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
5035 than prologue_augment for prologue parsing so you don't need prologue
5036 obstacks.
5c80250c
JD
5037 (grammar_declaration): For %union RHS, use `braceless' instead of
5038 "{...}" so that braces are already stripped and code is escaped with
5039 digraphs.
7ecec4dd
JD
5040 * src/reader.c (prologue_augment): Remove.
5041 (reader): Remove initialization of pre_prologue_obstack and
5042 post_prologue_obstack.
5043 * src/reader.h (prologue_augment): Remove.
5044
5045 * data/c.m4: Remove stray parenthesis.
5046
16dc6a9e
JD
50472007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5048
5049 Remove quotes from variables names in %define directives and from
5050 qualifiers in %code directives, and restrict the characters that are
5051 allowed in them to M4-friendly ones. For %define, continue to support
5052 the quoted form as a deprecated feature. Discussed starting at
5053 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
5054 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
5055 %code.
5056 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
5057 (Decl Summary): In %defines entry, update mention of `%code requires'
5058 and `%code provides'.
16dc6a9e
JD
5059 (C++ Location Values): Update %define uses.
5060 (Calc++ Parser Interface): Likewise.
5061 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 5062 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
5063 * src/parse-gram.y (prologue_declaration): For %define variables, use
5064 `variable' instead of `STRING'.
5065 (grammar_declaration): For %code qualifiers, use `ID' instead of
5066 `STRING'.
5067 (variable): New nonterminal that takes an `ID' or a `STRING'.
5068 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
5069 and %define uses.
5070 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
5071 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
5072 (%define errors): Update %define uses.
5073
e9813cd4
JD
50742007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5075
5076 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
5077 instead of muscle_insert for %define values so that M4-special
5078 characters are replaced with digraphs.
5079 * tests/input.at (%define errors): Extend to check weird values.
5080
6afc30cc
JD
50812007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5082
5083 Instead of having skeletons declare all valid %define variables and
5084 %code qualifiers, provide macros that retrieve the associated values
5085 and build these lists automatically. Thus Bison will now warn when a
5086 variable or qualifier is not used by the skeleton in the current
5087 invocation regardless of whether it might sometimes be used by that
5088 skeleton in other invocations. Also, move all %define value macros to
5089 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
5090 form, which is replaced by %code.
5091 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
5092 (b4_check_user_names): ... this, and change the series of valid name
5093 arguments to a single list argument for names used in the skeleton
5094 similar to the existing list argument for names used in the grammar.
5095 Warn instead of complaining.
5096 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
5097 values and %code code, to format %code code properly, and to build
5098 lists of all %define variables and %code qualifiers used in the
5099 skeleton: b4_skeleton_percent_define_variables and
5100 b4_skeleton_percent_code_qualifiers.
5101 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
5102 Remove, and...
5103 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
5104 the skeleton names lists can finish building first. In place of
5105 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
5106 expect the lists b4_user_percent_define_variables and
5107 b4_user_percent_code_qualifiers.
5108 * data/c++.m4: Where setting default values for b4_parser_class_name,
5109 b4_location_type, b4_filename_type, b4_namespace, and
5110 b4_define_location_comparison, update their names to the
5111 b4_percent_define_ namespace.
5112 * data/glr.c: Don't use b4_check_percent_define_variables and
5113 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
5114 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
5115 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 5116 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
5117 * data/location.cc: Use b4_get_percent_define.
5118 * data/push.c: Don't use b4_check_percent_define_variables and
5119 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
5120 * data/yacc.c: Likewise, and don't call m4_exit in
5121 b4_use_push_for_pull_if or m4_wrap code will never execute.
5122 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
5123 Rename to...
5124 (muscle_grow_user_name_list): ... this for consistency with the
5125 terminology used in bison.m4.
5126 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
5127 %define variable names, and rename muscle used_percent_define_variables
5128 to user_percent_define_variables.
5129 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
5130 user_percent_code_qualifiers.
5131 (content): Remove.
5132 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
5133 {CODE} form is no longer accepted.
5134 * tests/input.at (Reject bad %code qualifiers): Rename to...
5135 (Reject unused %code qualifiers): ... this, and update test output.
5136 (%define error): Update test output.
5137
7eb8a0bc
JD
51382007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
5139
5140 Check for unrecognized %define variables similar to checking for
5141 unrecognized %code qualifiers. Check for redefined %define variables.
5142 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
5143 generalizes...
5144 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
5145 (b4_check_percent_define_variables): New, also wraps it.
5146 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
5147 variables using b4_check_percent_define_variables.
5148 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
5149 all those exercised in the test suite and all those listed in the
5150 `Default values' section of c++.m4. Are there others?
5151 * data/push.c, data/yacc.c: Declare no valid %define variables.
5152 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
5153 similar to muscle_find, but it works even when the muscle stores a
5154 const value.
5155 (muscle_grow_used_name_list): New function for constructing the used
5156 name list muscles that b4_check_for_unrecognized_names requires.
5157 * src/parse-gram.y (prologue_declaration): Warn if a variable is
5158 %define'd more than once. Define the b4_used_percent_define_variables
5159 muscle with muscle_grow_used_name_list.
5160 (grammar_declaration): Abbreviate %code code with
5161 muscle_grow_used_name_list.
5162 * tests/input.at (%define errors): New.
5163
3fc65ead
JD
51642007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5165
5166 Provide warn_at, complain_at, and fatal_at function callbacks to the
5167 skeletons, and use this for %code qualifier complaints.
5168 * data/bison.m4 (b4_error_at): New, invoked by...
5169 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
5170 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
5171 @fatal_at(...@) directives.
5172 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
5173 qualifiers in b4_used_percent_code_qualifiers and to use
5174 b4_complain_at.
5175 * src/location.c, src/location.h (boundary_set_from_string): New global
5176 function.
5177 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
5178 function.
5179 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
5180 to b4_used_percent_code_qualifiers.
5181 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
5182 function.
5183 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
5184 (lineno): Rename to...
5185 (out_lineno): ... this so I don't misunderstand it again.
5186 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
5187 here; these newlines are in the input but not the output file.
5188 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
5189 (at_directive_perform): ... this new static function, and add handling
5190 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
5191 directives.
5192 * tests/input.at (Reject bad %code qualifiers): Update test output with
5193 locations and extend.
5194
5195 * tests/output.at (Output file name: [, Output file name: ]): Remove
5196 bogus comment about these tests failing.
5197
1c7b7e1d
JD
51982007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5199
5200 Clean up b4_check_percent_code_qualifiers a little.
5201 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
5202 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
5203 documentation and add examples.
5204 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
5205 qualifiers here.
5206
08af01c2
JD
52072007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
5208
5209 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
5210 unreliable -- especially when they're hidden inside another macro.
5211 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
5212 data/c.m4: Remove m4_divert(-1).
5213 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5214 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
5215 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 5216 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
5217 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
5218 pushed and popped by m4sugar, should be first on the stack.
5219
5220 Provide warn, complain, and fatal function callbacks to the skeletons.
5221 This provides more flexibility than m4_fatal, improves the error
5222 message format, and captures messages for translation. Discussed
5223 starting at
5224 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
5225 * data/bison.m4 (b4_error): New, invoked by...
5226 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
5227 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
5228 directives. Because these M4 macros might be called when the current
5229 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
5230 the previous removal of uses of m4_divert, which caused trouble.
5231 (b4_check_percent_code_qualifiers): Use b4_complain instead of
5232 m4_fatal to report unrecognized %code qualifiers.
5233 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
5234 push parser requests.
5235 * data/glr.c: Use b4_complain instead of m4_fatal to report
5236 non-deterministic push parser requests.
5237 Update @output usage to @output(...@) form.
5238 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
5239 report missing %defines. Update @output usage to @output(...@) form.
5240 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
5241 @output(...@) form.
5242 * src/main.c (main): Invoke skel_scanner_free.
5243 * src/scan-skel.h (skel_scanner_free): Prototype new function.
5244 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
5245 obstack_for_string from flex-scanner.h.
5246 (YY_DECL): Use to declare skel_lex static.
5247 (decode_at_digraphs): Remove; now handled in the new
5248 SC_AT_DIRECTIVE_ARG start condition.
5249 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
5250 functions.
5251 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
5252 at_directive_argv): New static globals.
5253 (INITIAL): Use fail_for_invalid_at.
5254 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
5255 recognize the start of a generalized `@directive(...@)' form and
5256 start...
5257 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
5258 directive args (using the new obstack_for_string), to decode the
5259 contained @ diagraphs, and to perform the directive. It recognizes
5260 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
5261 @output(...@).
5262 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
5263 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
5264 `@,'.
5265 (scan_skel): Initialize obstack_for_string on the first call.
5266 (skel_scanner_free): New function to free obstack_for_string.
5267 * tests/input.at (Reject bad %code qualifiers): Update test output.
5268
8e0a5e9e
JD
52692007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
5270
5271 Consolidate the 4 prologue alternative directives (%code, %requires,
5272 %provides, and %code-top) into a single %code directive with an
5273 optional qualifier field. Discussed at
5274 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
5275 * NEWS (2.3a+): Rewrite the existing entry for the prologue
5276 alternatives.
5277 * doc/bison.texinfo (Prologue Alternatives): Update.
5278 (Decl Summary): Update to %code "requires" and %code "provides".
5279 (Calc++ Parser): Update to %code "requires".
148d66d8 5280 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
5281 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
5282 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
5283 are replaced by b4_percent_code_provides and b4_percent_code_requires,
5284 which are skeleton-specific.
5285 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
5286 declare what %code qualifiers it supports and to complain if any other
5287 qualifiers were used in the grammar.
5288 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
5289 and b4_user_code([b4_percent_code_provides]) in place of
5290 b4_user_requires and b4_user_provides.
5291 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
5292 Add b4_user_code([b4_percent_code_top]) and
5293 b4_user_code([b4_percent_code]).
5294 Invoke b4_check_percent_code_qualifiers.
5295 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
5296 PERCENT_REQUIRES): Remove.
5297 (grammar_declaration): Remove RHS's for %code-top, %provides, and
5298 %requires. Rewrite the %code RHS as the unqualified form defining the
5299 muscle b4_percent_code. Add another RHS for the qualified %code form,
5300 which defines muscles of the form b4_percent_code_QUALIFIER and the
5301 b4_used_percent_code_qualifiers muscle.
5302 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
5303 PERCENT_REQUIRES): Remove.
5304 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
5305 %code "requires" and %code "provides".
5306 * tests/input.at (Reject bad %code qualifiers): New.
5307
95021767
JD
53082007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
5309
5310 Use the new code_props interface for destructors and printers.
5311 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
5312 printer_location members, and change the type of the destructor and
5313 printer members to code_props.
5314 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
5315 symbol_printer_get, semantic_type_destructor_set,
5316 semantic_type_printer_set, default_tagged_destructor_set,
5317 default_tagless_destructor_set, default_tagged_printer_set,
5318 default_tagless_printer_set): Use code_props in arguments and return
5319 types in place of char const * and location.
5320 (symbol_destructor_location_get, symbol_printer_location_get): Remove
5321 since the locations are now contained in the return of
5322 symbol_destructor_get and symbol_printer_get.
5323 * src/output.c (symbol_destructors_output, symbol_printers_output):
5324 Replace with...
5325 (symbol_code_props_output): ... this to eliminate duplicate code.
5326 (output_skeleton): Update to use symbol_code_props_output.
5327 * src/reader.c (symbol_should_be_used): Update use of
5328 symbol_destructor_get.
5329 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
5330 Update uses of the various _destructor_set and _printer_set functions.
5331 * src/symtab.c: (default_tagged_destructor_location,
5332 default_tagless_destructor_location, default_tagged_printer_location,
5333 default_tagless_printer_location): Remove since we...
5334 (default_tagged_destructor, default_tagless_destructor,
5335 default_tagged_printer, default_tagless_printer): ... change the type
5336 of these to code_props.
5337 (symbol_new, semantic_type_new, symbol_destructor_set,
5338 semantic_type_destructor_set, symbol_destructor_get,
5339 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
5340 symbol_check_alias_consistency, default_tagged_destructor_set,
5341 default_tagless_destructor_set, default_tagged_printer_set,
5342 default_tagless_printer_set): Update.
5343 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
5344 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
5345 code_props members.
5346 (symbol_print): Use SYMBOL_CODE_PRINT.
5347
f6857bbf
JD
53482007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
5349
5350 Use the new code_props interface for rule actions.
5351 * src/symlist.h (symbol_list): Replace action, action_location, and
5352 used members with a code_props action_props member.
5353 * src/reader.c (symbol_should_be_used, grammar_rule_check,
5354 grammar_midrule_action, grammar_current_rule_merge_set,
5355 grammar_current_rule_symbol_append, packgram): Update.
5356 * src/scan-code.h (translate_rule_action): Remove, no longer used.
5357 * src/scan-code.l (handle_action_dollar): Update.
5358 (translate_rule_action): Remove, no longer used.
5359 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
5360
7c0c6181
JD
53612007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5362
5363 Use the new code_props interface in parse-gram.y.
5364 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
5365 Update all uses of translate_* functions to use the new code_props
5366 interface and to use gram_scanner_last_string_free and
5367 code_scanner_last_string_free where possible.
5368 (grammar_declaration): symbol_list_destructor_set and
5369 symbol_list_printer_set now perform the translation, so don't do it
5370 here. Use gram_scanner_last_string_free where possible.
5371 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
5372 translate_code): Remove, no longer used.
5373 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
5374 symbol_list_printer_set): Perform code translation here rather than
5375 depending on the caller to do so.
5376
5377 * src/symlist.h (struct symbol_list): Correct some documentation typos.
5378 * src/scan-gram.h (gram_last_string): Remove declaration.
5379 * src/scan-gram.l (last_string): Declare it static.
5380
28e52c0d
JD
53812007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5382
5383 Encapsulate code properties and related functionality for the various
5384 destructors, printers, and actions into a code_props structure and
5385 interface. This patch merely implements code_props in scan-code.h and
5386 scan-code.l. Future patches will rewrite other modules to use it.
5387 Discussed starting at
5388 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
5389 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
5390 consistently initialize const structs that have an empty location
5391 field.
5392 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
5393 to ensure consistency.
5394 * src/scan-code.h (code_props): New structure.
5395 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
5396 function, macro, and const global variable for initializing a
5397 code_props with no code.
5398 (code_props_plain_init, code_props_symbol_action_init,
5399 code_props_rule_action_init, code_props_translate_code): The rest of
5400 the new code_props functional interface. Among other things, the init
5401 functions set the code_props kind field so that
5402 code_props_translate_code will know whether to behave like
5403 translate_symbol_action, translate_rule_action, or translate_code.
5404 These old translate functions must remain until all other modules are
5405 updated to use the new code_props interface.
5406 (code_scanner_last_string_free): New function similar to
5407 gram_scanner_last_string_free.
5408 (code_scanner_free): Add documentation.
5409 * src/scan-code.l: Implement the new interface.
5410 (code_lex): Make it static, add a code_props* argument, and remove the
5411 rule argument.
5412 (last_string): New static global similar to the one in scan-gram.l.
5413 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
5414 instead of rule.
5415 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
5416 code_props since Bison may one day use this information for destructors
5417 and printers.
5418 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
5419 (handle_action_dollar): Use symbol_list_n_get and set used flag
5420 directly since symbol_list_n_used_set is removed.
5421 (translate_action): Add a code_props* argument and remove the rule,
5422 action, and location arguments. Pass the code_props* on to code_lex.
5423 (translate_rule_action, translate_symbol_action, translate_code):
5424 Rewrite as wrappers around the new code_props interface.
5425 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
5426 it would eventually need to break the encapsulation of code_props.
5427
96034983
JD
54282007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
5429
5430 * etc/.cvsignore: New.
5431
945e396c
JD
54322007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
5433
5434 Add maintainer-push-check to run maintainer-check using push parsing in
5435 place of pull parsing where available.
5436 * Makefile.am (maintainer-push-check): New.
5437 * data/bison.m4 (b4_use_push_for_pull_if): New.
5438 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
5439 appropriately based on their existing values.
5440 (yypush_parse): Don't print push-parser-specific diagnostics if push
5441 parsing is being used in place of pull parsing.
5442 * data/yacc.c: If push parsing should replace pull parsing, redirect to
5443 push.c.
5444 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
5445 variable, and insert b4_use_push_for_pull_flag into muscles.
5446 * tests/Makefile.am (maintainer-push-check): New.
5447
7d596384
JD
54482006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
5449
5450 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
5451 (whether successful or failed) so that yypush_parse can be invoked
5452 again to start a new parse using the same yypstate.
5453 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
5454 check multiple yypull_parse invocations on the same yypstate. For pull
5455 mode, extend to check multiple yyparse invocations.
5456 (Exploding the Stack Size with Alloca): Extend to try with
5457 %push-pull-parser.
5458 (Exploding the Stack Size with Malloc): Likewise.
5459
5460 * tests/calc.at (Simple LALR Calculator): Don't specify
5461 %skeleton "push.c" since %push-pull-parser implies that now.
5462 * tests/headers.at (export YYLTYPE): Don't check for the push
5463 declarations. Otherwise, this test case can't be used to see if push
5464 mode can truly emulate pull mode.
5465 * tests/input.at (Torturing the Scanner): Likewise.
5466 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
5467 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
5468 AT_YACC_IF, which now includes the case of push mode since %skeleton
5469 need not be used for push mode. This will be more intuitive once
5470 push.c is renamed to yacc.c.
5471
7172e23e
JD
54722006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
5473
5474 For push mode, convert yyparse from a macro to a function, invoke yylex
5475 instead of passing a yylexp argument to yypull_parse, and don't
5476 generate yypull_parse or yyparse unless %push-pull-parser is declared.
5477 Discussed starting at
5478 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
5479 * data/bison.m4 (b4_pull_if): New.
5480 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
5481 * data/push.c: Improve M4 quoting a little.
5482 (b4_generate_macro_args, b4_parenthesize): Remove.
5483 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
5484 any time a pull parser is requested.
5485 Don't #define this as a wrapper around yypull_parse. Instead, when
5486 both push and pull are requested, make it a function that does that
5487 same thing.
5488 (yypull_parse): If there's a b4_prefix, #define this to
5489 b4_prefix[pull_parse] when both push and pull are requested.
5490 Don't define this as a function unless both push and pull are
5491 requested.
5492 Remove the yylexp argument and hard-code yylex invocation instead.
5493 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
5494 %push-parser.
5495 * src/getargs.c (pull_parser): New global initialized to true.
5496 * getargs.h (pull_parser): extern it.
5497 * src/output.c (prepare): Insert pull_flag muscle.
5498 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
5499 (prologue_declaration): Set both push_parser and pull_parser = true for
5500 %push-pull-parser. Set push_parser = true and pull_parser = false for
5501 %push-parser.
5502 * src/scan-gram.l: Don't accept %push_parser as an alternative to
5503 %push-parser since there's no backward-compatibility concern here.
5504 Scan %push-pull-parser.
5505 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
5506 instead of %push-parser.
5507 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
5508 prototype it in the module that calls yyparse.
5509 * tests/input.at (Torturing the Scanner): Likewise.
5510 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
5511
2e7944cb
JD
55122006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
5513
5514 Update etc/bench.pl. Optimize push mode a little (the yyn change
5515 deserves most of the credit).
5516 * Makefile.am (SUBDIRS): Add etc subdirectory.
5517 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
5518 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
5519 yytoken, yyval, and yyloc declarations to...
5520 (yyparse or yypush_parse): ... here to improve performance. For
5521 yypush_parse invocations after the first, be sure to assign yyn its old
5522 value again.
5523 (yypstate_new): Don't bother initializing the yyresult field since the
5524 initial value isn't used.
5525 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
5526 remove the #define that, in push mode, set it to yyps->NAME.
5527 * etc/Makefile.am: New.
5528 * etc/bench.pl: Remove and build it instead from...
5529 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
5530 "tests/bison" from the build directory by default rather than just
5531 invoking "bison" from $PATH.
5532 (calc_grammar): Update push parser code: don't declare yylval globally,
5533 don't define yyparse_wrapper, and don't #define yyparse.
5534 (bench_grammar): Update to check all working combinations of yacc.c,
5535 push.c, impure, pure, pull, and push.
5536
c3d50342
JD
55372006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
5538
5539 For push mode, add pull wrappers around yypush_parse.
5540 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
5541 (yypull_parse): New function wrapping yypush_parse.
5542 (yyparse): New #define wrapping yypull_parse.
5543 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
5544 is declared.
5545 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
5546 prototype yylex in the module that calls yyparse, and don't prototype
5547 yyparse there. Otherwise, the yyparse expansion won't compile.
5548 * tests/input.at (Torturing the Scanner): Likewise.
5549
94ebeba5
JD
55502006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
5551
5552 Enable push parsers to operate in impure mode. Thus, %push-parser no
5553 longer implies %pure-parser. The point of this change is to move
5554 towards being able to test the push parser code by running the entire
5555 test suite as if %push-parser had been declared.
5556 * data/push.c (yypush_parse): For impure mode, remove the
5557 yypushed_char, yypushed_val, and yypushed_loc arguments.
5558 Instead, declare these as local variables initialized to the global
5559 yychar, yylval, and yylloc.
5560 For the first yypush_parse invocation only, restore the initial values
5561 of these global variables when it's time to read a token since they
5562 have been overwritten.
5563 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
5564 %push-parser.
5565 * tests/calc.at (Simple LALR(1) Calculator): Always declare
5566 %pure-parser along with %push-parser since this test case was designed
5567 for pure push parsers.
5568 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
5569 (AT_YACC_OR_PUSH_IF): New.
5570 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
5571 add a note that it's still wrong for some cases (as it has been for a
5572 while).
5573 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
5574 %push-parser no longer implies %pure-parser.
5575
a0633178
JD
55762006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5577
5578 Remove some unnecessary differences between the pull parser code and
5579 the push parser code. This patch enables yynerrs in push mode.
5580 * data/push.c: Reformat M4 a little.
5581 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
5582 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
5583 because push mode is on. Instead, if pure mode is on, move yynerrs
5584 to...
5585 (b4_declare_parser_state_variables): ... here.
5586 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
5587 to yyps->NAME so it can be used in yypush_parse.
5588 (yypush_parse): Don't omit uses of yynerrs in push mode.
5589
8646b6a3
JD
55902006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5591
5592 Fix bug such that the first pushed token's value and location are
5593 sometimes overwritten (sometimes by %initial-action) before being used.
5594 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
5595 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
5596 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
5597 more closely mimic the pull parser logic.
5598 Don't copy the pushed token to yychar, yylval, and yylloc until it's
5599 time to read a token, which is after any initialization of yylval and
5600 yylloc.
5601 (gottoken): Rename label to...
5602 (yyread_pushed_token): ... for clarity and to avoid infringing on the
5603 user namespace.
5604
9baf4d74
JD
56052006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5606
5607 Rearrange initialization of the parser state variables so that the
5608 skeleton doesn't have to have a copy for pull mode and another for push
5609 mode. This patch also fixes at least a bug such that yylloc was not
5610 initialized (with b4_location_initial_line and
5611 b4_location_initial_column) upon calling yypush_parse. However, that
5612 initialization now overwrites the first token's location;
5613 %initial-action assigning @$ already did the same thing, and both bugs
5614 will be fixed in a later patch.
5615 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
5616 (b4_declare_parser_state_variables): Remove initialization of yytoken,
5617 yyss, yyvs, yyls, and yystacksize.
5618 (yypstate_new): Remove initialization of some yypstate fields: yystate,
5619 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
5620 yylsp.
5621 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
5622 yyps->NAME so it can be used in yypush_parse.
5623 (yyparse or yypush_parse): For yypush_parse, don't print the
5624 "Starting parse" diagnostic for invocations after the first.
5625 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
5626 yypush_parse, only do it for the first invocation.
5627 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
5628 initialization to occur in yypush_parse but only on the first
5629 invocation.
5630
23522164
JD
56312006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5632
5633 * data/push.c: Add CPP guards around push parser declarations in both
5634 the header and the code file.
5635 In the code file, move the push parser declarations to the same place
5636 they appear in the header file.
5637 Clean up the M4 some, especially the inconsistent underquoting in
5638 some b4_c_function_def and b4_c_function_decl uses.
5639
bb010fe5
JD
56402006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5641
5642 Encapsulate the push parser state variables into an M4 macro so the
5643 push skeleton doesn't have to list them again for pull mode's yyparse.
5644 For push mode, remove yypush_parse's local equivalents of these
5645 variables to eliminate unnecessary copying between the two sets at
5646 run-time. This patch also fixes at least a bug related to multiple
5647 %initial-action invocations in push mode.
5648 * data/push.c (b4_declare_parser_variables): Rename to...
5649 (b4_declare_scanner_communication_variables): ... this for clarity and
5650 update both uses.
5651 (b4_declare_yyparse_variables): Remove and move its contents to the one
5652 spot where it was invoked.
5653 (b4_declare_parser_state_variables): New macro containing the parser
5654 state variables required by push mode.
5655 (struct yypstate): Replace all fields but yynew with
5656 b4_declare_parser_state_variables.
5657 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
5658 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
5659 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
5660 (yyparse or yypush_parse): For yyparse in pull mode, replace local
5661 parser state variable declarations with
5662 b4_declare_parser_state_variables.
5663 Don't initialize parser state variables when calling yypush_parse since
5664 yypstate_new already does that.
5665 Invoke the user's initial action only upon the first yypush_parse
5666 invocation.
5667 Remove all code that copies between the local parser state variables
5668 and the yypstate.
5669
2d212f8c
JD
56702006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5671
5672 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
5673 prevent a name collision in a future patch where these names will
5674 sometimes be #define'd.
5675 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
5676 since it no longer has the same name as the existing argument.
5677 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
5678
e6e704dc
JD
56792006-12-19 Paolo Bonzini <bonzini@gnu.org>
5680 and Joel E. Denny <jdenny@ces.clemson.edu>
5681
5682 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
5683 that the argument is case-insensitive, and there's no `=' here.
5684 For the %skeleton entry, mention that %language is better.
5685 (Bison Options): Likewise for --language and --skeleton. Move the
5686 --skeleton entry so that the `Tuning the parser' section is sorted
5687 alphabetically on long options.
5688 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
5689 %language directive in detail here; cross-reference the %language
5690 documentation instead.
5691 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
5692 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 5693 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
5694 * examples/extexi (normalize): Instead of replacing every %require
5695 argument with the current Bison version, just substitute for
5696 `@value{VERSION}'. This guarantees that we're testing what actually
5697 appears in the documentation.
5698 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
5699 rather than `@VERSION@'.
5700
0e021770
PE
57012006-12-18 Paul Eggert <eggert@cs.ucla.edu>
5702
fd575f05
PE
5703 * NEWS: Reword the %language news a bit, and put it earlier.
5704
0e021770
PE
5705 * src/getargs.c (skeleton_arg): Last arg is now location const *.
5706 Rewrite to simplify the logic.
5707 (language_argmatch): Likewise.
fd575f05
PE
5708 (program_name): We now own this var.
5709 * src/getargs.h (struct bison_language): Use char[] rather than
5710 const char *.
0e021770
PE
5711
5712 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
5713 Java is supported.
5714 * src/complain.c (program_name): Remove decl; no longer needed.
5715 * src/main.c (program_name): Remove; now belongs to getargs.
5716
57172006-12-18 Paolo Bonzini <bonzini@gnu.org>
5718
5719 * NEWS: Document %language.
5720
5721 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
5722
5723 * data/c-skel.m4, data/c++-skel.m4: New files.
5724 * data/glr.c: Complain on push parsers.
5725
5726 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
5727 over %skeleton.
148d66d8 5728 (Decl Summary): Document %language and %skeleton.
0e021770
PE
5729 (Command line): Document -L.
5730
5731 * examples/extexi: Rewrite %require directive.
5732 * examples/calc++/Makefile.am: Pass VERSION to extexi.
5733
5734 * src/files.c (compute_exts_from_gc): Look in language structure
5735 for .y extension.
5736 (compute_file_name_parts): Check whether .tab should be added.
5737 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
5738 (language, skeleton_arg, language_argmatch): New.
5739 (long_options): Add --language.
5740 (getargs): Use skeleton_arg, add -L/--language.
5741 * src/getargs.h: Include location.h.
5742 (struct bison_language, language, skeleton_arg, language_argmatch): New.
5743 * src/output.c (prepare): Pick default skeleton from struct language.
5744 Don't dispatch C skeletons here.
5745 * src/parse-gram.y (PERCENT_LANGUAGE): New.
5746 (prologue_declaration): Add "%language" rule, use skeleton_arg.
5747 * src/scan-gram.l ("%language"): New rule.
5748
5749 * tests/calc.at: Test %skeleton and %language.
5750 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
5751 (AT_GLR_IF): Look for %skeleton "glr.cc".
5752 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
5753 (AT_YACC_IF): Reject %language.
5754
5691bf57
PE
57552006-12-18 Paul Eggert <eggert@cs.ucla.edu>
5756
db06f0ce
PE
5757 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
5758 since it wasn't used; only the typedef name 'semantic_type' is needed.
5759 Also, omit trailing white space.
5760
5691bf57
PE
5761 * bootstrap: Sync from coreutils.
5762 (gnulib_extra_files): Add build-aux/announce.gen.
5763 (slurp): Adjust .gitignore files like .cvsignore files.
5764 * build-aux/announce-gen: Remove from CVS, since bootstrap
5765 now creates this.
5766
791934e4
JD
57672006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
5768
5769 Make %push-parser imply %pure-parser. This fixes several bugs; see
5770 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
5771 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
5772 pure_parser = true.
5773 * data/push.c: Don't bother testing b4_push_if when deciding whether
5774 to expand b4_declare_parser_variables globally.
5775 (yypush_parse): Likewise in here.
5776
5777 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
5778 (yy_reduce_print): Reformat M4 for readability.
5779
ee5abb37
JD
57802006-12-15 Bob Rossi <bob@brasko.net>
5781 and Joel Denny <jdenny@ces.clemson.edu>
5782
5783 * data/push.c (yypstate): Add typedef, and update all uses of
5784 struct yypstate to just yypstate.
5785 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
5786
16ca01f9
JD
57872006-12-14 Bob Rossi <bob@brasko.net>
5788
5789 * data/push.c (yypush_parse): Declare prototype regardless of
5790 %locations option.
5791
ab8e7e1a
JD
57922006-12-14 Bob Rossi <bob@brasko.net>
5793
5794 * data/push.c (yyparse): Remove the prototype and the #define when in
5795 push-parser mode.
5796
9bf32be3
JD
57972006-12-13 Bob Rossi <bob@brasko.net>
5798
5799 * data/push.c (yypstate_init): Rename to...
5800 (yypstate_new): ... this and use b4_c_function_def.
5801 (yypstate_delete): New.
5802 (yypush_parse): Change parameters yynval and yynlloc to be const.
5803 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
5804 yypstate_delete functions.
5805
f02e2948
JD
58062006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
5807
5808 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
5809 strange test case titles. Reported by Bob Rossi.
5810
38eb7751
PE
58112006-12-13 Paul Eggert <eggert@cs.ucla.edu>
5812
5813 * TODO: Add pointer to Sylvain Schmitz's work on static detection
5814 of potential ambiguities in GLR grammers.
5815
bd9d212b
JD
58162006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
5817
5818 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
5819 `bison ', use m4_index instead of m4_substr since chopping up a string
5820 containing M4-special characters causes problems here.
5821
5822 Fix a couple of bugs related to special characters in user-specified
5823 file names, and make it easier for skeletons to compute output file
5824 names with the same file name prefix as Bison-computed output file
5825 names.
5826 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
5827 b4_parser_file_name and b4_spec_defines_file instead of
5828 @output_parser_name@ and @output_header_name@, which are now redundant.
5829 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
5830 b4_parser_file_name, b4_spec_defines_file, and the new
5831 @basename(FILENAME@) instead of @output_parser_name@ and
5832 @output_header_name@, which inappropriately escaped the file names as
5833 C string literals.
5834 * src/files.c (all_but_ext): Remove static qualifier.
5835 (compute_output_file_names): Move `free (all_but_ext)' to...
5836 (output_file_names_free): ... here since all_but_ext is needed later.
5837 * src/files.h (all_but_ext): Extern.
5838 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
5839 exactly what MUSCLE_INSERT_STRING used to do.
5840 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
5841 characters are escaped properly.
5842 * src/output.c (prepare): Define muscle file_name_all_but_ext as
5843 all_but_ext.
5844 For pkgdatadir muscle, maintain previous functionality by using
5845 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
5846 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
5847 digraphs would never be expanded. Hopefully no one has M4-special
5848 characters in his Bison installation path.
5849 * src/scan-skel.l: Don't parse @output_header_name@ and
5850 @output_parser_name@ anymore since they're now redundant.
5851 In @output, use decode_at_digraphs.
5852 Parse a new @basename command that invokes last_component.
5853 (decode_at_digraphs): New.
5854 (BASE_QPUTS): Remove unused.
5855 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
5856 (Output file name): New tests.
5857
3f7ca628
JD
58582006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
5859
5860 Warn about output files that are generated by the skeletons and that
5861 conflict with other output files.
5862 * data/glr.c: Don't generate the header file here when glr.cc does.
5863 * src/files.c (file_names, file_names_count): New static globals.
5864 (compute_output_file_names): Invoke output_file_name_check for files
5865 not generated by the skeletons and remove existing checks.
5866 (output_file_name_check): New function that warns about conflicting
5867 output file names.
5868 (output_file_names_free): Free file_names.
5869 * src/files.h (output_file_name_check): Declare.
5870 * src/scan-skel.l: Invoke output_file_name_check for files generated by
5871 the skeletons.
5872 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
5873 (Conflicting output files): New tests.
5874
178e123e
PE
58752006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5876
5877 * doc/bison.texinfo: Fix a couple of typos.
5878
58792006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
5880
5881 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
5882 Rename to...
5883 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
5884 update all uses.
5885 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
5886 (yypush_parse): Rename yypvars argument to yyps and remove redundant
5887 local pv.
5888 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
5889 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
5890
ea17f233
JD
58912006-12-07 Bob Rossi <bob@brasko.net>
5892 and Joel Denny <jdenny@ces.clemson.edu>
5893
5894 * data/push.c (yypvarsinit): Change return type from void* to struct
5895 yypvars*. No longer cast to void* on return.
5896 (struct yypvars): Remove yylen since it need not be remembered between
5897 yypushparse invocations.
5898 (yypushparse): Don't copy between yylen and pv->yylen.
5899
55a30bda
JD
59002006-12-05 Bob Rossi <bob@brasko.net>
5901
5902 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
5903 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
5904 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
5905 (struct yypvars): Remove b4_declare_parser_variables.
5906 (yypvarsinit): Remove init code for removed variables.
5907 (global scope): Do not declare b4_declare_parser_variables if
5908 push or pure mode.
5909 (yypushparse): Add b4_declare_parser_variables.
5910 Init new local variables, and remove init code for removed
5911 yypvars variables.
5912 (yyparse): Delete.
5913 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
5914 and yyparse for other modes.
5915 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
5916 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
5917 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
5918 (AT_PURE_LEX_IF): True if pure or push parser.
5919
85894313
JD
59202006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
5921
5922 Document Yacc prologue alternatives and default %destructor's and
5923 %printer's as experimental. Don't mention Java yet. Discussed at
5924 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
5925 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
5926 (2.3a): Annotate this entry to say the old forms of these features were
5927 also experimental.
5928 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 5929 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
5930 of Java (we'll want this back eventually).
5931
02975b9a
JD
59322006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
5933
5934 Support a file name argument to %defines. Deprecate `=' in
5935 %file-prefix, %name-prefix, and %output. Discussed at
5936 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
5937 * NEWS (2.3a+): Mention.
148d66d8 5938 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
5939 form of %defines, and remove `=' from entries for %file-prefix,
5940 %name-prefix, and %output.
5941 * src/parse-gram.y (prologue_declaration): Implement.
5942 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
5943 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
5944 all but one occurrence of %name-prefix.
5945 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
5946 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
5947 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
5948 occurrence of each of %file-prefix and %output. Add check for %defines
5949 with argument.
5950 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
5951 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
5952 Remove the `=' from %output.
5953
287b314e
JD
59542006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
5955
5956 Don't escape $ in test case titles since Autoconf 2.61 now does that
5957 correctly.
5958 * tests/actions.at (Default %printer and %destructor are not for error
5959 or $undefined): Here.
5960 (Default %printer and %destructor are not for $accept): Here.
5961 * tests/input.at (Invalid $n and @n): Here.
5962
3ebecc24
JD
59632006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
5964
5965 Rename <!> to <>. Discussed starting at
5966 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
5967 * NEWS (2.3a+): Update.
148d66d8 5968 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
5969 Update.
5970 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
5971 * src/scan-gram.l (INITIAL): Implement.
5972 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
5973 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
5974 comment.
5975 * tests/actions.at (Default tagless %printer and %destructor,
5976 Default tagged and per-type %printer and %destructor,
5977 Default %printer and %destructor are not for error or $undefined,
5978 Default %printer and %destructor are not for $accept,
5979 Default %printer and %destructor for mid-rule values): Update.
5980 * tests/input.at (Default %printer and %destructor redeclared,
5981 Unused values with default %destructor): Update.
5982
26b8a438
JD
59832006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
5984
5985 Don't let %prec take a nonterminal.
5986 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
5987 token.
5988 * tests/input.at (%prec takes a token): New test checking that %prec
5989 won't take a nonterminal.
5990
07c39ae9
JD
59912006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
5992
405d53b7
JD
5993 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
5994 it was double-quoted.
07c39ae9
JD
5995 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
5996 grammar is maintained with Bison's highest standards.
5997 * src/getargs.c: Fix some typos in Doxygen comments.
5998
580b8926
JD
59992006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
6000
6001 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
6002 later. Reported by Paul Eggert in
6003 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
6004 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
6005 * src/scan-code.l (translate_action): Don't bother invoking
6006 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
6007 (code_scanner_free): Instead of invoking
6008 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
6009 which frees more.
6010 * src/scan-gram.l (gram_scanner_free): Likewise.
6011 * src/scan-skel.l (scan_skel): Likewise.
6012
4502eadc
JD
60132006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
6014
6015 * src/files.c (tr): Change return type to void.
6016 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
6017 has been called previously for the same key.
6018 (muscle_find): Return storage instead of value so that
6019 --enable-gcc-warnings doesn't produce warnings that the return discards
6020 const. aver that the value and storage are the same since storage
6021 could potentially be NULL when value is not.
6022 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
6023 same as 0.
6024
7746c8f6
PE
60252006-11-08 Paul Eggert <eggert@cs.ucla.edu>
6026
6027 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
6028 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
6029 us a slightly cleaner distribution, and also works.
6030 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
6031 gnulib changes.
6032
eb095650
PE
60332006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
6034 and Paul Eggert <eggert@cs.ucla.edu>
6035
6036 Don't let Bison leak memory except when it complains.
6037 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
6038 (spec_defines_file, dir_prefix): Now char *, not const char *,
6039 since they are freed.
6040 * src/files.c: Likewise.
6041 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
6042 Likewise.
6043 (tr): Now operates in-place. All uses changed.
6044 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
6045 values.
6046 (compute_file_name_parts, compute_output_file_names): Don't store
6047 read-only data in variables that will be freed.
6048 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
6049 src_extension, and header_extension.
6050 (output_file_names_free): New public function to free
6051 spec_verbose_file, spec_graph_file, spec_defines_file,
6052 parser_file_name, and dir_prefix.
6053 * src/getargs.c (getargs): Don't store read-only data in variables that
6054 will be freed.
6055 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
6056 (which previously existed but was unused), and quotearg_free.
6057 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
6058 * src/muscle_tab.c: Likewise.
6059 (muscle_entry): Make the value char const *,
6060 and add a new storage member that is char * and can be freed.
6061 (muscle_entry_free): New private function.
6062 (muscle_init): Use it instead of free.
6063 (muscle_insert, muscle_grow): Update and use new storage member.
6064 (muscle_code_grow): Free the string passed to muscle_grow
6065 since it's not needed anymore.
6066 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
6067 add a new `char *code' member.
6068 ("{...}"): Declare semantic type as code.
6069 * src/scan-code.h (translate_rule_action):
6070 (translate_symbol_action, translate_code, translate_action): Return
6071 `char const *' rather than `char *' since external code should not free
6072 these strings.
6073 * src/scan-code.l: Likewise.
6074 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
6075 which is "{...}" in the parser.
6076 * tests/Makefile.am (maintainer-check-valgrind): Set
6077 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
6078 Valgrind.
6079 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
6080 complain.
6081 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
6082 expecting a non-zero exit status sets --leak-check=summary and
6083 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
6084 this case, and we don't want to hear about it.
6085
ac564be4
PE
60862006-11-08 Paul Eggert <eggert@cs.ucla.edu>
6087
6088 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
6089 instead of from the template, to simplify configuration a bit.
6090 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
6091 and m4/wint_t.m4, as they are needed with the latest gnulib.
6092
17bd8a73
JD
60932006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6094
6095 Disable unset/unused mid-rule value warnings by default, and recognize
6096 --warnings=midrule-values to enable them. Discussed starting at
6097 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
6098 * NEWS (2.3a+): Mention.
6099 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
6100 warnings): Add entry for midrule-values subargument.
6101 * src/reader.c (symbol_should_be_used): Don't return true just because
6102 the value is a set/used mid-rule value unless
6103 --warnings=midrule-values was specified.
6104 * tests/input.at (Unused values, Unused values before symbol
6105 declarations): Run tests with and without --warnings=midrule-values.
6106
6107 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
6108 than LIST_FREE directly.
6109
89eb3c76
JD
61102006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6111
6112 Finish implementing --warnings=error, which should not be implied by
6113 --warnings=all (or by its synonyms -W and --warnings without
6114 subarguments).
6115 * src/complain.c (set_warning_issued): New function to report that
6116 warnings are being treated as errors and to record an error if so.
6117 Invoke...
6118 (warn_at, warn): ... here.
6119 * src/getargs.c (warnings_args, warnings_types): Reorder so that
6120 "error - warnings are errors" does not appear above "all - all of the
6121 above".
6122 (getargs): For -W and --warnings without subarguments, don't let
6123 FLAGS_ARGMATCH set warnings_error in warnings_flag.
6124 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
6125
ba7560e2
JD
61262006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6127
6128 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
6129 empty subargument list. For example: `bison --warnings= parser.y'.
6130
31283fc3
JD
61312006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6132
6133 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
6134 the parser header file so that gcc doesn't warn.
6135
12e35840
JD
61362006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6137
6138 Split the default %destructor/%printer into two kinds: <*> and <!>.
6139 Discussed starting at
6140 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
6141 * NEWS (2.3a+): Mention.
6142 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
6143 previous change today related to mid-rules.
148d66d8 6144 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 6145 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
6146 (TYPE_TAG_ANY): Add as <*>.
6147 (TYPE_TAG_NONE): Add as <!>.
6148 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
6149 for <*> and <!>.
6150 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
6151 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
6152 * src/symlist.c (symbol_list_default_new): Split into tagged and
6153 tagless versions.
6154 (symbol_list_destructor_set, symbol_list_printer_set): Split
6155 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
6156 SYMLIST_DEFAULT_TAGLESS.
6157 * src/symlist.h: Update symbol_list_default*_new prototypes.
6158 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
6159 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
6160 * src/symtab.c (default_destructor, default_destructor_location,
6161 default_printer, default_printer_location): Split each into tagged and
6162 tagless versions.
6163 (symbol_destructor_get, symbol_destructor_location_get,
6164 symbol_printer_get, symbol_printer_location_get): Implement tagged
6165 default and tagless default cases.
6166 (default_destructor_set, default_printer_set): Split each into tagged
6167 and tagless versions.
6168 * src/symtab.h: Update prototypes.
6169 * tests/actions.at (Default %printer and %destructor): Rename to...
6170 (Default tagless %printer and %destructor): ... this, and extend.
6171 (Per-type %printer and %destructor): Rename to...
6172 (Default tagged and per-type %printer and %destructor): ... this, and
6173 extend.
6174 (Default %printer and %destructor for user-defined end token): Extend.
6175 (Default %printer and %destructor are not for error or $undefined):
6176 Update.
6177 (Default %printer and %destructor are not for $accept): Update.
6178 (Default %printer and %destructor for mid-rule values): Extend.
6179 * tests/input.at (Default %printer and %destructor redeclared): Extend.
6180 (Unused values with default %destructor): Extend.
6181
f91b1629
JD
61822006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6183
6184 Don't apply the default %destructor/%printer to an unreferenced midrule
6185 value. Mentioned at
6186 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
6187 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
6188 like $@n instead of just @n so that the default %destructor/%printer
6189 logic doesn't see them as user-defined symbols.
6190 (symbol_is_dummy): Check for both forms of the name.
6191 * src/reader.c (packgram): Remove the `$' from each midrule symbol
6192 name for which the midrule value is referenced in any action.
6193 * tests/actions.at (Default %printer and %destructor for mid-rule
6194 values): New test.
6195 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
6196 for change to dummy symbol names.
6197
519d0004
JD
61982006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
6199
6200 Warn about unset midrule $$ if the corresponding $n is used.
6201 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
6202 $n usage.
6203 (packgram): Before invoking grammar_rule_check on any rule, make sure
6204 all actions have already been scanned in order to set `used' flags.
6205 Otherwise, checking that a midrule's $$ is set will not always work
6206 properly because the midrule check must forward-reference the midrule's
6207 parent rule.
6208 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
6209 warning.
6210
a501eca9
JD
62112006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
6212
6213 More improvements to the documentation of the prologue alternatives:
6214 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
6215 Bison manual.
6216 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
6217 some text to clarify the relative importance of the new directives and
6218 to show how these directives may be viewed as code labels.
6219
2cbe6b7f
JD
62202006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
6221
6222 Similar to the recently removed %before-header, add %code-top as the
6223 alternative to the pre-prologue. Mentioned at
6224 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
6225 Also, let the prologue alternatives appear in the grammar section.
6226 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
6227 (prologue_declaration): Move the existing prologue alternatives to...
6228 (grammar_declaration): ... here and add %code-top.
6229 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
6230
6231 Clean up and extend documentation for the prologue alternatives.
6232 * NEWS (2.3a+): Describe prologue alternatives.
6233 * doc/bison.texinfo (Prologue): Move discussion of prologue
6234 alternatives to...
6235 (Prologue Alternatives): ... this new section, and extend it to discuss
6236 all 4 directives in detail.
148d66d8
JD
6237 (Table of Symbols): Clean up discussion of prologue alternatives and
6238 add %code-top.
2cbe6b7f 6239
e557d3ea
JMG
62402006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6241
6242 DJGPP specific issues.
6243
6244 * djgpp/config.bat: config.hin has been moved to lib. Adjust
6245 config.bat accordingly.
6246 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
6247 * djgpp/config.site: Likewise.
6248
136a0f76
PB
62492006-10-16 Paolo Bonzini <bonzini@gnu.org>
6250
27bd5d67
PB
6251 Replace %*-header with %provides, %requires, %code. See discussion at
6252 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
6253
136a0f76
PB
6254 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
6255 (b4_user_start_header): Remove.
6256 * data/glr.c: Use new macros instead of b4_*start_header
6257 and b4_*end_header.
6258 * data/glr.cc: Likewise.
6259 * data/lalr1.cc: Likewise.
6260 * data/push.c: Likewise.
6261 * data/yacc.c: Likewise.
6262
6263 * doc/bison.texinfo: Remove %before-header, rename
6264 %{start,end,after}-header to %requires, %provides, %code.
6265
6266 * src/parse-gram.y: Likewise (also rename token names accordingly).
6267 * src/scan-gram.l: Likewise.
6268 * tests/actions.at: Likewise.
6269
10f429ef
PE
62702006-10-14 Paul Eggert <eggert@cs.ucla.edu>
6271
6272 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
6273 Problem reported by Joel E. Denny.
6274
62752006-10-14 Jim Meyering <jim@meyering.net>
6276
6277 (Sync from coreutils.)
6278 Work also when the working directory (with e.g. coreutils sources)
6279 is version controlled with git, rather than CVS.
6280 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
6281 rather than CVS.
6282 In messages and comments, say e.g., "checked-out sources",
6283 rather than "CVS sources".
6284 (version_controlled_file): New function. Work for git as well as
6285 for CVS. Don't use grep's -q option.
6286 (slurp): Call it here, in place of CVS-specific code.
6287
c4bd5bf7
JD
62882006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
6289
6290 Fix testsuite for ./configure --enable-gcc-warnings:
6291 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
6292 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
6293 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
6294 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
6295 * test/regression.at (Diagnostic that expects two alternatives):
6296 Likewise.
6297
46356ea4
PE
62982006-10-12 Paul Eggert <eggert@cs.ucla.edu>
6299
231ed89a
PE
6300 * bootstrap.conf (gnulib_modules): Add config-h.
6301 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
6302 worry about HAVE_CONFIG_H.
6303 * lib/abitset.c: Likewise.
6304 * lib/bitset.c: Likewise.
6305 * lib/bitset_stats.c: Likewise.
6306 * lib/bitsetv-print.c: Likewise.
6307 * lib/bitsetv.c: Likewise.
6308 * lib/ebitset.c: Likewise.
6309 * lib/get-errno.c: Likewise.
6310 * lib/lbitset.c: Likewise.
6311 * lib/subpipe.c: Likewise.
6312 * lib/timevar.c: Likewise.
6313 * lib/vbitset.c: Likewise.
6314 * lib/bitset.c: Include "bitset.h" first, to test interface.
6315 * lib/bitset_stats.c: Include "bitset_stats.h" first.
6316 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
6317 * lib/bitsetv.c: Include "bitsetv.h" first.
6318 * lib/get-errno.c: Include "get-errno.h" first.
6319 * m4/.cvsignore: Add config-h.m4.
6320 * tests/actions.at (Default %printer and %destructor for ...):
6321 Adjust expected line numbers in output to reflect removal of #if
6322 HAVE_CONFIG_H lines.
6323 * tests/glr-regression.at (Missed %merge type warnings when ...):
6324 Likewise.
6325 * tests/regression.at (Braced code in declaration in rules section):
6326 Likewise.
6327 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
6328 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
6329 Include <config.h> unconditionally.
6330
46356ea4
PE
6331 * bootstrap: Sync from coreutils, as follows:
6332
6333 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
6334
6335 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
6336 variable was sometimes used without being initialized. This
6337 messed up the installation of the INSTALL file in some cases.
6338
6339 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
6340
6341 * bootstrap (usage, main program, symlink_to_gnulib): Add option
6342 --copy. Inspired by a suggestion from Bruno Haible.
6343
6344 2006-10-03 Jim Meyering <jim@meyering.net>
6345
6346 * bootstrap: Undo last change to this file, since now gnulib-tool
6347 sticks with the automake default in generating dependencies.
6348
dd4bf078
PE
63492006-10-12 Paul Eggert <eggert@cs.ucla.edu>
6350
cf2a5f7c
PE
6351 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
6352 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
6353
6354 * doc/bison.1: Add copyright notice.
6355
6356 * data/glr.c: Don't include <stdarg.h>; not used.
6357
35fe0834
PE
6358 * NEWS: The -g and --graph options now output graphs in Graphviz
6359 DOT format, not VCG format.
6360 * doc/bison.1: Likewise.
6361 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
6362 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
6363 of this change in
6364 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
6365 * TODO: Remove Graphviz entry.
6366 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
6367 remove vcg.c, vcg.h, vcg_defaults.h.
6368 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
6369 * src/graphviz.c, src/graphviz.h: New files.
6370 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
6371 * src/files.h: Make comment more generic.
6372 * src/main.c (main): Likewise.
6373 * src/print_graph.h: Likewise.
6374 * src/getargs.c (usage): Make usage description more generic.
6375 * src/print_graph.c: Include graphviz.h rather than vcg.h.
6376 (static_graph, fgraph): Remove. All uses changed to pass
6377 arguments instead of sharing a static var.
6378 (print_core, print_actions, print_state, print_graph):
6379 Output graphviz format rather than VCG format.
6380 * tests/.cvsignore: Remove *.vcg; add *.dot.
6381 * tests/output.at: Expect *.dot files, not *.vcg files.
6382
dd4bf078
PE
6383 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
6384 accommodates the 2006-10-08 change.
6385
efdd7421
PE
63862006-10-11 Bob Rossi <bob@brasko.net>
6387
6388 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
6389 (b4_yyssa, b4_yyerror_range): New macros.
6390 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
6391 (yypvarsinit): Remove init of removed fields.
6392 (yypushparse): Remove use of removed fields; use new macros instead.
6393
96a1981a
PE
63942006-10-11 Paul Eggert <eggert@cs.ucla.edu>
6395
6396 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
6397 in a push parser. Reindent slightly to match yacc.c better.
6398
63992006-10-11 Bob Rossi <bob@brasko.net>
6400
46356ea4
PE
6401 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
6402 yymsg_alloc fields.
6403 (yypvarsinit, yypushparse): Remove init of removed fields.
6404 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 6405
c1630a8b
PE
64062006-10-09 Paul Eggert <eggert@cs.ucla.edu>
6407
6408 * THANKS: Add Paolo Bonzini and Bob Rossi.
6409
90b9908d
PB
64102006-10-08 Paolo Bonzini <bonzini@gnu.org>
6411
6412 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
6413 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
6414 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
6415 b4_define_user_cde and uses): Remove.
6416 (b4_comment, b4_prefix, b4_sync_start): New.
6417 * data/bison.m4: New file, with most of the content removed from c.m4.
6418 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
6419 * src/output.c (output_skeleton): Pass bison.m4.
6420 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
6421 only if specified.
6422
cf806753
PE
64232006-10-05 Paul Eggert <eggert@cs.ucla.edu>
6424
6425 Fix test failure reported by Tom Lane in
6426 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
6427 and try to make such failures easier to catch in the future.
6428 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
6429 that's now the caller's responsibility.
6430 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
6431 Set yychar = YYEOF if it's negative.
6432 * tests/actions.at (yylex): Abort if asked to read past EOF.
6433 * tests/conflicts.at (yylex): Likewise.
6434 * tests/cxx-type.at (yylex): Likewise.
6435 * tests/glr-regression.at (yylex): Likewise.
6436 * tests/input.at (yylex): Likewise.
6437 * tests/regression.at (yylex): Likewise.
6438 * tests/torture.at (yylex): Likewise.
6439
0e2f006a
PE
64402006-10-01 Paul Eggert <eggert@cs.ucla.edu>
6441
6442 Fix problems with translating English-language diagnostics.
6443 * bootstrap: Fix bug introduced in recent bootstrap changes, with
6444 respect to bison-runtime pot generation. The YY_ stuff
6445 wasn't being captured.
6446 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
6447 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
6448 * runtime-po/POTFILES.in: Add data/push.c.
6449
e3ddc1e3
PE
64502006-09-29 Paul Eggert <eggert@cs.ucla.edu>
6451
6452 Merge bootstrap changes from coreutils.
6453
6454 2006-09-28 Jim Meyering <jim@meyering.net>
6455
6456 Automatically generated dependencies are important even
6457 when all of the sources in a directory come from gnulib.
6458 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
6459 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
6460
6461 2006-09-23 Jim Meyering <jim@meyering.net>
6462
6463 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
6464
6465 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6466
6467 * bootstrap: Add support for --force.
6468 (usage): New function. Describe usage less tersely.
6469 (CVS_only_file): New var.
6470
01e972b3
PE
64712006-09-21 Paul Eggert <eggert@cs.ucla.edu>
6472
6473 * data/push.c (YYPUSH_MORE): Make it an enum instead.
6474 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
6475 Adjust white space and comments to match GNU style better.
6476
c63d3e90
PE
64772006-09-20 Bob Rossi <bob@brasko.net>
6478
6479 * data/push.c (yyresult_get): Remove function.
6480 (YYPUSH_MORE): Add #define.
6481 (yypushparse): Modify return value.
6482
e70f46d1
PE
64832006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6484
6485 * stamp-h.in: Remove; no longer needed.
6486 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
6487 Remove config.h, config.hin, intl (no longer created).
6488 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
6489 stamp-h1.
6490
6491 Sync bootstrap from coreutils, as follows:
6492
6493 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
6494
6495 * bootstrap (symlink_to_gnulib): New function.
6496 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
6497 to copies-of-gnulib.
6498 (cp_mark_as_generated, slurp, gnulib_files):
6499 Avoid making a copy if it's the same as the old version.
6500 (gnulib_files): Add support for this variable (used by Bison).
6501
a92be413
PE
65022006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6503
6504 * src/getargs.c (usage): Rework to use conventions similar to
6505 coreutils, to make translation a bit easier and the code a bit
6506 smaller. Problem reported by Tim Van Holder.
6507
4f82b42a
PE
65082006-09-15 Paul Eggert <eggert@cs.ucla.edu>
6509
3b2942e6
PE
6510 Use some of gnulib's new modules, taken from coreutils.
6511
6512 * bootstrap: Sync from coreutils, except add support for gnulib_files.
6513 * bootstrap.conf: New file.
6514 (gnulib_modules): Add configmake, inttypes, unistd.
6515 (XGETTEXT_OPTIONS): Add complain, complain_at,
6516 fatal, fatal_at, warn, warn_at, unexpected_end.
6517 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
6518 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
6519 (gl_EARLY): Add.
6520 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
6521 (gl_INIT): Add
6522 (GNULIB_AUTOCONF_SNIPPET): Remove.
6523 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
6524 the pickiest.
6525 * lib/.cvsignore: Add inttypes_.h.
6526 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
6527 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
6528 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
6529 no-longer-necessary initializations.
6530 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
6531 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
6532 use the unistd module.
6533 * src/system.h: Likewise.
6534 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
6535 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
6536 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
6537 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
6538 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
6539 * src/system.h: Include inttypes.h unconditionally, now that we
6540 use the inttypes module. Don't bother to include stdint.h, since
6541 inttypes.h now does that for us.
6542 (LOCALEDIR): Remove, now that we use the configmake module.
6543 * src/getargs.c: Include configmake.h.
6544 * src/main.c: Likewise.
6545 * src/output.c: Likewise.
6546 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
6547 not from $abs_top_builddir, since config.h moved.
6548
6549
4f82b42a
PE
6550 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
6551 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
6552
6553 * src/parse-gram.y (symbol_declaration): Don't put statements
6554 before declarations; it's not portable to C89.
6555 * src/scan-code.l (handle_action_at): Likewise.
6556
6557 * src/scan-code.l: Always initialize braces_level; the old code
6558 left it uninitialized and therefore had undefined behavior.
6559
6560 Don't attempt to redefine 'assert', since it runs afoul of
6561 systems where standard headers (mistakenly) include <assert.h>.
6562 Instead, define and use our own alternative, called 'aver'.
6563 * src/reader.c: Don't include assert.h, since we no longer
6564 use assert.
6565 * src/scan-code.l: Likewise.
6566 * src/system.h (assert): Remove, replacing with....
6567 (aver): New function, taking a bool arg. All uses changed.
6568 * src/tables.c (pack_vector): Ensure that aver arg is bool,
6569 not merely an integer.
6570
31c10e38
PE
65712006-09-15 Bob Rossi <bob@brasko.net>
6572
e5926647
JD
6573 Add support for push parsing. Based on the original work of
6574 Odd Arild Olsen <oao@fibula.no>.
31c10e38
PE
6575 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
6576 * data/c.m4 (YYPUSH): New.
6577 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
e5926647 6578 * data/push.c: New file.
31c10e38
PE
6579 * src/getargs.c (push_parser): New var.
6580 * src/getargs.h (push_parser): New declaration.
6581 * src/output.c (prepare): Add macro insertion of `push_flag'.
6582 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
6583 (prologue_declaration): Parse %push-parser.
6584 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
6585 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
6586 list of removed lines from the traces observed.
6587 (AT_CHECK_CALC_LALR): Added push parser tests.
6588
fa7b79c0
PE
65892006-09-13 Paul Eggert <eggert@cs.ucla.edu>
6590
21fe08ca
PE
6591 * NEWS: Version 2.3a.
6592 * configure.ac (AC_INIT): Likewise.
6593
e8ec4d9b
PE
6594 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
6595 "#define YYSTYPE int" that caused "make maintainer-check" to fail
6596 due to header ordering dependencies. I don't know why the #define
6597 was there.
6598
fa7b79c0
PE
6599 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
6600 runtime cost when YYDEBUG is not defined, and so that some tests
6601 that used to fail now work. Problem and initial suggestion by
6602 Paolo Bonzini.
6603 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
6604 * data/glr.cc (b4_parser_class_name):
6605 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
6606 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
6607 (yydebug_) [YYDEBUG]: New member.
6608 (yycdebug_): Now defined only if YYDEBUG.
6609 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
6610 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
6611 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
6612 if YYYDEBUG.
6613 (debug_stream, set_debug_stream, debug_level, set_debug_level):
6614 Define only if YYDEBUG.
6615 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
6616 set_debug_level.
6617 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
6618 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
6619 AT_CHECK_CALC_GLR_CC that are working now.
6620
4ec13d60
PE
66212006-09-12 Paul Eggert <eggert@cs.ucla.edu>
6622
6623 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
6624 We don't need them in glr.cc, and glr.c defines them.
6625 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
6626 assumes that defining it to anything is the same as defining
6627 it to 1. Problem reported by Paolo Bonzini.
6628
8e1687ae
PE
66292006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
6630
6631 * data/c.m4 (b4_null, b4_case): Define.
6632 * src/output.c (prepare_symbols): Use b4_null.
6633 (user_actions_output): Use b4_case.
6634
3dc5e96b
PE
66352006-09-11 Paul Eggert <eggert@cs.ucla.edu>
6636
aef3da86
PE
6637 * data/glr.c (b4_shared_declarations): Put start-header first,
6638 before any #includes that we generate, so that feature-test
6639 macros work. Problem reported by Michael Deutschmann in
6640 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
6641 * data/lalr1.cc: Likewise.
6642 * doc/bison.texinfo (Prologue): Document that feature-test macros
6643 should be defined before any Bison declarations.
6644 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
6645 that depend on location.hh after, not before, Bison decls, since
6646 we now include location.hh after the first user prologue.
6647
3dc5e96b
PE
6648 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
6649 Sander Brandenburg in
6650 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
6651 Also, fix minor white space and comment issues.
aef3da86
PE
6652 (Prologue): Mention that it's better to define feature-test macros
6653 before Bison declarations. Problem reported by Michael Deutschmann.
6654
6655 * README-cvs: Fix typo: "&" should be "&&". Problem reported
6656 by Jim Meyering.
6657 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
6658 This adjusts to recent gnulib changes.
3dc5e96b 6659
b2a0b7ca
JD
66602006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
6661
6662 Finish implementation of per-type %destructor/%printer. Discussed
6663 starting at
6664 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
6665 and
6666 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
6667 * NEWS (2.3+): Add a description of this feature to the default
6668 %destructor/%printer description.
6669 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
6670 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
6671 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
6672 list node contains a semantic type.
6673 * src/symtab.c, src/symtab.h: Extend with a table that associates
6674 semantic types with their %destructor's and %printer's.
6675 (semantic_type_from_uniqstr, semantic_type_get,
6676 semantic_type_destructor_set, semantic_type_printer_set): New functions
6677 composing the public interface of that table.
6678 (symbol_destructor_get, symbol_destructor_location_get,
6679 symbol_printer_get, symbol_printer_location_get): If there's no
6680 per-symbol %destructor/%printer, look up the per-type before trying
6681 the default.
6682 * tests/actions.at (Per-type %printer and %destructor): New test case.
6683 * tests/input.at (Default %printer and %destructor redeclared):
6684 Extend to check that multiple occurrences of %symbol-default in a
6685 single %destructor/%printer declaration is an error.
6686 (Per-type %printer and %destructor redeclared, Unused values with
6687 per-type %destructor): New test cases.
6688
3be03b13
JD
66892006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
6690
6691 Require default %destructor/%printer to be declared using
6692 %symbol-default instead of an empty symbol list, and start working on
6693 new per-type %destructor/%printer. Discussed at
6694 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
6695 * NEWS (2.3+): Add %symbol-default to example.
6696 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 6697 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
6698 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
6699 (generic_symlist, generic_symlist_item): New nonterminals for creating
6700 a list in which each item is a symbol, semantic type, or
6701 %symbol-default.
6702 (grammar_declaration): Use generic_symlist in %destructor and %printer
6703 declarations instead of symbols.1 or an empty list.
6704 (symbol_declaration, precedence_declaration, symbols.1): Update actions
6705 for changes to symbol_list.
6706 * src/reader.c: Update for changes to symbol_list.
6707 * src/scan-code.l: Likewise.
6708 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
6709 * src/symlist.c, src/symlist.h: Extend such that a list node may
6710 represent a semantic type or a %symbol-default in addition to just an
6711 ordinary symbol. Add switched functions for setting %destructor's and
6712 %printer's.
6713 * tests/actions.at, tests/input.at: Add %symbol-default to all default
6714 %destructor/%printer declarations.
6715
3508ce36
JD
67162006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
6717
6718 Whether the default %destructor/%printer applies to a particular symbol
6719 isn't a question of whether the user *declares* that symbol (in %token,
6720 for example). It's a question of whether the user by any means
6721 *defines* the symbol at all (by simply using a char token, for
6722 example). $end is defined by Bison whereas any other token with token
6723 number 0 is defined by the user. The error token is always defined by
6724 Bison regardless of whether the user declares it with %token, but we
6725 may one day let the user define error as a nonterminal instead.
6726 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
6727 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
6728 the meaning of "user-defined".
6729 * tests/actions.at (Default %printer and %destructor for user-declared
6730 end token): Rename to...
6731 (Default %printer and %destructor for user-defined end token): ...
6732 this.
6733
6734 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
6735 computation of whether to apply the default, don't maintain a list of
6736 every Bison-defined symbol. Instead, just check for a first character
6737 of '$', which a user symbol cannot have, and check for the error token.
6738
9350499c
JD
67392006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
6740
6741 Don't apply the default %destructor or %printer to the error token,
6742 $undefined, or $accept. This change fits the general rule that the
6743 default %destructor and %printer are only for user-declared symbols,
6744 and it solves several difficulties that are described in the new test
6745 cases listed below.
6746 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
6747 * tests/actions.at (Default %printer and %destructor are not for error
6748 or $undefined, Default %printer and %destructor are not for $accept):
6749 New test cases.
6750
4d7370cb
JD
67512006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
6752
6753 Allow %start after the first rule.
6754 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
6755 when parsing the first rule.
6756 (check_and_convert_grammar): Search for it here after all grammar
6757 declarations have been parsed. Skip midrules, which have dummy LHS
6758 nonterminals.
6759 * src/symtab.c (symbol_is_dummy): New function.
6760 * src/symtab.h (symbol_is_dummy): Declare it.
6761 * tests/input.at (%start after first rule): New test.
6762
6d0ef4ec
JD
67632006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
6764
6765 Redo some of the previous commit: add back the ability to use
6766 non-aliased/undeclared string literals since it might be useful to
6767 those declaring %token-table.
6768 * src/reader.c (check_and_convert_grammar): Undo changes in previous
6769 commit: don't worry about complaints from symbols_pack.
6770 * src/symtab.c (symbol_new, symbol_class_set,
6771 symbol_check_alias_consistency): Undo changes in previous commit: count
6772 each string literal as a new symbol and token, assign it a symbol
6773 number, and don't complain about non-aliased string literals.
6774 (symbols_pack): Since symbol_make_alias still does not decrement symbol
6775 and token counts but does still set aliased tokens to the same number,
6776 symbol_pack_processor now leaves empty slots in the symbols array.
6777 Remove those slots.
6778 * tests/regression.at (Undeclared string literal): Remove test case
6779 added in previous commit since non-aliased string literals are allowed
6780 again.
6781 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
6782 remove unnecessary string literal declarations.
6783 * tests/sets.at (Firsts): Likewise.
6784
965537bc
JD
67852006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
6786
6787 Don't allow an undeclared string literal, but allow a string literal to
6788 be used before its declaration.
6789 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
6790 symbols_pack complained.
6791 * src/symtab.c (symbol_new): Don't count a string literal as a new
6792 symbol.
6793 (symbol_class_set): Don't count a string literal as a new token, and
6794 don't assign it a symbol number since symbol_make_alias does that.
6795 (symbol_make_alias): It's not necessary to decrement the symbol and
6796 token counts anymore. Don't assume that an alias declaration occurs
6797 before any uses of the identifier or string, and thus don't assert that
6798 one of them has the highest symbol number so far.
6799 (symbol_check_alias_consistency): Complain if there's a string literal
6800 that wasn't declared as an alias.
6801 (symbols_pack): Bail if symbol_check_alias_consistency failed since
6802 symbol_pack asserts that every token has been assigned a symbol number
6803 although undeclared string literals have not.
6804 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 6805 string literal): New test cases.
965537bc
JD
6806 (Characters Escapes, Web2c Actions): Declare string literals as
6807 aliases.
6808 * tests/sets.at (Firsts): Likewise.
6809
47aee066
JD
68102006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
6811
6812 In the grammar scanner, STRING_FINISH unclosed constructs and return
6813 them to the parser in order to improve error messages.
6814 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
6815 SC_BRACED_CODE, SC_PROLOGUE): Implement.
6816 * tests/input.at (Unclosed constructs): New test case.
6817 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
6818 seen.
6819
6820 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
6821 unused global.
6822
1f6b3679
JD
68232006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
6824
6825 Handle string aliases for character tokens correctly.
6826 * src/symtab.c (symbol_user_token_number_set): If the token has an
6827 alias, check and set its alias's user token number instead of its own,
6828 which is set to indicate the alias. Previously, every occurrence of
6829 the character token in the grammar overwrote that alias indicator with
6830 the character code.
6831 * tests/input.at (String aliases for character tokens): New test.
6832
219741d8
JD
68332006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
6834
6835 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
6836
11daa4e7
PE
68372006-08-11 Paul Eggert <eggert@cs.ucla.edu>
6838
6839 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
6840 to prevent failures when building on older platforms.
6841 Check for autopoint failure.
6842 Set XGETTEXT_OPTIONS to values that check for C format strings,
6843 so that translators are warned about them (this also helps
6844 prevent core dumps).
6845
6846 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
6847 function, since it simplifies our code a bit.
6848
6849 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
6850 rather than -W, so we don't get bogus warnings about sign comparisons.
6851 Add -Wpointer-arith, since that warning is useful (it reports code
6852 that does not conform to C89 and that some compilers reject).
6853 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
6854 since it's no longer needed.
6855
f9bfc42a
JD
68562006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
6857
6858 Clean up scanners a bit.
6859 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
6860 definitions so gcc won't warn when obstack_for_string is unused.
6861 * src/scan-code.l: config.h and system.h are already #include'd by
6862 scan-code-c.c, so get rid of them here.
6863 * src/scan-gram.l: Likewise.
6864 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
6865 definitions rather than duplicating the rest of it.
6866 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
6867
06e8700a
JD
68682006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
6869
6870 Suppress signed/unsigned comparison warnings for yycheck.
6871 * data/c.m4 (b4_safest_int_type): New macro.
6872 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
6873 a signed int type, cast it to b4_safest_int_type first.
6874 * data/yacc.c: Likewise.
6875 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
6876 also overwritten.
6877
9c437126
PE
68782006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
6879
6880 * doc/bison.texinfo: Fix some typos.
6881
284d8a13
PE
68822006-08-02 Paul Eggert <eggert@cs.ucla.edu>
6883
6884 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
6885 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
6886
6887 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
6888 the latest gnulib does this a different way.
6889 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
6890 translation was patched, so stop omitting it.
6891
ec5479ce
JD
68922006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
6893
6894 Enable declaration of default %printer/%destructor. Make the parser
6895 use these for all user-declared grammar symbols for which the user does
6896 not declare a specific %printer/%destructor. Thus, the parser uses it
6897 for token 0 if the user declares it but not if Bison generates it as
6898 $end. Discussed starting at
6899 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
6900 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
6901 and
6902 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
6903 * NEWS (2.3+): Mention.
6904 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
6905 declare a %destructor for a mid-rule's semantic value. It's just
6906 impossible to declare one specific to it.
6907 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
6908 code. Describe default %destructor form.
6909 * src/parse-gram.y (grammar_declaration): Parse default
6910 %printer/%destructor declarations.
6911 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
6912 and symbol_destructor_location_get rather than accessing the destructor
6913 and destructor_location members of struct symbol.
6914 (symbol_printers_output): Likewise but for %printer's.
6915 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
6916 again.
6917 * src/symtab.c (default_destructor, default_destructor_location,
6918 default_printer, default_printer_location): New static global
6919 variables to record the default %destructor and %printer.
6920 (symbol_destructor_get, symbol_destructor_location_get,
6921 symbol_printer_get, symbol_printer_location_get): New functions to
6922 compute the appropriate %destructor and %printer for a symbol.
6923 (default_destructor_set, default_printer_set): New functions to set the
6924 default %destructor and %printer.
6925 * src/symtab.h: Prototype all those new functions.
6926 * tests/actions.at (Default %printer and %destructor): New test to
6927 check that the right %printer and %destructor are called, that they're
6928 not called for $end, and that $$ and @$ work correctly.
6929 (Default %printer and %destructor for user-declared end token): New
6930 test to check that the default %printer and %destructor are called for
6931 a user-declared end token.
6932 * tests/input.at (Default %printer and %destructor redeclared, Unused
6933 values with default %destructor): New tests to check related grammar
6934 warnings and errors.
6935
868d2d96
JD
69362006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
6937
6938 Clean up handling of %destructor for the end token (token 0).
6939 Discussed starting at
6940 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
6941 and
6942 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
6943
6944 Make the skeletons consistent in how they pop the end token and invoke
6945 its %destructor.
6946 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
6947 state, which has token number 0, since this would invoke the
6948 %destructor for the end token.
6949 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
6950 until after shifting the end token, or else it won't be popped.
6951 * data/yacc.c (yyparse): Likewise.
6952
6953 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
6954 it's the end token. Upon termination, destroy an unshifted lookahead
6955 even when it's the end token.
6956 * data/lalr1.cc (yy::parser::parse): Likewise.
6957 * data/yacc.c (yyparse): Likewise.
6958
6959 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
6960 value warnings for the end token when the user gives the end token a
6961 %destructor.
6962
6963 * tests/actions.at (Printers and Destructors): Test all the above.
6964
62a9592d
PE
69652006-07-24 Paul Eggert <eggert@cs.ucla.edu>
6966
6967 Update to latest gnulib and gettext versions.
6968 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
6969 Add fopen-safer.
6970 (gnulib_files): Add m4/warning.m4. Don't worry about files
6971 overwritten by autopoint.
6972 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
6973 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
6974 rejects them.
6975 Don't use autoreconf; instead, invoke autopoint etc. by hand,
6976 so that we can remove the intl files at a better time.
6977 (intl_files_to_remove): Remove aclocal.m4, since it gets
6978 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
6979 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
6980 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
6981 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
6982 Remove datarootdir hack; no longer needed.
6983 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
6984 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
6985 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
6986 strdup.h.
6987 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
6988 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
6989
10d6970f
PE
69902006-07-20 Paul Eggert <eggert@cs.ucla.edu>
6991
6992 * bootstrap: Adjust to today's change to gnulib-tool by invoking
6993 it with --assume-autoconf='latest-stable'.
6994
50a33993
JD
69952006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
6996
6997 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
6998 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
6999 YYSTYPE' and `{'.
7000 * src/muscle_tab.h (muscle_grow): Replace the header comments with
7001 those from muscle_tab.c since the old ones are misleading.
7002
2ce4ed68
AD
70032006-07-13 Akim Demaille <akim@epita.fr>
7004
7005 Support %define "KEY" {VALUE}.
7006 * src/scan-code.h, src/scan-code.l (translate_action)
7007 (translate_rule_action, translate_symbol_action, translate_code):
7008 Return char *, not const char *.
7009 * src/parse-gram.y (declaration): Rename as...
7010 (prologue_declaration): this.
7011 (string_content): Remove this nonterminal, use STRING.
7012 (braceless, content, content.opt): New nonterminal.
7013 Use them.
7014 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
7015 as value.
7016 * src/scan-gram.l (getargs.h): Don't include it.
7017
db7e5eb5
PE
70182006-07-12 Paul Eggert <eggert@cs.ucla.edu>
7019
7020 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
7021 rather than a for-loop that declares a local bool variable. This
7022 should work around a compatibility problem with a Cray x1e C++
7023 compiler reported by Hung Nguyen in
7024 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
7025 The for-loop was introduced in the 2004-11-17 change but I don't
7026 know why it was needed.
7027
a5d80ba5
AD
70282006-07-12 Akim Demaille <akim@epita.fr>
7029
7030 * data/c.m4: Comment changes.
7031
23eb2a69
AD
70322006-07-10 Akim Demaille <akim@lrde.epita.fr>
7033
7034 * src/complain.c (error_message, ERROR_MESSAGE): New.
7035 To factor...
7036 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
7037 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
7038
ddc8ede1
PE
70392006-07-09 Paul Eggert <eggert@cs.ucla.edu>
7040
7041 * NEWS: Instead of %union, you can define and use your own union type
7042 YYSTYPE if your grammar contains at least one <type> tag.
7043 Your YYSTYPE need not be a macro; it can be a typedef.
7044 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
7045 (Union Decl, Decl Summary): Document this.
7046 * data/glr.c (YYSTYPE): Implement this.
7047 * data/glr.cc (YYSTYPE): Likewise.
7048 * data/lalr1.cc (YYSTYPE): Likewise.
7049 * data/yacc.c (YYSTYPE): Likewise.
7050 * src/output.c (prepare): Output tag_seen_flag.
7051 * src/parse-gram.y (declaration, grammar_declaration):
7052 Use 'union_seen' rather than 'typed' to determine whether
7053 %union has been seen, since grammars can now be typed without
7054 %union.
7055 (symbol_declaration, type.opt, symbol_def):
7056 Keep track of whether a tag has been seen.
7057 * src/reader.c (union_seen, tag_seen): New vars.
7058 (typed): remove.
7059 * src/reader.h (union_seen, tag_seen, typed): Likewise.
7060 * src/scan-code.l (untyped_var_seen): New variable.
7061 (handle_action_dollar): Adjust to above changes.
7062 (handle_action_dollar, handle_action_at):
7063 Improve overflow checking for outlandish numbers.
7064 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
7065 avoid new diagnostics generated by above changes.
7066 * tests/regression.at (YYSTYPE typedef): Add test to check
7067 for type tags without %union.
7068
7069 * src/symlist.c (symbol_list_length): Return int, not unsigned
7070 int, since callers expect int. This may need to get revisited
7071 once we have proper integer overflow checking.
7072
7073 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
7074 object is now static.
7075
7076 * src/getargs.c (flags_argmatch): Return void, not int,
7077 to pacify ./configure --enable-gcc-warnings.
7078
7079 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
7080 since last_string is already defined to FLEX_PREFIX (last_string).
7081
7b42569e
AD
70822006-07-09 Akim Demaille <akim@lrde.epita.fr>
7083
7084 Implement --warnings/-W.
7085 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
7086 replaced by...
7087 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
7088 Adjust callers.
7089 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
7090 (warnings_args, warnings_types): New.
7091 (getargs, short_options, long_options): Accept -W/--warnings.
7092 Sort the options by alphabetical order, upper case letter right
7093 before its lower case.
7094
3b452f4e
JD
70952006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
7096
7097 Change %merge result type clash warnings to errors. Discussed at
7098 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
7099 * src/reader.c (record_merge_function_type): Use complain_at.
7100 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7101 declared later): Update test case results.
7102
b8a41559
AD
71032006-07-09 Akim Demaille <akim@lrde.epita.fr>
7104
7105 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
7106 to be in alphabetical order.
7107 (trace_args): Spelling fixes.
7108
cd9e1ba2
PE
71092006-07-09 Paul Eggert <eggert@cs.ucla.edu>
7110
7111 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
7112 so they don't collide with user-defined macros.
7113 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
7114 this was never guaranteed, and now that we're using gnulib stdint,
7115 which defines int_fast16_t to long int, the problem is exposed.
7116
cb48f191
PE
71172006-07-08 Paul Eggert <eggert@cs.ucla.edu>
7118
b8445a15
PE
7119 * data/c.m4 (b4_basename): Simplify a bit, since we don't
7120 need the full POSIX semantics (and weren't implementing them
7121 anyway).
7122
cb48f191
PE
7123 Adjust to Autoconf 2.60 and today's gnulib.
7124 * bootstrap (gnulib_modules): Add stdint.
7125 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
7126 no longer copies it.
7127 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
7128 since stdint needs the former and wcwidth (which is now required
7129 by mbswidth) needs the latter.
7130 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
7131 work around a compatibility glitch between gettext 0.14.6 and
7132 Autoconf 2.60.
7133 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
7134 Do not check for uintptr_t, since new stdint module does the right
7135 thing.
7136 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
7137 Add stdint.h, stdint_.h, wcwidth.h.
7138 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
7139 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
7140 stdint.m4, wchar_t.m4, wcwidth.m4.
7141 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
7142 usual order for ../lib/*.h files.
7143 (file_name_split): Use last_component, not base_name, to adjust
7144 to gnulib changes.
7145 * src/parse-gram.h: Include <strverscmp.h> in the usual order
7146 for ../lib/*.h files.
7147 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
7148 Define unconditionally, since we now assume the stdint module.
7149 * src/scan-skel.l: Include <dirname.h>.
7150 (BASE_QPUTS): Use last_component, not base_name.
7151 * src/system.h: Include <unlocked-io.h> in the usual order
7152 for ../lib/*.h files. Include <stdint.h> unconditionally,
7153 since we now use the stdint module.
7154 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
7155 HAVE_UINTPTR_T, since we now use the stdint module.
7156 (base_name): Remove decl, since files now include <dirname.h>
7157 to get the decl.
7158
cd48d21d
AD
71592006-07-08 Akim Demaille <akim@lrde.epita.fr>
7160
7161 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
7162 New, default to 1.
7163 * data/yacc.c, data/glr.c, data/location.cc: Use them.
7164 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
7165 default.
7166 * tests/calc.at: Adjust.
7167
8ec0a172
AD
71682006-07-08 Akim Demaille <akim@lrde.epita.fr>
7169
b8445a15 7170 * data/c.m4 (b4_basename): New.
8ec0a172
AD
7171 (b4_syncline): Also output the location of its invocation (from
7172 the skeleton).
7173 (b4_user_action, b4_define_user_action, b4_user_actions)
7174 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
7175 (b4_user_stype): New.
7176 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
7177
4a678af8
JD
71782006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
7179
7180 In the grammar file, the first column is 1 not 0 on the first line as
7181 on every other line.
7182 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
7183 * tests/input.at (Torturing the Scanner): Update output.
7184
7185 * src/scan-gram.l (scanner_cursor): Declare it static.
7186
dd60572a
JD
71872006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
7188
7189 In warnings, say "previous declaration" rather than "first
7190 declaration".
7191 * src/symtab.c (redeclaration): Do that here.
7192 * src/reader.c (record_merge_function_type): In the case of a result
7193 type clash, report the previous declaration rather than the very first
7194 one in the grammar file.
7195 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7196 declared later): Add a third declaration to check this behavior.
7197 * tests/input.at (Incompatible Aliases): Update output.
7198
2073e1b6
AD
71992006-06-27 Akim Demaille <akim@epita.fr>
7200
7201 * doc/Doxyfile.in: New.
7202 * doc/Makefile.am: Use it.
7203 * src/lalr.h, src/symtab.h: Initial doxygenation.
7204
8ee5b538
JD
72052006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7206
7207 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
7208 declared after the %merge. This continues the effort of the previous
7209 patch.
8ee5b538
JD
7210 * src/reader.c (get_merge_function): Don't set the merger type yet.
7211 (record_merge_function_type): New function for setting the merger type
7212 and checking for clashes.
7213 (grammar_current_rule_merge_set): Set the location of the %merge for
7214 the current rule.
7215 (packgram): Invoke record_merge_function_type for each rule now that
7216 all symbol type declarations have been parsed.
7217 * src/reader.h (merger_list.type_declaration_location): New member
7218 storing the location of the first %merge from which the type for this
7219 merging function was derived.
7220 * src/symlist.h (symbol_list.merger_declaration_location): New member
7221 storing the location of a rule's %merge, if any.
7222 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7223 declared later): New test to catch the error fixed by the above patch.
7224
ffa4ba3a
JD
72252006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7226
7227 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
7228 declarations appear after the rules. Discussed at
7229 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
7230 and
7231 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
7232 Don't mistake the type of $$ in a midrule to be that of its parent
7233 rule's $$.
ffa4ba3a
JD
7234 * src/reader.c (grammar_current_rule_end): Don't invoke
7235 grammar_rule_check yet since not all symbol declarations may have been
7236 parsed yet.
7237 (grammar_midrule_action): Likewise.
7238 Don't record whether the midrule's $$ has been used yet since actions
7239 haven't been translated yet.
7240 Record the midrule's parent rule and its RHS index within the parent
7241 rule.
7242 (grammar_current_rule_action_append): Don't translate the action yet
7243 since not all symbol declarations may have been parsed yet and, thus,
7244 warnings about types for $$, $n, @$, and @n can't be reported yet.
7245 (packgram): Translate the action and invoke grammar_rule_check now that
7246 all symbol declarations have been parsed.
7247 * src/scan-code.l (handle_action_dollar): Now that this is invoked
7248 after parsing the entire grammar file, the symbol list here in the case
7249 of a midrule is actually the midrule's empty RHS, so reference its
7250 parent rule's RHS where necessary.
7251 On the other hand, now that you can already know it's a midrule, you
7252 aren't forced to think $$ has the same type as its parent rule's $$.
7253 (handle_action_at): In the case of a midrule, reference the parent rule
7254 where necessary.
7255 * src/symlist.c (symbol_list_new): Initialize new midrule-related
7256 members.
7257 (symbol_list_length): Now that this is invoked after all rules have
7258 been parsed, a NULL symbol (rather than a NULL symbol list node)
7259 terminates a rule. symbol_list_print already does this correctly.
7260 * src/symlist.h (symbol_list.midrule_parent_rule,
7261 symbol_list.midrule_parent_rhs_index): New members so that midrules can
7262 remember their relationships with their parents.
7263 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
7264 fixed by the above patch.
7265 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
7266 implementing...
7267 (Unused values): ... this old test case and...
7268 (Unused values before symbol declarations): ... this new test case.
7269 This one is the same as `Unused values' except that all symbol
7270 declarations appear after the rules in order to catch the rest of the
7271 errors fixed by the above patch.
7272
e256e17f
JD
72732006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7274
300a1930
JD
7275 More cleanup.
7276 * src/reader.c (current_rule): Declare it static since it's no longer
7277 used outside this file.
7278 (grammar_current_rule_action_append): Remove redundant arguments from
7279 translate_rule_action invocation.
7280 * src/reader.h (current_rule): Remove this unused extern.
7281 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
7282 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 7283
381ecb06
JD
72842006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
7285
7286 Clean up yesterday's patch.
7287 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
7288 to...
7289 * src/reader.c (grammar_current_rule_action_append): ... here for
7290 consistency with grammar_current_rule_symbol_append.
7291 * tests/regression.at (Braced code in declaration in rules section):
7292 Make yyerror and yylex static as usual.
7293
4210cd0b
JD
72942006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
7295
7296 Fix bug that mistakes braced code in a declaration in the rules section
7297 to be a rule action. Mentioned at
7298 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
7299 * src/scan-gram.l: Move midrule action detection from the start of the
7300 scanning of any braced code to...
7301 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
7302 action. For readability, use $2 and @2 rather than the equivalent
7303 global variables.
7304 * tests/regression.at (Braced code in declaration in rules section):
7305 New test to catch the error fixed by the above patch.
7306
7307 Work on code readability some.
7308 * src/scan-code.l (current_rule): Get rid of this misleading and
7309 redundant declaration: it's actually extern'ed in reader.h.
7310 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
7311 translate_action): Add a rule argument and use it instead of the global
7312 current_rule.
7313 (translate_rule_action): This already receives current_rule through an
7314 argument, so pass it on to translate_action instead of assigning
7315 current_rule to current_rule.
7316 (translate_symbol_action, translate_code): Pass rule = NULL to
7317 translate_action.
7318
34f98f46
JD
73192006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
7320
7321 Rename %before-definitions to %start-header and %after-definitions to
7322 %end-header. Don't use these declarations to separate pre-prologue
7323 blocks from post-prologue blocks. Add new order-independent
7324 declarations %before-header and %after-header as alternatives to the
7325 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
7326 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
7327 * NEWS (2.3+): Update for these changes.
7328 * data/glr.c (b4_before_definitions): Update to...
7329 (b4_start_header): ... this.
7330 (b4_after_definitions): Update to...
7331 (b4_end_header): ... this.
7332 * data/glr.cc: Likewise.
7333 * data/lalr1.cc: Likewise.
7334 * data/yacc.c: Likewise.
7335 * doc/bison.texinfo (The prologue): Update names, and replace remaining
7336 prologue blocks with %*-header declarations.
7337 (Calc++ Parser): Likewise.
91661ebb 7338 (Decl Summary): Update names.
148d66d8 7339 (Table of Symbols): Update description.
34f98f46
JD
7340 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
7341 (PERCENT_END_HEADER): ... this.
7342 (PERCENT_BEFORE_DEFINITIONS): Update to...
7343 (PERCENT_START_HEADER): ... this.
7344 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
7345 (declaration): Update token names and m4 macro names.
7346 When parsing %end-header and %start-header, invoke translate_code
7347 before muscle_code_grow, and no longer set global booleans to remember
7348 whether these declarations have been seen.
7349 Parse new %after-header and %before-header.
7350 * src/reader.c (before_definitions, after_definitions): Remove.
7351 (prologue_augment): Accept a new bool argument to specify whether to
7352 augment the pre-prologue or post-prologue.
7353 * src/reader.h (before_definitions, after_definitions): Remove these
7354 extern's.
7355 (prologue_augment): Add new bool argument.
7356 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
7357 (PERCENT_END_HEADER): ... this.
7358 (PERCENT_BEFORE_DEFINITIONS): Update to...
7359 (PERCENT_START_HEADER): ... this.
7360 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
7361 * tests/actions.at (Printers and Destructors): Update names.
7362
31b2b07e
JD
73632006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
7364
7365 Add comparison operators for C++ location classes. Discussed at
7366 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
7367 * data/c++.m4 (b4_define_location_comparison): New boolean %define
7368 declaration indicating whether filename_type has an operator==. If
7369 filename_type is `std::string', it defaults to `1', `0' otherwise.
7370 * data/location.cc: Iff b4_define_location_comparison is `1', add
7371 operator== and operator!= for class position and for class location.
7372
7373 Some minor fixes.
7374 * src/scan-action.l: Remove unused file.
7375 * src/symtab.c (symbol_printer_set): Use printer_location not
7376 destructor_location.
7377 * src/symtab.h (struct symbol): Replace incorrect source comment for
7378 printer members.
7379 * tests/input.at (Incompatible Aliases): Update output with correct
7380 printer location.
7381
9bc0dd67
JD
73822006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
7383
7384 Don't put the pre-prologue in the header file. For the yacc.c code
7385 file and the glr.c header and code files, move the pre-prologue before
7386 the token definitions. Add new %before-definitions and
7387 %after-definitions to declare code that will go in both the header file
7388 and code file. Discussed at
7389 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
7390 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
7391 and
7392 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
7393 * NEWS (2.3+): Describe these changes.
7394 * data/glr.c (b4_pre_prologue): Move from within to before...
7395 (b4_shared_declarations): ... this.
7396 Add new b4_before_definitions before b4_token_enums.
7397 Add new b4_after_definitions at the end.
7398 * data/glr.cc (b4_pre_prologue): Replace with...
7399 (b4_before_definitions): ... this in the header file.
7400 (b4_after_definitions): New near the end of the header file.
7401 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
7402 code file right before including the header file.
7403 (b4_before_definitions): New in the previous position of
7404 b4_pre_prologue in the header file.
7405 (b4_after_definitions): New near the end of the header file.
7406 * data/yacc.c: Clean up some m4 quoting especially in the header file.
7407 (b4_token_enums_defines): In the code file, move to right before
7408 YYSTYPE for consistency with the header file.
7409 (b4_before_definitions): New right before b4_token_enums_defines in
7410 both the header and code file.
7411 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
7412 header and code file.
7413 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
7414 of prologues for %union dependencies.
91661ebb
JD
7415 (Decl Summary): In %defines description, mention the effect of
7416 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
7417 (Calc++ Parser): Forward declare driver in a %before-definitions rather
7418 than in the pre-prologue so that make check succeeds.
148d66d8 7419 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
7420 %after-definitions.
7421 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
7422 %before-definitions.
7423 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
7424 (declaration): Parse those declarations and append to
7425 b4_before_definitions and b4_after_definitions, respectively.
7426 * src/reader.c (before_definitions, after_definitions): New bools to
7427 track whether those declarations have been seen.
7428 (prologue_augment): Add to the post-prologue if %union,
7429 %before-definitions, or %after-definitions has been seen.
7430 * src/reader.h (before_definitions, after_definitions): New extern's.
7431 * src/scan-gram.l: Scan the new declarations.
7432 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
7433 prologue block in a %before-definitions or a %after-definitions based
7434 on whether the %union is declared.
7435 * tests/regression.at (Early token definitions with --yacc, Early token
7436 definitions without --yacc): Move tests for token definitions into the
7437 post-prologue since token names are no longer defined in the
7438 pre-prologue.
7439
203b9274
AD
74402006-06-20 Akim Demaille <akim@epita.fr>
7441
7442 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
7443 (symbol_get): Use it.
7444 * src/parse-gram.y: Use it.
7445
a7ee59cf
JD
74462006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
7447
7448 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
7449 build succeeds when configured with --enable-gcc-warnings.
7450
5a2baae7
PE
74512006-06-19 Paul Eggert <eggert@cs.ucla.edu>
7452
33ad1a9c
PE
7453 * src/parse-gram.y (char_name): New function.
7454 (CHAR, STRING, string_content): For %printer, properly escape.
7455 (ID): Prefer fputs to fprintf.
7456 (id): Reindent to be consistent with other rules.
7457 Properly quote char.
7458
5a2baae7
PE
7459 The Translation Project changed its way of publishing translations
7460 to maintainers. I haven't received any responses to my request
7461 for supporting the old way, or for documenting the new way. I
7462 have modified 'bootstrap' to use screen scraping
7463 (in this case, HTML scraping). This is unreliable and inelegant,
7464 but I don't see any better way. Yuck.
7465 * bootstrap (TP_URL, WGET_COMMAND): New vars.
7466 (get_translations): New function, which uses HTML scraping to
7467 deduce locations of latest translations.
7468 Use this function to grab both bison and bison-runtime .po files.
7469 Don't bother priming the pump for the runtime-po domain any more,
7470 as it's now translated better than bison is.
7471
58d7a1a1
AD
74722006-06-19 Akim Demaille <akim@epita.fr>
7473
7474 * src/scan-gram.l: No longer "parse" things after `%union' until
7475 `{'. Rather, return a single "%union" token.
7476 No longer make symbols: return strings, and leave the conversion
7477 to symbols to the parser.
7478 (SC_PRE_CODE, token_type): Remove.
7479 * src/parse-gram.y (%union): New field `character'.
7480 Sort tokens.
7481 (CHAR): New token.
7482 (ID, ID_COLON): Now that the scanner no longer makes them
7483 identifiers, adjust all uses to invoke symbol_get.
7484 (id_colon): New, wraps the conversion from string to symbol.
7485 (%union): Accept a possible union_name.
7486 (symbol): Now can be a char.
7487 * data/c.m4 (b4_union_name): Leave a default value.
7488 * data/glr.c, data/yacc.c: Use it.
7489
b931235e
JD
74902006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
7491
7492 For associating token numbers with token names for "yacc.c", don't use
7493 #define statements unless `--yacc' is specified; always use enum
7494 yytokentype. Most important discussions start at:
7495 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
7496 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
7497 and
7498 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
7499 * NEWS (2.3+): Mention.
7500 * data/c.m4 (b4_yacc_if): New.
7501 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
7502 token #define's.
7503 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
7504 on token name definitions.
7505 * src/getargs.c (usage): Capitalize `Yacc' in English.
7506 * src/output.c (prepare): Define b4_yacc_flag.
7507 * tests/regression.at (Early token definitions): Test that tokens names
7508 are defined before the pre-prologue not just before the post-prologue.
7509 Remove this test case and copy to...
7510 (Early token definitions with --yacc): ... this to test #define's.
7511 (Early token definitions without --yacc): ... and this to test enums.
7512
9e6e7ed2
PE
75132006-06-11 Paul Eggert <eggert@cs.ucla.edu>
7514
7515 * NEWS: Reword the post-2.3 change to not be so optimistic about
7516 removing the old "look-ahead" spelling.
7517 Update previous look-ahead/lookahead change reports.
7518 * REFERENCES: look-ahead -> lookahead (since that's
7519 what he actually wrote).
7520 * doc/refcard.tex: look ahead -> lookahead,
7521 look-ahead -> lookahead
7522
742e4900
JD
75232006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
7524
7525 For consistency, use `lookahead' instead of `look-ahead' or
7526 `look_ahead'. Discussed starting at
7527 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
7528 and then at
7529 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
7530 * NEWS: For the next release, note the change to `--report'.
7531 * TODO, doc/bison.1: Update English.
7532 * doc/bison.texinfo: Update English.
7533 (Understanding Your Parser, Bison Options): Document as
7534 `--report=lookahead' rather than `--report=look-ahead'.
7535 * src/conflicts.c: Update English in comments.
7536 (lookahead_set): Rename from look_ahead_set.
7537 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
7538 (resolve_sr_conflict): Rename local look_ahead_tokens to
7539 lookahead_tokens, and update other uses.
7540 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
7541 count_rr_conflicts, conflicts_free): Update uses.
7542 * src/getargs.c (report_args): Move "lookahead" before alternate
7543 spellings.
7544 (report_types): Update uses.
7545 (usage): For `--report' usage description, state `lookahead' spelling
7546 rather than `look-ahead'.
7547 * src/getargs.h (report.report_lookahead_tokens): Rename from
7548 report_look_ahead_tokens.
7549 * src/lalr.c: Update English in comments.
7550 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
7551 (state_lookahead_tokens_count): Rename from
7552 state_look_ahead_tokens_count.
7553 Rename local n_look_ahead_tokens to n_lookahead_tokens.
7554 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
7555 Rename local n_look_ahead_tokens to n_lookahead_tokens.
7556 Update other uses.
7557 Update English in output.
7558 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
7559 * src/print.c: Update English in comments.
7560 (lookahead_set): Rename from look_ahead_set.
7561 (print_reduction): Rename argument lookahead_token from
7562 look_ahead_token.
7563 (print_core, state_default_rule, print_reductions, print_results):
7564 Update uses.
7565 * src/print_graph.c: Update English in comments.
7566 (print_core): Update uses.
7567 * src/state.c: Update English in comments.
7568 (reductions_new): Update uses.
7569 (state_rule_lookahead_tokens_print): Rename from
7570 state_rule_look_ahead_tokens_print, and update other uses.
7571 * src/state.h: Update English in comments.
7572 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
7573 (state_rule_lookahead_tokens_print): Rename from
7574 state_rule_look_ahead_tokens_print.
7575 * src/tables.c: Update English in comments.
7576 (conflict_row, action_row): Update uses.
7577 * tests/glr-regression.at
7578 (Incorrect lookahead during deterministic GLR,
7579 Incorrect lookahead during nondeterministic GLR): Rename
7580 print_look_ahead to print_lookahead.
7581 * tests/torture.at: Update English in comments.
7582 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
7583 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
7584 (Many lookahead tokens): Update uses.
7585 * data/glr.c: Update English in comments.
7586 * lalr1.cc: Likewise.
7587 * yacc.c: Likewise.
7588 * src/conflicts.h: Likewise.
7589 * src/lalr.h: Likewise.
7590 * src/main.c: Likewise.
7591 * src/output.c: Likewise.
7592 * src/parse-gram.c: Likewise.
7593 * src/tables.h: Likewise.
7594 * tests/calc.at: Likewise.
7595
3c40d0b5
JD
75962006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
7597
7598 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
7599
5d278082
PE
76002006-06-07 Paul Eggert <eggert@cs.ucla.edu>
7601
7602 * TODO: Add request from Nelson H. F. Beebe to be able to install
7603 Bison without installing the yacc script.
7604
9e668899
JD
76052006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
7606
7607 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
7608 and yytext if they're already #define'd.
7609 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
7610 * src/scan-code-c.c: ... here.
7611 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
7612 <config.h>.
7613
0c8e079f
JD
76142006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
7615
7616 Get Bison to build again when configured with --enable-gcc-warnings.
7617 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
7618 missing #include's.
7619 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
7620 loc argument as it shadows a global.
7621 * src/scan-gram.l: Remove stray comma that prevents boundary_set
7622 invocation.
7623
7624 * src/.cvsignore: Add scan-code.c.
7625
2346344a
AD
76262006-06-07 Akim Demaille <akim@epita.fr>
7627
7628 * src/scan-gram.l: Move the "add a trailing ; to actions" code
7629 to...
7630 * src/scan-code.l: here.
7631 * tests/input.at (Torturing the Scanner): Fix another location
7632 error.
7633
4862bdfd
AD
76342006-06-07 Akim Demaille <akim@epita.fr>
7635
7636 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
7637
e9071366
AD
76382006-06-06 Akim Demaille <akim@epita.fr>
7639
7640 Extract the parsing of user actions from the grammar scanner.
7641 As a consequence, the relation between the grammar scanner and
7642 parser is much simpler. We can also split "composite tokens" back
7643 into simple tokens.
7644 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
7645 * src/scan-gram.l (add_column_width, adjust_location): Move to and
7646 rename as...
7647 * src/location.h, src/location.c (add_column_width)
7648 (location_compute): these.
7649 Fix the column count: the initial column is 0.
7650 (location_print): Be robust to ending column being 0.
7651 * src/location.h (boundary_set): New.
7652 * src/main.c: Adjust to scanner_free being renamed as
7653 gram_scanner_free.
7654 * src/output.c: Include scan-code.h.
7655 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
7656 Use boundary_set.
7657 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
7658 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
7659 which is now, again, a separate token.
7660 Adjust all dependencies.
7661 Whereever actions with $ and @ are used, use translate_code.
7662 (action): Remove this nonterminal which is now useless.
7663 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
7664 (grammar_current_rule_action_append): Use translate_code.
7665 (packgram): Bound check ruleno, itemno, and rule_length.
7666 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
7667 (last_string, last_braced_code_loc, max_left_semantic_context)
7668 (scanner_initialize, scanner_free, scanner_last_string_free)
7669 (gram_out, gram_lineno, YY_DECL_): Move to...
7670 * src/scan-gram.h: this new file.
7671 (YY_DECL): Rename as...
7672 (GRAM_DECL): this.
7673 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
7674 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
7675 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
7676 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
7677 Move these declarations, and...
7678 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
7679 these to...
7680 * src/flex-scanner.h: this new file.
7681 * src/scan-gram.l (rule_length, rule_length_overflow)
7682 (increment_rule_length): Remove.
7683 (last_braced_code_loc): Rename as...
7684 (gram_last_braced_code_loc): this.
7685 Adjust to the changes of the parser.
7686 Move all the handling of $ and @ into...
7687 * src/scan-code.l: here.
7688 * src/scan-gram.l (handle_dollar, handle_at): Remove.
7689 (handle_action_dollar, handle_action_at): Move to...
7690 * src/scan-code.l: here.
7691 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
7692 scan-code.h, scan-code-c.c, scan-gram.h.
7693 (EXTRA_bison_SOURCES): Add scan-code.l.
7694 (BUILT_SOURCES): Add scan-code.c.
7695 (yacc): Be robust to white spaces.
7696
7697 * tests/conflicts.at, tests/input.at, tests/reduce.at,
7698 * tests/regression.at: Adjust the column numbers.
7699 * tests/regression.at: Adjust the error message.
7891a7c4 7700
184e42f0
JD
77012006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
7702
7703 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
7704 Use Akim's wording from
7705 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
7706
7891a7c4
JD
77072006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
7708
7709 Between Bison releases, manually append `+' to the previous Bison
7710 release number, and use that as a signal to automatically print the
7711 ChangeLog's CVS Id keyword from --version. Discussed starting at
7712 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
7713 * ChangeLog: Add Id header.
7714 * configure.ac (AC_INIT): Append `+' to `2.3'.
7715 * src/.cvsignore: Add revision.c.
7716 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
7717 (BUILT_SOURCES): Add revision.c.
7718 (revision.c): New target rule. This file defines a new global variable
7719 named revision. It initializes it with either the Id from ChangeLog
7720 or, if VERSION doesn't contain `+', with the empty string.
7721 * src/getargs.c (version): Print the value of revision.
7722 * src/revision.h: Extern revision.
7723
4ad3ed84
PE
77242006-06-05 Paul Eggert <eggert@cs.ucla.edu>
7725
7726 * NEWS: Version 2.3.
7727 * configure.ac (AC_INIT): Likewise.
7728
02103984
PE
77292006-05-30 Paul Eggert <eggert@cs.ucla.edu>
7730
7731 * data/glr.c (YYRECOVERING): Define to be a function-like macro
7732 with no arguments, not as an object-like macro. This is for
7733 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
7734 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
7735 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
7736 Document this.
7737
2c08afa5
JD
77382006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
7739
7740 * src/getargs.c (usage): Back out yesterday's modification of the
7741 --help output so that we don't have to wait for translation before
7742 releasing 2.3.
7743
6077da58
PE
77442006-05-29 Paul Eggert <eggert@cs.ucla.edu>
7745
7746 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
7747 Problem reported by Akim Demaille.
7748
2a26b6c2
JD
77492006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
7750
7751 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
7752
aefef0d6
PE
77532006-05-26 Paul Eggert <eggert@cs.ucla.edu>
7754
7755 * data/yacc.c (yy_reduce_print): Omit trailing white space in
7756 generated source code. Problem reported by Frans Englich in
7757 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
7758
fcd8e201
PE
77592006-05-22 Paul Eggert <eggert@cs.ucla.edu>
7760
7761 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
7762 shell, not within 'make', so that 'make' by an ordinary builder
7763 (using GNU make) does not worry about configuring gzip. This also
7764 works around a bug reported independently by Keith Thompson and by
7765 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
7766 stderr rather than stdout, messing up the build logs.
7767
7b5cdcbd
JD
77682006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
7769
7770 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
7771 to make sure that YYID will never be unused. This fixes a 'make
7772 maintainer-check' failure caused by the recent changes to the 'Trivial
7773 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
7774 not used.
7775 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
7776
5ad0a449
JD
77772006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
7778
7779 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
7780 state before an empty RHS is always resolved here. Only the location
7781 of that state is guaranteed to be resolved, and that's enough. This
7782 fixes the remaining bug reported by Derek M. Jones in
7783 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
7784 * tests/glr-regression.at (Uninitialized location when reporting
7785 ambiguity): Test the above case.
7786 Also, the embedded comments in this test case claim it checks the case
7787 of an empty RHS that has inherited the initial location. However, the
7788 corresponding LHS was already resolved, so yyresolveLocations didn't
7789 actually have reason to modify it. Fix this by forcing
7790 nondeterministic operation at the beginning of the parse.
7791
50cce58e
PE
77922006-05-20 Paul Eggert <eggert@cs.ucla.edu>
7793
7794 * data/c.m4 (b4_yy_symbol_print_generate):
7795 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
7796 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
7797 of the bugs reported today by Derek M Jones in
7798 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
7799 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
7800 defined to be a type name without parens or brackets.
7801 (Location Type): Similarly for YYLTYPE.
7802 * tests/regression.at (Trivial grammars): Put in a test for this
7803 bug that will be caught by 'make maintainer-check' (though not,
7804 alas, by 'make check' unless your compiler is picky).
7805
ab8d9dc5
PE
78062006-05-19 Paul Eggert <eggert@cs.ucla.edu>
7807
0d2c8934 7808 * NEWS: Version 2.2.
ab8d9dc5
PE
7809 * configure.ac (AC_INIT): Likewise.
7810
9138c575
JD
78112006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
7812
7813 * data/glr.c (yyreportTree): Make room in yystates for the state
7814 preceding the RHS. This fixes the segmentation fault reported by Derek
7815 M. Jones in
7816 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
7817 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
7818 to the user. Reported for yyreportTree by Derek M. Jones later in the
7819 same thread.
7820 * THANKS: Add Derek M. Jones.
7821 Update my email address.
7822 Fix typo in Steve Murphy's name.
7823
276f48df
PE
78242006-05-14 Paul Eggert <eggert@cs.ucla.edu>
7825
d6645148
PE
7826 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
7827 checking against YYLAST that caused the parser to miss a potential
7828 alternative in its diagnostic.
7829 Problem reported by Maria Jose Moron Fernandez in
7830 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
7831 * data/lalr1.cc (yysyntax_error_): Likewise.
7832 * data/yacc.c (yysyntax_error): Likewise.
7833 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
7834 tokens, in case we run into an older C compiler.
7835 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
7836 Use them to check for the off-by-one error fixed above.
7837
276f48df
PE
7838 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
7839 YYSIZE_T, not size_t.
7840 * tests/regression.at (Trivial grammars): New test, to catch
7841 the error fixed by the above patch.
7842
cd8b5791
AD
78432006-05-14 Akim Demaille <akim@lrde.epita.fr>
7844
7845 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
7846 scheme.
7847 Reported by Steve Murphy.
7848
34376418
AD
78492006-05-14 Akim Demaille <akim@lrde.epita.fr>
7850
7851 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
7852 * data/glr.cc: b4_location_flag is now b4_locations_flag.
7853
327afc7c
AD
78542006-05-14 Akim Demaille <akim@lrde.epita.fr>
7855
7856 Implement --trace=m4.
7857 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
7858 * src/output.c (output_skeleton): When set, pass -dV to m4.
7859
7860 Factor the handling of flags in m4.
7861 * src/output.c (prepare): Rename the muscle names debug, defines,
7862 error_verbose to debug_flag, defines_flag, error_verbose_flag.
7863 * data/c.m4: Adjust.
7864 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
7865 Use b4_define_flag_if to define other b4_FLAG_if macros.
7866 (b4_location_if): As a consequence, rename as...
7867 (b4_locations_if): this, for consistency.
7868 Adjust all the skeletons.
7869
ba9ecd19
AD
78702006-05-14 Akim Demaille <akim@lrde.epita.fr>
7871
7872 * etc/bench.pm: Shorten bench names.
7873
4e83ea15
AD
78742006-05-14 Akim Demaille <akim@lrde.epita.fr>
7875
7876 * src/output.h, src/output.c (error_verbose): Move to...
7877 * src/getargs.h, src/getargs.c: here.
7878 Sort the flags.
7879 Adjust dependencies.
7880
6e93d810
PE
78812006-05-13 Paul Eggert <eggert@cs.ucla.edu>
7882
7883 * data/c.m4 (b4_copyright): Put the special exception for Bison
7884 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
7885 uses changed. Suggested by Akim Demaille. Also, wrap the
7886 copyright notice, in case it is longer than 80 columns. Replace
7887 comma by newline after title.
6e93d810 7888
eaea13f5
PE
78892006-05-11 Paul Eggert <eggert@cs.ucla.edu>
7890
7891 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
7892 incompatibility, not a bug. Mention that it wasn't fixed as of
7893 flex 2.5.33.
7894
3cf084ec
AD
78952006-05-11 Akim Demaille <akim@lrde.epita.fr>
7896
7897 * examples/extexi: Enforce the precedence of concatenation over
7898 >>.
0a9f1c7d 7899 Reported by Tommy Nordgren.
3cf084ec 7900
32c96bd7
AD
79012006-05-11 Akim Demaille <akim@lrde.epita.fr>
7902
7903 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
7904 with the member "token".
f94705b2 7905 Reported by Martin Nylin.
32c96bd7 7906
eaea13f5
PE
79072006-05-08 Paul Eggert <eggert@cs.ucla.edu>
7908
7909 * data/glr.c: Switch to Bison 2.2 special-exception language in
7910 the copyright notice. Use more-regular format for titles and
7911 copyright notices.
7912 * data/glr.cc: Likewise.
7913 * data/location.cc: Likewise.
7914 * data/yacc.cc: Likewise.
7915 * doc/bison.texinfo (Conditions): Document this.
7916 * NEWS: likewise. Upgrade version to 2.2.
7917
6e2d1146
AD
79182006-04-27 Akim Demaille <akim@lrde.epita.fr>
7919
7920 * data/glr.cc: Remove dead code.
7921
47671055
PE
79222006-04-25 Paul Eggert <eggert@cs.ucla.edu>
7923
7924 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
7925 that variable and the line breaks the bootstrap. Problem reported
7926 by Juan M. Guerrero.
7927
ed2e6384
AD
79282006-04-24 Akim Demaille <akim@lrde.epita.fr>
7929
7930 * doc/bison.texinfo (Multiple start-symbols): New.
7931
3cedc2dc
AD
79322006-04-24 Akim Demaille <akim@lrde.epita.fr>
7933
7934 * etc/README, etc/bench.pl: New.
7935
b2ddc3f3
AD
79362006-04-03 Akim Demaille <akim@lrde.epita.fr>
7937
7938 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
7939 rule.
7940 Reported by Mickael Labau.
7941 * tests/input.at (Torturing the Scanner): Test it.
7942
91e3ac9a
PE
79432006-03-16 Paul Eggert <eggert@cs.ucla.edu>
7944
7945 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
7946 Problem reported by Bob Rossi.
7947
79482006-03-13 Paul Eggert <eggert@cs.ucla.edu>
7949
7950 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
7951 and didn't really work.
7952 For the index, use @ifnotinfo, not @iftex.
7953 Minor cleanups of spacing and terminology.
7954
5cf61e93
AD
79552006-03-12 Akim Demaille <akim@lrde.epita.fr>
7956
7957 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
7958 of AT_NAME_PREFIX when %name-prefix is not used.
7959
aa08666d
AD
79602006-03-12 Akim Demaille <akim@lrde.epita.fr>
7961
7962 Apply --prefix to C++ skeletons too: they change the namespace.
7963 The test suite already exercize these cases.
7964 * data/c++.m4 (b4_namespace): New.
7965 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
7966 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
7967 * data/yacc.c, data/glr.c: Remove a useless `[]'.
7968 * doc/bison.texinfo: Document it.
7969 (Option Cross Key): Use @multitable in all formats. It looks
7970 nicer, even in TeX outputs.
7971 (Rules): Use the same code whatever the output type is.
7972 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
7973 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
7974 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 7975
45567173
AD
79762006-03-10 Akim Demaille <akim@lrde.epita.fr>
7977
7978 * TODO: Remove dead items.
7979
e9d8f881 79802006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
7981
7982 * doc/FAQ: Remove, merged into...
7983 * doc/bison.texinfo (FAQ): this.
7984 * doc/Makefile.am (EXTRA_DIST): Adjust.
7985
c095d689
AD
79862006-03-10 Akim Demaille <akim@lrde.epita.fr>
7987
7988 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
7989 even if empty.
7990 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
7991 * doc/bison.texinfo (Calc++ Scanner): Use it.
7992
6e0f8287
PE
79932006-03-09 Paul Eggert <eggert@cs.ucla.edu>
7994
7995 Fix two nits reported by twlevo, plus one more that I discovered.
7996
7997 * src/assoc.h (assoc_to_string): Give a name to the arg, as
7998 this is the usual Bison style.
7999 * src/location.h (location_print): Likewise.
8000
8001 * src/reader.h (token_name): Likewise.
8002
d6b771c3
PE
80032006-03-08 Paul Eggert <eggert@cs.ucla.edu>
8004
8005 Fix some nits reported by twlevo.
8006 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
8007 and "POSIX". Use more-modern syntax for URLs. Mention C++
8008 and ask for Java. Don't hardwire OS version numbers. Add
8009 copyright notice.
8010 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
8011 * src/conflicts.c (solved_conflicts_obstack): Now static.
8012
1e137b71
JD
80132006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
8014
8015 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
8016 page. Say "you can use it" not "you may use it" as on the web page;
8017 we're describing capabilities not granting permission.
8018
73f2e47e
PE
80192006-03-06 Paul Eggert <eggert@cs.ucla.edu>
8020
6d05403d
PE
8021 * data/glr.c (yyresolveLocations): Rename local variables to avoid
8022 shadowing warnings. Use usual patter for iterating through RHS.
8023 * tests/glr-regression.at
8024 (Uninitialized location when reporting ambiguity):
8025 Modify yylex so that it uses its argument, rather than trying
8026 to rely on ARGSUSED (which doesn't work for gcc with warnings).
8027 const char -> char const.
8028
73f2e47e
PE
8029 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
8030 Don't use tabs inside commands; it messes up 'ps'.
8031 Problem reported by twlevo.
8032
8710fc41
JD
80332006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
8034
8035 * tests/glr-regression.at (Uninitialized location when reporting
8036 ambiguity): New test case.
8037 * data/glr.c (yyresolveLocations): New function, which uses
8038 YYLLOC_DEFAULT.
8039 (yyresolveValue): Invoke yyresolveLocations before reporting an
8040 ambiguity.
8041 * doc/bison.texinfo (Default Action for Locations): Note
8042 YYLLOC_DEFAULT's usage for ambiguity locations.
8043 (GLR Semantic Actions): Cross-reference those notes.
8044
ae952af2
JD
80452006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
8046
8047 * tests/glr-regression.at (Leaked semantic values when reporting
8048 ambiguity): Remove unnecessary union and type declarations.
8049 (Leaked lookahead after nondeterministic parse syntax error): New test
8050 case.
8051 * data/glr.c (yyparse): Check for zero stacks remaining before
8052 attempting to shift the lookahead so that you don't lose it.
8053
35ee866a
JD
80542006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
8055
8056 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
8057 * tests/glr-regression.at (Leaked semantic values when reporting
8058 ambiguity): New test case.
8059 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
8060 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
8061 now unnecessary yystackp parameter.
8062 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
8063 destructors can be called.
8064
8065 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
8066 in existing testcases.
8067
520181ab
JD
80682006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
8069
8070 Don't leak semantic values for parent RHS when a user action cuts the
8071 parser, and clean up related code a bit.
8072 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
8073 cuts parse): Rename to...
8074 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
8075 for leaked parent RHS values.
8076 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
8077 between an unresolved state (non-empty chain of semantic options) and
8078 an incomplete one (signaled by an empty chain).
ae952af2 8079 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
8080 successfully or unsuccessfully resolved yyGLRState to...
8081 (yyresolveValue): ... here so that yyresolveValue always leaves a
8082 yyGLRState with consistent data and thus is easier to understand.
8083 Remove the yyvalp and yylocp parameters since they are always just
8084 taken from the yys parameter. When reporting a discarded merged value
8085 in debugging output, note that it is incompletely merged. Document the
8086 interface.
8087 (yyresolveAction): If resolving any of the RHS states fails, destroy
8088 them all rather than leaking them. Thus, as long as user actions are
8089 written to clean up the RHS correctly, yyresolveAction always cleans up
8090 the RHS of a semantic option. Document the interface.
8091
18d9185c
PE
80922006-02-27 Paul Eggert <eggert@cs.ucla.edu>
8093
8094 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
8095 led to a segmentation fault in GNU Pascal. Problem reported
8096 by Waldek Hebisch.
8097
841a7737
JD
80982006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
8099
8100 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
8101 mid-rule action inside a nonterminal symbol in order to declare a
8102 destructor for its semantic value.
8103
fc3f467f
PE
81042006-02-16 Paul Eggert <eggert@cs.ucla.edu>
8105
8106 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
8107 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
8108 __cplusplus && ! defined _STDLIB_H && !
8109 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
8110 defined free))]: Include <stdlib.h> rather than rolling our own
8111 declarations of malloc and free, to avoid problems with
8112 incompatible declarations (using 'throw') C++'s stdlib.h. This
8113 should fix Debian bug 340012
8114 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
8115 reported by Guillaume Melquiond.
8116
a3af26dd
PE
81172006-02-13 Paul Eggert <eggert@cs.ucla.edu>
8118
4d7bc38c
PE
8119 * NEWS: Clarify symbols versus types in unused-value warnings.
8120
a3af26dd
PE
8121 * configure.ac (AC_INIT): Bump version number.
8122
4e26c69e
PE
81232006-02-13 Paul Eggert <eggert@cs.ucla.edu>
8124
8125 * NEWS: Version 2.1a.
8126 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
8127 since C99 requires this.
8128
498e897c
PE
81292006-02-11 Paul Eggert <eggert@cs.ucla.edu>
8130
8131 * m4/c-working.m4: New file.
8132 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
8133
57bb17ca
PE
81342006-02-10 Paul Eggert <eggert@cs.ucla.edu>
8135
8136 * Makefile.maint: Merge from coreutils.
8137
0be105dc
PE
81382006-02-09 Paul Eggert <eggert@cs.ucla.edu>
8139
8140 More portability fixes for problems summarized by Nelson H. F. Beebe.
8141
8142 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
8143 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
8144 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
8145 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
8146 messes up because C++ code is compiled in 32-bit mode but linked
8147 in 64-bit mode.
8148
6fc0c024
PE
81492006-02-08 Paul Eggert <eggert@cs.ucla.edu>
8150
8151 More portability fixes for problems summarized by Nelson H. F. Beebe.
8152
7870f699
PE
8153 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
8154 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
8155
6fc0c024
PE
8156 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
8157 nodist_PROGRAMS, since we don't need to actually compile the
8158 example if we're just doing a plain 'make'. This avoids bothering
8159 the installer unnecessarily about problems due to weird C++
8160 compilers.
8161
fe6c2fde
PE
81622006-02-06 Paul Eggert <eggert@cs.ucla.edu>
8163
8164 More portability fixes for problems summarized by Nelson H. F. Beebe.
8165
8166 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
8167 than #include "...", and compile with -I'.'. The old method was
8168 not portable, according to Posix and the C standard, and it does
8169 not work with Sun C 5.7, where previous #line directives affect
8170 the working directory used in later #include "..." directives.
8171
927b425b
JMG
81722006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8173
8174 Various DJGGP specific issues in /djgpp
8175
d9735e9e
PE
81762006-02-02 Paul Eggert <eggert@cs.ucla.edu>
8177
8178 More portability fixes for problems summarized by Nelson H. F. Beebe.
8179
8180 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
8181 '#include <map>' works and that you can apply ++ to iterators.
8182
5a6755af
PE
81832006-02-01 Paul Eggert <eggert@cs.ucla.edu>
8184
67a0dc4f
PE
8185 Work around portability problems summarized by Nelson H. F. Beebe in
8186 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
8187
8c86f0ef
PE
8188 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
8189 that '#include <string>' works.
8190
de35dd59
PE
8191 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
8192 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
8193 "warning: sorry: semantics of inline function static data `const
8194 unsigned char translate_table[262]' are wrong (you'll wind up with
8195 multiple copies)".
8196
67a0dc4f
PE
8197 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
8198 or, xor to not_, and_, or_, and xor_, respectively. This works
8199 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
8200 random system header somewhere that includes the equivalent of
8201 <iso646.h>.
8202
5a6755af
PE
8203 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
8204 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 8205 Suite Version 2.0.
5a6755af 8206
3f001415
JD
82072006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
8208
8209 During deterministic GLR operation, user actions should be able to
8210 influence the parse by changing yychar. To make this easier to fix and
8211 to make glr.c easier to evolve in general, don't maintain yytoken in
8212 parallel with yychar; just compute yytoken when needed.
8213 * tests/glr-regression.at (Incorrect lookahead during deterministic
8214 GLR): Check that setting yychar in a user action has the intended
8215 effect.
8216 * data/glr.c (yyGLRStack): Remove yytokenp member.
8217 (yyclearin): Don't set *yytokenp.
8218 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
8219 yychar rather than *yytokenp to determine the current lookahead.
8220 Compute yytoken locally when needed.
8221 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
8222 point to.
8223
8224 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
8225 after `--report' documentation.
8226
e2a8c0f5
PE
82272006-01-30 Paul Eggert <eggert@cs.ucla.edu>
8228
8229 * src/parse-gram.y (grammar_declaration): Location of printer
8230 symbol is @1, not list->location. Bug reported by twlevo.
8231 * tests/input.at (Incompatible Aliases): Adjust to above change.
8232
6b702268
PE
82332006-01-29 Paul Eggert <eggert@cs.ucla.edu>
8234
27622431
PE
8235 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
8236 all the test at once. This makes the output easier to read in the
8237 normal case.
8238
6b702268
PE
8239 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
8240 got from <http://bro-ids.org/download.html>. The bug is that
8241 when two actions appeared in succession, the second one was
8242 scanned before the first one was added to the grammar rule
8243 as a midrule action. Bison then output the incorrect warning
8244 "parse.y:905.17-906.36: warning: unused value: $3".
8245 * src/parse-gram.y (BRACED_CODE, action): These are no longer
8246 associated with a value.
8247 (rhs): Don't invoke grammar_current_rule_action_append.
8248 (action): Invoke it here instead.
8249 * src/reader.c (grammar_midrule_action): Now extern.
8250 (grammar_current_rule_action_append): Don't invoke
8251 grammar_midrule_action; that is now the scanner's job.
8252 * src/reader.h (last_string, last_braced_code_loc):
8253 (grammar_midrule_action): New decls.
8254 * src/scan-gram.l (last_string): Now extern, sigh.
8255 (last_braced_code_loc): New extern variable.
8256 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
8257 rule already has an action.
8258 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
8259 * tests/input.at (AT_CHECK_UNUSED_VALUES):
8260 Add some tests to check that the above changes fixed the bug.
8261
d40ba6c2
PE
82622006-01-27 Paul Eggert <eggert@cs.ucla.edu>
8263
8264 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
8265 All used changed. Check whether the symbol has a destructor,
8266 not whether it is typed.
8267 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
8268 that the values are still reported as unused. All line numbers
8269 adjusted.
8270
401aace6
PE
82712006-01-23 Paul Eggert <eggert@cs.ucla.edu>
8272
8273 Work around a bug in bro 0.8, which underparenthesizes its
8274 definition of YYLLOC_DEFAULT.
8275 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
8276 their arguments.
8277 * data/lalr1.cc: Likewise.
8278 * data/yacc.cc: Likewise.
8279
06f01bc4
PE
82802006-01-22 Paul Eggert <eggert@cs.ucla.edu>
8281
401aace6
PE
8282 Work around a bug in Pike 7.0, and give the Pike folks a
8283 better way to override the usual int widths.
8284 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
8285 user can override the types.
8286 (short): #undef, to work around a bug in Pike 7.0.
8287 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
8288 (union yyalloc.yyss): Use yytype_int16 rather than short.
8289 All uses changed.
8290 (yysigned_char): Remove.
8291 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
8292 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
8293 * tests/regression.at (Web2c Actions): Adjust to above changes.
8294
8295 * src/reader.c (check_and_convert_grammar): New function.
8296 (reader): Close the input file even if something went wrong during
8297 parsing. Minor file descriptor leak reported by twlevo.
8298
06f01bc4
PE
8299 * src/assoc.c (assoc_to_string): Use a default: abort (); case
8300 to pacify gcc -Wswitch-default.
8301 * src/scan-gram.l (adjust_location): Use a default: break; case
8302 to pacify gcc -Wswitch-default.
8303 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
8304 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
8305 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
8306 Move these decls to scan-skel.l, since they don't need to be
8307 visible elsewhere.
8308 * src/scan-skel.l: Accept the above decls.
8309 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
8310 is used.
8311
02650b7f
PE
83122006-01-21 Paul Eggert <eggert@cs.ucla.edu>
8313
8314 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
8315 since we don't want to insist on a version number at the start
8316 of the changelog every time.
8317 * Makefile.maint: Sync from coreutils a bit better.
8318 (sc_trailing_blank): Renamed from sc_trailing_space.
8319 All uses changed.
8320 (sc_no_if_have_config_h, sc_require_config_h):
8321 (sc_prohibit_assert_without_use): New rules.
8322 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
8323 (sc_dd_max_sym_length): Fix leading spaces in rule.
8324 (sc_system_h_headers): Prefix with @.
8325 (sc_useless_cpp_parens, m4-check): Output line numbers.
8326 (changelog-check): Allow version only in head.
8327 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
8328 satisfy new Makefile.maint rule.
8329 * data/glr.c: Likewise.
8330 * data/glr.cc: Likewise.
8331 * data/lalr1.cc: Likewise.
8332 * data/yacc.c: Likewise.
8333 * lib/ebitsetv.c: Likewise.
8334 * lib/lbitset.c: Likewise.
8335 * lib/subpipe.c: Likewise.
8336 * lib/timevar.c: Likewise.
8337 * src/system.h: Likewise.
8338 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
8339 * djgpp/Makefile.maint: Add copyright notice.
8340 * djgpp/README.in: Likewise.
8341 * djgpp/config.bat: Likewise.
8342 * djgpp/config.site: Likewise.
8343 * djgpp/config_h.sed: Likewise.
8344 * djgpp/djunpack.bat: Likewise.
8345 * djgpp/config.sed: Fix copyright notice to match standard format.
8346 * djgpp/subpipe.h: Likewise.
8347 * lib/bitsetv-print.c: Likewise.
8348 * lib/bitsetv.c: Likewise.
8349 * lib/subpipe.h: Likewise.
8350 * lib/timevar.c: Likewise.
8351 * lib/timevar.h: Likewise.
8352 * djgpp/subpipe.c: Use standard recipe for config.h.
8353 * lib/abitset.c: Likewise.
8354 * lib/bitset.c: Likewise.
8355 * lib/bitset_stats.c: Likewise.
8356 * lib/bitsetv-print.c: Likewise.
8357 * lib/bitsetv.c: Likewise.
8358 * lib/ebitsetv.c: Likewise.
8359 * lib/get-errno.c: Likewise.
8360 * lib/lbitset.c: Likewise.
8361 * lib/subpipe.c: Likewise.
8362 * lib/timevar.c: Likewise.
8363 * lib/vbitset.c: Likewise.
8364 * tests/local.at: Likewise.
8365 * src/scan-gram.l: Don't include verify.h, since system.h does
8366 that for us.
8367 * .x-sc_require_config_h: New file.
8368 * .x-sc_unmarked_diagnostics: New file.
8369
287c78f6
PE
83702006-01-20 Paul Eggert <eggert@cs.ucla.edu>
8371
287c78f6
PE
8372 Be a bit more systematic about using 'abort'.
8373 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
8374 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
8375 Put 'default: abort ();' before some other case, to satisfy older
8376 pedantic compilers.
8377 * lib/bitset_stats.c (bitset_stats_init): Likewise.
8378 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
8379 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
8380 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
8381 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
8382 (get_decision_str, get_orientation_str, get_node_alignment_str):
8383 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
8384 (get_linestyle_str, get_arrowstyle_str): Likewise.
8385 * src/conflicts.c (resolve_sr_conflict):
8386 Use a default case rather than one for the one remaining enum
8387 value, to catch invalid enum values as well.
8388 * src/lalr.c (set_goto_map, map_goto):
8389 Prefer "assert (FOO);" to "if (!FOO) abort ();".
8390 * src/nullable.c (nullable_compute, token_definitions_output):
8391 Likewise.
8392 * src/reader.c (packgram, reader): Likewise.
8393 * src/state.c (transitions_to, state_new, state_reduction_find):
8394 Likewise.
8395 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
8396 (symbol_pack): Likewise.
8397 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
8398 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
8399 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
8400 * src/system.h: Don't include <assert.h>.
8401 (assert): New macro.
8402
8403 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
8404 (Destructor Decl, Parser Function, Pure Calling):
8405 Describe rules for braces inside C code more carefully.
287c78f6 8406
c66dfadd
PE
84072006-01-19 Paul Eggert <eggert@cs.ucla.edu>
8408
c21493b8
PE
8409 Fix some porting glitches found by Nelson H. F. Beebe.
8410 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
8411 compilers that don't understand that abort () does not return.
8412 * src/state.c (transitions_to): Likewise.
8413 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
8414 that '#include <cstdlib>' works.
8415 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
8416 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
8417 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
8418 for the benefit of some pre-C99 compilers.
8419
b6e3facf
PE
8420 * bootstrap: Undo changes to gnulib files that autoreconf made.
8421
c66dfadd
PE
8422 Minor fixups to get 'make maintainer-check' to work.
8423 * configure.ac: Don't use -Wnested-externs, as it's incompatible
8424 with the new verify.h implementation.
8425 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
8426 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
8427 * data/yacc.c (YYUSE): Likewise.
8428 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
8429 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
8430 * src/parse-gram.y (declaration): Don't pass a string constant
8431 to a function that expects char *, since GCC might complain
8432 about the constant value.
8433 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
8434 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
8435 before #defining them.
8436 * tests/glr-regression.at
8437 (Incorrectly initialized location for empty right-hand side in GLR):
8438 In yyerror, use the msg arg.
8439 (Corrupted semantic options if user action cuts parse):
8440 (Incorrect lookahead during deterministic GLR):
8441 (Incorrect lookahead during nondeterministic GLR):
8442 Don't name a local var 'index'; it shadows string.h's 'index'.
8443
ed94ef2a
AD
84442006-01-19 Akim Demaille <akim@epita.fr>
8445
8446 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
8447 location, not just parts of it.
8448
e9ad4aec
PE
84492006-01-18 Paul Eggert <eggert@cs.ucla.edu>
8450
d6ca7905
PE
8451 * NEWS: Document the fact that multiple %unions are now allowed.
8452 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
8453 * TODO: This feature is now implemented, so remove it from
8454 the wishlist.
d6ca7905 8455
ef1b70e0
PE
8456 * Makefile.maint: Merge with coreutils Makefile.maint.
8457 (CVS_LIST): Use build-aux version if available.
8458 (VERSION_REGEXP): New macro.
8459 (syntax-check-rules): Add sc_no_if_have_config_h,
8460 sc_prohibit_assert_without_use, sc_require_config_h,
8461 sc_useless_cpp_parens.
8462 (sc_obsolete_symbols): Check for O_NDELAY.
8463 (sc_dd_max_sym_length): Track coreutils.
8464 (sc_unmarked_diagnostics): Look in all files, not just *.c.
8465 (sc_useless_cpp_parens): New rule.
8466 (news-date-check): Look for version or today's date.
8467 (changelog-check): Don't require version number near head.
8468 (copyright-check): Use current year instead of hardwiring 2005.
8469 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
8470 (announcement): Add --gpg-key-ID.
8471
8472 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
8473 with "file system".
8474
2073ce56 8475 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
8476 array. Problem reported by twlevo.
8477 * src/reader.c (packgram): Prepend a new sentinel before ritem.
8478 * src/lalr.c (build_relations): Rely on new sentinel.
8479 * src/gram.c (gram_free): Adjust to new sentinel.
8480
b7691f15
JD
84812006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
8482
8483 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
8484 yylookaheadNeeds. All uses updated.
8485 (yysplitStack): Rename local yynewLookaheadStatuses to
8486 yynewLookaheadNeeds.
8487 * data/glr-regression.at (Incorrect lookahead during nondeterministic
8488 GLR): In comments, change `lookahead status' to `lookahead need'.
8489
ddee1b06
PH
84902006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8491
8492 * data/glr.c (yysplitStack): A little stylistic rewrite.
8493
12f4614d
PH
84942006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8495
8496 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
8497
32c29292
JD
84982006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
8499
8500 * doc/bison.texinfo: Fix some typos.
8501 (GLR Semantic Actions): New subsection discussing special
8502 considerations because GLR semantic actions might be deferred.
8503 (Actions): Mention look-ahead usage of yylval.
8504 (Actions and Locations): Mention look-ahead usage of yylloc.
8505 (Special Features for Use in Actions): Add YYEOF entry and mention it
8506 in the yychar entry.
8507 In the yychar entry, remove mention of the local yychar case (pure
8508 parser) since this is irrelevant information when writing semantic
148d66d8 8509 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
8510 yychar is otherwise described as an external variable.
8511 In the yychar entry, don't call it the `current' look-ahead since it
8512 isn't when semantic actions are deferred.
8513 In the yychar and yyclearin entries, add note about deferred semantic
8514 actions.
8515 Add yylloc and yylval entries discussing look-ahead usage.
8516 (Look-Ahead Tokens): When discussing yychar, don't call it the
8517 `current' look-ahead, and do mention yylval and yylloc.
8518 (Error Recovery): Cross-reference `Action Features' when mentioning
8519 yyclearin.
148d66d8 8520 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
8521 look-ahead.
8522 In the yylloc and yylval entries, mention look-ahead usage.
8523
de366a2f 85242006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
8525
8526 * tests/glr-regression.at: Update copyright year to 2006.
8527
bf70fa87
JD
85282006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8529
8530 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
8531 use during nondeterministic operation to track which stacks have
8532 actually needed the current lookahead.
8533 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
8534 Allocate, deallocate, resize, and otherwise shuffle space for
8535 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
8536 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
8537 appropriately during nondeterministic operation.
8538 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
8539 members to store the current lookahead to be used by the deferred
8540 user action.
8541 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
8542 from which the RHS is taken. Set the lookahead members of the new
8543 yySemanticOption according to the lookahead status for stack yyk.
8544 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
8545 yyaddDeferredAction.
8546 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
8547 members of yySemanticOption before invoking yyuserAction, and then set
8548 them back to their current values afterward.
8549 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
8550 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
8551 * tests/glr-regression.at: Remove `.' from the ends of recent test case
8552 titles for consistency.
8553 (Leaked merged semantic value if user action cuts parse): In order to
8554 suppress lint warnings, use arguments in merge function, and assign
8555 char value < 128 in main.
8556 (Incorrect lookahead during deterministic GLR): New test case.
8557 (Incorrect lookahead during nondeterministic GLR): New test case.
8558
05449a2c
JD
85592006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8560
de366a2f 8561 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
8562 !yyvaluep as signal that no semantic value is available to print.
8563 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
8564 to print a semantic value.
8565
4158e0a1 85662006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 8567
4158e0a1
JD
8568 * tests/glr-regression.at: For consistency with my newer test cases,
8569 don't thank myself.
8570
d659304d
JD
85712006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
8572
8573 * data/glr.c (yyresolveValue): When merging semantic options, if at
8574 least one user action succeeds but a later one cuts the parse, then
8575 destroy the semantic value before returning rather than leaking it.
8576 (yyresolveStates): If a user action cuts the parse and thus
8577 yyresolveValue fails, ignore the (unset) semantic value rather than
8578 corrupting the yyGLRState, and empty the semantic options list since
8579 the user actions should have called all necessary destructors.
8580 Simplify code with YYCHK.
8581 * tests/glr-regression.at (Corrupted semantic options if user action
8582 cuts parse): New test case.
8583 (Undesirable destructors if user action cuts parse): New test case.
8584 Before applying any of this patch, this test case never actually failed
8585 for me... but only because the corrupted semantic options usually
8586 masked this bug.
8587 (Leaked merged semantic value if user action cuts parse): New test
8588 case.
8589
6ec2c0f2
AD
85902006-01-05 Akim Demaille <akim@epita.fr>
8591
8592 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
8593
1b9c21fb
PE
85942006-01-04 Paul Eggert <eggert@cs.ucla.edu>
8595
8596 * data/c.m4 (b4_c_modern): New macro, with a new provision for
8597 _MSC_VER. Problem reported by Cenzato Marco.
8598 (b4_c_function_def): Use it.
8599 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
8600 b4_c_modern.
8601 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
8602 than rolling our own.
8603
84866159
AD
86042006-01-04 Akim Demaille <akim@epita.fr>
8605
8606 Also warn about non-used mid-rule values.
8607 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
8608 member.
8609 (symbol_list_new): Adjust.
8610 * src/reader.c (symbol_typed_p): New.
8611 (grammar_rule_check): Use it.
8612 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
8613 Check its rule.
8614 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
8615 Use it.
8616 * tests/actions.at (Exotic Dollars): Adjust.
8617
378f4bd8
AD
86182006-01-04 Akim Demaille <akim@epita.fr>
8619
8620 * src/reader.c (grammar_midrule_action): If $$ is set in a
8621 mid-rule, move the `used' bit to its lhs.
8622 * tests/input.at (Unused values): New.
8623 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
8624
e2a21b6f
PE
86252006-01-03 Paul Eggert <eggert@cs.ucla.edu>
8626
54662697
PE
8627 * doc/bison.texinfo (Bison Options): Say more accurately what
8628 --yacc does.
8629 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
8630 about declarations in the grammar when in Yacc mode, as POSIX does
8631 not require a diagnostic when the grammar uses extensions.
8632
8633 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
8634
073f9288
PE
8635 Warn about dubious constructions like "%token T T".
8636 Reported by twlevo.
8637 * src/symtab.h (struct symbol.declared): New member.
8638 * src/symtab.c (symbol_new): Initialize it to false.
8639 (symbol_class_set): New arg DECLARING, specifying whether
8640 this is a declaration that we want to warn about, if there
8641 is more than one of them. All uses changed.
8642
1221b78a
PE
8643 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
8644 Allow multiple %union directives, whose contents concatenate.
8645 * src/parse-gram.y (grammar_declaration): Likewise.
8646 Use muscle_code_grow, so that we don't need stype_line any more.
8647 All uses changed.
8648
8649 * src/muscle_tab.c (muscle_grow): Fix comment.
8650
e2a21b6f
PE
8651 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
8652 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
8653 Update copyright year to 2006.
8654
8f7e3cf9
AD
86552006-01-03 Akim Demaille <akim@epita.fr>
8656
8657 Have glr.cc pass (some of) the calc.at tests.
8658 * data/glr.cc (b4_parse_param_orig): New.
8659 (b4_parse_param): Improve its definition, and bound it more
8660 clearly in the skeleton.
8661 (b4_epilogue): Append, instead of prepending, in order to keep
8662 #line consistency.
8663 Simplify the generation of auxiliary functions: locations and
8664 purity are mandated.
8665 (b4_global_tokens_and_yystype): Honor it.
8666 * data/location.cc (c++.m4): Don't include it.
8667 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
8668 and AT_SKEL_CC_IF.
8669 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
8670 AT_LALR1_CC_IF.
8671 Be sure to initialize the first position's filename.
8672 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
8673 mandated anyway.
8674 (AT_CHECK_CALC_GLR_CC): New.
8675 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
8676
3953ed88
AD
86772006-01-02 Akim Demaille <akim@epita.fr>
8678
8679 * src/output.c (output_skeleton): Don't hard wire the inclusion of
8680 c.m4.
0a96ba81 8681 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
8682 * data/glr.cc: Do not include stack.hh.
8683
9ecafbbf
AD
86842006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
8685
8686 * data/glr.c: Reformat whitespace with tabs.
8687 (b4_lpure_formals): Remove this unused m4 macro.
8688 * tests/cxx-type.at: Reformat whitespace with tabs.
8689 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
8690 since it's a member. Rename type to isNterm for clarity.
8691
c4d497a0
AD
86922005-12-29 Akim <akim@sulaco.local>
8693
8694 Let glr.cc catch up with symbol_value_print.
8695 * data/glr.cc (b4_yysymprint_generate): Replace by...
8696 (b4_yy_symbol_print_generate): this.
8697 (yy_symbol_print, yy_symbol_value_print): Declare them.
8698
4517da37
PE
86992005-12-28 Paul Eggert <eggert@cs.ucla.edu>
8700
8701 * src/location.h (boundary): Note that a line or column equal
8702 to INT_MAX indicates an overflow.
8703 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
8704 (rule_length_overflow, increment_rule_length, add_column_width):
8705 New functions.
8706 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
8707 (<SC_BRACED_CODE>"}"):
8708 Use increment_rule_length rather than incrementing it by hand.
8709 (adjust_location, handle_syncline): Diagnose overflow.
8710 (handle_action_dollar, handle_action_at):
8711 Fix bug with monstrosities like $-2147483648.
8712 Remove now-unnecessary checks.
8713 (scan_integer): Verify assumptions and remove now-unnecessary checks.
8714 (convert_ucn_to_byte): Verify assumptions.
8715 (handle_syncline): New arg LOC. All callers changed.
8716 Don't store through a value derived from char const * pointer.
8717
8718 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
8719 GCC warnings.
8720
e3233bf6
PE
87212005-12-27 Paul Eggert <eggert@cs.ucla.edu>
8722
8723 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
8724 Remove unnecessary forward static decls.
8725
8f3596a6
AD
87262005-12-27 Akim Demaille <akim@epita.fr>
8727
8728 * src/reader.c (grammar_current_rule_check): Also check that $$
8729 is used.
8730 Take the rule to check as argument, hence rename as...
8731 (grammar_rule_check): this.
8732 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
8733 Rename as...
8734 (grammar_rule_begin, grammar_rule_end): these, for consistency.
8735 (grammar_midrule_action, grammar_symbol_append): Now static.
8736 * tests/torture.at (input): Don't rely on the default action
8737 being always performed.
8738 * tests/calc.at: "Set" $$ even when the action is "cut" with
8739 YYERROR or other.
8740 * tests/actions.at (Exotic Dollars): Instead of using unused
8741 values, check that the warning is issued.
8742
721be13c
PE
87432005-12-22 Paul Eggert <eggert@cs.ucla.edu>
8744
8745 * NEWS: Improve wording for unused-value warnings.
8746
a0af42fc
AD
87472005-12-22 Akim Demaille <akim@epita.fr>
8748
8749 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
8750 (b4_yysymprint_generate): Rename as...
8751 (b4_yy_symbol_print_generate): this.
8752 Generate yy_symbol_print instead of yysymprint.
8753 Generate also yy_symbol_value_print, and use it.
8754
affac613
AD
87552005-12-22 Akim Demaille <akim@epita.fr>
8756
721be13c 8757 * NEWS: Warn about unused values.
affac613
AD
8758 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
8759 a `used' member.
8760 (symbol_list_n_get, symbol_list_n_used_set): New.
8761 (symbol_list_n_type_name_get): Use symbol_list_n_get.
8762 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
8763 * src/reader.c (grammar_current_rule_check): Check that values are
8764 used.
8765 * src/symtab.c (symbol_print): Accept 0.
8766 * tests/existing.at: Remove the type information.
8767 Empty the actions.
8768 Remove useless actions (beware of mid-rule actions: perl -000
8769 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
8770 * tests/actions.at (Exotic Dollars): Use unused values.
8771 * tests/calc.at: Likewise.
8772 * tests/glr-regression.at (No users destructors if stack 0 deleted):
8773 Likewise.
8774
8775 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
8776 rule_useful_p.
8777
9d9b8b70
PE
87782005-12-21 Paul Eggert <eggert@cs.ucla.edu>
8779
8bb4c753
PE
8780 Undo 2005-12-01 tentative license wording change. The wording is
8781 still being reviewed by the lawyers, and we don't want to wait for
8782 them before publishing a test release. For now, revert to the
8783 previous wording.
8784 * NEWS: Undo 2005-12-01 change.
8785 * data/glr.c: Revert to previous license wording.
8786 * data/glr.cc: Likewise.
8787 * data/lalr1.cc: Likewise.
8788 * data/location.cc: Likewise.
8789 * data/yacc.c: Likewise.
8790
9d9b8b70
PE
8791 * NEWS: Reword %destructor vs YYABORT etc.
8792 * data/glr.c: Use American spacing, for consistency.
8793 * data/glr.cc: Likewise.
8794 * data/lalr1.cc: Likewise.
8795 * data/yacc.c: Likewise.
8796 * data/yacc.c: Reformat comments slightly.
8797 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
8798 for consistency. Fix some spelling errors and reword recently-included
8799 text slightly.
8800 * tests/cxx-type.at: Cast results of malloc, for C++.
8801
2c3b392a
AD
88022005-12-21 Joel E. Denny <address@hidden>
8803
8804 * tests/cxx-type.at: Construct a tree, count the parents of shared
8805 nodes, and free each node once and only once. Previously, the memory
8806 for semantic values was leaked instead.
8807
d6cff4dc
AD
88082005-12-21 Joel E. Denny <address@hidden>
8809
8810 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
8811 (yylval, yylloc): If pure, #define to yystackp->yyval and
8812 yystackp->yyloc similar to yychar and yynerrs.
8813 (yyparse): If pure, remove local yylval and yylloc. Add local
8814 yystackp to accommodate pure definitions of yylval and yylloc.
8815 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
8816 yylvalp and yyllocp to &yylval and &yylloc.
8817 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
8818 namespace. Previously, nerrs and char were missing, but lval and lloc
8819 weren't necessary.
8820 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
8821 yylvalp and yyllocp parameters since, if pure, these are now always
8822 accessible through yystackp. If not pure, they are still accessible
8823 globally.
8824 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
8825 `if (YYID (N))' to pacify lint.
8826
a85284cf
AD
88272005-12-21 Akim Demaille <akim@epita.fr>
8828
8829 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
8830 destroy the RHS symbols of a rule.
8831 * data/yacc.c (yylen): Initialize to 0.
8832 Keep its value to the number of items to possibly shift.
8833 In particular, a regular successful parse that ends on YYFINAL by
8834 a (internal) YYACCEPT must not have yylen != 0.
8835 (yyerrorlab, yyreturn): Pop the RHS.
8836 Reorder a bit to emphasize the `shifting' bits of code.
8837 (YYPOPSTACK): Now accept a number of items to pop.
8838 * data/lalr1.cc: Likewise.
8839 * data/glr.c: Formatting changes.
8840 Use goto instead of fall through.
8841 * doc/bison.texinfo (Destructor Decl): Complete.
8842
d508c281
JMG
88432005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8844
8845 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
8846 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
8847 * djgpp/config.bat: Replace every occurence of the file name
8848 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
8849 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
8850 * djgpp/config.sed: Replace every occurence of the file name
8851 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
8852 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
8853 * djgpp/djunpack.bat: DJGPP specific file.
8854 * djgpp/fnchange.lst: DJGPP specific file.
8855 * djgpp/README.in: Add new information about how to unpack the bison
8856 source on MSDOS and other systems which have 8.3 file name restrictions
8857 using djunpack.bat and fnchange.lst.
8858
3e7a2cd9
PE
88592005-12-12 Paul Eggert <eggert@cs.ucla.edu>
8860
8861 * bootstrap (build_cvs_prefix): Remove; unused.
8862 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
8863 when getting gnulib.
8864
88652005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
8866
8867 * data/glr.c: Reorder typedef declarations for structs to match order
8868 of struct declarations.
8869 Rename yystack everywhere to yystackp except in yyparse where it's not
8870 a pointer.
8871 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
8872 consistency.
8873 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
8874 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
8875 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
8876 lint.
8877
877519f8
PE
88782005-12-09 Paul Eggert <eggert@cs.ucla.edu>
8879
0eca5a39
PE
8880 * tests/sets.at (Accept): Fix typos in regular expression used to
8881 sed out the final state number.
8882
2cec9080
PE
8883 Work around portability problem on Solaris 10: flex-generated
8884 files include <stdio.h> before <config.h>, which messes up
8885 because the latter defines __EXTENSIONS__. Address the problem
8886 by creating two new little files that include <config.h> first,
8887 then include the flex-generated files. Rewrite everyone else
8888 to include <config.h> first, as well.
8889 * lib/timevar.c: Always include "config.h".
8890 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
8891 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
8892 (EXTRA_bison_SOURCES): New macro.
8893 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
8894 * src/system.h: Don't include config.h.
8895 * src/LR0.c: Include <config.h> first.
8896 * src/assoc.c: Likewise.
8897 * src/closure.c: Likewise.
8898 * src/complain.c: Likewise.
8899 * src/conflicts.c: Likewise.
8900 * src/derives.c: Likewise.
8901 * src/files.c: Likewise.
8902 * src/getargs.c: Likewise.
8903 * src/gram.c: Likewise.
8904 * src/lalr.c: Likewise.
8905 * src/location.c: Likewise.
8906 * src/main.c: Likewise.
8907 * src/muscle_tab.c: Likewise.
8908 * src/nullable.c: Likewise.
8909 * src/output.c: Likewise.
8910 * src/parse-gram.y: Likewise.
8911 * src/print.c: Likewise.
8912 * src/print_graph.c: Likewise.
8913 * src/reader.c: Likewise.
8914 * src/reduce.c: Likewise.
8915 * src/relation.c: Likewise.
8916 * src/state.c: Likewise.
8917 * src/symlist.c: Likewise.
8918 * src/symtab.c: Likewise.
8919 * src/tables.c: Likewise.
8920 * src/uniqstr.c: Likewise.
8921 * src/vcg.c: Likewise.
8922
877519f8
PE
8923 * src/parse-gram.y: Fix minor problems uncovered by lint.
8924 (current_lhs, current_lhs_location): Now static.
8925 (current_assoc): Remove unused variable.
8926
8927 Cleanups so that Bison-generated parsers have less lint.
8928 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
8929 Prepend /*ARGSUSED*/, for lint's sake.
8930 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
8931 definition if 'lint' is defined.
8932 (YYID): New macro (or function, if lint).
8933 All uses of /*CONSTCOND*/0 replaced by YYID(0).
8934 * data/yacc.c: Likewise.
8935 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
8936 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
8937 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
8938 is C++ only.
8939 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
8940 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
8941 Use YYID(0) rather than 0, for lint.
8942 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
8943 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
8944
f5228370
PE
89452005-12-07 Paul Eggert <eggert@cs.ucla.edu>
8946
8947 * tests/glr-regression.at
8948 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
8949 Close memory leak reported by twlevo.
8950
69ce078b
PE
89512005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
8952
6ff99711
PE
8953 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
8954 all stacks.
8955 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
8956 * tests/glr-regression.at (No users destructors if stack 0 deleted):
8957 New test case.
8958 (Duplicated user destructor for lookahead): This test now is expected
8959 to succeed.
8960
af3412cd
PE
89612005-12-01 Paul Eggert <eggert@cs.ucla.edu>
8962
32b5b719 8963 * NEWS: Document the following change.
af3412cd
PE
8964 * data/yacc.c: Say "parser skeleton" rather than "file", since
8965 it's no longer just a file.
8966 * data/glr.c: Grant a special exception for C GLR parsers, that
8967 reads like the already-existing exception for C LALR(1) parsers.
8968 * data/glr.cc: Likewise.
8969 * data/lalr1.cc: Likewise.
8970 * data/location.cc: Likewise.
8971 * data/yacc.c: Reword the "written by" statement to clarify that
8972 it was the parser skeleton, not the entire output file.
8973 * data/glr.c: Written by Paul Hilfinger.
8974 * data/glr.cc: Written by Akim Demaille.
8975 * data/lalr1.cc: Likewise.
8976
035aa4a0
PE
89772005-11-18 Paul Eggert <eggert@cs.ucla.edu>
8978
d9963c85
PE
8979 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
8980 Fix typos in previous change that broke 'make check'.
8981 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
8982 supported in C.
8983 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
8984 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
8985 We can revert this once things settle down.
8986
035aa4a0
PE
8987 * src/conflicts.c (conflicts_print): Don't print file name twice
8988 when %expect fails because there were no conflicts.
8989 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
8990 change.
8991 * tests/conflicts.at (%expect not enough, %expect too much):
8992 (%expect with reduce conflicts): Adjust to new behavior.
8993
89942005-11-18 Akim Demaille <akim@epita.fr>
8995
8996 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
8997 errors.
8998 * NEWS: Document this.
8999 * doc/bison.texinfo (Expect Decl): Likewise.
9000
d1ff7a7c
AD
90012005-11-16 Akim Demaille <akim@epita.fr>
9002
9003 Generalize the display of semantic values and locations in traces.
9004 * data/glr.c (yy_reduce_print): Fix indices (again).
9005 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
9006 literal integers.
9007 * data/lalr1.cc (yyreduce_print): Rename as...
9008 (yy_reduce_print): this.
9009 Display values and locations.
9010 * data/yacc.c (yy_reduce_print): Likewise.
9011 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
9012 (yysymprint): Move higher to be visible from yy_reduce_print).
9013 (yyparse): Adjust.
9014 * tests/calc.at: Adjust the expected length of the traces.
9015
6de5398d
AD
90162005-11-14 Akim Demaille <akim@epita.fr>
9017
9018 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
9019 from 1 to N, while values and location start at 0.
9020 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
9021
a1373f55
AD
90222005-11-14 Akim Demaille <akim@epita.fr>
9023
9024 * data/glr.c (yy_reduce_print): Fix the $ number.
9025
613d8952
AD
90262005-11-14 Akim Demaille <akim@epita.fr>
9027
9028 "Use" parse parameters.
9029 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
9030 * data/glr.c, data/glr.cc: Use them.
9031 * data/glr.c (YYUSE): Have a C++ definition that supports
9032 non-pointer types.
9033
b2741627
AD
90342005-11-14 Akim Demaille <akim@epita.fr>
9035
9036 * data/glr.c (yyexpandGLRStack): Declare only if defined.
9037
5059b5c8
AD
90382005-11-14 Akim Demaille <akim@epita.fr>
9039
42249483
AD
9040 * data/glr.cc: New.
9041 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 9042
4626a15d
AD
90432005-11-12 Akim Demaille <akim@epita.fr>
9044
9045 Let position and location be PODs.
9046 * data/location.cc (position::initialize, location::initialize): New.
9047 (position::position, location::location): Define only if
9048 b4_location_constructors is defined.
9049 * data/lalr1.cc (b4_location_constructors): Define it for backward
9050 compatibility.
9051 * doc/bison.texinfo (Initial Action Decl): Use initialize.
9052
90532005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
9054
9055 * data/lalr1.cc: Move the body of the ctor and dtor into the
9056 parser file (instead of the header).
9057 Wrap the implementations in a "namespace yy".
9058
90592005-11-12 Akim Demaille <akim@epita.fr>
9060
9061 Have glr.c include its header file when created.
9062 * data/glr.c (b4_shared_declarations): New.
9063 Output them verbatim in the parser if !%defines, otherwise
9064 output then in the header file, and include it instead.
9065
1989d947
AD
90662005-11-11 Akim Demaille <akim@epita.fr>
9067
9068 * data/glr.c: Comment changes.
9069
90702005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
9071
9072 When yydebug, report semantic and location values for reductions.
9073 * data/glr.c (yy_reduce_print): Report the semantic values and the
9074 locations.
9075 (YY_REDUCE_PRINT): Adjust.
9076 (yyglrReduce): Use them.
9077 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
9078 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
9079 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
9080 traces.
9081
02998094
AD
90822005-11-10 Akim Demaille <akim@epita.fr>
9083
9084 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
9085 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
9086 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
9087
5210672f
PE
90882005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
9089
9090 * m4/cxx.m4, examples/Makefile.am: Don't build
9091 examples/calc++ if no C++ compiler is available. (trivial change)
9092
a8991a1d
AD
90932005-11-09 Akim Demaille <akim@epita.fr>
9094
9095 * src/scan-skel.l: Use a couple of asserts.
9096
36b5e963
AD
90972005-11-03 Akim Demaille <akim@epita.fr>
9098
9099 In some (weird) cases, the final state number is incorrect.
9100 Reported by Alexandre Duret-Lutz.
9101 * src/LR0.c (state_list_append): Remove the computation of
9102 final_state.
9103 (save_reductions): Do it here.
9104 (get_state): Alpha conversion.
9105 (generate_states): Use a for loop.
9106 * src/gram.h (item_number_is_rule_number)
9107 (item_number_is_symbol_number): New.
9108 * src/state.c: Use assert.
9109 * src/system.h: Include assert.h.
9110 * tests/sets.at (Accept): New.
9111
44e7ead1
PH
91122005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9113
9114 * data/glr.c (yyfill): Adjust comment.
36b5e963 9115 (yyresolveAction): Initialize default location properly
44e7ead1
PH
9116 for empty right-hand sides.
9117 (yydoAction): Ditto.
9118 Add comment explaining apparently dead code.
36b5e963
AD
9119 * tests/glr-regression.at
9120 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 9121 New test.
36b5e963 9122
e10a80ee
PE
91232005-10-30 Paul Eggert <eggert@cs.ucla.edu>
9124
9125 * bootstrap (cleanup_gnulib): New function. Use it to clean up
9126 gnulib when interrupted. This fixes some race conditions and
9127 works around some portability problems (one noted by Paul
9128 Hilfinger).
9129
067b32ee
AD
91302005-10-22 Akim <akim@epita.fr>
9131
9132 * Makefile.cfg: Adjust to config -> build-aux.
9133 Reported by twledo.
9134
4b367315
AD
91352005-10-21 Akim Demaille <akim@epita.fr>
9136
9137 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
9138 the %parse-params.
9139 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
9140 * data/yacc.c (b4_Pure_if): Rename as...
9141 (b4_yacc_pure_if): this.
9142 (YY_SYMBOL_PRINT, yyparse): Adjust.
9143 * doc/bison.texinfo: Formatting changes.
9144
24cc23d9
AD
91452005-10-21 Akim Demaille <akim@epita.fr>
9146
9147 Finish the transition config -> build-aux.
9148 * configure.ac, Makefile.am: Use build-aux.
9149 * config/prev-version, config/announce-gen, config/Makefile.am:
9150 Move to...
9151 * build-aux/prev-version, build-aux/announce-gen,
9152 * build-aux/Makefile.am: here.
9153
d4476375
AD
91542005-10-14 Akim Demaille <akim@epita.fr>
9155
9156 * examples/calc++/test: Use set -x only when VERBOSE.
9157
302c0aee
PE
91582005-10-13 Paul Eggert <eggert@cs.ucla.edu>
9159
9160 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
9161 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
9162
7625ec2c
AD
91632005-10-13 Akim Demaille <akim@epita.fr>
9164
9165 * src/scan-skel.l: Output the base name parts of the parser and
9166 header file names.
302c0aee 9167 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
9168 additional checks.
9169 Use this to exercise C++ outputs in subdirs.
9170 Reported by Oleg Smolsky.
9171
ba0fe3c7
PE
91722005-10-12 Paul Eggert <eggert@cs.ucla.edu>
9173
9174 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
9175 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
9176 Problem reported by John P. Hartmann.
9177 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
9178 already defined it.
9179
9b8a5ce0
AD
91802005-10-12 Akim Demaille <akim@epita.fr>
9181
9182 * src/parse-gram.y (version_check): Exit 63 to please missing
9183 (stands for "version mismatch).
9184 * tests/input.at, doc/bison.texinfo: Adjust.
9185
4f6e011e
PE
91862005-10-10 Paul Eggert <eggert@cs.ucla.edu>
9187
9188 Work around portability problems with Visual Age C compiler
9189 (xlc and xlC_r) reported by John P. Hartmann.
9190 * data/location.cc (initial_column, initial_line): Remove.
9191 All uses replaced by 0 and 1.
9192 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
9193 that xlc complains about.
9194 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 9195 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 9196 as __STDC__.
4d7aa45e
PE
9197 * data/yacc.c (YYMODERN_C): New macro, which also looks at
9198 __STDC_VERSION__. Use it everywhere instead of looking at
9199 __STDC__ and __cplusplus.
4f6e011e 9200
a1b3bf8c
AD
92012005-10-10 Akim Demaille <akim@epita.fr>
9202
9203 * examples/calc++/test: Be quiet unless VERBOSE.
9204
412e44aa
PE
92052005-10-05 Paul Eggert <eggert@cs.ucla.edu>
9206
2a4647a3
PE
9207 * data/c.m4 (yydestruct, yysymprint):
9208 Use YYUSE instead of casting to void.
9209 * data/glr.c (YYUSE): New macro.
9210 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
9211 Use it instead of rolling our own.
9212 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
9213 (YYCHK1):
9214 Use /*CONSTCOND*/ to suppress lint warnings.
9215 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
9216 (YY_STACK_PRINT): Use 'false' not '0'.
9217 (YYUSE): New macro.
9218 (yysymprint_, yydestruct_): Use it instead of rolling our own.
9219 * data/yacc.c (YYUSE): New macro.
9220 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
9221 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
9222 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
9223
9224
412e44aa
PE
9225 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
9226 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
9227
88c6637f
PE
92282005-10-04 Paul Eggert <eggert@cs.ucla.edu>
9229
2f4f028d
PE
9230 Undo the parts of the unlocked-I/O change that substituted
9231 putc or puts for printf. This might hurt performance a bit,
9232 but some people prefer the printf style.
9233 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
9234 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
9235 All uses replaced by YYFPRINTF and YYDPRINTF.
9236 * data/yacc.c: Likewise.
9237 * lib/bitset.c (bitset_print): Likewise.
9238 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
9239 putc and puts.
9240 * lib/lbitset.c (debug_lbitset): Likewise.
9241 * src/closure.c (print_firsts, print_fderives): Likewise.
9242 * src/gram.c (grammar_dump): Likewise.
9243 * src/lalr.c (look_ahead_tokens_print): Likewise.
9244 * src/output.c (escaped_output): Likewise.
9245 (user_actions_output): Break apart two printfs.
9246 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
9247 * src/reduce.c (reduce_print): Likewise.
9248 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
9249 * src/system.h: Include unlocked-io.h rathe than stdio.h.
9250
88c6637f
PE
9251 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
9252 Use assignments rather than casts-to-void to suppress
9253 unused-variable warnings. This pacifies 'lint'.
9254 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
9255 unused-variable warnings.
9256
fb32e373
JMG
92572005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9258
9259 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
9260
edb8f44f
PE
92612005-10-02 Paul Eggert <eggert@cs.ucla.edu>
9262
fb9c0b33
PE
9263 Use unlocked I/O for a minor performance improvement on hosts like
9264 GNU/Linux and Solaris that support unlocked I/O. The basic idea
9265 is to use the gnlib unlocked-io module, and to prefer putc and
9266 puts to printf when either will work (since the latter doesn't
9267 come in an unlocked flavor).
9268 * bootstrap (gnulib_modules): Add unlocked-io.
9269 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
9270 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
9271 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
9272 and similarly for puts and putc and printf.
9273 * data/yacc.c: Likewise.
9274 * lib/bitset.c (bitset_print): Likewise.
9275 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
9276 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
9277 to printf.
9278 * lib/lbitset.c (debug_lbitset): Likewise.
9279 * src/closure.c (print_firsts, print_fderives): Likewise.
9280 * src/gram.c (grammar_dump): Likewise.
9281 * src/lalr.c (look_ahead_tokens_print): Likewise.
9282 * src/output.c (escaped_output): Likewise.
9283 (user_actions_output): Coalesce two printfs.
2f4f028d 9284 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
9285 * src/reduce.c (reduce_print): Likewise.
9286 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 9287 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 9288
edb8f44f
PE
9289 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
9290 this confuses xgettext.
9291
b50d2359
AD
92922005-10-02 Akim Demaille <akim@epita.fr>
9293
9294 * bootstrap (gnulib_modules): Add strverscmp.
9295 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
9296 * m4/.cvsignore: Add strverscmp.m4.
9297 * src/parse-gram.y (%require): New token, new rule.
9298 (version_check): New.
9299 * src/scan-gram.l (%require): Adjust.
9300 * tests/input.at (AT_REQUIRE): New.
9301 Use it.
9302 * doc/bison.texinfo (Require Decl): New.
9303 (Calc++ Parser): Use %require.
9304
21667f64
AD
93052005-10-02 Akim Demaille <akim@epita.fr>
9306
9307 * data/location.cc: New.
9308
2b81e969
AD
93092005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
9310 Akim Demaille <akim@epita.fr>
9311
9312 Make sure -odir/foo.cc creates dir/location.hh etc.
9313 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
9314 (spec_file_prefix, spec_verbose_file, spec_graph_file)
9315 (spec_defines_file): Now const.
9316 (dir_prefix): New.
9317 (short_base_name): Remove.
9318 * src/files.c: Adjust.
9319 (dirname.h): Include.
9320 (base_name): Don't prototype it.
9321 (finput): Remove, duplicates gram_in.
9322 (full_base_name, short_base_name): Replace by...
9323 (all_but_ext, all_but_tab_ext): these.
9324 (compute_base_names): Rename as...
9325 (compute_file_name_parts): this.
9326 Update to compute the new variables, including dir_prefix.
9327 Adjust dependencies.
9328 * src/output.c (prepare): Output them.
9329 * src/reader.c: Adjust to use gram_in, not finput.
9330 * src/scan-skel.l (@dir_prefix@): New.
9331
ad6a9b97
JMG
93322005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9333
9334 * lib/subpipe.c: New function end_of_output_subpipe() added
9335 to allow support for non-posix systems. This is a no-op function
9336 for posix systems.
9337
9338 * lib/subpipe.h: New function end_of_output_subpipe() added
9339 to allow support for non-posix systems. This is a no-op function
9340 for posix systems.
9341
9342 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
9343 handle the lack of pipe/fork functionality on non-posix systems.
9344
9345 * djgpp/Makefile.maint: DJGPP specific file.
9346
9347 * djgpp/README.in: DJGPP specific file.
9348
9349 * djgpp/config.bat: DJGPP specific configuration file.
9350
9351 * djgpp/config.sed: DJGPP specific configuration file.
9352
9353 * djgpp/config.site: DJGPP specific configuration file.
9354
9355 * djgpp/config_h.sed: DJGPP specific configuration file.
9356
9357 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
9358
9359 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
9360
fc695704
AD
93612005-10-02 Akim Demaille <akim@epita.fr>
9362
9363 * data/location.cc: New, extract from...
9364 * data/lalr1.cc: here.
9365 (location.hh): Include it after the user prologue, in case the
9366 filename type is defined by the user.
9367 Forward declation location and position before the pre-prologue.
9368 (yyresult_): Rename as...
9369 (yyresult): this, it's a local variable, not an attribute.
9370 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
9371
93722005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
9373
9374 * examples/extexi: Restore the #line generation.
9375
fb9712a9
AD
93762005-09-30 Akim Demaille <akim@epita.fr>,
9377 Alexandre Duret-Lutz <adl@gnu.org>
9378
9379 Move the token type and YYSTYPE in the parser class.
9380 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
9381 (parser::token): New, from the moved free definition of tokens.
9382 (parser::semantic_value): Now a full definition instead of an
9383 indirection to YYSTYPE.
9384 (b4_post_prologue): No longer included in the header file, but
9385 in the implementation file.
9386 * doc/bison.texi (C+ Language Interface): Update.
9387 * src/parse-gram.y: Support unary %define.
9388 * tests/actions.at: Define global_tokens_and_yystype for backward
9389 compatibility until we update the tests.
9390 * tests/calc.at: Idem.
9391 (first_line, first_column, last_line, last_column): Define for lalr1.cc
9392 to simplify the code.
9393
55f0c7b1
PE
93942005-09-29 Paul Eggert <eggert@cs.ucla.edu>
9395
9396 Port to SunOS 4.1.4, which lacks strtoul and strerror.
9397 Ah, the good old days! Problem reported by Peter Klein.
9398 * bootstrap (gnulib_modules): Add strerror, strtoul.
9399 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
9400 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
9401
fb9712a9 94022005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
9403
9404 * data/c.m4 (b4_error_verbose_if): New.
9405 * data/lalr1.cc: Use it.
9406 (YYERROR_VERBOSE_IF): Remove.
9407 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
9408 parser members, replaced by...
9409 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
9410 local variables.
9411 (yysyntax_error_): Takes the state number as argument.
9412 (yyreduce_print_): Use the argument yyrule, not the former
9413 attribute yyn_.
9414
8a6f72f3
PE
94152005-09-26 Paul Eggert <eggert@cs.ucla.edu>
9416
9417 * bootstrap (gnulib_modules): Add verify.
9418 * lib/.cvsignore: Add verify.h.
9419 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
9420 * src/system.h (verify): Remove.
9421 Include verify.h instead.
9422 * src/tables.c (tables_generate): Use new API for 'verify'.
9423
0d50976f
PE
94242005-09-21 Paul Eggert <eggert@cs.ucla.edu>
9425
ebc3737e
PE
9426 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
9427 local variables whose names begin with 'yy'.
9428 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
9429 Trivial changes from Joel E. Denny.
9430
0d50976f
PE
9431 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
9432 it itself.
9433 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
9434 don't use alloca any more.
9435
9436 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
9437 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 9438 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
9439 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
9440 to match yacc.c, to test more hosts.
9441
a05b79df
PE
94422005-09-20 Paul Eggert <eggert@cs.ucla.edu>
9443
55289366
PE
9444 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
9445 doesn't affect behavior.
9446 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
9447 Solaris, AIX, MSC.
9448 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
9449 This works a bit better with glibc, if user code has already included
9450 stdlib.h.
9451 * doc/bison.texinfo (Bison Parser): Document that users can't
9452 arbitrarily use malloc and free for other purposes. Document
9453 that <alloca.h> and <malloc.h> might be included.
9454 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
9455 user must declare alloca.
9456
a05b79df
PE
9457 * HACKING (release): Forwarn the Translation Project about
9458 stable releses.
9459
3ab2ca22
AD
94602005-09-20 Akim Demaille <akim@epita.fr>
9461
9462 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
9463
a9739e7c
PE
94642005-09-19 Paul Eggert <eggert@cs.ucla.edu>
9465
a702593e
PE
9466 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
9467 (YYSTACK_ALLOC_MAXIMUM): Use it.
9468 (yysyntax_error): New function.
9469 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
9470 multiple syntax errors are reported, and alloca is being used.
9471 Instead, reallocate buffers twice as big each time, so that
9472 we waste at most half the allocated memory. Start with a small
9473 (128-byte) buffer that will suffice in most cases anyway.
9474 Use yysyntax_error to do most of the work.
9475
9476 * doc/bison.texinfo (Error Reporting, Table of Symbols):
9477 yynerrs is the number of errors reported, not the number of
9478 errors encountered.
9479
a9739e7c
PE
9480 * tests/glr-regression.at (Duplicated user destructor for lookahead):
9481 Mark it as expected to fail.
9482 Cast result of malloc; problem reported by twlevo@xs4all.nl.
9483 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
9484 Don't start user-code symbols with "yy", to avoid name space problems.
9485
f479c6c6
AD
94862005-09-19 Akim Demaille <akim@epita.fr>
9487
9488 Remove the traits, failed experiment.
9489 It never proved useful, and anyway because of the current
9490 definition, it was not possible to have several specialization of
9491 this traits, making it useless.
9492 * data/lalr1.cc (yy:traits): Remove.
9493 Inline its definitions in the parser class.
9494
e2586f82
AD
94952005-09-19 Akim Demaille <akim@epita.fr>
9496
9497 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
9498 least Mac OSX with a /usr/local install of gettext.
9499
2e8cf949
AD
95002005-09-19 Akim Demaille <akim@epita.fr>
9501
9502 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
9503 and yytoken for similarity with the other skeletons.
9504
c7fb0b90
AD
95052005-09-19 Akim Demaille <akim@epita.fr>
9506
4e26c69e 9507 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 9508
1bd0deda
PE
95092005-09-16 Paul Eggert <eggert@cs.ucla.edu>
9510
9511 * NEWS: Version 2.1.
9512
9513 * NEWS: Remove notice of yytname change, since it was never in an
9514 official release.
9515 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
9516 diagnostic.
9517 * src/output.c (prepare): Likewise.
9518 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
9519 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
9520 is not defined. This is an awful hack, but it's enough for now.
9521 All callers changed.
9522 * tests/glr-regression-at (make_value): Args are const pointers now,
9523 to avoid GCC warning.
9524 (Duplicated user destructor for lookahead): New test. Currently
9525 skipped. It fails on my host but I'm not sure it'll always fail.
9526
95272005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
9528
9529 * src/symtab.h (struct symbol): Declare the printer and destructor
9530 as const, to avoid accidental calls to free.
9531 (symbol_destructor_set, symbol_printer_set): Adjust.
9532 * src/symtab.c: Adjust.
9533
1bd0deda 95342005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
9535
9536 * data/c.m4 (b4_token_enums): New.
9537 (b4_token_defines): Rename as...
9538 (b4_token_enums_defines): this.
9539 (b4_token_defines): New, output only the #defines.
9540 * data/yacc.c, data/glr.c: Adjust.
9541 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
9542 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
9543 as default values.
9544
dbcdae2d
AD
95452005-09-16 Akim Demaille <akim@epita.fr>
9546
9547 * data/lalr1.cc (yylex_): Remove, inline its code.
9548 (yyreport_syntax_error_): Remove, replaced by...
9549 (yysyntax_error_): this which returns a string and leaves to the
9550 caller the call to the users' error function.
9551 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
9552 Move from members of the parser object...
9553 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
9554 to local variables of the parse function.
9555
70d8f291
AD
95562005-09-16 Akim Demaille <akim@epita.fr>
9557
9558 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
9559 since it's in Bison's name space.
9560
b47dbebe
PE
95612005-09-15 Paul Eggert <eggert@cs.ucla.edu>
9562
ae199bf1
PE
9563 * data/glr.c (yyresolveValue): Add default case to pacify
9564 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
9565
b47dbebe
PE
9566 * NEWS: Document when yyparse started to return 2.
9567 * doc/bison.texinfo (Parser Function): Document when yyparse
9568 returns 2.
9569
9570 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
9571 (b4_filename_type): Renamed back from b4_file_name_type. All uses
9572 changed.
9573 (class position): file_name -> filename (reverting). All uses changed.
9574
95752005-09-14 Paul Eggert <eggert@cs.ucla.edu>
9576
9577 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
9578 do anything if $@ exists. This reverts part of the 2005-07-07
9579 patch.
9580
00292f66
PE
95812005-09-11 Paul Eggert <eggert@cs.ucla.edu>
9582
9583 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
9584 contains obsolete information and isn't worth distributing as a
9585 separate file anyway.
9586 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
9587 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
9588 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
9589 (yyparse): Abort if user code uses longjmp to throw an unexpected
9590 value.
9591
a420f962
PE
95922005-09-09 Paul Eggert <eggert@cs.ucla.edu>
9593
00292f66
PE
9594 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
9595 Suggested by twlevo@xs4all.nl.
9596
127287e9
PE
9597 * data/glr.c (YYCHK1): Do not assume YYE is in range.
9598 This avoids a diagnostic from gcc -Wswitch-enum.
9599 Problem reported by twlevo@xs4all.nl.
9600
a420f962
PE
9601 * doc/bison.texinfo: Don't use "filename", as per GNU coding
9602 standards. Use "file name" or "file" or "name", depending on
9603 the context.
9604 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
9605 not to hack/foo.tab.c.
9606 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
9607 * data/glr.c: b4_filename -> b4_file_name.
9608 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
9609 All uses changed.
9610 (class position): filename -> file_name. All uses changed.
9611 * data/yacc.c: b4_filename -> b4_file_name.
9612 * lib/bitset.h: filename -> file_name in local vars.
9613 * lib/bitset_stats.c: Likewise.
9614 * src/files.c: Likewise.
9615 * src/scan-skel.l ("@output ".*\n): Likewise.
9616 * src/files.c (file_name_split): Renamed from filename_split.
9617 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
9618
96192005-09-08 Paul Eggert <eggert@cs.ucla.edu>
9620
9621 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
9622 to accommodate latest gnulib.
9623
9624 * tests/glr-regression.at (Duplicate representation of merged trees):
9625 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
9626
9627 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
9628 needed.
9629
42a6501d
PE
96302005-08-26 Paul Eggert <eggert@cs.ucla.edu>
9631
9632 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
9633 All uses changed. Invoke user destructor after an error during a
9634 split parse (trivial change from Joel E. Denny).
9635
9636 * tests/glr-regression.at
9637 (User destructor after an error during a split parse): New test case.
9638 Problem reported by Joel E. Denny in:
9639 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
9640
ef9a1faf
PE
96412005-08-25 Paul Eggert <eggert@cs.ucla.edu>
9642
5b4aaf78
PE
9643 * README-cvs: Give URLs for recommended tools.
9644 Mention Gzip version problem, and bootstrapping issues.
9645 Remove troubleshooting section, as it's somewhat obsolete.
9646
b5240ba5
PE
9647 * bootstrap (no_cache): New var, to accommodate different wget
9648 variants. Use it instead of '-C off'. Problem reported by
9649 twlevo@xs4all.nl.
9650
ef9a1faf
PE
9651 * data/glr.c (yydestroyStackItem): New function.
9652 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
9653 debugging information. Problem reported by Joel E. Denny.
9654
e6efa9da
AD
96552005-08-25 Akim Demaille <akim@epita.fr>
9656
9657 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
9658
adc90f13
PE
96592005-08-24 Paul Eggert <eggert@cs.ucla.edu>
9660
9661 * data/glr.c (yyrecoverSyntaxError, yyreturn):
9662 Don't invoke destructor on unresolved entries.
9663 * tests/glr-regression.at
9664 (User destructor for unresolved GLR semantic value): New test case.
9665 Problem reported by Joel E. Denny in:
9666 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
9667
f9315de5
PE
96682005-08-21 Paul Eggert <eggert@cs.ucla.edu>
9669
15d29c1f
PE
9670 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
9671 Add strnlen.c.
9672 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
9673 lib-prefix.m4, po.m4.
9674
dd5f2af2
PE
9675 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
9676 in yydestruct diagnostic, since it might not be an error.
9677 Problem reported by Joel Denny near end of
9678 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 9679 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
9680 * data/yacc.c (yyreturn): Likewise.
9681 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
9682
9683 * src/files.c: Remove obsolete FIXME comment.
9684
9685 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
9686 with the other templates, and to fix bogus run-on messages such
9687 as the one reported at the end of
9688 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
9689 All callers changed to avoid the newline.
9690 (yyprocessOneStack): Output two lines rather than one, to accommodate
9691 the above change. This changes the debug output format slightly.
9692
f9315de5
PE
9693 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
9694 reported by Joel E. Denny in
9695 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
9696 (trivial change).
9697 * tests/glr-regression.at (Duplicate representation of merged trees):
9698 New test, from Joel E. Denny in:
9699 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
9700 * THANKS: Add Joel E. Denny.
9701
9702 * configure.ac (AC_INIT): Bump to 2.0c.
9703
04098407
PE
97042005-07-24 Paul Eggert <eggert@cs.ucla.edu>
9705
9706 * NEWS: Version 2.0b.
9707
ca5d2013
PE
9708 * Makefile.am (SUBDIRS): Put examples before tests, so that
9709 "make check" doesn't finish with "All 1 tests passed".
9710
3d54b576
PE
9711 * tests/regression.at (Token definitions): Don't rely on
9712 AT_PARSER_CHECK for data that contains backslashes. It currently
9713 uses 'echo', and 'echo' isn't portable if its argument contains
9714 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
9715 that the byte '\0xff' is not printable in the C locale; it is,
9716 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
9717 not printable, so use '\0x81' to test.
9718
d53ae497
PE
9719 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
9720 version of GCC, since the macro is used with non-GCC compilers.
9721
fc01665e
PE
9722 Fix core dump reported by Pablo De Napoli in
9723 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
9724 * tests/regression.at (Invalid inputs with {}): New test.
9725 * src/parse-gram.y (token_name): Translate type before using
9726 it as an index.
9727
04098407
PE
9728 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
9729 the user's name space. All uses changed to __attribute__
9730 ((__unused__)).
9731 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
9732 Add __attribute__ ((__noreturn__)).
9733
9734 * etc/clcommit: Remove. We weren't using it, and it failed
9735 "make maintainer-distcheck".
9736 * Makefile.maint: Merge from coreutils.
9737 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
9738 (syntax-check-rules): Change list of rules as described below.
9739 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
9740 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
9741 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
9742 (sc_trailing_space): New rules.
9743 (sc_xalloc_h_in_src): Remove.
9744 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
9745 (sc_space_tab, sc_error_exit_success, sc_changelog):
9746 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
9747 (makefile-check, po-check, author_mark_check):
9748 (makefile_path_separator_check, copyright-check):
9749 Use grep -n, to make it easier to find violations.
9750 Use CVS_LIST and CVS_LIST_EXCEPT.
9751 (header_regexp, h_re): Remove.
9752 (dd_c): New macro.
9753 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
9754 (my-distcheck): Use more-modern GCC flags.
9755 (signatures, %.asc): Remove.
9756 (rel-files, announcement): Remove signatures.
9757 Restore old updating code, even though we don't use it, so
9758 that we're the same as coreutils.
9759 (alpha, beta, major): Depend on news-date-check.
9760 Make the upload commands.
9761
9762 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
9763 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
9764 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
9765 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
9766 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
9767 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
9768 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
9769 * tests/sets.at: Likewise.
9770
9771 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
9772 we comment out the Autoconf version number.
9773 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
9774 it's error-prone and "make maintainer-distcheck" rejects it.
9775
9776 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
9777 Indent calls to "error" to pacify "make maintainer-distcheck",
9778 when the calls are not intended to be translated.
9779 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
9780
9781 * src/Makefile.am (DEFS): Use +=, to pacify
9782 "make maintainer-distcheck".
9783 (bison_SOURCES): Add scan-skel.h.
9784 (sc_tight_scope): New rule, from coreutils.
9785
9786 * src/files.c (src_extension, header_extension):
9787 Now static, not extern.
9788 * src/getargs.c (short_options): Likewise.
9789 * src/muscle_tab.c (muscle_table): Likewise.
9790 * src/parse-gram.y (current_class, current_type, current_prec):
9791 Likewise.
9792 * src/reader.c (grammar_end, previous_rule_end): Likewise.
9793 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
9794 * src/main.c (main): Cast bindtextdomain and textdomain calls to
9795 void, to avoid warning when NLS is disabled.
9796 * src/output.c: Include scan-skel.h.
9797 (scan_skel): Remove decl, since scan-skel.h does this.
9798 (output_skeleton):
9799 Indent calls to "error" to pacify "make maintainer-distcheck".
9800 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
9801 * src/reader.h (gram_end, gram_lineno): New decls to pacify
9802 "make maintainer-distcheck".
9803 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
9804 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
9805 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
9806 (skel_lex_destroy, scan_skel): Move these decls to...
9807 * src/scan-skel.h: New file.
9808 * src/uniqstr.c (uniqstr_assert):
9809 Indent calls to "error" to pacify "make maintainer-distcheck".
9810
9811 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
9812 not @VAR@.
9813
9814 * tests/torture.at: Revamp to avoid misuse of atoi that
9815 "make maintainer-distcheck" complained about.
9816
9817 * examples/extexi (message): Don't print a message more than once,
9818 and omit line-number decoration that makes Emacs compile think
9819 that informative messages are worth worrying about.
9820
98212005-07-22 Paul Eggert <eggert@cs.ucla.edu>
9822
9823 * configure.ac: Update version number.
9824
9825 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
9826 accidentally.
9827 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
9828 autogenerated by the maintainer.
9829 * examples/calc++/.cvsignore: Add *.yy.
9830
9831 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
9832 * lib/bitset_stats.c (bitset_stats_init): Likewise.
9833 * lib/bitsetv.c (bitsetv_alloc): Likewise.
9834
9835 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
9836
9837 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
9838 from maintainer-distcheck about casting the argument of 'free'.
9839
9840 * NEWS: Mention recent yytname changes.
9841 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
9842
9843 * bootstrap: For translations that have not yet been upgraded to
9844 the new runtime-po domain, prime the pump by extracting the
9845 relevant strings from the obsolete translations. This code can be
9846 removed once the bison-runtime domain has been translated by each
9847 team.
9848
9849 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
9850 now that token names are already quoted.
9851
9852 Fix problem reported by Anthony Heading.
9853 * data/glr.c (YYTOKEN_TABLE): New macro.
9854 (yytname): Define if YYTOKEN_TABLE.
9855 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
9856 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
9857 (YYERROR_VERBOSE): Define the same way the other skeletons do.
9858 * src/output.c (prepare_symbols): Output token_table_flag.
9859
0ffda363
PE
98602005-07-21 Paul Eggert <eggert@cs.ucla.edu>
9861
9862 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
9863 again if the first call fails.
9864
9865 * data/glr.c (yytnamerr): New function.
9866 (yyreportSyntaxError): Use it to dequote most string literals.
9867 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
9868 with other skeletons. All uses changed.
9869 (yytnameerr_): New function.
9870 (yyreport_syntax_error): Use it to dequote most string literals.
9871 * data/yacc.c (yytnamerr): New function.
9872 (yyerrlab): Use it to decode most string literals.
9873 * doc/bison.texinfo (Decl Summary, Calling Convention):
9874 Clarify quoting convention of yytname.
9875 * src/output.c (prepare_symbols): Quote all names. This undoes
9876 the 2005-04-17 change, which is now accomplished (mostly) via
9877 changes in the parsers as described above.
9878 * tests/regression.at (Token definitions, Web2c Actions):
9879 Undo most 2005-04-17 change here, too.
9880
98812005-07-20 Paul Eggert <eggert@cs.ucla.edu>
9882
9883 Fix more problems reported by twlevo@xs4all.nl.
9884 * tests/cxx-type.at: Don't pipe output of ./types through sed to
9885 remove trailing spaces. This loses the exit status of ./types,
9886 and isn't needed since ./types shouldn't be emitting trailing
9887 spaces.
9888 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
9889 as the stack isn't valid in that case.
9890
9891 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
9892 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
9893 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
9894 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
9895 is used.
9896 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
9897 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
9898 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
9899 Likewise.
9900
9901 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
9902 overly-picky compilers that reject 'char *foo = "bar";'.
9903
9904 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
9905 to FILE * parameter, not to stderr. This fixes a typo introduced
9906 in the 2005-07-12 change.
9907
9908 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
9909 warnings from GCC 4.
9910
9911 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
9912 (yyglrShiftDefer, yysplitStack):
9913 Remove unused parameters b4_pure_formals. All uses changed.
9914 (yyglrShift): Remove unused parameters b4_user_formals.
9915 All uses changed.
9916 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
9917
6100a9aa
PE
99182005-07-18 Paul Eggert <eggert@cs.ucla.edu>
9919
258b75ca
PE
9920 Destructor cleanups and regularization among the three skeletons.
9921 * NEWS: Document the behavior changes.
9922 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
9923 stack before failing, as the cleanup code will do it for us now.
9924 * data/lalr1.cc (yyerrlab): Likewise.
9925 * data/glr.c (yyparse): Pop everything off the stack before
9926 freeing it, so that destructors get called properly.
9927 * data/lalr1.cc (yyreturn): Likewise.
9928 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
9929 This is more consistent.
9930 * doc/bison.texinfo (Destructor Decl): Mention more reasons
9931 why destructors might be called. 1.875 -> 2.1.
9932 (Destructor Decl, Decl Summary, Table of Symbols):
9933 Some English-language cleanups for %destructor.
9934 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
9935 Add output line for destructor of start symbol.
9936 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
9937 because of that same extra output line.
9938
1a059451
PE
9939 * NEWS: Document minor wording changes in diagnostics of
9940 Bison-generated parsers.
9941 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
9942 Remove unused formals. All uses changed.
9943 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
9944 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
9945 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
9946 Rename yyoverflowab to yyexhaustedlab.
9947 When memory exhaustion occurs during syntax-error reporting,
9948 report it separately rather than in a single diagnostic; this
9949 eases translation.
9950 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
9951 (Memory Exhausted): Renamed from Parser Stack Overflow.
9952 Revamp wording slightly to prefer "memory exhaustion".
9953 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
9954
97460c78
PE
9955 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
9956
30757c8c
PE
9957 Add i18n support to the GLR skeleton. Partially fix the C++
9958 skeleton; a C++ expert needs to finish this. Remove debugging
9959 msgids; there's little point to having them translated, since they
9960 can be understood only by someone who can read the
9961 (English-language) source code.
9962
9963 Generate runtime-po/bison-runtime.pot automatically, so that we
9964 don't have to worry about garbage getting in that file. We'll
9965 make sure after the next official release that old msgids don't
9966 get lost. See
9967 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
9968
9969 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
9970 Now auto-generated.
9971 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
9972 Fix typos in explanations of the runtime file.
9973 * bootstrap: Change gettext keyword from YYI18N to YY_.
9974 Use standard Makefile.in.in in runtime-po, since we'll arrange
9975 for backward-compatible bison-runtime.po files in a different way.
9976 * data/glr.c (YY_): New macro, from yacc.c.
9977 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
9978 Translate messages intended for users.
9979 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
9980 the wording in the other skeletons. We don't know that the memory
9981 is virtual.
9982 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
9983 Use same method that yacc.c uses.
9984 Don't translate debugging messages.
9985 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
9986 it doesn't work (yet), and requires C++ expertise to fix.
9987 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
9988 Move defn to a more logical place, to be consistent with other
9989 skeletons.
9990 Don't translate debugging messages.
9991 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
9992 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
9993 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
9994 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
9995
ac8c5689
PE
9996 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
9997 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
9998 void, not int.
9999 * tests/glr-regression.at (Badly Collapsed GLR States):
10000 Likewise.
10001 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
10002 yylex should return 0 at EOF rather than aborting.
10003
6100a9aa
PE
10004 Improve tests for stack overflow in GLR parser.
10005 Problem reported by twlevo@xs4all.nl.
10006 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
10007 All uses removed.
10008 (yyStackOverflow): Just longjmp, but with value 2 so that caller
10009 can handle the problem.
10010 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
10011 (yyparse): New local variable yyresult to record the result.
10012 Use result of setjmp to set it, rather than storing itinto
10013 struct.
10014 (yyDone): Remove label.
10015 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
10016 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
10017 if YYABORT is used).
10018 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
10019 yyparse status; put status > 1 into diagnostic.
10020 Check that status==2 works.
10021 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
10022 Use exit status 3 for failure to open (which shouldn't happen).
10023
15f40952
PE
100242005-07-17 Paul Eggert <eggert@cs.ucla.edu>
10025
67fd79c4
PE
10026 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
10027 1 on syntax error; just let yyparse do its thing.
10028 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
10029 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
10030 (Exploding the Stack Size with Alloca):
10031 (Exploding the Stack Size with Malloc):
10032 Expect exit status 2, not 1, since the parser is supposed to blow
10033 its stack. Problem reported by twlevo@xs4all.nl.
10034
15f40952
PE
10035 * data/glr.c (yyparse): Don't assume that the initial calls
10036 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
10037 Print a stack-overflow message and fail instead.
10038 Initialize the line-number information before creating the stack,
10039 so that the stack-overflow message can report line zero safely.
10040
f32c66b5
PE
100412005-07-14 Paul Eggert <eggert@cs.ucla.edu>
10042
a22ff96f 10043 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
10044 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
10045 (yyuserMerge): Provide a default case if b4_mergers is empty.
10046 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
10047 * tests/glr-regression.at
10048 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 10049 Add casts to pacify C++ compilers.
1beb0b24
PE
10050 * tests/glr-regression.at (Improper merging of GLR delayed action
10051 sets): Declare yylex before using it.
f32c66b5 10052 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
10053 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
10054 test for valgrind; valgrind is independent of g++.
10055 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
10056 for compatibility with POSIX 1003.1-2001 (if running coreutils).
10057 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
10058 Use a destructor, so that we can expand the stack. Change
10059 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 10060
d741bd1b
PE
100612005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10062
10063 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
10064 a valgrind failure. Problem reported by twlevo@xs4all.nl.
10065
0410a6e0
PE
100662005-07-13 Paul Eggert <eggert@cs.ucla.edu>
10067
10068 * PACKAGING: New file, suggested by Bruno Haible and taken from
10069 similar wording in gettext's PACKAGING file.
10070 * NEWS: Mention PACKAGING.
10071 * Makefile.am (EXTRA_DIST): Add PACKAGING.
10072
f7ab6a50
PE
100732005-07-12 Paul Eggert <eggert@cs.ucla.edu>
10074
baf785db 10075 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
10076 * bootstrap: Get runtime translations into runtime-po.
10077 Create runtime-po files automatically, if possible.
10078 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
10079 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
10080 does not infringe on the user's name space.
10081 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
10082 * doc/bison.texinfo (Internationalization): Revamp the English
10083 and Texinfo syntax a bit, to try to make it clearer.
10084 (Bison Options, Option Cross Key): Mention --print-localedir.
10085 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
10086 YYENABLE_NLS. Quote a bit more.
10087 * runtime-po/.cvsignore: New file.
10088 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
10089 * runtime-po/Rules-quot: Remove; now created by bootstrap.
10090 * runtime-po/quot.sed: Likewise.
10091 * runtime-po/boldquot.sed: Likewise.
10092 * runtime-po/en@quot.header: Likewise.
10093 * runtime-po/en@boldquot.header: Likewise.
10094 * runtime-po/insert-header.sin: Likewise.
10095 * runtime-po/remove-potcdate.sin: Likewise.
10096 * runtime-po/Makevars: Likewise.
10097 * runtime-po/LINGUAS: Likewise.
10098 * runtime-po/de.po: Likewise; we will rely on the translation project
10099 to maintain this, so "bootstrap" should get it.
0410a6e0 10100 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
10101 its value.
10102 * src/main.c (main): Bind the bison-runtime domain, too.
10103
101042005-07-12 Bruno Haible <bruno@clisp.org>
10105
10106 * data/yacc.c: Include <libintl.h> when NLS is enabled.
10107 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
10108 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
10109 * runtime-po: New directory.
10110 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
10111 $(DOMAIN).pot-update rule, so that old messages are never dropped.
10112 * runtime-po/Rules-quot: New file, copied from po/.
10113 * runtime-po/quot.sed: Likewise.
10114 * runtime-po/boldquot.sed: Likewise.
10115 * runtime-po/en@quot.header: Likewise.
10116 * runtime-po/en@boldquot.header: Likewise.
10117 * runtime-po/insert-header.sin: Likewise.
10118 * runtime-po/remove-potcdate.sin: Likewise.
10119 * runtime-po/Makevars: New file.
10120 * runtime-po/POTFILES.in: New file.
10121 * runtime-po/LINGUAS: New file.
10122 * runtime-po/bison-runtime.pot: New file.
10123 * runtime-po/de.po: New file.
10124 * m4/bison.m4: New file.
10125 * Makefile.am (SUBDIRS): Add runtime-po.
10126 (aclocaldir, aclocal_DATA): New variables.
10127 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
10128 Define aclocaldir.
10129 * src/getargs.c (usage): Document --print-localedir option.
10130 (PRINT_LOCALEDIR_OPTION): New enum item.
10131 (long_options): Add --print-localedir option.
10132 (getargs): Handle --print-localedir option.
10133 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
10134 (Internationalization): New section.
10135
22dda0f0
AD
101362005-07-12 Akim Demaille <akim@epita.fr>
10137
10138 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
10139 for consistency with the rest of the code.
10140 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
10141 Add separators.
10142
82b248ad
AD
101432005-07-12 Akim Demaille <akim@epita.fr>
10144
10145 * src/parse-gram.y: Use %printer instead of YYPRINT.
10146
fa0e9314
AD
101472005-07-12 Akim Demaille <akim@epita.fr>
10148
867a3e00
AD
10149 * src/symtab.h, src/symtab.c (symbol_print): New.
10150 * src/symlist.h, src/symlist.c (symbol_list_print): New.
10151 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
10152
101532005-07-12 Akim Demaille <akim@epita.fr>
10154
10155 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
10156 b4_at_dollar and b4_dollar_dollar.
10157
e054b190
PE
101582005-07-11 Paul Eggert <eggert@cs.ucla.edu>
10159
10160 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
10161 and Pennello's paper.
10162
34160ec4
PE
101632005-07-09 Paul Eggert <eggert@cs.ucla.edu>
10164
407d4a75
PE
10165 * data/yacc.c (yyparse): Undo previous patch. Instead,
10166 set yylsp[0] and yyvsp[0] only if the initial action
10167 sets yylloc and yylval, respectively.
10168
34160ec4
PE
10169 * data/yacc.c (yyparse): In the initial action, set
10170 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
10171 This avoids the use of undefined variables if the initial
10172 action does not set yylloc and/or yylval.
10173
c3d5a4a7
PE
101742005-07-07 Paul Eggert <eggert@cs.ucla.edu>
10175
b34d96c1
PE
10176 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
10177 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
10178 Remove from CVS. These files are automatically generated.
10179 * examples/extexi: Clarify that this file is now part of Bison,
10180 not GNU M4, and that it works with any POSIX-compatible Awk.
10181 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
10182 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
10183 so that we also get calc++-parser.yy. Geneate it.
10184 Use $(AWK), not gawk, since any conforming Awk will do.
10185 Put comment before action, since older 'make' can't handle comment
10186 in action.
10187 $(BUILT_SOURCES): List all built sources, not just some of them.
10188 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
10189 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
10190 $($(calc_sources_generated)): Remove unnecessary test for existence
10191 of target. (This had a shell syntax error anyway; a stray "x".)
10192 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
10193 calc++-parser.yy.
10194 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
10195
c3d5a4a7
PE
10196 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
10197 implied by the other modules.
10198
828c373b
AD
101992005-07-06 Akim Demaille <akim@epita.fr>
10200
10201 Bind examples/calc++ to the package.
10202 * examples/calc++/Makefile: Remove, replaced by...
10203 * examples/calc++/Makefile.am: ... this new file.
10204 * examples/calc++/test: Remove input.
10205 * examples/calc++/compile: Remove.
10206 * examples/Makefile.am: New.
10207 * configure.ac, Makefile.am: Adjust.
10208 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
10209
63cb01d6
PE
102102005-07-05 Paul Eggert <eggert@cs.ucla.edu>
10211
fd2df2ed
PE
10212 * data/glr.c (yyFail): Drastically simplify; since the format argument
10213 never had any % directives, we can simply pass it to yyerror.
10214 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
10215 be modified later, as that is the usual style in glr.c.
10216 Problems reported by Paul Hilfinger.
10217
63cb01d6
PE
10218 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
10219 and size overflow errors.
10220 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
10221 in case the user prolog sets feature-test macros like _GNU_SOURCE.
10222 (YYSIZEMAX): New macro.
10223 (yystpcpy): New function, taken from yacc.c.
10224 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
10225 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
10226 so that we don't have to maintain their signatures.
10227 (yyFail): Check for buffer overflow, by using vsnprintf rather
10228 than vsprintf. Allocate a bigger buffer if possible.
10229 Report an error if buffer allocation fails.
10230 (yyStackOverflow): New function.
10231 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
10232 the initialization was successful. It might fail if storage was
10233 exhausted.
10234 (yyexpandGLRStack): Add more checks for storage allocation failure.
10235 Use yyStackOverflow to report failures.
10236 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
10237 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
10238 Don't assume stack number fits in int.
10239 (yysplitStack): Check for storage allocation failure.
10240 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
10241 can print diagnostics on storage allocation failure. All callers
10242 changed.
10243 (yyresolveValue): Use yybool for boolean.
10244 (yyreportSyntaxError): Check for size-calculation overflow.
10245 This code is taken from yacc.c.
10246 (yyparse): Check for storage allocation errors when allocating
10247 the initial stack.
10248
1c59e0a1
AD
102492005-07-05 Akim Demaille <akim@epita.fr>
10250
10251 Extract calc++ from the documentation.
10252 * doc/bison.texinfo (Calc++): Add the extraction marks.
10253 * examples/extexi: New, from the aborted GNU Programming 2E.
10254 Separate the different paragraph of a file with empty lines.
10255 * examples/Makefile: Use it to extract the whole calc++ example.
10256
8a0adb01
AD
102572005-06-24 Akim Demaille <akim@epita.fr>
10258
10259 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
10260 class typedefs.
10261
12545799
AD
102622005-06-22 Akim Demaille <akim@epita.fr>
10263
10264 * doc/bison.texinfo (C++ Language Interface): First stab.
10265 (C++ Parsers): Remove.
10266
99be0235
AD
102672005-06-22 Akim Demaille <akim@epita.fr>
10268
10269 * data/lalr1.cc (yylex_): Honor %lex-param.
10270
0ffd4fd1
AD
102712005-06-22 Akim Demaille <akim@epita.fr>
10272
10273 Start a set of simple examples.
10274 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
10275 * examples/calc++/calc++-driver.hh,
10276 * examples/calc++/calc++-parser.yy,
10277 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
10278 * examples/calc++/compile, examples/calc++/test: New.
10279
0925ebb4
PE
102802005-06-09 Paul Eggert <eggert@cs.ucla.edu>
10281
10282 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
10283 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
10284 which stems from the 2005-05-27 patch.
10285
43d3b664
PH
102862005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10287
10288 * data/glr.c: Modify treatment of unused parameters to permit use
10289 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
10290
3062864d
PE
102912005-05-30 Paul Eggert <eggert@cs.ucla.edu>
10292
10293 Fix infringement on user name space reported by Janos Zoltan Szabo.
10294 * data/yacc.c (yyparse): strlen -> yystrlen.
10295
989b5b8e
AD
102962005-05-30 Akim Demaille <akim@epita.fr>
10297
10298 * data/lalr1.cc (_): New.
10299 Translate the various messages.
10300
bedf57f5
PE
103012005-05-27 Paul Eggert <eggert@cs.ucla.edu>
10302
10303 Fix infringement on user name space reported by Bruno Haible.
10304 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
10305 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
10306 the user's name space.
10307 (alloca): Include <stdlib.h> to get it, if it's not built in.
10308 (YYMALLOC, YYFREE): Define only if needed.
10309 (malloc, free): Declare, but only if needed, as this infringes on
10310 the user name space.
10311
4d1801f1
PE
103122005-05-25 Paul Eggert <eggert@cs.ucla.edu>
10313
10314 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
10315 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
10316 with %d format.
10317 * lib/ebitset.c (min, max): Undef before defining.
10318 * lib/vbitset.c (min, max): Likewise.
10319 * lib/subpipe.c (create_subpipe): Save local variables in case
10320 vfork clobbers them.
10321
103222005-05-24 Bruno Haible <bruno@clisp.org>
10323
10324 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
10325 error message syntax used by gcc-4.0.
10326
b94a9e1e
PE
103272005-05-23 Paul Eggert <eggert@cs.ucla.edu>
10328
85ac3861
PE
10329 * README: Mention m4 1.4.3. Remove obsolete advice about
10330 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
10331
b94a9e1e
PE
10332 * bootstrap: Remove workaround for problem I encountered with
10333 gettext 0.14.1; it seems to be fixed now.
10334
51c30d21
PE
103352005-05-22 Paul Eggert <eggert@cs.ucla.edu>
10336
009ce67d
PE
10337 * NEWS: Version 2.0a.
10338
f2a97c62
PE
10339 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
10340 the previous change.
10341
c8775f93
PE
10342 Various maintainer cleanups.
10343 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
10344 conftest*, for benefit of CVS commands run at the same time as
10345 "configure". Add build-aux, since "bootstrap" now creates it and
10346 its subfiles.
10347 * Makefile.cfg (move_if_change): Remove.
10348 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
10349 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
10350 (po_repo, do-po-update, po-update, wget_files, get-targets):
10351 (config.guess-url_prefix, config.sub-url_prefix):
10352 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
10353 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
10354 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
10355 Remove.
10356 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
10357 this is now the recommended name.
10358 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
10359 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
10360 ylwrap. These files now go into build-aux.
10361 * config/move-if-change: Remove.
10362 * config/prev-version.txt: Bump from 1.75 to 2.0.
10363
3ea5f0ec
PE
10364 * bootstrap: Add stdio-safer, unistd-safer modules.
10365 Remove m4/glibc2.m4 (introduced by latest gnulib, but
10366 we don't need it).
10367 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
10368 fopen-safer.c, stdio-safer.h, unistd-safer.h.
10369 * lib/subpipe.c: Include "unistd-safer.h".
10370 (create_subpipe): Make sure all the newly-created
10371 file descriptors are > 2, so that diagnostics don't
10372 get sent down them (which might cause Bison to hang, in theory).
10373 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
10374 * src/files.c (xfopen): Use fopen_safer, not fopen.
10375
51c30d21
PE
10376 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
10377 yesterday's yacc.c fix.
10378
cea1469d
PE
103792005-05-21 Paul Eggert <eggert@cs.ucla.edu>
10380
3ea5f0ec
PE
10381 * data/glr.c, data/lalr1.cc: Update copyright date.
10382
cea1469d
PE
10383 Fix a destructor bug reported by Wolfgang Spraul in
10384 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
10385 * data/yacc.c (yyabortlab): Don't call destructor, and
10386 don't set yychar to EMPTY.
10387 (yyoverflowlab): Don't call destructor.
10388 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
10389 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
10390 since we no longer output the message "discarding lookahead token
10391 end of input ()".
10392
5e6f62f2
PH
103932005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10394
10395 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
10396 fix a small glitch in debugging output.
10397 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
10398 after YY_SYMBOL_PRINT where needed.
10399
10400 (struct yyGLRState): Add some comments.
10401 (struct yySemanticOption): Add some comments.
10402 (union yyGLRStackItem): Add comment.
10403
10404 (yymergeOptionSets): Correct this to properly perform the union,
10405 avoiding infinite reported by Michael Rosien.
10406 Update comment.
10407
10408 * tests/glr-regression.at: Add test for GLR merging error reported
10409 by M. Rosien.
cea1469d 10410
0fb669f9
PE
104112005-05-13 Paul Eggert <eggert@cs.ucla.edu>
10412
10413 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
10414 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
10415 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
10416 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
10417 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
10418 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
10419 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
10420 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
10421 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
10422 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
10423 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
10424 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
10425 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
10426 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
10427 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
10428 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
10429 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
10430 src/derives.h, src/files.c, src/files.h, src/getargs.c,
10431 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
10432 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
10433 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
10434 src/output.h, src/parse-gram.c, src/parse-gram.h,
10435 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
10436 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
10437 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
10438 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
10439 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
10440 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
10441 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
10442 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
10443 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
10444 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
10445 tests/reduce.at, tests/regression.at, tests/sets.at,
10446 tests/synclines.at, tests/testsuite.at, tests/torture.at:
10447 Update FSF postal mail address.
10448
51f4735e
PE
104492005-05-11 Paul Eggert <eggert@cs.ucla.edu>
10450
10451 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
10452 Problem reported by Ralf Menzel.
10453
80ce3401
PE
104542005-05-01 Paul Eggert <eggert@cs.ucla.edu>
10455
10456 * tests/actions.at: Test that stack overflow invokes destructors.
10457 From Marcus Holland-Moritz.
10458 * data/yacc.c (yyerrlab): Move the code that destroys the stack
10459 from here....
10460 (yyreturn): to here. That way, destructors are called properly
10461 even if the stack overflows, or the user calls YYACCEPT or
10462 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
10463 (yyoverflowlab): Destroy the lookahead.
10464
104652005-04-24 Paul Eggert <eggert@cs.ucla.edu>
10466
10467 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
10468
72f000b0
PE
104692005-04-17 Paul Eggert <eggert@cs.ucla.edu>
10470
10471 * NEWS: Bison-generated C parsers no longer quote literal strings
10472 associated with tokens.
10473 * src/output.c (prepare_symbols): Don't escape strings,
10474 since users don't want to see C escapes.
10475 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
10476 in diagnostics.
c19683bb 10477 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
10478 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
10479
1094323f
PE
104802005-04-16 Paul Eggert <eggert@cs.ucla.edu>
10481
10482 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
10483 the data size is known to be too small and we can't increase it.
10484 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
10485
ca407bdf
PE
104862005-04-15 Paul Eggert <eggert@cs.ucla.edu>
10487
10488 * src/parse-gram.y: Include quotearg.h.
10489 (string_as_id): Quote $1 before using it as a key, since the
10490 lexer no longer quotes it for us.
10491 (string_content): Don't strip quotes, since lexer no longer
10492 quotes it for us.
10493 * src/scan-gram.l: Include quotearg.h.
10494 ("\""): Omit quote.
10495 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
10496 a key, since the rest of the lexer doesn't quote it.
10497 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
10498 * tests/regression.at (Token definitions): Check for backslashes
10499 in token strings.
10500
10501 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
10502 (YYSIZE_T): Define to unsigned long int when using an older compiler.
10503 (yyparse): Revamp code to generate long syntax error message, to
10504 make it easier to translate, and to avoid problems with arithmetic
10505 overflow. Change "virtual memory" to "memory" in diagnostic, since
10506 we don't know whether the memory is virtual.
10507
1ce59070
PE
105082005-04-13 Paul Eggert <eggert@cs.ucla.edu>
10509
10510 * NEWS: Bison-generated C parsers now use the _ macro to
10511 translate strings.
10512 * data/yacc.c (_) [!defined _]: New macro.
10513 All English strings wrapped inside this macro.
10514 * doc/bison.texinfo (Bison Parser): Document _.
10515 * po/POTFILES.in: Include src/parse-gram.c, since it now
10516 includes translateable strings that parse-gram.y doesn't.
10517
a749a695
PE
105182005-04-12 Paul Eggert <eggert@cs.ucla.edu>
10519
10520 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
10521 reverting the 2004-10-11 change to this function.
10522 (symbol_check_alias_consistency): Don't call symbol_type_set
10523 if the type name is already correct.
10524 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
10525
8fb1053b
PE
105262005-03-25 Paul Eggert <eggert@cs.ucla.edu>
10527
10528 * tests/regression.at (Token definitions): Don't use a token named
10529 c, as that generates a "#define c ..." that runs afoul of buggy
10530 stdlib.h that uses the identifier c as a member of struct
10531 drand48_data. Problem reported by Horst Wente.
10532
ff498c4a
PE
105332005-03-21 Paul Eggert <eggert@cs.ucla.edu>
10534
10535 * bootstrap: Change translation URL from
10536 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
10537 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
10538 redirection glitches. Problem reported by twlevo@xs4all.nl.
10539
65211d70
PE
105402005-03-20 Paul Eggert <eggert@cs.ucla.edu>
10541
10542 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
10543 after operands; POSIX says this isn't portable for the c99 command.
10544
9577fb1f
PE
105452005-03-18 Paul Eggert <eggert@cs.ucla.edu>
10546
10547 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
10548 immediately if a data overrun has occurred; this may help us track
10549 down what may be a spurious failure on MacOS.
10550
78b178f7
PE
105512005-03-17 Paul Eggert <eggert@cs.ucla.edu>
10552
a2599d0f
PE
10553 Respond to problems reported by twlevo@xs4all.nl.
10554
10555 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
10556
78b178f7
PE
10557 * src/vcg.h: Comment fix.
10558 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
10559 (G_CMAX): Change to -1 instead of INT_MAX.
10560
10561 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 10562
7296e729
PE
105632005-03-15 Paul Eggert <eggert@cs.ucla.edu>
10564
10565 * src/tables.c (state_number_to_vector_number): Put it inside an
10566 "#if 0", since it's not currently used. Problem reported by
10567 Roland McGrath.
10568
05ac60f3
PE
105692005-03-06 Paul Eggert <eggert@cs.ucla.edu>
10570
10571 * src/output.c (escaped_output): Renamed from
10572 escaped_file_name_output, since we now use it for symbol tags as
10573 well. All uses changed.
10574 (symbol_destructors_output, symbol_printers_output):
10575 Escape symbol tags too.
10576 Problem reported by Matyas Forstner in
10577 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
10578
10579 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
10580 not needed.
10581 * src/output.c (user_actions_output, token_definitions_output,
10582 symbol_destructors_output, symbol_printers_output): Likewise.
10583 * src/reader.c (prologue_augment): Likewise.
10584 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
10585
10586 * src/vcg.c (output_edge): Don't quote linestyle arg.
10587 Problem reported by twlevo@xs4all.nl.
10588
7eb453ac
PE
105892005-02-28 Paul Eggert <eggert@cs.ucla.edu>
10590
10591 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
10592 example, reported by Derek M Jones. Also, make the example even
10593 more outrageous, to better illustrate how bad the problem is.
10594
4c04c52a
PE
105952005-02-24 Paul Eggert <eggert@cs.ucla.edu>
10596
10597 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
10598 putsym. Typo reported by Sebastian Piping.
10599
a61e1620
PE
106002005-02-23 Paul Eggert <eggert@cs.ucla.edu>
10601
10602 * doc/bison.texinfo (Language and Grammar): some -> same
10603 (Epilogue): int he -> in the
10604 Typos reported by Sebastian Piping via Justin Pence.
10605
9ec93868
PE
106062005-02-07 Paul Eggert <eggert@cs.ucla.edu>
10607
10608 * tests/glr-regression.at (Improper handling of embedded actions
10609 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
10610 embedded actions and $-N in GLR parsers", work around an Autoconf bug
10611 with dollar signs in test names.
10612 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
10613 for a similar reason.
10614
73ce7e7e
PE
106152005-01-28 Paul Eggert <eggert@cs.ucla.edu>
10616
10617 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
10618 wants to redefine G_VIEW.
10619
2e72b98e
PE
106202005-01-27 Paul Eggert <eggert@cs.ucla.edu>
10621
10622 * src/vcg.c (get_view_str): Remove case for normal_view.
10623 Problem reported by twlevo@xs4all.nl.
10624
e0d634e5
PE
106252005-01-24 Paul Eggert <eggert@cs.ucla.edu>
10626
ccf830a4
PE
10627 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
10628 Problem reported by twlevo@xs4all.nl.
10629
e0d634e5
PE
10630 * doc/bison.texinfo: Change @dircategory from "GNU programming
10631 tools" to "Software development". Requested by Richard Stallman
10632 via Karl Berry.
10633
7bbc8cb0
PE
106342005-01-23 Paul Eggert <eggert@cs.ucla.edu>
10635
10636 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
10637 Problem reported by twlevo@xs4all.nl.
10638
08b770bc
PE
106392005-01-21 Paul Eggert <eggert@cs.ucla.edu>
10640
10641 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
10642 keyword; it's not needed with modern compilers, and it doesn't
10643 affect correctness with older compilers. Suggested by
10644 twlevo@xs4all.nl.
10645
95f22ad2
PE
106462005-01-17 Paul Eggert <eggert@cs.ucla.edu>
10647
10648 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
10649 gcc -Wswitch-default.
10650 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
10651 * data/yacc.c (yyparse): Likewise.
10652
d229d15c
PE
106532005-01-12 Paul Eggert <eggert@cs.ucla.edu>
10654
10655 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
10656 already. Let config.h define any nonstandard values.
10657
ecadd90f
PE
106582005-01-10 Paul Eggert <eggert@cs.ucla.edu>
10659
10660 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
10661 for the benefit of slower hosts. Problem reported by
10662 Nelson H. F. Beebe.
10663
213744b5
PE
106642005-01-07 Paul Eggert <eggert@cs.ucla.edu>
10665
10666 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
10667 being defined and not used.
10668 * data/lalr1.cc (yyparse): Likewise.
10669 Use "if (false)" rather than "if (0)".
10670
249d3236
PE
106712005-01-05 Paul Eggert <eggert@cs.ucla.edu>
10672
10673 * TODO: Mention that we should allow NUL bytes in tokens.
10674
987cc1fb
PE
106752005-01-02 Paul Eggert <eggert@cs.ucla.edu>
10676
10677 * src/scan-skel.l (<<EOF>>): Don't close standard output.
10678 Problem reported by Hans Aberg.
10679
08fe02d9
PE
106802005-01-01 Paul Eggert <eggert@cs.ucla.edu>
10681
10682 * src/getargs.c (version): Happy new year; update overall
10683 program copyright date from 2004 to 2005.
10684
10685 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
10686 Problem reported by Hans Aberg.
10687 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
10688 (Output file names.): Add a test for the case when standard output
10689 is closed.
10690
010c0266
PE
106912004-12-26 Paul Eggert <eggert@cs.ucla.edu>
10692
10693 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
10694 to fix an oversight in the Bison 2.0 manual.
10695
da12206a
PE
106962004-12-25 Paul Eggert <eggert@cs.ucla.edu>
10697
10698 * NEWS: Version 2.0. Reformat the existing news items since
10699 1.875, so that related items are grouped together.
3a4734aa 10700 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
10701 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
10702
c935d934
PE
10703 * tests/torture.at (Exploding the Stack Size with Alloca): Set
10704 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
10705 otherwise, we're not testing alloca. Unfortunately there's no
10706 simple way to consult HAVE_ALLOCA here.
10707
da12206a
PE
10708 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
10709 for yymsg, too.
10710
10711 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
10712 hand. This avoids a warning about comparing int to size_t when
10713 GCC warnings are enabled.
10714
0a2c5137
PE
107152004-12-22 Paul Eggert <eggert@cs.ucla.edu>
10716
d7e14fc0
PE
10717 * NEWS: Bison-generated parsers no longer default to using the
10718 alloca function (when available) to extend the parser stack, due
10719 to widespread problems in unchecked stack-overflow detection.
10720 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
10721 responsibility to set it to a positive value. This lets the user
10722 specify a value that is not a preprocessor constant.
10723 * data/yacc.c (YYMAXDEPTH): Likewise.
10724 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
10725 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
10726 to be a compile-time constant. However, explain the constraints on it.
10727 Also, explain the constraints on YYINITDEPTH.
10728 (Table of Symbols): Explain that alloca is no longer the default.
10729 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
10730 to 1.
10731
0a2c5137
PE
10732 * doc/bison.texinfo (Location Default Action): Mention that n must
10733 be zero when k is zero. Suggested by Frank Heckenbach.
10734
e019c247
AD
107352004-12-22 Akim Demaille <akim@epita.fr>
10736
10737 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
10738 (parser::state_type, parser::semantic_type, parser::location_type):
10739 Private, not public.
10740 (parser::parse): Return ints, not bool.
10741 Returning a bool introduces a problem: 0 corresponds to false, and
10742 it seems weird to return false on success. Returning true changes
10743 the conventions for yyparse.
10744 Alternatively we could return void and send an exception.
10745 There is no clear consensus (yet?).
10746 (state_stack, semantic_stack, location_stack): Rename as...
10747 (state_stack_type, semantic_stack_type, location_stack_type): these.
10748 Private, not public.
10749 * tests/c++.at: New.
10750 * tests/testsuite.at, tests/Makefile.am: Adjust.
10751
72731bb7
AD
107522004-12-21 Akim Demaille <akim@epita.fr>
10753
10754 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
10755
9a0d8bec
AD
107562004-12-21 Akim Demaille <akim@epita.fr>
10757
10758 Don't impose std::string for filenames.
10759
10760 * data/lalr1.cc (b4_filename_type): New.
10761 (position::filename): Use it.
10762 (parser.hh): Move the inclusion of stack.hh and location.hh below
10763 the user code, so that needed headers for the filename type can be
10764 included first.
72731bb7
AD
10765 Forward declare them before the user code.
10766 * tests/Makefile.am (check-local, installcheck-local): Pass
10767 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 10768
99880de5
AD
107692004-12-20 Akim Demaille <akim@epita.fr>
10770
10771 Use more STL like names: my_class instead of MyClass.
10772
10773 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
10774 (SemanticStack, SemanticType, StateStack, StateType)
10775 (TokenNumberType, Stack, Slice, Traits, Parser::location)
10776 (Parser::value): Rename as...
10777 (location_stack, location_type, rhs_number_type, semantic_stack)
10778 (semantic_type, state_stack, state_type, token_number_type, stack)
10779 (slice, traits, parser::yylloc, parser::yylval): these.
10780
10781 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
10782
9bec482e
PE
107832004-12-19 Paul Eggert <eggert@cs.ucla.edu>
10784
10785 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
10786 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
10787
f6fbd3da
PE
107882004-12-17 Paul Eggert <eggert@cs.ucla.edu>
10789
10790 Remove uses of 'short int' and 'unsigned short int'. This raises
10791 some arbitrary limits. It uses more memory but nowadays that's
10792 not much of an issue.
10793
10794 This change does not affect the generated parsers; that's a different
10795 task, as some users will want to conserve memory there.
10796
10797 Ideally we should use size_t to represent all object counts, and
10798 something like ptrdiff_t to represent signed differences of object
10799 counts; but that will require more code-cleanup than I have the
10800 time to do right now.
10801
10802 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
10803 Use size_t, not int or short int, to count objects.
10804 * src/closure.c (nritemset, closure): Likewise.
10805 * src/closure.h (nritemset, closure): Likewise.
10806 * src/nullable.c (nullable_compute): Likewise.
10807 * src/print.c (print_core): Likewise.
10808 * src/print_graph.c (print_core): Likewise.
10809 * src/state.c (state_compare, state_hash): Likewise.
10810 * src/state.h (struct state): Likewise.
10811 * src/tables.c (default_goto, goto_actions): Likewise.
10812
10813 * src/gram.h (rule_number, rule): Use int, not short int.
10814 * src/output.c (prepare_rules): Likewise.
10815 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
10816 errs, reductions): Likewise.
10817 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
10818 Likewise.
10819 * src/tables.c (vector_number, tally, action_number,
10820 ACTION_NUMBER_MINIMUM): Likewise.
10821 * src/output.c (muscle_insert_short_int_table): Remove.
10822
efeed023
AD
108232004-12-17 Akim Demaille <akim@epita.fr>
10824
10825 * data/lalr1.cc: Extensive Doxygenation.
10826 (error_): Rename as...
10827 (error): this, since it is visible to the user.
10828 Adjust callers.
10829 (Parser::message): Now an automatic variable from...
10830 (Parser::yyreport_syntax_error_): here.
10831 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
10832 Parser::error.
10833 * tests/input.at: Escape $.
10834
bc82c5a5
PE
108352004-12-16 Paul Eggert <eggert@cs.ucla.edu>
10836
10837 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
10838 Parenthesize rhs to avoid obscure problems with mistakes like
10839 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
10840 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
10841 b4_rhs_location): Likewise.
10842 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
10843 b4_rhs_location): Likewise.
10844
fd19f271
AD
108452004-12-16 Akim Demaille <akim@epita.fr>
10846
10847 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
10848 yacc.c: be sure to stay within yycheck_.
10849 * tests/actions.at: Re-enable C++ tests.
10850
10454ea4
AD
108512004-12-16 Akim Demaille <akim@epita.fr>
10852
10853 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
10854 real.
10855
c5b95ccf
AD
108562004-12-16 Akim Demaille <akim@epita.fr>
10857
10858 Use #define to handle the %name-prefix.
10859
10860 * data/glr.c, data/yacc.c: Comment changes.
10861 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
10862 so that one can refer to yylex in the parser file, and have it
10863 renamed, as is the case with other skeletons.
10864
617a8f12
AD
108652004-12-16 Akim Demaille <akim@epita.fr>
10866
10867 Move lalr1.cc internals into yy*.
10868
10869 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
10870 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
10871 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
10872 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
10873 (empty_, final_, terror_, errcode_, ntokens_)
10874 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
10875 (looka_, ilooka_, error_range_, nerrs_):
10876 Rename as...
10877 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
10878 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
10879 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
10880 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
10881 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
10882 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
10883 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
10884 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
10885 these.
10886
1e547e6e
PE
108872004-12-15 Paul Eggert <eggert@cs.ucla.edu>
10888
10889 Fix some problems reported by twlevo at xs4all.
10890 * src/symtab.c (symbol_new): Report an error if the input grammar
10891 contains too many symbols. This is better than calling abort() later.
10892 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
10893 (struct node, struct graph):
10894 Rename member expand to stretch. All uses changed.
10895 (struct graph): Remove member layoutalgorithm. All uses removed.
10896 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
10897 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
10898 All uses changed.
10899 (N_STRETCH): Rename from N_EXPAND. All uses changed.
10900
735d6bd4
AD
109012004-12-15 Akim Demaille <akim@epita.fr>
10902
10903 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
10904 Add more Doxygen comments.
10905 (symprint_, stack_print_, reduce_print_, destruct_, pop)
10906 (report_syntax_error_, translate_): Rename as...
10907 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
10908 (yypop_, yyreport_syntax_error_, yytranslate_): this.
10909
2e1f5829
AD
109102004-12-15 Akim Demaille <akim@epita.fr>
10911
10912 * data/lalr1.cc (lex_): Rename as...
10913 (yylex_): this.
10914 Move the trace here.
10915 Take the %name-prefix into account.
10916 Reported by Alexandre Duret-Lutz.
10917
a3cb6248
AD
109182004-12-15 Akim Demaille <akim@epita.fr>
10919
10920 Simplify the C++ parser constructor.
10921
10922 * data/lalr1.cc (debug_): Rename as...
10923 (yydebug_): so that the parser's internals are always in the yy*
10924 pseudo namespace.
10925 Adjust uses.
10926 (b4_parse_param_decl): Remove the leading comma as it is now only
10927 called as unique argument list.
10928 (Parser::Parser): Remove the constructor accepting a location and
10929 an initial debugging level.
10930 Remove from the other ctor the argument for the debugging level.
10931 (debug_level_type, debug_level, set_debug_level): New.
10932
10933 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
10934 constructor calls.
10935
07fed891
AD
109362004-12-15 Akim Demaille <akim@epita.fr>
10937
10938 Remove b4_root related material: failure experiment
a3cb6248 10939 (which goal was to allow to derive from a class).
07fed891
AD
10940
10941 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
10942 definitions and uses.
10943
e603eaa5
PE
109442004-12-14 Paul Eggert <eggert@cs.ucla.edu>
10945
10946 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
10947 not 2, since it's not portable to subtract 1 from the start of an
10948 array. The new item 0 is never set or used. All uses changed.
10949
10950 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
10951 the default definition of YYLLOC_DEFAULT. Problem reported
10952 by Frank Heckenbach.
10953
fafb007d
PE
109542004-12-12 Paul Eggert <eggert@cs.ucla.edu>
10955
10956 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
10957 the normal case and one for the error case. Just use the
10958 first one uniformly. Problem reported by Frank Heckenbach.
10959 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
10960 use exactly the same macro in both places.
10961 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
10962 so that the normal-case YYRHSLOC works for the error case too.
10963 All uses changed.
10964 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
10965 (YYLLOC_DEFAULT): Use the same macro as glr.c.
10966 * doc/bison.texinfo (Location Default Action): Don't claim that
10967 we have an array of locations. Use the same macro for both glr
10968 and lalr parsers. Mention YYRHSLOC. Mention what happens when
10969 the index is 0.
10970
48814dcd
PE
109712004-12-10 Paul Eggert <eggert@cs.ucla.edu>
10972
a4e1a53b
PE
10973 * HACKING: Update email addresses to send announcements to.
10974
48814dcd
PE
10975 * configure.ac (AC_INIT): Bump version to 1.875f.
10976
337116ba
PE
109772004-12-10 Paul Eggert <eggert@cs.ucla.edu>
10978
10979 * NEWS: Version 1.875e.
10980 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
10981
10982 * src/scan-skel.l: Include "complain.h", for "fatal".
10983
10984 * src/relation.h (relation_print, relation_digraph):
10985 Relation sizes are of type relation_node, not size_t (this is
10986 merely a doc fix, since the two types are equivalent).
10987 (relation_transpose): Relation sizes are of type relation_node,
10988 not int.
10989 * src/relation.c: Likewise.
10990 (top, infinity): Now of type relation_node, not int.
10991 (traverse, relation_transpose): Use relation_node, not int.
10992
10993 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
10994 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
10995 (yyparse): Remove unused local introduced in 2004-10-25 patch.
10996
10997 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 10998 specifying whether the test should be skipped. Use it tp
337116ba 10999 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 11000 fail on some hosts, and should be skipped.
337116ba 11001
da2a7671
PE
110022004-12-08 Paul Eggert <eggert@cs.ucla.edu>
11003
11004 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
11005 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
11006 unless otherwise specified below.
11007
11008 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
11009 to allocate kernel_base, kernel_items, kernel_size, since
11010 they needn't be initialized to 0.
11011 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
11012 * src/closure.c (new_closure): Likewise, for itemset.
11013 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
11014 * src/lalr.c (set_goto_map): Likewise, for temp_map.
11015 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
11016 (build_relations): Likewise for edge, states1, includes.
11017 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
11018 * src/reader.c (packgram): Likewise, for ritem, rules.
11019 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
11020 * src/relation.c (relation_digraph): Likewise for VERTICES.
11021 (relation_transpose): Likewise for new_R, end_R.
11022 * src/symtab.c (symbols_token_translations_init): Likewise for
11023 token_translations.
11024 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
11025 (token_actions): Likewise for yydefact, actrow, conflrow,
11026 conflict_list.
11027 (save_column): Likewise for froms[symno], tos[symno].
11028 (goto_actions): Likewise for state_count.
11029 (pack_table): Likewise for base, pos, check.
11030 (tables_generate): Likewise for width.
11031
11032 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
11033 for initial core. Just have a separate core, so we needn't worry
11034 about whether kernel_size and kernel_base are initialized.
11035
11036 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
11037 kernel_size, kernel_items): Remove unnecessary initialization.
11038 * src/conflicts.c (conflicts): Likewise.
11039 * src/derives.c (derives): Likewise.
11040 * src/muscle_tablc (muscle_insert): Likewise.
11041 * src/relation.c (relation_digraph): Likewise.
11042 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
11043 conflrow, conflict_table, conflict_list, table, check):
11044 Likewise.
11045
11046 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
11047 This is because all callers pass unsigned int.
11048 * src/closure.h (new_closure): Likewise.
11049
11050 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
11051 (build_relations): Initialize includes[i] in all cases.
11052 * src/reader.c (packgram): Always initialize rules[ruleno].prec
11053 and rules[ruleno].precsym. Initialize members in order.
11054 * src/relation.c (relation_transpose): Always initialize new_R[i]
11055 and end_R[i].
11056 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
11057
11058 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
11059 conflict_list[0] was always 0, but now it isn't initialized.
11060
11061 * src/table.c (table_grow): When conflict_table grew, the grown
11062 area wasn't cleared. Fix this.
11063
11064 * lib/.cvsignore: Add strdup.c, strdup.h.
11065 * m4/.cvsignore: Add strdup.m4.
11066
00baeeac
PE
110672004-12-07 Paul Eggert <eggert@cs.ucla.edu>
11068
11069 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
11070 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
11071 GOTO_NUMBER_MAXIMUM, since we occasionally compute
11072 ngotos + 1 without checking for overflow.
11073 (build_relations): Use END_NODE, not -1, to denote end of edges.
11074 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
11075 build_relations): Use goto_number, not int, for goto numbers.
11076 * src/tables.c (save_column, default_goto): Likewise.
11077
be3d9d42
AD
110782004-11-23 Akim Demaille <akim@epita.fr>
11079
11080 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
11081 of #defining from yystype.
11082 Don't typedef yystype, C++ does not need it.
11083 This lets it possible to forward declare it as union.
11084
78e526d5
PE
110852004-11-23 Paul Eggert <eggert@cs.ucla.edu>
11086
11087 * bootstrap (gnulib_modules): Add extensions.
11088 Problem reported by Jim Meyering.
11089
afbb696d
PE
110902004-11-22 Paul Eggert <eggert@cs.ucla.edu>
11091
11092 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
11093 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
11094 src/system.h, src/tables.c: XFREE -> free, to accommodate
11095 recent change to gnulib xalloc.h.
78e526d5 11096 Problem reported by Jim Meyering.
afbb696d 11097
c1f8f16a
AD
110982004-11-17 Akim Demaille <akim@epita.fr>
11099
11100 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
11101
db7e5eb5 111022004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
11103 Alexandre Duret-Lutz <adl@gnu.org>
11104
11105 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
11106 changes.
11107 (YYCDEBUG): Adjust.
11108 Use it instead of cdebug_.
11109 (Parser::debug_stream, Parser::set_debug_stream): New.
11110 (Parser::symprint_): Define cdebug_ for temporary backward
11111 compatibility.
11112 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
11113 debug_stream ().
11114
68e11668
AD
111152004-11-17 Akim Demaille <akim@epita.fr>
11116
11117 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
11118 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
11119 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
11120 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
11121
97cbc73e
PE
111222004-10-27 Paul Eggert <eggert@cs.ucla.edu>
11123
11124 * data/glr.c (yyloc_default): Remove; not used.
11125 Problem reported by Frank Heckenbach.
11126
e342c3be
AD
111272004-10-25 Akim Demaille <akim@epita.fr>
11128
11129 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
11130 Introduce another definition to address simple location arrays.
11131 (yyGLRStack): New member: yyerror_range.
11132 (yyrecoverSyntaxError, yyparse): Update it.
11133 (yyrecoverSyntaxError): Use it when shifting the error token to
11134 have an accurate range, equivalent to the one computed by both
11135 yacc.c and lalr1.cc.
11136 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
11137 that column numbers start at column 0, as per GNU Coding
11138 Standards, the others tests, and the doc.
11139 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
11140 Adjust to the above change (first column is 0).
11141 And adjust the location of the "<error>", now covering the whole
11142 line.
11143
93602feb 111442004-10-22 Akim Demaille <akim@epita.fr>
04098407 11145 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
11146
11147 Remove some arbitrary limits on goto numbers and relations.
11148 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
11149 initial values, since they're never used.
11150 (set_goto_map): ngotos is now unsigned, so test for overflow
11151 by seeing whether it wraps around to zero.
11152 * src/lalr.h (goto_number): Now size_t, not short int.
11153 (GOTO_NUMBER_MAXIMUM): Remove.
11154 * src/relation.c (relation_print, traverse, relation_transpose):
11155 Check for END_NODE rather than looking at sign.
11156 * src/relation.h (END_NODE): New macro.
11157 (relation_node): Now size_t, not short int.
11158
dba08b04
PE
111592004-10-22 Paul Eggert <eggert@cs.ucla.edu>
11160
11161 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
11162 keyword, not an identifier. Problem reported by Baron Schwartz in
11163 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
11164
df09ef2e
AD
111652004-10-11 Akim Demaille <akim@epita.fr>
11166
11167 * src/symtab.c (symbol_check_alias_consistency): Also check
11168 type names, destructors, and printers.
11169 Reported by Alexandre Duret-Lutz.
11170 Recode the handling of associativity and precedence in terms
11171 of symbol_precedence_set.
11172 Accept no redeclaration at all, not even equal to the previous
11173 value.
11174 (redeclaration): New.
11175 Use it to factor redeclaration complaints.
11176 (symbol_make_alias): Don't set the type of the alias, let
11177 symbol_check_alias_consistency do it as for other features.
11178 * src/symtab.h (symbol): Add new member prec_location, and
11179 type_location.
11180 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
11181 * tests/input.at (Incompatible Aliases): New.
11182
146bc99d
PE
111832004-10-09 Paul Eggert <eggert@cs.ucla.edu>
11184
11185 .cvsignore fixes to accommodate gnulib changes,
11186 and the practice of naming build directories "_build".
11187 * .cvsignore: Add "_*". Sort.
11188 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
11189 * m4/.cvsignore: Add "*_gl.m4".
11190
e503aa60
AD
111912004-10-06 Akim Demaille <akim@epita.fr>
11192
11193 * src/parse-gram.y (add_param): Fix the truncation of trailing
11194 spaces.
11195
b4a20338
AD
111962004-10-05 Akim Demaille <akim@epita.fr>
11197
11198 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
11199 whether the reducion was empty or not. This leaves room to
11200 improve the use of YYLLOC_DEFAULT in such a case.
11201 lalr1.cc is still experimental, so changing this is acceptable.
11202 And finally, there are probably not many users who changed the
11203 handling of locations in GLR, so changing is admissible too.
11204
11205 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
11206 empty reduction, set @$ to an empty location ending the previously
11207 stacked symbol.
11208 Adjust uses to make sure the code is triggered on empty
11209 reductions.
11210 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
11211 expected output: empty reductions have empty locations.
11212
f85a5e6f
AD
112132004-09-29 Akim Demaille <akim@epita.fr>
11214
11215 * data/lalr1.cc: Move towards a more standard C++ coding style
11216 for templates: Class < T > -> Class<T>.
11217
b203fc2c
AD
112182004-09-29 Akim Demaille <akim@epita.fr>
11219
11220 * data/lalr1.cc: Reinstall the former ctor, for sake of
11221 compatibility, but warn it will be removed.
11222 Move towards a more standard C++ coding style (i.e., type *var ->
11223 type* var).
11224
5b7e1e73
PE
112252004-09-27 Paul Eggert <eggert@cs.ucla.edu>
11226
3fee967f
PE
11227 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
11228 since it's less likely to work if NULs are involved in the future.
5b7e1e73 11229
0dcca5c2
AD
112302004-09-27 Akim Demaille <akim@epita.fr>
11231
11232 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
11233
6dde1c82
AD
112342004-09-27 Akim Demaille <akim@epita.fr>
11235
11236 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 11237 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
11238 and argument names.
11239 (b4_cc_constructor_call): Likewise.
11240
b233d555
AD
112412004-09-24 Akim Demaille <akim@epita.fr>
11242
11243 * src/parse-gram.y (add_param): Strip the leading and trailing
11244 blanks from a formal argument declaration.
11245 (YY_LOCATION_PRINT): New.
11246
619404e3
AD
112472004-09-24 Akim Demaille <akim@epita.fr>
11248
11249 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
11250 after the location.
11251
dd8d9022
AD
112522004-09-24 Akim Demaille <akim@epita.fr>
11253
11254 * doc/bison.texinfo (Table of Symbols): Sort.
11255
0092f063
AD
112562004-09-21 Akim Demaille <akim@epita.fr>
11257
11258 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
11259 the useless parentheses.
11260 Suggested by Paul Eggert.
11261
451364ed
AD
112622004-09-20 Akim Demaille <akim@epita.fr>
11263
11264 Let the initial-action act on the look-ahead, and use it for the
11265 "initial push" (corresponding to an hypothetical beginning-of-file).
11266 And let lalr1.cc honor %initial-action.
11267
11268 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
11269 example.
11270 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
11271 (Parser::Parser): Remove the ctor that used to initialize it.
11272 (Parser::parse): Like in the other skeletons, issue the "starting
11273 parse" message before any action.
11274 Honor %initial-action.
11275 Initialize the stacks with the lookahead.
11276 * data/yacc.c: Let $$ and @$ in %initial-action designate the
11277 look-ahead.
11278 Push them in the stacks.
11279 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
11280
18d192f0
AD
112812004-09-20 Akim Demaille <akim@epita.fr>
11282
11283 * doc/bison.texinfo (Initial Action Decl): New.
11284
b8458aa5
AD
112852004-09-20 Akim Demaille <akim@epita.fr>
11286
11287 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
11288 clearer criterion to define it.
11289 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
11290 When reducing on an empty RHS, use the latest stacked location as
11291 location.
11292 yylloc is not always available.
11293 * data/glr.c: Likewise.
11294 Also, honor initial-actions.
11295
3fc16193
AD
112962004-09-20 Akim Demaille <akim@epita.fr>
11297
11298 * data/yacc.c (YY_LOCATION_PRINT): New.
11299 Define when we know YYLTYPE's structure, i.e., when the default
11300 YYLLOC_DEFAULT is used.
11301 * data/c.m4 (b4_yysymprint_generate): Use it.
11302 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
11303 value of the result.
11304 (error_start_): Replace with...
11305 (error_range_): this location array.
11306 This allows to replace code relying on the implementation of
11307 locations by portable code.
11308 * data/yacc.c (yylerrsp): Replace with...
11309 (yyerror_range): this.
11310 Every time a token is popped, update yyerror_range[0], to have an
11311 accurate location for the error token.
11312 * data/glr.c (YY_LOCATION_PRINT): New.
11313 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
11314 deference a pointer.
11315 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
11316 report the location in %printers.
11317
11318 * src/scan-skel.l: Instead of abort, report error messages to ease
11319 understanding skeleton scanning failures.
11320
ecfe33e7
AD
113212004-09-16 Akim Demaille <akim@epita.fr>
11322
11323 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
11324 (iterator, const_iterator): these, to be more in the C++ spirit.
11325 Also, return reverse iterators so that when displaying the stack
11326 we display its bottom first.
11327 (Parser::stack_print_, Parser::reduce_print_): Match the messages
11328 from yacc.c.
11329 We should probably use vector here though.
11330
1576d44d
AD
113312004-09-16 Akim Demaille <akim@epita.fr>
11332
11333 Have more complete shift traces.
11334
11335 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
11336 to report Shifts instead of ad hoc YYDPRINTF invocations,
11337 including for the error token.
11338 * data/lalr1.cc (symprint_): Output the location.
11339 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
11340 output the location within the %printer.
11341 Activate GLR tests, at least to make sure they compile properly.
11342 They still don't pass though.
11343 * tests/calc.at: Adjust expect verbose output, since now "Entering
11344 state..." is on a different line than the "Shifting" message.
11345
9c66f418
AD
113462004-09-08 Akim Demaille <akim@epita.fr>
11347
11348 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
11349 Bison directive from the Bison file to the invocation of this
11350 macro, so that these directives are passed to
11351 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
11352 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
11353 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
11354 the extra Bison directives instead of the whole series.
11355 Change the grammar so that there are recoverable errors, and
11356 unrecoverable errors. Now we can have the parser give up before
11357 consuming the whole input. As a result we now can observe that
11358 the lookahead is freed when needed.
11359 Change the parser source to parse argv[1] instead of a hard coded
11360 string.
11361 Simplify yylex, and give a value and location to EOF.
11362 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
11363 passed directives already coded in the file.
11364 Add some tests to check the location of "error".
11365 For some tests, the C++ parser is correct, and not yacc.c.
11366 For other tests, they provide different, but unsatisfying, values,
11367 so keep the C++ value so that at least one parser is "correct"
11368 according to the test suite.
11369 (Actions after errors): Remove, this is subsumed by the
11370 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
11371
52d5733f
AD
113722004-09-06 Akim Demaille <akim@epita.fr>
11373
11374 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 11375 (Parser::pop): New.
52d5733f
AD
11376 Use it.
11377
a0e68930
AD
113782004-09-06 Akim Demaille <akim@epita.fr>
11379
11380 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
11381 argument, an informative message.
11382 Call YY_SYMBOL_PRINT.
11383 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
11384 * data/lalr1.cc (destruct_): Likewise.
11385 In addition, no longer depend on b4_yysymprint_generate and
11386 b4_yydestruct_generate to generate these functions, do it "by
11387 hand".
11388
e757bb10
AD
113892004-09-03 Akim Demaille <akim@epita.fr>
11390
11391 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
11392 invoked, yydestruct the lookahead.
11393 * tests/calc.at (Calculator $1): Update the expected lengths of
11394 traces: there is an added line for the discarded lookahead.
11395 * doc/bison.texinfo (Destructor Decl): Some rewording.
11396 Define "discarded" symbols.
11397
0fe1f06d
AD
113982004-09-02 Akim Demaille <akim@epita.fr>
11399
11400 * data/lalr1.cc (translate_, destruct_): No reason to be static.
11401
284acc8b
AD
114022004-09-02 Akim Demaille <akim@epita.fr>
11403
11404 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
11405 (YYDSYMPRINTF): Rename as...
11406 (YY_SYMBOL_PRINT): this.
11407 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
11408 two.
11409 Use it instead of direct symprint_ calls.
11410 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
11411 one.
11412
a5eb1ed2
AD
114132004-09-02 Akim Demaille <akim@epita.fr>
11414
b7c72fe1
AD
11415 * data/lalr1.cc (b4_yysymprint_generate): New.
11416 (symprint_): New member function, defined when YYDEBUG.
11417 Use it consistently instead of token/nterm debugging output by
11418 hand.
a5eb1ed2
AD
11419 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
11420 %printer calls to use cdebug_ when using lalr1.cc.
11421
417141dd
AD
114222004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
11423
11424 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
11425 with #ifdef YYDEBUG.
11426
2fa09258
AD
114272004-08-26 Akim Demaille <akim@epita.fr>
11428
11429 * doc/bison.texinfo (Implementing Loops): Rename as...
11430 (Implementing Gotos/Loops): this.
11431
9378b508
PE
114322004-08-13 Paul Eggert <eggert@cs.ucla.edu>
11433
11434 Adjust to latest gnulib.
11435 * bootstrap (gnulib_modules): Add xalloc-die.
11436 Set LC_ALL=C so that file names sort consistently.
11437 Prefer the gnulib copies of gettext.m4, glibc21.m4,
11438 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
11439 uintmax_t.m4, ulonglong.m4.
11440 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
11441 po.m4 since we are now using _gl.m4 instead.
11442
87a8ad5c
PE
114432004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
11444
11445 * src/scan-action.l: Remove. Scanning of semantic actions is
11446 handled in scan-gram.l.
11447
dca81a78
PE
114482004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
11449
11450 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
11451
11452 * src/location.h (struct): The file member is a uniqstr.
11453 (equal_boundaries): Use UNIQSTR_EQ for comparison.
11454
c9cbf7c5
PE
114552004-07-22 Paul Eggert <eggert@cs.ucla.edu>
11456
11457 Fix bug with non-%union parsers that have printers or destructors,
11458 which led to a Bison core dump. Reported by Peter Fales in
11459 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 11460
c9cbf7c5
PE
11461 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
11462 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
11463 not to our own type.
11464 * src/output.c (symbol_destructors_output, symbol_printers_output):
11465 Don't assume %union.
11466 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
11467 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
11468 UNION-FLAG. All callers changed.
11469 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
11470 Use type char, not unsigned int, when declaring an array of char;
11471 this lets us remove a cast.
11472 (Printers and Destructors): Add non-%union test cases.
11473
fa7e68c3
PE
114742004-06-21 Paul Eggert <eggert@cs.ucla.edu>
11475
11476 * doc/bison.texinfo: Minor editorial changes, mostly to the new
11477 GLR writeups. E.g., avoid frenchspacing and the future tense,
11478 change "lookahead" to "look-ahead", and change "wrt" to "with
11479 respect to".
2fa09258 11480
fa7e68c3
PE
114812004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11482
11483 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
11484 New sections, split off from the GLR Parsers section. Put the new
11485 Simple GLR Parser near the start of the GLR section, for clarity.
11486 Rewrite connective text.
11487
99a9344e
PE
114882004-06-21 Frank Heckenbach <frank@g-n-u.de>
11489
11490 * doc/bison.texinfo (Simple GLR Parsers): New section.
11491
8dd162d3
PE
114922004-06-21 Paul Eggert <eggert@cs.ucla.edu>
11493
11494 * NEWS, TODO, doc/bison.texinfo:
11495 Use "look-ahead" instead of "lookahead", to be consistent.
11496 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
11497 while we're fixing "look-ahead".
11498 * src/conflicts.c (shift_set): Renamed from shiftset.
11499 (look_ahead_set): Renamed from lookaheadset.
11500 * src/print.c: Likewise.
11501 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
11502 name for "lookahead".
11503 (report_types, usage): Likewise.
11504 * src/getargs.h (report_look_ahead_tokens): Renamed from
11505 report_lookaheads.
11506 * src/lalr.c (compute_look_ahead_tokens): Renamed from
11507 compute_lookaheads.
11508 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
11509 (look_ahead_tokens_print): Renamed from lookaheads_print.
11510 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
11511 state_rule_lookaheads_print.
11512 * src/state.h: Likewise.
11513 (reductions.look_ahead_tokens): Renamed from lookaheads.
11514 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
11515 AT_DATA_LOOKAHEADS_GRAMMAR.
11516
57a90331
PE
115172004-06-03 Paul Eggert <eggert@cs.ucla.edu>
11518
11519 * README: Update location of patched M4 distribution.
11520
8ed3234a
PE
115212004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
11522
11523 Don't assume the C++ compiler takes the same arguments as the C compiler
11524 (trivial change).
11525 * configure.ac (O0CXXFLAGS): New var.
11526 * tests/atlocal.in (CXXFLAGS): Use it.
11527
07971983
PE
115282004-05-29 Paul Eggert <eggert@cs.ucla.edu>
11529
11530 Fix some "make check" problems with C++ reported by
11531 Albert Chin-A-Young for Tru64 C++ in this thread:
11532 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
11533
11534 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
11535 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11536 Output to a .cc file for C++, not to a .c file.
11537 * tests/calc.at (AT_CHECK_CALC): Likewise.
11538 * tests/regression.at (AT_CHECK_DANCER): Likewise.
11539 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
11540
29058652
PE
115412004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
11542
11543 * tests/calc.at, tests/actions.at: Workaround for SGI
11544 C++ compiler. (trivial change)
11545
62cb8a99
PE
115462004-05-27 Paul Eggert <eggert@cs.ucla.edu>
11547
fd418816
PE
11548 Spent a few hours checking out which prerequisite versions the
11549 current sources actually require. I went all the way back to
11550 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
11551 a seemingly endless set of combinations of versions more recent
11552 than that. The bottom line is that the current sources require
11553 fairly recent versions of the build tools, and it'll be some work
11554 to change this.
11555 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
11556 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
11557 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
11558 Add comments explaining why those particular versions are
11559 currently needed.
2fa09258 11560
62cb8a99
PE
11561 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
11562 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 11563 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
11564
11565 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
11566 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
11567
caa52c10
PE
115682004-05-26 Paul Eggert <eggert@cs.ucla.edu>
11569
11570 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
11571 0.11.5. Suggested by Bruno Haible.
11572 * bootstrap: Remove gettext version checking.
11573
11574 * doc/bison.texinfo (Decl Summary): Also mention that %union
11575 can depend on prerequisite types. Problem reported by Tim
11576 Van Holder.
11577
4bfd5e4e
PE
115782004-05-25 Paul Eggert <eggert@cs.ucla.edu>
11579
2cef3017
PE
11580 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
11581 * README-alpha: Don't tell people not to package this.
11582
b9c85d5c
PE
11583 * bootstrap: Don't assume $(...) works; use `...` instead.
11584 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
11585 gettext better.
11586
4bfd5e4e
PE
11587 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
11588 put into the -d output file, and mention what to do if YYSTYPE is
11589 defined as a macro.
11590
6a36ff94
PE
115912004-05-24 Paul Eggert <eggert@cs.ucla.edu>
11592
6712933e
PE
11593 Undo change made earlier today: it caused autopoint to not bring
11594 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
11595 autopoint's.
11596
11597 * bootstrap: Check that gettext version matches what's in
11598 configure.ac. Warn users to ignore robots.txt ERROR 404.
11599 * bootstrap: Undo today's earlier change (logged below).
11600 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 11601
6a36ff94
PE
11602 The gettext version checking is causing more trouble than it's
11603 curing; remove it. Problem reported by Paul Hilfinger.
11604
11605 * bootstrap: Issue a warning that one can expect a message
11606 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
11607 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
11608
209ea708
PE
116092004-05-23 Paul Eggert <eggert@cs.ucla.edu>
11610
11611 Ensure that the C++ compiler used for testing actually works on a
11612 simple test program; if not, skip the C++-related tests. Problem
11613 reported by Vin Shelton in:
161a71f3 11614 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
11615
11616 * m4/cxx.m4: New file.
11617 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
11618 * tests/atlocal.in (BISON_CXX_WORKS): Add.
11619 * tests/local.at (AT_COMPILE_CXX): Use it.
11620
41ca2549
PE
116212004-05-21 Paul Eggert <eggert@cs.ucla.edu>
11622
383e69dc
PE
11623 * data/glr.c (yylloc): Output this macro even if locations are not
11624 being generated, as the GLR parser needs it even in that case.
11625 Problem reported by Troy A. Johnson
11626 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
11627
41ca2549
PE
11628 * configure.ac (AC_INIT): Update to 1.875e.
11629
e476c87d
PE
116302004-05-21 Paul Eggert <eggert@cs.ucla.edu>
11631
11632 * NEWS: Version 1.875d.
11633 * configure.ac (AC_INIT): Likewise.
11634 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
11635
11636 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
11637 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
11638 lalr1.cc runs afoul of the first, and the last two are no longer
11639 supported by GCC 3.4.0.
11640 * README: Mention GNU m4 1.4 or later; mention m4 patches.
11641 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
11642
233a88ad
PE
116432004-05-06 Paul Eggert <eggert@cs.ucla.edu>
11644
11645 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
11646 unsigned int, for compatibility with latest gnulib hash module.
11647 * src/state.c (state_hash, state_hasher): Likewise.
11648 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
11649 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 11650
12ffdd28
PE
116512004-05-03 Paul Eggert <eggert@cs.ucla.edu>
11652
11653 * NEWS: Unescaped newlines are no longer allowed in char & strings.
11654
11655 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
11656 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
11657 character and string literals.
11658 (unexpected_end): New function.
11659 (unexpected_eof): Use it.
11660 (unexpected_newline): New function.
11661 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
11662 actions.
e476c87d 11663
12ffdd28
PE
11664 * NEWS: Document %expect-rr.
11665
11666 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
11667 Fix typo by replacing $1 with $option.
11668 Remove more 'intl'-related files.
9668e2be 11669 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
11670
11671 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
11672 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
11673 strtoul.c.
11674 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
11675 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
11676 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
11677 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
11678 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
11679 * src/.cvsignore: Add *.output.
11680
11681 * src/parse-gram.y: Put copyright notice inside %{ %} so it
11682 gets copied to the output file.
e476c87d 11683
1f65350a
PE
116842004-04-28 Paul Eggert <eggert@twinsun.com>
11685
11686 Get files from the gnulib and po repositories, instead of relying
11687 on them being in our CVS. Upgrade to latest versions of gnulib
11688 and Automake.
11689
11690 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
11691 * bootstrap: Bootstrap from gnulib and po repositories.
11692 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
11693 * README-cvs: Document these changes. Remove version numbers from
11694 mentions of build tools, since they change so often. Mention Flex.
11695
11696 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
11697 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
11698 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
11699 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 11700 does this for us.
12ffdd28
PE
11701 (AC_ISC_POSIX): Remove; we no longer support this
11702 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
11703 (AC_HEADER_STDC): Remove: we now assume C89 or better.
11704 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
11705 Do not check for C89 headers, except for locale.h which is used
11706 by the Yacc library and must port to K&R hosts.
11707 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
11708 Do not check for C89 functions, except for setlocale which is
11709 used by the Yacc library.
11710 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
11711 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
11712 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
11713 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
11714 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
11715 AM_GNU_GETTEXT): Remove; now done by:
11716 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
11717 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
11718 for us.
11719
11720 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
11721 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
11722 Define to empty, as gnulib.mk will do the rest for us.
11723 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
11724 for us.
11725 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
11726 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
11727
11728 * src/files.c: Include gnulib's xstrndup.h.
11729
11730 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
11731 (REALLOC): Use xnrealloc, for likewise.
11732 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
11733 (strnlen, memrchr): Remove decls; functions no longer used.
11734 Include <stpcpy.h>.
11735
11736 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
11737 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
11738 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
11739 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
11740 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
11741 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
11742 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
11743 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
11744 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
11745 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
11746 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
11747 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
11748 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
11749 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
11750 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
11751 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
11752 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
11753 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
11754 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
11755 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
11756 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
11757 Remove, as these files are now generated automatically
11758 by bootstrap or automake.
11759
11760 * po/ChangeLog: Remove: all but one entry was a duplicate
11761 of this file, and I moved that 2000-11-02 entry here.
11762
11763 * config/.cvsignore: Add Makefile, depcomp, install-sh.
11764 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
11765 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
11766 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
11767 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
11768 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
11769 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
11770 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
11771 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
11772 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
11773 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
11774 xstrndup.h.
11775 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
11776 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
11777 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
11778 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
11779 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
11780 * src/.cvsignore: Remove *_.c.
11781
11782
11783 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
11784 support it. (The latest stable gzip doesn't.)
11785
117862004-04-27 Paul Eggert <eggert@twinsun.com>
11787
11788 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
11789 case, as stos_ is now used by destructors due to the 2004-02-09
11790 change.
11791
11792 Remove more K&R C support.
11793 * lib/libiberty.y (PARAMS): Remove. All uses removed.
11794 * lib/subpipe.c (errno): Remove decl.
11795 Include <stdlib.h> unconditionally.
11796 (EXIT_FAILURE): Remove macro.
11797 * src/complain.c (vfprintf, strerror): Remove.
11798 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
11799 unconditionally.
11800 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
11801 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
11802 (strchr, strspn, memchr): Remove decls.
11803 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
11804 unconditionally. Do not declare perror.
11805 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
11806 unconditionally.
11807
11808 * src/complain.c (_): Remove useless defn, as system.h defines this.
11809
11810 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
11811 with latest obstack.h.
11812 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
11813 to procedure types, as obstack.h now does that for us.
11814 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
11815
11816 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
11817 so that this include file can stand alone.
11818 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
11819 does this now. Include subpipe.h first after config.h, to
11820 test whether it can stand alone.
11821
11822 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
11823 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
11824 unused declaration.
11825
11826 * tests/synclines.at (%union synch line): Put a dummy member in
11827 the union, because empty unions aren't allowed in C. Caught
11828 by GCC 3.4.0.
11829
4f16766c
PE
118302004-04-13 Jim Meyering <jim@meyering.net>
11831
11832 * src/conflicts.c (conflicts_print): Correct format string typo:
11833 use `%%' to produce literal `%'. (trivial change)
11834
779e7ceb
PE
118352004-03-30 Paul Eggert <eggert@twinsun.com>
11836
11837 * src/getargs.c (version): Update copyright year to 2004.
11838
11839 * data/c.m4 (b4_int_type): Use 'short int' rather than
11840 'short', and similarly for 'long', 'unsigned', etc.
11841 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
11842 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
11843 yy_yypstack, yydumpstack): Likewise.
11844 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
11845 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
11846 Likewise.
11847 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
11848 yy_stack_print, yyparse): Likewise.
11849 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
11850 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
11851 * lib/bitset.c (bitset_print): Likewise.
11852 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
11853 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
11854 * lib/bitsetv.c (bitsetv_dump): Likewise.
11855 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
11856 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
11857 Likewise.
11858 * src/LR0.c (allocate_itemsets): Likewise.
11859 * src/gram.h (rule_number, rule): Likewise.
11860 * src/lalr.h (goto_number): Likewise.
11861 * src/nullable.c (nullable_compute): Likewise.
11862 * src/output.c (prepare_rules): Likewise.
11863 * src/relation.c (relation_print, relation_digraph): Likewise.
11864 * src/relation.h (relation_node): Likewise.
11865 * src/state.h (state_number, transitions, errs, reductions,
11866 struct state): Likewise.
11867 * src/symtab.h (symbol_number, struct symbol): Likewise.
11868 * src/tables.c (vector_number, tally, action_number,
11869 default_goto, goto_actions): Likewise.
11870 * tests/existing.at (GNU Cim Grammar): Likewise.
11871 * tests/regression.at (Web2c Actions): Likewise.
11872
11873 * src/output.c (muscle_insert_short_int_table): Renamed from
11874 muscle_insert_short_table. All uses changed.
11875
d6328241
PH
118762004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
11877
11878 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
11879 (declaration): Replace expected_conflicts with expected_sr_conflicts.
11880 Add %expect-rr rule.
4f16766c 11881
d6328241
PH
11882 * src/scan-gram.l: Recognize %expect-rr.
11883
4f16766c 11884 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 11885 expected_conflicts.
4f16766c 11886 (expected_rr_conflicts): Declare.
d6328241
PH
11887
11888 * src/conflicts.c (expected_sr_conflicts): Rename from
11889 expected_conflicts.
11890 (expected_rr_conflicts): Define.
11891 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
11892 for GLR parsers.
11893 Use expected_sr_conflicts in place of expected_conflicts.
11894 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 11895
d6328241 11896 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 11897
1452af69
PE
118982004-03-08 Paul Eggert <eggert@gnu.org>
11899
11900 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 11901 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
11902
11903 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
11904 in lalr1.cc.
11905 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
11906 * src/scan-gram.l (scan_integer): New function.
11907 ({int}): Use it.
11908 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
11909 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
11910 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
11911 Say "long int", not "long", for uniformity with GNU style.
11912
006d217d
PE
119132004-02-25 Paul Eggert <eggert@twinsun.com>
11914
11915 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
11916 compilers. This fixes a problem with Intel's C++ compiler being
11917 chatty, reported by Guido Trentalancia in
161a71f3 11918 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 11919
c2729758
ADL
119202004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
11921
11922 Support %destructor and merge error locations in lalr1.cc.
11923
11924 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
11925 (Parser::stos_): Define unconditionally.
11926 (Parser::destruct_): New method. Generate its body with
11927 b4_yydestruct_generate.
11928 (Parser::error_start_): New attribute.
11929 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
11930 token which are discarded.
11931 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
11932 error_start_ when erroneous token are discarded.
11933 (Parser::parse) <yyerrlab1>: Compute the location of the error
11934 token so that it covers all the discarded tokens.
11935 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
11936 it can be called with `%skeleton "lalr1.cc"', and do that.
11937
dd0e0635
PE
119382004-02-02 Paul Eggert <eggert@twinsun.com>
11939
11940 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
11941 $(top_srcdir)/lib and ../lib. This fixes a bug reported
11942 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
11943 There's no need to mention top_builddir since Automake does that
11944 for us.
11945 (INCLUDES): Remove, as Automake says it's obsolescent.
11946 Contents migrated into AM_CPPFLAGS as described above.
11947 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
11948
119492004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11950
11951 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
11952 (yyreportSyntaxError): Handle case where lookahead token is
11953 YYEMPTY.
11954
be16239b
PH
119552004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11956
11957 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
11958 resulting parsers are compilable with C++.
11959
5fa90832
PE
119602003-12-23 Paul Eggert <eggert@twinsun.com>
11961
11962 * config/depcomp, config/install-sh: Sync with Automake 1.8.
11963 * src/output.c (output_skeleton): Rename local var.
11964 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
11965 Bison tokens, as this runs afoul of the 2003-10-07 change that
11966 disallowed NUL bytes in character constants or string literals.
11967
11968 * tests/local.at: Require Autoconf 2.59's Autotest.
11969 * tests/testsuite.at: Don't include local.at, since we now assume
11970 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
11971 including it.
11972 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
11973 multiple inclusion warnings.
dd0e0635 11974
b165c324
AD
119752003-12-02 Akim Demaille <akim@epita.fr>
11976
11977 * doc/bison.texinfo (How Can I Reset the Parser): More about start
11978 conditions.
11979 From Bruno Haible.
11980
26e06a21
ADL
119812003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
11982
11983 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
11984
92ac3705
PE
119852003-10-07 Paul Eggert <eggert@twinsun.com>
11986
6a5ecb38
PE
11987 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
11988 if testsuite doesn't exist.
11989
92ac3705
PE
11990 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
11991 literals, unfortunately.
11992 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
11993 Complain about NUL bytes in character constants or string literals.
11994
91d2c560
PE
119952003-10-05 Paul Eggert <eggert@twinsun.com>
11996
11997 * NEWS: Don't document %no-default-prec, as it's still
11998 too experimental.
11999 * doc/bison.texinfo: Document %no-default-prec only if
12000 the defaultprec flag is set. Normally it's not.
12001
0cc3da3a
PE
120022003-10-04 Paul Eggert <eggert@twinsun.com>
12003
12004 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
12005 non-modifiable lvalue, instead of a modifiable one.
12006 * doc/bison.texinfo (Actions): Document that $$ can
12007 be assigned to. Do not claim that $$ and $N are
12008 array element references: user code should not rely on this.
12009
22fccf95
PE
120102003-10-01 Paul Eggert <eggert@twinsun.com>
12011
12012 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
12013 (grammar_declaration): Use it.
12014 * src/scan-gram.l: New token %no-default-prec.
12015 * tests/conflicts.at: Revamp tests to use %no-default-prec.
12016 * NEWS, doc/bison.texinfo: Document the above.
12017
fc8f2965
AD
120182003-10-01 Akim Demaille <akim@epita.fr>
12019
12020 VCG no longer supports long_straight_phase.
12021
12022 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
12023 * src/print_graph.c (print_graph): Adjust.
12024
39a06c25
PE
120252003-09-30 Frank Heckenbach <frank@g-n-u.de>
12026 and Paul Eggert <eggert@twinsun.com>
12027
12028 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
12029 Table of Symbols): Document %default-prec.
12030 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
12031 (grammar_declaration): Set default_prec on %default-prec.
12032 * src/scan-gram.l (%default-prec): New token.
12033 * src/reader.h (default_prec): New flag.
12034 * src/reader.c: Likewise.
12035 (packgram): Handle it.
12036 * tests/conflicts.at (%default-prec without %prec,
12037 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 12038
39a06c25
PE
120392003-09-30 Paul Eggert <eggert@twinsun.com>
12040
12041 * tests/testsuite.at: Include local.at, not input.at, fixing
12042 a typo in the 2003-08-25 patch.
12043
62b6aef9
AD
120442003-08-27 Akim Demaille <akim@epita.fr>
12045
12046 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
12047 GCC warnings.
12048
89e1cc61
AD
120492003-08-26 Akim Demaille <akim@epita.fr>
12050
12051 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
12052 "<\#" to avoid magic from Gnus when posting parts of this script.
12053
a08460b0
AD
120542003-08-26 Akim Demaille <akim@epita.fr>
12055
12056 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
12057 (Parser::parse): here.
12058 Adjust: nerrs and errstatus is now replaced by...
12059 (Parser::nerrs_, Parser::errstatus_): New.
12060
603f1cfd
AD
120612003-08-25 Akim Demaille <akim@epita.fr>
12062
12063 * config/announce-gen, Makefile.cfg: New.
12064 * Makefile.am: Adjust.
12065 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
12066 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
12067
cd3684cf
AD
120682003-08-25 Akim Demaille <akim@epita.fr>
12069
12070 When reducing initial empty rules, Bison parser read an initial
12071 location that is not defined. This results in garbage, and that
12072 affects Bison's own parser. Therefore we need (i) to extend Bison
12073 to support a means to initialize this location, and (ii) to use
12074 this CVS Bison to fix CVS Bison's parser.
12075
12076 * src/reader.h, reader.c (epilogue_augment): Remove, replace
12077 with...
12078 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
12079 * src/parse-gram.y: Adjust.
12080 (%initial-action): New.
12081 (%error-verbose): Since we require CVS Bison, there is no reason
12082 not to use it.
12083 * src/scan-gram.l: Adjust.
12084 * src/Makefile.am (YACC): New, to make sure we use our own parser.
12085 * data/yacc.c (yyparse): Use b4_initial_action.
12086
4e03e201
AD
120872003-08-25 Akim Demaille <akim@epita.fr>
12088
12089 * doc/bison.texinfo: Don't promote stdout for error messages.
12090
8c182d05
AD
120912003-08-25 Akim Demaille <akim@epita.fr>
12092
12093 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
12094 From Alexandre Duret-Lutz.
12095
6a60c4cf
PE
120962003-08-25 Akim Demaille <akim@epita.fr>
12097
12098 Version 1.875c.
12099
25f66e1a
AD
121002003-08-25 Akim Demaille <akim@epita.fr>
12101
12102 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
12103 Use them.
12104
5348bfbe
AD
121052003-08-25 Akim Demaille <akim@epita.fr>
12106
12107 * data/lalr1.cc (Parser::reduce_print_): New.
12108 Use it.
12109
47301314
AD
121102003-08-25 Akim Demaille <akim@epita.fr>
12111
12112 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
12113 error recovery loops. This patch is based on
161a71f3 12114 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
12115 Also, augment the similarity between lalr1.cc and yacc.c.
12116 Note: the locations of error recovery rules are not correct yet.
12117
12118 * data/lalr1.cc: Comment changes to augment the similarity between
12119 lalr1.cc and yacc.c.
12120 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
12121 (yyerrlab1): Remove, but where it used to be (now the bottom part of
12122 yyerrlab), when hitting EOF, pop the whole stack here instead of
12123 merely falling thru the default error handling mechanism.
12124 (yyerrorlab): New label, with the old contents of YYERROR,
12125 plus the following change: pop the stack of rhs corresponding
12126 to the production that invoked YYERROR. That is how Yacc
12127 behaves (required by POSIX).
12128 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
12129 fail.
12130
1f7a61ff
AD
121312003-08-25 Akim Demaille <akim@epita.fr>
12132
12133 Tune local.at so that people can "autom4te -l autotest calc.at -o
12134 calc" for instance, to extract a sub test suite.
12135
12136 * tests/testsuite.at: Move the initialization, Autotest version
12137 requirement, and AT_TESTED invocation into...
12138 * tests/local.at: here.
12139 * tests/testsuite.at: Include it for compatibility with Autoconf
12140 2.57.
12141 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
12142 be ignore.
12143
327b5b56
PE
121442003-08-04 Paul Eggert <eggert@twinsun.com>
12145
12146 Rework code slightly to avoid gcc -Wtraditional warnings.
12147 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
12148 The returned value is now stored in *YY0. All callers changed.
12149 * src/output.c (merge_output): Adjust to the above change.
12150
0051e3ed
PE
121512003-07-26 Paul Eggert <eggert@twinsun.com>
12152
12153 * data/glr.c (YYASSERT): New macro.
12154 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
12155 yyresolveStates, yyprocessOneStack):
12156 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
12157 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 12158
137437c6
PE
121592003-07-25 Paul Eggert <eggert@twinsun.com>
12160
5b620e06
PE
12161 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
12162 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 12163 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
12164 by Frank Heckenbach, though I have omitted the structure-initialization
12165 part of his glr-knr.diff patch since I recall that the Portable
12166 C Compiler didn't require that change.
12167
137437c6
PE
12168 Let the user specify how to allocate and free memory.
12169 Derived from a suggestion by Frank Heckenbach in
161a71f3 12170 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
12171 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
12172 All uses of free, malloc, realloc changed to use these macros,
12173 and unnecessary casts removed.
12174 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
12175
ddb85ca5
PE
121762003-07-06 Matthias Mann <MatthiasMann@gmx.de>
12177
12178 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
12179 use s.empty() rather than s == "" to test for empty string; see
161a71f3 12180 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
12181 (trivial change)
12182
39910e09
AD
121832003-06-25 Akim Demaille <akim@epita.fr>
12184
12185 * config/depcomp, config/install-sh: Update from masters.
12186
0ae99356
PE
121872003-06-20 Paul Eggert <eggert@twinsun.com>
12188
12189 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
12190 and return properly parenthesized result.
12191 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
12192 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
12193 Remove unnecessary parentheses from uses.
12194 * doc/bison.texinfo (Location Default Action): Describe the
12195 conventions for parentheses.
12196
cd05d13c
PE
121972003-06-19 Paul Eggert <eggert@twinsun.com>
12198
81fd08ca
PE
12199 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
12200 yyreportTree): Do not assume that size_t is the same width as int,
12201 when printing sizes. Print sizes using an unsigned format.
12202 Problem reported by Frank Heckenbach in
161a71f3 12203 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 12204
cd05d13c
PE
12205 Port to Forte Developer 7 C compiler.
12206 * data/glr.c (struct YYLTYPE): If locations are not being used,
12207 declare a single dummy member, as empty structs do not conform
12208 to the C standard.
12209 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
12210 the Forte Developer 7 C compiler complains that end-of-loop
12211 code is not reached.
12212
4dcf140b
PE
122132003-06-17 Paul Eggert <eggert@twinsun.com>
12214
12215 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
12216 avoid warnings from picky compilers about redefinition of PARAMS.
12217
8dd76bee
PE
122182003-06-17 Paul Eggert <eggert@twinsun.com>
12219
12220 Version 1.875b.
12221
12222 * NEWS: Document 1.875b.
12223
12224 * lib/bbitset.h: Do not include config.h; that's the includer's job.
12225 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
12226 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
12227 Don't use 'index' in comments, as it's a builtin fn on some hosts.
12228 * lib/bitset_stats.c: Include gettext.h unconditionally, as
12229 per recent gettext manual's suggestion.
12230 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
12231 Use prototypes, not old-style definitions.
12232 * lib/lbitset.c (lbitset_unused_clear): Likewise.
12233 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
12234 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
12235 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
12236 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
12237 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
12238 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
12239 vbitset_or_and_cmp, vbitset_copy): Likewise.
12240
12241 * lib/libiberty.h: Do not include config.h; that's the includer's job.
12242 Do not include <stdlib.h>.
12243 (PARAMS): Define unconditionally for C89.
12244 (ATTRIBUTE_NORETURN): Remove.
12245 (ATTRIBUTE_UNUSED): Define unconditionally.
12246
12247 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 12248 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
12249 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
12250 * lib/vbitset.c, lib/vbitset.h: New files.
12251 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
12252 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
12253 from libbitset.
12254
12255 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
12256 `How Can I Reset @code{yyparse}', since texinfo does not allow
12257 arbitrary @ in node names.
12258
12259 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
12260 shouldn't be needed according to the gettext 0.12.1 documentation
12261 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 12262 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 12263 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 12264 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 12265
8dd76bee
PE
12266 * lib/.cvsignore: Add stdbool.h.
12267 * m4/.cvsignore: Add nls.m4, po.m4.
12268
12269 Upgrade to CVS gnulib.
12270 * stdbool_.h: File renamed from stdbool.h.in.
12271 * configure.ac (AM_STDBOOL_H): Invoke this instead of
12272 AC_HEADER_STDBOOL.
12273 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
12274 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
12275 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
12276 (MOSTLYCLEANFILES): New var.
12277 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
12278 (stdbool.h): New rule.
12279 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
12280 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
12281 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
12282 m4/quote.m4: Upgrade to today's gnulib.
12283
12284 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
12285 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
12286 the tests right now.
12287 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
12288 yyerror are declared before use; C99 requires this.
12289
25005f6a
PH
122902003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12291
12292 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
12293 first.
12294 (yyrecoverSyntaxError): Correct the logic for setting and testing
12295 yyerrState.
12296 Correct comment on handling EOF.
12297 Allow states with only a default reduction, rather than failing
8dd76bee 12298 (I can't quite reconstruct why these were not allowed before).
25005f6a 12299
137437c6 12300 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 12301 buffer overruns, corrupting state.
8dd76bee
PE
12302
12303 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
12304 definition.
12305 * src/reader.h (max_left_semantic_context): New variable declaration.
12306 * src/scan-gram.l (max_left_semantic_context): Define.
12307 (handle_action_dollar): Update max_left_semantic_context.
12308 * data/glr.c (YYMAXLEFT): New definition.
12309 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
12310 (yyresolveAction): Ditto.
12311
12312 Fixes to problems with location handling in GLR parsers reported by
12313 Frank Heckenbach (2003/06/05).
12314
12315 * data/glr.c (YYLTYPE): Make trivial if locations not used.
12316 (YYRHSLOC): Add parentheses, and define only if locations used.
12317 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
12318 locations not used.
12319 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
12320 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 12321
25005f6a
PH
12322 * tests/cxx-type.at: Exercise location information; update tests
12323 to differentiate output with and without locations.
8dd76bee 12324 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
12325 because default YYLTYPE not yet defined.
12326 Change semantic actions to compute strings, rather than printing
12327 them directly (to test proper passing of semantics values). Change
12328 output to prefix notation and update test data and expected results.
12329 (yylex): Track locations.
12330 (stmtMerge): Return value rather than printing, and include arguments
12331 in value.
8dd76bee 12332
711f40b7
PE
123332003-06-03 Paul Eggert <eggert@twinsun.com>
12334
12335 Avoid warnings generated by GCC 2.95.4 when Bison is
12336 configured with --enable-gcc-warnings.
12337 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
12338 yy::]b4_parser_class_name[::translate_,
12339 yy::Stack::operator[] (unsigned),
12340 yy::Stack::operator[] (unsigned) const,
12341 yy::Slice::operator[] (unsigned),
12342 yy::Slice::operator[] (unsigned) const):
12343 Rename local vars to avoid warnings.
12344 * tests/glr-regression.at (Improper handling of embedded actions
12345 and $-N in GLR parsers): Remove unused local variable from yylex.
12346 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
12347 (void) as arg when not pure, since we now assume C89 when building
12348 Bison. Pacify GCC by using parameter.
12349
ac695f7d
PE
123502003-06-02 Paul Eggert <eggert@twinsun.com>
12351
12352 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
12353 yy::Location::lines, yy::Location::columns): Rename arguments
12354 to avoid shadowing; this removes a warning generated by GCC 3.3.
12355
26ec81e0
PE
123562003-06-01 Paul Eggert <eggert@twinsun.com>
12357
12358 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
12359 to g++, as GCC 3.3 complains if you do it.
12360 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
12361 everything that WARNING_CFLAGS has, except omit warnings
12362 not suitable for C++.
12363 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
12364 * tests/atlocal.in (CXXFLAGS): New var.
12365 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
12366
12367 Fix a GLR parser bug I reported in February; see
161a71f3 12368 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
12369 The problem was that GLR parsers did not conform to the C standard,
12370 because actions like { $1 = $2 + $3; } expanded to expressions
12371 that invoked YYFILL in separate subexpressions, and YYFILL assigned
12372 to a local variable. The C standard says that expressions
12373 like (var = f ()) + (var = f ()) have undefined behavior.
12374 Another problem was that GCC sometimes issues warnings that
12375 yyfill and its parameters are unused.
12376
12377 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
12378 as possibly unused.
12379 (yyfill): New function.
12380 (YYFILL): Use it.
12381 (yyuserAction): Change type of yynormal to bool, so that it matches
12382 the new yyfill signature. Mark it as possibly unused.
12383
12384
12385 Follow up on a bug I reported in February, where a Bison-generated
12386 parser can loop. Provide a test case and a fix for yacc.c. I
12387 don't have a fix for lalr1.cc or for glr.c, unfortunately.
12388 The original bug report is in:
161a71f3 12389 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
12390
12391 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
12392 macro's size was becoming unwieldy.
12393 (yyerrlab): Do not discard an empty lookahead symbol, as this
12394 might destroy garbage.
12395 (yyerrorlab): New label, with the old contents of YYERROR,
12396 plus the following change: pop the stack of rhs corresponding
12397 to the production that invoked YYERROR. That is how Yacc
12398 behaves, and POSIX requires this behavior.
12399 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
12400 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
12401 Define 'alarm' to do nothing if unistd.h is not available.
12402 Add a new rule "exp: '-' error;" to test the above change to
12403 data/yacc.c. Use 'alarm' to abort any test taking longer than
12404 10 seconds, as it's probably looping.
12405 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
12406 Also, the new yacc.c generates two fewer diagnostics for an
12407 existing test.
12408
d0829076
PE
124092003-05-24 Paul Eggert <eggert@twinsun.com>
12410
c6ae27df
PE
12411 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
12412 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
12413 This fixes a problem reported by John Bowman when the Compaq/HP
12414 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
12415 -ansi -Wall -gall).
12416 * data/yacc.c (union yyalloc): Likewise.
12417 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 12418
d0829076
PE
12419 Switch from 'int' to 'bool' where that makes sense.
12420
12421 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
12422 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
12423 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
12424 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
12425 Return or accept bool, not int. All callers changed.
12426 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
12427 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
12428 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
12429 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
12430 bitset_or_and_cmp_): Likewise.
12431 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
12432 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
12433 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
12434 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
12435 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
12436 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
12437 bitset_stats_or_and_cmp): Likewise.
12438 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
12439 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
12440 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
12441 ebitset_xor_cmp): Likewise.
12442 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
12443 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
12444 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
12445 lbitset_xor_cmp): Likewise.
12446 * lib/bbitset.h: Include <stdbool.h>.
12447 (struct bitset_vtable): The following members now return bool, not
12448 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
12449 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
12450 or_and_cmp).
12451 * src/conflicts.c (count_rr_conflicts): Likewise.
12452 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
12453 All uses changed.
12454 * lib/ebitset.c (ebitset_obstack_init): Likewise.
12455 * lib/lbitset.c (lbitset_obstack_init): Likewise.
12456 * src/getargs.c (debug_flag, defines_flag, locations_flag,
12457 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
12458 graph_flag): Likewise.
12459 * src/getargs.h (debug_flag, defines_flag, locations_flag,
12460 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
12461 graph_flag): Likewise.
12462 * src/output.c (error_verbose): Likewise.
12463 * src/output.h (error_verbose): Likewise.
12464 * src/reader.c (start_flag, typed): Likewise.
12465 * src/reader.h (typed): Likewise.
12466 * src/getargs.c (LOCATIONS_OPTION): New constant.
12467 (long_options, getargs): Use it.
12468 * src/lalr.c (build_relations): Use bool, not int.
12469 * src/nullable.c (nullable_compute): Likewise.
12470 * src/print.c (print_reductions): Likewise.
12471 * src/tables.c (action_row, pack_vector): Likewise.
12472 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
12473 * src/output.c (prepare): Use it.
12474 * src/output.c (token_definitions_output,
12475 symbol_destructors_output, symbol_destructors_output): Use string,
12476 not boolean integer, to keep track of whether to output separator.
12477 * src/print_graph.c (print_core): Likewise.
12478 * src/state.c (state_rule_lookaheads_print): Likewise.
12479
12480 * config/install-sh: Sync from automake 1.7.5.
12481
6b2584b7
PE
124822003-05-14 Paul Eggert <eggert@twinsun.com>
12483
12484 * src/parse-gram.y (rules_or_grammar_declaration): Require a
12485 semicolon after a grammar declaration, in the interest of possible
12486 future changes to the Bison input language.
12487 Do not allow a stray semicolon at the start of the grammar.
12488 (rhses.1): Allow one or more semicolons after any rule, including
12489 just before "|" as required by POSIX.
12490 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
12491 grammar.
12492
caf37a36
ADL
124932003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
12494
12495 %parse-param support for lalr1.cc.
12496
12497 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
12498 b4_cc_constructor_calls, b4_cc_constructor_call,
12499 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
12500 definitions.
12501 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
12502 parse-param arguments.
12503 (yy::b4_parser_class_name): Declare instance variables to
12504 hold parse-param arguments.
12505 * tests/calc.at: s/value/semantic_value/ because value clashes
12506 with a member of yy::b4_parser_class_name. Adjust C++ code
12507 to handle %parse-param. Enable %parse-param test in C++.
12508
3ab37077
PE
125092003-05-12 Paul Eggert <eggert@twinsun.com>
12510
12511 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
12512 English a bit. Fix fclose typo. Change "const char" to "char
12513 const", and use ANSI C rather than K&R for "main". Suggest
12514 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
12515 and suggest yy_switch_to_buffer.
12516
125172003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
12518
12519 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
12520 C89. This avoids a diagnostic on compilers that define __STDC__
12521 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 12522 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 12523
e743727f
PE
125242003-05-03 Paul Eggert <eggert@twinsun.com>
12525
12526 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
12527 Do not overrun array bounds.
12528 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 12529 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 12530
916708d5
AD
125312003-04-29 Akim Demaille <akim@epita.fr>
12532
12533 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
12534 * src/getargs.c, src/getargs.h: here, as bool, not int.
12535 (nondeterministic_parser): New.
12536 * src/parse-gram.y, src/scan-gram.l: Support
12537 %nondeterministic-parser.
12538 * src/output.c (prepare): Use nondeterministic_parser instead
12539 of glr_parser where appropriate.
12540 * src/tables.c (conflict_row, action_row, save_row)
12541 (token_actions, token_actions, pack_vector): Ditto.
12542
a06ea4aa
AD
125432003-04-29 Akim Demaille <akim@epita.fr>
12544
12545 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
12546
211074ca
AD
125472003-04-29 Akim Demaille <akim@epita.fr>
12548
12549 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
12550 with %pure-parser and %locations to exercise the patch from Yakov
12551 Markovitch below.
12552
6175ffe3
PE
125532003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
12554
12555 * data/yacc.c: (b4_lex_param): Corrected for the case where
12556 %lex-param is provided and %pure-parser isn't.
12557
b1e95857
PE
125582003-04-27 Paul Eggert <eggert@twinsun.com>
12559
12560 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 12561 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
12562 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
12563 if it is not defined.
12564 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
12565
acda9df6
PE
125662003-04-26 Paul Eggert <eggert@twinsun.com>
12567
3470c57b
PE
12568 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
12569 Declare to be of type suitable for the ninf value itself, not of
12570 type suitable for the corresponding table, since the latter might
12571 be unsigned but the ninf value might be negative. This fixes a
12572 bug reported by Alexandre Duret-Lutz in
161a71f3 12573 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 12574
acda9df6
PE
12575 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
12576 invokes it. We shouldn't invoke it twice because it will attempt
12577 to put error.o in the archive twice. This fixes a glitch reported
12578 by Martin Mokrejs in
161a71f3 12579 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 12580
b5250f26
PE
125812003-04-21 Paul Eggert <eggert@twinsun.com>
12582
12583 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
12584 to gnulib.
12585
089ac0f1
PE
125862003-04-21 Yakov Markovitch <Markovitch@iso.ru>
12587
12588 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
12589 Fix obvious typo that results in uncompilable GLR parsers
12590 when both %pure-parser and %locations are used. (trivial change)
12591
5ededac6
PE
125922003-04-17 Paul Eggert <eggert@twinsun.com>
12593
1b8f2fff
PE
12594 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
12595 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
12596 Do not insert the expected token via unput, as this runs afoul
12597 of a POSIX-compatibility bug in flex 2.5.31.
12598 All uses changed to BEGIN the parent state,
12599 since we no longer insert the expected token via unput.
12600 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
12601 that is no longer emitted after the above change.
12602
5ededac6
PE
12603 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
12604 the first one. This change is from Paul Hilfinger, and it fixes
12605 regression reported by Werner Lemberg in
161a71f3 12606 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
12607
12608 (resolve_sr_conflict): Don't invoke state_errs_set
12609 unless one or more tokens have been explicitly made errors.
12610 Otherwise, the above change causes Bison to abort.
12611
12612 * tests/existing.at (GNU pic Grammar): New test case, taken from
12613 Lemberg's email.
12614
b8be9132
AD
126152003-03-31 Akim Demaille <akim@epita.fr>
12616
12617 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
12618
d423d460
AD
126192003-03-31 Akim Demaille <akim@epita.fr>
12620
12621 * src/output.c (prepare_symbols): Avoid trailing spaces in the
12622 output.
12623
c7e441b4
AD
126242003-03-31 Akim Demaille <akim@epita.fr>
12625
12626 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
12627 From Paul Hilfinger.
12628
231897ad
AD
126292003-03-29 Akim Demaille <akim@epita.fr>
12630
12631 * m4/error.m4: Do not put under dynamic conditions some code which
12632 expansion is under static control.
12633
5b066063
AD
126342003-03-29 Akim Demaille <akim@epita.fr>
12635
12636 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
12637
22a74fec
AD
126382003-03-29 Akim Demaille <akim@epita.fr>
12639
12640 * doc/bison.texinfo (Strings are Destroyed): New.
12641
0eee27e7
PE
126422003-03-13 Paul Eggert <eggert@twinsun.com>
12643
12644 * .cvsignore: Add configure.lineno.
12645 * src/.cvsignore: Add yacc.
12646 * tests/.cvsignore: Add testsuite.log.
12647 * doc/fdl.texi: Sync with latest FSF version.
12648
f61aad93
PE
126492003-03-12 Paul Eggert <eggert@twinsun.com>
12650
537636c7
PE
12651 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
12652 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
12653 cursor, instead of leaving it undefined. This fixes a bug
12654 reported by Tim Van Holder in
161a71f3 12655 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
12656 * tests/input.at (Torturing the Scanner): Test the scanner on
12657 an empty input file, which was Tim Van Holder's test case.
12658
12659 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
12660 <sys/resource.h> can be included, include sys/time.h and
12661 sys/times.h first, if available. This works around the SunOS
12662 4.1.4 porting bug reported by Bruce Becker in
161a71f3 12663 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
12664
12665 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
12666 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
12667 AC_HEADER_SYS_WAIT.
12668
f61aad93
PE
12669 Merge changes from gnulib. This was prompted because the CVS
12670 snapshot didn't build on Solaris 7 due to strnlen problems.
12671
12672 These changes need to be merged back into gnulib:
12673 * lib/hash.c: Include <stdbool.h> unconditionally.
12674 * m4/onceonly.m4 (m4_quote): New macro.
12675 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
12676 Quote AC_FOREACH variable-expansions properly.
12677 The 2003-01-03 obstack.h change also needs merging.
12678 {end of changes requiring merging}
5b066063 12679
f61aad93
PE
12680 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
12681 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
12682 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
12683 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
12684 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
12685 New files, imported from gnulib.
12686 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
12687 above.
12688
12689 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
12690 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
12691 gnulib sources.
12692
12693 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
12694 Add.
12695 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
12696 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
12697 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
12698 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
12699 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
12700 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
12701 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
12702 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
12703 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
12704 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
12705 (jm_PREREQ_ARGMATCH): Remove.
12706 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
12707 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
12708
12709 * src/system.h: Include <stdbool.h> unconditionally.
12710
12711 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
12712 assuming at least C89 in the bitset code for some time now.
12713
d2ffe116
AD
127142003-03-03 Akim Demaille <akim@epita.fr>
12715
12716 * ro.po: New.
12717
052826fd
AD
127182003-03-02 Akim Demaille <akim@epita.fr>
12719
12720 * doc/bison.texinfo (Table of Symbols): Reactivate the
12721 documentation for %lex-param, and %parse-param.
12722
c4749565
AD
127232003-03-02 Akim Demaille <akim@epita.fr>
12724
12725 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
12726 generate verbose error messages.
12727 Use the number of tokens as an upper bound in yytname, as it
12728 cannot be a non terminal.
12729
d5286af1
AD
127302003-03-02 Akim Demaille <akim@epita.fr>
12731
12732 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
12733 message.
12734
22e304a6
AD
127352003-03-02 Akim Demaille <akim@epita.fr>
12736
22e304a6
AD
12737 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
12738 Use them to exercise yycheck overrun.
12739 Based on Andrew Suffield's grammar.
12740
67a25fed
AD
127412003-03-02 Akim Demaille <akim@epita.fr>
12742
12743 Create tests/local.at for Bison generic testing macros.
12744
12745 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
12746 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
12747 This new file.
12748 * tests/calc.at (AT_CHECK_CALC): Adjust.
12749 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
12750 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
12751 * tests/local.at: here.
12752 (AT_COMPILE_CXX): Tags the tests using it as c++.
12753 Ignore the test if CXX is not functional.
12754
9c2b381f
PE
127552003-03-01 Paul Eggert <eggert@twinsun.com>
12756
12757 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
12758 not loc->end, since loc->end might contain garbage and this leads
12759 to undefined behavior on some platforms.
12760 (id_loc, token_start): Use (IF_LINTed) initial values that do not
12761 depend on *loc, so that the reader doesn't give the the false
12762 impression that *loc is initialized.
12763 (<INITIAL>"%%"): Do not bother setting code_start, since its value
12764 does not survive the return.
12765
0433ba88
AD
127662003-03-01 Akim Demaille <akim@epita.fr>
12767
12768 * src/scan-gram.l (code_start): Always initialize it when entering
12769 into yylex, as SC_EPILOGUE is activated *before* the corresponding
12770 yylex invocation. An alternative would be making it static, but
12771 then it starts with the second %%'s beginning, instead of its end.
12772
b305ea69
PE
127732003-02-28 Paul Eggert <eggert@twinsun.com>
12774
12775 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
12776 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 12777 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 12778
c3d25e01
PE
127792003-02-26 Paul Eggert <eggert@twinsun.com>
12780
12781 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
12782 Remove Sequent/Pyramid discussion (nobody uses them any more).
12783 Merge VMS and MS-DOS discussion; these ports may well be dead
12784 but let's keep mentioning them for now. Put <> around email
12785 addresses. Add copyright notice.
12786
c267ffbc
PE
127872003-02-24 Paul Eggert <eggert@twinsun.com>
12788
12789 * data/glr.c (yy_reduce_print): yylineno -> yylno,
12790 to avoid collision with flex use of yylineno.
12791 Problem reported by Bruce Lilly in
161a71f3 12792 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
12793 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
12794 * data/yacc.c (yy_reduce_print): Likewise.
12795
12796 * config/depcomp: Sync with Automake 1.7.3.
12797
f939fc12
AD
127982003-02-21 Akim Demaille <akim@epita.fr>
12799
12800 * data/lalr1.cc: Use temporary variables instead of casts to
12801 change integer types.
12802 Suggested by Paul Eggert.
12803
95923bd6
AD
128042003-02-21 Akim Demaille <akim@epita.fr>
12805
12806 * doc/bison.texinfo: Use "location" consistently to refer to @n,
12807 to avoid confusions with lalr1.cc's notion of Position.
12808 Suggested by Paul Eggert.
12809
2cdc240e
AD
128102003-02-20 Akim Demaille <akim@epita.fr>
12811
12812 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
12813 before initial_columns.
12814 (location.hh): Use consistent variable names when defining the
12815 operator<<.
12816 Use "last" so that we subtract from Positions, not from unsigned.
12817
5d003116
AD
128182003-02-20 Akim Demaille <akim@epita.fr>
12819
12820 * data/lalr1.cc (position.hh): New subfile, including the extended
12821 and Doxygen'ed documentation of class Position.
12822 (location.hh): Use it.
12823 Document a` la Doxygen.
ba1ecc07 12824 With the help of Benoit Perrot.
5d003116 12825
d02b25f9
AD
128262003-02-20 Akim Demaille <akim@epita.fr>
12827
12828 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
12829 AT_YACC_IF.
12830 Redefine AT_YYERROR_SEES_LOC_IF using it.
12831 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
12832 not defined.
12833 Don't use the location in yy::Parser::error_ and
12834 yy::Parser::print_ when not %locations.
12835 Activate more lalr1.cc tests.
12836
0d1c3a04
AD
128372003-02-19 Akim Demaille <akim@epita.fr>
12838
12839 * data/lalr1.cc: When displaying a line number, be sure to make it
12840 an int.
12841
60a777aa
AD
128422003-02-19 Akim Demaille <akim@epita.fr>
12843
12844 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
12845 Remove, useless.
12846 (YYABORT, YYACCEPT, YYERROR): New.
12847 * tests/calc.at: Renable the lalr1.cc test.
12848
0b86fc41
AD
128492003-02-19 Akim Demaille <akim@epita.fr>
12850
12851 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
12852 error recovery, mixing with/without pops and discarding of the
12853 lookahead.
12854 Exercise YYERROR.
12855 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
12856
da99a5dc
PE
128572003-02-17 Paul Eggert <eggert@twinsun.com>
12858
12859 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
12860 * tests/testsuite.at (AT_COMPILE): Use them.
12861 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 12862 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 12863
93b8c255
PE
128642003-02-12 Paul Eggert <eggert@twinsun.com>
12865
12866 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
12867 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 12868 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
12869 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
12870 Check for malloc failure, for consistency with yacc.c.
12871 (yytname_size): Remove, for consistency with yacc.c.
12872
12873 The bug still remains in data/lalr1.cc, as I didn't have time
12874 to fix it there.
12875
7548fed2
AD
128762003-02-06 Akim Demaille <akim@epita.fr>
12877
12878 * configure.ac (GXX): Rename as...
12879 (CXX): this, to keep the original Autoconf semantics.
12880 Require 2.57.
12881 * data/lalr1.cc: Fix b4_copyright invocations.
12882 If YYDEBUG is not defined, don't depend upon name_ being defined.
12883 (location.hh): Include string and iostream.
12884 (Position::filename): New member.
12885 (Position::Position ()): New.
12886 (operator<< (Position)): New.
12887 (operator- (Position, int)): New.
12888 (Location::first, Location::last): Rename as...
12889 (Location::begin, Location::end): these, to mock the conventional
12890 iterator names.
12891 (operator<< (Location)): New.
12892 * tests/atlocal.in (CXX): New.
12893 * tests/testsuite.at (AT_COMPILE_CXX): New.
12894 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
12895 locations in a more synthetic way.
12896 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
12897 lalr1.cc is used.
12898 Adjust the C locations to match those from Emacs: first column is
12899 column 0.
12900 Change all the expected results.
12901 Conform to the GCS: simplify the locations when applicable.
12902 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
12903 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
12904 these CPP macros with the m4 macros new defined by...
12905 (AT_CHECK_PUSHDEFS): this, i.e.:
12906 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 12907 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
12908 New macros.
12909 (AT_CHECK_POPDEFS): Undefine them.
12910 (AT_CHECK_CALC_LALR1_CC): New.
12911 Use it for the first lalr1.cc test.
12912
43a176ef
AD
129132003-02-04 Akim Demaille <akim@epita.fr>
12914
12915 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
12916 Location as is defined.
12917
fc049e9c
AD
129182003-02-04 Akim Demaille <akim@epita.fr>
12919
12920 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
12921 name_ being defined.
12922
a737b216
PE
129232003-02-03 Paul Eggert <eggert@twinsun.com>
12924
12925 * src/gram.h (start_symbol): Remove unused decl.
12926
12927 Use more-consistent naming conventions for local vars.
12928
12929 * src/derives.c (derives_compute): Change type of local var from
12930 int to rule_number.
12931 * src/gram.c (grammar_rules_partial_print): Likewise.
12932 * src/print.c (print_core): Likewise.
12933 * src/reduce.c (reduce_grammar_tables): Likewise.
12934
12935 * src/gram.c (grammar_dump): Change name of item_number *
12936 local var from r to rp.
12937 * src/nullable.c (nullable_compute): Likewise.
12938
12939 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
12940
12941 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
12942 for symbol or symbol_number var.
12943 * src/reader.c (grammar_start_symbol_set): Likewise.
12944 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
12945 Likewise.
12946 * src/state.c (transitions_to): Likewise.
12947 * src/state.h: Likewise.
12948 * src/tables.c (symbol_number_to_vector_number): Likewise.
12949
12950 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
12951 char * var.
12952
12953 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
12954 var.
12955
12956 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
12957 var.
12958
12959 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
12960 Use str, not s, for char * var. Use ch, not c, for character var.
12961 Use size for size var.
12962
12963 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
12964 char * var.
12965 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
12966 uniqstr var.
12967 * src/uniqstr.h: Likewise.
12968
12969 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
12970 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
12971 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
12972 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
12973 param to have same name as that of enum, so that we don't use
12974 "s" to stand for a non-state.
12975
68e93ad5
AD
129762003-02-02 Akim Demaille <akim@epita.fr>
12977
12978 * src/scan-skel.l: Scan more than one inert character per yylex
12979 invocation.
12980
92898986
PE
129812003-02-01 Paul Eggert <eggert@twinsun.com>
12982
12983 Version 1.875a.
12984
1d9d5d71
PE
12985 * po/LINGUAS: Add ms.
12986
0435d061
AD
129872003-01-30 Akim Demaille <akim@epita.fr>
12988
12989 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
12990
6029a57f
PH
129912003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12992
12993 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
12994 of $1.
0435d061
AD
12995
12996 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 12997 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 12998 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 12999
6029a57f
PH
13000 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
13001 (b4_rhs_location): Ditto.
0435d061 13002 (yyfill): New function to copy from stack tree into array
6029a57f 13003 incrementally.
0435d061
AD
13004 (yyuserAction): Modify to allow incremental move of semantic values
13005 to rhs array when in GLR mode.
13006 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
13007 as needed.
13008 Remove dummy use of yystack, as there is now a guaranteed use.
13009 (yydoAction): Modify to allow incremental move of semantic values
13010 to rhs array when in GLR mode.
13011 (yyresolveAction): Ditto.
13012 (yyglrShiftDefer): Update comment.
0435d061 13013 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
13014 (yyglrReduce): Ditto.
13015 (yydoAction): Ditto
0435d061 13016
6029a57f
PH
13017 * tests/glr-regr1.at: Rename to ...
13018 * tests/glr-regression.at: Add new regression test for the problems
13019 described above (adapted from S. Eken).
13020 Update copyright notice.
13021 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
13022 * tests/Makefile.am: Ditto.
13023
6cee6297
PE
130242003-01-28 Paul Eggert <eggert@twinsun.com>
13025
13026 * data/lalr1.cc: Do not use @output_header_name@ unless
13027 b4_defines_flag is set. This fixes two bugs reported by
13028 Tim Van Holder in
161a71f3
PE
13029 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
13030 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 13031
b2a836b5
PE
130322003-01-21 Paul Eggert <eggert@twinsun.com>
13033
13034 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
13035 we don't need to worry about yyerrlab1 being reported as an
13036 "unused label" by non-GCC C compilers. The downside is that if
13037 locations are used then a couple of statements are duplicated each
13038 time YYERROR is invoked, but the upside is that the warnings
13039 should vanish.
13040 (yyerrlab1): Move code to YERROR.
13041 (yyerrlab2): Remove. Change uses back to yyerrlab1.
13042 This reverts some of the 2002-12-27 change.
13043
4196b931
PE
130442003-01-17 Paul Eggert <eggert@twinsun.com>
13045
13046 * src/output.c (symbol_printers_output): Fix typo that led
13047 to core dump. Problem reported by Antonio Rus in
161a71f3 13048 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 13049
3ae831b4
AD
130502003-01-13 Akim Demaille <akim@epita.fr>,
13051 Quoc Peyrot <chojin@lrde.epita.fr>,
13052 Robert Anisko <anisko_r@lrde.epita.fr>
13053
13054 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
13055 when the stacks contain one element, as the loop would otherwise
13056 free the last state, and then use the top state (the one we just
13057 popped). This means that the initial elements will not be freed
13058 explicitly, as is the case in yacc.c; it is not a problem, as
13059 these elements have fake values.
13060
e3aa65c5
PE
130612003-01-11 Paul Eggert <eggert@twinsun.com>
13062
13063 * NEWS: %expect-violations are now just warnings, reverting
13064 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
13065 bootstrapping problem reported by Matthias Klose; see
161a71f3 13066 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
13067 * src/conflicts.c (conflicts_print): Likewise.
13068 * tests/conflicts.at (%expect not enough, %expect too much,
13069 %expect with reduce conflicts): Likewise.
13070 * doc/bison.texinfo (Expect Decl): Document this. Also mention
13071 that the warning is enabled if the number of conflicts changes
13072 (not necessarily increases).
13073
13074 * src/getargs.c (version): Update copyright year.
13075
f0057011
AD
130762003-01-09 Akim Demaille <akim@epita.fr>
13077
13078 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
13079
1ee6d2a0
PE
130802003-01-08 Paul Eggert <eggert@twinsun.com>
13081
13082 * Makefile.maint (WGETFLAGS):
13083 New macro, containing "-C off" to disable proxy caches.
13084 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
13085 (rel-check): Use $(WGET) instead of wget.
13086
d4fd77c4
PE
130872003-01-06 Paul Eggert <eggert@twinsun.com>
13088
13089 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
13090 the GLR paper of Scott, Johnstone and Hussain.
13091
464c6927
PE
130922003-01-04 Paul Eggert <eggert@twinsun.com>
13093
d600ee67
PE
13094 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
13095 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
13096 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
13097 (EXTRA_LIBRARIES): New var, for liby.a.
13098 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
13099 (EXTRA_SCRIPTS): New var, for yacc.
13100
464c6927
PE
13101 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
13102 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
13103 Problem reported by Nelson H. F. Beebe.
13104
131052003-01-03 Paul Eggert <eggert@twinsun.com>
13106
13107 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
13108 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
13109 when compiling Bison 1.875's `bitset bset = obstack_alloc
13110 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
13111
13112 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
13113 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
13114 grow to a huge size with typical invocation.
d600ee67 13115
464c6927
PE
13116 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
13117 Use the pattern recommended by Autoconf 2.57, except also protect
13118 against double-definition.
13119 * src/system.h: Likewise.
13120 Portability issues reported by Nelson H. F. Beebe.
d600ee67 13121
464c6927
PE
13122 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
13123 All uses changed. Provide a definition in both C and C++.
13124 (yytrue, yyfalse): Define even if defined (__cplusplus).
13125
13126 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
13127 Reported by Nelson H. F. Beebe.
d600ee67 13128
464c6927
PE
13129 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
13130
0f42c7d5
PE
131312003-01-02 Paul Eggert <eggert@twinsun.com>
13132
13133 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
13134 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
13135 Bug reported by Nelson H. F. Beebe.
13136
dc546b0f
PE
131372003-01-01 Paul Eggert <eggert@twinsun.com>
13138
13139 * Version 1.875.
13140
2c09b6a7
PE
131412002-12-30 Paul Eggert <eggert@twinsun.com>
13142
13143 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
13144 Moved here from...
13145 (<INITIAL>","): Here. This causes stray "," to be treated
13146 more uniformly.
13147
dc546b0f 13148 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
13149 last brace in braced code when not in Yacc mode, for compatibility
13150 with Bison 1.35. This resurrects the 2001-12-15 patch to
13151 src/reader.c.
13152
13153 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
13154 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
13155
535c0f63
PE
131562002-12-28 Paul Eggert <eggert@twinsun.com>
13157
13158 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
13159 that of SYM's type. This fixes Debian bug 168069, reported by
13160 Thomas Olsson.
d600ee67 13161
963fcc17
PE
131622002-12-28 Paul Eggert <eggert@twinsun.com>
13163
13164 Version 1.75f.
13165
13166 Switch back to the Yacc style of conflict reports, undoing some
13167 of the 2002-07-30 change.
13168 * doc/bison.texinfo (Understanding): Use Yacc style for
13169 conflict reports. Also, use new way of locating rules.
13170 * src/conflicts.c (conflict_report):
13171 Renamed from conflict_report_yacc, removing the old
13172 'conflict_report'. Translate the entire conflict report at once,
13173 so that we don't assume that "," has the same interpretation in
13174 all languages.
13175 (conflicts_output): Use Yacc-style conflict report for each state,
13176 instead of our more-complicated style.
13177 (conflicts_print): Use Yacc-style conflict report, except print
13178 the input file name when not emulating Yacc.
13179 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
13180 Conflicted Reduction, %expect not enough, %expect too much,
13181 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
13182 * tests/existing.at (GNU Cim Grammar): Likewise.
13183 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
13184
13185 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
13186 fatal): Don't invoke fflush; it's not needed and it might even be
13187 harmful for stdout, as stdout might not be open.
13188 * src/reduce.c (reduce_print): Likewise.
13189
b1efe548
PE
131902002-12-27 Paul Eggert <eggert@twinsun.com>
13191
13192 Fix a bug where error locations were not being recorded correctly.
13193 This problem was originally reported by Paul Hilfinger in
161a71f3 13194 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
13195
13196 * data/yacc.c (yyparse): New local var yylerrsp, to record the
13197 top of the location stack's error locations.
13198 (yyerrlab): Set it. When discarding a token, push its location
13199 onto yylerrsp so that we don't lose track of the error's end.
13200 (yyerrlab1): Now is only the target of YYERROR, so that we can
13201 properly record the location of the action that failed. For GCC
13202 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
13203 GCC warning about yyerrlab1 being unused if YYERROR is unused.
13204 (yyerrlab2): New label, which yyerrlab now falls through to.
13205 Compute the error's location by applying YYLLOC_DEFAULT to
13206 the locations of all the symbols that went into the error.
13207 * doc/bison.texinfo (Location Default Action): Mention that
13208 YYLLOC_DEFAULT is also invoked for syntax errors.
13209 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
13210 Error locations include the locations of all the tokens that were
13211 discarded, not just the last token.
d600ee67 13212
983c5c2c
PE
132132002-12-26 Paul Eggert <eggert@twinsun.com>
13214
b1efe548
PE
13215 * src/files.c: Include quote.h.
13216 (compute_output_file_names): Warn if we detect conflicting
13217 outputs to the same file. This should catch the misunderstanding
13218 exemplified by Debian Bug 165349, reported by Bruce Stephens..
13219
13220 * src/conflicts.c (conflicts_print): If the user specifies
13221 "%expect N", report an error if there are any reduce/reduce
13222 conflicts. This is what the manual says should happen.
13223 This fixes Debian bug 130890, reported by Anthony DeRobertis.
13224 * tests/conflicts.at (%expect with reduce conflicts): New test.
13225
983c5c2c
PE
13226 Don't use m4_include on relative file names, as it doesn't work as
13227 desired if there happens to be a file with that name under ".".
d600ee67 13228
983c5c2c
PE
13229 * m4sugar/version.m4: Remove; it was included but it wasn't used.
13230 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
13231 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
13232 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
13233 * src/output.c (output_skeleton): Use full path names when
13234 specifying a file to include; don't rely on include path, as
13235 it's unreliable when the working file contains a file with
13236 that name.
d600ee67 13237
983c5c2c
PE
132382002-12-25 Paul Eggert <eggert@twinsun.com>
13239
13240 Remove obsolete references to bison.simple and bison.hairy.
13241 Problem mentioned by Aubin Mahe in
161a71f3 13242 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
13243 * data/glr.c: Comment fix.
13244 * doc/bison.1: Remove references. Also, mention "yacc".
13245
13246 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
13247 with -g option.
13248
13249 * src/parse-gram.y (declaration): Use enum "report_states" rather
13250 than its numeric value 1.
13251
13252 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
13253 opening a new one. This fixes Debian bug 165349, reported by
13254 Bruce Stephens.
13255
23f2d9dc
PE
132562002-12-24 Paul Eggert <eggert@twinsun.com>
13257
13258 Version 1.75e.
13259
13260 * Makefile.maint (cvs-update): Don't assume that the shell
13261 supports $(...), as Solaris sh doesn't.
13262
13263 * src/parse-gram.y (lloc_default): Remove test for empty
13264 nonterminals at the end, since it didn't change the result.
13265
132662002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
13267
13268 If the user does not define YYSTYPE as a macro, Bison now declares it
13269 using typedef instead of defining it as a macro. POSIX requires this.
13270 For consistency, YYLTYPE is also declared instead of defined.
13271
13272 %union directives can now have a tag before the `{', e.g., the
13273 directive `%union foo {...}' now generates the C code
13274 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
13275 The default union tag is `YYSTYPE', for compatibility with Solaris 9
13276 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
13277 instead of `yyltype'.
13278
13279 `yystype' and `yyltype' are now obsolescent macros instead of being
13280 typedefs or tags; they are no longer documented and will be
13281 withdrawn in a future release.
13282
13283 * data/glr.c (b4_location_type): Remove.
13284 (YYSTYPE): Renamed from yystype.
13285 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
13286 (struct YYLTYPE): Renamed from struct yyltype.
13287 (YYLTYPE): Renamed from yyltype.
13288 (yyltype, yystype): New (and obsolescent) macros,
13289 for backward compatibility.
13290 * data/yacc.c: Likewise.
13291
13292 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
13293 does not specify a union tag. This is for compatibility with
13294 Solaris 9 yacc.
13295
13296 * src/parse-gram.y (add_param): 2nd arg is now char * not char
13297 const *, since it is now modified by stripping surrounding { }.
13298 (current_braced_code): Remove.
13299 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
13300 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
13301 trailing " {...}". Now of type <chars>.
13302 (grammar_declaration): Adjust to bundled tokens.
13303 (code_content): Remove; stripping is now done by add_param.
13304 (print_token_value): Print contents of bundled tokens.
13305 (token_name): New function.
13306
13307 * src/reader.h (braced_code, current_braced_code): Remove.
13308 (token_name): New decl.
13309
13310 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
13311 token_type, not braced_code code_kind. All uses changed.
13312 (SC_PRE_CODE): New state, for scanning after a keyword that
13313 has (or usually has) an immediately-following braced code.
13314 (token_type): New local var, to keep track of which token type
13315 to return when scanning braced code.
13316 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 13317 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
13318 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
13319 instead of returning a token type immediately.
13320 (<INITIAL>"{"): Set token type.
13321 (<SC_BRACED_CODE>"}"): Use it.
13322 (handle_action_dollar, handle_action_at): Now returns bool
13323 indicating success. Fail if ! current_rule; this prevents a core dump.
13324 (handle_symbol_code_dollar, handle_symbol_code_at):
13325 Remove; merge body into caller.
13326 (handle_dollar, handle_at): Complain in invalid contexts.
13327
13328 * NEWS, doc/bison.texinfo: Document the above.
13329 * NEWS: Fix years and program names in copyright notice.
13330
879ca4f8
PE
133312002-12-17 Paul Eggert <eggert@twinsun.com>
13332
13333 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
13334 Reporting, Table of Symbols): Omit mentions of %lex-param and
13335 %parse-param from the documentation for now.
13336
1c5fe69d
PE
133372002-12-15 Paul Eggert <eggert@twinsun.com>
13338
13339 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
13340 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
13341 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
13342 disagreed with the Bison documentation. Bug
13343 reported by Andrew Walrond.
d600ee67 13344
1c5fe69d
PE
13345 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
13346 as the caller now does that.
13347 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
13348 (YYEMPTY): Parenthesize right hand side, since others use it.
13349 (yyparse): Don't assume that our generated code is the only code
13350 that sets yychar.
13351
d1de5372
PE
133522002-12-13 Paul Eggert <eggert@twinsun.com>
13353
13354 Version 1.75d.
13355
13356 POSIX requires a "yacc" command.
13357 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
13358 (MOSTLYCLEANFILES): Add yacc.
13359 (yacc): New rule.
1c5fe69d 13360 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
13361 as an alias for bison y.
13362
13363 * po/LINGUAS: Add da.
d600ee67 13364
d1de5372
PE
13365 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
13366 problem with latest <getopt.h>.
13367 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
13368
13369 * doc/fdl.texi: Upgrade to 1.2.
13370 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
13371 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
13372 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
13373 gnulib.
13374 * config/install-sh: Sync with autotools.
13375
13376 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 13377 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
13378 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
13379 locations are requested.
13380 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
13381 locations are requested.
13382
d0f3fe23
PE
133832002-12-12 Paul Eggert <eggert@twinsun.com>
13384
13385 Remove unportable casts and storage allocation tricks.
13386 While we're at it, remove almost all casts, since they
13387 usually aren't needed and are a sign of trouble.
13388
13389 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
13390
13391 * src/derives.c (derives_compute): Do not subtract NTOKENS from
13392 the pointer DSET returned by malloc; this isn't portable.
13393 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
13394 Similarly for DERIVES.
13395 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
13396 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
13397 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
13398
13399 * src/derives.c (derives_compute): Do not bother invoking
13400 int_of_rule_number, since rule numbers are integers.
13401
13402 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
13403 rather than XMALLOC (char, N).
13404
13405 * src/files.c (filename_split): Rewrite to avoid cast.
13406
13407 * src/gram.h (symbol_number_as_item_number,
13408 item_number_as_symbol_number, rule_number_as_item_number,
13409 item_number_as_rule_number):
13410 Now inline functions rather than macros, to avoid casts.
13411 * src/state.h (state_number_as_int): Likewise.
13412 * src/tables.c (state_number_to_vector_number,
13413 symbol_number_to_vector_number): Likewise.
13414
13415 * src/gram.h (int_of_rule_number): Remove; no longer used.
13416
13417 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
13418 since the resulting storage is always stored into.
13419
13420 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
13421 where it's needed.
13422
13423 * src/muscle_tab.c (muscle_m4_output):
13424 Now inline. Return bool, not int.
13425 * src/state.c (state_compare): Likewise.
13426 * src/symtab.c (symbol_check_defined,
13427 symbol_check_alias_consistency, symbol_pack, symbol_translation,
13428 hash_compare_symbol, hash_symbol):
13429 Likewise.
13430 * src/uniqstr.c (uniqstr_print): Likewise.
13431 * src/muscle_tab.c (muscle_m4_output_processor):
13432 New function, to avoid casts.
13433 * src/state.c (state_comparator, stage_hasher): Likewise.
13434 * src/symtab.c (symbol_check_defined_processor,
13435 symbol_check_alias_consistency_processor, symbol_pack_processor,
13436 symbol_translation_processor, hash_symbol_comparator,
13437 hash_symbol_hasher): Likewise.
13438 * src/uniqstr.c (uniqstr_print_processor): Likewise.
13439 * src/muscle_tab.c (muscles_m4_output):
13440 Use new functions instead of casting old functions unportably.
13441 * src/state.c (state_hash_new): Likewise.
13442 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
13443 symbols_token_translations_init):
13444 Likewise.
13445 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
13446
13447 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
13448 var instead of casting to long, to avoid casts.
13449 (prepare_states): Use MALLOC rather than alloca, so that we don't
13450 have to worry about alloca.
13451 * src/state.c (state_hash_lookup): Likewise.
13452
13453 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
13454 local var instead of casting to unsigned char, to avoid casts.
13455
13456 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
13457 STATE_ALLOC): Remove.
13458 (transitions_new, errs_new, reductions_new, state_new): Use malloc
13459 rather than calloc, and use offsetof to avoid allocating slightly
13460 too much storage.
13461 (state_new): Initialize all members.
13462
13463 * src/state.c (state_hash): Use unsigned accumulator, not signed.
13464
13465 * src/symtab.c (symbol_free): Remove; unused.
13466 (symbol_get): Remove cast in lhs of assignment.
13467 (symbols_do): Now static. Accept generic arguments, not
13468 hashing-related ones.
13469
13470 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
13471 (symbol_processor): Remove.
13472 (symbols_do): Remove decl; now static.
13473
13474 * src/system.h (alloca): Remove; decl no longer needed.
13475 (<stddef.h>): Include, for offsetof.
13476 (<inttypes.>, <stdint.h>): Include if available.
13477 (uintptr_t): New type, if system lacks it.
13478 (CALLOC, MALLOC, REALLOC): New macros.
13479 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
13480 new macros.
13481
13482 * src/tables.c (table_size): Now int, to pacify GCC.
13483 (table_grow, table_ninf_remap): Use signed table size.
13484 (save_row): Don't bother initializing locals when not needed.
13485 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
13486 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
13487
13488 * src/vcg.h: Correct misspellings.
13489
13490 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
13491
13492
13493 * src/getargs.c (getargs): Don't assume EOF == -1.
13494
26b4a969
PE
134952002-12-09 Paul Eggert <eggert@twinsun.com>
13496
13497 Change identifier spellings to avoid collisions with names
13498 that are reserved by POSIX.
13499
13500 Don't use names ending in _t, since POSIX reserves them.
13501 For consistency, remove _e and _s endings -- they're weren't
13502 needed to remove ambiguity. All uses changed.
13503 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
13504 turn was just renamed from struniq_t.
13505 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
13506 which in turn was just renamed from struniq_processor_t.
13507 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
13508 in turn was renamed from hash_compare_struniq_t.
13509 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
13510 (state_list): Renamed from state_list_t.
13511 * src/assoc.h (assoc): Renamed from assoc_t.
13512 * src/conflicts.c (enum conflict_resolution): Renamed from
13513 enum conflict_resolution_e.
13514 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
13515 (rule_list): Renamed from rule_list_t.
13516 * src/getargs.h (enum trace): Renamed from enum trace_e.
13517 (enum report): Renamed from enum report_e.
13518 * src/gram.h (item_number): Renamed from item_number_t.
13519 (rule_number): Renamed from rule_number_t.
13520 (struct rule_s): Remove the "rule_s" part; not used.
13521 (rule): Renamed from rule_t.
13522 (rule_filter): Renamed from rule_filter_t.
13523 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
13524 (goto_list): Renamed from goto_list_t.
13525 * src/lalr.h (goto_number): Renamed from goto_number_t.
13526 * src/location.h (location): Renamed from location_t.
13527 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
13528 and moved here from:
13529 * src/muscle_tab.h (muscle_entry_t): here.
13530 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
13531 (rule_list): Renamed from rule_list_t.
13532 * src/print_graph.c (static_graph): Renamed from graph.
13533 * src/reader.h (braced_code): Renamed from braced_code_t.
13534 Remove brace_code_e tag.
13535 * src/relation.h (relation_node): Renamed from relation_node_t.
13536 (relation_nodes): Renamed from relation_nodes_t.
13537 (relation): Renamed from relation_t.
13538 * src/state.h (state_number): Renamed from state_number_t.
13539 (struct state): Renamed from struct state_s.
13540 (state): Renamed from state_t.
13541 (transitions): Renamed from transitions_t. Unused (and
13542 misspelled) transtion_s tag removed.
13543 (errs): Renamed from errs_t. Unused errs_s tag removed.
13544 (reductions): Renamed from reductions_t. Unused tag
13545 reductions_s removed.
13546 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
13547 (struct symbol_list): Renamed from struct symbol_list_s.
13548 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
13549 (struct symbol): Renamed from struct symbol_s.
13550 (symbol): Renamed from symbol_t.
13551 * src/tables.c (vector_number): Renamed from vector_number_t.
13552 (action_number): Renamed from action_t.
13553 * src/tables.h (base_number): Renamed from base_t.
13554 * src/vcg.h (enum color): Renamed from enum color_e.
13555 (enum textmode): Renamed from enum textmode_e.
13556 (enum shape): Renamed from enum shape_e.
13557 (struct colorentry): Renamed from struct colorentry_s.
13558 (struct classname): Renamed from struct classname_s.
13559 (struct infoname): Renamed from struct infoname_s.
13560 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
13561 (enum decision): Renamed from enum decision_e.
13562 (enum orientation): Renamed from enum orientation_e.
13563 (enum alignment): Renamed from enum alignment_e.
13564 (enum arrow_mode): Renamed from enum arrow_mode_e.
13565 (enum crossing_type): Renamed from enum crossing_type_e.
13566 (enum view): Renamed from enum view_e.
13567 (struct node): Renamed from struct node_s.
13568 (node): Renamed from node_t.
13569 (enum linestyle): Renamed from enum linestyle_e.
13570 (enum arrowstyle): Renamed from enum arrowstyle_e.
13571 (struct edge): Renamed from struct edge.
13572 (edge): Renamed from edge_t.
13573 (struct graph): Renamed from struct graph_s.
13574 (graph): Renamed from graph_t.
13575 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
13576 Rename value_t -> value.
13577 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
13578 value_t_as_yystype -> value_as_yystype.
13579
13580 Don't include <errno.h> in the mainstream code, since it
13581 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
13582 * lib/get-errno.c, lib/get-errno.h: New files.
13583 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
13584 get-errno.c.
13585 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
13586 * src/output.c (output_skeleton): Likewise.
13587 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
13588 instead of errno.
13589 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
13590 Likewise.
13591 (handle_action_dollar, handle_action_at): Likewise.
13592 * src/system.h: Do not include <errno.h>.
13593 (TAB_EXT): Renamed from EXT_TAB.
13594 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
13595
13596 Avoid str[a-z]*, since <string.h> reserves that name space.
13597 Change all instances of "struniq" in names to "uniqstr", and
13598 likewise for "STRUNIQ" and "UNIQSTR".
13599 * src/uniqstr.c: Renamed from src/struniq.c.
13600 * src/uniqstr.h: Renamed from src/struniq.h.
13601 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
13602 * src/files.c (strsuffix): Remove; unused.
13603 (concat2): Renamed from stringappend. Now static.
13604 * src/files.h (strsuffix, stringappend): Remove; unused.
13605 * src/parse-gram.y (<chars>): Renamed from <string>.
13606 (<uniqstr>): Renamed from <struniq>.
13607 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
13608 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
13609 (struct graph_s.expand): Renamed from struct graph_s.stretch.
13610 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
13611 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
13612 (N_EXPAND): Renamed from N_STRETCH.
13613
13614 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
13615 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
13616 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
13617 Remove; unused.
13618 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
13619 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
13620 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
13621 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
13622 (BASE_MAXIMUM): Renamed from BASE_MAX.
13623 (BASE_MINIMUM): Renamed from BASE_MIN.
13624 (ACTION_MAX): Remove; unused.
13625 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
13626 Unnecessary casts removed from above defines.
13627
13628
13629 Fix misspelling in names.
13630 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
13631 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
13632 G_NODE_ALIGNEMENT.
13633
13634
13635 * lib/timevar.c (timevar_report): Renamed from time_report,
13636 for consistency with other names.
13637 * lib/timevar.h (timevar_report): New decl.
13638 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
13639
13640
13641 Sort include-file uses.
13642
13643 Reorder all include files under src to be in the order "system.h".
13644 then the ../lib include files in angle brackets (alphabetized),
13645 then the . include files in double-quotes (alphabetized). Fix
13646 dependency breakages encountered in this process, as follows:
13647 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
13648 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
13649 * src/state.h: Include "symtab.h".
13650
996b1c7e
PE
136512002-12-08 Paul Eggert <eggert@twinsun.com>
13652
13653 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
13654 since this causes problems when __file__ contains character
13655 sequences like "@" that are treated specially by src/scan-skel.l.
13656 Instead, just use the file's basename. This fixes the bug
13657 reported by Martin Mokrejs in
161a71f3 13658 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 13659
e19c4e5d
PE
136602002-12-06 Paul Eggert <eggert@twinsun.com>
13661
13662 Add support for rules that do not have trailing semicolons, as
13663 POSIX requires. Improve the quality of locations in Bison
13664 diagnostics.
26b4a969 13665
e19c4e5d
PE
13666 * src/location.c: Include <quotearg.h>.
13667 (empty_location): Now const.
13668 (location_print): New function. Follow the recommendation of the
13669 GNU Coding Standards for locations that span file boundaries.
13670 * src/location.h: Do not include <quotearg.h>; no longer needed.
13671 (boundary): New type.
13672 (location_t): Use it. This allows locations to span file boundaries.
13673 All member uses changed: file -> start.file or end.file (as needed),
13674 first_line -> start.line, first_column -> start.column,
13675 last_line -> end.line, last_column -> end.column.
13676 (equal_boundaries): New function.
13677 (LOCATION_RESET, LOCATION_STEP): Remove.
13678 (LOCATION_PRINT): Remove. All callers changed to use location_print.
13679 (empty_location): Now const.
13680 (location_print): New decl.
13681 * src/parse-gram.y (lloc_default): New function, which handles
13682 empty locations more accurately.
13683 (YYLLOC_DEFAULT): Use it.
13684 (%token COLON): Remove.
13685 (%token ID_COLON): New token.
26b4a969 13686 (rules): Use it.
e19c4e5d
PE
13687 (declarations, rules): Remove trailing semicolon.
13688 (declaration, rules_or_grammar_declaration):
13689 Allow empty (";") declaration.
13690 (symbol_def): Remove empty actions; no longer needed.
13691 (rules_or_grammar_declaration): Remove trailing semicolon.
13692 (semi_colon.opt): Remove.
13693 * src/reader.h: Include location.h.
13694 (scanner_cursor): New decl.
13695 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
13696 rolling our own.
13697 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
13698 of *loc.
13699 (STEP): Remove. No longer needed, now that adjust_location does
13700 the work. All uses removed.
13701 (scanner_cursor): New var.
13702 (adjust_location): Renamed from extend_location. It now sets
13703 *loc and adjusts the scanner cursor. All uses changed.
13704 Don't bother testing for CR.
13705 (handle_syncline): Remove location arg; now updates scanner cursor.
13706 All callers changed.
13707 (unexpected_end_of_file): Now accepts start boundary of token or
13708 comment, not location. All callers changed. Update scanner cursor,
13709 not the location.
13710 (SC_AFTER_IDENTIFIER): New state.
13711 (context_state): Renamed from c_context. All uses changed.
13712 (id_loc, code_start, token_start): New local vars.
13713 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
13714 processing of Yacc white space and equivalents here.
13715 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
13716 instead of returning ID immediately, since we need to search for
13717 a subsequent colon.
13718 (<INITIAL>"'", "\""): Save token_start.
13719 (<INITIAL>"%{", "{", "%%"): Save code_start.
13720 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
13721 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
13722 BEGIN context_state at end, not INITIAL.
13723 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
13724 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
13725 Return correct token start.
13726 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
13727 the start of a character, string or multiline comment is found.
13728 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
13729 Reduction): Adjust reported locations to match the more-precise
13730 results now expected.
13731 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
13732 * tests/reduce.at (Useless Rules, Reduced Automaton,
13733 Underivable Rules): Likewise.
13734 * tests/regression.at (Invalid inputs): No longer `expecting ";"
13735 or "|"' now that so many other tokens are allowed by the new grammar.
13736
13737 * src/complain.h (current_file): Remove duplicate decl;
13738 current_file is now owned by files.h.
13739 * src/complain.c, src/scan-gram.l: Include files.h.
13740
137412002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 13742
e19c4e5d
PE
13743 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
13744 promotes to int; it might be unsigned int.
13745 * data/yacc.c (yy_reduce_print): Likewise.
13746
13747 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
13748 be #defined in the prologue, not in the Bison declarations.
13749 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 13750
b64755e3
PE
137512002-12-02 Paul Eggert <eggert@twinsun.com>
13752
13753 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
13754 * lib/strtoul.c: New file, from gnulib.
13755 This fixes a porting bug reported by Peter Klein in
161a71f3 13756 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 13757
6e746484
PE
137582002-11-30 Paul Eggert <eggert@twinsun.com>
13759
b64755e3
PE
13760 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
13761 and put only a forward declaration in the prologue. This is for
13762 consistency with the other scanner helper functions.
13763
6ba55592
PE
13764 Type clashes now generate warnings, not errors, since it
13765 appears that POSIX may allow some grammars with type clashes.
13766 * src/reader.c (grammar_current_rule_check): Warn about
13767 type clashes instead of complaining.
13768 * tests/input.at (Type Clashes): Expect warnings, not complaints.
13769
6e746484
PE
13770 Add Yacc library, since POSIX requires it.
13771 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
13772 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
13773 * lib/main.c, lib/yyerror.c: New files.
13774
13775 gram_error can be static; it need not be extern.
13776 * src/reader.h (gram_error): Remove decl.
13777 * src/parse-gram.y (gram_error): Now static. Add static decl.
13778 (print_token_value): Omit parameter names from forward decl,
13779 for consistency.
13780
88510f9c
PE
137812002-11-29 Paul Eggert <eggert@twinsun.com>
13782
6e746484
PE
13783 * doc/bison.texinfo: Emphasize that yylex and yyerror must
13784 be declared before being used. E.g., one should typically
13785 declare them in the prologue. Use GNU coding style in examples.
13786 Put "const" consistently after the type it modifies. Mention
13787 that C99 supports "inline". Mention that yyerror traditionally
13788 returns "int".
13789
88510f9c
PE
13790 %parse-param and %lex-param now take just one argument, the
13791 declaration; the argument name is deduced from the declaration.
13792
13793 * doc/bison.texinfo (Parser Function, Pure Calling, Error
13794 Reporting, Table of Symbols): Document this.
13795 * src/parse-gram.y (add_param): New function.
13796 (COMMA): Remove.
13797 (declaration): Implement new rule for %parse-param and %lex-param.
13798 * src/scan-gram.l: "," now elicits a warning, rather than being
13799 a token; this is more compatible with byacc.
13800 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
13801
bb92250c
PE
138022002-11-27 Paul Eggert <eggert@twinsun.com>
13803
13804 Rename identifiers to avoid real and potential collisions.
13805
13806 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
13807 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 13808 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
13809 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
13810 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
13811 * src/parse-gram.y (print_token_value): Renamed from yyprint.
13812 All uses changed.
13813 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
13814 The name "yycontrol" violates the name space rules, and this stuff
13815 wasn't being used anyway.
13816 (input): Remove action; this stuff wasn't being used.
13817 (gram_error): Rename local variable yylloc -> loc.
13818 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
13819 (YY_DECL): Don't use "yy" at start of local variables.
13820 All uses changed, e.g., yylloc -> loc.
13821 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
13822 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
13823 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
13824 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
13825
13826 * src/parse-gram.y (gram_error): loc is now const *.
13827 * src/reader.h (gram_error): Likewise.
13828
3af4feb2
PE
138292002-11-24 Paul Eggert <eggert@twinsun.com>
13830
13831 Version 1.75c.
13832
13833 * tests/actions.at (Actions after errors): Use an output format
13834 more similar to that of the Printers and Destructors test.
13835 Test the position of the ';' token too.
13836 (Printers and Destructors): Likewise.
13837 (Printers and Destructors: %glr-parser): Remove for now, to avoid
13838 unnecessarily alarming people when the test fails.
13839
13840 * data/yacc.c (yyerrlab1): Move this label down, so that the
13841 parser does not discard the lookahead token if the user code
13842 invokes YYERROR. This change is required for POSIX conformance.
13843
13844 * lib/error.c: Sync with gnulib.
13845
138462002-11-22 Paul Eggert <eggert@twinsun.com>
13847
13848 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
13849 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
13850 * lib/xmalloc.c: Likewise.
26b4a969 13851
58004308
PE
138522002-11-20 Paul Eggert <eggert@twinsun.com>
13853
13854 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
13855
138562002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 13857
58004308
PE
13858 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
13859 should use `if (! x) abort ();' rather than `assert (x);', and
13860 anyway it's one less thing to worry about configuring.
13861
13862 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
13863 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
13864 and replace all instances of assert with abort.
13865 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
13866 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
13867
13868 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
13869 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
13870 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
13871 hash_find_entry, hash_rehash, hash_insert): Likewise.
13872 * src/conflicts.c (resolve_sr_conflict): Likewise.
13873 * src/lalr.c (set_goto_map, map_goto): Likewise.
13874 * src/nullable.c (nullable_compute): Likewise.
13875 * src/output.c (prepare_rules, token_definitions_output): Likewise.
13876 * src/reader.c (packgram, reader): Likewise.
13877 * src/state.c (state_new, state_free, state_transitions_set,
13878 state_reduction_find): Likewise.
13879 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
13880 symbol_pack): Likewise.
13881 * src/tables.c (conflict_row, pack_vector): Likewise.
13882 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
13883 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
13884 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
13885 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
13886
13887 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
13888 (ARGMATCH_CONSTRAINT): New macro.
13889 (ARGMATCH_ASSERT): Use it.
13890
13891 * src/system.h (verify): New macro.
13892 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
13893 rather than assert.
13894 * src/tables.c (tables_generate): Likewise.
13895
13896 * src/struniq.c (struniq_assert): Now returns void, and aborts
13897 if the assertion is false.
13898 (struniq_assert_p): Remove.
13899 * src/struniq.h: Likewise.
13900
76ae8198
PE
139012002-11-18 Paul Eggert <eggert@twinsun.com>
13902
13903 * data/glr.c (yygetLRActions): Replace `yyindex' with
13904 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
13905 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 13906 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 13907
d3c4e709
AD
139082002-11-18 Akim Demaille <akim@epita.fr>
13909
13910 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
13911 space.
13912 From Tim Van Holder.
13913
8d8a7238
PE
139142002-11-17 Paul Eggert <eggert@twinsun.com>
13915
13916 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
13917 to "SyntaxError" for consistency with my 2002-11-15 change.
13918
13919 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
13920 not define to {}, since this breaks the common use of `YYDPRINTF
13921 ((...));' if a single statement is desired (e.g. before `else').
13922 Work around GCC warnings by surrounding corresponding calls with
13923 {} if needed.
13924 (yyhasResolvedValue): Remove unused function.
13925 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
13926 loop body.
13927 (yyreportSyntaxError): Renamed from yyreportParseError.
13928 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
13929 All uses changed.
13930 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
13931 extern when possible. Remove unused initializations.
13932
b0937b22
AD
139332002-11-16 Akim Demaille <akim@epita.fr>
13934
13935 Augment the similarity between GLR and LALR traces.
13936
13937 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
13938 (YY_REDUCE_PRINT): New.
13939 (yyparse): Use them.
13940 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
13941 YYDPRINT here.
13942 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
13943 state reached after the reduction/recovery, since...
13944 (yyparse, yyprocessOneStack): Report the state we are entering in.
13945
c5e3e510
AD
139462002-11-16 Akim Demaille <akim@epita.fr>
13947
13948 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
13949 Add support for --trace=skeleton.
13950 * src/scan-skel.l: %option debug.
13951 Scan strings of non-@ or \n instead of character by character.
13952 (scan_skel): Handle trace_skeleton.
13953 (QPUTS): New.
13954 (@output_parser_name@, @output_header_name@): ``Restore'' their
13955 support (used to be M4 macros).
13956 * data/yacc.c: Quote larger chunks, a la glr.c.
13957 * data/lalr1.cc: Likewise.
13958 The header guards are no longer available, so use some other
13959 string than `YYLSP_NEEDED'.
13960
4c6cc1db
AD
139612002-11-16 Akim Demaille <akim@epita.fr>
13962
13963 Make the ``Printers and Destructors'' test more verbose, taking
13964 `yacc.c''s behavior as (possibly wrong) reference.
13965
13966 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
13967 instead of fprint on stdout.
13968 Set and report the last_line of the symbols.
13969 Consistently display values and locations.
13970
6d9e8019
PE
139712002-11-16 Paul Eggert <eggert@twinsun.com>
13972
13973 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
13974
6e649e65
PE
139752002-11-15 Paul Eggert <eggert@twinsun.com>
13976
b25d88f6
PE
13977 * tests/actions.at (Actions after errors): New test case.
13978
6e649e65
PE
13979 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
13980 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
13981 tests/action.at, tests/calc.at, tests/conflicts.at,
13982 tests/cxx-type.at, tests/regression.at:
13983 "parse error" -> "syntax error" for POSIX compatibility.
13984 "parsing stack overflow..." -> "parser stack overflow" so
13985 that code matches Bison documentation.
13986
0f39aab9
AD
139872002-11-15 Akim Demaille <akim@epita.fr>
13988
13989 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
13990 take two BRACED_CODE, not two string_content.
13991 Free the scanner's obstack when we are done.
13992 (code_content): New.
13993 * tests/calc.at: Adjust.
13994 * doc/bison.texinfo: Adjust.
13995 Also, make sure to include the `,' for these declarations.
13996
761c1926
AD
139972002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
13998
13999 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
14000 definition; avoids potential autoreconf problems.
14001
b0f98b10
AD
140022002-11-15 Akim Demaille <akim@epita.fr>
14003
14004 Always check the value returned by yyparse.
14005
14006 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
14007 returned by yyparse.
14008 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
14009 Adjust calls.
14010 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
14011 returned by yyparse.
14012
970785f1
PH
140132002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14014
14015 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
14016 on input.at test.
14017
8fcc7db1
PE
140182002-11-14 Paul Eggert <eggert@twinsun.com>
14019
7ec1b48e
PE
14020 * src/output.c (output_skeleton): Call xfopen instead of
14021 duplicating xfopen's body.
14022
cfff7583 14023 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 14024 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 14025
8fcc7db1
PE
14026 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
14027 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
14028 Group compiler. Instead, use "$CC -E bar.c". Include the .h
14029 file twice in the grammar, as an extra check.
14030
14031 * tests/input.at (Torturing the Scanner): Surround the
14032 backslash-newline tests with "#if 0", to make it less likely that
14033 we'll run into compiler bugs. Bring back solitary \ inside
14034 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 14035 test backslash-newline in C character constant.
8fcc7db1 14036
4e8d992c
AD
140372002-11-14 Akim Demaille <akim@epita.fr>
14038
14039 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
14040 status of the compiler.
f32b346d 14041 Calling `exit 1' is no longer needed.
4e8d992c
AD
14042 Reported by Nelson H. F. Beebe.
14043
9501dc6e
AD
140442002-11-14 Akim Demaille <akim@epita.fr>
14045
14046 * tests/atlocal.in (CPPFLAGS): We have config.h.
14047 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
14048 New.
14049 * tests/actions.at, tests/calc.at, tests/conflicts.at,
14050 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
14051 * tests/regression.at, tests/torture.at: Use them for all the
14052 grammars that are to be compiled.
14053 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
14054 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
14055 * doc/bison.texinfo (GLR Parsers): Document `inline'.
14056
18b519c0
AD
140572002-11-14 Akim Demaille <akim@epita.fr>
14058
14059 * doc/bison.texinfo: Various formatting changes (alignments in
14060 samples, additional @group/@end group, GCS in samples.
14061 Use @deffn instead of simple @table to define the directives,
14062 macros, variables etc.
14063
9a86cdb9
PE
140642002-11-13 Paul Eggert <eggert@twinsun.com>
14065
daa33def 14066 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 14067 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 14068
daa33def 14069 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 14070 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
14071 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
14072 * tests/headers.at (export YYLTYPE): Likewise.
14073
14074 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 14075 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 14076
9a86cdb9
PE
14077 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
14078 comments, since they're not portable. Use GNU coding style.
14079
9c1e26bd
AD
140802002-11-13 Akim Demaille <akim@epita.fr>
14081
14082 * data/yacc.c: Leave bigger chunks of quoted text.
14083 (YYDSYMPRINTF): New.
14084 Use it to report symbol activities.
14085 * data/glr.c (YYDSYMPRINTF): New.
14086 Use it.
14087
87f721cc
PE
140882002-11-12 Paul Eggert <eggert@twinsun.com>
14089
14090 Version 1.75b.
14091
14092 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
14093 (yyglrReduce): Return yyok, not 0.
14094 This should avoid the enumerated-type warnings reported
464c6927 14095 by Nelson H. F. Beebe in
161a71f3 14096 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
14097
14098 * lib/bbitset.h (BITSET_INLINE): Remove.
14099 * lib/bitset.h [! BITSET_INLINE]: Remove.
14100 (bitset_set, bitset_reset, bitset_test): Rename local vars
14101 to avoid shadowing warnings by GCC.
14102
14103 * data/glr.c (inline): Remove #define. It's the user's
14104 responsibility to #define it away, just like 'const'.
464c6927 14105 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 14106 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 14107
87f721cc
PE
14108 * Makefile.maint (po-check): Scan .l and .y files instead of the
14109 .c and the .h files that they generate. This fixes the bug
14110 reported by Tim Van Holder in:
161a71f3 14111 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
14112 Look for N_ as well as for _. Try to avoid matching #define for
14113 N_ and _.
14114 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
14115 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
14116 * src/scan-gram.l: Revamp regular expressions so that " and '
14117 do not confuse xgettext.
14118
14119 * src/struniq.h (struniq_new): Do not declare the return type
14120 to be 'const'; this violates the C standard.
14121 * src/struniq.c (struniq_new): Likewise.
14122
be14ade5
AD
141232002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
14124
14125 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
14126 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
14127 linker.
14128
05291fbc
AD
141292002-11-12 Akim Demaille <akim@epita.fr>
14130
14131 * Makefile.maint: Sync with Autoconf:
14132 (local_updates): New.
14133
1f5fd52e
AD
141342002-11-12 Akim Demaille <akim@epita.fr>
14135
14136 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
14137
283f1e64
AD
141382002-11-12 Akim Demaille <akim@epita.fr>
14139
14140 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
14141 locations.
14142
886b69d1
AD
141432002-11-12 Akim Demaille <akim@epita.fr>
14144
14145 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
14146 not yyvalue.
14147
3df37415
AD
141482002-11-12 Akim Demaille <akim@epita.fr>
14149
14150 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
14151 Use it to test the GLR parser.
14152
7bd6c77e
AD
141532002-11-12 Akim Demaille <akim@epita.fr>
14154
14155 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
14156 defines it.
14157 * data/glr.c (yystos): New.
14158 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
14159 (YYDSYMPRINT): New.
14160 (yyval): Don't define it, it is handled via M4.
14161 (yyrecoverParseError): Free verbosely the discarded symbols.
14162 * data/yacc.c (yysymprint): Remove, rather...
14163 (b4_yysymprint_generate): invoke.
14164 * data/c.m4 (b4_yysymprint_generate): New.
14165 Accept pointers as arguments, as opposed to the version from
14166 yacc.c.
14167 (b4_yydestruct_generate): Likewise.
14168 * tests/cations.at (Printers and Destructors): Use Bison directives
14169 instead of CPP macros.
14170 Don't rely on internal details.
14171
b0400cc6
AD
141722002-11-12 Akim Demaille <akim@epita.fr>
14173
14174 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
14175 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
14176 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
14177 it against YYEMPTY and so forth), work on yytoken (i.e., set
14178 it to YYEMPTY etc.).
14179 (yydestruct): Replace with a b4_yydestruct_generate invocation.
14180 (b4_symbol_actions): Remove.
14181 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
14182 for 0, end-of-input.
14183
72f889cc
AD
141842002-11-12 Akim Demaille <akim@epita.fr>
14185
14186 * doc/bison.texinfo (Destructor Decl): New.
14187
b1ae9233
AD
141882002-11-12 Akim Demaille <akim@epita.fr>
14189
14190 * src/tables.c (tables_generate): Use free for pointers that
14191 cannot be NULL, not XFREE.
14192 (pack_vector): Use assert, not fatal, for bound violations.
14193 * src/state.c (state_new): Likewise.
14194 * src/reader.c (reader): Likewise.
14195 * src/lalr.c (set_goto_map): Likewise.
72f889cc 14196 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
14197 the file name.
14198
7ec2d4cd
AD
141992002-11-12 Akim Demaille <akim@epita.fr>
14200
14201 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
14202 Restore.
14203 * src/scan-gram.l (last_string): Is global to the file, not to
14204 yylex.
14205 * src/parse-gram.y (input): Don't append the epilogue here,
14206 (epilogue.opt): do it here, and free the scanner's obstack.
14207 * src/reader.c (epilogue_set): Rename as...
14208 (epilogue_augment): this.
14209 * data/c.m4 (b4_epilogue): Defaults to empty.
14210
573a6cd3
AD
142112002-11-12 Akim Demaille <akim@epita.fr>
14212
14213 * src/getargs.c (long_options): Remove duplicates.
14214 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
14215 Remove.
14216 * doc/bison.rnh: Remove.
14217 * doc/bison.texinfo (VMS Invocation): Remove.
14218
95612cfa
AD
142192002-11-12 Akim Demaille <akim@epita.fr>
14220
14221 * src/struniq.h, src/struniq.c (struniq_t): Is const.
14222 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
14223
14224 Use struniq for symbols.
14225
14226 * src/symtab.h (symbol_t): The tag member is a struniq.
14227 (symbol_type_set): Adjust.
14228 * src/symtab.c (symbol_new): Takes a struniq.
14229 (symbol_free): Don't free the tag member.
14230 (hash_compare_symbol_t, hash_symbol_t): Rename as...
14231 (hash_compare_symbol, hash_symbol): these.
14232 Use the fact that tags as struniqs.
14233 (symbol_get): Use struniq_new.
14234 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
14235 Returns a strniq.
14236 * src/reader.h (merger_list, grammar_currentmerge_set): The name
14237 and type members are struniqs.
14238 * src/reader.c (get_merge_function)
14239 (grammar_current_rule_merge_set): Adjust.
14240 (TYPE, current_type): Are struniq.
14241
14242 Use struniq for file names.
14243
14244 * src/files.h, src/files.c (infile): Split into...
14245 (grammar_file, current_file): these.
14246 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
14247 * src/reduce.c (reduce_print): Likewise.
14248 * src/getargs.c (getargs): Likewise.
14249 * src/complain.h, src/complain.c: Likewise.
14250 * src/main.c (main): Call struniqs_new early enough to use it for
14251 file names.
14252 Don't free the input file name.
14253
3e6656f9
AD
142542002-11-12 Akim Demaille <akim@epita.fr>
14255
14256 * src/symtab.c (symbol_free): Remove dead deactivated code:
14257 type_name are properly removed.
14258 Don't use XFREE to free items that cannot be NULL.
14259 * src/struniq.h, src/struniq.c: New.
14260 * src/main.c (main): Initialize/free struniqs.
14261 * src/parse-gram.y (%union): Add astruniq member.
14262 (yyprint): Adjust.
14263 * src/scan-gram.l (<{tag}>): Return a struniq.
14264 Free the obstack bit that used to store it.
14265 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
14266
7672019c
PE
142672002-11-11 Paul Eggert <eggert@twinsun.com>
14268
14269 Revamp to fix many (but not all) of the C- and M4-related quoting
14270 problems. Among other things, this fixes the Bison bug reported
14271 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 14272 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
14273
14274 Use new @ escapes consistently. Represent brackets with @{ and @}
14275 rather than @<:@ and @:>@, since this works a bit better with dumb
14276 editors like vi. Represent @ with @@, since @ is now consistently
14277 an escape. Use @oline@ and @ofile@ rather than __oline__ and
14278 __ofile__, to avoid unexpected expansions. Similarly, use @output
14279 rather than #output.
14280
14281 * data/c.m4 (b4_copyright): Omit file name from comment, since
14282 the file name could contain "*/".
14283 (b4_synclines_flag): Don't quote the 2nd argument; it should already
14284 be quoted. All uses changed.
14285
14286 * data/glr.c: Use new @ escapes consistently.
14287 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
14288 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
14289 Remove, since they couldn't handle arbitrary characters in file
14290 names.
14291 * data/lalr1.cc: Likewise.
14292 * data/yacc.c: Likewise.
14293
14294 * src/files.c (output_infix): Remove; all uses removed.
14295 * src/files.h: Likewise.
14296
14297 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
14298 mishandled funny characters in file names, and anyway it isn't
14299 needed any more.
14300 * data/yacc.c: Likewise.
14301 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
14302
14303 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
14304 * data/yacc.c: Likewise.
14305
14306 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
14307 strings now.
14308 (muscle_init): Quote filename as a C string.
14309 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
14310 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
14311 * src/output.c (escaped_file_name_output): New function.
14312 (prepare_symbols): Quote tokens for M4.
14313 (prepare): Don't insert output_infix, output_prefix,
14314 output_parser_name, output_header_name; this is now down by scan-skel.
14315 Insert skeleton as a C string.
14316
14317 * src/output.c (user_actions_output, symbol_destructors_output,
14318 symbol_printers_output): Quote filenames for C and M4.
14319 * src/reader.c (prologue_augment, epilogue_set): Likewise.
14320
14321 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
14322 escapes other than \\ and \'; this simplifies the code.
14323 (<SC_STRING>): Likewise, for \\ and \".
14324 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
14325 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
14326 Use new escapes @{ and @} for [ and ].
14327
14328 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
14329 them with auto vars.
14330 Switch to new escape scheme, where @ is the escape character uniformly.
14331 Abort if a stray escape character is found. Avoid unbounded input
14332 buffer when parsing non-escaped text.
14333
14334 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
14335 __oline__, #output, $@, and @{ do not have unintended meanings.
14336
acea4f3b
PE
143372002-11-09 Paul Eggert <eggert@twinsun.com>
14338
14339 Fix the test failure due to GCC warnings described in
161a71f3 14340 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
14341 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
14342 evaluate to 0 if it's impossible for NINF to be in the respective
14343 table.
14344 (yygetLRActions, yyrecoverParseError): Use them.
14345
14346 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
14347 counted in the token inserted at end of file. Now takes
14348 location_t *, not location_t, so that the location can be
14349 adjusted. All uses changed.
14350
14351 * tests/regression.at (Invalid inputs): Adjust wording in
14352 diagnostic to match the new behavior.
14353
14354 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
14355 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
14356 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
14357 abort ();'. This reduces the runtime of the "Many lookaheads"
14358 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
14359 GCC 3.2.
14360
20ef1ad5
PE
143612002-11-07 Paul Eggert <eggert@twinsun.com>
14362
14363 * src/parse-gram.y (CHARACTER): Remove unused token.
14364 All uses removed.
14365
14366 * src/scan-gram.l: Remove stack option. We no longer use the
14367 stack, since the stack was never deeper than 1; instead, use the
14368 new auto var c_context to record the stacked value.
14369
14370 Remove nounput option. At an unexpected end of file, we now unput
14371 the minimal input necessary to end cleanly; this simplifies the
14372 code.
14373
14374 Avoid unbounded token sizes where this is easy.
14375
14376 (unexpected_end_of_file): New function.
14377 Use it to systematize the error message on unexpected EOF.
14378 (last-string): Now auto, not static.
14379 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
14380 (scanner_last_string_free): Remove; not used.
14381 (percent_percent_count): Move decl to just before use.
14382 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
14383 not the (never otherwised-used) CHARACTER.
14384
93724f13
AD
143852002-11-07 Akim Demaille <akim@epita.fr>
14386
14387 Let yyerror always receive the msg as last argument, so that
14388 yyerror can be variadic.
14389
14390 * data/yacc.c (b4_yyerror_args): New.
14391 Use it when calling yyerror.
14392 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
14393 Use it when calling yyerror.
14394 * doc/bison.texinfo (Error Reporting): Adjust.
14395 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
14396 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
14397
6e40b4eb
AD
143982002-11-06 Akim Demaille <akim@epita.fr>
14399
14400 #line should have quoted strings.
14401 Ideally, this should be done by m4_quotearg.
14402
14403 * src/scan-skel.l: Include quotearg.h.
14404 Quote __ofile__.
14405 * src/output.c (symbol_printers_output)
14406 (symbol_destructors_output): Quote the file name.
14407
2dfbfc12
AD
144082002-11-06 Akim Demaille <akim@epita.fr>
14409
14410 * tests/regression.at (Invalid inputs): Adjust to the recent
14411 messages.
14412
437c2d80
AD
144132002-11-06 Akim Demaille <akim@epita.fr>
14414
14415 Restore --no-lines.
14416 Reported by Jim Kent.
14417
14418 * data/c.m4 (b4_syncline): New.
14419 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
14420 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
14421 * src/output.c (user_actions_output): Likewise.
14422 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 14423 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 14424
900c5db5
AD
144252002-11-06 Akim Demaille <akim@epita.fr>
14426
14427 * src/main.c (main): Free `infile'.
14428 * src/scan-gram.l (handle_syncline): New.
14429 Recognize `#line'.
14430 * src/output.c (user_actions_output, symbol_destructors_output)
14431 (symbol_printers_output): Use the location's file name, not
14432 infile.
14433 * src/reader.c (prologue_augment, epilogue_set): Likewise.
14434
e183b123 144352002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 14436
e183b123 14437 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 14438 either has GLR conflict entries.
e183b123 14439
193eb6b7
PE
144402002-11-05 Paul Eggert <eggert@twinsun.com>
14441
e183b123
PE
14442 * src/scan-gram.l: Use more accurate diagnostics, e.g.
14443 "integer out of range" rather than "invalid value".
14444 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
14445 accordingly.
14446
193eb6b7
PE
14447 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
14448 Also, remove one static variable in the scanner.
14449
14450 * src/scan-gram.l (braces_level): Now auto, not static.
14451 Initialize to zero if the compiler is being picky.
14452 (INITIAL): Clear braces_level instead of incrementing it.
14453 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
14454 as POSIX 1003.1-2001 requires.
14455 * src/system.h (IF_LINT): New macro, taken from coreutils.
14456 * configure.ac: Define "lint" if --enable-gcc-warnings.
14457
29c01725
AD
144582002-11-05 Akim Demaille <akim@epita.fr>
14459
14460 * src/scan-gram.l: When it starts with `%', complain about the
14461 whole directive, not just that `invalid character: %'.
14462
8aeac3ca
AD
144632002-11-04 Akim Demaille <akim@epita.fr>
14464
14465 * Makefile.maint: Update from Autoconf.
14466 (update, cvs-update, po-update, do-po-update): New.
14467
793a58bb
AD
144682002-11-04 Akim Demaille <akim@epita.fr>
14469
14470 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
14471 and yyerror.
14472 Have yyerror `use' its arguments.
14473 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
14474 returns true when location & yacc & pure & parse-param.
14475 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
14476
c4d720cd
AD
144772002-11-04 Akim Demaille <akim@epita.fr>
14478
14479 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
14480 clashes.
14481 * src/scan-gram.l: Use [\'] instead of ['] to pacify
14482 font-lock-mode.
14483 Use complain_at.
14484 Use quote, not quote_n since LOCATION_PRINT no longer uses the
14485 slot 0.
14486
613a0dc5
PE
144872002-11-03 Paul Eggert <eggert@twinsun.com>
14488
14489 * src/reader.c (get_merge_function, grammar_current_rule_check):
14490 Use consistent diagnostics for reporting type name clashes.
14491 Quote the types with <>, for consistency with Yacc.
14492 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
14493
2a8d363a
AD
144942002-11-03 Akim Demaille <akim@epita.fr>
14495
14496 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
14497 New.
14498 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
14499 (b4_parse_param): Remove.
14500 Use b4_identification.
14501 Propagate b4_pure_args where needed to pass them to yyerror.
14502 * data/glr.m4 (b4_parse_param): Remove.
14503 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
14504 (b4_lpure_formals): New.
14505 Use b4_identification.
14506 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
14507 b4_user_formals and b4_user_args.
14508 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
14509 (yyreportAmbiguity): When using a pure parser, also need
14510 the location, and the parse-params.
14511 Adjust callers.
14512 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
14513 When using a pure parser, also need the parse-params.
14514 Adjust callers.
14515 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
14516 (%pure-parser + %parse-param) LALR and GLR parsers.
14517 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
14518 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
14519 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
14520 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
14521 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
14522 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
14523 * doc/bison.texinfo: Untabify the whole file.
14524 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
14525 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
14526 (Error Reporting): Adjust to these new directives.
14527 Document %error-verbose, deprecate YYERROR_VERBOSE.
14528
9e32add8
AD
145292002-11-03 Akim Demaille <akim@epita.fr>
14530
14531 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
14532 AT_CHECK_CALC_GLR invocations to use % directives, instead of
14533 command line options.
14534 * tests/cxx-type.at: Formatting changes.
14535
b02d90a5
PE
145362002-11-03 Paul Eggert <eggert@twinsun.com>
14537
14538 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
14539 to count columns correctly, and to check for invalid inputs.
9e32add8 14540
b02d90a5
PE
14541 Use mbsnwidth to count columns correctly. Account for tabs, too.
14542 Include mbswidth.h.
14543 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
14544 (extend_location): New function.
14545 (YY_LINES): Remove.
14546
14547 Handle CRLF in C code rather than in Lex code.
14548 (YY_INPUT): New macro.
14549 (no_cr_read): New function.
14550
14551 Scan UCNs, even though we don't fully handle them yet.
14552 (convert_ucn_to_byte): New function.
14553
14554 Handle backslash-newline correctly in C code.
14555 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
14556 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
14557 all uses changed.
14558 (tag, splice): New EREs. Do not allow NUL or newline in tags.
14559 Use {splice} wherever C allows backslash-newline.
14560 YY_STEP after space, newline, vertical-tab.
14561 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 14562
b02d90a5
PE
14563 (letter, id): Don't assume ASCII; e.g., spell out a-z.
14564
14565 ({int}, handle_action_dollar, handle_action_at): Check for integer
14566 overflow.
9e32add8 14567
b02d90a5
PE
14568 (YY_STEP): Omit trailing semicolon, so that it's more like C.
14569
14570 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
14571 as well as \000. Check for UCHAR_MAX, not 255.
14572 Allow \x with an arbitrary positive number of digits, as in C.
14573 Check for overflow here.
14574 Allow \? and UCNs, for compatibility with C.
14575
14576 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
14577 with quote slot used by complain_at.
14578
14579 * tests/input.at: Add tests for backslash-newline, m4 quotes
14580 in symbols, long literals, and funny escapes in strings.
14581
14582 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
14583 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
14584 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
14585 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
14586 * m4/mbswidth.m4: New file, from GNU coreutils.
14587
14588 * doc/bison.texinfo (Grammar Outline): Document // comments.
14589 (Symbols): Document that trigraphs have no special meaning in Bison,
14590 nor is backslash-newline allowed.
14591 (Actions): Document that trigraphs have no special meaning.
14592
14593 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
14594 no longer used.
14595
145962002-11-02 Paul Eggert <eggert@twinsun.com>
14597
14598 * src/reader.c: Don't include quote.h; not needed.
14599 (get_merge_function): Reword warning to be consistent with
14600 type clash diagnostic in grammar_current_rule_check.
14601
14602 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
14603 bug in trigraph handling.
14604
14605 * src/output.c (prepare_symbols): When printing token names,
14606 escape "[" as "@<:@" and likewise for "]".
14607
14608 * src/system.h (errno): Remove declaration, as we are now
14609 assuming C89 or better, and C89 guarantees errno.
14610
762b212b
PE
146112002-10-30 Paul Eggert <eggert@twinsun.com>
14612
14613 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
14614 Check for close failures.
14615 * src/files.h (xfclose): Return void, not int, since it always
14616 returned zero.
14617 * src/files.c (xfclose): Likewise. Report I/O error if ferror
14618 indicates one.
14619 * src/output.c (output_skeleton): Use xfclose rather than fclose
14620 and ferror. xfclose now checks ferror.
14621
14622 * data/glr.c (YYLEFTMOST_STATE): Remove.
14623 (yyreportTree): Use a stack-based leftmost state. This avoids
14624 our continuing battles with bogus warnings about initializers.
14625
56100c60
AD
146262002-10-30 Akim Demaille <akim@epita.fr>
14627
14628 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
14629 #if.
14630
51b4a04c
PH
146312002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14632
14633 * tests/glr-regr1.at: New test for reported regressions.
14634 * tests/testsuite.at: Add glr-regr1.at test.
14635 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 14636
bf1ebda2
PE
146372002-10-24 Paul Eggert <eggert@twinsun.com>
14638
5c16c6b1
PE
14639 Version 1.75a.
14640
bf1ebda2
PE
14641 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
14642 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
14643 we use malloc. Don't assume 'A' through 'Z' are contiguous.
14644 Don't assume strdup exists; POSIX says its an XSI extension.
14645 Check for buffer overflow on input.
14646
b526ee61
AD
146472002-10-24 Akim Demaille <akim@epita.fr>
14648
14649 * src/output.c (output_skeleton): Don't disable M4sugar comments
14650 too soon: it results in comments being expanded.
14651 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
14652 first output.
14653
f1886bb2
AD
146542002-10-24 Akim Demaille <akim@epita.fr>
14655
14656 * data/yacc.c (m4_int_type): New.
14657 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
14658 char' as only yacc.c wants K&R portability.
14659 * data/glr.c (yysigned_char): Remove.
14660 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
14661 Reported by Quoc Peyrot.
14662
c5576256
PE
146632002-10-23 Paul Eggert <eggert@twinsun.com>
14664
14665 * src/main.c (main): With --trace=time, report times even if a
14666 non-fatal error occurs. Formerly, the times were reported in some
14667 such cases but not in others.
14668 * src/reader.c (reader): Just return if a complaint has been issued,
14669 instead of exiting, so that 'main' can report times.
14670
27b0ffea
AD
146712002-10-22 Akim Demaille <akim@epita.fr>
14672
14673 * src/system.h: Include sys/types.
14674 Reported by Bert Deknuydt.
14675
223a7883
PE
146762002-10-23 Paul Eggert <eggert@twinsun.com>
14677
14678 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
14679 Suggested by Art Haas.
14680
146812002-10-22 Paul Eggert <eggert@twinsun.com>
14682
14683 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
14684 decl; not needed any more.
14685 * src/main.c (main): Use return to exit, undoing yesterday's change.
14686 The last OS that we could find where this wouldn't work is
14687 SunOS 3.5, and that's too old to worry about now.
14688
14689 * data/glr.c (struct yyltype): Define members even when not
14690 doing locations. This is more consistent with yacc.c, and it
14691 works around the following bug reports:
161a71f3
PE
14692 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
14693 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 14694
223a7883
PE
14695 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
14696 @acronym consistently. Standardize on "Yacc" instead of "YACC",
14697 "Algol" instead of "ALGOL". Give a bit more history about BNF.
14698
8b76775a
AD
146992002-10-22 Akim Demaille <akim@epita.fr>
14700
14701 * data/README: New.
14702
6db10d14
PE
147032002-10-21 Paul Eggert <eggert@twinsun.com>
14704
14705 Be consistent about 'bool'; the old code used an enum in one
14706 module and an int in another, and this violates the C standard.
14707 * m4/stdbool.m4: New file, from coreutils 4.5.3.
14708 * configure.ac (AC_HEADER_STDBOOL): Add.
14709 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
14710 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
14711 * src/symtab.c (hash_compare_symbol_t): Likewise.
14712 * src/system.h (bool, false, true): Use a definition consistent
14713 with ../lib/hash.c. All uses changed.
14714
14715 * src/complain.c (warning_issued): Renamed from warn_message_count,
14716 so that we needn't worry about integer overflow (!).
14717 Now of type bool. All uses changed.
14718 (complaint_issued): Renamed from complain_message_count; likewise.
14719
14720 * src/main.c (main): Use exit to exit with failure.
27b0ffea 14721
6db10d14
PE
14722 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
14723 rather than 1 and 0.
14724 * src/main.c (main): Likewise.
14725 * src/getargs.c (getargs): Likewise.
14726 * src/reader.c (reader): Likewise.
14727
14728 * src/getarg.c (getargs): Remove duplicate code for
14729 "Try `bison --help'".
14730
14731 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
14732 What was that "2" for?
14733
14734 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
14735 * src/getargs.c (usage): Likewise.
14736
14737 * src/getargs.c (getargs): When there are too few operands, report
14738 the last one. When there are too many, report the first extra
14739 one. This is how diffutils does it.
14740
92a060fd
PE
147412002-10-20 Paul Eggert <eggert@twinsun.com>
14742
14743 Remove K&R vestiges.
14744 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
14745 * src/complain.c (VA_START): Remove. Assume prototypes.
14746 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
14747 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
14748 fatal): Assume prototypes.
14749 * src/complain.h: Assume prototypes.
14750 * src/system.h (PARAMS): Remove.
14751 Include <limits.h> unconditionally, since it's guaranteeed even
14752 for a freestanding C89 compiler.
14753 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
14754 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 14755
e7cb57c0
AD
147562002-10-20 Akim Demaille <akim@epita.fr>
14757
14758 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
14759 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
14760 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
14761 (yyresolveStates, yyresolveAction, yyresolveStack)
14762 (yyprocessOneStack): Use them.
14763 (yy_reduce_print): New.
14764 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
14765
0245f82d
AD
147662002-10-20 Akim Demaille <akim@epita.fr>
14767
14768 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
14769 arguments and output `void'.
14770 (b4_c_function): Rename as...
14771 (b4_c_function_def): this.
14772 (b4_c_function_decl, b4_c_ansi_function_def)
14773 (b4_c_ansi_function_decl): New.
14774 Change the interpretation of the arguments: before `int, foo', now
14775 `int foo, foo'.
14776 * data/yacc.c (yyparse): Prototype and define thanks to these.
14777 Adjust b4_c_function_def uses.
14778 * data/glr.c (yyparse): Likewise, but ANSI only.
14779
39912f52
AD
147802002-10-20 Akim Demaille <akim@epita.fr>
14781
14782 * src/output.c (prepare): Move the definition of `tokens_number',
14783 `nterms_number', `undef_token_number', `user_token_number_max'
14784 to...
14785 (prepare_tokens): Here.
14786 (prepare_tokens): Rename as...
14787 (prepare_symbols): this.
14788 (prepare): Move the definition of `rules_number' to...
14789 (prepare_rules): here.
14790 (prepare): Move the definition of `last', `final_state_number',
14791 `states_number' to...
14792 (prepare_states): here.
14793 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
14794
20c1e2ad
AD
147952002-10-20 Akim Demaille <akim@epita.fr>
14796
14797 * src/tables.h, src/tables.c, src/output.c: Comment changes.
14798
21964f43
AD
147992002-10-20 Akim Demaille <akim@epita.fr>
14800
14801 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
14802 * data/c.m4: here.
14803
66d30cd4
AD
148042002-10-20 Akim Demaille <akim@epita.fr>
14805
14806 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
14807 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
14808 `pair'.
14809 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
14810 `name' to...
14811 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
14812 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
14813 These.
14814
95f2c9fe
PE
148152002-10-19 Paul Eggert <eggert@twinsun.com>
14816
14817 Do not create a temporary file, as that involves security and
14818 cleanup headaches. Instead, use a pair of pipes.
14819 Derived from a suggestion by Florian Krohm.
14820 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
14821 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
14822 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
14823 (BISON_PREREQ_SUBPIPE): Add.
14824 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
14825 Add subpipe.h, subpipe.c.
14826 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
14827 * po/POTFILES.in: Add lib/subpipe.c.
14828 * src/output.c: Include "subpipe.h".
14829 (m4_invoke): Remove decl.
14830 (scan_skel): New decl.
14831 (output_skeleton): Use pipe rather than temporary file for m4 input.
14832 Check that m4sugar.m4 is readable, to avoid deadlock.
14833 Check for pipe I/O error.
14834 * src/scan-skel.l (readpipe): Remove decl.
14835 (scan_skel): New function, to be used in place of m4_invoke.
14836 Read from stream rather than file.
66d30cd4 14837
95f2c9fe
PE
14838 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
14839 float, as this generates a warning on Solaris 8 + GCC 3.2 with
14840 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
14841 this generates a more-accurate value anyway.
14842
14843 * lib/timevar.c (timervar_accumulate): Rename locals to
14844 avoid confusion with similarly-named more-global.
14845 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
14846
14847 * src/output.c (prepare): Use xstrdup to convert char const *
14848 to char *, to avoid GCC warning.
14849
c19988b7
AD
148502002-10-19 Akim Demaille <akim@epita.fr>
14851
14852 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
14853 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
14854 Use them to have `calc.y' ready for %pure-parser.
14855 * data/yacc.c (YYLEX): Pass a yylex return type to
14856 b4_c_function_call.
14857
ae7453f2
AD
148582002-10-19 Akim Demaille <akim@epita.fr>
14859
14860 Prototype support of %lex-param and %parse-param.
14861
14862 * src/parse-gram.y: Add the definition of the %lex-param and
14863 %parse-param tokens, plus their rules.
14864 Drop the `_' version of %glr-parser.
14865 Add the "," token.
14866 * src/scan-gram.l (INITIAL): Scan them.
14867 * src/muscle_tab.c: Comment changes.
14868 (muscle_insert, muscle_find): Rename `pair' as `probe'.
14869 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
14870 (muscle_entry_s): The `value' member is no longer const.
14871 Adjust all dependencies.
14872 * src/muscle_tab.c (muscle_init): Adjust: use
14873 MUSCLE_INSERT_STRING.
14874 Initialize the obstack earlier.
14875 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
14876 (muscle_pair_list_grow): New.
14877 * data/c.m4 (b4_c_function_call, b4_c_args): New.
14878 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
14879 * tests/calc.at: Use %locations, not --locations.
14880 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
14881
0e575721
AD
148822002-10-19 Akim Demaille <akim@epita.fr>
14883
14884 * src/getargs.c (usage): Take status as argument and exit
14885 accordingly.
14886 Report the traditional `Try ... --help' message when status != 0.
14887 (usage, version): Don't take a FILE * as arg, it is pointless.
14888 (getargs): When there is an incorrect number of arguments, make it
14889 an error, and report it GNUlically thanks to `usage ()'.
14890
724ce7f5
PE
148912002-10-18 Paul Eggert <eggert@twinsun.com>
14892
3a781eb2
PE
14893 * data/glr.c (yyreportParseError): Don't assume that sprintf
14894 yields the length of the printed string, as this is not true
14895 on SunOS 4.1.4. Reported by Peter Klein.
14896
724ce7f5
PE
14897 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
14898 * tests/conflicts.at (%nonassoc and eof): Likewise.
14899 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
14900
473d0a75
AD
149012002-10-17 Akim Demaille <akim@epita.fr>
14902
14903 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
14904 * src/getargs.c (trace_types, trace_args): Adjust.
14905 * src/reader.c (grammar_current_rule_prec_set)
14906 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
14907 Standardize error messages.
14908 And s/@prec/%prec/!
14909 (reader): Use trace_flag to enable scanner/parser debugging,
14910 instead of an adhoc scheme.
14911 * src/scan-gram.l: Remove trailing debugging code.
14912
e76d2469
PE
149132002-10-16 Paul Eggert <eggert@twinsun.com>
14914
93e2236a
PE
14915 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
14916 MUSCLE_TAB_H.
14917
e76d2469
PE
14918 * NEWS: Officially drop support for building Bison with K&R C,
14919 since it didn't work anyway and it's not worth worrying about.
14920 * Makefile.maint (wget_files): Remove ansi2knr.c.
14921 (ansi2knr.c-url_prefix): Remove.
14922 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
14923 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
14924 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
14925
5bd1c419
PE
149262002-10-15 Paul Eggert <eggert@twinsun.com>
14927
14928 Stop using the "enum_" trick for K&R-style function definitions;
14929 it confused me, and I was the author! Instead, assume that people
14930 who want to use K&R C compilers (when using these modules in GCC,
14931 perhaps?) will run ansi2knr.
14932
14933 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
14934 All uses of "enum_" changed to "enum ".
14935 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
14936 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 14937
5bd1c419
PE
14938 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
14939 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
14940 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
14941 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
14942 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
14943 abitset_not, abitset_ones, abitset_or, abitset_or_and,
14944 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
14945 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
14946 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
14947 Use function prototypes; this removes the need for declaring
14948 static functions simply to provide their prototypes.
14949 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
14950 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
14951 bitset_count_, bitset_create, bitset_dump, bitset_first,
14952 bitset_free, bitset_init, bitset_last, bitset_next,
14953 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
14954 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
14955 bitset_print, bitset_release_memory, bitset_toggle_,
14956 bitset_type_choose, bitset_type_get, bitset_type_name_get,
14957 debug_bitset): Likewise.
14958 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
14959 * lib/bitset_stats.c (bitset_log_histogram_print,
14960 bitset_percent_histogram_print, bitset_stats_and,
14961 bitset_stats_and_cmp, bitset_stats_and_or,
14962 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
14963 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
14964 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
14965 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
14966 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
14967 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
14968 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
14969 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
14970 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
14971 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
14972 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
14973 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
14974 bitset_stats_zero): Likewise.
14975 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
14976 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
14977 bitsetv_dump, debug_bitsetv): Likewise.
14978 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
14979 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
14980 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
14981 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
14982 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
14983 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
14984 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
14985 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
14986 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
14987 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
14988 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
14989 Likewise.
14990 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
14991 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
14992 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
14993 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
14994 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
14995 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
14996 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
14997 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
14998 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
14999 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
15000 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 15001
ae26e1f0
AD
150022002-10-14 Akim Demaille <akim@epita.fr>
15003
15004 Version 1.75.
15005
d43baf71
AD
150062002-10-14 Akim Demaille <akim@epita.fr>
15007
15008 * tests/Makefile.am (maintainer-check-posix): New.
15009
7ebc83e3
AD
150102002-10-14 Akim Demaille <akim@epita.fr>
15011
15012 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
15013 member.
15014
05846dae
AD
150152002-10-14 Akim Demaille <akim@epita.fr>
15016
15017 * src/tables.c (table_ninf_remap): base -> tab.
15018 Reported by Matt Rosing.
15019
1318e37d
PE
150202002-10-14 Paul Eggert <eggert@twinsun.com>
15021
447fbb17
PE
15022 * tests/action.at, tests/calc.at, tests/conflicts.at,
15023 tests/cxx-type.at, tests/headers.at, tests/input.at,
15024 tests/regression.at, tests/synclines.at, tests/torture.at:
15025 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
15026 so that the tests still work even if POSIXLY_CORRECT is set.
15027 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 15028
1318e37d
PE
15029 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
15030 for portability to K&R hosts. Fix typo: signed char is guaranteed
15031 only to 127, not to 128.
15032 * data/glr.c (yysigned_char): New type.
15033 * data/yacc.c (yysigned_char): Likewise.
15034 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
15035
cc0f0794
PE
150362002-10-13 Paul Eggert <eggert@twinsun.com>
15037
5038f418
PE
15038 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
15039 true due to limited range of data type" warning from GCC.
15040
cc0f0794
PE
15041 * data/c.m4 (b4_token_defines): Protect against double-inclusion
15042 by wrapping enum yytokentype's definition inside #ifndef
15043 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
15044
6fed0802
AD
150452002-10-13 Akim Demaille <akim@epita.fr>
15046
15047 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
15048 Un yy- yyrhs to avoid the name clash with the global YYRHS.
15049
32f0598d
AD
150502002-10-13 Akim Demaille <akim@epita.fr>
15051
15052 * Makefile.maint: Update from Autoconf 2.54.
15053 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
15054
7ea9a33f
AD
150552002-10-13 Akim Demaille <akim@epita.fr>
15056
15057 * src/print.c (print_state): Separate the list of solved conflicts
15058 from the other items.
15059 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
15060
ea99527d
AD
150612002-10-13 Akim Demaille <akim@epita.fr>
15062
15063 Let nondeterministic skeletons be usable with deterministic
15064 tables.
15065
15066 With the patch, GAWK compiled by GCC without -O2 passes its test
15067 suite using a GLR parser driven by LALR tables. It fails with -O2
15068 because `struct stat' gives two different answers on my machine:
15069 88 (definition of an auto var) and later 96 (memset on this var).
15070 Hence the stack is badly corrumpted. The headers inclusion is to
15071 blame: if I move the awk.h inclusion before GLR's system header
15072 inclusion, the two struct stat have the same size.
15073
15074 * src/tables.c (pack_table): Always create conflict_table.
15075 (token_actions): Always create conflict_list.
15076 * data/glr.c (YYFLAG): Remove, unused.
15077
f377f69f
AD
150782002-10-13 Akim Demaille <akim@epita.fr>
15079
15080 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
15081 (O0FLAGS): New.
15082 (VALGRIND, GXX): New.
15083 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
15084 * tests/bison.in: Run $PREBISON a pre-command.
15085 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
15086 (maintainer-check-g++): New.
15087 * Makefile.am (maintainer-check): New.
15088
2a1fe6ed
AD
150892002-10-13 Akim Demaille <akim@epita.fr>
15090
15091 * data/glr.c: Formatting changes.
15092 Tweak some trace messages to match yacc.c's.
15093
f50adbbd
AD
150942002-10-13 Akim Demaille <akim@epita.fr>
15095
15096 GLR parsers sometimes raise parse errors instead of performing the
15097 default reduction.
15098 Reported by Charles-Henry de Boysson.
15099
15100 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 15101 check the length of the traces when %glr.
f50adbbd
AD
15102 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
15103 GLR's traces.
15104 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
15105 Test GLR parsers.
15106 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
15107 (yyltype): Remove the yy prefix from the member names.
15108 (yytable): Complete its comment.
15109 (yygetLRActions): Map error action number from YYTABLE from
15110 YYTABLE_NINF to 0.
15111 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
15112 (which was a bug: it should have been YYTABEL_NINF, and yet it was
15113 not satisfying as we could compare an YYACTION computed from
15114 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
15115 only value for error actions.
15116 (yyreportParseError): In verbose parse error messages, don't issue
15117 `error' in the list of expected tokens.
15118 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
15119 next action to perform to match glr.c's decoding.
15120 (yytable): Complete its comment.
15121
bcbad5b9
PE
151222002-10-13 Paul Eggert <eggert@twinsun.com>
15123
15124 Fix problem reported by Henrik Grubbstroem in
161a71f3 15125 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
15126 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
15127 because the Bison parser reads the second action before reducing
15128 the first one.
15129 * src/scan-gram.l (rule_length): New static var.
15130 Use it to keep track of the rule length in the scanner, since
15131 we can't expect the parser to be in lock-step sync with the scanner.
15132 (handle_action_dollar, handle_action_at): Use this var.
15133 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 15134
14904b89
PE
151352002-10-12 Paul Eggert <eggert@twinsun.com>
15136
1fe611e5
PE
15137 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
15138 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
15139 Include <sys/time.h> when checking for clock_t and struct tms.
15140 Use same include order as source.
15141 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 15142 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 15143
1fe611e5
PE
15144 * lib/timevar.c: Update copyright date and clarify comments.
15145 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 15146
1fe611e5
PE
15147 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
15148 GCC version as of today, then merge Bison's changes.
15149 Change "GCC" to "Bison" in copyright notice. timevar.def's
15150 author is Akim, so change that too.
15151
98194095
PE
15152 * src/reader.c (grammar_current_rule_check):
15153 Don't worry about the default action if $$ is untyped.
15154 Prevents bogus warnings reported by Jim Gifford in
161a71f3 15155 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 15156
14904b89
PE
15157 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
15158 * data/glr.c, data/lalr1.cc, data/yacc.c:
15159 Output token definitions before the first part of user declarations.
15160 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 15161 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 15162
ff6dca18
PE
151632002-10-11 Paul Eggert <eggert@twinsun.com>
15164
15165 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
15166 (yyparse): here. This undoes some of the 2002-07-25 change.
15167 Compatibility problem reported by Ralf S. Engelschall with
15168 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
15169
eb714592
AD
151702002-10-11 Akim Demaille <akim@epita.fr>
15171
15172 * tests/regression.at Characters Escapes): New.
15173 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
15174 characters.
15175 Reported by Jan Nieuwenhuizen.
15176
b7195100
AD
151772002-10-11 Akim Demaille <akim@epita.fr>
15178
15179 * po/id.po: New.
15180
f28a0f2d
PE
151812002-10-10 Paul Eggert <eggert@twinsun.com>
15182
15183 Portability fixes for bitsets; this also avoids several GCC
15184 warnings.
15185
15186 * lib/abitset.c: Include <stddef.h>, for offsetof.
15187 * lib/lbitset.c: Likewise.
15188
15189 * lib/abitset.c (abitset_bytes): Return a size that is aligned
15190 properly for vectors of objects. Do not assume that adding a
15191 header size to a multiple of a word size yields a value that is
15192 properly aligned for the whole union.
15193 * lib/bitsetv.c (bitsetv_alloc): Likewise.
15194
15195 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
15196 unique names for structures.
15197 * lib/ebitset.c (ebitset_bytes): Likewise.
15198 * lib/lbitset.c (lbitset_bytes): Likewise.
15199
15200 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
15201 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
15202 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
15203 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
15204 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
15205 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
15206 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
15207 to improve the type-checking that GCC can do.
15208 * lib/bitset.c (bitset_op4_cmp): Likewise.
15209 * lib/bitset_stats.c (bitset_stats_count,
15210 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
15211 bitset_stats_copy, bitset_stats_disjoint_p,
15212 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
15213 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
15214 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
15215 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
15216 bitset_stats_and_or_cmp, bitset_stats_andn_or,
15217 bitset_stats_andn_or_cmp, bitset_stats_or_and,
15218 bitset_stats_or_and_cmp): Likewise.
15219 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
15220 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
15221 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
15222 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
15223
15224 * lib/abitset.h: Include bitset.h, not bbitset.h.
15225 * lib/ebitset.h: Likewise.
15226 * lib/lbitset.h: Likewise.
15227
15228 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
15229 All instances of parameters of type enum bitset_opts are now of
15230 type enum_bitset_opts, to conform to the C Standard, and similarly
15231 for enum_bitset_type.
15232 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
15233 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
15234
15235 Do not use "struct bitset_struct" to mean different things in
15236 different modules. Not only is this confusing, it violates
15237 the C Standard, which requires that structure types in different
15238 modules must be compatible if one is to be passed to the other.
15239 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
15240 All instances of "struct bitset_struct *" replaced with "bitset".
15241 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
15242 (union bitset_union, struct abitset_struct, struct ebitset_struct,
15243 struct lbitset_struct, struct bitset_stats_struct): New types.
15244 All uses of struct bitset_struct changed to union bitset_union,
15245 etc.
ba0fe3c7 15246 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
15247 struct bitset_struct): Remove.
15248 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
15249 struct bitset_struct): Remove.
15250 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
15251 bitset_struct): Remove.
15252 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
15253 Likewise.
15254
15255 Do not call a function of type T using a call that assumes the
15256 function is of a different type U. Standard C requires that a
15257 function must be called with a type that is compatible with its
15258 definition.
15259 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
15260 New decls.
15261 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
15262 New functions.
15263 * lib/ebitset.c (PFV): Remove.
15264 * lib/lbitset.c (PFV): Likewise.
15265 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
15266 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
15267 decls.
15268 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
15269 (ebitset_vtable): Use them.
15270 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
15271 lbitset_xor): New functions.
15272 (lbitset_vtable): Use them.
15273
15274 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
15275 Declare.
15276
15277 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
15278 GCC warning.
15279 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
15280 Use offsetof, for simplicity.
15281
6fbe4984
PE
152822002-10-06 Paul Eggert <eggert@twinsun.com>
15283
15284 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
15285 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 15286 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
15287 which was inadvertently undone by the 2002-09-30 patch.
15288 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
15289 the same width as int.
15290
420f93c8
PE
152912002-10-04 Paul Eggert <eggert@twinsun.com>
15292
15293 Version 1.50.
15294
15295 * configure.ac (AC_INIT), NEWS: Increment version number.
15296
15297 * doc/bison.texinfo: Minor spelling, grammar, and white space
15298 fixes.
15299 (Symbols): Mention that any negative value returned from yylex
15300 signifies end-of-input. Warn about negative chars. Mention
15301 the portable Standard C character set.
15302
15303 The GNU coding standard says CFLAGS and YFLAGS are reserved
15304 for the installer to set.
15305 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
15306 * src/Makefile.am (AM_CFLAGS): Likewise.
15307 (AM_YFLAGS): Renamed from YFLAGS.
15308
15309 Fix some MAX and MIN problems.
15310 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
15311 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
15312 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
15313 * src/reader.c (reader): Use it.
15314
15315 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
15316 POSIX 1003.1-2001 has removed fgrep.
15317
153182002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
15319
15320 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
15321 interpreted as signed.
15322 * lib/ebitset.c (ebitset_list): Fix bug.
15323
ff68026d
PE
153242002-10-01 Paul Eggert <eggert@twinsun.com>
15325
15326 More fixes for 64-bit hosts and large bitsets.
15327
15328 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
15329 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
15330 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
15331 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
15332 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
15333 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
15334 bitset_count_): Likewise.
15335 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
15336 bitset_first, bitset_last): Likewise.
15337 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
15338 bitset_stats_list_reverse, bitset_stats_size,
15339 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
15340 Likewise.
15341 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
15342 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
15343 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
15344 bitsetv_reflexive_transitive_closure): Likewise.
15345 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
15346 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
15347 Likewise.
15348 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
15349 Likewise.
420f93c8 15350
ff68026d
PE
15351 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
15352 Use size_t, not unsigned int, to count bytes.
15353 * lib/abitset.h (abitset_bytes): Likewise.
15354 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
15355 Likewise.
15356 * lib/bitset.h (bitset_bytes): Likewise.
15357 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
15358 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
15359 * lib/bitsetv.c (bitsetv_alloc): Likewise.
15360 * lib/ebitset.c (ebitset_bytes): Likewise.
15361 * lib/ebitset.h (ebitset_bytes): Likewise.
15362 * lib/lbitset.c (lbitset_bytes): Likewise.
15363 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 15364
ff68026d
PE
15365 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
15366 abitset_subset_p, abitset_disjoint_p, abitset_and,
15367 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
15368 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
15369 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
15370 abitset_or_and, abitset_or_and_cmp):
15371 Use bitset_windex instead of unsigned int.
15372 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
15373 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
15374 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
15375 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
15376 Likewise.
15377 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 15378
ff68026d
PE
15379 * lib/bitset.c (bitset_print):
15380 Use proper printf formats for widths of integer types.
15381 * lib/bitset_stats.c (bitset_percent_histogram_print,
15382 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
15383 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
15384 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
15385 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 15386
ff68026d
PE
15387 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
15388 BITSET_SIZE_MAX): New macros.
15389 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
15390 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
15391 to BITSET_WINDEX_MAX.
15392
15393 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
15394 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
15395 since we now return the bitset_bindex type (not int).
15396
15397 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
15398 when computing sizes.
15399 * lib/ebitset.c (ebitset_elts_grow): Likewise.
15400
15401 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
15402 and avoid cast to unsigned.
15403
6aa452a6
AD
154042002-09-30 Akim Demaille <akim@epita.fr>
15405
15406 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
15407 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
15408 Updates from Michael Hayes.
15409
927f7817
AD
154102002-09-30 Art Haas <ahaas@neosoft.com>
15411
15412 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
15413 invocations.
15414 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
15415 defined.
15416
9738f41e
AD
154172002-09-27 Akim Demaille <akim@epita.fr>
15418
15419 Version 1.49c.
15420
a5c75d7f
AD
154212002-09-27 Akim Demaille <akim@epita.fr>
15422
15423 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
15424 (Because of AC_LIBSOURCE).
15425
8280e179
AD
154262002-09-27 Akim Demaille <akim@epita.fr>
15427
15428 Playing with Autoscan.
15429
15430 * configure.ac: Remove the old LIBOBJ tweaks.
15431 (AC_REPLACE_FUNCS): Add strrchr and strtol.
15432 * lib/strrchr.c: New.
15433 * lib/strtol.c: New, from the Coreutils 4.5.1.
15434
ae64af35
AD
154352002-09-27 Akim Demaille <akim@epita.fr>
15436
15437 Playing with Autoscan.
15438
15439 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
15440 * lib/Makefile.am (libbison_a_SOURCES): No longer include
15441 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
15442 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
15443 Coreutils 4.5.1.
15444
d1a1114f
AD
154452002-09-24 Akim Demaille <akim@epita.fr>
15446
15447 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
15448 (Frequently Asked Questions, Parser Stack Overflow): New.
15449
b906441c
AD
154502002-09-13 Akim Demaille <akim@epita.fr>
15451
15452 Playing with autoscan.
15453
15454 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
15455 * src/files.c (skeleton_find): Remove, unused.
15456 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
15457 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
15458
bd701811
AD
154592002-09-13 Akim Demaille <akim@epita.fr>
15460
15461 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
15462 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
15463
e0a13e7b
AD
154642002-09-13 Akim Demaille <akim@epita.fr>
15465
15466 * configure.ac: Require 2.54.
15467 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
15468 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
15469 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
15470 Remove, provided by Autoconf macros.
15471
c97011bf
AD
154722002-09-12 Akim Demaille <akim@epita.fr>
15473
15474 * m4/prereq.m4: Update, from Coreutils 4.5.1.
15475
d862b1be
AD
154762002-09-12 Akim Demaille <akim@epita.fr>
15477
15478 * m4/prereq.m4: Update, from Fileutils 4.1.5.
15479 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
15480 Reported by Martin Mokrejs.
15481
3d38c03a
AD
154822002-09-10 Akim Demaille <akim@epita.fr>
15483
15484 * src/parse-gram.y: Associate a human readable string to each
15485 token type.
15486 * tests/regression.at (Invalid inputs): Adjust.
15487
b6347355
AD
154882002-09-10 Gary V. Vaughan <gary@gnu.org>
15489
15490 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
15491 with an Autoconf-2.5x style configure.ac.
15492
09ba4ab2
PE
154932002-09-06 Paul Eggert <eggert@twinsun.com>
15494
15495 * doc/bison.texinfo (Conditions): Make explicit that the GPL
15496 exception applies only to yacc.c. This is a modification of a
15497 patch originally suggested by Akim Demaille.
15498
21846f69
AD
154992002-09-06 Akim Demaille <akim@epita.fr>
15500
09ba4ab2
PE
15501 * data/c.m4 (b4_copyright): Move the GPL exception comment from
15502 here to...
15503 * data/yacc.c: here.
15504
21846f69
AD
15505 * data/lalr1.cc (struct yyltype): Don't define it, since we use
15506 LocationType.
15507 (b4_ltype): Default to yy::Location from location.hh.
15508
c0ad8bf3
AD
155092002-09-04 Jim Meyering <jim@meyering.net>
15510
15511 * data/yacc.c: Guard the declaration of yytoknum also with
15512 `#ifdef YYPRINT', so it is declared only when used.
15513
3a93251e
AD
155142002-09-04 Akim Demaille <akim@epita.fr>
15515
15516 * configure.in: Rename as...
15517 * configure.ac: this.
15518 Bump to 1.49c.
15519
427c0dda
AD
155202002-09-04 Akim Demaille <akim@epita.fr>
15521
15522 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
15523 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
15524 translate maintainer only messages.
15525
6a254321
PE
155262002-08-12 Paul Eggert <eggert@twinsun.com>
15527
645e30d1
PE
15528 Version 1.49b.
15529
6a254321
PE
15530 * Makefile.am (SUBDIRS): Remove intl.
15531 (DISTCLEANFILES): Remove.
15532 * NEWS: Mention that GNU M4 is now required. Clarify what is
15533 meant by "larger grammars". Mention the pt_BR translation.
15534 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
15535 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
15536 Bump version from 0.11.2 to 0.11.5.
15537 (BISON_PREREQ_STAGE): Remove.
15538 (AM_GNU_GETTEXT): Use external gettext.
15539 (AC_OUTPUT): Remove intl/Makefile.
15540
15541 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
15542
15543 * data/glr.c: Include string.h, for strlen.
15544 (yyreportParseError): Use size_t for yysize.
15545 (yy_yypstack): No longer nested inside yypstates, as nested
15546 functions are not portable. Do not assume size_t is the
15547 same width as int.
15548 (yypstates): Do not assume that ptrdiff_t is the same width
15549 as int, and similarly for yyposn and YYINDEX.
15550
15551 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
15552
15553 * lib/Makefile.am (INCLUDES): Do not include from the intl
15554 directory, which has been removed.
15555 * src/Makefile.am (INCLUDES): Likewise.
15556
15557 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
15558 (bitsets_sources, additional_bitsets_sources, timevars_sources):
15559 New vars.
15560
15561 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
15562 * tests/Makefile.am (EXTRA_DIST): Likewise.
15563
15564 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
15565 Do not assume that bitset_windex is the same width as unsigned.
15566
15567 * lib/abitset.c (abitset_unused_clear): Do not assume that
15568 bitset_word is the same width as int.
15569 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
15570 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
15571 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
15572 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
15573 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
15574
15575 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
15576 portability to one's complement hosts!).
15577 * lib/ebitset.c (ebitset_op1): Likewise.
15578 * lib/lbitset.c (lbitset_op1): Likewise.
15579
15580 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
15581 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
15582 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
15583 Sync with fileutils.
15584 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
15585 lib/gettext.h: Sync with diffutils.
15586
15587 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
15588 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
15589
15590 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
15591 PROTOTYPES to check for prototypes, and "defined __STDC__" to
15592 check for void *.
15593
15594 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
15595 size_t; the old version tried to do this but casted improperly.
15596 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
15597 (bitset_test): Now returns int, not unsigned long.
15598
15599 * lib/bitset_stats.c: Include "gettext.h".
15600 (_): New macro.
15601 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
15602 name locals "index", as it generates unnecessary warnings on some
15603 hosts that have an "index" function.
15604
15605 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
15606 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
15607 they need translation.
15608 * src/LR0.c (state_list_append, new_itemsets, get_state,
15609 append_states, generate_states): Likewise.
15610 * src/assoc.c (assoc_to_string): Likewise.
15611 * src/closure.c (print_closure, set_firsts, closure): Likewise.
15612 * src/gram.c (grammar_dump): Likewise.
15613 * src/injections.c (injections_compute): Likewise.
15614 * src/lalr.c (lookaheads_print): Likewise.
15615 * src/relation.c (relation_transpose): Likewise.
15616 * src/scan-gram.l: Likewise.
15617 * src/tables.c (table_grow, pack_vector): Likewise.
15618
15619 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
15620 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
15621 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
15622 * m4/mbstate_t.m4: Sync with fileutils.
15623 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
15624
15625 * po/LINGUAS: Add pt_BR.
15626 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
15627 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
15628 lib/timevar.c.
15629 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
15630 manual recommends.
15631 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
15632
15633 * src/complain.c (strerror_r): Remove decl; not needed.
15634 (strerror): Use same pattern as ../lib/error.c.
15635
15636 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
15637
15638 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
15639
15640 * src/main.c (main): Cast result of bindtextdomain and textdomain
15641 to void, to avoid a GCC warning when --disable-nls is in effect.
15642
15643 * src/scan-gram.l: Use strings rather than escapes when possible,
15644 to minimize the number of warnings from xgettext.
15645 (handle_action_dollar, handle_action_at): Don't use isdigit,
15646 as it mishandles negative chars and it may not work as expected
15647 outside the C locale.
15648
15649 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
15650 this is a GCC extension and is not portable to other compilers.
15651
15652 * src/system.h (alloca): Use same pattern as ../lib/error.c.
15653 Do not include <ctype.h>; no longer needed.
15654 Do not include <malloc.h>; no longer needed (and generates
15655 warnings on OpenBSD 3.0).
15656
15657 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
15658 it's not portable.
15659
15660 * tests/regression.at: Do not use 'cc -c input.c -o input';
15661 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
15662
15663 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
15664 exit status as failure, not just exit status 1. Sun C exits
15665 with status 2 sometimes.
15666
15667 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
15668 Use it for the two large tests.
15669
c8f002c7
AD
156702002-08-02 Akim Demaille <akim@epita.fr>
15671
15672 * src/conflicts.c (conflicts_output): Don't output rules never
15673 reduced here, since anyway that computation doesn't work.
15674 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
15675 (rule_useless_p, rule_never_reduced_p): New.
15676 (grammar_rules_partial_print): Use a filter instead of a range.
15677 Display the title only if needed.
15678 (grammar_rules_print): Adjust.
15679 (grammar_rules_never_reduced_report): New.
15680 * src/tables.c (action_row): Move the computation of rules never
15681 reduced to...
15682 (token_actions): here.
15683 * src/main.c (main): Make the parser before making the report, so
15684 that rules never reduced are computed.
15685 Call grammar_rules_never_reduced_report.
15686 * src/print.c (print_results): Report rules never reduced.
15687 * tests/conflicts.at, tests/reduce.at: Adjust.
15688
cd08e51e
AD
156892002-08-01 Akim Demaille <akim@epita.fr>
15690
15691 Instead of attaching lookaheads and duplicating the rules being
15692 reduced by a state, attach the lookaheads to the reductions.
15693
15694 * src/state.h (state_t): Remove the `lookaheads',
15695 `lookaheads_rule' member.
15696 (reductions_t): Add a `lookaheads' member.
15697 Use a regular array for the `rules'.
15698 * src/state.c (reductions_new): Initialize the lookaheads member
15699 to 0.
15700 (state_rule_lookaheads_print): Adjust.
15701 * src/state.h, src/state.c (state_reductions_find): New.
15702 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
15703 (count_rr_conflicts): Adjust.
15704 * src/lalr.c (LArule): Remove.
15705 (add_lookback_edge): Adjust.
15706 (state_lookaheads_count): New.
15707 (states_lookaheads_initialize): Merge into...
15708 (initialize_LA): this.
15709 (lalr_free): Adjust.
15710 * src/main.c (main): Don't free nullable and derives too early: it
15711 is used by --verbose.
15712 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
15713
bb0027a9
AD
157142002-08-01 Akim Demaille <akim@epita.fr>
15715
15716 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
15717 `rule_number_t**'.
15718 (set_derives, free_derives): Rename as...
15719 (derives_compute, derives_free): this.
15720 Adjust all dependencies.
15721 * src/nullable.c (set_nullable, free_nullable): Rename as...
15722 (nullable_compute, nullable_free): these.
15723 (rule_list_t): Store rule_t *, not rule_number_t.
15724 * src/state.c (state_rule_lookaheads_print): Directly compare rule
15725 pointers, instead of their numbers.
15726 * src/main.c (main): Call nullable_free, and derives_free earlier,
15727 as they were lo longer used.
15728
3325ddc4
AD
157292002-08-01 Akim Demaille <akim@epita.fr>
15730
15731 * lib/timevar.c (get_time): Include children time.
15732 * src/lalr.h (LA, LArule): Don't export them: used with the
15733 state_t.
15734 * src/lalr.c (LA, LArule): Static.
15735 * src/lalr.h, src/lalr.c (lalr_free): New.
15736 * src/main.c (main): Call it.
15737 * src/tables.c (pack_vector): Check whether loc is >= to the
15738 table_size, not >.
15739 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
15740 (tables_generate): do it, since that's also it which allocates
15741 them.
15742 Don't free LA and LArule, main does.
15743
c6f1a33c
AD
157442002-07-31 Akim Demaille <akim@epita.fr>
15745
15746 Separate parser tables computation and output.
15747
15748 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
15749 (conflict_list, conflict_list_cnt, table, check, table_ninf)
15750 (yydefgoto, yydefact, high): Move to...
15751 * src/tables.h, src/tables.c: here.
15752 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
15753 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
15754 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
15755 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
15756 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
15757 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
15758 (action_row, save_row, token_actions, save_column, default_goto)
15759 (goto_actions, sort_actions, matching_state, pack_vector)
15760 (table_ninf_remap, pack_table, prepare_actions): Move to...
15761 * src/tables.c: here.
15762 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
15763 * src/output.c (token_actions, output_base, output_conflicts)
15764 (output_check): Merge into...
15765 (prepare_actions): this.
15766 (actions_output): Rename as...
15767 (user_actions_output): this.
15768 * src/main.c (main): Call tables_generate and tables_free.
15769
1509d42f
AD
157702002-07-31 Akim Demaille <akim@epita.fr>
15771
15772 Steal GCC's --time-report support.
15773
15774 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
15775 stolen/adjusted from GCC.
15776 * m4/stage.m4: Remove time related checks.
15777 * m4/timevar.m4: New.
15778 * configure.in: Adjust.
15779 * src/system.h: Adjust to using timevar.h.
15780 * src/getargs.h, src/getargs.c: Support trace_time for
15781 --trace=time.
15782 * src/main.c (stage): Remove.
15783 (main): Replace `stage' invocations with timevar calls.
15784 * src/output.c: Insert pertinent timevar calls.
15785
273a74fa
AD
157862002-07-31 Akim Demaille <akim@epita.fr>
15787
15788 Let --trace have arguments.
15789
15790 * src/getargs.h (enum trace_e): New.
15791 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
15792 (long_options, short_options): --trace/-T takes an optional
15793 argument.
15794 Change all the uses of trace_flag to reflect the new flags.
15795 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
15796
15797 Strengthen `stage' portability.
15798
15799 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
15800 * configure.in: Use it.
15801 Don't check for malloc.h and sys/times.h.
15802 * src/system.h: Include them when appropriate.
15803 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
15804 times and struct tms are available.
15805
217598da
AD
158062002-07-30 Akim Demaille <akim@epita.fr>
15807
15808 In verbose parse error message, don't report `error' as an
15809 expected token.
15810 * tests/actions.at (Printers and Destructors): Adjust.
15811 * tests/calc.at (Calculator $1): Adjust.
15812 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
15813 error message, do not report the parser accepts the error token in
15814 that state.
15815
52489d44
AD
158162002-07-30 Akim Demaille <akim@epita.fr>
15817
15818 Normalize conflict related messages.
15819
15820 * src/complain.h, src/complain.c (warn, complain): New.
15821 * src/conflicts.c (conflicts_print): Use them.
15822 (conflict_report_yacc): New, extracted from...
15823 (conflicts_print): here.
15824 * tests/conflicts.at, tests/existing.at: Adjust.
15825
e8832397
AD
158262002-07-30 Akim Demaille <akim@epita.fr>
15827
15828 Report rules which are never reduced by the parser: those hidden
15829 by conflicts.
15830
15831 * src/LR0.c (save_reductions): Don't make the final state too
15832 different: save its reduction (accept) instead of having a state
15833 without any action (no shift or goto, no reduce).
15834 Note: the final state is now a ``regular'' state, i.e., the
15835 parsers now contain `reduce 0' as default reduction.
15836 Nevertheless, since they decide to `accept' when yystate =
15837 final_state, they still will not reduce rule 0.
15838 * src/print.c (print_actions, print_reduction): Adjust.
15839 * src/output.c (action_row): Track reduced rules.
15840 (token_actions): Report rules never reduced.
15841 * tests/conflicts.at, tests/regression.at: Adjust.
15842
caf23d24
AD
158432002-07-30 Akim Demaille <akim@epita.fr>
15844
15845 `stage' was accidently included in a previous patch.
15846 Initiate its autoconfiscation.
15847
15848 * configure.in: Look for malloc.h and sys/times.h.
15849 * src/main.c (stage): Adjust.
15850 Report only when trace_flag.
15851
640748ee
AD
158522002-07-29 Akim Demaille <akim@epita.fr>
15853
15854 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
15855 state_number_t.
15856 (errs_t): symbol_t*, not symbol_number_t.
15857 (reductions_t): rule_t*, not rule_number_t.
15858 (FOR_EACH_SHIFT): New.
15859 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
15860 * src/print.c, src/print_graph.c: Adjust.
15861
88bce5a2
AD
158622002-07-29 Akim Demaille <akim@epita.fr>
15863
15864 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
15865
15866 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
15867 (endtoken, accept): these.
15868 * src/reader.c (reader): Set endtoken's default tag to "$end".
15869 Set undeftoken's tag to "$undefined" instead of "$undefined.".
15870 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
15871 Adjust.
15872
1bfb97db
AD
158732002-07-29 Akim Demaille <akim@epita.fr>
15874
15875 * src/reduce.c (reduce_grammar): When the language is empty,
15876 complain about the start symbol, not the axiom.
15877 Use its location.
15878 * tests/reduce.at (Empty Language): New.
15879
fc5734fe
AD
158802002-07-26 Akim Demaille <akim@epita.fr>
15881
15882 * src/reader.h, src/reader.c (gram_error): ... can't get
15883 yycontrol without making too strong assumptions on the parser
15884 itself.
15885 * src/output.c (prepare_tokens): Use the real 0th value of
15886 token_translations instead of `0'.
15887 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
15888 visible here.
15889 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
15890 for the time being: %locations ought to provide it to yyerror.
15891
3650b4b8
AD
158922002-07-25 Akim Demaille <akim@epita.fr>
15893
15894 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
15895 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
15896 * tests/regression.at (Web2c Actions): Adjust.
15897
4b3d3a8e
AD
158982002-07-25 Akim Demaille <akim@epita.fr>
15899
15900 Stop storing rules from 1 to nrules + 1.
15901
15902 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
15903 * src/nullable.c, src/output.c, src/print.c, src/reader.c
15904 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
15905 Iterate from 0 to nrules.
15906 Use rule_number_as_item_number and item_number_as_rule_number.
15907 Adjust to `derive' now containing possibly 0.
15908 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
15909 Handle the `- 1' part in rule numbers from/to item numbers.
15910 * src/conflicts.c (log_resolution): Fix the message which reversed
15911 shift and reduce.
15912 * src/output.c (action_row): Initialize default_rule to -1.
15913 (token_actions): Adjust.
15914 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
15915 expected output.
15916 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
15917
4a2a22f4
AD
159182002-07-25 Akim Demaille <akim@epita.fr>
15919
15920 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
15921 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
15922 (b4_c_knr_arg_decl): New.
15923 * data/yacc.c: Use it to define yysymprint, yydestruct, and
15924 yyreport_parse_error.
15925
b8df3223
AD
159262002-07-25 Akim Demaille <akim@epita.fr>
15927
15928 * data/yacc.c (yyreport_parse_error): New, extracted from...
15929 (yyparse): here.
15930 (yydestruct, yysymprint): Move above yyparse.
15931 Be K&R compliant.
15932
a762e609
AD
159332002-07-25 Akim Demaille <akim@epita.fr>
15934
15935 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
15936 replace...
15937 (b4_sint_type, b4_uint_type): these.
15938 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
15939 * tests/regression.at (Web2c Actions): Adjust.
15940
12b0043a
AD
159412002-07-25 Akim Demaille <akim@epita.fr>
15942
15943 * src/gram.h (TIEM_NUMBER_MAX): New.
15944 (item_number_of_rule_number, rule_number_of_item_number): Rename
15945 as...
15946 (rule_number_as_item_number, item_number_as_rule_number): these.
15947 Adjust dependencies.
15948 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
15949 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
15950 (symbol_number_to_vector_number): New.
15951 (order): Of vector_number_t* type.
15952 (base_t, BASE_MAX, BASE_MIN): New.
15953 (froms, tos, width, pos, check): Of base_t type.
15954 (action_number_t, ACTION_MIN, ACTION_MAX): New.
15955 (actrow): Of action_number_t type.
15956 (conflrow): Of unsigned int type.
15957 (table_ninf, base_ninf): New.
15958 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
15959 (muscle_insert_int_table, muscle_insert_base_table)
15960 (muscle_insert_rule_number_table): New.
15961 (prepare_tokens): Output `toknum' as int_table.
15962 (action_row): Returns a rule_number_t.
15963 Use ACTION_MIN, not SHRT_MIN.
15964 (token_actions): yydefact is rule_number_t*.
15965 (table_ninf_remap): New.
15966 (pack_table): Use it for `base' and `table'.
15967 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
15968 replaced with...
15969 (YYPACT_NINF, YYTABLE_NINF): these.
15970 (yypact, yytable): Compute their types instead of hard-coded
15971 `short'.
15972 * tests/regression.at (Web2c Actions): Adjust.
15973
5dde258a
AD
159742002-07-19 Akim Demaille <akim@epita.fr>
15975
15976 * src/scan-gram.l (id): Can start with an underscore.
15977
a945ec39
AD
159782002-07-16 Akim Demaille <akim@epita.fr>
15979
15980 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
15981 Adjust all former `associativity' dependencies.
15982 * src/symtab.c (symbol_new): Default associativity is `undef', not
15983 `right'.
15984 (symbol_check_alias_consistence): Adjust.
15985
fae437e8
AD
159862002-07-09 Akim Demaille <akim@epita.fr>
15987
15988 * doc/bison.texinfo: Properly set the ``header'' part.
15989 Use @dircategory ``GNU programming tools'' as per Texinfo's
15990 documentation.
15991 Use @copying.
15992
1a715ef2
AD
159932002-07-09 Akim Demaille <akim@epita.fr>
15994
15995 * lib/quotearg.h: Protect against multiple inclusions.
15996 * src/location.h (location_t): Add a `file' member.
15997 (LOCATION_RESET, LOCATION_PRINT): Adjust.
15998 * src/complain.c (warn_at, complain_at, fatal_at): Drop
15999 `error_one_per_line' support.
16000
a5d50994
AD
160012002-07-09 Akim Demaille <akim@epita.fr>
16002
16003 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
16004 * src/reader.c (lineno): Remove.
16005 Adjust all dependencies.
16006 (get_merge_function): Take a location and use complain_at.
16007 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
16008 * tests/regression.at (Invalid inputs, Mixing %token styles):
16009 Adjust.
16010
b275314e
AD
160112002-07-09 Akim Demaille <akim@epita.fr>
16012
16013 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
16014 recovery rule, and forbid extensions when --yacc.
16015 (gram_error): Use complain_at.
16016 * src/reader.c (reader): Exit if there were parse errors.
16017
865b9df1
AD
160182002-07-09 Akim Demaille <akim@epita.fr>
16019
16020 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
16021 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
16022 Reported by R Blake <blakers@mac.com>.
16023
c76e14da
AD
160242002-07-09 Akim Demaille <akim@epita.fr>
16025
16026 * data/yacc.c: Output the copyright notive in the header.
16027
7db2ed2d
AD
160282002-07-03 Akim Demaille <akim@epita.fr>
16029
16030 * src/output.c (froms, tos): Are state_number_t.
16031 (save_column): sp, sp1, and sp2 are state_number_t.
16032 (prepare): Rename `final' as `final_state_number', `nnts' as
16033 `nterms_number', `nrules' as `rules_number', `nstates' as
16034 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
16035 unused.
16036 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
16037 * data/lalr1.cc (nsym_): Remove, unused.
16038
e68e0410
AD
160392002-07-03 Akim Demaille <akim@epita.fr>
16040
16041 * src/lalr.h, src/lalr.c (goto_number_t): New.
16042 * src/lalr.c (goto_list_t): New.
16043 Propagate them.
16044 * src/nullable.c (rule_list_t): New.
16045 Propagate.
16046 * src/types.h: Remove.
16047
e1a4f3a4
AD
160482002-07-03 Akim Demaille <akim@epita.fr>
16049
16050 * src/closure.c (print_fderives): Use rule_rhs_print.
16051 * src/derives.c (print_derives): Use rule_rhs_print.
16052 (rule_list_t): New, replaces `shorts'.
16053 (set_derives): Add comments.
16054 * tests/sets.at (Nullable, Firsts): Adjust.
16055
536545f3
AD
160562002-07-03 Akim Demaille <akim@epita.fr>
16057
16058 * src/output.c (prepare_actions): Free `tally' and `width'.
16059 (prepare_actions): Allocate and free `order'.
16060 * src/symtab.c (symbols_free): Free `symbols'.
16061 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
16062 * src/output.c (m4_invoke): Move to...
16063 * src/scan-skel.l: here.
16064 (<<EOF>>): Close yyout, and free its name.
16065
8b752b00
AD
160662002-07-03 Akim Demaille <akim@epita.fr>
16067
16068 Fix some memory leaks, and fix a bug: state 0 was examined twice.
16069
16070 * src/LR0.c (new_state): Merge into...
16071 (state_list_append): this.
16072 (new_states): Merge into...
16073 (generate_states): here.
16074 (set_states): Don't ensure a proper `errs' state member here, do it...
16075 * src/conflicts.c (conflicts_solve): here.
16076 * src/state.h, src/state.c: Comment changes.
16077 (state_t): Rename member `shifts' as `transitions'.
16078 Adjust all dependencies.
16079 (errs_new): For consistency, also take the values as argument.
16080 (errs_dup): Remove.
16081 (state_errs_set): New.
16082 (state_reductions_set, state_transitions_set): Assert that no
16083 previous value was assigned.
16084 (state_free): New.
16085 (states_free): Use it.
16086 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
16087 temporary storage: use `errs' and `nerrs' as elsewhere.
16088 (set_conflicts): Allocate and free this `errs'.
16089
613f5e1a
AD
160902002-07-02 Akim Demaille <akim@epita.fr>
16091
16092 * lib/libiberty.h: New.
16093 * lib: Update the bitset implementation from upstream.
16094 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
16095 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
16096 * src/main.c: Adjust bitset stats calls.
16097
26e0cadc
PE
160982002-07-01 Paul Eggert <eggert@twinsun.com>
16099
16100 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
16101 char, so that negative chars don't collide with $.
16102
1154cced
AD
161032002-06-30 Akim Demaille <akim@epita.fr>
16104
16105 Have the GLR tests be `warning' checked, and fix the warnings.
16106
16107 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
16108 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
16109 (yyremoveDeletes): `yyi' and `yyj' are size_t.
16110 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
16111 (yyaddDeferredAction): static.
16112 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
16113 (yyreportParseError): yyprefix is const.
16114 yytokenp is used only when verbose.
16115 (yy__GNUC__): Replace with __GNUC__.
16116 (yypdumpstack): yyi is size_t.
16117 (yypreference): Un-yy local variables and arguments, to avoid
16118 clashes with `yyr1'. Anyway, we are not in the user name space.
16119 (yytname_size): be an int, as is compared with ints.
16120 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
16121 Use them.
16122 * tests/cxx-gram.at: Use quotation to protect $1.
16123 Use AT_COMPILE to enable warnings hunts.
16124 Prototype yylex and yyerror.
16125 `Use' argc.
16126 Include `string.h', not `strings.h'.
16127 Produce and prototype stmtMerge only when used.
16128 yylex takes a location.
16129
97650f4e
AD
161302002-06-30 Akim Demaille <akim@epita.fr>
16131
16132 We spend a lot of time in quotearg, in particular when --verbose.
16133
16134 * src/symtab.c (symbol_get): Store a quoted version of the key.
16135 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
16136 Adjust all callers.
16137
d2576365
AD
161382002-06-30 Akim Demaille <akim@epita.fr>
16139
16140 * src/state.h (reductions_t): Rename member `nreds' as num.
16141 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
16142 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
16143
ccaf65bc
AD
161442002-06-30 Akim Demaille <akim@epita.fr>
16145
16146 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
16147 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
16148 (shifts_to): Rename as...
16149 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
16150 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
16151 (TRANSITION_IS_DISABLED, transitions_to): these.
16152
87675353
AD
161532002-06-30 Akim Demaille <akim@epita.fr>
16154
16155 * src/print.c (print_shifts, print_gotos): Merge into...
16156 (print_transitions): this.
16157 (print_transitions, print_errs, print_reductions): Align the
16158 lookaheads columns.
16159 (print_core, print_transitions, print_errs, print_state,
16160 print_grammar): Output empty lines separator before, not after.
16161 (state_default_rule_compute): Rename as...
16162 (state_default_rule): this.
16163 * tests/conflicts.at (Defaulted Conflicted Reduction),
16164 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
16165 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
16166
ce4ccb4b
AD
161672002-06-30 Akim Demaille <akim@epita.fr>
16168
16169 Display items as we display rules.
16170
16171 * src/gram.h, src/gram.c (rule_lhs_print): New.
16172 * src/gram.c (grammar_rules_partial_print): Use it.
16173 * src/print.c (print_core): Likewise.
16174 * tests/conflicts.at (Defaulted Conflicted Reduction),
16175 (Unresolved SR Conflicts): Adjust.
16176 (Unresolved SR Conflicts): Adjust and rename as...
16177 (Resolved SR Conflicts): this, as was meant.
16178 * tests/regression.at (Web2c Report): Adjust.
16179
bc933ef1
AD
161802002-06-30 Akim Demaille <akim@epita.fr>
16181
16182 * src/print.c (state_default_rule_compute): New, extracted from...
16183 (print_reductions): here.
16184 Pessimize, but clarify the code.
16185 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
16186
53d4308d
AD
161872002-06-30 Akim Demaille <akim@epita.fr>
16188
16189 * src/output.c (action_row): Let default_rule be always a rule
16190 number.
16191
574fb2d5
AD
161922002-06-30 Akim Demaille <akim@epita.fr>
16193
16194 * src/closure.c (print_firsts, print_fderives, closure):
16195 Use BITSET_EXECUTE.
16196 * src/lalr.c (lookaheads_print): Likewise.
16197 * src/state.c (state_rule_lookaheads_print): Likewise.
16198 * src/print_graph.c (print_core): Likewise.
16199 * src/print.c (print_reductions): Likewise.
16200 * src/output.c (action_row): Likewise.
16201 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
16202
05811fd7
AD
162032002-06-30 Akim Demaille <akim@epita.fr>
16204
16205 * src/print_graph.c: Use report_flag.
16206
0e4d5753
AD
162072002-06-30 Akim Demaille <akim@epita.fr>
16208
16209 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
16210 to...
16211 * src/relation.h, src/relation.c (traverse, relation_digraph)
16212 (relation_print, relation_transpose): New.
16213
24c7d800
AD
162142002-06-30 Akim Demaille <akim@epita.fr>
16215
16216 * src/state.h, src/state.c (shifts_to): New.
16217 * src/lalr.c (build_relations): Use it.
16218
9222837b
AD
162192002-06-30 Akim Demaille <akim@epita.fr>
16220
16221 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
16222 (item_number_of_rule_number, rule_number_of_item_number): New.
16223 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
16224 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
16225 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
16226 Propagate their use.
16227 Much remains to be done, in particular wrt `shorts' from types.h.
16228
260008e5
AD
162292002-06-30 Akim Demaille <akim@epita.fr>
16230
16231 * src/symtab.c (symbol_new): Initialize the `printer' member.
16232
8a731ca8
AD
162332002-06-30 Akim Demaille <akim@epita.fr>
16234
16235 * src/LR0.c (save_reductions): Remove, replaced by...
16236 * src/state.h, src/state.c (state_reductions_set): New.
16237 (reductions, errs): Rename as...
16238 (reductions_t, errs_t): these.
16239 Adjust all dependencies.
16240
32e1e0a4
AD
162412002-06-30 Akim Demaille <akim@epita.fr>
16242
16243 * src/LR0.c (state_list_t, state_list_append): New.
16244 (first_state, last_state): Now symbol_list_t.
16245 (this_state): Remove.
16246 (new_itemsets, append_states, save_reductions): Take a state_t as
16247 argument.
16248 (set_states, generate_states): Adjust.
16249 (save_shifts): Remove, replaced by...
16250 * src/state.h, src/state.c (state_shifts_set): New.
16251 (shifts): Rename as...
16252 (shifts_t): this.
16253 Adjust all dependencies.
16254 * src/state.h (state_t): Remove the `next' member.
16255
e5fb6710
AD
162562002-06-30 Akim Demaille <akim@epita.fr>
16257
16258 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
16259 escaped in slot 0.
16260
c7ca99d4
AD
162612002-06-30 Akim Demaille <akim@epita.fr>
16262
16263 Use hash.h for the state hash table.
16264
16265 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
16266 (allocate_storage): Use state_hash_new.
16267 (free_storage): Use state_hash_free.
16268 (new_state, get_state): Adjust.
16269 * src/lalr.h, src/lalr.c (states): Move to...
16270 * src/states.h (state_t): Remove the `link' member, no longer
16271 used.
16272 * src/states.h, src/states.c: here.
16273 (state_hash_new, state_hash_free, state_hash_lookup)
16274 (state_hash_insert, states_free): New.
16275 * src/states.c (state_table, state_compare, state_hash): New.
16276 * src/output.c (output_actions): Do not free states now, since we
16277 still need to know the final_state number in `prepare', called
16278 afterwards. Do it...
16279 * src/main.c (main): here: call states_free after `output'.
16280
df0e7316
AD
162812002-06-30 Akim Demaille <akim@epita.fr>
16282
16283 * src/state.h, src/state.c (state_new): New, extracted from...
16284 * src/LR0.c (new_state): here.
16285 * src/state.h (STATE_ALLOC): Move to...
16286 * src/state.c: here.
16287 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
16288 * src/state.h, src/state.c: here.
16289
39f41916
AD
162902002-06-30 Akim Demaille <akim@epita.fr>
16291
16292 * src/reader.c (gensym): Rename as...
16293 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
16294 (getsym): Rename as...
16295 (symbol_get): this.
16296
d57650a5
AD
162972002-06-30 Akim Demaille <akim@epita.fr>
16298
16299 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
16300 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
16301 * src/output.c, src/print.c, src/print_graph.c: Propagate.
16302 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
16303
5a08f1ce
AD
163042002-06-30 Akim Demaille <akim@epita.fr>
16305
16306 Make the test suite pass with warnings checked.
16307
16308 * tests/actions.at (Printers and Destructors): Improve.
16309 Avoid unsigned vs. signed issues.
16310 * tests/calc.at: Don't exercise the scanner here, do it...
16311 * tests/input.at (Torturing the Scanner): here.
16312
720623af
PH
163132002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16314
88e7e941 16315 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
16316 reorganize first lines parallel to yacc.c.
16317
fb8135fa
AD
163182002-06-28 Akim Demaille <akim@epita.fr>
16319
16320 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
16321 (b4_token_enum, b4_token_defines): New, factored from...
16322 * data/lalr1.cc, data/yacc.c, glr.c: here.
16323
41442480
AD
163242002-06-28 Akim Demaille <akim@epita.fr>
16325
16326 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
16327 unused variables.
16328 * src/output.c (merger_output): static.
16329
e0e5bf84
AD
163302002-06-28 Akim Demaille <akim@epita.fr>
16331
ba0fe3c7 16332 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
16333 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
16334 pacify GCC.
16335 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 16336
676385e2
PH
163372002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16338
16339 Accumulated changelog for new GLR parsing features.
16340
6a254321 16341 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
16342 conflicts_total_count.
16343 * src/conflicts.h: Ditto.
16344 * src/output.c (token_actions): Use the new name.
16345 (output_conflicts): Change conflp => conflict_list_heads, and
16346 confl => conflict_list for better readability.
16347 * data/glr.c: Use the new names.
16348 * NEWS: Add self to GLR announcement.
e0e5bf84 16349
676385e2
PH
16350 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
16351
16352 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
16353 Akim Demaille.
16354
16355 * data/bison.glr: Change name to glr.c
16356 * data/glr.c: Renamed from bison.glr.
16357 * data/Makefile.am: Add glr.c
e0e5bf84
AD
16358
16359 * src/getargs.c:
16360
676385e2 16361 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 16362 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 16363
676385e2
PH
16364 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16365
16366 * data/bison.glr: Be sure to restore the
16367 current #line when returning to the skeleton contents after having
16368 exposed the input file's #line.
16369
16370 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16371
16372 * data/bison.glr: Bring up to date with changes to bison.simple.
16373
16374 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16375
16376 * data/bison.glr: Correct definitions that use b4_prefix.
16377 Various reformatting.
16378 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
16379 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
16380 yytokenp argument; now part of stack.
16381 (yychar): Define to behave as documented.
16382 (yyclearin): Ditto.
e0e5bf84 16383
676385e2
PH
16384 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16385
16386 * src/reader.h: Add declaration for free_merger_functions.
16387
16388 * src/reader.c (merge_functions): New variable.
16389 (get_merge_function): New function.
16390 (free_merger_functions): New function.
16391 (readgram): Check for %prec that is not followed by a symbol.
16392 Handle %dprec and %merge declarations.
16393 (packgram): Initialize dprec and merger fields in rules array.
16394
16395 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
16396 conflict_list_cnt, conflict_list_free): New variables.
16397 (table_grow): Also grow conflict_table.
e0e5bf84 16398 (prepare_rules): Output dprec and merger tables.
676385e2 16399 (conflict_row): New function.
e0e5bf84 16400 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
16401 default reduction in conflicted states for GLR parser so that there
16402 are spaces for the conflict lists.
16403 (save_row): Also save conflict information.
16404 (token_actions): Allocate conflict list.
16405 (merger_output): New function.
16406 (pack_vector): Pack conflict table, too.
16407 (output_conflicts): New function to output yyconflp and yyconfl.
16408 (output_check): Allocate conflict_tos.
16409 (output_actions): Output conflict tables, also.
16410 (output_skeleton): Output b4_mergers definition.
16411 (prepare): Output b4_max_rhs_length definition.
16412 Use 'bison.glr' as default skeleton for GLR parsers.
16413
16414 * src/gram.c (glr_parser): New flag.
16415 (grammar_free): Call free_merger_functions.
16416
16417 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
16418 all pairs of conflicting reductions, rather than just all tokens
16419 causing conflicts. Needed to size conflict tables.
e0e5bf84 16420 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
16421 interface.
16422 (conflicts_print): Ditto.
16423 (count_total_conflicts): New function.
16424
16425 * src/reader.h (merger_list): New type.
16426 (merge_functions): New variable.
16427
16428 * src/lex.h (tok_dprec, tok_merge): New token types.
16429
16430 * src/gram.h (rule_s): Add dprec and merger fields.
16431 (glr_parser): New flag.
16432
16433 * src/conflicts.h (count_total_conflicts): New function.
16434
16435 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
16436
16437 * doc/bison.texinfo (Generalized LR Parsing): New section.
16438 (GLR Parsers): New section.
16439 (Language and Grammar): Mention GLR parsing.
16440 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
16441 Correct typo ("tge" -> "the").
16442
16443 * data/bison.glr: New skeleton for GLR parsing.
16444
16445 * tests/cxx-gram.at: New tests for GLR parsing.
16446
16447 * tests/testsuite.at: Include cxx-gram.at.
16448
16449 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 16450
676385e2
PH
16451 * src/parse-gram.y:
16452
16453 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
16454
16455 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 16456
b5480d74 164572002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
16458
16459 * src/options.h, src/options.c: Remove.
16460 * src/getargs.c (short_options, long_options): New.
16461
60491a94
AD
164622002-06-27 Akim Demaille <akim@epita.fr>
16463
16464 * data/bison.simple, data/bison.c++: Rename as...
16465 * data/yacc.c, data/lalr1.cc: these.
16466 * doc/bison.texinfo (Environment Variables): Remove.
16467
9be0c25b
AD
164682002-06-25 Raja R Harinath <harinath@cs.umn.edu>
16469
16470 * src/getargs.c (report_argmatch): Initialize strtok().
16471
1ae72863
AD
164722002-06-20 Akim Demaille <akim@epita.fr>
16473
16474 * data/bison.simple (b4_symbol_actions): New, replaces...
16475 (b4_symbol_destructor, b4_symbol_printer): these.
16476 (yysymprint): Be sure to call YYPRINT only for tokens, and using
16477 user token numbers.
16478
87542d29
AD
164792002-06-20 Akim Demaille <akim@epita.fr>
16480
16481 * data/bison.simple (yydestructor): Rename as...
16482 (yydestruct): this.
16483
1a31ed21
AD
164842002-06-20 Akim Demaille <akim@epita.fr>
16485
16486 * src/symtab.h, src/symtab.c (symbol_type_set)
16487 (symbol_destructor_set, symbol_precedence_set): The location is
16488 the last argument.
16489 Adjust all callers.
16490
e776192e
AD
164912002-06-20 Akim Demaille <akim@epita.fr>
16492
16493 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
16494 internals.
16495 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
16496 Takes a location.
16497 * src/symtab.h, src/symtab.c (symbol_class_set)
16498 (symbol_user_token_number_set): Likewise.
16499 Adjust all callers.
16500 Promote complain_at.
16501 * tests/input.at (Type Clashes): Adjust.
16502
5c1180b3
AD
165032002-06-20 Akim Demaille <akim@epita.fr>
16504
16505 * data/bison.simple (YYLEX): Fix the declaration when
16506 %pure-parser.
16507
e3170060
AD
165082002-06-20 Akim Demaille <akim@epita.fr>
16509
16510 * data/bison.simple (yysymprint): Don't print the token number,
16511 just its name.
16512 * tests/actions.at (Destructors): Rename as...
16513 (Printers and Destructors): this.
16514 Also exercise %printer.
16515
253862fd
AD
165162002-06-20 Akim Demaille <akim@epita.fr>
16517
16518 * data/bison.simple (YYDSYMPRINT): New.
16519 Use it to remove many of the #if YYDEBUG/if (yydebug).
16520
366eea36
AD
165212002-06-20 Akim Demaille <akim@epita.fr>
16522
16523 * src/symtab.h, src/symtab.c (symbol_t): printer and
16524 printer_location are new members.
16525 (symbol_printer_set): New.
16526 * src/parse-gram.y (PERCENT_PRINTER): New token.
16527 Handle its associated rule.
16528 * src/scan-gram.l: Adjust.
16529 (handle_destructor_at, handle_destructor_dollar): Rename as...
16530 (handle_symbol_code_at, handle_symbol_code_dollar): these.
16531 * src/output.c (symbol_printers_output): New.
16532 (output_skeleton): Call it.
16533 * data/bison.simple (yysymprint): New. Cannot be named yyprint
16534 since there are already many grammar files with a user `yyprint'.
16535 Replace the calls to YYPRINT to calls to yysymprint.
16536 * tests/calc.at: Adjust.
16537 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
16538 taking advantage of parser very internal details (stack size!).
16539
4f25ebb0
AD
165402002-06-20 Akim Demaille <akim@epita.fr>
16541
16542 * src/scan-gram.l: Complete the scanner with the missing patterns
16543 to pacify Flex.
16544 Use `quote' and `symbol_tag_get' where appropriate.
16545
93b68a0e
AD
165462002-06-19 Akim Demaille <akim@epita.fr>
16547
16548 * tests/actions.at (Destructors): Augment to test locations.
16549 * data/bison.simple (yydestructor): Pass it the current location
16550 if locations are enabled.
16551 Prototype only when __STDC__ or C++.
16552 Change the argument names to move into the yy name space: there is
16553 user code here.
16554
58612f1d
AD
165552002-06-19 Akim Demaille <akim@epita.fr>
16556
74310291
AD
16557 * data/bison.simple (b4_pure_if): New.
16558 Use it instead of #ifdef YYPURE.
16559
165602002-06-19 Akim Demaille <akim@epita.fr>
16561
16562 * data/bison.simple (b4_location_if): New.
58612f1d
AD
16563 Use it instead of #ifdef YYLSP_NEEDED.
16564
f25bfb75
AD
165652002-06-19 Akim Demaille <akim@epita.fr>
16566
16567 Prepare @$ in %destructor, but currently don't bind it in the
16568 skeleton, as %location use is not cleaned up yet.
16569
16570 * src/scan-gram.l (handle_dollar, handle_destructor_at)
16571 (handle_action_at): New.
16572 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
16573 a braced_code_t and a location as additional arguments.
16574 (handle_destructor_dollar): Instead of requiring `b4_eval', just
16575 unquote one when outputting `b4_dollar_dollar'.
16576 Adjust callers.
16577 * data/bison.simple (b4_eval): Remove.
16578 (b4_symbol_destructor): Adjust.
16579 * tests/input.at (Invalid @n): Adjust.
16580
c732d2c6
AD
165812002-06-19 Zack Weinberg <zack@codesourcery.com>
16582
16583 * doc/bison.texinfo: Document ability to have multiple
16584 prologue sections.
16585
8c165d89
AD
165862002-06-18 Akim Demaille <akim@epita.fr>
16587
16588 * src/files.c (compute_base_names): When computing the output file
16589 names from the input file name, strip the directory part.
16590
ca98bf57
AD
165912002-06-18 Akim Demaille <akim@epita.fr>
16592
16593 * data/bison.simple.new: Comment changes.
16594 Reported by Andreas Schwab.
16595
0bfb02ff
AD
165962002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
16597
16598 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
16599 there are no `label `yyoverflowlab' defined but not used' warnings
16600 when yyoverflow is defined.
16601
24c0aad7
AD
166022002-06-18 Akim Demaille <akim@epita.fr>
16603
16604 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
16605 new member.
16606 (symbol_destructor_set): Adjust.
16607 * src/output.c (symbol_destructors_output): Output the destructor
16608 locations.
16609 Output the symbol name.
16610 * data/bison.simple (b4_symbol_destructor): Adjust.
16611
5719c109
AD
166122002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
16613 and Akim Demaille <akim@epita.fr>
16614
16615 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
16616 what's left on the stack when the error recovery hits EOF.
16617 * tests/actions.at (Destructors): Complete to exercise this case.
16618
9280d3ef
AD
166192002-06-17 Akim Demaille <akim@epita.fr>
16620
16621 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
16622 arguments is really empty, not only equal to `[]'.
16623 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
16624 member.
16625 (symbol_destructor_set): New.
16626 * src/output.c (symbol_destructors_output): New.
16627 * src/reader.h (brace_code_t, current_braced_code): New.
16628 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
16629 (handle_dollar): Rename as...
16630 (handle_action_dollar): this.
16631 (handle_destructor_dollar): New.
16632 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
16633 (grammar_declaration): Use it.
16634 * data/bison.simple (yystos): Is always defined.
16635 (yydestructor): New.
16636 * tests/actions.at (Destructors): New.
16637 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
16638
dafdc66f
AD
166392002-06-17 Akim Demaille <akim@epita.fr>
16640
16641 * src/symlist.h, src/symlist.c (symbol_list_length): New.
16642 * src/scan-gram.l (handle_dollar, handle_at): Compute the
16643 rule_length only when needed.
16644 * src/output.c (actions_output, token_definitions_output): Output
16645 the full M4 block.
16646 * src/symtab.c: Don't access directly to the symbol tag, use
16647 symbol_tag_get.
16648 * src/parse-gram.y: Use symbol_list_free.
16649
56c47203
AD
166502002-06-17 Akim Demaille <akim@epita.fr>
16651
16652 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
16653 (symbol_list_prepend, get_type_name): Move to...
16654 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
16655 (symbol_list_prepend, symbol_list_n_type_name_get): here.
16656 Adjust all callers.
16657 (symbol_list_free): New.
16658 * src/scan-gram.l (handle_dollar): Takes a location.
16659 * tests/input.at (Invalid $n): Adjust.
16660
1e0bab92
AD
166612002-06-17 Akim Demaille <akim@epita.fr>
16662
16663 * src/reader.h, src/reader.c (symbol_list_new): Export it.
16664 (symbol_list_prepend): New.
16665 * src/parse-gram.y (%union): `list' is a new member.
16666 (symbols.1): New, replaces...
16667 (terms_to_prec.1, nterms_to_type.1): these.
16668 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
16669 Take a location as additional argument.
16670 Adjust all callers.
16671
04e60654
AD
166722002-06-15 Akim Demaille <akim@epita.fr>
16673
16674 * src/parse-gram.y: Move %token in the declaration section so that
16675 we don't depend upon CVS Bison.
16676
10e5b8bd
AD
166772002-06-15 Akim Demaille <akim@epita.fr>
16678
16679 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
16680 * src/print.c (print_core): Use it.
16681
9801d40c
AD
166822002-06-15 Akim Demaille <akim@epita.fr>
16683
16684 * src/conflicts.c (log_resolution): Accept the rule involved in
16685 the sr conflicts instead of the lookahead number that points to
16686 that rule.
16687 (flush_reduce): Accept the current lookahead vector as argument,
16688 instead of the index in LA.
16689 (resolve_sr_conflict): Accept the current number of lookahead
16690 bitset to consider for the STATE, instead of the index in LA.
16691 (set_conflicts): Adjust.
16692 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
16693
c0263492
AD
166942002-06-15 Akim Demaille <akim@epita.fr>
16695
16696 * src/state.h (state_t): Replace the `lookaheadsp' member, a
16697 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
16698 Adjust all dependencies.
16699 * src/lalr.c (initialize_lookaheads): Split into...
16700 (states_lookaheads_count, states_lookaheads_initialize): these.
16701 (lalr): Adjust.
16702
9757c359
AD
167032002-06-15 Akim Demaille <akim@epita.fr>
16704
16705 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
16706 out of...
16707 (grammar_rules_print): here.
16708 * src/reduce.c (reduce_output): Use it.
16709 * tests/reduce.at (Useless Rules, Reduced Automaton)
16710 (Underivable Rules): Adjust.
16711
6b98e4b5
AD
167122002-06-15 Akim Demaille <akim@epita.fr>
16713
16714 Copy BYacc's nice way to report the grammar.
16715
16716 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
16717 New.
16718 Don't print the rules' location, it is confusing and useless.
16719 (rule_print): Use grammar_rhs_print.
16720 * src/print.c (print_grammar): Use grammar_rules_print.
16721
6b98e4b5
AD
167222002-06-15 Akim Demaille <akim@epita.fr>
16723
16724 Complete and rationalize `useless thing' warnings.
16725
16726 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
16727 (symbol_tag_print): New.
16728 Use them everywhere in place of accessing directly the tag member.
16729 * src/gram.h, src/gram.c (rule_print): New.
16730 Use it where a rule used to be printed `by hand'.
16731 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
16732 (reduce_grammar_tables): Report the useless rules.
16733 (reduce_print): Useless things are a warning, not an error.
16734 Report it as such.
16735 * tests/reduce.at (Useless Nonterminals, Useless Rules):
16736 (Reduced Automaton, Underivable Rules): Adjust.
16737 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
16738 * tests/conflicts.at (Unresolved SR Conflicts)
16739 (Solved SR Conflicts): Adjust.
16740
ee000ba4
AD
167412002-06-15 Akim Demaille <akim@epita.fr>
16742
16743 Let symbols have a location.
16744
16745 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
16746 (getsym): Adjust.
16747 Adjust all callers.
16748 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
16749 Use location_t, not int.
16750 * src/symtab.c (symbol_check_defined): Take advantage of the
16751 location.
16752 * tests/regression.at (Invalid inputs): Adjust.
16753
8efe435c
AD
167542002-06-15 Akim Demaille <akim@epita.fr>
16755
16756 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
16757 (input): Don't try to initialize yylloc here, do it in the
16758 scanner.
16759 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
16760 * src/gram.h (rule_t): Change line and action_line into location
16761 and action_location, of location_t type.
16762 Adjust all dependencies.
16763 * src/location.h, src/location.c (empty_location): New.
16764 * src/reader.h, src/reader.c (grammar_start_symbol_set)
16765 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
16766 (grammar_current_rule_symbol_append)
16767 (grammar_current_rule_action_append): Expect a location as argument.
16768 * src/reader.c (grammar_midrule_action): Adjust to attach an
16769 action's location as dummy symbol location.
16770 * src/symtab.h, src/symtab.c (startsymbol_location): New.
16771 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
16772 the line numbers.
16773
1921f1d7
AD
167742002-06-14 Akim Demaille <akim@epita.fr>
16775
16776 Grammar declarations may be found in the grammar section.
16777
16778 * src/parse-gram.y (rules_or_grammar_declaration): New.
16779 (declarations): Each declaration may end with a semicolon, not
16780 just...
16781 (grammar_declaration): `"%union"'.
16782 (grammar): Branch to rules_or_grammar_declaration.
16783
4515534c
AD
167842002-06-14 Akim Demaille <akim@epita.fr>
16785
16786 * src/main.c (main): Invoke scanner_free.
16787
f958596b
AD
167882002-06-14 Akim Demaille <akim@epita.fr>
16789
16790 * src/output.c (m4_invoke): Extracted from...
16791 (output_skeleton): here.
16792 Free tempfile.
16793
2c569025
AD
167942002-06-14 Akim Demaille <akim@epita.fr>
16795
16796 * src/parse-gram.y (directives, directive, gram)
16797 (grammar_directives, precedence_directives, precedence_directive):
16798 Rename as...
16799 (declarations, declaration, grammar, grammar_declaration)
16800 (precedence_declaration, precedence_declarator): these.
16801 (symbol_declaration): New.
16802
592e8d4d
AD
168032002-06-14 Akim Demaille <akim@epita.fr>
16804
16805 * src/files.c (action_obstack): Remove, unused.
16806 (output_obstack): Remove it, and all its dependencies, as it is no
16807 longer needed.
16808 * src/reader.c (epilogue_set): Build the epilogue in the
16809 muscle_obstack.
16810 * src/output.h, src/output.c (muscle_obstack): Move to...
16811 * src/muscle_tab.h, src/muscle_tab.h: here.
16812 (muscle_init): Initialize muscle_obstack.
16813 (muscle_free): New.
16814 * src/main.c (main): Call it.
16815
0c15323d
AD
168162002-06-14 Akim Demaille <akim@epita.fr>
16817
16818 * src/location.h: New, extracted from...
16819 * src/reader.h: here.
16820 * src/Makefile.am (noinst_HEADERS): Merge into
16821 (bison_SOURCES): this.
16822 Add location.h.
16823 * src/parse-gram.y: Use location_t instead of Bison's.
16824 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
16825 Use location_t instead of ints.
16826
e96c9728
AD
168272002-06-14 Akim Demaille <akim@epita.fr>
16828
16829 * data/bison.simple, data/bison.c++: Be sure to restore the
16830 current #line when returning to the skeleton contents after having
16831 exposed the input file's #line.
16832
75d1fe16
AD
168332002-06-12 Akim Demaille <akim@epita.fr>
16834
16835 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
16836 eager.
16837 * tests/actions.at (Exotic Dollars): New.
16838
6c35d22c
AD
168392002-06-12 Akim Demaille <akim@epita.fr>
16840
16841 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
16842 ['"/] too eagerly.
16843 * tests/input.at (Torturing the Scanner): New.
16844
1d6412ad
AD
168452002-06-11 Akim Demaille <akim@epita.fr>
16846
16847 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
16848 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
16849 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
16850 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
16851 * src/reader.c (reader): Use it.
16852
4cdb01db
AD
168532002-06-11 Akim Demaille <akim@epita.fr>
16854
16855 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
16856 Adjust all callers.
16857 (scanner_last_string_free): New.
16858
44995b2e
AD
168592002-06-11 Akim Demaille <akim@epita.fr>
16860
16861 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
16862 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
16863 (last_string, YY_OBS_FREE): New.
16864 Use them when returning an ID.
16865
e9955c83
AD
168662002-06-11 Akim Demaille <akim@epita.fr>
16867
16868 Have Bison grammars parsed by a Bison grammar.
16869
16870 * src/reader.c, src/reader.h (prologue_augment): New.
16871 * src/reader.c (copy_definition): Remove.
16872
16873 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
16874 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
16875 (grammar_current_rule_prec_set, grammar_current_rule_check)
16876 (grammar_current_rule_symbol_append)
16877 (grammar_current_rule_action_append): Export.
16878 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
16879 (symbol_list_action_append): Remove.
16880 Hook the routines from reader.
16881 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
16882 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
16883
16884 * src/reader.c (read_declarations): Remove, unused.
16885
16886 * src/parse-gram.y: Handle the epilogue.
16887 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
16888 (grammar_start_symbol_set): this.
16889 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
16890 * src/reader.c (readgram): Remove, unused.
16891 (reader): Adjust to insert eoftoken and axiom where appropriate.
16892
16893 * src/reader.c (copy_dollar): Replace with...
16894 * src/scan-gram.h (handle_dollar): this.
16895 * src/parse-gram.y: Remove `%thong'.
16896
16897 * src/reader.c (copy_at): Replace with...
16898 * src/scan-gram.h (handle_at): this.
16899
16900 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
16901 New.
16902
16903 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
16904 time being.
16905
16906 * src/reader.h, src/reader.c (grammar_rule_end): New.
16907
16908 * src/parse.y (current_type, current_class): New.
16909 Implement `%nterm', `%token' support.
16910 Merge `%term' into `%token'.
16911 (string_as_id): New.
16912 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
16913 type name.
16914
16915 * src/parse-gram.y: Be sure to handle properly the beginning of
16916 rules.
16917
16918 * src/parse-gram.y: Handle %type.
16919 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
16920
16921 * src/parse-gram.y: More directives support.
16922 * src/options.c: No longer handle source directives.
16923
16924 * src/parse-gram.y: Fix %output.
16925
16926 * src/parse-gram.y: Handle %union.
16927 Use the prologue locations.
16928 * src/reader.c (parse_union_decl): Remove.
16929
16930 * src/reader.h, src/reader.c (epilogue_set): New.
16931 * src/parse-gram.y: Use it.
16932
16933 * data/bison.simple, data/bison.c++: b4_stype is now either not
16934 defined, then default to int, or to the contents of %union,
16935 without `union' itself.
16936 Adjust.
16937 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
16938
16939 * src/output.c (actions_output): Don't output braces, as they are
16940 already handled by the scanner.
16941
16942 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
16943 characters to themselves.
16944
16945 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
16946 that the epilogue has a proper #line.
16947
16948 * src/parse-gram.y: Handle precedence/associativity.
16949
16950 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
16951 a terminal.
16952 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
16953 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
16954 at all to define terminals that cannot be emitted.
16955
16956 * src/scan-gram.l: Escape M4 characters.
16957
16958 * src/scan-gram.l: Working properly with escapes in user
16959 strings/characters.
16960
16961 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
16962 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
16963 grammar.
16964 Use more modest sizes, as for the time being the parser does not
16965 release memory, and therefore the process swallows a huge amount
16966 of memory.
16967
16968 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
16969 stricter %token grammar.
16970
16971 * src/symtab.h (associativity): Add `undef_assoc'.
16972 (symbol_precedence_set): Do nothing when passed an undef_assoc.
16973 * src/symtab.c (symbol_check_alias_consistence): Adjust.
16974
16975 * tests/regression.at (Invalid %directive): Remove, as it is now
16976 meaningless.
16977 (Invalid inputs): Adjust to the new error messages.
16978 (Token definitions): The new grammar doesn't allow too many
16979 eccentricities.
16980
16981 * src/lex.h, src/lex.c: Remove.
16982 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
16983 (copy_character, copy_string2, copy_string, copy_identifier)
16984 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
16985 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
16986 (parse_action): Remove.
16987 * po/POTFILES.in: Adjust.
16988
2e047461
AD
169892002-06-11 Akim Demaille <akim@epita.fr>
16990
cd05d13c 16991 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
16992 rule's action member: return the action as a string.
16993 Don't require `rule_length' as an argument: compute it.
16994 (grammar_current_rule_symbol_append)
16995 (grammar_current_rule_action_append): New, eved out from
16996 (readgram): here.
16997 Remove `action_flag', `rulelength', unused now.
16998
9af3fbce
AD
169992002-06-11 Akim Demaille <akim@epita.fr>
17000
17001 * src/reader.c (grammar_current_rule_prec_set).
17002 (grammar_current_rule_check): New, eved out from...
17003 (readgram): here.
17004 Remove `xaction', `first_rhs': useless.
17005 * tests/input.at (Type clashes): New.
17006 * tests/existing.at (GNU Cim Grammar): Adjust.
17007
1485e106
AD
170082002-06-11 Akim Demaille <akim@epita.fr>
17009
17010 * src/reader.c (grammar_midrule_action): New, Eved out from
17011 (readgram): here.
17012
da4160c3
AD
170132002-06-11 Akim Demaille <akim@epita.fr>
17014
17015 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
17016 New.
17017 (readgram): Use them as replacement of inlined code, crule and
17018 crule1.
17019
f6d0f937
AD
170202002-06-11 Akim Demaille <akim@epita.fr>
17021
17022 * src/reader.c (grammar_end, grammar_symbol_append): New.
17023 (readgram): Use them.
17024 Make the use of `p' as local as possible.
17025
69078d4b
AD
170262002-06-10 Akim Demaille <akim@epita.fr>
17027
17028 GCJ's parser requires the tokens to be defined before the prologue.
17029
17030 * data/bison.simple: Output the token definition before the user's
17031 prologue.
17032 * tests/regression.at (Braces parsing, Duplicate string)
17033 (Mixing %token styles): Check the output from bison.
17034 (Early token definitions): New.
17035
5e424082
AD
170362002-06-10 Akim Demaille <akim@epita.fr>
17037
17038 * src/symtab.c (symbol_user_token_number_set): Don't complain when
17039 assigning twice the same user number to a token, so that we can
17040 use it in...
17041 * src/lex.c (lex): here.
17042 Also use `symbol_class_set' instead of hand written code.
17043 * src/reader.c (parse_assoc_decl): Likewise.
17044
44536b35
AD
170452002-06-10 Akim Demaille <akim@epita.fr>
17046
17047 * src/symtab.c, src/symtab.c (symbol_class_set)
17048 (symbol_user_token_number_set): New.
17049 * src/reader.c (parse_token_decl): Use them.
17050 Use a switch instead of ifs.
17051 Use a single argument.
17052
8b9f2372
AD
170532002-06-10 Akim Demaille <akim@epita.fr>
17054
17055 Remove `%thong' support as it is undocumented, unused, duplicates
17056 `%token's job, and creates useless e-mail traffic with people who
17057 want to know what it is, why it is undocumented, unused, and
17058 duplicates `%token's job.
17059
17060 * src/reader.c (parse_thong_decl): Remove.
17061 * src/options.c (option_table): Remove "thong".
17062 * src/lex.h (tok_thong): Remove.
17063
3ae2b51f
AD
170642002-06-10 Akim Demaille <akim@epita.fr>
17065
17066 * src/symtab.c, src/symtab.c (symbol_type_set)
17067 (symbol_precedence_set): New.
17068 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
17069 (value_components_used): Remove, unused.
17070
2f1afb73
AD
170712002-06-09 Akim Demaille <akim@epita.fr>
17072
17073 Move symbols handling code out of the reader.
17074
17075 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
17076 (axiom): Move to...
17077 * src/symtab.h, src/symtab.c: here.
17078
17079 * src/gram.c (start_symbol): Remove: use startsymbol->number.
17080 * src/reader.c (startval): Rename as...
17081 * src/symtab.h, src/symtab.c (startsymbol): this.
17082 * src/reader.c: Adjust.
17083
17084 * src/reader.c (symbol_check_defined, symbol_make_alias)
17085 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
17086 (token_translations_init)
17087 Move to...
17088 * src/symtab.c: here.
17089 * src/reader.c (packsymbols): Move to...
17090 * src/symtab.h, src/symtab.c (symbols_pack): here.
17091 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
17092 argument.
17093
e9bca3ad
AD
170942002-06-03 Akim Demaille <akim@epita.fr>
17095
17096 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
17097 then statements.
17098
86eff183
AD
170992002-06-03 Akim Demaille <akim@epita.fr>
17100
17101 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
17102 structs with non literals.
17103 * src/scan-skel.l: never-interactive.
17104 * src/conflicts.c (enum conflict_resolution_e): No trailing
17105 comma.
17106 * src/getargs.c (usage): Split long literal strings.
17107 Reported by Hans Aberg.
17108
717be197
AD
171092002-05-28 Akim Demaille <akim@epita.fr>
17110
17111 * data/bison.c++: Use C++ ostreams.
17112 (cdebug_): New member.
17113
670ddffd
AD
171142002-05-28 Akim Demaille <akim@epita.fr>
17115
17116 * src/output.c (output_skeleton): Be sure to allocate enough room
17117 for `/' _and_ for `\0' in full_skeleton.
17118
769b430f
AD
171192002-05-28 Akim Demaille <akim@epita.fr>
17120
17121 * data/bison.c++: Catch up with bison.simple:
17122 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17123 and Paul Eggert <eggert@twinsun.com>: `error' handing.
17124 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
17125 and popping traces.
17126
7067cb36
PH
171272002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17128
17129 * src/output.c (output_skeleton): Put an explicit path in front of
17130 the skeleton file name, rather than relying on the -I directory,
17131 to partially alleviate effects of having a skeleton file lying around
17132 in the current directory.
769b430f 17133
4a713ec2
PH
171342002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17135
769b430f 17136 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
17137 obstack_printf should be obstack_fgrow1.
17138
b408954b
AD
171392002-05-26 Akim Demaille <akim@epita.fr>
17140
17141 * src/state.h (state_t): `solved_conflicts' is a new member.
17142 * src/LR0.c (new_state): Set it to 0.
17143 * src/conflicts.h, src/conflicts.c (print_conflicts)
17144 (free_conflicts, solve_conflicts): Rename as...
17145 (conflicts_print, conflicts_free, conflicts_solve): these.
17146 Adjust callers.
17147 * src/conflicts.c (enum conflict_resolution_e)
17148 (solved_conflicts_obstack): New, used by...
17149 (log_resolution): this.
17150 Adjust to attach the conflict resolution to each state.
17151 Complete the description with the precedence/associativity
17152 information.
17153 (resolve_sr_conflict): Adjust.
17154 * src/print.c (print_state): Output its solved_conflicts.
17155 * tests/conflicts.at (Unresolved SR Conflicts)
17156 (Solved SR Conflicts): Exercise --report=all.
17157
a49aecd5
AD
171582002-05-26 Akim Demaille <akim@epita.fr>
17159
17160 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
17161 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
17162 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
17163 (token_number_t, item_number_as_token_number)
17164 (token_number_as_item_number, muscle_insert_token_number_table):
17165 Rename as...
17166 (symbol_number_t, item_number_as_symbol_number)
17167 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
17168 these, since it is more appropriate.
17169
5504898e
AD
171702002-05-26 Akim Demaille <akim@epita.fr>
17171
17172 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
17173 `Error:' lines.
17174 * data/bison.simple (yystos) [YYDEBUG]: New.
17175 (yyparse) [YYDEBUG]: Display the symbols which are popped during
17176 error recovery.
17177 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
17178
ec3bc396
AD
171792002-05-25 Akim Demaille <akim@epita.fr>
17180
17181 * doc/bison.texinfo (Debugging): Split into...
17182 (Tracing): this new section, its former contents, and...
17183 (Understanding): this new section.
17184 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
17185 by...
17186 (report_flag): this.
17187 Adjust all dependencies.
17188 (report_args, report_types, report_argmatch): New.
17189 (usage, getargs): Report/support -r, --report.
17190 * src/options.h
17191 (struct option_table_struct): Rename as..,
17192 (struct option_table_s): this.
17193 Rename the `set_flag' member to `flag' to match with getopt_long's
17194 struct.
17195 * src/options.c (option_table): Split verbose into an entry for
17196 %verbose, and another for --verbose.
17197 Support --report/-r, so remove -r from the obsolete --raw.
17198 * src/print.c: Attach full item sets and lookaheads reports to
17199 report_flag instead of trace_flag.
17200 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
17201
78df8250
PE
172022002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17203 and Paul Eggert <eggert@twinsun.com>
769b430f 17204
78df8250
PE
17205 * data/bison.simple (yyparse): Correct error handling to conform to
17206 POSIX and yacc. Specifically, after syntax error is discovered,
17207 do not reduce further before shifting the error token.
17208 Clean up the code a bit by removing the labels yyerrdefault,
17209 yyerrhandle, yyerrpop.
17210 * NEWS: Document the above.
17211
c0c9ea05
PH
172122002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17213
17214 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
17215 type; it isn't always big enough, since it doesn't necessarily
17216 include non-terminals.
769b430f 17217 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
17218 the latter can be removed.
17219 (yy_token_number_type): Remove, only one use.
17220 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
17221 don't use TokenNumberType as element type.
769b430f 17222
c0c9ea05
PH
17223 * tests/regression.at: Modify expected output to agree with change
17224 to yyr1 and yytranslate.
769b430f 17225
6390a83f
FK
172262002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
17227
17228 * src/reader.c (parse_action): Use copy_character instead of
17229 obstack_1grow.
17230
db7c8e9a
AD
172312002-05-13 Akim Demaille <akim@epita.fr>
17232
17233 * tests/regression.at (Token definitions): Prototype yylex and
17234 yyerror.
17235
fcc61800
PH
172362002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17237
158c687b 17238 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
17239 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
17240 32-bit arithmetic.
17241 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
17242
5683e9b2
AD
172432002-05-07 Akim Demaille <akim@epita.fr>
17244
17245 * tests/synclines.at: Be sure to prototype yylex and yyerror to
17246 avoid GCC warnings.
17247
0c2d3f4c
AD
172482002-05-07 Akim Demaille <akim@epita.fr>
17249
17250 Kill GCC warnings.
17251
17252 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
17253 over the RHS of each rule.
17254 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
17255 * src/state.h (state_t): Member `nitems' is unsigned short.
17256 * src/LR0.c (get_state): Adjust.
17257 * src/reader.c (packgram): Likewise.
17258 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
17259 `Type'.
17260 (muscle_insert_int_table): Remove, unused.
17261 (prepare_rules): Remove `max'.
17262
1565b720
AD
172632002-05-06 Akim Demaille <akim@epita.fr>
17264
17265 * src/closure.c (print_firsts): Display of the symbol tags.
17266 (bitmatrix_print): Move to...
17267 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
17268 here.
17269 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
17270
cfaee611
AD
172712002-05-06 Akim Demaille <akim@epita.fr>
17272
17273 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
17274 hash_do_for_each.
17275
458be8e0
AD
172762002-05-06 Akim Demaille <akim@epita.fr>
17277
17278 * src/LR0.c (new_state, get_state): Instead of using the global
17279 `kernel_size' and `kernel_base', have two new arguments:
17280 `core_size' and `core'.
17281 Adjust callers.
17282
a900a624
AD
172832002-05-06 Akim Demaille <akim@epita.fr>
17284
17285 * src/reader.c (packgram): No longer end `ritem' with a 0
17286 sentinel: it is not used.
17287
d4e7d3a1
AD
172882002-05-05 Akim Demaille <akim@epita.fr>
17289
17290 New experimental feature: display the lookaheads in the report and
17291 graph.
17292
17293 * src/print (print_core): When --trace-flag, display the rules
17294 lookaheads.
17295 * src/print_graph.c (print_core): Likewise.
17296 Swap the arguments.
17297 Adjust caller.
17298
39ceb25b
AD
172992002-05-05 Akim Demaille <akim@epita.fr>
17300
17301 * tests/torture.at (Many lookaheads): New test.
17302
5372019f
AD
173032002-05-05 Akim Demaille <akim@epita.fr>
17304
17305 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
17306 (GENERATE_MUSCLE_INSERT_TABLE): this.
17307 (output_int_table, output_unsigned_int_table, output_short_table)
17308 (output_token_number_table, output_item_number_table): Replace with...
17309 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
17310 (muscle_insert_short_table, muscle_insert_token_number_table)
17311 (muscle_insert_item_number_table): these.
17312 Adjust all callers.
17313 (prepare_tokens): Don't free `translations', since...
17314 * src/reader.h, src/reader.c (grammar_free): do it.
17315 Move to...
17316 * src/gram.h, src/gram.c (grammar_free): here.
17317 * data/bison.simple, data/bison.c++: b4_token_number_max is now
17318 b4_translate_max.
17319
5df5f6d5
AD
173202002-05-05 Akim Demaille <akim@epita.fr>
17321
17322 * src/output.c (output_unsigned_int_table): New.
17323 (prepare_rules): `i' is unsigned.
17324 `prhs', `rline', `r2' are unsigned int.
17325 Rename muscle `rhs_number_max' as `rhs_max'.
17326 Output muscles `prhs_max', `rline_max', and `r2_max'.
17327 Free rline and r1.
17328 * data/bison.simple, data/bison.c++: Adjust to use these muscles
17329 to compute types instead of constant types.
17330 * tests/regression.at (Web2c Actions): Adjust.
17331
b87f8b21
AD
173322002-05-04 Akim Demaille <akim@epita.fr>
17333
17334 * src/symtab.h (SALIAS, SUNDEF): Rename as...
17335 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
17336 Adjust dependencies.
17337 * src/output.c (token_definitions_output): Be sure not to output a
17338 `#define 'a'' when fed with `%token 'a' "a"'.
17339 * tests/regression.at (Token definitions): New.
17340
8bb936e4
PE
173412002-05-03 Paul Eggert <eggert@twinsun.com>
17342
17343 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
17344 for K&R C.
17345
173462002-05-03 gettextize <bug-gnu-gettext@gnu.org>
17347
17348 * Makefile.am (SUBDIRS): Remove intl.
17349 (EXTRA_DIST): Add config/config.rpath.
17350
53c71a12
AD
173512002-05-03 Akim Demaille <akim@epita.fr>
17352
17353 * data/bison.simple (m4_if): Don't output empty enums.
17354 And actually, output valid enum definitions :(.
17355
289dd0cf
AD
173562002-05-03 Akim Demaille <akim@epita.fr>
17357
17358 * configure.bat: Remove, completely obsolete.
17359 * Makefile.am (EXTRA_DIST): Adjust.
17360 Don't distribute config.rpath...
17361 * config/Makefile.am (EXTRA_DIST): Do it.
17362
db85e524
AD
173632002-05-03 Akim Demaille <akim@epita.fr>
17364
17365 * configure.in (GETTEXT_VERSION): New.
17366 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
17367
83ccf991
AD
173682002-05-03 Akim Demaille <akim@epita.fr>
17369
17370 * data/bison.simple (b4_token_enum): New.
17371 (b4_token_defines): Use it to output tokens both as #define and
17372 enums.
17373 Suggested by Paul Eggert.
17374 * src/output.c (token_definitions_output): Don't output spurious
17375 white spaces.
17376
1f418995
AD
173772002-05-03 Akim Demaille <akim@epita.fr>
17378
17379 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
17380
45119f04
RA
173812002-05-02 Robert Anisko <robert@lrde.epita.fr>
17382
17383 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
17384 Update the stack class, give a try to deque as the default container.
17385
b2d52318
AD
173862002-05-02 Akim Demaille <akim@epita.fr>
17387
17388 * data/bison.simple (yyparse): Do not implement @$ = @1.
17389 (YYLLOC_DEFAULT): Adjust to do it.
17390 * doc/bison.texinfo (Location Default Action): Fix.
17391
3a8b4109
AD
173922002-05-02 Akim Demaille <akim@epita.fr>
17393
17394 * src/reader.c (parse_braces): Merge into...
17395 (parse_action): this.
17396
84614e13
AD
173972002-05-02 Akim Demaille <akim@epita.fr>
17398
17399 * configure.in (ALL_LINGUAS): Remove.
17400 * po/LINGUAS, hr.po: New.
17401
fdbcd8e2
AD
174022002-05-02 Akim Demaille <akim@epita.fr>
17403
17404 Remove the so called hairy (semantic) parsers.
17405
17406 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
17407 * src/gram.h, src/gram.c (semantic_parser): Remove.
17408 (rule_t): Remove the guard and guard_line members.
17409 * src/lex.h (token_t): remove tok_guard.
17410 * src/options.c (option_table): Remove %guard and %semantic_parser
17411 support.
17412 * src/output.c, src/output.h (guards_output): Remove.
17413 (prepare): Adjust.
17414 (token_definitions_output): Don't output the `T'
17415 tokens (???).
17416 (output_skeleton): Don't output the guards.
17417 * src/files.c, src/files.c (attrsfile): Remove.
17418 * src/reader.c (symbol_list): Remove the guard and guard_line
17419 members.
17420 Adjust dependencies.
17421 (parse_guard): Remove.
17422 * data/bison.hairy: Remove.
17423 * doc/bison.texinfo (Environment Variables): Remove occurrences of
17424 BISON_HAIRY.
17425
82b6cb3f
AD
174262002-05-02 Akim Demaille <akim@epita.fr>
17427
17428 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
17429 (parse_guard): Rename the formal argument `stack_offset' as
17430 `rule_length', which is more readable.
17431 Adjust callers.
17432 (copy_at, copy_dollar): Instead of outputting the hard coded
17433 values of $$, $n and so forth, output invocation to b4_lhs_value,
17434 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
17435 Note: this patch partially drops `semantic-parser' support: it
17436 always does `rule_length - n', where semantic parsers ought to
17437 always use `-n'.
82b6cb3f
AD
17438 * data/bison.simple, data/bison.c++ (b4_lhs_value)
17439 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
17440
6cbfbcc5
AD
174412002-05-02 Akim Demaille <akim@epita.fr>
17442
17443 * configure.in (AC_INIT): Bump to 1.49b.
17444 (AM_INIT_AUTOMAKE): Short invocation.
17445
b8548114
AD
174462002-05-02 Akim Demaille <akim@epita.fr>
17447
17448 Version 1.49a.
17449
c20cd1fa
AD
174502002-05-01 Akim Demaille <akim@epita.fr>
17451
17452 * src/skeleton.h: Remove.
17453
8a9566d4
AD
174542002-05-01 Akim Demaille <akim@epita.fr>
17455
17456 * src/skeleton.h: Fix the #endif.
17457 Reported by Magnus Fromreide.
17458
8c6d399a
PE
174592002-04-26 Paul Eggert <eggert@twinsun.com>
17460
17461 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
17462 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 17463 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 17464
2b7ed18a
RA
174652002-04-25 Robert Anisko <robert@lrde.epita.fr>
17466
17467 * src/scan-skel.l: Postprocess quadrigraphs.
17468
17469 * src/reader.c (copy_character): New function, used to output
17470 single characters while replacing `[' and `]' with quadrigraphs, to
17471 avoid troubles with M4 quotes.
17472 (copy_comment): Output characters with copy_character.
17473 (read_additionnal_code): Likewise.
17474 (copy_string2): Likewise.
17475 (copy_definition): Likewise.
17476
17477 * tests/calc.at: Exercise M4 quoting.
17478
34a89c50
AD
174792002-04-25 Akim Demaille <akim@epita.fr>
17480
17481 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
17482 between `!' and the command.
17483 Reported by Paul Eggert.
17484
0dd1580a
RA
174852002-04-24 Robert Anisko <robert@lrde.epita.fr>
17486
17487 * tests/calc.at: Exercise prologue splitting.
17488
17489 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
17490 `b4_post_prologue' instead of `b4_prologue'.
17491
17492 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
17493 muscles.
17494 (output): Free pre_prologue_obstack and post_prologue_obstack.
17495 * src/files.h, src/files.c (attrs_obstack): Remove.
17496 (pre_prologue_obstack, post_prologue_obstack): New.
17497 * src/reader.c (copy_definition): Add a parameter to specify the
17498 obstack to fill, instead of using attrs_obstack unconditionally.
17499 (read_declarations): Pass pre_prologue_obstack to copy_definition if
17500 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
17501
83c1796f
PE
175022002-04-23 Paul Eggert <eggert@twinsun.com>
17503
17504 * data/bison.simple: Remove unnecessary commentary and white
17505 space differences from 1_29-branch.
17506 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
17507
17508 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
17509 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
17510 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
17511 constructors or destructors.
17512
17513 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
17514
1207eeac
AD
175152002-04-23 Akim Demaille <akim@epita.fr>
17516
17517 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
17518 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
17519 location with columns.
17520 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
17521 All reported by Paul Eggert.
17522
78ab8f67
AD
175232002-04-22 Akim Demaille <akim@epita.fr>
17524
17525 * src/reduce.c (dump_grammar): Move to...
17526 * src/gram.h, src/gram.c (grammar_dump): here.
17527 Be sure to separate long item numbers.
17528 Don't read the members of a rule's prec if its nil.
17529
133c20e2
AD
175302002-04-22 Akim Demaille <akim@epita.fr>
17531
17532 * src/output.c (table_size, table_grow): New.
17533 (MAXTABLE): Remove, replace uses with table_size.
17534 (pack_vector): Instead of dying when the table is too big, grow it.
17535
9515e8a7
AD
175362002-04-22 Akim Demaille <akim@epita.fr>
17537
17538 * data/bison.simple (yyr1): Its type is that of a token number.
17539 * data/bison.c++ (r1_): Likewise.
17540 * tests/regression.at (Web2c Actions): Adjust.
17541
23c5a174
AD
175422002-04-22 Akim Demaille <akim@epita.fr>
17543
17544 * src/reader.c (token_translations_init): 256 is now the default
17545 value for the error token, i.e., it will be assigned another
17546 number if the user assigned 256 to one of her tokens.
17547 (reader): Don't force 256 to error.
17548 * doc/bison.texinfo (Symbols): Adjust.
17549 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
17550 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
17551 etc. instead of 10, 20, 30 (which was used to `jump' over error
17552 (256) and undefined (2)).
17553
5fbb0954
AD
175542002-04-22 Akim Demaille <akim@epita.fr>
17555
17556 Propagate more token_number_t.
17557
17558 * src/gram.h (token_number_as_item_number)
17559 (item_number_as_token_number): New.
17560 * src/output.c (GENERATE_OUTPUT_TABLE): New.
17561 Use it to create output_item_number_table and
17562 output_token_number_table.
17563 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
17564 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
17565 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
17566 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
17567
4f940944
AD
175682002-04-22 Akim Demaille <akim@epita.fr>
17569
17570 * src/output.h, src/output.c (get_lines_number): Remove.
17571
3ded9a63
AD
175722002-04-19 Akim Demaille <akim@epita.fr>
17573
17574 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
17575 as Lex/Flex'.
17576 (Debugging): More details about enabling the debugging features.
17577 (Table of Symbols): Describe $$, $n, @$, and @n.
17578 Suggested by Tim Josling.
17579
e0c471a9
AD
175802002-04-19 Akim Demaille <akim@epita.fr>
17581
17582 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
17583
fecc10cd
AD
175842002-04-10 Akim Demaille <akim@epita.fr>
17585
17586 * src/system.h: Rely on HAVE_LIMITS_H.
17587 Suggested by Paul Eggert.
17588
51dec47b
AD
175892002-04-09 Akim Demaille <akim@epita.fr>
17590
17591 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
17592 full stderr, and strip it according to the bison options, instead
17593 of composing the error message from different bits.
17594 This makes it easier to check for several error messages.
17595 Adjust all the invocations.
17596 Add an invocation exercising the error token.
17597 Add an invocation demonstrating a stupid error message.
17598 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
17599 Adjust the tests.
17600 Error message are for stderr, not stdout.
17601
007a50a4
AD
176022002-04-09 Akim Demaille <akim@epita.fr>
17603
17604 * src/gram.h, src/gram.c (error_token_number): Remove, use
17605 errtoken->number.
17606 * src/reader.c (reader): Don't specify the user token number (2)
17607 for $undefined, as it uselessly prevents using it.
17608 * src/gram.h (token_number_t): Move to...
17609 * src/symtab.h: here.
17610 (state_t.number): Is a token_number_t.
17611 * src/print.c, src/reader.c: Use undeftoken->number instead of
17612 hard coded 2.
17613 (Even though this 2 is not the same as above: the number of the
17614 undeftoken remains being 2, it is its user token number which
17615 might not be 2).
17616 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
17617 `user_token_number_max'.
17618 Output `undef_token_number'.
17619 * data/bison.simple, data/bison.c++: Use them.
17620 Be sure to map invalid yylex return values to
17621 `undef_token_number'. This saves us from gratuitous SEGV.
17622
17623 * tests/conflicts.at (Solved SR Conflicts)
17624 (Unresolved SR Conflicts): Adjust.
17625 * tests/regression.at (Web2c Actions): Adjust.
17626
06446ccf
AD
176272002-04-08 Akim Demaille <akim@epita.fr>
17628
17629 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
17630 Adding #line.
17631 Remove the duplicate `typedefs'.
17632 (RhsNumberType): Fix the declaration and various other typos.
17633 Use __ofile__.
17634 * data/bison.simple: Use __ofile__.
17635 * src/scan-skel.l: Handle __ofile__.
17636
62a3e4f0
AD
176372002-04-08 Akim Demaille <akim@epita.fr>
17638
17639 * src/gram.h (item_number_t): New, the type of item numbers in
17640 RITEM. Note that it must be able to code symbol numbers as
17641 positive number, and the negation of rule numbers as negative
17642 numbers.
17643 Adjust all dependencies (pretty many).
17644 * src/reduce.c (rule): Remove this `short *' pointer: use
17645 item_number_t.
17646 * src/system.h (MINSHORT, MAXSHORT): Remove.
17647 Include `limits.h'.
17648 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
17649 (shortcpy): Remove.
17650 (MAXTABLE): Move to...
17651 * src/output.c (MAXTABLE): here.
17652 (prepare_rules): Use output_int_table to output rhs.
17653 * data/bison.simple, data/bison.c++: Adjust.
17654 * tests/torture.at (Big triangle): Move the limit from 254 to
17655 500.
17656 * tests/regression.at (Web2c Actions): Ajust.
17657
17658 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
17659 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
17660 passes, but produces negative #line number, once fixed, GCC is
17661 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
17662 C), it passes.
17663 * src/state.h (state_h): Code input lines on ints, not shorts.
17664
bb88b0fc
AD
176652002-04-08 Akim Demaille <akim@epita.fr>
17666
17667 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
17668 and then the grammar.
17669
9a636f47
AD
176702002-04-08 Akim Demaille <akim@epita.fr>
17671
17672 * src/system.h: No longer using strndup.
17673
680e8701
AD
176742002-04-07 Akim Demaille <akim@epita.fr>
17675
17676 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
17677 * src/output.c (output_table_data): Return the longest number.
17678 (prepare_tokens): Output `token_number_max').
17679 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
17680 New.
17681 Use them to define yy_token_number_type/TokenNumberType.
17682 Use this type for yytranslate.
17683 * tests/torture.at (Big triangle): Push the limit from 124 to
17684 253.
17685 * tests/regression.at (Web2c Actions): Adjust.
17686
817e9f41
AD
176872002-04-07 Akim Demaille <akim@epita.fr>
17688
17689 * tests/torture.at (Big triangle): New.
17690 (GNU AWK Grammar, GNU Cim Grammar): Move to...
17691 * tests/existing.at: here.
17692
5123689b
AD
176932002-04-07 Akim Demaille <akim@epita.fr>
17694
17695 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
17696 nritems.
17697 Adjust dependencies.
17698
f3849179
AD
176992002-04-07 Akim Demaille <akim@epita.fr>
17700
17701 * src/reader.c: Normalize increments to prefix form.
17702
bd02036a
AD
177032002-04-07 Akim Demaille <akim@epita.fr>
17704
17705 * src/reader.c, symtab.c: Remove debugging code.
17706
db8837cb
AD
177072002-04-07 Akim Demaille <akim@epita.fr>
17708
17709 Rename all the `bucket's as `symbol_t'.
17710
17711 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
17712 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
17713 * src/symtab.c, src/symtab.h (bucket): Rename as...
17714 (symbol_t): this.
17715 (symbol_list_new, bucket_check_defined, bucket_make_alias)
17716 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
17717 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
17718 (buckets_new, buckets_free, buckets_do): Rename as...
17719 (symbol_list_new, symbol_check_defined, symbol_make_alias)
17720 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
17721 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
17722 (symbols_new, symbols_free, symbols_do): these.
17723
72a23c97
AD
177242002-04-07 Akim Demaille <akim@epita.fr>
17725
17726 Use lib/hash for the symbol table.
17727
17728 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
17729 EOF.
17730 * src/lex.c (lex): Set the `number' member of new terminals.
17731 * src/reader.c (bucket_check_defined, bucket_make_alias)
17732 (bucket_check_alias_consistence, bucket_translation): New.
17733 (reader, grammar_free, readgram, token_translations_init)
17734 (packsymbols): Adjust.
17735 (reader): Number the predefined tokens.
17736 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
17737 for predefined tokens.
17738 * src/symtab.h (bucket): Remove all the hash table related
17739 members.
17740 * src/symtab.c (symtab): Replace by...
17741 (bucket_table): this.
17742 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
17743 (buckets_new, buckets_do): New.
17744
280a38c3
AD
177452002-04-07 Akim Demaille <akim@epita.fr>
17746
17747 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
17748 (start_symbol, max_user_token_number, semantic_parser)
17749 (error_token_number): Initialize.
17750 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
17751 Initialize.
17752 (reader): Don't.
17753 (errtoken, eoftoken, undeftoken, axiom): Extern.
17754
03b31c0c
AD
177552002-04-07 Akim Demaille <akim@epita.fr>
17756
17757 * src/gram.h (rule_s): prec and precsym are now pointers
17758 to the bucket giving the priority/associativity.
17759 Member `associativity' removed: useless.
17760 * src/reduce.c, src/conflicts.c: Adjust.
17761
8b3df748
AD
177622002-04-07 Akim Demaille <akim@epita.fr>
17763
17764 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
17765 Properly escape the symbols' TAG when outputting them.
17766
e601aa1d
AD
177672002-04-07 Akim Demaille <akim@epita.fr>
17768
17769 * src/lalr.h (LA): Is a bitsetv, not bitset*.
17770
b0299a2e
AD
177712002-04-07 Akim Demaille <akim@epita.fr>
17772
17773 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
17774 (LArule): this, which is an array to rule_t*.
17775 * src/print.c, src/conflicts.c: Adjust.
17776
d7e1f00c
AD
177772002-04-07 Akim Demaille <akim@epita.fr>
17778
17779 * src/gram.h (rule_t): Rename `number' as `user_number'.
17780 `number' is a new member.
17781 Adjust dependencies.
17782 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
17783
cc9305dd
AD
177842002-04-07 Akim Demaille <akim@epita.fr>
17785
17786 As a result of the previous patch, it is no longer needed
17787 to reorder ritem itself.
17788
17789 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
17790
b0940840
AD
177912002-04-07 Akim Demaille <akim@epita.fr>
17792
17793 Be sure never to walk through RITEMS, but use only data related to
17794 the rules themselves. RITEMS should be banished.
17795
17796 * src/output.c (output_token_translations): Rename as...
17797 (prepare_tokens): this.
17798 In addition to `translate', prepare the muscles `tname' and
17799 `toknum', which were handled by...
17800 (output_rule_data): this.
17801 Remove, and move the remainder of its outputs into...
17802 (prepare_rules): this new routines, which also merges content from
17803 (output_gram): this.
17804 (prepare_rules): Be sure never to walk through RITEMS.
17805 (output_stos): Rename as...
17806 (prepare_stos): this.
17807 (output): Always invoke prepare_states, after all, just don't use it
17808 in the output if you don't need it.
17809
643a5994
AD
178102002-04-07 Akim Demaille <akim@epita.fr>
17811
17812 * src/LR0.c (new_state): Display `nstates' as the name of the
17813 newly created state.
17814 Adjust to initialize first_state and last_state if needed.
17815 Be sure to distinguish the initial from the final state.
17816 (new_states): Create the itemset of the initial state, and use
17817 new_state.
17818 * src/closure.c (closure): Now that the initial state has its
17819 items properly set, there is no need for a special case when
17820 creating `ruleset'.
17821
17822 As a result, now the rule 0, reducing to $axiom, is visible in the
17823 outputs. Adjust the test suite.
17824
17825 * tests/conflicts.at (Solved SR Conflicts)
17826 (Unresolved SR Conflicts): Adjust.
17827 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
17828 * tests/conflicts.at (S/R in initial): New.
17829
b4c4ccc2
AD
178302002-04-07 Akim Demaille <akim@epita.fr>
17831
17832 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
17833 the RHS of the rules.
17834 * src/output.c (output_gram): Likewise.
17835
bba97eb2
AD
178362002-04-07 Akim Demaille <akim@epita.fr>
17837
17838 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
17839 bucket.
17840 Adjust all dependencies.
17841 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
17842 `number' of the buckets too.
17843 * src/gram.h: Include `symtab.h'.
17844 (associativity): Move to...
17845 * src/symtab.h: here.
17846 No longer include `gram.h'.
17847
c3b407f4
AD
178482002-04-07 Akim Demaille <akim@epita.fr>
17849
17850 * src/gram.h, src/gram.c (rules_rhs_length): New.
17851 (ritem_longest_rhs): Use it.
17852 * src/gram.h (rule_t): `number' is a new member.
17853 * src/reader.c (packgram): Set it.
17854 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
17855 the end of `rules', and count them out of `nrules'.
17856 (reduce_output, dump_grammar): Adjust.
17857 * src/print.c (print_grammar): It is no longer needed to check for
17858 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
17859 * tests/reduce.at (Reduced Automaton): New test.
17860
11652ab3
AD
178612002-04-07 Akim Demaille <akim@epita.fr>
17862
17863 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
17864 lacking `+ 1' to nrules, Bison reported as useless a token if it
17865 was used solely to set the precedence of the last rule...
17866
26b23c1a
AD
178672002-04-07 Akim Demaille <akim@epita.fr>
17868
17869 * data/bison.c++, data/bison.simple: Don't output the current file
17870 name in #line, to avoid useless diffs between two identical
17871 outputs under different names.
17872
18bcecb0
AD
178732002-04-07 Akim Demaille <akim@epita.fr>
17874
17875 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
17876 Normalize loops to using `< nrules + 1', not `<= nrules'.
17877
fa770c86
AD
178782002-04-07 Akim Demaille <akim@epita.fr>
17879
17880 * TODO: Update.
17881
d9b739c3
AD
178822002-04-07 Akim Demaille <akim@epita.fr>
17883
17884 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
17885 bucket.value as bucket.number.
17886
99013900
AD
178872002-04-07 Akim Demaille <akim@epita.fr>
17888
17889 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
17890 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
17891 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
17892 RHS, instead of being an index in RITEMS.
17893
e966383b
PE
178942002-04-04 Paul Eggert <eggert@twinsun.com>
17895
17896 * doc/bison.texinfo: Update copyright date.
17897 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
17898 (Symbols): Warn about running Bison in one character set,
17899 but compiling and/or running in an incompatible one.
17900 Warn about character code 256, too.
17901
179022002-04-03 Paul Eggert <eggert@twinsun.com>
17903
17904 * src/bison.data (YYSTACK_ALLOC): Depend on whether
17905 YYERROR_VERBOSE is nonzero, not whether it is defined.
17906
17907 Merge changes from bison-1_29-branch.
c307773e 17908
8d6c48b9
PE
179092002-03-20 Paul Eggert <eggert@twinsun.com>
17910
17911 Merge fixes from Debian bison_1.34-1.diff.
17912
17913 * configure.in (AC_PREREQ): 2.53.
17914
e53c6322
AD
179152002-03-20 Akim Demaille <akim@epita.fr>
17916
17917 * src/conflicts.c (log_resolution): Argument `resolution' is const.
17918
9ffbeca7
PE
179192002-03-19 Paul Eggert <eggert@twinsun.com>
17920
21db0b2a
PE
17921 * src/bison.simple (YYCOPY): New macro.
17922 (YYSTACK_RELOCATE): Use it.
17923 Remove Type arg; no longer needed. All callers changed.
17924 (yymemcpy): Remove; no longer needed.
17925
9ffbeca7
PE
17926 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
17927 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
17928
642cb8f8
AD
179292002-03-19 Akim Demaille <akim@epita.fr>
17930
17931 Test and fix the #line outputs.
17932
17933 * tests/atlocal.at (GCC): New.
17934 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 17935 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
17936 (Action synch line, Epilogue synch line): New tests.
17937 * src/reader.c (parse_union_decl): Define the muscle stype_line.
17938 * data/bison.simple, data/bison.c++: Use it.
17939
3c31a486
AD
179402002-03-19 Akim Demaille <akim@epita.fr>
17941
17942 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
17943 (Solved SR Conflicts, %expect not enough, %expect right)
17944 (%expect too much): Move to...
17945 * tests/conflicts.at: this new file.
17946
0d8bed56
AD
179472002-03-19 Akim Demaille <akim@epita.fr>
17948
17949 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
17950 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
17951 that we can move to enums for instance.
17952 * src/output.c (token_definitions_output): Output a list of
17953 `token-name, token-number' instead of the #define.
17954 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
17955
9208d17f
AD
179562002-03-14 Akim Demaille <akim@epita.fr>
17957
17958 Use Gettext 0.11.1.
17959
af27eacb
RA
179602002-03-09 Robert Anisko <robert@lrde.epita.fr>
17961
17962 * data/bison.c++: Make the user able to add members to the generated
17963 parser by subclassing.
17964
9101a310
RA
179652002-03-05 Robert Anisko <robert@lrde.epita.fr>
17966
17967 * src/reader.c (read_additionnal_code): `c' should be an integer, not
17968 a character.
17969 Reported by Nicolas Tisserand and Nicolas Burrus.
17970
fff9bf0b
RA
179712002-03-04 Robert Anisko <robert@lrde.epita.fr>
17972
17973 * src/reader.c: Warn about lacking semi-colons, do not complain.
17974
64dba31e
RA
179752002-03-04 Robert Anisko <robert@lrde.epita.fr>
17976
17977 * data/bison.c++: Remove a debug line.
17978
374f5a14
RA
179792002-03-04 Robert Anisko <robert@lrde.epita.fr>
17980
17981 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
17982 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
17983 provide a default implementation.
17984
bfcf1f3a
AD
179852002-03-04 Akim Demaille <akim@epita.fr>
17986
17987 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
17988 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
17989 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
17990 * tests/semantic.at (Parsing Guards): Similarly.
17991 * src/reader.at (readgram): Complain if the last rule is not ended
17992 with a semi-colon.
17993
65ccf9fc
AD
179942002-03-04 Akim Demaille <akim@epita.fr>
17995
17996 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
17997 * src/closure.c: here.
17998 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
17999 RTC.
18000 * src/warshall.h, src/warshall.c: Remove.
18001 * tests/sets.at (Broken Closure): Adjust.
18002
d0039cbc
AD
180032002-03-04 Akim Demaille <akim@epita.fr>
18004
18005 * src/output.c (output_skeleton): tempdir is const.
18006 bytes_read is unused.
18007
345cea78
AD
180082002-03-04 Akim Demaille <akim@epita.fr>
18009
18010 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
18011 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
18012 Update.
18013 From Michael Hayes.
18014
564801f7
AD
180152002-03-04 Akim Demaille <akim@epita.fr>
18016
18017 * src/closure.c (closure): `r' is unused.
18018
e5352bc7
AD
180192002-03-04 Akim Demaille <akim@epita.fr>
18020
18021 * tests/sets.at (Broken Closure): Add the ending `;'.
18022 * src/reader.at (readgram): Complain if a rule is not ended with a
18023 semi-colon.
18024
914feea9
AD
180252002-03-04 Akim Demaille <akim@epita.fr>
18026
18027 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
18028 (count_sr_conflicts): Use bitset_count.
18029 * src/reduce.c (inaccessable_symbols): Ditto.
18030 (bits_size): Remove.
18031 * src/warshall.h, src/warshall.c: Convert to bitsetv.
18032
f0250de6
AD
180332002-03-04 Akim Demaille <akim@epita.fr>
18034
18035 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
18036 * src/reduce.c: Remove the `bitset_zero's following the
18037 `bitset_create's, as now it is performed by the latter.
18038
ef017502
AD
180392002-03-04 Akim Demaille <akim@epita.fr>
18040
18041 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
18042 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
18043 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
18044 latest sources from Michael.
18045
76514394
AD
180462002-03-04 Akim Demaille <akim@epita.fr>
18047
18048 * src/output.c (output): Don't free the grammar.
18049 * src/reader.c (grammar_free): New.
18050 * src/main.c (main): Call it and don't free symtab here.
18051
55024580
AD
180522002-03-04 Akim Demaille <akim@epita.fr>
18053
18054 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
18055 before returning.
18056 Reported by Benoit Perrot.
18057
f9abaa2c
AD
180582002-03-04 Akim Demaille <akim@epita.fr>
18059
18060 Use bitset operations when possible, not loops over bits.
18061
18062 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
18063 bitset_or.
18064 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
18065 * src/reduce.c (useless_nonterminals): Formatting changes.
18066 * src/warshall.c (TC): Use bitset_or.
18067
0e721e75
AD
180682002-03-04 Akim Demaille <akim@epita.fr>
18069
18070 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
18071 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
18072 Ditto.
18073
0fb1ffb1
AD
180742002-03-04 Akim Demaille <akim@epita.fr>
18075
18076 * src/lalr.c (F): Now a bitset*.
18077 Adjust all dependencies.
18078
b86796bf
AD
180792002-03-04 Akim Demaille <akim@epita.fr>
18080
18081 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
18082 Adjust all dependencies.
18083
602bbf31
AD
180842002-03-04 Akim Demaille <akim@epita.fr>
18085
18086 * src/L0.c, src/LR0.h (nstates): Be size_t.
18087 Adjust comparisons (signed vs unsigned).
18088 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
18089 bitset*.
18090 Adjust all dependencies.
18091
d8a0245c
AD
180922002-03-04 Akim Demaille <akim@epita.fr>
18093
18094 * src/closure.c (firsts): Now, also a bitset.
18095 Adjust all dependencies.
18096 (varsetsize): Remove, now unused.
18097 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
18098
34ba9743
AD
180992002-03-04 Akim Demaille <akim@epita.fr>
18100
18101 * src/print.c: Convert to use bitset.h, not hand coded iterations
18102 over ints.
18103
ed86e78c
AD
181042002-03-04 Akim Demaille <akim@epita.fr>
18105
18106 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
18107
dfdb1797
AD
181082002-03-04 Akim Demaille <akim@epita.fr>
18109
18110 * src/closure.c (ruleset): Be a bitset.
18111 (rulesetsize): Remove.
18112
7086e707
AD
181132002-03-04 Akim Demaille <akim@epita.fr>
18114
18115 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
18116 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
18117 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
18118 * src/closure.c (fderives): Be an array of bitsets.
18119
98254360
RA
181202002-02-28 Robert Anisko <robert@lrde.epita.fr>
18121
18122 * data/bison.c++: Merge the two generated headers. Insert a copyright
18123 notice in each output file.
18124
a75c057f
AD
181252002-02-28 Akim Demaille <akim@epita.fr>
18126
18127 * data/bison.c++: Copy the prologue of bison.simple to fetch
18128 useful M4 definitions, such as b4_header_guard.
18129
06b00abc
AD
181302002-02-25 Akim Demaille <akim@epita.fr>
18131
18132 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
18133 translator friendly scheme for the bgr
18134 copyright notice.
06b00abc 18135
70e7d534
AD
181362002-02-25 Akim Demaille <akim@epita.fr>
18137
18138 * src/output.c (header_output): Remove, now handled completely via
18139 M4.
18140
abe017f6
AD
181412002-02-25 Akim Demaille <akim@epita.fr>
18142
18143 * m4/m4.m4: New, from CVS Autoconf.
18144 * configure.in: Invoke it.
18145 * src/output.c (output_skeleton): Use its result instead of the
18146 hard coded name.
18147
381fb12e
AD
181482002-02-25 Akim Demaille <akim@epita.fr>
18149
18150 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
18151 Fileutils 4.1.5.
18152 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
18153 * src/output.c (output_skeleton): Use mkstemp to create a real
18154 temporary file.
18155 Move the filling of `skeleton' and its muscle to...
18156 (prepare): here.
18157 (output): Move the definition of the prologue muscle to...
18158 (prepare): here.
18159 * src/system.h (DEFAULT_TMPDIR): New.
18160
6f38107f
PE
181612002-02-14 Paul Eggert <eggert@twinsun.com>
18162
18163 Remove the support for C++ namespace cleanliness; it was
18164 causing more problems than it was curing, since it didn't work
18165 properly on some nonstandard C++ compilers. This can wait
18166 for a proper C++ parser.
18167
18168 * NEWS: Document this.
18169 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
18170 of C++, as it's treated like C now.
18171 * src/bison.simple (YYSTD): Remove.
18172 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
18173 Treat C++ just like Standard C instead of trying to support
18174 namespace cleanliness.
18175
80cce3da
AD
181762002-02-14 Akim Demaille <akim@epita.fr>
18177
18178 * tests/regression.at (else): Adjust to Andreas' change.
18179
842e8679
AD
181802002-02-14 Akim Demaille <akim@epita.fr>
18181
18182 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
18183
4bda3f10
AD
181842002-02-13 Andreas Schwab <schwab@suse.de>
18185
18186 * src/output.c (output_rule_data): Don't output NULL, it might
18187 not be defined yet.
18188
4162fa07 181892002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 18190
4162fa07
RA
18191 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
18192 (Copyright notice): Update.
b418ecd8 18193
bd16a5dc
AD
181942002-02-11 Akim Demaille <akim@epita.fr>
18195
18196 * tests/regression.at (%nonassoc and eof): Don't include
18197 nonportable headers.
18198
8d69a1a3
RA
181992002-02-08 Robert Anisko <robert@lrde.epita.fr>
18200
18201 * data/bison.c++: Correct error recovery. Make the user able to
18202 initialize the starting location.
18203
9b2d0677
AD
182042002-02-07 Akim Demaille <akim@epita.fr>
18205
18206 * tests/input.at: New.
18207
69e2658b
RA
182082002-02-07 Robert Anisko <robert@lrde.epita.fr>
18209
18210 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 18211 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
18212 directives around tables only needed for debugging.
18213
4aacc3a7
RA
182142002-02-07 Robert Anisko <robert@lrde.epita.fr>
18215
18216 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
18217 C++ parsers.
18218 (yy::b4_name::parse): Use print_.
18219
762a801e
RA
182202002-02-07 Robert Anisko <robert@lrde.epita.fr>
18221
18222 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
18223
4bb2bc3f
RA
182242002-02-07 Robert Anisko <robert@lrde.epita.fr>
18225
18226 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
18227 C++ parsers.
18228 (yy::b4_name::parse): Build verbose error messages, and use error_.
18229
6b45a3ca
RA
182302002-02-06 Robert Anisko <robert@lrde.epita.fr>
18231
18232 * data/bison.c++: Fix m4 quoting in comments.
18233
50997c6e
RA
182342002-02-06 Robert Anisko <robert@lrde.epita.fr>
18235
18236 * data/bison.c++: Adjust the parser code. Fix some muscles that were
18237 not expanded by m4.
18238
3f3eed27
AD
182392002-02-05 Akim Demaille <akim@epita.fr>
18240
18241 * data/bison.c++: Adjust to the M4 back end.
18242 More is certainly needed.
18243
be2a1a68
AD
182442002-02-05 Akim Demaille <akim@epita.fr>
18245
18246 Give a try to M4 as a back end.
18247
18248 * lib/readpipe.c: New, from wdiff.
18249 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
18250 BISON_HAIRY.
18251 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
18252 specific values. Now it is m4 that performs the lookup.
18253 * src/parse-skel.y: Remove.
18254 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
18255 * src/output.c (actions_output, guards_output)
18256 (token_definitions_output): No longer keeps track of the output
18257 line number, hence remove the second argument.
18258 (guards_output): Check against the guard member of a rule, not the
18259 action member.
18260 Adjust callers.
18261 (output_skeleton): Don't look for the skeleton location, let m4 do
18262 that.
18263 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
18264 file will be used.
18265 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
18266 (prepare): Given that for the time being changesyntax is not
18267 usable in M4, rename the muscles using `-' to `_'.
18268 Define `defines_flag', `output_parser_name' and `output_header_name'.
18269 * src/output.h (actions_output, guards_output)
18270 (token_definitions_output): Adjust prototypes.
18271 * src/scan-skel.l: Instead of scanning the skeletons, it now
18272 processes the output of m4: `__oline__' and `#output'.
18273 * data/bison.simple: Adjust to be used by M4(sugar).
18274 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
18275 to date.
18276 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
18277 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
18278 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
18279 shamelessly stolen from CVS Autoconf.
18280
beda758b
AD
182812002-02-05 Akim Demaille <akim@epita.fr>
18282
18283 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
18284 * configure.in: Check for the declarations of free and malloc.
18285 * src/muscle_tab.c: Adjust.
18286
5ece6d43
AD
182872002-02-05 Akim Demaille <akim@epita.fr>
18288
18289 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
18290 which have no values.
18291
5bb18f9a
AD
182922002-02-05 Akim Demaille <akim@epita.fr>
18293
18294 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
18295 * data/: here.
18296
894dd62e
PE
182972002-01-29 Paul Eggert <eggert@twinsun.com>
18298
18299 * src/bison.simple (YYSIZE_T): Do not define merely because
18300 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
18301 On some platforms, <alloca.h> does not declare YYSTD (size_t).
18302
82841af7
AD
183032002-01-27 Akim Demaille <akim@epita.fr>
18304
18305 Fix `%nonassoc and eof'.
18306
18307 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
18308 which were not properly copied! Replace
18309 memcpy (res->errs, src->errs, src->nerrs);
18310 with
18311 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
18312 !!!
18313 * tests/regression.at (%nonassoc and eof): Adjust to newest
18314 Autotest: `.' is not in the PATH.
18315
318b76e9
AD
183162002-01-27 Akim Demaille <akim@epita.fr>
18317
18318 * tests/sets.at (AT_EXTRACT_SETS): New.
18319 (Nullable): Use it.
18320 (Firsts): New.
18321
30d2f3d5
AD
183222002-01-26 Akim Demaille <akim@epita.fr>
18323
18324 * tests/actions.at, tests/calc.at, tests/headers.at,
18325 * tests/torture.at: Adjust to the newest Autotest which no longer
18326 forces `.' in the PATH.
18327
30f8c395
AD
183282002-01-25 Akim Demaille <akim@epita.fr>
18329
18330 * tests/regression.at (%nonassoc and eof): New.
18331 Suggested by Robert Anisko.
18332
29ae55f1
AD
183332002-01-24 Akim Demaille <akim@epita.fr>
18334
18335 Bison dumps core when trying to complain about broken input files.
18336 Reported by Cris van Pelt.
18337
18338 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
18339 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
18340 into...
18341 (Invalid inputs): Strengthen: exercise parse_percent_token.
18342
2b548aa6
RA
183432002-01-24 Robert Anisko <robert.anisko@epita.fr>
18344
18345 * src/Makefile.am: Add bison.c++.
18346 * src/bison.c++: New skeleton.
18347
bb0146c2
AD
183482002-01-21 Paolo Bonzini <bonzini@gnu.org>
18349
18350 * po/it.po: New.
18351
bec30531
AD
183522002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
18353
18354 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
18355
fc6edc45
MA
183562002-01-20 Marc Autret <marc@gnu.org>
18357
18358 * src/files.c (compute_output_file_names): Fix
18359
5e5d5415
MA
183602002-01-20 Marc Autret <marc@gnu.org>
18361
18362 * tests/output.at: New test.
18363 * src/files.c (compute_base_names): Don't map extensions when
18364 the YACC flag is set, use defaults.
18365 Reported by Evgeny Stambulchik.
18366
44ea3fbd
MA
183672002-01-20 Marc Autret <marc@gnu.org>
18368
ba0fe3c7
PE
18369 * src/system.h: Need to define __attribute__ away for non-GCC
18370 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
18371 Suggested by Albert Chin-A-Young.
18372
338963d1
TVH
183732002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
18374
18375 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
18376 canonical definition.
18377 * src/system.h: Use the canonical definition for PARAMS (avoids
18378 a conflict with the macro from lib/hash.h).
18379
c57b2479
AD
183802002-01-11 Akim Demaille <akim@epita.fr>
18381
18382 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 18383 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 18384
b85810ae
AD
183852002-01-09 Akim Demaille <akim@epita.fr>
18386
18387 * src/files.c, src/files.h (output_infix): New.
18388 (tab_extension): Remove.
18389 (compute_base_names): Compute the former, drop the latter.
18390 * src/output.c (prepare): Insert the muscles `output-infix', and
18391 `output-suffix'.
18392 * src/parse-skel.y (string, string.1): New.
18393 (section.header): Use it.
18394 (section.yacc): Remove.
18395 (prefix): Remove too.
18396 * src/scan-skel.l: Adjust.
18397 * src/bison.simple, src/bison.hairy: Adjust.
18398
cae60122
AD
183992002-01-09 Akim Demaille <akim@epita.fr>
18400
18401 * configure.in (WERROR_CFLAGS): Compute it.
18402 * src/Makefile.am (CFLAGS): Pass it.
18403 * tests/atlocal.in (CFLAGS): Idem.
18404 * src/files.c: Fix a few warnings.
18405 (get_extension_index): Remove, unused.
18406
ae404801
AD
184072002-01-08 Akim Demaille <akim@epita.fr>
18408
18409 * src/getargs.c (AS_FILE_NAME): New.
18410 (getargs): Use it to convert DOSish file names.
18411 * src/files.c (base_name): Rename as full_base_name to avoid
18412 clashes with `base_name ()'.
18413 (filename_split): New.
18414 (compute_base_names): N-th rewrite, using filename_split.
18415
22312b71
AD
184162002-01-08 Akim Demaille <akim@epita.fr>
18417
18418 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
18419 New, stolen from the Fileutils 4.1.
18420 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
18421 * configure.in: Check for the presence of memrchr, and of its
18422 prototype.
18423
a67cef01
TVH
184242002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
18425
18426 * lib/hash.h (__P): Added definition for this macro.
18427 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
18428 BUILT_SOURCES, to ensure they are generated first.
18429 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
18430 %error-verbose to allow bootstrapping with bison 1.30x.
18431
2b25d624
AD
184322002-01-06 Akim Demaille <akim@epita.fr>
18433
18434 * src/reader.c (parse_braces): Don't fetch the next char, the
18435 convention is to fetch on entry.
18436 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
18437 'switch' without a following semicolon.
18438 * tests/regression.at (braces parsing): New.
18439
3460813b
AD
184402002-01-06 Akim Demaille <akim@epita.fr>
18441
18442 Bison is dead wrong in its RR conflict reports.
18443
18444 * tests/torture.at (GNU Cim Grammar): New.
18445 * src/conflicts.c (count_rr_conflicts): Fix.
18446
73784c64
AD
184472002-01-06 Akim Demaille <akim@epita.fr>
18448
18449 Creating package.m4 from configure.ac causes too many problems.
18450
18451 * tests/Makefile.am (package.m4): Create it by hand,
18452 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
18453
25d81090
AD
184542002-01-06 Akim Demaille <akim@epita.fr>
18455
18456 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
18457 skeleton.h.
18458
a9b8959e
PE
184592002-01-04 Paul Eggert <eggert@twinsun.com>
18460
18461 * doc/bison.texinfo (Debugging):
18462 Remove YYSTDERR; it's no longer defined or used.
18463 Also, s/cstdio.h/cstdio/.
18464
25d81090
AD
184652002-01-03 Akim Demaille <akim@epita.fr>
18466
18467 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
18468
1109455c
AD
184692002-01-03 Akim Demaille <akim@epita.fr>
18470
18471 * src/parse-skel.y (process_skeleton): Don't bind the parser's
18472 tracing code to --trace, wait for a better --trace option, with
18473 args.
18474
7ea5e977
AD
184752002-01-03 Akim Demaille <akim@epita.fr>
18476
18477 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
18478 The ISO C++ standard is extremely clear about it: stderr is
18479 considered a macro, not a regular symbol (see table 94 `Header
18480 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
18481 Therefore std:: does not apply to it. It still does with fprintf.
18482 Also, s/cstdio.h/cstdio/.
18483
fab5b110
AD
184842002-01-03 Akim Demaille <akim@epita.fr>
18485
18486 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
18487 for non system headers.
18488
aed7fd9b
AD
184892002-01-02 Akim Demaille <akim@epita.fr>
18490
18491 Equip the skeleton chain with location tracking, runtime trace,
18492 pure parser and scanner.
18493
18494 * src/parse-skel.y: Request a pure parser, locations, and prefix
18495 renaming.
18496 (%union): Having several members with the same type does not help
18497 type mismatches, simplify.
18498 (YYPRINT, yyprint): New.
18499 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
18500 (skel_error): this.
18501 Handle locations.
18502 * src/scan-skel.l: Adjust to these changes.
18503 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
18504 (LOCATION_PRINT, skel_control_t): New.
18505
24fad99e
AD
185062001-12-30 Akim Demaille <akim@epita.fr>
18507
18508 * src/parse-skel.y: Get rid of the shift/reduce conflict:
18509 replace `gb' with BLANKS.
18510 * src/scan-skel.l: Adjust.
18511
a4b36db4
AD
185122001-12-30 Akim Demaille <akim@epita.fr>
18513
18514 * src/system.h: We don't need nor want bcopy.
18515 Throw away MS-DOS crap: we don't need getpid.
18516 * configure.in: We don't need strndup. It was even causing
18517 problems: because Flex includes the headers *before* us,
18518 _GNU_SOURCE is not defined by config.h, and therefore strndup was
18519 not visible.
18520 * lib/xstrndup.c: New.
18521 * src/scan-skel.l: Use it.
18522 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
18523 * src/parse-skel.y: Use %directives instead of #defines.
18524
1239777d
AD
185252001-12-30 Akim Demaille <akim@epita.fr>
18526
18527 * src/skeleton.h: New.
18528 * src/output.c (output_parser, output_master_parser): Remove, dead
18529 code.
18530 * src/output.h (get_lines_number, actions_output, guards_output)
18531 (token_definitions_output): Prototype them.
18532 * src/parse-skel.y: Add the license notice.
18533 Include output.h and skeleton.h.
18534 (process_skeleton): Returns void, and takes a single parameter.
18535 * src/scan-skel.l: Add the license notice.
18536 Include skeleton.h.
18537 Don't use %option yylineno: it seems that then Flex imagines
18538 REJECT has been used, and therefore it won't reallocate its
18539 buffers (which makes no other sense to me than a bug). It results
18540 in warnings for `unused: yy_flex_realloc'.
18541
9b3add5b
RA
185422001-12-30 Robert Anisko <robert.anisko@epita.fr>
18543
18544 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
18545 (MUSCLE_INSERT_PREFIX): ...to there.
18546 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
18547 (MUSCLE_INSERT_PREFIX): Move from here...
18548
18549 * src/bison.hairy: Add a section directive. Put braces around muscle
18550 names. This parser skeleton is still broken, but Bison should not
18551 choke on a bad muscle 'syntax'.
18552 * src/bison.simple: Add a section directive. Put braces around muscle
18553 names.
18554
18555 * src/files.h (strsuffix, stringappend): Add declarations.
18556 (tab_extension): Add declaration.
18557 (short_base_name): Add declaration.
18558
18559 * src/files.c (strsuffix, stringappend): No longer static. These
18560 functions are used in the skeleton parser.
18561 (tab_extension): New.
18562 (compute_base_names): Use the computations done in this function
fab5b110 18563 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
18564 names.
18565 (short_base_name): No longer static.
18566
18567 * src/output.c (output_skeleton): New.
18568 (output): Disable call to output_master_parser, and give a try to
18569 a new skeleton handling system.
18570 (guards_output, actions_output): No longer static.
18571 (token_definitions_output, get_lines_number): No longer static.
18572
18573 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
18574
fab5b110 18575 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
18576 parse-skel.y.
18577
18578 * src/parse-skel.y: New file.
18579 * src/scan-skel.l: New file.
18580
b5b61c61
AD
185812001-12-29 Akim Demaille <akim@epita.fr>
18582
18583 %name-prefix is broken.
18584
18585 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
18586 Adjust all dependencies.
18587 * tests/headers.at (export YYLTYPE): Strengthen this test: use
18588 %name-prefix.
18589
18590 Renaming yylval but not yylloc is not consistent. Now we do.
18591
18592 * src/bison.simple: Prefix yylloc if used.
18593 * doc/bison.texinfo (Decl Summary): Document that.
18594
8c9a50be
AD
185952001-12-29 Akim Demaille <akim@epita.fr>
18596
18597 * doc/bison.texinfo: Promote `%long-directive' over
18598 `%long_directive'.
18599 Remove all references to fixed-output-files, yacc is enough.
18600
d99361e6
AD
186012001-12-29 Akim Demaille <akim@epita.fr>
18602
18603 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
18604 user prologue. These are defaults.
18605 * tests/actions.at (Mid-rule actions): Make sure the user can
18606 define YYDEBUG and YYERROR_VERBOSE.
18607
b9cecb91
AD
186082001-12-29 Akim Demaille <akim@epita.fr>
18609
18610 * src/output.c (header_output): Don't forget to export YYLTYPE and
18611 yylloc.
18612 * tests/headers.at (export YYLTYPE): New, make sure it does.
18613 * tests/regression.at (%union and --defines, Invalid CPP headers):
18614 Move to...
18615 * tests/headers.at: here.
18616
aea13e97
AD
186172001-12-29 Akim Demaille <akim@epita.fr>
18618
18619 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
18620
931394cb
AD
186212001-12-29 Akim Demaille <akim@epita.fr>
18622
18623 * tests/actions.at (Mid-rule actions): Output on a single line
18624 instead of several.
18625
704a47c4
AD
186262001-12-29 Akim Demaille <akim@epita.fr>
18627
18628 * doc/bison.texinfo: Formatting changes.
18629
091e20bb
AD
186302001-12-29 Akim Demaille <akim@epita.fr>
18631
18632 Don't store the token defs in a muscle, just be ready to output it
18633 on command. Now possible via `symbols'. Fixes a memory leak.
18634
18635 * src/output.c (token_definitions_output): New.
18636 (output_parser, header_output): Use it.
18637 * src/reader.c (symbols_save): Remove.
18638
cce71710
AD
186392001-12-29 Akim Demaille <akim@epita.fr>
18640
18641 * src/bison.simple: Do not provide a default for YYSTYPE and
18642 YYLTYPE before the user's prologue. Otherwise it's hardly... a
18643 default.
18644
82c035a8
AD
186452001-12-29 Akim Demaille <akim@epita.fr>
18646
18647 Mid-rule actions are simply... ignored!
18648
18649 * src/reader.c (readgram): Be sure to attach mid-rule actions to
18650 the empty-rule associated to the dummy symbol, not to the host
18651 rule.
18652 * tests/actions.at (Mid-rule actions): New.
18653
8419d367
AD
186542001-12-29 Akim Demaille <akim@epita.fr>
18655
18656 Memory leak.
18657
18658 * src/reader.c (reader): Free grammar.
18659
375d5806
AD
186602001-12-29 Akim Demaille <akim@epita.fr>
18661
18662 Memory leak.
18663
18664 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
18665 since it allocates it for each state, although only one is needed.
18666 (allocate_storage): Do it here.
18667
f51cb8ff
AD
186682001-12-29 Akim Demaille <akim@epita.fr>
18669
18670 * src/options.h, src/options.c (create_long_option_table): Rename
18671 as...
18672 (long_option_table_new): this, with a clearer prototype.
18673 (percent_table): Remove, unused,
18674 * src/getargs.c (getargs): Adjust.
18675
29e88316
AD
186762001-12-29 Akim Demaille <akim@epita.fr>
18677
18678 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
18679 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
18680 as states.
18681
b9f71f19
AD
186822001-12-29 Akim Demaille <akim@epita.fr>
18683
18684 * src/lalr.c (build_relations): Rename `states' as `states1'.
18685 Sorry, I don't understand exactly what it is, no better name...
18686
1a2b5d37
AD
186872001-12-29 Akim Demaille <akim@epita.fr>
18688
18689 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
18690 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
18691 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
18692 as rules.
18693
1cca533e
AD
186942001-12-29 Akim Demaille <akim@epita.fr>
18695
18696 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
18697 ago.
18698
c03ae966
AD
186992001-12-29 Akim Demaille <akim@epita.fr>
18700
18701 * src/reader.c, src/reader.h (user_toknums): Remove.
18702 Adjust all users to use symbols[i]->user_token_number.
18703
5a670b1e
AD
187042001-12-29 Akim Demaille <akim@epita.fr>
18705
18706 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
18707 Adjust all users to use symbols[i]->prec or ->assoc.
18708
ad949da9
AD
187092001-12-29 Akim Demaille <akim@epita.fr>
18710
18711 * src/reader.c, src/reader.h (tags): Remove.
18712 Adjust all users to use symbols[i]->tag.
18713
0e78e603
AD
187142001-12-29 Akim Demaille <akim@epita.fr>
18715
18716 * src/gram.h, src/gram.c (symbols): New, similar to state_table
18717 and rule_table.
18718 * src/reader.c (packsymbols): Fill this table.
18719 Drop sprec.
18720 * src/conflicts.c (resolve_sr_conflict): Adjust.
18721 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
18722 single table.
18723 Use symbols[i]->tag instead of tags[i].
18724
213e640e
AD
187252001-12-29 Akim Demaille <akim@epita.fr>
18726
18727 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
18728 In addition, put a comment in there, to replace...
18729 * tests/regression.at (%union and C comments): Remove.
18730
e7b8bef1
AD
187312001-12-29 Akim Demaille <akim@epita.fr>
18732
18733 * tests/regression.at (Web2c Actions): Blindly move the actual
18734 output as expected output. The contents *seem* right to me, but I
18735 can't pretend reading perfectly parser tables... Nonetheless, all
18736 the other tests pass correctly, the table look OK, even though the
18737 presence of `$axiom' is to be noted: AFAICS it is useless (but
18738 harmless).
18739
b68e7744
AD
187402001-12-29 Akim Demaille <akim@epita.fr>
18741
18742 * src/reader.c (readgram): Don't add the rule 0 if there were no
18743 rules read. In other words, add it _after_ having performed
18744 grammar sanity checks.
18745 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
18746
78d5bae9
AD
187472001-12-29 Akim Demaille <akim@epita.fr>
18748
18749 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
18750 visible, and some states have now a different number.
18751
ff442794
AD
187522001-12-29 Akim Demaille <akim@epita.fr>
18753
18754 * src/reader.c (readgram): Bind the initial rule's lineno to that
18755 of the first rule.
18756 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
18757 (Solved SR Conflicts): Adjust rule 0's line number.
18758
610ab194
AD
187592001-12-29 Akim Demaille <akim@epita.fr>
18760
18761 Fix the `GAWK Grammar' failure.
18762
18763 * src/LR0.c (final_state): Initialize to -1 so that we do compute
18764 the reductions of the first state which was mistakenly confused
18765 with the final state because precisely final_state was initialized
18766 to 0.
18767 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
18768 now noticed by Bison.
18769 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
18770 have a reduction on $default.
18771
29d29c8f
AD
187722001-12-29 Akim Demaille <akim@epita.fr>
18773
18774 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
18775 rule line numbers.
18776 * src/closure.c (print_closure): Likewise.
18777 * src/derives.c (print_derives): Likewise.
18778 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
18779 now.
18780
7c6b64d0
AD
187812001-12-29 Akim Demaille <akim@epita.fr>
18782
18783 * src/lalr.c (lookaheads_print): New.
18784 (lalr): Call it when --trace-flag.
18785 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
18786 are dumped.
18787
3d4daee3
AD
187882001-12-29 Akim Demaille <akim@epita.fr>
18789
18790 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
18791 when walking through ritem, even via rule->rhs.
18792 * src/reduce.c (dump_grammar, useful_production, reduce_output)
18793 (useful_production, useless_nonterminals): Likewise.
18794 (reduce_grammar_tables): Likewise, plus update nritems.
18795 * src/nullable.c (set_nullable): Likewise.
18796 * src/lalr.c (build_relations): Likewise.
18797 * tests/sets.at (Nullable): Adjust.
18798 Fortunately, now, the $axiom is no longer nullable.
18799
9e7f6bbd
AD
188002001-12-29 Akim Demaille <akim@epita.fr>
18801
18802 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
18803 the 0-sentinel.
18804 * src/gram.c (ritem_longest_rhs): Likewise.
18805 * src/reduce.c (nonterminals_reduce): Likewise.
18806 * src/print_graph.c (print_graph): Likewise.
18807 * src/output.c (output_rule_data): Likewise.
18808 * src/nullable.c (set_nullable): Likewise.
18809
255ef638
AD
188102001-12-29 Akim Demaille <akim@epita.fr>
18811
18812 * src/output.c: Comment changes.
18813
0d8a7363
AD
188142001-12-27 Paul Eggert <eggert@twinsun.com>
18815
18816 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
18817 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
18818 Sparc, as they were causing more porting problems than the
18819 (minor) performance improvement was worth.
18820
18821 Also, catch up with 1.31's YYSTD.
18822
3db472b9
AD
188232001-12-27 Akim Demaille <akim@epita.fr>
18824
18825 * src/output.c (output_gram): Rely on nritems, not the
18826 0-sentinel. See below.
18827 Use -1 as separator, not 0.
18828 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
18829 Rely on -1 as separator in yyrhs, instead of 0.
18830 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
18831 twice `Now at end of input', therefore there are two lines less to
18832 expect.
18833
b365aa05
AD
188342001-12-27 Akim Demaille <akim@epita.fr>
18835
18836 * tests/regression.at (Unresolved SR Conflicts):
18837 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
18838 below.
18839
30171f79
AD
188402001-12-27 Akim Demaille <akim@epita.fr>
18841
18842 * src/LR0.c (new_state): Recognize the final state by the fact it
18843 is reached by eoftoken.
18844 (insert_start_shifting_state, insert_eof_shifting_state)
18845 (insert_accepting_state, augment_automaton): Remove, since now
18846 these states are automatically computed from the initial state.
18847 (generate_states): Adjust.
18848 * src/print.c: When reporting a rule number to the user, substract
18849 1, so that the axiom rule is rule 0, and the first user rule is 1.
18850 * src/reduce.c: Likewise.
18851 * src/print_graph.c (print_core): For the time being, just as for
18852 the report, depend upon --trace-flags to dump the full set of
18853 items.
18854 * src/reader.c (readgram): Once the grammar read, insert the rule
18855 0: `$axiom: START-SYMBOL $'.
18856 * tests/set.at: Adjust: rule 0 is now displayed, and since the
18857 number of the states has changed (the final state is no longer
18858 necessarily the last), catch up.
18859
75142d45
AD
188602001-12-27 Akim Demaille <akim@epita.fr>
18861
18862 Try to make the use of the eoftoken valid. Given that its value
18863 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
18864 is used instead of > 0 where appropriate, (ii), depend upon nritems
18865 instead of the 0-sentinel.
18866
18867 * src/gram.h, src/gram.c (nritems): New.
18868 Expected to be duplication of nitems, but for the time being...
18869 * src/reader.c (packgram): Assert nritems and nitems are equal.
18870 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
18871 * src/closure.c (print_closure, print_fderives): Likewise.
18872 * src/gram.c (ritem_print): Likewise.
18873 * src/print.c (print_core, print_grammar): Likewise.
18874 * src/print_graph.c: Likewise.
18875
b7c49edf
AD
188762001-12-27 Akim Demaille <akim@epita.fr>
18877
18878 * src/main.c (main): If there are complains after grammar
18879 reductions, then output the report anyway if requested, then die.
18880 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
18881 * src/reader.c (eoftoken): New.
18882 (parse_token_decl): If the token being defined has value `0', it
18883 is the eoftoken.
18884 (packsymbols): No longer hack `tags' to insert `$' by hand.
18885 Be sure to preserve the value of the eoftoken.
18886 (reader): Make sure eoftoken is defined.
18887 Initialize nsyms to 0: now eoftoken is created just like the others.
18888 * src/print.c (print_grammar): Don't special case the eof token.
18889 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
18890 lie anyway, albeit pleasant.
18891 * tests/calc.at: Exercise error messages with eoftoken.
18892 Change the grammar so that empty input is invalid.
18893 Adjust expectations.
18894 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
18895
ec2da99f
AD
188962001-12-27 Akim Demaille <akim@epita.fr>
18897
18898 * configure.in: Check the protos of strchr ans strspn.
18899 Replace strchr if needed.
18900 * src/system.h: Provide the protos of strchr, strspn and memchr if
18901 missing.
18902 * lib/strchr.c: New.
18903 * src/reader.c (symbols_save): Use strchr.
18904
8adfa272
AD
189052001-12-27 Akim Demaille <akim@epita.fr>
18906
18907 * src/print.c, src/print_graph.c (escape): New.
18908 Use it to quote the TAGS outputs.
18909 * src/print_graph.c (print_state): Now errors are in red, and
18910 reductions in green.
18911 Prefer high to wide: output the state number on a line of its own.
18912
80dac38c
AD
189132001-12-27 Akim Demaille <akim@epita.fr>
18914
18915 * src/state.h, src/state.c (reductions_new): New.
18916 * src/LR0.c (set_state_table): Let all the states have a
18917 `reductions', even if reduced to 0.
18918 (save_reductions): Adjust.
18919 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
18920 * src/print.c (print_reductions, print_actions): Adjust.
18921 * src/output.c (action_row): Adjust.
18922
2cec70b9
AD
189232001-12-27 Akim Demaille <akim@epita.fr>
18924
18925 * src/state.h, src/state.c (errs_new, errs_dup): New.
18926 * src/LR0.c (set_state_table): Let all the states have an errs,
18927 even if reduced to 0.
18928 * src/print.c (print_errs, print_reductions): Adjust.
18929 * src/output.c (output_actions, action_row): Adjust.
18930 * src/conflicts.c (resolve_sr_conflict): Adjust.
18931
13ca549a
AD
189322001-12-27 Akim Demaille <akim@epita.fr>
18933
18934 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
18935
5092aba5
AD
189362001-12-27 Akim Demaille <akim@epita.fr>
18937
18938 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
18939 * src/print.c: here.
18940 (lookaheadset, shiftset): New, used as additional storage by
18941 print_reductions.
18942 (print_results): Adjust.
18943 (print_shifts, print_gotos, print_errs): New, extracted from...
18944 (print_actions): here.
18945 * src/print_graph.c (print_actions): Remove dead code.
18946
11e2beca
AD
189472001-12-27 Akim Demaille <akim@epita.fr>
18948
18949 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
18950 `$n' and `@n'.
18951
dac3c910
AD
189522001-12-27 Akim Demaille <akim@epita.fr>
18953
18954 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
18955 (build_relations): Adjust.
18956
d0b0fefa
AD
189572001-12-27 Akim Demaille <akim@epita.fr>
18958
18959 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
18960 duplication.
18961
adc8c848
AD
189622001-12-27 Akim Demaille <akim@epita.fr>
18963
18964 * src/reader.c (packgram): Catch nitems overflows.
18965
14d293ac
AD
189662001-12-27 Akim Demaille <akim@epita.fr>
18967
18968 * src/files.c, src/files.h (guard_obstack): Remove.
18969 * src/output.c (output): Adjust.
18970 * src/reader.c (parse_braces): New, factoring...
18971 (copy_action, copy_guard): these two which are renamed as...
18972 (parse_action, parse_guard): these.
18973 As a voluntary consequence, using braces around guards is now
18974 mandatory.
18975
f499b062
AD
189762001-12-27 Akim Demaille <akim@epita.fr>
18977
18978 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
18979 * src/reader.c (symbol_list): `guard' and `guard_line' are new
18980 members.
18981 (symbol_list_new): Adjust.
18982 (copy_action): action_line is the first line, not the last.
18983 (copy_guard): Just as for actions, store the `action' only, not
18984 the switch/case/break flesh.
18985 Don't parse the user action that might follow the guard, let...
18986 (readgram): do it, i.e., now, there can be an action after a
18987 guard.
18988 In other words the guard is just explicitly optional.
18989 (packgram): Adjust.
18990 * src/output.c (guards_output): New.
18991 (output_parser): Call it when needed.
18992 (output): Also free the guard and attrs obstacks.
18993 * src/files.c, src/files.h (obstack_save): Remove.
18994 (output_files): Remove.
18995 As a result, if one needs the former `.act' file, using an
18996 appropriate skeleton which requires actions and guards is now
18997 required.
18998 * src/main.c (main): Adjust.
18999 * tests/semantic.at: New.
19000 * tests/regression.at: Use `input.y' as input file name.
19001 Avoid 8+3 problems by requiring input.c when the test needs the
19002 parser.
19003
d945f5cd
AD
190042001-12-27 Akim Demaille <akim@epita.fr>
19005
19006 * src/reader.c (symbol_list_new): Be sure to initialize all the
19007 fields.
19008
d200e455
AD
190092001-12-27 Akim Demaille <akim@epita.fr>
19010
19011 All the hacks using a final pseudo state are now useless.
19012
19013 * src/LR0.c (set_state_table): state_table holds exactly nstates.
19014 * src/lalr.c (nLA): New.
19015 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
19016 instead of lookaheadsp from the pseudo state (nstate + 1).
19017
f9507c28
AD
190182001-12-27 Akim Demaille <akim@epita.fr>
19019
19020 * src/output.c (action_row, token_actions): Use a state_t instead
19021 of a integer, and nlookaheads instead of the following state's
19022 lookaheadsp.
19023
065fbd27
AD
190242001-12-27 Akim Demaille <akim@epita.fr>
19025
19026 * src/conflicts.c (log_resolution, flush_shift)
19027 (resolve_sr_conflict, set_conflicts, solve_conflicts)
19028 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
19029 (conflicts_print, print_reductions): Use a state_t instead of an
19030 integer when referring to a state.
19031 As much as possible, depend upon nlookaheads, instead of the
19032 `lookaheadsp' member of the following state (since lookaheads of
19033 successive states are successive, the difference between state n + 1
19034 and n served as the number of lookaheads for state n).
19035 * src/lalr.c (add_lookback_edge): Likewise.
19036 * src/print.c (print_core, print_actions, print_state)
19037 (print_results): Likewise.
19038 * src/print_graph.c (print_core, print_actions, print_state)
19039 (print_graph): Likewise.
19040 * src/conflicts.h: Adjust.
19041
1b177bd7
AD
190422001-12-27 Akim Demaille <akim@epita.fr>
19043
19044 * src/bison.hairy: Formatting/comment changes.
19045 ANSIfy.
19046 Remove `register' indications.
19047 Add plenty of `static'.
19048
7742ddeb
AD
190492001-12-27 Akim Demaille <akim@epita.fr>
19050
19051 * src/output.c (prepare): Drop the muscle `ntbase' which
19052 duplicates ntokens.
19053 * src/bison.simple: Formatting/comment changes.
19054 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
19055 is an undocumented synonym.
19056
1fa14068
AD
190572001-12-22 Akim Demaille <akim@epita.fr>
19058
19059 * src/output.c (output_table_data): Change the prototype to use
19060 `int' for array ranges: some invocations do pass an int, not a
19061 short.
19062 Reported by Wayne Green.
19063
b9752825
AD
190642001-12-22 Akim Demaille <akim@epita.fr>
19065
19066 Some actions of web2c.y are improperly triggered.
19067 Reported by Mike Castle.
19068
19069 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
19070 * tests/regression.at (Web2c): Rename as...
19071 (Web2c Report): this.
19072 (Web2c Actions): New.
19073
776209d6
AD
190742001-12-22 Akim Demaille <akim@epita.fr>
19075
19076 Reductions in web2c.y are improperly reported.
19077 Reported by Mike Castle.
19078
19079 * src/conflicts.c (print_reductions): Fix.
19080 * tests/regression.at (Web2c): New.
19081
275fc3ad
AD
190822001-12-18 Akim Demaille <akim@epita.fr>
19083
19084 Some host fail on `assert (!"foo")', which expands to
19085 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
19086 Reported by Nelson Beebee.
19087
19088 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
19089 `#define it_succeeded 0' and `assert (it_succeeded)'.
19090
897668ee
MA
190912001-12-17 Marc Autret <autret_m@epita.fr>
19092
19093 * src/bison.simple: Don't hard code the skeleton line and filename.
19094 * src/output.c (output_parser): Rename 'line' as 'output_line'.
19095 New line counter 'skeleton_line' (skeleton-line muscle).
19096
ab3399e0
PE
190972001-12-17 Paul Eggert <eggert@twinsun.com>
19098
19099 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
19100 YYDEBUG must be defined to a nonzero value.
19101
19102 * src/bison.simple (yytname): Do not assume that the user defines
19103 YYDEBUG to a properly parenthesized expression.
19104
3877f72b
AD
191052001-12-17 Akim Demaille <akim@epita.fr>
19106
19107 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
19108 nlookaheads is a new member.
19109 Adjust all users.
19110 * src/lalr.h (nlookaheads): Remove this orphan declaration.
19111 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
19112 state.
776209d6 19113
331dbc1b
AD
191142001-12-17 Akim Demaille <akim@epita.fr>
19115
19116 * src/files.h, src/files.c (open_files, close_files): Remove.
19117 * src/main.c (main): Don't open/close files, nor invoke lex_free,
19118 let...
19119 * src/reader.c (reader): Do it.
776209d6 19120
be750e4c
AD
191212001-12-17 Akim Demaille <akim@epita.fr>
19122
19123 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 19124
709ae8c6
AD
191252001-12-17 Akim Demaille <akim@epita.fr>
19126
19127 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
19128 (flush_reduce): New.
19129 (resolve_sr_conflict): Adjust.
776209d6 19130
f87685c3
AD
191312001-12-17 Akim Demaille <akim@epita.fr>
19132
19133 * src/output.c (output_obstack): Be static and rename as...
19134 (format_obstack): this, to avoid any confusion with files.c's
19135 output_obstack.
19136 * src/reader.h (muscle_obstack): Move to...
19137 * src/output.h: here, since it's defined in output.c.
19138
837491d8
AD
191392001-12-17 Akim Demaille <akim@epita.fr>
19140
19141 * src/output.c (action_row, save_column, default_goto)
19142 (sort_actions, matching_state, pack_vector): Better variable
19143 locality.
19144
796d61fb
AD
191452001-12-17 Akim Demaille <akim@epita.fr>
19146
19147 * src/output.c: Various formatting changes.
776209d6 19148
64d15509
AD
191492001-12-17 Akim Demaille <akim@epita.fr>
19150
19151 * src/files.c (output_files): Free the output_obstack.
19152 * src/main.c (main): Call print and print_graph conditionally.
19153 * src/print.c (print): Work unconditionally.
19154 * src/print_graph.c (print_graph): Work unconditionally.
19155 * src/conflicts.c (log_resolution): Output only if verbose_flag.
19156
fbc8ecb7
MA
191572001-12-16 Marc Autret <autret_m@epita.fr>
19158
19159 * src/output.c (actions_output): Fix. When we use %no-lines,
19160 there is one less line per action.
19161
f0440388
MA
191622001-12-16 Marc Autret <autret_m@epita.fr>
19163
19164 * src/bison.simple: Remove a useless #line directive.
19165 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
19166 * src/output.c (get_lines_number): New.
776209d6 19167 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
19168 output muscles.
19169 Fix line numbering.
19170 (actions_output): Computes the number of lines taken by actions.
19171 (output_master_parser): Insert new skeleton which is the name of
19172 the output parser file name.
19173
a79986b8
MA
191742001-12-15 Marc Autret <autret_m@epita.fr>
19175
19176 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
19177
4ec8e00f
MA
191782001-12-15 Marc Autret <autret_m@epita.fr>
19179
19180 * src/output.c (output_gram): Keep track of the hairy one.
19181
1a4648ff
AD
191822001-12-15 Akim Demaille <akim@epita.fr>
19183
19184 Make `make distcheck' work.
19185
19186 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
19187 system.h which uses libgettext.h.
19188
9c2c67e6
AD
191892001-12-15 Akim Demaille <akim@epita.fr>
19190
19191 * src/nullable.c (set_nullable): Useless rules must be skipped,
19192 otherwise, since we range over their symbols, we might look at a
19193 nonterminal which no longer ``exists'', i.e., it is not counted in
19194 `nvars', hence we overflow our arrays.
19195
93ede233
AD
191962001-12-15 Akim Demaille <akim@epita.fr>
19197
19198 The header can also be produced directly, without any obstack!
19199 Yahoo!
19200
19201 * src/files.c, src/files.h (defines_obstack): Remove.
19202 (compute_header_macro): Global.
19203 (defines_obstack_save): Remove.
19204 * src/reader.c (parse_union_decl): No longer output to
19205 defines_obstack: its content can be found in the `stype' muscle
19206 anyway.
19207 (output_token_translations): Merge into...
19208 (symbols_output): this.
19209 Rename as...
19210 (symbols_save): this.
19211 (reader): Adjust.
19212 * src/output.c (header_output): New.
19213 (output): Call it.
19214
2666f928
AD
192152001-12-15 Akim Demaille <akim@epita.fr>
19216
19217 * src/reader.c (parse_union_decl): Instead of handling two obstack
19218 simultaneously, use one to define the `stype' muscle, and use the
19219 value of the latter to fill defines_obstack.
19220 (copy_comment): Remove.
19221 (copy_comment2): Work for a single obstack.
19222 Rename as...
19223 (copy_comment): this.
19224
428046f8
AD
192252001-12-15 Akim Demaille <akim@epita.fr>
19226
19227 * src/lex.c, src/lex.h (xgetc): No longer static.
19228 * src/reader.c (parse_union_decl): Revamp.
19229
ea52d706
AD
192302001-12-15 Akim Demaille <akim@epita.fr>
19231
19232 Still making progress in separating Bison into (i) input, (ii)
19233 process, (iii) output: now we can directly output the parser file
19234 without using table_obstack at all.
19235
19236 * src/files.c, src/files.h (table_obstack): Bye bye.
19237 (parser_file_name): New.
19238 * src/files.c (compute_output_file_names): Compute it.
19239 * src/output.c (actions_output, output_parser)
19240 (output_master_parser): To a file instead of an obstack.
19241
3f96f4dc
AD
192422001-12-15 Akim Demaille <akim@epita.fr>
19243
19244 Attach actions to rules, instead of pre-outputting them to
19245 actions_obstack.
19246
19247 * src/gram.h (rule_t): action and action_line are new members.
19248 * src/reader.c (symbol_list): Likewise.
19249 (copy_action): Save the actions within the rule.
19250 (packgram): Save them in rule_table.
19251 * src/output.c (actions_output): New.
19252 (output_parser): Use it on `%%actions'.
19253 (output_rule_data): Don't free rule_table.
19254 (output): Do it.
19255 (prepare): Don't save the `action' muscle.
19256 * src/bison.simple: s/%%action/%%actions/.
19257
51576fb3
AD
192582001-12-15 Akim Demaille <akim@epita.fr>
19259
19260 * src/reader.c (copy_action): When --yacc, don't append a `;'
19261 to the user action: let it fail if lacking.
dee049eb 19262 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 19263
2648a72d
AD
192642001-12-14 Akim Demaille <akim@epita.fr>
19265
19266 * src/lex.c (literalchar): Simply return the char you decoded, non
19267 longer mess around with obstacks and int pointers.
19268 Adjust all callers.
19269
92790e5b
AD
192702001-12-14 Akim Demaille <akim@epita.fr>
19271
19272 * src/lex.c (literalchar): Don't escape the special characters,
19273 just decode them, and keep them as char (before, eol was output as
19274 the 2 char string `\n' etc.).
19275 * src/output.c (output_rule_data): Use quotearg to output the
19276 token strings.
19277
927c1557
PE
192782001-12-13 Paul Eggert <eggert@twinsun.com>
19279
19280 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
19281 Do not infringe on the global user namespace when using C++.
19282 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
19283 All uses of `fprintf' and `stderr' changed.
19284
19285 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
19286
ed8e1f68
AD
192872001-12-13 Akim Demaille <akim@epita.fr>
19288
19289 The computation of nullable is broken: it doesn't handle empty
19290 RHS's properly.
19291
19292 * tests/torture.at (GNU AWK Grammar): New.
19293 * tests/sets.at (Nullable): New.
19294 * src/nullable.c (set_nullable): Instead of blindly looping over
19295 `ritems', loop over the rules, and then over their rhs's.
19296
19297 Work around Autotest bugs.
19298
19299 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
19300 frame, because Autotest understand lines starting with a `+' as
19301 traces from the shell. Then, they are not processed properly.
19302 Admittedly an Autotest bug, but we don't have time to wait for
19303 Autotest to catch up.
19304 * tests/regression.at (Broken Closure): Adjust to the new table
19305 frames.
19306 Move to...
19307 * tests/sets.at: here.
19308
cb581495
AD
193092001-12-13 Akim Demaille <akim@epita.fr>
19310
19311 * src/closure.c (closure): Use nrules instead of playing tricks
19312 with BITS_PER_WORD.
19313
2e729273
AD
193142001-12-13 Akim Demaille <akim@epita.fr>
19315
19316 * src/print.c (print_actions): Output the handling of `$' as the
19317 traces do: shifting the token EOF. Before EOF was treated as a
19318 nonterminal.
19319 * tests/regression.at: Adjust some tests.
19320 * src/print_graph.c (print_core): Complete the set of items via
19321 closure. The next-to-final and final states are still unsatisfying,
19322 but that's to be addressed elsewhere.
19323 No longer output the rule numbers, but do output the state number.
19324 A single loop for the shifts + gotos is enough, but picked a
19325 distinct color for each.
19326 (print_graph): Initialize and finalize closure.
19327
107f7dfb
AD
193282001-12-13 Akim Demaille <akim@epita.fr>
19329
19330 * src/reader.c (readgram): Remove dead code, an strip useless
19331 braces.
19332 (get_type): Remove, unused.
19333
9b53a24f
AD
193342001-12-12 Akim Demaille <akim@epita.fr>
19335
19336 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
19337 on that of lib/error.c.
19338
dbfb6dcd
AD
193392001-12-12 Akim Demaille <akim@epita.fr>
19340
19341 Some hosts don't like `/' in includes.
19342
19343 * src/system.h: Include libgettext.h without qualifying the path.
19344 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
19345 $(top_srcdir).
19346
c25fb648
MA
193472001-12-11 Marc Autret <autret_m@epita.fr>
19348
19349 * src/output.c (output_parser): Remove useless muscle.
19350
710ddc4f
MA
193512001-12-11 Marc Autret <autret_m@epita.fr>
19352
19353 * src/bison.simple: Remove #line just before %%epilogue. It
19354 is now handled in ...
19355 * src/reader.c (read_additionnal_code): Add the output of a
19356 #line for the epilogue.
19357
e83d80b8
MA
193582001-12-10 Marc Autret <autret_m@epita.fr>
19359
927c1557 19360 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
19361 replace precedent remove.
19362 * src/bison.simple: Remove #line before %%prologue because
19363 %%input-line is wrong at this time.
19364
971d5158
MA
193652001-12-10 Marc Autret <autret_m@epita.fr>
19366
19367 * src/reader.c (symbols_output): Clean up.
927c1557 19368 * src/output.c (output_gram, output): Clean up.
971d5158 19369
5edafffd
AD
193702001-12-10 Akim Demaille <akim@epita.fr>
19371
19372 * src/lalr.c (initialize_lookaheads): New. Extracted from...
19373 * src/LR0.c (set_state_table): here.
19374 * src/lalr.c (lalr): Call it.
19375
0279f8e9
AD
193762001-12-10 Akim Demaille <akim@epita.fr>
19377
19378 * src/state.h (shifts): Remove the `number' member: shifts are
19379 attached to state, hence no longer need to be labelled with a
19380 state number.
19381
190c4f5f
AD
193822001-12-10 Akim Demaille <akim@epita.fr>
19383
19384 Now that states have a complete set of members, the linked list of
19385 shifts is useless: just fill directly the state's shifts member.
19386
19387 * src/state.h (shifts): Remove the `next' member.
19388 * src/LR0.c (first_state, last_state): Remove.
19389 Adjust the callers.
19390 (augment_automaton): Don't look for the shifts that must be added
19391 a shift on EOF: it is those of the state we looked for! But now,
19392 since shifts are attached, it is no longer needed to looking
19393 merely by its id: its number.
19394
2a73b93d
AD
193952001-12-10 Akim Demaille <akim@epita.fr>
19396
19397 * src/LR0.c (augment_automaton): Better variable locality.
19398 Remove an impossible branch: if there is a state corresponding to
19399 the start symbol being shifted, then there is shift for the start
19400 symbol from the initial state.
19401
74392f6a
AD
194022001-12-10 Akim Demaille <akim@epita.fr>
19403
19404 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
19405 only when appropriate: when insert_start_shifting_state' is not
19406 invoked.
19407 * tests/regression.at (Rule Line Numbers): Adjust.
19408
37c82725
AD
194092001-12-10 Akim Demaille <akim@epita.fr>
19410
19411 * src/LR0.c (augment_automaton): Now that all states have shifts,
19412 merge the two cases addition shifts to the initial state.
19413
6a164e0c
AD
194142001-12-10 Akim Demaille <akim@epita.fr>
19415
19416 * src/lalr.c (set_state_table): Move to...
19417 * src/LR0.c: here.
19418 * src/lalr.c (lalr): Don't call it...
19419 * src/LR0.c (generate_states): do it.
19420 * src/LR0.h (first_state): Remove, only the table is used.
19421
7215de24
AD
194222001-12-10 Akim Demaille <akim@epita.fr>
19423
19424 * src/LR0.h (first_shift, first_reduction): Remove.
19425 * src/lalr.c: Don't use first_shift: find shifts through the
19426 states.
19427
80e25d4d
AD
194282001-12-10 Akim Demaille <akim@epita.fr>
19429
19430 * src/LR0.c: Attach shifts to states as soon as they are
19431 computed.
19432 * src/lalr.c (set_state_table): Instead of assigning shifts to
19433 state, just assert that the mapping was properly done.
19434
0ab3728b
AD
194352001-12-10 Akim Demaille <akim@epita.fr>
19436
19437 * src/LR0.c (insert_start_shift): Rename as...
19438 (insert_start_shifting_state): this.
19439 (insert_eof_shifting_state, insert_accepting_state): New.
19440 (augment_automaton): Adjust.
19441 Better locality of the variables.
19442 When looking if the start_symbol is shifted from the initial
19443 state, using `while (... symbol != start_symbol ...)' sounds
19444 better than `while (... symbol < start_symbol ...)': If fail
19445 to see how the order between symbols could be relevant!
19446
78af9bbc
AD
194472001-12-10 Akim Demaille <akim@epita.fr>
19448
19449 * src/getargs.h: Don't declare `spec_name_prefix' and
19450 `spec_file_prefix', declared by src/files.h.
19451 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
19452 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
19453 * src/output.c (prepare): Adjust.
19454 * src/reader.c (symbols_output): Likewise.
19455 * src/vmsgetargs.c: Vaguely adjust, but who cares?
19456
bdef2a41
AD
194572001-12-10 Akim Demaille <akim@epita.fr>
19458
19459 * src/muscle_tab.c (muscle_init): NULL is a better default than
19460 `"0"'.
19461
3735969c
AD
194622001-12-10 Akim Demaille <akim@epita.fr>
19463
19464 * src/reader.c (reader): Calling symbols_output once is enough.
19465
49701457
AD
194662001-12-10 Akim Demaille <akim@epita.fr>
19467
19468 Now that states have a complete set of members, the linked list of
19469 reductions is useless: just fill directly the state's reductions
19470 member.
19471
19472 * src/state.h (struct reductions): Remove member `number' and
19473 `next'.
19474 * src/LR0.c (first_reduction, last_reduction): Remove.
19475 (save_reductions): Don't link the new reductions, store them in
19476 this_state.
19477 * src/lalr.c (set_state_table): No need to attach reductions to
19478 states, it's already done.
19479 * src/output.c (output_actions): No longer free the shifts, then
19480 the reductions, then the states: free all the states and their
19481 members.
19482
0edad749
AD
194832001-12-10 Akim Demaille <akim@epita.fr>
19484
19485 * src/options.c (OPTN, DRTV, BOTH): New.
19486 (option_table): Use them.
19487
0edad749
AD
19488 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
19489 the job of system.h.
19490 * src/options.c: Don't include stdio.h and xalloc.h for the same
19491 reasons.
19492
5449dd0f
AD
194932001-12-10 Akim Demaille <akim@epita.fr>
19494
19495 * src/output.c (output, prepare): Make sure the values of the
19496 muscles `action' and `prologue' are 0-terminated.
19497
a870c567
AD
194982001-12-10 Akim Demaille <akim@epita.fr>
19499
19500 Clean up GCC warnings.
19501
19502 * src/reader.c (copy_action): `buf' is not used.
19503 (parse_skel_decl): Be static.
19504 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
19505 * src/options.h (create_long_option_table): Have a real prototype.
19506 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
19507 (hash_delete_at): Return const void *.
19508 Adjust casts to preserve the const.
19509
80df8768
AD
195102001-12-10 Akim Demaille <akim@epita.fr>
19511
19512 * configure.in: Require 2.52g.
19513 M4 is not needed, but AUTOM4TE is.
19514 * m4/m4.m4: Remove.
19515 * tests/Makefile.am: Adjust.
19516
f693ad14
AD
195172001-12-10 Akim Demaille <akim@epita.fr>
19518
19519 One structure for states is enough, even though theoretically
19520 there are LR(0) states and LALR(1) states.
19521
19522 * src/lalr.h (state_t): Remove.
19523 (state_table): Be state_t **, not state_t *.
19524 * src/state.h (core, CORE_ALLOC): Rename as...
19525 (state_t, STATE_ALLOC): this.
19526 Add the LALR(1) members: shifts, reductions, errs.
19527 * src/LR0.c (state_table): Rename as...
19528 (state_hash): this, to avoid name clashes with the global
19529 `state_table'.
19530 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
19531 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
19532
74ffbcb6
AD
195332001-12-10 Akim Demaille <akim@epita.fr>
19534
19535 Bison dumps core on bash.y.
19536 Reported by Pascal Bart.
19537
19538 * src/warshall.c (bitmatrix_print): New.
19539 (TC): Use it.
ba0fe3c7 19540 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
19541 j must be the outer loop.
19542 * tests/regression.at (Broken Closure): New.
19543
07708e19
AD
195442001-12-05 Akim Demaille <akim@epita.fr>
19545
19546 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
19547 its argument.
ba1ecc07 19548 Reported by Peter Hamorsky.
07708e19 19549
92b16366
AD
195502001-12-05 Akim Demaille <akim@epita.fr>
19551
19552 * src/conflicts.c (err_table): Remove.
19553 (resolve_sr_conflict): Adjust.
19554 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
19555 Rename as...
19556 (state_t.reductions, state_t.shifts): this.
19557
076ab033
AD
195582001-12-05 Akim Demaille <akim@epita.fr>
19559
19560 * src/reduce.c (reduce_grammar_tables): No longer disable the
19561 removal of useless rules via CPP but via `if (0)', so that the
19562 compiler still check the code is valid.
19563 For instance, it should have noticed `rline' no longer exists: use
19564 the `line' member of rule_t.
19565 * src/gram.c (dummy, rline): Remove, unused.
19566
3843c413
AD
195672001-12-05 Akim Demaille <akim@epita.fr>
19568
19569 * src/output.c (pack_vector): Use assert, not berror.
19570 * src/main.c (berror): Remove, unused.
19571
43168960
AD
195722001-12-05 Akim Demaille <akim@epita.fr>
19573
19574 New experimental feature: if --verbose --trace output all the
19575 items of a state, not only its kernel.
19576
19577 * src/print.c (print_core): If `trace_flag', then invoke closure
19578 before outputting the items of the state (print_core is no longer
19579 a correct name them).
19580 (print_results): Invoke new_closure/free_closure if needed.
19581
b2872512
AD
195822001-12-05 Akim Demaille <akim@epita.fr>
19583
19584 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
19585 * src/closure.c, src/closure.h (itemsetsize): Rename as...
19586 (nitemset): for consistency with the rest of the project.
19587
23cbcc6c
AD
195882001-12-05 Akim Demaille <akim@epita.fr>
19589
19590 * src/closure.c (print_closure): Improve.
19591 (closure): Use it for printing input and output.
19592
03ec521c
AD
195932001-12-05 Akim Demaille <akim@epita.fr>
19594
19595 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
19596 indexed by nonterminals.
19597
3a7456dd
AD
195982001-12-05 Akim Demaille <akim@epita.fr>
19599
19600 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
19601 what it was!).
19602 * src/warshall.h: Remove accidental duplication of the content.
19603
1cbcf2e7
AD
196042001-12-05 Akim Demaille <akim@epita.fr>
19605
19606 * src/closure.c (set_fderives): De-obfuscate.
19607
84182270
AD
196082001-12-05 Akim Demaille <akim@epita.fr>
19609
19610 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
19611
3f6f053c
AD
196122001-12-05 Akim Demaille <akim@epita.fr>
19613
19614 * src/closure.c (set_firsts): De-obfuscate.
19615
7a5350ba
AD
196162001-12-05 Akim Demaille <akim@epita.fr>
19617
19618 * src/output.c (action_row): De-obfuscate
19619 using the good o' techniques: arrays not pointers, variable
19620 locality, BITISSET, RESETBIT etc.
19621
d954473d
AD
196222001-12-05 Akim Demaille <akim@epita.fr>
19623
19624 Pessimize the code to simplify it: from now on, all the states
19625 have a valid SHIFTS, which NSHIFTS is possibly 0.
19626
19627 * src/LR0.c (shifts_new): Be global and move to..
19628 * src/state.c, src/state.h: here.
19629 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
19630 * src/print_graph: Adjust.
19631
9839bbe5
AD
196322001-12-05 Akim Demaille <akim@epita.fr>
19633
19634 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
19635 * src/conflicts.c: Use it.
19636 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
19637 incorrectly ``simplified''.
19638
9f136c07
AD
196392001-12-05 Akim Demaille <akim@epita.fr>
19640
19641 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
19642 using the good o' techniques: arrays not pointers, variable
19643 locality, BITISSET, RESETBIT etc.
19644
b608206e
AD
196452001-12-05 Akim Demaille <akim@epita.fr>
19646
19647 * src/state.h (SHIFT_SYMBOL): New.
19648 * src/conflicts.c: Use it to deobfuscate.
19649
52afa962
AD
196502001-12-05 Akim Demaille <akim@epita.fr>
19651
19652 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
19653 (print_reductions): De-obfuscate using the good o' techniques:
19654 arrays not pointers, variable locality, BITISSET.
19655
e74dc321
AD
196562001-12-05 Akim Demaille <akim@epita.fr>
19657
19658 * src/conflicts.c (print_reductions): Arrays, not pointers.
19659 Use BITISSET.
19660
768fca83
AD
196612001-12-05 Akim Demaille <akim@epita.fr>
19662
19663 * src/conflicts.c (print_reductions): Pessimize, but clarify.
19664
a17e599f
AD
196652001-12-05 Akim Demaille <akim@epita.fr>
19666
19667 * src/conflicts.c (print_reductions): Improve variable locality.
19668
a04bc341
AD
196692001-12-05 Akim Demaille <akim@epita.fr>
19670
19671 * src/conflicts.c (print_reductions): Pessimize, but clarify.
19672
c8ea038e
AD
196732001-12-05 Akim Demaille <akim@epita.fr>
19674
19675 * src/conflicts.c (print_reductions): Improve variable locality.
19676
aa2aab3c
AD
196772001-12-05 Akim Demaille <akim@epita.fr>
19678
19679 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
19680 * src/lalr.c: Use them.
19681
b178c8cc
AD
196822001-12-05 Akim Demaille <akim@epita.fr>
19683
19684 * src/LR0.c (augment_automaton): Formatting changes.
19685 Better variable locality.
19686
f67d13aa
AD
196872001-12-05 Akim Demaille <akim@epita.fr>
19688
19689 * src/lalr.c (matrix_print): New.
19690 (transpose): Use it.
19691 Use arrays instead of pointers.
19692
c2713865
AD
196932001-12-05 Akim Demaille <akim@epita.fr>
19694
19695 * src/lalr.c (maxrhs): Move to...
19696 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
19697 * src/lalr.c (build_relations): Adjust.
19698
9887c18a
AD
196992001-12-05 Akim Demaille <akim@epita.fr>
19700
19701 * src/lalr.c (transpose): Free the memory allocated to the
19702 argument, as it is replaced by the results by the unique caller.
19703 (build_relations): Merely invoke transpose: it handles the memory
19704 deallocation.
19705 Improve variable locality.
19706 Avoid variables used as mere abbreviations.
19707 (compute_lookaheads): Use arrays instead of pointers.
19708
4d4f699c
AD
197092001-12-05 Akim Demaille <akim@epita.fr>
19710
19711 * src/lalr.c (initialize_F): Improve variable locality.
19712 Avoid variables used as mere abbreviations.
19713
80a69750
AD
197142001-12-05 Akim Demaille <akim@epita.fr>
19715
19716 * src/derives.c (print_derives): Display the ruleno.
19717 * src/lalr.c (initialize_F, transpose): Better variable locality
19718 to improve readability.
19719 Avoid variables used as mere abbreviations.
19720
fe961097
AD
197212001-12-05 Akim Demaille <akim@epita.fr>
19722
19723 * src/lalr.c (traverse): Use arrays instead of pointers.
19724
e3e4e814
AD
197252001-12-05 Akim Demaille <akim@epita.fr>
19726
19727 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
19728 the handling of squeue.
19729 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
19730
630e182b
AD
197312001-12-05 Akim Demaille <akim@epita.fr>
19732
19733 Because useless nonterminals are now kept alive (instead of being
19734 `destroyed'), we now sometimes examine them, and store information
19735 related to them. Hence we need to know their number, and adjust
19736 memory allocations.
19737
19738 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
19739 static.
19740 * src/LR0.c (allocate_itemsets): The memory allocated to
19741 `symbol_count' was used for two different purpose: once to count
19742 the number of occurrences of each symbol, and later reassigned to
19743 `shift_symbol', containing the symbol that can be shifted from a
19744 given state.
19745 Deobfuscate, i.e., allocate, use and free `symbol_count' here
19746 only, and...
19747 (new_itemsets): Allocate `shift_symbol' here.
19748 (allocate_itemsets): symbol_count includes useless nonterminals.
19749 Make room for them.
19750 (free_storage): Use `free', not `XFREE', for pointers that cannot
19751 be null.
19752
81b51460
AD
197532001-12-05 Akim Demaille <akim@epita.fr>
19754
19755 * src/nullable.c (set_nullable): Deobfuscate the handling of
19756 ritem.
19757 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
19758
3067fbef
AD
197592001-12-05 Akim Demaille <akim@epita.fr>
19760
19761 * src/gram.c, src/gram.h (ritem_print): New.
19762 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
19763 (This useless function was defined only to work around VMS linkers
19764 that can't handle compilation units with variables only).
19765 * src/reduce.c (dump_grammar): Use it to trace the construction of
19766 ritem.
19767
c2bea5f9
PE
197682001-12-04 Paul Eggert <eggert@twinsun.com>
19769
7d27c823
PE
19770 * src/bison.simple (union yyalloc): Change member names
19771 to be the same as the stack names.
19772 (yyparse): yyptr is now union yyalloc *, not char *.
19773 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
19774 and may generate better code on some machines.
c2bea5f9
PE
19775 (yystpcpy): Use prototype if __STDC__ is defined, not just
19776 if __cplusplus is defined.
35687a9d 19777
2c8a9dfa
AD
197782001-11-30 Akim Demaille <akim@epita.fr>
19779
19780 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
19781 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
19782 Gettext doesn't compile cleanly, and dies with -Werror.
19783 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
19784 Include WARNING_CFLAGS here.
19785 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
19786 before being defined.
19787
f4e421e6
AD
197882001-11-27 Paul Eggert <eggert@twinsun.com>
19789
19790 * lib/quotearg.h (quotearg_n, quotearg_n_style):
19791 First arg is int, not unsigned.
19792 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
19793 (SIZE_MAX, UINT_MAX): New macros.
19794 (quotearg_n_options): Abort if N is negative.
19795 Avoid overflow check on hosts where size_t is 64 bits and int
19796 is 32 bits, as overflow is impossible there.
19797 Fix off-by-one typo that caused unnecessary reallocation.
19798
7093d0f5
AD
197992001-11-29 Paul Eggert <eggert@twinsun.com>
19800
19801 Name space cleanup in generated parser.
19802
19803 * doc/bison.texinfo (Bison Parser): Discuss system headers
19804 and their effect on the user name space.
19805
19806 * src/bison.simple:
19807 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
19808 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
19809 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
19810
19811 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
19812 on user names when possible.
19813
19814 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
19815 Simplify test for whather <alloca.h> exists.
19816
19817 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
19818
19819 (<stdio.h>): Include if YYDEBUG.
19820
19821 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
19822 ! defined (yyoverflow) && ! defined (yymemcpy).
19823
19824 (yymemcpy, yyparse): Rename local variables as needed so that
19825 they all begin with 'yy'.
19826
19827 (yystrlen, yystpcpy): New functions.
19828
19829 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
19830 All uses changed.
19831
19832 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
19833 instead of relying on string.h functions. Use YYSTACK_ALLOC
19834 and YYSTACK_FREE instead of malloc and free.
19835
fd51e5ff
AD
198362001-11-30 Akim Demaille <akim@epita.fr>
19837
19838 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
19839 before their first uses.
19840 (YYBISON, YYPURE): Move to the top of the output.
19841
7d13ff5f
AD
198422001-11-30 Akim Demaille <akim@epita.fr>
19843
19844 * tests/reduce.at (Useless Nonterminals): Fix.
19845
892a3995
AD
198462001-11-30 Akim Demaille <akim@epita.fr>
19847
19848 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
19849 if body instead of `;' to pacify GCC's warnings.
19850
68f1e3ed
AD
198512001-11-30 Akim Demaille <akim@epita.fr>
19852
19853 Instead of mapping the LHS of unused rules to -1, keep the LHS
19854 valid, but flag the rules as invalid.
19855
19856 * src/gram.h (rule_t): `useful' is a new member.
19857 * src/print.c (print_grammar): Adjust.
19858 * src/derives.c (set_derives): Likewise.
19859 * src/reader.c (packgram, reduce_output): Likewise.
19860 * src/reduce.c (reduce_grammar_tables): Likewise.
19861 * tests/reduce.at (Underivable Rules, Useless Rules): New.
19862
d2d1b42b
AD
198632001-11-30 Akim Demaille <akim@epita.fr>
19864
19865 * src/reduce.c (reduce_output): Formatting changes.
19866 * src/print.c (print_results, print_grammar): Likewise.
19867 * tests/regression.at (Rule Line Numbers)
19868 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
19869
760b53a8
AD
198702001-11-30 Akim Demaille <akim@epita.fr>
19871
19872 * src/reduce.c (nonterminals_reduce): Instead of throwing away
19873 useless nonterminals, move them at the end of the symbol arrays.
19874 (reduce_output): Adjust.
19875 * tests/reduce.at (Useless Nonterminals): Adjust.
19876
00238958
AD
198772001-11-30 Akim Demaille <akim@epita.fr>
19878
19879 * src/reduce.c: Various comment/formatting changes.
19880 (nonterminals_reduce): New, extracted from...
19881 (reduce_grammar_tables): here.
19882 (reduce_grammar): Call nonterminals_reduce.
19883
396452de
PE
198842001-11-29 Paul Eggert <eggert@twinsun.com>
19885
19886 * src/bison.simple (YYSTACK_REALLOC): Remove.
19887 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
19888 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
19889 New macros.
19890 (union yyalloc): New type.
19891 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
19892 an arbitrary restriction on hosts where size_t is wider than int.
19893
19894 (yyparse): Don't dump core if alloca or malloc fails; instead, report
19895 a parser stack overflow. Allocate just one block of memory for all
19896 three stacks, instead of allocating three blocks; this typically is
19897 faster and reduces fragmentation.
19898
19899 Do not limit the number of items in the stack to a value that fits
19900 in 'int', as this is an arbitrary limit on hosts with 64-bit
19901 size_t and 32-bit int.
19902
147e184c
MA
199032001-11-29 Marc Autret <autret_m@epita.fr>
19904
19905 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
19906 of defining YYERROR_VERBOSE.
19907 [AT_DATA]: $4 is now out of C declarations in the prologue.
19908
426cf563
MA
199092001-11-28 Marc Autret <autret_m@epita.fr>
19910
19911 * src/reader.c (parse_dquoted_param): New.
19912 (parse_skel_decl): Use it.
19913 * src/lex.h: Add its prototype.
19914 * src/lex.c (literalchar): Become not static.
19915
c7925b99
MA
199162001-11-28 Marc Autret <autret_m@epita.fr>
19917
19918 * src/output.h: And put its extern declaration here.
19919 * src/output.c (error_verbose): Define here.
19920 (prepare): Echo name modification.
19921 * src/getargs.h: Clean its extern declaration.
19922 * src/getargs.c (error_verbose_flag): Remove.
19923 (getargs): Remove case 'e'.
19924 * src/options.c (option_table): 'error-verbose' is now seen as simple
19925 percent option.
19926 Include output.h.
19927
19928 * src/reader.c (read_declarations): Remove case tok_include.
19929 (parse_include_decl): Remove.
19930 * src/lex.h (token_t): Remove tok_include.
19931 * src/options.c (option_table): 'include' is now a simple command line
19932 option.
19933
5b5d1929
MA
199342001-11-28 Marc Autret <autret_m@epita.fr>
19935
19936 * src/bison.simple: Adjust muscle names.
19937 * src/muscle_tab.c (muscle_init): Also rename the muscles.
19938 * src/output.c (prepare): s/_/-/ for the muscles names.
19939 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
19940
8850be4b
MA
199412001-11-28 Marc Autret <autret_m@epita.fr>
19942
19943 * src/bison.simple: Fix debug.
19944 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
19945
4a38e613
AD
199462001-11-28 Akim Demaille <akim@epita.fr>
19947
19948 * src/LR0.c (shifts_new): New.
19949 (save_shifts, insert_start_shift, augment_automaton): Use it.
19950
4b35e1c1
AD
199512001-11-28 Akim Demaille <akim@epita.fr>
19952
19953 * src/closure.c (closure): `b' and `ruleno' denote the same value:
19954 keep ruleno only.
19955
d2b04478
AD
199562001-11-28 Akim Demaille <akim@epita.fr>
19957
19958 * src/closure.c (closure): Instead of looping over word in array
19959 then bits in words, loop over bits in array.
19960
2c4c30aa
AD
199612001-11-28 Akim Demaille <akim@epita.fr>
19962
19963 * src/closure.c (closure): No longer optimize the special case
19964 where all the bits of `ruleset[r]' are set to 0, to make the code
19965 clearer.
19966
576890b7
AD
199672001-11-28 Akim Demaille <akim@epita.fr>
19968
19969 * src/closure.c (closure): `r' and `c' are new variables, used to
19970 de-obfuscate accesses to RULESET and CORE.
19971
cb487d7d
AD
199722001-11-28 Akim Demaille <akim@epita.fr>
19973
19974 * src/reduce.c (reduce_print): Use ngettext.
19975 (dump_grammar): Improve the trace accuracy.
19976
6013d43f
AD
199772001-11-28 Akim Demaille <akim@epita.fr>
19978
19979 * src/reduce.c (dump_grammar): Don't translate trace messages.
19980
cb4956ee
AD
199812001-11-28 Akim Demaille <akim@epita.fr>
19982
19983 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
19984 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
19985 as all tags are free'ed afterwards.
19986 From Enrico Scholz.
19987
648185ab
PE
199882001-11-27 Paul Eggert <eggert@twinsun.com>
19989
19990 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
19991 use alloca when we didn't want to, and vice versa.
19992
68254a03
MA
199932001-11-27 Marc Autret <autret_m@epita.fr>
19994
9113b58f
AD
19995 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
19996 initialization.
68254a03
MA
19997 * src/output.c (prepare): Remove its update.
19998
04d843a2
MA
199992001-11-27 Marc Autret <autret_m@epita.fr>
20000
20001 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
20002 Use %error-verbose.
20003
d2079671 200042001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
20005
20006 * src/bison.simple: Remove YYERROR_VERBOSE using.
20007 Use %%error_verbose.
20008 (yyparse): Likewise.
20009 * src/output.c (prepare): Give its final value.
20010 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
20011 * src/getargs.h: Add its extern declaration.
20012 * src/getargs.c (error_verbose_flag): New int.
20013 (getargs): Update to catch new case.
20014 * src/options.c (option_table): 'error-verbose' is a new option.
20015 (shortopts): Update.
20016
e0327bc8
AD
200172001-11-27 Akim Demaille <akim@epita.fr>
20018
20019 * src/system.h: Use intl/libgettext.h.
20020 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
20021
000f1a3c
AD
200222001-11-27 Akim Demaille <akim@epita.fr>
20023
20024 * tests/torture.at (Exploding the Stack Size with Malloc):
20025 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
20026
26cfe0be
AD
200272001-11-27 Akim Demaille <akim@epita.fr>
20028
20029 * src/files.c: Include error.h.
20030 Reported by Hans Aberg.
20031
f6bd5427
MA
200322001-11-26 Marc Autret <autret_m@epita.fr>
20033
d2079671 20034 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
20035 (read_declarations): Add case tok_include.
20036 * src/getargs.h (include): Add its extern definition.
20037 * src/getargs.c (include): New const char *.
20038 (getargs): Add case '-I'.
20039 * src/options.c (option_table): Add include as command line and
20040 percent option.
20041 * src/lex.h (token_t): Add tok_include.
20042
2ca209c1
AD
200432001-11-26 Akim Demaille <akim@epita.fr>
20044
20045 * src/reader.c (readgram): Make sure rules for mid-rule actions
20046 have a lineno equal to that of their host rule.
20047 Reported by Hans Aberg.
20048 * tests/regression.at (Rule Line Numbers): New.
20049
0e41b407
AD
200502001-11-26 Akim Demaille <akim@epita.fr>
20051
20052 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
20053 size_ts.
20054
200552001-11-26 Akim Demaille <akim@epita.fr>
20056
20057 * src/complain.c, src/complain.h (error): Remove, provided by
20058 lib/error.[ch].
20059
e0c40012
AD
200602001-11-26 Akim Demaille <akim@epita.fr>
20061
20062 * src/reader.c (read_declarations): Don't abort on tok_illegal,
20063 issue an error message.
20064 * tests/regression.at (Invalid %directive): New.
20065 Reported by Hans Aberg.
20066
5e147124
AD
200672001-11-26 Akim Demaille <akim@epita.fr>
20068
20069 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
20070 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
20071
a034c8b8
AD
200722001-11-26 Akim Demaille <akim@epita.fr>
20073
20074 * src/conflicts.c (conflicts_print): Don't complain at all when
20075 there are no reduce/reduce conflicts, and as many shift/reduce
20076 conflicts as expected.
20077 * tests/regression.at (%expect right): Adjust.
20078
c64a20f3
AD
200792001-11-23 Akim Demaille <akim@epita.fr>
20080
20081 * lib/alloca.c: Update, from fileutils.
20082
5b0d29bb
AD
200832001-11-23 Akim Demaille <akim@epita.fr>
20084
20085 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
20086
722c4bfe
AD
200872001-11-23 Akim Demaille <akim@epita.fr>
20088
20089 * src/system.h: Include alloca.h.
20090 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
20091
6255b435
AD
200922001-11-23 Akim Demaille <akim@epita.fr>
20093
20094 * src/print_graph.c (print_actions): Remove `rule', unused.
20095 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
20096 pacify GCC's signed < unsigned warnings.
20097 * src/closure.c (itemsetsize): Likewise.
20098 * src/reader.c (symbol_list_new): Static.
20099
b29b2ed5
AD
201002001-11-23 Akim Demaille <akim@epita.fr>
20101
20102 Attaching lineno to buckets is stupid, since only one copy of each
20103 symbol is kept, only the line of the first occurrence is kept too.
20104
20105 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
20106 * src/reader.c (rline_allocated): Remove, unused.
20107 (symbol_list): Have a `line' member.
20108 (symbol_list_new): New.
20109 (readgram): Use it.
20110 * src/print.c (print_grammar): Output the rule line numbers.
20111 * tests/regression.at (Solved SR Conflicts)
20112 (Unresolved SR Conflicts): Adjust.
20113 Reported by Hans Aberg.
20114
a81b1d4a
MA
201152001-11-22 Marc Autret <autret_m@epita.fr>
20116
20117 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
20118
c1ecb3c1
MA
201192001-11-22 Marc Autret <autret_m@epita.fr>
20120
20121 * src/muscle_tab.c (muscle_init): Remove initialization of
20122 skeleton muscle.
20123 * src/output.c (output_master_parser): Do it here.
20124
fbe01355
AD
201252001-11-20 Akim Demaille <akim@epita.fr>
20126
20127 * po/sv.po: New.
20128 * configure.in (ALL_LINGUAS): Adjust.
20129 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
20130 longer contains strings to translate.
20131
81e895c0
AD
201322001-11-19 Akim Demaille <akim@epita.fr>
20133
20134 * src/conflicts.c (conflicts_print): Add a missing \n.
20135
6bb1878b
AD
201362001-11-19 Akim Demaille <akim@epita.fr>
20137
20138 * src/nullable.c (nullable_print): New.
20139 (set_nullable): Call it when tracing.
20140 Better locality of variables.
20141
d9ec2d07
AD
201422001-11-19 Akim Demaille <akim@epita.fr>
20143
20144 * src/print.c (print_actions): Better locality of variables.
20145
720e5c1b
AD
201462001-11-19 Akim Demaille <akim@epita.fr>
20147
20148 * src/derives.c (print_derives): Fix and enrich.
20149 * src/closure.c (print_fderives): Likewise.
20150
fb908786
AD
201512001-11-19 Akim Demaille <akim@epita.fr>
20152
20153 * src/closure.c (itemsetend): Remove, replaced with...
20154 (itemsetsize): new.
20155
125ecb56
AD
201562001-11-19 Akim Demaille <akim@epita.fr>
20157
20158 * src/LR0.c (kernel_end): Remove, replaced with...
20159 (kernel_size): new.
20160
d8cf039f
AD
201612001-11-19 Akim Demaille <akim@epita.fr>
20162
20163 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
20164 to clarify.
20165
7bec0760
AD
201662001-11-19 Akim Demaille <akim@epita.fr>
20167
20168 * src/closure.c (closure): Use arrays instead of pointers to clarify.
20169
c87d4863
AD
201702001-11-19 Akim Demaille <akim@epita.fr>
20171
20172 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
20173 trace messages.
20174 * src/LR0.c: Likewise.
20175 (allocate_itemsets): Use arrays instead of pointers to clarify.
20176
9bfe901c
AD
201772001-11-19 Akim Demaille <akim@epita.fr>
20178
20179 * src/getargs.c (statistics_flag): Replace with...
20180 (trace_flag): New.
20181 (longopts): Accept --trace instead of --statistics.
20182 * src/getargs.h, src/options.c: Adjust.
20183 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
20184 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
20185
97db7bd4
AD
201862001-11-19 Akim Demaille <akim@epita.fr>
20187
cc72668c 20188 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
20189 pointers to clarify the code.
20190 (save_reductions, save_shifts): Factor common parts of alternatives.
20191
2c5f66ed
AD
201922001-11-19 Akim Demaille <akim@epita.fr>
20193
20194 * src/LR0.c (new_state, get_state): Complete TRACE code.
20195 * src/closure.c: Include `reader.h' to get `tags', needed by the
20196 trace code.
20197 Rename the conditional DEBUG as TRACE.
20198 Output consistently TRACEs to stderr, not stdout.
20199 * src/derives.c: Likewise.
20200 * src/reduce.c: (inaccessable_symbols): Using if is better style
20201 than goto.
20202 Use `#if TRACE' instead of `#if 0' for tracing code.
20203
300f275f
AD
202042001-11-19 Akim Demaille <akim@epita.fr>
20205
20206 * src/system.h (LIST_FREE, shortcpy): New.
20207 * src/LR0.c: Use them.
20208 * src/output.c (free_itemsets, free_reductions, free_shifts):
20209 Remove, replaced by LIST_FREE.
20210
f59c437a
AD
202112001-11-19 Akim Demaille <akim@epita.fr>
20212
20213 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
20214 (REDUCTIONS_ALLOC): New.
20215 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
20216 allocation.
20217
6986fd9e
AD
202182001-11-19 Akim Demaille <akim@epita.fr>
20219
20220 * src/LR0.c (new_state): Complete trace code.
20221 * src/nullable.c (set_nullable): Don't translate traces.
20222
4bc30f78
AD
202232001-11-19 Akim Demaille <akim@epita.fr>
20224
20225 * src/print_graph.c (print_core): Better locality of variables.
20226 * src/print.c (print_core): Likewise.
20227
08a946e0
AD
202282001-11-19 Akim Demaille <akim@epita.fr>
20229
20230 * src/vcg.c: You do the output, so you are responsible of the
20231 handling of VCG syntax, in particular: use quotearg.
20232 * src/print_graph.c: Don't.
20233 (print_actions): Don't output the actions as part of the nodes,
20234 since that's the job of the edges.
20235 (print_state): Don't output by hand: fill the node description,
9bfe901c 20236 and ask for its output.
08a946e0 20237
f0473484
AD
202382001-11-19 Akim Demaille <akim@epita.fr>
20239
cc72668c
AD
20240 * src/bison.simple (yyparse): When verbosely reporting an error,
20241 no longer put additional quotes around token names.
f0473484
AD
20242 * tests/calc.at: Adjust.
20243
e41dc700
AD
202442001-11-19 Akim Demaille <akim@epita.fr>
20245
20246 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
20247 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
20248 * src/output.c: Adjust.
20249
652a871c
AD
202502001-11-19 Akim Demaille <akim@epita.fr>
20251
20252 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
20253 (rule_t): this.
20254 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
20255
b2ed6e58
AD
202562001-11-19 Akim Demaille <akim@epita.fr>
20257
20258 * src/gram.h (rule_t): New.
20259 (rule_table): New.
20260 (rrhs, rlhs): Remove, part of state_t.
20261 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
20262 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
20263 * src/reader.c, src/reduce.c: Adjust.
20264
edad7067
AD
202652001-11-19 Akim Demaille <akim@epita.fr>
20266
20267 * src/reader.c (symbols_output): New, extracted from...
20268 (packsymbols): Here.
20269 (reader): Call it.
20270
3feec034
AD
202712001-11-19 Akim Demaille <akim@epita.fr>
20272
20273 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
20274 (maxrhs): this new function.
20275
ddcd5fdf
AD
202762001-11-19 Akim Demaille <akim@epita.fr>
20277
cc72668c 20278 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
20279 Adjust.
20280
bb527fc2
AD
202812001-11-19 Akim Demaille <akim@epita.fr>
20282
cc72668c 20283 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
20284 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20285 * src/lalr.c: Adjust.
20286
a845a697
AD
202872001-11-19 Akim Demaille <akim@epita.fr>
20288
20289 * src/lalr.c (initialize_LA): Only initialize LA. Let...
20290 (set_state_table): handle the `lookaheads' members.
20291
f004bf6a
AD
202922001-11-19 Akim Demaille <akim@epita.fr>
20293
cc72668c
AD
20294 * src/lalr.h (lookaheads): Removed array, whose contents is now
20295 a member of...
f004bf6a
AD
20296 (state_t): this structure.
20297 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20298 Adjust.
20299
de326cc0
AD
203002001-11-19 Akim Demaille <akim@epita.fr>
20301
cc72668c
AD
20302 * src/lalr.h (consistent): Removed array, whose contents is now
20303 a member of...
de326cc0
AD
20304 (state_t): this structure.
20305 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20306 Adjust.
20307
90b4416b
AD
203082001-11-19 Akim Demaille <akim@epita.fr>
20309
cc72668c
AD
20310 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
20311 contents are now members of...
90b4416b
AD
20312 (state_t): this structure.
20313 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20314 Adjust.
20315
9703cc49
AD
203162001-11-19 Akim Demaille <akim@epita.fr>
20317
20318 * src/lalr.h (state_t): New.
20319 (state_table): Be a state_t * instead of a core **.
20320 (accessing_symbol): Remove, part of state_t.
20321 * src/lalr.c: Adjust.
20322 (set_accessing_symbol): Merge into...
20323 (set_state_table): this.
20324 * src/print_graph.c, src/conflicts.c: Adjust.
20325
d803322e
AD
203262001-11-14 Akim Demaille <akim@epita.fr>
20327
20328 * tests/calc.at, tests/output.at, tests/regression.at,
20329 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
20330 now the tests are run in private dirs, therefore AC_CLEANUP and
20331 family can be simplified to 0-ary.
20332 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
20333 use abs. path to find config.h.
20334 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
20335 stderr, there can be way too much random noise.
20336 Instead pass -Werror to GCC and rely on the exit status.
20337 Reported by Wolfram Wagner.
20338
3d76b07d
AD
203392001-11-14 Akim Demaille <akim@epita.fr>
20340
20341 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
20342 defined only if yyoverflow is defined, to avoid `warning: unused
20343 variable `yyvs1''.
20344 Reported by The Test Suite.
20345
09b503c8
AD
203462001-11-14 Akim Demaille <akim@epita.fr>
20347
20348 * src/print.c: Include reduce.h.
20349 Reported by Hans Aberg.
20350
203512001-11-14 Akim Demaille <akim@epita.fr>
20352
20353 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
20354 Revert a previous patch: these are really const.
20355 * src/conflicts.c (conflict_report): Additional useless pair of
20356 braces to pacify GCC's warnings for `if () if () {} else {}'.
20357 * src/lex.c (parse_percent_token): Replace equal_offset with
20358 arg_offset.
20359 arg is const.
20360 Be sure to strdup `arg' when used, since there is no reason for
20361 token_buffer not to change.
20362
0f37a994
AD
203632001-11-14 Akim Demaille <akim@epita.fr>
20364
20365 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
20366 definition.
20367 * src/main.c (main): Use them.
20368 Suggested by Hans Aberg.
20369
d39d93b8
AD
203702001-11-12 Akim Demaille <akim@epita.fr>
20371
20372 * src/system.h (ngettext): Now that we use ngettext, be sure to
20373 provide a default definition when NLS are not used.
20374
9edcd895
AD
203752001-11-12 Akim Demaille <akim@epita.fr>
20376
20377 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
20378 Use @kbd to denote user input.
20379 (Language and Grammar): ANSIfy the example.
20380 Adjust its layout for info/notinfo.
20381 (Location Tracking Calc): Output error messages to stderr.
20382 Output locations in a more GNUtically correct way.
20383 Fix a couple of Englishos.
20384 Adjust @group/@end group pairs.
20385
7da99ede
AD
203862001-11-12 Akim Demaille <akim@epita.fr>
20387
e3aa65c5 20388 %expect was not functioning at all.
7da99ede
AD
20389
20390 * src/conflicts.c (expected_conflicts): Set to -1.
20391 (conflict_report): Use ngettext.
20392 (conflicts_print): Check %expect and make its violation an error.
20393 * doc/bison.texinfo (Expect Decl): Adjust.
20394 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
20395 * tests/regression.at (%expect not enough, %expect right)
20396 (%expect too much): New.
20397
ba9dda1a
AD
203982001-11-12 Akim Demaille <akim@epita.fr>
20399
20400 * tests/regression.at (Conflicts): Rename as...
20401 (Unresolved SR Conflicts): this.
20402 (Solved SR Conflicts): New.
20403
337c5bd1
AD
204042001-11-12 Akim Demaille <akim@epita.fr>
20405
20406 * src/reduce.c (print_results): Rename as...
20407 (reduce_output): This.
20408 Output to OUT, passed as argument, instead of output_obstack.
20409 (dump_grammar): Likewise.
20410 (reduce_free): New.
20411 Also free V1.
20412 (reduce_grammar): No longer call reduce_output, since...
20413 * src/print.c (print_results): do it.
20414 * src/main.c (main): Call reduce_free;
20415
c73a41af
AD
204162001-11-12 Akim Demaille <akim@epita.fr>
20417
20418 * src/conflicts.c (print_reductions): Accept OUT as argument.
20419 Output to it, not to output_obstack.
20420 * src/print.c (print_actions): Adjust.
20421
0df87bb6
AD
204222001-11-12 Akim Demaille <akim@epita.fr>
20423
20424 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
20425 the result instead of using...
20426 (src_total, rrc_total, src_count, rrc_count): Remove.
20427 (any_conflicts): Remove.
20428 (print_conflicts): Split into...
20429 (conflicts_print, conflicts_output): New.
20430 * src/conflicts.h: Adjust.
20431 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 20432 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
20433 * tests/regression.at (Conflicts): New.
20434 Reported by Tom Lane.
20435
e4d3d4de
AD
204362001-11-12 Akim Demaille <akim@epita.fr>
20437
20438 * tests/regression.at (Invalid input): Remove, duplicate with
20439 ``Invalid input: 1''.
20440
6d7d248e
AD
204412001-11-12 Akim Demaille <akim@epita.fr>
20442
20443 * tests/torture.at (AT_DATA_STACK_TORTURE)
20444 (Exploding the Stack Size with Alloca)
20445 (Exploding the Stack Size with Malloc): New.
20446
e9e4c321
AD
204472001-11-12 Akim Demaille <akim@epita.fr>
20448
20449 * src/bison.simple (YYSTACK_REALLOC): New.
20450 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 20451 Reported by Per Allansson.
e9e4c321 20452
5f7e0832
AD
204532001-11-12 Pascal Bart <pascal.bart@epita.fr>
20454
20455 * src/bison.simple: Define type yystype instead of YYSTYPE, and
20456 define CPP macro, which substitute YYSTYPE by yystype.
20457 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
20458 with yyltype/YYLTYPE. This allows inclusion of the generated
20459 header within the parser if the compiler, such as GGC, accepts
20460 multiple equivalent #defines.
20461 From Akim.
20462
e3f1699f
AD
204632001-11-05 Akim Demaille <akim@epita.fr>
20464
20465 * src/reader.c (symbols_output): New, extracted from...
20466 (packsymbols): here.
20467 (reader): Adjust.
20468
65be0866
AD
204692001-11-05 Akim Demaille <akim@epita.fr>
20470
20471 * src/lex.c (parse_percent_token): s/quotearg/quote/.
20472
e4d910bf
AD
204732001-11-05 Akim Demaille <akim@epita.fr>
20474
20475 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
20476 pattern.
20477
951366c1
AD
204782001-11-05 Akim Demaille <akim@epita.fr>
20479
20480 * src/options.h (struct option_table_struct): set_flags is void*.
20481 * src/options.c (longopts): Support `--output' and `%output'.
20482 (usage): Adjust.
20483 * src/lex.h (tok_setopt): Remove, replaced with...
20484 (tok_intopt, tok_stropt): these new guys.
20485 * src/lex.c (getopt.h): Not needed.
20486 (token_buffer, unlexed_token_buffer): Not const.
20487 (percent_table): Promote `-' over `_' in directive names.
20488 Active `%name-prefix', `file-prefix', and `output'.
20489 (parse_percent_token): Accept possible arguments to directives.
20490 Promote `-' over `_' in directive names.
20491
d8988b2f
AD
204922001-11-04 Akim Demaille <akim@epita.fr>
20493
20494 * doc/bison.texinfo (Decl Summary): Split the list into
20495 `directives for grammars' and `directives for bison'.
20496 Sort'em.
20497 Add description of `%name-prefix', `file-prefix', and `output'.
20498 Promote `-' over `_' in directive names.
20499 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
20500 Simplify the description of `--name-prefix'.
20501 Promote `-' over `_' in directive names.
20502 Promote `--output' over `--output-file'.
20503 Fix the description of `--defines'.
20504 * tests/output.at: Exercise %file-prefix and %output.
20505
6468d18e
AD
205062001-11-02 Akim Demaille <akim@epita.fr>
20507
20508 * doc/refcard.tex: Update.
20509
6b7e85b9
AD
205102001-11-02 Akim Demaille <akim@epita.fr>
20511
20512 * src/symtab.h (SUNDEF): New.
20513 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
20514 stand for `uninitialized', instead of 0.
20515 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
20516 * src/lex.c (lex): Adjust.
20517
20518 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
20519 Number it 0.
20520 Let yylex return it instead of a plain 0.
20521 Reported by Dick Streefland.
20522
cd5aafcf
AD
205232001-11-02 Akim Demaille <akim@epita.fr>
20524
20525 * tests/regression.at (Mixing %token styles): New test.
20526
037ca2f1
AD
205272001-11-02 Akim Demaille <akim@epita.fr>
20528
20529 * src/reader.c (parse_thong_decl): Formatting changes.
20530 (token_translations_init): New, extracted from...
20531 (packsymbols): Here.
20532 Adjust.
20533
270a173c
AD
205342001-11-01 Akim Demaille <akim@epita.fr>
20535
20536 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
20537 Check that `9foo.y' produces correct cpp guards.
20538 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
20539 guards.
20540 Reported by Wwp.
20541
561f9a30
AD
205422001-11-01 Akim Demaille <akim@epita.fr>
20543
20544 * tests/regression.at (Invalid input: 2): New.
20545 * src/lex.c (unlexed_token_buffer): New.
20546 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
20547 too.
20548 Reported by Wwp.
20549
f987e9d2
AD
205502001-11-01 Akim Demaille <akim@epita.fr>
20551
20552 * tests/calc.at: Catch up with 1.30.
20553 * configure.in: Bump to 1.49a.
20554 Adjust to newer Autotest.
20555
0846f581
PB
205562001-10-19 Pascal Bart <pascal.bart@epita.fr>
20557
20558 * src/conflicts.c: Move global variables rrc_total and src_total ...
20559 (print_conflicts): here.
20560 * src/output.c (output): Free global variable user_toknums.
20561 * src/lex.c (token_obstack): Become static.
20562
3c1a79b3
AD
205632001-10-18 Akim Demaille <akim@epita.fr>
20564
20565 * tests/atlocal.in (GCC): Add.
20566 * tests/calc.at: s/m4_match/m4_bmatch/.
20567 s/m4_patsubst/m4_bpatsubst/.
20568 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
20569 * configure.in: AC_SUBST(GCC).
20570
5d52e7d0
MA
205712001-10-14 Marc Autret <autret_m@epita.fr>
20572
20573 * src/options.c (create_long_option_table): Fix.
20574
631aa1d3
AD
205752001-10-10 Akim Demaille <akim@epita.fr>
20576
20577 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
20578
f6ec6d13
AD
205792001-10-04 Akim Demaille <akim@epita.fr>
20580
20581 * src/reader.c (parse_union_decl): Push the caracters in
20582 union_obstack, not attrs_obstack.
20583
342b8b6e
AD
205842001-10-04 Akim Demaille <akim@epita.fr>
20585
20586 Merge in the branch 1.29.
20587
20588 * src/reader.c (packsymbols): Use a temporary obstack for
20589 `%%tokendef', since output_stack is already used elsewhere.
20590
20591 2001-10-02 Akim Demaille <akim@epita.fr>
20592
20593 Bump 1.29d.
20594
20595 2001-10-02 Akim Demaille <akim@epita.fr>
20596
20597 Version 1.29c.
20598
20599 2001-10-02 Akim Demaille <akim@epita.fr>
20600
20601 * tests/regression.at (Invalid CPP headers): New.
20602 From Alexander Belopolsky.
20603 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
20604
20605 2001-10-02 Akim Demaille <akim@epita.fr>
20606
20607 * tests/regression.at (Invalid input): New.
20608 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
20609 Reported by Shura.
20610
20611 2001-10-02 Akim Demaille <akim@epita.fr>
20612
20613 * tests/calc.at: Now that --debug works, the tests must be adjusted.
20614
20615 2001-10-02 Akim Demaille <akim@epita.fr>
20616
20617 * src/output.c (output_parser): Assert `skeleton'.
20618 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
20619 systems.
20620 From Shura.
20621
20622 2001-10-01 Marc Autret <autret_m@epita.fr>
20623
20624 * src/lex.h: Echo modifications.
20625 * src/lex.c (unlex): Parameter is now token_t.
20626 From Hans Aberg.
20627
20628 2001-10-01 Marc Autret <autret_m@epita.fr>
20629
20630 * src/main.c: Include lex.h.
20631 From Hans Aberg.
20632
20633 2001-09-29 Akim Demaille <akim@epita.fr>
20634
20635 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
20636
20637 2001-09-28 Akim Demaille <akim@epita.fr>
20638
20639 * tests/testsuite.at: Update to newer Autotest.
20640 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
20641
20642 2001-09-27 Akim Demaille <akim@epita.fr>
20643
20644 Position independent wrapper.
20645
20646 * tests/bison: Remove.
20647 * tests/bison.in: New.
20648 * configure.in: Adjust.
20649
20650 2001-09-27 Paul Eggert <eggert@twinsun.com>
20651
20652 Port quotearg fixes from tar 1.13.24.
20653
20654 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
20655 tm to be declared.
20656 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
20657 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
20658
20659 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
20660 * m4/mbrtowc.m4: New file.
20661 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
20662 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
20663
20664 2001-09-27 Akim Demaille <akim@epita.fr>
20665
20666 Bump to 1.29c.
20667
20668 2001-09-27 Akim Demaille <akim@epita.fr>
20669
20670 Version 1.29b.
20671
20672 2001-09-25 Akim Demaille <akim@epita.fr>
20673
20674 * src/system.h: Include `xalloc.h'.
20675 Remove it from the C files.
20676 * src/files.c (output_files): Free the obstacks.
20677 * src/lex.c (init_lex): Rename as...
20678 (lex_init): this.
20679 (lex_free): New.
20680 * src/main.c (main): Use it.
20681
20682 2001-09-24 Marc Autret <autret_m@epita.fr>
20683
20684 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
20685 to output informations in fout (FILE*).
20686 (open_graph, close_graph): Likewise.
20687 (output_graph, output_edge, output_node): Likewise.
20688 * src/vcg.h: Update function prototypes.
20689 * src/print_graph.c (print_graph): Open output graph file.
20690 (print_actions): Adjust.
20691 * src/files.h: Remove extern declaration.
20692 * src/files.c: Remove graph_obstack declaration.
20693 (open_files): Remove graph_obstack initialization.
20694 (output_files): Remove graph_obstack saving.
20695
20696 2001-09-24 Marc Autret <autret_m@epita.fr>
20697
20698 * src/files.c (compute_output_file_names): Fix.
20699
20700 2001-09-24 Marc Autret <autret_m@epita.fr>,
20701 Akim Demaille <akim@epita.fr>
20702
20703 * src/reader.c (reader): Remove call to free_symtab ().
20704 * src/main.c (main): Call it here.
20705 Include symtab.h.
20706 * src/conflicts.c (initialize_conflicts): Rename as...
20707 (solve_conflicts): this.
20708 * src/print.c (print_core, print_actions, print_state)
20709 (print_grammar): Dump to a file instead a `output_obstack'.
20710 (print_results): Dump `output_obstack', and then proceed with the
20711 FILE *.
20712 * src/files.c (compute_output_file_names, close_files): New.
20713 (output_files): Adjust.
20714 * src/main.c (main): Adjust.
20715
20716 2001-09-23 Marc Autret <autret_m@epita.fr>
20717
20718 * src/files.c (compute_header_macro): Computes header macro name
20719 from spec_defines_file when given.
20720
20721 2001-09-23 Marc Autret <autret_m@epita.fr>
20722
20723 * src/files.c (output_files): Add default extensions.
20724
20725 2001-09-22 Akim Demaille <akim@epita.fr>
20726
20727 * src/conflicts.c (finalize_conflicts): Rename as...
20728 (free_conflicts): this.
20729
20730 2001-09-22 Akim Demaille <akim@epita.fr>
20731
20732 * src/gram.c (gram_free): Rename back as...
20733 (dummy): this.
20734 (output_token_translations): Free `token_translations'.
20735 * src/symtab.c (free_symtab): Free the tag field.
20736
20737 2001-09-22 Akim Demaille <akim@epita.fr>
20738
20739 Remove `translations' as it is always set to true.
20740
20741 * src/gram.h: Adjust.
20742 * src/reader.c (packsymbols, parse_token_decl): Adjust
20743 * src/print.c (print_grammar): Adjust.
20744 * src/output.c (output_token_translations): Adjust.
20745 * src/lex.c (lex): Adjust.
20746 * src/gram.c: Be sure the set pointers to NULL.
20747 (dummy): Rename as...
20748 (gram_free): this.
20749
20750 2001-09-22 Akim Demaille <akim@epita.fr>
20751
20752 * configure.in: Invoke AM_LIB_DMALLOC.
20753 * src/system.h: Use dmalloc.
20754 * src/LR0.c: Be sure to have pointers initialized to NULL.
20755 (allocate_itemsets): Allocate kernel_items only if needed.
20756
20757 2001-09-22 Akim Demaille <akim@epita.fr>
20758
20759 * configure.in: Bump to 1.29b.
20760 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
20761 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
20762 need xmalloc.c in calc.y.
20763 From Pascal Bart.
20764
20765 2001-09-21 Akim Demaille <akim@epita.fr>
20766
20767 Version 1.29a.
20768 * Makefile.maint, config/config.guess, config/config.sub,
20769 * config/missing: Update from masters.
20770 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
20771 upon package.m4.
20772 * configure.in (ALL_LINGUAS): Add `tr'.
20773
20774 2001-09-21 Akim Demaille <akim@epita.fr>
20775
20776 * tests/Makefile.am (package.m4): Move to...
20777 ($(srcdir)/$(TESTSUITE)): here.
20778
20779 2001-09-20 Akim Demaille <akim@epita.fr>
20780
20781 * src/complain.c: No longer try to be standalone: use system.h.
20782 Don't assume __STDC__ is defined to 1. Just test if it is defined.
20783 * src/complain.h: Likewise.
20784 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
20785 Remove the unused variable `n'.
20786 From Albert Chin-A-Young.
20787
20788 2001-09-18 Marc Autret <autret_m@epita.fr>
20789
20790 * doc/bison.1: Update.
20791 * doc/bison.texinfo (Bison Options): Update --defines and --graph
20792 descriptions.
20793 (Option Cross Key): Update.
20794 Add --graph.
20795
20796 2001-09-18 Marc Autret <autret_m@epita.fr>
20797
20798 * tests/regression.at: New test (comment in %union).
20799
20800 2001-09-18 Marc Autret <autret_m@epita.fr>
20801
20802 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
20803 do that.
20804 Reported by Keith Browne.
20805
20806 2001-09-18 Marc Autret <autret_m@epita.fr>
20807
20808 * tests/output.at: Add tests for --defines and --graph.
20809
20810 2001-09-18 Marc Autret <autret_m@epita.fr>
20811
20812 * tests/output.at: Removes tests of %{header,src}_extension features.
20813
20814 2001-09-18 Akim Demaille <akim@epita.fr>
20815
20816 * tests/Makefile.am (package.m4): New.
20817 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
20818 (_AT_CHECK_CALC_ERROR): Likewise.
20819 Factor the `, ' part of verbose error messages.
20820
20821 2001-09-18 Marc Autret <autret_m@epita.fr>
20822
20823 * src/getargs.c (longopts): Declare --defines and --graph as options
20824 with optional arguments.
20825 * src/files.h: Add extern declarations.
20826 * src/files.c (spec_graph_file, spec_defines_file): New.
20827 (output_files): Update.
20828 Remove CPP-outed code.
20829
20830 2001-09-18 Marc Autret <autret_m@epita.fr>
20831
20832 Turn off %{source,header}_extension feature.
20833
20834 * src/files.c (compute_exts_from_gf): Update.
20835 (compute_exts_from_src): Update.
20836 (output_files): CPP-out useless code.
20837 * src/files.h: Remove {header,source}_extension extern declarations.
20838 * src/reader.c (parse_dquoted_param): CPP-out.
20839 (parse_header_extension_decl): Remove.
20840 (parse_source_extension_decl): Remove.
20841 (read_declarations): Remove cases tok_{hdrext,srcext}.
20842 * src/lex.c (percent_table): Remove {header,source}_extension entries.
20843 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
20844
20845 2001-09-10 Akim Demaille <akim@epita.fr>
20846
20847 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
20848 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
20849 (AT_CHECK_OUTPUT): this.
20850 Merely check ls' exit status, its output is useless.
20851
20852 2001-09-10 Akim Demaille <akim@epita.fr>
20853
20854 * tests/calc.at: Use m4_match.
20855 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
20856
20857 2001-09-10 Marc Autret <autret_m@epita.fr>,
20858 Akim Demaille <akim@epita.fr>
20859
20860 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
20861 enum color_e.
20862 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
20863 to `normal'.
20864 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
20865 * src/lex.h: Adjust prototype.
20866 (token_t): Add `tok_undef'.
20867 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
20868 (parse_percent_token): Now returns token_t.
20869 Add default statement in switch.
20870 (lex): Separate `c' as an input variable, from the token_t result
20871 part.
20872 (unlexed): Is a token_t.
20873
20874 2001-09-10 Akim Demaille <akim@epita.fr>
20875
20876 * configure.in: Bump to 1.29a.
20877
20878 2001-09-07 Akim Demaille <akim@epita.fr>
20879
20880 Version 1.29.
20881
20882 2001-08-30 Akim Demaille <akim@epita.fr>
20883
20884 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
20885 * m4/atconfig.m4: Remove.
20886 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
20887 * tests/bison: New.
20888 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
20889 m4_if, m4_patsubst, and m4_regexp.
20890 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
20891 `input' file instead of echo.
20892
20893 2001-08-29 Akim Demaille <akim@epita.fr>
20894
20895 Bump to 1.28e.
20896
20897 2001-08-29 Akim Demaille <akim@epita.fr>
20898
20899 Version 1.28d.
20900
20901 2001-08-29 Paul Eggert <eggert@twinsun.com>
20902
20903 * src/bison.simple (yyparse): Don't take the address of an
20904 item before the start of an array, as that doesn't conform to
20905 the C Standard.
20906
20907 2001-08-29 Robert Anisko <anisko_r@epita.fr>
20908
20909 * doc/bison.texinfo (Location Tracking Calc): New node.
20910
20911 2001-08-29 Paul Eggert <eggert@twinsun.com>
20912
20913 * src/output.c (output): Do not define const, as this now
20914 causes more problems than it cures.
20915
20916 2001-08-29 Akim Demaille <akim@epita.fr>
20917
20918 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
20919 the nodes.
20920 Be sure to tag the `detailmenu'.
20921
20922 2001-08-29 Akim Demaille <akim@epita.fr>
20923
20924 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
20925 download in a tmp dir.
20926
20927 2001-08-28 Marc Autret <autret_m@epita.fr>
20928
20929 * config/depcomp: New file.
20930
20931 2001-08-28 Marc Autret <autret_m@epita.fr>
20932
20933 * doc/bison.1 (mandoc): Adjust.
20934 From Juan Manuel Guerrero.
20935
20936 2001-08-28 Marc Autret <autret_m@epita.fr>
20937
20938 * src/print_graph.c (print_state): Fix.
20939
20940 2001-08-27 Marc Autret <autret_m@epita.fr>
20941
20942 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
20943 char * members.
20944 Echo modifications to the functions prototypes.
20945 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
20946
20947 2001-08-27 Marc Autret <autret_m@epita.fr>
20948
20949 * src/vcg.c: Include `xalloc.h'.
20950 (add_colorentry): New.
20951 (add_classname): New.
20952 (add_infoname): New.
20953 * src/vcg.h: Add new prototypes.
20954
20955 2001-08-27 Akim Demaille <akim@epita.fr>
20956
20957 * Makefile.maint: Sync. again with CVS Autoconf.
20958
20959 2001-08-27 Akim Demaille <akim@epita.fr>
20960
20961 * Makefile.maint: Formatting changes.
20962 (po-update, cvs-update, update): New targets.
20963 (AMTAR): Remove.
20964
20965 2001-08-27 Akim Demaille <akim@epita.fr>
20966
20967 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
20968 * Makefile.maint: Sync. with CVS Autoconf.
20969
20970 2001-08-27 Marc Autret <autret_m@epita.fr>
20971
20972 * src/vcg.h (struct infoname_s): New.
20973 (struct colorentry_s): New.
20974 (graph_s): New fields {vertical,horizontal}_order in structure.
20975 Add `infoname' field.
20976 Add `colorentry' field;
20977 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
20978 (G_HORIZONTAL_ORDER): New.
20979 (G_INFONAME): New.
20980 (G_COLORENTRY): New.
20981 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
20982 Add output of `infoname'.
20983 Add output of `colorentry'.
20984
20985 2001-08-27 Marc Autret <autret_m@epita.fr>
20986
20987 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
20988 This one shadowed a global parameter.
20989
20990 2001-08-24 Marc Autret <autret_m@epita.fr>
20991
20992 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
20993 instead of `unsigned'.
20994 (print_state): Do not call obstack_object_size () in obstack_grow ()
20995 to avoid macro variables shadowing.
20996
20997 2001-08-23 Marc Autret <autret_m@epita.fr>
20998
20999 * src/lex.c (percent_table): Typo: s/naem/name/.
21000 Add graph option.
21001 Normalize new options declarations.
21002
21003 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
21004
21005 * tests/suite.at: Exercise %header_extension and %source_extension.
21006
21007 2001-08-16 Marc Autret <autret_m@epita.fr>
21008
21009 * src/reader.c (parse_dquoted_param): New.
21010 (parse_header_extension_decl): Use it.
21011 (parse_source_extension_decl): Likewise.
21012
21013 2001-08-16 Marc Autret <autret_m@epita.fr>
21014
21015 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
21016 (get_xxxx_str): Use assert () instead of complain ().
21017 Remove return invokations in default cases.
21018 (get_decision_str): Modify default behaviour. Remove second argument.
21019 Echo modifications on calls.
21020 (output_graph): Fix.
21021
21022 2001-08-16 Marc Autret <autret_m@epita.fr>
21023
21024 * src/getargs.c (usage): Update with ``-g, --graph''.
21025
21026 2001-08-16 Marc Autret <autret_m@epita.fr>
21027
21028 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
21029 (Option Cross Key): Likewise.
21030 * doc/bison.1: Update.
21031
1c8c2190
PB
210322001-09-25 Pascal Bart <pascal.bart@epita.fr>
21033
21034 * src/output.c (output_master_parser): Don't finish action_obstack.
21035 (output_parser): Don't care about the muscle action, here.
21036 (prepare): Copy the action_obstack in the action muscle.
21037 (output): Free action_obstack.
21038
180d45ba
PB
210392001-09-23 Pascal Bart <pascal.bart@epita.fr>
21040
21041 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
21042 will contain `%union' declaration.
21043 (parse_union_decl): Delete #line directive output.
21044 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
21045 informations about %union.
21046 (parse_union_decl): Copy the union_obstack in the muscle stype.
21047 * src/bison.simple: Add new #line directive.
21048 Add typdef %%stype YYSTYPE.
21049
c51d1a19
PB
210502001-09-23 Pascal Bart <pascal.bart@epita.fr>
21051
21052 * src/bison.simple: Add new `#line' directive.
21053
6f9344da
PB
210542001-09-22 Pascal Bart <pascal.bart@epita.fr>
21055
21056 * src/bison.simple: New `#line' directive.
21057 * src/output.c (output_parser): Support new dynamic muscle input_line.
21058
652def80
MA
210592001-09-22 Marc Autret <autret_m@epita.fr>
21060
21061 * src/output.c (output_master_parser): New.
21062 (output_parser): Be more re-entrant.
21063
25b222fa
MA
210642001-09-21 Marc Autret <autret_m@epita.fr>
21065
21066 * src/reader.c (copy_definition, parse_union_decl): Update and use
21067 `linef' muscle.
21068 (copy_action): Likewise.
21069 Use obstack_1grow ().
21070 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
21071
6bc35ae5
MA
210722001-09-21 Marc Autret <autret_m@epita.fr>
21073
21074 * src/options.c (option_table): Adjust.
21075 * src/lex.c (parse_percent_token): Fix.
21076
c0629aa1
PB
210772001-09-20 Pascal Bart <pascal.bart@epita.fr>
21078
21079 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 21080
82b6d266
PB
210812001-09-20 Pascal Bart <pascal.bart@epita.fr>
21082
21083 * src/lex.c (parse_percent_token): Change type of variable `tx', which
21084 is now an option_table_struct*.
21085 (option_strcmp): New function option_strcmp.
21086 (parse_percent_token): Call option_strcmp.
21087 * src/getargs.c (xalloc.h, options.h): Include it.
21088 (getargs): Call create_long_option_table.
21089 (getargs): Free longopts at the end of the function.
21090 (shortopts): Move in options.c.
21091 * src/options.c (create_long_option_table): New function. Convert
21092 information from option_table to option structure.
21093 * src/reader.c (options.h): Include it.
21094
21095 * src/Makefile.am: Adjust.
21096 * src/options.c (option_table): Create from longopts and percent_table.
21097 * src/getargs.c (longopts): Delete.
21098 * src/lex.c (struct percent_table_struct): Delete.
21099 (percent_table): Delete.
21100 (options.h): Include it.
21101 * src/options.c: Create.
21102 * src/options.h: Create.
21103 Declare enum opt_access_e.
21104 Define struct option_table_struct.
21105
75f5aaea
MA
211062001-09-20 Marc Autret <autret_m@epita.fr>
21107
21108 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
21109 sections of Bison.
21110
f508cb0a
PB
211112001-09-19 Pascal Bart <pascal.bart@epita.fr>
21112
21113 * src/bison.simple: s/%%filename/%%skeleton.
21114 * src/muscle_tab.c (getargs.h): Include it.
21115 (muscle_init): Insert new muscle skeleton.
21116
13105fc1
PB
211172001-09-18 Pascal Bart <pascal.bart@epita.fr>
21118
21119 * src/output.c (output_parser): Delete unused variable actions_dumped.
21120
b0c4483e
PB
211212001-09-07 Pascal Bart <pascal.bart@epita.fr>
21122
21123 * src/output.c (output): Delete call to reader_output_yylsp.
21124 * src/reader.c (reader): Likewise.
ba0fe3c7 21125 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 21126
11d82f03
MA
211272001-09-02 Marc Autret <autret_m@epita.fr>
21128
21129 * src/reader.c: Include muscle_tab.h.
21130 (parse_union_decl): Update.
21131 (parse_macro_decl): Rename parse_muscle_decl.
21132 Update to use renamed functions and variable.
21133 (read_declarations, copy_action, read_additionnal_code, : Updated
21134 with correct variables and functions names.
21135 (packsymbols, reader): Likewise.
342b8b6e 21136
11d82f03 21137 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 21138
11d82f03
MA
21139 * src/output.c: Include muscle_tab.h
21140 In all functions using macro_insert, change by using muscle_insert ().
21141 (macro_obstack): Rename muscle_obstack.
21142 Echo modifications in the whole file.
21143 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
21144 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
21145 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
21146
21147 * src/muscle_tab.h: Update double inclusion macros.
21148 (macro_entry_s): Rename muscle_entry_s.
21149 Update prototypes.
342b8b6e 21150
11d82f03
MA
21151 * src/muscle_tab.c: Include muscle_tab.h.
21152 Rename macro_tabble to muscle_table.
21153 (mhash1, mhash2, mcmp): Use muscle_entry.
21154 (macro_init): Rename muscle_init. Update.
21155 (macro_insert): Rename muscle_insert. Update.
21156 (macro_find): Rename muscle_find. Update.
21157
21158 * src/main.c: Include muscle_tab.h.
21159 (main): Call muscle_init ().
21160 * src/Makefile.am (bison_SOURCES): Echo modifications.
21161
93a37297
MA
211622001-09-02 Marc Autret <autret_m@epita.fr>
21163
f753cd62 21164 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 21165
f753cd62
MA
21166 * src/muscle_tab.c, src/muscle_tab.h: Add files.
21167
211682001-09-02 Marc Autret <autret_m@epita.fr>
21169
21170 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 21171
682d48cd
PB
211722001-09-01 Pascal Bart <pascal.bart@epita.fr>
21173
342b8b6e 21174 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
21175 filename.
21176
087c8fda
MA
211772001-09-01 Marc Autret <autret_m@epita.fr>
21178
21179 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
21180 to an explicit value to activate the feature. We do it here.
21181
dda680cb
PB
211822001-08-31 Pascal Bart <pascal.bart@epita.fr>
21183
21184 * src/output.c (prepare): Delete the `filename' muscule insertion.
21185 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
21186 (parse_union_decl): Likewise.
21187 * src/macrotab.c (macro_init): Initialize filename by infile.
21188
9e644e64
MA
211892001-08-31 Marc Autret <autret_m@epita.fr>
21190
21191 * src/bison.simple (YYLSP_NEEDED): New definition.
21192 * src/output.c (prepare): Add macro insertion of `locations_flag'
21193
17da6427
PB
211942001-08-31 Pascal Bart <pascal.bart@epita.fr>
21195
21196 * src/output.c (prepare): Delete insertion of previous muscles,
21197 and insert the `prefix' muscles.
21198 * src/macrotab.c (macro_init): Likewise.
21199 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 21200 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
21201 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
21202 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 21203 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
21204 name_prefix.
21205
e8cb70b9
PB
212062001-08-31 Pascal Bart <pascal.bart@epita.fr>
21207
21208 * src/main.c (main): Standardize.
21209 * src/output.c (output_table_data, output_parser): Likewise.
21210 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
21211
63c2d5de
MA
212122001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
21213
342b8b6e 21214 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
21215 %%epilogue.
21216 * src/output.c (output): Rename %%declarations to %%prologue.
21217 * src/bison.simple: Echo modifications.
342b8b6e 21218
d8cb5183
MA
212192001-08-31 Marc Autret <autret_m@epita.fr>
21220
21221 * src/reader.c (readgram): CleanUp.
21222 (output_token_defines): Likewise.
21223 (packsymbols): Likewise.
21224 (reader): Likewise.
21225 * src/output.c (output): CPP-out useless code.
21226
6c686258
PB
212272001-08-31 Pascal Bart <pascal.bart@epita.fr>
21228
342b8b6e 21229 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
21230 output_trailers and output_headers.
21231 * src/output.h: Remove obsolete functions prototypes of output_headers
21232 and output_trailers.
21233
8f451ef7
PB
212342001-08-30 Pascal Bart <pascal.bart@epita.fr>
21235
21236 * src/main.c: Include macrotab.h.
342b8b6e 21237 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
21238 Adjust functions prototypes.
21239 * src/macrotab.c (macro_insert): Constify key and value.
21240 (macro_find): Constify key.
21241 (macro_insert): Include 'xalloc.h'
21242 (macro_insert): Use XMALLOC.
21243 (macro_find): Constify return value.
21244 * src/output.c (output_table_data): Rename table to table_data.
21245 (output_parser): Constify macro_key, macro_value.
21246
997b6fd0 212472001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
21248
21249 * src/reader.c (parse_skel_decl): New.
342b8b6e 21250 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
21251 * src/lex.h (token_t): New token `tok_skel'.
21252 * src/lex.c (percent_table): Add skeleton option entry.
21253 Standardize.
21254
ff48177d
MA
212552001-08-29 Marc Autret <autret_m@epita.fr>
21256
21257 * src/bison.simple: Add %%user_code directive at the end.
21258 * src/reader.c (read_additionnal_code): New.
21259 (reader): Use it.
21260 * src/output.c (output_program): Remove.
21261 (output): Update.
21262
b33160bf
MA
212632001-08-28 Marc Autret <autret_m@epita.fr>
21264
21265 * src/output.c (output_actions): Clean up.
4e5caae2 21266 (output_gram): CPP-out useless code.
b33160bf
MA
21267 * src/reader.c (reader): Clean up, CPP-out useless code.
21268
d1a2daf7
PB
212692001-08-28 Pascal Bart <pascal.bart@epita.fr>
21270
342b8b6e 21271 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 21272 directive.
d1a2daf7
PB
21273 * src/bison.simple: Add `%%definitions'.
21274
2b763dfe
MA
212752001-08-28 Marc Autret <autret_m@epita.fr>
21276
21277 * config/depcomp: New file.
21278
f1a87ef6
PE
212792001-08-27 Paul Eggert <eggert@twinsun.com>
21280
21281 * src/bison.simple (yyparse): Don't take the address of an
21282 item before the start of an array, as that doesn't conform to
21283 the C Standard.
21284
82e236e2
RA
212852001-08-27 Robert Anisko <robert.anisko@epita.fr>
21286
f1a87ef6 21287 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
21288 obstack. It was done too late here.
21289
21290 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
21291 completely wrong.
21292 (reader): Initialize the macro obstack here, since we need it to grow
21293 '%define' directives.
21294
21295 * src/reader.h: Declare the macro obstack as extern.
21296
b0cfa28a
RA
212972001-08-27 Robert Anisko <robert.anisko@epita.fr>
21298
21299 * src/output.c (output_parser): Fix. Store single '%' characters in
21300 the output obstack instead of throwing them away.
21301
6fc74234
AD
213022001-08-27 Akim Demaille <akim@epita.fr>
21303
21304 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
21305
9c76d118
RA
213062001-08-25 Robert Anisko <robert.anisko@epita.fr>
21307
21308 * lib/Makefile.am: Adjust.
21309
a8289c62
RA
213102001-08-25 Robert Anisko <robert.anisko@epita.fr>
21311
21312 * src/bison.simple: Update and add '%%' directives.
21313
b6610515
RA
213142001-08-25 Robert Anisko <robert.anisko@epita.fr>
21315
21316 * src/reader.c (reader): Remove calls to 'output_headers' and
21317 'output_trailers'. Remove some C output.
21318 (readgram): Disable a piece of code that was writing a default
21319 definition for 'YYSTYPE'.
21320 (reader_output_yylsp): Remove.
21321 (packsymbols): Output token defintions to a macro.
21322 (copy_definition): Disable C output.
6fc74234 21323
b6610515
RA
21324 * src/reader.c (parse_macro_decl): New function used to parse macro
21325 declarations.
21326 (copy_string2): Put the body of copy_string into this new function.
21327 Add a parameter to let the caller choose whether he wants to copy the
21328 string delimiters or not.
21329 (copy_string): Be a simple call to copy_string2 with the last argument
21330 bound to true.
21331 (read_declarations): Add case for macro definition.
21332 (copy_identifier): New.
6fc74234 21333 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
21334 rather than lex.
21335
26f609ff
RA
213362001-08-25 Robert Anisko <robert.anisko@epita.fr>
21337
21338 * src/output.c (prepare): Add prefixed names.
21339 (output_parser): Output semantic actions.
21340 (output_parser): Fix bug on '%%line' directives.
6fc74234 21341
26f609ff
RA
21342 * src/output.c (output_headers): Remove. The C code printed by this
21343 function should now be in the skeletons.
21344 (output_trailers): Remove.
21345 (output): Disable call to 'reader_output_yylsp'.
21346 (output_rule_data): Do not output tables to the table obstack.
21347
21348 * src/output.c: Remove some C dedicated output.
21349 Improve the use of macro and output obstacks.
21350 (output_defines): Remove.
6fc74234 21351
26f609ff
RA
21352 * src/output.c (output_token_translations): Associate 'translate'
21353 table with a macro. No output to the table obstack.
21354 (output_gram): Same for 'rhs' and 'prhs'.
21355 (output_stos): Same for 'stos'.
21356 (output_rule_data): Same for 'r1' and 'r2'.
21357 (token_actions): Same for 'defact'.
21358 (goto_actions): Same for 'defgoto'.
21359 (output_base): Same for 'pact' and 'pgoto'.
21360 (output_table): Same for 'table'.
21361 (output_check): Same for 'check'.
6fc74234 21362
26f609ff
RA
21363 * src/output.c (output_table_data): New function.
21364 (output_short_table): Remove.
21365 (output_short_or_char_table): Remove.
6fc74234 21366
26f609ff
RA
21367 * src/output.c (output_parser): Replace most of the skeleton copy code
21368 with something new. Skeletons are now processed character by character
21369 rather than line by line, and Bison looks for '%%' macros. This is the
21370 first step in making Bison's output process (a lot) more flexible.
21371 (output_parser): Use the macro table.
21372
6f43b113
RA
213732001-08-25 Robert Anisko <robert.anisko@epita.fr>
21374
21375 * src/main.c (main): Initialize the macro table.
21376
dd3127cf
RA
213772001-08-25 Robert Anisko <robert.anisko@epita.fr>
21378
21379 * src/lex.c (percent_table): Add tok_define.
21380 * src/lex.h: Add tok_define.
21381
aa321494
RA
213822001-08-25 Robert Anisko <robert.anisko@epita.fr>
21383
21384 * src/macrotab.c: New file.
21385 * src/macrotab.h: New file.
21386 * src/Makefile.am: Update.
21387
68bd3b6b
RA
213882001-08-25 Robert Anisko <robert.anisko@epita.fr>
21389
21390 * lib/hash.c: New file.
21391 * lib/hash.h: New file.
21392 * lib/Makefile.am: Update.
21393
45f8dd1e
AD
213942001-08-15 Akim Demaille <akim@epita.fr>
21395
21396 Version 1.28c.
21397
40a64a7a 213982001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
21399
21400 * src/reader.c (readgram): Indent output macro YYSTYPE.
21401 (packsymbols): Likewise.
21402 (output_token_defines): Likewise.
21403 * src/files.c: Standardize.
21404 (compute_header_macro): New.
21405 (defines_obstack_save): New. Use compute_header_macro.
21406 (output_files): Update. Use defines_obstack_save.
21407
f9a8293a
AD
214082001-08-15 Akim Demaille <akim@epita.fr>
21409
21410 * doc/bison.texinfo (Table of Symbols): Document
21411 YYSTACK_USE_ALLOCA.
21412
150ca7a7
AD
214132001-08-15 Akim Demaille <akim@epita.fr>
21414
21415 * missing: Update from CVS Automake.
21416 * config/config.guess, config/config.sub, config/texinfo.tex:
21417 Update from gnu.org.
21418
69b5cec4
AD
214192001-08-15 Akim Demaille <akim@epita.fr>
21420
21421 * Makefile.maint: Sync with CVS Autoconf.
21422
f2b5126e
PB
214232001-08-14 Pascal Bart <pascal.bart@epita.fr>
21424
69b5cec4 21425 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
21426 `fdl.texi'.
21427 * doc/fdl.texi: Add to package.
21428
4ecbf796
MA
214292001-08-14 Marc Autret <autret_m@epita.fr>
21430
21431 Turn on %{source,header}_extension features.
21432
69b5cec4 21433 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
21434 source_extension.
21435 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 21436 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
21437 between options.
21438
95fb5662
MA
214392001-08-14 Marc Autret <autret_m@epita.fr>
21440
21441 * src/files.c (compute_base_names): Add extensions computing when
21442 `--file-prefix' used.
21443 Standardize function calls.
21444
78d09da9
MA
214452001-08-13 Marc Autret <autret_m@epita.fr>
21446
69b5cec4 21447 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
21448 defining it (defined but null disables alloca).
21449
5a009f2c
MA
214502001-08-13 Marc Autret <autret_m@epita.fr>
21451
21452 * src/bison.simple (_yy_memcpy): CPP reformat.
21453
1e41465a
PB
214542001-08-13 Pascal Bart <pascal.bart@epita.fr>
21455
21456 * tests/atconfig.in (CPPFLAGS): Fix.
21457
c67a198d
PB
214582001-08-10 Pascal Bart <pascal.bart@epita.fr>
21459
79282c6c 21460 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
21461 `gpl.texi'.
21462 * doc/gpl.texi: Add to package.
21463
09a6de7e
MA
214642001-08-10 Marc Autret <autret_m@epita.fr>
21465
21466 * src/print_graph.h: Fix.
21467 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
21468
b77b9ee0
AD
214692001-08-10 Akim Demaille <akim@epita.fr>
21470
21471 * src/system.h: Provide default declarations for stpcpy, strndup,
21472 and strnlen.
21473
3e259915
MA
214742001-08-10 Robert Anisko <anisko_r@epita.fr>
21475
21476 * doc/bison.texinfo (Locations): Update @$ stuff.
21477
ca96bc2d
MA
214782001-08-09 Robert Anisko <anisko_r@epita.fr>
21479
21480 * src/bison.simple (YYLLOC_DEFAULT): Update.
21481 (yyparse): Adjust.
21482
fdc6758b
MA
214832001-08-08 Marc Autret <autret_m@epita.fr>
21484
b77b9ee0 21485 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
21486 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
21487 Reported by Fabrice Bauzac.
957d4dbf 21488
600cad3b
MA
214892001-08-08 Marc Autret <autret_m@epita.fr>
21490
21491 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
21492 * src/vcg.c (output_node): Fix.
21493 * src/vcg.h: Cleanup.
21494 * src/print_graph.c: Add comments.
b77b9ee0 21495 (node_output_size): New global variable. Simplify the formatting of
600cad3b 21496 the VCG graph output.
b77b9ee0 21497 (print_actions): Unused code is now used. It notifies the final state
600cad3b 21498 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 21499 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
21500 blue.
21501 Get the current node name and node_obstack by argument.
21502 (node_obstack): New variable.
21503 (print_state): Manage node_obstack.
21504 (print_core): Use node_obstack given by argument.
21505 A node is not only computed here but in print_actions also.
21506 (print_graph): CPP out useless code instead of commenting it.
21507
976e528f
AD
215082001-08-07 Pascal Bart <pascal.bart@epita.fr>
21509
21510 * tests/atconfig.in (CPPFLAGS): Fix.
21511
20e8e5ca
AD
215122001-08-07 Akim Demaille <akim@epita.fr>
21513
21514 * src/print_graph.c (quote): New.
21515 (print_core): Use it.
21516
957d4dbf 215172001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 21518
3e3da797
AD
21519 * src/vcg.c (complain.h): Include it.
21520 Unepitaize `return' invocations.
c4b66126 21521 [NDEBUG] (main): Remove.
79282c6c 21522 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
21523 * src/files.c (open_files): Initialize graph_obstack.
21524 * src/print_graph.c (print_actions): CPP out useless code.
21525 (print_core): Don't output the last `\n' in labels.
21526 Use `quote'.
21527 * src/files.c (output_files): Output the VCG file.
21528 * src/main.c (main): Invoke print_graph ();
3e3da797 21529
957d4dbf 215302001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
21531
21532 Automaton VCG graph output.
21533 Using option ``-g'' or long option ``--graph'', you can generate
21534 a gram_filename.vcg file containing a VCG description of the LALR (1)
21535 automaton of your grammar.
21536
21537 * src/main.c: Call to print_graph() function.
21538 * src/getargs.h: Update.
21539 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
21540 (graph_flag): New flag.
21541 (longopts): Update.
21542 (getargs): Add case `g'.
21543 * src/files.c (graph_obstack): New obstack struct.
21544 (open_files): Initialize new obstack.
21545 (output_files): Saves graph_obstack if required.
21546 * src/files.h (graph_obstack): New extern declaration.
21547 * src/Makefile.am: Add new source files.
21548
927c1557 215492001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
21550
21551 * src/print_graph.c, src/print_graph.h (graph): New.
21552 * src/vcg.h: New file.
21553 * src/vcg.c: New file, VCG graph handling.
21554
7333d403
AD
215552001-08-06 Marc Autret <autret_m@epita.fr>
21556
21557 Add of %source_extension and %header_extension which specify
21558 the source or/and the header output file extension.
21559
21560 * src/files.c (compute_base_names): Remove initialisation of
21561 src_extension and header_extension.
21562 (compute_exts_from_gf): Update.
21563 (compute_exts_from_src): Update.
21564 (output_files): Update.
21565 * src/reader.c (parse_header_extension_decl): New.
21566 (parse_source_extension_decl): New.
21567 (read_declarations): New case statements for the new tokens.
21568 * src/lex.c (percent_table): Add entries for %source_extension
21569 and %header_extension.
21570 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
21571
84163231
AD
215722001-08-06 Marc Autret <autret_m@epita.fr>
21573
21574 * configure.in: Bump to 1.28c.
21575 * doc/bison.texinfo: Texinfo thingies.
21576
8303fc42
AD
215772001-08-04 Pascal Bart <pascal.bart@epita.fr>
21578
21579 * tests/atconfig.in (CPPFLAGS): Add.
21580 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
21581
70a84437
AD
215822001-08-03 Akim Demaille <akim@epita.fr>
21583
21584 Version 1.28b.
21585
2ce10144
AD
215862001-08-03 Akim Demaille <akim@epita.fr>
21587
21588 * tests/Makefile.am (check-local): Ship testsuite.
21589 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
21590 Include `string.h'.
21591
1e3e4bc1
AD
215922001-08-03 Akim Demaille <akim@epita.fr>
21593
21594 * configure.in: Try using -Wformat when compiling.
21595
42b45b7f
AD
215962001-08-03 Akim Demaille <akim@epita.fr>
21597
21598 * configure.in: Bump to 1.28b.
21599
8f13fe33
AD
216002001-08-03 Akim Demaille <akim@epita.fr>
21601
21602 * src/complain.c: Adjust strerror_r portability issues.
21603
b37ba92c
AD
216042001-08-03 Akim Demaille <akim@epita.fr>
21605
21606 Version 1.28a.
21607
b0ce6046
AD
216082001-08-03 Akim Demaille <akim@epita.fr>
21609
21610 * src/getargs.c, src/getarg.h (skeleton)): Constify.
21611 * src/lex.c (literalchar): Avoid name clashes on `buf'.
21612 * src/getargs.c: Include complain.h.
21613 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
21614 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
21615
d01c415b
AD
216162001-08-03 Akim Demaille <akim@epita.fr>
21617
21618 * src/reader.c (readgram): Display hidden chars in error messages.
21619
459dd1a6
AD
216202001-08-03 Akim Demaille <akim@epita.fr>
21621
21622 Update to gettext 0.10.39.
21623
53b74c0c
AD
216242001-08-03 Akim Demaille <akim@epita.fr>
21625
21626 * lib/strspn.c: New.
21627
234a3be3
AD
216282001-08-01 Marc Autret <autret_m@epita.fr>
21629
21630 * doc/bison.texinfo: Update.
21631 * doc/bison.1 (mandoc): Update.
21632 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
21633 * src/files.c: Support output files extensions computing.
21634 (src_extension): New static variable.
21635 (header_extension): New static variable.
21636 (tr): New function.
21637 (get_extension_index): New function, gets the index of an extension
21638 filename in a string.
21639 (compute_exts_from_gf): New function, computes extensions from the
21640 grammar file extension.
21641 (compute_exts_from_src): New functions, computes extensions from the
21642 C source file extension, file given by ``-o'' option.
21643 (compute_base_names): Update.
21644 (output_files): Update.
21645
847bf1f5
AD
216462001-08-01 Robert Anisko <anisko_r@epita.fr>
21647
d995fee7 21648 * doc/bison.texi: Document @$.
847bf1f5
AD
21649 (Locations): New section.
21650
d074a105
AD
216512001-07-18 Akim Demaille <akim@epita.fr>
21652
21653 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
21654 * config/prev-version.txt, config/move-if-change: New.
21655 * Makefile.am: Adjust.
21656
3419715d
AD
216572001-07-08 Pascal Bart <pascal.bart@epita.fr>
21658
21659 * src/bison.simple (yyparse): Suppress warning `comparaison
21660 between signed and unsigned'.
21661
62ab6972
AD
216622001-07-05 Pascal Bart <pascal.bart@epita.fr>
21663
21664 * src/getargs.h (raw_flag): Remove.
21665 * src/getargs.c: Die on `-r'/`--raw'.
21666 * src/lex.c (parse_percent_token): Die on `%raw'.
21667 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
21668 * tests/calc.at: Suppress test with option `--raw'.
21669
1e24cc5b
AD
216702001-07-14 Akim Demaille <akim@epita.fr>
21671
21672 * config/: New.
21673 * configure.in: Require Autoconf 2.50.
21674 Update to gettext 0.10.38.
21675
32dfccf8
AD
216762001-03-16 Akim Demaille <akim@epita.fr>
21677
21678 * doc/bison.texinfo: ANSIfy the examples.
21679
cd5bd6ac
AD
216802001-03-16 Akim Demaille <akim@epita.fr>
21681
21682 * getargs.c (skeleton): New variable.
21683 (longopts): --skeleton is a new option.
21684 (shortopts, getargs): -S is a new option.
21685 * getargs.h: Declare skeleton.
21686 * output.c (output_parser): Use it.
21687
5141b016
AD
216882001-03-16 Akim Demaille <akim@epita.fr>
21689
21690 * m4/strerror_r.m4: New.
21691 * m4/error.m4: Run AC_FUNC_STRERROR_R.
21692 * lib/error.h, lib/error.c: Update.
21693
447992b9
AD
216942001-03-16 Akim Demaille <akim@epita.fr>
21695
21696 * src/getargs.c (longopts): Clean up.
21697
274d42ce
AD
216982001-02-21 Akim Demaille <akim@epita.fr>
21699
21700 * src/reader.c (gensym): `gensym_count' is your own.
21701 Use a static buf to create the symbol name, as token_buffer is no
21702 longer a buffer.
21703
22c821f3
AD
217042001-02-08 Akim Demaille <akim@epita.fr>
21705
21706 * src/conflicts.c (conflict_report): Be sure not to append to res
21707 between two calls, which could happen if both first sprintf were
21708 skipped, but not the first cp += strlen.
21709
18569462
AD
217102001-02-08 Akim Demaille <akim@epita.fr>
21711
21712 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
21713 New, from fileutils 4.0.37.
21714 * configure.in: Require Autoconf 2.49c. I took some time before
21715 making this decision. This is the only way out for portability
21716 issues in Bison, it would mean way too much duplicate effort to
21717 import in Bison features implemented in 2.49c since 2.13.
21718 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
21719
0d8f3c8a
AD
217202001-02-02 Akim Demaille <akim@epita.fr>
21721
21722 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 21723 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 21724
f17bcd1f
AD
217252001-01-19 Akim Demaille <akim@epita.fr>
21726
21727 Get rid of the ad hoc handling of token_buffer in the scanner: use
21728 the obstacks.
21729
21730 * src/lex.c (token_obstack): New.
21731 (init_lex): Initialize it. No longer call...
21732 (grow_token_buffer): this. Remove it.
21733 Adjust all the places which used it to use the obstack.
21734
511e79b3
AD
217352001-01-19 Akim Demaille <akim@epita.fr>
21736
21737 * src/lex.h: Rename all the tokens:
21738 s/\bENDFILE\b/tok_eof/g;
21739 s/\bIDENTIFIER\b/tok_identifier/g;
21740 etc.
21741 Let them be enums, not #define, to ease debugging.
21742 Adjust all the code.
21743
0d6508ef
AD
217442001-01-18 Akim Demaille <akim@epita.fr>
21745
21746 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
21747 * src/lex.c (maxtoken, grow_token_buffer): Static.
21748
6deb4447
AD
217492001-01-18 Akim Demaille <akim@epita.fr>
21750
21751 Since we now use obstacks, more % directives can be enabled.
21752
21753 * src/lex.c (percent_table): Also accept `%yacc',
21754 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
21755 `%debug'.
21756 Handle the actions for `%semantic_parser' and `%pure_parser' here,
21757 instead of returning a token.
21758 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
21759 * src/reader.c (read_declarations): Adjust.
21760 * src/files.c (open_files): Don't call `compute_base_names', don't
21761 compute `attrsfile' since they depend upon data which might be
21762 *in* the input file now.
21763 (output_files): Do it here.
21764 * src/output.c (output_headers): Document the fact that this patch
21765 introduces a guaranteed SEGV for semantic parsers.
21766 * doc/bison.texinfo: Document them.
21767 * tests/suite.at: Exercise these %options.
21768
ff4423cc
AD
217692000-12-20 Akim Demaille <akim@epita.fr>
21770
21771 Also handle the output file (--verbose) with obstacks.
21772
21773 * files.c (foutput): Remove.
21774 (output_obstack): New.
21775 Adjust all dependencies.
21776 * src/conflicts.c: Return a string.
21777 * src/system.h (obstack_grow_string): Rename as...
21778 (obstack_sgrow): this. Be ready to work with non literals.
21779 (obstack_fgrow4): New.
21780
956dba3a
AD
217812000-12-20 Akim Demaille <akim@epita.fr>
21782
21783 * src/files.c (open_files): Fix the computation of short_base_name
21784 in the case of `-o foo.tab.c'.
21785
337bab46
AD
217862000-12-20 Akim Demaille <akim@epita.fr>
21787
21788 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
21789 (copy_dollar): Now that everything uses obstacks, get rid of the
21790 FILE * parameters.
21791
5d3214b8
AD
217922000-12-20 Akim Demaille <akim@epita.fr>
21793
21794 * src/files.c (open_files): Actually the `.output' file is based
21795 on the short_base_name, not base_name.
21796 * tests/suite.at (Checking output file names): Adjust.
21797
29092a57
AD
217982000-12-20 Akim Demaille <akim@epita.fr>
21799
21800 * src/bison.s1: Remove, we now use directly...
21801 * src/bison.simple: this.
21802 * src/Makefile.am: Use pkgdata instead of data.
21803
ea5607fd
AD
218042000-12-20 Akim Demaille <akim@epita.fr>
21805
21806 * src/files.c (guard_obstack): New.
21807 (open_files): Initialize it.
21808 (output_files): Dump it...
21809 * src/files.h: Export it.
21810 * src/reader.c (copy_guard): Use it.
21811
27110317
AD
218122000-12-19 Akim Demaille <akim@epita.fr>
21813
21814 * src/files.c (outfile, defsfile, actfile): Removed as global
21815 vars.
21816 (open_files): Don't compute them.
21817 (output_files): Adjust.
21818 (base_name, short_base_name): Be global.
21819 Adjust dependencies.
21820
19c50364
AD
218212000-12-19 Akim Demaille <akim@epita.fr>
21822
21823 * src/files.c (strsuffix): New.
21824 (stringappend): Be just like strcat but allocate.
21825 (base_names): Eve out from open_files.
21826 Try to simplify the rather hairy computation of base_name and
21827 short_base_name.
21828 (open_files): Use it.
21829 * tests/suite.at (Checking output file names): New test.
21830
573c1d9f
AD
218312000-12-19 Akim Demaille <akim@epita.fr>
21832
21833 * src/system.h (obstack_grow_literal_string): Rename as...
21834 (obstack_grow_string): this.
21835 * src/output.c (output_parser): Recognize `%% actions' instead of
21836 `$'.
21837 * src/bison.s1: s/$/%% actions/.
21838 * src/bison.hairy: Likewise.
21839
ef7ddedd
AD
218402000-12-19 Akim Demaille <akim@epita.fr>
21841
21842 * src/output.c (output_parser): Compute the `#line' lines when
21843 there are.
21844 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
21845 Suggested by Hans Aberg.
21846
ff61dabd
AD
218472000-12-19 Akim Demaille <akim@epita.fr>
21848
21849 Let the handling of the skeleton files be local to the procedures
21850 that use it.
21851
21852 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
21853 longer static.
21854 (fparser, open_extra_files): Remove.
21855 (open_files, output_files): Don't take care of fparser.
21856 * src/files.h: Adjust.
21857 * src/output.c (output_parser): Open and close the file to the
21858 skeleton.
21859 * src/reader.c (read_declarations): When %semantic_parser, open
21860 fguard.
21861
55b96341
AD
218622000-12-19 Akim Demaille <akim@epita.fr>
21863
21864 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
21865 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
21866
358c15b7
AD
218672000-12-19 Akim Demaille <akim@epita.fr>
21868
21869 * src/files.c (open_files): Yipee! We no longer need all the code
21870 looking for `/tmp' since we have no tmp file.
21871
7de3329e
AD
218722000-12-19 Akim Demaille <akim@epita.fr>
21873
21874 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
21875 New macros.
21876 * src/files.c (open_files): Less dependency on MSDOS etc.
21877
3abcd459
AD
218782000-12-14 Akim Demaille <akim@epita.fr>
21879
21880 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
21881 Provide a default definition.
21882 Use it when executing the default @ action.
21883 * src/reader.c (reader_output_yylsp): No longer include
21884 `timestamp' and `text' in the default YYLTYPE.
21885
2a91a95e
AD
218862000-12-12 Akim Demaille <akim@epita.fr>
21887
21888 * src/reader.c (copy_definition, parse_union_decl, copy_action)
21889 (copy_guard): Quote the file names.
21890 Reported by Laurent Mascherpa.
21891
14d3eb9b
AD
218922000-12-12 Akim Demaille <akim@epita.fr>
21893
21894 * src/output.c (output_headers, output_program, output): Be sure
21895 to escape special characters when outputting filenames.
21896 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
21897 (output_headers): Don't depend on them, Use ACTSTR.
21898
d7045ec6
AD
218992000-11-17 Akim Demaille <akim@epita.fr>
21900
21901 * lib/obstack.h: Formatting changes.
21902 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
21903 prevents type checking.
21904 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
21905 cast the value to (void *): assigning a `foo *' to a `void *'
21906 variable is valid.
21907 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
21908 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
21909 append characters.
21910
6fd54b73
AD
219112000-11-17 Akim Demaille <akim@epita.fr>
21912
21913 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
21914 as...
21915 (suite.m4, regression.m4, calc.m4): these.
21916 * tests/atgeneral.m4: Update from CVS Autoconf.
21917
4c50eae6
AD
219182000-11-17 Akim Demaille <akim@epita.fr>
21919
21920 * tests/regression.m4 (%union and --defines): New test,
21921 demonstrating a current bug in the obstack implementation.
21922
a35f64ea
AD
219232000-11-17 Akim Demaille <akim@epita.fr>
21924
21925 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
21926 macros.
21927 Use them to declare the variables which are global or local to
21928 `yyparse'.
21929
7de23534
AD
219302000-11-17 Akim Demaille <akim@epita.fr>
21931
21932 * acconfig.h: Remove, no longer used.
21933
aa7815f5
AD
219342000-11-07 Akim Demaille <akim@epita.fr>
21935
21936 * src: s/Copyright (C)/Copyright/g.
21937
5af1f549
AD
219382000-11-07 Akim Demaille <akim@epita.fr>
21939
21940 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
21941 defining.
21942 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
21943
553e2b22
AD
219442000-11-07 Akim Demaille <akim@epita.fr>
21945
21946 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
21947 Merge in a single CPP if/else.
21948
8a4f41d6
AD
219492000-11-07 Akim Demaille <akim@epita.fr>
21950
21951 * src/output.c (output): Remove useless variables.
21952 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
21953 argument `data' for consistency with the prototypes.
21954 Qualify it `const'.
21955 (obstack_copy, obstack_copy0): Rename the second argument as
21956 `address' for consistency. Qualify it `const'.
21957 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
21958 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
21959 `const' their input argument (`data' or `address').
21960 Adjust the corresponding macros to include `const' in casts.
21961
095a3fb5
AD
219622000-11-03 Akim Demaille <akim@epita.fr>
21963
21964 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
21965 s/PFILE1/BISON_HAIRY/.
21966 Adjust dependencies.
21967
d1cdce7c
AD
219682000-11-03 Akim Demaille <akim@epita.fr>
21969
090c5ebf 21970 For some reason, this was not applied.
d1cdce7c
AD
21971
21972 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
21973 `unlink': it's no longer used.
21974
9311529b
AD
219752000-11-03 Akim Demaille <akim@epita.fr>
21976
21977 * src/files.c (skeleton_find): New function, eved out of...
21978 (open_files, open_extra_files): here.
21979
d8880f69
AD
219802000-11-03 Akim Demaille <akim@epita.fr>
21981
21982 Don't use `atexit'.
21983
21984 * src/files.c (obstack_save): New function.
21985 (done): Rename as...
21986 (output_files): this.
21987 Use `obstack_save'.
21988 * src/main.c (main): Don't use `atexit' to register `done', since
21989 it no longer has to remove tmp files, just call `output_files'
21990 when there are no errors.
21991
0dbb648e
AD
219922000-11-02 Akim Demaille <akim@epita.fr>
21993
21994 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
21995 `unlink': it's no longer used.
21996 * src/files.h: Formatting changes.
21997
896fe5c1
AD
219982000-11-02 Akim Demaille <akim@epita.fr>
21999
22000 Remove the last uses of mktemp and unlink/delete.
22001
22002 * src/files.c (fdefines, ftable): Removed.
22003 (defines_ostack, table_obstack): New.
22004 Adjust dependencies of the former into uses of the latter.
22005 * src/output.c (output_short_or_char_table, output_short_table):
22006 Convert to using obstacks.
22007 * src/reader.c (copy_comment2): Accept one FILE * and two
22008 obstacks.
22009 (output_token_defines, reader_output_yylsp): Use obstacks.
22010 * src/system.h (obstack_fgrow3): New.
1f65350a 22011 * po/POTFILES.in: Adjust.
896fe5c1 22012
dd60faec
AD
220132000-11-01 Akim Demaille <akim@epita.fr>
22014
22015 Change each use of `fattrs' into a use of `attrs_obstack'.
22016
22017 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
22018 * src/files.c (fattrs): Remove.
22019 (attrs_obstack): New.
22020 Adjust all dependencies.
22021 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
22022
8c7ebe49
AD
220232000-11-01 Akim Demaille <akim@epita.fr>
22024
22025 Introduce obstacks.
22026 Change each use of `faction' into a use of `action_obstack'.
22027
22028 * lib/obstack.h, lib/obstack.c: New files.
22029 * src/files.c (faction): Remove.
22030 (action_obstack): New.
22031 Adjust all dependencies.
22032
77aee789
AD
220332000-10-20 Akim Demaille <akim@epita.fr>
22034
22035 * lib/quote.h (PARAMS): New macro. Use it.
22036
43591cec
AD
220372000-10-16 Akim Demaille <akim@epita.fr>
22038
22039 * src/output.c (output_short_or_char_table): New function.
22040 (output_short_table, output_token_translations): Use it.
22041 (goto_actions): Use output_short_table.
22042
1e9798d5
AD
220432000-10-16 Akim Demaille <akim@epita.fr>
22044
22045 * src/symtab.c (bucket_new): New function.
22046 (getsym): Use it.
22047
22048 * src/output.c (output_short_table): New argument to display the
22049 comment associated with the table.
22050 Adjust dependencies.
22051 (output_gram): Use it.
22052 (output_rule_data): Nicer output layout for YYTNAME.
22053
f282676b
AD
220542000-10-16 Akim Demaille <akim@epita.fr>
22055
22056 * src/lex.c (read_typename): New function.
22057 (lex): Use it.
22058 * src/reader.c (copy_dollar): Likewise.
22059
550a72a3
AD
220602000-10-16 Akim Demaille <akim@epita.fr>
22061
22062 * src/reader.c (copy_comment2): Expect the input stream to be on
22063 the `/' which is suspected to open a comment, instead of being
22064 called after `//' or `/*' was read.
22065 (copy_comment, copy_definition, parse_union_decl, copy_action)
22066 (copy_guard): Adjust.
22067
131e2fef
AD
220682000-10-16 Akim Demaille <akim@epita.fr>
22069
22070 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
22071 `read_signed_integer'.
22072
79282c5a
AD
220732000-10-16 Akim Demaille <akim@epita.fr>
22074
22075 * src/reader.c (copy_dollar): New function.
22076 (copy_guard, copy_action): Use it.
22077
ff4a34be
AD
220782000-10-16 Akim Demaille <akim@epita.fr>
22079
22080 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
22081 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
22082 New files, from Fileutils 4.0.27.
22083 * src/main.c (printable_version): Remove.
22084 * src/lex.c, src/reader.c: Use `quote'.
22085
220862000-10-04 Akim Demaille <akim@epita.fr>
22087
22088 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
22089
14ded682
AD
220902000-10-04 Akim Demaille <akim@epita.fr>
22091
22092 * doc/bison.texinfo: Various typos spotted by Neil Booth.
22093
8e03724b
AD
220942000-10-04 Akim Demaille <akim@epita.fr>
22095
22096 When a literal string is used to define two different tokens,
22097 `bison -v' segfaults.
22098 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
22099
22100 * tests/regression.m4: New file.
22101 Include the core of the sample provided by Piotr Gackiewicz.
22102 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
22103 properly.
22104
a9e64249
AD
221052000-10-04 Akim Demaille <akim@epita.fr>
22106
22107 * src/reader.c (parse_expect_decl): Keep `count' within the size
22108 of `buffer'.
22109 From Neil Booth.
22110
da9abf43
AD
221112000-10-02 Paul Eggert <eggert@twinsun.com>
22112
22113 * bison.s1 (yyparse): Assign the default value
22114 unconditionally, to avoid a GCC warning and make the parser a
22115 tad smaller.
22116
c33638bb
AD
221172000-10-02 Akim Demaille <akim@epita.fr>
22118
22119 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
22120 options.
22121
444c570a
AD
221222000-10-02 Akim Demaille <akim@epita.fr>
22123
22124 * src/derives.c, src/print.c, src/reduce.c: To ease the
22125 translation, move some `\n' out of the translated strings.
22126
89cab50d
AD
221272000-10-02 Akim Demaille <akim@epita.fr>
22128
22129 The location tracking mechanism is precious for parse error
22130 messages. Nevertheless, it is enabled only when `@n' is used in
22131 the grammar, which is a different issue (you can use it in error
22132 message, but not in the grammar per se). Therefore, there should
22133 be another means to enable it.
22134
22135 * src/getargs.c (getargs): Support `--locations'.
22136 (usage): Report it.
22137 * src/getargs.h (locationsflag): Export it.
22138 * src/lex.c (percent_table): Support `%locations'.
22139 * src/reader.c (yylsp_needed): Remove this variable, now replaced
22140 with `locationsflag'.
22141 * doc/bison.texinfo: Document `--locations' and `%locations'.
22142 Sort the options.
22143 * tests/calc.m4: Test it.
22144
22145 For regularity of the names, replace each
22146 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
22147 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
22148 In addition replace each `flag' with `_flag'.
22149
d6c2cba0
AD
221502000-10-02 Akim Demaille <akim@epita.fr>
22151
22152 Also test parse error messages, including with YYERROR_VERBOSE.
22153
22154 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
22155 associative).
22156 Use it to check the computations.
22157 Use it to check `nonassoc' is honored.
22158 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
22159 `--yyerror-verbose'.
22160 (_AT_CHECK_CALC): Adjust to this option.
22161 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
22162
5a35a6cb
AD
221632000-10-02 Akim Demaille <akim@epita.fr>
22164
22165 Test also `--verbose', `--defines' and `--name-prefix'. Testing
22166 the latter demonstrates a flaw in the handling of non debugging
22167 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
22168 was used in order to simplify:
22169
22170 #if YYDEBUG
22171 if (yydebug)
22172 {
22173 ...
22174 }
22175 #endif
22176
22177 into
22178
22179 if (yydebug)
22180 {
22181 ...
22182 }
22183
22184 unfortunately this leads to a CPP conflict when
22185 `--name-prefix=foo' is used since it produces `#define yydebug
22186 foodebug'.
22187
22188 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
22189 (YYDPRINTF): New macro.
22190 Spread its use.
22191 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
22192 the bison options.
22193 Also test `--verbose', `--defines' and `--name-prefix'.
22194
71da9eea
AD
221952000-10-02 Akim Demaille <akim@epita.fr>
22196
22197 Improve the readability of the produced parsers.
22198
22199 * src/bison.s1: Formatting changes.
22200 Improve the comment related to the `$' mark.
22201 (yydefault): Don't fall through to `yyresume': `goto' there.
22202 * src/output.c (output_parser): When the `$' is met, skip the end
22203 of its line.
22204 New variable, `number_of_dollar_signs', to check there's exactly
22205 one `$' in the parser skeleton.
22206
95e36146
AD
222072000-10-02 Akim Demaille <akim@epita.fr>
22208
22209 * lib/xstrdup.c: New file, from the fileutils.
22210 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
22211 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
22212 instead of strlen + xmalloc + strcpy.
22213 * src/symtab.c (copys): Remove, use xstrdup instead.
22214
d7020c20
AD
222152000-10-02 Akim Demaille <akim@epita.fr>
22216
22217 * src/gram.h (associativity): New enum type which replaces the
22218 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
22219 `right_assoc', `left_assoc' and `non_assoc'.
22220 Adjust all dependencies.
22221 * src/reader.c: Formatting changes.
22222 (LTYPESTR): Don't define it, use it as a literal in
22223 `reader_output_yylsp'.
22224 * src/symtab.h (symbol_class): New enum type which replaces the
22225 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
22226 `sunknown', `stoken and `snterm'.
22227
1916f98e
AD
222282000-10-02 Akim Demaille <akim@epita.fr>
22229
22230 * src/getargs.c (fixed_outfiles): Rename as...
22231 (yaccflag): for consistency and accuracy.
22232 Adjust dependencies.
22233
d7913476
AD
222342000-10-02 Akim Demaille <akim@epita.fr>
22235
22236 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
22237 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
22238 difficult and introduced a lot of core dump. It turns out that
22239 Bison used an implementation of `xmalloc' based on `calloc', and
22240 at various places it does depend upon the initialization to 0. I
22241 have not tried to isolate the pertinent places, and all the former
22242 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
22243 someone should address this issue.
22244
22245 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
22246 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
22247 files.
22248 Adjust dependencies.
22249 * src/warshall.h: New file.
22250 Propagate.
22251
340ef489
AD
222522000-10-02 Akim Demaille <akim@epita.fr>
22253
22254 Various anti-`extern in *.c' changes.
22255
22256 * src/system.h: Include `assert.h'.
22257
b2ca4022
AD
222582000-10-02 Akim Demaille <akim@epita.fr>
22259
22260 * src/state.h (nstates, final_state, first_state, first_shift)
22261 (first_reduction): Move their exportation from here...
22262 * src/LR0.h: to here.
22263 Adjust dependencies.
22264 * src/getargs.c (statisticsflag): New variable.
22265 Add support for `--statistics'.
22266 Adjust dependencies.
22267
22268 Remove a lot of now useless `extern' statements in most files.
22269
403b315b
AD
222702000-10-02 Akim Demaille <akim@epita.fr>
22271
22272 * src/LR0.h: New file.
22273 Propagate its use.
22274
07a58c13
AD
222752000-10-02 Akim Demaille <akim@epita.fr>
22276
22277 * src/print.h: New file.
22278 Propagate its use.
22279 * src/print.c: Formatting and ordering changes.
22280 (verbose, terse): Replace with...
22281 (print_results): this new function.
22282 Adjust dependencies.
22283
0619caf0
AD
222842000-10-02 Akim Demaille <akim@epita.fr>
22285
22286 * src/conflicts.c (conflict_report): New function.
22287 (conflict_log, verbose_conflict_log): Replace with...
22288 (print_conflicts): this function.
22289 Adjust dependencies.
22290 * src/conflicts.h: New file.
22291 Propagate its inclusion.
22292
3519ec76
AD
222932000-10-02 Akim Demaille <akim@epita.fr>
22294
22295 * src/nullable.h: New file.
22296 Propagate its inclusion.
22297 * src/nullable.c: Formatting changes.
22298
015acc48
AD
222992000-10-02 Akim Demaille <akim@epita.fr>
22300
22301 * src/reduce.h: New file.
22302 Propagate its inclusion.
22303 * src/reduce.c: Topological sort and other formatting changes.
22304 (bool, TRUE, FALSE): Move their definition to...
22305 * src/system.h: here.
22306
8963a27b
AD
223072000-10-02 Akim Demaille <akim@epita.fr>
22308
22309 * src/files.c: Formatting changes.
22310 (tryopen, tryclose, openfiles): Rename as...
22311 (xfopen, xfclose, open_files): this.
22312 (stringappend): static.
22313 * src/files.h: Complete the list of exported symbols.
22314 Propagate its use.
22315
a70083a3
AD
223162000-10-02 Akim Demaille <akim@epita.fr>
22317
22318 * src/reader.h: New file.
22319 Propagate its use instead of tedious list of `extern' and
22320 prototypes.
22321 * src/reader.c: Formatting changes, topological sort,
22322 s/register//.
22323
abadc117
AD
223242000-10-02 Akim Demaille <akim@epita.fr>
22325
22326 * src/lex.h: Prototype `lex.c' exported functions.
22327 * src/reader.c: Adjust.
22328 * src/lex.c: Formatting changes.
22329 (safegetc): Rename as...
22330 (xgetc): this.
22331
720d742f
AD
223322000-10-02 Akim Demaille <akim@epita.fr>
22333
22334 * src/lalr.h: New file.
22335 Propagate its inclusion instead of prototypes and `extern'.
22336 * src/lalr.c: Formatting changes, topological sorting etc.
22337
f2acea59
AD
223382000-10-02 Akim Demaille <akim@epita.fr>
22339
22340 * src/output.c (token_actions): Introduce a temporary array,
22341 YYDEFACT, that makes it possible for this function to use
22342 output_short_table.
22343
d019d655
AD
223442000-10-02 Akim Demaille <akim@epita.fr>
22345
22346 `user_toknums' is output as a `short[]' in `output.c', while it is
22347 defined as a `int[]' in `reader.c'. For consistency with the
22348 other output tables, `user_toknums' is now defined as a table of
22349 shorts.
22350
22351 * src/reader.c (user_toknums): Be a short table instead of an int
22352 table.
22353 Adjust dependencies.
22354
22355 Factor the short table outputs.
22356
22357 * src/output.c (output_short_table): New function.
22358 * src/output.c (output_gram, output_stos, output_rule_data)
22359 (output_base, output_table, output_check): Use it.
22360
6c89f1c1
AD
223612000-10-02 Akim Demaille <akim@epita.fr>
22362
22363 * src/output.c (output): Topological sort of the functions, in
22364 order to get rid of the `static' prototypes.
22365 No longer use `register'.
22366 * src/output.h: New file.
22367 Propagate its inclusion in files explicitly prototyping functions
22368 from output.c.
22369
d9efd181
AD
223702000-09-21 Akim Demaille <akim@epita.fr>
22371
22372 * src/atgeneral.m4: Update from Autoconf.
22373
c29240e7 223742000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
22375
22376 * src/closure.h: New file.
22377 * src/closure.c: Formatting changes, topological sort over the
22378 functions, use of closure.h.
22379 (initialize_closure, finalize_closure): Rename as...
22380 (new_closure, free_closure): these. Adjust dependencies.
22381 * src/LR0.c: Formatting changes, topological sort, use of
22382 cloture.h.
22383 (initialize_states): Rename as...
22384 (new_states): this.
22385 * src/Makefile.am (noinst_HEADERS): Adjust.
22386
499daa50
AD
223872000-09-20 Akim Demaille <akim@epita.fr>
22388
22389 * src/acconfig.h: Don't protect config.h against multiple
22390 inclusion.
22391 Don't define PARAMS.
22392 * src/system.h: Define PARAMS.
22393 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
22394 purpose of config.h. system.h must not try to fix wrong
22395 definitions in config.h.
22396
cc84fd5d
AD
223972000-09-20 Akim Demaille <akim@epita.fr>
22398
22399 * src/derives.h: New file.
22400 * src/main.c, src/derives.h: Use it.
22401 Formatting changes.
22402 * src/Makefile.am (noinst_HEADERS): Adjust.
22403
db5b3a89
AD
224042000-09-20 Akim Demaille <akim@epita.fr>
22405
22406 * tests/atgeneral.m4: Update from Autoconf.
22407 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
22408 (AT_CHECK_CALC): New macros.
22409 Use these macros to test bison with options `', `--raw',
22410 `--debug', `--yacc', `--yacc --debug'.
22411
ceed8467
AD
224122000-09-19 Akim Demaille <akim@epita.fr>
22413
22414 * src/output.c: Formatting changes.
22415 * src/machine.h: Remove, leaving its contents in...
22416 * src/system.h: here.
22417 Include stdio.h.
22418 Adjust all dependencies on stdio.h and machine.h.
22419 * src/getargs.h: New file.
22420 Let all `extern' declarations about getargs.c be replaced with
22421 inclusion of `getargs.h'.
22422 * src/Makefile.am (noinst_HEADERS): Adjust.
22423
22424 * tests/calc.m4 (yyin): Be initialized in main, not on the global
22425 scope.
22426 (yyerror): Returns void, not int.
22427 * doc/bison.texinfo: Formatting changes.
22428
05a1d24b
AD
224292000-09-19 Akim Demaille <akim@epita.fr>
22430
22431 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
22432 portable.
22433
cbd25751
AD
224342000-09-18 Akim Demaille <akim@epita.fr>
22435
22436 * configure.in: Append WARNING_CFLAGS to CFLAGS.
22437 * src/Makefile.am (INCLUDES): Don't.
22438 Be ready to fetch headers in lib/.
22439
13863333
AD
224402000-09-18 Akim Demaille <akim@epita.fr>
22441
22442 * doc/bison.texinfo: Update the copyright.
22443 ANSIfy and GNUify the examples.
22444 Remove the old menu.
22445
0d533154
AD
224462000-09-18 Akim Demaille <akim@epita.fr>
22447
22448 First set of tests: use the `calc' example from the documentation.
22449
22450 * src/bison.s1 (yyparse): Condition the code using `yytname' which
22451 is defined only when YYDEBUG is.
22452 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
22453 * src/files.c (tryopen, tryclose): Formatting changes.
22454 Move to the top and be static.
22455 * src/reader.c (read_signed_integer): Likewise.
22456 * tests/calc.m4: New file.
22457 * Makefile.am, suite.m4: Adjust.
22458 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
22459
e79137ac
AD
224602000-09-18 Akim Demaille <akim@epita.fr>
22461
22462 Add support for an Autotest test suite for Bison.
22463
22464 * m4/m4.m4, m4/atconfig.m4: New files.
22465 * m4/Makefile.am (EXTRA_DIST): Adjust.
22466 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
22467 files.
22468 * src/getargs.c: Display a more standard --version message.
22469 * src/reader.c (reader): Formatting changes.
22470 No longer depend upon VERSION_STRING.
22471 * configure.in: No longer use `dnl'.
22472 Set up the test suite and the new directory `tests/.
22473 (VERSION_STRING): Remove.
22474
27821bff
AD
224752000-04-14 Akim Demaille <akim@epita.fr>
22476
22477 * src/reader.c (copy_comment2): New function, same as former
22478 `copy_comment', but outputs into two FILE *.
22479 (copy_comment): Use it.
22480 (parse_union_decl): Use it.
22481 (get_type, parse_start_decl): Use the same `invalid' message.
22482 (parse_start_decl, parse_union_decl): Use the same `multiple'
22483 message.
22484 (parse_union_decl, copy_guard, copy_action): Use the same
22485 `unmatched' message.
22486 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
22487
cfe5fbc0
AD
224882000-03-31 Akim Demaille <akim@epita.fr>
22489
22490 * src/files.c (tryopen, tryclose): Move to the top.
22491 Be static.
22492
cb7db13e
AD
224932000-03-31 Akim Demaille <akim@epita.fr>
22494
22495 * src/main.c (main): Don't call `done', exit does it.
22496
a0f6b076
AD
224972000-03-31 Akim Demaille <akim@epita.fr>
22498
36281465
AD
22499 * allocate.c: s/return (foo)/return foo/.
22500 * lalr.c: Likewise.
22501 * LR0.c: Likewise.
22502 * output.c: Likewise.
22503 * reader.c: Likewise.
22504 * symtab.c: Likewise.
22505 * vmsgetargs.c: Likewise.
22506
225072000-03-31 Akim Demaille <akim@epita.fr>
22508
22509 Clean up the error reporting functions.
a0f6b076
AD
22510
22511 * src/report.c: New file.
22512 * src/report.h: Likewise.
22513 * src/Makefile.am: Adjust.
22514 * m4/error.m4: New file.
22515 * m4/Makefile.am: Adjust.
22516 * configure.in (jm_PREREQ_ERROR): Call it.
22517 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
22518 Remove.
22519 (fatal, fatals): Remove. All callers use complain.c::fatal.
22520 (warn, warni, warns, warnss, warnss): Remove. All callers use
22521 complain.c::complain.
22522 (toomany): Remove, use fatal instead.
22523 * src/files.c (done): No argument, use complain_message_count.
22524 * src/main.c (main): Register `done' to `atexit'.
22525
22526 * src/getargs.c (usage): More `fputs', less `fprintf'.
22527
18539825
AD
225282000-03-28 Akim Demaille <akim@epita.fr>
22529
22530 * lib/: New directory.
22531 * Makefile.am (SUBDIRS): Adjust.
22532 * configure.in: Adjust.
22533 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
22534 useless.
22535 * src/alloca.c: Moved to lib/.
22536 * src/getopt.c: Likewise.
22537 * src/getopt1.c: Likewise.
22538 * src/getopt.h: Likewise.
22539 * src/ansi2knr.c: Likewise.
22540 * src/ansi2knr.1: Likewise.
22541 * src/Makefile.am: Adjust.
22542 * lib/Makefile.am: New file.
22543
9f306f2a
AD
225442000-03-28 Akim Demaille <akim@epita.fr>
22545
22546 * src/getargs.c (usage): Refresh the help message.
22547
0ba347b6
AD
225482000-03-17 Akim Demaille <akim@epita.fr>
22549
22550 * src/getopt1.c: Updated from textutils 2.0e
22551 * src/getopt.c: Likewise.
22552 * src/getopt.h: Likewise.
22553
dbe7f271
AD
225542000-03-17 Akim Demaille <akim@epita.fr>
22555
22556 * src/Makefile.am (bison.simple): Fix the awk program: quote only
22557 the file name, not the whole `#line LINE FILE'.
22558
75bbe78d
AD
225592000-03-17 Akim Demaille <akim@epita.fr>
22560
22561 On syntax errors, report the token on which we choked.
22562
aa5fd0ee
AD
22563 * src/bison.s1 (yyparse): In the label yyerrlab, when
22564 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 22565
7b306f52
AD
225662000-03-17 Akim Demaille <akim@epita.fr>
22567
aa5fd0ee 22568 * src/reader.c (copy_at): New function.
7b306f52
AD
22569 (copy_guard): Use it.
22570 (copy_action): Use it.
22571
e87b5700
AD
225722000-03-17 Akim Demaille <akim@epita.fr>
22573
22574 Be kind to translators, save some useless translations.
22575
aa5fd0ee 22576 * src/main.c (banner): New function.
e87b5700
AD
22577 (fatal_banner): Use it.
22578 (warn_banner): Use it.
22579
ae3c3164
AD
225802000-03-17 Akim Demaille <akim@epita.fr>
22581
aa5fd0ee
AD
22582 * src/reader.c (copy_definition): Use copy_string and
22583 copy_comment. Removed now unused `match', `ended',
22584 `cplus_comment'.
ae3c3164
AD
22585 (copy_comment, copy_string): Moved, to be visible from
22586 copy_definition.
22587
4dc58e7c
AD
225882000-03-17 Akim Demaille <akim@epita.fr>
22589
aa5fd0ee
AD
22590 * src/reader.c (copy_string): Declare `static inline'. No
22591 problems with inline, since it is checked by configure.
4dc58e7c
AD
22592 (copy_comment): Likewise.
22593
0a6384c4
AD
225942000-03-17 Akim Demaille <akim@epita.fr>
22595
aa5fd0ee 22596 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 22597
3cef001a
AD
225982000-03-17 Akim Demaille <akim@epita.fr>
22599
aa5fd0ee 22600 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
22601 (copy_action): Use it. Removed now unused `match', `ended',
22602 `cplus_comment'.
22603 (copy_guard): Likewise.
22604
ca36d2ef
AD
226052000-03-17 Akim Demaille <akim@epita.fr>
22606
aa5fd0ee 22607 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
22608 (copy_action): Use it.
22609 (copy_guard): Likewise.
22610
6666f98f
AD
226112000-03-17 Akim Demaille <akim@epita.fr>
22612
22613 Change the handling of @s so that they behave exactly like $s.
22614 There is now a pseudo variable @$ (readble and writable), location
22615 of the lhs of the rule (by default ranging from the location of
22616 the first symbol of the rhs, to the location of the last symbol,
22617 or, if the rhs is empty, YYLLOC).
22618
22619 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
22620 yyval.
22621 (yyparse): When providing a default semantic action, provide a
22622 default location action.
22623 (after the $): No longer change `*YYLSP', just stack YYLOC the
22624 same way you stack YYVAL.
22625 * src/reader.c (read_declarations): Use warns.
22626 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
22627 (copy_action, case '@'): Likewise.
22628 Use a standard error message, to save useless work from
22629 translators.
22630
41aca2e0
AD
226312000-03-17 Akim Demaille <akim@epita.fr>
22632
aa5fd0ee
AD
22633 * src/bison.s1: Formatting and cosmetics changes.
22634 * src/reader.c: Likewise.
41aca2e0
AD
22635 Update the Copyright notice.
22636
dc08c1d5
AD
226372000-03-17 Akim Demaille <akim@epita.fr>
22638
aa5fd0ee
AD
22639 * src/bison.s1 (#line): All set to `#line' only, since the
22640 Makefile now handles them.
dc08c1d5 22641
9ee3c97b
AD
226422000-03-16 Akim Demaille <akim@epita.fr>
22643
22644 * src/output.c (output_rule_data): Output the documentation of
22645 some of the tables.
22646 (Copyright notice): Update.
22647 Formatting changes.
22648
0de741ca
AD
226492000-03-16 Akim Demaille <akim@epita.fr>
22650
22651 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
22652 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
22653 One `#if YYDEBUG' remains, since it uses variables which are
22654 defined only if `YYDEBUG != 0'.
22655
bb10be54
AD
226562000-03-16 Akim Demaille <akim@epita.fr>
22657
22658 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
22659 and related variables so that the similarities are highlighted.
22660
b07b484a
AD
226612000-03-16 Akim Demaille <akim@epita.fr>
22662
22663 * src/bison.s1: Properly indent CPP directives.
22664
361f60b3
AD
226652000-03-16 Akim Demaille <akim@epita.fr>
22666
22667 * src/bison.s1: Properly indent the `alloca' CPP section.
22668
8c44d3ec
AD
226692000-03-16 Akim Demaille <akim@epita.fr>
22670
22671 Do not hard code values of directories in `configure.in'.
22672 Update the `configure' tool chain.
22673
22674 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
22675 src/makefile.am.
22676 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
22677 (AC_OUTPUT): Add m4/Makefile.
22678 Bump to bison 1.28a, 1.29 has never been released.
22679 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
22680 handled via src/Makefile.am.
22681 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
22682 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
22683 autoheader.
22684 * Makefile.am (SUBDIRS): Add m4.
22685 (ACLOCAL_AM_FLAGS): New variable.
22686 (AUTOMAKE_OPTIONS): Add check-news.
22687 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
22688 the proper line number and file name.
22689 (DEFS): Propagate the location of bison library files and of the
22690 locale files.
22691 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
22692 builddir.
22693 * acinclude.m4: Remove, replaced by the directory m4.
22694 * m4/Makefile.am (EXTRA_DIST): New variable.
22695 * m4/gettext.m4: New file, from the fileutils.
22696 * m4/lcmessage.m4: Likewise
22697 * m4/progtest.m4: Likewise.
22698 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
22699
f95997e7
AD
227002000-03-10 Akim Demaille <akim@epita.fr>
22701
22702 * src/closure.c:
22703 Formatting changes of various comments.
22704 Respect the GNU coding standards at various places.
22705 Don't use `_()' when no translation is needed.
22706
227071999-12-13 Jesse Thilo <jthilo@gnu.org>
22708
22709 * src/files.c:
22710 OS/2 honors TMPDIR environment variable.
22711
227121999-12-13 Jesse Thilo <jthilo@gnu.org>
22713
22714 * doc/bison.texinfo: Tweaked spelling and grammar.
22715 Updated ISBN.
22716 Removed reference to price of printed copy.
22717 Mention BISON_SIMPLE and BISON_HAIRY.
22718
227191999-12-13 Jesse Thilo <jthilo@gnu.org>
22720
22721 * configure.in, NEWS:
22722 Bison 1.29 released.
22723
227241999-10-27 Jesse Thilo <jthilo@gnu.org>
22725
22726 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
22727 Added reference card.
22728
227291999-07-26 Jesse Thilo <jthilo@gnu.org>
22730
22731 * po/ru.po: Added Russian translation.
22732
227331999-07-26 Jesse Thilo <jthilo@gnu.org>
22734
22735 * configure.in: Added Russian translation.
22736
227371999-07-06 Jesse Thilo <jthilo@gnu.org>
22738
22739 * configure.in, NEWS, README:
22740 Released version 1.28.
22741
227421999-06-14 Jesse Thilo <jthilo@gnu.org>
22743
22744 * src/system.h:
22745 Squashed redefinition warning on some systems.
22746
22747 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
22748 Have configure build version string instead of relying on ANSI string
22749 concatentation.
22750
227511999-06-14 Jesse Thilo <jthilo@gnu.org>
22752
22753 * po/POTFILES.in: Got rid of version.c.
22754
227551999-06-14 Jesse Thilo <jthilo@gnu.org>
22756
22757 * acconfig.h, configure.in:
22758 Have configure build version string instead of relying on ANSI string
22759 concatentation.
22760
227611999-06-08 Jesse Thilo <jthilo@gnu.org>
22762
22763 * doc/bison.1:
22764 Dropped mention of `+' for long-named options.
22765
227661999-05-30 Jesse Thilo <jthilo@gnu.org>
22767
22768 * src/files.c: Added <unistd.h> for unlink().
22769
22770 * src/Makefile.am, src/system.h:
22771 I18n fixes.
22772
227731999-05-30 Jesse Thilo <jthilo@gnu.org>
22774
22775 * README: Added a FAQ list.
22776
22777 * configure.in, acconfig.h:
22778 I18n fixes.
22779
227801999-05-30 Jesse Thilo <jthilo@gnu.org>
22781
22782 * doc/FAQ, doc/Makefile.am:
22783 Added a FAQ list.
22784
227851999-05-19 Jesse Thilo <jthilo@gnu.org>
22786
22787 * src/alloc.h, src/symtab.h, src/version.c:
22788 Protected inclusion of "config.h" with HAVE_CONFIG_H.
22789
227901999-04-18 Jesse Thilo <jthilo@gnu.org>
22791
22792 * src/.cvsignore, src/Makefile.am:
22793 Reorganized: sources in `src', documentation in `doc'.
22794
22795 * src/lex.c (literalchar):
22796 fixed the code for escaping double quotes (thanks
22797 Jonathan Czisny.)
22798
227991999-04-18 Jesse Thilo <jthilo@gnu.org>
22800
22801 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
22802 Adjusted paths to reflect directory reorganization.
22803
228041999-04-18 Jesse Thilo <jthilo@gnu.org>
22805
22806 * doc/.cvsignore, doc/Makefile.am:
22807 Reorganized: sources in `src', documentation in `doc'.
22808
228091999-04-18 Jesse Thilo <jthilo@gnu.org>
22810
22811 * configure.in:
22812 Updated AC_INIT file to reflect directory reorganization.
22813
22814 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
22815 Reorganized: sources in `src', documentation in `doc'.
22816
228171999-04-13 Jesse Thilo <jthilo@gnu.org>
22818
22819 * src/allocate.c:
22820 Don't declare calloc() and realloc() if not necessary.
22821
228221999-04-13 Jesse Thilo <jthilo@gnu.org>
22823
22824 * configure.in, acconfig.h, acinclude.m4:
22825 Don't declare calloc() and realloc() if not necessary.
22826
228271999-03-23 Jesse Thilo <jthilo@gnu.org>
22828
22829 * po/.cvsignore: Added i18n support.
22830
228311999-03-23 Jesse Thilo <jthilo@gnu.org>
22832
22833 * acconfig.h, configure.in, Makefile.am:
22834 Added i18n support.
22835
228361999-03-22 Jesse Thilo <jthilo@gnu.org>
22837
22838 * src/bison.s1: Fixed #line numbers.
22839
228401999-03-15 Jesse Thilo <jthilo@gnu.org>
22841
22842 * po/es.po, po/fr.po, po/nl.po, po/de.po:
22843 Added PO files from Translation Project.
22844
228451999-03-03 Jesse Thilo <jthilo@gnu.org>
22846
22847 * Makefile.am:
22848 Added support for non-ANSI compilers (ansi2knr).
22849
228501999-02-16 Jesse Thilo <jthilo@gnu.org>
22851
22852 * configure.in: Bumped version number to 1.27.
22853
22854 * Makefile.am:
22855 Added `bison.simple' to list of files removed by `make distclean'.
22856
228571999-02-12 Jesse Thilo <jthilo@gnu.org>
22858
22859 * src/files.c, src/files.h:
22860 Defined locations of parser files in config.h instead of Makefile.
22861
228621999-02-12 Jesse Thilo <jthilo@gnu.org>
22863
22864 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
22865 Defined locations of parser files in config.h instead of Makefile.
22866
228671999-02-09 Jesse Thilo <jthilo@gnu.org>
22868
22869 * Makefile.am:
22870 Removed inappropriate use of $< macro.
22871
228721999-02-05 Jesse Thilo <jthilo@gnu.org>
22873
22874 * po/Makefile.in.in, po/POTFILES.in:
22875 Add `po' directory skeleton.
22876
228771999-01-27 Jesse Thilo <jthilo@gnu.org>
22878
22879 * README: Document help-bison list.
22880
22881 * configure.in: Add check for mkstemp().
22882
228831999-01-20 Jesse Thilo <jthilo@gnu.org>
22884
22885 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
22886 Hush a few compiler warnings.
22887
22888 * src/files.c:
22889 Add tryclose(), which verifies that fclose was successful.
22890 Hush a couple of compiler warnings.
22891
228921999-01-20 Jesse Thilo <jthilo@gnu.org>
22893
22894 * Makefile.am, OChangeLog:
22895 ChangeLog is now automatically generated. Include the old version as
22896 OChangeLog.
22897
228981999-01-14 Jesse Thilo <jthilo@gnu.org>
22899
22900 * 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:
22901 Update FSF address.
22902
229031999-01-14 Jesse Thilo <jthilo@gnu.org>
22904
22905 * doc/bison.texinfo: Fix formatting glitch.
22906
22907 * doc/bison.texinfo: Update FSF address.
22908
229091999-01-14 Jesse Thilo <jthilo@gnu.org>
22910
22911 * acconfig.h: Update FSF address.
22912
229131999-01-08 Jesse Thilo <jthilo@gnu.org>
22914
22915 * src/system.h:
22916 Don't define PACKAGE here, since config.h defines it.
22917
229181998-12-30 Jesse Thilo <jthilo@gnu.org>
22919
22920 * src/reader.c: Update copyright date.
22921
22922 * src/main.c:
22923 Ditch sprintf to statically-sized buffers in fatal/warn functions in
22924 favor of output directly to stderr (avoids buffer overruns).
22925
22926 * src/reader.c: Some checks for premature EOF.
22927
22928 * 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:
22929 Use prototypes if the compiler understands them.
22930
22931 * src/files.c: Honor TMPDIR on Unix hosts.
22932 Use prototypes if the compiler understands them.
22933
22934 * src/reader.c:
22935 Fix a couple of buffer overrun bugs.
22936 Use prototypes if the compiler understands them.
22937
22938 * src/system.h: Include unistd.h and ctype.h.
22939 Use #ifdef instead of #if for NLS symbols.
22940
229411998-12-30 Jesse Thilo <jthilo@gnu.org>
22942
22943 * doc/bison.texinfo:
22944 Delete comment "consider using @set for edition number, etc..." since
22945 we now are doing so.
22946
229471998-12-30 Jesse Thilo <jthilo@gnu.org>
22948
22949 * configure.in:
22950 Use prototypes if the compiler understands them.
22951
22952 * NEWS: Document 1.26 highlights.
22953
22954 * Makefile.am: Require Automake 1.3 or later.
22955
22956 * acconfig.h:
22957 Use prototypes if the compiler understands them.
22958
229591998-12-29 Jesse Thilo <jthilo@gnu.org>
22960
22961 * src/version.c:
22962 Use VERSION symbol from automake for version number.
22963
229641998-12-29 Jesse Thilo <jthilo@gnu.org>
22965
22966 * acconfig.h, configure.in, version.cin:
22967 Use VERSION symbol from automake for version number.
22968
229691998-11-28 Jesse Thilo <jthilo@gnu.org>
22970
22971 * Makefile.am:
22972 Distribute original version of simple parser (bison.s1), not built
22973 version (bison.simple).
22974
229751998-11-28 Jesse Thilo <jthilo@gnu.org>
22976
22977 * doc/bison.texinfo: Add info dir entry.
22978
22979 * doc/bison.texinfo:
22980 Let automake put version number into documentation.
22981
229821998-11-26 Jesse Thilo <jthilo@gnu.org>
22983
22984 * src/bison.cld, src/build.com, src/vmshlp.mar:
22985 Add non-RCS files from /gd/gnu/bison.
22986
229871998-11-26 Jesse Thilo <jthilo@gnu.org>
22988
22989 * doc/bison.1:
22990 Document the BISON_HAIRY and BISON_SIMPLE variables.
22991
229921998-11-25 Jesse Thilo <jthilo@gnu.org>
22993
22994 * src/version.c: Build version.c automatically.
22995
22996 * src/reader.c:
22997 Fix token numbering (used to start at 258, not 257).
22998
22999 * src/system.h: Include config.h.
23000
23001 * src/getargs.c: Update bug report address.
23002
23003 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
23004 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
23005
230061998-11-25 Jesse Thilo <jthilo@gnu.org>
23007
23008 * Makefile.am:
23009 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
23010
23011 * configure.in, version.cin:
23012 Build version.c automatically.
23013
23014 * AUTHORS: Add AUTHORS file.
23015
23016 * README: Update bug report address.
23017
23018 * bison.simple:
23019 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
23020
23021 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
23022 Add automake stuff.
23023
230241998-11-25 Jesse Thilo <jthilo@gnu.org>
23025
23026 * doc/bison.texinfo: Clean up some formatting.
23027
230281998-05-05 Richard Stallman <rms@gnu.org>
23029
23030 * doc/bison.texinfo:
23031 Explain better why to make a pure parser.
23032
230331998-01-05 Richard Stallman <rms@gnu.org>
23034
23035 * src/files.c (openfiles):
23036 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
23037 find a temporary directory, if possible. Do not unlink files while
23038 they are open.
23039
230401997-08-25 Richard Stallman <rms@gnu.org>
23041
23042 * src/reader.c (stack_offset;):
23043 Change some warni to warns.
23044
23045 * src/lex.c (literalchar): Use warns, not warni.
23046
230471997-06-28 Richard Stallman <rms@gnu.org>
23048
23049 * src/bison.s1: Add a Bison version comment.
23050
23051 * src/main.c (fatal, warn, berror):
23052 Use program_name.
23053
230541997-06-28 Richard Stallman <rms@gnu.org>
23055
23056 * Makefile.in (bison_version): New variable.
23057 (dist): Use that variable.
23058 (bison.s1): Substitute the Bison version into bison.simple.
23059
23060 * bison.simple: Add a Bison version comment.
23061
230621997-06-18 Richard Stallman <rms@gnu.org>
23063
23064 * src/main.c (fatal, warn, berror):
23065 Make error messages standard.
23066 (toomany): Improve error message text.
23067
23068 * 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:
23069 new.h renamed to alloc.h.
23070
230711997-06-18 Richard Stallman <rms@gnu.org>
23072
23073 * Makefile.in: new.h renamed to alloc.h.
23074
230751997-05-24 Richard Stallman <rms@gnu.org>
23076
23077 * src/lex.c (literalchar):
23078 Fix the code for escaping \, " and '.
23079
23080 (lex): Avoid trouble when there are many chars
23081 to discard in a char literal with just several chars in it.
23082
230831997-05-17 Richard Stallman <rms@gnu.org>
23084
23085 * src/bison.s1:
23086 Use malloc, if using alloca is troublesome.
23087 (YYSTACK_USE_ALLOCA): New flag macro.
23088 Define it for some systems and compilers.
23089 (YYSTACK_ALLOC): New macro.
23090 (yyparse): Use YYSTACK_ALLOC to allocate stack.
23091 If it was malloc'd, free it.
23092
230931997-05-17 Richard Stallman <rms@gnu.org>
23094
23095 * bison.simple:
23096 Use malloc, if using alloca is troublesome.
23097 (YYSTACK_USE_ALLOCA): New flag macro.
23098 Define it for some systems and compilers.
23099 (YYSTACK_ALLOC): New macro.
23100 (yyparse): Use YYSTACK_ALLOC to allocate stack.
23101 If it was malloc'd, free it.
23102
231031997-04-23 Richard Stallman <rms@gnu.org>
23104
23105 * src/bison.s1:
23106 (alloca) [__hpux]: Always define as __builtin_alloca.
23107
231081997-04-23 Richard Stallman <rms@gnu.org>
23109
23110 * bison.simple:
23111 (alloca) [__hpux]: Always define as __builtin_alloca.
23112
231131997-04-22 Richard Stallman <rms@gnu.org>
23114
23115 * src/bison.s1:
23116 [__hpux]: Include alloca.h (right for HPUX 10)
23117 instead of declaring alloca (right for HPUX 9).
23118
23119 * src/bison.s1 (__yy_memcpy):
23120 Declare arg `count' as unsigned int.
23121 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
23122
231231997-04-22 Richard Stallman <rms@gnu.org>
23124
23125 * bison.simple:
23126 [__hpux]: Include alloca.h (right for HPUX 10)
23127 instead of declaring alloca (right for HPUX 9).
23128
23129 * bison.simple (__yy_memcpy):
23130 Declare arg `count' as unsigned int.
23131 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
23132
231331997-01-03 Richard Stallman <rms@gnu.org>
23134
23135 * src/allocate.c: [__STDC__ or _MSC_VER]:
23136 Declare calloc and realloc to return void *.
23137
231381997-01-02 Richard Stallman <rms@gnu.org>
23139
23140 * src/system.h:
23141 [_MSC_VER]: Include stdlib.h and process.h.
23142 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
23143
23144 * src/main.c (main): Return FAILURE as a value.
23145 (printable_version): Declare arg as int, not char.
23146
231471997-01-02 Richard Stallman <rms@gnu.org>
23148
23149 * Makefile.in (dist):
23150 Explicitly check for symlinks, and copy them.
23151
231521996-12-19 Richard Stallman <rms@gnu.org>
23153
23154 * src/files.c:
23155 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
23156
231571996-12-18 Paul Eggert <eggert@gnu.org>
23158
23159 * src/bison.s1 (yyparse):
23160 If __GNUC__ and YYPARSE_PARAM are both defined,
23161 declare yyparse to have a void * argument.
23162
231631996-12-18 Paul Eggert <eggert@gnu.org>
23164
23165 * bison.simple (yyparse):
23166 If __GNUC__ and YYPARSE_PARAM are both defined,
23167 declare yyparse to have a void * argument.
23168
231691996-12-17 Richard Stallman <rms@gnu.org>
23170
23171 * src/reduce.c (nbits): Add some casts.
23172
231731996-08-12 Richard Stallman <rms@gnu.org>
23174
23175 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
23176
231771996-08-12 Richard Stallman <rms@gnu.org>
23178
23179 * bison.simple: Test _MSDOS as well as _MSDOS_.
23180
231811996-07-31 Richard Stallman <rms@gnu.org>
23182
23183 * src/bison.s1:
23184 [__sun && __i386]: Include alloca.h.
23185
231861996-07-31 Richard Stallman <rms@gnu.org>
23187
23188 * bison.simple:
23189 [__sun && __i386]: Include alloca.h.
23190
231911996-07-30 Richard Stallman <rms@gnu.org>
23192
23193 * src/bison.s1: Comment change.
23194
23195 * src/bison.s1: Test _MSDOS_, not MSDOS.
23196
231971996-07-30 Richard Stallman <rms@gnu.org>
23198
23199 * bison.simple: Comment change.
23200
23201 * bison.simple: Test _MSDOS_, not MSDOS.
23202
232031996-06-01 Richard Stallman <rms@gnu.org>
23204
23205 * 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:
23206 Insert `_' macro around many string constants.
23207
23208 * src/main.c:
23209 Insert `_' macro around many string constants.
23210
23211 (main): Call setlocale, bindtextdomain and textdomain.
23212
23213 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
23214 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
23215 [ENABLE_NLS]: Include libintl.h.
23216 [ENABLE_NLS] (gettext): Define.
23217 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
23218 (N_, PACKAGE, LOCALEDIR): New macros.
23219
232201996-06-01 Richard Stallman <rms@gnu.org>
23221
23222 * POTFILES.in: New file.
23223
23224 * Makefile.in (allocate.o):
23225 Define target explicitly.
23226
23227 * Makefile.in (CFLAGS): Set to @CFLAGS@.
23228 (LDFLAGS): Set to @LDFLAGS@.
23229 (configure): Run autoconf only if preceding `cd' succeeds.
23230 (bison.s1): Redirect output to temporary file then move the
23231 temporary to the target, rather than redirecting directly to bison.s1.
23232 (clean): Remove config.status and config.log.
23233 (distclean): Don't remove config.status here.
23234
232351996-05-12 Richard Stallman <rms@gnu.org>
23236
23237 * src/bison.s1:
23238 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
23239
232401996-05-12 Richard Stallman <rms@gnu.org>
23241
23242 * bison.simple:
23243 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
23244
232451996-05-11 Richard Stallman <rms@gnu.org>
23246
23247 * src/bison.s1 (__yy_memcpy):
23248 Really reorder the args, as was supposedly done on Feb 14 1995.
23249 (yyparse): Calls changed accordingly.
23250
232511996-05-11 Richard Stallman <rms@gnu.org>
23252
23253 * Makefile.in (dist): Don't use $(srcdir).
23254
23255 * bison.simple (__yy_memcpy):
23256 Really reorder the args, as was supposedly done on Feb 14 1995.
23257 (yyparse): Calls changed accordingly.
23258
232591996-01-27 Richard Stallman <rms@gnu.org>
23260
23261 * src/output.c (output_rule_data):
23262 Test YYERROR_VERBOSE in the conditional
23263 around the definition of ttyname.
23264
232651995-12-29 Richard Stallman <rms@gnu.org>
23266
23267 * src/bison.s1:
23268 Fix line numbers in #line commands.
23269
232701995-12-29 Richard Stallman <rms@gnu.org>
23271
23272 * bison.simple:
23273 Fix line numbers in #line commands.
23274
232751995-12-27 Richard Stallman <rms@gnu.org>
23276
23277 * src/bison.s1 (YYPARSE_PARAM_DECL):
23278 In C++, make it always null.
23279 (YYPARSE_PARAM_ARG): New macro.
23280 (yyparse): Use YYPARSE_PARAM_ARG.
23281
232821995-12-27 Richard Stallman <rms@gnu.org>
23283
23284 * bison.simple (YYPARSE_PARAM_DECL):
23285 In C++, make it always null.
23286 (YYPARSE_PARAM_ARG): New macro.
23287 (yyparse): Use YYPARSE_PARAM_ARG.
23288
232891995-11-29 Richard Stallman <rms@gnu.org>
23290
23291 * doc/bison.texinfo:
23292 Describe literal string tokens, %raw, %no_lines, %token_table.
23293
232941995-11-29 Daniel Hagerty <hag@gnu.org>
23295
23296 * doc/bison.texinfo: Fixed update date
23297
232981995-10-16 Richard Stallman <rms@gnu.org>
23299
23300 * src/version.c: Version 1.25.
23301
233021995-10-16 Richard Stallman <rms@gnu.org>
23303
23304 * NEWS: *** empty log message ***
23305
233061995-10-16 Richard Stallman <rms@gnu.org>
23307
23308 * doc/bison.1, doc/bison.rnh:
23309 Add new options.
23310
233111995-10-15 Richard Stallman <rms@gnu.org>
23312
23313 * src/vmsgetargs.c, src/getargs.c:
23314 Added -n, -k, and -raw switches.
23315 (noparserflag, toknumflag, rawtoknumflag): New variables.
23316
23317 * src/symtab.h (SALIAS):
23318 New #define for adding aliases to %token.
23319 (struct bucket): Added `alias' field.
23320
23321 * src/reduce.c (reduce_grammar):
23322 Revise error message.
23323 (print_notices): Remove final `.' from error message.
23324
23325 * src/reader.c (reader_output_yylsp):
23326 New function.
23327 (readgram): Use `#if 0' around code that accepted %command
23328 inside grammar rules: The documentation doesn't allow it,
23329 and it will fail since the %command processors scan for the next %.
23330 (parse_token_decl): Extended the %token
23331 declaration to allow a multi-character symbol as an alias.
23332 (parse_thong_decl): New function.
23333 (read_declarations): Added %thong declarations.
23334 (read_declarations): Handle NOOP to deal with allowing
23335 % declarations as another means to specify the flags.
23336 (readgram): Allow %prec prior to semantics embedded in a rule.
23337 (skip_to_char, read_declarations, copy_definition)
23338 (parse_token_decl, parse_start_decl, parse_type_decl)
23339 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
23340 (get_type_name, copy_guard, copy_action, readgram)
23341 (get_type, packsymbols): Revised most error messages.
23342 Changed `fatal' to `warnxxx' to avoid aborting for error.
23343 Revised and use multiple warnxxx functions to avoid using VARARGS1.
23344 (read_declarations): Improve the error message for
23345 an invalid character. Do not abort.
23346 (read_declarations, copy_guard, copy_action): Use
23347 printable_version to avoid unprintable characters in printed output.
23348 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
23349 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
23350 Allow the type of a non-terminal can be given
23351 more than once, as long as all specifications give the same type.
23352
23353 * src/output.c:
23354 (output_headers, output_trailers, output, output_gram)
23355 (output_rule_data): Implement noparserflag variable.
23356 Implement toknumflag variable.
23357 (output): Call reader_output_yylsp to output LTYPESTR.
23358
23359 * src/main.c (main):
23360 If reader sees an error, don't process the grammar.
23361 (fatals): Updated to not use VARARGS1.
23362 (printable_version, int_to_string, warn, warni, warns, warnss)
23363 (warnsss): New error reporting functions. Avoid abort for error.
23364
23365 * src/lex.h:
23366 Added THONG and NOOP for alias processing.
23367 Added SETOPT for the new code that allows setting options with %flags.
23368
23369 * src/lex.c:
23370 Include getopt.h. Add some extern decls.
23371 (safegetc): New function to deal with EOF gracefully.
23372 (literalchar); new function to deal with reading \ escapes.
23373 (lex): Use literalchar.
23374 (lex): Implemented "..." tokens.
23375 (literalchar, lex, parse_percent_token): Made tokenbuffer
23376 always contain the token. This includes growing the token
23377 buffer while reading an integer.
23378 (parse_percent_token): Replaced if-else statement with percent_table.
23379 (parse_percent_token): Added % declarations as another
23380 way to specify the flags -n, -l, and -r. Also added hooks for
23381 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
23382 major changes to files.c.
23383 (lex) Retain in the incoming stream a character following
23384 an incorrect '/'.
23385 (skip_white_space, lex): Revised most error messages
23386 and changed fatal to warn to avoid aborting.
23387 (percent_table): Added %thong declarations.
23388
23389 * src/gram.h: Comment changes.
23390
23391 * src/files.c (openfiles, open_extra_files, done):
23392 Add faction flag
23393 and actfile file. Handle noparserflag. Both for -n switch.
23394
23395 * src/conflicts.c (resolve_sr_conflict):
23396 Remove use of alloca.
23397
233981995-06-01 Jim Meyering <meyering@gnu.org>
23399
23400 * doc/bison.texinfo: *** empty log message ***
23401
234021995-05-06 Richard Stallman <rms@gnu.org>
23403
23404 * src/bison.s1: Comment change.
23405
234061995-05-06 Richard Stallman <rms@gnu.org>
23407
23408 * bison.simple: Comment change.
23409
234101995-05-03 Richard Stallman <rms@gnu.org>
23411
23412 * src/version.c: Version now 1.24.
23413
23414 * src/bison.s1: Change distribution terms.
23415
23416 * src/version.c: Version now 1.23.
23417
234181995-05-03 Richard Stallman <rms@gnu.org>
23419
23420 * doc/bison.texinfo:
23421 Rewrite "Conditions for Using Bison".
23422 Update version to 1.24.
23423
234241995-05-03 Richard Stallman <rms@gnu.org>
23425
23426 * bison.simple: Change distribution terms.
23427
234281995-02-23 Richard Stallman <rms@gnu.org>
23429
23430 * src/files.c: Test __VMS_POSIX as well as VMS.
23431
234321995-02-14 Jim Meyering <meyering@gnu.org>
23433
23434 * src/bison.s1 (__yy_memcpy):
23435 Renamed from __yy_bcopy to avoid
23436 confusion. Reverse FROM and TO arguments to be consistent with
23437 those of memcpy.
23438
234391995-02-14 Jim Meyering <meyering@gnu.org>
23440
23441 * bison.simple (__yy_memcpy):
23442 Renamed from __yy_bcopy to avoid
23443 confusion. Reverse FROM and TO arguments to be consistent with
23444 those of memcpy.
23445
234461994-11-10 David J. MacKenzie <djm@gnu.org>
23447
23448 * NEWS: reformat
23449
23450 * NEWS: New file.
23451
23452 * Makefile.in (DISTFILES): Include NEWS.
23453
23454 * Makefile.in (DISTFILES):
23455 Include install-sh, not install.sh.
23456
23457 * configure.in: Update to Autoconf v2 macro names.
23458
234591994-10-05 David J. MacKenzie <djm@gnu.org>
23460
23461 * Makefile.in: fix typo
23462
23463 * Makefile.in (prefix, exec_prefix):
23464 Let configure set them.
23465
234661994-09-28 David J. MacKenzie <djm@gnu.org>
23467
23468 * Makefile.in: Set datadir to $(prefix)/share.
23469
234701994-09-15 Richard Stallman <rms@gnu.org>
23471
23472 * src/bison.s1:
23473 Update copyright notice and GPL version.
23474
234751994-09-15 Richard Stallman <rms@gnu.org>
23476
23477 * bison.simple:
23478 Update copyright notice and GPL version.
23479
234801994-07-12 Richard Stallman <rms@gnu.org>
23481
23482 * src/reduce.c, src/reader.c:
23483 entered into RCS
23484
234851994-05-05 David J. MacKenzie <djm@gnu.org>
23486
23487 * Makefile.in: entered into RCS
23488
234891994-03-26 Richard Stallman <rms@gnu.org>
23490
23491 * src/bison.s1: entered into RCS
23492
234931994-03-26 Richard Stallman <rms@gnu.org>
23494
23495 * bison.simple: entered into RCS
23496
234971994-03-25 Richard Stallman <rms@gnu.org>
23498
23499 * src/main.c: entered into RCS
23500
235011994-03-24 Richard Stallman <rms@gnu.org>
23502
23503 * src/conflicts.c: entered into RCS
23504
235051994-01-02 Richard Stallman <rms@gnu.org>
23506
23507 * Makefile.in: *** empty log message ***
23508
235091993-11-21 Richard Stallman <rms@gnu.org>
23510
23511 * src/bison.s1: *** empty log message ***
23512
235131993-11-21 Richard Stallman <rms@gnu.org>
23514
23515 * doc/bison.texinfo: entered into RCS
23516
23517 * doc/bison.texinfo: *** empty log message ***
23518
235191993-11-21 Richard Stallman <rms@gnu.org>
23520
23521 * bison.simple: *** empty log message ***
23522
235231993-10-25 David J. MacKenzie <djm@gnu.org>
23524
23525 * doc/bison.texinfo: *** empty log message ***
23526
235271993-10-19 Richard Stallman <rms@gnu.org>
23528
23529 * src/bison.s1: *** empty log message ***
23530
235311993-10-19 Richard Stallman <rms@gnu.org>
23532
23533 * bison.simple: *** empty log message ***
23534
235351993-10-14 Richard Stallman <rms@gnu.org>
23536
23537 * src/bison.s1: *** empty log message ***
23538
235391993-10-14 Richard Stallman <rms@gnu.org>
23540
23541 * bison.simple: *** empty log message ***
23542
235431993-09-14 David J. MacKenzie <djm@gnu.org>
23544
23545 * doc/bison.texinfo: *** empty log message ***
23546
235471993-09-13 Noah Friedman <friedman@gnu.org>
23548
23549 * Makefile.in: *** empty log message ***
23550
235511993-09-10 Richard Stallman <rms@gnu.org>
23552
23553 * src/conflicts.c: *** empty log message ***
23554
23555 * src/system.h: entered into RCS
23556
235571993-09-10 Richard Stallman <rms@gnu.org>
23558
23559 * doc/bison.1: entered into RCS
23560
235611993-09-06 Noah Friedman <friedman@gnu.org>
23562
23563 * src/version.c: entered into RCS
23564
235651993-09-06 Noah Friedman <friedman@gnu.org>
23566
23567 * Makefile.in: *** empty log message ***
23568
235691993-07-30 David J. MacKenzie <djm@gnu.org>
23570
23571 * Makefile.in: *** empty log message ***
23572
235731993-07-24 Richard Stallman <rms@gnu.org>
23574
23575 * src/bison.s1: *** empty log message ***
23576
235771993-07-24 Richard Stallman <rms@gnu.org>
23578
23579 * bison.simple: *** empty log message ***
23580
235811993-07-08 David J. MacKenzie <djm@gnu.org>
23582
23583 * Makefile.in: *** empty log message ***
23584
235851993-07-04 Richard Stallman <rms@gnu.org>
23586
23587 * src/bison.s1: *** empty log message ***
23588
235891993-07-04 Richard Stallman <rms@gnu.org>
23590
23591 * bison.simple: *** empty log message ***
23592
235931993-06-26 David J. MacKenzie <djm@gnu.org>
23594
23595 * src/getargs.c: entered into RCS
23596
235971993-06-26 David J. MacKenzie <djm@gnu.org>
23598
23599 * doc/bison.texinfo: *** empty log message ***
23600
23601 * doc/bison.1: New file.
23602
236031993-06-25 Richard Stallman <rms@gnu.org>
23604
23605 * src/getargs.c: New file.
23606
236071993-06-16 Richard Stallman <rms@gnu.org>
23608
23609 * src/bison.s1: *** empty log message ***
23610
236111993-06-16 Richard Stallman <rms@gnu.org>
23612
23613 * bison.simple: *** empty log message ***
23614
236151993-06-03 Richard Stallman <rms@gnu.org>
23616
23617 * src/bison.s1: New file.
23618
236191993-06-03 Richard Stallman <rms@gnu.org>
23620
23621 * doc/bison.texinfo: *** empty log message ***
23622
236231993-06-03 Richard Stallman <rms@gnu.org>
23624
23625 * bison.simple: New file.
23626
236271993-05-19 Richard Stallman <rms@gnu.org>
23628
23629 * doc/bison.texinfo: New file.
23630
236311993-05-07 Noah Friedman <friedman@gnu.org>
23632
23633 * Makefile.in: *** empty log message ***
23634
236351993-04-28 Noah Friedman <friedman@gnu.org>
23636
23637 * src/reader.c: *** empty log message ***
23638
236391993-04-23 Noah Friedman <friedman@gnu.org>
23640
23641 * src/alloc.h: entered into RCS
23642
236431993-04-20 David J. MacKenzie <djm@gnu.org>
23644
23645 * src/version.c: *** empty log message ***
23646
23647 * src/files.c, src/allocate.c:
23648 entered into RCS
23649
23650 * src/reader.c: *** empty log message ***
23651
23652 * src/lex.c: entered into RCS
23653
23654 * src/conflicts.c: New file.
23655
23656 * src/symtab.c: entered into RCS
23657
23658 * src/alloc.h: New file.
23659
23660 * src/LR0.c: entered into RCS
23661
236621993-04-18 Noah Friedman <friedman@gnu.org>
23663
23664 * src/reader.c: New file.
23665
23666 * src/version.c: *** empty log message ***
23667
236681993-04-18 Noah Friedman <friedman@gnu.org>
23669
23670 * Makefile.in: *** empty log message ***
23671
236721993-04-17 Noah Friedman <friedman@gnu.org>
23673
23674 * Makefile.in: *** empty log message ***
23675
236761993-04-15 Richard Stallman <rms@gnu.org>
23677
23678 * src/main.c, src/files.c:
23679 New file.
23680
236811993-04-15 Noah Friedman <friedman@gnu.org>
23682
23683 * configure.in: entered into RCS
23684
23685 * configure.in: *** empty log message ***
23686
23687 * configure.in: New file.
23688
236891993-04-14 Richard Stallman <rms@gnu.org>
23690
23691 * Makefile.in: New file.
23692
236931993-04-13 Richard Stallman <rms@gnu.org>
23694
23695 * src/version.c: New file.
23696
236971993-03-25 Richard Stallman <rms@gnu.org>
23698
23699 * src/output.c: entered into RCS
23700
237011992-09-25 Richard Stallman <rms@gnu.org>
23702
23703 * configure.bat: entered into RCS
23704
237051992-06-22 Richard Stallman <rms@gnu.org>
23706
23707 * src/vmsgetargs.c: entered into RCS
23708
237091992-06-22 Richard Stallman <rms@gnu.org>
23710
23711 * doc/bison.rnh: entered into RCS
23712
237131992-04-20 David J. MacKenzie <djm@gnu.org>
23714
23715 * README: entered into RCS
23716
237171992-01-22 Richard Stallman <rms@gnu.org>
23718
23719 * src/machine.h: entered into RCS
23720
237211991-12-21 Richard Stallman <rms@gnu.org>
23722
23723 * src/lalr.c, src/closure.c:
23724 entered into RCS
23725
237261991-12-20 Richard Stallman <rms@gnu.org>
23727
23728 * src/state.h: entered into RCS
23729
237301991-12-18 Richard Stallman <rms@gnu.org>
23731
23732 * src/print.c, src/nullable.c, src/derives.c:
23733 entered into RCS
23734
237351991-11-03 David J. MacKenzie <djm@gnu.org>
23736
23737 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
23738 entered into RCS
23739
237401988-09-09 Richard Stallman <rms@gnu.org>
23741
23742 * src/bison.hairy: entered into RCS
23743
237441987-12-16 Richard Stallman <rms@gnu.org>
23745
23746 * REFERENCES: entered into RCS
dc546b0f 23747
f294a2c2 23748
04098407 23749 -----
f294a2c2 23750
ea0a7676
JD
23751 Copyright (C) 1987-1988, 1991-2011 Free Software Foundation,
23752 Inc.
f294a2c2 23753
04098407
PE
23754 Copying and distribution of this file, with or without
23755 modification, are permitted provided the copyright notice and this
23756 notice are preserved.