]> git.saurik.com Git - bison.git/blame - ChangeLog
Pacify -DGNULIB_POSIXCHECK.
[bison.git] / ChangeLog
CommitLineData
d143e9c3
JD
12011-05-01 Joel E. Denny <joeldenny@joeldenny.org>
2
3 Pacify -DGNULIB_POSIXCHECK.
4 * bootstrap.conf (gnulib_modules): Add all modules suggested by
5 -DGNULIB_POSIXCHECK.
6 * src/files.c (file_name_split)
7 * src/getargs.c (getargs)
8 * src/location.c (boundary_set_from_string)
9 * src/output.c (token_definitions_output, output_skeleton)
10 * src/parse-gram.y (prologue_declaration)
11 * src/scan-gram.l (handle_syncline)
12 * src/symtab.c (symbol_new): Use mbschr and mbsrchr instead of
13 strchr and strrchr. In the cases of command-line options, file
14 names, and thus locations, functionality may be improved. In the
15 case of symbol names, there should be no functional difference as
16 all characters are ASCII, so the intended benefit is just warning
17 suppression.
18
723206df
JD
192011-05-01 Joel E. Denny <joeldenny@joeldenny.org>
20
21 * NEWS (2.5): Fix minor typos.
22
ac3297d5
JD
232011-05-01 Joel E. Denny <joeldenny@joeldenny.org>
24
25 doc: clean up quotation style in NEWS.
26 * NEWS (2.5): For multi-character tokens in example grammar rules,
27 use "token" not 'token'. In English, use a consistent quotation
28 style; we might as well follow the precedent seen in info pages:
29 `quote' not "quote".
30
c9e2da4f
JD
312011-04-16 Joel E. Denny <joeldenny@joeldenny.org>
32
33 tests: pacify gcc 4.6.0's -Wunused-but-set-variable.
34 Reported by Jim Meyering at
35 <http://lists.gnu.org/archive/html/bug-bison/2011-04/msg00002.html>.
36 * tests/actions.at
37 (Default %printer and %destructor for mid-rule values): Define
38 YYLLOC_DEFAULT so that it uses its Rhs argument.
39
55dd3563
JD
402011-04-16 Joel E. Denny <joeldenny@joeldenny.org>
41
42 glr.c: omit yyresolveLocations when locations are disabled.
43 This prevents gcc 4.6.0's -Wunused-but-set-variable from warning
44 about yyresolveLocations's local yyrhsloc. When locations are
45 enabled, there's no such warning because YYLLOC_DEFAULT then uses
46 yyrhsloc. Reported by Jim Meyering at
47 <http://lists.gnu.org/archive/html/bug-bison/2011-04/msg00002.html>.
48 * data/glr.c (yyresolveLocations): Omit definition when locations
49 are disabled.
50 (yyresolveValue): Omit yyresolveLocations invocation when
51 locations are disabled.
52
a898435b
JD
532011-04-16 Joel E. Denny <joeldenny@joeldenny.org>
54
55 gnulib, autoconf: update.
56 * README-hacking (Updating a submodule): Give advice on how to
57 determine the versions of gnulib and autoconf to which we should
58 update.
59 (Release Procedure): Note that submodules should be updated.
60 * bootstrap.conf (gnulib_modules): Rename pipe to spawn-pipe as
61 suggested in updated gnulib NEWS.
62 * gnulib: Choose a stable snapshot according to advice in Bison's
63 README-hacking.
64 * po/POTFILES.in (lib/pipe.c): Rename to...
65 (lib/spawn-pipe.c): ... this.
66 * src/output.c: Update to include spawn-pipe.h.
67 * submodules/autoconf: Update to latest for improvement in m4.m4
68 that excludes M4 with buggy strstr. The only other changes to
69 files that we use are copyright updates.
70
fea2d6b0
JD
712011-04-09 Joel E. Denny <joeldenny@joeldenny.org>
72
73 Fix missing updates to GPLv3.
74 Reported by Tys Lefering at
75 <http://lists.gnu.org/archive/html/bison-patches/2011-04/msg00000.html>.
76 * src/print-xml.c, src/print-xml.h: In these files.
77
6f8bdce2
JD
782011-03-27 Joel E. Denny <joeldenny@joeldenny.org>
79
80 Add -Wconflicts-sr and -Wconflicts-rr.
81 Thus, conflict reports are now affected by -Werror and -Wnone
82 (unless %expect or %expect-rr is specified). Reported by George
83 Neuner at
84 <http://lists.gnu.org/archive/html/bug-bison/2010-08/msg00002.html>.
85 * NEWS (2.5): Document.
86 * doc/bison.texinfo (Bison Options): Document.
87 * src/complain.c, src/complain.h (set_warning_issued): Export
88 function.
89 * src/conflicts.c (conflicts_print): Suppress conflict report
90 based on -Wno-conflicts-sr and -Wno-conflicts-rr, and treat
91 conflicts as errors if -Werror.
92 * src/getargs.c (warnings_flag): Initialize with
93 warnings_conflicts_sr and warnings_conflicts_rr as well.
94 (warnings_args, warnings_types): Add entries for
95 warnings_conflicts_sr and warnings_conflicts_rr.
96 (usage): Update.
97 * src/getargs.h (enum warnings): Add entries for
98 warnings_conflicts_sr and warnings_conflicts_rr.
99 * tests/conflicts.at (-W versus %expect and %expect-rr): New test
100 group.
101 * tests/local.at (AT_BISON_CHECK_NO_XML): Update now that the
102 conflict report can produce a "warnings being treated as errors"
103 message. Also, check that stderr is now fully scrubbed by -Wnone
104 when the exit status is 0.
105
fc7ce997
JD
1062011-03-27 Joel E. Denny <joeldenny@joeldenny.org>
107
108 Pacify maintainer-check-posix.
109 Adding command-line options after the grammar file name is not
110 permitted, so disable checks that do that when
111 maintainer-check-posix is running.
112 * tests/local.at (AT_BISON_CHECK_NO_XML): Don't run the
113 problematic checks when POSIXLY_CORRECT=1. Also, for readability,
114 remove an unnecessary m4_if.
115
8ffd7912
JD
1162011-03-27 Joel E. Denny <joeldenny@joeldenny.org>
117
118 Add -Wother so -Wnone suppresses all warnings.
119 Reported by George Neuner at
120 <http://lists.gnu.org/archive/html/bug-bison/2010-08/msg00002.html>.
121 * NEWS (2.5): Document.
122 * THANKS (George Neuner): Add.
123 * doc/bison.texinfo (Bison Options): Document.
124 * src/complain.c, src/complain.h
125 (warn_at, warn_at_indent, warn): Suppress warning if -Wno-other.
126 (midrule_value_at): New warning function, similar to yacc_at in
127 that it's controlled by its own warning category.
128 * src/getargs.c (warnings_flag): Initialize to warnings_other.
129 (warnings_args, warnings_types): Add entry for warnings_other.
130 (usage): Update.
131 * src/getargs.h (enum warnings): Add entry for warnings_other.
132 * src/gram.c (grammar_rules_useless_report): If -Wno-other, then
133 don't print useless rules.
134 * src/reader.c (symbol_should_be_used): Rather than adjusting the
135 return value based on whether midrule value warnings are enabled,
136 accept a new parameter for telling the caller whether true is
137 being returned for a potential midrule warning.
138 (grammar_rule_check): Use midrule_value_at for midrule value
139 warnings, and continue to use warn_at for all other warnings. Let
140 them check whether the warnings are enabled.
141 * tests/local.at (AT_BISON_CHECK): Update documentation.
142 (AT_BISON_CHECK_NO_XML): Check that -Wnone and --warnings=none
143 disable all warnings exercised in the test suite.
144
dab96632
JD
1452011-03-27 Joel E. Denny <joeldenny@joeldenny.org>
146
147 Don't let -Wnone disable -Werror.
148 Discussed at
149 <http://lists.gnu.org/archive/html/bison-patches/2010-08/msg00009.html>.
150 * NEWS (2.5): Document.
151 * src/getargs.c (flags_argmatch): Accept a new argument that
152 specifies what flags "all" and thus "none" affect.
153 (FLAGS_ARGMATCH): Update flags_argmatch invocation.
154 * tests/input.at (-Werror is not affected by -Wnone and -Wall):
155 New test group.
156
248dba53
JD
1572011-03-27 Joel E. Denny <joeldenny@joeldenny.org>
158
159 * NEWS (2.5): Document fix for -Wno-CATEGORY.
160
20cc7149
DJ
1612008-11-21 Di-an Jan <dianj@freeshell.org>
162
163 Implement no-XXX arguments for --warnings, --report, --trace.
164 * src/getargs.c (flags_argmatch): Handles no-XXX.
165 Fix typo in doxygen comment.
166
56706c61
JD
1672011-03-20 Joel E. Denny <joeldenny@joeldenny.org>
168
169 doc: fix confusing citation of LAC publication.
170 Suggested by Akim Demaille.
171 * doc/bison.texinfo (LAC): Here.
172
a6e5a280
JD
1732011-03-20 Joel E. Denny <joeldenny@joeldenny.org>
174
175 lr.default-reductions: rename "full" value to "most".
176 Unlike "consistent" and "accepting", "full" doesn't answer the
177 question of "which states".
178 * doc/bison.texinfo (%define Summary): Update.
179 (Default Reductions): Update.
180 * src/print.c (print_reductions): Update.
181 * src/reader.c (prepare_percent_define_front_end_variables):
182 Update.
183 * src/tables.c (action_row): Update.
184 * tests/input.at (%define enum variables): Update.
185 * tests/reduce.at (%define lr.default-reductions): Update.
186
49e8e901
JD
1872011-03-13 Joel E. Denny <joeldenny@joeldenny.org>
188
189 * src/parse-gram.c, src/parse-gram.h: Regenerate.
190
8f462efe
AD
1912011-03-09 Akim Demaille <akim@lrde.epita.fr>
192
193 named references: fix double free.
194 In `rhs[name]: "a" | "b"', do not free "name" twice.
195 Reported by Tys Lefering.
196 <http://lists.gnu.org/archive/html/bug-bison/2010-06/msg00002.html>
197 * src/named-ref.h, src/named-ref.c (named_ref_copy): New.
198 * src/parse-gram.y (current_lhs): Rename as...
199 (current_lhs_symbol): this.
200 (current_lhs): New function. Use it to free the current lhs
201 named reference.
202 * src/reader.c: Bind lhs to a copy of the current named reference.
203 * src/symlist.c: Rely on free (0) being valid.
204 * tests/named-refs.at: Test this.
205
686e83e3
AD
2062011-03-09 Akim Demaille <akim@lrde.epita.fr>
207
208 tests: style changes.
209 * tests/named-refs.at (Redundant words in LHS brackets)
210 (Unresolved references): here.
211
f0e2c228
JD
2122011-03-06 Joel E. Denny <joeldenny@joeldenny.org>
213
214 java: fix parser tracing bug.
215 * NEWS (2.5): Document.
216 * data/lalr1.java (YYParser::YYStack::print): Don't skip top
217 element.
218
4c2a6e42
JD
2192011-03-06 Joel E. Denny <joeldenny@joeldenny.org>
220
221 java: finish fixing parser stack popping bug.
222 * NEWS (2.5): Document.
223 * data/lalr1.java (YYParser::YYStack::pop): Fix off-by-one error
224 in clearing the location stack. Also fix pop function that
225 accepts no arguments.
226
6f75992b
AB
2272011-03-06 Angelo Borsotti <angelo.borsotti@gmail.com> (tiny change)
228
229 java: fix parser stack popping bug.
230 Reported at
231 <http://lists.gnu.org/archive/html/bug-bison/2011-02/msg00005.html>.
232 * THANKS (Angelo Borsotti): Add.
233 * data/lalr1.java (YYParser::YYStack::pop): Fix off-by-one error
234 in clearing the value stack. Previously, the top element of the
235 stack wasn't cleared and so the value was not garbage collected.
236
121c4982
JD
2372011-03-06 Joel E. Denny <joeldenny@joeldenny.org>
238
239 doc: cite publication for LAC.
240 * doc/bison.texinfo (LAC): Here.
241
5da0355a
JD
2422011-03-06 Joel E. Denny <joeldenny@joeldenny.org>
243
244 doc: clean up terminology for mysterious conflicts.
245 * doc/bison.texinfo (Mystery Conflicts): Rename node to...
246 (Mysterious Conflicts): ... this, which is already the section
247 title and the name used in the index. Update all cross-references
248 to this node. Also, don't imply that R/R conflicts are the only
249 kind of mysterious conflict.
250
d815ec4a
JD
2512011-03-06 Joel E. Denny <joeldenny@joeldenny.org>
252
253 lr.default-reductions: rename "all" value to "full".
254 States that shift the error token do not have default reductions,
255 and GLR disables some default reductions, so "all" was a misnomer.
256 * doc/bison.texinfo (%define Summary): Update.
257 (Default Reductions): Update.
258 * src/print.c (print_reductions): Update.
259 * src/reader.c (prepare_percent_define_front_end_variables):
260 Update.
261 * src/tables.c (action_row): Update.
262 * tests/input.at (%define enum variables): Update.
263 * tests/reduce.at (%define lr.default-reductions): Update.
264
6f04ee6c
JD
2652011-03-06 Joel E. Denny <joeldenny@joeldenny.org>
266
267 doc: create a new Tuning LR section in the manual.
268 And clean up all other documentation of the features described
269 there.
270 * NEWS (2.5): Tweak wording of lr.type and parse.lac entries a
271 bit, update the cross-references to the manual, and point out that
272 LAC has caveats. Don't be so adamant that IELR+LAC=canonical LR.
273 That is, as the referenced section in the manual documents, LAC
274 does not fix infinite parsing loops on syntax errors.
275 * doc/bison.texinfo: Consistently drop the "(1)" suffix from LALR,
276 IELR, and LR in @cindex.
277 (%define Summary): Condense the entries for lr.default-reductions,
278 lr.keep-unreachable-states, lr.type, and parse.lac into brief
279 summaries, and cross-reference the appropriate subsections of
280 Tuning LR. For parse.lac, mention that it's only implemented for
281 deterministic parsers in C.
282 (Error Reporting): When mentioning %error-verbose, mention LAC,
283 and add cross-reference to the LAC section.
284 (Tuning LR): New section with an extended version of the
285 documentation removed from %define Summary. Change all
286 cross-references in the manual to point here instead of there.
287 (Calc++ Parser): When mentioning %error-verbose, mention LAC, and
288 add cross-reference to the LAC section.
289 (Table of Symbols): In %error-verbose and YYERROR_VERBOSE entries,
290 add cross-references to Error Reporting.
291 (Glossary): Capitalize entry titles consistently. Add definitions
292 for "defaulted state" and "unreachable state". Expand IELR
293 acronym in IELR's entry.
294
71caec06
JD
2952011-02-20 Joel E. Denny <joeldenny@joeldenny.org>
296
297 doc: add bibliography to manual.
298 * doc/bison.texinfo (Mystery Conflicts): Cross-reference
299 bibliography instead of citing publications directly.
300 (Generalized LR Parsing): Likewise.
301 (Bibliography): New section. Not all entries are cross-referenced
302 yet, but that will come in future patches.
303
77768165
JD
3042011-02-19 Joel E. Denny <joeldenny@joeldenny.org>
305
306 java: test and document previous bug fix.
307 * NEWS (2.5): Document it.
308 * tests/java.at (_AT_DATA_JAVA_CALC_Y): To one of the yyerror
309 invocations, pass a location that spans multiple tokens. Change
310 yyerror to report all of a location rather than just the begin
311 position. Extend yylex and Position to count tokens on a line.
312 Remove getHashCode as it's unused. Update all expected output.
313
8db68289
BK
3142011-02-19 Bernd Kiefer <kiefer@dfki.de> (tiny change)
315
316 java: fix location handling bug.
317 Reported at
318 <http://lists.gnu.org/archive/html/bison-patches/2011-02/msg00005.html>.
319 * data/lalr1.java (YYParser::yylloc): For non-empty RHS, fix
320 reversed access to location stack.
321 * THANKS (Bernd Kiefer): Add.
322
f3103c5b
AD
3232010-05-11 Akim Demaille <demaille@gostai.com>
324
325 doc: please Emacs.
326 * doc/bison.texinfo (Local Variables): Move this after the
327 LocalWords, since the latter are looked for in the whole document,
328 while the former are looked for only at its end.
329 Require american spell checking.
330
406dec82
JD
3312011-02-06 Joel E. Denny <joeldenny@joeldenny.org>
332
333 doc: clean up new subsections in manual.
334 * doc/bison.texinfo (%define Summary): Reword so it reads well as
335 a separate section. For example, add an intro, and move most of
336 the text outside of the @deffn so it is not indented so far.
337 (%code Summary): Likewise.
338 (Table of Symbols): Reword %code entry to match the %code entry in
339 Decl Summary.
340
2f4518a1
JD
3412011-02-06 Joel E. Denny <joeldenny@joeldenny.org>
342
343 doc: finish splitting apart the manual's Decl Summary section.
344 Suggested by Akim Demaille at
345 <http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00013.html>.
346 * doc/bison.texinfo (Decl Summary): Extract most of the %define
347 entry into...
348 (%define Summary): ... this new subsection, and update all
349 cross-references. For readability of the patches, rewriting of
350 the text so it makes sense as a separate subsection will come in a
351 later patch. Moreover, the majority of the text describing the
352 various new LR features should likely move to another new section
353 somewhere.
354
8e6f2266
JD
3552011-02-06 Joel E. Denny <joeldenny@joeldenny.org>
356
357 doc: begin to split apart the manual's Decl Summary section.
358 Discussed in thread starting at
359 <http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00013.html>.
360 * doc/bison.texinfo (Decl Summary): Extract most of the %code
361 entry into...
362 (%code Summary): ... this new subsection, and update all
363 cross-references. For readability of the patches, rewriting of
364 the text so it makes sense as a separate subsection will come in a
365 later patch.
366
9913d6e4
JD
3672011-02-06 Joel E. Denny <joeldenny@joeldenny.org>
368
369 doc: clean up naming of various Bison files.
370 The Bison manual's names for various files associated with a Bison
371 parser has devolved into inconsistency. This patch makes the
372 naming consistent for the most important files. First, it chooses
373 "grammar file" over "input file". The former appears to be more
374 traditional in the Bison manual, and Bison has other input
375 files (skeletons). Second, it chooses "parser implementation
376 file" over names like "parser file", "parser source file", "parser
377 source code file", and "parser output file". The new name makes
378 it clearer where Bison generates the main parser implementation,
379 and it is easily distinguishable from "parser header file".
380 * doc/bison.texinfo: Implement throughout.
381
840341d6
JD
3822011-02-06 Joel E. Denny <joeldenny@joeldenny.org>
383
384 doc: give credit to more of Bison's developers.
385 * doc/bison.texinfo (Introduction): Don't imply that only Robert
386 Corbett, Richard Stallman, and Wilfred Hansen have contributed to
387 Bison. However, I don't have time to write a full history, so
388 just point readers to THANKS and ChangeLog.
389
d89e48b3
JD
3902011-02-06 Joel E. Denny <joeldenny@joeldenny.org>
391
392 doc: document experimental features better.
393 * doc/bison.texinfo (Introduction): Say that IELR(1) and canonical
394 LR(1) are experimental. Mention Java. Normally experimental
395 features probably shouldn't be mentioned in the introduction.
396 However, if Bison's limitations to LALR(1), C, and C++ are so
397 important that they should be mentioned here, then it's important
398 to point out that Bison is beginning to escape those limitations.
399 Moreover, these particular experimental features have very little
400 chance of being removed.
401 * src/getargs.c (usage): Say that IELR(1) and canonical LR(1) are
402 experimental.
403
eb8c66bb
JD
4042011-01-29 Joel E. Denny <joeldenny@joeldenny.org>
405
406 Do not allow identifiers that start with a dash.
407 This cleans up our previous fixes for a bug whereby Bison
408 discarded `.field' in `$-1.field'. The previous fixes were less
409 restrictive about where a dash could appear in an identifier, but
410 the restrictions were hard to explain. That bug was reported and
411 this final fix was originally suggested by Paul Hilfinger. This
412 also fixes a remaining bug reported by Paul Eggert whereby Bison
413 parses `%token ID -123' as `%token ID - 123' and handles `-' as an
414 identifier. Now, `-' cannot be an identifier. Discussed in
415 threads beginning at
416 <http://lists.gnu.org/archive/html/bug-bison/2011-01/msg00000.html>,
417 <http://lists.gnu.org/archive/html/bug-bison/2011-01/msg00004.html>.
418 * NEWS (2.5): Update entry describing the dash extension to
419 grammar symbol names. Also, move that entry before the named
420 references entry because the latter mentions the former.
421 * doc/bison.texinfo (Symbol): Update documentation for symbol
422 names. As suggested by Paul Eggert, mention the effect of periods
423 and dashes on named references.
424 (Decl Summary): Update documentation for unquoted %define values,
425 which, as a side effect, can no longer start with dashes either.
426 * src/scan-code.l (id): Implement.
427 * src/scan-gram.l (id): Implement.
428 * tests/actions.at (Exotic Dollars): Extend test group to exercise
429 bug reported by Paul Hilfinger.
430 * tests/input.at (Symbols): Update test group, and extend to
431 exercise bug reported by Paul Eggert.
432 * tests/named-refs.at (Stray symbols in brackets): Update test
433 group.
434 ($ or @ followed by . or -): Likewise.
435 * tests/regression.at (Invalid inputs): Likewise.
436
448dc38b
JD
4372011-01-24 Joel E. Denny <joeldenny@joeldenny.org>
438
439 * data/yacc.c: Fix last apostrophe warning from xgettext.
440
7e5ef706
PE
4412011-01-09 Paul Eggert <eggert@cs.ucla.edu>
442
443 Fix minor problems encountered by a fresh bootstrap.
444 * data/glr.c, data/yacc.c: Do not use apostrophes in '#' comments,
445 as they confuse xgettext, which tries to parse them as C character
446 constants in a preprocessor directive.
447 * data/yacc.c (yy_lac): Don't use printf %d format on *yyesp, as
448 that expression might not promote to int on some platforms.
449 * src/parse-gram.c, src/parse-gram.h: Regenerate.
450
8cbbf178
JD
4512011-01-09 Joel E. Denny <joeldenny@joeldenny.org>
452
453 Improve error messages for `$' or `@' followed by `.' or `-'.
454 Previously, for this special case of an invalid reference, the
455 usual "symbol not found in production:" was printed. However,
456 because the symbol name was parsed as the empty string, that
457 message was followed immediately by a newline instead of a symbol
458 name. In reality, this is a syntax error, so the reference is
459 invalid regardless of the symbols actually appearing in the
460 production. Discussed at
461 <http://lists.gnu.org/archive/html/bison-patches/2011-01/msg00012.html>.
462 * src/scan-code.l (parse_ref): Report the above case as a syntax
463 error. Other than that, continue to handle this case like any
464 other invalid reference that Bison manages to parse because
465 "possibly meant" messages can still be helpful to the user.
466 * tests/named-refs.at ($ or @ followed by . or -): New test group.
467
35430378
JD
4682011-01-08 Joel E. Denny <joeldenny@joeldenny.org>
469
470 doc: don't use @acronym.
471 Lately, many GNU packages are dropping it. See
472 <http://lists.gnu.org/archive/html/bison-patches/2011-01/msg00003.html>.
473 * doc/bison.texinfo: Remove all uses.
474
d236ad94
AR
4752011-01-05 Alex Rozenman <rozenman@gmail.com>
476
477 Do not allow identifiers that start with a negative number.
478 Reported by Paul Hilfinger as a side effect of named references
479 support at
480 <http://lists.gnu.org/archive/html/bug-bison/2011-01/msg00000.html>.
481 Suggested by Paul Eggert.
482 * src/scan-code.l ({letter}, {id}): Adjust lexical definitions.
483 * src/scan-gram.l ({letter}, {id}): Likewise.
484
9a4292e5
JD
4852011-01-03 Joel E. Denny <joeldenny@joeldenny.org>
486
487 * ChangeLog (2011-01-02): improve description.
488
17300e83
JD
4892011-01-03 Joel E. Denny <joeldenny@joeldenny.org>
490
491 maint: don't update copyright years in bootstrap.
492 * .x-update-copyright: Add entry for bootstrap.
493 * bootstrap: Remove 2011 from copyright years. The bootstrap
494 version we're currently using comes from an older version of
495 gnulib.
496 * bootstrap.conf (bootstrap_sync): Add comments explaining this
497 issue.
498
ea0a7676
JD
4992011-01-02 Joel E. Denny <joeldenny@joeldenny.org>
500
501 maint: run "make update-copyright".
502
f52e1e5e
JD
5032011-01-02 Joel E. Denny <joeldenny@joeldenny.org>
504
9a4292e5 505 maint: prepare to use year ranges in copyright notices.
f52e1e5e 506 * README (Copyright statements): New section explaining the range
9a4292e5
JD
507 notation. The GNU maintainers document requires this explanation:
508 <http://www.gnu.org/prep/maintain/maintain.html#Copyright-Notices>.
509 I copied our explanation from coreutils.
f52e1e5e
JD
510 * build-aux/update-b4-copyright: Revert 2010-06-17 changes that
511 disabled Bison's automated use of ranges.
512 * cfg.mk (update-copyright-env): Likewise.
513
210c1eef
JD
5142011-01-02 Joel E. Denny <joeldenny@joeldenny.org>
515
516 Correct my email address.
517 * ChangeLog: In all recent entries.
518 * THANKS (Joel E. Denny): Here.
519
5202010-12-19 Joel E. Denny <joeldenny@joeldenny.org>
6ee881f6
JD
521
522 doc: cleanup.
523 * NEWS (2.5): Try to sort entries according to how interesting
524 users might find them.
525
210c1eef 5262010-12-19 Joel E. Denny <joeldenny@joeldenny.org>
3b1977ea
JD
527
528 doc: cleanup.
529 * NEWS (2.5): Make some minor improvements to wording, and format
530 entries more consistently.
531 * doc/bison.texinfo (Language and Grammar): Point out that IELR
532 and canonical LR are experimental features.
533 (Decl Summary): In list of %define variables, make wording more
534 consistent. Improve discussion of using LALR for GLR.
535
210c1eef 5362010-12-19 Joel E. Denny <joeldenny@joeldenny.org>
4c38b19e
JD
537
538 parse.lac: document.
539 * NEWS (2.5): Add entry for LAC, and mention LAC in entry for
540 other corrections to verbose syntax error messages.
541 * doc/bison.texinfo (Decl Summary): Rewrite entries for
542 lr.default-reductions and lr.type to be clearer, to mention
543 %nonassoc's effect on canonical LR, and to mention LAC. Add entry
544 for parse.lac.
545 (Glossary): Add entry for LAC.
546
210c1eef 5472010-12-11 Joel E. Denny <joeldenny@joeldenny.org>
723fe7d1
JD
548
549 parse.lac: implement exploratory stack reallocations.
550 * data/yacc.c: Rename %define variable parse.lac.es-capacity to
551 parse.lac.es-capacity-initial. Accept parse.lac.memory-trace
552 with values of "failures" (default) or "full".
553 (b4_declare_parser_state_variables): Add yyesa, yyes, and
554 yyes_capacity variables.
555 (YYSTACK_USE_ALLOCA): Ignore it if LAC requested.
556 (YYSTACK_ALLOC, YYSTACK_FREE, YYSTACK_ALLOC_MAXIMUM): Define if
557 LAC requested.
558 (YYCOPY_NEEDED): New cpp macro.
559 (YYCOPY): Define if LAC requested.
560 (yy_lac_stack_realloc): New function implementing stack
561 reallocations. Use YYMAXDEPTH for maximum stack size given that
562 the stack should never need to grow larger than the main state
563 stack needs to grow without LAC.
564 (YY_LAC_ESTABLISH): Update yy_lac invocation.
565 (yy_lac): Add arguments for exploratory stack memory data
566 recorded in the main parser. Invoke yy_lac_stack_realloc when
567 reallocation is necessary.
568 (yysyntax_error): Add the same new arguments and pass them to
569 yy_lac.
570 (yypstate_delete): Free yyes if necessary.
571 (yyesa, yyes, yyes_capacity): #define these to yypstate members
572 in the case of push parsing.
573 (yyparse, yypush_parse): Initialize yyes and yyes_capacity.
574 Update yysyntax_error invocations. At yyreturn, free yyes if
575 necessary.
576 * src/parse-gram.y: %define parse.lac full.
577 * tests/input.at (LAC: errors for %define): Extend for
578 parse.lac-memory-trace.
579 * tests/regression.at (LAC: Exploratory stack): Extend to check
580 that stack reallocs happen when expected.
581 (LAC: Memory exhaustion): Update to use YYMAXDEPTH and
582 parse.lac.es-capacity-initial.
583
210c1eef 5842010-12-11 Joel E. Denny <joeldenny@joeldenny.org>
ea13bea8
JD
585
586 parse.lac: implement as %define variable.
587 LAC = lookahead correction. See discussion at
588 <http://lists.gnu.org/archive/html/bison-patches/2009-09/msg00034.html>.
589 However, one point there must be corrected: because of %nonassoc,
590 LAC is *not* always redundant for lr.type=canonical-lr.
591 * data/yacc.c: Accept values of "none" (default) or "full" for
592 parse.lac. Accept %define parse.lac.es-capacity to specify
593 capacity of LAC's temporary exploratory stack. It defaults to 20
594 and, for now, will not grow dynamically.
595 (b4_lac_flag, b4_lac_if): New m4 macros. Evaluate as true for
596 parse.lac!=none.
597 (YYBACKUP): Invoke YY_LAC_DISCARD.
598 (YY_LAC_ESTABLISH, YY_LAC_DISCARD): New cpp macros that invoke
599 yy_lac and track when it needs to be invoked
600 (yy_lac): New function that, given the current stack, determines
601 whether a token can eventually be shifted. Return status mimics
602 yyparse return status.
603 (yysyntax_error): Change yystate argument to yyssp so stack top
604 can be passed to yy_lac. If LAC is requested, build expected
605 token list by invoking yy_lac for every token instead of just
606 checking the current state for lookaheads. Return 2 if yy_lac
607 exhausts memory.
608 (yyparse, yypush_parse): Use local variable yy_lac_established and
609 cpp macros YY_LAC_ESTABLISH and YY_LAC_DISCARD to implement LAC.
610 Update yysyntax_error invocation. Add yyexhaustedlab code if LAC
611 is requested.
612 * tests/conflicts.at (%nonassoc and eof): Extend to check the
613 effect of each of -Dlr.type=canonical-lr and -Dparse.lac=full.
614 (%error-verbose and consistent errors): Likewise.
615 (LAC: %nonassoc requires splitting canonical LR states): New test
616 group demonstrating how LAC can fix canonical LR.
617 * tests/input.at (LAC: Errors for %define): New test group.
618 * tests/regression.at (LAC: Exploratory stack): New test group.
619 (LAC: Memory exhaustion): New test group.
620
210c1eef 6212010-11-21 Joel E. Denny <joeldenny@joeldenny.org>
dcd39f1d
JD
622
623 build: use gnulib's new bootstrap_sync option.
624 Now, whenever we update bison's copy of gnulib, bootstrap will
625 update itself the next time it's run.
626 * bootstrap: Copy from latest gnulib for bootstrap_sync support.
627 * bootstrap.conf (bootstrap_sync): Set to true.
628 * gnulib: Update to latest so bootstrap is in sync now.
629
210c1eef 6302010-11-07 Joel E. Denny <joeldenny@joeldenny.org>
3b837882
JD
631
632 yysyntax_error: adjust prior fixes for branch-2.5's lalr1.cc.
633 On master, there is no yychar in lalr1.cc, but there is on
634 branch-2.5, and the prior cherry-pick of "Fix handling of yychar
635 manipulation in user semantic actions" wasn't adjusted for that
636 difference.
637 * data/lalr1.cc (yy::parser::parse): Translate yychar before
638 every use of yytoken, and add comments explaining this approach.
639 * tests/conflicts.at (%error-verbose and consistent errors):
640 Extend to test yychar manipulation with lalr1.cc.
641
210c1eef 6422010-11-07 Joel E. Denny <joeldenny@joeldenny.org>
095a1d11
JD
643
644 yysyntax_error: fix for consistent error with lookahead.
645 * NEWS (2.5): Document.
646 * data/yacc.c (yysyntax_error): In a verbose syntax error
647 message while in a consistent state with a default action (which
648 must be an error action given that yysyntax_error is being
649 invoked), continue to drop the expected token list, but don't
650 drop the unexpected token unless there actually is no lookahead.
651 Moreover, handle that internally instead of returning 1 to tell
652 the caller to do it. With that meaning of 1 gone, renumber
653 return codes more usefully.
654 (yyparse, yypush_parse): Update yysyntax_error usage. Most
655 importantly, set yytoken to YYEMPTY when there's no lookahead.
656 * data/glr.c (yyreportSyntaxError): As in yacc.c, don't drop the
657 unexpected token unless there actually is no lookahead.
658 * data/lalr1.cc (yy::parser::parse): If there's no lookahead,
659 set yytoken to yyempty_ before invoking yysyntax_error_.
660 (yy::parser::yysyntax_error_): Again, don't drop the unexpected
661 token unless there actually is no lookahead.
662 * data/lalr1.java (YYParser::parse): If there's no lookahead,
663 set yytoken to yyempty_ before invoking yysyntax_error.
664 (YYParser::yysyntax_error): Again, don't drop the unexpected
665 token unless there actually is no lookahead.
666 * tests/conflicts.at (%error-verbose and consistent
667 errors): Extend test group to further reveal how the previous
668 use of the simple "syntax error" message was too general. Test
669 yacc.c, glr.c, lalr1.cc, and lalr1.java. No longer an expected
670 failure.
671 * tests/java.at (AT_JAVA_COMPILE, AT_JAVA_PARSER_CHECK): Move
672 to...
673 * tests/local.at: ... here.
674 (_AT_BISON_OPTION_PUSHDEFS): Push AT_SKEL_JAVA_IF definition.
675 (AT_BISON_OPTION_POPDEFS): Pop it.
676 (AT_FULL_COMPILE): Extend to handle Java.
677
210c1eef 6782010-11-07 Joel E. Denny <joeldenny@joeldenny.org>
678094a2
JD
679
680 yysyntax_error: more preparation for readability of next patch.
681 There are no behavioral changes here.
682 * data/glr.c (yyreportSyntaxError): Reorganize.
683 * data/lalr1.cc (yy::parser::yysyntax_error_): Reorganize.
684 * tests/conflicts.at (%error-verbose and consistent errors):
685 Reorganize.
686
210c1eef 6872010-11-07 Joel E. Denny <joeldenny@joeldenny.org>
f953cb20
JD
688
689 yysyntax_error: prepare for readability of next patches.
690 These are purely whitespace changes that result in ugly code
691 but that make the next couple of patches much easier to read.
692 * data/glr.c (yyreportSyntaxError): Reindent.
693 * data/lalr1.cc (yy::parser::yysyntax_error_): Reindent.
694 * data/lalr1.java (YYParser::yysyntax_error): Reindent.
695 * data/yacc.c (yysyntax_error): Reindent.
696
0e0f066b
JD
6972010-10-31 Joel E. Denny <joeldenny@joeldenny.org>
698
699 yysyntax_error: improve invocation readability.
700 * data/yacc.c (yyparse, yypush_parse): For yysyntax_error
701 invocation, get rid of the while loop, which is misleading
702 because there are really at most two iterations.
703
5f1485d8
JD
7042010-10-31 Joel E. Denny <joeldenny@joeldenny.org>
705
706 * ChangeLog: Correct some errors in previous entries.
707
2f3fd8f9
JD
7082010-10-17 Joel E. Denny <joeldenny@joeldenny.org>
709
710 maint: re-anchor all .gitignore entries.
711 * bootstrap: Copy from gnulib's latest for the fix to
712 automatically anchor entries it constructs.
713 * gnulib: Update to latest just so it has the same bootstrap.
714 * .gitignore, build-aux/.gitignore, doc/.gitignore:
715 * lib/.gitignore, m4/.gitignore, po/.gitignore:
716 * runtime-po/.gitignore: Re-anchor all entries.
717
86996fca
PE
7182010-10-08 Paul Eggert <eggert@cs.ucla.edu>
719
ea6046b9
PE
720 Fix portability problem on OpenBSD 4.7.
721
722 Jim Meyering reported this in
723 <http://lists.gnu.org/archive/html/bug-bison/2010-10/msg00007.html>.
724 * data/yacc.c: Use EXIT_SUCCESS as a witness for stdlib.h,
725 not _STDLIB_H. EXIT_SUCCESS has been defined by the standard
726 for quite some time.
727 * src/parse-gram.c, src/parse-gram.h: Regenerate.
728 * tests/regression.at: Tamper with the renamed witness.
729
86996fca
PE
730 Adjust to recent changes to gnulib bootstrap.
731
732 * .cvsignore, build-aux/.cvsignore, doc/.cvsignore, etc/.cvsignore:
733 * examples/calc++/.cvsignore, lib/.cvsignore, m4/.cvsignore:
734 * po/.cvsignore, runtime-po/.cvsignore, src/.cvsignore:
735 * tests/.cvsignore: Remove; I don't use CVS to maintain Bison
736 anymore and don't know of anybody else who does. If someone needs
737 these files, they can resurrect them.
738 * .gitignore, build-aux/.gitignore, doc/.gitignore, lib/.gitignore:
739 * m4/.gitignore, po/.gitignore, runtime-po/.gitignore:
740 Omit leading '/', since bootstrap omits it.
741 Adjust file names to match current contents better.
742 * bootstrap: Sync from gnulib: this contains the new gnulib_mk_hook
743 installed just for us.
744 * bootstrap.conf (excluded_files): Don't exclude codeset.m4,
745 glibc21.m4, inttypes_h.m4, size_max.m4, xsize.m4, as they are now
746 needed somehow. Don't have time to look into why.
747 (gnulib_modules): Change malloc to malloc-gnu. Do we really assume
748 the GNU malloc behavior, where malloc (0) != NULL unless we're
749 out of storage? If not, we can omit malloc-gnu; but for now I left
750 it in to be safe.
751 (vc_ignore): Remove.
752 * README-hacking: Renamed from HACKING, since gnulib bootstrap now
753 uses that convention.
754
7527c744
JD
7552010-08-05 Joel E. Denny <joeldenny@joeldenny.org>
756
757 Version 2.4.3.
758 * NEWS (2.4.3): Set date.
759
d034d520
JD
7602010-08-04 Joel E. Denny <joeldenny@joeldenny.org>
761
762 maint: add gettext version to release announcements.
763 Suggested by Paul Hilfinger at
764 <http://lists.gnu.org/archive/html/bison-patches/2010-07/msg00019.html>
765 <http://lists.gnu.org/archive/html/bison-patches/2010-08/msg00002.html>.
766 * cfg.mk (bootstrap-tools): Add gettext.
767
cf22447c
JD
7682010-08-04 Joel E. Denny <joeldenny@joeldenny.org>
769
770 doc: fix -W and %expect documentation some.
771 * NEWS (2.4.3): Mention that there are documentation fixes.
772 * doc/bison.texinfo (Expect Decl): Make it clear that %expect
773 turns conflicts into errors not warnings.
774 (Shift/Reduce): Likewise.
775 (Bison Options): Don't mention -Wsyntax. It doesn't exist.
776
4631c34f
JD
7772010-08-01 Joel E. Denny <joeldenny@joeldenny.org>
778
779 -Werror: fix for rules useless in parser after conflicts.
780 * NEWS (2.4.3): Document fix.
781 * src/complain.c (error_message): Extend to handle incomplete
782 error messages so warn and warn_at can be used in more cases.
783 * src/gram.c (grammar_rules_useless_report): Use warn_at so that
784 -Werror is always obeyed.
785 * src/reduce.c (reduce_print): Use warn so that the "warnings
786 being treated as errors" message is printed consistently before
787 the first warning message. This makes testing easier.
788 * tests/local.at (AT_BISON_WERROR_MSG): New macro.
789 (AT_BISON_CHECK_NO_XML): Extend to check -Werror and
790 --warnings=error when warnings appear in bison's stderr.
791
3e948170
JD
7922010-07-29 Joel E. Denny <joeldenny@joeldenny.org>
793
794 maint: enable gnits only at stable releases.
795 * configure.ac (AM_INIT_AUTOMAKE): Underscore or dash in a
796 version string should disable gnits. Explain in comments.
797
82df2d6d
JD
7982010-07-28 Joel E. Denny <joeldenny@joeldenny.org>
799
800 i18n: update.
801 * po/POTFILES.in: Add src/graphviz.c.
802
6e0ecb9a
JD
8032010-07-28 Joel E. Denny <joeldenny@joeldenny.org>
804
805 i18n: fix for gnulib.
806 * po/POTFILES.in: Add remaining gnulib files that have
807 translatable strings.
808
83e34842
JD
8092010-07-25 Joel E. Denny <joeldenny@joeldenny.org>
810
811 maint: use announce-gen's new --mail-headers.
812 * HACKING (Announce): Update instructions.
813 * cfg.mk (announcement_Cc_): Define.
814 * configure.ac (AM_GNU_GETTEXT_VERSION): Update to 0.18 as
815 required by latest gnulib.
816 * gnulib: Update to latest.
817
0162a44c
JD
8182010-07-24 Joel E. Denny <joeldenny@joeldenny.org>
819
820 tests: handle Valgrind that complains about >&-.
821 * tests/output.at (AT_CHECK_OUTPUT): Extend to accept pre-tests.
822 (Output files: -dv >&-): Skip test group if running
823 maintainer-check-valgrind.
824
241ac701
AD
8252010-06-17 Paul Eggert <eggert@cs.ucla.edu>
826
827 Update from GFDL GFDL 1.2 to 1.3.
828 * doc/bison.texinfo: Update GFDL version number.
829 * doc/fdl.texi: Update to version 1.3, taken from:
830 http://www.gnu.org/licenses/fdl.texi
831
6e30ede8
PE
8322010-06-17 Paul Eggert <eggert@cs.ucla.edu>
833
834 Do not use date ranges in copyright notices.
835 See http://www.gnu.org/prep/maintain/maintain.html#Copyright-Notices
836
837 * HACKING, Makefile.am, NEWS, PACKAGING, README, README-alpha:
838 * TODO, bootstrap, bootstrap.conf:
839 * build-aux/update-b4-copyright, cfg.mk, configure.ac:
840 * data/README, data/bison.m4, data/c++-skel.m4, data/c++.m4:
841 * data/c-skel.m4, data/c.m4, data/glr.c, data/glr.cc:
842 * data/java-skel.m4, data/java.m4, data/lalr1.cc:
843 * data/lalr1.java, data/location.cc:
844 * data/xslt/bison.xsl:
845 * data/xslt/xml2dot.xsl, data/xslt/xml2text.xsl:
846 * data/xslt/xml2xhtml.xsl, data/yacc.c, djgpp/Makefile.maint:
847 * djgpp/README.in, djgpp/config.bat, djgpp/config.sed:
848 * djgpp/config.site, djgpp/config_h.sed, djgpp/djunpack.bat:
849 * djgpp/subpipe.c, djgpp/subpipe.h:
850 * djgpp/testsuite.sed, doc/bison.texinfo:
851 * doc/refcard.tex, etc/README, etc/bench.pl.in:
852 * examples/calc++/Makefile.am, examples/extexi:
853 * lib/abitset.c, lib/abitset.h:
854 * lib/bbitset.h, lib/bitset.c, lib/bitset.h:
855 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
856 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
857 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
858 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
859 * lib/libiberty.h, lib/main.c, lib/timevar.c:
860 * lib/timevar.def, lib/timevar.h, lib/vbitset.c:
861 * lib/vbitset.h, lib/yyerror.c, m4/bison-i18n.m4:
862 * m4/c-working.m4, m4/cxx.m4, m4/subpipe.m4, m4/timevar.m4:
863 * src/AnnotationList.c, src/AnnotationList.h:
864 * src/InadequacyList.c, src/InadequacyList.h, src/LR0.c:
865 * src/LR0.h, src/Sbitset.c, src/Sbitset.h, src/assoc.c:
866 * src/assoc.h, src/closure.c, src/closure.h, src/complain.c:
867 * src/complain.h, src/conflicts.c, src/conflicts.h:
868 * src/derives.c, src/derives.h, src/files.c, src/files.h:
869 * src/flex-scanner.h, src/getargs.c, src/getargs.h:
870 * src/gram.c, src/gram.h, src/graphviz.c, src/ielr.c:
871 * src/ielr.h, src/lalr.c, src/lalr.h:
872 * src/location.c, src/location.h, src/main.c:
873 * src/muscle-tab.c, src/muscle-tab.h, src/named-ref.c:
874 * src/named-ref.h, src/nullable.c, src/nullable.h:
875 * src/output.c, src/output.h, src/parse-gram.y:
876 * src/print-xml.c, src/print-xml.h, src/print.c, src/print.h:
877 * src/print_graph.c, src/print_graph.h, src/reader.c:
878 * src/reader.h, src/reduce.c, src/reduce.h, src/relation.c:
879 * src/relation.h, src/scan-code.h, src/scan-code.l:
880 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
881 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
882 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
883 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
884 * tests/actions.at, tests/atlocal.in, tests/c++.at:
885 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
886 * tests/existing.at, tests/glr-regression.at:
887 * tests/headers.at, tests/input.at, tests/java.at:
888 * tests/local.at, tests/named-refs.at:
889 * tests/output.at, tests/push.at, tests/reduce.at:
890 * tests/regression.at, tests/sets.at, tests/skeletons.at:
891 * tests/synclines.at, tests/testsuite.at, tests/torture.at:
892 * data/Makefile.am, data/location.cc, doc/Makefile.am, src/Makefile.am:
893 * tests/Makefile.am, lib/Makefile.am, examples/Makefile.am:
894 * etc/Makefile.am:
895 Don't use date ranges in copyright notices.
896
3d4a0cad
AD
8972010-05-11 Akim Demaille <demaille@gostai.com>
898
899 lalrl1.cc: give a chance to user defined YYLLOC_DEFAULT.
900 * data/lalr1.cc (YYLLOC_DEFAULT): Move its definition from the
901 header file to the implementation file, after the user %code
902 sections.
903 * NEWS (2.5): Document this.
904
e7bab2df
AD
9052010-05-07 Akim Demaille <demaille@gostai.com>
906
907 c++: use YYRHSLOC.
908 * data/lalr1.cc (YYRHSLOC): New.
909 (YYLLOC_DEFAULT): Use it.
910 * data/glr.cc: If location_type was user defined, do not include
911 location.hh, and do not produce location.hh and position.hh.
912 * tests/calc.at (YYLLOC_DEFAULT): Use YYRHSLOC.
913 Check that glr.cc supports user defined location_type.
914 * NEWS: Document this.
915
baacae49
AD
9162010-05-10 Akim Demaille <demaille@gostai.com>
917
918 doc: fix lalr1.cc documentation.
919 * doc/bison.texinfo (C++ Scanner Interface): Fix yylex signature.
920 (C++ Bison Interface): Fix lalr1.cc skeleton name.
921 (C++ Parser Interface): Fix semantic_type and location_type names.
922 Document yy::parser::token.
923 Reported by Jerry Quinn.
924
95a2de56
AD
9252010-05-04 Akim Demaille <demaille@gostai.com>
926
927 lalr1.cc: don't generate location.hh when location_type is defined
928 * data/bison.m4 (b4_percent_define_use): New.
929 (b4_percent_define_get): Use it.
930 Accept a default value.
931 * data/c++.m4: Do not provide a default value for the %define
932 variable location_type, rather, use b4_percent_define_get with a
933 default argument where its value is needed.
934 * data/lalr1.cc: Do not load location.cc (which outputs both
935 location.hh and position.hh) if the user defined location_type.
936 Do not include location.hh either.
937 * data/glr.cc: Likewise.
938
0f404a0a
AD
9392010-05-04 Akim Demaille <demaille@gostai.com>
940
941 lalr1.cc: location_type: make sure we don't depend on loc.(begin|end).
942 * tests/calc.at (Span): Instead of begin/end, as in the built-in
943 location class, use first and last.
944 Define YYLLOC_DEFAULT to adjust to these changes.
945 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Adjust to the
946 location_type changes.
947
bdc360ae
AD
9482010-05-04 Akim Demaille <demaille@gostai.com>
949
950 tests: enhance AT_SYNCLINES_COMPILE.
951 * tests/synclines.at (AT_TEST_SYNCLINE): Move GCC 4.5 protection
952 into...
953 (AT_SYNCLINES_COMPILE): here.
954 Add more distcc patterns.
955
ca7a59e8
JD
9562010-05-01 Joel E. Denny <joeldenny@joeldenny.org>
957
958 tests: fix maintainer-xml-check.
959 * data/xslt/xml2dot.xsl (xsl:template match="bison-xml-report"):
960 Update output to include comments now produced by --graph.
961 (xsl:template match="automaton"): As for --graph, name the
962 digraph after the grammar file.
963 * src/print-xml.c (escape_bufs): Enlarge array.
964 (print_xml): Add bug-report and url attributes to
965 bison-xml-report element.
966
ad6f84e5
JD
9672010-05-01 Joel E. Denny <joeldenny@joeldenny.org>
968
969 In DOT output, convert from "/*" comments to "//" comments.
970 This handles the possibility that a "*/" might appear in
971 variable portions of those comments at some point in the future.
972 * src/graphviz.c (start_graph): Implement.
973
43fdc9fd
JD
9742010-04-30 Joel E. Denny <joeldenny@joeldenny.org>
975
976 Document that undefined %prec identifier warnings will remain.
977 * NEWS (2.4.3): Here.
978 (2.4.2): Here.
979
e02df72c
JD
9802010-04-30 Joel E. Denny <joeldenny@joeldenny.org>
981
982 Revert 2009-12-30 change for undefined %prec token complaints.
983 That is, keep them as warnings because that should be sufficient
984 to satisfy POSIX without creating backward compatibility issues.
985 Suggested by Richard Stallman at
986 <http://lists.gnu.org/archive/html/bison-patches/2010-03/msg00033.html>.
987 * NEWS (2.5): Remove mention of complaint.
21279295
JD
988 * src/reader.c (grammar_rule_check): Convert complaint back to
989 warning.
e02df72c
JD
990 * tests/input.at (%prec's token must be defined): Update.
991
ba3063f6
JD
9922010-04-25 Joel E. Denny <joeldenny@joeldenny.org>
993
994 build: don't require src/bison during bootstrap.
995 Suggested by Eric Blake at
996 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00003.html>.
997 * bootstrap.conf (bootstrap_epilogue): New function to make sure
998 src/parse-gram.[ch] are stamped later than src/parse-gram.y.
999
e0fda26c
JD
10002010-04-25 Joel E. Denny <joeldenny@joeldenny.org>
1001
1002 i18n: fix untranslatable string.
1003 Reported by Goran Uddeborg at
1004 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00000.html>.
1005 * src/muscle-tab.c (muscle_percent_define_insert): Here.
1006
ecbca7db
AD
10072010-04-13 Akim Demaille <demaille@gostai.com>
1008
1009 tests: calc: minor refactoring.
1010 * tests/calc.at (_AT_DATA_CALC_Y): Simplify yylex.
1011
ed228e60
AD
10122010-04-13 Akim Demaille <demaille@gostai.com>
1013
1014 tests: calc: simplify location management.
1015 * tests/local.at (AT_LOC_PUSHDEF, AT_LOC_POPDEF): New.
1016 (_AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS): Use them to
1017 define the appropriate AT_LOC accessors.
1018 * tests/calc.at: Use AT_LOC accessors.
1019
cacfdef7
AD
10202010-04-13 Akim Demaille <demaille@gostai.com>
1021
1022 test location_type.
1023 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS):
1024 Define AT_LOCATION_TYPE_IF.
1025 (_AT_BISON_OPTION_POPDEFS): Undefine AT_LOCATION_TYPE_IF.
1026 * tests/calc.at (_AT_DATA_CALC_Y): When %define location_type is
1027 used, provide a user location type and use it.
1028 (Simple LALR1 C++ Calculator): Add a test case for location_type.
1029
2f61c4a2
AD
10302010-04-13 Akim Demaille <demaille@gostai.com>
1031
1032 tests: check fclose's return value.
1033 * tests/calc.at (_AT_DATA_CALC_Y): Check fclose's return status.
1034
16d9244d
AD
10352010-04-13 Akim Demaille <demaille@gostai.com>
1036
1037 tests: don't depend on the actual location type.
1038 * tests/calc.at: Use yy::parser::location_type rather than
1039 yy::location, since the former is always right, and might point to
1040 another type than the latter.
1041
3e4a253b
AD
10422010-04-13 Akim Demaille <demaille@gostai.com>
1043
1044 formatting changes.
1045 * tests/calc.at: Formatting changes.
1046
df5df58d
AD
10472010-04-13 Akim Demaille <demaille@gostai.com>
1048
1049 lalr1.cc: remove useless forward declaration.
1050 * data/lalr1.cc: Include location.hh before stack.hh.
1051 Remove the useless forward declarations of position and location.
1052 Reported by Chris Morley.
1053 * data/glr.cc: Likewise.
1054
88bb35d6
JD
10552010-04-11 Joel E. Denny <joeldenny@joeldenny.org>
1056
1057 * NEWS (2.4.3): Mention fix for Sun Studio C++.
1058
585ef2eb
JD
10592010-04-10 Joel E. Denny <joeldenny@joeldenny.org>
1060
1061 tests: fix for newer Sun Studio C++.
1062 Reported by Dagobert Michelsen at
1063 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00023.html>.
1064 * THANKS (Dagobert Michelsen): Add.
1065 * configure.ac (AC_PREREQ): Set to 2.64 so we get the latest
1066 Autoconf macro for handling the restrict keyword.
1067 * gnulib: Update to latest, which no longer overrides that macro
1068 from Autoconf.
1069
a005dbcb
JD
10702010-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1071
1072 portability: fix pointer arithmetic to conform to C standard.
1073 Reported by Tys Lefering at
1074 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00035.html>.
1075 This fix is already implemented in glr.c and does not apply to
1076 lalr1.java.
1077 * data/lalr1.cc (yy::parser::parse): Increase size of
1078 yyerror_range and adjust subscripting so you don't have to
1079 subtract one from the beginning of the array.
1080 * data/yacc.c (b4_declare_parser_state_variables,
1081 yyparse, yypush_parse): Likewise.
1082
8a8b33e8
AD
10832010-04-05 Akim Demaille <demaille@gostai.com>
1084
1085 remove useless include.
1086 * src/graphviz.h: Don't include stdbool.h.
1087
a0279765
AD
10882010-04-05 Akim Demaille <demaille@gostai.com>
1089
1090 graph: sign the output file.
1091 * src/graphviz.c (start_graph): Issue comments about Bison.
1092 Suggested by Tys Lefering.
1093
132247cd
JD
10942010-03-31 Joel E. Denny <jdenny@ces.clemson.edu>
1095
1096 portability: fix test suite for GCC 4.5's new #error message.
1097 Reported by Tys Lefering at
1098 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00030.html>.
1099 * NEWS (2.4.3): Mention.
1100 * tests/synclines.at (AT_TEST_SYNCLINE): Implement.
1101
c0259969
AD
11022010-03-30 Akim Demaille <demaille@gostai.com>
1103
1104 fix comments.
1105 * src/graphviz.h: Add missing license notice.
1106 Document.
1107
23761f42
AD
11082010-03-25 Akim Demaille <demaille@gostai.com>
1109
1110 tests: fix 250: parse.error=verbose overflow.
1111 * tests/regression.at (parse.error=verbose overflow): Avoid the
1112 double inclusion of stdlib.h as it triggers hard errors.
1113
9097fda0
JD
11142010-03-23 Joel E. Denny <jdenny@ces.clemson.edu>
1115
1116 portability: fix for BSD make.
1117 Reported by Johan van Selst at
1118 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00016.html>.
1119 * tests/Makefile.am ($(TESTSUITE)): Qualify package.m4 in
1120 this dependency list as in package.m4's target rule.
1121
7a9c3cb3
JD
11222010-03-23 Joel E. Denny <jdenny@ces.clemson.edu>
1123
1124 portability: fix spawning on at least FreeBSD 8 and FreeBSD 9.
1125 Reported by Johan van Selst at
1126 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00014.html>.
1127 * NEWS (2.4.3): New.
1128 * THANKS (Johan van Selst): Add.
1129 * gnulib: Update to latest.
1130
5a3c69f1
JD
11312010-03-20 Joel E. Denny <jdenny@ces.clemson.edu>
1132
1133 maint: update for changes to gnulib's announce-gen.
1134 * HACKING (Announce): RELEASE_TYPE=major must now be written
1135 RELEASE_TYPE=stable.
1136
ea66d039
JD
11372010-03-20 Joel E. Denny <jdenny@ces.clemson.edu>
1138
1139 Version 2.4.2.
1140 * NEWS (2.4.2): Set version and date. For the recent test suite
1141 portability fixes, don't be so optimistic about their success
1142 given the lack of feedback on the affected platforms.
1143
c50befe6
JD
11442010-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
1145
1146 tests: fix maintainer-xml-check for recent changes.
1147 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Use
1148 AT_BISON_CHECK_NO_XML rather than AT_BISON_CHECK because an
1149 output file whose name conflicts with a previous output file
1150 is now never generated.
1151
47fa5747
JD
11522010-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
1153
1154 portability: fix several issues with M4 subprocess.
1155
1156 M4's output pipe was not being drained upon fatal errors during
1157 scan_skel. As a result, broken-pipe messages from M4 were seen
1158 on at least AIX, HP-UX, Solaris, and RHEL4, and this caused a
1159 failure in the test suite. The problem was that, on platforms
1160 where the default disposition for SIGPIPE is ignore instead of
1161 terminate, M4 sometimes saw fwrite fail with errno=EPIPE and
1162 then reported it. However, there's some sort of race condition,
1163 because the new test group occasionally succeeded.
1164 Reported by Albert Chin at
1165 <http://lists.gnu.org/archive/html/bug-bison/2010-02/msg00004.html>.
1166
1167 There were also problems with the test suite livelocking on
1168 Tru64 5.1b. Reported by Didier Godefroy at
1169 <http://lists.gnu.org/archive/html/bug-bison/2009-05/msg00005.html>.
1170 Switching to create_pipe_bidi suggested by Akim Demaille.
1171
1172 To attempt to solve both of these problems, switch to gnulib's
1173 create_pipe_bidi and register M4 process as a slave. Along the
1174 way, clean up file name conflict handling, which was affected by
1175 the broken-pipe problem before the switch.
1176 * NEWS (2.4.2): Document.
1177 * THANKS (Didier Godefroy): Add.
1178 * bootstrap.conf (gnulib_modules): Add pipe.
1179 * gnulib: Update to latest to make sure we have all the latest
1180 fixes.
1181 * lib/Makefile.am (libbison_a_SOURCES): Remove subpipe.h and
1182 subpipe.c.
1183 * po/POTFILES.in (lib/subpipe.c): Remove.
1184 * src/files.c (compute_output_file_names): Update invocations
1185 of output_file_name_check.
1186 (output_file_name_check): In the case that the grammar file
1187 would be overwritten, use complain instead of fatal, but replace
1188 the output file name with /dev/null. Use the /dev/null solution
1189 for the case of two conflicting output files as well because it
1190 seems safer in case Bison one day tries to open both files at
1191 the same time.
1192 * src/files.h (output_file_name_check): Update prototype.
1193 * src/output.c (output_skeleton): Use create_pipe_bidi and
1194 wait_subprocess. Assert that scan_skel completely drains the
1195 pipe.
1196 * src/scan-skel.l (at_directive_perform): Update
1197 output_file_name_check invocation.
1198 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Check that the
1199 grammar file actually isn't overwritten.
1200 (Conflicting output files: -o foo.y): Update expected output.
1201 * tests/skeletons.at (Fatal errors but M4 continues producing
1202 output): New test group.
1203
d67e37a7
JD
12042010-02-04 Joel E. Denny <jdenny@ces.clemson.edu>
1205
1206 Update POTFILES.
1207 * HACKING (Release Procedure): Add reminder about keeping
1208 POTFILES files up-to-date.
1209 * po/POTFILES.in (src/muscle-tab.c, src/scan-skel.l): Add.
1210
0ee1af2e
JD
12112010-02-01 Joel E. Denny <jdenny@clemson.edu>
1212
1213 Code cleanup.
1214 * tests/atlocal.in (abs_top_srcdir): Remove shell variable,
1215 which is already defined in atconfig.
1216
2655c7cd
JD
12172010-01-21 Joel E. Denny <jdenny@clemson.edu>
1218
1219 * cfg.mk (gnulib_dir): Assume gnulib is a subdirectory.
1220
8ebc7dca
JD
12212010-01-21 Joel E. Denny <jdenny@clemson.edu>
1222
1223 maint: automate PACKAGE_COPYRIGHT_YEAR update, and update it.
1224 * HACKING (Release Procedure): Update notes on copyright years.
1225 * Makefile.am (update-package-copyright-year): New target rule.
1226 * build-aux/update-package-copyright-year: New file.
1227 * cfg.mk (update-copyright): Add update-package-copyright-year
1228 as a dependency.
1229
f0a43dd1
JD
12302010-01-19 Joel E. Denny <jdenny@clemson.edu>
1231
1232 * bootstrap: Import improvements from latest gnulib.
1233
e4ca7a85
JD
12342010-01-19 Joel E. Denny <jdenny@clemson.edu>
1235
1236 build: require Automake 1.11.1 to avoid a security flaw.
1237 * HACKING (Release Procedure): Don't document Automake security
1238 flaw here.
1239 * configure.ac (AM_INIT_AUTOMAKE): Require 1.11.1, and explain
1240 why here.
1241
8d830047
JD
12422010-01-19 Joel E. Denny <jdenny@clemson.edu>
1243
1244 gnulib: update to latest.
1245
e5926647
JD
12462010-01-19 Joel E. Denny <jdenny@clemson.edu>
1247
1248 ChangeLog (2006-09-15): add Odd Arild Olsen's role for push.c.
1249
5a2f6eb4
JD
12502010-01-15 Joel E. Denny <jdenny@clemson.edu>
1251
1252 Thank the developer of the initial push parser implementation.
1253 This unfortunate oversight is several years old.
1254 * THANKS (Odd Arild Olsen): Add.
1255
1c4ad777
JD
12562010-01-04 Joel E. Denny <jdenny@clemson.edu>
1257
1258 Fix some comments concerning LR(0) versus LALR(1).
1259
1260 Stop equating LR(0) with nondeterminism and LALR(1) with
1261 determinism. That is, if all states are consistent, then LR(0)
1262 tables are deterministic. On the other hand, LALR(1) tables
1263 might be nondeterministic before conflict resolution, and GLR
1264 permits LALR(1) tables to remain nondeterministic.
1265 * src/LR0.c, src/LR0.h: Here.
1266 * src/lalr.c, src/lalr.h: Here.
1267 * src/main.c (main): Here.
1268 * src/state.c, src/state.h: Here.
1269
1270 * src/ielr.h (ielr): In preconditions, expect LR(0) not LALR(1)
1271 parser tables.
1272
1462fcee
JD
12732010-01-04 Joel E. Denny <jdenny@clemson.edu>
1274
1275 maint: run "make update-copyright"
1276
510df951
JD
12772009-12-30 Joel E. Denny <jdenny@clemson.edu>
1278
1279 POSIX: complain if %prec's token was not defined.
1280 * NEWS (2.5): Document.
1281 * src/reader.c (grammar_rule_check): Convert warning to
1282 complaint.
1283 * tests/input.at (%prec's token must be defined): Update.
1284
2c203528
JD
12852009-12-30 Joel E. Denny <jdenny@clemson.edu>
1286
1287 POSIX: warn if %prec's token was not defined.
1288 Reported by Florian Krohm at
1289 <http://lists.gnu.org/archive/html/bug-bison/2009-12/msg00005.html>.
1290 * NEWS (2.4.2): Document.
1291 * src/reader.c (grammar_rule_check): Implement.
1292 (grammar_current_rule_prec_set): Add comments explaining that we
1293 here assume a %prec identifier is a token, but we still manage
1294 to support POSIX.
1295 * tests/input.at (%prec's token must be defined): New test
1296 group.
1297
a93cdd3d
JD
12982009-12-31 Joel E. Denny <jdenny@clemson.edu>
1299
1300 * HACKING (Release Procedure): Recommend a secure automake.
1301
bb57985c
AD
13022008-12-11 Akim Demaille <demaille@gostai.com>
1303
1304 Propagate i18n changes into glr.c.
1305 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
1306 building the error message format dynamically.
1307 * data/lalr1.java: Formatting changes.
1308
70afaf26
JD
13092009-12-22 Joel E. Denny <jdenny@clemson.edu>
1310
1311 Port small part of master's 11707b2b so future ports are easier.
1312 * data/lalr1.java (YYParser::yysyntax_error): Untabify.
1313
8200219a
AD
13142008-12-11 Akim Demaille <demaille@gostai.com>
1315
1316 Simplify the i18n of the error messages.
1317 * data/lalr1.cc: Comment changes.
1318
39f6a8d1
AD
13192008-11-11 Akim Demaille <demaille@gostai.com>
1320
1321 Prefer M4 to CPP.
1322 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
1323 YYERROR_VERBOSE.
1324
e657f369
AD
13252008-11-11 Akim Demaille <demaille@gostai.com>
1326
1327 Support i18n of the parse error messages.
1328 * TODO (lalr1.cc/I18n): Remove.
1329 * data/lalr1.cc (yysyntax_error_): Support the translation of the
1330 error messages, as done in yacc.c.
1331 Stay within the yy* pseudo namespace.
1332
1e05521d
JD
13332009-12-22 Joel E. Denny <jdenny@clemson.edu>
1334
1335 Port small part of master's 8901f32e so future ports are easier.
1336 * data/lalr1.cc (yy::parser::yysyntax_error_): Always add second
1337 argument, but name it in the function definition only when
1338 verbose error messages are enabled and it'll thus be used.
1339 (yy::parser::parse): Update use of yysyntax_error_.
1340
2728ac7e
JD
13412009-12-29 Joel E. Denny <jdenny@clemson.edu>
1342
1343 portability: `<' and `>' are not always defined on addresses.
1344 Specifically, don't sort objects by their memory addresses when
1345 they're not allocated in the same array or other object. Though
1346 I haven't found a test case where that fails on my platform, C
1347 says the behavior is undefined.
1348 * src/AnnotationList.c (AnnotationList__insertInto): Remove
1349 FIXME. Use new id field of InadequacyList nodes rather than
1350 their memory addresses when sorting.
1351 (AnnotationList__compute_from_inadequacies): Add
1352 inadequacy_list_node_count argument to pass to
1353 InadequacyList__new_conflict.
1354 * src/AnnotationList.h
1355 (AnnotationList__compute_from_inadequacies): Update prototype
1356 and documentation for new argument.
1357 * src/InadequacyList.c (InadequacyList__new_conflict): Add
1358 node_count argument and use it to assign a unique ID.
1359 * src/InadequacyList.h (InadequacyListNodeCount): New typedef.
1360 (InadequacyList): Add id field.
1361 (InadequacyList__new_conflict): Update prototype and
1362 documentation for new argument.
1363 * src/ielr.c (ielr_compute_annotation_lists): Update
1364 AnnotationList__compute_from_inadequacies invocation.
1365
abcc7c03
JD
13662009-12-20 Joel E. Denny <jdenny@clemson.edu>
1367
1368 Fix handling of yychar manipulation in user semantic actions.
1369 The problem was that yacc.c didn't always update the yychar
1370 translation afterwards. However, other skeletons appear to be
1371 fine. glr.c appears to already translate yychar before every
1372 use. lalr1.cc does not define yychar and does not document its
1373 replacement, yyla, for users. It does provide yyclearin, but
1374 that does not manipulate yyla and thus requires no translation
1375 update. In lalr1.java, yychar is out of scope during semantic
1376 actions.
1377 * NEWS (2.5): Document.
1378 * data/yacc.c (YYBACKUP): Don't bother translating yychar into
1379 yytoken here.
1380 (yyparse, yypush_parse): Instead, translate before every use of
1381 yytoken, and add comments explaining this approach.
1382 * tests/actions.at (Destroying lookahead assigned by semantic
1383 action): New test group checking that translation happens before
1384 lookahead destructor calls at parser return. Previously,
1385 incorrect destructors were called.
1386 * tests/conflicts.at (%error-verbose and consistent
1387 errors): New test group checking that translation happens at
1388 syntax error detection before the associated verbose error
1389 message and the associated lookahead destructor calls. While
1390 the destructor call is fixed by this patch, the verbose error
1391 message is currently incorrect due to another bug (see
1392 comments in test group), so this is an expected failure for now.
1393
62efdd2a
JD
13942009-12-21 Joel E. Denny <jdenny@clemson.edu>
1395
1396 YYFAIL: warn about uses and remove from lalr1.java.
1397 * NEWS (2.5): Document.
5f1485d8 1398 * data/lalr1.java (YYParser::YYFAIL): Rename to YYERRLAB,
62efdd2a
JD
1399 and make it private. Update all uses.
1400 * src/scan-code.l (SC_RULE_ACTION): Implement warning.
1401
41d35e54
JD
14022009-12-21 Joel E. Denny <jdenny@clemson.edu>
1403
1404 YYFAIL: deprecate.
1405 * NEWS (2.4.2): Document deprecation and the phase-out plan.
5f1485d8 1406 * data/lalr1.java (YYParser::YYFAIL): Add comment about
41d35e54
JD
1407 deprecation.
1408 * data/yacc.c (YYFAIL): Likewise, and suppress warnings about
1409 YYFAIL from GCC cpp's -Wunused-macros.
1410 * doc/bison.texinfo (Java Action Features): Remove YYFAIL
1411 documentation.
1412 (LocalWords): Remove YYFAIL.
1413
692d04cb
JD
14142009-12-17 Joel E. Denny <jdenny@clemson.edu>
1415
1416 Code cleanup.
1417 * src/symtab.c, src/symtab.h (symbol_class_get_string): Remove
1418 function, which is no longer used.
1419
34731471
JD
14202009-12-16 Joel E. Denny <jdenny@clemson.edu>
1421
1422 Add gcc's -Wundef to test suite and fix another warning from it.
1423 * NEWS (2.4.2): Update description of -Wundef fix.
1424 * configure.ac (WARN_CXXFLAGS_TEST): New substitution.
1425 (WARN_CFLAGS_TEST): New substitution.
1426 * data/glr.c: Avoid warning about __STRICT_ANSI__.
1427 * tests/atlocal.in (CFLAGS): Use WARN_CFLAGS_TEST instead of
1428 WARN_CFLAGS.
1429 (NO_WERROR_CFLAGS): Likewise.
1430 (CXXFLAGS): Use WARN_CXXFLAGS_TEST instead of WARN_CXXFLAGS.
1431
3bba2dad
JD
14322009-12-16 Joel E. Denny <jdenny@clemson.edu>
1433
1434 * data/yacc.c: Reformat m4 a little.
1435
af2ffe5c
JD
14362009-12-16 Joel E. Denny <jdenny@clemson.edu>
1437
1438 Document gcc -Wundef fix.
1439 * NEWS (2.4.2): Here.
1440 * THANKS (Jonathan Nieder): Add.
1441
874ac415
JN
14422009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
1443
1444 Simplify y.tab.c when location tracking is disabled.
1445 * data/yacc.c: Do not check YYLTYPE_IS_TRIVIAL if location
1446 tracking is not enabled. Instead, unconditionally define
1447 YY_LOCATION_PRINT as a no-op for backward compatibility.
1448
06caf0e1
JN
14492009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
1450
1451 Avoid warnings from gcc -Wundef y.tab.c.
1452 * data/glr.c: Check if YYENABLE_NLS and YYLTYPE_IS_TRIVIAL are
1453 defined before using them.
1454 * data/lalr1.cc: Likewise.
1455 * data/yacc.c: Likewise.
1456
687f011a
JD
14572009-12-15 Joel E. Denny <jdenny@clemson.edu>
1458
1459 autoconf: update to latest for fix of M4 detection.
1460 Reported by Eric Blake.
1461 * submodules/autoconf: Update.
1462
fb9a3976
JD
14632009-12-15 Joel E. Denny <jdenny@clemson.edu>
1464
1465 portability: use -DGNULIB_POSIXCHECK.
1466 Reported by Eric Blake. See discussions at
1467 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00008.html>
1468 and
1469 <http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00108.html>.
1470 * HACKING (Release checks): Suggest -DGNULIB_POSIXCHECK.
1471 * bootstrap.conf (gnulib_modules): Add all the printf modules
1472 suggested by -DGNULIB_POSIXCHECK. Add realloc-posix as
1473 suggested by -DGNULIB_POSIXCHECK for gnulib's own vasnprintf.c.
1474 (excluded_files): Remove m4/printf-posix.m4.
1475 * tests/atlocal.in (LIBS): As for LDADD in src/local.mk, add
1476 lib/libbison.a so gnulib libraries can be linked.
1477
f1fb412c
JD
14782009-12-14 Joel E. Denny <jdenny@clemson.edu>
1479
1480 Enable assertion output and --disable-assert for configure.
1481 * bootstrap.conf (gnulib_modules): Add assert module.
1482 * src/system.h (aver): Define as assert, and summarize the
1483 discussion on this issue.
1484
51c7ca01
JD
14852009-12-14 Joel E. Denny <jdenny@clemson.edu>
1486
1487 Expand GLR acronym in summary of Bison.
1488 Based on discussion with Akim Demaille starting at
1489 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00087.html>.
1490 * doc/bison.texinfo (Introduction): Here.
1491 * src/getargs.c (usage): Here.
1492
1f68dca5
AR
14932009-10-03 Alex Rozenman <rozenman@gmail.com>
1494
1495 Document named references.
1496 * doc/bison.texinfo (Actions): Add new example and xref to
1497 Using Named References node.
1498 (Using Named References): New node.
1499
aa01d193
JD
15002009-10-16 Joel E. Denny <jdenny@clemson.edu>
1501
1502 cleanup.
1503 * src/Sbitset.c (Sbitset__new_on_obstack): Use Sbitset instead
1504 of char*.
1505 (Sbitset__isEmpty): Use Sbitset instead of char*.
1506 * src/Sbitset.h (Sbitset): Make it a pointer to unsigned char
1507 instead of char. This helps to avoid casting errors.
1508 (Sbitset__or): Use Sbitset instead of char*.
1509
61747047
JD
15102009-10-16 Joel E. Denny <jdenny@clemson.edu>
1511
1512 portability: don't assume 8-bit bytes.
1513 That is, use CHAR_BIT and UCHAR_MAX instead of 8 and 0xff.
1514 * src/Sbitset.h (Sbitset__nbytes): Here.
1515 (Sbitset__byteAddress): Here.
1516 (Sbitset__bit_mask): Here.
1517 (Sbitset__last_byte_mask): Here.
1518 (Sbitset__ones): Here.
1519 (SBITSET__FOR_EACH): Here.
1520
a70596de
JD
15212009-10-11 Joel E. Denny <jdenny@clemson.edu>
1522
1523 portability: use va_start and va_end in the same function.
1524 * src/complain.c (error_message): Move va_end from here...
1525 (ERROR_MESSAGE): ... to here.
1526
51f255a5
JD
15272009-10-08 Joel E. Denny <jdenny@clemson.edu>
1528
1529 * data/bison.m4: Update comments for rename to muscle-tab.h.
1530
23ec25b7
JD
15312009-10-08 Joel E. Denny <jdenny@clemson.edu>
1532
1533 Rename muscle_tab.* to muscle-tab.* for consistency with master.
1534 * src/Makefile.am (bison_SOURCES): Update.
1535 * src/getargs.c, src/ielr.c, src/lalr.c, src/main.c,
1536 src/output.c, src/parse-gram.y, src/print.c, src/reader.c,
1537 src/tables.c: Update include.
1538 * src/muscle_tab.c, src/muscle_tab.h: Rename to...
1539 * src/muscle-tab.c, src/muscle-tab.h: ... these and update
1540 include.
1541
0ab402b4
JD
15422009-10-07 Joel E. Denny <jdenny@clemson.edu>
1543
1544 Minor code cleanup.
1545 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT): Remove macro and
1546 replace all uses with UNIQSTR_CONCAT.
1547 * src/uniqstr.c (uniqstr_vsprintf): New function.
1548 * src/uniqstr.h (uniqstr_vsprintf): Add prototype.
1549 (UNIQSTR_CONCAT, UNIQSTR_GEN_FORMAT, UNIQSTR_GEN_FORMAT_): New
1550 macros.
1551
42ec0ae1
JD
15522009-10-04 Joel E. Denny <jdenny@clemson.edu>
1553
1554 Minor code cleanup.
1555 * src/parse-gram.y: Clean up sorting of declarations.
1556 Use types to simplify %printer declarations where possible.
1557 Provide %printer for BRACKETED_ID and symbol.prec.
1558 * src/symtab.c: Whitespace change.
1559
9637e0ed
JD
15602009-10-04 Joel E. Denny <jdenny@clemson.edu>
1561
1562 tests: skip tests of file names that platform does not support.
1563 Reported by Michael Raskin at
1564 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00001.html>.
1565 * THANKS (Michael Raskin): Add.
1566 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Fix. Cygwin used
1567 to fail at least for file names containing ":" or "\".
1568
69a2ab11
JD
15692009-09-23 Joel E. Denny <jdenny@clemson.edu>
1570
1571 yysyntax_error: avoid duplicate lookahead collection.
1572 Except when memory reallocation is required, this change
1573 eliminates the need to invoke yysyntax_error twice and thus to
1574 repeat the collection of lookaheads. It also prepares for
1575 future extensions that will make those repetitions more
1576 expensive and that will require additional memory management in
1577 yysyntax_error. Finally, it fixes an obscure bug already
1578 exercised in the test suite.
1579 * data/yacc.c (yysyntax_error): Add arguments for message
1580 buffer variables stored in the parser. Instead of size, return
1581 status similar to yyparse status but indicating success of
1582 message creation. Other than the actual reallocation of the
1583 message buffer, import and clean up memory management code
1584 from...
1585 (yyparse, yypush_parse): ... here.
1586 * tests/regression.at (%error-verbose overflow): No longer an
1587 expected failure.
1588
d88cf117
JD
15892009-09-23 Joel E. Denny <jdenny@clemson.edu>
1590
1591 yysyntax_error: test memory management more.
1592 * tests/atlocal.in (NO_WERROR_CFLAGS): New cpp macro.
1593 * tests/regression.at (%error-verbose and YYSTACK_USE_ALLOCA):
1594 New test group.
1595 (%error-verbose overflow): New test group that reveals an
1596 obscure bug. Expected fail for now.
1597
9da640ea
AD
15982008-12-11 Akim Demaille <demaille@gostai.com>
1599
1600 Pass the token type to yysyntax_error.
1601 * data/yacc.c (yysyntax_error): Take the transated token instead
1602 of the raw number.
1603 Adjust callers.
1604
d3d3628b
AD
16052008-12-11 Akim Demaille <demaille@gostai.com>
1606
1607 Simplify the i18n of the error messages.
1608 * data/yacc.c (yysyntax_error): Rewrite, using a switch instead
1609 of building dynamically the format string.
1610
4c6b13f3
JD
16112009-10-03 Joel E. Denny <jdenny@clemson.edu>
1612
1613 Remove dead code.
1614 * src/symtab.c (symbol_pack): Here because every symbol's number
1615 is always defined by this time.
1616
f840c05a
AR
16172009-10-03 Alex Rozenman <rozenman@gmail.com>
1618
1619 Add additional space after periods in NEWS.
1620 * NEWS (2.5): here.
1621
17a407dc
JD
16222009-09-29 Joel E. Denny <jdenny@clemson.edu>
1623
1624 Use the correct conversion specifier for size_t.
1625 Reported by Jim Meyering.
1626 * src/Sbitset.h (SBITSET__INDEX__CONVERSION_SPEC): New, "zu"
1627 because Sbitset__Index is size_t.
1628 * src/Sbitset.c (Sbitset__fprint): Use it instead of %d.
1629
4b7a4c1b
JD
16302009-09-27 Joel E. Denny <jdenny@clemson.edu>
1631
1632 tests: don't abuse AT_BISON_CHECK.
1633 * tests/regression.at (parse-gram.y: LALR = IELR): Move
1634 additional shell commands outside of AT_BISON_CHECK.
1635
873ac263
JD
16362009-09-26 Joel E. Denny <jdenny@clemson.edu>
1637
1638 tests: check that parse-gram.y's IELR and LALR are identical.
1639 * tests/atlocal.in (abs_top_srcdir): New shell variable.
1640 * tests/regression.at (parse-gram.y: LALR = IELR): New test
1641 group.
1642
232be91a
AD
16432009-09-16 Akim Demaille <demaille@gostai.com>
1644
1645 doc: comment changes.
1646 * doc/bison.texinfo: Comment changes.
1647
c781580d
AD
16482009-09-16 Akim Demaille <demaille@gostai.com>
1649
1650 doc: spell checking.
1651 * doc/bison.texinfo: here.
1652
348f5608
AR
16532009-09-19 Alex Rozenman <rozenman@gmail.com>
1654
1655 Keep sub-messages aligned. Fix strings for translation.
f840c05a
AR
1656 * src/location.h (location_print): Add return value.
1657 * src/location.c (location_print): Return number of printed
348f5608 1658 characters.
f840c05a
AR
1659 * src/complain.h (complain_at_indent, warn_at_indent): Prototype
1660 new functions.
1661 * src/complain.cpp (indent_ptr): New static variable.
1662 (error_message, complain_at_indent, warn_at_indent): Implement
1663 the alignment mechanism.
1664 * src/scan-code.l (parse_ref, show_sub_messages): Fix strings
1665 for translations. Use new alignment mechanism.
1666 * tests/named-ref.at: Adjust test-cases.
348f5608
AR
1667 * NEWS (2.5): Add an announcement about named references.
1668
d93b5f50
JD
16692009-09-13 Joel E. Denny <jdenny@clemson.edu>
1670
1671 tests: clean up push.at test group titles.
1672 * tests/push.at: Remove "Push Parsing: " from test group titles
1673 because these are already under the banner "Push Parsing Tests".
1674
4c56b131
AR
16752009-09-12 Alex Rozenman <rozenman@gmail.com>
1676
1677 Provide an additional sub-message for clarity.
1678 Add "symbol not found in production" error message when
1679 an "invalid reference" is detected in named references
1680 resolution.
1681 * src/scan-code.l: Update "invalid reference" case.
1682 * tests/named-ref.at: Adjust test-cases.
1683
93d0103d
JD
16842009-09-10 Joel E. Denny <jdenny@clemson.edu>
1685
1686 Clean up yacc.c a little.
1687 * data/yacc.c: Clean up M4 for readability, and make output
1688 whitespace more consistent. For the main parse function
1689 comment, instead of saying "yyparse or yypush_parse", say either
1690 "yyparse" or "yypush_parse" depending on which it actually is.
1691
628be6c9
JD
16922009-09-03 Joel E. Denny <jdenny@clemson.edu>
1693
1694 Complain about unused %define variables and %code qualifiers.
1695 * NEWS (2.5): Document.
1696 * data/bison.m4 (b4_check_user_names): Complain instead of warn.
1697 * doc/bison.texinfo (Decl Summary): Document complaint, and
1698 improve %define documentation a little otherwise.
1699 * tests/input.at (Reject unused %code qualifiers): Update.
1700 (%define errors): Update.
1701 (%define, --define, --force-define): Update.
1702 (%define backward compatibility): Update.
1703 (Unused %define api.pure): Update.
1704 * tests/push.at (Push Parsing: Unsupported Skeletons): Update.
1705
c842365a
JD
17062009-09-03 Joel E. Denny <jdenny@clemson.edu>
1707
1708 Use aver not assert.
1709 * src/output.c: Don't include assert.h.
1710 (output_skeleton): Use aver not assert.
1711 * src/system.h (aver): In documentation of why, add links to
1712 Paul Eggert's explanations in the mailing lists.
1713
14e568d7
AR
17142009-09-05 Alex Rozenman <rozenman@gmail.com>
1715
1716 Use "Unresolved reference" error message when no symbols were found
1717 in a symbolic reference resolution. Remove .expr and -expr from
1718 the shown reference when the reference is unresolved.
1719 * src/scan-code.l: Change the error message, adjust location columns,
1720 rename variable "exact_mode" to "explicit_bracketing".
1721 * tests/named-ref.at: Adjust existing tests and add a new one.
1722
dac8cc0d
AD
17232009-09-03 Akim Demaille <demaille@gostai.com>
1724
1725 * NEWS (2.4.2): Add "Internationalization" item.
1726
3710dd02
AD
17272009-09-03 Akim Demaille <demaille@gostai.com>
1728
1729 bootstrap: fix/improve find_tool.
1730 * bootstrap (find_tool): Improve error messages.
1731 Fix typo about find_tool_names.
1732
9852b61c
JD
17332009-08-29 Joel E. Denny <jdenny@clemson.edu>
1734
1735 Fix gcc 3.4.4 shadowing warning reported by Eric Blake.
1736 See
1737 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00093.html>.
1738 * src/scan-code.h (code_props_rule_action_init): Rename
1739 named_ref arg to name so it doesn't shadow named_ref type. This
1740 makes it consistent with the function definition in scan-code.l
1741 anyway.
1742
f37495f6
JD
17432009-08-28 Joel E. Denny <jdenny@clemson.edu>
1744
1745 %define: accept unquoted values.
1746 * NEWS (2.5): Group all %define changes together, and document
1747 this one. Remove quotes in IELR and canonical LR entry.
1748 * doc/bison.texinfo: Remove quotes in most examples throughout.
1749 (Decl Summary): Update %define documentation.
1750 (Table of Symbols): Likewise.
1751 * src/ielr.c (LrType): Update documentation.
1752 * src/parse-gram.y (content.opt): Add production for ID.
5bf2bf7a 1753 * tests/calc.at: Remove quotes in most tests.
f37495f6
JD
1754 * tests/existing.at: Likewise.
1755 * tests/input.at: Likewise.
1756 * tests/local.at: Likewise.
1757 * tests/push.at: Likewise.
1758 * tests/reduce.at: Likewise.
1759 * tests/torture.at: Likewise.
1760
3a414bbf
JD
17612009-08-28 Joel E. Denny <jdenny@clemson.edu>
1762
1763 %define lr.type: make values lowercase IDs.
1764 That is, "LALR" => "lalr", "IELR" => "ielr", and
1765 "canonical LR" => "canonical-lr".
1766 * NEWS (2.5): Update documentation.
1767 * doc/bison.texinfo (Decl Summary): Likewise.
1768 * src/ielr.c (ielr): Use new values.
1769 * src/ielr.h (ielr): Update documentation.
1770 * src/reader.c (prepare_percent_define_front_end_variables): Use
1771 and validate new values.
1772 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): Update test
1773 grammars.
1774 * tests/reduce.at (AT_TEST_LR_TYPE): Likewise.
1775
4bb975e1
EB
17762009-08-27 Eric Blake <ebb9@byu.net>
1777
1778 scan-gram: avoid portability trap with ctype usage.
1779 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
1780 Avoid compiler warning.
1781
74baf5c9
JD
17822009-08-27 Joel E. Denny <jdenny@clemson.edu>
1783
1784 tests: use perl for printing special sequences to files.
1785 And skip tests if perl is not available. This is better than
1786 playing tricks with shell portability. Suggested by Akim
1787 Demaille.
1788 * tests/input.at (Bad character literals): Use it here for
1789 omitting final newlines.
1790 (Bad escapes in literals): Use it here for special characters.
1791
d63e1279
JD
17922009-08-26 Joel E. Denny <jdenny@clemson.edu>
1793
1794 tests: show a use of %define lr.default-reductions "consistent"
1795 * tests/conflicts.at (%nonassoc and eof): Extend to test that it
1796 prevents the omission of expected tokens for %error-verbose.
1797
833d1720
AD
17982009-08-26 Akim Demaille <demaille@gostai.com>
1799
1800 tests: portability fix.
1801 * tests/input.at (Bad escapes in literals): Don't expect "echo
1802 '\0'" to output \ then 0.
1803
e4bcae3c
JD
18042009-08-26 Joel E. Denny <jdenny@clemson.edu>
1805
1806 Actually handle the yytable zero value correctly this time.
1807 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c: Don't
1808 mention zero values in the YYTABLE comments.
1809 * data/glr.c (yytable_value_is_error): Don't check for zero
1810 value.
1811 * data/lalr1.cc (yy_table_value_is_error_): Likewise.
1812 * data/yacc.c (yytable_value_is_error): Likewise.
1813 * data/lalr1.java (yy_table_value_is_error_): Likewise.
1814 (yysyntax_error): Fix typo in code: use yytable_ not yycheck_.
1815 * src/tables.h: In header comments, explain why it's useless to
1816 check for a zero value in yytable.
1817
d5eb0826
JD
18182009-08-25 Joel E. Denny <jdenny@clemson.edu>
1819
1820 More fixes related to last two patches.
1821 * data/c.m4 (b4_table_value_equals): Comment that YYID must be
1822 defined.
1823 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c: Fix
1824 yytable comments: zero indicates syntax error not default
1825 action.
1826 * data/glr.c (yyis_pact_ninf): Rename to...
1827 (yypact_value_is_default): ... this.
1828 (yyisDefaultedState): Update for rename.
1829 (yyis_table_ninf): Rename to...
1830 (yytable_value_is_error): ... this, and check for value zero
1831 besides just YYTABLE_NINF.
1832 (yygetLRActions): Check for default value from yypact. It
1833 appears that this check is always performed before this function
1834 is invoked, and so adding the check here is probably redundant.
1835 However, the code may evolve after this subtlety is forgotten.
1836 Also, update for rename to yytable_value_is_error. Because that
1837 macro now checks for zero, a different but equivalent branch of
1838 the if-then-else here is evaluated.
1839 (yyreportSyntaxError): Update for rename to
1840 yytable_value_is_error. The zero condition was mishandled
1841 before.
1842 (yyrecoverSyntaxError): Update for renames. No behavioral
1843 changes.
1844 * data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_):
1845 New function.
1846 (yy_table_value_is_error_): New function.
1847 (parse): Use new functions where possible. No behavioral
1848 changes.
1849 (yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_.
1850 The zero condition was mishandled before.
1851 * data/yacc.c (yyis_pact_ninf): Rename to...
1852 (yypact_value_is_default): ... this.
1853 (yyis_table_ninf): Rename to...
1854 (yytable_value_is_error): ... this, and check for value zero
1855 besides just YYTABLE_NINF.
1856 (yysyntax_error): Update for rename to yytable_value_is_error.
1857 The zero condition was mishandled before.
1858 (yyparse): Update for renames. No behavioral changes.
1859 * src/tables.h: Improve comments about yypact, yytable, etc.
1860 more. Most importantly, say yytable value of zero means syntax
1861 error not default action.
1862
1fa30307
JD
18632009-08-25 Joel E. Denny <jdenny@clemson.edu>
1864
1865 Fix %error-verbose for conflicts resolved by %nonassoc.
1866 * NEWS (2.5): Document.
1867 * data/glr.c (yyreportSyntaxError): Fix this by checking
1868 yyis_table_ninf.
1869 * data/yacc.c (yysyntax_error): Likewise.
1870 * data/lalr1.cc (yysyntax_error_): Fix this by checking
1871 yytable_ninf_.
1872 * data/lalr1.java (yysyntax_error): Likewise.
1873 * tests/conflicts.at (%nonassoc and eof): Update expected output
1874 and remove FIXME.
1875
77373efa
JD
18762009-08-25 Joel E. Denny <jdenny@clemson.edu>
1877
1878 Some code and documentation improvements.
1879 * data/c.m4 (b4_table_value_equals): New macro to capture
1880 some repeated code.
1881 * data/glr.c (yyis_pact_ninf): Use it here.
1882 (yyis_table_ninf): Likewise.
1883 (yyreportSyntaxError): Improve internal comments.
1884 * data/yacc.c (yyis_pact_ninf): New macro copied from glr.c.
1885 Use it everywhere possible.
1886 (yyis_table_ninf): Likewise.
1887 (yysyntax_error): Improve internal comments.
1888 * data/lalr1.cc (yysyntax_error_): Likewise.
1889 * data/lalr1.java (yysyntax_error): Likewise.
1890 * src/tables.h: Improve comments about yypact, yytable, etc.
1891
890ab17c
JD
18922009-08-21 Joel E. Denny <jdenny@clemson.edu>
1893
1894 Use locale when quoting.
1895 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
1896 quote rather than implementing quoting here.
1897
c5196098
EB
18982009-08-20 Eric Blake <ebb9@byu.net>
1899
aa50ba7b
EB
1900 Make previous patch more robust.
1901 * src/output.c (ARRAY_CARDINALITY): New macro, copied from
1902 argmatch.h.
1903 (output_skeleton): Use it.
1904 Suggested by Akim Demaille.
1905
c5196098
EB
1906 Import latest m4/m4.m4.
1907 * submodules/autoconf: Update to autoconf 2.64.
1908 * configure.ac (M4_GNU_OPTION): New define.
1909 * src/output.c (output_skeleton): Use it to resolve FIXME.
1910 * NEWS: Mention this.
1911
39fb7e62
JD
19122009-08-19 Joel E. Denny <jdenny@clemson.edu>
1913
1914 Fix complaints about escape sequences.
1915 Discussed starting at
1916 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
1917 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
1918 For a \0 and similar escape sequences meaning the null
1919 character, report an invalid escape sequence instead of an
1920 invalid null character because the latter does not actually
1921 appear in the user's input.
1922 In all escape sequence complaints, don't escape the initial
1923 backslash, and don't quote when the sequence appears at the end
1924 of the complaint line unless there's whitespace that quotearg
1925 won't escape.
1926 Consistently say "invalid" not "unrecognized".
1927 Consistently prefer "empty character literal" over "extra
1928 characters in character literal" warning for invalid escape
1929 sequences; that is, consistently discard those sequences.
1930 * tests/input.at (Bad escapes in literals): New.
1931
c33bc800
AD
19322009-08-19 Akim Demaille <demaille@gostai.com>
1933
1934 doc: fixes.
1935 * doc/bison.texinfo: Fix minor Texinfo errors.
1936
8fbbeba2
AD
19372009-08-19 Akim Demaille <demaille@gostai.com>
1938
1939 doc: %initial-action to initialize yylloc.
1940 Reported by Bill Allombert.
1941 * doc/bison.texinfo: Set fill-column to 76.
1942 (Location Type): Document the use of %initial-action to initialize
1943 yylloc.
1944
1874a474
JD
19452009-08-18 Joel E. Denny <jdenny@clemson.edu>
1946
1947 maint: update for gnulib's recent update-copyright changes
1948 * gnulib: Update.
1949 * .x-update-copyright (COPYING): Add as it's no longer implied
1950 when .x-update-copyright is present.
1951 * cfg.mk (update-copyright-local): Remove, now ignored.
1952 (update-copyright): Declare update-b4-copyright as a dependency.
1953
f4bfd5a9
AD
19542009-08-17 Akim Demaille <demaille@gostai.com>
1955
1956 build: require gettext 0.17.
1957
1958 Suggested by Bruno Haible.
1959 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
1960 * configure.ac: require gettext 0.17 to ensure compatibility with
1961 gnulib.
1962
2509eba6
AD
19632009-08-17 Akim Demaille <demaille@gostai.com>
1964
1965 build: lower gettext requirements.
1966
1967 Bison was uselessly requiring the formatstring macros from
1968 gettext, which resulted in mo files not being installed on systems
1969 that perfectly supported Bison mo files. Lower the requirement.
1970 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
1971
aa50ba7b
EB
1972 * configure.ac: Require need-ngettext instead of
1973 need-formatstring-macros.
1974 Reported by Martin Jabocs.
1975 Suggested by Bruno Haible.
1976 * INSTALL: Restructure.
1977 (Internationalization): New.
2509eba6 1978
314542f9
JD
19792009-08-14 Joel E. Denny <jdenny@clemson.edu>
1980
1981 maint: fix use of copyright year intervals.
1982 * gnulib: Update.
1983 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
1984 as now recommended in gnulib/NEWS.
1985 * build-aux/update-b4-copyright: Fix.
1986 * cfg.mk (update-copyright-env): Configure update-copyright.
1987
24985964
JD
19882009-08-13 Joel E. Denny <jdenny@clemson.edu>
1989
1990 Make it easier to write deterministic tests.
1991 Continues Akim's work from his 2009-06-10 commits.
1992 * src/reader.c (check_and_convert_grammar): Don't add any
1993 symbols after the first symbols_do invocation.
1994 * src/symtab.c (symbols_sorted): New static global.
1995 (user_token_number_redeclaration): Update comments.
1996 (symbol_from_uniqstr): If a new symbol is being created, assert
1997 that symbols_sorted hasn't been allocated yet.
1998 (symbols_free): Free symbols_sorted.
1999 (symbols_cmp, symbols_cmp_qsort): New functions.
2000 (symbols_do): Sort symbol_table into symbols_sorted on first
2001 invocation.
2002 * tests/input.at (Numbered tokens): Recombine tests now that the
2003 output should be deterministic across multiple numbers.
2004
47076da5
AD
20052009-08-12 Akim Demaille <demaille@gostai.com>
2006
2007 distcheck: fix.
2008
aa50ba7b 2009 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
47076da5 2010
36dfe466
JD
20112009-08-10 Joel E. Denny <jdenny@clemson.edu>
2012
2013 * tests/Makefile.am (TESTSUITE_AT): Add named-refs.at.
2014
07c0db18
JD
20152009-08-10 Joel E. Denny <jdenny@clemson.edu>
2016
2017 Miscellaneous code readability improvements.
2018
2019 * src/reader.c (reader): Move %define front-end variable
2020 defaults and checking into...
2021 (prepare_percent_define_front_end_variables): ... this new
2022 function.
2023
2024 * src/scan-gram.l (INITIAL): For consistency with string
2025 literals, don't store open quote on character literal. It's
2026 discarded before returning anyway.
2027 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
2028 Make length test more readable, and make the character stored
2029 for an empty literal more obvious while consistent with the
2030 previous behavior.
2031
2032 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
2033 USER_NUMBER_HAS_STRING_ALIAS throughout.
2034 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
2035 that is repeated in symtab.h. Improve argument names to make it
2036 clear which side of the symbol-string alias pair is which.
2037 (symbol_check_alias_consistency): Improve local variable names
2038 for the same purpose.
2039 * src/symtab.h (struct symbol): Make comments about aliases
2040 clearer.
2041 (symbol_make_alias): Improve comments and argument name.
2042 * src/output.c (token_definitions_output): Update for rename to
2043 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
2044
1a323c2f
AR
20452009-08-08 Alex Rozenman <rozenman@gmail.com>
2046
2047 Convert "misleading reference" messages to warnings.
2048 * src/scan-code.l: New function 'show_sub_messages', more
2049 factoring.
2050 * tests/named-ref.at: Adjust tests.
2051
38609c34
JD
20522009-08-06 Joel E. Denny <jdenny@clemson.edu>
2053
2054 maint: run "make update-copyright"
2055
642f240e
JD
20562009-08-06 Joel E. Denny <jdenny@clemson.edu>
2057
2058 maint: make update-b4-copyright easier to use
2059 * build-aux/update-b4-copyright: In warnings, report line
2060 numbers rather than character positions.
2061 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
2062 that update-copyright runs it.
2063 * gnulib: Update.
2064
d0caad01
JD
20652009-08-05 Joel E. Denny <jdenny@clemson.edu>
2066
2067 maint: clean up update-b4-copyright code
2068 * build-aux/update-b4-copyright: Do not accept 2-digit
2069 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
2070 Don't accept a `[' in a b4_copyright argument.
2071 Format code more consistently.
2072 Don't assume b4*copyright never occurs.
2073
ac2def56
JD
20742009-08-04 Joel E. Denny <jdenny@clemson.edu>
2075
2076 maint: automate b4_copyright updates.
2077 * Makefile.am (update-b4-copyright): New target rule.
2078 * build-aux/Makefile.am (EXTRA_DIST): Add update-b4-copyright.
2079 * build-aux/update-b4-copyright: New.
2080 * data/yacc.c: Remove stray characters around b4_copyright
2081 invocations.
2082
dbbb64f0
JD
20832009-08-04 Joel E. Denny <jdenny@clemson.edu>
2084
2085 maint: automate annual package-wide copyright-year update.
2086 * .x-update-copyright: New.
2087 * Makefile.am (EXTRA_DIST): Remove maint.mk.
2088 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
2089 update-copyright. Remove gnumakefile, which is implied by
2090 maintainer-makefile.
2091 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
2092 * gnulib: Update.
2093 * maint.mk: Remove, now copied from gnulib.
2094 * examples/extexi: Add missing "(C)" in copyright statement so
2095 update-copyright can recognize it.
2096 * src/LR0.h: Likewise.
2097 * src/print.h: Likewise.
2098 * src/print_graph.h: Likewise.
2099 * src/gram.c: Add missing comma in copyright statement.
2100 * src/gram.h: Likewise.
2101
bfa018d4
JD
21022009-08-04 Joel E. Denny <jdenny@clemson.edu>
2103
2104 Fix "make distcheck".
2105 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
2106 of just calc.stamp.
2107
4521fcdf
JD
21082009-08-01 Joel E. Denny <jdenny@clemson.edu>
2109
2110 Pacify "gcc -Wunused" for the input function from Flex.
2111 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
2112 and later.
2113 * src/scan-code.l: Add "%option noinput", which I cannot find in
2114 the Flex manual, but which Flex has supported since at least as
2115 far back as 2.5.4. However, if any of our developers still use
2116 Flex 2.5.4, they'll need to stop configuring with
2117 --enable-gcc-warnings because "%option noinput" didn't work
2118 correctly until Flex 2.5.6.
2119 * src/scan-gram.l: Likewise.
2120 * src/scan-skel.l: Likewise.
2121
992e874a
AR
21222009-07-31 Alex Rozenman <rozenman@gmail.com>
2123
2124 Fix --enable-gcc-warnings problems.
2125 * src/reader.c: Adjust variable names.
2126 * src/scan-code.l: Fix prototypes and adjust names.
2127 * src/named-ref.c: Remove redundant "if".
2128
a1ed2b71
JD
21292009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
2130
2131 Fix a --enable-gcc-warnings problem.
2132 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
2133 variable.
2134
cbc6a70e 21352009-07-24 Alex Rozenman <rozenman@gmail.com>
1e20ad11
AR
2136
2137 Fix some memory leaks.
2138 * src/named-ref.c: Add a pointer check (named_ref_free).
2139 * src/scan-code.l: New function (variant_table_free). Called in
2140 code_scanner_free.
2141 * src/symlist.c: Call to named_ref_free (symbol_list_free).
2142
ac9b0e95
JD
21432009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
2144
2145 Warn about character literals not of length one.
2146 * NEWS (2.5): Document.
2147 * src/scan-gram.l (INITIAL): Remove comment that we don't check
2148 the length.
2149 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
2150 * tests/input.at (Bad character literals): New test group.
2151
2de160e1
JD
21522009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
2153
2154 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
2155
cba97506
JD
21562009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
2157
2158 Some M4 cleanup in the testsuite.
2159 Suggested by Eric Blake at
2160 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
2161 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
2162 complicate the code by distinguishing between a missing value
2163 and an empty string value for an optional argument. This fix is
2164 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
2165 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
2166 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
2167 arguments are not needed because of the following changes.
2168 Fix stale comments.
2169 Bison developers should use GNU M4 and should not use
2170 POSIXLY_CORRECT when building the test suite, so do not
2171 complicate the code by avoiding $10 and above.
2172 Do not quote an empty string value for an optional argument, and
2173 do not distinguish between a missing value and an empty string
2174 value.
2175
62eb2d1b
JD
21762009-07-21 Joel E. Denny <jdenny@ces.clemson.edu>
2177
2178 * m4/m4.m4: Make it a sym link to submodules/autoconf/m4/m4.m4.
2179
620b2e36
JD
21802009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
2181
2182 Revert unnecessary column realignment in --help output.
2183 Reported by Akim Demaille at
2184 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
2185 * src/getargs.c (usage): Here.
2186
cbc6a70e 21872009-07-04 Alex Rozenman <rozenman@gmail.com>
dad6544d
AR
2188
2189 Alphabetical order in src/Makefile.am.
2190 * src/Makefile.am: Adjust.
2191
cbc6a70e 21922009-07-04 Alex Rozenman <rozenman@gmail.com>
d5e8574b
AR
2193
2194 Style changes and factoring.
2195 * src/named-ref.h: Add comments.
2196 * src/parse-gram.y: Readability and style changes.
2197 * src/reader.c: Factoring: assign_named_ref function.
2198 * src/scan-code.l: Factoring and style changes. Rename
2199 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
2200 Use "unsigned" type for variant index. Improve readablity.
2201 * src/scan-gram.l: Change error messages and add comments.
2202 * src/symlist.h: symbol_list_null: New function decl.
2203 * src/symlist.c: symbol_list_null: Implement here.
2204 * tests/named-refs.at: Adjust for new error messages.
2205
ae09ec85
EB
22062009-06-29 Eric Blake <ebb9@byu.net>
2207
2208 scan-code: avoid compiler warnings
2209 * src/scan-code.l (parse_named_ref): Use correct specifiers.
2210
80d653fd
AD
22112009-06-29 Akim Demaille <demaille@gostai.com>
2212
2213 build: avoid concurrent extraction of calc++.
2214 * examples/calc++/Makefile.am (calc.stamp): New.
2215 Depend on it to create the sources of calc++ so that concurrent
2216 builds don't launch several "extexi" in parallel.
2217 Not only this is inefficient, this also builds incorrect sources
2218 with several extractions mixed together.
2219
7685e2f7
AR
22202009-06-27 Alex Rozenman <rozenman@gmail.com>
2221
2222 Implement support for named symbol references.
2223 * src/parse-gram.y: Add new syntax (named_ref.opt).
2224 * src/reader.c: Store named refs in symbol lists.
2225 * src/reader.h: New argument for symbol_append and
2226 action_append functions.
2227 * src/scan-code.h: Add new field (named_ref) into
2228 code_props data structure. Keeps named ref of midrule
2229 actions.
2230 * src/scan-code.l: Support for named refs in semantic
2231 action code. New function 'parse_named_ref'.
2232 * src/scan-gram.l: Support bracketed id.
2233 * src/symlist.c: Store named refs in symbol lists.
2234 * src/symlist.h: New field in symbol list: named_ref.
2235 * src/named-ref.h: New file, a struct for named_ref.
2236 * src/named-ref.cp: New file, named_ref_new function.
2237 * src/local.mk: Add two new files.
2238 * tests/testsuite.at: Include new test group:
2239 * tests/named-refs.at: this new file.
2240
67f8cf51
AD
22412009-06-25 Akim Demaille <demaille@gostai.com>
2242
2243 hash: check insertion for memory exhaustion.
2244 * src/uniqstr.c (uniqstr_new): New.
2245
83b66ddd
AD
22462009-06-11 Akim Demaille <demaille@gostai.com>
2247
2248 style changes.
2249 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
2250 * src/print-xml.c: Style changes.
2251 * tests/conflicts.at: Comment changes.
2252
517cb0ad
AD
22532009-06-11 Akim Demaille <demaille@gostai.com>
2254
2255 xml: beware of user strings used to give a %prec to rules.
2256 * tests/conflicts.at (%prec with user strings): New.
2257 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
2258 XML output.
2259
75c7a52a
AD
22602009-06-11 Akim Demaille <demaille@gostai.com>
2261
2262 hash: check insertion for memory exhaustion.
2263 * src/muscle-tab.c (muscle_insert, muscle_grow)
2264 * src/state.c (state_hash_insert): Check the return value of
2265 hash_insert.
2266
66ed9753
AD
22672009-06-10 Akim Demaille <demaille@gostai.com>
2268
2269 deterministic test suite.
2270 Some consistency checks on symbols are performed after all the
2271 symbols were read, by an iteration over the symbol table. This
2272 traversal is nondeterministic, which can be a problem for test
2273 cases.
2274 Avoid this.
2275 Addresses another form of nondeterminism reported by Joel E. Denny.
2276 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
2277
2278 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
2279 test in two.
2280 Use different file names for the three tests to make the
2281 maintenance easier.
2282
ed15d907
AD
22832009-06-10 Akim Demaille <demaille@gostai.com>
2284
95d176ff
AD
2285 deterministic user-token-number redeclaration errors.
2286 Address nondeterminism reported by Joel E. Denny.
2287 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
2288
2289 * src/uniqstr.h: Comment changes.
2290 * src/location.h (boundary_cmp, location_cmp): New.
2291 * src/symtab.c (user_token_number_redeclaration): New.
2292 (symbol_translation): Use it.
2293 * tests/input.at (Numbered tokens): Adjust the expected output.
2294
22952009-05-25 Akim Demaille <demaille@gostai.com>
2296
ed15d907 2297 gnulib: update.
aa50ba7b
EB
2298 * gnulib: Update to latest.
2299 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
2300 * m4/.gitignore: Regen.
2301 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
2302 Call xalloc_die on hash_insert failures.
2303 Requested by the new __warn_unused_result__ attribute of
2304 hash_insert.
ed15d907 2305
e3a33f7c
JD
23062009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
2307
2308 Convert multiple variable definition warnings to complaints.
2309 * NEWS (2.5): Add a new entry for that change.
2310 * doc/bison.texinfo (Decl Summary): Update %define entry.
2311 (Bison Options): Update -D/--define/-F/--force-define entry.
2312 * src/muscle_tab.c (muscle_percent_define_insert): Implement.
2313 * src/muscle_tab.h (muscle_percent_define_insert): Update
2314 comments.
2315 * tests/input.at (`%define errors'): Update.
2316 (`%define, --define, --force-define'): Update.
2317
34d41938
JD
23182009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
2319
2320 -F/--force-define and relative %define/-D/--define priorities.
2321 * NEWS (2.5): Add documentation to -D/--define entry.
2322 * build-aux/cross-options.pl: Hard-code association of
2323 --force-define with %define.
2324 * doc/bison.texinfo (Decl Summary): In %define entry,
2325 cross-reference command-line options.
2326 (Bison Options): Add documentation to -D/--define entry.
2327 (Option Cross Key): Widen column for --force-define row.
2328 * src/getargs.c (usage): Document -F/--force-define. Realign
2329 options in output.
2330 (short_options, long_options, getargs): Parse -F/--force-define,
2331 and update muscle_percent_define_insert invocation.
2332 * src/muscle_tab.h (muscle_percent_define_how): New enum type.
2333 (muscle_percent_define_insert): Add argument with that type.
2334 * src/muscle_tab.c (muscle_percent_define_insert): Implement
2335 -F/--force-define behavior and priorities.
2336 * src/parse-gram.y (prologue_declaration): Update
2337 muscle_percent_define_insert invocations.
2338 * tests/input.at (`%define, --define'): Rename to...
2339 (`%define, --define, --force-define'): ... this and extend.
2340
246c4efa
JD
23412009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
2342
2343 Update some comments to make sense for -D.
2344 * data/bison.m4 (b4_check_user_names): In header comments, say
2345 "user occurrence" instead of "grammar occurrence".
2346 * src/muscle_tab.h (muscle_percent_define_insert): Likewise.
2347 (muscle_percent_code_grow): Likewise just for consistency.
2348
531683e7
JD
23492009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
2350
2351 * data/c++.m4: Update copyright year.
2352
e7bfa8b7
JD
23532009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
2354
2355 * data/c++.m4 (b4_namespace_close): Simplify slightly.
2356
8c221795
JD
23572009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
2358
2359 Handle a trailing `:' in a user-supplied C++ namespace better.
2360 * data/c++.m4 (b4_namespace_close): Don't let it be printed
2361 among the closing braces here. This fix might make the
2362 generated code easier to debug, but otherwise it should be
2363 insignificant because a trailing `:' is a C++ error already.
2364
c8bf65f0
AD
23652009-05-19 Akim Demaille <demaille@gostai.com>
2366
2367 remove useless variable.
2368 * src/getargs.c (skeleton_arg): Remove now useless variable.
2369 Should help the compiler see that this printf-like call is sane.
2370
7ac45a46
AD
23712009-05-11 Akim Demaille <demaille@gostai.com>
2372
2373 doc: use C++ headers.
2374 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
2375 headers.
2376
601bdfab
AD
23772009-05-05 Akim Demaille <demaille@gostai.com>
2378
2379 fix hexadecimal token number support.
2380 * src/scan-gram.l: Catch incorrect ids after hexadecimal numbers.
2381
d19123e6
AD
23822009-05-05 Akim Demaille <demaille@gostai.com>
2383
2384 tests: check token numbers.
2385 * tests/input.at (Numbered tokens): New.
2386
ecdfea9a
AD
23872009-05-04 Akim Demaille <demaille@gostai.com>
2388
2389 bison: catch bad symbol names.
2390 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
2391 * tests/input.at: Adjust.
2392
43e6aea5
AD
23932009-05-04 Akim Demaille <demaille@gostai.com>
2394
2395 space changes.
2396 * src/scan-gram.l: Untabify to be robust to zealous editors.
2397
c046698e
AD
23982009-05-04 Akim Demaille <demaille@gostai.com>
2399
2400 identifiers: dashes are letters.
2401 Dashes can now start identifiers (symbols and directives).
b10dd689 2402
c046698e
AD
2403 * src/scan-gram.l ({letter}): Add dash.
2404 ({id}): Remove it.
2405 * tests/input.at (Symbols): Adjust.
2406 Remove stray comment.
2407 * tests/regression.at (Invalid inputs): Adjust error message.
2408 * doc/bison.texinfo (Symbols): Update.
2409
966aba65
JD
24102009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
2411
2412 Declare %code to be a permanent feature.
2413 * NEWS (2.4.2): Here.
2414 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
2415 experimental.
2416 (Decl Summary): Likewise.
2417
812775a0
JD
24182009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
2419
2420 Convert underscores to dashes in some %define variable names.
2421 For now, just api.push-pull and lr.keep-unreachable-states.
2422 Maintain old names for backward compatibility.
2423 * NEWS (2.5): Document.
2424 * data/c.m4 (b4_identification): Update comment.
2425 * data/yacc.c: Update access.
2426 * doc/bison.texinfo: Update.
2427 * etc/bench.pl.in (bench_grammar): Update use.
2428 * src/files.c (tr): Move to...
2429 * src/getargs.c, src/getargs.h (tr): ... here because I can't
2430 think of a better place to expose it. My logic is that, for all
2431 uses of tr so far, command-line arguments can be involved, and
2432 getargs.h is already included.
2433 * src/main.c (main): Update access.
2434 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
2435 variable names to new variable names before assigning value.
2436 * src/reader.c (reader): Update setting default.
2437 * tests/calc.at: Update uses.
2438 * tests/conflicts.at (Unreachable States After Conflict
2439 Resolution): Update use.
2440 * tests/input.at (%define enum variables): Update use.
2441 (%define backward compatibility): New test group.
2442 * tests/push.at: Update uses.
2443 * tests/reduce.at: Update uses.
2444 * tests/torture.at: Update uses.
2445
1c4aa81d
JD
24462009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
2447
2448 Set all front-end %define defaults in one place.
2449 * src/main.c (main): Move lr.keep_unreachable_states default...
2450 * src/reader.c (reader): ... to here.
2451
1d0f55cc
JD
24522009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
2453
2454 Rename lr.default_reductions to lr.default-reductions.
2455 * NEWS (2.5): Here.
2456 * doc/bison.texinfo: Here.
2457 * src/lalr.c (initialize_LA): Here.
2458 * src/print.c (print_reductions): Here.
2459 * src/reader.c (reader): Here.
2460 * src/tables.c (action_row): Here.
2461 * tests/input.at (%define enum variables): Here.
2462 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
2463
0b593457
JD
24642009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
2465
2466 Pacify ./configure --enable-gcc-warnings.
2467 * tests/input.at (Symbols): Prototype yyerror and yylex.
2468
0939aa2d
AD
24692009-04-21 Akim Demaille <demaille@gostai.com>
2470
2471 tests: check the use of dashes and periods in symbols.
2472 * tests/input.at (Symbol): New test group.
2473
0b593457 24742009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
ae618dcc
JD
2475
2476 Document how `%define "var" "value"' is not M4-friendly.
2477 * src/parse-gram.y (variable): In comments here.
2478
0b593457 24792009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
6789b8bd
JD
2480
2481 Add copyright updates missed during previous cherry pick.
2482 * src/output.c: Here.
2483 * src/parse-gram.y: Here.
2484 * src/scan-gram.l: Here.
2485
663ce7bb
AD
24862009-04-20 Akim Demaille <demaille@gostai.com>
2487
2488 variables: accept dashes.
2489 * src/scan-gram.l ({id}): Also accept dashes after the initial
2490 letter.
2491 ({directive}): Use {id}.
2492 * src/parse-gram.y: Comment and formatting changes.
2493 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
2494 symbols.
2495 * src/complain.h, src/complain.c (yacc_at): New.
2496 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
2497 symbol names.
2498 * src/output.c (token_definitions_output): Do not #define token
2499 names with dashes.
2500
379261b3
JD
25012009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
2502
2503 Clean up recent patches a little.
2504 Reported by Akim Demaille.
2505 * doc/bison.texinfo (Understanding): Fix typos.
2506 * src/print.c (print_reductions): Don't use negated variable.
2507
25029e16
JD
25082009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
2509
2510 List accepted values for a %define enum variable with an invalid value.
2511 Suggested by Akim Demaille at
2512 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
2513 * data/bison.m4 (_b4_percent_define_check_values): Implement.
2514 * src/muscle_tab.c (muscle_percent_define_check_values): Implement.
2515 * tests/input.at (%define lr.default_reductions invalid values): Merge
2516 into...
2517 (%define enum variables): ... here, and update output.
2518
620b5727
JD
25192009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
2520
2521 Rename "default rule" to "default reduction".
2522 This includes changing variable names in code, changing
2523 comments, and renaming %define lr.default_rules to %define
2524 lr.default_reductions.
2525 * NEWS (2.5): Update IELR documentation.
2526 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c:
2527 Adjust YYDEFACT and yydefact_ documentation.
2528 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
2529 and lr.type documentation. Make some other wording
2530 improvements.
2531 (Glossary): Adjust cross-references and Default Reduction
2532 definition.
2533 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
2534 Remove a confusing comment pointed out by Akim Demaille.
2535 (initialize_LA): Adjust code.
2536 * src/print-xml.c (print_reductions): Adjust code.
2537 * src/print.c (print_reductions): Adjust code.
2538 * src/reader.c (reader): Adjust code.
2539 * src/tables.c (action_row): Adjust code.
2540 (token_actions): Adjust code.
2541 * src/tables.h: Adjust YYDEFACT documentation.
2542 * tests/input.at (%define lr.default_rules invalid values):
2543 Rename test group to...
2544 (%define lr.default_reductions invalid values): ... this, and
2545 update grammar file and expected output.
2546 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
2547 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
2548
34a6c2d1
JD
25492009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2550
2551 Document %define lr.type and lr.default_rules.
2552 * NEWS (2.5): Add an entry.
2553 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
2554 besides just LALR(1) and GLR(1).
2555 * doc/bison.texinfo (Introduction): Likewise.
2556 (Language and Grammar): Bison is no longer limited to LALR(1)
2557 restrictions.
2558 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
2559 when trying to distinguish from GLR. Talk about LR(1) grammars
2560 rather than LALR(1) grammars.
2561 (Decl Summary): In %define api.push_pull entry, say it applies
2562 to deterministic parsers in C rather than LALR(1) parsers in C.
2563 Add lr.default_rules entry.
2564 Add lr.type entry.
2565 (Mystery Conflicts): Bison is no longer limited to LALR(1)
2566 restrictions.
2567 (Generalized LR Parsing): Same changes as for the previous GLR
2568 section.
2569 (Memory Management): Say deterministic rather than LALR(1).
2570 (Understanding): Correct some bison output.
2571 Index discussion of "accepting state".
2572 Say deterministic rather than LALR(1).
2573 (Bison Options): In --yacc entry, say deterministic rather than
2574 LALR(1).
2575 In --report, --graph, and --xml entries, just don't mention
2576 LALR(1).
2577 (C++ Parsers): Say deterministic rather than LALR(1).
2578 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
2579 (Glossary): Add Accepting State, Consistent State, Default Rule,
2580 and IELR(1) definitions.
2581 In Generalized LR (GLR) definition, make same changes as in
2582 previous GLR sections.
2583 In LALR(1) definition, say Bison uses LALR(1) by default rather
2584 than implying Bison is limited to LALR(1).
2585 (LocalWords): Add IELR.
2586
f805dfcb
JD
25872009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2588
2589 Finish implementing %define lr.type.
2590 Its value can be "LALR", "IELR", or "canonical LR".
2591 * lib/timevar.def (TV_IELR_PHASE1): New var.
2592 (TV_IELR_PHASE2): New var.
2593 (TV_IELR_PHASE3): New var.
2594 (TV_IELR_PHASE4): New var.
2595 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
2596 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
2597 Sbitset.h, ielr.h, and ielr.c.
2598 * src/getargs.h, src/getargs.c (enum trace, trace_args,
2599 trace_types): Add trace_ielr.
2600 * src/lalr.h, src/lalr.c (ngotos): Export it.
2601 (F): Rename to...
2602 (goto_follows): ... this, update all uses, and export it.
2603 (set_goto_map): Export it.
2604 (map_goto): Export it.
2605 (compute_lookahead_tokens): Don't free goto_follows yet. Now
2606 handled in ielr.
2607 (initialize_LA): Export it. Move lookback allocation to...
2608 (lalr): ... here because, for canonical LR, initialize_LA must
2609 be invoked but lookback and much of the rest of LALR isn't
2610 needed.
2611 * main.c (main): Instead of lalr, invoke ielr, which invokes
2612 lalr.
2613 * src/reader.c (reader): Default lr.type to "LALR".
2614 Default lr.default_rules to "accepting" if lr.type is "canonical
2615 LR". Leave the default as "all" otherwise.
2616 Check for a valid lr.type value.
2617 * src/state.h, src/state.c (struct state_list): Add state_list
2618 member.
2619 (state_new): Initialize state_list member to NULL.
2620 (state_new_isocore): New function, exported.
2621 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
2622 exercises all values of lr.type.
2623 (GNU AWK Grammar): Rename test group to...
2624 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
2625 AT_TEST_EXISTING_GRAMMAR.
2626 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
2627 (GNU pic Grammar): Rename test group to...
2628 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
2629 AT_TEST_EXISTING_GRAMMAR.
2630 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
2631 all values of lr.type.
2632 (Single State Split): New test groups using AT_TEST_LR_TYPE.
2633 (Lane Split): Likewise.
2634 (Complex Lane Split): Likewise.
2635 (Split During Added Lookahead Propagation): Likewise.
2636
166366b2
JD
26372009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2638
2639 Add new files for IELR and canonical LR implementation.
2640 * src/AnnotationList.c: New.
2641 * src/AnnotationList.h: New.
2642 * src/InadequacyList.c: New.
2643 * src/InadequacyList.h: New.
2644 * src/Sbitset.c: New.
2645 * src/Sbitset.h: New.
2646 * src/ielr.c: New.
2647 * src/ielr.h: New.
2648
03c07b03
JD
26492009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
2650
2651 Implement %define lr.default_rules.
2652 Its value describes the states that are permitted to contain
2653 default rules: "all", "consistent", or "accepting".
2654 * src/reader.c (reader): Default lr.default_rules to "all".
2655 Check for a valid lr.default_rules value.
2656 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
2657 is "accepting", then only mark the accepting state as
2658 consistent.
2659 (initialize_LA): Tell state_lookahead_tokens_count whether
2660 lr.default_rules is "accepting".
2661 * src/tables.c (action_row): If lr.default_rules is not "all",
2662 then disable default rules in inconsistent states.
2663 * src/print.c (print_reductions): Use this opportunity to
2664 perform some assertions about whether lr.default_rules was
2665 obeyed correctly.
2666 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
2667 helps with checking the parser tables for a grammar.
2668 * tests/input.at (%define lr.default_rules invalid values): New
2669 test group.
2670 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
2671 AT_TEST_TABLES_AND_PARSE.
2672 (`no %define lr.default_rules'): New test group generated by
2673 AT_TEST_LR_DEFAULT_RULES.
2674 (`%define lr.default_rules "all"'): Likewise.
2675 (`%define lr.default_rules "consistent"'): Likewise.
2676 (`%define lr.default_rules "accepting"'): Likewise.
2677
44c124a3
AD
26782009-04-20 Akim Demaille <demaille@gostai.com>
2679
2680 Consistently refer to Yacc, not YACC.
2681 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
2682
42660736
JD
26832009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
2684
2685 Pacify make maintainer-check-posix.
2686 * tests/input.at (%define, --define): Move bison command-line
2687 options before grammar file name.
2688
a2d05674
JD
26892009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
2690
2691 Document semicolon warnings.
2692 * NEWS (2.5): Here.
2693
c4fae1ef
AD
26942008-12-08 Akim Demaille <demaille@gostai.com>
2695
2696 Fix portability issue in the test suite.
2697 * tests/local.at (AT_MATCHES_CHECK): New.
2698 Based on Perl instead of Sed. Sed has too many portability
2699 pitfalls, not ever Sed is GNU Sed.
2700 * tests/actions.at (Fix user actions without a trailing semicolon):
2701 Use it.
2702
42f4393a
DJ
27032008-12-07 Di-an Jan <dianj@freeshell.org>
2704
2705 Implement the FIXME that ends an user action with a semicolon
2706 if it seems necessary.
2707 * src/scan-code.l (flex rules section): Flag cpp directive from
2708 any `#' to the first unescaped end-of-line. Semicolon is not
2709 needed after `;', `{', '}', or cpp directives and is needed after
2710 any other token (whitespaces and comments have no effect).
2711 * tests/actions.at (Fix user actions without a trailing semicolon):
2712 New test.
2713 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
2714 to make user actions complete statements.
2715 Adjust column numbers in error messages.
2716 * tests/regression.at (Fix user actions without a trailing semicolon):
2717 Remove. Covered by new test.
2718
bd5df716
AD
27192009-04-14 Akim Demaille <demaille@gostai.com>
2720
2721 doc: minor fixes.
2722 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
2723 (Table of Symbols): Remove duplicate entry for %debug.
2724
7ba0d59d
EB
27252009-04-10 Eric Blake <ebb9@byu.net>
2726
2727 submodules: update to latest
2728 * submodules/autoconf: Use latest upstream Autoconf.
2729
b4d71a96
EB
27302009-04-06 Eric Blake <ebb9@byu.net>
2731
2732 Work around autoconf 2.63b bug in testsuite.
2733 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
2734 autoconf bug related to # in test.
2735
4ecd3681
JD
27362009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2737
2738 * NEWS (2.5): Describe new -D/--define feature.
2739
c65e5292
AD
27402008-11-10 Akim Demaille <demaille@gostai.com>
2741
2742 --trace=muscles
2743 * src/getargs.h, src/getargs.c (trace_muscle): New.
2744 (trace_types, trace_args): Support it.
2745 * src/output.c (output_skeleton): Use it.
2746
96002de2
AD
27472008-11-10 Akim Demaille <demaille@gostai.com>
2748
2749 muscles_output.
2750 * src/output.c (muscles_output): New, extracted from...
2751 (output_skeleton): here.
2752 Adjust.
2753
fadb13b5
AD
27542008-11-21 Akim Demaille <demaille@gostai.com>
2755
2756 Display the changes in cross-options.texi.
2757 * build-aux/cross-options.pl ($sep): New, to separate items.
2758 * doc/Makefile.am ($(srcdir)/cross-options.texi): Use diff to display
2759 the changes.
2760
72183df4
DJ
27612008-11-20 Di-an Jan <dianj@freeshell.org>
2762
2763 Improves options in the manual.
2764 * doc/bison.texinfo (-g, -x): Add space before argument.
2765 (Option Cross Key): Implement FIXME: listing directives also.
2766 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
2767 (Short Option): Special case -d. Put arguments inside @option.
fadb13b5 2768 (Bison Directive): Add column, automatically extracted from
72183df4
DJ
2769 src/scan-gram.l (actual name passed as the first argument)
2770 with special case for %define.
2771 * doc/Makefile.am (doc/cross-options.texi): Pass src/scan-gram.l
2772 to build-aux/cross-options.pl.
2773 * src/getargs.c (usage): Document limitations of cross-options.pl.
2774 * src/scan-gram.l: Likewise.
2775
e80b068c
AD
27762009-02-25 Akim Demaille <demaille@gostai.com>
2777
2778 Copyright years.
2779 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
2780
e3ee30b8
AD
27812008-12-08 Akim Demaille <demaille@gostai.com>
2782
2783 Install autoconf as a submodule to get m4sugar.
2784 * .gitmodules: Add submodules/autoconf.
2785 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
2786 submodules/autoconf.
2787
c4eb1e84
JD
27882008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2789
2790 Simplify last patch slightly.
2791 * src/getargs.c (getargs): Here.
2792
10fa0146
JD
27932008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2794
2795 Fix last warning from --enable-gcc-warnings.
2796 * src/getargs.c (getargs): Don't assign const address to non-const
2797 pointer.
2798
6f5be1ab
DJ
27992008-11-17 Di-an Jan <dianj@freeshell.org>
2800
2801 Handle --enable-gcc-warnings.
2802 * src/getargs.c (command_line_location): Set parameters to void.
2803
11c4e57d
AD
28042008-11-11 Akim Demaille <demaille@gostai.com>
2805
2806 AT_FULL_COMPILE.
2807 * tests/actions.at, tests/regression.at: Use it.
2808
e186a284
AD
28092008-11-07 Akim Demaille <demaille@gostai.com>
2810
2811 Pass command line location to skeleton_arg and language_argmatch.
2812 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
2813 The location argument is now mandatory.
2814 Adjust all dependencies.
2815 (getargs): Use command_line_location.
2816
e14c6831
AD
28172008-11-07 Akim Demaille <demaille@gostai.com>
2818
2819 -D, --define.
2820 * src/getargs.c (usage): Document -D.
2821 Fix help string for --locations.
2822 (command_line_location): New.
2823 (short_options, long_options, getargs): Support -D, --define.
2824 (getargs): Move -d support at the right place.
2825 * doc/bison.texinfo (Bison Options): Update.
2826 * tests/input.at (%define, --define): New.
2827
75c21b61
AD
28282008-11-07 Akim Demaille <demaille@gostai.com>
2829
2830 Initialize the muscle table before parsing the command line.
2831 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
2832 (getargs): Define file_name.
2833 * src/main.c (main): Initialize muscle_tab before calling
2834 getargs.
2835 * src/muscle_tab.c (muscle_init): No longer define file_name, as
2836 its value is not available yet.
2837
33d2a860
AD
28382008-11-09 Akim Demaille <demaille@gostai.com>
2839
2840 Require the generation of parse-gram.output.
2841 * src/Makefile.am (YACC): Pass --report=all.
2842
006faedf
JD
28432009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2844
2845 * NEWS (2.5): New stub.
2846
ecd1b61c
JD
28472009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2848
2849 Fix options documentation.
2850 * build-aux/cross-options.pl: As in --help output, write optional
2851 arguments as [=ARG] not =[ARG].
2852 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
2853
f67c4037
AD
28542008-11-07 Akim Demaille <demaille@gostai.com>
2855
2856 Fix --help.
2857 * src/getargs.c (usage): Fix help string for -W.
2858
0213d651
AD
28592008-11-07 Akim Demaille <demaille@gostai.com>
2860
2861 Handle more general types of option arguments.
2862 * build-aux/cross-options.pl: The argument ends at the first
2863 space, not the first non-symbol character.
2864 Use @var for each word appearing the argument description.
2865
c19178bf
JD
28662009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
2867
2868 Remove spurious initial empty lines.
2869 * data/location.cc: End the @output lines with an @.
2870
0d2b2ab0
AD
28712008-11-04 Akim Demaille <demaille@gostai.com>
2872
2873 Remove spurious initial empty lines.
2874 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
2875 * data/yacc.c: End the @output lines with an @.
2876
8ba62e3e
JD
28772009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
2878
2879 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
2880 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
2881 requirements for a correct m4 are stricter.
2882 * m4/m4.m4: Replace with Autoconf 2.63's m4/m4.m4.
2883 * configure.ac: Update to use AC_PROG_GNU_M4.
2884 Reported by Eric Blake.
2885
5bc993d9
JD
28862009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2887
2888 Help with updating web manual.
2889 * HACKING: Incorporate instructions from gnulib/doc/README.
2890 * bootstrap.conf (gnulib_modules): Add gendocs.
2891
580c075d
JD
28922009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2893
2894 Fix strange %define locations for default values.
2895 Reported by Akim Demaille at
2896 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
2897 and discussed again starting at
2898 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
2899 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
2900 because location information is bogus.
2901 Use angle brackets to delimit fake file name because square brackets
2902 look like underexpanded m4. Choose a better fake file name.
2903 Use negative line numbers.
2904 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
2905 * src/location.c (location_print): If line for a boundary is negative,
2906 only print that boundary's file name.
2907 * src/location.h: Document that.
2908 * tests/skeletons.at (%define Boolean variables: invalid skeleton
2909 defaults): Update output.
2910
5d3a1ecb
AD
29112008-11-07 Akim Demaille <demaille@gostai.com>
2912
2913 Locations without columns for command line arguments.
2914 * src/location.c (location_print): Don't display negative columns.
2915 * src/location.h: Document this.
2916
015e86a7
JD
29172009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
2918
2919 Add reminder about uploading public key to keys.gnupg.net.
2920 * HACKING (Release Procedure): Here.
2921
c1455bab
AD
29222009-03-31 Akim Demaille <demaille@gostai.com>
2923
2924 bootstrap: --help to stdout.
2925 * bootstrap (usage): Don't send --help to stderr.
2926 Use a here doc instead of a long string.
2927
2075a82a
AD
29282009-03-31 Akim Demaille <demaille@gostai.com>
2929
2930 bootstrap: README-hacking no longer exists
2931 * bootstrap (checkout_only_file): Set to HACKING.
2932
26fccd4d
AD
29332009-03-26 Akim Demaille <demaille@gostai.com>
2934
2935 doc: merge HACKING and README-hacking.
2936 Two files is confusing.
2937 Reported by Alexandre Duret-Lutz.
5bc993d9 2938
26fccd4d
AD
2939 * README-hacking: Merge into...
2940 * HACKING (Working from the repository): here.
2941
6469c4d7
AD
29422009-03-26 Akim Demaille <demaille@gostai.com>
2943
2944 doc: update README-hacking.
2945 * README-hacking: We now use git and git submodules.
2946 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
2947
b328890a
AD
29482009-03-26 Akim Demaille <demaille@gostai.com>
2949
2950 lalr1.cc: avoid GCC 4.3 warnings.
2951 GCC 4.3 now warns about "a || b && c" and asks for explicit
2952 parentheses.
2953 Reported by Alexandre Duret-Lutz.
2954 * data/location.cc: Update copyright years.
2955 (Position::operator==): Use parens to make precedence explicit.
2956 Compare lines and columns first, as they are more likely to be
2957 different, and they are faster to compare.
2958
f3079439
AD
29592009-03-26 Akim Demaille <demaille@gostai.com>
2960
2961 gnulib: update.
2962 * gnulib: Update to latest.
2963 * lib/Makefile.am (AM_CPPFLAGS): It is now defined by gnulib, so
2964 use +=.
2965
8defe11b
AD
29662009-01-08 Akim Demaille <demaille@gostai.com>
2967
2968 Fix grep portability issues.
2969 Grep on Solaris does not support -q.
2970 Reported by Summum Bonum.
5bc993d9 2971
8defe11b
AD
2972 * NEWS: Add a stub for 2.4.2.
2973 * THANKS: Add Summum Bonum.
2974 * tests/atlocal.in (EGREP): New.
2975 (CC, CXX, XSLTPROC): Make it possible to override them via
2976 envvars.
2977 * tests/java.at: Use $EGREP instead of egrep.
2978 Use AT_CHECK's ignore instead of grep's -q.
2979
41930e7a
JD
29802008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
2981
2982 Version 2.4.1.
2983 * NEWS: Set version and date.
2984 * lib/Makefile.am: Update copyright year.
2985 * tests/atlocal.in: Update copyright year.
2986
d07932ef
JD
29872008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
2988
2989 Semicolon feature removal is not about future language support.
2990 * NEWS: The semicolon feature is no longer active for newer languages,
2991 so don't claim that it causes trouble for them.
2992
0364b334
JD
29932008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
2994
2995 * gnulib: Update submodule to HEAD.
2996
876fd835
AD
29972008-12-09 Akim Demaille <demaille@gostai.com>
2998
2999 Update data/README.
3000 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
3001
bee1df15
EB
30022008-12-05 Eric Blake <ebb9@byu.net>
3003
3004 Build testsuite with newer autoconf.
3005 * tests/output.at (m4_expand): Don't override in newer autoconf,
3006 where the underlying implementation changed.
3007 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
3008 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
3009 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
3010 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
3011 since some of them contain unbalanced ')'.
3012
7e6d1e22
JD
30132008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
3014
3015 * NEWS: Clarify a little.
3016
a957d06c
JD
30172008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
3018
3019 * NEWS: Update for recent changes.
3020
462503f8
JD
30212008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
3022
3023 Fix unexpanded macros in GLR defines file.
3024 Reported by Csaba Raduly at
3025 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
3026 * THANKS (Csaba Raduly): Add.
3027 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
3028 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
3029 lexer in a separate module that includes the defines file.
3030 (AT_CHECK_CALC): Use AT_FULL_COMPILE and request compilation of lexer
3031 source.
3032 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
3033 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
3034 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
3035 (AT_DATA_SOURCE_PROLOGUE): New.
3036 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
3037 (AT_DATA_SOURCE): New.
3038 (AT_FULL_COMPILE): New, copied from master branch and extended to
3039 support an additional source file.
3040
bf151b75
JD
30412008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
3042
3043 Don't let maintainer-*-check targets force a version update.
3044 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
3045 handled.
3046
f56274a8
DJ
30472008-11-17 Di-an Jan <dianj@freeshell.org>
3048
3049 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
3050 Align menus. Adjust word wrapping. Use node names for menu names.
3051 (Examples): Don't abbreviate node names.
3052 (LocalWords): Remove abbreviations.
3053 (Copying): Make description a sentence.
bf151b75 3054 (Java Action Features): Remove period to match the rest of menu.
f56274a8 3055
b5775a81
PB
30562008-11-11 Paolo Bonzini <bonzini@gnu.org>
3057
3058 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
3059 * configure.ac: Adjust usage.
3060 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
3061 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
3062 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
3063
7ed73f82
JD
30642008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
3065
3066 Don't add a semicolon to actions for %skeleton or %language.
3067 It breaks Java test cases as reported by Akim Demaille.
3068 * src/scan-code.l: Implement.
3069
4b1ebc49
JD
30702008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
3071
3072 Clean up %skeleton and %language priority implementation.
3073 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
3074 remove static qualifier because others will soon need to see it.
3075 (language_prio): Likewise.
3076 (getargs): Use command_line_prio rather than 0.
3077 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
3078 enum fields.
3079 (skeleton_prio): Extern it.
3080 (language_prio): Extern it.
3081 * src/parse-gram.y: Use grammar_prio rather than 1.
3082
738cde3e
AD
30832008-11-04 Akim Demaille <demaille@gostai.com>
3084
3085 * NEWS: Mention the trailing semicolon in action.
3086
d6fb461d
AD
30872008-11-04 Akim Demaille <demaille@gostai.com>
3088
3089 Reformat NEWS.
3090 * NEWS: Use more outline-mode markup.
3091 Suggested by Jim Meyering.
3092
14da0cdd
JD
30932008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
3094
3095 Fix user actions without a trailing semicolon.
3096 Reported by Sergei Steshenko at
3097 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
3098 * THANKS (Sergei Steshenko): Add.
3099 * src/scan-code.l (SC_RULE_ACTION): Fix it.
3100 * tests/regression.at (Fix user actions without a trailing semicolon):
3101 New test case.
3102
c9ba9e59
JD
31032008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3104
3105 Initiate further development.
3106 * NEWS: Create an empty section for new entries.
3107 * gnulib: Update submodule to HEAD.
3108
bfb40910
JD
31092008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3110
3111 * NEWS: Version 2.4.
3112
241fda7a
JD
31132008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3114
3115 Prepare for next release.
3116 * NEWS: Briefly mention changes since 2.3b.
3117 * README: Say GNU m4 1.4.6, which we've been requiring in release
3118 announcements already, not 1.4.3, which breaks the build.
3119
ed4d67dc
JD
31202008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3121
3122 Say %language is experimental.
3123 We're thinking of extending it's effect on output file naming. See the
3124 thread at
3125 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
3126 * NEWS: Say it's experimental.
3127 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
3128 recommend it over %skeleton for now.
3129 (Bison Options): Likewise.
3130 (C++ Bison Interface): Use %skeleton not %language.
3131 (Calc++ Parser): Use %skeleton not %language.
3132 * src/getargs.c (usage): Say it's experimental.
3133
e254a580
DJ
31342008-11-01 Di-an Jan <dianj@freeshell.org>
3135 Paolo Bonzini <bonzini@gnu.org>
3136
3137 Support all Java parser class modifiers.
3138 * data/java.m4 (b4_percent_define_get3): New.
3139 (b4_final_if, b4_strictfp_if): New.
3140 * data/lalr1.java (final, strictfp, extends, implements): Support.
3141 * doc/bison.texinfo (final, strictfp, extends, implements): Add
3142 documentation.
3143 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
3144 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
3145 (AT_CHECK_JAVA_GREP): New.
3146 (Java parser class modifiers): New test.
3147 (Java parser class extends and implements): New test.
3148
3149 Model exception propagation better with throws and lex_throws.
3150 * data/java.m4 (b4_list2): New.
3151 (throws): Change default.
3152 * data/lalr1.java (yyaction): Add throws.
3153 (parse): Add lex_throws in addition to throws.
3154 * doc/bison.texinfo (throws, lex_throws): Add documentation.
3155 * tests/java.at (Java throws specifications): New test.
3156
3157 Improve documentation for Java parsers.
3158 * doc/bison.texinfo (Java Parsers): Add subsections.
3159 Don't quote first argument of %define.
3160 (Java Bison Interface): Document output files. Move documentation
3161 of parser class and merge into Java Parser Interface. Document
3162 features that error out. Document directives with no effect.
3163 Move note about Javadoc higher.
3164 (Java Semantic Values): Explicitly mention stype.
3165 Document that generic types cannot be used.
3166 (Java Location Values): Use @deftypeivar. Document constructors.
3167 Correct return value for toString.
3168 (Java Parser Interface): List undocumented constants/fields.
3169 Move documentation of fields added by %parse-param closer to list
3170 of members. Document that token names are added as fields.
3171 Document constructors accurately. Remove error method.
3172 (Java Scanner Interface): Move note on %pure-parser to Java Bison
3173 Interface. Describe %code lexer and yylex accutately.
3174 Remove documentation that does not match the code.
3175 (Java Action Features): New.
3176 (Java Differences): Add reference. Add item on semantic values.
3177 Add note about @{ ... @}. Clarify %% epilogue placement.
3178 (Java Declarations Summary): New.
3179
3180 Fix Java skeleton.
3181 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
3182 (b4_remove_comma): Quote test argument.
3183 (b4_identification): Remove "bison" field.
3184 * tests/java.at (Java parser class and package names): New test.
3185 (Java %parse-param and %lex-param): New test.
3186 (Java stype, position_class and location_class): New test.
3187
f259e4e6
PB
31882008-10-31 Di-an Jan <dianj@freeshell.org>
3189
3190 * data/lalr1.jave: Update copyright years.
3191 (YYParser): Correct name of "generated from" file in Javadoc:
3192 use b4_file_name instead of @ofile@.
3193 (Location constructor): Correct Javadoc parameter name.
3194 (yylloc): Add missing opening m4 quote after b4_location_if.
3195 This removes a stray [ in the Javadoc of Lexer.getStartPos.
3196 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
3197 (YYParser constructor): Correct Javadoc parameter name.
3198
cae5057f
JD
31992008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
3200
3201 Always put auxiliary code files in the same dir as other output files.
3202 * src/files.c (compute_file_name_parts): When the user specifies
3203 --output but not --file-prefix, extract the directory prefix from the
3204 file prefix not from the grammar file name. This affects the location
3205 of files like location.hh generated by the C++ skeleton. The includes
3206 in the other output files require this fix.
3207 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
3208 for expected output files.
3209 (Output files): Add a test for the above.
3210
4af432ba
JD
32112008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
3212
3213 * gnulib: Update submodule to HEAD.
3214
e26d4e43
JD
32152008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
3216
3217 Update copyright year.
3218 * src/files.c: Here.
3219
c0ee9e21
DJ
32202008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
3221
3222 Don't overwrite the input file.
3223 * src/files.c (output_file_name_check): Fatal error if using input file
3224 for output.
3225 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
3226 argument.
3227 (Conflicting output files): Add test.
3228
482dc52f
AD
32292008-10-28 Akim Demaille <demaille@gostai.com>
3230
3231 Space changes.
3232 * data/lalr1.cc: Formatting changes.
3233
52cbbe84
AD
32342008-10-28 Akim Demaille <demaille@gostai.com>
3235
3236 Don't define debugging functions when !YYDEBUG.
3237 * data/lalr1.cc (debug_stream, set_debug_stream)
3238 (debug_level_type, debug_level, set_debug_level): Don't
3239 declare them when YYDEBUG is not defined.
3240 The implementation are already YYDEBUG-aware.
3241
0925d5bf
AD
32422008-10-28 Akim Demaille <demaille@gostai.com>
3243
3244 Prefer "continue" for empty loop bodies.
3245 * etc/bench.pl.in: Use "continue" instead of {}.
3246
cf98343c
AD
32472008-10-28 Akim Demaille <demaille@gostai.com>
3248
3249 Space and comments changes.
3250 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
3251 * data/c.m4, data/lalr1.cc: Space changes.
3252
9f467b7d
AD
32532008-10-28 Akim Demaille <demaille@gostai.com>
3254
3255 Make gnulib a submodule.
3256 * gnulib: New.
3257 * .gitmodules (gnulib): New.
3258
0f0e1ace
JD
32592008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
3260
3261 Fix yyerror_range for user-defined location type in C++. Reported by
3262 Georg Sauthoff at
3263 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
3264 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
3265 * THANKS (Georg Sauthoff): Add.
3266
548e2104
JD
32672008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
3268
3269 Update several administrative files mainly to facilitate releasing.
3270 * HACKING (Administrivia): Make the git-merge-changelog notes more
3271 helpful.
3272 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
3273 (Release Procedure): Update for git and add numerous details that were
3274 previously missing.
3275 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
3276 * maint.mk (announcement): Don't list bison as a bootstrap tool so
3277 that announcements don't claim we bootstrapped with whatever bison
3278 happened to be in PATH. Add flex as a bootstrap tool.
3279 * Makefile.maint: Remove, previously replaced by maint.mk.
3280 * Makefile.cfg: Remove, and migrate settings to...
3281 * cfg.mk: ... here for the sake of `make announcement'.
3282 * bootstrap.conf (gnulib_modules): Add announce-gen.
3283 * README: Say GNU Bison instead of just Bison. Suggested by Karl
3284 Berry.
3285
ddf17a6e
PB
32862008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
3287
3288 Small but important bugfixes for the Java skeleton.
3289 * data/lalr1.java (yyerror): Change Location to b4_location_type.
3290 (yy_symbol_print): Call toString on yyvaluep.
3291
e1145ad8
AD
32922008-08-29 Akim Demaille <demaille@gostai.com>
3293
3294 Clarify UPDATED use.
bee1df15 3295 * doc/bison.texinfo: It refers to the last edition of this file,
e1145ad8 3296 not to the release date of Bison.
bee1df15 3297 Reported by Joel E. Denny.
e1145ad8 3298
0df72d78
AD
32992008-08-29 Akim Demaille <demaille@gostai.com>
3300
3301 * README: Update FAQ pointer.
3302 Reported by Joel E. Denny.
3303
9a90b6bb
EB
33042008-08-27 Eric Blake <ebb9@byu.net>
3305
3306 Resync m4sugar from autoconf.
3307 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
3308 (m4_init): Adjust to latest m4.git changes.
3309 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
3310 effects.
3311 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
3312 (_m4_list_cmp): Reduce side effects.
3313
65015668
AD
33142008-08-27 Akim Demaille <demaille@gostai.com>
3315
3316 Check yyerrok in calc.at.
bee1df15
EB
3317 * tests/calc.at (calc.y): Use yyerrok on "( error )".
3318 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
3319 expected.
65015668 3320
98e26a92
AD
33212008-08-27 Akim Demaille <demaille@gostai.com>
3322
3323 Support yyerrok in lalr1.cc.
3324 YYBACKUP is still to import back into lalr1.cc.
bee1df15 3325 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
98e26a92 3326
86c0e784
JD
33272008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
3328
3329 For maintainer-check*, don't recompile for a $(VERSION) update.
3330 * cfg.mk: New file.
3331 (_is-dist-target): Override the one in GNUmakefile.
3332 * Makefile.am (EXTRA_DIST): Add cfg.mk.
3333
88511166
JD
33342008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
3335
3336 Update for recent change to gnulib.
3337 * src/parse-gram.y: Don't include strverscmp.h. It comes from
3338 string.h now.
3339
6bbb2ed5
EB
33402008-08-15 Eric Blake <ebb9@byu.net>
3341
d67c52e8
EB
3342 Remaining m4sugar merge from autoconf.
3343 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
3344 * data/m4sugar/foreach.m4: New file, copied from autoconf.
3345 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
3346 * src/output.c (output_skeleton): Tell m4 how to find it.
3347
6bbb2ed5
EB
3348 Partial m4sugar merge from autoconf: m4_map.
3349 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
3350 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
3351 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
3352 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
3353 for empty list.
3354 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
3355 Likewise.
3356 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
3357 declares it.
3358
8dce3875
JD
33592008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
3360
3361 Keep .version and PACKAGE_VERSION in sync.
3362 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
3363 dependency, and add comments justifying this in more detail. Discussed
3364 starting at
3365 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
3366
882a1fbf
EB
33672008-08-06 Eric Blake <ebb9@byu.net>
3368
a3764451
EB
3369 Partial m4sugar merge from autoconf: m4_shiftn.
3370 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
3371 (m4_shift2, m4_shift3): New macros.
3372 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
3373 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
3374 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
3375 * data/java.m4 (b4_remove_comma): Likewise.
3376
882a1fbf
EB
3377 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
3378 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
3379 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
3380 (m4_init): Consolidate wrapped text into single m4_wrap.
3381 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
3382 in wrapped text.
3383
a30e920d
EB
33842008-08-05 Eric Blake <ebb9@byu.net>
3385
dfcc5959
EB
3386 Partial m4sugar merge from autoconf: builtins, version.m4.
3387 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
3388 (m4_prepend): Remove, as it is unused and inherently quadratic,
3389 whereas m4_append is linear in newer m4.
3390 (m4_mkstemp): New builtin.
3391 (m4_symbols): Make rename conditional.
3392 (m4_version_prereq): Ensure fatal error if used in bison, which
3393 intentionally lacks version.m4.
3394
a30e920d
EB
3395 Fix comments in m4sugar.
3396 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
3397
445b7470
JD
33982008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
3399
3400 Update for recent .gitignore fix in Gnulib.
3401 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
3402 anchored .gitignore entries.
3403
a1e50014
JD
34042008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
3405
3406 Set gnu or gnits strictness.
3407 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
3408 development and gnits strictness for releases. Based on Eric Blake's
3409 suggestion at
3410 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
3411
d43f77e7
PB
34122008-07-31 Paolo Bonzini <bonzini@gnu.org>
3413
3414 * NEWS: Clarify documentation of %language.
3415
fee2ed87
PB
34162008-07-31 Paolo Bonzini <bonzini@gnu.org>
3417
3418 Support usage of git-merge-changelog.
3419 * .gitattributes: New.
3420 * HACKING: Document usage of git-merge-changelog.
3421 * bootstrap: Install git-merge-changelog entries in .git/config
3422 if appropriate.
3423
78029cd5
JD
34242008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3425
3426 Remove remaining dependence on CVS Id keyword.
3427 * ChangeLog: For the sake of people still using CVS, don't use dollars
3428 when mentioning Id.
3429 * data/xslt/bison.xsl: Remove Id from header comments, where it was
3430 unusual anyway.
3431 * data/xslt/xml2dot.xsl: Likewise.
3432 * data/xslt/xml2text.xsl: Likewise.
3433 * data/xslt/xml2xhtml.xsl: Likewise.
3434 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
3435 * doc/Makefile.am (neutralize): Remove, no longer needed.
3436 (.x.1): Don't use neutralize.
3437 (edit): Don't substitute for ID.
3438 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
3439
c53d18b1
JD
34402008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3441
3442 Fix dependence on computed configure variables.
3443 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
3444 $(top_srcdir)/configure.ac so that changes to computed variables, such
3445 as PACKAGE_VERSION, are seen.
3446 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
3447
5523ac79
JD
34482008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
3449
3450 Update copyright dates for recent changes.
3451 * Makefile.am: Here.
3452 * src/Makefile.am: Here.
3453 * src/reduce.c: Here.
3454 * tests/reduce.at: Here.
3455
8fa36911
JD
34562008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
3457
3458 Use git-version-gen for version names between releases.
3459 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
3460 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
3461 * .prev-version: New.
3462 * .version.in: Remove.
78029cd5 3463 * ChangeLog: Remove the Id previously used for capturing the CVS
8fa36911
JD
3464 revision.
3465 * GNUmakefile: Remove, now copied from Gnulib.
3466 * Makefile.am: Add code suggested by comments in
3467 build-aux/git-version-gen.
3468 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
3469 .prev-version, and .version.
3470 * NEWS (2.3b+): Rename to...
3471 (?.?): ... this because we're dropping the "+" version naming scheme,
3472 but, in general, we still can't be sure of our next release name.
3473 * bootstrap: Add a quick hack to remove from .gitignore the
3474 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
3475 entry. This should really be fixed in gnulib instead.
3476 * bootstrap.conf (gnulib_modules): Add gnumakefile.
3477 * configure.ac (AC_INIT): Set version name by invoking
3478 build-aux/git-version-gen.
3479 (AC_CONFIG_FILES): Remove .version, now generated by
3480 build-aux/git-version-gen.
3481 * maint.mk: New, copied from coreutils.
3482 * doc/.cvsignore (bison.1): Add.
3483 * doc/.gitignore (/bison.1): Add.
3484 * doc/bison.1: Remove, generated.
3485 * src/.cvsignore (revision.c): Remove.
3486 * src/.gitignore (/revision.c): Remove.
3487 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
3488 (BUILT_SOURCES): Remove revision.c.
3489 (revision.c): Remove.
3490 * src/getargs.c (version): Don't print revision after the VERSION.
3491 * src/revision.h: Remove.
3492
bcf07cb7
JD
34932008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
3494
3495 Fix untranslatable composition of sentences. Reported by Goran
3496 Uddeborg at
3497 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
3498 * THANKS (Goran Uddeborg): Add.
3499 * src/reduce.c (reduce_print): Report the number of nonterminals and
3500 rules useless in the grammar in separate sentences.
3501 * tests/reduce.at (Useless Rules): Update output.
3502 (Reduced Automaton): Likewise.
3503 (Underivable Rules): Likewise.
3504 (Empty Language): Likewise.
3505
9aacab9a
JD
35062008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
3507
3508 Fix some .gitignore and .cvsignore problems.
3509 * bootstrap (insert_sorted_if_absent): Replace all uses with...
3510 (insert_vc_ignore): ... this new function, which prepends `/' to all
3511 .gitignore entries before passing them to insert_sorted_if_absent.
3512 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
3513 .cvsignore files are maintained even though Bison developers run
3514 bootstrap while using Git.
3515 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
3516 unneeded by Bison.
3517 (gnulib): Add.
3518 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
3519 unneeded. Reported by Eric Blake.
3520 * lib/.gitignore (/*~): Add.
3521 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
3522 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
3523 Blake.
3524 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
3525
a9fc7990
JD
35262008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
3527
3528 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
3529 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
3530 * bootstrap.conf (gnulib_modules): Add unsetenv.
3531 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
3532 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
3533 (/setenv.m4): Add.
3534 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
3535 the first argument because it may become position-dependent, and unset
3536 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
3537 Add comments explaining these issues in more detail.
3538
0f1d6f10
JD
35392008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
3540
3541 Add .gitignore everywhere based on .cvsignore.
3542 * .gitignore: New.
3543 * build-aux/.gitignore: New.
3544 * data/.gitignore: New.
3545 * doc/.gitignore: New.
3546 * etc/.gitignore: New.
3547 * examples/.gitignore: New.
3548 * examples/calc++/.gitignore: New.
3549 * lib/.gitignore: New.
3550 * m4/.gitignore: New.
3551 * po/.gitignore: New.
3552 * runtime-po/.gitignore: New.
3553 * src/.gitignore: New.
3554 * tests/.gitignore: New.
3555
7bd1665a
JD
35562008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
3557
3558 * NEWS (2.3b+): New section, empty for now.
3559 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
3560
72c5b982
JD
35612008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
3562
3563 * NEWS (2.3b): Update release date since there has been a delay in
3564 getting the announcements and tarballs out.
3565
bd02cd5d
JD
35662008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
3567
3568 * NEWS: Version 2.3b.
3569 * configure.ac (AC_INIT): Likewise.
3570 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
3571
9126263e
JD
35722008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
3573
3574 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
3575 been doing it for years.
3576 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
3577 (Release Procedure): Add FIXME about make alpha being unmaintained.
3578
fa6aa7b3
JD
35792008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
3580
3581 * data/yacc.c: Reformat m4 a little for readability.
3582 * src/lalr.c (build_relations): Correct comment.
3583
d30b312d
JMG
35842008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3585
3586 DJGPP specific issue.
3587 * djgpp/config.sed: Fixes required to run configure scripts generated
3588 by autoconf 2.62.
3589
138d4cd9
JD
35902008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
3591
3592 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
3593 coordinator@translationproject.org.
3594
8f7e2e1f
JD
35952008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3596
3597 * THANKS: Add Eric Blake.
3598
f55efa38
JD
35992008-04-23 Eric Blake <ebb9@byu.net>
3600
3601 Revert prior patch, by working around autoconf regression.
3602 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
3603 ("Output file name: ("): Uncomment test.
3604 ("Output file name: )"): Likewise.
3605 Based on an idea from Noah Misch.
3606
096c9f9d
JD
36072008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
3608
3609 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
3610 2.61. Reported by Juan Manuel Guerrero at
3611 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
3612 * tests/output.at ("Output file name: ("): Comment out test case for
3613 now.
3614 ("Output file name: )"): Likewise.
3615
0f664b89
JD
36162008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
3617
3618 * GNUmakefile: Update git-version-gen invocation so make dist
3619 succeeds.
3620
1cfe6375
JD
36212008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
3622
3623 Update to the current gnulib CVS repository, and fix trigraph handling
3624 in Bison.
3625 * bootstrap: Update gnulib CVS repository URL.
3626 (symlink_to_dir): Encapsulate the code that guarantees the destination
3627 directory exists into...
3628 (check_dst_dir): ... this new function, and...
3629 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
3630 fail when copying files into lib/uniwidth/.
3631 * src/output.c (prepare_symbols): When writing yytname muscles, where
3632 symbol names will be encoded in C-string literals, tell quotearg to
3633 escape trigraphs. This used to be the default in gnulib.
3634 * tests/regression.at (Token definitions): Because of the change in
3635 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
3636 escapes trigraphs in symbol names. Thus, yytname no longer has
3637 trigraphs unnecessarily doubly escaped. Update test case output.
3638 Extend test case to be sure Bison's own error messages will no longer
3639 have trigraphs in symbol names unnecessarily escaped once.
3640
74c52fc8
JD
36412008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
3642
3643 Fix make dist infinite loop reported by Juan Manuel Guerrero at
3644 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
3645 * .cvsignore: Add .version.
3646 * .version.in: New.
3647 * bootstrap.conf (gnulib_modules): Add git-version-gen.
3648 * configure.ac (AC_CONFIG_FILES): Add .version.
3649 * build-aux/.cvsignore: Add git-version-gen.
3650
8e55b3aa
JD
36512008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
3652
3653 * NEWS (2.3a+): Mention that -g now takes an argument.
3654 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
3655 consistency. Update the -g and -x entries now that they take
3656 arguments. Use brackets to indicate optional arguments.
3657 * src/getargs.c (usage): Explain the relationship between arguments of
3658 long and short options more completely. Document --defines and -d
3659 separately since the former takes an argument but, for POSIX Yacc, the
3660 latter does not.
3661 (short_options): Let -W take an optional argument like --warnings.
8452fdd9 3662 (getargs): Sort cases.
8e55b3aa 3663
59c5ac72
AD
36642008-02-28 Akim Demaille <demaille@gostai.com>
3665
3666 * doc/bison.texinfo: Fix a few typos.
3667
118d4978
AD
36682008-02-28 Akim Demaille <akim@epita.fr>
3669
3670 * doc/bison.texinfo (Bison Options): Document -W.
3671 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
3672
7020f1e9
AD
36732008-02-28 Akim Demaille <akim@epita.fr>
3674
3675 * src/getargs.c (short_options): Split and sort for readability.
3676 -g and -x take optional arguments, just like their long options.
3677 * build-aux/cross-options.pl: Use /x to make the regexp easier to
3678 understand.
3679 Fix the handling of $opt which resulted in all the argument to be
3680 considered as optional.
3681
59da312b
JD
36822008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
3683
3684 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
3685 say its interface is experimental.
3686 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
3687 Java.
3688 (Bison Options): In the -L and --language entry, mention Java.
3689 (Java Bison Interface): Say the interface is experimental.
3690 * src/getargs.c (usage): Mention -L and --language.
3691
3692 * NEWS (2.3a+): Say the push parsing interface is experimental.
3693 * doc/bison.texinfo (Push Decl): Likewise.
3694 (Decl Summary): Likewise in the "%define api.push_pull" entry.
3695 (Push Parser Function): Likewise.
3696 (Pull Parser Function): Likewise.
3697 (Parser Create Function): Likewise.
3698 (Parser Delete Function): Likewise.
3699 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
3700 yypull_parse, and yypush_parse entries.
3701
3702 * NEWS (2.3a+): Mention XML support, and say the schema is
3703 experimental.
3704 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
3705 * src/getargs.c (usage): Say the XML schema is experimental.
3706
3707 * NEWS (2.3a+): Say option instead of flag.
3708
2bb3ebec
WP
37092008-02-21 Wojciech Polak <polak@gnu.org>
3710
3711 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
3712 text.
3713
333e670c
JD
37142008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
3715
3716 Fix impure push parser compile error reported by Bob Rossi at
3717 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
3718 * data/yacc.c: Clean up whitespace in the output a little.
3719 (yypstate_allocated): Define for impure push parsers regardless of
3720 whether the pull interface is also requested.
3721 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
3722 check impure push parsers without the pull interface.
3723
3724 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
3725 yyerror takes arguments specified by %parse-param while yypstate_new
3726 does not.
3727 * doc/bison.texinfo (Parser Create Function): Document that
3728 yypstate_new returns 0 for multiple impure parser instances.
3729 * tests/push.at (Push Parsing: Multiple impure instances): Update
3730 expected stderr output.
3731
798096e1
JD
37322008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
3733
3734 * runtime-po/POTFILES.in (push.c): Remove.
3735
9ca7f077
JD
37362008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
3737
3738 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
3739 * data/push.c: Rename to...
3740 * data/yacc.c: ... this, overwriting it.
3741 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
3742 `%push-pull-parser' -> `%define api.push_pull "both"'.
3743 Remove old yacc.c tests, and update push.c tests to yacc.c.
3744
42ee26bb
JD
37452008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
3746
3747 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
3748 `"%code top" blocks' instead of `%code "top" blocks'.
3749 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
3750 Clean up whitespace in the output a little.
3751
b1cc23c4
JD
37522008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
3753
3754 Fix documentation problems reported by Tim Josling at
3755 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
3756 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
3757 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
3758 integers. Explain the effect of literal string aliases on error
3759 messages. Copy token 0 documentation from the C++ skeleton
3760 documentation.
3761
ab7f29f8
JD
37622008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
3763
3764 Accept a token number in a %left, %right, or %nonassoc for POSIX
3765 conformance. Reported by Tim Josling at
3766 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
3767 * NEWS (2.3a+): Mention.
3768 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
3769 and code numbers are treated by precedence declarations.
3770 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
3771 of symbols.1.
3772 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
3773 of symbol.
3774 (symbol.prec): New, just like symbol but allows INT.
3775 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
3776 longer holds.
3777 * tests/regression.at (Token number in precedence declaration): New
3778 test case.
3779
a924ef36
JMG
37802008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3781
3782 DJGPP specific issues.
3783 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
3784 be changed. Copyright timestamp adjusted.
3785 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
3786 be changed. Copyright timestamp adjusted.
3787 * djgpp/config.site: Copyright timestamp adjusted.
3788 * djgpp/config_h.sed: Copyright timestamp adjusted.
3789 * djgpp/djunpack.bat: Copyright timestamp adjusted.
3790 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
3791 filename translation list.
3792 * djgpp/subpipe.c (init_subpipe): Check the environment variables
3793 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
3794 files shall be created. Before trying to use the temp dir where the
3795 environment variable points to check that the dir really exists. If
3796 not default to the cwd as temp dir. Copyright timestamp adjusted.
3797 * djgpp/subpipe.h: Copyright timestamp adjusted.
3798 * djgpp/testsuite.sed: Copyright timestamp adjusted.
3799
389c8cfd
PE
38002008-01-30 Paul Eggert <eggert@cs.ucla.edu>
3801
3802 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
3803
5d1cfef4
PE
38042008-01-09 Paul Eggert <eggert@cs.ucla.edu>
3805
3806 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
3807 Problem reported by Claudio Saavedra in
3808 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
3809
e2dcf996
WP
38102008-01-05 Wojciech Polak <polak@gnu.org>
3811
3812 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
3813 document's title with the input grammar file name.
3814
da730230
JD
38152007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
3816
3817 Automate regression testing of the XML/XSLT implementation. Discussed
3818 starting at
3819 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
3820 * configure.ac (XSLTPROC): New substitution.
3821 * Makefile.am (maintainer-xml-check): New phony target invoking...
3822 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
3823 invoking make maintainer-check with BISON_TEST_XML=1.
3824 * tests/atlocal.in (XSLTPROC): New.
3825 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
3826 not to report reachable memory when Bison is expected to have a
3827 non-zero exit status and (2) to compare XML/XSLT output with --graph
3828 and --report=all output for every working grammar when
3829 BISON_TEST_XML=1.
3830 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
3831 (AT_BISON_CHECK_XML): New.
3832 (AT_QUELL_VALGRIND): New.
3833 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
3834 (AT_CHECK): ... don't redefine this since this was the old way to
3835 quell Valgrind.
3836 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
3837 AT_BISON_CHECK invocations.
3838 * tests/c++.at: Likewise.
3839 * tests/calc.at: Likewise.
3840 * tests/conflicts.at: Likewise.
3841 * tests/cxx-type.at: Likewise.
3842 * tests/existing.at: Likewise.
3843 * tests/glr-regression.at: Likewise.
3844 * tests/headers.at: Likewise.
3845 * tests/input.at: Likewise.
3846 * tests/java.at: Likewise.
3847 * tests/output.at: Likewise.
3848 * tests/push.at: Likewise.
3849 * tests/reduce.at: Likewise.
3850 * tests/regression.at: Likewise.
3851 * tests/sets.at: Likewise.
3852 * tests/skeletons.at: Likewise.
3853 * tests/synclines.at: Likewise.
3854 * tests/torture.at: Likewise.
3855 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
3856 tends to hang xsltproc.
3857 (Big horizontal): Likewise.
3858
408476bc
JD
38592007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
3860
3861 In XML output, remove redundant class attribute on symbol element.
3862 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
3863 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
3864 look up a symbol to determine whether it's a nonterminal or terminal.
3865 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
3866 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
3867
3868 Add prec/assoc information to XML output.
3869 * src/gram.c (grammar_rules_print_xml): For each rule that has a
3870 %prec, add a percent_prec attribute.
3871 * src/print-xml.c (print_grammar): For each terminal that has a
3872 precedence or associativity, add a prec or assoc attribute.
3873 (xml_indent): New.
3874 (xml_puts): Use xml_indent.
3875 (xml_printf): Use xml_indent.
3876 * src/print-xml.h (xml_indent): Prototype.
3877
3878 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
3879 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
3880
d4a26c48
JD
38812007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
3882
3883 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
3884 (bison:ruleByNumber): ... this for clarity.
3885 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
3886 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
3887 (xsl:template match="reduction"): Update.
3888 (xsl:template match="item"): Update.
3889 (xsl:template match="reduction"): Update.
3890
3891 In the XML output, don't print the list of rules where symbols appear.
3892 Compute it in XSLT instead. Discussed at
3893 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
3894 * data/xslt/bison.xsl (bison:ruleByLhs): New.
3895 (bison:ruleByRhs): New.
3896 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
3897 bison:ruleByRhs.
3898 (xsl:template match="terminal/rule"): Remove.
3899 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
3900 bison:ruleByRhs.
3901 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
3902 Remove.
3903 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
3904 bison:ruleByRhs and mode="number-link" for rule template.
3905 (xsl:template match="terminal/rule"): Remove.
3906 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
3907 bison:ruleByRhs and mode="number-link" for rule template.
3908 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
3909 Rewrite as...
3910 (xsl:template match="rule" mode="number-link"): ... this.
3911 * src/print-xml.c (print_grammar): Don't print the list of rules.
3912
ef1b4273
JD
39132007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
3914
3915 Don't let --report affect XML output; always print all information.
3916 Discussed at
3917 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
3918 * src/conflicts.c (log_resolution): Implement.
3919 * src/print-xml.c (print_core): Implement.
3920 (print_state): Implement.
3921 (print_xml): Implement.
3922
3923 * NEWS (2.3a+): Fix quotes.
3924 * src/parse-gram.y (prologue_declaration): For consistency with -v,
3925 don't let %verbose clear the list specified by --report.
3926
0f6cd9e3
AD
39272007-11-26 Akim Demaille <akim@epita.fr>
3928
3929 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
3930
d80fb37a
JD
39312007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
3932
3933 In the XML output, list useless and unused symbols and rules with the
3934 useful ones and add a "usefulness" attribute. Discussed starting at
3935 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
3936 * src/gram.c (grammar_rules_partial_print_xml): Remove.
3937 (grammar_rules_print_xml): Print all rules instead of just those
3938 useful in the grammar, and add a "usefulness" attribute.
3939 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
3940 * src/print-xml.c (print_rules_useless_in_parser): Remove.
3941 (print_grammar): Print all nonterminals instead of just useful ones,
3942 and add a "usefulness" attribute to nonterminals and terminals.
3943 (print_xml): Don't print a separate "reductions" or
3944 "rules-useless-in-parser" element.
3945 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
3946 (reduce_xml): Remove.
3947 (reduce_token_unused_in_grammar): New.
3948 (reduce_nonterminal_useless_in_grammar): New.
3949 * src/reduce.h (reduce_xml): Remove prototype.
3950 (reduce_token_unused_in_grammar): Add prototype.
3951 (reduce_nonterminal_useless_in_grammar): Add prototype.
3952 * data/xslt/xml2text.xsl: Update for XML changes.
3953 * data/xslt/xml2xhtml.xsl: Update for XML changes.
3954 * tests/reduce.at (Useless Terminals): Update output.
3955 (Useless Rules): Update output.
3956 (Reduced Automaton): Update output.
3957
3958 Say "Terminals unused in grammar" instead of "Unused terminals".
3959 * NEWS (2.3a+): Update.
3960 * doc/bison.texinfo (Understanding): Update example output.
3961 * src/reduce.c (reduce_output): Implement.
3962 * data/xslt/xml2text.xsl: Implement.
3963 * data/xslt/xml2xhtml.xsl: Implement.
3964
1bb2bd75
JD
39652007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
3966
3967 Accept --report-file=FILE to override the default `.output' filename.
3968 * NEWS (2.3a+): Mention.
3969 * doc/bison.texinfo (Bison Options): Add an entry.
3970 * src/files.c (compute_output_file_names): Don't override
3971 spec_verbose_file if already set.
3972 * src/getargs.c (usage): Document --report-file.
3973 (REPORT_FILE_OPTION): New anonymous enum member.
3974 (long_options): Add entry for it.
3975 (getargs): Add case for it setting spec_verbose_file.
3976
3977 * build-aux/cross-options.pl: Don't record a short option just because
3978 there's an arg.
3979 * doc/.cvsignore: Add yacc.1.
3980
a005a9c4
AD
39812007-11-14 Akim Demaille <akim@epita.fr>
3982
3983 * doc/yacc.1.in: New.
3984 * configure.ac, doc/Makefile.am: Adjust.
3985 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
3986 config.h symbol.
3987 Use AC_SUBST for assignments too.
3988 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
3989
cff03fb2
JD
39902007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
3991
3992 * src/gram.c: Remove comments that duplicate comments in gram.h.
3993
3994 When reporting useless rules and nonterminals, say "useless in grammar"
3995 instead of "useless", and say "useless in parser" instead of "never
3996 reduced". Discussed starting at
3997 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
3998 * NEWS (2.3a+): Mention this change.
3999 * data/xslt/xml2text.xsl: Update output text and expected input XML
4000 element names to match changes below.
4001 * data/xslt/xml2xhtml.xsl: Likewise.
4002 (xsl:template match="bison-xml-report"): Add missing entry in Table of
4003 Contents: "Rules useless in parser due to conflicts".
4004 * doc/bison.texinfo (Decl Summary): Reword a little.
4005 (Understanding): Update example output for changes below.
4006 * src/gram.c: (rule_useful_p): Rename to...
4007 (rule_useful_in_grammar_p): ... this.
4008 (rule_useless_p): Rename to...
4009 (rule_useless_in_grammar_p): ... this.
4010 (rule_never_reduced_p): Rename to...
4011 (rule_useless_in_parser_p): ... this.
4012 (grammar_rules_print): Update for renames.
4013 (grammar_rules_print_xml): Update for renames.
4014 (grammar_rules_never_reduced_report): Rename to...
4015 (grammar_rules_useless_report): ... this since it is used for either
4016 kind of useless rule.
4017 * src/gram.h: Reword comments and update function names in prototypes.
4018 * src/main.c (main): Say "rule useless in parser due to conflicts".
4019 * src/print-xml.c (print_rules_never_reduced): Rename to...
4020 (print_rules_useless_in_parser): ... this, and rename output XML
4021 element "rules-never-reduced" to "rules-useless-in-parser".
4022 (print_xml): Update for rename.
4023 * src/print.c (print_results): Say "Rules useless in parser due to
4024 conflicts".
4025 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
4026 (nonterminals_reduce): Say "nonterminal useless in grammar".
4027 (reduce_output): Say "Nonterminals useless in grammar".
4028 Say "Rules useless in grammar".
4029 (reduce_xml): Rename output XML element "useless" to
4030 "useless-in-grammar".
4031 (reduce_print): Don't report the count of grammatically useless rules
4032 as "rules never reduced" just because %yacc is specified.
4033 In the correct report of this count, say nonterminal(s) and rule(s)
4034 "useless in grammar".
4035 * tests/conflicts.at (S/R in initial): Update expected output.
4036 (Defaulted Conflicted Reduction): Likewise.
4037 (Unreachable States After Conflict Resolution): Likewise.
4038 * tests/existing.at (GNU pic Grammar): Likewise.
4039 * tests/reduce.at (Useless Nonterminals): Likewise.
4040 (Useless Rules): Likewise.
4041 (Reduced Automaton): Likewise.
4042 (Underivable Rules): Likewise.
4043 (Empty Language): Likewise.
4044
66f0441d
JD
40452007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
4046
4047 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
4048 here document and before the EOF so that BSD's implementation of Bourne
4049 shell doesn't parse the delimiter as part of the here document.
4050 * doc/.cvsignore: Add cross-options.texi.
4051 * src/getargs.c (usage): Add a blank line after the warning categories.
4052
d0ee4105
PB
40532007-11-08 Paolo Bonzini <bonzini@gnu.org>
4054
4055 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
4056
e8b1fb9b
AD
40572007-11-05 Akim Demaille <akim@epita.fr>
4058
4059 Remove Id: from bison.1.
4060 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
4061 (perl -0777 -pi -e 's/\.PP\nId): New.
4062 (.x.1): Use it to ignore the version control revision.
4063
2f7a96b5
AD
40642007-11-05 Akim Demaille <demaille@gostai.com>
4065
4066 * build-aux/Makefile.am: Ship cross-options.pl.
4067 * doc/Makefile.am: Always refer to cross-options.texi with
4068 $(srcdir).
4069 (MAINTAINERCLEANFILES): Add it.
4070
f4101aa6
AD
40712007-11-04 Akim Demaille <demaille@gostai.com>
4072
4073 Generate the long/short option cross-table.
4074 * build-aux/cross-options.pl: New.
4075 * doc/Makefile.am (cross-options.texi): New.
4076 * doc/bison.texinfo: Use it.
4077
727a1401
AD
40782007-11-04 Akim Demaille <demaille@gostai.com>
4079
4080 Generate bison.1 using help2man.
4081 * doc/common.x, doc/bison.x: New.
4082 * doc/Makefile.am (bison.1, .x.1): New.
4083 The code is taken from autoconf-2.61/man/Makefile.am.
4084 * configure.ac: Look for help2man.
4085
6aeb9c57
AD
40862007-11-04 Akim Demaille <demaille@gostai.com>
4087
4088 Complete --help.
4089 * src/getargs.c (usage): Document -W, make it clear that -d,
4090 -g and -x have optional arguments.
4091
d7be4085
AD
40922007-11-04 Akim Demaille <demaille@gostai.com>
4093
4094 Find sha1sum when named gsha1sum.
4095 * bootstrap (find_tool): New.
4096 ($SHA1SUM): New.
4097
d9df47b6
JD
40982007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
4099
4100 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
4101 at
4102 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
4103 * NEWS (2.3a+): Mention.
4104 * data/bison.m4 (b4_pure_if): Don't define it here.
4105 * data/c.m4 (b4_identification): Depend on individual skeletons to
4106 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
4107 values of the %define variables api.pure or api.push_pull. Define
4108 YYPURE, YYPUSH, and YYPULL accordingly.
4109 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
4110 glr.cc has already defined b4_pure_flag.
4111 * data/push.c: Define b4_pure_if based on `%define api.pure'.
4112 Remove YYPUSH and YYPULL since they're back in b4_identification again.
42ee26bb 4113 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
d9df47b6
JD
4114 * doc/bison.texinfo (Pure Decl): Update.
4115 (Push Decl): Update.
4116 (Decl Summary): Add api.pure to %define entry.
4117 In %pure-parser entry, say it's deprecated and reference %define.
4118 (Pure Calling): Update.
4119 (Error Reporting): Update.
4120 (C++ Scanner Interface): Update.
4121 (How Can I Reset the Parser): Update.
4122 (Table of Symbols): In %pure-parser entry, say it's deprecated and
4123 reference %define.
4124 * src/getargs.c (pure_parser): Remove global variable.
4125 * src/getargs.h (pure_parser): Remove extern.
4126 * src/output.c (prepare): Don't define pure_flag muscle.
4127 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
4128 wrapper around `%define api.pure'.
4129 * tests/calc.at (Simple LALR Calculator): Update.
4130 (Simple GLR Calculator): Update.
4131 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
4132 Update.
4133 (GLR: Resolve ambiguity, pure, locations): Update.
4134 (GLR: Merge conflicting parses, pure, no locations): Update.
4135 (GLR: Merge conflicting parses, pure, locations): Update.
4136 * tests/glr-regression.at (Uninitialized location when reporting
4137 ambiguity): Update
4138 * tests/input.at (Unused %define api.pure): New test case.
4139 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
4140 AT_PURE_IF and AT_PURE_AND_LOC_IF.
4141 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
4142
c373bf8b
JD
41432007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
4144
4145 %define push_pull -> %define api.push_pull. Discussed starting at
4146 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
4147 * data/push.c: Expect the new name.
4148 * data/yacc.c: Likewise.
4149 * doc/bison.texinfo (Push Decl): Update.
4150 (Decl Summary): Update %define entry.
4151 (Push Parser Function): Update.
4152 (Pull Parser Function): Update.
4153 (Parser Create Function): Update.
4154 (Parser Delete Function): Update.
4155 * tests/calc.at (Simple LALR Calculator): Update.
4156 * tests/input.at (%define enum variables): Update.
4157 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
4158 (Push Parsing: Multiple impure instances): Update.
4159 (Push Parsing: Unsupported Skeletons): Update.
4160 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
4161 (Exploding the Stack Size with Malloc): Update.
4162
4163 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
4164 other entries some.
4165
32f19b6b
JD
41662007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
4167
4168 For the XML output's terminal element, rename @number to @token-number,
4169 and add @symbol-number. In the nonterminal element, rename @number to
4170 @symbol-number. Discussed starting at
4171 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
4172 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
4173 renames.
4174 (xsl:template match="nonterminal"): Likewise.
4175 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
4176 (xsl:template match="nonterminal"): Likewise.
4177 * src/print-xml.c (print_grammar): Implement.
4178
255a6b90
JD
41792007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4180
4181 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
4182 2007-10-11 change, the child elements here are items not rules.
408476bc 4183 (xsl:template match="item"): New.
255a6b90
JD
4184 (xsl:template match="rule"): Update for new reduced itemset.
4185 (xsl:template match="point"): Remove.
4186 (xsl:template match="empty"): For consistency with --graph, don't
4187 output "/* empty */".
4188 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
4189 line-wrap, don't pass a negative value as first-line-length since this
4190 won't work with the following changes.
4191 (xsl:template name="line-wrap"): Simplify slightly.
4192 (xsl:template name="ws-search"): Eliminate recursion.
4193 * src/print_graph.c (print_core): Don't print a reduction's lookahead
4194 set next to an item whose dot is not at the end of the RHS even if it
4195 happens to be associated with the same rule.
4196
88c78747
JD
41972007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
4198
31984206
JD
4199 Add %define lr.keep_unreachable_states.
4200 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
4201 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
4202 * src/main.c (main): Implement it.
4203 * tests/conflicts.at (Unreachable States After Conflict Resolution):
4204 Extend to test it, and fix a typo.
4205
42062007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
4207
4208 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
4209 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
4210 the example .output text.
4211 * tests/regression.at (Extra lookahead sets in report): Improve wording
4212 of comments.
4213
b7a70162
WP
42142007-10-17 Wojciech Polak <polak@gnu.org>
4215
4216 * src/print-xml.c (print_grammar): Renamed
4217 <terminal> and <nonterminal> attributes:
4218 "type" to "number" and "symbol" to "name".
4219 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
4220 Use new attribute names.
4221 (xsl:template match="nonterminal"): Likewise.
4222 * data/xslt/xml2xhtml.xsl: Likewise.
4223
a0de5091
JD
42242007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
4225
4226 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
4227 (Option Cross Key): Likewise.
4228
4229 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
4230 next to an item whose dot is not at the end of the RHS even if it
4231 happens to be associated with the same rule.
4232 * src/print.c (print_core): Likewise.
4233 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
4234 (Resolved SR Conflicts): Update output.
4235 * tests/regression.at (Extra lookahead sets in report): New test case.
4236
4c20d18d
WP
42372007-10-11 Wojciech Polak <polak@gnu.org>
4238
4239 * src/print-xml.c (print_core): Remove item set
4240 redundancy.
4241 * data/xslt/bison.xsl (bison:ruleNumber): New key.
4242 Improve processing time. Suggested by Joel E. Denny.
4243 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
4244 Write xsl:param "required" attribute as comment.
4245 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
4246 (xsl:template match="rule"): Support new reduced itemset.
4247 (xsl:template match="point"): Remove.
4248 * data/xslt/xml2xhtml.xsl: Likewise.
4249
f506ad1c
JD
42502007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
4251
4252 * src/getargs.c (version): Update copyright year.
4253
21f1b063
JD
42542007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
4255
4256 Make xml2dot.xsl and --graph produce the same output.
4257 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
4258 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
4259 escaped later.
4260 (xsl:template name="output-node"): Use the new escape template instead
4261 of the string-replace template directly.
4262 (xsl:template name="output-edge"): Likewise.
4263 (xsl:template name="escape"): New, escapes backslashes and newlines in
4264 addition to quotation marks.
4265 * src/graphviz.c (start_graph, output_node, output_edge): Add
4266 whitespace to output for legibility.
4267
4268 Make xml2text.xsl and --report produce the same output, and remove the
4269 XML "conflicts" element since a conflict summary is easily extracted
4270 from the automaton.
4271 * data/xslt/bison.xsl: New.
4272 (xsl:template match="state" mode="bison:count-conflicts): New.
4273 * data/xslt/xml2text.xsl: Import bison.xsl.
4274 (xsl:template match="bison-xml-report"): Instead of styling the
4275 "conflicts" element, style the "automaton" element with mode
4276 "conflicts". Unlike the former, the latter lists S/R and R/R
4277 conflicts for a state on the same line.
4278 (xsl:template match="conflicts"): Remove.
4279 (xsl:template match="conflict"): Remove.
4280 (xsl:template match="terminal"): Line-wrap the list of rules in which
4281 the terminal is used.
4282 (xsl:template match="nonterminal"): Likewise for nonterminals.
4283 (xsl:template match="automaton" mode="conflicts"): New.
4284 (xsl:template match="state" mode="conflicts"): New.
4285 (xsl:template name="line-wrap"): New.
4286 (xsl:template name="ws-search"): New.
4287 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
4288 (xsl:template match="bison-xml-report"): Instead of styling the
4289 "conflicts" element, style the "automaton" element with mode
4290 "conflicts."
4291 (xsl:template match="conflicts"): Remove.
4292 (xsl:template match="conflict"): Remove.
4293 (xsl:template match="automaton" mode="conflicts"): New.
4294 (xsl:template match="state" mode="conflicts): New.
4295 * src/conflicts.c (conflicts_output_xml): Remove.
4296 * src/conflicts.h (conflicts_output_xml): Remove prototype.
4297 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
4298 * src/print.c (print_grammar): Consistently wrap at the 66th column so
4299 the corresponding XSLT is easier. Also, never wrap between a word and
4300 the comma that follows it.
4301
793fbca5
JD
43022007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
4303
4304 Improve C++ namespace support. Discussed starting at
4305 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
4306 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
4307 b4_namespace_close): New macros that interpret the %define variable
4308 "namespace" so its value can contain "::" to indicate nested
4309 namespaces.
4310 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
4311 the above macros.
4312 * data/lalr1.cc (b4_namespace): Likewise.
4313 * data/location.cc (b4_namespace): Likewise.
4314 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
4315 inside a new table in the general %define entry. Document `%define
4316 namespace' there as well. Point the %name-prefix entry to it since it
4317 explains it more completely in the case of C++.
4318 (C++ Bison Interface): Mention `%define namespace' instead of
4319 %name-prefix.
4320 (Table of Symbols): Remove the `%define push_pull' entry. The %define
4321 entry suffices.
4322 * tests/c++.at (Relative namespace references): New test case.
4323 (Absolute namespace references): New test case.
4324 (Syntactically invalid namespace references): New test case.
4325 * tests/input.at (C++ namespace reference errors): New test case.
4326
35b8730d
JD
43272007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
4328
4329 Add syncline support and location accessor to internal %define
4330 interfaces.
4331 * data/bison.m4 (b4_percent_define_get_loc): New.
4332 (b4_percent_define_get_syncline): New.
4333 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
4334 (b4_percent_define_default): Record defining location as line 1 rather
4335 than 0 for the sake of synchronizing #line's, and define
4336 b4_percent_define_syncline(VARIABLE).
4337 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
4338 * src/muscle_tab.c (muscle_syncline_grow): New.
4339 (muscle_code_grow): Use muscle_syncline_grow.
4340 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
4341 define b4_percent_define_syncline(VARIABLE).
4342 (muscle_percent_define_get_loc): New.
4343 (muscle_percent_define_get_syncline): New.
4344 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
4345 remove some unused variables.
4346 (muscle_percent_define_default): Record defining location as line 1
4347 rather than 0 for the sake of synchronizing #line's, and define
4348 b4_percent_define_syncline(VARIABLE).
4349 (muscle_percent_define_check_values): Use
4350 muscle_percent_define_get_loc.
4351 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
4352 (muscle_percent_define_get_syncline): Prototype.
4353 * tests/skeletons.at (%define Boolean variables: invalid skeleton
4354 defaults): Update output for location change.
4355 (Complaining during macro argument expansion): Extend to test
4356 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
4357
7dc4a694
JD
43582007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
4359
4360 Fix some error-reporting macro bugs.
4361 * data/bison.m4 (b4_cat): New.
4362 (b4_error, b4_error_at): Use b4_cat to send error directives directly
4363 to stdout so they don't become arguments to other macros. Update
4364 comments and add examples.
4365 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
4366 add examples.
4367 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
4368 after printing the error directive so that M4 doesn't report subsequent
4369 problems that are induced by this problem.
4370 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
4371 instead of just in them. Recognize @\n in both places. Both expand to
4372 the empty string. Needed by b4_cat.
4373 * tests/skeletons.at (Complaining during macro argument expansion):
4374 New test case.
4375 (Fatal errors make M4 exit immediately): New test case.
4376
d4bd2295
JD
43772007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
4378
4379 Implement --print-datadir.
4380 * src/getargs.c (usage): Mention.
4381 (PRINT_DATADIR_OPTION): New anonymous enum member.
4382 (long_options): Add entry for it.
4383 (getargs): Add case for it calling compute_pkgdatadir.
4384 * src/output.c (output_skeleton): Encapsulate data directory
4385 computation from here...
4386 (prepare): ... and from here...
4387 (compute_pkgdatadir): ... into this new function.
4388 * src/output.h (compute_pkgdatadir): Prototype.
4389
34cdeddf
JD
43902007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
4391
4392 * src/print-xml.c (escape_bufs): New static global variable
4393 replacing...
4394 (xml_escape_n): ... the static local variable buf here.
4395 (print_xml): Free memory for escape_bufs.
4396 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
4397
d782395d
JD
43982007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
4399
4400 Replace `%push-parser' and `%push-pull-parser' with
4401 `%define push_pull "push"' and `%define push_pull "both"'.
4402 `%define push_pull "pull"' is the default.
4403 * doc/bison.texinfo (Push Decl, Push Parser Function,
4404 Pull Parser Function, Parser Create Function, Parser Delete Function):
4405 Update declarations.
4406 (Decl Summary, Table of Symbols): Replace %push-parser and
4407 %push-pull-parser entries with a %define push_pull entry.
4408 * data/bison.m4 (b4_percent_define_check_values): New macro.
4409 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
4410 definitions...
4411 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
4412 definitions...
4413 * data/push.c: ... to here and compute them from the value of the
4414 %define variable push_pull.
4415 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
4416 parsing requests here...
4417 * data/yacc.c: ... hack this to switch to push.c any time
4418 b4_use_push_pull_flag or the %define variable push_pull is set. This
4419 will go away when we mv push.c yacc.c.
4420 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
4421 push parsing is not supported since unused %define variables are
4422 reported anyway.
4423 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
4424 * src/muscle_tab.h (muscle_percent_define_check_values): Update
4425 comments for consistency with b4_percent_define_check_values.
4426 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
4427 muscles.
4428 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
4429 Remove.
4430 (prologue_declaration): Remove %push-parser and %push-pull-parser
4431 rules.
4432 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
4433 * tests/calc.at: Update declarations.
4434 * tests/input.at (%define enum variables): New test case.
4435 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
4436 declaration.
4437 (Push Parsing: Multiple impure instances): Update declaration.
4438 (Push Parsing: Unsupported Skeletons): New test case.
4439 * tests/torture.at (Exploding the Stack Size with Alloca): Update
4440 declaration.
4441 (Exploding the Stack Size with Malloc): Update declaration.
4442
3f999f78
WP
44432007-09-24 Wojciech Polak <polak@gnu.org>
4444
4445 Add XSLT transformations.
4446
4447 * data/xslt/xml2dot.xsl: Transform XML into DOT.
4448 * data/xslt/xml2text.xsl: Transform XML into plain text.
4449 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
4450 * data/Makefile.am (xsltdir): New variable.
4451 (dist_xslt_DATA): Add xslt/*.xsl files.
4452
a4f75309
PE
44532007-09-23 Paul Eggert <eggert@cs.ucla.edu>
4454
4455 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
4456 Problem reported by Wojciech Polak.
4457 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
4458 (xml_printf): Undo change I made on 21 September; that is,
4459 indent 2 spaces, not 1.
4460
ad5feac4
JD
44612007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
4462
4463 Pacify ./configure --enable-gcc-warnings.
4464 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
4465 `char const *' instead of `char *'.
4466 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
4467 local variable `sep'.
4468
41d7a5f2
PE
44692007-09-21 Paul Eggert <eggert@cs.ucla.edu>
4470
4471 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
4472 elsewhere.
4473 * src/print-xml.c: Prefer "const" after types; that's more consistent.
4474 (xml_printf): Indent just 1 space for level.
4475 (e_char, xlate_char): Remove.
4476 (xml_escape_string): Rewrite to avoid undefined behavior (used
4477 storage that was freed from the stack).
4478 (xml_escape_n): Don't bother checking for subscript error.
4479
3f999f78
WP
44802007-09-21 Wojciech Polak <polak@gnu.org>
4481
4482 Add Bison XML Automaton Report.
41d7a5f2
PE
4483
4484 Add support for an -x option to generate an XML report.
4485 It is not documented yet.
4486 * src/print-xml.c: New file.
4487 * src/print-xml.h: Likewise.
4488 * lib/timevar.def (TV_XML): New var.
4489 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
4490 * src/conflicts.c: Include print-xml.h.
4491 (solved_conflicts_xml_obstack): New var.
4492 (log_resolution, conflicts_solve, conflicts_free):
4493 Add support for XML report.
4494 (conflicts_output_val): New function.
4495 * src/conflicts.h (conflicts_output_val): New decl.
4496 * src/files.c (spec_xml_file): New var.
4497 (compute_output_file_names, output_file_names_free): Add XML support.
4498 * src/files.h (spec_xml_file): New decl.
4499 * src/getargs.c (xml_flag): New var.
4500 (usage, short_options, long_options, getargs): Add XML support.
4501 * src/getargs.h (xml_flag): New decl.
4502 * src/gram.c: Include print-xml.h.
4503 (rule_lhs_print_xml, rule_rhs_print_xml):
4504 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
4505 New functions.
4506 * src/gram.h: Declare external ones.
4507 * src/main.c: Include print-xml.h.
4508 (main): Add XML support.
4509 * src/reduce.c: Include print-xml.h.
4510 (reduce_xml): New function.
4511 * src/reduce.h: Declare it.
4512 * src/state.c: Include print-xml.h.
4513 (state_new): Add XML support.
4514 (state_rule_lookahead_tokens_print_xml): New function.
4515 * src/state.h: Declare it.
4516 (struct state): New member solved_conflicts_xml.
4517 * src/symtab.c (symbol_class_get_string): New function.
4518 * src/symtab.h: Declare it.
4519
6d8e724d
PE
45202007-09-21 Paul Eggert <eggert@cs.ucla.edu>
4521
4522 * GNUmakefile: Switch to coreutils's version.
4523 * bootstrap: Likewise.
4524 * Makefile.cfg: Adjust to new GNUmakefile.
4525 * README-hacking: Likewise.
4526
4527 Import from gnulib:
4528
4529 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
4530 Bruno Haible <bruno@clisp.org>
4531
4532 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
4533 and is a script that invokes bison. Tighten the code. Add comments.
4534
922bdd7f
JD
45352007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
4536
4537 Spell "boolean" as "Boolean". Reported by Akim Demaille.
4538 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
4539 * doc/bison.texinfo (Decl Summary): Fix.
4540 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
4541 * tests/input.at (Boolean %define variables): Update output.
4542 * tests/skeletons.at (%define boolean variables: invalid skeleton
4543 defaults): Rename to...
4544 (%define Boolean variables: invalid skeleton defaults): ... this and
4545 update output.
4546
1b17b01d
JD
45472007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
4548
4549 In impure push mode, don't allow more than one yypstate to be allocated
4550 since multiple impure parsers would corrupt yynerrs.
4551 * data/push.c (yypstate_allocated): New static global variable
4552 initialized to 0.
4553 (yypull_parse): If yypstate_new returns 0, don't report it as memory
4554 exhaustion if yypstate_allocated is 1, but still return 2.
4555 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
4556 already 1. Otherwise, set it to 1.
4557 (yypstate_delete): Set it to 0.
4558 * tests/push.at (Push Parsing: Multiple impure instances): New test
4559 case.
4560
9987d1b3
JD
45612007-08-17 Bob Rossi <bob@brasko.net>
4562
4563 * doc/bison.texinfo (Push Decl): Document the push parser.
4564 (Table of Symbols): Ditto.
4565 (Pure Decl): Ditto.
4566 (Decl Summary): Ditto.
4567 (Multiple Parsers, Push Parser Function, Pull Parser Function,
4568 Parser Create Function, Parser Delete Function):
4569 Add new push parser symbols.
4570 (Table of Symbols): Document push-parser, push-pull-parser,
4571 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
4572
f16b0819
PE
45732007-08-15 Paul Eggert <eggert@cs.ucla.edu>
4574
4575 Update to GPLv3.
4576 * doc/gpl-3.0.texi: New file.
4577 * doc/gpl.texi: Remove.
4578 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
4579 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
4580 * README-hacking, TODO, bootstrap, bootstrap.conf:
4581 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
4582 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
4583 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
4584 * data/lalr1.cc, data/lalr1.java, data/location.cc:
4585 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
4586 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
4587 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
4588 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
4589 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
4590 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
4591 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
4592 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
4593 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
4594 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
4595 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
4596 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
4597 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
4598 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
4599 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
4600 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
4601 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
4602 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
4603 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
4604 * src/complain.c, src/complain.h, src/conflicts.c:
4605 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
4606 * src/files.h, src/flex-scanner.h, src/getargs.c:
4607 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
4608 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
4609 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
4610 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
4611 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
4612 * src/print.c, src/print.h, src/print_graph.c:
4613 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
4614 * src/reduce.h, src/relation.c, src/relation.h:
4615 * src/revision.h, src/scan-code.h, src/scan-code.l:
4616 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
4617 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
4618 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
4619 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
4620 * tests/Makefile.am, tests/actions.at, tests/c++.at:
4621 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
4622 * tests/existing.at, tests/glr-regression.at:
4623 * tests/headers.at, tests/input.at, tests/java.at:
4624 * tests/local.at, tests/output.at, tests/push.at:
4625 * tests/reduce.at, tests/regression.at, tests/sets.at:
4626 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
4627 * tests/torture.at:
4628 Update to GPLv3.
4629
728c4be2
JD
46302007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
4631
4632 Get rid of broken %no-parser, -n, and --no-parser implementation and
4633 documentation.
4634 * TODO: Don't mention them.
4635 * doc/bison.1: Likewise.
4636 * doc/bison.texinfo (Decl Summary): Likewise.
4637 (Bison Options): Likewise.
4638 (Option Cross Key): Likewise.
4639 * src/getargs.c (no_parser_flag): Remove global variable.
4640 (usage): Don't print description of -n and --no-parser.
4641 (long_options): Remove --no-parser entry here.
4642 (getargs): Remove -n case in the switch here.
4643 * src/getargs.h (no_parser_flag): Remove extern.
4644 * tests/regression.at (Web2c Actions): Remove comment that mentions
4645 --no-parser.
4646
5d31a216
JD
46472007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
4648
4649 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
4650 name user variables starting with `yy'. Just pass NULL instead of a
4651 dummy local &yylval to yypush_parse.
4652 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
4653 starting with `yy'.
4654
a2ea208d
JD
46552007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
4656
4657 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
4658 true since it's then always used regardless of whether yyoverflow is
4659 defined. Reported by Christian Burger at
4660 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
4661 * THANKS: Add Christian Burger.
4662
91661ebb
JD
4663 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
4664 node names: say "Decl Summary" not "Bison Declaration Summary".
4665
cbd50549
JD
46662007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
4667
4668 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
4669 determine whether this function has already complained about an invalid
4670 value for a %define boolean variable, don't check whether Bison has
4671 ever examined the value. As written, the check was a tautology.
4672 Instead, record and check for this complaint using a separate muscle.
4673
eb1b0740
JD
46742007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4675
4676 Fix push parsing memory leak reported by Brandon Lucia at
4677 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
4678 * THANKS: Add Brandon Lucia.
4679 * data/push.c (yypstate_delete): Free the stack if it was reallocated
4680 but the parse never completed and thus freed it.
4681 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
4682 * tests/testsuite.at: Include push.at.
4683 * test/push.at: New.
4684 (Push Parsing: Memory Leak for Early Deletion): New test case.
4685
9d774aff
JD
46862007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
4687
4688 Improve handling of multiple S/R conflicts in the same state and of S/R
4689 conflicts involving multiple reductions.
4690 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
4691 set for a state here or Bison will abort if it is reassigned on a
4692 later conflicted reduction in the same state.
4693 Similarly, don't finalize and assign the solved conflicts report here
4694 or it will be lost if it is reassigned on a later conflicted reduction
4695 in the same state.
4696 (set_conflicts): Instead, assign them both here after all S/R conflicts
4697 in the state have been fully examined.
4698 * src/print.c (shift_set): Rename to...
4699 (no_reduce_set): ... this.
4700 (print_reductions): Update for rename, and add %nonassoc error action
4701 tokens to no_reduce_set so that, when printing the first remaining
4702 reduction on an error action token, the reduction is enclosed in
4703 brackets.
4704 (print_results): Update for rename.
4705 * tests/conflicts.at (Solved conflicts report for multiple reductions
4706 in a state): New test case.
4707 (%nonassoc error actions for multiple reductions in a state): New test
4708 case.
4709
4710 * src/main.c (main): Don't depend on C99 features.
4711
10159d2a
JD
47122007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
4713
4714 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
4715 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
4716 uniwidth.
10159d2a 4717
953b3935
JD
47182007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
4719
4720 * bootstrap (slurp): Create target directories that don't exist.
4721 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
4722
6ce2d93a
JD
47232007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
4724
4725 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
4726 than item number.
4727 * closure.c (closure): Likewise.
4728 * state.h (reductions): Comment sorting of rules.
4729 (state): Comment sorting of items.
4730
ce3448d5
JD
47312007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
4732
4733 Fix C++ test cases after recent Gnulib changes. Discussed starting at
4734 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
4735 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
4736 definition in order to avoid Gnulib headers since we don't use config.h
4737 here.
4738 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
4739 rather than AT_DATA so that config.h is included.
4740
8a86eef0
JD
47412007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
4742
4743 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
4744 instead of fprintf. Guard these functions with #if YYDEBUG instead of
4745 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
4746 and so that YYFPRINTF is guaranteed to be defined here.
4747
b1a81613
JD
47482007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
4749
4750 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
4751 with...
4752 (muscle_percent_define_check_values): ... this more helpful function.
4753 Again, it's not used yet, but it will be.
4754 * src/muscle_tab.h: Likewise.
4755
71b61d4d
JD
4756 Improve some comments in parser table construction.
4757 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
4758 (generate_states): Don't mention ruleset, which is internal to closure.
4759 * src/closure.c (closure): Explain sorting of core and itemset, which
4760 is required for this function to behave correctly.
4761 * src/closure.h (closure): Mention sorting.
4762
2a6b783d
JD
47632007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
4764
4765 * src/lalr.c (state_lookahead_tokens_count): For code readability,
4766 move the check for disabled transitions to an aver since conflict
4767 resolution hasn't happened yet.
4768
4769 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
4770 labels a state as inconsistent just because it has error transitions.
4771 The original form of this check appeared in revision 1.1 of lalr.c,
4772 which was committed on 1991-12-21. Now (at least), changing the
4773 consistency label on such a state appears to have no useful effect in
4774 any of the places it is examined, which I enumerate below. The key
4775 point to understanding each item in this enumeration is that a state
4776 with an error transition is labelled consistent in the first place only
4777 if it has no rules, so the check cannot matter for states that have
4778 rules. (1) Labelling a state as inconsistent will cause set_conflicts
4779 to try to identify its conflicts, and a state must have *rules* to have
4780 conflicts. (2) Labelling a state as inconsistent will affect how
4781 action_row sets the default *rule* for the state. (3) Labelling a
4782 state as inconsistent will cause build_relations to add lookback edges
4783 to *rules* in that state.
4784 * src/state.h (struct state): Word the comment for member consistent
4785 more carefully.
4786
14462c2b
JD
47872007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4788
4789 Don't depend on C99 features.
4790 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
4791 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
4792 * src/reader.c (check_and_convert_grammar): Fix for-loop.
4793 * src/state.c (state_mark_reachable_states): Fix for-loop.
4794 (state_remove_unreachable_states): Fix for-loop.
4795
4796 Don't widen struct state with member reachable just to temporarily
4797 record reachability. Instead, use a local bitset.
4798 * src/state.h (struct state): Remove member.
4799 * src/state.c (state_new): Don't initialize it.
4800 (state_mark_reachable_states): Rename to...
4801 (state_record_reachable_states): ... this, and use bitset.
4802 (state_remove_unreachable_states): Use bitset.
4803
5a43d418
JD
48042007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
4805
4806 * src/Makefile.am (yacc): Quote target action commands properly so
4807 that the yacc script isn't corrupt. Reported by Hans Aberg at
4808 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
4809
0c650a20
JD
4810 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
4811 the case of pure parsers. Reported by Frans Englich at
4812 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
4813 * THANKS: Add Frans Englich.
4814
61fee93e
JD
4815 * NEWS (2.3a+): In the %code entry, reference section `Bison
4816 Declaration Summary' from the manual now since the %code summary has
4817 moved there.
4818 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
4819 in the rules section must be terminated by semicolons.
4820
f124d423
JD
48212007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
4822
4823 Extend the front-end API for %define variables to more completely
4824 mirror the back-end. This will be useful in the future.
4825 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
4826 Update comments to mention the new front-end counterparts of these
4827 macros.
4828 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
4829 for muscle_string_decode and muscle_location_decode.
4830 (muscle_string_decode): New static function.
4831 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
4832 (muscle_percent_define_get, muscle_percent_define_ifdef): New
4833 functions.
4834 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
4835 muscle_percent_define_get to mimic the b4_percent_define_flag_if
4836 implementation more closely.
4837 (muscle_percent_define_invalid_value): New function.
4838 * src/muscle_tab.h (muscle_percent_define_get,
4839 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
4840 Prototype.
4841
75ad86ee
JD
48422007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
4843
4844 * NEWS (2.3a+): Mention yesterday's state-removal change.
4845 (2.3a): Remove the %language entry, which was added after 2.3a.
4846 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
4847 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
4848 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
4849 tests/existing.at: Update copyright date.
4850
5967f0cf
JD
48512007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4852
4853 If conflict resolution makes states unreachable, remove those states,
4854 report rules that are then unused, and don't report conflicts in those
4855 states.
4856 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
4857 New global function.
4858 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
4859 function.
4860 * src/main.c (main): After conflict resolution, remove the unreachable
4861 states and update all data structures that reference states by number.
4862 * src/state.c (state_new): Initialize each state's reachable member to
4863 false.
4864 (state_mark_reachable_states): New static function.
4865 (state_remove_unreachable_states): New global function.
4866 * src/state.h (struct state): Add member bool reachable.
4867 (state_remove_unreachable_states): Prototype.
4868 * tests/conflicts.at (Unreachable States After Conflict Resolution):
4869 New test case.
4870 * tests/existing.at (GNU pic Grammar): Update test case output now that
4871 an unused rule is discovered.
4872
b09f4f48
JD
48732007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4874
4875 Minor code cleanup in parser table construction.
4876 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
4877 (new_itemsets, save_reductions): Update for rename to nitemset.
4878 * src/closure.c (nritemset): Rename to...
4879 (nitemset): ... this since the "r" appears to meaningless and isn't
4880 used in the comments.
4881 (closure): Update for rename.
4882 * src/closure.h (nritemset): Update extern to...
4883 (nitemset): ... this.
4884 * src/lalr.c (LA): Fix a typo in comments.
4885 * src/print.c (print_core): Update for rename to nitemset.
4886 * src/print_graph.c (print_graph): Likewise.
4887 * src/state.h: Fix some typos in header comments.
4888
bbb44d83
PE
48892007-04-04 Paul Eggert <eggert@cs.ucla.edu>
4890
9b33de72
PE
4891 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
4892 still sticks to ASCII. Sorry!
4893
bbb44d83
PE
4894 * README-hacking: New file, taken mostly from coreutils, with changes
4895 for Bison. Contains much of the contents of:
4896 * README-cvs: Remove.
4897 * bootstrap: Sync from gnulib.
4898 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
4899 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
4900
29553547
JD
49012007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
4902
4903 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
4904 Setzer.
4905 (Java Differences): Fix some typos.
4906 * THANKS: Add Sebastian Setzer.
4907
01b477c6
PB
49082007-03-07 Paolo Bonzini <bonzini@gnu.org>
4909
730739e4
AD
4910 * data/java.m4 (b4_single_class_if): Remove.
4911 (b4_abstract_if): Look at "%define abstract".
4912 (b4_lexer_if): New.
4913 (b4_union_name): Rename...
4914 (b4_yystype): ... to this. Map to "%define stype".
4915 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
4916 b4_maybe_throws): Fix quoting.
4917 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
4918 * data/lalr1.java (Lexer interface): Always define.
4919 (Lexer interface within parser class): Remove.
4920 (YYLexer class): New, used when "%code lexer" is present.
4921 (constructor): When "%code lexer" is used, pass %lex-param
4922 to the lexer constructor.
4923 (yylex, yyparse): Remove %lex-param from method invocations
4924 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
4925
4926 * doc/bison.texinfo (Java Bison Interface): Mention "%define
4927 abstract". Rename "%define union_name" to "%define stype".
4928 Rename method names according to previous patch.
4929 (Java Scanner Interface): Describe "%code lexer" instead of
4930 "%pure-parser" and "%define single_class".
4931 (Java Differences): Mention "%code lexer".
4932
4933 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
4934 Include scanner here, using macros from tests/local.at.
4935 (AT_DATA_CALC_Y): Remove final argument.
4936 (_AT_CHECK_JAVA_CALC): Likewise.
4937 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
4938 of %locations and %error-verbose.
4939 (main): Test with and without %lex-param.
4940 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
4941 (AT_BISON_OPTION_POPDEFS): Pop it.
01b477c6 4942
122bea3a
JMG
49432007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4944
4945 DJGPP spefic issue. Inhibit the use of disallowed characters for
4946 file name genertion on Win98, WinXP, etc. These are |<>":?*\
4947 and concern testsuite case 46.
4948 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
4949 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
4950 * djgpp/config.bat: Inhibit the use of disallowed characters.
4951
9611cfa2
JD
49522007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4953
4954 Miscellaneous %define and %code cleanup.
4955 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
4956 values are interpreted.
4957 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
4958 documentation a little more.
4959 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
4960 muscle_percent_define_insert, muscle_percent_code_grow): New
4961 functions/macros.
4962 * src/muscle_tab.h (muscle_percent_define_insert,
4963 muscle_percent_code_grow): Prototype.
4964 * src/parse-gram.y (prologue_declaration): Use
4965 muscle_percent_define_insert and muscle_percent_code_grow when parsing
4966 %define and %code directives.
4967
4968 Make it easy to share %define boolean variables between the front-end
4969 and back-end. Though not used yet, this will be useful in the future.
4970 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
4971 Bison uses of names rather than just skeleton uses of names.
4972 (b4_percent_define_get, b4_percent_define_ifdef): Rename
4973 b4_percent_define_skeleton_variables(VARIABLE) to
4974 b4_percent_define_bison_variables(VARIABLE).
4975 (b4_percent_code_get, b4_percent_code_ifdef): Rename
4976 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
4977 b4_percent_code_bison_qualifiers(QUALIFIER).
4978 (b4_check_user_names_wrap): Update for renames.
4979 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
4980 muscle_percent_define_default): New functions mimicking
4981 b4_percent_define_flag_if and b4_percent_define_default.
4982
4983 For %define variables, report locations for invalid values and
bbb44d83 4984 redefinitions.
9611cfa2
JD
4985 * data/bison.m4 (b4_percent_define_flag_if): Read
4986 b4_percent_define_loc(VARIABLE) to report the location of an invalid
4987 value for VARIABLE.
4988 (b4_percent_define_default): Save a special location in
4989 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
4990 must later be reported as invalid.
4991 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
4992 functions.
4993 (muscle_percent_define_insert): Record the location of VARIABLE in
4994 muscle percent_define_loc(VARIABLE), and use it to report the previous
4995 location for a redefinition.
4996 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
4997 (muscle_percent_define_default): Update like b4_percent_define_default.
4998 (muscle_grow_user_name_list): Rename to...
4999 (muscle_user_name_list_grow): ... this for consistency and use
5000 muscle_location_grow.
5001 * src/muscle_tab.h (muscle_location_grow): Prototype.
5002 * tests/input.at (%define errors): Update expected output.
5003 * tests/skeletons.at (%define boolean variables: invalid skeleton
5004 defaults): New test case.
5005
0bf92491
JD
50062007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
5007
5008 * src/print.c (lookahead_set, state_default_rule): Remove.
5009 (print_reductions): Replace state_default_rule invocation with
5010 equivalent use of yydefact, which was computed in token_actions in
5011 tables.c.
5012 (print_results): Don't allocate lookahead_set.
5013
d3b12988
PB
50142007-02-27 Paolo Bonzini <bonzini@gnu.org>
5015
5016 * data/lalr1.java: Prefix all private members with yy.
5017
f57a7536
JD
50182007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
5019
5020 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 5021 Sebastien Fricker at
f57a7536 5022 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 5023 * THANKS: Add Sebastien Fricker.
f57a7536
JD
5024 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
5025 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
5026 accept a variable number of arguments.
5027
6404a5bf
JD
50282007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
5029
5030 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
5031
e4e09639
JMG
50322007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5033
5034 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
5035 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
5036 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
5037
d7e0a1a7
PE
50382007-02-11 Paul Eggert <eggert@cs.ucla.edu>
5039
5040 Undo my 2007-02-07 change, switching back to the c-strcase module
5041 introduced in the 2007-02-03 change. Bruno Haible reported that
5042 the 2007-02-07 change would be dangerous in Turkish if we add a
5043 language whose name contains "i", since "i" is not lowercase "I"
5044 in Turkish.
5045 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
5046 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
5047 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
5048 * m4/.cvsignore: Remove strcase.m4.
5049 * src/getargs.c: Revert 2007-02-07 change, as follows.
5050 Include c-strcase.h.
5051 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
5052
deee93a1
JD
50532007-02-11 Bruno Haible <bruno@clisp.org>
5054
5055 Enable the Java related testsuite tests when the only Java compiler
5056 found is a gcj < 4.3. Discussed at
5057 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
5058 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
5059
574add85
JD
50602007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
5061
5062 * data/Makefile.am: Update copyright date.
5063 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
5064 yypstate_new returns NULL.
5065 (yypstate_new): Return NULL if malloc does.
5066 * src/reader.c (packgram): Move translation of rule actions from the
5067 beginning of packgram to...
5068 (check_and_convert_grammar): ... here right before packgram is invoked
5069 so it's easier to write more complete comments, and remove redundant
5070 code.
5071
e785ccf7
JD
50722007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
5073
5074 As in semantic actions, make @$ in %initial-action, %destructor, and
5075 %printer imply %locations.
5076 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
5077 scanning @$.
5078 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
5079 (@$ in %initial-action implies %locations,
5080 @$ in %destructor implies %locations,
5081 @$ in %printer implies %locations): ... these new test cases.
5082
1cfe1ed7
PE
50832007-02-07 Paul Eggert <eggert@cs.ucla.edu>
5084
5085 Undo most of the 2007-02-03 change, switching to the strcase module
5086 now that gnulib strcase has been fixed.
5087 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
5088 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
5089 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
5090 * m4/.cvsignore: Add strcase.m4.
5091 * src/getargs.c: Revert 2007-02-03 change, as follows.
5092 Don't include c-strcase.h.
5093 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
5094 strcasecmp has "unspecified behavior" outside the POSIX locale,
5095 but it works fine in practice if at least one argument is ASCII,
5096 as is the case in Bison.
5097
0049ec86
PB
50982007-02-07 Paolo Bonzini <bonzini@gnu.org>
5099
5100 * tests/java.at: Skip tests if only one of javac/java is present.
5101 Reported by Joel E. Denny.
5102 * tests/atlocal.in: Adjust copyright years.
5103
51042007-02-05 Paolo Bonzini <bonzini@gnu.org>
5105
5106 * data/lalr1.java (Stack): Work around old verifiers that disallow
5107 access to the private fields of an inner class, from the outer class.
5108 We can make Stack's fields public because user code doesn't have access
5109 to the instance of Stack used by parse(). Reported by Paul Eggert.
5110
2c2b7220
PE
51112007-02-03 Paul Eggert <eggert@cs.ucla.edu>
5112
5113 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
5114 the right spot for these files?
5115 * bootstrap.conf (gnulib_modules): Add c-strcase.
5116 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
5117 c-strncasecmp.c.
5118 * src/getargs.c: Include c-strcase.h.
5119 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
5120 to avoid unspecified behavior.
5121
b2b81dae
JD
51222007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
5123
5124 * doc/bison.texinfo (Decl Summary): Correct typo.
5125
c1d19e10
PB
51262007-01-30 Paolo Bonzini <bonzini@gnu.org>
5127
5128 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
5129 Complain if the value does not match empty, "true" or "false".
5130 * data/c++.m4: Adjust default definitions of %define variables.
5131 * data/java.m4: Adjust default definitions of %define variables.
5132 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
5133 to above behavior.
5134 * tests/input.at (Boolean %define variables): Test new behavior.
5135
8405b70c
PB
51362007-01-29 Paolo Bonzini <bonzini@gnu.org>
5137
5138 * NEWS: Mention java.
5139 * TODO: Remove things that are done.
5140 * bootstrap.conf: Add javacomp-script and javaexec-script.
5141 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
5142
5143 * data/Makefile.am: Add new files.
5144 * data/java-skel.m4: New.
5145 * data/java.m4: New.
5146 * data/lalr1.java: New.
5147
5148 * doc/bison.texinfo: Put "A Complete C++ Example" under
5149 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
5150 under Other Languages.
5151
5152 * src/getargs.c (valid_languages): Add Java.
5153 * src/getargs.h (struct bison_language): Update size of string fields.
5154
5155 * tests/Makefile.am: Add java.at.
5156 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
5157 * tests/java.at: New.
5158 * tests/testsuite.at: Include it.
5159
3eb82471
JD
51602007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
5161
5162 Clean up.
5163 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
5164 at_directive_argv arguments so these no longer have to be global
5165 variables. Also, update the implementation for the following changes.
5166 (fail_for_at_directive_too_many_args,
5167 fail_for_at_directive_too_few_args): Add at_directive_name argument.
5168 (at_directive_name): Remove as at_directive_argv[0] will be used for
5169 this now.
5170 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
5171 for the directive name.
5172 (at_directive_argc, at_directive_argv): Make these local within
5173 skel_lex instead of global.
5174 (INITIAL): Update directive start action for above changes.
5175 (SC_AT_DIRECTIVE_ARG): Rename to...
5176 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
5177 (SC_AT_DIRECTIVE_SKIP_WS): Update.
5178 (scan_skel): Move yylex_destroy to...
5179 (skel_scanner_free): ... here.
5180 * tests/skeletons.at (installed skeleton file name): Rename to...
5181 (installed skeleton file names): ... this.
5182
148d66d8
JD
51832007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
5184
5185 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
5186 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
5187 Summary" not "Directives".
5188 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
5189 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
5190 since the former is now the more complete one.
5191 (Prologue Alternatives): Likewise and do the same for %defines.
5192 (Table of Symbols): Add summary of %code, add summary of %define, and
5193 move full %code documentation to...
5194 (Decl Summary): ... here for consistency with other entries in these
5195 sections.
5196 Move %define entry in order to keep this list alphabetized.
5197 Reword %define entry a little to put less emphasis on the skeleton
5198 concept, which most users shouldn't have to think about.
5199
665f0c24
PE
52002007-01-26 Paul Eggert <eggert@cs.ucla.edu>
5201
5202 Adjust to recent gnulib changes.
5203 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
5204 Add string.h, string_.h, unistd_.h, wchar_.h.
5205 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
5206 * src/system.h: Don't include <stpcpy.h>; this is now done by
5207 <string.h>.
5208
592d0b1e
PB
52092007-01-23 Paolo Bonzini <bonzini@gnu.org>
5210
5211 Simplify implementation of unqualified %code, implement macros for
5212 uniform treatment of boolean %define flags. Document %define.
5213 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
5214 b4_percent_code_ifdef): New.
5215 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
5216 * data/c++.m4: Define default value for global_tokens_and_yystype.
5217 * data/glr.cc: Likewise.
5218 * data/location.cc: Use b4_percent_define_flag_if.
5219
148d66d8 5220 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
5221
5222 * src/parse-gram.y (Unqualified %code): Change muscle name to
5223 b4_percent_code().
5224 (content.opt): Default to empty.
5225
a7867f53
JD
52262007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
5227
5228 Implement support for relative and absolute skeleton file names.
5229 Discussed starting at
5230 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
5231 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
5232 (Bison Options): Document in --skeleton entry.
5233 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
5234 full_skeleton can't necessarily hold all of pkgdatadir.
5235 If the specified skeleton file name contains a `/', don't prepend
5236 pkgdatadir.
5237 * src/parse-gram.y (prologue_declaration): If the specified skeleton
5238 file name contains a `/', prepend the grammar file directory.
5239 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
5240 * skeletons.at: New file.
5241 (relative skeleton file names): New test case.
5242 (installed skeleton file names): New test case.
5243 * tests/testsuite.at: Include skeletons.at.
5244
5245 * bootstrap: Update copyright to 2007.
5246
830c9b18
PB
52472007-01-17 Paolo Bonzini <bonzini@gnu.org>
5248
5249 * bootstrap: Remove occurrences of .#bootmp from the files.
5250
a8c2e813
AD
52512007-01-17 Akim Demaille <akim@epita.fr>
5252
5253 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
5254 nonterminals.
5255 Use per-type %printer.
5256
279cabb6
JD
52572007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
5258
5259 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
5260 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5261 djgpp/config.site, src/files.c, src/files.h, src/main.c,
5262 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
5263 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
5264 tests/glr-regression.at, tests/input.at, tests/local.at,
5265 tests/output.at, tests/torture.at: Update copyright to 2007.
5266
bb32f4f2
AD
52672007-01-16 Akim Demaille <akim@epita.fr>
5268
5269 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
5270 error code.
5271 (Calc++ Scanner): Exit with failure if we can't open the input
5272 file.
5273 Accept "-" standing for stdin.
5274 (Calc++ Top Level): Print the result only if the parsing was
5275 successful.
5276
7cff04b5
AD
52772007-01-16 Akim Demaille <akim@epita.fr>
5278
5279 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
5280
a4e25e1d
JD
52812007-01-15 Paolo Bonzini <bonzini@gnu.org>
5282 and Joel E. Denny <jdenny@ces.clemson.edu>
5283
5284 Clean up %define and %code implementation in M4 some. Most
5285 importantly, rename all related macros to be in the b4_percent_define
5286 and b4_percent_code namespaces. Also, complete support for `.' in
5287 %define variable names and %code qualifiers.
5288 * data/bison.m4 (b4_check_user_names): Check for special
5289 "SKELETON-NAMESPACE(name)" macros instead of using two nested
5290 m4_foreach loops.
5291 (b4_get_percent_define, b4_get_percent_code): Rename to...
5292 (b4_percent_define_get, b4_percent_code_get): ... these.
5293 Extend documentation with examples.
5294 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
5295 b4_percent_define_skeleton_variables and
5296 b4_percent_code_skeleton_qualifiers.
5297 Expect any value for the %define variable `foo' to be stored in the
5298 macro named `b4_percent_define(foo)'; expect any %code blocks for the
5299 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
5300 expect any unqualified %code blocks to be stored in a macro named
5301 `b4_percent_code_unqualified'.
5302 Use m4_indir so that %define variable names and %code qualifiers can
5303 contain `.', which is allowed by the grammar parser.
5304 (b4_percent_define_default): New macro to set a default value for a
5305 %define variable.
5306 (m4_wrap): Update wrapped code, and fix some underquoting.
5307 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
5308 Expect grammar uses of %define variables and %code qualifiers to be
5309 defined in b4_percent_define_user_variables and
5310 b4_percent_code_user_qualifiers.
5311 * data/c++.m4: Use b4_percent_define_default rather than
5312 m4_define_default. Fix some underquoting. Skeleton usage of %define
5313 variable define_location_comparison now implies skeleton usage of
5314 %define variable filename_type.
5315 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5316 data/push.c, data/yacc.c: Update macro names.
5317 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
5318 muscle names.
5319
e37c665c
JMG
53202007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5321
5322 DJGPP specific issues.
5323
5324 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
5325 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
5326
7d2d521f
JD
53272007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5328
5329 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
5330 run parsers in all tests so that Valgrind is invoked during
5331 maintainer-check-valgrind.
5332 (Duplicate representation of merged trees): Free all semantic values.
5333 (Duplicated user destructor for lookahead): Likewise.
5334
e0ac9b4b
JD
53352007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5336
5337 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
5338 command-line prefix.
5339 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
5340 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
5341 miss Valgrind messages.
5342 (Exploding the Stack Size with Malloc): Likewise.
5343
78143faa
JD
53442007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5345
5346 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
5347 locals. Reported by Juan Manuel Guerrero at
5348 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
5349 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
5350 Fix some indentation also.
5351 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
5352 explaining this issue.
5353
7ecec4dd
JD
53542007-01-09 Paolo Bonzini <bonzini@gnu.org>
5355 and Joel E. Denny <jdenny@ces.clemson.edu>
5356
5357 Simplify union and prologue handling, and escape union and lex/parse
5358 params with digraphs.
5359 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
5360 values to the empty string since these are no longer guaranteed
5361 initialized by the front-end.
5362 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
5363 braces around b4_user_stype since this is no longer done by the
5364 front-end.
5365 * src/files.c, src/files.h (pre_prologue_obstack,
5366 post_prologue_obstack): Remove.
5367 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
5368 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
5369 with digraphs. This fixes lex params and parse params.
5370 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
5371 * src/output.c (prepare): Remove muscle insertion of the prologues.
5372 (output): Remove freeing of pre_prologue_obstack and
5373 post_prologue_obstack.
5374 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
5375 than prologue_augment for prologue parsing so you don't need prologue
5376 obstacks.
5c80250c
JD
5377 (grammar_declaration): For %union RHS, use `braceless' instead of
5378 "{...}" so that braces are already stripped and code is escaped with
5379 digraphs.
7ecec4dd
JD
5380 * src/reader.c (prologue_augment): Remove.
5381 (reader): Remove initialization of pre_prologue_obstack and
5382 post_prologue_obstack.
5383 * src/reader.h (prologue_augment): Remove.
5384
5385 * data/c.m4: Remove stray parenthesis.
5386
16dc6a9e
JD
53872007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5388
5389 Remove quotes from variables names in %define directives and from
5390 qualifiers in %code directives, and restrict the characters that are
5391 allowed in them to M4-friendly ones. For %define, continue to support
5392 the quoted form as a deprecated feature. Discussed starting at
5393 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
5394 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
5395 %code.
5396 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
5397 (Decl Summary): In %defines entry, update mention of `%code requires'
5398 and `%code provides'.
16dc6a9e
JD
5399 (C++ Location Values): Update %define uses.
5400 (Calc++ Parser Interface): Likewise.
5401 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 5402 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
5403 * src/parse-gram.y (prologue_declaration): For %define variables, use
5404 `variable' instead of `STRING'.
5405 (grammar_declaration): For %code qualifiers, use `ID' instead of
5406 `STRING'.
5407 (variable): New nonterminal that takes an `ID' or a `STRING'.
5408 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
5409 and %define uses.
5410 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
5411 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
5412 (%define errors): Update %define uses.
5413
e9813cd4
JD
54142007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5415
5416 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
5417 instead of muscle_insert for %define values so that M4-special
5418 characters are replaced with digraphs.
5419 * tests/input.at (%define errors): Extend to check weird values.
5420
6afc30cc
JD
54212007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5422
5423 Instead of having skeletons declare all valid %define variables and
5424 %code qualifiers, provide macros that retrieve the associated values
5425 and build these lists automatically. Thus Bison will now warn when a
5426 variable or qualifier is not used by the skeleton in the current
5427 invocation regardless of whether it might sometimes be used by that
5428 skeleton in other invocations. Also, move all %define value macros to
5429 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
5430 form, which is replaced by %code.
5431 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
5432 (b4_check_user_names): ... this, and change the series of valid name
5433 arguments to a single list argument for names used in the skeleton
5434 similar to the existing list argument for names used in the grammar.
5435 Warn instead of complaining.
5436 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
5437 values and %code code, to format %code code properly, and to build
5438 lists of all %define variables and %code qualifiers used in the
5439 skeleton: b4_skeleton_percent_define_variables and
5440 b4_skeleton_percent_code_qualifiers.
5441 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
5442 Remove, and...
5443 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
5444 the skeleton names lists can finish building first. In place of
5445 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
5446 expect the lists b4_user_percent_define_variables and
5447 b4_user_percent_code_qualifiers.
5448 * data/c++.m4: Where setting default values for b4_parser_class_name,
5449 b4_location_type, b4_filename_type, b4_namespace, and
5450 b4_define_location_comparison, update their names to the
5451 b4_percent_define_ namespace.
5452 * data/glr.c: Don't use b4_check_percent_define_variables and
5453 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
5454 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
5455 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 5456 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
5457 * data/location.cc: Use b4_get_percent_define.
5458 * data/push.c: Don't use b4_check_percent_define_variables and
5459 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
5460 * data/yacc.c: Likewise, and don't call m4_exit in
5461 b4_use_push_for_pull_if or m4_wrap code will never execute.
5462 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
5463 Rename to...
5464 (muscle_grow_user_name_list): ... this for consistency with the
5465 terminology used in bison.m4.
5466 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
5467 %define variable names, and rename muscle used_percent_define_variables
5468 to user_percent_define_variables.
5469 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
5470 user_percent_code_qualifiers.
5471 (content): Remove.
5472 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
5473 {CODE} form is no longer accepted.
5474 * tests/input.at (Reject bad %code qualifiers): Rename to...
5475 (Reject unused %code qualifiers): ... this, and update test output.
5476 (%define error): Update test output.
5477
7eb8a0bc
JD
54782007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
5479
5480 Check for unrecognized %define variables similar to checking for
5481 unrecognized %code qualifiers. Check for redefined %define variables.
5482 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
5483 generalizes...
5484 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
5485 (b4_check_percent_define_variables): New, also wraps it.
5486 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
5487 variables using b4_check_percent_define_variables.
5488 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
5489 all those exercised in the test suite and all those listed in the
5490 `Default values' section of c++.m4. Are there others?
5491 * data/push.c, data/yacc.c: Declare no valid %define variables.
5492 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
5493 similar to muscle_find, but it works even when the muscle stores a
5494 const value.
5495 (muscle_grow_used_name_list): New function for constructing the used
5496 name list muscles that b4_check_for_unrecognized_names requires.
5497 * src/parse-gram.y (prologue_declaration): Warn if a variable is
5498 %define'd more than once. Define the b4_used_percent_define_variables
5499 muscle with muscle_grow_used_name_list.
5500 (grammar_declaration): Abbreviate %code code with
5501 muscle_grow_used_name_list.
5502 * tests/input.at (%define errors): New.
5503
3fc65ead
JD
55042007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5505
5506 Provide warn_at, complain_at, and fatal_at function callbacks to the
5507 skeletons, and use this for %code qualifier complaints.
5508 * data/bison.m4 (b4_error_at): New, invoked by...
5509 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
5510 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
5511 @fatal_at(...@) directives.
5512 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
5513 qualifiers in b4_used_percent_code_qualifiers and to use
5514 b4_complain_at.
5515 * src/location.c, src/location.h (boundary_set_from_string): New global
5516 function.
5517 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
5518 function.
5519 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
5520 to b4_used_percent_code_qualifiers.
5521 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
5522 function.
5523 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
5524 (lineno): Rename to...
5525 (out_lineno): ... this so I don't misunderstand it again.
5526 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
5527 here; these newlines are in the input but not the output file.
5528 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
5529 (at_directive_perform): ... this new static function, and add handling
5530 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
5531 directives.
5532 * tests/input.at (Reject bad %code qualifiers): Update test output with
5533 locations and extend.
5534
5535 * tests/output.at (Output file name: [, Output file name: ]): Remove
5536 bogus comment about these tests failing.
5537
1c7b7e1d
JD
55382007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5539
5540 Clean up b4_check_percent_code_qualifiers a little.
5541 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
5542 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
5543 documentation and add examples.
5544 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
5545 qualifiers here.
5546
08af01c2
JD
55472007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
5548
5549 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
5550 unreliable -- especially when they're hidden inside another macro.
5551 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
5552 data/c.m4: Remove m4_divert(-1).
5553 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5554 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
5555 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 5556 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
5557 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
5558 pushed and popped by m4sugar, should be first on the stack.
5559
5560 Provide warn, complain, and fatal function callbacks to the skeletons.
5561 This provides more flexibility than m4_fatal, improves the error
5562 message format, and captures messages for translation. Discussed
5563 starting at
5564 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
5565 * data/bison.m4 (b4_error): New, invoked by...
5566 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
5567 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
5568 directives. Because these M4 macros might be called when the current
5569 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
5570 the previous removal of uses of m4_divert, which caused trouble.
5571 (b4_check_percent_code_qualifiers): Use b4_complain instead of
5572 m4_fatal to report unrecognized %code qualifiers.
5573 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
5574 push parser requests.
5575 * data/glr.c: Use b4_complain instead of m4_fatal to report
5576 non-deterministic push parser requests.
5577 Update @output usage to @output(...@) form.
5578 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
5579 report missing %defines. Update @output usage to @output(...@) form.
5580 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
5581 @output(...@) form.
5582 * src/main.c (main): Invoke skel_scanner_free.
5583 * src/scan-skel.h (skel_scanner_free): Prototype new function.
5584 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
5585 obstack_for_string from flex-scanner.h.
5586 (YY_DECL): Use to declare skel_lex static.
5587 (decode_at_digraphs): Remove; now handled in the new
5588 SC_AT_DIRECTIVE_ARG start condition.
5589 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
5590 functions.
5591 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
5592 at_directive_argv): New static globals.
5593 (INITIAL): Use fail_for_invalid_at.
5594 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
5595 recognize the start of a generalized `@directive(...@)' form and
5596 start...
5597 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
5598 directive args (using the new obstack_for_string), to decode the
5599 contained @ diagraphs, and to perform the directive. It recognizes
5600 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
5601 @output(...@).
5602 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
5603 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
5604 `@,'.
5605 (scan_skel): Initialize obstack_for_string on the first call.
5606 (skel_scanner_free): New function to free obstack_for_string.
5607 * tests/input.at (Reject bad %code qualifiers): Update test output.
5608
8e0a5e9e
JD
56092007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
5610
5611 Consolidate the 4 prologue alternative directives (%code, %requires,
5612 %provides, and %code-top) into a single %code directive with an
5613 optional qualifier field. Discussed at
5614 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
5615 * NEWS (2.3a+): Rewrite the existing entry for the prologue
5616 alternatives.
5617 * doc/bison.texinfo (Prologue Alternatives): Update.
5618 (Decl Summary): Update to %code "requires" and %code "provides".
5619 (Calc++ Parser): Update to %code "requires".
148d66d8 5620 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
5621 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
5622 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
5623 are replaced by b4_percent_code_provides and b4_percent_code_requires,
5624 which are skeleton-specific.
5625 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
5626 declare what %code qualifiers it supports and to complain if any other
5627 qualifiers were used in the grammar.
5628 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
5629 and b4_user_code([b4_percent_code_provides]) in place of
5630 b4_user_requires and b4_user_provides.
5631 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
5632 Add b4_user_code([b4_percent_code_top]) and
5633 b4_user_code([b4_percent_code]).
5634 Invoke b4_check_percent_code_qualifiers.
5635 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
5636 PERCENT_REQUIRES): Remove.
5637 (grammar_declaration): Remove RHS's for %code-top, %provides, and
5638 %requires. Rewrite the %code RHS as the unqualified form defining the
5639 muscle b4_percent_code. Add another RHS for the qualified %code form,
5640 which defines muscles of the form b4_percent_code_QUALIFIER and the
5641 b4_used_percent_code_qualifiers muscle.
5642 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
5643 PERCENT_REQUIRES): Remove.
5644 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
5645 %code "requires" and %code "provides".
5646 * tests/input.at (Reject bad %code qualifiers): New.
5647
95021767
JD
56482007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
5649
5650 Use the new code_props interface for destructors and printers.
5651 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
5652 printer_location members, and change the type of the destructor and
5653 printer members to code_props.
5654 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
5655 symbol_printer_get, semantic_type_destructor_set,
5656 semantic_type_printer_set, default_tagged_destructor_set,
5657 default_tagless_destructor_set, default_tagged_printer_set,
5658 default_tagless_printer_set): Use code_props in arguments and return
5659 types in place of char const * and location.
5660 (symbol_destructor_location_get, symbol_printer_location_get): Remove
5661 since the locations are now contained in the return of
5662 symbol_destructor_get and symbol_printer_get.
5663 * src/output.c (symbol_destructors_output, symbol_printers_output):
5664 Replace with...
5665 (symbol_code_props_output): ... this to eliminate duplicate code.
5666 (output_skeleton): Update to use symbol_code_props_output.
5667 * src/reader.c (symbol_should_be_used): Update use of
5668 symbol_destructor_get.
5669 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
5670 Update uses of the various _destructor_set and _printer_set functions.
5671 * src/symtab.c: (default_tagged_destructor_location,
5672 default_tagless_destructor_location, default_tagged_printer_location,
5673 default_tagless_printer_location): Remove since we...
5674 (default_tagged_destructor, default_tagless_destructor,
5675 default_tagged_printer, default_tagless_printer): ... change the type
5676 of these to code_props.
5677 (symbol_new, semantic_type_new, symbol_destructor_set,
5678 semantic_type_destructor_set, symbol_destructor_get,
5679 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
5680 symbol_check_alias_consistency, default_tagged_destructor_set,
5681 default_tagless_destructor_set, default_tagged_printer_set,
5682 default_tagless_printer_set): Update.
5683 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
5684 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
5685 code_props members.
5686 (symbol_print): Use SYMBOL_CODE_PRINT.
5687
f6857bbf
JD
56882007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
5689
5690 Use the new code_props interface for rule actions.
5691 * src/symlist.h (symbol_list): Replace action, action_location, and
5692 used members with a code_props action_props member.
5693 * src/reader.c (symbol_should_be_used, grammar_rule_check,
5694 grammar_midrule_action, grammar_current_rule_merge_set,
5695 grammar_current_rule_symbol_append, packgram): Update.
5696 * src/scan-code.h (translate_rule_action): Remove, no longer used.
5697 * src/scan-code.l (handle_action_dollar): Update.
5698 (translate_rule_action): Remove, no longer used.
5699 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
5700
7c0c6181
JD
57012007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5702
5703 Use the new code_props interface in parse-gram.y.
5704 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
5705 Update all uses of translate_* functions to use the new code_props
5706 interface and to use gram_scanner_last_string_free and
5707 code_scanner_last_string_free where possible.
5708 (grammar_declaration): symbol_list_destructor_set and
5709 symbol_list_printer_set now perform the translation, so don't do it
5710 here. Use gram_scanner_last_string_free where possible.
5711 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
5712 translate_code): Remove, no longer used.
5713 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
5714 symbol_list_printer_set): Perform code translation here rather than
5715 depending on the caller to do so.
5716
5717 * src/symlist.h (struct symbol_list): Correct some documentation typos.
5718 * src/scan-gram.h (gram_last_string): Remove declaration.
5719 * src/scan-gram.l (last_string): Declare it static.
5720
28e52c0d
JD
57212007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5722
5723 Encapsulate code properties and related functionality for the various
5724 destructors, printers, and actions into a code_props structure and
5725 interface. This patch merely implements code_props in scan-code.h and
5726 scan-code.l. Future patches will rewrite other modules to use it.
5727 Discussed starting at
5728 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
5729 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
5730 consistently initialize const structs that have an empty location
5731 field.
5732 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
5733 to ensure consistency.
5734 * src/scan-code.h (code_props): New structure.
5735 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
5736 function, macro, and const global variable for initializing a
5737 code_props with no code.
5738 (code_props_plain_init, code_props_symbol_action_init,
5739 code_props_rule_action_init, code_props_translate_code): The rest of
5740 the new code_props functional interface. Among other things, the init
5741 functions set the code_props kind field so that
5742 code_props_translate_code will know whether to behave like
5743 translate_symbol_action, translate_rule_action, or translate_code.
5744 These old translate functions must remain until all other modules are
5745 updated to use the new code_props interface.
5746 (code_scanner_last_string_free): New function similar to
5747 gram_scanner_last_string_free.
5748 (code_scanner_free): Add documentation.
5749 * src/scan-code.l: Implement the new interface.
5750 (code_lex): Make it static, add a code_props* argument, and remove the
5751 rule argument.
5752 (last_string): New static global similar to the one in scan-gram.l.
5753 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
5754 instead of rule.
5755 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
5756 code_props since Bison may one day use this information for destructors
5757 and printers.
5758 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
5759 (handle_action_dollar): Use symbol_list_n_get and set used flag
5760 directly since symbol_list_n_used_set is removed.
5761 (translate_action): Add a code_props* argument and remove the rule,
5762 action, and location arguments. Pass the code_props* on to code_lex.
5763 (translate_rule_action, translate_symbol_action, translate_code):
5764 Rewrite as wrappers around the new code_props interface.
5765 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
5766 it would eventually need to break the encapsulation of code_props.
5767
96034983
JD
57682007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
5769
5770 * etc/.cvsignore: New.
5771
945e396c
JD
57722007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
5773
5774 Add maintainer-push-check to run maintainer-check using push parsing in
5775 place of pull parsing where available.
5776 * Makefile.am (maintainer-push-check): New.
5777 * data/bison.m4 (b4_use_push_for_pull_if): New.
5778 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
5779 appropriately based on their existing values.
5780 (yypush_parse): Don't print push-parser-specific diagnostics if push
5781 parsing is being used in place of pull parsing.
5782 * data/yacc.c: If push parsing should replace pull parsing, redirect to
5783 push.c.
5784 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
5785 variable, and insert b4_use_push_for_pull_flag into muscles.
5786 * tests/Makefile.am (maintainer-push-check): New.
5787
7d596384
JD
57882006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
5789
5790 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
5791 (whether successful or failed) so that yypush_parse can be invoked
5792 again to start a new parse using the same yypstate.
5793 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
5794 check multiple yypull_parse invocations on the same yypstate. For pull
5795 mode, extend to check multiple yyparse invocations.
5796 (Exploding the Stack Size with Alloca): Extend to try with
5797 %push-pull-parser.
5798 (Exploding the Stack Size with Malloc): Likewise.
5799
5800 * tests/calc.at (Simple LALR Calculator): Don't specify
5801 %skeleton "push.c" since %push-pull-parser implies that now.
5802 * tests/headers.at (export YYLTYPE): Don't check for the push
5803 declarations. Otherwise, this test case can't be used to see if push
5804 mode can truly emulate pull mode.
5805 * tests/input.at (Torturing the Scanner): Likewise.
5806 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
5807 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
5808 AT_YACC_IF, which now includes the case of push mode since %skeleton
5809 need not be used for push mode. This will be more intuitive once
5810 push.c is renamed to yacc.c.
5811
7172e23e
JD
58122006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
5813
5814 For push mode, convert yyparse from a macro to a function, invoke yylex
5815 instead of passing a yylexp argument to yypull_parse, and don't
5816 generate yypull_parse or yyparse unless %push-pull-parser is declared.
5817 Discussed starting at
5818 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
5819 * data/bison.m4 (b4_pull_if): New.
5820 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
5821 * data/push.c: Improve M4 quoting a little.
5822 (b4_generate_macro_args, b4_parenthesize): Remove.
5823 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
5824 any time a pull parser is requested.
5825 Don't #define this as a wrapper around yypull_parse. Instead, when
5826 both push and pull are requested, make it a function that does that
5827 same thing.
5828 (yypull_parse): If there's a b4_prefix, #define this to
5829 b4_prefix[pull_parse] when both push and pull are requested.
5830 Don't define this as a function unless both push and pull are
5831 requested.
5832 Remove the yylexp argument and hard-code yylex invocation instead.
5833 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
5834 %push-parser.
5835 * src/getargs.c (pull_parser): New global initialized to true.
5836 * getargs.h (pull_parser): extern it.
5837 * src/output.c (prepare): Insert pull_flag muscle.
5838 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
5839 (prologue_declaration): Set both push_parser and pull_parser = true for
5840 %push-pull-parser. Set push_parser = true and pull_parser = false for
5841 %push-parser.
5842 * src/scan-gram.l: Don't accept %push_parser as an alternative to
5843 %push-parser since there's no backward-compatibility concern here.
5844 Scan %push-pull-parser.
5845 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
5846 instead of %push-parser.
5847 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
5848 prototype it in the module that calls yyparse.
5849 * tests/input.at (Torturing the Scanner): Likewise.
5850 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
5851
2e7944cb
JD
58522006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
5853
5854 Update etc/bench.pl. Optimize push mode a little (the yyn change
5855 deserves most of the credit).
5856 * Makefile.am (SUBDIRS): Add etc subdirectory.
5857 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
5858 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
5859 yytoken, yyval, and yyloc declarations to...
5860 (yyparse or yypush_parse): ... here to improve performance. For
5861 yypush_parse invocations after the first, be sure to assign yyn its old
5862 value again.
5863 (yypstate_new): Don't bother initializing the yyresult field since the
5864 initial value isn't used.
5865 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
5866 remove the #define that, in push mode, set it to yyps->NAME.
5867 * etc/Makefile.am: New.
5868 * etc/bench.pl: Remove and build it instead from...
5869 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
5870 "tests/bison" from the build directory by default rather than just
5871 invoking "bison" from $PATH.
5872 (calc_grammar): Update push parser code: don't declare yylval globally,
5873 don't define yyparse_wrapper, and don't #define yyparse.
5874 (bench_grammar): Update to check all working combinations of yacc.c,
5875 push.c, impure, pure, pull, and push.
5876
c3d50342
JD
58772006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
5878
5879 For push mode, add pull wrappers around yypush_parse.
5880 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
5881 (yypull_parse): New function wrapping yypush_parse.
5882 (yyparse): New #define wrapping yypull_parse.
5883 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
5884 is declared.
5885 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
5886 prototype yylex in the module that calls yyparse, and don't prototype
5887 yyparse there. Otherwise, the yyparse expansion won't compile.
5888 * tests/input.at (Torturing the Scanner): Likewise.
5889
94ebeba5
JD
58902006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
5891
5892 Enable push parsers to operate in impure mode. Thus, %push-parser no
5893 longer implies %pure-parser. The point of this change is to move
5894 towards being able to test the push parser code by running the entire
5895 test suite as if %push-parser had been declared.
5896 * data/push.c (yypush_parse): For impure mode, remove the
5897 yypushed_char, yypushed_val, and yypushed_loc arguments.
5898 Instead, declare these as local variables initialized to the global
5899 yychar, yylval, and yylloc.
5900 For the first yypush_parse invocation only, restore the initial values
5901 of these global variables when it's time to read a token since they
5902 have been overwritten.
5903 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
5904 %push-parser.
5905 * tests/calc.at (Simple LALR(1) Calculator): Always declare
5906 %pure-parser along with %push-parser since this test case was designed
5907 for pure push parsers.
5908 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
5909 (AT_YACC_OR_PUSH_IF): New.
5910 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
5911 add a note that it's still wrong for some cases (as it has been for a
5912 while).
5913 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
5914 %push-parser no longer implies %pure-parser.
5915
a0633178
JD
59162006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5917
5918 Remove some unnecessary differences between the pull parser code and
5919 the push parser code. This patch enables yynerrs in push mode.
5920 * data/push.c: Reformat M4 a little.
5921 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
5922 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
5923 because push mode is on. Instead, if pure mode is on, move yynerrs
5924 to...
5925 (b4_declare_parser_state_variables): ... here.
5926 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
5927 to yyps->NAME so it can be used in yypush_parse.
5928 (yypush_parse): Don't omit uses of yynerrs in push mode.
5929
8646b6a3
JD
59302006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5931
5932 Fix bug such that the first pushed token's value and location are
5933 sometimes overwritten (sometimes by %initial-action) before being used.
5934 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
5935 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
5936 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
5937 more closely mimic the pull parser logic.
5938 Don't copy the pushed token to yychar, yylval, and yylloc until it's
5939 time to read a token, which is after any initialization of yylval and
5940 yylloc.
5941 (gottoken): Rename label to...
5942 (yyread_pushed_token): ... for clarity and to avoid infringing on the
5943 user namespace.
5944
9baf4d74
JD
59452006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5946
5947 Rearrange initialization of the parser state variables so that the
5948 skeleton doesn't have to have a copy for pull mode and another for push
5949 mode. This patch also fixes at least a bug such that yylloc was not
5950 initialized (with b4_location_initial_line and
5951 b4_location_initial_column) upon calling yypush_parse. However, that
5952 initialization now overwrites the first token's location;
5953 %initial-action assigning @$ already did the same thing, and both bugs
5954 will be fixed in a later patch.
5955 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
5956 (b4_declare_parser_state_variables): Remove initialization of yytoken,
5957 yyss, yyvs, yyls, and yystacksize.
5958 (yypstate_new): Remove initialization of some yypstate fields: yystate,
5959 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
5960 yylsp.
5961 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
5962 yyps->NAME so it can be used in yypush_parse.
5963 (yyparse or yypush_parse): For yypush_parse, don't print the
5964 "Starting parse" diagnostic for invocations after the first.
5965 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
5966 yypush_parse, only do it for the first invocation.
5967 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
5968 initialization to occur in yypush_parse but only on the first
5969 invocation.
5970
23522164
JD
59712006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5972
5973 * data/push.c: Add CPP guards around push parser declarations in both
5974 the header and the code file.
5975 In the code file, move the push parser declarations to the same place
5976 they appear in the header file.
5977 Clean up the M4 some, especially the inconsistent underquoting in
5978 some b4_c_function_def and b4_c_function_decl uses.
5979
bb010fe5
JD
59802006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5981
5982 Encapsulate the push parser state variables into an M4 macro so the
5983 push skeleton doesn't have to list them again for pull mode's yyparse.
5984 For push mode, remove yypush_parse's local equivalents of these
5985 variables to eliminate unnecessary copying between the two sets at
5986 run-time. This patch also fixes at least a bug related to multiple
5987 %initial-action invocations in push mode.
5988 * data/push.c (b4_declare_parser_variables): Rename to...
5989 (b4_declare_scanner_communication_variables): ... this for clarity and
5990 update both uses.
5991 (b4_declare_yyparse_variables): Remove and move its contents to the one
5992 spot where it was invoked.
5993 (b4_declare_parser_state_variables): New macro containing the parser
5994 state variables required by push mode.
5995 (struct yypstate): Replace all fields but yynew with
5996 b4_declare_parser_state_variables.
5997 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
5998 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
5999 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
6000 (yyparse or yypush_parse): For yyparse in pull mode, replace local
6001 parser state variable declarations with
6002 b4_declare_parser_state_variables.
6003 Don't initialize parser state variables when calling yypush_parse since
6004 yypstate_new already does that.
6005 Invoke the user's initial action only upon the first yypush_parse
6006 invocation.
6007 Remove all code that copies between the local parser state variables
6008 and the yypstate.
6009
2d212f8c
JD
60102006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
6011
6012 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
6013 prevent a name collision in a future patch where these names will
6014 sometimes be #define'd.
6015 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
6016 since it no longer has the same name as the existing argument.
6017 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
6018
e6e704dc
JD
60192006-12-19 Paolo Bonzini <bonzini@gnu.org>
6020 and Joel E. Denny <jdenny@ces.clemson.edu>
6021
6022 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
6023 that the argument is case-insensitive, and there's no `=' here.
6024 For the %skeleton entry, mention that %language is better.
6025 (Bison Options): Likewise for --language and --skeleton. Move the
6026 --skeleton entry so that the `Tuning the parser' section is sorted
6027 alphabetically on long options.
6028 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
6029 %language directive in detail here; cross-reference the %language
6030 documentation instead.
6031 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
6032 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 6033 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
6034 * examples/extexi (normalize): Instead of replacing every %require
6035 argument with the current Bison version, just substitute for
6036 `@value{VERSION}'. This guarantees that we're testing what actually
6037 appears in the documentation.
6038 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
6039 rather than `@VERSION@'.
6040
0e021770
PE
60412006-12-18 Paul Eggert <eggert@cs.ucla.edu>
6042
fd575f05
PE
6043 * NEWS: Reword the %language news a bit, and put it earlier.
6044
0e021770
PE
6045 * src/getargs.c (skeleton_arg): Last arg is now location const *.
6046 Rewrite to simplify the logic.
6047 (language_argmatch): Likewise.
fd575f05
PE
6048 (program_name): We now own this var.
6049 * src/getargs.h (struct bison_language): Use char[] rather than
6050 const char *.
0e021770
PE
6051
6052 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
6053 Java is supported.
6054 * src/complain.c (program_name): Remove decl; no longer needed.
6055 * src/main.c (program_name): Remove; now belongs to getargs.
6056
60572006-12-18 Paolo Bonzini <bonzini@gnu.org>
6058
6059 * NEWS: Document %language.
6060
6061 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
6062
6063 * data/c-skel.m4, data/c++-skel.m4: New files.
6064 * data/glr.c: Complain on push parsers.
6065
6066 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
6067 over %skeleton.
148d66d8 6068 (Decl Summary): Document %language and %skeleton.
0e021770
PE
6069 (Command line): Document -L.
6070
6071 * examples/extexi: Rewrite %require directive.
6072 * examples/calc++/Makefile.am: Pass VERSION to extexi.
6073
6074 * src/files.c (compute_exts_from_gc): Look in language structure
6075 for .y extension.
6076 (compute_file_name_parts): Check whether .tab should be added.
6077 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
6078 (language, skeleton_arg, language_argmatch): New.
6079 (long_options): Add --language.
6080 (getargs): Use skeleton_arg, add -L/--language.
6081 * src/getargs.h: Include location.h.
6082 (struct bison_language, language, skeleton_arg, language_argmatch): New.
6083 * src/output.c (prepare): Pick default skeleton from struct language.
6084 Don't dispatch C skeletons here.
6085 * src/parse-gram.y (PERCENT_LANGUAGE): New.
6086 (prologue_declaration): Add "%language" rule, use skeleton_arg.
6087 * src/scan-gram.l ("%language"): New rule.
6088
6089 * tests/calc.at: Test %skeleton and %language.
6090 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
6091 (AT_GLR_IF): Look for %skeleton "glr.cc".
6092 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
6093 (AT_YACC_IF): Reject %language.
6094
5691bf57
PE
60952006-12-18 Paul Eggert <eggert@cs.ucla.edu>
6096
db06f0ce
PE
6097 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
6098 since it wasn't used; only the typedef name 'semantic_type' is needed.
6099 Also, omit trailing white space.
6100
5691bf57
PE
6101 * bootstrap: Sync from coreutils.
6102 (gnulib_extra_files): Add build-aux/announce.gen.
6103 (slurp): Adjust .gitignore files like .cvsignore files.
6104 * build-aux/announce-gen: Remove from CVS, since bootstrap
6105 now creates this.
6106
791934e4
JD
61072006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
6108
6109 Make %push-parser imply %pure-parser. This fixes several bugs; see
6110 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
6111 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
6112 pure_parser = true.
6113 * data/push.c: Don't bother testing b4_push_if when deciding whether
6114 to expand b4_declare_parser_variables globally.
6115 (yypush_parse): Likewise in here.
6116
6117 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
6118 (yy_reduce_print): Reformat M4 for readability.
6119
ee5abb37
JD
61202006-12-15 Bob Rossi <bob@brasko.net>
6121 and Joel Denny <jdenny@ces.clemson.edu>
6122
6123 * data/push.c (yypstate): Add typedef, and update all uses of
6124 struct yypstate to just yypstate.
6125 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
6126
16ca01f9
JD
61272006-12-14 Bob Rossi <bob@brasko.net>
6128
6129 * data/push.c (yypush_parse): Declare prototype regardless of
6130 %locations option.
6131
ab8e7e1a
JD
61322006-12-14 Bob Rossi <bob@brasko.net>
6133
6134 * data/push.c (yyparse): Remove the prototype and the #define when in
6135 push-parser mode.
6136
9bf32be3
JD
61372006-12-13 Bob Rossi <bob@brasko.net>
6138
6139 * data/push.c (yypstate_init): Rename to...
6140 (yypstate_new): ... this and use b4_c_function_def.
6141 (yypstate_delete): New.
6142 (yypush_parse): Change parameters yynval and yynlloc to be const.
6143 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
6144 yypstate_delete functions.
6145
f02e2948
JD
61462006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
6147
6148 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
6149 strange test case titles. Reported by Bob Rossi.
6150
38eb7751
PE
61512006-12-13 Paul Eggert <eggert@cs.ucla.edu>
6152
6153 * TODO: Add pointer to Sylvain Schmitz's work on static detection
6154 of potential ambiguities in GLR grammers.
6155
bd9d212b
JD
61562006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
6157
6158 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
6159 `bison ', use m4_index instead of m4_substr since chopping up a string
6160 containing M4-special characters causes problems here.
6161
6162 Fix a couple of bugs related to special characters in user-specified
6163 file names, and make it easier for skeletons to compute output file
6164 names with the same file name prefix as Bison-computed output file
6165 names.
6166 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
6167 b4_parser_file_name and b4_spec_defines_file instead of
6168 @output_parser_name@ and @output_header_name@, which are now redundant.
6169 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
6170 b4_parser_file_name, b4_spec_defines_file, and the new
6171 @basename(FILENAME@) instead of @output_parser_name@ and
6172 @output_header_name@, which inappropriately escaped the file names as
6173 C string literals.
6174 * src/files.c (all_but_ext): Remove static qualifier.
6175 (compute_output_file_names): Move `free (all_but_ext)' to...
6176 (output_file_names_free): ... here since all_but_ext is needed later.
6177 * src/files.h (all_but_ext): Extern.
6178 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
6179 exactly what MUSCLE_INSERT_STRING used to do.
6180 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
6181 characters are escaped properly.
6182 * src/output.c (prepare): Define muscle file_name_all_but_ext as
6183 all_but_ext.
6184 For pkgdatadir muscle, maintain previous functionality by using
6185 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
6186 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
6187 digraphs would never be expanded. Hopefully no one has M4-special
6188 characters in his Bison installation path.
6189 * src/scan-skel.l: Don't parse @output_header_name@ and
6190 @output_parser_name@ anymore since they're now redundant.
6191 In @output, use decode_at_digraphs.
6192 Parse a new @basename command that invokes last_component.
6193 (decode_at_digraphs): New.
6194 (BASE_QPUTS): Remove unused.
6195 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
6196 (Output file name): New tests.
6197
3f7ca628
JD
61982006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
6199
6200 Warn about output files that are generated by the skeletons and that
6201 conflict with other output files.
6202 * data/glr.c: Don't generate the header file here when glr.cc does.
6203 * src/files.c (file_names, file_names_count): New static globals.
6204 (compute_output_file_names): Invoke output_file_name_check for files
6205 not generated by the skeletons and remove existing checks.
6206 (output_file_name_check): New function that warns about conflicting
6207 output file names.
6208 (output_file_names_free): Free file_names.
6209 * src/files.h (output_file_name_check): Declare.
6210 * src/scan-skel.l: Invoke output_file_name_check for files generated by
6211 the skeletons.
6212 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
6213 (Conflicting output files): New tests.
6214
178e123e
PE
62152006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6216
6217 * doc/bison.texinfo: Fix a couple of typos.
6218
62192006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
6220
6221 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
6222 Rename to...
6223 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
6224 update all uses.
6225 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
6226 (yypush_parse): Rename yypvars argument to yyps and remove redundant
6227 local pv.
6228 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
6229 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
6230
ea17f233
JD
62312006-12-07 Bob Rossi <bob@brasko.net>
6232 and Joel Denny <jdenny@ces.clemson.edu>
6233
6234 * data/push.c (yypvarsinit): Change return type from void* to struct
6235 yypvars*. No longer cast to void* on return.
6236 (struct yypvars): Remove yylen since it need not be remembered between
6237 yypushparse invocations.
6238 (yypushparse): Don't copy between yylen and pv->yylen.
6239
55a30bda
JD
62402006-12-05 Bob Rossi <bob@brasko.net>
6241
6242 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
6243 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
6244 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
6245 (struct yypvars): Remove b4_declare_parser_variables.
6246 (yypvarsinit): Remove init code for removed variables.
6247 (global scope): Do not declare b4_declare_parser_variables if
6248 push or pure mode.
6249 (yypushparse): Add b4_declare_parser_variables.
6250 Init new local variables, and remove init code for removed
6251 yypvars variables.
6252 (yyparse): Delete.
6253 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
6254 and yyparse for other modes.
6255 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
6256 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
6257 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
6258 (AT_PURE_LEX_IF): True if pure or push parser.
6259
85894313
JD
62602006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
6261
6262 Document Yacc prologue alternatives and default %destructor's and
6263 %printer's as experimental. Don't mention Java yet. Discussed at
6264 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
6265 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
6266 (2.3a): Annotate this entry to say the old forms of these features were
6267 also experimental.
6268 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 6269 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
6270 of Java (we'll want this back eventually).
6271
02975b9a
JD
62722006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
6273
6274 Support a file name argument to %defines. Deprecate `=' in
6275 %file-prefix, %name-prefix, and %output. Discussed at
6276 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
6277 * NEWS (2.3a+): Mention.
148d66d8 6278 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
6279 form of %defines, and remove `=' from entries for %file-prefix,
6280 %name-prefix, and %output.
6281 * src/parse-gram.y (prologue_declaration): Implement.
6282 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
6283 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
6284 all but one occurrence of %name-prefix.
6285 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
6286 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
6287 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
6288 occurrence of each of %file-prefix and %output. Add check for %defines
6289 with argument.
6290 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
6291 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
6292 Remove the `=' from %output.
6293
287b314e
JD
62942006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
6295
6296 Don't escape $ in test case titles since Autoconf 2.61 now does that
6297 correctly.
6298 * tests/actions.at (Default %printer and %destructor are not for error
6299 or $undefined): Here.
6300 (Default %printer and %destructor are not for $accept): Here.
6301 * tests/input.at (Invalid $n and @n): Here.
6302
3ebecc24
JD
63032006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
6304
6305 Rename <!> to <>. Discussed starting at
6306 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
6307 * NEWS (2.3a+): Update.
148d66d8 6308 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
6309 Update.
6310 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
6311 * src/scan-gram.l (INITIAL): Implement.
6312 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
6313 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
6314 comment.
6315 * tests/actions.at (Default tagless %printer and %destructor,
6316 Default tagged and per-type %printer and %destructor,
6317 Default %printer and %destructor are not for error or $undefined,
6318 Default %printer and %destructor are not for $accept,
6319 Default %printer and %destructor for mid-rule values): Update.
6320 * tests/input.at (Default %printer and %destructor redeclared,
6321 Unused values with default %destructor): Update.
6322
26b8a438
JD
63232006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
6324
6325 Don't let %prec take a nonterminal.
6326 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
6327 token.
6328 * tests/input.at (%prec takes a token): New test checking that %prec
6329 won't take a nonterminal.
6330
07c39ae9
JD
63312006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
6332
405d53b7
JD
6333 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
6334 it was double-quoted.
07c39ae9
JD
6335 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
6336 grammar is maintained with Bison's highest standards.
6337 * src/getargs.c: Fix some typos in Doxygen comments.
6338
580b8926
JD
63392006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
6340
6341 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
6342 later. Reported by Paul Eggert in
6343 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
6344 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
6345 * src/scan-code.l (translate_action): Don't bother invoking
6346 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
6347 (code_scanner_free): Instead of invoking
6348 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
6349 which frees more.
6350 * src/scan-gram.l (gram_scanner_free): Likewise.
6351 * src/scan-skel.l (scan_skel): Likewise.
6352
4502eadc
JD
63532006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
6354
6355 * src/files.c (tr): Change return type to void.
6356 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
6357 has been called previously for the same key.
6358 (muscle_find): Return storage instead of value so that
6359 --enable-gcc-warnings doesn't produce warnings that the return discards
6360 const. aver that the value and storage are the same since storage
6361 could potentially be NULL when value is not.
6362 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
6363 same as 0.
6364
7746c8f6
PE
63652006-11-08 Paul Eggert <eggert@cs.ucla.edu>
6366
6367 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
6368 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
6369 us a slightly cleaner distribution, and also works.
6370 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
6371 gnulib changes.
6372
eb095650
PE
63732006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
6374 and Paul Eggert <eggert@cs.ucla.edu>
6375
6376 Don't let Bison leak memory except when it complains.
6377 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
6378 (spec_defines_file, dir_prefix): Now char *, not const char *,
6379 since they are freed.
6380 * src/files.c: Likewise.
6381 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
6382 Likewise.
6383 (tr): Now operates in-place. All uses changed.
6384 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
6385 values.
6386 (compute_file_name_parts, compute_output_file_names): Don't store
6387 read-only data in variables that will be freed.
6388 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
6389 src_extension, and header_extension.
6390 (output_file_names_free): New public function to free
6391 spec_verbose_file, spec_graph_file, spec_defines_file,
6392 parser_file_name, and dir_prefix.
6393 * src/getargs.c (getargs): Don't store read-only data in variables that
6394 will be freed.
6395 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
6396 (which previously existed but was unused), and quotearg_free.
6397 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
6398 * src/muscle_tab.c: Likewise.
6399 (muscle_entry): Make the value char const *,
6400 and add a new storage member that is char * and can be freed.
6401 (muscle_entry_free): New private function.
6402 (muscle_init): Use it instead of free.
6403 (muscle_insert, muscle_grow): Update and use new storage member.
6404 (muscle_code_grow): Free the string passed to muscle_grow
6405 since it's not needed anymore.
6406 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
6407 add a new `char *code' member.
6408 ("{...}"): Declare semantic type as code.
6409 * src/scan-code.h (translate_rule_action):
6410 (translate_symbol_action, translate_code, translate_action): Return
6411 `char const *' rather than `char *' since external code should not free
6412 these strings.
6413 * src/scan-code.l: Likewise.
6414 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
6415 which is "{...}" in the parser.
6416 * tests/Makefile.am (maintainer-check-valgrind): Set
6417 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
6418 Valgrind.
6419 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
6420 complain.
6421 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
6422 expecting a non-zero exit status sets --leak-check=summary and
6423 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
6424 this case, and we don't want to hear about it.
6425
ac564be4
PE
64262006-11-08 Paul Eggert <eggert@cs.ucla.edu>
6427
6428 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
6429 instead of from the template, to simplify configuration a bit.
6430 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
6431 and m4/wint_t.m4, as they are needed with the latest gnulib.
6432
17bd8a73
JD
64332006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6434
6435 Disable unset/unused mid-rule value warnings by default, and recognize
6436 --warnings=midrule-values to enable them. Discussed starting at
6437 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
6438 * NEWS (2.3a+): Mention.
6439 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
6440 warnings): Add entry for midrule-values subargument.
6441 * src/reader.c (symbol_should_be_used): Don't return true just because
6442 the value is a set/used mid-rule value unless
6443 --warnings=midrule-values was specified.
6444 * tests/input.at (Unused values, Unused values before symbol
6445 declarations): Run tests with and without --warnings=midrule-values.
6446
6447 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
6448 than LIST_FREE directly.
6449
89eb3c76
JD
64502006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6451
6452 Finish implementing --warnings=error, which should not be implied by
6453 --warnings=all (or by its synonyms -W and --warnings without
6454 subarguments).
6455 * src/complain.c (set_warning_issued): New function to report that
6456 warnings are being treated as errors and to record an error if so.
6457 Invoke...
6458 (warn_at, warn): ... here.
6459 * src/getargs.c (warnings_args, warnings_types): Reorder so that
6460 "error - warnings are errors" does not appear above "all - all of the
6461 above".
6462 (getargs): For -W and --warnings without subarguments, don't let
6463 FLAGS_ARGMATCH set warnings_error in warnings_flag.
6464 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
6465
ba7560e2
JD
64662006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6467
6468 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
6469 empty subargument list. For example: `bison --warnings= parser.y'.
6470
31283fc3
JD
64712006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6472
6473 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
6474 the parser header file so that gcc doesn't warn.
6475
12e35840
JD
64762006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6477
6478 Split the default %destructor/%printer into two kinds: <*> and <!>.
6479 Discussed starting at
6480 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
6481 * NEWS (2.3a+): Mention.
6482 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
6483 previous change today related to mid-rules.
148d66d8 6484 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 6485 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
6486 (TYPE_TAG_ANY): Add as <*>.
6487 (TYPE_TAG_NONE): Add as <!>.
6488 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
6489 for <*> and <!>.
6490 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
6491 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
6492 * src/symlist.c (symbol_list_default_new): Split into tagged and
6493 tagless versions.
6494 (symbol_list_destructor_set, symbol_list_printer_set): Split
6495 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
6496 SYMLIST_DEFAULT_TAGLESS.
6497 * src/symlist.h: Update symbol_list_default*_new prototypes.
6498 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
6499 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
6500 * src/symtab.c (default_destructor, default_destructor_location,
6501 default_printer, default_printer_location): Split each into tagged and
6502 tagless versions.
6503 (symbol_destructor_get, symbol_destructor_location_get,
6504 symbol_printer_get, symbol_printer_location_get): Implement tagged
6505 default and tagless default cases.
6506 (default_destructor_set, default_printer_set): Split each into tagged
6507 and tagless versions.
6508 * src/symtab.h: Update prototypes.
6509 * tests/actions.at (Default %printer and %destructor): Rename to...
6510 (Default tagless %printer and %destructor): ... this, and extend.
6511 (Per-type %printer and %destructor): Rename to...
6512 (Default tagged and per-type %printer and %destructor): ... this, and
6513 extend.
6514 (Default %printer and %destructor for user-defined end token): Extend.
6515 (Default %printer and %destructor are not for error or $undefined):
6516 Update.
6517 (Default %printer and %destructor are not for $accept): Update.
6518 (Default %printer and %destructor for mid-rule values): Extend.
6519 * tests/input.at (Default %printer and %destructor redeclared): Extend.
6520 (Unused values with default %destructor): Extend.
6521
f91b1629
JD
65222006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6523
6524 Don't apply the default %destructor/%printer to an unreferenced midrule
6525 value. Mentioned at
6526 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
6527 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
6528 like $@n instead of just @n so that the default %destructor/%printer
6529 logic doesn't see them as user-defined symbols.
6530 (symbol_is_dummy): Check for both forms of the name.
6531 * src/reader.c (packgram): Remove the `$' from each midrule symbol
6532 name for which the midrule value is referenced in any action.
6533 * tests/actions.at (Default %printer and %destructor for mid-rule
6534 values): New test.
6535 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
6536 for change to dummy symbol names.
6537
519d0004
JD
65382006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
6539
6540 Warn about unset midrule $$ if the corresponding $n is used.
6541 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
6542 $n usage.
6543 (packgram): Before invoking grammar_rule_check on any rule, make sure
6544 all actions have already been scanned in order to set `used' flags.
6545 Otherwise, checking that a midrule's $$ is set will not always work
6546 properly because the midrule check must forward-reference the midrule's
6547 parent rule.
6548 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
6549 warning.
6550
a501eca9
JD
65512006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
6552
6553 More improvements to the documentation of the prologue alternatives:
6554 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
6555 Bison manual.
6556 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
6557 some text to clarify the relative importance of the new directives and
6558 to show how these directives may be viewed as code labels.
6559
2cbe6b7f
JD
65602006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
6561
6562 Similar to the recently removed %before-header, add %code-top as the
6563 alternative to the pre-prologue. Mentioned at
6564 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
6565 Also, let the prologue alternatives appear in the grammar section.
6566 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
6567 (prologue_declaration): Move the existing prologue alternatives to...
6568 (grammar_declaration): ... here and add %code-top.
6569 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
6570
6571 Clean up and extend documentation for the prologue alternatives.
6572 * NEWS (2.3a+): Describe prologue alternatives.
6573 * doc/bison.texinfo (Prologue): Move discussion of prologue
6574 alternatives to...
6575 (Prologue Alternatives): ... this new section, and extend it to discuss
6576 all 4 directives in detail.
148d66d8
JD
6577 (Table of Symbols): Clean up discussion of prologue alternatives and
6578 add %code-top.
2cbe6b7f 6579
e557d3ea
JMG
65802006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6581
6582 DJGPP specific issues.
6583
6584 * djgpp/config.bat: config.hin has been moved to lib. Adjust
6585 config.bat accordingly.
6586 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
6587 * djgpp/config.site: Likewise.
6588
136a0f76
PB
65892006-10-16 Paolo Bonzini <bonzini@gnu.org>
6590
27bd5d67
PB
6591 Replace %*-header with %provides, %requires, %code. See discussion at
6592 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
6593
136a0f76
PB
6594 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
6595 (b4_user_start_header): Remove.
6596 * data/glr.c: Use new macros instead of b4_*start_header
6597 and b4_*end_header.
6598 * data/glr.cc: Likewise.
6599 * data/lalr1.cc: Likewise.
6600 * data/push.c: Likewise.
6601 * data/yacc.c: Likewise.
6602
6603 * doc/bison.texinfo: Remove %before-header, rename
6604 %{start,end,after}-header to %requires, %provides, %code.
6605
6606 * src/parse-gram.y: Likewise (also rename token names accordingly).
6607 * src/scan-gram.l: Likewise.
6608 * tests/actions.at: Likewise.
6609
10f429ef
PE
66102006-10-14 Paul Eggert <eggert@cs.ucla.edu>
6611
6612 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
6613 Problem reported by Joel E. Denny.
6614
66152006-10-14 Jim Meyering <jim@meyering.net>
6616
6617 (Sync from coreutils.)
6618 Work also when the working directory (with e.g. coreutils sources)
6619 is version controlled with git, rather than CVS.
6620 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
6621 rather than CVS.
6622 In messages and comments, say e.g., "checked-out sources",
6623 rather than "CVS sources".
6624 (version_controlled_file): New function. Work for git as well as
6625 for CVS. Don't use grep's -q option.
6626 (slurp): Call it here, in place of CVS-specific code.
6627
c4bd5bf7
JD
66282006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
6629
6630 Fix testsuite for ./configure --enable-gcc-warnings:
6631 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
6632 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
6633 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
6634 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
6635 * test/regression.at (Diagnostic that expects two alternatives):
6636 Likewise.
6637
46356ea4
PE
66382006-10-12 Paul Eggert <eggert@cs.ucla.edu>
6639
231ed89a
PE
6640 * bootstrap.conf (gnulib_modules): Add config-h.
6641 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
6642 worry about HAVE_CONFIG_H.
6643 * lib/abitset.c: Likewise.
6644 * lib/bitset.c: Likewise.
6645 * lib/bitset_stats.c: Likewise.
6646 * lib/bitsetv-print.c: Likewise.
6647 * lib/bitsetv.c: Likewise.
6648 * lib/ebitset.c: Likewise.
6649 * lib/get-errno.c: Likewise.
6650 * lib/lbitset.c: Likewise.
6651 * lib/subpipe.c: Likewise.
6652 * lib/timevar.c: Likewise.
6653 * lib/vbitset.c: Likewise.
6654 * lib/bitset.c: Include "bitset.h" first, to test interface.
6655 * lib/bitset_stats.c: Include "bitset_stats.h" first.
6656 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
6657 * lib/bitsetv.c: Include "bitsetv.h" first.
6658 * lib/get-errno.c: Include "get-errno.h" first.
6659 * m4/.cvsignore: Add config-h.m4.
6660 * tests/actions.at (Default %printer and %destructor for ...):
6661 Adjust expected line numbers in output to reflect removal of #if
6662 HAVE_CONFIG_H lines.
6663 * tests/glr-regression.at (Missed %merge type warnings when ...):
6664 Likewise.
6665 * tests/regression.at (Braced code in declaration in rules section):
6666 Likewise.
6667 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
6668 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
6669 Include <config.h> unconditionally.
6670
46356ea4
PE
6671 * bootstrap: Sync from coreutils, as follows:
6672
6673 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
6674
6675 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
6676 variable was sometimes used without being initialized. This
6677 messed up the installation of the INSTALL file in some cases.
6678
6679 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
6680
6681 * bootstrap (usage, main program, symlink_to_gnulib): Add option
6682 --copy. Inspired by a suggestion from Bruno Haible.
6683
6684 2006-10-03 Jim Meyering <jim@meyering.net>
6685
6686 * bootstrap: Undo last change to this file, since now gnulib-tool
6687 sticks with the automake default in generating dependencies.
6688
dd4bf078
PE
66892006-10-12 Paul Eggert <eggert@cs.ucla.edu>
6690
cf2a5f7c
PE
6691 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
6692 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
6693
6694 * doc/bison.1: Add copyright notice.
6695
6696 * data/glr.c: Don't include <stdarg.h>; not used.
6697
35fe0834
PE
6698 * NEWS: The -g and --graph options now output graphs in Graphviz
6699 DOT format, not VCG format.
6700 * doc/bison.1: Likewise.
6701 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
6702 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
6703 of this change in
6704 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
6705 * TODO: Remove Graphviz entry.
6706 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
6707 remove vcg.c, vcg.h, vcg_defaults.h.
6708 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
6709 * src/graphviz.c, src/graphviz.h: New files.
6710 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
6711 * src/files.h: Make comment more generic.
6712 * src/main.c (main): Likewise.
6713 * src/print_graph.h: Likewise.
6714 * src/getargs.c (usage): Make usage description more generic.
6715 * src/print_graph.c: Include graphviz.h rather than vcg.h.
6716 (static_graph, fgraph): Remove. All uses changed to pass
6717 arguments instead of sharing a static var.
6718 (print_core, print_actions, print_state, print_graph):
6719 Output graphviz format rather than VCG format.
6720 * tests/.cvsignore: Remove *.vcg; add *.dot.
6721 * tests/output.at: Expect *.dot files, not *.vcg files.
6722
dd4bf078
PE
6723 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
6724 accommodates the 2006-10-08 change.
6725
efdd7421
PE
67262006-10-11 Bob Rossi <bob@brasko.net>
6727
6728 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
6729 (b4_yyssa, b4_yyerror_range): New macros.
6730 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
6731 (yypvarsinit): Remove init of removed fields.
6732 (yypushparse): Remove use of removed fields; use new macros instead.
6733
96a1981a
PE
67342006-10-11 Paul Eggert <eggert@cs.ucla.edu>
6735
6736 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
6737 in a push parser. Reindent slightly to match yacc.c better.
6738
67392006-10-11 Bob Rossi <bob@brasko.net>
6740
46356ea4
PE
6741 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
6742 yymsg_alloc fields.
6743 (yypvarsinit, yypushparse): Remove init of removed fields.
6744 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 6745
c1630a8b
PE
67462006-10-09 Paul Eggert <eggert@cs.ucla.edu>
6747
6748 * THANKS: Add Paolo Bonzini and Bob Rossi.
6749
90b9908d
PB
67502006-10-08 Paolo Bonzini <bonzini@gnu.org>
6751
6752 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
6753 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
6754 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
6755 b4_define_user_cde and uses): Remove.
6756 (b4_comment, b4_prefix, b4_sync_start): New.
6757 * data/bison.m4: New file, with most of the content removed from c.m4.
6758 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
6759 * src/output.c (output_skeleton): Pass bison.m4.
6760 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
6761 only if specified.
6762
cf806753
PE
67632006-10-05 Paul Eggert <eggert@cs.ucla.edu>
6764
6765 Fix test failure reported by Tom Lane in
6766 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
6767 and try to make such failures easier to catch in the future.
6768 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
6769 that's now the caller's responsibility.
6770 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
6771 Set yychar = YYEOF if it's negative.
6772 * tests/actions.at (yylex): Abort if asked to read past EOF.
6773 * tests/conflicts.at (yylex): Likewise.
6774 * tests/cxx-type.at (yylex): Likewise.
6775 * tests/glr-regression.at (yylex): Likewise.
6776 * tests/input.at (yylex): Likewise.
6777 * tests/regression.at (yylex): Likewise.
6778 * tests/torture.at (yylex): Likewise.
6779
0e2f006a
PE
67802006-10-01 Paul Eggert <eggert@cs.ucla.edu>
6781
6782 Fix problems with translating English-language diagnostics.
6783 * bootstrap: Fix bug introduced in recent bootstrap changes, with
6784 respect to bison-runtime pot generation. The YY_ stuff
6785 wasn't being captured.
6786 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
6787 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
6788 * runtime-po/POTFILES.in: Add data/push.c.
6789
e3ddc1e3
PE
67902006-09-29 Paul Eggert <eggert@cs.ucla.edu>
6791
6792 Merge bootstrap changes from coreutils.
6793
6794 2006-09-28 Jim Meyering <jim@meyering.net>
6795
6796 Automatically generated dependencies are important even
6797 when all of the sources in a directory come from gnulib.
6798 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
6799 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
6800
6801 2006-09-23 Jim Meyering <jim@meyering.net>
6802
6803 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
6804
6805 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6806
6807 * bootstrap: Add support for --force.
6808 (usage): New function. Describe usage less tersely.
6809 (CVS_only_file): New var.
6810
01e972b3
PE
68112006-09-21 Paul Eggert <eggert@cs.ucla.edu>
6812
6813 * data/push.c (YYPUSH_MORE): Make it an enum instead.
6814 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
6815 Adjust white space and comments to match GNU style better.
6816
c63d3e90
PE
68172006-09-20 Bob Rossi <bob@brasko.net>
6818
6819 * data/push.c (yyresult_get): Remove function.
6820 (YYPUSH_MORE): Add #define.
6821 (yypushparse): Modify return value.
6822
e70f46d1
PE
68232006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6824
6825 * stamp-h.in: Remove; no longer needed.
6826 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
6827 Remove config.h, config.hin, intl (no longer created).
6828 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
6829 stamp-h1.
6830
6831 Sync bootstrap from coreutils, as follows:
6832
6833 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
6834
6835 * bootstrap (symlink_to_gnulib): New function.
6836 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
6837 to copies-of-gnulib.
6838 (cp_mark_as_generated, slurp, gnulib_files):
6839 Avoid making a copy if it's the same as the old version.
6840 (gnulib_files): Add support for this variable (used by Bison).
6841
a92be413
PE
68422006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6843
6844 * src/getargs.c (usage): Rework to use conventions similar to
6845 coreutils, to make translation a bit easier and the code a bit
6846 smaller. Problem reported by Tim Van Holder.
6847
4f82b42a
PE
68482006-09-15 Paul Eggert <eggert@cs.ucla.edu>
6849
3b2942e6
PE
6850 Use some of gnulib's new modules, taken from coreutils.
6851
6852 * bootstrap: Sync from coreutils, except add support for gnulib_files.
6853 * bootstrap.conf: New file.
6854 (gnulib_modules): Add configmake, inttypes, unistd.
6855 (XGETTEXT_OPTIONS): Add complain, complain_at,
6856 fatal, fatal_at, warn, warn_at, unexpected_end.
6857 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
6858 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
6859 (gl_EARLY): Add.
6860 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
6861 (gl_INIT): Add
6862 (GNULIB_AUTOCONF_SNIPPET): Remove.
6863 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
6864 the pickiest.
6865 * lib/.cvsignore: Add inttypes_.h.
6866 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
6867 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
6868 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
6869 no-longer-necessary initializations.
6870 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
6871 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
6872 use the unistd module.
6873 * src/system.h: Likewise.
6874 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
6875 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
6876 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
6877 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
6878 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
6879 * src/system.h: Include inttypes.h unconditionally, now that we
6880 use the inttypes module. Don't bother to include stdint.h, since
6881 inttypes.h now does that for us.
6882 (LOCALEDIR): Remove, now that we use the configmake module.
6883 * src/getargs.c: Include configmake.h.
6884 * src/main.c: Likewise.
6885 * src/output.c: Likewise.
6886 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
6887 not from $abs_top_builddir, since config.h moved.
6888
6889
4f82b42a
PE
6890 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
6891 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
6892
6893 * src/parse-gram.y (symbol_declaration): Don't put statements
6894 before declarations; it's not portable to C89.
6895 * src/scan-code.l (handle_action_at): Likewise.
6896
6897 * src/scan-code.l: Always initialize braces_level; the old code
6898 left it uninitialized and therefore had undefined behavior.
6899
6900 Don't attempt to redefine 'assert', since it runs afoul of
6901 systems where standard headers (mistakenly) include <assert.h>.
6902 Instead, define and use our own alternative, called 'aver'.
6903 * src/reader.c: Don't include assert.h, since we no longer
6904 use assert.
6905 * src/scan-code.l: Likewise.
6906 * src/system.h (assert): Remove, replacing with....
6907 (aver): New function, taking a bool arg. All uses changed.
6908 * src/tables.c (pack_vector): Ensure that aver arg is bool,
6909 not merely an integer.
6910
31c10e38
PE
69112006-09-15 Bob Rossi <bob@brasko.net>
6912
e5926647
JD
6913 Add support for push parsing. Based on the original work of
6914 Odd Arild Olsen <oao@fibula.no>.
31c10e38
PE
6915 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
6916 * data/c.m4 (YYPUSH): New.
6917 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
e5926647 6918 * data/push.c: New file.
31c10e38
PE
6919 * src/getargs.c (push_parser): New var.
6920 * src/getargs.h (push_parser): New declaration.
6921 * src/output.c (prepare): Add macro insertion of `push_flag'.
6922 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
6923 (prologue_declaration): Parse %push-parser.
6924 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
6925 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
6926 list of removed lines from the traces observed.
6927 (AT_CHECK_CALC_LALR): Added push parser tests.
6928
fa7b79c0
PE
69292006-09-13 Paul Eggert <eggert@cs.ucla.edu>
6930
21fe08ca
PE
6931 * NEWS: Version 2.3a.
6932 * configure.ac (AC_INIT): Likewise.
6933
e8ec4d9b
PE
6934 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
6935 "#define YYSTYPE int" that caused "make maintainer-check" to fail
6936 due to header ordering dependencies. I don't know why the #define
6937 was there.
6938
fa7b79c0
PE
6939 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
6940 runtime cost when YYDEBUG is not defined, and so that some tests
6941 that used to fail now work. Problem and initial suggestion by
6942 Paolo Bonzini.
6943 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
6944 * data/glr.cc (b4_parser_class_name):
6945 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
6946 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
6947 (yydebug_) [YYDEBUG]: New member.
6948 (yycdebug_): Now defined only if YYDEBUG.
6949 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
6950 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
6951 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
6952 if YYYDEBUG.
6953 (debug_stream, set_debug_stream, debug_level, set_debug_level):
6954 Define only if YYDEBUG.
6955 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
6956 set_debug_level.
6957 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
6958 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
6959 AT_CHECK_CALC_GLR_CC that are working now.
6960
4ec13d60
PE
69612006-09-12 Paul Eggert <eggert@cs.ucla.edu>
6962
6963 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
6964 We don't need them in glr.cc, and glr.c defines them.
6965 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
6966 assumes that defining it to anything is the same as defining
6967 it to 1. Problem reported by Paolo Bonzini.
6968
8e1687ae
PE
69692006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
6970
6971 * data/c.m4 (b4_null, b4_case): Define.
6972 * src/output.c (prepare_symbols): Use b4_null.
6973 (user_actions_output): Use b4_case.
6974
3dc5e96b
PE
69752006-09-11 Paul Eggert <eggert@cs.ucla.edu>
6976
aef3da86
PE
6977 * data/glr.c (b4_shared_declarations): Put start-header first,
6978 before any #includes that we generate, so that feature-test
6979 macros work. Problem reported by Michael Deutschmann in
6980 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
6981 * data/lalr1.cc: Likewise.
6982 * doc/bison.texinfo (Prologue): Document that feature-test macros
6983 should be defined before any Bison declarations.
6984 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
6985 that depend on location.hh after, not before, Bison decls, since
6986 we now include location.hh after the first user prologue.
6987
3dc5e96b
PE
6988 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
6989 Sander Brandenburg in
6990 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
6991 Also, fix minor white space and comment issues.
aef3da86
PE
6992 (Prologue): Mention that it's better to define feature-test macros
6993 before Bison declarations. Problem reported by Michael Deutschmann.
6994
6995 * README-cvs: Fix typo: "&" should be "&&". Problem reported
6996 by Jim Meyering.
6997 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
6998 This adjusts to recent gnulib changes.
3dc5e96b 6999
b2a0b7ca
JD
70002006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
7001
7002 Finish implementation of per-type %destructor/%printer. Discussed
7003 starting at
7004 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
7005 and
7006 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
7007 * NEWS (2.3+): Add a description of this feature to the default
7008 %destructor/%printer description.
7009 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
7010 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
7011 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
7012 list node contains a semantic type.
7013 * src/symtab.c, src/symtab.h: Extend with a table that associates
7014 semantic types with their %destructor's and %printer's.
7015 (semantic_type_from_uniqstr, semantic_type_get,
7016 semantic_type_destructor_set, semantic_type_printer_set): New functions
7017 composing the public interface of that table.
7018 (symbol_destructor_get, symbol_destructor_location_get,
7019 symbol_printer_get, symbol_printer_location_get): If there's no
7020 per-symbol %destructor/%printer, look up the per-type before trying
7021 the default.
7022 * tests/actions.at (Per-type %printer and %destructor): New test case.
7023 * tests/input.at (Default %printer and %destructor redeclared):
7024 Extend to check that multiple occurrences of %symbol-default in a
7025 single %destructor/%printer declaration is an error.
7026 (Per-type %printer and %destructor redeclared, Unused values with
7027 per-type %destructor): New test cases.
7028
3be03b13
JD
70292006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
7030
7031 Require default %destructor/%printer to be declared using
7032 %symbol-default instead of an empty symbol list, and start working on
7033 new per-type %destructor/%printer. Discussed at
7034 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
7035 * NEWS (2.3+): Add %symbol-default to example.
7036 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 7037 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
7038 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
7039 (generic_symlist, generic_symlist_item): New nonterminals for creating
7040 a list in which each item is a symbol, semantic type, or
7041 %symbol-default.
7042 (grammar_declaration): Use generic_symlist in %destructor and %printer
7043 declarations instead of symbols.1 or an empty list.
7044 (symbol_declaration, precedence_declaration, symbols.1): Update actions
7045 for changes to symbol_list.
7046 * src/reader.c: Update for changes to symbol_list.
7047 * src/scan-code.l: Likewise.
7048 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
7049 * src/symlist.c, src/symlist.h: Extend such that a list node may
7050 represent a semantic type or a %symbol-default in addition to just an
7051 ordinary symbol. Add switched functions for setting %destructor's and
7052 %printer's.
7053 * tests/actions.at, tests/input.at: Add %symbol-default to all default
7054 %destructor/%printer declarations.
7055
3508ce36
JD
70562006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
7057
7058 Whether the default %destructor/%printer applies to a particular symbol
7059 isn't a question of whether the user *declares* that symbol (in %token,
7060 for example). It's a question of whether the user by any means
7061 *defines* the symbol at all (by simply using a char token, for
7062 example). $end is defined by Bison whereas any other token with token
7063 number 0 is defined by the user. The error token is always defined by
7064 Bison regardless of whether the user declares it with %token, but we
7065 may one day let the user define error as a nonterminal instead.
7066 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
7067 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
7068 the meaning of "user-defined".
7069 * tests/actions.at (Default %printer and %destructor for user-declared
7070 end token): Rename to...
7071 (Default %printer and %destructor for user-defined end token): ...
7072 this.
7073
7074 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
7075 computation of whether to apply the default, don't maintain a list of
7076 every Bison-defined symbol. Instead, just check for a first character
7077 of '$', which a user symbol cannot have, and check for the error token.
7078
9350499c
JD
70792006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
7080
7081 Don't apply the default %destructor or %printer to the error token,
7082 $undefined, or $accept. This change fits the general rule that the
7083 default %destructor and %printer are only for user-declared symbols,
7084 and it solves several difficulties that are described in the new test
7085 cases listed below.
7086 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
7087 * tests/actions.at (Default %printer and %destructor are not for error
7088 or $undefined, Default %printer and %destructor are not for $accept):
7089 New test cases.
7090
4d7370cb
JD
70912006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
7092
7093 Allow %start after the first rule.
7094 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
7095 when parsing the first rule.
7096 (check_and_convert_grammar): Search for it here after all grammar
7097 declarations have been parsed. Skip midrules, which have dummy LHS
7098 nonterminals.
7099 * src/symtab.c (symbol_is_dummy): New function.
7100 * src/symtab.h (symbol_is_dummy): Declare it.
7101 * tests/input.at (%start after first rule): New test.
7102
6d0ef4ec
JD
71032006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
7104
7105 Redo some of the previous commit: add back the ability to use
7106 non-aliased/undeclared string literals since it might be useful to
7107 those declaring %token-table.
7108 * src/reader.c (check_and_convert_grammar): Undo changes in previous
7109 commit: don't worry about complaints from symbols_pack.
7110 * src/symtab.c (symbol_new, symbol_class_set,
7111 symbol_check_alias_consistency): Undo changes in previous commit: count
7112 each string literal as a new symbol and token, assign it a symbol
7113 number, and don't complain about non-aliased string literals.
7114 (symbols_pack): Since symbol_make_alias still does not decrement symbol
7115 and token counts but does still set aliased tokens to the same number,
7116 symbol_pack_processor now leaves empty slots in the symbols array.
7117 Remove those slots.
7118 * tests/regression.at (Undeclared string literal): Remove test case
7119 added in previous commit since non-aliased string literals are allowed
7120 again.
7121 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
7122 remove unnecessary string literal declarations.
7123 * tests/sets.at (Firsts): Likewise.
7124
965537bc
JD
71252006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
7126
7127 Don't allow an undeclared string literal, but allow a string literal to
7128 be used before its declaration.
7129 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
7130 symbols_pack complained.
7131 * src/symtab.c (symbol_new): Don't count a string literal as a new
7132 symbol.
7133 (symbol_class_set): Don't count a string literal as a new token, and
7134 don't assign it a symbol number since symbol_make_alias does that.
7135 (symbol_make_alias): It's not necessary to decrement the symbol and
7136 token counts anymore. Don't assume that an alias declaration occurs
7137 before any uses of the identifier or string, and thus don't assert that
7138 one of them has the highest symbol number so far.
7139 (symbol_check_alias_consistency): Complain if there's a string literal
7140 that wasn't declared as an alias.
7141 (symbols_pack): Bail if symbol_check_alias_consistency failed since
7142 symbol_pack asserts that every token has been assigned a symbol number
7143 although undeclared string literals have not.
7144 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 7145 string literal): New test cases.
965537bc
JD
7146 (Characters Escapes, Web2c Actions): Declare string literals as
7147 aliases.
7148 * tests/sets.at (Firsts): Likewise.
7149
47aee066
JD
71502006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
7151
7152 In the grammar scanner, STRING_FINISH unclosed constructs and return
7153 them to the parser in order to improve error messages.
7154 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
7155 SC_BRACED_CODE, SC_PROLOGUE): Implement.
7156 * tests/input.at (Unclosed constructs): New test case.
7157 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
7158 seen.
7159
7160 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
7161 unused global.
7162
1f6b3679
JD
71632006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
7164
7165 Handle string aliases for character tokens correctly.
7166 * src/symtab.c (symbol_user_token_number_set): If the token has an
7167 alias, check and set its alias's user token number instead of its own,
7168 which is set to indicate the alias. Previously, every occurrence of
7169 the character token in the grammar overwrote that alias indicator with
7170 the character code.
7171 * tests/input.at (String aliases for character tokens): New test.
7172
219741d8
JD
71732006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
7174
7175 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
7176
11daa4e7
PE
71772006-08-11 Paul Eggert <eggert@cs.ucla.edu>
7178
7179 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
7180 to prevent failures when building on older platforms.
7181 Check for autopoint failure.
7182 Set XGETTEXT_OPTIONS to values that check for C format strings,
7183 so that translators are warned about them (this also helps
7184 prevent core dumps).
7185
7186 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
7187 function, since it simplifies our code a bit.
7188
7189 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
7190 rather than -W, so we don't get bogus warnings about sign comparisons.
7191 Add -Wpointer-arith, since that warning is useful (it reports code
7192 that does not conform to C89 and that some compilers reject).
7193 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
7194 since it's no longer needed.
7195
f9bfc42a
JD
71962006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
7197
7198 Clean up scanners a bit.
7199 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
7200 definitions so gcc won't warn when obstack_for_string is unused.
7201 * src/scan-code.l: config.h and system.h are already #include'd by
7202 scan-code-c.c, so get rid of them here.
7203 * src/scan-gram.l: Likewise.
7204 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
7205 definitions rather than duplicating the rest of it.
7206 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
7207
06e8700a
JD
72082006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
7209
7210 Suppress signed/unsigned comparison warnings for yycheck.
7211 * data/c.m4 (b4_safest_int_type): New macro.
7212 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
7213 a signed int type, cast it to b4_safest_int_type first.
7214 * data/yacc.c: Likewise.
7215 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
7216 also overwritten.
7217
9c437126
PE
72182006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
7219
7220 * doc/bison.texinfo: Fix some typos.
7221
284d8a13
PE
72222006-08-02 Paul Eggert <eggert@cs.ucla.edu>
7223
7224 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
7225 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
7226
7227 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
7228 the latest gnulib does this a different way.
7229 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
7230 translation was patched, so stop omitting it.
7231
ec5479ce
JD
72322006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
7233
7234 Enable declaration of default %printer/%destructor. Make the parser
7235 use these for all user-declared grammar symbols for which the user does
7236 not declare a specific %printer/%destructor. Thus, the parser uses it
7237 for token 0 if the user declares it but not if Bison generates it as
7238 $end. Discussed starting at
7239 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
7240 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
7241 and
7242 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
7243 * NEWS (2.3+): Mention.
7244 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
7245 declare a %destructor for a mid-rule's semantic value. It's just
7246 impossible to declare one specific to it.
7247 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
7248 code. Describe default %destructor form.
7249 * src/parse-gram.y (grammar_declaration): Parse default
7250 %printer/%destructor declarations.
7251 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
7252 and symbol_destructor_location_get rather than accessing the destructor
7253 and destructor_location members of struct symbol.
7254 (symbol_printers_output): Likewise but for %printer's.
7255 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
7256 again.
7257 * src/symtab.c (default_destructor, default_destructor_location,
7258 default_printer, default_printer_location): New static global
7259 variables to record the default %destructor and %printer.
7260 (symbol_destructor_get, symbol_destructor_location_get,
7261 symbol_printer_get, symbol_printer_location_get): New functions to
7262 compute the appropriate %destructor and %printer for a symbol.
7263 (default_destructor_set, default_printer_set): New functions to set the
7264 default %destructor and %printer.
7265 * src/symtab.h: Prototype all those new functions.
7266 * tests/actions.at (Default %printer and %destructor): New test to
7267 check that the right %printer and %destructor are called, that they're
7268 not called for $end, and that $$ and @$ work correctly.
7269 (Default %printer and %destructor for user-declared end token): New
7270 test to check that the default %printer and %destructor are called for
7271 a user-declared end token.
7272 * tests/input.at (Default %printer and %destructor redeclared, Unused
7273 values with default %destructor): New tests to check related grammar
7274 warnings and errors.
7275
868d2d96
JD
72762006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
7277
7278 Clean up handling of %destructor for the end token (token 0).
7279 Discussed starting at
7280 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
7281 and
7282 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
7283
7284 Make the skeletons consistent in how they pop the end token and invoke
7285 its %destructor.
7286 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
7287 state, which has token number 0, since this would invoke the
7288 %destructor for the end token.
7289 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
7290 until after shifting the end token, or else it won't be popped.
7291 * data/yacc.c (yyparse): Likewise.
7292
7293 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
7294 it's the end token. Upon termination, destroy an unshifted lookahead
7295 even when it's the end token.
7296 * data/lalr1.cc (yy::parser::parse): Likewise.
7297 * data/yacc.c (yyparse): Likewise.
7298
7299 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
7300 value warnings for the end token when the user gives the end token a
7301 %destructor.
7302
7303 * tests/actions.at (Printers and Destructors): Test all the above.
7304
62a9592d
PE
73052006-07-24 Paul Eggert <eggert@cs.ucla.edu>
7306
7307 Update to latest gnulib and gettext versions.
7308 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
7309 Add fopen-safer.
7310 (gnulib_files): Add m4/warning.m4. Don't worry about files
7311 overwritten by autopoint.
7312 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
7313 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
7314 rejects them.
7315 Don't use autoreconf; instead, invoke autopoint etc. by hand,
7316 so that we can remove the intl files at a better time.
7317 (intl_files_to_remove): Remove aclocal.m4, since it gets
7318 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
7319 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
7320 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
7321 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
7322 Remove datarootdir hack; no longer needed.
7323 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
7324 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
7325 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
7326 strdup.h.
7327 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
7328 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
7329
10d6970f
PE
73302006-07-20 Paul Eggert <eggert@cs.ucla.edu>
7331
7332 * bootstrap: Adjust to today's change to gnulib-tool by invoking
7333 it with --assume-autoconf='latest-stable'.
7334
50a33993
JD
73352006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
7336
7337 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
7338 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
7339 YYSTYPE' and `{'.
7340 * src/muscle_tab.h (muscle_grow): Replace the header comments with
7341 those from muscle_tab.c since the old ones are misleading.
7342
2ce4ed68
AD
73432006-07-13 Akim Demaille <akim@epita.fr>
7344
7345 Support %define "KEY" {VALUE}.
7346 * src/scan-code.h, src/scan-code.l (translate_action)
7347 (translate_rule_action, translate_symbol_action, translate_code):
7348 Return char *, not const char *.
7349 * src/parse-gram.y (declaration): Rename as...
7350 (prologue_declaration): this.
7351 (string_content): Remove this nonterminal, use STRING.
7352 (braceless, content, content.opt): New nonterminal.
7353 Use them.
7354 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
7355 as value.
7356 * src/scan-gram.l (getargs.h): Don't include it.
7357
db7e5eb5
PE
73582006-07-12 Paul Eggert <eggert@cs.ucla.edu>
7359
7360 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
7361 rather than a for-loop that declares a local bool variable. This
7362 should work around a compatibility problem with a Cray x1e C++
7363 compiler reported by Hung Nguyen in
7364 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
7365 The for-loop was introduced in the 2004-11-17 change but I don't
7366 know why it was needed.
7367
a5d80ba5
AD
73682006-07-12 Akim Demaille <akim@epita.fr>
7369
7370 * data/c.m4: Comment changes.
7371
23eb2a69
AD
73722006-07-10 Akim Demaille <akim@lrde.epita.fr>
7373
7374 * src/complain.c (error_message, ERROR_MESSAGE): New.
7375 To factor...
7376 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
7377 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
7378
ddc8ede1
PE
73792006-07-09 Paul Eggert <eggert@cs.ucla.edu>
7380
7381 * NEWS: Instead of %union, you can define and use your own union type
7382 YYSTYPE if your grammar contains at least one <type> tag.
7383 Your YYSTYPE need not be a macro; it can be a typedef.
7384 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
7385 (Union Decl, Decl Summary): Document this.
7386 * data/glr.c (YYSTYPE): Implement this.
7387 * data/glr.cc (YYSTYPE): Likewise.
7388 * data/lalr1.cc (YYSTYPE): Likewise.
7389 * data/yacc.c (YYSTYPE): Likewise.
7390 * src/output.c (prepare): Output tag_seen_flag.
7391 * src/parse-gram.y (declaration, grammar_declaration):
7392 Use 'union_seen' rather than 'typed' to determine whether
7393 %union has been seen, since grammars can now be typed without
7394 %union.
7395 (symbol_declaration, type.opt, symbol_def):
7396 Keep track of whether a tag has been seen.
7397 * src/reader.c (union_seen, tag_seen): New vars.
7398 (typed): remove.
7399 * src/reader.h (union_seen, tag_seen, typed): Likewise.
7400 * src/scan-code.l (untyped_var_seen): New variable.
7401 (handle_action_dollar): Adjust to above changes.
7402 (handle_action_dollar, handle_action_at):
7403 Improve overflow checking for outlandish numbers.
7404 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
7405 avoid new diagnostics generated by above changes.
7406 * tests/regression.at (YYSTYPE typedef): Add test to check
7407 for type tags without %union.
7408
7409 * src/symlist.c (symbol_list_length): Return int, not unsigned
7410 int, since callers expect int. This may need to get revisited
7411 once we have proper integer overflow checking.
7412
7413 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
7414 object is now static.
7415
7416 * src/getargs.c (flags_argmatch): Return void, not int,
7417 to pacify ./configure --enable-gcc-warnings.
7418
7419 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
7420 since last_string is already defined to FLEX_PREFIX (last_string).
7421
7b42569e
AD
74222006-07-09 Akim Demaille <akim@lrde.epita.fr>
7423
7424 Implement --warnings/-W.
7425 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
7426 replaced by...
7427 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
7428 Adjust callers.
7429 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
7430 (warnings_args, warnings_types): New.
7431 (getargs, short_options, long_options): Accept -W/--warnings.
7432 Sort the options by alphabetical order, upper case letter right
7433 before its lower case.
7434
3b452f4e
JD
74352006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
7436
7437 Change %merge result type clash warnings to errors. Discussed at
7438 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
7439 * src/reader.c (record_merge_function_type): Use complain_at.
7440 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7441 declared later): Update test case results.
7442
b8a41559
AD
74432006-07-09 Akim Demaille <akim@lrde.epita.fr>
7444
7445 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
7446 to be in alphabetical order.
7447 (trace_args): Spelling fixes.
7448
cd9e1ba2
PE
74492006-07-09 Paul Eggert <eggert@cs.ucla.edu>
7450
7451 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
7452 so they don't collide with user-defined macros.
7453 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
7454 this was never guaranteed, and now that we're using gnulib stdint,
7455 which defines int_fast16_t to long int, the problem is exposed.
7456
cb48f191
PE
74572006-07-08 Paul Eggert <eggert@cs.ucla.edu>
7458
b8445a15
PE
7459 * data/c.m4 (b4_basename): Simplify a bit, since we don't
7460 need the full POSIX semantics (and weren't implementing them
7461 anyway).
7462
cb48f191
PE
7463 Adjust to Autoconf 2.60 and today's gnulib.
7464 * bootstrap (gnulib_modules): Add stdint.
7465 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
7466 no longer copies it.
7467 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
7468 since stdint needs the former and wcwidth (which is now required
7469 by mbswidth) needs the latter.
7470 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
7471 work around a compatibility glitch between gettext 0.14.6 and
7472 Autoconf 2.60.
7473 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
7474 Do not check for uintptr_t, since new stdint module does the right
7475 thing.
7476 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
7477 Add stdint.h, stdint_.h, wcwidth.h.
7478 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
7479 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
7480 stdint.m4, wchar_t.m4, wcwidth.m4.
7481 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
7482 usual order for ../lib/*.h files.
7483 (file_name_split): Use last_component, not base_name, to adjust
7484 to gnulib changes.
7485 * src/parse-gram.h: Include <strverscmp.h> in the usual order
7486 for ../lib/*.h files.
7487 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
7488 Define unconditionally, since we now assume the stdint module.
7489 * src/scan-skel.l: Include <dirname.h>.
7490 (BASE_QPUTS): Use last_component, not base_name.
7491 * src/system.h: Include <unlocked-io.h> in the usual order
7492 for ../lib/*.h files. Include <stdint.h> unconditionally,
7493 since we now use the stdint module.
7494 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
7495 HAVE_UINTPTR_T, since we now use the stdint module.
7496 (base_name): Remove decl, since files now include <dirname.h>
7497 to get the decl.
7498
cd48d21d
AD
74992006-07-08 Akim Demaille <akim@lrde.epita.fr>
7500
7501 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
7502 New, default to 1.
7503 * data/yacc.c, data/glr.c, data/location.cc: Use them.
7504 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
7505 default.
7506 * tests/calc.at: Adjust.
7507
8ec0a172
AD
75082006-07-08 Akim Demaille <akim@lrde.epita.fr>
7509
b8445a15 7510 * data/c.m4 (b4_basename): New.
8ec0a172
AD
7511 (b4_syncline): Also output the location of its invocation (from
7512 the skeleton).
7513 (b4_user_action, b4_define_user_action, b4_user_actions)
7514 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
7515 (b4_user_stype): New.
7516 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
7517
4a678af8
JD
75182006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
7519
7520 In the grammar file, the first column is 1 not 0 on the first line as
7521 on every other line.
7522 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
7523 * tests/input.at (Torturing the Scanner): Update output.
7524
7525 * src/scan-gram.l (scanner_cursor): Declare it static.
7526
dd60572a
JD
75272006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
7528
7529 In warnings, say "previous declaration" rather than "first
7530 declaration".
7531 * src/symtab.c (redeclaration): Do that here.
7532 * src/reader.c (record_merge_function_type): In the case of a result
7533 type clash, report the previous declaration rather than the very first
7534 one in the grammar file.
7535 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7536 declared later): Add a third declaration to check this behavior.
7537 * tests/input.at (Incompatible Aliases): Update output.
7538
2073e1b6
AD
75392006-06-27 Akim Demaille <akim@epita.fr>
7540
7541 * doc/Doxyfile.in: New.
7542 * doc/Makefile.am: Use it.
7543 * src/lalr.h, src/symtab.h: Initial doxygenation.
7544
8ee5b538
JD
75452006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7546
7547 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
7548 declared after the %merge. This continues the effort of the previous
7549 patch.
8ee5b538
JD
7550 * src/reader.c (get_merge_function): Don't set the merger type yet.
7551 (record_merge_function_type): New function for setting the merger type
7552 and checking for clashes.
7553 (grammar_current_rule_merge_set): Set the location of the %merge for
7554 the current rule.
7555 (packgram): Invoke record_merge_function_type for each rule now that
7556 all symbol type declarations have been parsed.
7557 * src/reader.h (merger_list.type_declaration_location): New member
7558 storing the location of the first %merge from which the type for this
7559 merging function was derived.
7560 * src/symlist.h (symbol_list.merger_declaration_location): New member
7561 storing the location of a rule's %merge, if any.
7562 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7563 declared later): New test to catch the error fixed by the above patch.
7564
ffa4ba3a
JD
75652006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7566
7567 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
7568 declarations appear after the rules. Discussed at
7569 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
7570 and
7571 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
7572 Don't mistake the type of $$ in a midrule to be that of its parent
7573 rule's $$.
ffa4ba3a
JD
7574 * src/reader.c (grammar_current_rule_end): Don't invoke
7575 grammar_rule_check yet since not all symbol declarations may have been
7576 parsed yet.
7577 (grammar_midrule_action): Likewise.
7578 Don't record whether the midrule's $$ has been used yet since actions
7579 haven't been translated yet.
7580 Record the midrule's parent rule and its RHS index within the parent
7581 rule.
7582 (grammar_current_rule_action_append): Don't translate the action yet
7583 since not all symbol declarations may have been parsed yet and, thus,
7584 warnings about types for $$, $n, @$, and @n can't be reported yet.
7585 (packgram): Translate the action and invoke grammar_rule_check now that
7586 all symbol declarations have been parsed.
7587 * src/scan-code.l (handle_action_dollar): Now that this is invoked
7588 after parsing the entire grammar file, the symbol list here in the case
7589 of a midrule is actually the midrule's empty RHS, so reference its
7590 parent rule's RHS where necessary.
7591 On the other hand, now that you can already know it's a midrule, you
7592 aren't forced to think $$ has the same type as its parent rule's $$.
7593 (handle_action_at): In the case of a midrule, reference the parent rule
7594 where necessary.
7595 * src/symlist.c (symbol_list_new): Initialize new midrule-related
7596 members.
7597 (symbol_list_length): Now that this is invoked after all rules have
7598 been parsed, a NULL symbol (rather than a NULL symbol list node)
7599 terminates a rule. symbol_list_print already does this correctly.
7600 * src/symlist.h (symbol_list.midrule_parent_rule,
7601 symbol_list.midrule_parent_rhs_index): New members so that midrules can
7602 remember their relationships with their parents.
7603 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
7604 fixed by the above patch.
7605 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
7606 implementing...
7607 (Unused values): ... this old test case and...
7608 (Unused values before symbol declarations): ... this new test case.
7609 This one is the same as `Unused values' except that all symbol
7610 declarations appear after the rules in order to catch the rest of the
7611 errors fixed by the above patch.
7612
e256e17f
JD
76132006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7614
300a1930
JD
7615 More cleanup.
7616 * src/reader.c (current_rule): Declare it static since it's no longer
7617 used outside this file.
7618 (grammar_current_rule_action_append): Remove redundant arguments from
7619 translate_rule_action invocation.
7620 * src/reader.h (current_rule): Remove this unused extern.
7621 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
7622 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 7623
381ecb06
JD
76242006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
7625
7626 Clean up yesterday's patch.
7627 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
7628 to...
7629 * src/reader.c (grammar_current_rule_action_append): ... here for
7630 consistency with grammar_current_rule_symbol_append.
7631 * tests/regression.at (Braced code in declaration in rules section):
7632 Make yyerror and yylex static as usual.
7633
4210cd0b
JD
76342006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
7635
7636 Fix bug that mistakes braced code in a declaration in the rules section
7637 to be a rule action. Mentioned at
7638 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
7639 * src/scan-gram.l: Move midrule action detection from the start of the
7640 scanning of any braced code to...
7641 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
7642 action. For readability, use $2 and @2 rather than the equivalent
7643 global variables.
7644 * tests/regression.at (Braced code in declaration in rules section):
7645 New test to catch the error fixed by the above patch.
7646
7647 Work on code readability some.
7648 * src/scan-code.l (current_rule): Get rid of this misleading and
7649 redundant declaration: it's actually extern'ed in reader.h.
7650 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
7651 translate_action): Add a rule argument and use it instead of the global
7652 current_rule.
7653 (translate_rule_action): This already receives current_rule through an
7654 argument, so pass it on to translate_action instead of assigning
7655 current_rule to current_rule.
7656 (translate_symbol_action, translate_code): Pass rule = NULL to
7657 translate_action.
7658
34f98f46
JD
76592006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
7660
7661 Rename %before-definitions to %start-header and %after-definitions to
7662 %end-header. Don't use these declarations to separate pre-prologue
7663 blocks from post-prologue blocks. Add new order-independent
7664 declarations %before-header and %after-header as alternatives to the
7665 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
7666 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
7667 * NEWS (2.3+): Update for these changes.
7668 * data/glr.c (b4_before_definitions): Update to...
7669 (b4_start_header): ... this.
7670 (b4_after_definitions): Update to...
7671 (b4_end_header): ... this.
7672 * data/glr.cc: Likewise.
7673 * data/lalr1.cc: Likewise.
7674 * data/yacc.c: Likewise.
7675 * doc/bison.texinfo (The prologue): Update names, and replace remaining
7676 prologue blocks with %*-header declarations.
7677 (Calc++ Parser): Likewise.
91661ebb 7678 (Decl Summary): Update names.
148d66d8 7679 (Table of Symbols): Update description.
34f98f46
JD
7680 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
7681 (PERCENT_END_HEADER): ... this.
7682 (PERCENT_BEFORE_DEFINITIONS): Update to...
7683 (PERCENT_START_HEADER): ... this.
7684 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
7685 (declaration): Update token names and m4 macro names.
7686 When parsing %end-header and %start-header, invoke translate_code
7687 before muscle_code_grow, and no longer set global booleans to remember
7688 whether these declarations have been seen.
7689 Parse new %after-header and %before-header.
7690 * src/reader.c (before_definitions, after_definitions): Remove.
7691 (prologue_augment): Accept a new bool argument to specify whether to
7692 augment the pre-prologue or post-prologue.
7693 * src/reader.h (before_definitions, after_definitions): Remove these
7694 extern's.
7695 (prologue_augment): Add new bool argument.
7696 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
7697 (PERCENT_END_HEADER): ... this.
7698 (PERCENT_BEFORE_DEFINITIONS): Update to...
7699 (PERCENT_START_HEADER): ... this.
7700 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
7701 * tests/actions.at (Printers and Destructors): Update names.
7702
31b2b07e
JD
77032006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
7704
7705 Add comparison operators for C++ location classes. Discussed at
7706 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
7707 * data/c++.m4 (b4_define_location_comparison): New boolean %define
7708 declaration indicating whether filename_type has an operator==. If
7709 filename_type is `std::string', it defaults to `1', `0' otherwise.
7710 * data/location.cc: Iff b4_define_location_comparison is `1', add
7711 operator== and operator!= for class position and for class location.
7712
7713 Some minor fixes.
7714 * src/scan-action.l: Remove unused file.
7715 * src/symtab.c (symbol_printer_set): Use printer_location not
7716 destructor_location.
7717 * src/symtab.h (struct symbol): Replace incorrect source comment for
7718 printer members.
7719 * tests/input.at (Incompatible Aliases): Update output with correct
7720 printer location.
7721
9bc0dd67
JD
77222006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
7723
7724 Don't put the pre-prologue in the header file. For the yacc.c code
7725 file and the glr.c header and code files, move the pre-prologue before
7726 the token definitions. Add new %before-definitions and
7727 %after-definitions to declare code that will go in both the header file
7728 and code file. Discussed at
7729 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
7730 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
7731 and
7732 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
7733 * NEWS (2.3+): Describe these changes.
7734 * data/glr.c (b4_pre_prologue): Move from within to before...
7735 (b4_shared_declarations): ... this.
7736 Add new b4_before_definitions before b4_token_enums.
7737 Add new b4_after_definitions at the end.
7738 * data/glr.cc (b4_pre_prologue): Replace with...
7739 (b4_before_definitions): ... this in the header file.
7740 (b4_after_definitions): New near the end of the header file.
7741 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
7742 code file right before including the header file.
7743 (b4_before_definitions): New in the previous position of
7744 b4_pre_prologue in the header file.
7745 (b4_after_definitions): New near the end of the header file.
7746 * data/yacc.c: Clean up some m4 quoting especially in the header file.
7747 (b4_token_enums_defines): In the code file, move to right before
7748 YYSTYPE for consistency with the header file.
7749 (b4_before_definitions): New right before b4_token_enums_defines in
7750 both the header and code file.
7751 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
7752 header and code file.
7753 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
7754 of prologues for %union dependencies.
91661ebb
JD
7755 (Decl Summary): In %defines description, mention the effect of
7756 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
7757 (Calc++ Parser): Forward declare driver in a %before-definitions rather
7758 than in the pre-prologue so that make check succeeds.
148d66d8 7759 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
7760 %after-definitions.
7761 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
7762 %before-definitions.
7763 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
7764 (declaration): Parse those declarations and append to
7765 b4_before_definitions and b4_after_definitions, respectively.
7766 * src/reader.c (before_definitions, after_definitions): New bools to
7767 track whether those declarations have been seen.
7768 (prologue_augment): Add to the post-prologue if %union,
7769 %before-definitions, or %after-definitions has been seen.
7770 * src/reader.h (before_definitions, after_definitions): New extern's.
7771 * src/scan-gram.l: Scan the new declarations.
7772 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
7773 prologue block in a %before-definitions or a %after-definitions based
7774 on whether the %union is declared.
7775 * tests/regression.at (Early token definitions with --yacc, Early token
7776 definitions without --yacc): Move tests for token definitions into the
7777 post-prologue since token names are no longer defined in the
7778 pre-prologue.
7779
203b9274
AD
77802006-06-20 Akim Demaille <akim@epita.fr>
7781
7782 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
7783 (symbol_get): Use it.
7784 * src/parse-gram.y: Use it.
7785
a7ee59cf
JD
77862006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
7787
7788 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
7789 build succeeds when configured with --enable-gcc-warnings.
7790
5a2baae7
PE
77912006-06-19 Paul Eggert <eggert@cs.ucla.edu>
7792
33ad1a9c
PE
7793 * src/parse-gram.y (char_name): New function.
7794 (CHAR, STRING, string_content): For %printer, properly escape.
7795 (ID): Prefer fputs to fprintf.
7796 (id): Reindent to be consistent with other rules.
7797 Properly quote char.
7798
5a2baae7
PE
7799 The Translation Project changed its way of publishing translations
7800 to maintainers. I haven't received any responses to my request
7801 for supporting the old way, or for documenting the new way. I
7802 have modified 'bootstrap' to use screen scraping
7803 (in this case, HTML scraping). This is unreliable and inelegant,
7804 but I don't see any better way. Yuck.
7805 * bootstrap (TP_URL, WGET_COMMAND): New vars.
7806 (get_translations): New function, which uses HTML scraping to
7807 deduce locations of latest translations.
7808 Use this function to grab both bison and bison-runtime .po files.
7809 Don't bother priming the pump for the runtime-po domain any more,
7810 as it's now translated better than bison is.
7811
58d7a1a1
AD
78122006-06-19 Akim Demaille <akim@epita.fr>
7813
7814 * src/scan-gram.l: No longer "parse" things after `%union' until
7815 `{'. Rather, return a single "%union" token.
7816 No longer make symbols: return strings, and leave the conversion
7817 to symbols to the parser.
7818 (SC_PRE_CODE, token_type): Remove.
7819 * src/parse-gram.y (%union): New field `character'.
7820 Sort tokens.
7821 (CHAR): New token.
7822 (ID, ID_COLON): Now that the scanner no longer makes them
7823 identifiers, adjust all uses to invoke symbol_get.
7824 (id_colon): New, wraps the conversion from string to symbol.
7825 (%union): Accept a possible union_name.
7826 (symbol): Now can be a char.
7827 * data/c.m4 (b4_union_name): Leave a default value.
7828 * data/glr.c, data/yacc.c: Use it.
7829
b931235e
JD
78302006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
7831
7832 For associating token numbers with token names for "yacc.c", don't use
7833 #define statements unless `--yacc' is specified; always use enum
7834 yytokentype. Most important discussions start at:
7835 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
7836 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
7837 and
7838 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
7839 * NEWS (2.3+): Mention.
7840 * data/c.m4 (b4_yacc_if): New.
7841 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
7842 token #define's.
7843 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
7844 on token name definitions.
7845 * src/getargs.c (usage): Capitalize `Yacc' in English.
7846 * src/output.c (prepare): Define b4_yacc_flag.
7847 * tests/regression.at (Early token definitions): Test that tokens names
7848 are defined before the pre-prologue not just before the post-prologue.
7849 Remove this test case and copy to...
7850 (Early token definitions with --yacc): ... this to test #define's.
7851 (Early token definitions without --yacc): ... and this to test enums.
7852
9e6e7ed2
PE
78532006-06-11 Paul Eggert <eggert@cs.ucla.edu>
7854
7855 * NEWS: Reword the post-2.3 change to not be so optimistic about
7856 removing the old "look-ahead" spelling.
7857 Update previous look-ahead/lookahead change reports.
7858 * REFERENCES: look-ahead -> lookahead (since that's
7859 what he actually wrote).
7860 * doc/refcard.tex: look ahead -> lookahead,
7861 look-ahead -> lookahead
7862
742e4900
JD
78632006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
7864
7865 For consistency, use `lookahead' instead of `look-ahead' or
7866 `look_ahead'. Discussed starting at
7867 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
7868 and then at
7869 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
7870 * NEWS: For the next release, note the change to `--report'.
7871 * TODO, doc/bison.1: Update English.
7872 * doc/bison.texinfo: Update English.
7873 (Understanding Your Parser, Bison Options): Document as
7874 `--report=lookahead' rather than `--report=look-ahead'.
7875 * src/conflicts.c: Update English in comments.
7876 (lookahead_set): Rename from look_ahead_set.
7877 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
7878 (resolve_sr_conflict): Rename local look_ahead_tokens to
7879 lookahead_tokens, and update other uses.
7880 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
7881 count_rr_conflicts, conflicts_free): Update uses.
7882 * src/getargs.c (report_args): Move "lookahead" before alternate
7883 spellings.
7884 (report_types): Update uses.
7885 (usage): For `--report' usage description, state `lookahead' spelling
7886 rather than `look-ahead'.
7887 * src/getargs.h (report.report_lookahead_tokens): Rename from
7888 report_look_ahead_tokens.
7889 * src/lalr.c: Update English in comments.
7890 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
7891 (state_lookahead_tokens_count): Rename from
7892 state_look_ahead_tokens_count.
7893 Rename local n_look_ahead_tokens to n_lookahead_tokens.
7894 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
7895 Rename local n_look_ahead_tokens to n_lookahead_tokens.
7896 Update other uses.
7897 Update English in output.
7898 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
7899 * src/print.c: Update English in comments.
7900 (lookahead_set): Rename from look_ahead_set.
7901 (print_reduction): Rename argument lookahead_token from
7902 look_ahead_token.
7903 (print_core, state_default_rule, print_reductions, print_results):
7904 Update uses.
7905 * src/print_graph.c: Update English in comments.
7906 (print_core): Update uses.
7907 * src/state.c: Update English in comments.
7908 (reductions_new): Update uses.
7909 (state_rule_lookahead_tokens_print): Rename from
7910 state_rule_look_ahead_tokens_print, and update other uses.
7911 * src/state.h: Update English in comments.
7912 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
7913 (state_rule_lookahead_tokens_print): Rename from
7914 state_rule_look_ahead_tokens_print.
7915 * src/tables.c: Update English in comments.
7916 (conflict_row, action_row): Update uses.
7917 * tests/glr-regression.at
7918 (Incorrect lookahead during deterministic GLR,
7919 Incorrect lookahead during nondeterministic GLR): Rename
7920 print_look_ahead to print_lookahead.
7921 * tests/torture.at: Update English in comments.
7922 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
7923 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
7924 (Many lookahead tokens): Update uses.
7925 * data/glr.c: Update English in comments.
7926 * lalr1.cc: Likewise.
7927 * yacc.c: Likewise.
7928 * src/conflicts.h: Likewise.
7929 * src/lalr.h: Likewise.
7930 * src/main.c: Likewise.
7931 * src/output.c: Likewise.
7932 * src/parse-gram.c: Likewise.
7933 * src/tables.h: Likewise.
7934 * tests/calc.at: Likewise.
7935
3c40d0b5
JD
79362006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
7937
7938 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
7939
5d278082
PE
79402006-06-07 Paul Eggert <eggert@cs.ucla.edu>
7941
7942 * TODO: Add request from Nelson H. F. Beebe to be able to install
7943 Bison without installing the yacc script.
7944
9e668899
JD
79452006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
7946
7947 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
7948 and yytext if they're already #define'd.
7949 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
7950 * src/scan-code-c.c: ... here.
7951 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
7952 <config.h>.
7953
0c8e079f
JD
79542006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
7955
7956 Get Bison to build again when configured with --enable-gcc-warnings.
7957 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
7958 missing #include's.
7959 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
7960 loc argument as it shadows a global.
7961 * src/scan-gram.l: Remove stray comma that prevents boundary_set
7962 invocation.
7963
7964 * src/.cvsignore: Add scan-code.c.
7965
2346344a
AD
79662006-06-07 Akim Demaille <akim@epita.fr>
7967
7968 * src/scan-gram.l: Move the "add a trailing ; to actions" code
7969 to...
7970 * src/scan-code.l: here.
7971 * tests/input.at (Torturing the Scanner): Fix another location
7972 error.
7973
4862bdfd
AD
79742006-06-07 Akim Demaille <akim@epita.fr>
7975
7976 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
7977
e9071366
AD
79782006-06-06 Akim Demaille <akim@epita.fr>
7979
7980 Extract the parsing of user actions from the grammar scanner.
7981 As a consequence, the relation between the grammar scanner and
7982 parser is much simpler. We can also split "composite tokens" back
7983 into simple tokens.
7984 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
7985 * src/scan-gram.l (add_column_width, adjust_location): Move to and
7986 rename as...
7987 * src/location.h, src/location.c (add_column_width)
7988 (location_compute): these.
7989 Fix the column count: the initial column is 0.
7990 (location_print): Be robust to ending column being 0.
7991 * src/location.h (boundary_set): New.
7992 * src/main.c: Adjust to scanner_free being renamed as
7993 gram_scanner_free.
7994 * src/output.c: Include scan-code.h.
7995 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
7996 Use boundary_set.
7997 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
7998 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
7999 which is now, again, a separate token.
8000 Adjust all dependencies.
8001 Whereever actions with $ and @ are used, use translate_code.
8002 (action): Remove this nonterminal which is now useless.
8003 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
8004 (grammar_current_rule_action_append): Use translate_code.
8005 (packgram): Bound check ruleno, itemno, and rule_length.
8006 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
8007 (last_string, last_braced_code_loc, max_left_semantic_context)
8008 (scanner_initialize, scanner_free, scanner_last_string_free)
8009 (gram_out, gram_lineno, YY_DECL_): Move to...
8010 * src/scan-gram.h: this new file.
8011 (YY_DECL): Rename as...
8012 (GRAM_DECL): this.
8013 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
8014 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
8015 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
8016 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
8017 Move these declarations, and...
8018 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
8019 these to...
8020 * src/flex-scanner.h: this new file.
8021 * src/scan-gram.l (rule_length, rule_length_overflow)
8022 (increment_rule_length): Remove.
8023 (last_braced_code_loc): Rename as...
8024 (gram_last_braced_code_loc): this.
8025 Adjust to the changes of the parser.
8026 Move all the handling of $ and @ into...
8027 * src/scan-code.l: here.
8028 * src/scan-gram.l (handle_dollar, handle_at): Remove.
8029 (handle_action_dollar, handle_action_at): Move to...
8030 * src/scan-code.l: here.
8031 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
8032 scan-code.h, scan-code-c.c, scan-gram.h.
8033 (EXTRA_bison_SOURCES): Add scan-code.l.
8034 (BUILT_SOURCES): Add scan-code.c.
8035 (yacc): Be robust to white spaces.
8036
8037 * tests/conflicts.at, tests/input.at, tests/reduce.at,
8038 * tests/regression.at: Adjust the column numbers.
8039 * tests/regression.at: Adjust the error message.
7891a7c4 8040
184e42f0
JD
80412006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
8042
8043 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
8044 Use Akim's wording from
8045 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
8046
7891a7c4
JD
80472006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
8048
8049 Between Bison releases, manually append `+' to the previous Bison
8050 release number, and use that as a signal to automatically print the
8051 ChangeLog's CVS Id keyword from --version. Discussed starting at
8052 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
8053 * ChangeLog: Add Id header.
8054 * configure.ac (AC_INIT): Append `+' to `2.3'.
8055 * src/.cvsignore: Add revision.c.
8056 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
8057 (BUILT_SOURCES): Add revision.c.
8058 (revision.c): New target rule. This file defines a new global variable
8059 named revision. It initializes it with either the Id from ChangeLog
8060 or, if VERSION doesn't contain `+', with the empty string.
8061 * src/getargs.c (version): Print the value of revision.
8062 * src/revision.h: Extern revision.
8063
4ad3ed84
PE
80642006-06-05 Paul Eggert <eggert@cs.ucla.edu>
8065
8066 * NEWS: Version 2.3.
8067 * configure.ac (AC_INIT): Likewise.
8068
02103984
PE
80692006-05-30 Paul Eggert <eggert@cs.ucla.edu>
8070
8071 * data/glr.c (YYRECOVERING): Define to be a function-like macro
8072 with no arguments, not as an object-like macro. This is for
8073 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
8074 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
8075 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
8076 Document this.
8077
2c08afa5
JD
80782006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
8079
8080 * src/getargs.c (usage): Back out yesterday's modification of the
8081 --help output so that we don't have to wait for translation before
8082 releasing 2.3.
8083
6077da58
PE
80842006-05-29 Paul Eggert <eggert@cs.ucla.edu>
8085
8086 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
8087 Problem reported by Akim Demaille.
8088
2a26b6c2
JD
80892006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
8090
8091 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
8092
aefef0d6
PE
80932006-05-26 Paul Eggert <eggert@cs.ucla.edu>
8094
8095 * data/yacc.c (yy_reduce_print): Omit trailing white space in
8096 generated source code. Problem reported by Frans Englich in
8097 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
8098
fcd8e201
PE
80992006-05-22 Paul Eggert <eggert@cs.ucla.edu>
8100
8101 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
8102 shell, not within 'make', so that 'make' by an ordinary builder
8103 (using GNU make) does not worry about configuring gzip. This also
8104 works around a bug reported independently by Keith Thompson and by
8105 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
8106 stderr rather than stdout, messing up the build logs.
8107
7b5cdcbd
JD
81082006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
8109
8110 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
8111 to make sure that YYID will never be unused. This fixes a 'make
8112 maintainer-check' failure caused by the recent changes to the 'Trivial
8113 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
8114 not used.
8115 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
8116
5ad0a449
JD
81172006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
8118
8119 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
8120 state before an empty RHS is always resolved here. Only the location
8121 of that state is guaranteed to be resolved, and that's enough. This
8122 fixes the remaining bug reported by Derek M. Jones in
8123 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
8124 * tests/glr-regression.at (Uninitialized location when reporting
8125 ambiguity): Test the above case.
8126 Also, the embedded comments in this test case claim it checks the case
8127 of an empty RHS that has inherited the initial location. However, the
8128 corresponding LHS was already resolved, so yyresolveLocations didn't
8129 actually have reason to modify it. Fix this by forcing
8130 nondeterministic operation at the beginning of the parse.
8131
50cce58e
PE
81322006-05-20 Paul Eggert <eggert@cs.ucla.edu>
8133
8134 * data/c.m4 (b4_yy_symbol_print_generate):
8135 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
8136 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
8137 of the bugs reported today by Derek M Jones in
8138 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
8139 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
8140 defined to be a type name without parens or brackets.
8141 (Location Type): Similarly for YYLTYPE.
8142 * tests/regression.at (Trivial grammars): Put in a test for this
8143 bug that will be caught by 'make maintainer-check' (though not,
8144 alas, by 'make check' unless your compiler is picky).
8145
ab8d9dc5
PE
81462006-05-19 Paul Eggert <eggert@cs.ucla.edu>
8147
0d2c8934 8148 * NEWS: Version 2.2.
ab8d9dc5
PE
8149 * configure.ac (AC_INIT): Likewise.
8150
9138c575
JD
81512006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
8152
8153 * data/glr.c (yyreportTree): Make room in yystates for the state
8154 preceding the RHS. This fixes the segmentation fault reported by Derek
8155 M. Jones in
8156 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
8157 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
8158 to the user. Reported for yyreportTree by Derek M. Jones later in the
8159 same thread.
8160 * THANKS: Add Derek M. Jones.
8161 Update my email address.
8162 Fix typo in Steve Murphy's name.
8163
276f48df
PE
81642006-05-14 Paul Eggert <eggert@cs.ucla.edu>
8165
d6645148
PE
8166 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
8167 checking against YYLAST that caused the parser to miss a potential
8168 alternative in its diagnostic.
8169 Problem reported by Maria Jose Moron Fernandez in
8170 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
8171 * data/lalr1.cc (yysyntax_error_): Likewise.
8172 * data/yacc.c (yysyntax_error): Likewise.
8173 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
8174 tokens, in case we run into an older C compiler.
8175 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
8176 Use them to check for the off-by-one error fixed above.
8177
276f48df
PE
8178 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
8179 YYSIZE_T, not size_t.
8180 * tests/regression.at (Trivial grammars): New test, to catch
8181 the error fixed by the above patch.
8182
cd8b5791
AD
81832006-05-14 Akim Demaille <akim@lrde.epita.fr>
8184
8185 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
8186 scheme.
8187 Reported by Steve Murphy.
8188
34376418
AD
81892006-05-14 Akim Demaille <akim@lrde.epita.fr>
8190
8191 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
8192 * data/glr.cc: b4_location_flag is now b4_locations_flag.
8193
327afc7c
AD
81942006-05-14 Akim Demaille <akim@lrde.epita.fr>
8195
8196 Implement --trace=m4.
8197 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
8198 * src/output.c (output_skeleton): When set, pass -dV to m4.
8199
8200 Factor the handling of flags in m4.
8201 * src/output.c (prepare): Rename the muscle names debug, defines,
8202 error_verbose to debug_flag, defines_flag, error_verbose_flag.
8203 * data/c.m4: Adjust.
8204 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
8205 Use b4_define_flag_if to define other b4_FLAG_if macros.
8206 (b4_location_if): As a consequence, rename as...
8207 (b4_locations_if): this, for consistency.
8208 Adjust all the skeletons.
8209
ba9ecd19
AD
82102006-05-14 Akim Demaille <akim@lrde.epita.fr>
8211
8212 * etc/bench.pm: Shorten bench names.
8213
4e83ea15
AD
82142006-05-14 Akim Demaille <akim@lrde.epita.fr>
8215
8216 * src/output.h, src/output.c (error_verbose): Move to...
8217 * src/getargs.h, src/getargs.c: here.
8218 Sort the flags.
8219 Adjust dependencies.
8220
6e93d810
PE
82212006-05-13 Paul Eggert <eggert@cs.ucla.edu>
8222
8223 * data/c.m4 (b4_copyright): Put the special exception for Bison
8224 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
8225 uses changed. Suggested by Akim Demaille. Also, wrap the
8226 copyright notice, in case it is longer than 80 columns. Replace
8227 comma by newline after title.
6e93d810 8228
eaea13f5
PE
82292006-05-11 Paul Eggert <eggert@cs.ucla.edu>
8230
8231 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
8232 incompatibility, not a bug. Mention that it wasn't fixed as of
8233 flex 2.5.33.
8234
3cf084ec
AD
82352006-05-11 Akim Demaille <akim@lrde.epita.fr>
8236
8237 * examples/extexi: Enforce the precedence of concatenation over
8238 >>.
0a9f1c7d 8239 Reported by Tommy Nordgren.
3cf084ec 8240
32c96bd7
AD
82412006-05-11 Akim Demaille <akim@lrde.epita.fr>
8242
8243 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
8244 with the member "token".
f94705b2 8245 Reported by Martin Nylin.
32c96bd7 8246
eaea13f5
PE
82472006-05-08 Paul Eggert <eggert@cs.ucla.edu>
8248
8249 * data/glr.c: Switch to Bison 2.2 special-exception language in
8250 the copyright notice. Use more-regular format for titles and
8251 copyright notices.
8252 * data/glr.cc: Likewise.
8253 * data/location.cc: Likewise.
8254 * data/yacc.cc: Likewise.
8255 * doc/bison.texinfo (Conditions): Document this.
8256 * NEWS: likewise. Upgrade version to 2.2.
8257
6e2d1146
AD
82582006-04-27 Akim Demaille <akim@lrde.epita.fr>
8259
8260 * data/glr.cc: Remove dead code.
8261
47671055
PE
82622006-04-25 Paul Eggert <eggert@cs.ucla.edu>
8263
8264 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
8265 that variable and the line breaks the bootstrap. Problem reported
8266 by Juan M. Guerrero.
8267
ed2e6384
AD
82682006-04-24 Akim Demaille <akim@lrde.epita.fr>
8269
8270 * doc/bison.texinfo (Multiple start-symbols): New.
8271
3cedc2dc
AD
82722006-04-24 Akim Demaille <akim@lrde.epita.fr>
8273
8274 * etc/README, etc/bench.pl: New.
8275
b2ddc3f3
AD
82762006-04-03 Akim Demaille <akim@lrde.epita.fr>
8277
8278 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
8279 rule.
8280 Reported by Mickael Labau.
8281 * tests/input.at (Torturing the Scanner): Test it.
8282
91e3ac9a
PE
82832006-03-16 Paul Eggert <eggert@cs.ucla.edu>
8284
8285 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
8286 Problem reported by Bob Rossi.
8287
82882006-03-13 Paul Eggert <eggert@cs.ucla.edu>
8289
8290 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
8291 and didn't really work.
8292 For the index, use @ifnotinfo, not @iftex.
8293 Minor cleanups of spacing and terminology.
8294
5cf61e93
AD
82952006-03-12 Akim Demaille <akim@lrde.epita.fr>
8296
8297 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
8298 of AT_NAME_PREFIX when %name-prefix is not used.
8299
aa08666d
AD
83002006-03-12 Akim Demaille <akim@lrde.epita.fr>
8301
8302 Apply --prefix to C++ skeletons too: they change the namespace.
8303 The test suite already exercize these cases.
8304 * data/c++.m4 (b4_namespace): New.
8305 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
8306 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
8307 * data/yacc.c, data/glr.c: Remove a useless `[]'.
8308 * doc/bison.texinfo: Document it.
8309 (Option Cross Key): Use @multitable in all formats. It looks
8310 nicer, even in TeX outputs.
8311 (Rules): Use the same code whatever the output type is.
8312 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
8313 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
8314 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 8315
45567173
AD
83162006-03-10 Akim Demaille <akim@lrde.epita.fr>
8317
8318 * TODO: Remove dead items.
8319
e9d8f881 83202006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
8321
8322 * doc/FAQ: Remove, merged into...
8323 * doc/bison.texinfo (FAQ): this.
8324 * doc/Makefile.am (EXTRA_DIST): Adjust.
8325
c095d689
AD
83262006-03-10 Akim Demaille <akim@lrde.epita.fr>
8327
8328 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
8329 even if empty.
8330 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
8331 * doc/bison.texinfo (Calc++ Scanner): Use it.
8332
6e0f8287
PE
83332006-03-09 Paul Eggert <eggert@cs.ucla.edu>
8334
8335 Fix two nits reported by twlevo, plus one more that I discovered.
8336
8337 * src/assoc.h (assoc_to_string): Give a name to the arg, as
8338 this is the usual Bison style.
8339 * src/location.h (location_print): Likewise.
8340
8341 * src/reader.h (token_name): Likewise.
8342
d6b771c3
PE
83432006-03-08 Paul Eggert <eggert@cs.ucla.edu>
8344
8345 Fix some nits reported by twlevo.
8346 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
8347 and "POSIX". Use more-modern syntax for URLs. Mention C++
8348 and ask for Java. Don't hardwire OS version numbers. Add
8349 copyright notice.
8350 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
8351 * src/conflicts.c (solved_conflicts_obstack): Now static.
8352
1e137b71
JD
83532006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
8354
8355 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
8356 page. Say "you can use it" not "you may use it" as on the web page;
8357 we're describing capabilities not granting permission.
8358
73f2e47e
PE
83592006-03-06 Paul Eggert <eggert@cs.ucla.edu>
8360
6d05403d
PE
8361 * data/glr.c (yyresolveLocations): Rename local variables to avoid
8362 shadowing warnings. Use usual patter for iterating through RHS.
8363 * tests/glr-regression.at
8364 (Uninitialized location when reporting ambiguity):
8365 Modify yylex so that it uses its argument, rather than trying
8366 to rely on ARGSUSED (which doesn't work for gcc with warnings).
8367 const char -> char const.
8368
73f2e47e
PE
8369 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
8370 Don't use tabs inside commands; it messes up 'ps'.
8371 Problem reported by twlevo.
8372
8710fc41
JD
83732006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
8374
8375 * tests/glr-regression.at (Uninitialized location when reporting
8376 ambiguity): New test case.
8377 * data/glr.c (yyresolveLocations): New function, which uses
8378 YYLLOC_DEFAULT.
8379 (yyresolveValue): Invoke yyresolveLocations before reporting an
8380 ambiguity.
8381 * doc/bison.texinfo (Default Action for Locations): Note
8382 YYLLOC_DEFAULT's usage for ambiguity locations.
8383 (GLR Semantic Actions): Cross-reference those notes.
8384
ae952af2
JD
83852006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
8386
8387 * tests/glr-regression.at (Leaked semantic values when reporting
8388 ambiguity): Remove unnecessary union and type declarations.
8389 (Leaked lookahead after nondeterministic parse syntax error): New test
8390 case.
8391 * data/glr.c (yyparse): Check for zero stacks remaining before
8392 attempting to shift the lookahead so that you don't lose it.
8393
35ee866a
JD
83942006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
8395
8396 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
8397 * tests/glr-regression.at (Leaked semantic values when reporting
8398 ambiguity): New test case.
8399 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
8400 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
8401 now unnecessary yystackp parameter.
8402 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
8403 destructors can be called.
8404
8405 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
8406 in existing testcases.
8407
520181ab
JD
84082006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
8409
8410 Don't leak semantic values for parent RHS when a user action cuts the
8411 parser, and clean up related code a bit.
8412 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
8413 cuts parse): Rename to...
8414 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
8415 for leaked parent RHS values.
8416 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
8417 between an unresolved state (non-empty chain of semantic options) and
8418 an incomplete one (signaled by an empty chain).
ae952af2 8419 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
8420 successfully or unsuccessfully resolved yyGLRState to...
8421 (yyresolveValue): ... here so that yyresolveValue always leaves a
8422 yyGLRState with consistent data and thus is easier to understand.
8423 Remove the yyvalp and yylocp parameters since they are always just
8424 taken from the yys parameter. When reporting a discarded merged value
8425 in debugging output, note that it is incompletely merged. Document the
8426 interface.
8427 (yyresolveAction): If resolving any of the RHS states fails, destroy
8428 them all rather than leaking them. Thus, as long as user actions are
8429 written to clean up the RHS correctly, yyresolveAction always cleans up
8430 the RHS of a semantic option. Document the interface.
8431
18d9185c
PE
84322006-02-27 Paul Eggert <eggert@cs.ucla.edu>
8433
8434 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
8435 led to a segmentation fault in GNU Pascal. Problem reported
8436 by Waldek Hebisch.
8437
841a7737
JD
84382006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
8439
8440 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
8441 mid-rule action inside a nonterminal symbol in order to declare a
8442 destructor for its semantic value.
8443
fc3f467f
PE
84442006-02-16 Paul Eggert <eggert@cs.ucla.edu>
8445
8446 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
8447 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
8448 __cplusplus && ! defined _STDLIB_H && !
8449 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
8450 defined free))]: Include <stdlib.h> rather than rolling our own
8451 declarations of malloc and free, to avoid problems with
8452 incompatible declarations (using 'throw') C++'s stdlib.h. This
8453 should fix Debian bug 340012
8454 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
8455 reported by Guillaume Melquiond.
8456
a3af26dd
PE
84572006-02-13 Paul Eggert <eggert@cs.ucla.edu>
8458
4d7bc38c
PE
8459 * NEWS: Clarify symbols versus types in unused-value warnings.
8460
a3af26dd
PE
8461 * configure.ac (AC_INIT): Bump version number.
8462
4e26c69e
PE
84632006-02-13 Paul Eggert <eggert@cs.ucla.edu>
8464
8465 * NEWS: Version 2.1a.
8466 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
8467 since C99 requires this.
8468
498e897c
PE
84692006-02-11 Paul Eggert <eggert@cs.ucla.edu>
8470
8471 * m4/c-working.m4: New file.
8472 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
8473
57bb17ca
PE
84742006-02-10 Paul Eggert <eggert@cs.ucla.edu>
8475
8476 * Makefile.maint: Merge from coreutils.
8477
0be105dc
PE
84782006-02-09 Paul Eggert <eggert@cs.ucla.edu>
8479
8480 More portability fixes for problems summarized by Nelson H. F. Beebe.
8481
8482 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
8483 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
8484 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
8485 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
8486 messes up because C++ code is compiled in 32-bit mode but linked
8487 in 64-bit mode.
8488
6fc0c024
PE
84892006-02-08 Paul Eggert <eggert@cs.ucla.edu>
8490
8491 More portability fixes for problems summarized by Nelson H. F. Beebe.
8492
7870f699
PE
8493 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
8494 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
8495
6fc0c024
PE
8496 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
8497 nodist_PROGRAMS, since we don't need to actually compile the
8498 example if we're just doing a plain 'make'. This avoids bothering
8499 the installer unnecessarily about problems due to weird C++
8500 compilers.
8501
fe6c2fde
PE
85022006-02-06 Paul Eggert <eggert@cs.ucla.edu>
8503
8504 More portability fixes for problems summarized by Nelson H. F. Beebe.
8505
8506 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
8507 than #include "...", and compile with -I'.'. The old method was
8508 not portable, according to Posix and the C standard, and it does
8509 not work with Sun C 5.7, where previous #line directives affect
8510 the working directory used in later #include "..." directives.
8511
927b425b
JMG
85122006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8513
8514 Various DJGGP specific issues in /djgpp
8515
d9735e9e
PE
85162006-02-02 Paul Eggert <eggert@cs.ucla.edu>
8517
8518 More portability fixes for problems summarized by Nelson H. F. Beebe.
8519
8520 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
8521 '#include <map>' works and that you can apply ++ to iterators.
8522
5a6755af
PE
85232006-02-01 Paul Eggert <eggert@cs.ucla.edu>
8524
67a0dc4f
PE
8525 Work around portability problems summarized by Nelson H. F. Beebe in
8526 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
8527
8c86f0ef
PE
8528 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
8529 that '#include <string>' works.
8530
de35dd59
PE
8531 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
8532 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
8533 "warning: sorry: semantics of inline function static data `const
8534 unsigned char translate_table[262]' are wrong (you'll wind up with
8535 multiple copies)".
8536
67a0dc4f
PE
8537 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
8538 or, xor to not_, and_, or_, and xor_, respectively. This works
8539 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
8540 random system header somewhere that includes the equivalent of
8541 <iso646.h>.
8542
5a6755af
PE
8543 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
8544 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 8545 Suite Version 2.0.
5a6755af 8546
3f001415
JD
85472006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
8548
8549 During deterministic GLR operation, user actions should be able to
8550 influence the parse by changing yychar. To make this easier to fix and
8551 to make glr.c easier to evolve in general, don't maintain yytoken in
8552 parallel with yychar; just compute yytoken when needed.
8553 * tests/glr-regression.at (Incorrect lookahead during deterministic
8554 GLR): Check that setting yychar in a user action has the intended
8555 effect.
8556 * data/glr.c (yyGLRStack): Remove yytokenp member.
8557 (yyclearin): Don't set *yytokenp.
8558 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
8559 yychar rather than *yytokenp to determine the current lookahead.
8560 Compute yytoken locally when needed.
8561 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
8562 point to.
8563
8564 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
8565 after `--report' documentation.
8566
e2a8c0f5
PE
85672006-01-30 Paul Eggert <eggert@cs.ucla.edu>
8568
8569 * src/parse-gram.y (grammar_declaration): Location of printer
8570 symbol is @1, not list->location. Bug reported by twlevo.
8571 * tests/input.at (Incompatible Aliases): Adjust to above change.
8572
6b702268
PE
85732006-01-29 Paul Eggert <eggert@cs.ucla.edu>
8574
27622431
PE
8575 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
8576 all the test at once. This makes the output easier to read in the
8577 normal case.
8578
6b702268
PE
8579 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
8580 got from <http://bro-ids.org/download.html>. The bug is that
8581 when two actions appeared in succession, the second one was
8582 scanned before the first one was added to the grammar rule
8583 as a midrule action. Bison then output the incorrect warning
8584 "parse.y:905.17-906.36: warning: unused value: $3".
8585 * src/parse-gram.y (BRACED_CODE, action): These are no longer
8586 associated with a value.
8587 (rhs): Don't invoke grammar_current_rule_action_append.
8588 (action): Invoke it here instead.
8589 * src/reader.c (grammar_midrule_action): Now extern.
8590 (grammar_current_rule_action_append): Don't invoke
8591 grammar_midrule_action; that is now the scanner's job.
8592 * src/reader.h (last_string, last_braced_code_loc):
8593 (grammar_midrule_action): New decls.
8594 * src/scan-gram.l (last_string): Now extern, sigh.
8595 (last_braced_code_loc): New extern variable.
8596 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
8597 rule already has an action.
8598 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
8599 * tests/input.at (AT_CHECK_UNUSED_VALUES):
8600 Add some tests to check that the above changes fixed the bug.
8601
d40ba6c2
PE
86022006-01-27 Paul Eggert <eggert@cs.ucla.edu>
8603
8604 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
8605 All used changed. Check whether the symbol has a destructor,
8606 not whether it is typed.
8607 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
8608 that the values are still reported as unused. All line numbers
8609 adjusted.
8610
401aace6
PE
86112006-01-23 Paul Eggert <eggert@cs.ucla.edu>
8612
8613 Work around a bug in bro 0.8, which underparenthesizes its
8614 definition of YYLLOC_DEFAULT.
8615 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
8616 their arguments.
8617 * data/lalr1.cc: Likewise.
8618 * data/yacc.cc: Likewise.
8619
06f01bc4
PE
86202006-01-22 Paul Eggert <eggert@cs.ucla.edu>
8621
401aace6
PE
8622 Work around a bug in Pike 7.0, and give the Pike folks a
8623 better way to override the usual int widths.
8624 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
8625 user can override the types.
8626 (short): #undef, to work around a bug in Pike 7.0.
8627 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
8628 (union yyalloc.yyss): Use yytype_int16 rather than short.
8629 All uses changed.
8630 (yysigned_char): Remove.
8631 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
8632 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
8633 * tests/regression.at (Web2c Actions): Adjust to above changes.
8634
8635 * src/reader.c (check_and_convert_grammar): New function.
8636 (reader): Close the input file even if something went wrong during
8637 parsing. Minor file descriptor leak reported by twlevo.
8638
06f01bc4
PE
8639 * src/assoc.c (assoc_to_string): Use a default: abort (); case
8640 to pacify gcc -Wswitch-default.
8641 * src/scan-gram.l (adjust_location): Use a default: break; case
8642 to pacify gcc -Wswitch-default.
8643 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
8644 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
8645 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
8646 Move these decls to scan-skel.l, since they don't need to be
8647 visible elsewhere.
8648 * src/scan-skel.l: Accept the above decls.
8649 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
8650 is used.
8651
02650b7f
PE
86522006-01-21 Paul Eggert <eggert@cs.ucla.edu>
8653
8654 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
8655 since we don't want to insist on a version number at the start
8656 of the changelog every time.
8657 * Makefile.maint: Sync from coreutils a bit better.
8658 (sc_trailing_blank): Renamed from sc_trailing_space.
8659 All uses changed.
8660 (sc_no_if_have_config_h, sc_require_config_h):
8661 (sc_prohibit_assert_without_use): New rules.
8662 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
8663 (sc_dd_max_sym_length): Fix leading spaces in rule.
8664 (sc_system_h_headers): Prefix with @.
8665 (sc_useless_cpp_parens, m4-check): Output line numbers.
8666 (changelog-check): Allow version only in head.
8667 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
8668 satisfy new Makefile.maint rule.
8669 * data/glr.c: Likewise.
8670 * data/glr.cc: Likewise.
8671 * data/lalr1.cc: Likewise.
8672 * data/yacc.c: Likewise.
8673 * lib/ebitsetv.c: Likewise.
8674 * lib/lbitset.c: Likewise.
8675 * lib/subpipe.c: Likewise.
8676 * lib/timevar.c: Likewise.
8677 * src/system.h: Likewise.
8678 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
8679 * djgpp/Makefile.maint: Add copyright notice.
8680 * djgpp/README.in: Likewise.
8681 * djgpp/config.bat: Likewise.
8682 * djgpp/config.site: Likewise.
8683 * djgpp/config_h.sed: Likewise.
8684 * djgpp/djunpack.bat: Likewise.
8685 * djgpp/config.sed: Fix copyright notice to match standard format.
8686 * djgpp/subpipe.h: Likewise.
8687 * lib/bitsetv-print.c: Likewise.
8688 * lib/bitsetv.c: Likewise.
8689 * lib/subpipe.h: Likewise.
8690 * lib/timevar.c: Likewise.
8691 * lib/timevar.h: Likewise.
8692 * djgpp/subpipe.c: Use standard recipe for config.h.
8693 * lib/abitset.c: Likewise.
8694 * lib/bitset.c: Likewise.
8695 * lib/bitset_stats.c: Likewise.
8696 * lib/bitsetv-print.c: Likewise.
8697 * lib/bitsetv.c: Likewise.
8698 * lib/ebitsetv.c: Likewise.
8699 * lib/get-errno.c: Likewise.
8700 * lib/lbitset.c: Likewise.
8701 * lib/subpipe.c: Likewise.
8702 * lib/timevar.c: Likewise.
8703 * lib/vbitset.c: Likewise.
8704 * tests/local.at: Likewise.
8705 * src/scan-gram.l: Don't include verify.h, since system.h does
8706 that for us.
8707 * .x-sc_require_config_h: New file.
8708 * .x-sc_unmarked_diagnostics: New file.
8709
287c78f6
PE
87102006-01-20 Paul Eggert <eggert@cs.ucla.edu>
8711
287c78f6
PE
8712 Be a bit more systematic about using 'abort'.
8713 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
8714 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
8715 Put 'default: abort ();' before some other case, to satisfy older
8716 pedantic compilers.
8717 * lib/bitset_stats.c (bitset_stats_init): Likewise.
8718 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
8719 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
8720 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
8721 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
8722 (get_decision_str, get_orientation_str, get_node_alignment_str):
8723 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
8724 (get_linestyle_str, get_arrowstyle_str): Likewise.
8725 * src/conflicts.c (resolve_sr_conflict):
8726 Use a default case rather than one for the one remaining enum
8727 value, to catch invalid enum values as well.
8728 * src/lalr.c (set_goto_map, map_goto):
8729 Prefer "assert (FOO);" to "if (!FOO) abort ();".
8730 * src/nullable.c (nullable_compute, token_definitions_output):
8731 Likewise.
8732 * src/reader.c (packgram, reader): Likewise.
8733 * src/state.c (transitions_to, state_new, state_reduction_find):
8734 Likewise.
8735 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
8736 (symbol_pack): Likewise.
8737 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
8738 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
8739 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
8740 * src/system.h: Don't include <assert.h>.
8741 (assert): New macro.
8742
8743 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
8744 (Destructor Decl, Parser Function, Pure Calling):
8745 Describe rules for braces inside C code more carefully.
287c78f6 8746
c66dfadd
PE
87472006-01-19 Paul Eggert <eggert@cs.ucla.edu>
8748
c21493b8
PE
8749 Fix some porting glitches found by Nelson H. F. Beebe.
8750 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
8751 compilers that don't understand that abort () does not return.
8752 * src/state.c (transitions_to): Likewise.
8753 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
8754 that '#include <cstdlib>' works.
8755 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
8756 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
8757 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
8758 for the benefit of some pre-C99 compilers.
8759
b6e3facf
PE
8760 * bootstrap: Undo changes to gnulib files that autoreconf made.
8761
c66dfadd
PE
8762 Minor fixups to get 'make maintainer-check' to work.
8763 * configure.ac: Don't use -Wnested-externs, as it's incompatible
8764 with the new verify.h implementation.
8765 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
8766 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
8767 * data/yacc.c (YYUSE): Likewise.
8768 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
8769 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
8770 * src/parse-gram.y (declaration): Don't pass a string constant
8771 to a function that expects char *, since GCC might complain
8772 about the constant value.
8773 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
8774 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
8775 before #defining them.
8776 * tests/glr-regression.at
8777 (Incorrectly initialized location for empty right-hand side in GLR):
8778 In yyerror, use the msg arg.
8779 (Corrupted semantic options if user action cuts parse):
8780 (Incorrect lookahead during deterministic GLR):
8781 (Incorrect lookahead during nondeterministic GLR):
8782 Don't name a local var 'index'; it shadows string.h's 'index'.
8783
ed94ef2a
AD
87842006-01-19 Akim Demaille <akim@epita.fr>
8785
8786 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
8787 location, not just parts of it.
8788
e9ad4aec
PE
87892006-01-18 Paul Eggert <eggert@cs.ucla.edu>
8790
d6ca7905
PE
8791 * NEWS: Document the fact that multiple %unions are now allowed.
8792 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
8793 * TODO: This feature is now implemented, so remove it from
8794 the wishlist.
d6ca7905 8795
ef1b70e0
PE
8796 * Makefile.maint: Merge with coreutils Makefile.maint.
8797 (CVS_LIST): Use build-aux version if available.
8798 (VERSION_REGEXP): New macro.
8799 (syntax-check-rules): Add sc_no_if_have_config_h,
8800 sc_prohibit_assert_without_use, sc_require_config_h,
8801 sc_useless_cpp_parens.
8802 (sc_obsolete_symbols): Check for O_NDELAY.
8803 (sc_dd_max_sym_length): Track coreutils.
8804 (sc_unmarked_diagnostics): Look in all files, not just *.c.
8805 (sc_useless_cpp_parens): New rule.
8806 (news-date-check): Look for version or today's date.
8807 (changelog-check): Don't require version number near head.
8808 (copyright-check): Use current year instead of hardwiring 2005.
8809 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
8810 (announcement): Add --gpg-key-ID.
8811
8812 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
8813 with "file system".
8814
2073ce56 8815 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
8816 array. Problem reported by twlevo.
8817 * src/reader.c (packgram): Prepend a new sentinel before ritem.
8818 * src/lalr.c (build_relations): Rely on new sentinel.
8819 * src/gram.c (gram_free): Adjust to new sentinel.
8820
b7691f15
JD
88212006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
8822
8823 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
8824 yylookaheadNeeds. All uses updated.
8825 (yysplitStack): Rename local yynewLookaheadStatuses to
8826 yynewLookaheadNeeds.
8827 * data/glr-regression.at (Incorrect lookahead during nondeterministic
8828 GLR): In comments, change `lookahead status' to `lookahead need'.
8829
ddee1b06
PH
88302006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8831
8832 * data/glr.c (yysplitStack): A little stylistic rewrite.
8833
12f4614d
PH
88342006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8835
8836 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
8837
32c29292
JD
88382006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
8839
8840 * doc/bison.texinfo: Fix some typos.
8841 (GLR Semantic Actions): New subsection discussing special
8842 considerations because GLR semantic actions might be deferred.
8843 (Actions): Mention look-ahead usage of yylval.
8844 (Actions and Locations): Mention look-ahead usage of yylloc.
8845 (Special Features for Use in Actions): Add YYEOF entry and mention it
8846 in the yychar entry.
8847 In the yychar entry, remove mention of the local yychar case (pure
8848 parser) since this is irrelevant information when writing semantic
148d66d8 8849 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
8850 yychar is otherwise described as an external variable.
8851 In the yychar entry, don't call it the `current' look-ahead since it
8852 isn't when semantic actions are deferred.
8853 In the yychar and yyclearin entries, add note about deferred semantic
8854 actions.
8855 Add yylloc and yylval entries discussing look-ahead usage.
8856 (Look-Ahead Tokens): When discussing yychar, don't call it the
8857 `current' look-ahead, and do mention yylval and yylloc.
8858 (Error Recovery): Cross-reference `Action Features' when mentioning
8859 yyclearin.
148d66d8 8860 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
8861 look-ahead.
8862 In the yylloc and yylval entries, mention look-ahead usage.
8863
de366a2f 88642006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
8865
8866 * tests/glr-regression.at: Update copyright year to 2006.
8867
bf70fa87
JD
88682006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8869
8870 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
8871 use during nondeterministic operation to track which stacks have
8872 actually needed the current lookahead.
8873 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
8874 Allocate, deallocate, resize, and otherwise shuffle space for
8875 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
8876 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
8877 appropriately during nondeterministic operation.
8878 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
8879 members to store the current lookahead to be used by the deferred
8880 user action.
8881 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
8882 from which the RHS is taken. Set the lookahead members of the new
8883 yySemanticOption according to the lookahead status for stack yyk.
8884 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
8885 yyaddDeferredAction.
8886 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
8887 members of yySemanticOption before invoking yyuserAction, and then set
8888 them back to their current values afterward.
8889 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
8890 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
8891 * tests/glr-regression.at: Remove `.' from the ends of recent test case
8892 titles for consistency.
8893 (Leaked merged semantic value if user action cuts parse): In order to
8894 suppress lint warnings, use arguments in merge function, and assign
8895 char value < 128 in main.
8896 (Incorrect lookahead during deterministic GLR): New test case.
8897 (Incorrect lookahead during nondeterministic GLR): New test case.
8898
05449a2c
JD
88992006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8900
de366a2f 8901 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
8902 !yyvaluep as signal that no semantic value is available to print.
8903 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
8904 to print a semantic value.
8905
4158e0a1 89062006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 8907
4158e0a1
JD
8908 * tests/glr-regression.at: For consistency with my newer test cases,
8909 don't thank myself.
8910
d659304d
JD
89112006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
8912
8913 * data/glr.c (yyresolveValue): When merging semantic options, if at
8914 least one user action succeeds but a later one cuts the parse, then
8915 destroy the semantic value before returning rather than leaking it.
8916 (yyresolveStates): If a user action cuts the parse and thus
8917 yyresolveValue fails, ignore the (unset) semantic value rather than
8918 corrupting the yyGLRState, and empty the semantic options list since
8919 the user actions should have called all necessary destructors.
8920 Simplify code with YYCHK.
8921 * tests/glr-regression.at (Corrupted semantic options if user action
8922 cuts parse): New test case.
8923 (Undesirable destructors if user action cuts parse): New test case.
8924 Before applying any of this patch, this test case never actually failed
8925 for me... but only because the corrupted semantic options usually
8926 masked this bug.
8927 (Leaked merged semantic value if user action cuts parse): New test
8928 case.
8929
6ec2c0f2
AD
89302006-01-05 Akim Demaille <akim@epita.fr>
8931
8932 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
8933
1b9c21fb
PE
89342006-01-04 Paul Eggert <eggert@cs.ucla.edu>
8935
8936 * data/c.m4 (b4_c_modern): New macro, with a new provision for
8937 _MSC_VER. Problem reported by Cenzato Marco.
8938 (b4_c_function_def): Use it.
8939 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
8940 b4_c_modern.
8941 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
8942 than rolling our own.
8943
84866159
AD
89442006-01-04 Akim Demaille <akim@epita.fr>
8945
8946 Also warn about non-used mid-rule values.
8947 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
8948 member.
8949 (symbol_list_new): Adjust.
8950 * src/reader.c (symbol_typed_p): New.
8951 (grammar_rule_check): Use it.
8952 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
8953 Check its rule.
8954 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
8955 Use it.
8956 * tests/actions.at (Exotic Dollars): Adjust.
8957
378f4bd8
AD
89582006-01-04 Akim Demaille <akim@epita.fr>
8959
8960 * src/reader.c (grammar_midrule_action): If $$ is set in a
8961 mid-rule, move the `used' bit to its lhs.
8962 * tests/input.at (Unused values): New.
8963 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
8964
e2a21b6f
PE
89652006-01-03 Paul Eggert <eggert@cs.ucla.edu>
8966
54662697
PE
8967 * doc/bison.texinfo (Bison Options): Say more accurately what
8968 --yacc does.
8969 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
8970 about declarations in the grammar when in Yacc mode, as POSIX does
8971 not require a diagnostic when the grammar uses extensions.
8972
8973 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
8974
073f9288
PE
8975 Warn about dubious constructions like "%token T T".
8976 Reported by twlevo.
8977 * src/symtab.h (struct symbol.declared): New member.
8978 * src/symtab.c (symbol_new): Initialize it to false.
8979 (symbol_class_set): New arg DECLARING, specifying whether
8980 this is a declaration that we want to warn about, if there
8981 is more than one of them. All uses changed.
8982
1221b78a
PE
8983 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
8984 Allow multiple %union directives, whose contents concatenate.
8985 * src/parse-gram.y (grammar_declaration): Likewise.
8986 Use muscle_code_grow, so that we don't need stype_line any more.
8987 All uses changed.
8988
8989 * src/muscle_tab.c (muscle_grow): Fix comment.
8990
e2a21b6f
PE
8991 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
8992 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
8993 Update copyright year to 2006.
8994
8f7e3cf9
AD
89952006-01-03 Akim Demaille <akim@epita.fr>
8996
8997 Have glr.cc pass (some of) the calc.at tests.
8998 * data/glr.cc (b4_parse_param_orig): New.
8999 (b4_parse_param): Improve its definition, and bound it more
9000 clearly in the skeleton.
9001 (b4_epilogue): Append, instead of prepending, in order to keep
9002 #line consistency.
9003 Simplify the generation of auxiliary functions: locations and
9004 purity are mandated.
9005 (b4_global_tokens_and_yystype): Honor it.
9006 * data/location.cc (c++.m4): Don't include it.
9007 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
9008 and AT_SKEL_CC_IF.
9009 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
9010 AT_LALR1_CC_IF.
9011 Be sure to initialize the first position's filename.
9012 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
9013 mandated anyway.
9014 (AT_CHECK_CALC_GLR_CC): New.
9015 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
9016
3953ed88
AD
90172006-01-02 Akim Demaille <akim@epita.fr>
9018
9019 * src/output.c (output_skeleton): Don't hard wire the inclusion of
9020 c.m4.
0a96ba81 9021 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
9022 * data/glr.cc: Do not include stack.hh.
9023
9ecafbbf
AD
90242006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
9025
9026 * data/glr.c: Reformat whitespace with tabs.
9027 (b4_lpure_formals): Remove this unused m4 macro.
9028 * tests/cxx-type.at: Reformat whitespace with tabs.
9029 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
9030 since it's a member. Rename type to isNterm for clarity.
9031
c4d497a0
AD
90322005-12-29 Akim <akim@sulaco.local>
9033
9034 Let glr.cc catch up with symbol_value_print.
9035 * data/glr.cc (b4_yysymprint_generate): Replace by...
9036 (b4_yy_symbol_print_generate): this.
9037 (yy_symbol_print, yy_symbol_value_print): Declare them.
9038
4517da37
PE
90392005-12-28 Paul Eggert <eggert@cs.ucla.edu>
9040
9041 * src/location.h (boundary): Note that a line or column equal
9042 to INT_MAX indicates an overflow.
9043 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
9044 (rule_length_overflow, increment_rule_length, add_column_width):
9045 New functions.
9046 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
9047 (<SC_BRACED_CODE>"}"):
9048 Use increment_rule_length rather than incrementing it by hand.
9049 (adjust_location, handle_syncline): Diagnose overflow.
9050 (handle_action_dollar, handle_action_at):
9051 Fix bug with monstrosities like $-2147483648.
9052 Remove now-unnecessary checks.
9053 (scan_integer): Verify assumptions and remove now-unnecessary checks.
9054 (convert_ucn_to_byte): Verify assumptions.
9055 (handle_syncline): New arg LOC. All callers changed.
9056 Don't store through a value derived from char const * pointer.
9057
9058 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
9059 GCC warnings.
9060
e3233bf6
PE
90612005-12-27 Paul Eggert <eggert@cs.ucla.edu>
9062
9063 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
9064 Remove unnecessary forward static decls.
9065
8f3596a6
AD
90662005-12-27 Akim Demaille <akim@epita.fr>
9067
9068 * src/reader.c (grammar_current_rule_check): Also check that $$
9069 is used.
9070 Take the rule to check as argument, hence rename as...
9071 (grammar_rule_check): this.
9072 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
9073 Rename as...
9074 (grammar_rule_begin, grammar_rule_end): these, for consistency.
9075 (grammar_midrule_action, grammar_symbol_append): Now static.
9076 * tests/torture.at (input): Don't rely on the default action
9077 being always performed.
9078 * tests/calc.at: "Set" $$ even when the action is "cut" with
9079 YYERROR or other.
9080 * tests/actions.at (Exotic Dollars): Instead of using unused
9081 values, check that the warning is issued.
9082
721be13c
PE
90832005-12-22 Paul Eggert <eggert@cs.ucla.edu>
9084
9085 * NEWS: Improve wording for unused-value warnings.
9086
a0af42fc
AD
90872005-12-22 Akim Demaille <akim@epita.fr>
9088
9089 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
9090 (b4_yysymprint_generate): Rename as...
9091 (b4_yy_symbol_print_generate): this.
9092 Generate yy_symbol_print instead of yysymprint.
9093 Generate also yy_symbol_value_print, and use it.
9094
affac613
AD
90952005-12-22 Akim Demaille <akim@epita.fr>
9096
721be13c 9097 * NEWS: Warn about unused values.
affac613
AD
9098 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
9099 a `used' member.
9100 (symbol_list_n_get, symbol_list_n_used_set): New.
9101 (symbol_list_n_type_name_get): Use symbol_list_n_get.
9102 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
9103 * src/reader.c (grammar_current_rule_check): Check that values are
9104 used.
9105 * src/symtab.c (symbol_print): Accept 0.
9106 * tests/existing.at: Remove the type information.
9107 Empty the actions.
9108 Remove useless actions (beware of mid-rule actions: perl -000
9109 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
9110 * tests/actions.at (Exotic Dollars): Use unused values.
9111 * tests/calc.at: Likewise.
9112 * tests/glr-regression.at (No users destructors if stack 0 deleted):
9113 Likewise.
9114
9115 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
9116 rule_useful_p.
9117
9d9b8b70
PE
91182005-12-21 Paul Eggert <eggert@cs.ucla.edu>
9119
8bb4c753
PE
9120 Undo 2005-12-01 tentative license wording change. The wording is
9121 still being reviewed by the lawyers, and we don't want to wait for
9122 them before publishing a test release. For now, revert to the
9123 previous wording.
9124 * NEWS: Undo 2005-12-01 change.
9125 * data/glr.c: Revert to previous license wording.
9126 * data/glr.cc: Likewise.
9127 * data/lalr1.cc: Likewise.
9128 * data/location.cc: Likewise.
9129 * data/yacc.c: Likewise.
9130
9d9b8b70
PE
9131 * NEWS: Reword %destructor vs YYABORT etc.
9132 * data/glr.c: Use American spacing, for consistency.
9133 * data/glr.cc: Likewise.
9134 * data/lalr1.cc: Likewise.
9135 * data/yacc.c: Likewise.
9136 * data/yacc.c: Reformat comments slightly.
9137 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
9138 for consistency. Fix some spelling errors and reword recently-included
9139 text slightly.
9140 * tests/cxx-type.at: Cast results of malloc, for C++.
9141
2c3b392a
AD
91422005-12-21 Joel E. Denny <address@hidden>
9143
9144 * tests/cxx-type.at: Construct a tree, count the parents of shared
9145 nodes, and free each node once and only once. Previously, the memory
9146 for semantic values was leaked instead.
9147
d6cff4dc
AD
91482005-12-21 Joel E. Denny <address@hidden>
9149
9150 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
9151 (yylval, yylloc): If pure, #define to yystackp->yyval and
9152 yystackp->yyloc similar to yychar and yynerrs.
9153 (yyparse): If pure, remove local yylval and yylloc. Add local
9154 yystackp to accommodate pure definitions of yylval and yylloc.
9155 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
9156 yylvalp and yyllocp to &yylval and &yylloc.
9157 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
9158 namespace. Previously, nerrs and char were missing, but lval and lloc
9159 weren't necessary.
9160 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
9161 yylvalp and yyllocp parameters since, if pure, these are now always
9162 accessible through yystackp. If not pure, they are still accessible
9163 globally.
9164 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
9165 `if (YYID (N))' to pacify lint.
9166
a85284cf
AD
91672005-12-21 Akim Demaille <akim@epita.fr>
9168
9169 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
9170 destroy the RHS symbols of a rule.
9171 * data/yacc.c (yylen): Initialize to 0.
9172 Keep its value to the number of items to possibly shift.
9173 In particular, a regular successful parse that ends on YYFINAL by
9174 a (internal) YYACCEPT must not have yylen != 0.
9175 (yyerrorlab, yyreturn): Pop the RHS.
9176 Reorder a bit to emphasize the `shifting' bits of code.
9177 (YYPOPSTACK): Now accept a number of items to pop.
9178 * data/lalr1.cc: Likewise.
9179 * data/glr.c: Formatting changes.
9180 Use goto instead of fall through.
9181 * doc/bison.texinfo (Destructor Decl): Complete.
9182
d508c281
JMG
91832005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9184
9185 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
9186 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
9187 * djgpp/config.bat: Replace every occurence of the file name
9188 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
9189 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
9190 * djgpp/config.sed: Replace every occurence of the file name
9191 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
9192 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
9193 * djgpp/djunpack.bat: DJGPP specific file.
9194 * djgpp/fnchange.lst: DJGPP specific file.
9195 * djgpp/README.in: Add new information about how to unpack the bison
9196 source on MSDOS and other systems which have 8.3 file name restrictions
9197 using djunpack.bat and fnchange.lst.
9198
3e7a2cd9
PE
91992005-12-12 Paul Eggert <eggert@cs.ucla.edu>
9200
9201 * bootstrap (build_cvs_prefix): Remove; unused.
9202 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
9203 when getting gnulib.
9204
92052005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
9206
9207 * data/glr.c: Reorder typedef declarations for structs to match order
9208 of struct declarations.
9209 Rename yystack everywhere to yystackp except in yyparse where it's not
9210 a pointer.
9211 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
9212 consistency.
9213 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
9214 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
9215 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
9216 lint.
9217
877519f8
PE
92182005-12-09 Paul Eggert <eggert@cs.ucla.edu>
9219
0eca5a39
PE
9220 * tests/sets.at (Accept): Fix typos in regular expression used to
9221 sed out the final state number.
9222
2cec9080
PE
9223 Work around portability problem on Solaris 10: flex-generated
9224 files include <stdio.h> before <config.h>, which messes up
9225 because the latter defines __EXTENSIONS__. Address the problem
9226 by creating two new little files that include <config.h> first,
9227 then include the flex-generated files. Rewrite everyone else
9228 to include <config.h> first, as well.
9229 * lib/timevar.c: Always include "config.h".
9230 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
9231 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
9232 (EXTRA_bison_SOURCES): New macro.
9233 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
9234 * src/system.h: Don't include config.h.
9235 * src/LR0.c: Include <config.h> first.
9236 * src/assoc.c: Likewise.
9237 * src/closure.c: Likewise.
9238 * src/complain.c: Likewise.
9239 * src/conflicts.c: Likewise.
9240 * src/derives.c: Likewise.
9241 * src/files.c: Likewise.
9242 * src/getargs.c: Likewise.
9243 * src/gram.c: Likewise.
9244 * src/lalr.c: Likewise.
9245 * src/location.c: Likewise.
9246 * src/main.c: Likewise.
9247 * src/muscle_tab.c: Likewise.
9248 * src/nullable.c: Likewise.
9249 * src/output.c: Likewise.
9250 * src/parse-gram.y: Likewise.
9251 * src/print.c: Likewise.
9252 * src/print_graph.c: Likewise.
9253 * src/reader.c: Likewise.
9254 * src/reduce.c: Likewise.
9255 * src/relation.c: Likewise.
9256 * src/state.c: Likewise.
9257 * src/symlist.c: Likewise.
9258 * src/symtab.c: Likewise.
9259 * src/tables.c: Likewise.
9260 * src/uniqstr.c: Likewise.
9261 * src/vcg.c: Likewise.
9262
877519f8
PE
9263 * src/parse-gram.y: Fix minor problems uncovered by lint.
9264 (current_lhs, current_lhs_location): Now static.
9265 (current_assoc): Remove unused variable.
9266
9267 Cleanups so that Bison-generated parsers have less lint.
9268 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
9269 Prepend /*ARGSUSED*/, for lint's sake.
9270 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
9271 definition if 'lint' is defined.
9272 (YYID): New macro (or function, if lint).
9273 All uses of /*CONSTCOND*/0 replaced by YYID(0).
9274 * data/yacc.c: Likewise.
9275 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
9276 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
9277 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
9278 is C++ only.
9279 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
9280 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
9281 Use YYID(0) rather than 0, for lint.
9282 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
9283 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
9284
f5228370
PE
92852005-12-07 Paul Eggert <eggert@cs.ucla.edu>
9286
9287 * tests/glr-regression.at
9288 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
9289 Close memory leak reported by twlevo.
9290
69ce078b
PE
92912005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
9292
6ff99711
PE
9293 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
9294 all stacks.
9295 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
9296 * tests/glr-regression.at (No users destructors if stack 0 deleted):
9297 New test case.
9298 (Duplicated user destructor for lookahead): This test now is expected
9299 to succeed.
9300
af3412cd
PE
93012005-12-01 Paul Eggert <eggert@cs.ucla.edu>
9302
32b5b719 9303 * NEWS: Document the following change.
af3412cd
PE
9304 * data/yacc.c: Say "parser skeleton" rather than "file", since
9305 it's no longer just a file.
9306 * data/glr.c: Grant a special exception for C GLR parsers, that
9307 reads like the already-existing exception for C LALR(1) parsers.
9308 * data/glr.cc: Likewise.
9309 * data/lalr1.cc: Likewise.
9310 * data/location.cc: Likewise.
9311 * data/yacc.c: Reword the "written by" statement to clarify that
9312 it was the parser skeleton, not the entire output file.
9313 * data/glr.c: Written by Paul Hilfinger.
9314 * data/glr.cc: Written by Akim Demaille.
9315 * data/lalr1.cc: Likewise.
9316
035aa4a0
PE
93172005-11-18 Paul Eggert <eggert@cs.ucla.edu>
9318
d9963c85
PE
9319 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
9320 Fix typos in previous change that broke 'make check'.
9321 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
9322 supported in C.
9323 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
9324 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
9325 We can revert this once things settle down.
9326
035aa4a0
PE
9327 * src/conflicts.c (conflicts_print): Don't print file name twice
9328 when %expect fails because there were no conflicts.
9329 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
9330 change.
9331 * tests/conflicts.at (%expect not enough, %expect too much):
9332 (%expect with reduce conflicts): Adjust to new behavior.
9333
93342005-11-18 Akim Demaille <akim@epita.fr>
9335
9336 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
9337 errors.
9338 * NEWS: Document this.
9339 * doc/bison.texinfo (Expect Decl): Likewise.
9340
d1ff7a7c
AD
93412005-11-16 Akim Demaille <akim@epita.fr>
9342
9343 Generalize the display of semantic values and locations in traces.
9344 * data/glr.c (yy_reduce_print): Fix indices (again).
9345 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
9346 literal integers.
9347 * data/lalr1.cc (yyreduce_print): Rename as...
9348 (yy_reduce_print): this.
9349 Display values and locations.
9350 * data/yacc.c (yy_reduce_print): Likewise.
9351 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
9352 (yysymprint): Move higher to be visible from yy_reduce_print).
9353 (yyparse): Adjust.
9354 * tests/calc.at: Adjust the expected length of the traces.
9355
6de5398d
AD
93562005-11-14 Akim Demaille <akim@epita.fr>
9357
9358 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
9359 from 1 to N, while values and location start at 0.
9360 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
9361
a1373f55
AD
93622005-11-14 Akim Demaille <akim@epita.fr>
9363
9364 * data/glr.c (yy_reduce_print): Fix the $ number.
9365
613d8952
AD
93662005-11-14 Akim Demaille <akim@epita.fr>
9367
9368 "Use" parse parameters.
9369 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
9370 * data/glr.c, data/glr.cc: Use them.
9371 * data/glr.c (YYUSE): Have a C++ definition that supports
9372 non-pointer types.
9373
b2741627
AD
93742005-11-14 Akim Demaille <akim@epita.fr>
9375
9376 * data/glr.c (yyexpandGLRStack): Declare only if defined.
9377
5059b5c8
AD
93782005-11-14 Akim Demaille <akim@epita.fr>
9379
42249483
AD
9380 * data/glr.cc: New.
9381 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 9382
4626a15d
AD
93832005-11-12 Akim Demaille <akim@epita.fr>
9384
9385 Let position and location be PODs.
9386 * data/location.cc (position::initialize, location::initialize): New.
9387 (position::position, location::location): Define only if
9388 b4_location_constructors is defined.
9389 * data/lalr1.cc (b4_location_constructors): Define it for backward
9390 compatibility.
9391 * doc/bison.texinfo (Initial Action Decl): Use initialize.
9392
93932005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
9394
9395 * data/lalr1.cc: Move the body of the ctor and dtor into the
9396 parser file (instead of the header).
9397 Wrap the implementations in a "namespace yy".
9398
93992005-11-12 Akim Demaille <akim@epita.fr>
9400
9401 Have glr.c include its header file when created.
9402 * data/glr.c (b4_shared_declarations): New.
9403 Output them verbatim in the parser if !%defines, otherwise
9404 output then in the header file, and include it instead.
9405
1989d947
AD
94062005-11-11 Akim Demaille <akim@epita.fr>
9407
9408 * data/glr.c: Comment changes.
9409
94102005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
9411
9412 When yydebug, report semantic and location values for reductions.
9413 * data/glr.c (yy_reduce_print): Report the semantic values and the
9414 locations.
9415 (YY_REDUCE_PRINT): Adjust.
9416 (yyglrReduce): Use them.
9417 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
9418 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
9419 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
9420 traces.
9421
02998094
AD
94222005-11-10 Akim Demaille <akim@epita.fr>
9423
9424 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
9425 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
9426 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
9427
5210672f
PE
94282005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
9429
9430 * m4/cxx.m4, examples/Makefile.am: Don't build
9431 examples/calc++ if no C++ compiler is available. (trivial change)
9432
a8991a1d
AD
94332005-11-09 Akim Demaille <akim@epita.fr>
9434
9435 * src/scan-skel.l: Use a couple of asserts.
9436
36b5e963
AD
94372005-11-03 Akim Demaille <akim@epita.fr>
9438
9439 In some (weird) cases, the final state number is incorrect.
9440 Reported by Alexandre Duret-Lutz.
9441 * src/LR0.c (state_list_append): Remove the computation of
9442 final_state.
9443 (save_reductions): Do it here.
9444 (get_state): Alpha conversion.
9445 (generate_states): Use a for loop.
9446 * src/gram.h (item_number_is_rule_number)
9447 (item_number_is_symbol_number): New.
9448 * src/state.c: Use assert.
9449 * src/system.h: Include assert.h.
9450 * tests/sets.at (Accept): New.
9451
44e7ead1
PH
94522005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9453
9454 * data/glr.c (yyfill): Adjust comment.
36b5e963 9455 (yyresolveAction): Initialize default location properly
44e7ead1
PH
9456 for empty right-hand sides.
9457 (yydoAction): Ditto.
9458 Add comment explaining apparently dead code.
36b5e963
AD
9459 * tests/glr-regression.at
9460 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 9461 New test.
36b5e963 9462
e10a80ee
PE
94632005-10-30 Paul Eggert <eggert@cs.ucla.edu>
9464
9465 * bootstrap (cleanup_gnulib): New function. Use it to clean up
9466 gnulib when interrupted. This fixes some race conditions and
9467 works around some portability problems (one noted by Paul
9468 Hilfinger).
9469
067b32ee
AD
94702005-10-22 Akim <akim@epita.fr>
9471
9472 * Makefile.cfg: Adjust to config -> build-aux.
9473 Reported by twledo.
9474
4b367315
AD
94752005-10-21 Akim Demaille <akim@epita.fr>
9476
9477 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
9478 the %parse-params.
9479 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
9480 * data/yacc.c (b4_Pure_if): Rename as...
9481 (b4_yacc_pure_if): this.
9482 (YY_SYMBOL_PRINT, yyparse): Adjust.
9483 * doc/bison.texinfo: Formatting changes.
9484
24cc23d9
AD
94852005-10-21 Akim Demaille <akim@epita.fr>
9486
9487 Finish the transition config -> build-aux.
9488 * configure.ac, Makefile.am: Use build-aux.
9489 * config/prev-version, config/announce-gen, config/Makefile.am:
9490 Move to...
9491 * build-aux/prev-version, build-aux/announce-gen,
9492 * build-aux/Makefile.am: here.
9493
d4476375
AD
94942005-10-14 Akim Demaille <akim@epita.fr>
9495
9496 * examples/calc++/test: Use set -x only when VERBOSE.
9497
302c0aee
PE
94982005-10-13 Paul Eggert <eggert@cs.ucla.edu>
9499
9500 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
9501 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
9502
7625ec2c
AD
95032005-10-13 Akim Demaille <akim@epita.fr>
9504
9505 * src/scan-skel.l: Output the base name parts of the parser and
9506 header file names.
302c0aee 9507 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
9508 additional checks.
9509 Use this to exercise C++ outputs in subdirs.
9510 Reported by Oleg Smolsky.
9511
ba0fe3c7
PE
95122005-10-12 Paul Eggert <eggert@cs.ucla.edu>
9513
9514 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
9515 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
9516 Problem reported by John P. Hartmann.
9517 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
9518 already defined it.
9519
9b8a5ce0
AD
95202005-10-12 Akim Demaille <akim@epita.fr>
9521
9522 * src/parse-gram.y (version_check): Exit 63 to please missing
9523 (stands for "version mismatch).
9524 * tests/input.at, doc/bison.texinfo: Adjust.
9525
4f6e011e
PE
95262005-10-10 Paul Eggert <eggert@cs.ucla.edu>
9527
9528 Work around portability problems with Visual Age C compiler
9529 (xlc and xlC_r) reported by John P. Hartmann.
9530 * data/location.cc (initial_column, initial_line): Remove.
9531 All uses replaced by 0 and 1.
9532 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
9533 that xlc complains about.
9534 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 9535 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 9536 as __STDC__.
4d7aa45e
PE
9537 * data/yacc.c (YYMODERN_C): New macro, which also looks at
9538 __STDC_VERSION__. Use it everywhere instead of looking at
9539 __STDC__ and __cplusplus.
4f6e011e 9540
a1b3bf8c
AD
95412005-10-10 Akim Demaille <akim@epita.fr>
9542
9543 * examples/calc++/test: Be quiet unless VERBOSE.
9544
412e44aa
PE
95452005-10-05 Paul Eggert <eggert@cs.ucla.edu>
9546
2a4647a3
PE
9547 * data/c.m4 (yydestruct, yysymprint):
9548 Use YYUSE instead of casting to void.
9549 * data/glr.c (YYUSE): New macro.
9550 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
9551 Use it instead of rolling our own.
9552 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
9553 (YYCHK1):
9554 Use /*CONSTCOND*/ to suppress lint warnings.
9555 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
9556 (YY_STACK_PRINT): Use 'false' not '0'.
9557 (YYUSE): New macro.
9558 (yysymprint_, yydestruct_): Use it instead of rolling our own.
9559 * data/yacc.c (YYUSE): New macro.
9560 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
9561 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
9562 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
9563
9564
412e44aa
PE
9565 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
9566 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
9567
88c6637f
PE
95682005-10-04 Paul Eggert <eggert@cs.ucla.edu>
9569
2f4f028d
PE
9570 Undo the parts of the unlocked-I/O change that substituted
9571 putc or puts for printf. This might hurt performance a bit,
9572 but some people prefer the printf style.
9573 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
9574 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
9575 All uses replaced by YYFPRINTF and YYDPRINTF.
9576 * data/yacc.c: Likewise.
9577 * lib/bitset.c (bitset_print): Likewise.
9578 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
9579 putc and puts.
9580 * lib/lbitset.c (debug_lbitset): Likewise.
9581 * src/closure.c (print_firsts, print_fderives): Likewise.
9582 * src/gram.c (grammar_dump): Likewise.
9583 * src/lalr.c (look_ahead_tokens_print): Likewise.
9584 * src/output.c (escaped_output): Likewise.
9585 (user_actions_output): Break apart two printfs.
9586 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
9587 * src/reduce.c (reduce_print): Likewise.
9588 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
9589 * src/system.h: Include unlocked-io.h rathe than stdio.h.
9590
88c6637f
PE
9591 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
9592 Use assignments rather than casts-to-void to suppress
9593 unused-variable warnings. This pacifies 'lint'.
9594 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
9595 unused-variable warnings.
9596
fb32e373
JMG
95972005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9598
9599 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
9600
edb8f44f
PE
96012005-10-02 Paul Eggert <eggert@cs.ucla.edu>
9602
fb9c0b33
PE
9603 Use unlocked I/O for a minor performance improvement on hosts like
9604 GNU/Linux and Solaris that support unlocked I/O. The basic idea
9605 is to use the gnlib unlocked-io module, and to prefer putc and
9606 puts to printf when either will work (since the latter doesn't
9607 come in an unlocked flavor).
9608 * bootstrap (gnulib_modules): Add unlocked-io.
9609 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
9610 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
9611 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
9612 and similarly for puts and putc and printf.
9613 * data/yacc.c: Likewise.
9614 * lib/bitset.c (bitset_print): Likewise.
9615 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
9616 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
9617 to printf.
9618 * lib/lbitset.c (debug_lbitset): Likewise.
9619 * src/closure.c (print_firsts, print_fderives): Likewise.
9620 * src/gram.c (grammar_dump): Likewise.
9621 * src/lalr.c (look_ahead_tokens_print): Likewise.
9622 * src/output.c (escaped_output): Likewise.
9623 (user_actions_output): Coalesce two printfs.
2f4f028d 9624 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
9625 * src/reduce.c (reduce_print): Likewise.
9626 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 9627 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 9628
edb8f44f
PE
9629 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
9630 this confuses xgettext.
9631
b50d2359
AD
96322005-10-02 Akim Demaille <akim@epita.fr>
9633
9634 * bootstrap (gnulib_modules): Add strverscmp.
9635 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
9636 * m4/.cvsignore: Add strverscmp.m4.
9637 * src/parse-gram.y (%require): New token, new rule.
9638 (version_check): New.
9639 * src/scan-gram.l (%require): Adjust.
9640 * tests/input.at (AT_REQUIRE): New.
9641 Use it.
9642 * doc/bison.texinfo (Require Decl): New.
9643 (Calc++ Parser): Use %require.
9644
21667f64
AD
96452005-10-02 Akim Demaille <akim@epita.fr>
9646
9647 * data/location.cc: New.
9648
2b81e969
AD
96492005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
9650 Akim Demaille <akim@epita.fr>
9651
9652 Make sure -odir/foo.cc creates dir/location.hh etc.
9653 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
9654 (spec_file_prefix, spec_verbose_file, spec_graph_file)
9655 (spec_defines_file): Now const.
9656 (dir_prefix): New.
9657 (short_base_name): Remove.
9658 * src/files.c: Adjust.
9659 (dirname.h): Include.
9660 (base_name): Don't prototype it.
9661 (finput): Remove, duplicates gram_in.
9662 (full_base_name, short_base_name): Replace by...
9663 (all_but_ext, all_but_tab_ext): these.
9664 (compute_base_names): Rename as...
9665 (compute_file_name_parts): this.
9666 Update to compute the new variables, including dir_prefix.
9667 Adjust dependencies.
9668 * src/output.c (prepare): Output them.
9669 * src/reader.c: Adjust to use gram_in, not finput.
9670 * src/scan-skel.l (@dir_prefix@): New.
9671
ad6a9b97
JMG
96722005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9673
9674 * lib/subpipe.c: New function end_of_output_subpipe() added
9675 to allow support for non-posix systems. This is a no-op function
9676 for posix systems.
9677
9678 * lib/subpipe.h: New function end_of_output_subpipe() added
9679 to allow support for non-posix systems. This is a no-op function
9680 for posix systems.
9681
9682 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
9683 handle the lack of pipe/fork functionality on non-posix systems.
9684
9685 * djgpp/Makefile.maint: DJGPP specific file.
9686
9687 * djgpp/README.in: DJGPP specific file.
9688
9689 * djgpp/config.bat: DJGPP specific configuration file.
9690
9691 * djgpp/config.sed: DJGPP specific configuration file.
9692
9693 * djgpp/config.site: DJGPP specific configuration file.
9694
9695 * djgpp/config_h.sed: DJGPP specific configuration file.
9696
9697 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
9698
9699 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
9700
fc695704
AD
97012005-10-02 Akim Demaille <akim@epita.fr>
9702
9703 * data/location.cc: New, extract from...
9704 * data/lalr1.cc: here.
9705 (location.hh): Include it after the user prologue, in case the
9706 filename type is defined by the user.
9707 Forward declation location and position before the pre-prologue.
9708 (yyresult_): Rename as...
9709 (yyresult): this, it's a local variable, not an attribute.
9710 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
9711
97122005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
9713
9714 * examples/extexi: Restore the #line generation.
9715
fb9712a9
AD
97162005-09-30 Akim Demaille <akim@epita.fr>,
9717 Alexandre Duret-Lutz <adl@gnu.org>
9718
9719 Move the token type and YYSTYPE in the parser class.
9720 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
9721 (parser::token): New, from the moved free definition of tokens.
9722 (parser::semantic_value): Now a full definition instead of an
9723 indirection to YYSTYPE.
9724 (b4_post_prologue): No longer included in the header file, but
9725 in the implementation file.
9726 * doc/bison.texi (C+ Language Interface): Update.
9727 * src/parse-gram.y: Support unary %define.
9728 * tests/actions.at: Define global_tokens_and_yystype for backward
9729 compatibility until we update the tests.
9730 * tests/calc.at: Idem.
9731 (first_line, first_column, last_line, last_column): Define for lalr1.cc
9732 to simplify the code.
9733
55f0c7b1
PE
97342005-09-29 Paul Eggert <eggert@cs.ucla.edu>
9735
9736 Port to SunOS 4.1.4, which lacks strtoul and strerror.
9737 Ah, the good old days! Problem reported by Peter Klein.
9738 * bootstrap (gnulib_modules): Add strerror, strtoul.
9739 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
9740 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
9741
fb9712a9 97422005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
9743
9744 * data/c.m4 (b4_error_verbose_if): New.
9745 * data/lalr1.cc: Use it.
9746 (YYERROR_VERBOSE_IF): Remove.
9747 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
9748 parser members, replaced by...
9749 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
9750 local variables.
9751 (yysyntax_error_): Takes the state number as argument.
9752 (yyreduce_print_): Use the argument yyrule, not the former
9753 attribute yyn_.
9754
8a6f72f3
PE
97552005-09-26 Paul Eggert <eggert@cs.ucla.edu>
9756
9757 * bootstrap (gnulib_modules): Add verify.
9758 * lib/.cvsignore: Add verify.h.
9759 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
9760 * src/system.h (verify): Remove.
9761 Include verify.h instead.
9762 * src/tables.c (tables_generate): Use new API for 'verify'.
9763
0d50976f
PE
97642005-09-21 Paul Eggert <eggert@cs.ucla.edu>
9765
ebc3737e
PE
9766 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
9767 local variables whose names begin with 'yy'.
9768 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
9769 Trivial changes from Joel E. Denny.
9770
0d50976f
PE
9771 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
9772 it itself.
9773 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
9774 don't use alloca any more.
9775
9776 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
9777 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 9778 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
9779 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
9780 to match yacc.c, to test more hosts.
9781
a05b79df
PE
97822005-09-20 Paul Eggert <eggert@cs.ucla.edu>
9783
55289366
PE
9784 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
9785 doesn't affect behavior.
9786 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
9787 Solaris, AIX, MSC.
9788 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
9789 This works a bit better with glibc, if user code has already included
9790 stdlib.h.
9791 * doc/bison.texinfo (Bison Parser): Document that users can't
9792 arbitrarily use malloc and free for other purposes. Document
9793 that <alloca.h> and <malloc.h> might be included.
9794 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
9795 user must declare alloca.
9796
a05b79df
PE
9797 * HACKING (release): Forwarn the Translation Project about
9798 stable releses.
9799
3ab2ca22
AD
98002005-09-20 Akim Demaille <akim@epita.fr>
9801
9802 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
9803
a9739e7c
PE
98042005-09-19 Paul Eggert <eggert@cs.ucla.edu>
9805
a702593e
PE
9806 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
9807 (YYSTACK_ALLOC_MAXIMUM): Use it.
9808 (yysyntax_error): New function.
9809 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
9810 multiple syntax errors are reported, and alloca is being used.
9811 Instead, reallocate buffers twice as big each time, so that
9812 we waste at most half the allocated memory. Start with a small
9813 (128-byte) buffer that will suffice in most cases anyway.
9814 Use yysyntax_error to do most of the work.
9815
9816 * doc/bison.texinfo (Error Reporting, Table of Symbols):
9817 yynerrs is the number of errors reported, not the number of
9818 errors encountered.
9819
a9739e7c
PE
9820 * tests/glr-regression.at (Duplicated user destructor for lookahead):
9821 Mark it as expected to fail.
9822 Cast result of malloc; problem reported by twlevo@xs4all.nl.
9823 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
9824 Don't start user-code symbols with "yy", to avoid name space problems.
9825
f479c6c6
AD
98262005-09-19 Akim Demaille <akim@epita.fr>
9827
9828 Remove the traits, failed experiment.
9829 It never proved useful, and anyway because of the current
9830 definition, it was not possible to have several specialization of
9831 this traits, making it useless.
9832 * data/lalr1.cc (yy:traits): Remove.
9833 Inline its definitions in the parser class.
9834
e2586f82
AD
98352005-09-19 Akim Demaille <akim@epita.fr>
9836
9837 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
9838 least Mac OSX with a /usr/local install of gettext.
9839
2e8cf949
AD
98402005-09-19 Akim Demaille <akim@epita.fr>
9841
9842 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
9843 and yytoken for similarity with the other skeletons.
9844
c7fb0b90
AD
98452005-09-19 Akim Demaille <akim@epita.fr>
9846
4e26c69e 9847 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 9848
1bd0deda
PE
98492005-09-16 Paul Eggert <eggert@cs.ucla.edu>
9850
9851 * NEWS: Version 2.1.
9852
9853 * NEWS: Remove notice of yytname change, since it was never in an
9854 official release.
9855 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
9856 diagnostic.
9857 * src/output.c (prepare): Likewise.
9858 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
9859 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
9860 is not defined. This is an awful hack, but it's enough for now.
9861 All callers changed.
9862 * tests/glr-regression-at (make_value): Args are const pointers now,
9863 to avoid GCC warning.
9864 (Duplicated user destructor for lookahead): New test. Currently
9865 skipped. It fails on my host but I'm not sure it'll always fail.
9866
98672005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
9868
9869 * src/symtab.h (struct symbol): Declare the printer and destructor
9870 as const, to avoid accidental calls to free.
9871 (symbol_destructor_set, symbol_printer_set): Adjust.
9872 * src/symtab.c: Adjust.
9873
1bd0deda 98742005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
9875
9876 * data/c.m4 (b4_token_enums): New.
9877 (b4_token_defines): Rename as...
9878 (b4_token_enums_defines): this.
9879 (b4_token_defines): New, output only the #defines.
9880 * data/yacc.c, data/glr.c: Adjust.
9881 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
9882 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
9883 as default values.
9884
dbcdae2d
AD
98852005-09-16 Akim Demaille <akim@epita.fr>
9886
9887 * data/lalr1.cc (yylex_): Remove, inline its code.
9888 (yyreport_syntax_error_): Remove, replaced by...
9889 (yysyntax_error_): this which returns a string and leaves to the
9890 caller the call to the users' error function.
9891 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
9892 Move from members of the parser object...
9893 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
9894 to local variables of the parse function.
9895
70d8f291
AD
98962005-09-16 Akim Demaille <akim@epita.fr>
9897
9898 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
9899 since it's in Bison's name space.
9900
b47dbebe
PE
99012005-09-15 Paul Eggert <eggert@cs.ucla.edu>
9902
ae199bf1
PE
9903 * data/glr.c (yyresolveValue): Add default case to pacify
9904 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
9905
b47dbebe
PE
9906 * NEWS: Document when yyparse started to return 2.
9907 * doc/bison.texinfo (Parser Function): Document when yyparse
9908 returns 2.
9909
9910 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
9911 (b4_filename_type): Renamed back from b4_file_name_type. All uses
9912 changed.
9913 (class position): file_name -> filename (reverting). All uses changed.
9914
99152005-09-14 Paul Eggert <eggert@cs.ucla.edu>
9916
9917 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
9918 do anything if $@ exists. This reverts part of the 2005-07-07
9919 patch.
9920
00292f66
PE
99212005-09-11 Paul Eggert <eggert@cs.ucla.edu>
9922
9923 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
9924 contains obsolete information and isn't worth distributing as a
9925 separate file anyway.
9926 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
9927 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
9928 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
9929 (yyparse): Abort if user code uses longjmp to throw an unexpected
9930 value.
9931
a420f962
PE
99322005-09-09 Paul Eggert <eggert@cs.ucla.edu>
9933
00292f66
PE
9934 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
9935 Suggested by twlevo@xs4all.nl.
9936
127287e9
PE
9937 * data/glr.c (YYCHK1): Do not assume YYE is in range.
9938 This avoids a diagnostic from gcc -Wswitch-enum.
9939 Problem reported by twlevo@xs4all.nl.
9940
a420f962
PE
9941 * doc/bison.texinfo: Don't use "filename", as per GNU coding
9942 standards. Use "file name" or "file" or "name", depending on
9943 the context.
9944 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
9945 not to hack/foo.tab.c.
9946 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
9947 * data/glr.c: b4_filename -> b4_file_name.
9948 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
9949 All uses changed.
9950 (class position): filename -> file_name. All uses changed.
9951 * data/yacc.c: b4_filename -> b4_file_name.
9952 * lib/bitset.h: filename -> file_name in local vars.
9953 * lib/bitset_stats.c: Likewise.
9954 * src/files.c: Likewise.
9955 * src/scan-skel.l ("@output ".*\n): Likewise.
9956 * src/files.c (file_name_split): Renamed from filename_split.
9957 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
9958
99592005-09-08 Paul Eggert <eggert@cs.ucla.edu>
9960
9961 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
9962 to accommodate latest gnulib.
9963
9964 * tests/glr-regression.at (Duplicate representation of merged trees):
9965 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
9966
9967 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
9968 needed.
9969
42a6501d
PE
99702005-08-26 Paul Eggert <eggert@cs.ucla.edu>
9971
9972 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
9973 All uses changed. Invoke user destructor after an error during a
9974 split parse (trivial change from Joel E. Denny).
9975
9976 * tests/glr-regression.at
9977 (User destructor after an error during a split parse): New test case.
9978 Problem reported by Joel E. Denny in:
9979 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
9980
ef9a1faf
PE
99812005-08-25 Paul Eggert <eggert@cs.ucla.edu>
9982
5b4aaf78
PE
9983 * README-cvs: Give URLs for recommended tools.
9984 Mention Gzip version problem, and bootstrapping issues.
9985 Remove troubleshooting section, as it's somewhat obsolete.
9986
b5240ba5
PE
9987 * bootstrap (no_cache): New var, to accommodate different wget
9988 variants. Use it instead of '-C off'. Problem reported by
9989 twlevo@xs4all.nl.
9990
ef9a1faf
PE
9991 * data/glr.c (yydestroyStackItem): New function.
9992 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
9993 debugging information. Problem reported by Joel E. Denny.
9994
e6efa9da
AD
99952005-08-25 Akim Demaille <akim@epita.fr>
9996
9997 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
9998
adc90f13
PE
99992005-08-24 Paul Eggert <eggert@cs.ucla.edu>
10000
10001 * data/glr.c (yyrecoverSyntaxError, yyreturn):
10002 Don't invoke destructor on unresolved entries.
10003 * tests/glr-regression.at
10004 (User destructor for unresolved GLR semantic value): New test case.
10005 Problem reported by Joel E. Denny in:
10006 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
10007
f9315de5
PE
100082005-08-21 Paul Eggert <eggert@cs.ucla.edu>
10009
15d29c1f
PE
10010 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
10011 Add strnlen.c.
10012 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
10013 lib-prefix.m4, po.m4.
10014
dd5f2af2
PE
10015 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
10016 in yydestruct diagnostic, since it might not be an error.
10017 Problem reported by Joel Denny near end of
10018 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 10019 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
10020 * data/yacc.c (yyreturn): Likewise.
10021 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
10022
10023 * src/files.c: Remove obsolete FIXME comment.
10024
10025 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
10026 with the other templates, and to fix bogus run-on messages such
10027 as the one reported at the end of
10028 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
10029 All callers changed to avoid the newline.
10030 (yyprocessOneStack): Output two lines rather than one, to accommodate
10031 the above change. This changes the debug output format slightly.
10032
f9315de5
PE
10033 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
10034 reported by Joel E. Denny in
10035 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
10036 (trivial change).
10037 * tests/glr-regression.at (Duplicate representation of merged trees):
10038 New test, from Joel E. Denny in:
10039 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
10040 * THANKS: Add Joel E. Denny.
10041
10042 * configure.ac (AC_INIT): Bump to 2.0c.
10043
04098407
PE
100442005-07-24 Paul Eggert <eggert@cs.ucla.edu>
10045
10046 * NEWS: Version 2.0b.
10047
ca5d2013
PE
10048 * Makefile.am (SUBDIRS): Put examples before tests, so that
10049 "make check" doesn't finish with "All 1 tests passed".
10050
3d54b576
PE
10051 * tests/regression.at (Token definitions): Don't rely on
10052 AT_PARSER_CHECK for data that contains backslashes. It currently
10053 uses 'echo', and 'echo' isn't portable if its argument contains
10054 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
10055 that the byte '\0xff' is not printable in the C locale; it is,
10056 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
10057 not printable, so use '\0x81' to test.
10058
d53ae497
PE
10059 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
10060 version of GCC, since the macro is used with non-GCC compilers.
10061
fc01665e
PE
10062 Fix core dump reported by Pablo De Napoli in
10063 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
10064 * tests/regression.at (Invalid inputs with {}): New test.
10065 * src/parse-gram.y (token_name): Translate type before using
10066 it as an index.
10067
04098407
PE
10068 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
10069 the user's name space. All uses changed to __attribute__
10070 ((__unused__)).
10071 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
10072 Add __attribute__ ((__noreturn__)).
10073
10074 * etc/clcommit: Remove. We weren't using it, and it failed
10075 "make maintainer-distcheck".
10076 * Makefile.maint: Merge from coreutils.
10077 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
10078 (syntax-check-rules): Change list of rules as described below.
10079 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
10080 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
10081 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
10082 (sc_trailing_space): New rules.
10083 (sc_xalloc_h_in_src): Remove.
10084 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
10085 (sc_space_tab, sc_error_exit_success, sc_changelog):
10086 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
10087 (makefile-check, po-check, author_mark_check):
10088 (makefile_path_separator_check, copyright-check):
10089 Use grep -n, to make it easier to find violations.
10090 Use CVS_LIST and CVS_LIST_EXCEPT.
10091 (header_regexp, h_re): Remove.
10092 (dd_c): New macro.
10093 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
10094 (my-distcheck): Use more-modern GCC flags.
10095 (signatures, %.asc): Remove.
10096 (rel-files, announcement): Remove signatures.
10097 Restore old updating code, even though we don't use it, so
10098 that we're the same as coreutils.
10099 (alpha, beta, major): Depend on news-date-check.
10100 Make the upload commands.
10101
10102 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
10103 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
10104 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
10105 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
10106 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
10107 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
10108 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
10109 * tests/sets.at: Likewise.
10110
10111 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
10112 we comment out the Autoconf version number.
10113 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
10114 it's error-prone and "make maintainer-distcheck" rejects it.
10115
10116 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
10117 Indent calls to "error" to pacify "make maintainer-distcheck",
10118 when the calls are not intended to be translated.
10119 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
10120
10121 * src/Makefile.am (DEFS): Use +=, to pacify
10122 "make maintainer-distcheck".
10123 (bison_SOURCES): Add scan-skel.h.
10124 (sc_tight_scope): New rule, from coreutils.
10125
10126 * src/files.c (src_extension, header_extension):
10127 Now static, not extern.
10128 * src/getargs.c (short_options): Likewise.
10129 * src/muscle_tab.c (muscle_table): Likewise.
10130 * src/parse-gram.y (current_class, current_type, current_prec):
10131 Likewise.
10132 * src/reader.c (grammar_end, previous_rule_end): Likewise.
10133 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
10134 * src/main.c (main): Cast bindtextdomain and textdomain calls to
10135 void, to avoid warning when NLS is disabled.
10136 * src/output.c: Include scan-skel.h.
10137 (scan_skel): Remove decl, since scan-skel.h does this.
10138 (output_skeleton):
10139 Indent calls to "error" to pacify "make maintainer-distcheck".
10140 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
10141 * src/reader.h (gram_end, gram_lineno): New decls to pacify
10142 "make maintainer-distcheck".
10143 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
10144 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
10145 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
10146 (skel_lex_destroy, scan_skel): Move these decls to...
10147 * src/scan-skel.h: New file.
10148 * src/uniqstr.c (uniqstr_assert):
10149 Indent calls to "error" to pacify "make maintainer-distcheck".
10150
10151 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
10152 not @VAR@.
10153
10154 * tests/torture.at: Revamp to avoid misuse of atoi that
10155 "make maintainer-distcheck" complained about.
10156
10157 * examples/extexi (message): Don't print a message more than once,
10158 and omit line-number decoration that makes Emacs compile think
10159 that informative messages are worth worrying about.
10160
101612005-07-22 Paul Eggert <eggert@cs.ucla.edu>
10162
10163 * configure.ac: Update version number.
10164
10165 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
10166 accidentally.
10167 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
10168 autogenerated by the maintainer.
10169 * examples/calc++/.cvsignore: Add *.yy.
10170
10171 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
10172 * lib/bitset_stats.c (bitset_stats_init): Likewise.
10173 * lib/bitsetv.c (bitsetv_alloc): Likewise.
10174
10175 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
10176
10177 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
10178 from maintainer-distcheck about casting the argument of 'free'.
10179
10180 * NEWS: Mention recent yytname changes.
10181 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
10182
10183 * bootstrap: For translations that have not yet been upgraded to
10184 the new runtime-po domain, prime the pump by extracting the
10185 relevant strings from the obsolete translations. This code can be
10186 removed once the bison-runtime domain has been translated by each
10187 team.
10188
10189 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
10190 now that token names are already quoted.
10191
10192 Fix problem reported by Anthony Heading.
10193 * data/glr.c (YYTOKEN_TABLE): New macro.
10194 (yytname): Define if YYTOKEN_TABLE.
10195 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
10196 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
10197 (YYERROR_VERBOSE): Define the same way the other skeletons do.
10198 * src/output.c (prepare_symbols): Output token_table_flag.
10199
0ffda363
PE
102002005-07-21 Paul Eggert <eggert@cs.ucla.edu>
10201
10202 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
10203 again if the first call fails.
10204
10205 * data/glr.c (yytnamerr): New function.
10206 (yyreportSyntaxError): Use it to dequote most string literals.
10207 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
10208 with other skeletons. All uses changed.
10209 (yytnameerr_): New function.
10210 (yyreport_syntax_error): Use it to dequote most string literals.
10211 * data/yacc.c (yytnamerr): New function.
10212 (yyerrlab): Use it to decode most string literals.
10213 * doc/bison.texinfo (Decl Summary, Calling Convention):
10214 Clarify quoting convention of yytname.
10215 * src/output.c (prepare_symbols): Quote all names. This undoes
10216 the 2005-04-17 change, which is now accomplished (mostly) via
10217 changes in the parsers as described above.
10218 * tests/regression.at (Token definitions, Web2c Actions):
10219 Undo most 2005-04-17 change here, too.
10220
102212005-07-20 Paul Eggert <eggert@cs.ucla.edu>
10222
10223 Fix more problems reported by twlevo@xs4all.nl.
10224 * tests/cxx-type.at: Don't pipe output of ./types through sed to
10225 remove trailing spaces. This loses the exit status of ./types,
10226 and isn't needed since ./types shouldn't be emitting trailing
10227 spaces.
10228 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
10229 as the stack isn't valid in that case.
10230
10231 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
10232 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
10233 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
10234 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
10235 is used.
10236 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
10237 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
10238 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
10239 Likewise.
10240
10241 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
10242 overly-picky compilers that reject 'char *foo = "bar";'.
10243
10244 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
10245 to FILE * parameter, not to stderr. This fixes a typo introduced
10246 in the 2005-07-12 change.
10247
10248 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
10249 warnings from GCC 4.
10250
10251 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
10252 (yyglrShiftDefer, yysplitStack):
10253 Remove unused parameters b4_pure_formals. All uses changed.
10254 (yyglrShift): Remove unused parameters b4_user_formals.
10255 All uses changed.
10256 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
10257
6100a9aa
PE
102582005-07-18 Paul Eggert <eggert@cs.ucla.edu>
10259
258b75ca
PE
10260 Destructor cleanups and regularization among the three skeletons.
10261 * NEWS: Document the behavior changes.
10262 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
10263 stack before failing, as the cleanup code will do it for us now.
10264 * data/lalr1.cc (yyerrlab): Likewise.
10265 * data/glr.c (yyparse): Pop everything off the stack before
10266 freeing it, so that destructors get called properly.
10267 * data/lalr1.cc (yyreturn): Likewise.
10268 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
10269 This is more consistent.
10270 * doc/bison.texinfo (Destructor Decl): Mention more reasons
10271 why destructors might be called. 1.875 -> 2.1.
10272 (Destructor Decl, Decl Summary, Table of Symbols):
10273 Some English-language cleanups for %destructor.
10274 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
10275 Add output line for destructor of start symbol.
10276 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
10277 because of that same extra output line.
10278
1a059451
PE
10279 * NEWS: Document minor wording changes in diagnostics of
10280 Bison-generated parsers.
10281 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
10282 Remove unused formals. All uses changed.
10283 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
10284 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
10285 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
10286 Rename yyoverflowab to yyexhaustedlab.
10287 When memory exhaustion occurs during syntax-error reporting,
10288 report it separately rather than in a single diagnostic; this
10289 eases translation.
10290 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
10291 (Memory Exhausted): Renamed from Parser Stack Overflow.
10292 Revamp wording slightly to prefer "memory exhaustion".
10293 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
10294
97460c78
PE
10295 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
10296
30757c8c
PE
10297 Add i18n support to the GLR skeleton. Partially fix the C++
10298 skeleton; a C++ expert needs to finish this. Remove debugging
10299 msgids; there's little point to having them translated, since they
10300 can be understood only by someone who can read the
10301 (English-language) source code.
10302
10303 Generate runtime-po/bison-runtime.pot automatically, so that we
10304 don't have to worry about garbage getting in that file. We'll
10305 make sure after the next official release that old msgids don't
10306 get lost. See
10307 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
10308
10309 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
10310 Now auto-generated.
10311 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
10312 Fix typos in explanations of the runtime file.
10313 * bootstrap: Change gettext keyword from YYI18N to YY_.
10314 Use standard Makefile.in.in in runtime-po, since we'll arrange
10315 for backward-compatible bison-runtime.po files in a different way.
10316 * data/glr.c (YY_): New macro, from yacc.c.
10317 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
10318 Translate messages intended for users.
10319 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
10320 the wording in the other skeletons. We don't know that the memory
10321 is virtual.
10322 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
10323 Use same method that yacc.c uses.
10324 Don't translate debugging messages.
10325 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
10326 it doesn't work (yet), and requires C++ expertise to fix.
10327 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
10328 Move defn to a more logical place, to be consistent with other
10329 skeletons.
10330 Don't translate debugging messages.
10331 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
10332 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
10333 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
10334 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
10335
ac8c5689
PE
10336 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
10337 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
10338 void, not int.
10339 * tests/glr-regression.at (Badly Collapsed GLR States):
10340 Likewise.
10341 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
10342 yylex should return 0 at EOF rather than aborting.
10343
6100a9aa
PE
10344 Improve tests for stack overflow in GLR parser.
10345 Problem reported by twlevo@xs4all.nl.
10346 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
10347 All uses removed.
10348 (yyStackOverflow): Just longjmp, but with value 2 so that caller
10349 can handle the problem.
10350 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
10351 (yyparse): New local variable yyresult to record the result.
10352 Use result of setjmp to set it, rather than storing itinto
10353 struct.
10354 (yyDone): Remove label.
10355 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
10356 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
10357 if YYABORT is used).
10358 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
10359 yyparse status; put status > 1 into diagnostic.
10360 Check that status==2 works.
10361 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
10362 Use exit status 3 for failure to open (which shouldn't happen).
10363
15f40952
PE
103642005-07-17 Paul Eggert <eggert@cs.ucla.edu>
10365
67fd79c4
PE
10366 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
10367 1 on syntax error; just let yyparse do its thing.
10368 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
10369 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
10370 (Exploding the Stack Size with Alloca):
10371 (Exploding the Stack Size with Malloc):
10372 Expect exit status 2, not 1, since the parser is supposed to blow
10373 its stack. Problem reported by twlevo@xs4all.nl.
10374
15f40952
PE
10375 * data/glr.c (yyparse): Don't assume that the initial calls
10376 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
10377 Print a stack-overflow message and fail instead.
10378 Initialize the line-number information before creating the stack,
10379 so that the stack-overflow message can report line zero safely.
10380
f32c66b5
PE
103812005-07-14 Paul Eggert <eggert@cs.ucla.edu>
10382
a22ff96f 10383 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
10384 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
10385 (yyuserMerge): Provide a default case if b4_mergers is empty.
10386 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
10387 * tests/glr-regression.at
10388 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 10389 Add casts to pacify C++ compilers.
1beb0b24
PE
10390 * tests/glr-regression.at (Improper merging of GLR delayed action
10391 sets): Declare yylex before using it.
f32c66b5 10392 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
10393 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
10394 test for valgrind; valgrind is independent of g++.
10395 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
10396 for compatibility with POSIX 1003.1-2001 (if running coreutils).
10397 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
10398 Use a destructor, so that we can expand the stack. Change
10399 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 10400
d741bd1b
PE
104012005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10402
10403 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
10404 a valgrind failure. Problem reported by twlevo@xs4all.nl.
10405
0410a6e0
PE
104062005-07-13 Paul Eggert <eggert@cs.ucla.edu>
10407
10408 * PACKAGING: New file, suggested by Bruno Haible and taken from
10409 similar wording in gettext's PACKAGING file.
10410 * NEWS: Mention PACKAGING.
10411 * Makefile.am (EXTRA_DIST): Add PACKAGING.
10412
f7ab6a50
PE
104132005-07-12 Paul Eggert <eggert@cs.ucla.edu>
10414
baf785db 10415 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
10416 * bootstrap: Get runtime translations into runtime-po.
10417 Create runtime-po files automatically, if possible.
10418 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
10419 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
10420 does not infringe on the user's name space.
10421 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
10422 * doc/bison.texinfo (Internationalization): Revamp the English
10423 and Texinfo syntax a bit, to try to make it clearer.
10424 (Bison Options, Option Cross Key): Mention --print-localedir.
10425 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
10426 YYENABLE_NLS. Quote a bit more.
10427 * runtime-po/.cvsignore: New file.
10428 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
10429 * runtime-po/Rules-quot: Remove; now created by bootstrap.
10430 * runtime-po/quot.sed: Likewise.
10431 * runtime-po/boldquot.sed: Likewise.
10432 * runtime-po/en@quot.header: Likewise.
10433 * runtime-po/en@boldquot.header: Likewise.
10434 * runtime-po/insert-header.sin: Likewise.
10435 * runtime-po/remove-potcdate.sin: Likewise.
10436 * runtime-po/Makevars: Likewise.
10437 * runtime-po/LINGUAS: Likewise.
10438 * runtime-po/de.po: Likewise; we will rely on the translation project
10439 to maintain this, so "bootstrap" should get it.
0410a6e0 10440 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
10441 its value.
10442 * src/main.c (main): Bind the bison-runtime domain, too.
10443
104442005-07-12 Bruno Haible <bruno@clisp.org>
10445
10446 * data/yacc.c: Include <libintl.h> when NLS is enabled.
10447 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
10448 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
10449 * runtime-po: New directory.
10450 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
10451 $(DOMAIN).pot-update rule, so that old messages are never dropped.
10452 * runtime-po/Rules-quot: New file, copied from po/.
10453 * runtime-po/quot.sed: Likewise.
10454 * runtime-po/boldquot.sed: Likewise.
10455 * runtime-po/en@quot.header: Likewise.
10456 * runtime-po/en@boldquot.header: Likewise.
10457 * runtime-po/insert-header.sin: Likewise.
10458 * runtime-po/remove-potcdate.sin: Likewise.
10459 * runtime-po/Makevars: New file.
10460 * runtime-po/POTFILES.in: New file.
10461 * runtime-po/LINGUAS: New file.
10462 * runtime-po/bison-runtime.pot: New file.
10463 * runtime-po/de.po: New file.
10464 * m4/bison.m4: New file.
10465 * Makefile.am (SUBDIRS): Add runtime-po.
10466 (aclocaldir, aclocal_DATA): New variables.
10467 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
10468 Define aclocaldir.
10469 * src/getargs.c (usage): Document --print-localedir option.
10470 (PRINT_LOCALEDIR_OPTION): New enum item.
10471 (long_options): Add --print-localedir option.
10472 (getargs): Handle --print-localedir option.
10473 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
10474 (Internationalization): New section.
10475
22dda0f0
AD
104762005-07-12 Akim Demaille <akim@epita.fr>
10477
10478 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
10479 for consistency with the rest of the code.
10480 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
10481 Add separators.
10482
82b248ad
AD
104832005-07-12 Akim Demaille <akim@epita.fr>
10484
10485 * src/parse-gram.y: Use %printer instead of YYPRINT.
10486
fa0e9314
AD
104872005-07-12 Akim Demaille <akim@epita.fr>
10488
867a3e00
AD
10489 * src/symtab.h, src/symtab.c (symbol_print): New.
10490 * src/symlist.h, src/symlist.c (symbol_list_print): New.
10491 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
10492
104932005-07-12 Akim Demaille <akim@epita.fr>
10494
10495 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
10496 b4_at_dollar and b4_dollar_dollar.
10497
e054b190
PE
104982005-07-11 Paul Eggert <eggert@cs.ucla.edu>
10499
10500 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
10501 and Pennello's paper.
10502
34160ec4
PE
105032005-07-09 Paul Eggert <eggert@cs.ucla.edu>
10504
407d4a75
PE
10505 * data/yacc.c (yyparse): Undo previous patch. Instead,
10506 set yylsp[0] and yyvsp[0] only if the initial action
10507 sets yylloc and yylval, respectively.
10508
34160ec4
PE
10509 * data/yacc.c (yyparse): In the initial action, set
10510 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
10511 This avoids the use of undefined variables if the initial
10512 action does not set yylloc and/or yylval.
10513
c3d5a4a7
PE
105142005-07-07 Paul Eggert <eggert@cs.ucla.edu>
10515
b34d96c1
PE
10516 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
10517 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
10518 Remove from CVS. These files are automatically generated.
10519 * examples/extexi: Clarify that this file is now part of Bison,
10520 not GNU M4, and that it works with any POSIX-compatible Awk.
10521 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
10522 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
10523 so that we also get calc++-parser.yy. Geneate it.
10524 Use $(AWK), not gawk, since any conforming Awk will do.
10525 Put comment before action, since older 'make' can't handle comment
10526 in action.
10527 $(BUILT_SOURCES): List all built sources, not just some of them.
10528 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
10529 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
10530 $($(calc_sources_generated)): Remove unnecessary test for existence
10531 of target. (This had a shell syntax error anyway; a stray "x".)
10532 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
10533 calc++-parser.yy.
10534 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
10535
c3d5a4a7
PE
10536 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
10537 implied by the other modules.
10538
828c373b
AD
105392005-07-06 Akim Demaille <akim@epita.fr>
10540
10541 Bind examples/calc++ to the package.
10542 * examples/calc++/Makefile: Remove, replaced by...
10543 * examples/calc++/Makefile.am: ... this new file.
10544 * examples/calc++/test: Remove input.
10545 * examples/calc++/compile: Remove.
10546 * examples/Makefile.am: New.
10547 * configure.ac, Makefile.am: Adjust.
10548 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
10549
63cb01d6
PE
105502005-07-05 Paul Eggert <eggert@cs.ucla.edu>
10551
fd2df2ed
PE
10552 * data/glr.c (yyFail): Drastically simplify; since the format argument
10553 never had any % directives, we can simply pass it to yyerror.
10554 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
10555 be modified later, as that is the usual style in glr.c.
10556 Problems reported by Paul Hilfinger.
10557
63cb01d6
PE
10558 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
10559 and size overflow errors.
10560 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
10561 in case the user prolog sets feature-test macros like _GNU_SOURCE.
10562 (YYSIZEMAX): New macro.
10563 (yystpcpy): New function, taken from yacc.c.
10564 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
10565 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
10566 so that we don't have to maintain their signatures.
10567 (yyFail): Check for buffer overflow, by using vsnprintf rather
10568 than vsprintf. Allocate a bigger buffer if possible.
10569 Report an error if buffer allocation fails.
10570 (yyStackOverflow): New function.
10571 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
10572 the initialization was successful. It might fail if storage was
10573 exhausted.
10574 (yyexpandGLRStack): Add more checks for storage allocation failure.
10575 Use yyStackOverflow to report failures.
10576 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
10577 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
10578 Don't assume stack number fits in int.
10579 (yysplitStack): Check for storage allocation failure.
10580 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
10581 can print diagnostics on storage allocation failure. All callers
10582 changed.
10583 (yyresolveValue): Use yybool for boolean.
10584 (yyreportSyntaxError): Check for size-calculation overflow.
10585 This code is taken from yacc.c.
10586 (yyparse): Check for storage allocation errors when allocating
10587 the initial stack.
10588
1c59e0a1
AD
105892005-07-05 Akim Demaille <akim@epita.fr>
10590
10591 Extract calc++ from the documentation.
10592 * doc/bison.texinfo (Calc++): Add the extraction marks.
10593 * examples/extexi: New, from the aborted GNU Programming 2E.
10594 Separate the different paragraph of a file with empty lines.
10595 * examples/Makefile: Use it to extract the whole calc++ example.
10596
8a0adb01
AD
105972005-06-24 Akim Demaille <akim@epita.fr>
10598
10599 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
10600 class typedefs.
10601
12545799
AD
106022005-06-22 Akim Demaille <akim@epita.fr>
10603
10604 * doc/bison.texinfo (C++ Language Interface): First stab.
10605 (C++ Parsers): Remove.
10606
99be0235
AD
106072005-06-22 Akim Demaille <akim@epita.fr>
10608
10609 * data/lalr1.cc (yylex_): Honor %lex-param.
10610
0ffd4fd1
AD
106112005-06-22 Akim Demaille <akim@epita.fr>
10612
10613 Start a set of simple examples.
10614 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
10615 * examples/calc++/calc++-driver.hh,
10616 * examples/calc++/calc++-parser.yy,
10617 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
10618 * examples/calc++/compile, examples/calc++/test: New.
10619
0925ebb4
PE
106202005-06-09 Paul Eggert <eggert@cs.ucla.edu>
10621
10622 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
10623 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
10624 which stems from the 2005-05-27 patch.
10625
43d3b664
PH
106262005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10627
10628 * data/glr.c: Modify treatment of unused parameters to permit use
10629 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
10630
3062864d
PE
106312005-05-30 Paul Eggert <eggert@cs.ucla.edu>
10632
10633 Fix infringement on user name space reported by Janos Zoltan Szabo.
10634 * data/yacc.c (yyparse): strlen -> yystrlen.
10635
989b5b8e
AD
106362005-05-30 Akim Demaille <akim@epita.fr>
10637
10638 * data/lalr1.cc (_): New.
10639 Translate the various messages.
10640
bedf57f5
PE
106412005-05-27 Paul Eggert <eggert@cs.ucla.edu>
10642
10643 Fix infringement on user name space reported by Bruno Haible.
10644 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
10645 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
10646 the user's name space.
10647 (alloca): Include <stdlib.h> to get it, if it's not built in.
10648 (YYMALLOC, YYFREE): Define only if needed.
10649 (malloc, free): Declare, but only if needed, as this infringes on
10650 the user name space.
10651
4d1801f1
PE
106522005-05-25 Paul Eggert <eggert@cs.ucla.edu>
10653
10654 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
10655 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
10656 with %d format.
10657 * lib/ebitset.c (min, max): Undef before defining.
10658 * lib/vbitset.c (min, max): Likewise.
10659 * lib/subpipe.c (create_subpipe): Save local variables in case
10660 vfork clobbers them.
10661
106622005-05-24 Bruno Haible <bruno@clisp.org>
10663
10664 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
10665 error message syntax used by gcc-4.0.
10666
b94a9e1e
PE
106672005-05-23 Paul Eggert <eggert@cs.ucla.edu>
10668
85ac3861
PE
10669 * README: Mention m4 1.4.3. Remove obsolete advice about
10670 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
10671
b94a9e1e
PE
10672 * bootstrap: Remove workaround for problem I encountered with
10673 gettext 0.14.1; it seems to be fixed now.
10674
51c30d21
PE
106752005-05-22 Paul Eggert <eggert@cs.ucla.edu>
10676
009ce67d
PE
10677 * NEWS: Version 2.0a.
10678
f2a97c62
PE
10679 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
10680 the previous change.
10681
c8775f93
PE
10682 Various maintainer cleanups.
10683 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
10684 conftest*, for benefit of CVS commands run at the same time as
10685 "configure". Add build-aux, since "bootstrap" now creates it and
10686 its subfiles.
10687 * Makefile.cfg (move_if_change): Remove.
10688 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
10689 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
10690 (po_repo, do-po-update, po-update, wget_files, get-targets):
10691 (config.guess-url_prefix, config.sub-url_prefix):
10692 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
10693 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
10694 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
10695 Remove.
10696 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
10697 this is now the recommended name.
10698 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
10699 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
10700 ylwrap. These files now go into build-aux.
10701 * config/move-if-change: Remove.
10702 * config/prev-version.txt: Bump from 1.75 to 2.0.
10703
3ea5f0ec
PE
10704 * bootstrap: Add stdio-safer, unistd-safer modules.
10705 Remove m4/glibc2.m4 (introduced by latest gnulib, but
10706 we don't need it).
10707 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
10708 fopen-safer.c, stdio-safer.h, unistd-safer.h.
10709 * lib/subpipe.c: Include "unistd-safer.h".
10710 (create_subpipe): Make sure all the newly-created
10711 file descriptors are > 2, so that diagnostics don't
10712 get sent down them (which might cause Bison to hang, in theory).
10713 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
10714 * src/files.c (xfopen): Use fopen_safer, not fopen.
10715
51c30d21
PE
10716 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
10717 yesterday's yacc.c fix.
10718
cea1469d
PE
107192005-05-21 Paul Eggert <eggert@cs.ucla.edu>
10720
3ea5f0ec
PE
10721 * data/glr.c, data/lalr1.cc: Update copyright date.
10722
cea1469d
PE
10723 Fix a destructor bug reported by Wolfgang Spraul in
10724 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
10725 * data/yacc.c (yyabortlab): Don't call destructor, and
10726 don't set yychar to EMPTY.
10727 (yyoverflowlab): Don't call destructor.
10728 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
10729 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
10730 since we no longer output the message "discarding lookahead token
10731 end of input ()".
10732
5e6f62f2
PH
107332005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10734
10735 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
10736 fix a small glitch in debugging output.
10737 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
10738 after YY_SYMBOL_PRINT where needed.
10739
10740 (struct yyGLRState): Add some comments.
10741 (struct yySemanticOption): Add some comments.
10742 (union yyGLRStackItem): Add comment.
10743
10744 (yymergeOptionSets): Correct this to properly perform the union,
10745 avoiding infinite reported by Michael Rosien.
10746 Update comment.
10747
10748 * tests/glr-regression.at: Add test for GLR merging error reported
10749 by M. Rosien.
cea1469d 10750
0fb669f9
PE
107512005-05-13 Paul Eggert <eggert@cs.ucla.edu>
10752
10753 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
10754 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
10755 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
10756 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
10757 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
10758 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
10759 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
10760 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
10761 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
10762 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
10763 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
10764 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
10765 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
10766 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
10767 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
10768 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
10769 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
10770 src/derives.h, src/files.c, src/files.h, src/getargs.c,
10771 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
10772 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
10773 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
10774 src/output.h, src/parse-gram.c, src/parse-gram.h,
10775 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
10776 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
10777 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
10778 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
10779 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
10780 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
10781 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
10782 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
10783 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
10784 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
10785 tests/reduce.at, tests/regression.at, tests/sets.at,
10786 tests/synclines.at, tests/testsuite.at, tests/torture.at:
10787 Update FSF postal mail address.
10788
51f4735e
PE
107892005-05-11 Paul Eggert <eggert@cs.ucla.edu>
10790
10791 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
10792 Problem reported by Ralf Menzel.
10793
80ce3401
PE
107942005-05-01 Paul Eggert <eggert@cs.ucla.edu>
10795
10796 * tests/actions.at: Test that stack overflow invokes destructors.
10797 From Marcus Holland-Moritz.
10798 * data/yacc.c (yyerrlab): Move the code that destroys the stack
10799 from here....
10800 (yyreturn): to here. That way, destructors are called properly
10801 even if the stack overflows, or the user calls YYACCEPT or
10802 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
10803 (yyoverflowlab): Destroy the lookahead.
10804
108052005-04-24 Paul Eggert <eggert@cs.ucla.edu>
10806
10807 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
10808
72f000b0
PE
108092005-04-17 Paul Eggert <eggert@cs.ucla.edu>
10810
10811 * NEWS: Bison-generated C parsers no longer quote literal strings
10812 associated with tokens.
10813 * src/output.c (prepare_symbols): Don't escape strings,
10814 since users don't want to see C escapes.
10815 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
10816 in diagnostics.
c19683bb 10817 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
10818 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
10819
1094323f
PE
108202005-04-16 Paul Eggert <eggert@cs.ucla.edu>
10821
10822 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
10823 the data size is known to be too small and we can't increase it.
10824 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
10825
ca407bdf
PE
108262005-04-15 Paul Eggert <eggert@cs.ucla.edu>
10827
10828 * src/parse-gram.y: Include quotearg.h.
10829 (string_as_id): Quote $1 before using it as a key, since the
10830 lexer no longer quotes it for us.
10831 (string_content): Don't strip quotes, since lexer no longer
10832 quotes it for us.
10833 * src/scan-gram.l: Include quotearg.h.
10834 ("\""): Omit quote.
10835 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
10836 a key, since the rest of the lexer doesn't quote it.
10837 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
10838 * tests/regression.at (Token definitions): Check for backslashes
10839 in token strings.
10840
10841 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
10842 (YYSIZE_T): Define to unsigned long int when using an older compiler.
10843 (yyparse): Revamp code to generate long syntax error message, to
10844 make it easier to translate, and to avoid problems with arithmetic
10845 overflow. Change "virtual memory" to "memory" in diagnostic, since
10846 we don't know whether the memory is virtual.
10847
1ce59070
PE
108482005-04-13 Paul Eggert <eggert@cs.ucla.edu>
10849
10850 * NEWS: Bison-generated C parsers now use the _ macro to
10851 translate strings.
10852 * data/yacc.c (_) [!defined _]: New macro.
10853 All English strings wrapped inside this macro.
10854 * doc/bison.texinfo (Bison Parser): Document _.
10855 * po/POTFILES.in: Include src/parse-gram.c, since it now
10856 includes translateable strings that parse-gram.y doesn't.
10857
a749a695
PE
108582005-04-12 Paul Eggert <eggert@cs.ucla.edu>
10859
10860 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
10861 reverting the 2004-10-11 change to this function.
10862 (symbol_check_alias_consistency): Don't call symbol_type_set
10863 if the type name is already correct.
10864 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
10865
8fb1053b
PE
108662005-03-25 Paul Eggert <eggert@cs.ucla.edu>
10867
10868 * tests/regression.at (Token definitions): Don't use a token named
10869 c, as that generates a "#define c ..." that runs afoul of buggy
10870 stdlib.h that uses the identifier c as a member of struct
10871 drand48_data. Problem reported by Horst Wente.
10872
ff498c4a
PE
108732005-03-21 Paul Eggert <eggert@cs.ucla.edu>
10874
10875 * bootstrap: Change translation URL from
10876 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
10877 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
10878 redirection glitches. Problem reported by twlevo@xs4all.nl.
10879
65211d70
PE
108802005-03-20 Paul Eggert <eggert@cs.ucla.edu>
10881
10882 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
10883 after operands; POSIX says this isn't portable for the c99 command.
10884
9577fb1f
PE
108852005-03-18 Paul Eggert <eggert@cs.ucla.edu>
10886
10887 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
10888 immediately if a data overrun has occurred; this may help us track
10889 down what may be a spurious failure on MacOS.
10890
78b178f7
PE
108912005-03-17 Paul Eggert <eggert@cs.ucla.edu>
10892
a2599d0f
PE
10893 Respond to problems reported by twlevo@xs4all.nl.
10894
10895 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
10896
78b178f7
PE
10897 * src/vcg.h: Comment fix.
10898 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
10899 (G_CMAX): Change to -1 instead of INT_MAX.
10900
10901 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 10902
7296e729
PE
109032005-03-15 Paul Eggert <eggert@cs.ucla.edu>
10904
10905 * src/tables.c (state_number_to_vector_number): Put it inside an
10906 "#if 0", since it's not currently used. Problem reported by
10907 Roland McGrath.
10908
05ac60f3
PE
109092005-03-06 Paul Eggert <eggert@cs.ucla.edu>
10910
10911 * src/output.c (escaped_output): Renamed from
10912 escaped_file_name_output, since we now use it for symbol tags as
10913 well. All uses changed.
10914 (symbol_destructors_output, symbol_printers_output):
10915 Escape symbol tags too.
10916 Problem reported by Matyas Forstner in
10917 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
10918
10919 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
10920 not needed.
10921 * src/output.c (user_actions_output, token_definitions_output,
10922 symbol_destructors_output, symbol_printers_output): Likewise.
10923 * src/reader.c (prologue_augment): Likewise.
10924 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
10925
10926 * src/vcg.c (output_edge): Don't quote linestyle arg.
10927 Problem reported by twlevo@xs4all.nl.
10928
7eb453ac
PE
109292005-02-28 Paul Eggert <eggert@cs.ucla.edu>
10930
10931 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
10932 example, reported by Derek M Jones. Also, make the example even
10933 more outrageous, to better illustrate how bad the problem is.
10934
4c04c52a
PE
109352005-02-24 Paul Eggert <eggert@cs.ucla.edu>
10936
10937 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
10938 putsym. Typo reported by Sebastian Piping.
10939
a61e1620
PE
109402005-02-23 Paul Eggert <eggert@cs.ucla.edu>
10941
10942 * doc/bison.texinfo (Language and Grammar): some -> same
10943 (Epilogue): int he -> in the
10944 Typos reported by Sebastian Piping via Justin Pence.
10945
9ec93868
PE
109462005-02-07 Paul Eggert <eggert@cs.ucla.edu>
10947
10948 * tests/glr-regression.at (Improper handling of embedded actions
10949 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
10950 embedded actions and $-N in GLR parsers", work around an Autoconf bug
10951 with dollar signs in test names.
10952 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
10953 for a similar reason.
10954
73ce7e7e
PE
109552005-01-28 Paul Eggert <eggert@cs.ucla.edu>
10956
10957 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
10958 wants to redefine G_VIEW.
10959
2e72b98e
PE
109602005-01-27 Paul Eggert <eggert@cs.ucla.edu>
10961
10962 * src/vcg.c (get_view_str): Remove case for normal_view.
10963 Problem reported by twlevo@xs4all.nl.
10964
e0d634e5
PE
109652005-01-24 Paul Eggert <eggert@cs.ucla.edu>
10966
ccf830a4
PE
10967 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
10968 Problem reported by twlevo@xs4all.nl.
10969
e0d634e5
PE
10970 * doc/bison.texinfo: Change @dircategory from "GNU programming
10971 tools" to "Software development". Requested by Richard Stallman
10972 via Karl Berry.
10973
7bbc8cb0
PE
109742005-01-23 Paul Eggert <eggert@cs.ucla.edu>
10975
10976 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
10977 Problem reported by twlevo@xs4all.nl.
10978
08b770bc
PE
109792005-01-21 Paul Eggert <eggert@cs.ucla.edu>
10980
10981 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
10982 keyword; it's not needed with modern compilers, and it doesn't
10983 affect correctness with older compilers. Suggested by
10984 twlevo@xs4all.nl.
10985
95f22ad2
PE
109862005-01-17 Paul Eggert <eggert@cs.ucla.edu>
10987
10988 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
10989 gcc -Wswitch-default.
10990 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
10991 * data/yacc.c (yyparse): Likewise.
10992
d229d15c
PE
109932005-01-12 Paul Eggert <eggert@cs.ucla.edu>
10994
10995 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
10996 already. Let config.h define any nonstandard values.
10997
ecadd90f
PE
109982005-01-10 Paul Eggert <eggert@cs.ucla.edu>
10999
11000 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
11001 for the benefit of slower hosts. Problem reported by
11002 Nelson H. F. Beebe.
11003
213744b5
PE
110042005-01-07 Paul Eggert <eggert@cs.ucla.edu>
11005
11006 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
11007 being defined and not used.
11008 * data/lalr1.cc (yyparse): Likewise.
11009 Use "if (false)" rather than "if (0)".
11010
249d3236
PE
110112005-01-05 Paul Eggert <eggert@cs.ucla.edu>
11012
11013 * TODO: Mention that we should allow NUL bytes in tokens.
11014
987cc1fb
PE
110152005-01-02 Paul Eggert <eggert@cs.ucla.edu>
11016
11017 * src/scan-skel.l (<<EOF>>): Don't close standard output.
11018 Problem reported by Hans Aberg.
11019
08fe02d9
PE
110202005-01-01 Paul Eggert <eggert@cs.ucla.edu>
11021
11022 * src/getargs.c (version): Happy new year; update overall
11023 program copyright date from 2004 to 2005.
11024
11025 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
11026 Problem reported by Hans Aberg.
11027 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
11028 (Output file names.): Add a test for the case when standard output
11029 is closed.
11030
010c0266
PE
110312004-12-26 Paul Eggert <eggert@cs.ucla.edu>
11032
11033 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
11034 to fix an oversight in the Bison 2.0 manual.
11035
da12206a
PE
110362004-12-25 Paul Eggert <eggert@cs.ucla.edu>
11037
11038 * NEWS: Version 2.0. Reformat the existing news items since
11039 1.875, so that related items are grouped together.
3a4734aa 11040 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
11041 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
11042
c935d934
PE
11043 * tests/torture.at (Exploding the Stack Size with Alloca): Set
11044 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
11045 otherwise, we're not testing alloca. Unfortunately there's no
11046 simple way to consult HAVE_ALLOCA here.
11047
da12206a
PE
11048 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
11049 for yymsg, too.
11050
11051 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
11052 hand. This avoids a warning about comparing int to size_t when
11053 GCC warnings are enabled.
11054
0a2c5137
PE
110552004-12-22 Paul Eggert <eggert@cs.ucla.edu>
11056
d7e14fc0
PE
11057 * NEWS: Bison-generated parsers no longer default to using the
11058 alloca function (when available) to extend the parser stack, due
11059 to widespread problems in unchecked stack-overflow detection.
11060 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
11061 responsibility to set it to a positive value. This lets the user
11062 specify a value that is not a preprocessor constant.
11063 * data/yacc.c (YYMAXDEPTH): Likewise.
11064 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
11065 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
11066 to be a compile-time constant. However, explain the constraints on it.
11067 Also, explain the constraints on YYINITDEPTH.
11068 (Table of Symbols): Explain that alloca is no longer the default.
11069 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
11070 to 1.
11071
0a2c5137
PE
11072 * doc/bison.texinfo (Location Default Action): Mention that n must
11073 be zero when k is zero. Suggested by Frank Heckenbach.
11074
e019c247
AD
110752004-12-22 Akim Demaille <akim@epita.fr>
11076
11077 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
11078 (parser::state_type, parser::semantic_type, parser::location_type):
11079 Private, not public.
11080 (parser::parse): Return ints, not bool.
11081 Returning a bool introduces a problem: 0 corresponds to false, and
11082 it seems weird to return false on success. Returning true changes
11083 the conventions for yyparse.
11084 Alternatively we could return void and send an exception.
11085 There is no clear consensus (yet?).
11086 (state_stack, semantic_stack, location_stack): Rename as...
11087 (state_stack_type, semantic_stack_type, location_stack_type): these.
11088 Private, not public.
11089 * tests/c++.at: New.
11090 * tests/testsuite.at, tests/Makefile.am: Adjust.
11091
72731bb7
AD
110922004-12-21 Akim Demaille <akim@epita.fr>
11093
11094 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
11095
9a0d8bec
AD
110962004-12-21 Akim Demaille <akim@epita.fr>
11097
11098 Don't impose std::string for filenames.
11099
11100 * data/lalr1.cc (b4_filename_type): New.
11101 (position::filename): Use it.
11102 (parser.hh): Move the inclusion of stack.hh and location.hh below
11103 the user code, so that needed headers for the filename type can be
11104 included first.
72731bb7
AD
11105 Forward declare them before the user code.
11106 * tests/Makefile.am (check-local, installcheck-local): Pass
11107 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 11108
99880de5
AD
111092004-12-20 Akim Demaille <akim@epita.fr>
11110
11111 Use more STL like names: my_class instead of MyClass.
11112
11113 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
11114 (SemanticStack, SemanticType, StateStack, StateType)
11115 (TokenNumberType, Stack, Slice, Traits, Parser::location)
11116 (Parser::value): Rename as...
11117 (location_stack, location_type, rhs_number_type, semantic_stack)
11118 (semantic_type, state_stack, state_type, token_number_type, stack)
11119 (slice, traits, parser::yylloc, parser::yylval): these.
11120
11121 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
11122
9bec482e
PE
111232004-12-19 Paul Eggert <eggert@cs.ucla.edu>
11124
11125 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
11126 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
11127
f6fbd3da
PE
111282004-12-17 Paul Eggert <eggert@cs.ucla.edu>
11129
11130 Remove uses of 'short int' and 'unsigned short int'. This raises
11131 some arbitrary limits. It uses more memory but nowadays that's
11132 not much of an issue.
11133
11134 This change does not affect the generated parsers; that's a different
11135 task, as some users will want to conserve memory there.
11136
11137 Ideally we should use size_t to represent all object counts, and
11138 something like ptrdiff_t to represent signed differences of object
11139 counts; but that will require more code-cleanup than I have the
11140 time to do right now.
11141
11142 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
11143 Use size_t, not int or short int, to count objects.
11144 * src/closure.c (nritemset, closure): Likewise.
11145 * src/closure.h (nritemset, closure): Likewise.
11146 * src/nullable.c (nullable_compute): Likewise.
11147 * src/print.c (print_core): Likewise.
11148 * src/print_graph.c (print_core): Likewise.
11149 * src/state.c (state_compare, state_hash): Likewise.
11150 * src/state.h (struct state): Likewise.
11151 * src/tables.c (default_goto, goto_actions): Likewise.
11152
11153 * src/gram.h (rule_number, rule): Use int, not short int.
11154 * src/output.c (prepare_rules): Likewise.
11155 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
11156 errs, reductions): Likewise.
11157 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
11158 Likewise.
11159 * src/tables.c (vector_number, tally, action_number,
11160 ACTION_NUMBER_MINIMUM): Likewise.
11161 * src/output.c (muscle_insert_short_int_table): Remove.
11162
efeed023
AD
111632004-12-17 Akim Demaille <akim@epita.fr>
11164
11165 * data/lalr1.cc: Extensive Doxygenation.
11166 (error_): Rename as...
11167 (error): this, since it is visible to the user.
11168 Adjust callers.
11169 (Parser::message): Now an automatic variable from...
11170 (Parser::yyreport_syntax_error_): here.
11171 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
11172 Parser::error.
11173 * tests/input.at: Escape $.
11174
bc82c5a5
PE
111752004-12-16 Paul Eggert <eggert@cs.ucla.edu>
11176
11177 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
11178 Parenthesize rhs to avoid obscure problems with mistakes like
11179 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
11180 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
11181 b4_rhs_location): Likewise.
11182 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
11183 b4_rhs_location): Likewise.
11184
fd19f271
AD
111852004-12-16 Akim Demaille <akim@epita.fr>
11186
11187 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
11188 yacc.c: be sure to stay within yycheck_.
11189 * tests/actions.at: Re-enable C++ tests.
11190
10454ea4
AD
111912004-12-16 Akim Demaille <akim@epita.fr>
11192
11193 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
11194 real.
11195
c5b95ccf
AD
111962004-12-16 Akim Demaille <akim@epita.fr>
11197
11198 Use #define to handle the %name-prefix.
11199
11200 * data/glr.c, data/yacc.c: Comment changes.
11201 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
11202 so that one can refer to yylex in the parser file, and have it
11203 renamed, as is the case with other skeletons.
11204
617a8f12
AD
112052004-12-16 Akim Demaille <akim@epita.fr>
11206
11207 Move lalr1.cc internals into yy*.
11208
11209 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
11210 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
11211 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
11212 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
11213 (empty_, final_, terror_, errcode_, ntokens_)
11214 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
11215 (looka_, ilooka_, error_range_, nerrs_):
11216 Rename as...
11217 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
11218 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
11219 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
11220 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
11221 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
11222 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
11223 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
11224 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
11225 these.
11226
1e547e6e
PE
112272004-12-15 Paul Eggert <eggert@cs.ucla.edu>
11228
11229 Fix some problems reported by twlevo at xs4all.
11230 * src/symtab.c (symbol_new): Report an error if the input grammar
11231 contains too many symbols. This is better than calling abort() later.
11232 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
11233 (struct node, struct graph):
11234 Rename member expand to stretch. All uses changed.
11235 (struct graph): Remove member layoutalgorithm. All uses removed.
11236 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
11237 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
11238 All uses changed.
11239 (N_STRETCH): Rename from N_EXPAND. All uses changed.
11240
735d6bd4
AD
112412004-12-15 Akim Demaille <akim@epita.fr>
11242
11243 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
11244 Add more Doxygen comments.
11245 (symprint_, stack_print_, reduce_print_, destruct_, pop)
11246 (report_syntax_error_, translate_): Rename as...
11247 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
11248 (yypop_, yyreport_syntax_error_, yytranslate_): this.
11249
2e1f5829
AD
112502004-12-15 Akim Demaille <akim@epita.fr>
11251
11252 * data/lalr1.cc (lex_): Rename as...
11253 (yylex_): this.
11254 Move the trace here.
11255 Take the %name-prefix into account.
11256 Reported by Alexandre Duret-Lutz.
11257
a3cb6248
AD
112582004-12-15 Akim Demaille <akim@epita.fr>
11259
11260 Simplify the C++ parser constructor.
11261
11262 * data/lalr1.cc (debug_): Rename as...
11263 (yydebug_): so that the parser's internals are always in the yy*
11264 pseudo namespace.
11265 Adjust uses.
11266 (b4_parse_param_decl): Remove the leading comma as it is now only
11267 called as unique argument list.
11268 (Parser::Parser): Remove the constructor accepting a location and
11269 an initial debugging level.
11270 Remove from the other ctor the argument for the debugging level.
11271 (debug_level_type, debug_level, set_debug_level): New.
11272
11273 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
11274 constructor calls.
11275
07fed891
AD
112762004-12-15 Akim Demaille <akim@epita.fr>
11277
11278 Remove b4_root related material: failure experiment
a3cb6248 11279 (which goal was to allow to derive from a class).
07fed891
AD
11280
11281 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
11282 definitions and uses.
11283
e603eaa5
PE
112842004-12-14 Paul Eggert <eggert@cs.ucla.edu>
11285
11286 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
11287 not 2, since it's not portable to subtract 1 from the start of an
11288 array. The new item 0 is never set or used. All uses changed.
11289
11290 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
11291 the default definition of YYLLOC_DEFAULT. Problem reported
11292 by Frank Heckenbach.
11293
fafb007d
PE
112942004-12-12 Paul Eggert <eggert@cs.ucla.edu>
11295
11296 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
11297 the normal case and one for the error case. Just use the
11298 first one uniformly. Problem reported by Frank Heckenbach.
11299 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
11300 use exactly the same macro in both places.
11301 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
11302 so that the normal-case YYRHSLOC works for the error case too.
11303 All uses changed.
11304 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
11305 (YYLLOC_DEFAULT): Use the same macro as glr.c.
11306 * doc/bison.texinfo (Location Default Action): Don't claim that
11307 we have an array of locations. Use the same macro for both glr
11308 and lalr parsers. Mention YYRHSLOC. Mention what happens when
11309 the index is 0.
11310
48814dcd
PE
113112004-12-10 Paul Eggert <eggert@cs.ucla.edu>
11312
a4e1a53b
PE
11313 * HACKING: Update email addresses to send announcements to.
11314
48814dcd
PE
11315 * configure.ac (AC_INIT): Bump version to 1.875f.
11316
337116ba
PE
113172004-12-10 Paul Eggert <eggert@cs.ucla.edu>
11318
11319 * NEWS: Version 1.875e.
11320 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
11321
11322 * src/scan-skel.l: Include "complain.h", for "fatal".
11323
11324 * src/relation.h (relation_print, relation_digraph):
11325 Relation sizes are of type relation_node, not size_t (this is
11326 merely a doc fix, since the two types are equivalent).
11327 (relation_transpose): Relation sizes are of type relation_node,
11328 not int.
11329 * src/relation.c: Likewise.
11330 (top, infinity): Now of type relation_node, not int.
11331 (traverse, relation_transpose): Use relation_node, not int.
11332
11333 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
11334 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
11335 (yyparse): Remove unused local introduced in 2004-10-25 patch.
11336
11337 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 11338 specifying whether the test should be skipped. Use it tp
337116ba 11339 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 11340 fail on some hosts, and should be skipped.
337116ba 11341
da2a7671
PE
113422004-12-08 Paul Eggert <eggert@cs.ucla.edu>
11343
11344 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
11345 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
11346 unless otherwise specified below.
11347
11348 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
11349 to allocate kernel_base, kernel_items, kernel_size, since
11350 they needn't be initialized to 0.
11351 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
11352 * src/closure.c (new_closure): Likewise, for itemset.
11353 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
11354 * src/lalr.c (set_goto_map): Likewise, for temp_map.
11355 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
11356 (build_relations): Likewise for edge, states1, includes.
11357 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
11358 * src/reader.c (packgram): Likewise, for ritem, rules.
11359 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
11360 * src/relation.c (relation_digraph): Likewise for VERTICES.
11361 (relation_transpose): Likewise for new_R, end_R.
11362 * src/symtab.c (symbols_token_translations_init): Likewise for
11363 token_translations.
11364 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
11365 (token_actions): Likewise for yydefact, actrow, conflrow,
11366 conflict_list.
11367 (save_column): Likewise for froms[symno], tos[symno].
11368 (goto_actions): Likewise for state_count.
11369 (pack_table): Likewise for base, pos, check.
11370 (tables_generate): Likewise for width.
11371
11372 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
11373 for initial core. Just have a separate core, so we needn't worry
11374 about whether kernel_size and kernel_base are initialized.
11375
11376 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
11377 kernel_size, kernel_items): Remove unnecessary initialization.
11378 * src/conflicts.c (conflicts): Likewise.
11379 * src/derives.c (derives): Likewise.
11380 * src/muscle_tablc (muscle_insert): Likewise.
11381 * src/relation.c (relation_digraph): Likewise.
11382 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
11383 conflrow, conflict_table, conflict_list, table, check):
11384 Likewise.
11385
11386 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
11387 This is because all callers pass unsigned int.
11388 * src/closure.h (new_closure): Likewise.
11389
11390 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
11391 (build_relations): Initialize includes[i] in all cases.
11392 * src/reader.c (packgram): Always initialize rules[ruleno].prec
11393 and rules[ruleno].precsym. Initialize members in order.
11394 * src/relation.c (relation_transpose): Always initialize new_R[i]
11395 and end_R[i].
11396 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
11397
11398 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
11399 conflict_list[0] was always 0, but now it isn't initialized.
11400
11401 * src/table.c (table_grow): When conflict_table grew, the grown
11402 area wasn't cleared. Fix this.
11403
11404 * lib/.cvsignore: Add strdup.c, strdup.h.
11405 * m4/.cvsignore: Add strdup.m4.
11406
00baeeac
PE
114072004-12-07 Paul Eggert <eggert@cs.ucla.edu>
11408
11409 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
11410 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
11411 GOTO_NUMBER_MAXIMUM, since we occasionally compute
11412 ngotos + 1 without checking for overflow.
11413 (build_relations): Use END_NODE, not -1, to denote end of edges.
11414 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
11415 build_relations): Use goto_number, not int, for goto numbers.
11416 * src/tables.c (save_column, default_goto): Likewise.
11417
be3d9d42
AD
114182004-11-23 Akim Demaille <akim@epita.fr>
11419
11420 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
11421 of #defining from yystype.
11422 Don't typedef yystype, C++ does not need it.
11423 This lets it possible to forward declare it as union.
11424
78e526d5
PE
114252004-11-23 Paul Eggert <eggert@cs.ucla.edu>
11426
11427 * bootstrap (gnulib_modules): Add extensions.
11428 Problem reported by Jim Meyering.
11429
afbb696d
PE
114302004-11-22 Paul Eggert <eggert@cs.ucla.edu>
11431
11432 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
11433 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
11434 src/system.h, src/tables.c: XFREE -> free, to accommodate
11435 recent change to gnulib xalloc.h.
78e526d5 11436 Problem reported by Jim Meyering.
afbb696d 11437
c1f8f16a
AD
114382004-11-17 Akim Demaille <akim@epita.fr>
11439
11440 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
11441
db7e5eb5 114422004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
11443 Alexandre Duret-Lutz <adl@gnu.org>
11444
11445 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
11446 changes.
11447 (YYCDEBUG): Adjust.
11448 Use it instead of cdebug_.
11449 (Parser::debug_stream, Parser::set_debug_stream): New.
11450 (Parser::symprint_): Define cdebug_ for temporary backward
11451 compatibility.
11452 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
11453 debug_stream ().
11454
68e11668
AD
114552004-11-17 Akim Demaille <akim@epita.fr>
11456
11457 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
11458 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
11459 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
11460 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
11461
97cbc73e
PE
114622004-10-27 Paul Eggert <eggert@cs.ucla.edu>
11463
11464 * data/glr.c (yyloc_default): Remove; not used.
11465 Problem reported by Frank Heckenbach.
11466
e342c3be
AD
114672004-10-25 Akim Demaille <akim@epita.fr>
11468
11469 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
11470 Introduce another definition to address simple location arrays.
11471 (yyGLRStack): New member: yyerror_range.
11472 (yyrecoverSyntaxError, yyparse): Update it.
11473 (yyrecoverSyntaxError): Use it when shifting the error token to
11474 have an accurate range, equivalent to the one computed by both
11475 yacc.c and lalr1.cc.
11476 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
11477 that column numbers start at column 0, as per GNU Coding
11478 Standards, the others tests, and the doc.
11479 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
11480 Adjust to the above change (first column is 0).
11481 And adjust the location of the "<error>", now covering the whole
11482 line.
11483
93602feb 114842004-10-22 Akim Demaille <akim@epita.fr>
04098407 11485 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
11486
11487 Remove some arbitrary limits on goto numbers and relations.
11488 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
11489 initial values, since they're never used.
11490 (set_goto_map): ngotos is now unsigned, so test for overflow
11491 by seeing whether it wraps around to zero.
11492 * src/lalr.h (goto_number): Now size_t, not short int.
11493 (GOTO_NUMBER_MAXIMUM): Remove.
11494 * src/relation.c (relation_print, traverse, relation_transpose):
11495 Check for END_NODE rather than looking at sign.
11496 * src/relation.h (END_NODE): New macro.
11497 (relation_node): Now size_t, not short int.
11498
dba08b04
PE
114992004-10-22 Paul Eggert <eggert@cs.ucla.edu>
11500
11501 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
11502 keyword, not an identifier. Problem reported by Baron Schwartz in
11503 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
11504
df09ef2e
AD
115052004-10-11 Akim Demaille <akim@epita.fr>
11506
11507 * src/symtab.c (symbol_check_alias_consistency): Also check
11508 type names, destructors, and printers.
11509 Reported by Alexandre Duret-Lutz.
11510 Recode the handling of associativity and precedence in terms
11511 of symbol_precedence_set.
11512 Accept no redeclaration at all, not even equal to the previous
11513 value.
11514 (redeclaration): New.
11515 Use it to factor redeclaration complaints.
11516 (symbol_make_alias): Don't set the type of the alias, let
11517 symbol_check_alias_consistency do it as for other features.
11518 * src/symtab.h (symbol): Add new member prec_location, and
11519 type_location.
11520 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
11521 * tests/input.at (Incompatible Aliases): New.
11522
146bc99d
PE
115232004-10-09 Paul Eggert <eggert@cs.ucla.edu>
11524
11525 .cvsignore fixes to accommodate gnulib changes,
11526 and the practice of naming build directories "_build".
11527 * .cvsignore: Add "_*". Sort.
11528 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
11529 * m4/.cvsignore: Add "*_gl.m4".
11530
e503aa60
AD
115312004-10-06 Akim Demaille <akim@epita.fr>
11532
11533 * src/parse-gram.y (add_param): Fix the truncation of trailing
11534 spaces.
11535
b4a20338
AD
115362004-10-05 Akim Demaille <akim@epita.fr>
11537
11538 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
11539 whether the reducion was empty or not. This leaves room to
11540 improve the use of YYLLOC_DEFAULT in such a case.
11541 lalr1.cc is still experimental, so changing this is acceptable.
11542 And finally, there are probably not many users who changed the
11543 handling of locations in GLR, so changing is admissible too.
11544
11545 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
11546 empty reduction, set @$ to an empty location ending the previously
11547 stacked symbol.
11548 Adjust uses to make sure the code is triggered on empty
11549 reductions.
11550 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
11551 expected output: empty reductions have empty locations.
11552
f85a5e6f
AD
115532004-09-29 Akim Demaille <akim@epita.fr>
11554
11555 * data/lalr1.cc: Move towards a more standard C++ coding style
11556 for templates: Class < T > -> Class<T>.
11557
b203fc2c
AD
115582004-09-29 Akim Demaille <akim@epita.fr>
11559
11560 * data/lalr1.cc: Reinstall the former ctor, for sake of
11561 compatibility, but warn it will be removed.
11562 Move towards a more standard C++ coding style (i.e., type *var ->
11563 type* var).
11564
5b7e1e73
PE
115652004-09-27 Paul Eggert <eggert@cs.ucla.edu>
11566
3fee967f
PE
11567 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
11568 since it's less likely to work if NULs are involved in the future.
5b7e1e73 11569
0dcca5c2
AD
115702004-09-27 Akim Demaille <akim@epita.fr>
11571
11572 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
11573
6dde1c82
AD
115742004-09-27 Akim Demaille <akim@epita.fr>
11575
11576 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 11577 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
11578 and argument names.
11579 (b4_cc_constructor_call): Likewise.
11580
b233d555
AD
115812004-09-24 Akim Demaille <akim@epita.fr>
11582
11583 * src/parse-gram.y (add_param): Strip the leading and trailing
11584 blanks from a formal argument declaration.
11585 (YY_LOCATION_PRINT): New.
11586
619404e3
AD
115872004-09-24 Akim Demaille <akim@epita.fr>
11588
11589 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
11590 after the location.
11591
dd8d9022
AD
115922004-09-24 Akim Demaille <akim@epita.fr>
11593
11594 * doc/bison.texinfo (Table of Symbols): Sort.
11595
0092f063
AD
115962004-09-21 Akim Demaille <akim@epita.fr>
11597
11598 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
11599 the useless parentheses.
11600 Suggested by Paul Eggert.
11601
451364ed
AD
116022004-09-20 Akim Demaille <akim@epita.fr>
11603
11604 Let the initial-action act on the look-ahead, and use it for the
11605 "initial push" (corresponding to an hypothetical beginning-of-file).
11606 And let lalr1.cc honor %initial-action.
11607
11608 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
11609 example.
11610 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
11611 (Parser::Parser): Remove the ctor that used to initialize it.
11612 (Parser::parse): Like in the other skeletons, issue the "starting
11613 parse" message before any action.
11614 Honor %initial-action.
11615 Initialize the stacks with the lookahead.
11616 * data/yacc.c: Let $$ and @$ in %initial-action designate the
11617 look-ahead.
11618 Push them in the stacks.
11619 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
11620
18d192f0
AD
116212004-09-20 Akim Demaille <akim@epita.fr>
11622
11623 * doc/bison.texinfo (Initial Action Decl): New.
11624
b8458aa5
AD
116252004-09-20 Akim Demaille <akim@epita.fr>
11626
11627 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
11628 clearer criterion to define it.
11629 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
11630 When reducing on an empty RHS, use the latest stacked location as
11631 location.
11632 yylloc is not always available.
11633 * data/glr.c: Likewise.
11634 Also, honor initial-actions.
11635
3fc16193
AD
116362004-09-20 Akim Demaille <akim@epita.fr>
11637
11638 * data/yacc.c (YY_LOCATION_PRINT): New.
11639 Define when we know YYLTYPE's structure, i.e., when the default
11640 YYLLOC_DEFAULT is used.
11641 * data/c.m4 (b4_yysymprint_generate): Use it.
11642 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
11643 value of the result.
11644 (error_start_): Replace with...
11645 (error_range_): this location array.
11646 This allows to replace code relying on the implementation of
11647 locations by portable code.
11648 * data/yacc.c (yylerrsp): Replace with...
11649 (yyerror_range): this.
11650 Every time a token is popped, update yyerror_range[0], to have an
11651 accurate location for the error token.
11652 * data/glr.c (YY_LOCATION_PRINT): New.
11653 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
11654 deference a pointer.
11655 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
11656 report the location in %printers.
11657
11658 * src/scan-skel.l: Instead of abort, report error messages to ease
11659 understanding skeleton scanning failures.
11660
ecfe33e7
AD
116612004-09-16 Akim Demaille <akim@epita.fr>
11662
11663 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
11664 (iterator, const_iterator): these, to be more in the C++ spirit.
11665 Also, return reverse iterators so that when displaying the stack
11666 we display its bottom first.
11667 (Parser::stack_print_, Parser::reduce_print_): Match the messages
11668 from yacc.c.
11669 We should probably use vector here though.
11670
1576d44d
AD
116712004-09-16 Akim Demaille <akim@epita.fr>
11672
11673 Have more complete shift traces.
11674
11675 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
11676 to report Shifts instead of ad hoc YYDPRINTF invocations,
11677 including for the error token.
11678 * data/lalr1.cc (symprint_): Output the location.
11679 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
11680 output the location within the %printer.
11681 Activate GLR tests, at least to make sure they compile properly.
11682 They still don't pass though.
11683 * tests/calc.at: Adjust expect verbose output, since now "Entering
11684 state..." is on a different line than the "Shifting" message.
11685
9c66f418
AD
116862004-09-08 Akim Demaille <akim@epita.fr>
11687
11688 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
11689 Bison directive from the Bison file to the invocation of this
11690 macro, so that these directives are passed to
11691 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
11692 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
11693 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
11694 the extra Bison directives instead of the whole series.
11695 Change the grammar so that there are recoverable errors, and
11696 unrecoverable errors. Now we can have the parser give up before
11697 consuming the whole input. As a result we now can observe that
11698 the lookahead is freed when needed.
11699 Change the parser source to parse argv[1] instead of a hard coded
11700 string.
11701 Simplify yylex, and give a value and location to EOF.
11702 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
11703 passed directives already coded in the file.
11704 Add some tests to check the location of "error".
11705 For some tests, the C++ parser is correct, and not yacc.c.
11706 For other tests, they provide different, but unsatisfying, values,
11707 so keep the C++ value so that at least one parser is "correct"
11708 according to the test suite.
11709 (Actions after errors): Remove, this is subsumed by the
11710 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
11711
52d5733f
AD
117122004-09-06 Akim Demaille <akim@epita.fr>
11713
11714 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 11715 (Parser::pop): New.
52d5733f
AD
11716 Use it.
11717
a0e68930
AD
117182004-09-06 Akim Demaille <akim@epita.fr>
11719
11720 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
11721 argument, an informative message.
11722 Call YY_SYMBOL_PRINT.
11723 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
11724 * data/lalr1.cc (destruct_): Likewise.
11725 In addition, no longer depend on b4_yysymprint_generate and
11726 b4_yydestruct_generate to generate these functions, do it "by
11727 hand".
11728
e757bb10
AD
117292004-09-03 Akim Demaille <akim@epita.fr>
11730
11731 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
11732 invoked, yydestruct the lookahead.
11733 * tests/calc.at (Calculator $1): Update the expected lengths of
11734 traces: there is an added line for the discarded lookahead.
11735 * doc/bison.texinfo (Destructor Decl): Some rewording.
11736 Define "discarded" symbols.
11737
0fe1f06d
AD
117382004-09-02 Akim Demaille <akim@epita.fr>
11739
11740 * data/lalr1.cc (translate_, destruct_): No reason to be static.
11741
284acc8b
AD
117422004-09-02 Akim Demaille <akim@epita.fr>
11743
11744 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
11745 (YYDSYMPRINTF): Rename as...
11746 (YY_SYMBOL_PRINT): this.
11747 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
11748 two.
11749 Use it instead of direct symprint_ calls.
11750 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
11751 one.
11752
a5eb1ed2
AD
117532004-09-02 Akim Demaille <akim@epita.fr>
11754
b7c72fe1
AD
11755 * data/lalr1.cc (b4_yysymprint_generate): New.
11756 (symprint_): New member function, defined when YYDEBUG.
11757 Use it consistently instead of token/nterm debugging output by
11758 hand.
a5eb1ed2
AD
11759 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
11760 %printer calls to use cdebug_ when using lalr1.cc.
11761
417141dd
AD
117622004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
11763
11764 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
11765 with #ifdef YYDEBUG.
11766
2fa09258
AD
117672004-08-26 Akim Demaille <akim@epita.fr>
11768
11769 * doc/bison.texinfo (Implementing Loops): Rename as...
11770 (Implementing Gotos/Loops): this.
11771
9378b508
PE
117722004-08-13 Paul Eggert <eggert@cs.ucla.edu>
11773
11774 Adjust to latest gnulib.
11775 * bootstrap (gnulib_modules): Add xalloc-die.
11776 Set LC_ALL=C so that file names sort consistently.
11777 Prefer the gnulib copies of gettext.m4, glibc21.m4,
11778 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
11779 uintmax_t.m4, ulonglong.m4.
11780 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
11781 po.m4 since we are now using _gl.m4 instead.
11782
87a8ad5c
PE
117832004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
11784
11785 * src/scan-action.l: Remove. Scanning of semantic actions is
11786 handled in scan-gram.l.
11787
dca81a78
PE
117882004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
11789
11790 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
11791
11792 * src/location.h (struct): The file member is a uniqstr.
11793 (equal_boundaries): Use UNIQSTR_EQ for comparison.
11794
c9cbf7c5
PE
117952004-07-22 Paul Eggert <eggert@cs.ucla.edu>
11796
11797 Fix bug with non-%union parsers that have printers or destructors,
11798 which led to a Bison core dump. Reported by Peter Fales in
11799 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 11800
c9cbf7c5
PE
11801 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
11802 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
11803 not to our own type.
11804 * src/output.c (symbol_destructors_output, symbol_printers_output):
11805 Don't assume %union.
11806 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
11807 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
11808 UNION-FLAG. All callers changed.
11809 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
11810 Use type char, not unsigned int, when declaring an array of char;
11811 this lets us remove a cast.
11812 (Printers and Destructors): Add non-%union test cases.
11813
fa7e68c3
PE
118142004-06-21 Paul Eggert <eggert@cs.ucla.edu>
11815
11816 * doc/bison.texinfo: Minor editorial changes, mostly to the new
11817 GLR writeups. E.g., avoid frenchspacing and the future tense,
11818 change "lookahead" to "look-ahead", and change "wrt" to "with
11819 respect to".
2fa09258 11820
fa7e68c3
PE
118212004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11822
11823 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
11824 New sections, split off from the GLR Parsers section. Put the new
11825 Simple GLR Parser near the start of the GLR section, for clarity.
11826 Rewrite connective text.
11827
99a9344e
PE
118282004-06-21 Frank Heckenbach <frank@g-n-u.de>
11829
11830 * doc/bison.texinfo (Simple GLR Parsers): New section.
11831
8dd162d3
PE
118322004-06-21 Paul Eggert <eggert@cs.ucla.edu>
11833
11834 * NEWS, TODO, doc/bison.texinfo:
11835 Use "look-ahead" instead of "lookahead", to be consistent.
11836 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
11837 while we're fixing "look-ahead".
11838 * src/conflicts.c (shift_set): Renamed from shiftset.
11839 (look_ahead_set): Renamed from lookaheadset.
11840 * src/print.c: Likewise.
11841 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
11842 name for "lookahead".
11843 (report_types, usage): Likewise.
11844 * src/getargs.h (report_look_ahead_tokens): Renamed from
11845 report_lookaheads.
11846 * src/lalr.c (compute_look_ahead_tokens): Renamed from
11847 compute_lookaheads.
11848 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
11849 (look_ahead_tokens_print): Renamed from lookaheads_print.
11850 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
11851 state_rule_lookaheads_print.
11852 * src/state.h: Likewise.
11853 (reductions.look_ahead_tokens): Renamed from lookaheads.
11854 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
11855 AT_DATA_LOOKAHEADS_GRAMMAR.
11856
57a90331
PE
118572004-06-03 Paul Eggert <eggert@cs.ucla.edu>
11858
11859 * README: Update location of patched M4 distribution.
11860
8ed3234a
PE
118612004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
11862
11863 Don't assume the C++ compiler takes the same arguments as the C compiler
11864 (trivial change).
11865 * configure.ac (O0CXXFLAGS): New var.
11866 * tests/atlocal.in (CXXFLAGS): Use it.
11867
07971983
PE
118682004-05-29 Paul Eggert <eggert@cs.ucla.edu>
11869
11870 Fix some "make check" problems with C++ reported by
11871 Albert Chin-A-Young for Tru64 C++ in this thread:
11872 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
11873
11874 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
11875 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11876 Output to a .cc file for C++, not to a .c file.
11877 * tests/calc.at (AT_CHECK_CALC): Likewise.
11878 * tests/regression.at (AT_CHECK_DANCER): Likewise.
11879 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
11880
29058652
PE
118812004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
11882
11883 * tests/calc.at, tests/actions.at: Workaround for SGI
11884 C++ compiler. (trivial change)
11885
62cb8a99
PE
118862004-05-27 Paul Eggert <eggert@cs.ucla.edu>
11887
fd418816
PE
11888 Spent a few hours checking out which prerequisite versions the
11889 current sources actually require. I went all the way back to
11890 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
11891 a seemingly endless set of combinations of versions more recent
11892 than that. The bottom line is that the current sources require
11893 fairly recent versions of the build tools, and it'll be some work
11894 to change this.
11895 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
11896 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
11897 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
11898 Add comments explaining why those particular versions are
11899 currently needed.
2fa09258 11900
62cb8a99
PE
11901 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
11902 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 11903 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
11904
11905 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
11906 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
11907
caa52c10
PE
119082004-05-26 Paul Eggert <eggert@cs.ucla.edu>
11909
11910 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
11911 0.11.5. Suggested by Bruno Haible.
11912 * bootstrap: Remove gettext version checking.
11913
11914 * doc/bison.texinfo (Decl Summary): Also mention that %union
11915 can depend on prerequisite types. Problem reported by Tim
11916 Van Holder.
11917
4bfd5e4e
PE
119182004-05-25 Paul Eggert <eggert@cs.ucla.edu>
11919
2cef3017
PE
11920 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
11921 * README-alpha: Don't tell people not to package this.
11922
b9c85d5c
PE
11923 * bootstrap: Don't assume $(...) works; use `...` instead.
11924 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
11925 gettext better.
11926
4bfd5e4e
PE
11927 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
11928 put into the -d output file, and mention what to do if YYSTYPE is
11929 defined as a macro.
11930
6a36ff94
PE
119312004-05-24 Paul Eggert <eggert@cs.ucla.edu>
11932
6712933e
PE
11933 Undo change made earlier today: it caused autopoint to not bring
11934 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
11935 autopoint's.
11936
11937 * bootstrap: Check that gettext version matches what's in
11938 configure.ac. Warn users to ignore robots.txt ERROR 404.
11939 * bootstrap: Undo today's earlier change (logged below).
11940 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 11941
6a36ff94
PE
11942 The gettext version checking is causing more trouble than it's
11943 curing; remove it. Problem reported by Paul Hilfinger.
11944
11945 * bootstrap: Issue a warning that one can expect a message
11946 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
11947 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
11948
209ea708
PE
119492004-05-23 Paul Eggert <eggert@cs.ucla.edu>
11950
11951 Ensure that the C++ compiler used for testing actually works on a
11952 simple test program; if not, skip the C++-related tests. Problem
11953 reported by Vin Shelton in:
161a71f3 11954 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
11955
11956 * m4/cxx.m4: New file.
11957 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
11958 * tests/atlocal.in (BISON_CXX_WORKS): Add.
11959 * tests/local.at (AT_COMPILE_CXX): Use it.
11960
41ca2549
PE
119612004-05-21 Paul Eggert <eggert@cs.ucla.edu>
11962
383e69dc
PE
11963 * data/glr.c (yylloc): Output this macro even if locations are not
11964 being generated, as the GLR parser needs it even in that case.
11965 Problem reported by Troy A. Johnson
11966 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
11967
41ca2549
PE
11968 * configure.ac (AC_INIT): Update to 1.875e.
11969
e476c87d
PE
119702004-05-21 Paul Eggert <eggert@cs.ucla.edu>
11971
11972 * NEWS: Version 1.875d.
11973 * configure.ac (AC_INIT): Likewise.
11974 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
11975
11976 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
11977 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
11978 lalr1.cc runs afoul of the first, and the last two are no longer
11979 supported by GCC 3.4.0.
11980 * README: Mention GNU m4 1.4 or later; mention m4 patches.
11981 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
11982
233a88ad
PE
119832004-05-06 Paul Eggert <eggert@cs.ucla.edu>
11984
11985 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
11986 unsigned int, for compatibility with latest gnulib hash module.
11987 * src/state.c (state_hash, state_hasher): Likewise.
11988 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
11989 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 11990
12ffdd28
PE
119912004-05-03 Paul Eggert <eggert@cs.ucla.edu>
11992
11993 * NEWS: Unescaped newlines are no longer allowed in char & strings.
11994
11995 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
11996 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
11997 character and string literals.
11998 (unexpected_end): New function.
11999 (unexpected_eof): Use it.
12000 (unexpected_newline): New function.
12001 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
12002 actions.
e476c87d 12003
12ffdd28
PE
12004 * NEWS: Document %expect-rr.
12005
12006 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
12007 Fix typo by replacing $1 with $option.
12008 Remove more 'intl'-related files.
9668e2be 12009 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
12010
12011 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
12012 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
12013 strtoul.c.
12014 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
12015 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
12016 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
12017 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
12018 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
12019 * src/.cvsignore: Add *.output.
12020
12021 * src/parse-gram.y: Put copyright notice inside %{ %} so it
12022 gets copied to the output file.
e476c87d 12023
1f65350a
PE
120242004-04-28 Paul Eggert <eggert@twinsun.com>
12025
12026 Get files from the gnulib and po repositories, instead of relying
12027 on them being in our CVS. Upgrade to latest versions of gnulib
12028 and Automake.
12029
12030 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
12031 * bootstrap: Bootstrap from gnulib and po repositories.
12032 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
12033 * README-cvs: Document these changes. Remove version numbers from
12034 mentions of build tools, since they change so often. Mention Flex.
12035
12036 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
12037 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
12038 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
12039 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 12040 does this for us.
12ffdd28
PE
12041 (AC_ISC_POSIX): Remove; we no longer support this
12042 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
12043 (AC_HEADER_STDC): Remove: we now assume C89 or better.
12044 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
12045 Do not check for C89 headers, except for locale.h which is used
12046 by the Yacc library and must port to K&R hosts.
12047 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
12048 Do not check for C89 functions, except for setlocale which is
12049 used by the Yacc library.
12050 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
12051 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
12052 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
12053 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
12054 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
12055 AM_GNU_GETTEXT): Remove; now done by:
12056 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
12057 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
12058 for us.
12059
12060 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
12061 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
12062 Define to empty, as gnulib.mk will do the rest for us.
12063 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
12064 for us.
12065 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
12066 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
12067
12068 * src/files.c: Include gnulib's xstrndup.h.
12069
12070 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
12071 (REALLOC): Use xnrealloc, for likewise.
12072 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
12073 (strnlen, memrchr): Remove decls; functions no longer used.
12074 Include <stpcpy.h>.
12075
12076 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
12077 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
12078 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
12079 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
12080 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
12081 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
12082 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
12083 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
12084 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
12085 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
12086 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
12087 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
12088 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
12089 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
12090 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
12091 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
12092 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
12093 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
12094 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
12095 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
12096 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
12097 Remove, as these files are now generated automatically
12098 by bootstrap or automake.
12099
12100 * po/ChangeLog: Remove: all but one entry was a duplicate
12101 of this file, and I moved that 2000-11-02 entry here.
12102
12103 * config/.cvsignore: Add Makefile, depcomp, install-sh.
12104 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
12105 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
12106 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
12107 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
12108 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
12109 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
12110 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
12111 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
12112 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
12113 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
12114 xstrndup.h.
12115 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
12116 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
12117 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
12118 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
12119 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
12120 * src/.cvsignore: Remove *_.c.
12121
12122
12123 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
12124 support it. (The latest stable gzip doesn't.)
12125
121262004-04-27 Paul Eggert <eggert@twinsun.com>
12127
12128 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
12129 case, as stos_ is now used by destructors due to the 2004-02-09
12130 change.
12131
12132 Remove more K&R C support.
12133 * lib/libiberty.y (PARAMS): Remove. All uses removed.
12134 * lib/subpipe.c (errno): Remove decl.
12135 Include <stdlib.h> unconditionally.
12136 (EXIT_FAILURE): Remove macro.
12137 * src/complain.c (vfprintf, strerror): Remove.
12138 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
12139 unconditionally.
12140 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
12141 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
12142 (strchr, strspn, memchr): Remove decls.
12143 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
12144 unconditionally. Do not declare perror.
12145 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
12146 unconditionally.
12147
12148 * src/complain.c (_): Remove useless defn, as system.h defines this.
12149
12150 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
12151 with latest obstack.h.
12152 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
12153 to procedure types, as obstack.h now does that for us.
12154 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
12155
12156 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
12157 so that this include file can stand alone.
12158 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
12159 does this now. Include subpipe.h first after config.h, to
12160 test whether it can stand alone.
12161
12162 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
12163 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
12164 unused declaration.
12165
12166 * tests/synclines.at (%union synch line): Put a dummy member in
12167 the union, because empty unions aren't allowed in C. Caught
12168 by GCC 3.4.0.
12169
4f16766c
PE
121702004-04-13 Jim Meyering <jim@meyering.net>
12171
12172 * src/conflicts.c (conflicts_print): Correct format string typo:
12173 use `%%' to produce literal `%'. (trivial change)
12174
779e7ceb
PE
121752004-03-30 Paul Eggert <eggert@twinsun.com>
12176
12177 * src/getargs.c (version): Update copyright year to 2004.
12178
12179 * data/c.m4 (b4_int_type): Use 'short int' rather than
12180 'short', and similarly for 'long', 'unsigned', etc.
12181 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
12182 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
12183 yy_yypstack, yydumpstack): Likewise.
12184 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
12185 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
12186 Likewise.
12187 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
12188 yy_stack_print, yyparse): Likewise.
12189 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
12190 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
12191 * lib/bitset.c (bitset_print): Likewise.
12192 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
12193 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
12194 * lib/bitsetv.c (bitsetv_dump): Likewise.
12195 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
12196 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
12197 Likewise.
12198 * src/LR0.c (allocate_itemsets): Likewise.
12199 * src/gram.h (rule_number, rule): Likewise.
12200 * src/lalr.h (goto_number): Likewise.
12201 * src/nullable.c (nullable_compute): Likewise.
12202 * src/output.c (prepare_rules): Likewise.
12203 * src/relation.c (relation_print, relation_digraph): Likewise.
12204 * src/relation.h (relation_node): Likewise.
12205 * src/state.h (state_number, transitions, errs, reductions,
12206 struct state): Likewise.
12207 * src/symtab.h (symbol_number, struct symbol): Likewise.
12208 * src/tables.c (vector_number, tally, action_number,
12209 default_goto, goto_actions): Likewise.
12210 * tests/existing.at (GNU Cim Grammar): Likewise.
12211 * tests/regression.at (Web2c Actions): Likewise.
12212
12213 * src/output.c (muscle_insert_short_int_table): Renamed from
12214 muscle_insert_short_table. All uses changed.
12215
d6328241
PH
122162004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
12217
12218 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
12219 (declaration): Replace expected_conflicts with expected_sr_conflicts.
12220 Add %expect-rr rule.
4f16766c 12221
d6328241
PH
12222 * src/scan-gram.l: Recognize %expect-rr.
12223
4f16766c 12224 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 12225 expected_conflicts.
4f16766c 12226 (expected_rr_conflicts): Declare.
d6328241
PH
12227
12228 * src/conflicts.c (expected_sr_conflicts): Rename from
12229 expected_conflicts.
12230 (expected_rr_conflicts): Define.
12231 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
12232 for GLR parsers.
12233 Use expected_sr_conflicts in place of expected_conflicts.
12234 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 12235
d6328241 12236 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 12237
1452af69
PE
122382004-03-08 Paul Eggert <eggert@gnu.org>
12239
12240 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 12241 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
12242
12243 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
12244 in lalr1.cc.
12245 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
12246 * src/scan-gram.l (scan_integer): New function.
12247 ({int}): Use it.
12248 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
12249 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
12250 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
12251 Say "long int", not "long", for uniformity with GNU style.
12252
006d217d
PE
122532004-02-25 Paul Eggert <eggert@twinsun.com>
12254
12255 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
12256 compilers. This fixes a problem with Intel's C++ compiler being
12257 chatty, reported by Guido Trentalancia in
161a71f3 12258 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 12259
c2729758
ADL
122602004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
12261
12262 Support %destructor and merge error locations in lalr1.cc.
12263
12264 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
12265 (Parser::stos_): Define unconditionally.
12266 (Parser::destruct_): New method. Generate its body with
12267 b4_yydestruct_generate.
12268 (Parser::error_start_): New attribute.
12269 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
12270 token which are discarded.
12271 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
12272 error_start_ when erroneous token are discarded.
12273 (Parser::parse) <yyerrlab1>: Compute the location of the error
12274 token so that it covers all the discarded tokens.
12275 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
12276 it can be called with `%skeleton "lalr1.cc"', and do that.
12277
dd0e0635
PE
122782004-02-02 Paul Eggert <eggert@twinsun.com>
12279
12280 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
12281 $(top_srcdir)/lib and ../lib. This fixes a bug reported
12282 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
12283 There's no need to mention top_builddir since Automake does that
12284 for us.
12285 (INCLUDES): Remove, as Automake says it's obsolescent.
12286 Contents migrated into AM_CPPFLAGS as described above.
12287 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
12288
122892004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12290
12291 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
12292 (yyreportSyntaxError): Handle case where lookahead token is
12293 YYEMPTY.
12294
be16239b
PH
122952004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12296
12297 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
12298 resulting parsers are compilable with C++.
12299
5fa90832
PE
123002003-12-23 Paul Eggert <eggert@twinsun.com>
12301
12302 * config/depcomp, config/install-sh: Sync with Automake 1.8.
12303 * src/output.c (output_skeleton): Rename local var.
12304 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
12305 Bison tokens, as this runs afoul of the 2003-10-07 change that
12306 disallowed NUL bytes in character constants or string literals.
12307
12308 * tests/local.at: Require Autoconf 2.59's Autotest.
12309 * tests/testsuite.at: Don't include local.at, since we now assume
12310 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
12311 including it.
12312 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
12313 multiple inclusion warnings.
dd0e0635 12314
b165c324
AD
123152003-12-02 Akim Demaille <akim@epita.fr>
12316
12317 * doc/bison.texinfo (How Can I Reset the Parser): More about start
12318 conditions.
12319 From Bruno Haible.
12320
26e06a21
ADL
123212003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
12322
12323 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
12324
92ac3705
PE
123252003-10-07 Paul Eggert <eggert@twinsun.com>
12326
6a5ecb38
PE
12327 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
12328 if testsuite doesn't exist.
12329
92ac3705
PE
12330 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
12331 literals, unfortunately.
12332 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
12333 Complain about NUL bytes in character constants or string literals.
12334
91d2c560
PE
123352003-10-05 Paul Eggert <eggert@twinsun.com>
12336
12337 * NEWS: Don't document %no-default-prec, as it's still
12338 too experimental.
12339 * doc/bison.texinfo: Document %no-default-prec only if
12340 the defaultprec flag is set. Normally it's not.
12341
0cc3da3a
PE
123422003-10-04 Paul Eggert <eggert@twinsun.com>
12343
12344 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
12345 non-modifiable lvalue, instead of a modifiable one.
12346 * doc/bison.texinfo (Actions): Document that $$ can
12347 be assigned to. Do not claim that $$ and $N are
12348 array element references: user code should not rely on this.
12349
22fccf95
PE
123502003-10-01 Paul Eggert <eggert@twinsun.com>
12351
12352 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
12353 (grammar_declaration): Use it.
12354 * src/scan-gram.l: New token %no-default-prec.
12355 * tests/conflicts.at: Revamp tests to use %no-default-prec.
12356 * NEWS, doc/bison.texinfo: Document the above.
12357
fc8f2965
AD
123582003-10-01 Akim Demaille <akim@epita.fr>
12359
12360 VCG no longer supports long_straight_phase.
12361
12362 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
12363 * src/print_graph.c (print_graph): Adjust.
12364
39a06c25
PE
123652003-09-30 Frank Heckenbach <frank@g-n-u.de>
12366 and Paul Eggert <eggert@twinsun.com>
12367
12368 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
12369 Table of Symbols): Document %default-prec.
12370 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
12371 (grammar_declaration): Set default_prec on %default-prec.
12372 * src/scan-gram.l (%default-prec): New token.
12373 * src/reader.h (default_prec): New flag.
12374 * src/reader.c: Likewise.
12375 (packgram): Handle it.
12376 * tests/conflicts.at (%default-prec without %prec,
12377 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 12378
39a06c25
PE
123792003-09-30 Paul Eggert <eggert@twinsun.com>
12380
12381 * tests/testsuite.at: Include local.at, not input.at, fixing
12382 a typo in the 2003-08-25 patch.
12383
62b6aef9
AD
123842003-08-27 Akim Demaille <akim@epita.fr>
12385
12386 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
12387 GCC warnings.
12388
89e1cc61
AD
123892003-08-26 Akim Demaille <akim@epita.fr>
12390
12391 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
12392 "<\#" to avoid magic from Gnus when posting parts of this script.
12393
a08460b0
AD
123942003-08-26 Akim Demaille <akim@epita.fr>
12395
12396 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
12397 (Parser::parse): here.
12398 Adjust: nerrs and errstatus is now replaced by...
12399 (Parser::nerrs_, Parser::errstatus_): New.
12400
603f1cfd
AD
124012003-08-25 Akim Demaille <akim@epita.fr>
12402
12403 * config/announce-gen, Makefile.cfg: New.
12404 * Makefile.am: Adjust.
12405 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
12406 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
12407
cd3684cf
AD
124082003-08-25 Akim Demaille <akim@epita.fr>
12409
12410 When reducing initial empty rules, Bison parser read an initial
12411 location that is not defined. This results in garbage, and that
12412 affects Bison's own parser. Therefore we need (i) to extend Bison
12413 to support a means to initialize this location, and (ii) to use
12414 this CVS Bison to fix CVS Bison's parser.
12415
12416 * src/reader.h, reader.c (epilogue_augment): Remove, replace
12417 with...
12418 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
12419 * src/parse-gram.y: Adjust.
12420 (%initial-action): New.
12421 (%error-verbose): Since we require CVS Bison, there is no reason
12422 not to use it.
12423 * src/scan-gram.l: Adjust.
12424 * src/Makefile.am (YACC): New, to make sure we use our own parser.
12425 * data/yacc.c (yyparse): Use b4_initial_action.
12426
4e03e201
AD
124272003-08-25 Akim Demaille <akim@epita.fr>
12428
12429 * doc/bison.texinfo: Don't promote stdout for error messages.
12430
8c182d05
AD
124312003-08-25 Akim Demaille <akim@epita.fr>
12432
12433 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
12434 From Alexandre Duret-Lutz.
12435
6a60c4cf
PE
124362003-08-25 Akim Demaille <akim@epita.fr>
12437
12438 Version 1.875c.
12439
25f66e1a
AD
124402003-08-25 Akim Demaille <akim@epita.fr>
12441
12442 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
12443 Use them.
12444
5348bfbe
AD
124452003-08-25 Akim Demaille <akim@epita.fr>
12446
12447 * data/lalr1.cc (Parser::reduce_print_): New.
12448 Use it.
12449
47301314
AD
124502003-08-25 Akim Demaille <akim@epita.fr>
12451
12452 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
12453 error recovery loops. This patch is based on
161a71f3 12454 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
12455 Also, augment the similarity between lalr1.cc and yacc.c.
12456 Note: the locations of error recovery rules are not correct yet.
12457
12458 * data/lalr1.cc: Comment changes to augment the similarity between
12459 lalr1.cc and yacc.c.
12460 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
12461 (yyerrlab1): Remove, but where it used to be (now the bottom part of
12462 yyerrlab), when hitting EOF, pop the whole stack here instead of
12463 merely falling thru the default error handling mechanism.
12464 (yyerrorlab): New label, with the old contents of YYERROR,
12465 plus the following change: pop the stack of rhs corresponding
12466 to the production that invoked YYERROR. That is how Yacc
12467 behaves (required by POSIX).
12468 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
12469 fail.
12470
1f7a61ff
AD
124712003-08-25 Akim Demaille <akim@epita.fr>
12472
12473 Tune local.at so that people can "autom4te -l autotest calc.at -o
12474 calc" for instance, to extract a sub test suite.
12475
12476 * tests/testsuite.at: Move the initialization, Autotest version
12477 requirement, and AT_TESTED invocation into...
12478 * tests/local.at: here.
12479 * tests/testsuite.at: Include it for compatibility with Autoconf
12480 2.57.
12481 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
12482 be ignore.
12483
327b5b56
PE
124842003-08-04 Paul Eggert <eggert@twinsun.com>
12485
12486 Rework code slightly to avoid gcc -Wtraditional warnings.
12487 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
12488 The returned value is now stored in *YY0. All callers changed.
12489 * src/output.c (merge_output): Adjust to the above change.
12490
0051e3ed
PE
124912003-07-26 Paul Eggert <eggert@twinsun.com>
12492
12493 * data/glr.c (YYASSERT): New macro.
12494 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
12495 yyresolveStates, yyprocessOneStack):
12496 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
12497 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 12498
137437c6
PE
124992003-07-25 Paul Eggert <eggert@twinsun.com>
12500
5b620e06
PE
12501 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
12502 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 12503 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
12504 by Frank Heckenbach, though I have omitted the structure-initialization
12505 part of his glr-knr.diff patch since I recall that the Portable
12506 C Compiler didn't require that change.
12507
137437c6
PE
12508 Let the user specify how to allocate and free memory.
12509 Derived from a suggestion by Frank Heckenbach in
161a71f3 12510 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
12511 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
12512 All uses of free, malloc, realloc changed to use these macros,
12513 and unnecessary casts removed.
12514 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
12515
ddb85ca5
PE
125162003-07-06 Matthias Mann <MatthiasMann@gmx.de>
12517
12518 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
12519 use s.empty() rather than s == "" to test for empty string; see
161a71f3 12520 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
12521 (trivial change)
12522
39910e09
AD
125232003-06-25 Akim Demaille <akim@epita.fr>
12524
12525 * config/depcomp, config/install-sh: Update from masters.
12526
0ae99356
PE
125272003-06-20 Paul Eggert <eggert@twinsun.com>
12528
12529 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
12530 and return properly parenthesized result.
12531 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
12532 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
12533 Remove unnecessary parentheses from uses.
12534 * doc/bison.texinfo (Location Default Action): Describe the
12535 conventions for parentheses.
12536
cd05d13c
PE
125372003-06-19 Paul Eggert <eggert@twinsun.com>
12538
81fd08ca
PE
12539 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
12540 yyreportTree): Do not assume that size_t is the same width as int,
12541 when printing sizes. Print sizes using an unsigned format.
12542 Problem reported by Frank Heckenbach in
161a71f3 12543 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 12544
cd05d13c
PE
12545 Port to Forte Developer 7 C compiler.
12546 * data/glr.c (struct YYLTYPE): If locations are not being used,
12547 declare a single dummy member, as empty structs do not conform
12548 to the C standard.
12549 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
12550 the Forte Developer 7 C compiler complains that end-of-loop
12551 code is not reached.
12552
4dcf140b
PE
125532003-06-17 Paul Eggert <eggert@twinsun.com>
12554
12555 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
12556 avoid warnings from picky compilers about redefinition of PARAMS.
12557
8dd76bee
PE
125582003-06-17 Paul Eggert <eggert@twinsun.com>
12559
12560 Version 1.875b.
12561
12562 * NEWS: Document 1.875b.
12563
12564 * lib/bbitset.h: Do not include config.h; that's the includer's job.
12565 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
12566 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
12567 Don't use 'index' in comments, as it's a builtin fn on some hosts.
12568 * lib/bitset_stats.c: Include gettext.h unconditionally, as
12569 per recent gettext manual's suggestion.
12570 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
12571 Use prototypes, not old-style definitions.
12572 * lib/lbitset.c (lbitset_unused_clear): Likewise.
12573 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
12574 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
12575 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
12576 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
12577 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
12578 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
12579 vbitset_or_and_cmp, vbitset_copy): Likewise.
12580
12581 * lib/libiberty.h: Do not include config.h; that's the includer's job.
12582 Do not include <stdlib.h>.
12583 (PARAMS): Define unconditionally for C89.
12584 (ATTRIBUTE_NORETURN): Remove.
12585 (ATTRIBUTE_UNUSED): Define unconditionally.
12586
12587 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 12588 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
12589 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
12590 * lib/vbitset.c, lib/vbitset.h: New files.
12591 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
12592 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
12593 from libbitset.
12594
12595 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
12596 `How Can I Reset @code{yyparse}', since texinfo does not allow
12597 arbitrary @ in node names.
12598
12599 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
12600 shouldn't be needed according to the gettext 0.12.1 documentation
12601 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 12602 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 12603 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 12604 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 12605
8dd76bee
PE
12606 * lib/.cvsignore: Add stdbool.h.
12607 * m4/.cvsignore: Add nls.m4, po.m4.
12608
12609 Upgrade to CVS gnulib.
12610 * stdbool_.h: File renamed from stdbool.h.in.
12611 * configure.ac (AM_STDBOOL_H): Invoke this instead of
12612 AC_HEADER_STDBOOL.
12613 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
12614 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
12615 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
12616 (MOSTLYCLEANFILES): New var.
12617 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
12618 (stdbool.h): New rule.
12619 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
12620 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
12621 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
12622 m4/quote.m4: Upgrade to today's gnulib.
12623
12624 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
12625 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
12626 the tests right now.
12627 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
12628 yyerror are declared before use; C99 requires this.
12629
25005f6a
PH
126302003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12631
12632 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
12633 first.
12634 (yyrecoverSyntaxError): Correct the logic for setting and testing
12635 yyerrState.
12636 Correct comment on handling EOF.
12637 Allow states with only a default reduction, rather than failing
8dd76bee 12638 (I can't quite reconstruct why these were not allowed before).
25005f6a 12639
137437c6 12640 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 12641 buffer overruns, corrupting state.
8dd76bee
PE
12642
12643 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
12644 definition.
12645 * src/reader.h (max_left_semantic_context): New variable declaration.
12646 * src/scan-gram.l (max_left_semantic_context): Define.
12647 (handle_action_dollar): Update max_left_semantic_context.
12648 * data/glr.c (YYMAXLEFT): New definition.
12649 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
12650 (yyresolveAction): Ditto.
12651
12652 Fixes to problems with location handling in GLR parsers reported by
12653 Frank Heckenbach (2003/06/05).
12654
12655 * data/glr.c (YYLTYPE): Make trivial if locations not used.
12656 (YYRHSLOC): Add parentheses, and define only if locations used.
12657 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
12658 locations not used.
12659 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
12660 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 12661
25005f6a
PH
12662 * tests/cxx-type.at: Exercise location information; update tests
12663 to differentiate output with and without locations.
8dd76bee 12664 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
12665 because default YYLTYPE not yet defined.
12666 Change semantic actions to compute strings, rather than printing
12667 them directly (to test proper passing of semantics values). Change
12668 output to prefix notation and update test data and expected results.
12669 (yylex): Track locations.
12670 (stmtMerge): Return value rather than printing, and include arguments
12671 in value.
8dd76bee 12672
711f40b7
PE
126732003-06-03 Paul Eggert <eggert@twinsun.com>
12674
12675 Avoid warnings generated by GCC 2.95.4 when Bison is
12676 configured with --enable-gcc-warnings.
12677 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
12678 yy::]b4_parser_class_name[::translate_,
12679 yy::Stack::operator[] (unsigned),
12680 yy::Stack::operator[] (unsigned) const,
12681 yy::Slice::operator[] (unsigned),
12682 yy::Slice::operator[] (unsigned) const):
12683 Rename local vars to avoid warnings.
12684 * tests/glr-regression.at (Improper handling of embedded actions
12685 and $-N in GLR parsers): Remove unused local variable from yylex.
12686 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
12687 (void) as arg when not pure, since we now assume C89 when building
12688 Bison. Pacify GCC by using parameter.
12689
ac695f7d
PE
126902003-06-02 Paul Eggert <eggert@twinsun.com>
12691
12692 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
12693 yy::Location::lines, yy::Location::columns): Rename arguments
12694 to avoid shadowing; this removes a warning generated by GCC 3.3.
12695
26ec81e0
PE
126962003-06-01 Paul Eggert <eggert@twinsun.com>
12697
12698 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
12699 to g++, as GCC 3.3 complains if you do it.
12700 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
12701 everything that WARNING_CFLAGS has, except omit warnings
12702 not suitable for C++.
12703 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
12704 * tests/atlocal.in (CXXFLAGS): New var.
12705 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
12706
12707 Fix a GLR parser bug I reported in February; see
161a71f3 12708 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
12709 The problem was that GLR parsers did not conform to the C standard,
12710 because actions like { $1 = $2 + $3; } expanded to expressions
12711 that invoked YYFILL in separate subexpressions, and YYFILL assigned
12712 to a local variable. The C standard says that expressions
12713 like (var = f ()) + (var = f ()) have undefined behavior.
12714 Another problem was that GCC sometimes issues warnings that
12715 yyfill and its parameters are unused.
12716
12717 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
12718 as possibly unused.
12719 (yyfill): New function.
12720 (YYFILL): Use it.
12721 (yyuserAction): Change type of yynormal to bool, so that it matches
12722 the new yyfill signature. Mark it as possibly unused.
12723
12724
12725 Follow up on a bug I reported in February, where a Bison-generated
12726 parser can loop. Provide a test case and a fix for yacc.c. I
12727 don't have a fix for lalr1.cc or for glr.c, unfortunately.
12728 The original bug report is in:
161a71f3 12729 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
12730
12731 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
12732 macro's size was becoming unwieldy.
12733 (yyerrlab): Do not discard an empty lookahead symbol, as this
12734 might destroy garbage.
12735 (yyerrorlab): New label, with the old contents of YYERROR,
12736 plus the following change: pop the stack of rhs corresponding
12737 to the production that invoked YYERROR. That is how Yacc
12738 behaves, and POSIX requires this behavior.
12739 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
12740 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
12741 Define 'alarm' to do nothing if unistd.h is not available.
12742 Add a new rule "exp: '-' error;" to test the above change to
12743 data/yacc.c. Use 'alarm' to abort any test taking longer than
12744 10 seconds, as it's probably looping.
12745 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
12746 Also, the new yacc.c generates two fewer diagnostics for an
12747 existing test.
12748
d0829076
PE
127492003-05-24 Paul Eggert <eggert@twinsun.com>
12750
c6ae27df
PE
12751 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
12752 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
12753 This fixes a problem reported by John Bowman when the Compaq/HP
12754 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
12755 -ansi -Wall -gall).
12756 * data/yacc.c (union yyalloc): Likewise.
12757 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 12758
d0829076
PE
12759 Switch from 'int' to 'bool' where that makes sense.
12760
12761 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
12762 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
12763 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
12764 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
12765 Return or accept bool, not int. All callers changed.
12766 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
12767 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
12768 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
12769 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
12770 bitset_or_and_cmp_): Likewise.
12771 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
12772 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
12773 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
12774 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
12775 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
12776 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
12777 bitset_stats_or_and_cmp): Likewise.
12778 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
12779 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
12780 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
12781 ebitset_xor_cmp): Likewise.
12782 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
12783 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
12784 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
12785 lbitset_xor_cmp): Likewise.
12786 * lib/bbitset.h: Include <stdbool.h>.
12787 (struct bitset_vtable): The following members now return bool, not
12788 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
12789 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
12790 or_and_cmp).
12791 * src/conflicts.c (count_rr_conflicts): Likewise.
12792 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
12793 All uses changed.
12794 * lib/ebitset.c (ebitset_obstack_init): Likewise.
12795 * lib/lbitset.c (lbitset_obstack_init): Likewise.
12796 * src/getargs.c (debug_flag, defines_flag, locations_flag,
12797 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
12798 graph_flag): Likewise.
12799 * src/getargs.h (debug_flag, defines_flag, locations_flag,
12800 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
12801 graph_flag): Likewise.
12802 * src/output.c (error_verbose): Likewise.
12803 * src/output.h (error_verbose): Likewise.
12804 * src/reader.c (start_flag, typed): Likewise.
12805 * src/reader.h (typed): Likewise.
12806 * src/getargs.c (LOCATIONS_OPTION): New constant.
12807 (long_options, getargs): Use it.
12808 * src/lalr.c (build_relations): Use bool, not int.
12809 * src/nullable.c (nullable_compute): Likewise.
12810 * src/print.c (print_reductions): Likewise.
12811 * src/tables.c (action_row, pack_vector): Likewise.
12812 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
12813 * src/output.c (prepare): Use it.
12814 * src/output.c (token_definitions_output,
12815 symbol_destructors_output, symbol_destructors_output): Use string,
12816 not boolean integer, to keep track of whether to output separator.
12817 * src/print_graph.c (print_core): Likewise.
12818 * src/state.c (state_rule_lookaheads_print): Likewise.
12819
12820 * config/install-sh: Sync from automake 1.7.5.
12821
6b2584b7
PE
128222003-05-14 Paul Eggert <eggert@twinsun.com>
12823
12824 * src/parse-gram.y (rules_or_grammar_declaration): Require a
12825 semicolon after a grammar declaration, in the interest of possible
12826 future changes to the Bison input language.
12827 Do not allow a stray semicolon at the start of the grammar.
12828 (rhses.1): Allow one or more semicolons after any rule, including
12829 just before "|" as required by POSIX.
12830 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
12831 grammar.
12832
caf37a36
ADL
128332003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
12834
12835 %parse-param support for lalr1.cc.
12836
12837 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
12838 b4_cc_constructor_calls, b4_cc_constructor_call,
12839 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
12840 definitions.
12841 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
12842 parse-param arguments.
12843 (yy::b4_parser_class_name): Declare instance variables to
12844 hold parse-param arguments.
12845 * tests/calc.at: s/value/semantic_value/ because value clashes
12846 with a member of yy::b4_parser_class_name. Adjust C++ code
12847 to handle %parse-param. Enable %parse-param test in C++.
12848
3ab37077
PE
128492003-05-12 Paul Eggert <eggert@twinsun.com>
12850
12851 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
12852 English a bit. Fix fclose typo. Change "const char" to "char
12853 const", and use ANSI C rather than K&R for "main". Suggest
12854 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
12855 and suggest yy_switch_to_buffer.
12856
128572003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
12858
12859 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
12860 C89. This avoids a diagnostic on compilers that define __STDC__
12861 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 12862 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 12863
e743727f
PE
128642003-05-03 Paul Eggert <eggert@twinsun.com>
12865
12866 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
12867 Do not overrun array bounds.
12868 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 12869 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 12870
916708d5
AD
128712003-04-29 Akim Demaille <akim@epita.fr>
12872
12873 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
12874 * src/getargs.c, src/getargs.h: here, as bool, not int.
12875 (nondeterministic_parser): New.
12876 * src/parse-gram.y, src/scan-gram.l: Support
12877 %nondeterministic-parser.
12878 * src/output.c (prepare): Use nondeterministic_parser instead
12879 of glr_parser where appropriate.
12880 * src/tables.c (conflict_row, action_row, save_row)
12881 (token_actions, token_actions, pack_vector): Ditto.
12882
a06ea4aa
AD
128832003-04-29 Akim Demaille <akim@epita.fr>
12884
12885 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
12886
211074ca
AD
128872003-04-29 Akim Demaille <akim@epita.fr>
12888
12889 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
12890 with %pure-parser and %locations to exercise the patch from Yakov
12891 Markovitch below.
12892
6175ffe3
PE
128932003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
12894
12895 * data/yacc.c: (b4_lex_param): Corrected for the case where
12896 %lex-param is provided and %pure-parser isn't.
12897
b1e95857
PE
128982003-04-27 Paul Eggert <eggert@twinsun.com>
12899
12900 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 12901 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
12902 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
12903 if it is not defined.
12904 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
12905
acda9df6
PE
129062003-04-26 Paul Eggert <eggert@twinsun.com>
12907
3470c57b
PE
12908 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
12909 Declare to be of type suitable for the ninf value itself, not of
12910 type suitable for the corresponding table, since the latter might
12911 be unsigned but the ninf value might be negative. This fixes a
12912 bug reported by Alexandre Duret-Lutz in
161a71f3 12913 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 12914
acda9df6
PE
12915 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
12916 invokes it. We shouldn't invoke it twice because it will attempt
12917 to put error.o in the archive twice. This fixes a glitch reported
12918 by Martin Mokrejs in
161a71f3 12919 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 12920
b5250f26
PE
129212003-04-21 Paul Eggert <eggert@twinsun.com>
12922
12923 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
12924 to gnulib.
12925
089ac0f1
PE
129262003-04-21 Yakov Markovitch <Markovitch@iso.ru>
12927
12928 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
12929 Fix obvious typo that results in uncompilable GLR parsers
12930 when both %pure-parser and %locations are used. (trivial change)
12931
5ededac6
PE
129322003-04-17 Paul Eggert <eggert@twinsun.com>
12933
1b8f2fff
PE
12934 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
12935 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
12936 Do not insert the expected token via unput, as this runs afoul
12937 of a POSIX-compatibility bug in flex 2.5.31.
12938 All uses changed to BEGIN the parent state,
12939 since we no longer insert the expected token via unput.
12940 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
12941 that is no longer emitted after the above change.
12942
5ededac6
PE
12943 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
12944 the first one. This change is from Paul Hilfinger, and it fixes
12945 regression reported by Werner Lemberg in
161a71f3 12946 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
12947
12948 (resolve_sr_conflict): Don't invoke state_errs_set
12949 unless one or more tokens have been explicitly made errors.
12950 Otherwise, the above change causes Bison to abort.
12951
12952 * tests/existing.at (GNU pic Grammar): New test case, taken from
12953 Lemberg's email.
12954
b8be9132
AD
129552003-03-31 Akim Demaille <akim@epita.fr>
12956
12957 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
12958
d423d460
AD
129592003-03-31 Akim Demaille <akim@epita.fr>
12960
12961 * src/output.c (prepare_symbols): Avoid trailing spaces in the
12962 output.
12963
c7e441b4
AD
129642003-03-31 Akim Demaille <akim@epita.fr>
12965
12966 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
12967 From Paul Hilfinger.
12968
231897ad
AD
129692003-03-29 Akim Demaille <akim@epita.fr>
12970
12971 * m4/error.m4: Do not put under dynamic conditions some code which
12972 expansion is under static control.
12973
5b066063
AD
129742003-03-29 Akim Demaille <akim@epita.fr>
12975
12976 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
12977
22a74fec
AD
129782003-03-29 Akim Demaille <akim@epita.fr>
12979
12980 * doc/bison.texinfo (Strings are Destroyed): New.
12981
0eee27e7
PE
129822003-03-13 Paul Eggert <eggert@twinsun.com>
12983
12984 * .cvsignore: Add configure.lineno.
12985 * src/.cvsignore: Add yacc.
12986 * tests/.cvsignore: Add testsuite.log.
12987 * doc/fdl.texi: Sync with latest FSF version.
12988
f61aad93
PE
129892003-03-12 Paul Eggert <eggert@twinsun.com>
12990
537636c7
PE
12991 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
12992 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
12993 cursor, instead of leaving it undefined. This fixes a bug
12994 reported by Tim Van Holder in
161a71f3 12995 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
12996 * tests/input.at (Torturing the Scanner): Test the scanner on
12997 an empty input file, which was Tim Van Holder's test case.
12998
12999 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
13000 <sys/resource.h> can be included, include sys/time.h and
13001 sys/times.h first, if available. This works around the SunOS
13002 4.1.4 porting bug reported by Bruce Becker in
161a71f3 13003 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
13004
13005 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
13006 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
13007 AC_HEADER_SYS_WAIT.
13008
f61aad93
PE
13009 Merge changes from gnulib. This was prompted because the CVS
13010 snapshot didn't build on Solaris 7 due to strnlen problems.
13011
13012 These changes need to be merged back into gnulib:
13013 * lib/hash.c: Include <stdbool.h> unconditionally.
13014 * m4/onceonly.m4 (m4_quote): New macro.
13015 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
13016 Quote AC_FOREACH variable-expansions properly.
13017 The 2003-01-03 obstack.h change also needs merging.
13018 {end of changes requiring merging}
5b066063 13019
f61aad93
PE
13020 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
13021 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
13022 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
13023 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
13024 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
13025 New files, imported from gnulib.
13026 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
13027 above.
13028
13029 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
13030 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
13031 gnulib sources.
13032
13033 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
13034 Add.
13035 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
13036 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
13037 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
13038 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
13039 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
13040 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
13041 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
13042 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
13043 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
13044 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
13045 (jm_PREREQ_ARGMATCH): Remove.
13046 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
13047 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
13048
13049 * src/system.h: Include <stdbool.h> unconditionally.
13050
13051 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
13052 assuming at least C89 in the bitset code for some time now.
13053
d2ffe116
AD
130542003-03-03 Akim Demaille <akim@epita.fr>
13055
13056 * ro.po: New.
13057
052826fd
AD
130582003-03-02 Akim Demaille <akim@epita.fr>
13059
13060 * doc/bison.texinfo (Table of Symbols): Reactivate the
13061 documentation for %lex-param, and %parse-param.
13062
c4749565
AD
130632003-03-02 Akim Demaille <akim@epita.fr>
13064
13065 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
13066 generate verbose error messages.
13067 Use the number of tokens as an upper bound in yytname, as it
13068 cannot be a non terminal.
13069
d5286af1
AD
130702003-03-02 Akim Demaille <akim@epita.fr>
13071
13072 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
13073 message.
13074
22e304a6
AD
130752003-03-02 Akim Demaille <akim@epita.fr>
13076
22e304a6
AD
13077 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
13078 Use them to exercise yycheck overrun.
13079 Based on Andrew Suffield's grammar.
13080
67a25fed
AD
130812003-03-02 Akim Demaille <akim@epita.fr>
13082
13083 Create tests/local.at for Bison generic testing macros.
13084
13085 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
13086 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
13087 This new file.
13088 * tests/calc.at (AT_CHECK_CALC): Adjust.
13089 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
13090 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
13091 * tests/local.at: here.
13092 (AT_COMPILE_CXX): Tags the tests using it as c++.
13093 Ignore the test if CXX is not functional.
13094
9c2b381f
PE
130952003-03-01 Paul Eggert <eggert@twinsun.com>
13096
13097 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
13098 not loc->end, since loc->end might contain garbage and this leads
13099 to undefined behavior on some platforms.
13100 (id_loc, token_start): Use (IF_LINTed) initial values that do not
13101 depend on *loc, so that the reader doesn't give the the false
13102 impression that *loc is initialized.
13103 (<INITIAL>"%%"): Do not bother setting code_start, since its value
13104 does not survive the return.
13105
0433ba88
AD
131062003-03-01 Akim Demaille <akim@epita.fr>
13107
13108 * src/scan-gram.l (code_start): Always initialize it when entering
13109 into yylex, as SC_EPILOGUE is activated *before* the corresponding
13110 yylex invocation. An alternative would be making it static, but
13111 then it starts with the second %%'s beginning, instead of its end.
13112
b305ea69
PE
131132003-02-28 Paul Eggert <eggert@twinsun.com>
13114
13115 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
13116 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 13117 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 13118
c3d25e01
PE
131192003-02-26 Paul Eggert <eggert@twinsun.com>
13120
13121 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
13122 Remove Sequent/Pyramid discussion (nobody uses them any more).
13123 Merge VMS and MS-DOS discussion; these ports may well be dead
13124 but let's keep mentioning them for now. Put <> around email
13125 addresses. Add copyright notice.
13126
c267ffbc
PE
131272003-02-24 Paul Eggert <eggert@twinsun.com>
13128
13129 * data/glr.c (yy_reduce_print): yylineno -> yylno,
13130 to avoid collision with flex use of yylineno.
13131 Problem reported by Bruce Lilly in
161a71f3 13132 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
13133 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
13134 * data/yacc.c (yy_reduce_print): Likewise.
13135
13136 * config/depcomp: Sync with Automake 1.7.3.
13137
f939fc12
AD
131382003-02-21 Akim Demaille <akim@epita.fr>
13139
13140 * data/lalr1.cc: Use temporary variables instead of casts to
13141 change integer types.
13142 Suggested by Paul Eggert.
13143
95923bd6
AD
131442003-02-21 Akim Demaille <akim@epita.fr>
13145
13146 * doc/bison.texinfo: Use "location" consistently to refer to @n,
13147 to avoid confusions with lalr1.cc's notion of Position.
13148 Suggested by Paul Eggert.
13149
2cdc240e
AD
131502003-02-20 Akim Demaille <akim@epita.fr>
13151
13152 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
13153 before initial_columns.
13154 (location.hh): Use consistent variable names when defining the
13155 operator<<.
13156 Use "last" so that we subtract from Positions, not from unsigned.
13157
5d003116
AD
131582003-02-20 Akim Demaille <akim@epita.fr>
13159
13160 * data/lalr1.cc (position.hh): New subfile, including the extended
13161 and Doxygen'ed documentation of class Position.
13162 (location.hh): Use it.
13163 Document a` la Doxygen.
ba1ecc07 13164 With the help of Benoit Perrot.
5d003116 13165
d02b25f9
AD
131662003-02-20 Akim Demaille <akim@epita.fr>
13167
13168 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
13169 AT_YACC_IF.
13170 Redefine AT_YYERROR_SEES_LOC_IF using it.
13171 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
13172 not defined.
13173 Don't use the location in yy::Parser::error_ and
13174 yy::Parser::print_ when not %locations.
13175 Activate more lalr1.cc tests.
13176
0d1c3a04
AD
131772003-02-19 Akim Demaille <akim@epita.fr>
13178
13179 * data/lalr1.cc: When displaying a line number, be sure to make it
13180 an int.
13181
60a777aa
AD
131822003-02-19 Akim Demaille <akim@epita.fr>
13183
13184 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
13185 Remove, useless.
13186 (YYABORT, YYACCEPT, YYERROR): New.
13187 * tests/calc.at: Renable the lalr1.cc test.
13188
0b86fc41
AD
131892003-02-19 Akim Demaille <akim@epita.fr>
13190
13191 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
13192 error recovery, mixing with/without pops and discarding of the
13193 lookahead.
13194 Exercise YYERROR.
13195 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
13196
da99a5dc
PE
131972003-02-17 Paul Eggert <eggert@twinsun.com>
13198
13199 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
13200 * tests/testsuite.at (AT_COMPILE): Use them.
13201 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 13202 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 13203
93b8c255
PE
132042003-02-12 Paul Eggert <eggert@twinsun.com>
13205
13206 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
13207 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 13208 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
13209 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
13210 Check for malloc failure, for consistency with yacc.c.
13211 (yytname_size): Remove, for consistency with yacc.c.
13212
13213 The bug still remains in data/lalr1.cc, as I didn't have time
13214 to fix it there.
13215
7548fed2
AD
132162003-02-06 Akim Demaille <akim@epita.fr>
13217
13218 * configure.ac (GXX): Rename as...
13219 (CXX): this, to keep the original Autoconf semantics.
13220 Require 2.57.
13221 * data/lalr1.cc: Fix b4_copyright invocations.
13222 If YYDEBUG is not defined, don't depend upon name_ being defined.
13223 (location.hh): Include string and iostream.
13224 (Position::filename): New member.
13225 (Position::Position ()): New.
13226 (operator<< (Position)): New.
13227 (operator- (Position, int)): New.
13228 (Location::first, Location::last): Rename as...
13229 (Location::begin, Location::end): these, to mock the conventional
13230 iterator names.
13231 (operator<< (Location)): New.
13232 * tests/atlocal.in (CXX): New.
13233 * tests/testsuite.at (AT_COMPILE_CXX): New.
13234 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
13235 locations in a more synthetic way.
13236 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
13237 lalr1.cc is used.
13238 Adjust the C locations to match those from Emacs: first column is
13239 column 0.
13240 Change all the expected results.
13241 Conform to the GCS: simplify the locations when applicable.
13242 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
13243 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
13244 these CPP macros with the m4 macros new defined by...
13245 (AT_CHECK_PUSHDEFS): this, i.e.:
13246 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 13247 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
13248 New macros.
13249 (AT_CHECK_POPDEFS): Undefine them.
13250 (AT_CHECK_CALC_LALR1_CC): New.
13251 Use it for the first lalr1.cc test.
13252
43a176ef
AD
132532003-02-04 Akim Demaille <akim@epita.fr>
13254
13255 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
13256 Location as is defined.
13257
fc049e9c
AD
132582003-02-04 Akim Demaille <akim@epita.fr>
13259
13260 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
13261 name_ being defined.
13262
a737b216
PE
132632003-02-03 Paul Eggert <eggert@twinsun.com>
13264
13265 * src/gram.h (start_symbol): Remove unused decl.
13266
13267 Use more-consistent naming conventions for local vars.
13268
13269 * src/derives.c (derives_compute): Change type of local var from
13270 int to rule_number.
13271 * src/gram.c (grammar_rules_partial_print): Likewise.
13272 * src/print.c (print_core): Likewise.
13273 * src/reduce.c (reduce_grammar_tables): Likewise.
13274
13275 * src/gram.c (grammar_dump): Change name of item_number *
13276 local var from r to rp.
13277 * src/nullable.c (nullable_compute): Likewise.
13278
13279 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
13280
13281 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
13282 for symbol or symbol_number var.
13283 * src/reader.c (grammar_start_symbol_set): Likewise.
13284 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
13285 Likewise.
13286 * src/state.c (transitions_to): Likewise.
13287 * src/state.h: Likewise.
13288 * src/tables.c (symbol_number_to_vector_number): Likewise.
13289
13290 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
13291 char * var.
13292
13293 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
13294 var.
13295
13296 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
13297 var.
13298
13299 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
13300 Use str, not s, for char * var. Use ch, not c, for character var.
13301 Use size for size var.
13302
13303 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
13304 char * var.
13305 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
13306 uniqstr var.
13307 * src/uniqstr.h: Likewise.
13308
13309 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
13310 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
13311 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
13312 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
13313 param to have same name as that of enum, so that we don't use
13314 "s" to stand for a non-state.
13315
68e93ad5
AD
133162003-02-02 Akim Demaille <akim@epita.fr>
13317
13318 * src/scan-skel.l: Scan more than one inert character per yylex
13319 invocation.
13320
92898986
PE
133212003-02-01 Paul Eggert <eggert@twinsun.com>
13322
13323 Version 1.875a.
13324
1d9d5d71
PE
13325 * po/LINGUAS: Add ms.
13326
0435d061
AD
133272003-01-30 Akim Demaille <akim@epita.fr>
13328
13329 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
13330
6029a57f
PH
133312003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13332
13333 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
13334 of $1.
0435d061
AD
13335
13336 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 13337 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 13338 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 13339
6029a57f
PH
13340 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
13341 (b4_rhs_location): Ditto.
0435d061 13342 (yyfill): New function to copy from stack tree into array
6029a57f 13343 incrementally.
0435d061
AD
13344 (yyuserAction): Modify to allow incremental move of semantic values
13345 to rhs array when in GLR mode.
13346 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
13347 as needed.
13348 Remove dummy use of yystack, as there is now a guaranteed use.
13349 (yydoAction): Modify to allow incremental move of semantic values
13350 to rhs array when in GLR mode.
13351 (yyresolveAction): Ditto.
13352 (yyglrShiftDefer): Update comment.
0435d061 13353 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
13354 (yyglrReduce): Ditto.
13355 (yydoAction): Ditto
0435d061 13356
6029a57f
PH
13357 * tests/glr-regr1.at: Rename to ...
13358 * tests/glr-regression.at: Add new regression test for the problems
13359 described above (adapted from S. Eken).
13360 Update copyright notice.
13361 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
13362 * tests/Makefile.am: Ditto.
13363
6cee6297
PE
133642003-01-28 Paul Eggert <eggert@twinsun.com>
13365
13366 * data/lalr1.cc: Do not use @output_header_name@ unless
13367 b4_defines_flag is set. This fixes two bugs reported by
13368 Tim Van Holder in
161a71f3
PE
13369 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
13370 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 13371
b2a836b5
PE
133722003-01-21 Paul Eggert <eggert@twinsun.com>
13373
13374 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
13375 we don't need to worry about yyerrlab1 being reported as an
13376 "unused label" by non-GCC C compilers. The downside is that if
13377 locations are used then a couple of statements are duplicated each
13378 time YYERROR is invoked, but the upside is that the warnings
13379 should vanish.
13380 (yyerrlab1): Move code to YERROR.
13381 (yyerrlab2): Remove. Change uses back to yyerrlab1.
13382 This reverts some of the 2002-12-27 change.
13383
4196b931
PE
133842003-01-17 Paul Eggert <eggert@twinsun.com>
13385
13386 * src/output.c (symbol_printers_output): Fix typo that led
13387 to core dump. Problem reported by Antonio Rus in
161a71f3 13388 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 13389
3ae831b4
AD
133902003-01-13 Akim Demaille <akim@epita.fr>,
13391 Quoc Peyrot <chojin@lrde.epita.fr>,
13392 Robert Anisko <anisko_r@lrde.epita.fr>
13393
13394 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
13395 when the stacks contain one element, as the loop would otherwise
13396 free the last state, and then use the top state (the one we just
13397 popped). This means that the initial elements will not be freed
13398 explicitly, as is the case in yacc.c; it is not a problem, as
13399 these elements have fake values.
13400
e3aa65c5
PE
134012003-01-11 Paul Eggert <eggert@twinsun.com>
13402
13403 * NEWS: %expect-violations are now just warnings, reverting
13404 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
13405 bootstrapping problem reported by Matthias Klose; see
161a71f3 13406 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
13407 * src/conflicts.c (conflicts_print): Likewise.
13408 * tests/conflicts.at (%expect not enough, %expect too much,
13409 %expect with reduce conflicts): Likewise.
13410 * doc/bison.texinfo (Expect Decl): Document this. Also mention
13411 that the warning is enabled if the number of conflicts changes
13412 (not necessarily increases).
13413
13414 * src/getargs.c (version): Update copyright year.
13415
f0057011
AD
134162003-01-09 Akim Demaille <akim@epita.fr>
13417
13418 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
13419
1ee6d2a0
PE
134202003-01-08 Paul Eggert <eggert@twinsun.com>
13421
13422 * Makefile.maint (WGETFLAGS):
13423 New macro, containing "-C off" to disable proxy caches.
13424 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
13425 (rel-check): Use $(WGET) instead of wget.
13426
d4fd77c4
PE
134272003-01-06 Paul Eggert <eggert@twinsun.com>
13428
13429 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
13430 the GLR paper of Scott, Johnstone and Hussain.
13431
464c6927
PE
134322003-01-04 Paul Eggert <eggert@twinsun.com>
13433
d600ee67
PE
13434 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
13435 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
13436 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
13437 (EXTRA_LIBRARIES): New var, for liby.a.
13438 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
13439 (EXTRA_SCRIPTS): New var, for yacc.
13440
464c6927
PE
13441 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
13442 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
13443 Problem reported by Nelson H. F. Beebe.
13444
134452003-01-03 Paul Eggert <eggert@twinsun.com>
13446
13447 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
13448 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
13449 when compiling Bison 1.875's `bitset bset = obstack_alloc
13450 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
13451
13452 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
13453 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
13454 grow to a huge size with typical invocation.
d600ee67 13455
464c6927
PE
13456 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
13457 Use the pattern recommended by Autoconf 2.57, except also protect
13458 against double-definition.
13459 * src/system.h: Likewise.
13460 Portability issues reported by Nelson H. F. Beebe.
d600ee67 13461
464c6927
PE
13462 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
13463 All uses changed. Provide a definition in both C and C++.
13464 (yytrue, yyfalse): Define even if defined (__cplusplus).
13465
13466 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
13467 Reported by Nelson H. F. Beebe.
d600ee67 13468
464c6927
PE
13469 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
13470
0f42c7d5
PE
134712003-01-02 Paul Eggert <eggert@twinsun.com>
13472
13473 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
13474 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
13475 Bug reported by Nelson H. F. Beebe.
13476
dc546b0f
PE
134772003-01-01 Paul Eggert <eggert@twinsun.com>
13478
13479 * Version 1.875.
13480
2c09b6a7
PE
134812002-12-30 Paul Eggert <eggert@twinsun.com>
13482
13483 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
13484 Moved here from...
13485 (<INITIAL>","): Here. This causes stray "," to be treated
13486 more uniformly.
13487
dc546b0f 13488 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
13489 last brace in braced code when not in Yacc mode, for compatibility
13490 with Bison 1.35. This resurrects the 2001-12-15 patch to
13491 src/reader.c.
13492
13493 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
13494 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
13495
535c0f63
PE
134962002-12-28 Paul Eggert <eggert@twinsun.com>
13497
13498 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
13499 that of SYM's type. This fixes Debian bug 168069, reported by
13500 Thomas Olsson.
d600ee67 13501
963fcc17
PE
135022002-12-28 Paul Eggert <eggert@twinsun.com>
13503
13504 Version 1.75f.
13505
13506 Switch back to the Yacc style of conflict reports, undoing some
13507 of the 2002-07-30 change.
13508 * doc/bison.texinfo (Understanding): Use Yacc style for
13509 conflict reports. Also, use new way of locating rules.
13510 * src/conflicts.c (conflict_report):
13511 Renamed from conflict_report_yacc, removing the old
13512 'conflict_report'. Translate the entire conflict report at once,
13513 so that we don't assume that "," has the same interpretation in
13514 all languages.
13515 (conflicts_output): Use Yacc-style conflict report for each state,
13516 instead of our more-complicated style.
13517 (conflicts_print): Use Yacc-style conflict report, except print
13518 the input file name when not emulating Yacc.
13519 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
13520 Conflicted Reduction, %expect not enough, %expect too much,
13521 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
13522 * tests/existing.at (GNU Cim Grammar): Likewise.
13523 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
13524
13525 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
13526 fatal): Don't invoke fflush; it's not needed and it might even be
13527 harmful for stdout, as stdout might not be open.
13528 * src/reduce.c (reduce_print): Likewise.
13529
b1efe548
PE
135302002-12-27 Paul Eggert <eggert@twinsun.com>
13531
13532 Fix a bug where error locations were not being recorded correctly.
13533 This problem was originally reported by Paul Hilfinger in
161a71f3 13534 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
13535
13536 * data/yacc.c (yyparse): New local var yylerrsp, to record the
13537 top of the location stack's error locations.
13538 (yyerrlab): Set it. When discarding a token, push its location
13539 onto yylerrsp so that we don't lose track of the error's end.
13540 (yyerrlab1): Now is only the target of YYERROR, so that we can
13541 properly record the location of the action that failed. For GCC
13542 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
13543 GCC warning about yyerrlab1 being unused if YYERROR is unused.
13544 (yyerrlab2): New label, which yyerrlab now falls through to.
13545 Compute the error's location by applying YYLLOC_DEFAULT to
13546 the locations of all the symbols that went into the error.
13547 * doc/bison.texinfo (Location Default Action): Mention that
13548 YYLLOC_DEFAULT is also invoked for syntax errors.
13549 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
13550 Error locations include the locations of all the tokens that were
13551 discarded, not just the last token.
d600ee67 13552
983c5c2c
PE
135532002-12-26 Paul Eggert <eggert@twinsun.com>
13554
b1efe548
PE
13555 * src/files.c: Include quote.h.
13556 (compute_output_file_names): Warn if we detect conflicting
13557 outputs to the same file. This should catch the misunderstanding
13558 exemplified by Debian Bug 165349, reported by Bruce Stephens..
13559
13560 * src/conflicts.c (conflicts_print): If the user specifies
13561 "%expect N", report an error if there are any reduce/reduce
13562 conflicts. This is what the manual says should happen.
13563 This fixes Debian bug 130890, reported by Anthony DeRobertis.
13564 * tests/conflicts.at (%expect with reduce conflicts): New test.
13565
983c5c2c
PE
13566 Don't use m4_include on relative file names, as it doesn't work as
13567 desired if there happens to be a file with that name under ".".
d600ee67 13568
983c5c2c
PE
13569 * m4sugar/version.m4: Remove; it was included but it wasn't used.
13570 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
13571 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
13572 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
13573 * src/output.c (output_skeleton): Use full path names when
13574 specifying a file to include; don't rely on include path, as
13575 it's unreliable when the working file contains a file with
13576 that name.
d600ee67 13577
983c5c2c
PE
135782002-12-25 Paul Eggert <eggert@twinsun.com>
13579
13580 Remove obsolete references to bison.simple and bison.hairy.
13581 Problem mentioned by Aubin Mahe in
161a71f3 13582 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
13583 * data/glr.c: Comment fix.
13584 * doc/bison.1: Remove references. Also, mention "yacc".
13585
13586 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
13587 with -g option.
13588
13589 * src/parse-gram.y (declaration): Use enum "report_states" rather
13590 than its numeric value 1.
13591
13592 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
13593 opening a new one. This fixes Debian bug 165349, reported by
13594 Bruce Stephens.
13595
23f2d9dc
PE
135962002-12-24 Paul Eggert <eggert@twinsun.com>
13597
13598 Version 1.75e.
13599
13600 * Makefile.maint (cvs-update): Don't assume that the shell
13601 supports $(...), as Solaris sh doesn't.
13602
13603 * src/parse-gram.y (lloc_default): Remove test for empty
13604 nonterminals at the end, since it didn't change the result.
13605
136062002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
13607
13608 If the user does not define YYSTYPE as a macro, Bison now declares it
13609 using typedef instead of defining it as a macro. POSIX requires this.
13610 For consistency, YYLTYPE is also declared instead of defined.
13611
13612 %union directives can now have a tag before the `{', e.g., the
13613 directive `%union foo {...}' now generates the C code
13614 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
13615 The default union tag is `YYSTYPE', for compatibility with Solaris 9
13616 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
13617 instead of `yyltype'.
13618
13619 `yystype' and `yyltype' are now obsolescent macros instead of being
13620 typedefs or tags; they are no longer documented and will be
13621 withdrawn in a future release.
13622
13623 * data/glr.c (b4_location_type): Remove.
13624 (YYSTYPE): Renamed from yystype.
13625 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
13626 (struct YYLTYPE): Renamed from struct yyltype.
13627 (YYLTYPE): Renamed from yyltype.
13628 (yyltype, yystype): New (and obsolescent) macros,
13629 for backward compatibility.
13630 * data/yacc.c: Likewise.
13631
13632 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
13633 does not specify a union tag. This is for compatibility with
13634 Solaris 9 yacc.
13635
13636 * src/parse-gram.y (add_param): 2nd arg is now char * not char
13637 const *, since it is now modified by stripping surrounding { }.
13638 (current_braced_code): Remove.
13639 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
13640 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
13641 trailing " {...}". Now of type <chars>.
13642 (grammar_declaration): Adjust to bundled tokens.
13643 (code_content): Remove; stripping is now done by add_param.
13644 (print_token_value): Print contents of bundled tokens.
13645 (token_name): New function.
13646
13647 * src/reader.h (braced_code, current_braced_code): Remove.
13648 (token_name): New decl.
13649
13650 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
13651 token_type, not braced_code code_kind. All uses changed.
13652 (SC_PRE_CODE): New state, for scanning after a keyword that
13653 has (or usually has) an immediately-following braced code.
13654 (token_type): New local var, to keep track of which token type
13655 to return when scanning braced code.
13656 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 13657 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
13658 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
13659 instead of returning a token type immediately.
13660 (<INITIAL>"{"): Set token type.
13661 (<SC_BRACED_CODE>"}"): Use it.
13662 (handle_action_dollar, handle_action_at): Now returns bool
13663 indicating success. Fail if ! current_rule; this prevents a core dump.
13664 (handle_symbol_code_dollar, handle_symbol_code_at):
13665 Remove; merge body into caller.
13666 (handle_dollar, handle_at): Complain in invalid contexts.
13667
13668 * NEWS, doc/bison.texinfo: Document the above.
13669 * NEWS: Fix years and program names in copyright notice.
13670
879ca4f8
PE
136712002-12-17 Paul Eggert <eggert@twinsun.com>
13672
13673 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
13674 Reporting, Table of Symbols): Omit mentions of %lex-param and
13675 %parse-param from the documentation for now.
13676
1c5fe69d
PE
136772002-12-15 Paul Eggert <eggert@twinsun.com>
13678
13679 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
13680 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
13681 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
13682 disagreed with the Bison documentation. Bug
13683 reported by Andrew Walrond.
d600ee67 13684
1c5fe69d
PE
13685 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
13686 as the caller now does that.
13687 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
13688 (YYEMPTY): Parenthesize right hand side, since others use it.
13689 (yyparse): Don't assume that our generated code is the only code
13690 that sets yychar.
13691
d1de5372
PE
136922002-12-13 Paul Eggert <eggert@twinsun.com>
13693
13694 Version 1.75d.
13695
13696 POSIX requires a "yacc" command.
13697 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
13698 (MOSTLYCLEANFILES): Add yacc.
13699 (yacc): New rule.
1c5fe69d 13700 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
13701 as an alias for bison y.
13702
13703 * po/LINGUAS: Add da.
d600ee67 13704
d1de5372
PE
13705 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
13706 problem with latest <getopt.h>.
13707 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
13708
13709 * doc/fdl.texi: Upgrade to 1.2.
13710 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
13711 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
13712 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
13713 gnulib.
13714 * config/install-sh: Sync with autotools.
13715
13716 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 13717 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
13718 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
13719 locations are requested.
13720 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
13721 locations are requested.
13722
d0f3fe23
PE
137232002-12-12 Paul Eggert <eggert@twinsun.com>
13724
13725 Remove unportable casts and storage allocation tricks.
13726 While we're at it, remove almost all casts, since they
13727 usually aren't needed and are a sign of trouble.
13728
13729 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
13730
13731 * src/derives.c (derives_compute): Do not subtract NTOKENS from
13732 the pointer DSET returned by malloc; this isn't portable.
13733 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
13734 Similarly for DERIVES.
13735 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
13736 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
13737 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
13738
13739 * src/derives.c (derives_compute): Do not bother invoking
13740 int_of_rule_number, since rule numbers are integers.
13741
13742 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
13743 rather than XMALLOC (char, N).
13744
13745 * src/files.c (filename_split): Rewrite to avoid cast.
13746
13747 * src/gram.h (symbol_number_as_item_number,
13748 item_number_as_symbol_number, rule_number_as_item_number,
13749 item_number_as_rule_number):
13750 Now inline functions rather than macros, to avoid casts.
13751 * src/state.h (state_number_as_int): Likewise.
13752 * src/tables.c (state_number_to_vector_number,
13753 symbol_number_to_vector_number): Likewise.
13754
13755 * src/gram.h (int_of_rule_number): Remove; no longer used.
13756
13757 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
13758 since the resulting storage is always stored into.
13759
13760 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
13761 where it's needed.
13762
13763 * src/muscle_tab.c (muscle_m4_output):
13764 Now inline. Return bool, not int.
13765 * src/state.c (state_compare): Likewise.
13766 * src/symtab.c (symbol_check_defined,
13767 symbol_check_alias_consistency, symbol_pack, symbol_translation,
13768 hash_compare_symbol, hash_symbol):
13769 Likewise.
13770 * src/uniqstr.c (uniqstr_print): Likewise.
13771 * src/muscle_tab.c (muscle_m4_output_processor):
13772 New function, to avoid casts.
13773 * src/state.c (state_comparator, stage_hasher): Likewise.
13774 * src/symtab.c (symbol_check_defined_processor,
13775 symbol_check_alias_consistency_processor, symbol_pack_processor,
13776 symbol_translation_processor, hash_symbol_comparator,
13777 hash_symbol_hasher): Likewise.
13778 * src/uniqstr.c (uniqstr_print_processor): Likewise.
13779 * src/muscle_tab.c (muscles_m4_output):
13780 Use new functions instead of casting old functions unportably.
13781 * src/state.c (state_hash_new): Likewise.
13782 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
13783 symbols_token_translations_init):
13784 Likewise.
13785 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
13786
13787 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
13788 var instead of casting to long, to avoid casts.
13789 (prepare_states): Use MALLOC rather than alloca, so that we don't
13790 have to worry about alloca.
13791 * src/state.c (state_hash_lookup): Likewise.
13792
13793 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
13794 local var instead of casting to unsigned char, to avoid casts.
13795
13796 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
13797 STATE_ALLOC): Remove.
13798 (transitions_new, errs_new, reductions_new, state_new): Use malloc
13799 rather than calloc, and use offsetof to avoid allocating slightly
13800 too much storage.
13801 (state_new): Initialize all members.
13802
13803 * src/state.c (state_hash): Use unsigned accumulator, not signed.
13804
13805 * src/symtab.c (symbol_free): Remove; unused.
13806 (symbol_get): Remove cast in lhs of assignment.
13807 (symbols_do): Now static. Accept generic arguments, not
13808 hashing-related ones.
13809
13810 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
13811 (symbol_processor): Remove.
13812 (symbols_do): Remove decl; now static.
13813
13814 * src/system.h (alloca): Remove; decl no longer needed.
13815 (<stddef.h>): Include, for offsetof.
13816 (<inttypes.>, <stdint.h>): Include if available.
13817 (uintptr_t): New type, if system lacks it.
13818 (CALLOC, MALLOC, REALLOC): New macros.
13819 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
13820 new macros.
13821
13822 * src/tables.c (table_size): Now int, to pacify GCC.
13823 (table_grow, table_ninf_remap): Use signed table size.
13824 (save_row): Don't bother initializing locals when not needed.
13825 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
13826 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
13827
13828 * src/vcg.h: Correct misspellings.
13829
13830 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
13831
13832
13833 * src/getargs.c (getargs): Don't assume EOF == -1.
13834
26b4a969
PE
138352002-12-09 Paul Eggert <eggert@twinsun.com>
13836
13837 Change identifier spellings to avoid collisions with names
13838 that are reserved by POSIX.
13839
13840 Don't use names ending in _t, since POSIX reserves them.
13841 For consistency, remove _e and _s endings -- they're weren't
13842 needed to remove ambiguity. All uses changed.
13843 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
13844 turn was just renamed from struniq_t.
13845 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
13846 which in turn was just renamed from struniq_processor_t.
13847 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
13848 in turn was renamed from hash_compare_struniq_t.
13849 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
13850 (state_list): Renamed from state_list_t.
13851 * src/assoc.h (assoc): Renamed from assoc_t.
13852 * src/conflicts.c (enum conflict_resolution): Renamed from
13853 enum conflict_resolution_e.
13854 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
13855 (rule_list): Renamed from rule_list_t.
13856 * src/getargs.h (enum trace): Renamed from enum trace_e.
13857 (enum report): Renamed from enum report_e.
13858 * src/gram.h (item_number): Renamed from item_number_t.
13859 (rule_number): Renamed from rule_number_t.
13860 (struct rule_s): Remove the "rule_s" part; not used.
13861 (rule): Renamed from rule_t.
13862 (rule_filter): Renamed from rule_filter_t.
13863 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
13864 (goto_list): Renamed from goto_list_t.
13865 * src/lalr.h (goto_number): Renamed from goto_number_t.
13866 * src/location.h (location): Renamed from location_t.
13867 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
13868 and moved here from:
13869 * src/muscle_tab.h (muscle_entry_t): here.
13870 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
13871 (rule_list): Renamed from rule_list_t.
13872 * src/print_graph.c (static_graph): Renamed from graph.
13873 * src/reader.h (braced_code): Renamed from braced_code_t.
13874 Remove brace_code_e tag.
13875 * src/relation.h (relation_node): Renamed from relation_node_t.
13876 (relation_nodes): Renamed from relation_nodes_t.
13877 (relation): Renamed from relation_t.
13878 * src/state.h (state_number): Renamed from state_number_t.
13879 (struct state): Renamed from struct state_s.
13880 (state): Renamed from state_t.
13881 (transitions): Renamed from transitions_t. Unused (and
13882 misspelled) transtion_s tag removed.
13883 (errs): Renamed from errs_t. Unused errs_s tag removed.
13884 (reductions): Renamed from reductions_t. Unused tag
13885 reductions_s removed.
13886 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
13887 (struct symbol_list): Renamed from struct symbol_list_s.
13888 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
13889 (struct symbol): Renamed from struct symbol_s.
13890 (symbol): Renamed from symbol_t.
13891 * src/tables.c (vector_number): Renamed from vector_number_t.
13892 (action_number): Renamed from action_t.
13893 * src/tables.h (base_number): Renamed from base_t.
13894 * src/vcg.h (enum color): Renamed from enum color_e.
13895 (enum textmode): Renamed from enum textmode_e.
13896 (enum shape): Renamed from enum shape_e.
13897 (struct colorentry): Renamed from struct colorentry_s.
13898 (struct classname): Renamed from struct classname_s.
13899 (struct infoname): Renamed from struct infoname_s.
13900 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
13901 (enum decision): Renamed from enum decision_e.
13902 (enum orientation): Renamed from enum orientation_e.
13903 (enum alignment): Renamed from enum alignment_e.
13904 (enum arrow_mode): Renamed from enum arrow_mode_e.
13905 (enum crossing_type): Renamed from enum crossing_type_e.
13906 (enum view): Renamed from enum view_e.
13907 (struct node): Renamed from struct node_s.
13908 (node): Renamed from node_t.
13909 (enum linestyle): Renamed from enum linestyle_e.
13910 (enum arrowstyle): Renamed from enum arrowstyle_e.
13911 (struct edge): Renamed from struct edge.
13912 (edge): Renamed from edge_t.
13913 (struct graph): Renamed from struct graph_s.
13914 (graph): Renamed from graph_t.
13915 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
13916 Rename value_t -> value.
13917 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
13918 value_t_as_yystype -> value_as_yystype.
13919
13920 Don't include <errno.h> in the mainstream code, since it
13921 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
13922 * lib/get-errno.c, lib/get-errno.h: New files.
13923 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
13924 get-errno.c.
13925 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
13926 * src/output.c (output_skeleton): Likewise.
13927 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
13928 instead of errno.
13929 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
13930 Likewise.
13931 (handle_action_dollar, handle_action_at): Likewise.
13932 * src/system.h: Do not include <errno.h>.
13933 (TAB_EXT): Renamed from EXT_TAB.
13934 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
13935
13936 Avoid str[a-z]*, since <string.h> reserves that name space.
13937 Change all instances of "struniq" in names to "uniqstr", and
13938 likewise for "STRUNIQ" and "UNIQSTR".
13939 * src/uniqstr.c: Renamed from src/struniq.c.
13940 * src/uniqstr.h: Renamed from src/struniq.h.
13941 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
13942 * src/files.c (strsuffix): Remove; unused.
13943 (concat2): Renamed from stringappend. Now static.
13944 * src/files.h (strsuffix, stringappend): Remove; unused.
13945 * src/parse-gram.y (<chars>): Renamed from <string>.
13946 (<uniqstr>): Renamed from <struniq>.
13947 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
13948 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
13949 (struct graph_s.expand): Renamed from struct graph_s.stretch.
13950 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
13951 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
13952 (N_EXPAND): Renamed from N_STRETCH.
13953
13954 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
13955 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
13956 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
13957 Remove; unused.
13958 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
13959 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
13960 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
13961 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
13962 (BASE_MAXIMUM): Renamed from BASE_MAX.
13963 (BASE_MINIMUM): Renamed from BASE_MIN.
13964 (ACTION_MAX): Remove; unused.
13965 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
13966 Unnecessary casts removed from above defines.
13967
13968
13969 Fix misspelling in names.
13970 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
13971 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
13972 G_NODE_ALIGNEMENT.
13973
13974
13975 * lib/timevar.c (timevar_report): Renamed from time_report,
13976 for consistency with other names.
13977 * lib/timevar.h (timevar_report): New decl.
13978 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
13979
13980
13981 Sort include-file uses.
13982
13983 Reorder all include files under src to be in the order "system.h".
13984 then the ../lib include files in angle brackets (alphabetized),
13985 then the . include files in double-quotes (alphabetized). Fix
13986 dependency breakages encountered in this process, as follows:
13987 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
13988 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
13989 * src/state.h: Include "symtab.h".
13990
996b1c7e
PE
139912002-12-08 Paul Eggert <eggert@twinsun.com>
13992
13993 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
13994 since this causes problems when __file__ contains character
13995 sequences like "@" that are treated specially by src/scan-skel.l.
13996 Instead, just use the file's basename. This fixes the bug
13997 reported by Martin Mokrejs in
161a71f3 13998 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 13999
e19c4e5d
PE
140002002-12-06 Paul Eggert <eggert@twinsun.com>
14001
14002 Add support for rules that do not have trailing semicolons, as
14003 POSIX requires. Improve the quality of locations in Bison
14004 diagnostics.
26b4a969 14005
e19c4e5d
PE
14006 * src/location.c: Include <quotearg.h>.
14007 (empty_location): Now const.
14008 (location_print): New function. Follow the recommendation of the
14009 GNU Coding Standards for locations that span file boundaries.
14010 * src/location.h: Do not include <quotearg.h>; no longer needed.
14011 (boundary): New type.
14012 (location_t): Use it. This allows locations to span file boundaries.
14013 All member uses changed: file -> start.file or end.file (as needed),
14014 first_line -> start.line, first_column -> start.column,
14015 last_line -> end.line, last_column -> end.column.
14016 (equal_boundaries): New function.
14017 (LOCATION_RESET, LOCATION_STEP): Remove.
14018 (LOCATION_PRINT): Remove. All callers changed to use location_print.
14019 (empty_location): Now const.
14020 (location_print): New decl.
14021 * src/parse-gram.y (lloc_default): New function, which handles
14022 empty locations more accurately.
14023 (YYLLOC_DEFAULT): Use it.
14024 (%token COLON): Remove.
14025 (%token ID_COLON): New token.
26b4a969 14026 (rules): Use it.
e19c4e5d
PE
14027 (declarations, rules): Remove trailing semicolon.
14028 (declaration, rules_or_grammar_declaration):
14029 Allow empty (";") declaration.
14030 (symbol_def): Remove empty actions; no longer needed.
14031 (rules_or_grammar_declaration): Remove trailing semicolon.
14032 (semi_colon.opt): Remove.
14033 * src/reader.h: Include location.h.
14034 (scanner_cursor): New decl.
14035 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
14036 rolling our own.
14037 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
14038 of *loc.
14039 (STEP): Remove. No longer needed, now that adjust_location does
14040 the work. All uses removed.
14041 (scanner_cursor): New var.
14042 (adjust_location): Renamed from extend_location. It now sets
14043 *loc and adjusts the scanner cursor. All uses changed.
14044 Don't bother testing for CR.
14045 (handle_syncline): Remove location arg; now updates scanner cursor.
14046 All callers changed.
14047 (unexpected_end_of_file): Now accepts start boundary of token or
14048 comment, not location. All callers changed. Update scanner cursor,
14049 not the location.
14050 (SC_AFTER_IDENTIFIER): New state.
14051 (context_state): Renamed from c_context. All uses changed.
14052 (id_loc, code_start, token_start): New local vars.
14053 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
14054 processing of Yacc white space and equivalents here.
14055 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
14056 instead of returning ID immediately, since we need to search for
14057 a subsequent colon.
14058 (<INITIAL>"'", "\""): Save token_start.
14059 (<INITIAL>"%{", "{", "%%"): Save code_start.
14060 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
14061 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
14062 BEGIN context_state at end, not INITIAL.
14063 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
14064 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
14065 Return correct token start.
14066 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
14067 the start of a character, string or multiline comment is found.
14068 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
14069 Reduction): Adjust reported locations to match the more-precise
14070 results now expected.
14071 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
14072 * tests/reduce.at (Useless Rules, Reduced Automaton,
14073 Underivable Rules): Likewise.
14074 * tests/regression.at (Invalid inputs): No longer `expecting ";"
14075 or "|"' now that so many other tokens are allowed by the new grammar.
14076
14077 * src/complain.h (current_file): Remove duplicate decl;
14078 current_file is now owned by files.h.
14079 * src/complain.c, src/scan-gram.l: Include files.h.
14080
140812002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 14082
e19c4e5d
PE
14083 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
14084 promotes to int; it might be unsigned int.
14085 * data/yacc.c (yy_reduce_print): Likewise.
14086
14087 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
14088 be #defined in the prologue, not in the Bison declarations.
14089 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 14090
b64755e3
PE
140912002-12-02 Paul Eggert <eggert@twinsun.com>
14092
14093 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
14094 * lib/strtoul.c: New file, from gnulib.
14095 This fixes a porting bug reported by Peter Klein in
161a71f3 14096 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 14097
6e746484
PE
140982002-11-30 Paul Eggert <eggert@twinsun.com>
14099
b64755e3
PE
14100 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
14101 and put only a forward declaration in the prologue. This is for
14102 consistency with the other scanner helper functions.
14103
6ba55592
PE
14104 Type clashes now generate warnings, not errors, since it
14105 appears that POSIX may allow some grammars with type clashes.
14106 * src/reader.c (grammar_current_rule_check): Warn about
14107 type clashes instead of complaining.
14108 * tests/input.at (Type Clashes): Expect warnings, not complaints.
14109
6e746484
PE
14110 Add Yacc library, since POSIX requires it.
14111 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
14112 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
14113 * lib/main.c, lib/yyerror.c: New files.
14114
14115 gram_error can be static; it need not be extern.
14116 * src/reader.h (gram_error): Remove decl.
14117 * src/parse-gram.y (gram_error): Now static. Add static decl.
14118 (print_token_value): Omit parameter names from forward decl,
14119 for consistency.
14120
88510f9c
PE
141212002-11-29 Paul Eggert <eggert@twinsun.com>
14122
6e746484
PE
14123 * doc/bison.texinfo: Emphasize that yylex and yyerror must
14124 be declared before being used. E.g., one should typically
14125 declare them in the prologue. Use GNU coding style in examples.
14126 Put "const" consistently after the type it modifies. Mention
14127 that C99 supports "inline". Mention that yyerror traditionally
14128 returns "int".
14129
88510f9c
PE
14130 %parse-param and %lex-param now take just one argument, the
14131 declaration; the argument name is deduced from the declaration.
14132
14133 * doc/bison.texinfo (Parser Function, Pure Calling, Error
14134 Reporting, Table of Symbols): Document this.
14135 * src/parse-gram.y (add_param): New function.
14136 (COMMA): Remove.
14137 (declaration): Implement new rule for %parse-param and %lex-param.
14138 * src/scan-gram.l: "," now elicits a warning, rather than being
14139 a token; this is more compatible with byacc.
14140 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
14141
bb92250c
PE
141422002-11-27 Paul Eggert <eggert@twinsun.com>
14143
14144 Rename identifiers to avoid real and potential collisions.
14145
14146 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
14147 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 14148 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
14149 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
14150 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
14151 * src/parse-gram.y (print_token_value): Renamed from yyprint.
14152 All uses changed.
14153 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
14154 The name "yycontrol" violates the name space rules, and this stuff
14155 wasn't being used anyway.
14156 (input): Remove action; this stuff wasn't being used.
14157 (gram_error): Rename local variable yylloc -> loc.
14158 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
14159 (YY_DECL): Don't use "yy" at start of local variables.
14160 All uses changed, e.g., yylloc -> loc.
14161 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
14162 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
14163 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
14164 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
14165
14166 * src/parse-gram.y (gram_error): loc is now const *.
14167 * src/reader.h (gram_error): Likewise.
14168
3af4feb2
PE
141692002-11-24 Paul Eggert <eggert@twinsun.com>
14170
14171 Version 1.75c.
14172
14173 * tests/actions.at (Actions after errors): Use an output format
14174 more similar to that of the Printers and Destructors test.
14175 Test the position of the ';' token too.
14176 (Printers and Destructors): Likewise.
14177 (Printers and Destructors: %glr-parser): Remove for now, to avoid
14178 unnecessarily alarming people when the test fails.
14179
14180 * data/yacc.c (yyerrlab1): Move this label down, so that the
14181 parser does not discard the lookahead token if the user code
14182 invokes YYERROR. This change is required for POSIX conformance.
14183
14184 * lib/error.c: Sync with gnulib.
14185
141862002-11-22 Paul Eggert <eggert@twinsun.com>
14187
14188 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
14189 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
14190 * lib/xmalloc.c: Likewise.
26b4a969 14191
58004308
PE
141922002-11-20 Paul Eggert <eggert@twinsun.com>
14193
14194 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
14195
141962002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 14197
58004308
PE
14198 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
14199 should use `if (! x) abort ();' rather than `assert (x);', and
14200 anyway it's one less thing to worry about configuring.
14201
14202 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
14203 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
14204 and replace all instances of assert with abort.
14205 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
14206 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
14207
14208 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
14209 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
14210 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
14211 hash_find_entry, hash_rehash, hash_insert): Likewise.
14212 * src/conflicts.c (resolve_sr_conflict): Likewise.
14213 * src/lalr.c (set_goto_map, map_goto): Likewise.
14214 * src/nullable.c (nullable_compute): Likewise.
14215 * src/output.c (prepare_rules, token_definitions_output): Likewise.
14216 * src/reader.c (packgram, reader): Likewise.
14217 * src/state.c (state_new, state_free, state_transitions_set,
14218 state_reduction_find): Likewise.
14219 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
14220 symbol_pack): Likewise.
14221 * src/tables.c (conflict_row, pack_vector): Likewise.
14222 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
14223 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
14224 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
14225 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
14226
14227 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
14228 (ARGMATCH_CONSTRAINT): New macro.
14229 (ARGMATCH_ASSERT): Use it.
14230
14231 * src/system.h (verify): New macro.
14232 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
14233 rather than assert.
14234 * src/tables.c (tables_generate): Likewise.
14235
14236 * src/struniq.c (struniq_assert): Now returns void, and aborts
14237 if the assertion is false.
14238 (struniq_assert_p): Remove.
14239 * src/struniq.h: Likewise.
14240
76ae8198
PE
142412002-11-18 Paul Eggert <eggert@twinsun.com>
14242
14243 * data/glr.c (yygetLRActions): Replace `yyindex' with
14244 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
14245 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 14246 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 14247
d3c4e709
AD
142482002-11-18 Akim Demaille <akim@epita.fr>
14249
14250 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
14251 space.
14252 From Tim Van Holder.
14253
8d8a7238
PE
142542002-11-17 Paul Eggert <eggert@twinsun.com>
14255
14256 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
14257 to "SyntaxError" for consistency with my 2002-11-15 change.
14258
14259 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
14260 not define to {}, since this breaks the common use of `YYDPRINTF
14261 ((...));' if a single statement is desired (e.g. before `else').
14262 Work around GCC warnings by surrounding corresponding calls with
14263 {} if needed.
14264 (yyhasResolvedValue): Remove unused function.
14265 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
14266 loop body.
14267 (yyreportSyntaxError): Renamed from yyreportParseError.
14268 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
14269 All uses changed.
14270 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
14271 extern when possible. Remove unused initializations.
14272
b0937b22
AD
142732002-11-16 Akim Demaille <akim@epita.fr>
14274
14275 Augment the similarity between GLR and LALR traces.
14276
14277 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
14278 (YY_REDUCE_PRINT): New.
14279 (yyparse): Use them.
14280 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
14281 YYDPRINT here.
14282 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
14283 state reached after the reduction/recovery, since...
14284 (yyparse, yyprocessOneStack): Report the state we are entering in.
14285
c5e3e510
AD
142862002-11-16 Akim Demaille <akim@epita.fr>
14287
14288 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
14289 Add support for --trace=skeleton.
14290 * src/scan-skel.l: %option debug.
14291 Scan strings of non-@ or \n instead of character by character.
14292 (scan_skel): Handle trace_skeleton.
14293 (QPUTS): New.
14294 (@output_parser_name@, @output_header_name@): ``Restore'' their
14295 support (used to be M4 macros).
14296 * data/yacc.c: Quote larger chunks, a la glr.c.
14297 * data/lalr1.cc: Likewise.
14298 The header guards are no longer available, so use some other
14299 string than `YYLSP_NEEDED'.
14300
4c6cc1db
AD
143012002-11-16 Akim Demaille <akim@epita.fr>
14302
14303 Make the ``Printers and Destructors'' test more verbose, taking
14304 `yacc.c''s behavior as (possibly wrong) reference.
14305
14306 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
14307 instead of fprint on stdout.
14308 Set and report the last_line of the symbols.
14309 Consistently display values and locations.
14310
6d9e8019
PE
143112002-11-16 Paul Eggert <eggert@twinsun.com>
14312
14313 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
14314
6e649e65
PE
143152002-11-15 Paul Eggert <eggert@twinsun.com>
14316
b25d88f6
PE
14317 * tests/actions.at (Actions after errors): New test case.
14318
6e649e65
PE
14319 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
14320 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
14321 tests/action.at, tests/calc.at, tests/conflicts.at,
14322 tests/cxx-type.at, tests/regression.at:
14323 "parse error" -> "syntax error" for POSIX compatibility.
14324 "parsing stack overflow..." -> "parser stack overflow" so
14325 that code matches Bison documentation.
14326
0f39aab9
AD
143272002-11-15 Akim Demaille <akim@epita.fr>
14328
14329 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
14330 take two BRACED_CODE, not two string_content.
14331 Free the scanner's obstack when we are done.
14332 (code_content): New.
14333 * tests/calc.at: Adjust.
14334 * doc/bison.texinfo: Adjust.
14335 Also, make sure to include the `,' for these declarations.
14336
761c1926
AD
143372002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
14338
14339 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
14340 definition; avoids potential autoreconf problems.
14341
b0f98b10
AD
143422002-11-15 Akim Demaille <akim@epita.fr>
14343
14344 Always check the value returned by yyparse.
14345
14346 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
14347 returned by yyparse.
14348 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
14349 Adjust calls.
14350 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
14351 returned by yyparse.
14352
970785f1
PH
143532002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14354
14355 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
14356 on input.at test.
14357
8fcc7db1
PE
143582002-11-14 Paul Eggert <eggert@twinsun.com>
14359
7ec1b48e
PE
14360 * src/output.c (output_skeleton): Call xfopen instead of
14361 duplicating xfopen's body.
14362
cfff7583 14363 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 14364 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 14365
8fcc7db1
PE
14366 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
14367 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
14368 Group compiler. Instead, use "$CC -E bar.c". Include the .h
14369 file twice in the grammar, as an extra check.
14370
14371 * tests/input.at (Torturing the Scanner): Surround the
14372 backslash-newline tests with "#if 0", to make it less likely that
14373 we'll run into compiler bugs. Bring back solitary \ inside
14374 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 14375 test backslash-newline in C character constant.
8fcc7db1 14376
4e8d992c
AD
143772002-11-14 Akim Demaille <akim@epita.fr>
14378
14379 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
14380 status of the compiler.
f32b346d 14381 Calling `exit 1' is no longer needed.
4e8d992c
AD
14382 Reported by Nelson H. F. Beebe.
14383
9501dc6e
AD
143842002-11-14 Akim Demaille <akim@epita.fr>
14385
14386 * tests/atlocal.in (CPPFLAGS): We have config.h.
14387 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
14388 New.
14389 * tests/actions.at, tests/calc.at, tests/conflicts.at,
14390 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
14391 * tests/regression.at, tests/torture.at: Use them for all the
14392 grammars that are to be compiled.
14393 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
14394 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
14395 * doc/bison.texinfo (GLR Parsers): Document `inline'.
14396
18b519c0
AD
143972002-11-14 Akim Demaille <akim@epita.fr>
14398
14399 * doc/bison.texinfo: Various formatting changes (alignments in
14400 samples, additional @group/@end group, GCS in samples.
14401 Use @deffn instead of simple @table to define the directives,
14402 macros, variables etc.
14403
9a86cdb9
PE
144042002-11-13 Paul Eggert <eggert@twinsun.com>
14405
daa33def 14406 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 14407 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 14408
daa33def 14409 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 14410 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
14411 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
14412 * tests/headers.at (export YYLTYPE): Likewise.
14413
14414 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 14415 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 14416
9a86cdb9
PE
14417 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
14418 comments, since they're not portable. Use GNU coding style.
14419
9c1e26bd
AD
144202002-11-13 Akim Demaille <akim@epita.fr>
14421
14422 * data/yacc.c: Leave bigger chunks of quoted text.
14423 (YYDSYMPRINTF): New.
14424 Use it to report symbol activities.
14425 * data/glr.c (YYDSYMPRINTF): New.
14426 Use it.
14427
87f721cc
PE
144282002-11-12 Paul Eggert <eggert@twinsun.com>
14429
14430 Version 1.75b.
14431
14432 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
14433 (yyglrReduce): Return yyok, not 0.
14434 This should avoid the enumerated-type warnings reported
464c6927 14435 by Nelson H. F. Beebe in
161a71f3 14436 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
14437
14438 * lib/bbitset.h (BITSET_INLINE): Remove.
14439 * lib/bitset.h [! BITSET_INLINE]: Remove.
14440 (bitset_set, bitset_reset, bitset_test): Rename local vars
14441 to avoid shadowing warnings by GCC.
14442
14443 * data/glr.c (inline): Remove #define. It's the user's
14444 responsibility to #define it away, just like 'const'.
464c6927 14445 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 14446 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 14447
87f721cc
PE
14448 * Makefile.maint (po-check): Scan .l and .y files instead of the
14449 .c and the .h files that they generate. This fixes the bug
14450 reported by Tim Van Holder in:
161a71f3 14451 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
14452 Look for N_ as well as for _. Try to avoid matching #define for
14453 N_ and _.
14454 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
14455 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
14456 * src/scan-gram.l: Revamp regular expressions so that " and '
14457 do not confuse xgettext.
14458
14459 * src/struniq.h (struniq_new): Do not declare the return type
14460 to be 'const'; this violates the C standard.
14461 * src/struniq.c (struniq_new): Likewise.
14462
be14ade5
AD
144632002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
14464
14465 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
14466 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
14467 linker.
14468
05291fbc
AD
144692002-11-12 Akim Demaille <akim@epita.fr>
14470
14471 * Makefile.maint: Sync with Autoconf:
14472 (local_updates): New.
14473
1f5fd52e
AD
144742002-11-12 Akim Demaille <akim@epita.fr>
14475
14476 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
14477
283f1e64
AD
144782002-11-12 Akim Demaille <akim@epita.fr>
14479
14480 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
14481 locations.
14482
886b69d1
AD
144832002-11-12 Akim Demaille <akim@epita.fr>
14484
14485 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
14486 not yyvalue.
14487
3df37415
AD
144882002-11-12 Akim Demaille <akim@epita.fr>
14489
14490 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
14491 Use it to test the GLR parser.
14492
7bd6c77e
AD
144932002-11-12 Akim Demaille <akim@epita.fr>
14494
14495 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
14496 defines it.
14497 * data/glr.c (yystos): New.
14498 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
14499 (YYDSYMPRINT): New.
14500 (yyval): Don't define it, it is handled via M4.
14501 (yyrecoverParseError): Free verbosely the discarded symbols.
14502 * data/yacc.c (yysymprint): Remove, rather...
14503 (b4_yysymprint_generate): invoke.
14504 * data/c.m4 (b4_yysymprint_generate): New.
14505 Accept pointers as arguments, as opposed to the version from
14506 yacc.c.
14507 (b4_yydestruct_generate): Likewise.
14508 * tests/cations.at (Printers and Destructors): Use Bison directives
14509 instead of CPP macros.
14510 Don't rely on internal details.
14511
b0400cc6
AD
145122002-11-12 Akim Demaille <akim@epita.fr>
14513
14514 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
14515 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
14516 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
14517 it against YYEMPTY and so forth), work on yytoken (i.e., set
14518 it to YYEMPTY etc.).
14519 (yydestruct): Replace with a b4_yydestruct_generate invocation.
14520 (b4_symbol_actions): Remove.
14521 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
14522 for 0, end-of-input.
14523
72f889cc
AD
145242002-11-12 Akim Demaille <akim@epita.fr>
14525
14526 * doc/bison.texinfo (Destructor Decl): New.
14527
b1ae9233
AD
145282002-11-12 Akim Demaille <akim@epita.fr>
14529
14530 * src/tables.c (tables_generate): Use free for pointers that
14531 cannot be NULL, not XFREE.
14532 (pack_vector): Use assert, not fatal, for bound violations.
14533 * src/state.c (state_new): Likewise.
14534 * src/reader.c (reader): Likewise.
14535 * src/lalr.c (set_goto_map): Likewise.
72f889cc 14536 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
14537 the file name.
14538
7ec2d4cd
AD
145392002-11-12 Akim Demaille <akim@epita.fr>
14540
14541 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
14542 Restore.
14543 * src/scan-gram.l (last_string): Is global to the file, not to
14544 yylex.
14545 * src/parse-gram.y (input): Don't append the epilogue here,
14546 (epilogue.opt): do it here, and free the scanner's obstack.
14547 * src/reader.c (epilogue_set): Rename as...
14548 (epilogue_augment): this.
14549 * data/c.m4 (b4_epilogue): Defaults to empty.
14550
573a6cd3
AD
145512002-11-12 Akim Demaille <akim@epita.fr>
14552
14553 * src/getargs.c (long_options): Remove duplicates.
14554 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
14555 Remove.
14556 * doc/bison.rnh: Remove.
14557 * doc/bison.texinfo (VMS Invocation): Remove.
14558
95612cfa
AD
145592002-11-12 Akim Demaille <akim@epita.fr>
14560
14561 * src/struniq.h, src/struniq.c (struniq_t): Is const.
14562 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
14563
14564 Use struniq for symbols.
14565
14566 * src/symtab.h (symbol_t): The tag member is a struniq.
14567 (symbol_type_set): Adjust.
14568 * src/symtab.c (symbol_new): Takes a struniq.
14569 (symbol_free): Don't free the tag member.
14570 (hash_compare_symbol_t, hash_symbol_t): Rename as...
14571 (hash_compare_symbol, hash_symbol): these.
14572 Use the fact that tags as struniqs.
14573 (symbol_get): Use struniq_new.
14574 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
14575 Returns a strniq.
14576 * src/reader.h (merger_list, grammar_currentmerge_set): The name
14577 and type members are struniqs.
14578 * src/reader.c (get_merge_function)
14579 (grammar_current_rule_merge_set): Adjust.
14580 (TYPE, current_type): Are struniq.
14581
14582 Use struniq for file names.
14583
14584 * src/files.h, src/files.c (infile): Split into...
14585 (grammar_file, current_file): these.
14586 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
14587 * src/reduce.c (reduce_print): Likewise.
14588 * src/getargs.c (getargs): Likewise.
14589 * src/complain.h, src/complain.c: Likewise.
14590 * src/main.c (main): Call struniqs_new early enough to use it for
14591 file names.
14592 Don't free the input file name.
14593
3e6656f9
AD
145942002-11-12 Akim Demaille <akim@epita.fr>
14595
14596 * src/symtab.c (symbol_free): Remove dead deactivated code:
14597 type_name are properly removed.
14598 Don't use XFREE to free items that cannot be NULL.
14599 * src/struniq.h, src/struniq.c: New.
14600 * src/main.c (main): Initialize/free struniqs.
14601 * src/parse-gram.y (%union): Add astruniq member.
14602 (yyprint): Adjust.
14603 * src/scan-gram.l (<{tag}>): Return a struniq.
14604 Free the obstack bit that used to store it.
14605 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
14606
7672019c
PE
146072002-11-11 Paul Eggert <eggert@twinsun.com>
14608
14609 Revamp to fix many (but not all) of the C- and M4-related quoting
14610 problems. Among other things, this fixes the Bison bug reported
14611 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 14612 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
14613
14614 Use new @ escapes consistently. Represent brackets with @{ and @}
14615 rather than @<:@ and @:>@, since this works a bit better with dumb
14616 editors like vi. Represent @ with @@, since @ is now consistently
14617 an escape. Use @oline@ and @ofile@ rather than __oline__ and
14618 __ofile__, to avoid unexpected expansions. Similarly, use @output
14619 rather than #output.
14620
14621 * data/c.m4 (b4_copyright): Omit file name from comment, since
14622 the file name could contain "*/".
14623 (b4_synclines_flag): Don't quote the 2nd argument; it should already
14624 be quoted. All uses changed.
14625
14626 * data/glr.c: Use new @ escapes consistently.
14627 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
14628 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
14629 Remove, since they couldn't handle arbitrary characters in file
14630 names.
14631 * data/lalr1.cc: Likewise.
14632 * data/yacc.c: Likewise.
14633
14634 * src/files.c (output_infix): Remove; all uses removed.
14635 * src/files.h: Likewise.
14636
14637 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
14638 mishandled funny characters in file names, and anyway it isn't
14639 needed any more.
14640 * data/yacc.c: Likewise.
14641 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
14642
14643 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
14644 * data/yacc.c: Likewise.
14645
14646 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
14647 strings now.
14648 (muscle_init): Quote filename as a C string.
14649 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
14650 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
14651 * src/output.c (escaped_file_name_output): New function.
14652 (prepare_symbols): Quote tokens for M4.
14653 (prepare): Don't insert output_infix, output_prefix,
14654 output_parser_name, output_header_name; this is now down by scan-skel.
14655 Insert skeleton as a C string.
14656
14657 * src/output.c (user_actions_output, symbol_destructors_output,
14658 symbol_printers_output): Quote filenames for C and M4.
14659 * src/reader.c (prologue_augment, epilogue_set): Likewise.
14660
14661 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
14662 escapes other than \\ and \'; this simplifies the code.
14663 (<SC_STRING>): Likewise, for \\ and \".
14664 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
14665 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
14666 Use new escapes @{ and @} for [ and ].
14667
14668 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
14669 them with auto vars.
14670 Switch to new escape scheme, where @ is the escape character uniformly.
14671 Abort if a stray escape character is found. Avoid unbounded input
14672 buffer when parsing non-escaped text.
14673
14674 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
14675 __oline__, #output, $@, and @{ do not have unintended meanings.
14676
acea4f3b
PE
146772002-11-09 Paul Eggert <eggert@twinsun.com>
14678
14679 Fix the test failure due to GCC warnings described in
161a71f3 14680 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
14681 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
14682 evaluate to 0 if it's impossible for NINF to be in the respective
14683 table.
14684 (yygetLRActions, yyrecoverParseError): Use them.
14685
14686 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
14687 counted in the token inserted at end of file. Now takes
14688 location_t *, not location_t, so that the location can be
14689 adjusted. All uses changed.
14690
14691 * tests/regression.at (Invalid inputs): Adjust wording in
14692 diagnostic to match the new behavior.
14693
14694 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
14695 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
14696 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
14697 abort ();'. This reduces the runtime of the "Many lookaheads"
14698 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
14699 GCC 3.2.
14700
20ef1ad5
PE
147012002-11-07 Paul Eggert <eggert@twinsun.com>
14702
14703 * src/parse-gram.y (CHARACTER): Remove unused token.
14704 All uses removed.
14705
14706 * src/scan-gram.l: Remove stack option. We no longer use the
14707 stack, since the stack was never deeper than 1; instead, use the
14708 new auto var c_context to record the stacked value.
14709
14710 Remove nounput option. At an unexpected end of file, we now unput
14711 the minimal input necessary to end cleanly; this simplifies the
14712 code.
14713
14714 Avoid unbounded token sizes where this is easy.
14715
14716 (unexpected_end_of_file): New function.
14717 Use it to systematize the error message on unexpected EOF.
14718 (last-string): Now auto, not static.
14719 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
14720 (scanner_last_string_free): Remove; not used.
14721 (percent_percent_count): Move decl to just before use.
14722 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
14723 not the (never otherwised-used) CHARACTER.
14724
93724f13
AD
147252002-11-07 Akim Demaille <akim@epita.fr>
14726
14727 Let yyerror always receive the msg as last argument, so that
14728 yyerror can be variadic.
14729
14730 * data/yacc.c (b4_yyerror_args): New.
14731 Use it when calling yyerror.
14732 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
14733 Use it when calling yyerror.
14734 * doc/bison.texinfo (Error Reporting): Adjust.
14735 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
14736 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
14737
6e40b4eb
AD
147382002-11-06 Akim Demaille <akim@epita.fr>
14739
14740 #line should have quoted strings.
14741 Ideally, this should be done by m4_quotearg.
14742
14743 * src/scan-skel.l: Include quotearg.h.
14744 Quote __ofile__.
14745 * src/output.c (symbol_printers_output)
14746 (symbol_destructors_output): Quote the file name.
14747
2dfbfc12
AD
147482002-11-06 Akim Demaille <akim@epita.fr>
14749
14750 * tests/regression.at (Invalid inputs): Adjust to the recent
14751 messages.
14752
437c2d80
AD
147532002-11-06 Akim Demaille <akim@epita.fr>
14754
14755 Restore --no-lines.
14756 Reported by Jim Kent.
14757
14758 * data/c.m4 (b4_syncline): New.
14759 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
14760 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
14761 * src/output.c (user_actions_output): Likewise.
14762 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 14763 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 14764
900c5db5
AD
147652002-11-06 Akim Demaille <akim@epita.fr>
14766
14767 * src/main.c (main): Free `infile'.
14768 * src/scan-gram.l (handle_syncline): New.
14769 Recognize `#line'.
14770 * src/output.c (user_actions_output, symbol_destructors_output)
14771 (symbol_printers_output): Use the location's file name, not
14772 infile.
14773 * src/reader.c (prologue_augment, epilogue_set): Likewise.
14774
e183b123 147752002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 14776
e183b123 14777 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 14778 either has GLR conflict entries.
e183b123 14779
193eb6b7
PE
147802002-11-05 Paul Eggert <eggert@twinsun.com>
14781
e183b123
PE
14782 * src/scan-gram.l: Use more accurate diagnostics, e.g.
14783 "integer out of range" rather than "invalid value".
14784 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
14785 accordingly.
14786
193eb6b7
PE
14787 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
14788 Also, remove one static variable in the scanner.
14789
14790 * src/scan-gram.l (braces_level): Now auto, not static.
14791 Initialize to zero if the compiler is being picky.
14792 (INITIAL): Clear braces_level instead of incrementing it.
14793 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
14794 as POSIX 1003.1-2001 requires.
14795 * src/system.h (IF_LINT): New macro, taken from coreutils.
14796 * configure.ac: Define "lint" if --enable-gcc-warnings.
14797
29c01725
AD
147982002-11-05 Akim Demaille <akim@epita.fr>
14799
14800 * src/scan-gram.l: When it starts with `%', complain about the
14801 whole directive, not just that `invalid character: %'.
14802
8aeac3ca
AD
148032002-11-04 Akim Demaille <akim@epita.fr>
14804
14805 * Makefile.maint: Update from Autoconf.
14806 (update, cvs-update, po-update, do-po-update): New.
14807
793a58bb
AD
148082002-11-04 Akim Demaille <akim@epita.fr>
14809
14810 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
14811 and yyerror.
14812 Have yyerror `use' its arguments.
14813 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
14814 returns true when location & yacc & pure & parse-param.
14815 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
14816
c4d720cd
AD
148172002-11-04 Akim Demaille <akim@epita.fr>
14818
14819 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
14820 clashes.
14821 * src/scan-gram.l: Use [\'] instead of ['] to pacify
14822 font-lock-mode.
14823 Use complain_at.
14824 Use quote, not quote_n since LOCATION_PRINT no longer uses the
14825 slot 0.
14826
613a0dc5
PE
148272002-11-03 Paul Eggert <eggert@twinsun.com>
14828
14829 * src/reader.c (get_merge_function, grammar_current_rule_check):
14830 Use consistent diagnostics for reporting type name clashes.
14831 Quote the types with <>, for consistency with Yacc.
14832 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
14833
2a8d363a
AD
148342002-11-03 Akim Demaille <akim@epita.fr>
14835
14836 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
14837 New.
14838 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
14839 (b4_parse_param): Remove.
14840 Use b4_identification.
14841 Propagate b4_pure_args where needed to pass them to yyerror.
14842 * data/glr.m4 (b4_parse_param): Remove.
14843 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
14844 (b4_lpure_formals): New.
14845 Use b4_identification.
14846 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
14847 b4_user_formals and b4_user_args.
14848 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
14849 (yyreportAmbiguity): When using a pure parser, also need
14850 the location, and the parse-params.
14851 Adjust callers.
14852 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
14853 When using a pure parser, also need the parse-params.
14854 Adjust callers.
14855 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
14856 (%pure-parser + %parse-param) LALR and GLR parsers.
14857 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
14858 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
14859 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
14860 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
14861 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
14862 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
14863 * doc/bison.texinfo: Untabify the whole file.
14864 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
14865 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
14866 (Error Reporting): Adjust to these new directives.
14867 Document %error-verbose, deprecate YYERROR_VERBOSE.
14868
9e32add8
AD
148692002-11-03 Akim Demaille <akim@epita.fr>
14870
14871 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
14872 AT_CHECK_CALC_GLR invocations to use % directives, instead of
14873 command line options.
14874 * tests/cxx-type.at: Formatting changes.
14875
b02d90a5
PE
148762002-11-03 Paul Eggert <eggert@twinsun.com>
14877
14878 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
14879 to count columns correctly, and to check for invalid inputs.
9e32add8 14880
b02d90a5
PE
14881 Use mbsnwidth to count columns correctly. Account for tabs, too.
14882 Include mbswidth.h.
14883 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
14884 (extend_location): New function.
14885 (YY_LINES): Remove.
14886
14887 Handle CRLF in C code rather than in Lex code.
14888 (YY_INPUT): New macro.
14889 (no_cr_read): New function.
14890
14891 Scan UCNs, even though we don't fully handle them yet.
14892 (convert_ucn_to_byte): New function.
14893
14894 Handle backslash-newline correctly in C code.
14895 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
14896 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
14897 all uses changed.
14898 (tag, splice): New EREs. Do not allow NUL or newline in tags.
14899 Use {splice} wherever C allows backslash-newline.
14900 YY_STEP after space, newline, vertical-tab.
14901 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 14902
b02d90a5
PE
14903 (letter, id): Don't assume ASCII; e.g., spell out a-z.
14904
14905 ({int}, handle_action_dollar, handle_action_at): Check for integer
14906 overflow.
9e32add8 14907
b02d90a5
PE
14908 (YY_STEP): Omit trailing semicolon, so that it's more like C.
14909
14910 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
14911 as well as \000. Check for UCHAR_MAX, not 255.
14912 Allow \x with an arbitrary positive number of digits, as in C.
14913 Check for overflow here.
14914 Allow \? and UCNs, for compatibility with C.
14915
14916 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
14917 with quote slot used by complain_at.
14918
14919 * tests/input.at: Add tests for backslash-newline, m4 quotes
14920 in symbols, long literals, and funny escapes in strings.
14921
14922 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
14923 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
14924 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
14925 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
14926 * m4/mbswidth.m4: New file, from GNU coreutils.
14927
14928 * doc/bison.texinfo (Grammar Outline): Document // comments.
14929 (Symbols): Document that trigraphs have no special meaning in Bison,
14930 nor is backslash-newline allowed.
14931 (Actions): Document that trigraphs have no special meaning.
14932
14933 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
14934 no longer used.
14935
149362002-11-02 Paul Eggert <eggert@twinsun.com>
14937
14938 * src/reader.c: Don't include quote.h; not needed.
14939 (get_merge_function): Reword warning to be consistent with
14940 type clash diagnostic in grammar_current_rule_check.
14941
14942 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
14943 bug in trigraph handling.
14944
14945 * src/output.c (prepare_symbols): When printing token names,
14946 escape "[" as "@<:@" and likewise for "]".
14947
14948 * src/system.h (errno): Remove declaration, as we are now
14949 assuming C89 or better, and C89 guarantees errno.
14950
762b212b
PE
149512002-10-30 Paul Eggert <eggert@twinsun.com>
14952
14953 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
14954 Check for close failures.
14955 * src/files.h (xfclose): Return void, not int, since it always
14956 returned zero.
14957 * src/files.c (xfclose): Likewise. Report I/O error if ferror
14958 indicates one.
14959 * src/output.c (output_skeleton): Use xfclose rather than fclose
14960 and ferror. xfclose now checks ferror.
14961
14962 * data/glr.c (YYLEFTMOST_STATE): Remove.
14963 (yyreportTree): Use a stack-based leftmost state. This avoids
14964 our continuing battles with bogus warnings about initializers.
14965
56100c60
AD
149662002-10-30 Akim Demaille <akim@epita.fr>
14967
14968 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
14969 #if.
14970
51b4a04c
PH
149712002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14972
14973 * tests/glr-regr1.at: New test for reported regressions.
14974 * tests/testsuite.at: Add glr-regr1.at test.
14975 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 14976
bf1ebda2
PE
149772002-10-24 Paul Eggert <eggert@twinsun.com>
14978
5c16c6b1
PE
14979 Version 1.75a.
14980
bf1ebda2
PE
14981 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
14982 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
14983 we use malloc. Don't assume 'A' through 'Z' are contiguous.
14984 Don't assume strdup exists; POSIX says its an XSI extension.
14985 Check for buffer overflow on input.
14986
b526ee61
AD
149872002-10-24 Akim Demaille <akim@epita.fr>
14988
14989 * src/output.c (output_skeleton): Don't disable M4sugar comments
14990 too soon: it results in comments being expanded.
14991 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
14992 first output.
14993
f1886bb2
AD
149942002-10-24 Akim Demaille <akim@epita.fr>
14995
14996 * data/yacc.c (m4_int_type): New.
14997 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
14998 char' as only yacc.c wants K&R portability.
14999 * data/glr.c (yysigned_char): Remove.
15000 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
15001 Reported by Quoc Peyrot.
15002
c5576256
PE
150032002-10-23 Paul Eggert <eggert@twinsun.com>
15004
15005 * src/main.c (main): With --trace=time, report times even if a
15006 non-fatal error occurs. Formerly, the times were reported in some
15007 such cases but not in others.
15008 * src/reader.c (reader): Just return if a complaint has been issued,
15009 instead of exiting, so that 'main' can report times.
15010
27b0ffea
AD
150112002-10-22 Akim Demaille <akim@epita.fr>
15012
15013 * src/system.h: Include sys/types.
15014 Reported by Bert Deknuydt.
15015
223a7883
PE
150162002-10-23 Paul Eggert <eggert@twinsun.com>
15017
15018 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
15019 Suggested by Art Haas.
15020
150212002-10-22 Paul Eggert <eggert@twinsun.com>
15022
15023 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
15024 decl; not needed any more.
15025 * src/main.c (main): Use return to exit, undoing yesterday's change.
15026 The last OS that we could find where this wouldn't work is
15027 SunOS 3.5, and that's too old to worry about now.
15028
15029 * data/glr.c (struct yyltype): Define members even when not
15030 doing locations. This is more consistent with yacc.c, and it
15031 works around the following bug reports:
161a71f3
PE
15032 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
15033 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 15034
223a7883
PE
15035 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
15036 @acronym consistently. Standardize on "Yacc" instead of "YACC",
15037 "Algol" instead of "ALGOL". Give a bit more history about BNF.
15038
8b76775a
AD
150392002-10-22 Akim Demaille <akim@epita.fr>
15040
15041 * data/README: New.
15042
6db10d14
PE
150432002-10-21 Paul Eggert <eggert@twinsun.com>
15044
15045 Be consistent about 'bool'; the old code used an enum in one
15046 module and an int in another, and this violates the C standard.
15047 * m4/stdbool.m4: New file, from coreutils 4.5.3.
15048 * configure.ac (AC_HEADER_STDBOOL): Add.
15049 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
15050 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
15051 * src/symtab.c (hash_compare_symbol_t): Likewise.
15052 * src/system.h (bool, false, true): Use a definition consistent
15053 with ../lib/hash.c. All uses changed.
15054
15055 * src/complain.c (warning_issued): Renamed from warn_message_count,
15056 so that we needn't worry about integer overflow (!).
15057 Now of type bool. All uses changed.
15058 (complaint_issued): Renamed from complain_message_count; likewise.
15059
15060 * src/main.c (main): Use exit to exit with failure.
27b0ffea 15061
6db10d14
PE
15062 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
15063 rather than 1 and 0.
15064 * src/main.c (main): Likewise.
15065 * src/getargs.c (getargs): Likewise.
15066 * src/reader.c (reader): Likewise.
15067
15068 * src/getarg.c (getargs): Remove duplicate code for
15069 "Try `bison --help'".
15070
15071 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
15072 What was that "2" for?
15073
15074 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
15075 * src/getargs.c (usage): Likewise.
15076
15077 * src/getargs.c (getargs): When there are too few operands, report
15078 the last one. When there are too many, report the first extra
15079 one. This is how diffutils does it.
15080
92a060fd
PE
150812002-10-20 Paul Eggert <eggert@twinsun.com>
15082
15083 Remove K&R vestiges.
15084 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
15085 * src/complain.c (VA_START): Remove. Assume prototypes.
15086 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
15087 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
15088 fatal): Assume prototypes.
15089 * src/complain.h: Assume prototypes.
15090 * src/system.h (PARAMS): Remove.
15091 Include <limits.h> unconditionally, since it's guaranteeed even
15092 for a freestanding C89 compiler.
15093 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
15094 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 15095
e7cb57c0
AD
150962002-10-20 Akim Demaille <akim@epita.fr>
15097
15098 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
15099 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
15100 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
15101 (yyresolveStates, yyresolveAction, yyresolveStack)
15102 (yyprocessOneStack): Use them.
15103 (yy_reduce_print): New.
15104 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
15105
0245f82d
AD
151062002-10-20 Akim Demaille <akim@epita.fr>
15107
15108 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
15109 arguments and output `void'.
15110 (b4_c_function): Rename as...
15111 (b4_c_function_def): this.
15112 (b4_c_function_decl, b4_c_ansi_function_def)
15113 (b4_c_ansi_function_decl): New.
15114 Change the interpretation of the arguments: before `int, foo', now
15115 `int foo, foo'.
15116 * data/yacc.c (yyparse): Prototype and define thanks to these.
15117 Adjust b4_c_function_def uses.
15118 * data/glr.c (yyparse): Likewise, but ANSI only.
15119
39912f52
AD
151202002-10-20 Akim Demaille <akim@epita.fr>
15121
15122 * src/output.c (prepare): Move the definition of `tokens_number',
15123 `nterms_number', `undef_token_number', `user_token_number_max'
15124 to...
15125 (prepare_tokens): Here.
15126 (prepare_tokens): Rename as...
15127 (prepare_symbols): this.
15128 (prepare): Move the definition of `rules_number' to...
15129 (prepare_rules): here.
15130 (prepare): Move the definition of `last', `final_state_number',
15131 `states_number' to...
15132 (prepare_states): here.
15133 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
15134
20c1e2ad
AD
151352002-10-20 Akim Demaille <akim@epita.fr>
15136
15137 * src/tables.h, src/tables.c, src/output.c: Comment changes.
15138
21964f43
AD
151392002-10-20 Akim Demaille <akim@epita.fr>
15140
15141 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
15142 * data/c.m4: here.
15143
66d30cd4
AD
151442002-10-20 Akim Demaille <akim@epita.fr>
15145
15146 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
15147 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
15148 `pair'.
15149 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
15150 `name' to...
15151 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
15152 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
15153 These.
15154
95f2c9fe
PE
151552002-10-19 Paul Eggert <eggert@twinsun.com>
15156
15157 Do not create a temporary file, as that involves security and
15158 cleanup headaches. Instead, use a pair of pipes.
15159 Derived from a suggestion by Florian Krohm.
15160 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
15161 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
15162 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
15163 (BISON_PREREQ_SUBPIPE): Add.
15164 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
15165 Add subpipe.h, subpipe.c.
15166 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
15167 * po/POTFILES.in: Add lib/subpipe.c.
15168 * src/output.c: Include "subpipe.h".
15169 (m4_invoke): Remove decl.
15170 (scan_skel): New decl.
15171 (output_skeleton): Use pipe rather than temporary file for m4 input.
15172 Check that m4sugar.m4 is readable, to avoid deadlock.
15173 Check for pipe I/O error.
15174 * src/scan-skel.l (readpipe): Remove decl.
15175 (scan_skel): New function, to be used in place of m4_invoke.
15176 Read from stream rather than file.
66d30cd4 15177
95f2c9fe
PE
15178 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
15179 float, as this generates a warning on Solaris 8 + GCC 3.2 with
15180 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
15181 this generates a more-accurate value anyway.
15182
15183 * lib/timevar.c (timervar_accumulate): Rename locals to
15184 avoid confusion with similarly-named more-global.
15185 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
15186
15187 * src/output.c (prepare): Use xstrdup to convert char const *
15188 to char *, to avoid GCC warning.
15189
c19988b7
AD
151902002-10-19 Akim Demaille <akim@epita.fr>
15191
15192 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
15193 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
15194 Use them to have `calc.y' ready for %pure-parser.
15195 * data/yacc.c (YYLEX): Pass a yylex return type to
15196 b4_c_function_call.
15197
ae7453f2
AD
151982002-10-19 Akim Demaille <akim@epita.fr>
15199
15200 Prototype support of %lex-param and %parse-param.
15201
15202 * src/parse-gram.y: Add the definition of the %lex-param and
15203 %parse-param tokens, plus their rules.
15204 Drop the `_' version of %glr-parser.
15205 Add the "," token.
15206 * src/scan-gram.l (INITIAL): Scan them.
15207 * src/muscle_tab.c: Comment changes.
15208 (muscle_insert, muscle_find): Rename `pair' as `probe'.
15209 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
15210 (muscle_entry_s): The `value' member is no longer const.
15211 Adjust all dependencies.
15212 * src/muscle_tab.c (muscle_init): Adjust: use
15213 MUSCLE_INSERT_STRING.
15214 Initialize the obstack earlier.
15215 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
15216 (muscle_pair_list_grow): New.
15217 * data/c.m4 (b4_c_function_call, b4_c_args): New.
15218 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
15219 * tests/calc.at: Use %locations, not --locations.
15220 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
15221
0e575721
AD
152222002-10-19 Akim Demaille <akim@epita.fr>
15223
15224 * src/getargs.c (usage): Take status as argument and exit
15225 accordingly.
15226 Report the traditional `Try ... --help' message when status != 0.
15227 (usage, version): Don't take a FILE * as arg, it is pointless.
15228 (getargs): When there is an incorrect number of arguments, make it
15229 an error, and report it GNUlically thanks to `usage ()'.
15230
724ce7f5
PE
152312002-10-18 Paul Eggert <eggert@twinsun.com>
15232
3a781eb2
PE
15233 * data/glr.c (yyreportParseError): Don't assume that sprintf
15234 yields the length of the printed string, as this is not true
15235 on SunOS 4.1.4. Reported by Peter Klein.
15236
724ce7f5
PE
15237 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
15238 * tests/conflicts.at (%nonassoc and eof): Likewise.
15239 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
15240
473d0a75
AD
152412002-10-17 Akim Demaille <akim@epita.fr>
15242
15243 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
15244 * src/getargs.c (trace_types, trace_args): Adjust.
15245 * src/reader.c (grammar_current_rule_prec_set)
15246 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
15247 Standardize error messages.
15248 And s/@prec/%prec/!
15249 (reader): Use trace_flag to enable scanner/parser debugging,
15250 instead of an adhoc scheme.
15251 * src/scan-gram.l: Remove trailing debugging code.
15252
e76d2469
PE
152532002-10-16 Paul Eggert <eggert@twinsun.com>
15254
93e2236a
PE
15255 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
15256 MUSCLE_TAB_H.
15257
e76d2469
PE
15258 * NEWS: Officially drop support for building Bison with K&R C,
15259 since it didn't work anyway and it's not worth worrying about.
15260 * Makefile.maint (wget_files): Remove ansi2knr.c.
15261 (ansi2knr.c-url_prefix): Remove.
15262 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
15263 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
15264 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
15265
5bd1c419
PE
152662002-10-15 Paul Eggert <eggert@twinsun.com>
15267
15268 Stop using the "enum_" trick for K&R-style function definitions;
15269 it confused me, and I was the author! Instead, assume that people
15270 who want to use K&R C compilers (when using these modules in GCC,
15271 perhaps?) will run ansi2knr.
15272
15273 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
15274 All uses of "enum_" changed to "enum ".
15275 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
15276 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 15277
5bd1c419
PE
15278 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
15279 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
15280 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
15281 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
15282 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
15283 abitset_not, abitset_ones, abitset_or, abitset_or_and,
15284 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
15285 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
15286 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
15287 Use function prototypes; this removes the need for declaring
15288 static functions simply to provide their prototypes.
15289 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
15290 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
15291 bitset_count_, bitset_create, bitset_dump, bitset_first,
15292 bitset_free, bitset_init, bitset_last, bitset_next,
15293 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
15294 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
15295 bitset_print, bitset_release_memory, bitset_toggle_,
15296 bitset_type_choose, bitset_type_get, bitset_type_name_get,
15297 debug_bitset): Likewise.
15298 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
15299 * lib/bitset_stats.c (bitset_log_histogram_print,
15300 bitset_percent_histogram_print, bitset_stats_and,
15301 bitset_stats_and_cmp, bitset_stats_and_or,
15302 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
15303 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
15304 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
15305 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
15306 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
15307 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
15308 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
15309 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
15310 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
15311 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
15312 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
15313 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
15314 bitset_stats_zero): Likewise.
15315 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
15316 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
15317 bitsetv_dump, debug_bitsetv): Likewise.
15318 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
15319 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
15320 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
15321 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
15322 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
15323 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
15324 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
15325 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
15326 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
15327 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
15328 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
15329 Likewise.
15330 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
15331 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
15332 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
15333 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
15334 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
15335 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
15336 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
15337 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
15338 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
15339 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
15340 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 15341
ae26e1f0
AD
153422002-10-14 Akim Demaille <akim@epita.fr>
15343
15344 Version 1.75.
15345
d43baf71
AD
153462002-10-14 Akim Demaille <akim@epita.fr>
15347
15348 * tests/Makefile.am (maintainer-check-posix): New.
15349
7ebc83e3
AD
153502002-10-14 Akim Demaille <akim@epita.fr>
15351
15352 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
15353 member.
15354
05846dae
AD
153552002-10-14 Akim Demaille <akim@epita.fr>
15356
15357 * src/tables.c (table_ninf_remap): base -> tab.
15358 Reported by Matt Rosing.
15359
1318e37d
PE
153602002-10-14 Paul Eggert <eggert@twinsun.com>
15361
447fbb17
PE
15362 * tests/action.at, tests/calc.at, tests/conflicts.at,
15363 tests/cxx-type.at, tests/headers.at, tests/input.at,
15364 tests/regression.at, tests/synclines.at, tests/torture.at:
15365 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
15366 so that the tests still work even if POSIXLY_CORRECT is set.
15367 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 15368
1318e37d
PE
15369 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
15370 for portability to K&R hosts. Fix typo: signed char is guaranteed
15371 only to 127, not to 128.
15372 * data/glr.c (yysigned_char): New type.
15373 * data/yacc.c (yysigned_char): Likewise.
15374 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
15375
cc0f0794
PE
153762002-10-13 Paul Eggert <eggert@twinsun.com>
15377
5038f418
PE
15378 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
15379 true due to limited range of data type" warning from GCC.
15380
cc0f0794
PE
15381 * data/c.m4 (b4_token_defines): Protect against double-inclusion
15382 by wrapping enum yytokentype's definition inside #ifndef
15383 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
15384
6fed0802
AD
153852002-10-13 Akim Demaille <akim@epita.fr>
15386
15387 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
15388 Un yy- yyrhs to avoid the name clash with the global YYRHS.
15389
32f0598d
AD
153902002-10-13 Akim Demaille <akim@epita.fr>
15391
15392 * Makefile.maint: Update from Autoconf 2.54.
15393 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
15394
7ea9a33f
AD
153952002-10-13 Akim Demaille <akim@epita.fr>
15396
15397 * src/print.c (print_state): Separate the list of solved conflicts
15398 from the other items.
15399 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
15400
ea99527d
AD
154012002-10-13 Akim Demaille <akim@epita.fr>
15402
15403 Let nondeterministic skeletons be usable with deterministic
15404 tables.
15405
15406 With the patch, GAWK compiled by GCC without -O2 passes its test
15407 suite using a GLR parser driven by LALR tables. It fails with -O2
15408 because `struct stat' gives two different answers on my machine:
15409 88 (definition of an auto var) and later 96 (memset on this var).
15410 Hence the stack is badly corrumpted. The headers inclusion is to
15411 blame: if I move the awk.h inclusion before GLR's system header
15412 inclusion, the two struct stat have the same size.
15413
15414 * src/tables.c (pack_table): Always create conflict_table.
15415 (token_actions): Always create conflict_list.
15416 * data/glr.c (YYFLAG): Remove, unused.
15417
f377f69f
AD
154182002-10-13 Akim Demaille <akim@epita.fr>
15419
15420 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
15421 (O0FLAGS): New.
15422 (VALGRIND, GXX): New.
15423 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
15424 * tests/bison.in: Run $PREBISON a pre-command.
15425 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
15426 (maintainer-check-g++): New.
15427 * Makefile.am (maintainer-check): New.
15428
2a1fe6ed
AD
154292002-10-13 Akim Demaille <akim@epita.fr>
15430
15431 * data/glr.c: Formatting changes.
15432 Tweak some trace messages to match yacc.c's.
15433
f50adbbd
AD
154342002-10-13 Akim Demaille <akim@epita.fr>
15435
15436 GLR parsers sometimes raise parse errors instead of performing the
15437 default reduction.
15438 Reported by Charles-Henry de Boysson.
15439
15440 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 15441 check the length of the traces when %glr.
f50adbbd
AD
15442 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
15443 GLR's traces.
15444 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
15445 Test GLR parsers.
15446 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
15447 (yyltype): Remove the yy prefix from the member names.
15448 (yytable): Complete its comment.
15449 (yygetLRActions): Map error action number from YYTABLE from
15450 YYTABLE_NINF to 0.
15451 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
15452 (which was a bug: it should have been YYTABEL_NINF, and yet it was
15453 not satisfying as we could compare an YYACTION computed from
15454 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
15455 only value for error actions.
15456 (yyreportParseError): In verbose parse error messages, don't issue
15457 `error' in the list of expected tokens.
15458 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
15459 next action to perform to match glr.c's decoding.
15460 (yytable): Complete its comment.
15461
bcbad5b9
PE
154622002-10-13 Paul Eggert <eggert@twinsun.com>
15463
15464 Fix problem reported by Henrik Grubbstroem in
161a71f3 15465 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
15466 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
15467 because the Bison parser reads the second action before reducing
15468 the first one.
15469 * src/scan-gram.l (rule_length): New static var.
15470 Use it to keep track of the rule length in the scanner, since
15471 we can't expect the parser to be in lock-step sync with the scanner.
15472 (handle_action_dollar, handle_action_at): Use this var.
15473 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 15474
14904b89
PE
154752002-10-12 Paul Eggert <eggert@twinsun.com>
15476
1fe611e5
PE
15477 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
15478 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
15479 Include <sys/time.h> when checking for clock_t and struct tms.
15480 Use same include order as source.
15481 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 15482 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 15483
1fe611e5
PE
15484 * lib/timevar.c: Update copyright date and clarify comments.
15485 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 15486
1fe611e5
PE
15487 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
15488 GCC version as of today, then merge Bison's changes.
15489 Change "GCC" to "Bison" in copyright notice. timevar.def's
15490 author is Akim, so change that too.
15491
98194095
PE
15492 * src/reader.c (grammar_current_rule_check):
15493 Don't worry about the default action if $$ is untyped.
15494 Prevents bogus warnings reported by Jim Gifford in
161a71f3 15495 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 15496
14904b89
PE
15497 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
15498 * data/glr.c, data/lalr1.cc, data/yacc.c:
15499 Output token definitions before the first part of user declarations.
15500 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 15501 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 15502
ff6dca18
PE
155032002-10-11 Paul Eggert <eggert@twinsun.com>
15504
15505 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
15506 (yyparse): here. This undoes some of the 2002-07-25 change.
15507 Compatibility problem reported by Ralf S. Engelschall with
15508 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
15509
eb714592
AD
155102002-10-11 Akim Demaille <akim@epita.fr>
15511
15512 * tests/regression.at Characters Escapes): New.
15513 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
15514 characters.
15515 Reported by Jan Nieuwenhuizen.
15516
b7195100
AD
155172002-10-11 Akim Demaille <akim@epita.fr>
15518
15519 * po/id.po: New.
15520
f28a0f2d
PE
155212002-10-10 Paul Eggert <eggert@twinsun.com>
15522
15523 Portability fixes for bitsets; this also avoids several GCC
15524 warnings.
15525
15526 * lib/abitset.c: Include <stddef.h>, for offsetof.
15527 * lib/lbitset.c: Likewise.
15528
15529 * lib/abitset.c (abitset_bytes): Return a size that is aligned
15530 properly for vectors of objects. Do not assume that adding a
15531 header size to a multiple of a word size yields a value that is
15532 properly aligned for the whole union.
15533 * lib/bitsetv.c (bitsetv_alloc): Likewise.
15534
15535 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
15536 unique names for structures.
15537 * lib/ebitset.c (ebitset_bytes): Likewise.
15538 * lib/lbitset.c (lbitset_bytes): Likewise.
15539
15540 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
15541 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
15542 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
15543 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
15544 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
15545 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
15546 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
15547 to improve the type-checking that GCC can do.
15548 * lib/bitset.c (bitset_op4_cmp): Likewise.
15549 * lib/bitset_stats.c (bitset_stats_count,
15550 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
15551 bitset_stats_copy, bitset_stats_disjoint_p,
15552 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
15553 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
15554 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
15555 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
15556 bitset_stats_and_or_cmp, bitset_stats_andn_or,
15557 bitset_stats_andn_or_cmp, bitset_stats_or_and,
15558 bitset_stats_or_and_cmp): Likewise.
15559 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
15560 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
15561 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
15562 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
15563
15564 * lib/abitset.h: Include bitset.h, not bbitset.h.
15565 * lib/ebitset.h: Likewise.
15566 * lib/lbitset.h: Likewise.
15567
15568 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
15569 All instances of parameters of type enum bitset_opts are now of
15570 type enum_bitset_opts, to conform to the C Standard, and similarly
15571 for enum_bitset_type.
15572 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
15573 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
15574
15575 Do not use "struct bitset_struct" to mean different things in
15576 different modules. Not only is this confusing, it violates
15577 the C Standard, which requires that structure types in different
15578 modules must be compatible if one is to be passed to the other.
15579 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
15580 All instances of "struct bitset_struct *" replaced with "bitset".
15581 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
15582 (union bitset_union, struct abitset_struct, struct ebitset_struct,
15583 struct lbitset_struct, struct bitset_stats_struct): New types.
15584 All uses of struct bitset_struct changed to union bitset_union,
15585 etc.
ba0fe3c7 15586 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
15587 struct bitset_struct): Remove.
15588 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
15589 struct bitset_struct): Remove.
15590 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
15591 bitset_struct): Remove.
15592 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
15593 Likewise.
15594
15595 Do not call a function of type T using a call that assumes the
15596 function is of a different type U. Standard C requires that a
15597 function must be called with a type that is compatible with its
15598 definition.
15599 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
15600 New decls.
15601 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
15602 New functions.
15603 * lib/ebitset.c (PFV): Remove.
15604 * lib/lbitset.c (PFV): Likewise.
15605 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
15606 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
15607 decls.
15608 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
15609 (ebitset_vtable): Use them.
15610 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
15611 lbitset_xor): New functions.
15612 (lbitset_vtable): Use them.
15613
15614 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
15615 Declare.
15616
15617 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
15618 GCC warning.
15619 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
15620 Use offsetof, for simplicity.
15621
6fbe4984
PE
156222002-10-06 Paul Eggert <eggert@twinsun.com>
15623
15624 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
15625 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 15626 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
15627 which was inadvertently undone by the 2002-09-30 patch.
15628 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
15629 the same width as int.
15630
420f93c8
PE
156312002-10-04 Paul Eggert <eggert@twinsun.com>
15632
15633 Version 1.50.
15634
15635 * configure.ac (AC_INIT), NEWS: Increment version number.
15636
15637 * doc/bison.texinfo: Minor spelling, grammar, and white space
15638 fixes.
15639 (Symbols): Mention that any negative value returned from yylex
15640 signifies end-of-input. Warn about negative chars. Mention
15641 the portable Standard C character set.
15642
15643 The GNU coding standard says CFLAGS and YFLAGS are reserved
15644 for the installer to set.
15645 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
15646 * src/Makefile.am (AM_CFLAGS): Likewise.
15647 (AM_YFLAGS): Renamed from YFLAGS.
15648
15649 Fix some MAX and MIN problems.
15650 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
15651 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
15652 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
15653 * src/reader.c (reader): Use it.
15654
15655 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
15656 POSIX 1003.1-2001 has removed fgrep.
15657
156582002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
15659
15660 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
15661 interpreted as signed.
15662 * lib/ebitset.c (ebitset_list): Fix bug.
15663
ff68026d
PE
156642002-10-01 Paul Eggert <eggert@twinsun.com>
15665
15666 More fixes for 64-bit hosts and large bitsets.
15667
15668 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
15669 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
15670 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
15671 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
15672 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
15673 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
15674 bitset_count_): Likewise.
15675 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
15676 bitset_first, bitset_last): Likewise.
15677 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
15678 bitset_stats_list_reverse, bitset_stats_size,
15679 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
15680 Likewise.
15681 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
15682 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
15683 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
15684 bitsetv_reflexive_transitive_closure): Likewise.
15685 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
15686 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
15687 Likewise.
15688 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
15689 Likewise.
420f93c8 15690
ff68026d
PE
15691 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
15692 Use size_t, not unsigned int, to count bytes.
15693 * lib/abitset.h (abitset_bytes): Likewise.
15694 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
15695 Likewise.
15696 * lib/bitset.h (bitset_bytes): Likewise.
15697 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
15698 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
15699 * lib/bitsetv.c (bitsetv_alloc): Likewise.
15700 * lib/ebitset.c (ebitset_bytes): Likewise.
15701 * lib/ebitset.h (ebitset_bytes): Likewise.
15702 * lib/lbitset.c (lbitset_bytes): Likewise.
15703 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 15704
ff68026d
PE
15705 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
15706 abitset_subset_p, abitset_disjoint_p, abitset_and,
15707 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
15708 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
15709 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
15710 abitset_or_and, abitset_or_and_cmp):
15711 Use bitset_windex instead of unsigned int.
15712 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
15713 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
15714 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
15715 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
15716 Likewise.
15717 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 15718
ff68026d
PE
15719 * lib/bitset.c (bitset_print):
15720 Use proper printf formats for widths of integer types.
15721 * lib/bitset_stats.c (bitset_percent_histogram_print,
15722 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
15723 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
15724 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
15725 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 15726
ff68026d
PE
15727 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
15728 BITSET_SIZE_MAX): New macros.
15729 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
15730 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
15731 to BITSET_WINDEX_MAX.
15732
15733 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
15734 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
15735 since we now return the bitset_bindex type (not int).
15736
15737 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
15738 when computing sizes.
15739 * lib/ebitset.c (ebitset_elts_grow): Likewise.
15740
15741 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
15742 and avoid cast to unsigned.
15743
6aa452a6
AD
157442002-09-30 Akim Demaille <akim@epita.fr>
15745
15746 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
15747 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
15748 Updates from Michael Hayes.
15749
927f7817
AD
157502002-09-30 Art Haas <ahaas@neosoft.com>
15751
15752 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
15753 invocations.
15754 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
15755 defined.
15756
9738f41e
AD
157572002-09-27 Akim Demaille <akim@epita.fr>
15758
15759 Version 1.49c.
15760
a5c75d7f
AD
157612002-09-27 Akim Demaille <akim@epita.fr>
15762
15763 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
15764 (Because of AC_LIBSOURCE).
15765
8280e179
AD
157662002-09-27 Akim Demaille <akim@epita.fr>
15767
15768 Playing with Autoscan.
15769
15770 * configure.ac: Remove the old LIBOBJ tweaks.
15771 (AC_REPLACE_FUNCS): Add strrchr and strtol.
15772 * lib/strrchr.c: New.
15773 * lib/strtol.c: New, from the Coreutils 4.5.1.
15774
ae64af35
AD
157752002-09-27 Akim Demaille <akim@epita.fr>
15776
15777 Playing with Autoscan.
15778
15779 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
15780 * lib/Makefile.am (libbison_a_SOURCES): No longer include
15781 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
15782 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
15783 Coreutils 4.5.1.
15784
d1a1114f
AD
157852002-09-24 Akim Demaille <akim@epita.fr>
15786
15787 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
15788 (Frequently Asked Questions, Parser Stack Overflow): New.
15789
b906441c
AD
157902002-09-13 Akim Demaille <akim@epita.fr>
15791
15792 Playing with autoscan.
15793
15794 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
15795 * src/files.c (skeleton_find): Remove, unused.
15796 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
15797 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
15798
bd701811
AD
157992002-09-13 Akim Demaille <akim@epita.fr>
15800
15801 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
15802 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
15803
e0a13e7b
AD
158042002-09-13 Akim Demaille <akim@epita.fr>
15805
15806 * configure.ac: Require 2.54.
15807 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
15808 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
15809 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
15810 Remove, provided by Autoconf macros.
15811
c97011bf
AD
158122002-09-12 Akim Demaille <akim@epita.fr>
15813
15814 * m4/prereq.m4: Update, from Coreutils 4.5.1.
15815
d862b1be
AD
158162002-09-12 Akim Demaille <akim@epita.fr>
15817
15818 * m4/prereq.m4: Update, from Fileutils 4.1.5.
15819 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
15820 Reported by Martin Mokrejs.
15821
3d38c03a
AD
158222002-09-10 Akim Demaille <akim@epita.fr>
15823
15824 * src/parse-gram.y: Associate a human readable string to each
15825 token type.
15826 * tests/regression.at (Invalid inputs): Adjust.
15827
b6347355
AD
158282002-09-10 Gary V. Vaughan <gary@gnu.org>
15829
15830 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
15831 with an Autoconf-2.5x style configure.ac.
15832
09ba4ab2
PE
158332002-09-06 Paul Eggert <eggert@twinsun.com>
15834
15835 * doc/bison.texinfo (Conditions): Make explicit that the GPL
15836 exception applies only to yacc.c. This is a modification of a
15837 patch originally suggested by Akim Demaille.
15838
21846f69
AD
158392002-09-06 Akim Demaille <akim@epita.fr>
15840
09ba4ab2
PE
15841 * data/c.m4 (b4_copyright): Move the GPL exception comment from
15842 here to...
15843 * data/yacc.c: here.
15844
21846f69
AD
15845 * data/lalr1.cc (struct yyltype): Don't define it, since we use
15846 LocationType.
15847 (b4_ltype): Default to yy::Location from location.hh.
15848
c0ad8bf3
AD
158492002-09-04 Jim Meyering <jim@meyering.net>
15850
15851 * data/yacc.c: Guard the declaration of yytoknum also with
15852 `#ifdef YYPRINT', so it is declared only when used.
15853
3a93251e
AD
158542002-09-04 Akim Demaille <akim@epita.fr>
15855
15856 * configure.in: Rename as...
15857 * configure.ac: this.
15858 Bump to 1.49c.
15859
427c0dda
AD
158602002-09-04 Akim Demaille <akim@epita.fr>
15861
15862 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
15863 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
15864 translate maintainer only messages.
15865
6a254321
PE
158662002-08-12 Paul Eggert <eggert@twinsun.com>
15867
645e30d1
PE
15868 Version 1.49b.
15869
6a254321
PE
15870 * Makefile.am (SUBDIRS): Remove intl.
15871 (DISTCLEANFILES): Remove.
15872 * NEWS: Mention that GNU M4 is now required. Clarify what is
15873 meant by "larger grammars". Mention the pt_BR translation.
15874 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
15875 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
15876 Bump version from 0.11.2 to 0.11.5.
15877 (BISON_PREREQ_STAGE): Remove.
15878 (AM_GNU_GETTEXT): Use external gettext.
15879 (AC_OUTPUT): Remove intl/Makefile.
15880
15881 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
15882
15883 * data/glr.c: Include string.h, for strlen.
15884 (yyreportParseError): Use size_t for yysize.
15885 (yy_yypstack): No longer nested inside yypstates, as nested
15886 functions are not portable. Do not assume size_t is the
15887 same width as int.
15888 (yypstates): Do not assume that ptrdiff_t is the same width
15889 as int, and similarly for yyposn and YYINDEX.
15890
15891 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
15892
15893 * lib/Makefile.am (INCLUDES): Do not include from the intl
15894 directory, which has been removed.
15895 * src/Makefile.am (INCLUDES): Likewise.
15896
15897 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
15898 (bitsets_sources, additional_bitsets_sources, timevars_sources):
15899 New vars.
15900
15901 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
15902 * tests/Makefile.am (EXTRA_DIST): Likewise.
15903
15904 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
15905 Do not assume that bitset_windex is the same width as unsigned.
15906
15907 * lib/abitset.c (abitset_unused_clear): Do not assume that
15908 bitset_word is the same width as int.
15909 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
15910 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
15911 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
15912 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
15913 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
15914
15915 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
15916 portability to one's complement hosts!).
15917 * lib/ebitset.c (ebitset_op1): Likewise.
15918 * lib/lbitset.c (lbitset_op1): Likewise.
15919
15920 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
15921 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
15922 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
15923 Sync with fileutils.
15924 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
15925 lib/gettext.h: Sync with diffutils.
15926
15927 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
15928 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
15929
15930 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
15931 PROTOTYPES to check for prototypes, and "defined __STDC__" to
15932 check for void *.
15933
15934 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
15935 size_t; the old version tried to do this but casted improperly.
15936 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
15937 (bitset_test): Now returns int, not unsigned long.
15938
15939 * lib/bitset_stats.c: Include "gettext.h".
15940 (_): New macro.
15941 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
15942 name locals "index", as it generates unnecessary warnings on some
15943 hosts that have an "index" function.
15944
15945 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
15946 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
15947 they need translation.
15948 * src/LR0.c (state_list_append, new_itemsets, get_state,
15949 append_states, generate_states): Likewise.
15950 * src/assoc.c (assoc_to_string): Likewise.
15951 * src/closure.c (print_closure, set_firsts, closure): Likewise.
15952 * src/gram.c (grammar_dump): Likewise.
15953 * src/injections.c (injections_compute): Likewise.
15954 * src/lalr.c (lookaheads_print): Likewise.
15955 * src/relation.c (relation_transpose): Likewise.
15956 * src/scan-gram.l: Likewise.
15957 * src/tables.c (table_grow, pack_vector): Likewise.
15958
15959 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
15960 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
15961 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
15962 * m4/mbstate_t.m4: Sync with fileutils.
15963 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
15964
15965 * po/LINGUAS: Add pt_BR.
15966 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
15967 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
15968 lib/timevar.c.
15969 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
15970 manual recommends.
15971 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
15972
15973 * src/complain.c (strerror_r): Remove decl; not needed.
15974 (strerror): Use same pattern as ../lib/error.c.
15975
15976 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
15977
15978 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
15979
15980 * src/main.c (main): Cast result of bindtextdomain and textdomain
15981 to void, to avoid a GCC warning when --disable-nls is in effect.
15982
15983 * src/scan-gram.l: Use strings rather than escapes when possible,
15984 to minimize the number of warnings from xgettext.
15985 (handle_action_dollar, handle_action_at): Don't use isdigit,
15986 as it mishandles negative chars and it may not work as expected
15987 outside the C locale.
15988
15989 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
15990 this is a GCC extension and is not portable to other compilers.
15991
15992 * src/system.h (alloca): Use same pattern as ../lib/error.c.
15993 Do not include <ctype.h>; no longer needed.
15994 Do not include <malloc.h>; no longer needed (and generates
15995 warnings on OpenBSD 3.0).
15996
15997 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
15998 it's not portable.
15999
16000 * tests/regression.at: Do not use 'cc -c input.c -o input';
16001 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
16002
16003 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
16004 exit status as failure, not just exit status 1. Sun C exits
16005 with status 2 sometimes.
16006
16007 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
16008 Use it for the two large tests.
16009
c8f002c7
AD
160102002-08-02 Akim Demaille <akim@epita.fr>
16011
16012 * src/conflicts.c (conflicts_output): Don't output rules never
16013 reduced here, since anyway that computation doesn't work.
16014 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
16015 (rule_useless_p, rule_never_reduced_p): New.
16016 (grammar_rules_partial_print): Use a filter instead of a range.
16017 Display the title only if needed.
16018 (grammar_rules_print): Adjust.
16019 (grammar_rules_never_reduced_report): New.
16020 * src/tables.c (action_row): Move the computation of rules never
16021 reduced to...
16022 (token_actions): here.
16023 * src/main.c (main): Make the parser before making the report, so
16024 that rules never reduced are computed.
16025 Call grammar_rules_never_reduced_report.
16026 * src/print.c (print_results): Report rules never reduced.
16027 * tests/conflicts.at, tests/reduce.at: Adjust.
16028
cd08e51e
AD
160292002-08-01 Akim Demaille <akim@epita.fr>
16030
16031 Instead of attaching lookaheads and duplicating the rules being
16032 reduced by a state, attach the lookaheads to the reductions.
16033
16034 * src/state.h (state_t): Remove the `lookaheads',
16035 `lookaheads_rule' member.
16036 (reductions_t): Add a `lookaheads' member.
16037 Use a regular array for the `rules'.
16038 * src/state.c (reductions_new): Initialize the lookaheads member
16039 to 0.
16040 (state_rule_lookaheads_print): Adjust.
16041 * src/state.h, src/state.c (state_reductions_find): New.
16042 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
16043 (count_rr_conflicts): Adjust.
16044 * src/lalr.c (LArule): Remove.
16045 (add_lookback_edge): Adjust.
16046 (state_lookaheads_count): New.
16047 (states_lookaheads_initialize): Merge into...
16048 (initialize_LA): this.
16049 (lalr_free): Adjust.
16050 * src/main.c (main): Don't free nullable and derives too early: it
16051 is used by --verbose.
16052 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
16053
bb0027a9
AD
160542002-08-01 Akim Demaille <akim@epita.fr>
16055
16056 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
16057 `rule_number_t**'.
16058 (set_derives, free_derives): Rename as...
16059 (derives_compute, derives_free): this.
16060 Adjust all dependencies.
16061 * src/nullable.c (set_nullable, free_nullable): Rename as...
16062 (nullable_compute, nullable_free): these.
16063 (rule_list_t): Store rule_t *, not rule_number_t.
16064 * src/state.c (state_rule_lookaheads_print): Directly compare rule
16065 pointers, instead of their numbers.
16066 * src/main.c (main): Call nullable_free, and derives_free earlier,
16067 as they were lo longer used.
16068
3325ddc4
AD
160692002-08-01 Akim Demaille <akim@epita.fr>
16070
16071 * lib/timevar.c (get_time): Include children time.
16072 * src/lalr.h (LA, LArule): Don't export them: used with the
16073 state_t.
16074 * src/lalr.c (LA, LArule): Static.
16075 * src/lalr.h, src/lalr.c (lalr_free): New.
16076 * src/main.c (main): Call it.
16077 * src/tables.c (pack_vector): Check whether loc is >= to the
16078 table_size, not >.
16079 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
16080 (tables_generate): do it, since that's also it which allocates
16081 them.
16082 Don't free LA and LArule, main does.
16083
c6f1a33c
AD
160842002-07-31 Akim Demaille <akim@epita.fr>
16085
16086 Separate parser tables computation and output.
16087
16088 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
16089 (conflict_list, conflict_list_cnt, table, check, table_ninf)
16090 (yydefgoto, yydefact, high): Move to...
16091 * src/tables.h, src/tables.c: here.
16092 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
16093 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
16094 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
16095 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
16096 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
16097 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
16098 (action_row, save_row, token_actions, save_column, default_goto)
16099 (goto_actions, sort_actions, matching_state, pack_vector)
16100 (table_ninf_remap, pack_table, prepare_actions): Move to...
16101 * src/tables.c: here.
16102 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
16103 * src/output.c (token_actions, output_base, output_conflicts)
16104 (output_check): Merge into...
16105 (prepare_actions): this.
16106 (actions_output): Rename as...
16107 (user_actions_output): this.
16108 * src/main.c (main): Call tables_generate and tables_free.
16109
1509d42f
AD
161102002-07-31 Akim Demaille <akim@epita.fr>
16111
16112 Steal GCC's --time-report support.
16113
16114 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
16115 stolen/adjusted from GCC.
16116 * m4/stage.m4: Remove time related checks.
16117 * m4/timevar.m4: New.
16118 * configure.in: Adjust.
16119 * src/system.h: Adjust to using timevar.h.
16120 * src/getargs.h, src/getargs.c: Support trace_time for
16121 --trace=time.
16122 * src/main.c (stage): Remove.
16123 (main): Replace `stage' invocations with timevar calls.
16124 * src/output.c: Insert pertinent timevar calls.
16125
273a74fa
AD
161262002-07-31 Akim Demaille <akim@epita.fr>
16127
16128 Let --trace have arguments.
16129
16130 * src/getargs.h (enum trace_e): New.
16131 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
16132 (long_options, short_options): --trace/-T takes an optional
16133 argument.
16134 Change all the uses of trace_flag to reflect the new flags.
16135 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
16136
16137 Strengthen `stage' portability.
16138
16139 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
16140 * configure.in: Use it.
16141 Don't check for malloc.h and sys/times.h.
16142 * src/system.h: Include them when appropriate.
16143 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
16144 times and struct tms are available.
16145
217598da
AD
161462002-07-30 Akim Demaille <akim@epita.fr>
16147
16148 In verbose parse error message, don't report `error' as an
16149 expected token.
16150 * tests/actions.at (Printers and Destructors): Adjust.
16151 * tests/calc.at (Calculator $1): Adjust.
16152 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
16153 error message, do not report the parser accepts the error token in
16154 that state.
16155
52489d44
AD
161562002-07-30 Akim Demaille <akim@epita.fr>
16157
16158 Normalize conflict related messages.
16159
16160 * src/complain.h, src/complain.c (warn, complain): New.
16161 * src/conflicts.c (conflicts_print): Use them.
16162 (conflict_report_yacc): New, extracted from...
16163 (conflicts_print): here.
16164 * tests/conflicts.at, tests/existing.at: Adjust.
16165
e8832397
AD
161662002-07-30 Akim Demaille <akim@epita.fr>
16167
16168 Report rules which are never reduced by the parser: those hidden
16169 by conflicts.
16170
16171 * src/LR0.c (save_reductions): Don't make the final state too
16172 different: save its reduction (accept) instead of having a state
16173 without any action (no shift or goto, no reduce).
16174 Note: the final state is now a ``regular'' state, i.e., the
16175 parsers now contain `reduce 0' as default reduction.
16176 Nevertheless, since they decide to `accept' when yystate =
16177 final_state, they still will not reduce rule 0.
16178 * src/print.c (print_actions, print_reduction): Adjust.
16179 * src/output.c (action_row): Track reduced rules.
16180 (token_actions): Report rules never reduced.
16181 * tests/conflicts.at, tests/regression.at: Adjust.
16182
caf23d24
AD
161832002-07-30 Akim Demaille <akim@epita.fr>
16184
16185 `stage' was accidently included in a previous patch.
16186 Initiate its autoconfiscation.
16187
16188 * configure.in: Look for malloc.h and sys/times.h.
16189 * src/main.c (stage): Adjust.
16190 Report only when trace_flag.
16191
640748ee
AD
161922002-07-29 Akim Demaille <akim@epita.fr>
16193
16194 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
16195 state_number_t.
16196 (errs_t): symbol_t*, not symbol_number_t.
16197 (reductions_t): rule_t*, not rule_number_t.
16198 (FOR_EACH_SHIFT): New.
16199 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
16200 * src/print.c, src/print_graph.c: Adjust.
16201
88bce5a2
AD
162022002-07-29 Akim Demaille <akim@epita.fr>
16203
16204 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
16205
16206 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
16207 (endtoken, accept): these.
16208 * src/reader.c (reader): Set endtoken's default tag to "$end".
16209 Set undeftoken's tag to "$undefined" instead of "$undefined.".
16210 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
16211 Adjust.
16212
1bfb97db
AD
162132002-07-29 Akim Demaille <akim@epita.fr>
16214
16215 * src/reduce.c (reduce_grammar): When the language is empty,
16216 complain about the start symbol, not the axiom.
16217 Use its location.
16218 * tests/reduce.at (Empty Language): New.
16219
fc5734fe
AD
162202002-07-26 Akim Demaille <akim@epita.fr>
16221
16222 * src/reader.h, src/reader.c (gram_error): ... can't get
16223 yycontrol without making too strong assumptions on the parser
16224 itself.
16225 * src/output.c (prepare_tokens): Use the real 0th value of
16226 token_translations instead of `0'.
16227 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
16228 visible here.
16229 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
16230 for the time being: %locations ought to provide it to yyerror.
16231
3650b4b8
AD
162322002-07-25 Akim Demaille <akim@epita.fr>
16233
16234 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
16235 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
16236 * tests/regression.at (Web2c Actions): Adjust.
16237
4b3d3a8e
AD
162382002-07-25 Akim Demaille <akim@epita.fr>
16239
16240 Stop storing rules from 1 to nrules + 1.
16241
16242 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
16243 * src/nullable.c, src/output.c, src/print.c, src/reader.c
16244 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
16245 Iterate from 0 to nrules.
16246 Use rule_number_as_item_number and item_number_as_rule_number.
16247 Adjust to `derive' now containing possibly 0.
16248 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
16249 Handle the `- 1' part in rule numbers from/to item numbers.
16250 * src/conflicts.c (log_resolution): Fix the message which reversed
16251 shift and reduce.
16252 * src/output.c (action_row): Initialize default_rule to -1.
16253 (token_actions): Adjust.
16254 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
16255 expected output.
16256 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
16257
4a2a22f4
AD
162582002-07-25 Akim Demaille <akim@epita.fr>
16259
16260 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
16261 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
16262 (b4_c_knr_arg_decl): New.
16263 * data/yacc.c: Use it to define yysymprint, yydestruct, and
16264 yyreport_parse_error.
16265
b8df3223
AD
162662002-07-25 Akim Demaille <akim@epita.fr>
16267
16268 * data/yacc.c (yyreport_parse_error): New, extracted from...
16269 (yyparse): here.
16270 (yydestruct, yysymprint): Move above yyparse.
16271 Be K&R compliant.
16272
a762e609
AD
162732002-07-25 Akim Demaille <akim@epita.fr>
16274
16275 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
16276 replace...
16277 (b4_sint_type, b4_uint_type): these.
16278 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
16279 * tests/regression.at (Web2c Actions): Adjust.
16280
12b0043a
AD
162812002-07-25 Akim Demaille <akim@epita.fr>
16282
16283 * src/gram.h (TIEM_NUMBER_MAX): New.
16284 (item_number_of_rule_number, rule_number_of_item_number): Rename
16285 as...
16286 (rule_number_as_item_number, item_number_as_rule_number): these.
16287 Adjust dependencies.
16288 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
16289 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
16290 (symbol_number_to_vector_number): New.
16291 (order): Of vector_number_t* type.
16292 (base_t, BASE_MAX, BASE_MIN): New.
16293 (froms, tos, width, pos, check): Of base_t type.
16294 (action_number_t, ACTION_MIN, ACTION_MAX): New.
16295 (actrow): Of action_number_t type.
16296 (conflrow): Of unsigned int type.
16297 (table_ninf, base_ninf): New.
16298 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
16299 (muscle_insert_int_table, muscle_insert_base_table)
16300 (muscle_insert_rule_number_table): New.
16301 (prepare_tokens): Output `toknum' as int_table.
16302 (action_row): Returns a rule_number_t.
16303 Use ACTION_MIN, not SHRT_MIN.
16304 (token_actions): yydefact is rule_number_t*.
16305 (table_ninf_remap): New.
16306 (pack_table): Use it for `base' and `table'.
16307 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
16308 replaced with...
16309 (YYPACT_NINF, YYTABLE_NINF): these.
16310 (yypact, yytable): Compute their types instead of hard-coded
16311 `short'.
16312 * tests/regression.at (Web2c Actions): Adjust.
16313
5dde258a
AD
163142002-07-19 Akim Demaille <akim@epita.fr>
16315
16316 * src/scan-gram.l (id): Can start with an underscore.
16317
a945ec39
AD
163182002-07-16 Akim Demaille <akim@epita.fr>
16319
16320 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
16321 Adjust all former `associativity' dependencies.
16322 * src/symtab.c (symbol_new): Default associativity is `undef', not
16323 `right'.
16324 (symbol_check_alias_consistence): Adjust.
16325
fae437e8
AD
163262002-07-09 Akim Demaille <akim@epita.fr>
16327
16328 * doc/bison.texinfo: Properly set the ``header'' part.
16329 Use @dircategory ``GNU programming tools'' as per Texinfo's
16330 documentation.
16331 Use @copying.
16332
1a715ef2
AD
163332002-07-09 Akim Demaille <akim@epita.fr>
16334
16335 * lib/quotearg.h: Protect against multiple inclusions.
16336 * src/location.h (location_t): Add a `file' member.
16337 (LOCATION_RESET, LOCATION_PRINT): Adjust.
16338 * src/complain.c (warn_at, complain_at, fatal_at): Drop
16339 `error_one_per_line' support.
16340
a5d50994
AD
163412002-07-09 Akim Demaille <akim@epita.fr>
16342
16343 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
16344 * src/reader.c (lineno): Remove.
16345 Adjust all dependencies.
16346 (get_merge_function): Take a location and use complain_at.
16347 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
16348 * tests/regression.at (Invalid inputs, Mixing %token styles):
16349 Adjust.
16350
b275314e
AD
163512002-07-09 Akim Demaille <akim@epita.fr>
16352
16353 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
16354 recovery rule, and forbid extensions when --yacc.
16355 (gram_error): Use complain_at.
16356 * src/reader.c (reader): Exit if there were parse errors.
16357
865b9df1
AD
163582002-07-09 Akim Demaille <akim@epita.fr>
16359
16360 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
16361 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
16362 Reported by R Blake <blakers@mac.com>.
16363
c76e14da
AD
163642002-07-09 Akim Demaille <akim@epita.fr>
16365
16366 * data/yacc.c: Output the copyright notive in the header.
16367
7db2ed2d
AD
163682002-07-03 Akim Demaille <akim@epita.fr>
16369
16370 * src/output.c (froms, tos): Are state_number_t.
16371 (save_column): sp, sp1, and sp2 are state_number_t.
16372 (prepare): Rename `final' as `final_state_number', `nnts' as
16373 `nterms_number', `nrules' as `rules_number', `nstates' as
16374 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
16375 unused.
16376 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
16377 * data/lalr1.cc (nsym_): Remove, unused.
16378
e68e0410
AD
163792002-07-03 Akim Demaille <akim@epita.fr>
16380
16381 * src/lalr.h, src/lalr.c (goto_number_t): New.
16382 * src/lalr.c (goto_list_t): New.
16383 Propagate them.
16384 * src/nullable.c (rule_list_t): New.
16385 Propagate.
16386 * src/types.h: Remove.
16387
e1a4f3a4
AD
163882002-07-03 Akim Demaille <akim@epita.fr>
16389
16390 * src/closure.c (print_fderives): Use rule_rhs_print.
16391 * src/derives.c (print_derives): Use rule_rhs_print.
16392 (rule_list_t): New, replaces `shorts'.
16393 (set_derives): Add comments.
16394 * tests/sets.at (Nullable, Firsts): Adjust.
16395
536545f3
AD
163962002-07-03 Akim Demaille <akim@epita.fr>
16397
16398 * src/output.c (prepare_actions): Free `tally' and `width'.
16399 (prepare_actions): Allocate and free `order'.
16400 * src/symtab.c (symbols_free): Free `symbols'.
16401 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
16402 * src/output.c (m4_invoke): Move to...
16403 * src/scan-skel.l: here.
16404 (<<EOF>>): Close yyout, and free its name.
16405
8b752b00
AD
164062002-07-03 Akim Demaille <akim@epita.fr>
16407
16408 Fix some memory leaks, and fix a bug: state 0 was examined twice.
16409
16410 * src/LR0.c (new_state): Merge into...
16411 (state_list_append): this.
16412 (new_states): Merge into...
16413 (generate_states): here.
16414 (set_states): Don't ensure a proper `errs' state member here, do it...
16415 * src/conflicts.c (conflicts_solve): here.
16416 * src/state.h, src/state.c: Comment changes.
16417 (state_t): Rename member `shifts' as `transitions'.
16418 Adjust all dependencies.
16419 (errs_new): For consistency, also take the values as argument.
16420 (errs_dup): Remove.
16421 (state_errs_set): New.
16422 (state_reductions_set, state_transitions_set): Assert that no
16423 previous value was assigned.
16424 (state_free): New.
16425 (states_free): Use it.
16426 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
16427 temporary storage: use `errs' and `nerrs' as elsewhere.
16428 (set_conflicts): Allocate and free this `errs'.
16429
613f5e1a
AD
164302002-07-02 Akim Demaille <akim@epita.fr>
16431
16432 * lib/libiberty.h: New.
16433 * lib: Update the bitset implementation from upstream.
16434 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
16435 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
16436 * src/main.c: Adjust bitset stats calls.
16437
26e0cadc
PE
164382002-07-01 Paul Eggert <eggert@twinsun.com>
16439
16440 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
16441 char, so that negative chars don't collide with $.
16442
1154cced
AD
164432002-06-30 Akim Demaille <akim@epita.fr>
16444
16445 Have the GLR tests be `warning' checked, and fix the warnings.
16446
16447 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
16448 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
16449 (yyremoveDeletes): `yyi' and `yyj' are size_t.
16450 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
16451 (yyaddDeferredAction): static.
16452 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
16453 (yyreportParseError): yyprefix is const.
16454 yytokenp is used only when verbose.
16455 (yy__GNUC__): Replace with __GNUC__.
16456 (yypdumpstack): yyi is size_t.
16457 (yypreference): Un-yy local variables and arguments, to avoid
16458 clashes with `yyr1'. Anyway, we are not in the user name space.
16459 (yytname_size): be an int, as is compared with ints.
16460 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
16461 Use them.
16462 * tests/cxx-gram.at: Use quotation to protect $1.
16463 Use AT_COMPILE to enable warnings hunts.
16464 Prototype yylex and yyerror.
16465 `Use' argc.
16466 Include `string.h', not `strings.h'.
16467 Produce and prototype stmtMerge only when used.
16468 yylex takes a location.
16469
97650f4e
AD
164702002-06-30 Akim Demaille <akim@epita.fr>
16471
16472 We spend a lot of time in quotearg, in particular when --verbose.
16473
16474 * src/symtab.c (symbol_get): Store a quoted version of the key.
16475 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
16476 Adjust all callers.
16477
d2576365
AD
164782002-06-30 Akim Demaille <akim@epita.fr>
16479
16480 * src/state.h (reductions_t): Rename member `nreds' as num.
16481 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
16482 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
16483
ccaf65bc
AD
164842002-06-30 Akim Demaille <akim@epita.fr>
16485
16486 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
16487 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
16488 (shifts_to): Rename as...
16489 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
16490 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
16491 (TRANSITION_IS_DISABLED, transitions_to): these.
16492
87675353
AD
164932002-06-30 Akim Demaille <akim@epita.fr>
16494
16495 * src/print.c (print_shifts, print_gotos): Merge into...
16496 (print_transitions): this.
16497 (print_transitions, print_errs, print_reductions): Align the
16498 lookaheads columns.
16499 (print_core, print_transitions, print_errs, print_state,
16500 print_grammar): Output empty lines separator before, not after.
16501 (state_default_rule_compute): Rename as...
16502 (state_default_rule): this.
16503 * tests/conflicts.at (Defaulted Conflicted Reduction),
16504 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
16505 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
16506
ce4ccb4b
AD
165072002-06-30 Akim Demaille <akim@epita.fr>
16508
16509 Display items as we display rules.
16510
16511 * src/gram.h, src/gram.c (rule_lhs_print): New.
16512 * src/gram.c (grammar_rules_partial_print): Use it.
16513 * src/print.c (print_core): Likewise.
16514 * tests/conflicts.at (Defaulted Conflicted Reduction),
16515 (Unresolved SR Conflicts): Adjust.
16516 (Unresolved SR Conflicts): Adjust and rename as...
16517 (Resolved SR Conflicts): this, as was meant.
16518 * tests/regression.at (Web2c Report): Adjust.
16519
bc933ef1
AD
165202002-06-30 Akim Demaille <akim@epita.fr>
16521
16522 * src/print.c (state_default_rule_compute): New, extracted from...
16523 (print_reductions): here.
16524 Pessimize, but clarify the code.
16525 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
16526
53d4308d
AD
165272002-06-30 Akim Demaille <akim@epita.fr>
16528
16529 * src/output.c (action_row): Let default_rule be always a rule
16530 number.
16531
574fb2d5
AD
165322002-06-30 Akim Demaille <akim@epita.fr>
16533
16534 * src/closure.c (print_firsts, print_fderives, closure):
16535 Use BITSET_EXECUTE.
16536 * src/lalr.c (lookaheads_print): Likewise.
16537 * src/state.c (state_rule_lookaheads_print): Likewise.
16538 * src/print_graph.c (print_core): Likewise.
16539 * src/print.c (print_reductions): Likewise.
16540 * src/output.c (action_row): Likewise.
16541 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
16542
05811fd7
AD
165432002-06-30 Akim Demaille <akim@epita.fr>
16544
16545 * src/print_graph.c: Use report_flag.
16546
0e4d5753
AD
165472002-06-30 Akim Demaille <akim@epita.fr>
16548
16549 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
16550 to...
16551 * src/relation.h, src/relation.c (traverse, relation_digraph)
16552 (relation_print, relation_transpose): New.
16553
24c7d800
AD
165542002-06-30 Akim Demaille <akim@epita.fr>
16555
16556 * src/state.h, src/state.c (shifts_to): New.
16557 * src/lalr.c (build_relations): Use it.
16558
9222837b
AD
165592002-06-30 Akim Demaille <akim@epita.fr>
16560
16561 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
16562 (item_number_of_rule_number, rule_number_of_item_number): New.
16563 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
16564 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
16565 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
16566 Propagate their use.
16567 Much remains to be done, in particular wrt `shorts' from types.h.
16568
260008e5
AD
165692002-06-30 Akim Demaille <akim@epita.fr>
16570
16571 * src/symtab.c (symbol_new): Initialize the `printer' member.
16572
8a731ca8
AD
165732002-06-30 Akim Demaille <akim@epita.fr>
16574
16575 * src/LR0.c (save_reductions): Remove, replaced by...
16576 * src/state.h, src/state.c (state_reductions_set): New.
16577 (reductions, errs): Rename as...
16578 (reductions_t, errs_t): these.
16579 Adjust all dependencies.
16580
32e1e0a4
AD
165812002-06-30 Akim Demaille <akim@epita.fr>
16582
16583 * src/LR0.c (state_list_t, state_list_append): New.
16584 (first_state, last_state): Now symbol_list_t.
16585 (this_state): Remove.
16586 (new_itemsets, append_states, save_reductions): Take a state_t as
16587 argument.
16588 (set_states, generate_states): Adjust.
16589 (save_shifts): Remove, replaced by...
16590 * src/state.h, src/state.c (state_shifts_set): New.
16591 (shifts): Rename as...
16592 (shifts_t): this.
16593 Adjust all dependencies.
16594 * src/state.h (state_t): Remove the `next' member.
16595
e5fb6710
AD
165962002-06-30 Akim Demaille <akim@epita.fr>
16597
16598 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
16599 escaped in slot 0.
16600
c7ca99d4
AD
166012002-06-30 Akim Demaille <akim@epita.fr>
16602
16603 Use hash.h for the state hash table.
16604
16605 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
16606 (allocate_storage): Use state_hash_new.
16607 (free_storage): Use state_hash_free.
16608 (new_state, get_state): Adjust.
16609 * src/lalr.h, src/lalr.c (states): Move to...
16610 * src/states.h (state_t): Remove the `link' member, no longer
16611 used.
16612 * src/states.h, src/states.c: here.
16613 (state_hash_new, state_hash_free, state_hash_lookup)
16614 (state_hash_insert, states_free): New.
16615 * src/states.c (state_table, state_compare, state_hash): New.
16616 * src/output.c (output_actions): Do not free states now, since we
16617 still need to know the final_state number in `prepare', called
16618 afterwards. Do it...
16619 * src/main.c (main): here: call states_free after `output'.
16620
df0e7316
AD
166212002-06-30 Akim Demaille <akim@epita.fr>
16622
16623 * src/state.h, src/state.c (state_new): New, extracted from...
16624 * src/LR0.c (new_state): here.
16625 * src/state.h (STATE_ALLOC): Move to...
16626 * src/state.c: here.
16627 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
16628 * src/state.h, src/state.c: here.
16629
39f41916
AD
166302002-06-30 Akim Demaille <akim@epita.fr>
16631
16632 * src/reader.c (gensym): Rename as...
16633 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
16634 (getsym): Rename as...
16635 (symbol_get): this.
16636
d57650a5
AD
166372002-06-30 Akim Demaille <akim@epita.fr>
16638
16639 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
16640 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
16641 * src/output.c, src/print.c, src/print_graph.c: Propagate.
16642 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
16643
5a08f1ce
AD
166442002-06-30 Akim Demaille <akim@epita.fr>
16645
16646 Make the test suite pass with warnings checked.
16647
16648 * tests/actions.at (Printers and Destructors): Improve.
16649 Avoid unsigned vs. signed issues.
16650 * tests/calc.at: Don't exercise the scanner here, do it...
16651 * tests/input.at (Torturing the Scanner): here.
16652
720623af
PH
166532002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16654
88e7e941 16655 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
16656 reorganize first lines parallel to yacc.c.
16657
fb8135fa
AD
166582002-06-28 Akim Demaille <akim@epita.fr>
16659
16660 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
16661 (b4_token_enum, b4_token_defines): New, factored from...
16662 * data/lalr1.cc, data/yacc.c, glr.c: here.
16663
41442480
AD
166642002-06-28 Akim Demaille <akim@epita.fr>
16665
16666 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
16667 unused variables.
16668 * src/output.c (merger_output): static.
16669
e0e5bf84
AD
166702002-06-28 Akim Demaille <akim@epita.fr>
16671
ba0fe3c7 16672 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
16673 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
16674 pacify GCC.
16675 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 16676
676385e2
PH
166772002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16678
16679 Accumulated changelog for new GLR parsing features.
16680
6a254321 16681 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
16682 conflicts_total_count.
16683 * src/conflicts.h: Ditto.
16684 * src/output.c (token_actions): Use the new name.
16685 (output_conflicts): Change conflp => conflict_list_heads, and
16686 confl => conflict_list for better readability.
16687 * data/glr.c: Use the new names.
16688 * NEWS: Add self to GLR announcement.
e0e5bf84 16689
676385e2
PH
16690 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
16691
16692 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
16693 Akim Demaille.
16694
16695 * data/bison.glr: Change name to glr.c
16696 * data/glr.c: Renamed from bison.glr.
16697 * data/Makefile.am: Add glr.c
e0e5bf84
AD
16698
16699 * src/getargs.c:
16700
676385e2 16701 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 16702 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 16703
676385e2
PH
16704 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16705
16706 * data/bison.glr: Be sure to restore the
16707 current #line when returning to the skeleton contents after having
16708 exposed the input file's #line.
16709
16710 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16711
16712 * data/bison.glr: Bring up to date with changes to bison.simple.
16713
16714 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16715
16716 * data/bison.glr: Correct definitions that use b4_prefix.
16717 Various reformatting.
16718 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
16719 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
16720 yytokenp argument; now part of stack.
16721 (yychar): Define to behave as documented.
16722 (yyclearin): Ditto.
e0e5bf84 16723
676385e2
PH
16724 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16725
16726 * src/reader.h: Add declaration for free_merger_functions.
16727
16728 * src/reader.c (merge_functions): New variable.
16729 (get_merge_function): New function.
16730 (free_merger_functions): New function.
16731 (readgram): Check for %prec that is not followed by a symbol.
16732 Handle %dprec and %merge declarations.
16733 (packgram): Initialize dprec and merger fields in rules array.
16734
16735 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
16736 conflict_list_cnt, conflict_list_free): New variables.
16737 (table_grow): Also grow conflict_table.
e0e5bf84 16738 (prepare_rules): Output dprec and merger tables.
676385e2 16739 (conflict_row): New function.
e0e5bf84 16740 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
16741 default reduction in conflicted states for GLR parser so that there
16742 are spaces for the conflict lists.
16743 (save_row): Also save conflict information.
16744 (token_actions): Allocate conflict list.
16745 (merger_output): New function.
16746 (pack_vector): Pack conflict table, too.
16747 (output_conflicts): New function to output yyconflp and yyconfl.
16748 (output_check): Allocate conflict_tos.
16749 (output_actions): Output conflict tables, also.
16750 (output_skeleton): Output b4_mergers definition.
16751 (prepare): Output b4_max_rhs_length definition.
16752 Use 'bison.glr' as default skeleton for GLR parsers.
16753
16754 * src/gram.c (glr_parser): New flag.
16755 (grammar_free): Call free_merger_functions.
16756
16757 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
16758 all pairs of conflicting reductions, rather than just all tokens
16759 causing conflicts. Needed to size conflict tables.
e0e5bf84 16760 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
16761 interface.
16762 (conflicts_print): Ditto.
16763 (count_total_conflicts): New function.
16764
16765 * src/reader.h (merger_list): New type.
16766 (merge_functions): New variable.
16767
16768 * src/lex.h (tok_dprec, tok_merge): New token types.
16769
16770 * src/gram.h (rule_s): Add dprec and merger fields.
16771 (glr_parser): New flag.
16772
16773 * src/conflicts.h (count_total_conflicts): New function.
16774
16775 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
16776
16777 * doc/bison.texinfo (Generalized LR Parsing): New section.
16778 (GLR Parsers): New section.
16779 (Language and Grammar): Mention GLR parsing.
16780 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
16781 Correct typo ("tge" -> "the").
16782
16783 * data/bison.glr: New skeleton for GLR parsing.
16784
16785 * tests/cxx-gram.at: New tests for GLR parsing.
16786
16787 * tests/testsuite.at: Include cxx-gram.at.
16788
16789 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 16790
676385e2
PH
16791 * src/parse-gram.y:
16792
16793 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
16794
16795 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 16796
b5480d74 167972002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
16798
16799 * src/options.h, src/options.c: Remove.
16800 * src/getargs.c (short_options, long_options): New.
16801
60491a94
AD
168022002-06-27 Akim Demaille <akim@epita.fr>
16803
16804 * data/bison.simple, data/bison.c++: Rename as...
16805 * data/yacc.c, data/lalr1.cc: these.
16806 * doc/bison.texinfo (Environment Variables): Remove.
16807
9be0c25b
AD
168082002-06-25 Raja R Harinath <harinath@cs.umn.edu>
16809
16810 * src/getargs.c (report_argmatch): Initialize strtok().
16811
1ae72863
AD
168122002-06-20 Akim Demaille <akim@epita.fr>
16813
16814 * data/bison.simple (b4_symbol_actions): New, replaces...
16815 (b4_symbol_destructor, b4_symbol_printer): these.
16816 (yysymprint): Be sure to call YYPRINT only for tokens, and using
16817 user token numbers.
16818
87542d29
AD
168192002-06-20 Akim Demaille <akim@epita.fr>
16820
16821 * data/bison.simple (yydestructor): Rename as...
16822 (yydestruct): this.
16823
1a31ed21
AD
168242002-06-20 Akim Demaille <akim@epita.fr>
16825
16826 * src/symtab.h, src/symtab.c (symbol_type_set)
16827 (symbol_destructor_set, symbol_precedence_set): The location is
16828 the last argument.
16829 Adjust all callers.
16830
e776192e
AD
168312002-06-20 Akim Demaille <akim@epita.fr>
16832
16833 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
16834 internals.
16835 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
16836 Takes a location.
16837 * src/symtab.h, src/symtab.c (symbol_class_set)
16838 (symbol_user_token_number_set): Likewise.
16839 Adjust all callers.
16840 Promote complain_at.
16841 * tests/input.at (Type Clashes): Adjust.
16842
5c1180b3
AD
168432002-06-20 Akim Demaille <akim@epita.fr>
16844
16845 * data/bison.simple (YYLEX): Fix the declaration when
16846 %pure-parser.
16847
e3170060
AD
168482002-06-20 Akim Demaille <akim@epita.fr>
16849
16850 * data/bison.simple (yysymprint): Don't print the token number,
16851 just its name.
16852 * tests/actions.at (Destructors): Rename as...
16853 (Printers and Destructors): this.
16854 Also exercise %printer.
16855
253862fd
AD
168562002-06-20 Akim Demaille <akim@epita.fr>
16857
16858 * data/bison.simple (YYDSYMPRINT): New.
16859 Use it to remove many of the #if YYDEBUG/if (yydebug).
16860
366eea36
AD
168612002-06-20 Akim Demaille <akim@epita.fr>
16862
16863 * src/symtab.h, src/symtab.c (symbol_t): printer and
16864 printer_location are new members.
16865 (symbol_printer_set): New.
16866 * src/parse-gram.y (PERCENT_PRINTER): New token.
16867 Handle its associated rule.
16868 * src/scan-gram.l: Adjust.
16869 (handle_destructor_at, handle_destructor_dollar): Rename as...
16870 (handle_symbol_code_at, handle_symbol_code_dollar): these.
16871 * src/output.c (symbol_printers_output): New.
16872 (output_skeleton): Call it.
16873 * data/bison.simple (yysymprint): New. Cannot be named yyprint
16874 since there are already many grammar files with a user `yyprint'.
16875 Replace the calls to YYPRINT to calls to yysymprint.
16876 * tests/calc.at: Adjust.
16877 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
16878 taking advantage of parser very internal details (stack size!).
16879
4f25ebb0
AD
168802002-06-20 Akim Demaille <akim@epita.fr>
16881
16882 * src/scan-gram.l: Complete the scanner with the missing patterns
16883 to pacify Flex.
16884 Use `quote' and `symbol_tag_get' where appropriate.
16885
93b68a0e
AD
168862002-06-19 Akim Demaille <akim@epita.fr>
16887
16888 * tests/actions.at (Destructors): Augment to test locations.
16889 * data/bison.simple (yydestructor): Pass it the current location
16890 if locations are enabled.
16891 Prototype only when __STDC__ or C++.
16892 Change the argument names to move into the yy name space: there is
16893 user code here.
16894
58612f1d
AD
168952002-06-19 Akim Demaille <akim@epita.fr>
16896
74310291
AD
16897 * data/bison.simple (b4_pure_if): New.
16898 Use it instead of #ifdef YYPURE.
16899
169002002-06-19 Akim Demaille <akim@epita.fr>
16901
16902 * data/bison.simple (b4_location_if): New.
58612f1d
AD
16903 Use it instead of #ifdef YYLSP_NEEDED.
16904
f25bfb75
AD
169052002-06-19 Akim Demaille <akim@epita.fr>
16906
16907 Prepare @$ in %destructor, but currently don't bind it in the
16908 skeleton, as %location use is not cleaned up yet.
16909
16910 * src/scan-gram.l (handle_dollar, handle_destructor_at)
16911 (handle_action_at): New.
16912 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
16913 a braced_code_t and a location as additional arguments.
16914 (handle_destructor_dollar): Instead of requiring `b4_eval', just
16915 unquote one when outputting `b4_dollar_dollar'.
16916 Adjust callers.
16917 * data/bison.simple (b4_eval): Remove.
16918 (b4_symbol_destructor): Adjust.
16919 * tests/input.at (Invalid @n): Adjust.
16920
c732d2c6
AD
169212002-06-19 Zack Weinberg <zack@codesourcery.com>
16922
16923 * doc/bison.texinfo: Document ability to have multiple
16924 prologue sections.
16925
8c165d89
AD
169262002-06-18 Akim Demaille <akim@epita.fr>
16927
16928 * src/files.c (compute_base_names): When computing the output file
16929 names from the input file name, strip the directory part.
16930
ca98bf57
AD
169312002-06-18 Akim Demaille <akim@epita.fr>
16932
16933 * data/bison.simple.new: Comment changes.
16934 Reported by Andreas Schwab.
16935
0bfb02ff
AD
169362002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
16937
16938 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
16939 there are no `label `yyoverflowlab' defined but not used' warnings
16940 when yyoverflow is defined.
16941
24c0aad7
AD
169422002-06-18 Akim Demaille <akim@epita.fr>
16943
16944 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
16945 new member.
16946 (symbol_destructor_set): Adjust.
16947 * src/output.c (symbol_destructors_output): Output the destructor
16948 locations.
16949 Output the symbol name.
16950 * data/bison.simple (b4_symbol_destructor): Adjust.
16951
5719c109
AD
169522002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
16953 and Akim Demaille <akim@epita.fr>
16954
16955 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
16956 what's left on the stack when the error recovery hits EOF.
16957 * tests/actions.at (Destructors): Complete to exercise this case.
16958
9280d3ef
AD
169592002-06-17 Akim Demaille <akim@epita.fr>
16960
16961 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
16962 arguments is really empty, not only equal to `[]'.
16963 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
16964 member.
16965 (symbol_destructor_set): New.
16966 * src/output.c (symbol_destructors_output): New.
16967 * src/reader.h (brace_code_t, current_braced_code): New.
16968 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
16969 (handle_dollar): Rename as...
16970 (handle_action_dollar): this.
16971 (handle_destructor_dollar): New.
16972 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
16973 (grammar_declaration): Use it.
16974 * data/bison.simple (yystos): Is always defined.
16975 (yydestructor): New.
16976 * tests/actions.at (Destructors): New.
16977 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
16978
dafdc66f
AD
169792002-06-17 Akim Demaille <akim@epita.fr>
16980
16981 * src/symlist.h, src/symlist.c (symbol_list_length): New.
16982 * src/scan-gram.l (handle_dollar, handle_at): Compute the
16983 rule_length only when needed.
16984 * src/output.c (actions_output, token_definitions_output): Output
16985 the full M4 block.
16986 * src/symtab.c: Don't access directly to the symbol tag, use
16987 symbol_tag_get.
16988 * src/parse-gram.y: Use symbol_list_free.
16989
56c47203
AD
169902002-06-17 Akim Demaille <akim@epita.fr>
16991
16992 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
16993 (symbol_list_prepend, get_type_name): Move to...
16994 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
16995 (symbol_list_prepend, symbol_list_n_type_name_get): here.
16996 Adjust all callers.
16997 (symbol_list_free): New.
16998 * src/scan-gram.l (handle_dollar): Takes a location.
16999 * tests/input.at (Invalid $n): Adjust.
17000
1e0bab92
AD
170012002-06-17 Akim Demaille <akim@epita.fr>
17002
17003 * src/reader.h, src/reader.c (symbol_list_new): Export it.
17004 (symbol_list_prepend): New.
17005 * src/parse-gram.y (%union): `list' is a new member.
17006 (symbols.1): New, replaces...
17007 (terms_to_prec.1, nterms_to_type.1): these.
17008 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
17009 Take a location as additional argument.
17010 Adjust all callers.
17011
04e60654
AD
170122002-06-15 Akim Demaille <akim@epita.fr>
17013
17014 * src/parse-gram.y: Move %token in the declaration section so that
17015 we don't depend upon CVS Bison.
17016
10e5b8bd
AD
170172002-06-15 Akim Demaille <akim@epita.fr>
17018
17019 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
17020 * src/print.c (print_core): Use it.
17021
9801d40c
AD
170222002-06-15 Akim Demaille <akim@epita.fr>
17023
17024 * src/conflicts.c (log_resolution): Accept the rule involved in
17025 the sr conflicts instead of the lookahead number that points to
17026 that rule.
17027 (flush_reduce): Accept the current lookahead vector as argument,
17028 instead of the index in LA.
17029 (resolve_sr_conflict): Accept the current number of lookahead
17030 bitset to consider for the STATE, instead of the index in LA.
17031 (set_conflicts): Adjust.
17032 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
17033
c0263492
AD
170342002-06-15 Akim Demaille <akim@epita.fr>
17035
17036 * src/state.h (state_t): Replace the `lookaheadsp' member, a
17037 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
17038 Adjust all dependencies.
17039 * src/lalr.c (initialize_lookaheads): Split into...
17040 (states_lookaheads_count, states_lookaheads_initialize): these.
17041 (lalr): Adjust.
17042
9757c359
AD
170432002-06-15 Akim Demaille <akim@epita.fr>
17044
17045 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
17046 out of...
17047 (grammar_rules_print): here.
17048 * src/reduce.c (reduce_output): Use it.
17049 * tests/reduce.at (Useless Rules, Reduced Automaton)
17050 (Underivable Rules): Adjust.
17051
6b98e4b5
AD
170522002-06-15 Akim Demaille <akim@epita.fr>
17053
17054 Copy BYacc's nice way to report the grammar.
17055
17056 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
17057 New.
17058 Don't print the rules' location, it is confusing and useless.
17059 (rule_print): Use grammar_rhs_print.
17060 * src/print.c (print_grammar): Use grammar_rules_print.
17061
6b98e4b5
AD
170622002-06-15 Akim Demaille <akim@epita.fr>
17063
17064 Complete and rationalize `useless thing' warnings.
17065
17066 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
17067 (symbol_tag_print): New.
17068 Use them everywhere in place of accessing directly the tag member.
17069 * src/gram.h, src/gram.c (rule_print): New.
17070 Use it where a rule used to be printed `by hand'.
17071 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
17072 (reduce_grammar_tables): Report the useless rules.
17073 (reduce_print): Useless things are a warning, not an error.
17074 Report it as such.
17075 * tests/reduce.at (Useless Nonterminals, Useless Rules):
17076 (Reduced Automaton, Underivable Rules): Adjust.
17077 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
17078 * tests/conflicts.at (Unresolved SR Conflicts)
17079 (Solved SR Conflicts): Adjust.
17080
ee000ba4
AD
170812002-06-15 Akim Demaille <akim@epita.fr>
17082
17083 Let symbols have a location.
17084
17085 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
17086 (getsym): Adjust.
17087 Adjust all callers.
17088 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
17089 Use location_t, not int.
17090 * src/symtab.c (symbol_check_defined): Take advantage of the
17091 location.
17092 * tests/regression.at (Invalid inputs): Adjust.
17093
8efe435c
AD
170942002-06-15 Akim Demaille <akim@epita.fr>
17095
17096 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
17097 (input): Don't try to initialize yylloc here, do it in the
17098 scanner.
17099 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
17100 * src/gram.h (rule_t): Change line and action_line into location
17101 and action_location, of location_t type.
17102 Adjust all dependencies.
17103 * src/location.h, src/location.c (empty_location): New.
17104 * src/reader.h, src/reader.c (grammar_start_symbol_set)
17105 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
17106 (grammar_current_rule_symbol_append)
17107 (grammar_current_rule_action_append): Expect a location as argument.
17108 * src/reader.c (grammar_midrule_action): Adjust to attach an
17109 action's location as dummy symbol location.
17110 * src/symtab.h, src/symtab.c (startsymbol_location): New.
17111 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
17112 the line numbers.
17113
1921f1d7
AD
171142002-06-14 Akim Demaille <akim@epita.fr>
17115
17116 Grammar declarations may be found in the grammar section.
17117
17118 * src/parse-gram.y (rules_or_grammar_declaration): New.
17119 (declarations): Each declaration may end with a semicolon, not
17120 just...
17121 (grammar_declaration): `"%union"'.
17122 (grammar): Branch to rules_or_grammar_declaration.
17123
4515534c
AD
171242002-06-14 Akim Demaille <akim@epita.fr>
17125
17126 * src/main.c (main): Invoke scanner_free.
17127
f958596b
AD
171282002-06-14 Akim Demaille <akim@epita.fr>
17129
17130 * src/output.c (m4_invoke): Extracted from...
17131 (output_skeleton): here.
17132 Free tempfile.
17133
2c569025
AD
171342002-06-14 Akim Demaille <akim@epita.fr>
17135
17136 * src/parse-gram.y (directives, directive, gram)
17137 (grammar_directives, precedence_directives, precedence_directive):
17138 Rename as...
17139 (declarations, declaration, grammar, grammar_declaration)
17140 (precedence_declaration, precedence_declarator): these.
17141 (symbol_declaration): New.
17142
592e8d4d
AD
171432002-06-14 Akim Demaille <akim@epita.fr>
17144
17145 * src/files.c (action_obstack): Remove, unused.
17146 (output_obstack): Remove it, and all its dependencies, as it is no
17147 longer needed.
17148 * src/reader.c (epilogue_set): Build the epilogue in the
17149 muscle_obstack.
17150 * src/output.h, src/output.c (muscle_obstack): Move to...
17151 * src/muscle_tab.h, src/muscle_tab.h: here.
17152 (muscle_init): Initialize muscle_obstack.
17153 (muscle_free): New.
17154 * src/main.c (main): Call it.
17155
0c15323d
AD
171562002-06-14 Akim Demaille <akim@epita.fr>
17157
17158 * src/location.h: New, extracted from...
17159 * src/reader.h: here.
17160 * src/Makefile.am (noinst_HEADERS): Merge into
17161 (bison_SOURCES): this.
17162 Add location.h.
17163 * src/parse-gram.y: Use location_t instead of Bison's.
17164 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
17165 Use location_t instead of ints.
17166
e96c9728
AD
171672002-06-14 Akim Demaille <akim@epita.fr>
17168
17169 * data/bison.simple, data/bison.c++: Be sure to restore the
17170 current #line when returning to the skeleton contents after having
17171 exposed the input file's #line.
17172
75d1fe16
AD
171732002-06-12 Akim Demaille <akim@epita.fr>
17174
17175 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
17176 eager.
17177 * tests/actions.at (Exotic Dollars): New.
17178
6c35d22c
AD
171792002-06-12 Akim Demaille <akim@epita.fr>
17180
17181 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
17182 ['"/] too eagerly.
17183 * tests/input.at (Torturing the Scanner): New.
17184
1d6412ad
AD
171852002-06-11 Akim Demaille <akim@epita.fr>
17186
17187 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
17188 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
17189 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
17190 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
17191 * src/reader.c (reader): Use it.
17192
4cdb01db
AD
171932002-06-11 Akim Demaille <akim@epita.fr>
17194
17195 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
17196 Adjust all callers.
17197 (scanner_last_string_free): New.
17198
44995b2e
AD
171992002-06-11 Akim Demaille <akim@epita.fr>
17200
17201 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
17202 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
17203 (last_string, YY_OBS_FREE): New.
17204 Use them when returning an ID.
17205
e9955c83
AD
172062002-06-11 Akim Demaille <akim@epita.fr>
17207
17208 Have Bison grammars parsed by a Bison grammar.
17209
17210 * src/reader.c, src/reader.h (prologue_augment): New.
17211 * src/reader.c (copy_definition): Remove.
17212
17213 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
17214 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
17215 (grammar_current_rule_prec_set, grammar_current_rule_check)
17216 (grammar_current_rule_symbol_append)
17217 (grammar_current_rule_action_append): Export.
17218 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
17219 (symbol_list_action_append): Remove.
17220 Hook the routines from reader.
17221 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
17222 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
17223
17224 * src/reader.c (read_declarations): Remove, unused.
17225
17226 * src/parse-gram.y: Handle the epilogue.
17227 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
17228 (grammar_start_symbol_set): this.
17229 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
17230 * src/reader.c (readgram): Remove, unused.
17231 (reader): Adjust to insert eoftoken and axiom where appropriate.
17232
17233 * src/reader.c (copy_dollar): Replace with...
17234 * src/scan-gram.h (handle_dollar): this.
17235 * src/parse-gram.y: Remove `%thong'.
17236
17237 * src/reader.c (copy_at): Replace with...
17238 * src/scan-gram.h (handle_at): this.
17239
17240 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
17241 New.
17242
17243 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
17244 time being.
17245
17246 * src/reader.h, src/reader.c (grammar_rule_end): New.
17247
17248 * src/parse.y (current_type, current_class): New.
17249 Implement `%nterm', `%token' support.
17250 Merge `%term' into `%token'.
17251 (string_as_id): New.
17252 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
17253 type name.
17254
17255 * src/parse-gram.y: Be sure to handle properly the beginning of
17256 rules.
17257
17258 * src/parse-gram.y: Handle %type.
17259 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
17260
17261 * src/parse-gram.y: More directives support.
17262 * src/options.c: No longer handle source directives.
17263
17264 * src/parse-gram.y: Fix %output.
17265
17266 * src/parse-gram.y: Handle %union.
17267 Use the prologue locations.
17268 * src/reader.c (parse_union_decl): Remove.
17269
17270 * src/reader.h, src/reader.c (epilogue_set): New.
17271 * src/parse-gram.y: Use it.
17272
17273 * data/bison.simple, data/bison.c++: b4_stype is now either not
17274 defined, then default to int, or to the contents of %union,
17275 without `union' itself.
17276 Adjust.
17277 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
17278
17279 * src/output.c (actions_output): Don't output braces, as they are
17280 already handled by the scanner.
17281
17282 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
17283 characters to themselves.
17284
17285 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
17286 that the epilogue has a proper #line.
17287
17288 * src/parse-gram.y: Handle precedence/associativity.
17289
17290 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
17291 a terminal.
17292 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
17293 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
17294 at all to define terminals that cannot be emitted.
17295
17296 * src/scan-gram.l: Escape M4 characters.
17297
17298 * src/scan-gram.l: Working properly with escapes in user
17299 strings/characters.
17300
17301 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
17302 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
17303 grammar.
17304 Use more modest sizes, as for the time being the parser does not
17305 release memory, and therefore the process swallows a huge amount
17306 of memory.
17307
17308 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
17309 stricter %token grammar.
17310
17311 * src/symtab.h (associativity): Add `undef_assoc'.
17312 (symbol_precedence_set): Do nothing when passed an undef_assoc.
17313 * src/symtab.c (symbol_check_alias_consistence): Adjust.
17314
17315 * tests/regression.at (Invalid %directive): Remove, as it is now
17316 meaningless.
17317 (Invalid inputs): Adjust to the new error messages.
17318 (Token definitions): The new grammar doesn't allow too many
17319 eccentricities.
17320
17321 * src/lex.h, src/lex.c: Remove.
17322 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
17323 (copy_character, copy_string2, copy_string, copy_identifier)
17324 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
17325 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
17326 (parse_action): Remove.
17327 * po/POTFILES.in: Adjust.
17328
2e047461
AD
173292002-06-11 Akim Demaille <akim@epita.fr>
17330
cd05d13c 17331 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
17332 rule's action member: return the action as a string.
17333 Don't require `rule_length' as an argument: compute it.
17334 (grammar_current_rule_symbol_append)
17335 (grammar_current_rule_action_append): New, eved out from
17336 (readgram): here.
17337 Remove `action_flag', `rulelength', unused now.
17338
9af3fbce
AD
173392002-06-11 Akim Demaille <akim@epita.fr>
17340
17341 * src/reader.c (grammar_current_rule_prec_set).
17342 (grammar_current_rule_check): New, eved out from...
17343 (readgram): here.
17344 Remove `xaction', `first_rhs': useless.
17345 * tests/input.at (Type clashes): New.
17346 * tests/existing.at (GNU Cim Grammar): Adjust.
17347
1485e106
AD
173482002-06-11 Akim Demaille <akim@epita.fr>
17349
17350 * src/reader.c (grammar_midrule_action): New, Eved out from
17351 (readgram): here.
17352
da4160c3
AD
173532002-06-11 Akim Demaille <akim@epita.fr>
17354
17355 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
17356 New.
17357 (readgram): Use them as replacement of inlined code, crule and
17358 crule1.
17359
f6d0f937
AD
173602002-06-11 Akim Demaille <akim@epita.fr>
17361
17362 * src/reader.c (grammar_end, grammar_symbol_append): New.
17363 (readgram): Use them.
17364 Make the use of `p' as local as possible.
17365
69078d4b
AD
173662002-06-10 Akim Demaille <akim@epita.fr>
17367
17368 GCJ's parser requires the tokens to be defined before the prologue.
17369
17370 * data/bison.simple: Output the token definition before the user's
17371 prologue.
17372 * tests/regression.at (Braces parsing, Duplicate string)
17373 (Mixing %token styles): Check the output from bison.
17374 (Early token definitions): New.
17375
5e424082
AD
173762002-06-10 Akim Demaille <akim@epita.fr>
17377
17378 * src/symtab.c (symbol_user_token_number_set): Don't complain when
17379 assigning twice the same user number to a token, so that we can
17380 use it in...
17381 * src/lex.c (lex): here.
17382 Also use `symbol_class_set' instead of hand written code.
17383 * src/reader.c (parse_assoc_decl): Likewise.
17384
44536b35
AD
173852002-06-10 Akim Demaille <akim@epita.fr>
17386
17387 * src/symtab.c, src/symtab.c (symbol_class_set)
17388 (symbol_user_token_number_set): New.
17389 * src/reader.c (parse_token_decl): Use them.
17390 Use a switch instead of ifs.
17391 Use a single argument.
17392
8b9f2372
AD
173932002-06-10 Akim Demaille <akim@epita.fr>
17394
17395 Remove `%thong' support as it is undocumented, unused, duplicates
17396 `%token's job, and creates useless e-mail traffic with people who
17397 want to know what it is, why it is undocumented, unused, and
17398 duplicates `%token's job.
17399
17400 * src/reader.c (parse_thong_decl): Remove.
17401 * src/options.c (option_table): Remove "thong".
17402 * src/lex.h (tok_thong): Remove.
17403
3ae2b51f
AD
174042002-06-10 Akim Demaille <akim@epita.fr>
17405
17406 * src/symtab.c, src/symtab.c (symbol_type_set)
17407 (symbol_precedence_set): New.
17408 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
17409 (value_components_used): Remove, unused.
17410
2f1afb73
AD
174112002-06-09 Akim Demaille <akim@epita.fr>
17412
17413 Move symbols handling code out of the reader.
17414
17415 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
17416 (axiom): Move to...
17417 * src/symtab.h, src/symtab.c: here.
17418
17419 * src/gram.c (start_symbol): Remove: use startsymbol->number.
17420 * src/reader.c (startval): Rename as...
17421 * src/symtab.h, src/symtab.c (startsymbol): this.
17422 * src/reader.c: Adjust.
17423
17424 * src/reader.c (symbol_check_defined, symbol_make_alias)
17425 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
17426 (token_translations_init)
17427 Move to...
17428 * src/symtab.c: here.
17429 * src/reader.c (packsymbols): Move to...
17430 * src/symtab.h, src/symtab.c (symbols_pack): here.
17431 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
17432 argument.
17433
e9bca3ad
AD
174342002-06-03 Akim Demaille <akim@epita.fr>
17435
17436 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
17437 then statements.
17438
86eff183
AD
174392002-06-03 Akim Demaille <akim@epita.fr>
17440
17441 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
17442 structs with non literals.
17443 * src/scan-skel.l: never-interactive.
17444 * src/conflicts.c (enum conflict_resolution_e): No trailing
17445 comma.
17446 * src/getargs.c (usage): Split long literal strings.
17447 Reported by Hans Aberg.
17448
717be197
AD
174492002-05-28 Akim Demaille <akim@epita.fr>
17450
17451 * data/bison.c++: Use C++ ostreams.
17452 (cdebug_): New member.
17453
670ddffd
AD
174542002-05-28 Akim Demaille <akim@epita.fr>
17455
17456 * src/output.c (output_skeleton): Be sure to allocate enough room
17457 for `/' _and_ for `\0' in full_skeleton.
17458
769b430f
AD
174592002-05-28 Akim Demaille <akim@epita.fr>
17460
17461 * data/bison.c++: Catch up with bison.simple:
17462 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17463 and Paul Eggert <eggert@twinsun.com>: `error' handing.
17464 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
17465 and popping traces.
17466
7067cb36
PH
174672002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17468
17469 * src/output.c (output_skeleton): Put an explicit path in front of
17470 the skeleton file name, rather than relying on the -I directory,
17471 to partially alleviate effects of having a skeleton file lying around
17472 in the current directory.
769b430f 17473
4a713ec2
PH
174742002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17475
769b430f 17476 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
17477 obstack_printf should be obstack_fgrow1.
17478
b408954b
AD
174792002-05-26 Akim Demaille <akim@epita.fr>
17480
17481 * src/state.h (state_t): `solved_conflicts' is a new member.
17482 * src/LR0.c (new_state): Set it to 0.
17483 * src/conflicts.h, src/conflicts.c (print_conflicts)
17484 (free_conflicts, solve_conflicts): Rename as...
17485 (conflicts_print, conflicts_free, conflicts_solve): these.
17486 Adjust callers.
17487 * src/conflicts.c (enum conflict_resolution_e)
17488 (solved_conflicts_obstack): New, used by...
17489 (log_resolution): this.
17490 Adjust to attach the conflict resolution to each state.
17491 Complete the description with the precedence/associativity
17492 information.
17493 (resolve_sr_conflict): Adjust.
17494 * src/print.c (print_state): Output its solved_conflicts.
17495 * tests/conflicts.at (Unresolved SR Conflicts)
17496 (Solved SR Conflicts): Exercise --report=all.
17497
a49aecd5
AD
174982002-05-26 Akim Demaille <akim@epita.fr>
17499
17500 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
17501 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
17502 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
17503 (token_number_t, item_number_as_token_number)
17504 (token_number_as_item_number, muscle_insert_token_number_table):
17505 Rename as...
17506 (symbol_number_t, item_number_as_symbol_number)
17507 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
17508 these, since it is more appropriate.
17509
5504898e
AD
175102002-05-26 Akim Demaille <akim@epita.fr>
17511
17512 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
17513 `Error:' lines.
17514 * data/bison.simple (yystos) [YYDEBUG]: New.
17515 (yyparse) [YYDEBUG]: Display the symbols which are popped during
17516 error recovery.
17517 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
17518
ec3bc396
AD
175192002-05-25 Akim Demaille <akim@epita.fr>
17520
17521 * doc/bison.texinfo (Debugging): Split into...
17522 (Tracing): this new section, its former contents, and...
17523 (Understanding): this new section.
17524 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
17525 by...
17526 (report_flag): this.
17527 Adjust all dependencies.
17528 (report_args, report_types, report_argmatch): New.
17529 (usage, getargs): Report/support -r, --report.
17530 * src/options.h
17531 (struct option_table_struct): Rename as..,
17532 (struct option_table_s): this.
17533 Rename the `set_flag' member to `flag' to match with getopt_long's
17534 struct.
17535 * src/options.c (option_table): Split verbose into an entry for
17536 %verbose, and another for --verbose.
17537 Support --report/-r, so remove -r from the obsolete --raw.
17538 * src/print.c: Attach full item sets and lookaheads reports to
17539 report_flag instead of trace_flag.
17540 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
17541
78df8250
PE
175422002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17543 and Paul Eggert <eggert@twinsun.com>
769b430f 17544
78df8250
PE
17545 * data/bison.simple (yyparse): Correct error handling to conform to
17546 POSIX and yacc. Specifically, after syntax error is discovered,
17547 do not reduce further before shifting the error token.
17548 Clean up the code a bit by removing the labels yyerrdefault,
17549 yyerrhandle, yyerrpop.
17550 * NEWS: Document the above.
17551
c0c9ea05
PH
175522002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17553
17554 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
17555 type; it isn't always big enough, since it doesn't necessarily
17556 include non-terminals.
769b430f 17557 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
17558 the latter can be removed.
17559 (yy_token_number_type): Remove, only one use.
17560 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
17561 don't use TokenNumberType as element type.
769b430f 17562
c0c9ea05
PH
17563 * tests/regression.at: Modify expected output to agree with change
17564 to yyr1 and yytranslate.
769b430f 17565
6390a83f
FK
175662002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
17567
17568 * src/reader.c (parse_action): Use copy_character instead of
17569 obstack_1grow.
17570
db7c8e9a
AD
175712002-05-13 Akim Demaille <akim@epita.fr>
17572
17573 * tests/regression.at (Token definitions): Prototype yylex and
17574 yyerror.
17575
fcc61800
PH
175762002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17577
158c687b 17578 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
17579 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
17580 32-bit arithmetic.
17581 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
17582
5683e9b2
AD
175832002-05-07 Akim Demaille <akim@epita.fr>
17584
17585 * tests/synclines.at: Be sure to prototype yylex and yyerror to
17586 avoid GCC warnings.
17587
0c2d3f4c
AD
175882002-05-07 Akim Demaille <akim@epita.fr>
17589
17590 Kill GCC warnings.
17591
17592 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
17593 over the RHS of each rule.
17594 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
17595 * src/state.h (state_t): Member `nitems' is unsigned short.
17596 * src/LR0.c (get_state): Adjust.
17597 * src/reader.c (packgram): Likewise.
17598 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
17599 `Type'.
17600 (muscle_insert_int_table): Remove, unused.
17601 (prepare_rules): Remove `max'.
17602
1565b720
AD
176032002-05-06 Akim Demaille <akim@epita.fr>
17604
17605 * src/closure.c (print_firsts): Display of the symbol tags.
17606 (bitmatrix_print): Move to...
17607 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
17608 here.
17609 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
17610
cfaee611
AD
176112002-05-06 Akim Demaille <akim@epita.fr>
17612
17613 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
17614 hash_do_for_each.
17615
458be8e0
AD
176162002-05-06 Akim Demaille <akim@epita.fr>
17617
17618 * src/LR0.c (new_state, get_state): Instead of using the global
17619 `kernel_size' and `kernel_base', have two new arguments:
17620 `core_size' and `core'.
17621 Adjust callers.
17622
a900a624
AD
176232002-05-06 Akim Demaille <akim@epita.fr>
17624
17625 * src/reader.c (packgram): No longer end `ritem' with a 0
17626 sentinel: it is not used.
17627
d4e7d3a1
AD
176282002-05-05 Akim Demaille <akim@epita.fr>
17629
17630 New experimental feature: display the lookaheads in the report and
17631 graph.
17632
17633 * src/print (print_core): When --trace-flag, display the rules
17634 lookaheads.
17635 * src/print_graph.c (print_core): Likewise.
17636 Swap the arguments.
17637 Adjust caller.
17638
39ceb25b
AD
176392002-05-05 Akim Demaille <akim@epita.fr>
17640
17641 * tests/torture.at (Many lookaheads): New test.
17642
5372019f
AD
176432002-05-05 Akim Demaille <akim@epita.fr>
17644
17645 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
17646 (GENERATE_MUSCLE_INSERT_TABLE): this.
17647 (output_int_table, output_unsigned_int_table, output_short_table)
17648 (output_token_number_table, output_item_number_table): Replace with...
17649 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
17650 (muscle_insert_short_table, muscle_insert_token_number_table)
17651 (muscle_insert_item_number_table): these.
17652 Adjust all callers.
17653 (prepare_tokens): Don't free `translations', since...
17654 * src/reader.h, src/reader.c (grammar_free): do it.
17655 Move to...
17656 * src/gram.h, src/gram.c (grammar_free): here.
17657 * data/bison.simple, data/bison.c++: b4_token_number_max is now
17658 b4_translate_max.
17659
5df5f6d5
AD
176602002-05-05 Akim Demaille <akim@epita.fr>
17661
17662 * src/output.c (output_unsigned_int_table): New.
17663 (prepare_rules): `i' is unsigned.
17664 `prhs', `rline', `r2' are unsigned int.
17665 Rename muscle `rhs_number_max' as `rhs_max'.
17666 Output muscles `prhs_max', `rline_max', and `r2_max'.
17667 Free rline and r1.
17668 * data/bison.simple, data/bison.c++: Adjust to use these muscles
17669 to compute types instead of constant types.
17670 * tests/regression.at (Web2c Actions): Adjust.
17671
b87f8b21
AD
176722002-05-04 Akim Demaille <akim@epita.fr>
17673
17674 * src/symtab.h (SALIAS, SUNDEF): Rename as...
17675 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
17676 Adjust dependencies.
17677 * src/output.c (token_definitions_output): Be sure not to output a
17678 `#define 'a'' when fed with `%token 'a' "a"'.
17679 * tests/regression.at (Token definitions): New.
17680
8bb936e4
PE
176812002-05-03 Paul Eggert <eggert@twinsun.com>
17682
17683 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
17684 for K&R C.
17685
176862002-05-03 gettextize <bug-gnu-gettext@gnu.org>
17687
17688 * Makefile.am (SUBDIRS): Remove intl.
17689 (EXTRA_DIST): Add config/config.rpath.
17690
53c71a12
AD
176912002-05-03 Akim Demaille <akim@epita.fr>
17692
17693 * data/bison.simple (m4_if): Don't output empty enums.
17694 And actually, output valid enum definitions :(.
17695
289dd0cf
AD
176962002-05-03 Akim Demaille <akim@epita.fr>
17697
17698 * configure.bat: Remove, completely obsolete.
17699 * Makefile.am (EXTRA_DIST): Adjust.
17700 Don't distribute config.rpath...
17701 * config/Makefile.am (EXTRA_DIST): Do it.
17702
db85e524
AD
177032002-05-03 Akim Demaille <akim@epita.fr>
17704
17705 * configure.in (GETTEXT_VERSION): New.
17706 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
17707
83ccf991
AD
177082002-05-03 Akim Demaille <akim@epita.fr>
17709
17710 * data/bison.simple (b4_token_enum): New.
17711 (b4_token_defines): Use it to output tokens both as #define and
17712 enums.
17713 Suggested by Paul Eggert.
17714 * src/output.c (token_definitions_output): Don't output spurious
17715 white spaces.
17716
1f418995
AD
177172002-05-03 Akim Demaille <akim@epita.fr>
17718
17719 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
17720
45119f04
RA
177212002-05-02 Robert Anisko <robert@lrde.epita.fr>
17722
17723 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
17724 Update the stack class, give a try to deque as the default container.
17725
b2d52318
AD
177262002-05-02 Akim Demaille <akim@epita.fr>
17727
17728 * data/bison.simple (yyparse): Do not implement @$ = @1.
17729 (YYLLOC_DEFAULT): Adjust to do it.
17730 * doc/bison.texinfo (Location Default Action): Fix.
17731
3a8b4109
AD
177322002-05-02 Akim Demaille <akim@epita.fr>
17733
17734 * src/reader.c (parse_braces): Merge into...
17735 (parse_action): this.
17736
84614e13
AD
177372002-05-02 Akim Demaille <akim@epita.fr>
17738
17739 * configure.in (ALL_LINGUAS): Remove.
17740 * po/LINGUAS, hr.po: New.
17741
fdbcd8e2
AD
177422002-05-02 Akim Demaille <akim@epita.fr>
17743
17744 Remove the so called hairy (semantic) parsers.
17745
17746 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
17747 * src/gram.h, src/gram.c (semantic_parser): Remove.
17748 (rule_t): Remove the guard and guard_line members.
17749 * src/lex.h (token_t): remove tok_guard.
17750 * src/options.c (option_table): Remove %guard and %semantic_parser
17751 support.
17752 * src/output.c, src/output.h (guards_output): Remove.
17753 (prepare): Adjust.
17754 (token_definitions_output): Don't output the `T'
17755 tokens (???).
17756 (output_skeleton): Don't output the guards.
17757 * src/files.c, src/files.c (attrsfile): Remove.
17758 * src/reader.c (symbol_list): Remove the guard and guard_line
17759 members.
17760 Adjust dependencies.
17761 (parse_guard): Remove.
17762 * data/bison.hairy: Remove.
17763 * doc/bison.texinfo (Environment Variables): Remove occurrences of
17764 BISON_HAIRY.
17765
82b6cb3f
AD
177662002-05-02 Akim Demaille <akim@epita.fr>
17767
17768 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
17769 (parse_guard): Rename the formal argument `stack_offset' as
17770 `rule_length', which is more readable.
17771 Adjust callers.
17772 (copy_at, copy_dollar): Instead of outputting the hard coded
17773 values of $$, $n and so forth, output invocation to b4_lhs_value,
17774 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
17775 Note: this patch partially drops `semantic-parser' support: it
17776 always does `rule_length - n', where semantic parsers ought to
17777 always use `-n'.
82b6cb3f
AD
17778 * data/bison.simple, data/bison.c++ (b4_lhs_value)
17779 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
17780
6cbfbcc5
AD
177812002-05-02 Akim Demaille <akim@epita.fr>
17782
17783 * configure.in (AC_INIT): Bump to 1.49b.
17784 (AM_INIT_AUTOMAKE): Short invocation.
17785
b8548114
AD
177862002-05-02 Akim Demaille <akim@epita.fr>
17787
17788 Version 1.49a.
17789
c20cd1fa
AD
177902002-05-01 Akim Demaille <akim@epita.fr>
17791
17792 * src/skeleton.h: Remove.
17793
8a9566d4
AD
177942002-05-01 Akim Demaille <akim@epita.fr>
17795
17796 * src/skeleton.h: Fix the #endif.
17797 Reported by Magnus Fromreide.
17798
8c6d399a
PE
177992002-04-26 Paul Eggert <eggert@twinsun.com>
17800
17801 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
17802 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 17803 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 17804
2b7ed18a
RA
178052002-04-25 Robert Anisko <robert@lrde.epita.fr>
17806
17807 * src/scan-skel.l: Postprocess quadrigraphs.
17808
17809 * src/reader.c (copy_character): New function, used to output
17810 single characters while replacing `[' and `]' with quadrigraphs, to
17811 avoid troubles with M4 quotes.
17812 (copy_comment): Output characters with copy_character.
17813 (read_additionnal_code): Likewise.
17814 (copy_string2): Likewise.
17815 (copy_definition): Likewise.
17816
17817 * tests/calc.at: Exercise M4 quoting.
17818
34a89c50
AD
178192002-04-25 Akim Demaille <akim@epita.fr>
17820
17821 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
17822 between `!' and the command.
17823 Reported by Paul Eggert.
17824
0dd1580a
RA
178252002-04-24 Robert Anisko <robert@lrde.epita.fr>
17826
17827 * tests/calc.at: Exercise prologue splitting.
17828
17829 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
17830 `b4_post_prologue' instead of `b4_prologue'.
17831
17832 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
17833 muscles.
17834 (output): Free pre_prologue_obstack and post_prologue_obstack.
17835 * src/files.h, src/files.c (attrs_obstack): Remove.
17836 (pre_prologue_obstack, post_prologue_obstack): New.
17837 * src/reader.c (copy_definition): Add a parameter to specify the
17838 obstack to fill, instead of using attrs_obstack unconditionally.
17839 (read_declarations): Pass pre_prologue_obstack to copy_definition if
17840 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
17841
83c1796f
PE
178422002-04-23 Paul Eggert <eggert@twinsun.com>
17843
17844 * data/bison.simple: Remove unnecessary commentary and white
17845 space differences from 1_29-branch.
17846 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
17847
17848 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
17849 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
17850 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
17851 constructors or destructors.
17852
17853 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
17854
1207eeac
AD
178552002-04-23 Akim Demaille <akim@epita.fr>
17856
17857 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
17858 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
17859 location with columns.
17860 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
17861 All reported by Paul Eggert.
17862
78ab8f67
AD
178632002-04-22 Akim Demaille <akim@epita.fr>
17864
17865 * src/reduce.c (dump_grammar): Move to...
17866 * src/gram.h, src/gram.c (grammar_dump): here.
17867 Be sure to separate long item numbers.
17868 Don't read the members of a rule's prec if its nil.
17869
133c20e2
AD
178702002-04-22 Akim Demaille <akim@epita.fr>
17871
17872 * src/output.c (table_size, table_grow): New.
17873 (MAXTABLE): Remove, replace uses with table_size.
17874 (pack_vector): Instead of dying when the table is too big, grow it.
17875
9515e8a7
AD
178762002-04-22 Akim Demaille <akim@epita.fr>
17877
17878 * data/bison.simple (yyr1): Its type is that of a token number.
17879 * data/bison.c++ (r1_): Likewise.
17880 * tests/regression.at (Web2c Actions): Adjust.
17881
23c5a174
AD
178822002-04-22 Akim Demaille <akim@epita.fr>
17883
17884 * src/reader.c (token_translations_init): 256 is now the default
17885 value for the error token, i.e., it will be assigned another
17886 number if the user assigned 256 to one of her tokens.
17887 (reader): Don't force 256 to error.
17888 * doc/bison.texinfo (Symbols): Adjust.
17889 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
17890 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
17891 etc. instead of 10, 20, 30 (which was used to `jump' over error
17892 (256) and undefined (2)).
17893
5fbb0954
AD
178942002-04-22 Akim Demaille <akim@epita.fr>
17895
17896 Propagate more token_number_t.
17897
17898 * src/gram.h (token_number_as_item_number)
17899 (item_number_as_token_number): New.
17900 * src/output.c (GENERATE_OUTPUT_TABLE): New.
17901 Use it to create output_item_number_table and
17902 output_token_number_table.
17903 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
17904 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
17905 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
17906 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
17907
4f940944
AD
179082002-04-22 Akim Demaille <akim@epita.fr>
17909
17910 * src/output.h, src/output.c (get_lines_number): Remove.
17911
3ded9a63
AD
179122002-04-19 Akim Demaille <akim@epita.fr>
17913
17914 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
17915 as Lex/Flex'.
17916 (Debugging): More details about enabling the debugging features.
17917 (Table of Symbols): Describe $$, $n, @$, and @n.
17918 Suggested by Tim Josling.
17919
e0c471a9
AD
179202002-04-19 Akim Demaille <akim@epita.fr>
17921
17922 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
17923
fecc10cd
AD
179242002-04-10 Akim Demaille <akim@epita.fr>
17925
17926 * src/system.h: Rely on HAVE_LIMITS_H.
17927 Suggested by Paul Eggert.
17928
51dec47b
AD
179292002-04-09 Akim Demaille <akim@epita.fr>
17930
17931 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
17932 full stderr, and strip it according to the bison options, instead
17933 of composing the error message from different bits.
17934 This makes it easier to check for several error messages.
17935 Adjust all the invocations.
17936 Add an invocation exercising the error token.
17937 Add an invocation demonstrating a stupid error message.
17938 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
17939 Adjust the tests.
17940 Error message are for stderr, not stdout.
17941
007a50a4
AD
179422002-04-09 Akim Demaille <akim@epita.fr>
17943
17944 * src/gram.h, src/gram.c (error_token_number): Remove, use
17945 errtoken->number.
17946 * src/reader.c (reader): Don't specify the user token number (2)
17947 for $undefined, as it uselessly prevents using it.
17948 * src/gram.h (token_number_t): Move to...
17949 * src/symtab.h: here.
17950 (state_t.number): Is a token_number_t.
17951 * src/print.c, src/reader.c: Use undeftoken->number instead of
17952 hard coded 2.
17953 (Even though this 2 is not the same as above: the number of the
17954 undeftoken remains being 2, it is its user token number which
17955 might not be 2).
17956 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
17957 `user_token_number_max'.
17958 Output `undef_token_number'.
17959 * data/bison.simple, data/bison.c++: Use them.
17960 Be sure to map invalid yylex return values to
17961 `undef_token_number'. This saves us from gratuitous SEGV.
17962
17963 * tests/conflicts.at (Solved SR Conflicts)
17964 (Unresolved SR Conflicts): Adjust.
17965 * tests/regression.at (Web2c Actions): Adjust.
17966
06446ccf
AD
179672002-04-08 Akim Demaille <akim@epita.fr>
17968
17969 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
17970 Adding #line.
17971 Remove the duplicate `typedefs'.
17972 (RhsNumberType): Fix the declaration and various other typos.
17973 Use __ofile__.
17974 * data/bison.simple: Use __ofile__.
17975 * src/scan-skel.l: Handle __ofile__.
17976
62a3e4f0
AD
179772002-04-08 Akim Demaille <akim@epita.fr>
17978
17979 * src/gram.h (item_number_t): New, the type of item numbers in
17980 RITEM. Note that it must be able to code symbol numbers as
17981 positive number, and the negation of rule numbers as negative
17982 numbers.
17983 Adjust all dependencies (pretty many).
17984 * src/reduce.c (rule): Remove this `short *' pointer: use
17985 item_number_t.
17986 * src/system.h (MINSHORT, MAXSHORT): Remove.
17987 Include `limits.h'.
17988 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
17989 (shortcpy): Remove.
17990 (MAXTABLE): Move to...
17991 * src/output.c (MAXTABLE): here.
17992 (prepare_rules): Use output_int_table to output rhs.
17993 * data/bison.simple, data/bison.c++: Adjust.
17994 * tests/torture.at (Big triangle): Move the limit from 254 to
17995 500.
17996 * tests/regression.at (Web2c Actions): Ajust.
17997
17998 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
17999 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
18000 passes, but produces negative #line number, once fixed, GCC is
18001 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
18002 C), it passes.
18003 * src/state.h (state_h): Code input lines on ints, not shorts.
18004
bb88b0fc
AD
180052002-04-08 Akim Demaille <akim@epita.fr>
18006
18007 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
18008 and then the grammar.
18009
9a636f47
AD
180102002-04-08 Akim Demaille <akim@epita.fr>
18011
18012 * src/system.h: No longer using strndup.
18013
680e8701
AD
180142002-04-07 Akim Demaille <akim@epita.fr>
18015
18016 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
18017 * src/output.c (output_table_data): Return the longest number.
18018 (prepare_tokens): Output `token_number_max').
18019 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
18020 New.
18021 Use them to define yy_token_number_type/TokenNumberType.
18022 Use this type for yytranslate.
18023 * tests/torture.at (Big triangle): Push the limit from 124 to
18024 253.
18025 * tests/regression.at (Web2c Actions): Adjust.
18026
817e9f41
AD
180272002-04-07 Akim Demaille <akim@epita.fr>
18028
18029 * tests/torture.at (Big triangle): New.
18030 (GNU AWK Grammar, GNU Cim Grammar): Move to...
18031 * tests/existing.at: here.
18032
5123689b
AD
180332002-04-07 Akim Demaille <akim@epita.fr>
18034
18035 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
18036 nritems.
18037 Adjust dependencies.
18038
f3849179
AD
180392002-04-07 Akim Demaille <akim@epita.fr>
18040
18041 * src/reader.c: Normalize increments to prefix form.
18042
bd02036a
AD
180432002-04-07 Akim Demaille <akim@epita.fr>
18044
18045 * src/reader.c, symtab.c: Remove debugging code.
18046
db8837cb
AD
180472002-04-07 Akim Demaille <akim@epita.fr>
18048
18049 Rename all the `bucket's as `symbol_t'.
18050
18051 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
18052 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
18053 * src/symtab.c, src/symtab.h (bucket): Rename as...
18054 (symbol_t): this.
18055 (symbol_list_new, bucket_check_defined, bucket_make_alias)
18056 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
18057 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
18058 (buckets_new, buckets_free, buckets_do): Rename as...
18059 (symbol_list_new, symbol_check_defined, symbol_make_alias)
18060 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
18061 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
18062 (symbols_new, symbols_free, symbols_do): these.
18063
72a23c97
AD
180642002-04-07 Akim Demaille <akim@epita.fr>
18065
18066 Use lib/hash for the symbol table.
18067
18068 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
18069 EOF.
18070 * src/lex.c (lex): Set the `number' member of new terminals.
18071 * src/reader.c (bucket_check_defined, bucket_make_alias)
18072 (bucket_check_alias_consistence, bucket_translation): New.
18073 (reader, grammar_free, readgram, token_translations_init)
18074 (packsymbols): Adjust.
18075 (reader): Number the predefined tokens.
18076 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
18077 for predefined tokens.
18078 * src/symtab.h (bucket): Remove all the hash table related
18079 members.
18080 * src/symtab.c (symtab): Replace by...
18081 (bucket_table): this.
18082 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
18083 (buckets_new, buckets_do): New.
18084
280a38c3
AD
180852002-04-07 Akim Demaille <akim@epita.fr>
18086
18087 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
18088 (start_symbol, max_user_token_number, semantic_parser)
18089 (error_token_number): Initialize.
18090 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
18091 Initialize.
18092 (reader): Don't.
18093 (errtoken, eoftoken, undeftoken, axiom): Extern.
18094
03b31c0c
AD
180952002-04-07 Akim Demaille <akim@epita.fr>
18096
18097 * src/gram.h (rule_s): prec and precsym are now pointers
18098 to the bucket giving the priority/associativity.
18099 Member `associativity' removed: useless.
18100 * src/reduce.c, src/conflicts.c: Adjust.
18101
8b3df748
AD
181022002-04-07 Akim Demaille <akim@epita.fr>
18103
18104 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
18105 Properly escape the symbols' TAG when outputting them.
18106
e601aa1d
AD
181072002-04-07 Akim Demaille <akim@epita.fr>
18108
18109 * src/lalr.h (LA): Is a bitsetv, not bitset*.
18110
b0299a2e
AD
181112002-04-07 Akim Demaille <akim@epita.fr>
18112
18113 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
18114 (LArule): this, which is an array to rule_t*.
18115 * src/print.c, src/conflicts.c: Adjust.
18116
d7e1f00c
AD
181172002-04-07 Akim Demaille <akim@epita.fr>
18118
18119 * src/gram.h (rule_t): Rename `number' as `user_number'.
18120 `number' is a new member.
18121 Adjust dependencies.
18122 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
18123
cc9305dd
AD
181242002-04-07 Akim Demaille <akim@epita.fr>
18125
18126 As a result of the previous patch, it is no longer needed
18127 to reorder ritem itself.
18128
18129 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
18130
b0940840
AD
181312002-04-07 Akim Demaille <akim@epita.fr>
18132
18133 Be sure never to walk through RITEMS, but use only data related to
18134 the rules themselves. RITEMS should be banished.
18135
18136 * src/output.c (output_token_translations): Rename as...
18137 (prepare_tokens): this.
18138 In addition to `translate', prepare the muscles `tname' and
18139 `toknum', which were handled by...
18140 (output_rule_data): this.
18141 Remove, and move the remainder of its outputs into...
18142 (prepare_rules): this new routines, which also merges content from
18143 (output_gram): this.
18144 (prepare_rules): Be sure never to walk through RITEMS.
18145 (output_stos): Rename as...
18146 (prepare_stos): this.
18147 (output): Always invoke prepare_states, after all, just don't use it
18148 in the output if you don't need it.
18149
643a5994
AD
181502002-04-07 Akim Demaille <akim@epita.fr>
18151
18152 * src/LR0.c (new_state): Display `nstates' as the name of the
18153 newly created state.
18154 Adjust to initialize first_state and last_state if needed.
18155 Be sure to distinguish the initial from the final state.
18156 (new_states): Create the itemset of the initial state, and use
18157 new_state.
18158 * src/closure.c (closure): Now that the initial state has its
18159 items properly set, there is no need for a special case when
18160 creating `ruleset'.
18161
18162 As a result, now the rule 0, reducing to $axiom, is visible in the
18163 outputs. Adjust the test suite.
18164
18165 * tests/conflicts.at (Solved SR Conflicts)
18166 (Unresolved SR Conflicts): Adjust.
18167 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
18168 * tests/conflicts.at (S/R in initial): New.
18169
b4c4ccc2
AD
181702002-04-07 Akim Demaille <akim@epita.fr>
18171
18172 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
18173 the RHS of the rules.
18174 * src/output.c (output_gram): Likewise.
18175
bba97eb2
AD
181762002-04-07 Akim Demaille <akim@epita.fr>
18177
18178 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
18179 bucket.
18180 Adjust all dependencies.
18181 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
18182 `number' of the buckets too.
18183 * src/gram.h: Include `symtab.h'.
18184 (associativity): Move to...
18185 * src/symtab.h: here.
18186 No longer include `gram.h'.
18187
c3b407f4
AD
181882002-04-07 Akim Demaille <akim@epita.fr>
18189
18190 * src/gram.h, src/gram.c (rules_rhs_length): New.
18191 (ritem_longest_rhs): Use it.
18192 * src/gram.h (rule_t): `number' is a new member.
18193 * src/reader.c (packgram): Set it.
18194 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
18195 the end of `rules', and count them out of `nrules'.
18196 (reduce_output, dump_grammar): Adjust.
18197 * src/print.c (print_grammar): It is no longer needed to check for
18198 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
18199 * tests/reduce.at (Reduced Automaton): New test.
18200
11652ab3
AD
182012002-04-07 Akim Demaille <akim@epita.fr>
18202
18203 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
18204 lacking `+ 1' to nrules, Bison reported as useless a token if it
18205 was used solely to set the precedence of the last rule...
18206
26b23c1a
AD
182072002-04-07 Akim Demaille <akim@epita.fr>
18208
18209 * data/bison.c++, data/bison.simple: Don't output the current file
18210 name in #line, to avoid useless diffs between two identical
18211 outputs under different names.
18212
18bcecb0
AD
182132002-04-07 Akim Demaille <akim@epita.fr>
18214
18215 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
18216 Normalize loops to using `< nrules + 1', not `<= nrules'.
18217
fa770c86
AD
182182002-04-07 Akim Demaille <akim@epita.fr>
18219
18220 * TODO: Update.
18221
d9b739c3
AD
182222002-04-07 Akim Demaille <akim@epita.fr>
18223
18224 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
18225 bucket.value as bucket.number.
18226
99013900
AD
182272002-04-07 Akim Demaille <akim@epita.fr>
18228
18229 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
18230 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
18231 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
18232 RHS, instead of being an index in RITEMS.
18233
e966383b
PE
182342002-04-04 Paul Eggert <eggert@twinsun.com>
18235
18236 * doc/bison.texinfo: Update copyright date.
18237 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
18238 (Symbols): Warn about running Bison in one character set,
18239 but compiling and/or running in an incompatible one.
18240 Warn about character code 256, too.
18241
182422002-04-03 Paul Eggert <eggert@twinsun.com>
18243
18244 * src/bison.data (YYSTACK_ALLOC): Depend on whether
18245 YYERROR_VERBOSE is nonzero, not whether it is defined.
18246
18247 Merge changes from bison-1_29-branch.
c307773e 18248
8d6c48b9
PE
182492002-03-20 Paul Eggert <eggert@twinsun.com>
18250
18251 Merge fixes from Debian bison_1.34-1.diff.
18252
18253 * configure.in (AC_PREREQ): 2.53.
18254
e53c6322
AD
182552002-03-20 Akim Demaille <akim@epita.fr>
18256
18257 * src/conflicts.c (log_resolution): Argument `resolution' is const.
18258
9ffbeca7
PE
182592002-03-19 Paul Eggert <eggert@twinsun.com>
18260
21db0b2a
PE
18261 * src/bison.simple (YYCOPY): New macro.
18262 (YYSTACK_RELOCATE): Use it.
18263 Remove Type arg; no longer needed. All callers changed.
18264 (yymemcpy): Remove; no longer needed.
18265
9ffbeca7
PE
18266 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
18267 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
18268
642cb8f8
AD
182692002-03-19 Akim Demaille <akim@epita.fr>
18270
18271 Test and fix the #line outputs.
18272
18273 * tests/atlocal.at (GCC): New.
18274 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 18275 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
18276 (Action synch line, Epilogue synch line): New tests.
18277 * src/reader.c (parse_union_decl): Define the muscle stype_line.
18278 * data/bison.simple, data/bison.c++: Use it.
18279
3c31a486
AD
182802002-03-19 Akim Demaille <akim@epita.fr>
18281
18282 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
18283 (Solved SR Conflicts, %expect not enough, %expect right)
18284 (%expect too much): Move to...
18285 * tests/conflicts.at: this new file.
18286
0d8bed56
AD
182872002-03-19 Akim Demaille <akim@epita.fr>
18288
18289 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
18290 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
18291 that we can move to enums for instance.
18292 * src/output.c (token_definitions_output): Output a list of
18293 `token-name, token-number' instead of the #define.
18294 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
18295
9208d17f
AD
182962002-03-14 Akim Demaille <akim@epita.fr>
18297
18298 Use Gettext 0.11.1.
18299
af27eacb
RA
183002002-03-09 Robert Anisko <robert@lrde.epita.fr>
18301
18302 * data/bison.c++: Make the user able to add members to the generated
18303 parser by subclassing.
18304
9101a310
RA
183052002-03-05 Robert Anisko <robert@lrde.epita.fr>
18306
18307 * src/reader.c (read_additionnal_code): `c' should be an integer, not
18308 a character.
18309 Reported by Nicolas Tisserand and Nicolas Burrus.
18310
fff9bf0b
RA
183112002-03-04 Robert Anisko <robert@lrde.epita.fr>
18312
18313 * src/reader.c: Warn about lacking semi-colons, do not complain.
18314
64dba31e
RA
183152002-03-04 Robert Anisko <robert@lrde.epita.fr>
18316
18317 * data/bison.c++: Remove a debug line.
18318
374f5a14
RA
183192002-03-04 Robert Anisko <robert@lrde.epita.fr>
18320
18321 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
18322 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
18323 provide a default implementation.
18324
bfcf1f3a
AD
183252002-03-04 Akim Demaille <akim@epita.fr>
18326
18327 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
18328 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
18329 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
18330 * tests/semantic.at (Parsing Guards): Similarly.
18331 * src/reader.at (readgram): Complain if the last rule is not ended
18332 with a semi-colon.
18333
65ccf9fc
AD
183342002-03-04 Akim Demaille <akim@epita.fr>
18335
18336 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
18337 * src/closure.c: here.
18338 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
18339 RTC.
18340 * src/warshall.h, src/warshall.c: Remove.
18341 * tests/sets.at (Broken Closure): Adjust.
18342
d0039cbc
AD
183432002-03-04 Akim Demaille <akim@epita.fr>
18344
18345 * src/output.c (output_skeleton): tempdir is const.
18346 bytes_read is unused.
18347
345cea78
AD
183482002-03-04 Akim Demaille <akim@epita.fr>
18349
18350 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
18351 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
18352 Update.
18353 From Michael Hayes.
18354
564801f7
AD
183552002-03-04 Akim Demaille <akim@epita.fr>
18356
18357 * src/closure.c (closure): `r' is unused.
18358
e5352bc7
AD
183592002-03-04 Akim Demaille <akim@epita.fr>
18360
18361 * tests/sets.at (Broken Closure): Add the ending `;'.
18362 * src/reader.at (readgram): Complain if a rule is not ended with a
18363 semi-colon.
18364
914feea9
AD
183652002-03-04 Akim Demaille <akim@epita.fr>
18366
18367 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
18368 (count_sr_conflicts): Use bitset_count.
18369 * src/reduce.c (inaccessable_symbols): Ditto.
18370 (bits_size): Remove.
18371 * src/warshall.h, src/warshall.c: Convert to bitsetv.
18372
f0250de6
AD
183732002-03-04 Akim Demaille <akim@epita.fr>
18374
18375 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
18376 * src/reduce.c: Remove the `bitset_zero's following the
18377 `bitset_create's, as now it is performed by the latter.
18378
ef017502
AD
183792002-03-04 Akim Demaille <akim@epita.fr>
18380
18381 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
18382 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
18383 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
18384 latest sources from Michael.
18385
76514394
AD
183862002-03-04 Akim Demaille <akim@epita.fr>
18387
18388 * src/output.c (output): Don't free the grammar.
18389 * src/reader.c (grammar_free): New.
18390 * src/main.c (main): Call it and don't free symtab here.
18391
55024580
AD
183922002-03-04 Akim Demaille <akim@epita.fr>
18393
18394 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
18395 before returning.
18396 Reported by Benoit Perrot.
18397
f9abaa2c
AD
183982002-03-04 Akim Demaille <akim@epita.fr>
18399
18400 Use bitset operations when possible, not loops over bits.
18401
18402 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
18403 bitset_or.
18404 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
18405 * src/reduce.c (useless_nonterminals): Formatting changes.
18406 * src/warshall.c (TC): Use bitset_or.
18407
0e721e75
AD
184082002-03-04 Akim Demaille <akim@epita.fr>
18409
18410 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
18411 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
18412 Ditto.
18413
0fb1ffb1
AD
184142002-03-04 Akim Demaille <akim@epita.fr>
18415
18416 * src/lalr.c (F): Now a bitset*.
18417 Adjust all dependencies.
18418
b86796bf
AD
184192002-03-04 Akim Demaille <akim@epita.fr>
18420
18421 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
18422 Adjust all dependencies.
18423
602bbf31
AD
184242002-03-04 Akim Demaille <akim@epita.fr>
18425
18426 * src/L0.c, src/LR0.h (nstates): Be size_t.
18427 Adjust comparisons (signed vs unsigned).
18428 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
18429 bitset*.
18430 Adjust all dependencies.
18431
d8a0245c
AD
184322002-03-04 Akim Demaille <akim@epita.fr>
18433
18434 * src/closure.c (firsts): Now, also a bitset.
18435 Adjust all dependencies.
18436 (varsetsize): Remove, now unused.
18437 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
18438
34ba9743
AD
184392002-03-04 Akim Demaille <akim@epita.fr>
18440
18441 * src/print.c: Convert to use bitset.h, not hand coded iterations
18442 over ints.
18443
ed86e78c
AD
184442002-03-04 Akim Demaille <akim@epita.fr>
18445
18446 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
18447
dfdb1797
AD
184482002-03-04 Akim Demaille <akim@epita.fr>
18449
18450 * src/closure.c (ruleset): Be a bitset.
18451 (rulesetsize): Remove.
18452
7086e707
AD
184532002-03-04 Akim Demaille <akim@epita.fr>
18454
18455 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
18456 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
18457 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
18458 * src/closure.c (fderives): Be an array of bitsets.
18459
98254360
RA
184602002-02-28 Robert Anisko <robert@lrde.epita.fr>
18461
18462 * data/bison.c++: Merge the two generated headers. Insert a copyright
18463 notice in each output file.
18464
a75c057f
AD
184652002-02-28 Akim Demaille <akim@epita.fr>
18466
18467 * data/bison.c++: Copy the prologue of bison.simple to fetch
18468 useful M4 definitions, such as b4_header_guard.
18469
06b00abc
AD
184702002-02-25 Akim Demaille <akim@epita.fr>
18471
18472 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
18473 translator friendly scheme for the bgr
18474 copyright notice.
06b00abc 18475
70e7d534
AD
184762002-02-25 Akim Demaille <akim@epita.fr>
18477
18478 * src/output.c (header_output): Remove, now handled completely via
18479 M4.
18480
abe017f6
AD
184812002-02-25 Akim Demaille <akim@epita.fr>
18482
18483 * m4/m4.m4: New, from CVS Autoconf.
18484 * configure.in: Invoke it.
18485 * src/output.c (output_skeleton): Use its result instead of the
18486 hard coded name.
18487
381fb12e
AD
184882002-02-25 Akim Demaille <akim@epita.fr>
18489
18490 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
18491 Fileutils 4.1.5.
18492 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
18493 * src/output.c (output_skeleton): Use mkstemp to create a real
18494 temporary file.
18495 Move the filling of `skeleton' and its muscle to...
18496 (prepare): here.
18497 (output): Move the definition of the prologue muscle to...
18498 (prepare): here.
18499 * src/system.h (DEFAULT_TMPDIR): New.
18500
6f38107f
PE
185012002-02-14 Paul Eggert <eggert@twinsun.com>
18502
18503 Remove the support for C++ namespace cleanliness; it was
18504 causing more problems than it was curing, since it didn't work
18505 properly on some nonstandard C++ compilers. This can wait
18506 for a proper C++ parser.
18507
18508 * NEWS: Document this.
18509 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
18510 of C++, as it's treated like C now.
18511 * src/bison.simple (YYSTD): Remove.
18512 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
18513 Treat C++ just like Standard C instead of trying to support
18514 namespace cleanliness.
18515
80cce3da
AD
185162002-02-14 Akim Demaille <akim@epita.fr>
18517
18518 * tests/regression.at (else): Adjust to Andreas' change.
18519
842e8679
AD
185202002-02-14 Akim Demaille <akim@epita.fr>
18521
18522 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
18523
4bda3f10
AD
185242002-02-13 Andreas Schwab <schwab@suse.de>
18525
18526 * src/output.c (output_rule_data): Don't output NULL, it might
18527 not be defined yet.
18528
4162fa07 185292002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 18530
4162fa07
RA
18531 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
18532 (Copyright notice): Update.
b418ecd8 18533
bd16a5dc
AD
185342002-02-11 Akim Demaille <akim@epita.fr>
18535
18536 * tests/regression.at (%nonassoc and eof): Don't include
18537 nonportable headers.
18538
8d69a1a3
RA
185392002-02-08 Robert Anisko <robert@lrde.epita.fr>
18540
18541 * data/bison.c++: Correct error recovery. Make the user able to
18542 initialize the starting location.
18543
9b2d0677
AD
185442002-02-07 Akim Demaille <akim@epita.fr>
18545
18546 * tests/input.at: New.
18547
69e2658b
RA
185482002-02-07 Robert Anisko <robert@lrde.epita.fr>
18549
18550 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 18551 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
18552 directives around tables only needed for debugging.
18553
4aacc3a7
RA
185542002-02-07 Robert Anisko <robert@lrde.epita.fr>
18555
18556 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
18557 C++ parsers.
18558 (yy::b4_name::parse): Use print_.
18559
762a801e
RA
185602002-02-07 Robert Anisko <robert@lrde.epita.fr>
18561
18562 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
18563
4bb2bc3f
RA
185642002-02-07 Robert Anisko <robert@lrde.epita.fr>
18565
18566 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
18567 C++ parsers.
18568 (yy::b4_name::parse): Build verbose error messages, and use error_.
18569
6b45a3ca
RA
185702002-02-06 Robert Anisko <robert@lrde.epita.fr>
18571
18572 * data/bison.c++: Fix m4 quoting in comments.
18573
50997c6e
RA
185742002-02-06 Robert Anisko <robert@lrde.epita.fr>
18575
18576 * data/bison.c++: Adjust the parser code. Fix some muscles that were
18577 not expanded by m4.
18578
3f3eed27
AD
185792002-02-05 Akim Demaille <akim@epita.fr>
18580
18581 * data/bison.c++: Adjust to the M4 back end.
18582 More is certainly needed.
18583
be2a1a68
AD
185842002-02-05 Akim Demaille <akim@epita.fr>
18585
18586 Give a try to M4 as a back end.
18587
18588 * lib/readpipe.c: New, from wdiff.
18589 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
18590 BISON_HAIRY.
18591 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
18592 specific values. Now it is m4 that performs the lookup.
18593 * src/parse-skel.y: Remove.
18594 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
18595 * src/output.c (actions_output, guards_output)
18596 (token_definitions_output): No longer keeps track of the output
18597 line number, hence remove the second argument.
18598 (guards_output): Check against the guard member of a rule, not the
18599 action member.
18600 Adjust callers.
18601 (output_skeleton): Don't look for the skeleton location, let m4 do
18602 that.
18603 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
18604 file will be used.
18605 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
18606 (prepare): Given that for the time being changesyntax is not
18607 usable in M4, rename the muscles using `-' to `_'.
18608 Define `defines_flag', `output_parser_name' and `output_header_name'.
18609 * src/output.h (actions_output, guards_output)
18610 (token_definitions_output): Adjust prototypes.
18611 * src/scan-skel.l: Instead of scanning the skeletons, it now
18612 processes the output of m4: `__oline__' and `#output'.
18613 * data/bison.simple: Adjust to be used by M4(sugar).
18614 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
18615 to date.
18616 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
18617 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
18618 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
18619 shamelessly stolen from CVS Autoconf.
18620
beda758b
AD
186212002-02-05 Akim Demaille <akim@epita.fr>
18622
18623 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
18624 * configure.in: Check for the declarations of free and malloc.
18625 * src/muscle_tab.c: Adjust.
18626
5ece6d43
AD
186272002-02-05 Akim Demaille <akim@epita.fr>
18628
18629 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
18630 which have no values.
18631
5bb18f9a
AD
186322002-02-05 Akim Demaille <akim@epita.fr>
18633
18634 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
18635 * data/: here.
18636
894dd62e
PE
186372002-01-29 Paul Eggert <eggert@twinsun.com>
18638
18639 * src/bison.simple (YYSIZE_T): Do not define merely because
18640 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
18641 On some platforms, <alloca.h> does not declare YYSTD (size_t).
18642
82841af7
AD
186432002-01-27 Akim Demaille <akim@epita.fr>
18644
18645 Fix `%nonassoc and eof'.
18646
18647 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
18648 which were not properly copied! Replace
18649 memcpy (res->errs, src->errs, src->nerrs);
18650 with
18651 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
18652 !!!
18653 * tests/regression.at (%nonassoc and eof): Adjust to newest
18654 Autotest: `.' is not in the PATH.
18655
318b76e9
AD
186562002-01-27 Akim Demaille <akim@epita.fr>
18657
18658 * tests/sets.at (AT_EXTRACT_SETS): New.
18659 (Nullable): Use it.
18660 (Firsts): New.
18661
30d2f3d5
AD
186622002-01-26 Akim Demaille <akim@epita.fr>
18663
18664 * tests/actions.at, tests/calc.at, tests/headers.at,
18665 * tests/torture.at: Adjust to the newest Autotest which no longer
18666 forces `.' in the PATH.
18667
30f8c395
AD
186682002-01-25 Akim Demaille <akim@epita.fr>
18669
18670 * tests/regression.at (%nonassoc and eof): New.
18671 Suggested by Robert Anisko.
18672
29ae55f1
AD
186732002-01-24 Akim Demaille <akim@epita.fr>
18674
18675 Bison dumps core when trying to complain about broken input files.
18676 Reported by Cris van Pelt.
18677
18678 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
18679 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
18680 into...
18681 (Invalid inputs): Strengthen: exercise parse_percent_token.
18682
2b548aa6
RA
186832002-01-24 Robert Anisko <robert.anisko@epita.fr>
18684
18685 * src/Makefile.am: Add bison.c++.
18686 * src/bison.c++: New skeleton.
18687
bb0146c2
AD
186882002-01-21 Paolo Bonzini <bonzini@gnu.org>
18689
18690 * po/it.po: New.
18691
bec30531
AD
186922002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
18693
18694 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
18695
fc6edc45
MA
186962002-01-20 Marc Autret <marc@gnu.org>
18697
18698 * src/files.c (compute_output_file_names): Fix
18699
5e5d5415
MA
187002002-01-20 Marc Autret <marc@gnu.org>
18701
18702 * tests/output.at: New test.
18703 * src/files.c (compute_base_names): Don't map extensions when
18704 the YACC flag is set, use defaults.
18705 Reported by Evgeny Stambulchik.
18706
44ea3fbd
MA
187072002-01-20 Marc Autret <marc@gnu.org>
18708
ba0fe3c7
PE
18709 * src/system.h: Need to define __attribute__ away for non-GCC
18710 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
18711 Suggested by Albert Chin-A-Young.
18712
338963d1
TVH
187132002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
18714
18715 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
18716 canonical definition.
18717 * src/system.h: Use the canonical definition for PARAMS (avoids
18718 a conflict with the macro from lib/hash.h).
18719
c57b2479
AD
187202002-01-11 Akim Demaille <akim@epita.fr>
18721
18722 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 18723 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 18724
b85810ae
AD
187252002-01-09 Akim Demaille <akim@epita.fr>
18726
18727 * src/files.c, src/files.h (output_infix): New.
18728 (tab_extension): Remove.
18729 (compute_base_names): Compute the former, drop the latter.
18730 * src/output.c (prepare): Insert the muscles `output-infix', and
18731 `output-suffix'.
18732 * src/parse-skel.y (string, string.1): New.
18733 (section.header): Use it.
18734 (section.yacc): Remove.
18735 (prefix): Remove too.
18736 * src/scan-skel.l: Adjust.
18737 * src/bison.simple, src/bison.hairy: Adjust.
18738
cae60122
AD
187392002-01-09 Akim Demaille <akim@epita.fr>
18740
18741 * configure.in (WERROR_CFLAGS): Compute it.
18742 * src/Makefile.am (CFLAGS): Pass it.
18743 * tests/atlocal.in (CFLAGS): Idem.
18744 * src/files.c: Fix a few warnings.
18745 (get_extension_index): Remove, unused.
18746
ae404801
AD
187472002-01-08 Akim Demaille <akim@epita.fr>
18748
18749 * src/getargs.c (AS_FILE_NAME): New.
18750 (getargs): Use it to convert DOSish file names.
18751 * src/files.c (base_name): Rename as full_base_name to avoid
18752 clashes with `base_name ()'.
18753 (filename_split): New.
18754 (compute_base_names): N-th rewrite, using filename_split.
18755
22312b71
AD
187562002-01-08 Akim Demaille <akim@epita.fr>
18757
18758 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
18759 New, stolen from the Fileutils 4.1.
18760 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
18761 * configure.in: Check for the presence of memrchr, and of its
18762 prototype.
18763
a67cef01
TVH
187642002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
18765
18766 * lib/hash.h (__P): Added definition for this macro.
18767 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
18768 BUILT_SOURCES, to ensure they are generated first.
18769 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
18770 %error-verbose to allow bootstrapping with bison 1.30x.
18771
2b25d624
AD
187722002-01-06 Akim Demaille <akim@epita.fr>
18773
18774 * src/reader.c (parse_braces): Don't fetch the next char, the
18775 convention is to fetch on entry.
18776 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
18777 'switch' without a following semicolon.
18778 * tests/regression.at (braces parsing): New.
18779
3460813b
AD
187802002-01-06 Akim Demaille <akim@epita.fr>
18781
18782 Bison is dead wrong in its RR conflict reports.
18783
18784 * tests/torture.at (GNU Cim Grammar): New.
18785 * src/conflicts.c (count_rr_conflicts): Fix.
18786
73784c64
AD
187872002-01-06 Akim Demaille <akim@epita.fr>
18788
18789 Creating package.m4 from configure.ac causes too many problems.
18790
18791 * tests/Makefile.am (package.m4): Create it by hand,
18792 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
18793
25d81090
AD
187942002-01-06 Akim Demaille <akim@epita.fr>
18795
18796 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
18797 skeleton.h.
18798
a9b8959e
PE
187992002-01-04 Paul Eggert <eggert@twinsun.com>
18800
18801 * doc/bison.texinfo (Debugging):
18802 Remove YYSTDERR; it's no longer defined or used.
18803 Also, s/cstdio.h/cstdio/.
18804
25d81090
AD
188052002-01-03 Akim Demaille <akim@epita.fr>
18806
18807 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
18808
1109455c
AD
188092002-01-03 Akim Demaille <akim@epita.fr>
18810
18811 * src/parse-skel.y (process_skeleton): Don't bind the parser's
18812 tracing code to --trace, wait for a better --trace option, with
18813 args.
18814
7ea5e977
AD
188152002-01-03 Akim Demaille <akim@epita.fr>
18816
18817 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
18818 The ISO C++ standard is extremely clear about it: stderr is
18819 considered a macro, not a regular symbol (see table 94 `Header
18820 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
18821 Therefore std:: does not apply to it. It still does with fprintf.
18822 Also, s/cstdio.h/cstdio/.
18823
fab5b110
AD
188242002-01-03 Akim Demaille <akim@epita.fr>
18825
18826 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
18827 for non system headers.
18828
aed7fd9b
AD
188292002-01-02 Akim Demaille <akim@epita.fr>
18830
18831 Equip the skeleton chain with location tracking, runtime trace,
18832 pure parser and scanner.
18833
18834 * src/parse-skel.y: Request a pure parser, locations, and prefix
18835 renaming.
18836 (%union): Having several members with the same type does not help
18837 type mismatches, simplify.
18838 (YYPRINT, yyprint): New.
18839 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
18840 (skel_error): this.
18841 Handle locations.
18842 * src/scan-skel.l: Adjust to these changes.
18843 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
18844 (LOCATION_PRINT, skel_control_t): New.
18845
24fad99e
AD
188462001-12-30 Akim Demaille <akim@epita.fr>
18847
18848 * src/parse-skel.y: Get rid of the shift/reduce conflict:
18849 replace `gb' with BLANKS.
18850 * src/scan-skel.l: Adjust.
18851
a4b36db4
AD
188522001-12-30 Akim Demaille <akim@epita.fr>
18853
18854 * src/system.h: We don't need nor want bcopy.
18855 Throw away MS-DOS crap: we don't need getpid.
18856 * configure.in: We don't need strndup. It was even causing
18857 problems: because Flex includes the headers *before* us,
18858 _GNU_SOURCE is not defined by config.h, and therefore strndup was
18859 not visible.
18860 * lib/xstrndup.c: New.
18861 * src/scan-skel.l: Use it.
18862 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
18863 * src/parse-skel.y: Use %directives instead of #defines.
18864
1239777d
AD
188652001-12-30 Akim Demaille <akim@epita.fr>
18866
18867 * src/skeleton.h: New.
18868 * src/output.c (output_parser, output_master_parser): Remove, dead
18869 code.
18870 * src/output.h (get_lines_number, actions_output, guards_output)
18871 (token_definitions_output): Prototype them.
18872 * src/parse-skel.y: Add the license notice.
18873 Include output.h and skeleton.h.
18874 (process_skeleton): Returns void, and takes a single parameter.
18875 * src/scan-skel.l: Add the license notice.
18876 Include skeleton.h.
18877 Don't use %option yylineno: it seems that then Flex imagines
18878 REJECT has been used, and therefore it won't reallocate its
18879 buffers (which makes no other sense to me than a bug). It results
18880 in warnings for `unused: yy_flex_realloc'.
18881
9b3add5b
RA
188822001-12-30 Robert Anisko <robert.anisko@epita.fr>
18883
18884 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
18885 (MUSCLE_INSERT_PREFIX): ...to there.
18886 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
18887 (MUSCLE_INSERT_PREFIX): Move from here...
18888
18889 * src/bison.hairy: Add a section directive. Put braces around muscle
18890 names. This parser skeleton is still broken, but Bison should not
18891 choke on a bad muscle 'syntax'.
18892 * src/bison.simple: Add a section directive. Put braces around muscle
18893 names.
18894
18895 * src/files.h (strsuffix, stringappend): Add declarations.
18896 (tab_extension): Add declaration.
18897 (short_base_name): Add declaration.
18898
18899 * src/files.c (strsuffix, stringappend): No longer static. These
18900 functions are used in the skeleton parser.
18901 (tab_extension): New.
18902 (compute_base_names): Use the computations done in this function
fab5b110 18903 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
18904 names.
18905 (short_base_name): No longer static.
18906
18907 * src/output.c (output_skeleton): New.
18908 (output): Disable call to output_master_parser, and give a try to
18909 a new skeleton handling system.
18910 (guards_output, actions_output): No longer static.
18911 (token_definitions_output, get_lines_number): No longer static.
18912
18913 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
18914
fab5b110 18915 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
18916 parse-skel.y.
18917
18918 * src/parse-skel.y: New file.
18919 * src/scan-skel.l: New file.
18920
b5b61c61
AD
189212001-12-29 Akim Demaille <akim@epita.fr>
18922
18923 %name-prefix is broken.
18924
18925 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
18926 Adjust all dependencies.
18927 * tests/headers.at (export YYLTYPE): Strengthen this test: use
18928 %name-prefix.
18929
18930 Renaming yylval but not yylloc is not consistent. Now we do.
18931
18932 * src/bison.simple: Prefix yylloc if used.
18933 * doc/bison.texinfo (Decl Summary): Document that.
18934
8c9a50be
AD
189352001-12-29 Akim Demaille <akim@epita.fr>
18936
18937 * doc/bison.texinfo: Promote `%long-directive' over
18938 `%long_directive'.
18939 Remove all references to fixed-output-files, yacc is enough.
18940
d99361e6
AD
189412001-12-29 Akim Demaille <akim@epita.fr>
18942
18943 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
18944 user prologue. These are defaults.
18945 * tests/actions.at (Mid-rule actions): Make sure the user can
18946 define YYDEBUG and YYERROR_VERBOSE.
18947
b9cecb91
AD
189482001-12-29 Akim Demaille <akim@epita.fr>
18949
18950 * src/output.c (header_output): Don't forget to export YYLTYPE and
18951 yylloc.
18952 * tests/headers.at (export YYLTYPE): New, make sure it does.
18953 * tests/regression.at (%union and --defines, Invalid CPP headers):
18954 Move to...
18955 * tests/headers.at: here.
18956
aea13e97
AD
189572001-12-29 Akim Demaille <akim@epita.fr>
18958
18959 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
18960
931394cb
AD
189612001-12-29 Akim Demaille <akim@epita.fr>
18962
18963 * tests/actions.at (Mid-rule actions): Output on a single line
18964 instead of several.
18965
704a47c4
AD
189662001-12-29 Akim Demaille <akim@epita.fr>
18967
18968 * doc/bison.texinfo: Formatting changes.
18969
091e20bb
AD
189702001-12-29 Akim Demaille <akim@epita.fr>
18971
18972 Don't store the token defs in a muscle, just be ready to output it
18973 on command. Now possible via `symbols'. Fixes a memory leak.
18974
18975 * src/output.c (token_definitions_output): New.
18976 (output_parser, header_output): Use it.
18977 * src/reader.c (symbols_save): Remove.
18978
cce71710
AD
189792001-12-29 Akim Demaille <akim@epita.fr>
18980
18981 * src/bison.simple: Do not provide a default for YYSTYPE and
18982 YYLTYPE before the user's prologue. Otherwise it's hardly... a
18983 default.
18984
82c035a8
AD
189852001-12-29 Akim Demaille <akim@epita.fr>
18986
18987 Mid-rule actions are simply... ignored!
18988
18989 * src/reader.c (readgram): Be sure to attach mid-rule actions to
18990 the empty-rule associated to the dummy symbol, not to the host
18991 rule.
18992 * tests/actions.at (Mid-rule actions): New.
18993
8419d367
AD
189942001-12-29 Akim Demaille <akim@epita.fr>
18995
18996 Memory leak.
18997
18998 * src/reader.c (reader): Free grammar.
18999
375d5806
AD
190002001-12-29 Akim Demaille <akim@epita.fr>
19001
19002 Memory leak.
19003
19004 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
19005 since it allocates it for each state, although only one is needed.
19006 (allocate_storage): Do it here.
19007
f51cb8ff
AD
190082001-12-29 Akim Demaille <akim@epita.fr>
19009
19010 * src/options.h, src/options.c (create_long_option_table): Rename
19011 as...
19012 (long_option_table_new): this, with a clearer prototype.
19013 (percent_table): Remove, unused,
19014 * src/getargs.c (getargs): Adjust.
19015
29e88316
AD
190162001-12-29 Akim Demaille <akim@epita.fr>
19017
19018 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
19019 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
19020 as states.
19021
b9f71f19
AD
190222001-12-29 Akim Demaille <akim@epita.fr>
19023
19024 * src/lalr.c (build_relations): Rename `states' as `states1'.
19025 Sorry, I don't understand exactly what it is, no better name...
19026
1a2b5d37
AD
190272001-12-29 Akim Demaille <akim@epita.fr>
19028
19029 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
19030 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
19031 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
19032 as rules.
19033
1cca533e
AD
190342001-12-29 Akim Demaille <akim@epita.fr>
19035
19036 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
19037 ago.
19038
c03ae966
AD
190392001-12-29 Akim Demaille <akim@epita.fr>
19040
19041 * src/reader.c, src/reader.h (user_toknums): Remove.
19042 Adjust all users to use symbols[i]->user_token_number.
19043
5a670b1e
AD
190442001-12-29 Akim Demaille <akim@epita.fr>
19045
19046 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
19047 Adjust all users to use symbols[i]->prec or ->assoc.
19048
ad949da9
AD
190492001-12-29 Akim Demaille <akim@epita.fr>
19050
19051 * src/reader.c, src/reader.h (tags): Remove.
19052 Adjust all users to use symbols[i]->tag.
19053
0e78e603
AD
190542001-12-29 Akim Demaille <akim@epita.fr>
19055
19056 * src/gram.h, src/gram.c (symbols): New, similar to state_table
19057 and rule_table.
19058 * src/reader.c (packsymbols): Fill this table.
19059 Drop sprec.
19060 * src/conflicts.c (resolve_sr_conflict): Adjust.
19061 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
19062 single table.
19063 Use symbols[i]->tag instead of tags[i].
19064
213e640e
AD
190652001-12-29 Akim Demaille <akim@epita.fr>
19066
19067 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
19068 In addition, put a comment in there, to replace...
19069 * tests/regression.at (%union and C comments): Remove.
19070
e7b8bef1
AD
190712001-12-29 Akim Demaille <akim@epita.fr>
19072
19073 * tests/regression.at (Web2c Actions): Blindly move the actual
19074 output as expected output. The contents *seem* right to me, but I
19075 can't pretend reading perfectly parser tables... Nonetheless, all
19076 the other tests pass correctly, the table look OK, even though the
19077 presence of `$axiom' is to be noted: AFAICS it is useless (but
19078 harmless).
19079
b68e7744
AD
190802001-12-29 Akim Demaille <akim@epita.fr>
19081
19082 * src/reader.c (readgram): Don't add the rule 0 if there were no
19083 rules read. In other words, add it _after_ having performed
19084 grammar sanity checks.
19085 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
19086
78d5bae9
AD
190872001-12-29 Akim Demaille <akim@epita.fr>
19088
19089 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
19090 visible, and some states have now a different number.
19091
ff442794
AD
190922001-12-29 Akim Demaille <akim@epita.fr>
19093
19094 * src/reader.c (readgram): Bind the initial rule's lineno to that
19095 of the first rule.
19096 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
19097 (Solved SR Conflicts): Adjust rule 0's line number.
19098
610ab194
AD
190992001-12-29 Akim Demaille <akim@epita.fr>
19100
19101 Fix the `GAWK Grammar' failure.
19102
19103 * src/LR0.c (final_state): Initialize to -1 so that we do compute
19104 the reductions of the first state which was mistakenly confused
19105 with the final state because precisely final_state was initialized
19106 to 0.
19107 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
19108 now noticed by Bison.
19109 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
19110 have a reduction on $default.
19111
29d29c8f
AD
191122001-12-29 Akim Demaille <akim@epita.fr>
19113
19114 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
19115 rule line numbers.
19116 * src/closure.c (print_closure): Likewise.
19117 * src/derives.c (print_derives): Likewise.
19118 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
19119 now.
19120
7c6b64d0
AD
191212001-12-29 Akim Demaille <akim@epita.fr>
19122
19123 * src/lalr.c (lookaheads_print): New.
19124 (lalr): Call it when --trace-flag.
19125 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
19126 are dumped.
19127
3d4daee3
AD
191282001-12-29 Akim Demaille <akim@epita.fr>
19129
19130 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
19131 when walking through ritem, even via rule->rhs.
19132 * src/reduce.c (dump_grammar, useful_production, reduce_output)
19133 (useful_production, useless_nonterminals): Likewise.
19134 (reduce_grammar_tables): Likewise, plus update nritems.
19135 * src/nullable.c (set_nullable): Likewise.
19136 * src/lalr.c (build_relations): Likewise.
19137 * tests/sets.at (Nullable): Adjust.
19138 Fortunately, now, the $axiom is no longer nullable.
19139
9e7f6bbd
AD
191402001-12-29 Akim Demaille <akim@epita.fr>
19141
19142 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
19143 the 0-sentinel.
19144 * src/gram.c (ritem_longest_rhs): Likewise.
19145 * src/reduce.c (nonterminals_reduce): Likewise.
19146 * src/print_graph.c (print_graph): Likewise.
19147 * src/output.c (output_rule_data): Likewise.
19148 * src/nullable.c (set_nullable): Likewise.
19149
255ef638
AD
191502001-12-29 Akim Demaille <akim@epita.fr>
19151
19152 * src/output.c: Comment changes.
19153
0d8a7363
AD
191542001-12-27 Paul Eggert <eggert@twinsun.com>
19155
19156 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
19157 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
19158 Sparc, as they were causing more porting problems than the
19159 (minor) performance improvement was worth.
19160
19161 Also, catch up with 1.31's YYSTD.
19162
3db472b9
AD
191632001-12-27 Akim Demaille <akim@epita.fr>
19164
19165 * src/output.c (output_gram): Rely on nritems, not the
19166 0-sentinel. See below.
19167 Use -1 as separator, not 0.
19168 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
19169 Rely on -1 as separator in yyrhs, instead of 0.
19170 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
19171 twice `Now at end of input', therefore there are two lines less to
19172 expect.
19173
b365aa05
AD
191742001-12-27 Akim Demaille <akim@epita.fr>
19175
19176 * tests/regression.at (Unresolved SR Conflicts):
19177 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
19178 below.
19179
30171f79
AD
191802001-12-27 Akim Demaille <akim@epita.fr>
19181
19182 * src/LR0.c (new_state): Recognize the final state by the fact it
19183 is reached by eoftoken.
19184 (insert_start_shifting_state, insert_eof_shifting_state)
19185 (insert_accepting_state, augment_automaton): Remove, since now
19186 these states are automatically computed from the initial state.
19187 (generate_states): Adjust.
19188 * src/print.c: When reporting a rule number to the user, substract
19189 1, so that the axiom rule is rule 0, and the first user rule is 1.
19190 * src/reduce.c: Likewise.
19191 * src/print_graph.c (print_core): For the time being, just as for
19192 the report, depend upon --trace-flags to dump the full set of
19193 items.
19194 * src/reader.c (readgram): Once the grammar read, insert the rule
19195 0: `$axiom: START-SYMBOL $'.
19196 * tests/set.at: Adjust: rule 0 is now displayed, and since the
19197 number of the states has changed (the final state is no longer
19198 necessarily the last), catch up.
19199
75142d45
AD
192002001-12-27 Akim Demaille <akim@epita.fr>
19201
19202 Try to make the use of the eoftoken valid. Given that its value
19203 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
19204 is used instead of > 0 where appropriate, (ii), depend upon nritems
19205 instead of the 0-sentinel.
19206
19207 * src/gram.h, src/gram.c (nritems): New.
19208 Expected to be duplication of nitems, but for the time being...
19209 * src/reader.c (packgram): Assert nritems and nitems are equal.
19210 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
19211 * src/closure.c (print_closure, print_fderives): Likewise.
19212 * src/gram.c (ritem_print): Likewise.
19213 * src/print.c (print_core, print_grammar): Likewise.
19214 * src/print_graph.c: Likewise.
19215
b7c49edf
AD
192162001-12-27 Akim Demaille <akim@epita.fr>
19217
19218 * src/main.c (main): If there are complains after grammar
19219 reductions, then output the report anyway if requested, then die.
19220 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
19221 * src/reader.c (eoftoken): New.
19222 (parse_token_decl): If the token being defined has value `0', it
19223 is the eoftoken.
19224 (packsymbols): No longer hack `tags' to insert `$' by hand.
19225 Be sure to preserve the value of the eoftoken.
19226 (reader): Make sure eoftoken is defined.
19227 Initialize nsyms to 0: now eoftoken is created just like the others.
19228 * src/print.c (print_grammar): Don't special case the eof token.
19229 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
19230 lie anyway, albeit pleasant.
19231 * tests/calc.at: Exercise error messages with eoftoken.
19232 Change the grammar so that empty input is invalid.
19233 Adjust expectations.
19234 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
19235
ec2da99f
AD
192362001-12-27 Akim Demaille <akim@epita.fr>
19237
19238 * configure.in: Check the protos of strchr ans strspn.
19239 Replace strchr if needed.
19240 * src/system.h: Provide the protos of strchr, strspn and memchr if
19241 missing.
19242 * lib/strchr.c: New.
19243 * src/reader.c (symbols_save): Use strchr.
19244
8adfa272
AD
192452001-12-27 Akim Demaille <akim@epita.fr>
19246
19247 * src/print.c, src/print_graph.c (escape): New.
19248 Use it to quote the TAGS outputs.
19249 * src/print_graph.c (print_state): Now errors are in red, and
19250 reductions in green.
19251 Prefer high to wide: output the state number on a line of its own.
19252
80dac38c
AD
192532001-12-27 Akim Demaille <akim@epita.fr>
19254
19255 * src/state.h, src/state.c (reductions_new): New.
19256 * src/LR0.c (set_state_table): Let all the states have a
19257 `reductions', even if reduced to 0.
19258 (save_reductions): Adjust.
19259 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
19260 * src/print.c (print_reductions, print_actions): Adjust.
19261 * src/output.c (action_row): Adjust.
19262
2cec70b9
AD
192632001-12-27 Akim Demaille <akim@epita.fr>
19264
19265 * src/state.h, src/state.c (errs_new, errs_dup): New.
19266 * src/LR0.c (set_state_table): Let all the states have an errs,
19267 even if reduced to 0.
19268 * src/print.c (print_errs, print_reductions): Adjust.
19269 * src/output.c (output_actions, action_row): Adjust.
19270 * src/conflicts.c (resolve_sr_conflict): Adjust.
19271
13ca549a
AD
192722001-12-27 Akim Demaille <akim@epita.fr>
19273
19274 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
19275
5092aba5
AD
192762001-12-27 Akim Demaille <akim@epita.fr>
19277
19278 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
19279 * src/print.c: here.
19280 (lookaheadset, shiftset): New, used as additional storage by
19281 print_reductions.
19282 (print_results): Adjust.
19283 (print_shifts, print_gotos, print_errs): New, extracted from...
19284 (print_actions): here.
19285 * src/print_graph.c (print_actions): Remove dead code.
19286
11e2beca
AD
192872001-12-27 Akim Demaille <akim@epita.fr>
19288
19289 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
19290 `$n' and `@n'.
19291
dac3c910
AD
192922001-12-27 Akim Demaille <akim@epita.fr>
19293
19294 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
19295 (build_relations): Adjust.
19296
d0b0fefa
AD
192972001-12-27 Akim Demaille <akim@epita.fr>
19298
19299 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
19300 duplication.
19301
adc8c848
AD
193022001-12-27 Akim Demaille <akim@epita.fr>
19303
19304 * src/reader.c (packgram): Catch nitems overflows.
19305
14d293ac
AD
193062001-12-27 Akim Demaille <akim@epita.fr>
19307
19308 * src/files.c, src/files.h (guard_obstack): Remove.
19309 * src/output.c (output): Adjust.
19310 * src/reader.c (parse_braces): New, factoring...
19311 (copy_action, copy_guard): these two which are renamed as...
19312 (parse_action, parse_guard): these.
19313 As a voluntary consequence, using braces around guards is now
19314 mandatory.
19315
f499b062
AD
193162001-12-27 Akim Demaille <akim@epita.fr>
19317
19318 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
19319 * src/reader.c (symbol_list): `guard' and `guard_line' are new
19320 members.
19321 (symbol_list_new): Adjust.
19322 (copy_action): action_line is the first line, not the last.
19323 (copy_guard): Just as for actions, store the `action' only, not
19324 the switch/case/break flesh.
19325 Don't parse the user action that might follow the guard, let...
19326 (readgram): do it, i.e., now, there can be an action after a
19327 guard.
19328 In other words the guard is just explicitly optional.
19329 (packgram): Adjust.
19330 * src/output.c (guards_output): New.
19331 (output_parser): Call it when needed.
19332 (output): Also free the guard and attrs obstacks.
19333 * src/files.c, src/files.h (obstack_save): Remove.
19334 (output_files): Remove.
19335 As a result, if one needs the former `.act' file, using an
19336 appropriate skeleton which requires actions and guards is now
19337 required.
19338 * src/main.c (main): Adjust.
19339 * tests/semantic.at: New.
19340 * tests/regression.at: Use `input.y' as input file name.
19341 Avoid 8+3 problems by requiring input.c when the test needs the
19342 parser.
19343
d945f5cd
AD
193442001-12-27 Akim Demaille <akim@epita.fr>
19345
19346 * src/reader.c (symbol_list_new): Be sure to initialize all the
19347 fields.
19348
d200e455
AD
193492001-12-27 Akim Demaille <akim@epita.fr>
19350
19351 All the hacks using a final pseudo state are now useless.
19352
19353 * src/LR0.c (set_state_table): state_table holds exactly nstates.
19354 * src/lalr.c (nLA): New.
19355 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
19356 instead of lookaheadsp from the pseudo state (nstate + 1).
19357
f9507c28
AD
193582001-12-27 Akim Demaille <akim@epita.fr>
19359
19360 * src/output.c (action_row, token_actions): Use a state_t instead
19361 of a integer, and nlookaheads instead of the following state's
19362 lookaheadsp.
19363
065fbd27
AD
193642001-12-27 Akim Demaille <akim@epita.fr>
19365
19366 * src/conflicts.c (log_resolution, flush_shift)
19367 (resolve_sr_conflict, set_conflicts, solve_conflicts)
19368 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
19369 (conflicts_print, print_reductions): Use a state_t instead of an
19370 integer when referring to a state.
19371 As much as possible, depend upon nlookaheads, instead of the
19372 `lookaheadsp' member of the following state (since lookaheads of
19373 successive states are successive, the difference between state n + 1
19374 and n served as the number of lookaheads for state n).
19375 * src/lalr.c (add_lookback_edge): Likewise.
19376 * src/print.c (print_core, print_actions, print_state)
19377 (print_results): Likewise.
19378 * src/print_graph.c (print_core, print_actions, print_state)
19379 (print_graph): Likewise.
19380 * src/conflicts.h: Adjust.
19381
1b177bd7
AD
193822001-12-27 Akim Demaille <akim@epita.fr>
19383
19384 * src/bison.hairy: Formatting/comment changes.
19385 ANSIfy.
19386 Remove `register' indications.
19387 Add plenty of `static'.
19388
7742ddeb
AD
193892001-12-27 Akim Demaille <akim@epita.fr>
19390
19391 * src/output.c (prepare): Drop the muscle `ntbase' which
19392 duplicates ntokens.
19393 * src/bison.simple: Formatting/comment changes.
19394 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
19395 is an undocumented synonym.
19396
1fa14068
AD
193972001-12-22 Akim Demaille <akim@epita.fr>
19398
19399 * src/output.c (output_table_data): Change the prototype to use
19400 `int' for array ranges: some invocations do pass an int, not a
19401 short.
19402 Reported by Wayne Green.
19403
b9752825
AD
194042001-12-22 Akim Demaille <akim@epita.fr>
19405
19406 Some actions of web2c.y are improperly triggered.
19407 Reported by Mike Castle.
19408
19409 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
19410 * tests/regression.at (Web2c): Rename as...
19411 (Web2c Report): this.
19412 (Web2c Actions): New.
19413
776209d6
AD
194142001-12-22 Akim Demaille <akim@epita.fr>
19415
19416 Reductions in web2c.y are improperly reported.
19417 Reported by Mike Castle.
19418
19419 * src/conflicts.c (print_reductions): Fix.
19420 * tests/regression.at (Web2c): New.
19421
275fc3ad
AD
194222001-12-18 Akim Demaille <akim@epita.fr>
19423
19424 Some host fail on `assert (!"foo")', which expands to
19425 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
19426 Reported by Nelson Beebee.
19427
19428 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
19429 `#define it_succeeded 0' and `assert (it_succeeded)'.
19430
897668ee
MA
194312001-12-17 Marc Autret <autret_m@epita.fr>
19432
19433 * src/bison.simple: Don't hard code the skeleton line and filename.
19434 * src/output.c (output_parser): Rename 'line' as 'output_line'.
19435 New line counter 'skeleton_line' (skeleton-line muscle).
19436
ab3399e0
PE
194372001-12-17 Paul Eggert <eggert@twinsun.com>
19438
19439 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
19440 YYDEBUG must be defined to a nonzero value.
19441
19442 * src/bison.simple (yytname): Do not assume that the user defines
19443 YYDEBUG to a properly parenthesized expression.
19444
3877f72b
AD
194452001-12-17 Akim Demaille <akim@epita.fr>
19446
19447 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
19448 nlookaheads is a new member.
19449 Adjust all users.
19450 * src/lalr.h (nlookaheads): Remove this orphan declaration.
19451 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
19452 state.
776209d6 19453
331dbc1b
AD
194542001-12-17 Akim Demaille <akim@epita.fr>
19455
19456 * src/files.h, src/files.c (open_files, close_files): Remove.
19457 * src/main.c (main): Don't open/close files, nor invoke lex_free,
19458 let...
19459 * src/reader.c (reader): Do it.
776209d6 19460
be750e4c
AD
194612001-12-17 Akim Demaille <akim@epita.fr>
19462
19463 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 19464
709ae8c6
AD
194652001-12-17 Akim Demaille <akim@epita.fr>
19466
19467 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
19468 (flush_reduce): New.
19469 (resolve_sr_conflict): Adjust.
776209d6 19470
f87685c3
AD
194712001-12-17 Akim Demaille <akim@epita.fr>
19472
19473 * src/output.c (output_obstack): Be static and rename as...
19474 (format_obstack): this, to avoid any confusion with files.c's
19475 output_obstack.
19476 * src/reader.h (muscle_obstack): Move to...
19477 * src/output.h: here, since it's defined in output.c.
19478
837491d8
AD
194792001-12-17 Akim Demaille <akim@epita.fr>
19480
19481 * src/output.c (action_row, save_column, default_goto)
19482 (sort_actions, matching_state, pack_vector): Better variable
19483 locality.
19484
796d61fb
AD
194852001-12-17 Akim Demaille <akim@epita.fr>
19486
19487 * src/output.c: Various formatting changes.
776209d6 19488
64d15509
AD
194892001-12-17 Akim Demaille <akim@epita.fr>
19490
19491 * src/files.c (output_files): Free the output_obstack.
19492 * src/main.c (main): Call print and print_graph conditionally.
19493 * src/print.c (print): Work unconditionally.
19494 * src/print_graph.c (print_graph): Work unconditionally.
19495 * src/conflicts.c (log_resolution): Output only if verbose_flag.
19496
fbc8ecb7
MA
194972001-12-16 Marc Autret <autret_m@epita.fr>
19498
19499 * src/output.c (actions_output): Fix. When we use %no-lines,
19500 there is one less line per action.
19501
f0440388
MA
195022001-12-16 Marc Autret <autret_m@epita.fr>
19503
19504 * src/bison.simple: Remove a useless #line directive.
19505 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
19506 * src/output.c (get_lines_number): New.
776209d6 19507 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
19508 output muscles.
19509 Fix line numbering.
19510 (actions_output): Computes the number of lines taken by actions.
19511 (output_master_parser): Insert new skeleton which is the name of
19512 the output parser file name.
19513
a79986b8
MA
195142001-12-15 Marc Autret <autret_m@epita.fr>
19515
19516 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
19517
4ec8e00f
MA
195182001-12-15 Marc Autret <autret_m@epita.fr>
19519
19520 * src/output.c (output_gram): Keep track of the hairy one.
19521
1a4648ff
AD
195222001-12-15 Akim Demaille <akim@epita.fr>
19523
19524 Make `make distcheck' work.
19525
19526 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
19527 system.h which uses libgettext.h.
19528
9c2c67e6
AD
195292001-12-15 Akim Demaille <akim@epita.fr>
19530
19531 * src/nullable.c (set_nullable): Useless rules must be skipped,
19532 otherwise, since we range over their symbols, we might look at a
19533 nonterminal which no longer ``exists'', i.e., it is not counted in
19534 `nvars', hence we overflow our arrays.
19535
93ede233
AD
195362001-12-15 Akim Demaille <akim@epita.fr>
19537
19538 The header can also be produced directly, without any obstack!
19539 Yahoo!
19540
19541 * src/files.c, src/files.h (defines_obstack): Remove.
19542 (compute_header_macro): Global.
19543 (defines_obstack_save): Remove.
19544 * src/reader.c (parse_union_decl): No longer output to
19545 defines_obstack: its content can be found in the `stype' muscle
19546 anyway.
19547 (output_token_translations): Merge into...
19548 (symbols_output): this.
19549 Rename as...
19550 (symbols_save): this.
19551 (reader): Adjust.
19552 * src/output.c (header_output): New.
19553 (output): Call it.
19554
2666f928
AD
195552001-12-15 Akim Demaille <akim@epita.fr>
19556
19557 * src/reader.c (parse_union_decl): Instead of handling two obstack
19558 simultaneously, use one to define the `stype' muscle, and use the
19559 value of the latter to fill defines_obstack.
19560 (copy_comment): Remove.
19561 (copy_comment2): Work for a single obstack.
19562 Rename as...
19563 (copy_comment): this.
19564
428046f8
AD
195652001-12-15 Akim Demaille <akim@epita.fr>
19566
19567 * src/lex.c, src/lex.h (xgetc): No longer static.
19568 * src/reader.c (parse_union_decl): Revamp.
19569
ea52d706
AD
195702001-12-15 Akim Demaille <akim@epita.fr>
19571
19572 Still making progress in separating Bison into (i) input, (ii)
19573 process, (iii) output: now we can directly output the parser file
19574 without using table_obstack at all.
19575
19576 * src/files.c, src/files.h (table_obstack): Bye bye.
19577 (parser_file_name): New.
19578 * src/files.c (compute_output_file_names): Compute it.
19579 * src/output.c (actions_output, output_parser)
19580 (output_master_parser): To a file instead of an obstack.
19581
3f96f4dc
AD
195822001-12-15 Akim Demaille <akim@epita.fr>
19583
19584 Attach actions to rules, instead of pre-outputting them to
19585 actions_obstack.
19586
19587 * src/gram.h (rule_t): action and action_line are new members.
19588 * src/reader.c (symbol_list): Likewise.
19589 (copy_action): Save the actions within the rule.
19590 (packgram): Save them in rule_table.
19591 * src/output.c (actions_output): New.
19592 (output_parser): Use it on `%%actions'.
19593 (output_rule_data): Don't free rule_table.
19594 (output): Do it.
19595 (prepare): Don't save the `action' muscle.
19596 * src/bison.simple: s/%%action/%%actions/.
19597
51576fb3
AD
195982001-12-15 Akim Demaille <akim@epita.fr>
19599
19600 * src/reader.c (copy_action): When --yacc, don't append a `;'
19601 to the user action: let it fail if lacking.
dee049eb 19602 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 19603
2648a72d
AD
196042001-12-14 Akim Demaille <akim@epita.fr>
19605
19606 * src/lex.c (literalchar): Simply return the char you decoded, non
19607 longer mess around with obstacks and int pointers.
19608 Adjust all callers.
19609
92790e5b
AD
196102001-12-14 Akim Demaille <akim@epita.fr>
19611
19612 * src/lex.c (literalchar): Don't escape the special characters,
19613 just decode them, and keep them as char (before, eol was output as
19614 the 2 char string `\n' etc.).
19615 * src/output.c (output_rule_data): Use quotearg to output the
19616 token strings.
19617
927c1557
PE
196182001-12-13 Paul Eggert <eggert@twinsun.com>
19619
19620 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
19621 Do not infringe on the global user namespace when using C++.
19622 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
19623 All uses of `fprintf' and `stderr' changed.
19624
19625 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
19626
ed8e1f68
AD
196272001-12-13 Akim Demaille <akim@epita.fr>
19628
19629 The computation of nullable is broken: it doesn't handle empty
19630 RHS's properly.
19631
19632 * tests/torture.at (GNU AWK Grammar): New.
19633 * tests/sets.at (Nullable): New.
19634 * src/nullable.c (set_nullable): Instead of blindly looping over
19635 `ritems', loop over the rules, and then over their rhs's.
19636
19637 Work around Autotest bugs.
19638
19639 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
19640 frame, because Autotest understand lines starting with a `+' as
19641 traces from the shell. Then, they are not processed properly.
19642 Admittedly an Autotest bug, but we don't have time to wait for
19643 Autotest to catch up.
19644 * tests/regression.at (Broken Closure): Adjust to the new table
19645 frames.
19646 Move to...
19647 * tests/sets.at: here.
19648
cb581495
AD
196492001-12-13 Akim Demaille <akim@epita.fr>
19650
19651 * src/closure.c (closure): Use nrules instead of playing tricks
19652 with BITS_PER_WORD.
19653
2e729273
AD
196542001-12-13 Akim Demaille <akim@epita.fr>
19655
19656 * src/print.c (print_actions): Output the handling of `$' as the
19657 traces do: shifting the token EOF. Before EOF was treated as a
19658 nonterminal.
19659 * tests/regression.at: Adjust some tests.
19660 * src/print_graph.c (print_core): Complete the set of items via
19661 closure. The next-to-final and final states are still unsatisfying,
19662 but that's to be addressed elsewhere.
19663 No longer output the rule numbers, but do output the state number.
19664 A single loop for the shifts + gotos is enough, but picked a
19665 distinct color for each.
19666 (print_graph): Initialize and finalize closure.
19667
107f7dfb
AD
196682001-12-13 Akim Demaille <akim@epita.fr>
19669
19670 * src/reader.c (readgram): Remove dead code, an strip useless
19671 braces.
19672 (get_type): Remove, unused.
19673
9b53a24f
AD
196742001-12-12 Akim Demaille <akim@epita.fr>
19675
19676 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
19677 on that of lib/error.c.
19678
dbfb6dcd
AD
196792001-12-12 Akim Demaille <akim@epita.fr>
19680
19681 Some hosts don't like `/' in includes.
19682
19683 * src/system.h: Include libgettext.h without qualifying the path.
19684 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
19685 $(top_srcdir).
19686
c25fb648
MA
196872001-12-11 Marc Autret <autret_m@epita.fr>
19688
19689 * src/output.c (output_parser): Remove useless muscle.
19690
710ddc4f
MA
196912001-12-11 Marc Autret <autret_m@epita.fr>
19692
19693 * src/bison.simple: Remove #line just before %%epilogue. It
19694 is now handled in ...
19695 * src/reader.c (read_additionnal_code): Add the output of a
19696 #line for the epilogue.
19697
e83d80b8
MA
196982001-12-10 Marc Autret <autret_m@epita.fr>
19699
927c1557 19700 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
19701 replace precedent remove.
19702 * src/bison.simple: Remove #line before %%prologue because
19703 %%input-line is wrong at this time.
19704
971d5158
MA
197052001-12-10 Marc Autret <autret_m@epita.fr>
19706
19707 * src/reader.c (symbols_output): Clean up.
927c1557 19708 * src/output.c (output_gram, output): Clean up.
971d5158 19709
5edafffd
AD
197102001-12-10 Akim Demaille <akim@epita.fr>
19711
19712 * src/lalr.c (initialize_lookaheads): New. Extracted from...
19713 * src/LR0.c (set_state_table): here.
19714 * src/lalr.c (lalr): Call it.
19715
0279f8e9
AD
197162001-12-10 Akim Demaille <akim@epita.fr>
19717
19718 * src/state.h (shifts): Remove the `number' member: shifts are
19719 attached to state, hence no longer need to be labelled with a
19720 state number.
19721
190c4f5f
AD
197222001-12-10 Akim Demaille <akim@epita.fr>
19723
19724 Now that states have a complete set of members, the linked list of
19725 shifts is useless: just fill directly the state's shifts member.
19726
19727 * src/state.h (shifts): Remove the `next' member.
19728 * src/LR0.c (first_state, last_state): Remove.
19729 Adjust the callers.
19730 (augment_automaton): Don't look for the shifts that must be added
19731 a shift on EOF: it is those of the state we looked for! But now,
19732 since shifts are attached, it is no longer needed to looking
19733 merely by its id: its number.
19734
2a73b93d
AD
197352001-12-10 Akim Demaille <akim@epita.fr>
19736
19737 * src/LR0.c (augment_automaton): Better variable locality.
19738 Remove an impossible branch: if there is a state corresponding to
19739 the start symbol being shifted, then there is shift for the start
19740 symbol from the initial state.
19741
74392f6a
AD
197422001-12-10 Akim Demaille <akim@epita.fr>
19743
19744 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
19745 only when appropriate: when insert_start_shifting_state' is not
19746 invoked.
19747 * tests/regression.at (Rule Line Numbers): Adjust.
19748
37c82725
AD
197492001-12-10 Akim Demaille <akim@epita.fr>
19750
19751 * src/LR0.c (augment_automaton): Now that all states have shifts,
19752 merge the two cases addition shifts to the initial state.
19753
6a164e0c
AD
197542001-12-10 Akim Demaille <akim@epita.fr>
19755
19756 * src/lalr.c (set_state_table): Move to...
19757 * src/LR0.c: here.
19758 * src/lalr.c (lalr): Don't call it...
19759 * src/LR0.c (generate_states): do it.
19760 * src/LR0.h (first_state): Remove, only the table is used.
19761
7215de24
AD
197622001-12-10 Akim Demaille <akim@epita.fr>
19763
19764 * src/LR0.h (first_shift, first_reduction): Remove.
19765 * src/lalr.c: Don't use first_shift: find shifts through the
19766 states.
19767
80e25d4d
AD
197682001-12-10 Akim Demaille <akim@epita.fr>
19769
19770 * src/LR0.c: Attach shifts to states as soon as they are
19771 computed.
19772 * src/lalr.c (set_state_table): Instead of assigning shifts to
19773 state, just assert that the mapping was properly done.
19774
0ab3728b
AD
197752001-12-10 Akim Demaille <akim@epita.fr>
19776
19777 * src/LR0.c (insert_start_shift): Rename as...
19778 (insert_start_shifting_state): this.
19779 (insert_eof_shifting_state, insert_accepting_state): New.
19780 (augment_automaton): Adjust.
19781 Better locality of the variables.
19782 When looking if the start_symbol is shifted from the initial
19783 state, using `while (... symbol != start_symbol ...)' sounds
19784 better than `while (... symbol < start_symbol ...)': If fail
19785 to see how the order between symbols could be relevant!
19786
78af9bbc
AD
197872001-12-10 Akim Demaille <akim@epita.fr>
19788
19789 * src/getargs.h: Don't declare `spec_name_prefix' and
19790 `spec_file_prefix', declared by src/files.h.
19791 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
19792 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
19793 * src/output.c (prepare): Adjust.
19794 * src/reader.c (symbols_output): Likewise.
19795 * src/vmsgetargs.c: Vaguely adjust, but who cares?
19796
bdef2a41
AD
197972001-12-10 Akim Demaille <akim@epita.fr>
19798
19799 * src/muscle_tab.c (muscle_init): NULL is a better default than
19800 `"0"'.
19801
3735969c
AD
198022001-12-10 Akim Demaille <akim@epita.fr>
19803
19804 * src/reader.c (reader): Calling symbols_output once is enough.
19805
49701457
AD
198062001-12-10 Akim Demaille <akim@epita.fr>
19807
19808 Now that states have a complete set of members, the linked list of
19809 reductions is useless: just fill directly the state's reductions
19810 member.
19811
19812 * src/state.h (struct reductions): Remove member `number' and
19813 `next'.
19814 * src/LR0.c (first_reduction, last_reduction): Remove.
19815 (save_reductions): Don't link the new reductions, store them in
19816 this_state.
19817 * src/lalr.c (set_state_table): No need to attach reductions to
19818 states, it's already done.
19819 * src/output.c (output_actions): No longer free the shifts, then
19820 the reductions, then the states: free all the states and their
19821 members.
19822
0edad749
AD
198232001-12-10 Akim Demaille <akim@epita.fr>
19824
19825 * src/options.c (OPTN, DRTV, BOTH): New.
19826 (option_table): Use them.
19827
0edad749
AD
19828 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
19829 the job of system.h.
19830 * src/options.c: Don't include stdio.h and xalloc.h for the same
19831 reasons.
19832
5449dd0f
AD
198332001-12-10 Akim Demaille <akim@epita.fr>
19834
19835 * src/output.c (output, prepare): Make sure the values of the
19836 muscles `action' and `prologue' are 0-terminated.
19837
a870c567
AD
198382001-12-10 Akim Demaille <akim@epita.fr>
19839
19840 Clean up GCC warnings.
19841
19842 * src/reader.c (copy_action): `buf' is not used.
19843 (parse_skel_decl): Be static.
19844 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
19845 * src/options.h (create_long_option_table): Have a real prototype.
19846 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
19847 (hash_delete_at): Return const void *.
19848 Adjust casts to preserve the const.
19849
80df8768
AD
198502001-12-10 Akim Demaille <akim@epita.fr>
19851
19852 * configure.in: Require 2.52g.
19853 M4 is not needed, but AUTOM4TE is.
19854 * m4/m4.m4: Remove.
19855 * tests/Makefile.am: Adjust.
19856
f693ad14
AD
198572001-12-10 Akim Demaille <akim@epita.fr>
19858
19859 One structure for states is enough, even though theoretically
19860 there are LR(0) states and LALR(1) states.
19861
19862 * src/lalr.h (state_t): Remove.
19863 (state_table): Be state_t **, not state_t *.
19864 * src/state.h (core, CORE_ALLOC): Rename as...
19865 (state_t, STATE_ALLOC): this.
19866 Add the LALR(1) members: shifts, reductions, errs.
19867 * src/LR0.c (state_table): Rename as...
19868 (state_hash): this, to avoid name clashes with the global
19869 `state_table'.
19870 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
19871 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
19872
74ffbcb6
AD
198732001-12-10 Akim Demaille <akim@epita.fr>
19874
19875 Bison dumps core on bash.y.
19876 Reported by Pascal Bart.
19877
19878 * src/warshall.c (bitmatrix_print): New.
19879 (TC): Use it.
ba0fe3c7 19880 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
19881 j must be the outer loop.
19882 * tests/regression.at (Broken Closure): New.
19883
07708e19
AD
198842001-12-05 Akim Demaille <akim@epita.fr>
19885
19886 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
19887 its argument.
ba1ecc07 19888 Reported by Peter Hamorsky.
07708e19 19889
92b16366
AD
198902001-12-05 Akim Demaille <akim@epita.fr>
19891
19892 * src/conflicts.c (err_table): Remove.
19893 (resolve_sr_conflict): Adjust.
19894 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
19895 Rename as...
19896 (state_t.reductions, state_t.shifts): this.
19897
076ab033
AD
198982001-12-05 Akim Demaille <akim@epita.fr>
19899
19900 * src/reduce.c (reduce_grammar_tables): No longer disable the
19901 removal of useless rules via CPP but via `if (0)', so that the
19902 compiler still check the code is valid.
19903 For instance, it should have noticed `rline' no longer exists: use
19904 the `line' member of rule_t.
19905 * src/gram.c (dummy, rline): Remove, unused.
19906
3843c413
AD
199072001-12-05 Akim Demaille <akim@epita.fr>
19908
19909 * src/output.c (pack_vector): Use assert, not berror.
19910 * src/main.c (berror): Remove, unused.
19911
43168960
AD
199122001-12-05 Akim Demaille <akim@epita.fr>
19913
19914 New experimental feature: if --verbose --trace output all the
19915 items of a state, not only its kernel.
19916
19917 * src/print.c (print_core): If `trace_flag', then invoke closure
19918 before outputting the items of the state (print_core is no longer
19919 a correct name them).
19920 (print_results): Invoke new_closure/free_closure if needed.
19921
b2872512
AD
199222001-12-05 Akim Demaille <akim@epita.fr>
19923
19924 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
19925 * src/closure.c, src/closure.h (itemsetsize): Rename as...
19926 (nitemset): for consistency with the rest of the project.
19927
23cbcc6c
AD
199282001-12-05 Akim Demaille <akim@epita.fr>
19929
19930 * src/closure.c (print_closure): Improve.
19931 (closure): Use it for printing input and output.
19932
03ec521c
AD
199332001-12-05 Akim Demaille <akim@epita.fr>
19934
19935 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
19936 indexed by nonterminals.
19937
3a7456dd
AD
199382001-12-05 Akim Demaille <akim@epita.fr>
19939
19940 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
19941 what it was!).
19942 * src/warshall.h: Remove accidental duplication of the content.
19943
1cbcf2e7
AD
199442001-12-05 Akim Demaille <akim@epita.fr>
19945
19946 * src/closure.c (set_fderives): De-obfuscate.
19947
84182270
AD
199482001-12-05 Akim Demaille <akim@epita.fr>
19949
19950 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
19951
3f6f053c
AD
199522001-12-05 Akim Demaille <akim@epita.fr>
19953
19954 * src/closure.c (set_firsts): De-obfuscate.
19955
7a5350ba
AD
199562001-12-05 Akim Demaille <akim@epita.fr>
19957
19958 * src/output.c (action_row): De-obfuscate
19959 using the good o' techniques: arrays not pointers, variable
19960 locality, BITISSET, RESETBIT etc.
19961
d954473d
AD
199622001-12-05 Akim Demaille <akim@epita.fr>
19963
19964 Pessimize the code to simplify it: from now on, all the states
19965 have a valid SHIFTS, which NSHIFTS is possibly 0.
19966
19967 * src/LR0.c (shifts_new): Be global and move to..
19968 * src/state.c, src/state.h: here.
19969 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
19970 * src/print_graph: Adjust.
19971
9839bbe5
AD
199722001-12-05 Akim Demaille <akim@epita.fr>
19973
19974 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
19975 * src/conflicts.c: Use it.
19976 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
19977 incorrectly ``simplified''.
19978
9f136c07
AD
199792001-12-05 Akim Demaille <akim@epita.fr>
19980
19981 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
19982 using the good o' techniques: arrays not pointers, variable
19983 locality, BITISSET, RESETBIT etc.
19984
b608206e
AD
199852001-12-05 Akim Demaille <akim@epita.fr>
19986
19987 * src/state.h (SHIFT_SYMBOL): New.
19988 * src/conflicts.c: Use it to deobfuscate.
19989
52afa962
AD
199902001-12-05 Akim Demaille <akim@epita.fr>
19991
19992 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
19993 (print_reductions): De-obfuscate using the good o' techniques:
19994 arrays not pointers, variable locality, BITISSET.
19995
e74dc321
AD
199962001-12-05 Akim Demaille <akim@epita.fr>
19997
19998 * src/conflicts.c (print_reductions): Arrays, not pointers.
19999 Use BITISSET.
20000
768fca83
AD
200012001-12-05 Akim Demaille <akim@epita.fr>
20002
20003 * src/conflicts.c (print_reductions): Pessimize, but clarify.
20004
a17e599f
AD
200052001-12-05 Akim Demaille <akim@epita.fr>
20006
20007 * src/conflicts.c (print_reductions): Improve variable locality.
20008
a04bc341
AD
200092001-12-05 Akim Demaille <akim@epita.fr>
20010
20011 * src/conflicts.c (print_reductions): Pessimize, but clarify.
20012
c8ea038e
AD
200132001-12-05 Akim Demaille <akim@epita.fr>
20014
20015 * src/conflicts.c (print_reductions): Improve variable locality.
20016
aa2aab3c
AD
200172001-12-05 Akim Demaille <akim@epita.fr>
20018
20019 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
20020 * src/lalr.c: Use them.
20021
b178c8cc
AD
200222001-12-05 Akim Demaille <akim@epita.fr>
20023
20024 * src/LR0.c (augment_automaton): Formatting changes.
20025 Better variable locality.
20026
f67d13aa
AD
200272001-12-05 Akim Demaille <akim@epita.fr>
20028
20029 * src/lalr.c (matrix_print): New.
20030 (transpose): Use it.
20031 Use arrays instead of pointers.
20032
c2713865
AD
200332001-12-05 Akim Demaille <akim@epita.fr>
20034
20035 * src/lalr.c (maxrhs): Move to...
20036 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
20037 * src/lalr.c (build_relations): Adjust.
20038
9887c18a
AD
200392001-12-05 Akim Demaille <akim@epita.fr>
20040
20041 * src/lalr.c (transpose): Free the memory allocated to the
20042 argument, as it is replaced by the results by the unique caller.
20043 (build_relations): Merely invoke transpose: it handles the memory
20044 deallocation.
20045 Improve variable locality.
20046 Avoid variables used as mere abbreviations.
20047 (compute_lookaheads): Use arrays instead of pointers.
20048
4d4f699c
AD
200492001-12-05 Akim Demaille <akim@epita.fr>
20050
20051 * src/lalr.c (initialize_F): Improve variable locality.
20052 Avoid variables used as mere abbreviations.
20053
80a69750
AD
200542001-12-05 Akim Demaille <akim@epita.fr>
20055
20056 * src/derives.c (print_derives): Display the ruleno.
20057 * src/lalr.c (initialize_F, transpose): Better variable locality
20058 to improve readability.
20059 Avoid variables used as mere abbreviations.
20060
fe961097
AD
200612001-12-05 Akim Demaille <akim@epita.fr>
20062
20063 * src/lalr.c (traverse): Use arrays instead of pointers.
20064
e3e4e814
AD
200652001-12-05 Akim Demaille <akim@epita.fr>
20066
20067 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
20068 the handling of squeue.
20069 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
20070
630e182b
AD
200712001-12-05 Akim Demaille <akim@epita.fr>
20072
20073 Because useless nonterminals are now kept alive (instead of being
20074 `destroyed'), we now sometimes examine them, and store information
20075 related to them. Hence we need to know their number, and adjust
20076 memory allocations.
20077
20078 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
20079 static.
20080 * src/LR0.c (allocate_itemsets): The memory allocated to
20081 `symbol_count' was used for two different purpose: once to count
20082 the number of occurrences of each symbol, and later reassigned to
20083 `shift_symbol', containing the symbol that can be shifted from a
20084 given state.
20085 Deobfuscate, i.e., allocate, use and free `symbol_count' here
20086 only, and...
20087 (new_itemsets): Allocate `shift_symbol' here.
20088 (allocate_itemsets): symbol_count includes useless nonterminals.
20089 Make room for them.
20090 (free_storage): Use `free', not `XFREE', for pointers that cannot
20091 be null.
20092
81b51460
AD
200932001-12-05 Akim Demaille <akim@epita.fr>
20094
20095 * src/nullable.c (set_nullable): Deobfuscate the handling of
20096 ritem.
20097 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
20098
3067fbef
AD
200992001-12-05 Akim Demaille <akim@epita.fr>
20100
20101 * src/gram.c, src/gram.h (ritem_print): New.
20102 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
20103 (This useless function was defined only to work around VMS linkers
20104 that can't handle compilation units with variables only).
20105 * src/reduce.c (dump_grammar): Use it to trace the construction of
20106 ritem.
20107
c2bea5f9
PE
201082001-12-04 Paul Eggert <eggert@twinsun.com>
20109
7d27c823
PE
20110 * src/bison.simple (union yyalloc): Change member names
20111 to be the same as the stack names.
20112 (yyparse): yyptr is now union yyalloc *, not char *.
20113 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
20114 and may generate better code on some machines.
c2bea5f9
PE
20115 (yystpcpy): Use prototype if __STDC__ is defined, not just
20116 if __cplusplus is defined.
35687a9d 20117
2c8a9dfa
AD
201182001-11-30 Akim Demaille <akim@epita.fr>
20119
20120 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
20121 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
20122 Gettext doesn't compile cleanly, and dies with -Werror.
20123 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
20124 Include WARNING_CFLAGS here.
20125 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
20126 before being defined.
20127
f4e421e6
AD
201282001-11-27 Paul Eggert <eggert@twinsun.com>
20129
20130 * lib/quotearg.h (quotearg_n, quotearg_n_style):
20131 First arg is int, not unsigned.
20132 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
20133 (SIZE_MAX, UINT_MAX): New macros.
20134 (quotearg_n_options): Abort if N is negative.
20135 Avoid overflow check on hosts where size_t is 64 bits and int
20136 is 32 bits, as overflow is impossible there.
20137 Fix off-by-one typo that caused unnecessary reallocation.
20138
7093d0f5
AD
201392001-11-29 Paul Eggert <eggert@twinsun.com>
20140
20141 Name space cleanup in generated parser.
20142
20143 * doc/bison.texinfo (Bison Parser): Discuss system headers
20144 and their effect on the user name space.
20145
20146 * src/bison.simple:
20147 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
20148 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
20149 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
20150
20151 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
20152 on user names when possible.
20153
20154 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
20155 Simplify test for whather <alloca.h> exists.
20156
20157 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
20158
20159 (<stdio.h>): Include if YYDEBUG.
20160
20161 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
20162 ! defined (yyoverflow) && ! defined (yymemcpy).
20163
20164 (yymemcpy, yyparse): Rename local variables as needed so that
20165 they all begin with 'yy'.
20166
20167 (yystrlen, yystpcpy): New functions.
20168
20169 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
20170 All uses changed.
20171
20172 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
20173 instead of relying on string.h functions. Use YYSTACK_ALLOC
20174 and YYSTACK_FREE instead of malloc and free.
20175
fd51e5ff
AD
201762001-11-30 Akim Demaille <akim@epita.fr>
20177
20178 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
20179 before their first uses.
20180 (YYBISON, YYPURE): Move to the top of the output.
20181
7d13ff5f
AD
201822001-11-30 Akim Demaille <akim@epita.fr>
20183
20184 * tests/reduce.at (Useless Nonterminals): Fix.
20185
892a3995
AD
201862001-11-30 Akim Demaille <akim@epita.fr>
20187
20188 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
20189 if body instead of `;' to pacify GCC's warnings.
20190
68f1e3ed
AD
201912001-11-30 Akim Demaille <akim@epita.fr>
20192
20193 Instead of mapping the LHS of unused rules to -1, keep the LHS
20194 valid, but flag the rules as invalid.
20195
20196 * src/gram.h (rule_t): `useful' is a new member.
20197 * src/print.c (print_grammar): Adjust.
20198 * src/derives.c (set_derives): Likewise.
20199 * src/reader.c (packgram, reduce_output): Likewise.
20200 * src/reduce.c (reduce_grammar_tables): Likewise.
20201 * tests/reduce.at (Underivable Rules, Useless Rules): New.
20202
d2d1b42b
AD
202032001-11-30 Akim Demaille <akim@epita.fr>
20204
20205 * src/reduce.c (reduce_output): Formatting changes.
20206 * src/print.c (print_results, print_grammar): Likewise.
20207 * tests/regression.at (Rule Line Numbers)
20208 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
20209
760b53a8
AD
202102001-11-30 Akim Demaille <akim@epita.fr>
20211
20212 * src/reduce.c (nonterminals_reduce): Instead of throwing away
20213 useless nonterminals, move them at the end of the symbol arrays.
20214 (reduce_output): Adjust.
20215 * tests/reduce.at (Useless Nonterminals): Adjust.
20216
00238958
AD
202172001-11-30 Akim Demaille <akim@epita.fr>
20218
20219 * src/reduce.c: Various comment/formatting changes.
20220 (nonterminals_reduce): New, extracted from...
20221 (reduce_grammar_tables): here.
20222 (reduce_grammar): Call nonterminals_reduce.
20223
396452de
PE
202242001-11-29 Paul Eggert <eggert@twinsun.com>
20225
20226 * src/bison.simple (YYSTACK_REALLOC): Remove.
20227 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
20228 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
20229 New macros.
20230 (union yyalloc): New type.
20231 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
20232 an arbitrary restriction on hosts where size_t is wider than int.
20233
20234 (yyparse): Don't dump core if alloca or malloc fails; instead, report
20235 a parser stack overflow. Allocate just one block of memory for all
20236 three stacks, instead of allocating three blocks; this typically is
20237 faster and reduces fragmentation.
20238
20239 Do not limit the number of items in the stack to a value that fits
20240 in 'int', as this is an arbitrary limit on hosts with 64-bit
20241 size_t and 32-bit int.
20242
147e184c
MA
202432001-11-29 Marc Autret <autret_m@epita.fr>
20244
20245 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
20246 of defining YYERROR_VERBOSE.
20247 [AT_DATA]: $4 is now out of C declarations in the prologue.
20248
426cf563
MA
202492001-11-28 Marc Autret <autret_m@epita.fr>
20250
20251 * src/reader.c (parse_dquoted_param): New.
20252 (parse_skel_decl): Use it.
20253 * src/lex.h: Add its prototype.
20254 * src/lex.c (literalchar): Become not static.
20255
c7925b99
MA
202562001-11-28 Marc Autret <autret_m@epita.fr>
20257
20258 * src/output.h: And put its extern declaration here.
20259 * src/output.c (error_verbose): Define here.
20260 (prepare): Echo name modification.
20261 * src/getargs.h: Clean its extern declaration.
20262 * src/getargs.c (error_verbose_flag): Remove.
20263 (getargs): Remove case 'e'.
20264 * src/options.c (option_table): 'error-verbose' is now seen as simple
20265 percent option.
20266 Include output.h.
20267
20268 * src/reader.c (read_declarations): Remove case tok_include.
20269 (parse_include_decl): Remove.
20270 * src/lex.h (token_t): Remove tok_include.
20271 * src/options.c (option_table): 'include' is now a simple command line
20272 option.
20273
5b5d1929
MA
202742001-11-28 Marc Autret <autret_m@epita.fr>
20275
20276 * src/bison.simple: Adjust muscle names.
20277 * src/muscle_tab.c (muscle_init): Also rename the muscles.
20278 * src/output.c (prepare): s/_/-/ for the muscles names.
20279 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
20280
8850be4b
MA
202812001-11-28 Marc Autret <autret_m@epita.fr>
20282
20283 * src/bison.simple: Fix debug.
20284 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
20285
4a38e613
AD
202862001-11-28 Akim Demaille <akim@epita.fr>
20287
20288 * src/LR0.c (shifts_new): New.
20289 (save_shifts, insert_start_shift, augment_automaton): Use it.
20290
4b35e1c1
AD
202912001-11-28 Akim Demaille <akim@epita.fr>
20292
20293 * src/closure.c (closure): `b' and `ruleno' denote the same value:
20294 keep ruleno only.
20295
d2b04478
AD
202962001-11-28 Akim Demaille <akim@epita.fr>
20297
20298 * src/closure.c (closure): Instead of looping over word in array
20299 then bits in words, loop over bits in array.
20300
2c4c30aa
AD
203012001-11-28 Akim Demaille <akim@epita.fr>
20302
20303 * src/closure.c (closure): No longer optimize the special case
20304 where all the bits of `ruleset[r]' are set to 0, to make the code
20305 clearer.
20306
576890b7
AD
203072001-11-28 Akim Demaille <akim@epita.fr>
20308
20309 * src/closure.c (closure): `r' and `c' are new variables, used to
20310 de-obfuscate accesses to RULESET and CORE.
20311
cb487d7d
AD
203122001-11-28 Akim Demaille <akim@epita.fr>
20313
20314 * src/reduce.c (reduce_print): Use ngettext.
20315 (dump_grammar): Improve the trace accuracy.
20316
6013d43f
AD
203172001-11-28 Akim Demaille <akim@epita.fr>
20318
20319 * src/reduce.c (dump_grammar): Don't translate trace messages.
20320
cb4956ee
AD
203212001-11-28 Akim Demaille <akim@epita.fr>
20322
20323 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
20324 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
20325 as all tags are free'ed afterwards.
20326 From Enrico Scholz.
20327
648185ab
PE
203282001-11-27 Paul Eggert <eggert@twinsun.com>
20329
20330 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
20331 use alloca when we didn't want to, and vice versa.
20332
68254a03
MA
203332001-11-27 Marc Autret <autret_m@epita.fr>
20334
9113b58f
AD
20335 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
20336 initialization.
68254a03
MA
20337 * src/output.c (prepare): Remove its update.
20338
04d843a2
MA
203392001-11-27 Marc Autret <autret_m@epita.fr>
20340
20341 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
20342 Use %error-verbose.
20343
d2079671 203442001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
20345
20346 * src/bison.simple: Remove YYERROR_VERBOSE using.
20347 Use %%error_verbose.
20348 (yyparse): Likewise.
20349 * src/output.c (prepare): Give its final value.
20350 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
20351 * src/getargs.h: Add its extern declaration.
20352 * src/getargs.c (error_verbose_flag): New int.
20353 (getargs): Update to catch new case.
20354 * src/options.c (option_table): 'error-verbose' is a new option.
20355 (shortopts): Update.
20356
e0327bc8
AD
203572001-11-27 Akim Demaille <akim@epita.fr>
20358
20359 * src/system.h: Use intl/libgettext.h.
20360 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
20361
000f1a3c
AD
203622001-11-27 Akim Demaille <akim@epita.fr>
20363
20364 * tests/torture.at (Exploding the Stack Size with Malloc):
20365 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
20366
26cfe0be
AD
203672001-11-27 Akim Demaille <akim@epita.fr>
20368
20369 * src/files.c: Include error.h.
20370 Reported by Hans Aberg.
20371
f6bd5427
MA
203722001-11-26 Marc Autret <autret_m@epita.fr>
20373
d2079671 20374 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
20375 (read_declarations): Add case tok_include.
20376 * src/getargs.h (include): Add its extern definition.
20377 * src/getargs.c (include): New const char *.
20378 (getargs): Add case '-I'.
20379 * src/options.c (option_table): Add include as command line and
20380 percent option.
20381 * src/lex.h (token_t): Add tok_include.
20382
2ca209c1
AD
203832001-11-26 Akim Demaille <akim@epita.fr>
20384
20385 * src/reader.c (readgram): Make sure rules for mid-rule actions
20386 have a lineno equal to that of their host rule.
20387 Reported by Hans Aberg.
20388 * tests/regression.at (Rule Line Numbers): New.
20389
0e41b407
AD
203902001-11-26 Akim Demaille <akim@epita.fr>
20391
20392 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
20393 size_ts.
20394
203952001-11-26 Akim Demaille <akim@epita.fr>
20396
20397 * src/complain.c, src/complain.h (error): Remove, provided by
20398 lib/error.[ch].
20399
e0c40012
AD
204002001-11-26 Akim Demaille <akim@epita.fr>
20401
20402 * src/reader.c (read_declarations): Don't abort on tok_illegal,
20403 issue an error message.
20404 * tests/regression.at (Invalid %directive): New.
20405 Reported by Hans Aberg.
20406
5e147124
AD
204072001-11-26 Akim Demaille <akim@epita.fr>
20408
20409 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
20410 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
20411
a034c8b8
AD
204122001-11-26 Akim Demaille <akim@epita.fr>
20413
20414 * src/conflicts.c (conflicts_print): Don't complain at all when
20415 there are no reduce/reduce conflicts, and as many shift/reduce
20416 conflicts as expected.
20417 * tests/regression.at (%expect right): Adjust.
20418
c64a20f3
AD
204192001-11-23 Akim Demaille <akim@epita.fr>
20420
20421 * lib/alloca.c: Update, from fileutils.
20422
5b0d29bb
AD
204232001-11-23 Akim Demaille <akim@epita.fr>
20424
20425 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
20426
722c4bfe
AD
204272001-11-23 Akim Demaille <akim@epita.fr>
20428
20429 * src/system.h: Include alloca.h.
20430 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
20431
6255b435
AD
204322001-11-23 Akim Demaille <akim@epita.fr>
20433
20434 * src/print_graph.c (print_actions): Remove `rule', unused.
20435 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
20436 pacify GCC's signed < unsigned warnings.
20437 * src/closure.c (itemsetsize): Likewise.
20438 * src/reader.c (symbol_list_new): Static.
20439
b29b2ed5
AD
204402001-11-23 Akim Demaille <akim@epita.fr>
20441
20442 Attaching lineno to buckets is stupid, since only one copy of each
20443 symbol is kept, only the line of the first occurrence is kept too.
20444
20445 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
20446 * src/reader.c (rline_allocated): Remove, unused.
20447 (symbol_list): Have a `line' member.
20448 (symbol_list_new): New.
20449 (readgram): Use it.
20450 * src/print.c (print_grammar): Output the rule line numbers.
20451 * tests/regression.at (Solved SR Conflicts)
20452 (Unresolved SR Conflicts): Adjust.
20453 Reported by Hans Aberg.
20454
a81b1d4a
MA
204552001-11-22 Marc Autret <autret_m@epita.fr>
20456
20457 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
20458
c1ecb3c1
MA
204592001-11-22 Marc Autret <autret_m@epita.fr>
20460
20461 * src/muscle_tab.c (muscle_init): Remove initialization of
20462 skeleton muscle.
20463 * src/output.c (output_master_parser): Do it here.
20464
fbe01355
AD
204652001-11-20 Akim Demaille <akim@epita.fr>
20466
20467 * po/sv.po: New.
20468 * configure.in (ALL_LINGUAS): Adjust.
20469 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
20470 longer contains strings to translate.
20471
81e895c0
AD
204722001-11-19 Akim Demaille <akim@epita.fr>
20473
20474 * src/conflicts.c (conflicts_print): Add a missing \n.
20475
6bb1878b
AD
204762001-11-19 Akim Demaille <akim@epita.fr>
20477
20478 * src/nullable.c (nullable_print): New.
20479 (set_nullable): Call it when tracing.
20480 Better locality of variables.
20481
d9ec2d07
AD
204822001-11-19 Akim Demaille <akim@epita.fr>
20483
20484 * src/print.c (print_actions): Better locality of variables.
20485
720e5c1b
AD
204862001-11-19 Akim Demaille <akim@epita.fr>
20487
20488 * src/derives.c (print_derives): Fix and enrich.
20489 * src/closure.c (print_fderives): Likewise.
20490
fb908786
AD
204912001-11-19 Akim Demaille <akim@epita.fr>
20492
20493 * src/closure.c (itemsetend): Remove, replaced with...
20494 (itemsetsize): new.
20495
125ecb56
AD
204962001-11-19 Akim Demaille <akim@epita.fr>
20497
20498 * src/LR0.c (kernel_end): Remove, replaced with...
20499 (kernel_size): new.
20500
d8cf039f
AD
205012001-11-19 Akim Demaille <akim@epita.fr>
20502
20503 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
20504 to clarify.
20505
7bec0760
AD
205062001-11-19 Akim Demaille <akim@epita.fr>
20507
20508 * src/closure.c (closure): Use arrays instead of pointers to clarify.
20509
c87d4863
AD
205102001-11-19 Akim Demaille <akim@epita.fr>
20511
20512 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
20513 trace messages.
20514 * src/LR0.c: Likewise.
20515 (allocate_itemsets): Use arrays instead of pointers to clarify.
20516
9bfe901c
AD
205172001-11-19 Akim Demaille <akim@epita.fr>
20518
20519 * src/getargs.c (statistics_flag): Replace with...
20520 (trace_flag): New.
20521 (longopts): Accept --trace instead of --statistics.
20522 * src/getargs.h, src/options.c: Adjust.
20523 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
20524 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
20525
97db7bd4
AD
205262001-11-19 Akim Demaille <akim@epita.fr>
20527
cc72668c 20528 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
20529 pointers to clarify the code.
20530 (save_reductions, save_shifts): Factor common parts of alternatives.
20531
2c5f66ed
AD
205322001-11-19 Akim Demaille <akim@epita.fr>
20533
20534 * src/LR0.c (new_state, get_state): Complete TRACE code.
20535 * src/closure.c: Include `reader.h' to get `tags', needed by the
20536 trace code.
20537 Rename the conditional DEBUG as TRACE.
20538 Output consistently TRACEs to stderr, not stdout.
20539 * src/derives.c: Likewise.
20540 * src/reduce.c: (inaccessable_symbols): Using if is better style
20541 than goto.
20542 Use `#if TRACE' instead of `#if 0' for tracing code.
20543
300f275f
AD
205442001-11-19 Akim Demaille <akim@epita.fr>
20545
20546 * src/system.h (LIST_FREE, shortcpy): New.
20547 * src/LR0.c: Use them.
20548 * src/output.c (free_itemsets, free_reductions, free_shifts):
20549 Remove, replaced by LIST_FREE.
20550
f59c437a
AD
205512001-11-19 Akim Demaille <akim@epita.fr>
20552
20553 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
20554 (REDUCTIONS_ALLOC): New.
20555 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
20556 allocation.
20557
6986fd9e
AD
205582001-11-19 Akim Demaille <akim@epita.fr>
20559
20560 * src/LR0.c (new_state): Complete trace code.
20561 * src/nullable.c (set_nullable): Don't translate traces.
20562
4bc30f78
AD
205632001-11-19 Akim Demaille <akim@epita.fr>
20564
20565 * src/print_graph.c (print_core): Better locality of variables.
20566 * src/print.c (print_core): Likewise.
20567
08a946e0
AD
205682001-11-19 Akim Demaille <akim@epita.fr>
20569
20570 * src/vcg.c: You do the output, so you are responsible of the
20571 handling of VCG syntax, in particular: use quotearg.
20572 * src/print_graph.c: Don't.
20573 (print_actions): Don't output the actions as part of the nodes,
20574 since that's the job of the edges.
20575 (print_state): Don't output by hand: fill the node description,
9bfe901c 20576 and ask for its output.
08a946e0 20577
f0473484
AD
205782001-11-19 Akim Demaille <akim@epita.fr>
20579
cc72668c
AD
20580 * src/bison.simple (yyparse): When verbosely reporting an error,
20581 no longer put additional quotes around token names.
f0473484
AD
20582 * tests/calc.at: Adjust.
20583
e41dc700
AD
205842001-11-19 Akim Demaille <akim@epita.fr>
20585
20586 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
20587 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
20588 * src/output.c: Adjust.
20589
652a871c
AD
205902001-11-19 Akim Demaille <akim@epita.fr>
20591
20592 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
20593 (rule_t): this.
20594 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
20595
b2ed6e58
AD
205962001-11-19 Akim Demaille <akim@epita.fr>
20597
20598 * src/gram.h (rule_t): New.
20599 (rule_table): New.
20600 (rrhs, rlhs): Remove, part of state_t.
20601 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
20602 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
20603 * src/reader.c, src/reduce.c: Adjust.
20604
edad7067
AD
206052001-11-19 Akim Demaille <akim@epita.fr>
20606
20607 * src/reader.c (symbols_output): New, extracted from...
20608 (packsymbols): Here.
20609 (reader): Call it.
20610
3feec034
AD
206112001-11-19 Akim Demaille <akim@epita.fr>
20612
20613 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
20614 (maxrhs): this new function.
20615
ddcd5fdf
AD
206162001-11-19 Akim Demaille <akim@epita.fr>
20617
cc72668c 20618 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
20619 Adjust.
20620
bb527fc2
AD
206212001-11-19 Akim Demaille <akim@epita.fr>
20622
cc72668c 20623 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
20624 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20625 * src/lalr.c: Adjust.
20626
a845a697
AD
206272001-11-19 Akim Demaille <akim@epita.fr>
20628
20629 * src/lalr.c (initialize_LA): Only initialize LA. Let...
20630 (set_state_table): handle the `lookaheads' members.
20631
f004bf6a
AD
206322001-11-19 Akim Demaille <akim@epita.fr>
20633
cc72668c
AD
20634 * src/lalr.h (lookaheads): Removed array, whose contents is now
20635 a member of...
f004bf6a
AD
20636 (state_t): this structure.
20637 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20638 Adjust.
20639
de326cc0
AD
206402001-11-19 Akim Demaille <akim@epita.fr>
20641
cc72668c
AD
20642 * src/lalr.h (consistent): Removed array, whose contents is now
20643 a member of...
de326cc0
AD
20644 (state_t): this structure.
20645 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20646 Adjust.
20647
90b4416b
AD
206482001-11-19 Akim Demaille <akim@epita.fr>
20649
cc72668c
AD
20650 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
20651 contents are now members of...
90b4416b
AD
20652 (state_t): this structure.
20653 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20654 Adjust.
20655
9703cc49
AD
206562001-11-19 Akim Demaille <akim@epita.fr>
20657
20658 * src/lalr.h (state_t): New.
20659 (state_table): Be a state_t * instead of a core **.
20660 (accessing_symbol): Remove, part of state_t.
20661 * src/lalr.c: Adjust.
20662 (set_accessing_symbol): Merge into...
20663 (set_state_table): this.
20664 * src/print_graph.c, src/conflicts.c: Adjust.
20665
d803322e
AD
206662001-11-14 Akim Demaille <akim@epita.fr>
20667
20668 * tests/calc.at, tests/output.at, tests/regression.at,
20669 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
20670 now the tests are run in private dirs, therefore AC_CLEANUP and
20671 family can be simplified to 0-ary.
20672 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
20673 use abs. path to find config.h.
20674 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
20675 stderr, there can be way too much random noise.
20676 Instead pass -Werror to GCC and rely on the exit status.
20677 Reported by Wolfram Wagner.
20678
3d76b07d
AD
206792001-11-14 Akim Demaille <akim@epita.fr>
20680
20681 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
20682 defined only if yyoverflow is defined, to avoid `warning: unused
20683 variable `yyvs1''.
20684 Reported by The Test Suite.
20685
09b503c8
AD
206862001-11-14 Akim Demaille <akim@epita.fr>
20687
20688 * src/print.c: Include reduce.h.
20689 Reported by Hans Aberg.
20690
206912001-11-14 Akim Demaille <akim@epita.fr>
20692
20693 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
20694 Revert a previous patch: these are really const.
20695 * src/conflicts.c (conflict_report): Additional useless pair of
20696 braces to pacify GCC's warnings for `if () if () {} else {}'.
20697 * src/lex.c (parse_percent_token): Replace equal_offset with
20698 arg_offset.
20699 arg is const.
20700 Be sure to strdup `arg' when used, since there is no reason for
20701 token_buffer not to change.
20702
0f37a994
AD
207032001-11-14 Akim Demaille <akim@epita.fr>
20704
20705 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
20706 definition.
20707 * src/main.c (main): Use them.
20708 Suggested by Hans Aberg.
20709
d39d93b8
AD
207102001-11-12 Akim Demaille <akim@epita.fr>
20711
20712 * src/system.h (ngettext): Now that we use ngettext, be sure to
20713 provide a default definition when NLS are not used.
20714
9edcd895
AD
207152001-11-12 Akim Demaille <akim@epita.fr>
20716
20717 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
20718 Use @kbd to denote user input.
20719 (Language and Grammar): ANSIfy the example.
20720 Adjust its layout for info/notinfo.
20721 (Location Tracking Calc): Output error messages to stderr.
20722 Output locations in a more GNUtically correct way.
20723 Fix a couple of Englishos.
20724 Adjust @group/@end group pairs.
20725
7da99ede
AD
207262001-11-12 Akim Demaille <akim@epita.fr>
20727
e3aa65c5 20728 %expect was not functioning at all.
7da99ede
AD
20729
20730 * src/conflicts.c (expected_conflicts): Set to -1.
20731 (conflict_report): Use ngettext.
20732 (conflicts_print): Check %expect and make its violation an error.
20733 * doc/bison.texinfo (Expect Decl): Adjust.
20734 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
20735 * tests/regression.at (%expect not enough, %expect right)
20736 (%expect too much): New.
20737
ba9dda1a
AD
207382001-11-12 Akim Demaille <akim@epita.fr>
20739
20740 * tests/regression.at (Conflicts): Rename as...
20741 (Unresolved SR Conflicts): this.
20742 (Solved SR Conflicts): New.
20743
337c5bd1
AD
207442001-11-12 Akim Demaille <akim@epita.fr>
20745
20746 * src/reduce.c (print_results): Rename as...
20747 (reduce_output): This.
20748 Output to OUT, passed as argument, instead of output_obstack.
20749 (dump_grammar): Likewise.
20750 (reduce_free): New.
20751 Also free V1.
20752 (reduce_grammar): No longer call reduce_output, since...
20753 * src/print.c (print_results): do it.
20754 * src/main.c (main): Call reduce_free;
20755
c73a41af
AD
207562001-11-12 Akim Demaille <akim@epita.fr>
20757
20758 * src/conflicts.c (print_reductions): Accept OUT as argument.
20759 Output to it, not to output_obstack.
20760 * src/print.c (print_actions): Adjust.
20761
0df87bb6
AD
207622001-11-12 Akim Demaille <akim@epita.fr>
20763
20764 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
20765 the result instead of using...
20766 (src_total, rrc_total, src_count, rrc_count): Remove.
20767 (any_conflicts): Remove.
20768 (print_conflicts): Split into...
20769 (conflicts_print, conflicts_output): New.
20770 * src/conflicts.h: Adjust.
20771 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 20772 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
20773 * tests/regression.at (Conflicts): New.
20774 Reported by Tom Lane.
20775
e4d3d4de
AD
207762001-11-12 Akim Demaille <akim@epita.fr>
20777
20778 * tests/regression.at (Invalid input): Remove, duplicate with
20779 ``Invalid input: 1''.
20780
6d7d248e
AD
207812001-11-12 Akim Demaille <akim@epita.fr>
20782
20783 * tests/torture.at (AT_DATA_STACK_TORTURE)
20784 (Exploding the Stack Size with Alloca)
20785 (Exploding the Stack Size with Malloc): New.
20786
e9e4c321
AD
207872001-11-12 Akim Demaille <akim@epita.fr>
20788
20789 * src/bison.simple (YYSTACK_REALLOC): New.
20790 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 20791 Reported by Per Allansson.
e9e4c321 20792
5f7e0832
AD
207932001-11-12 Pascal Bart <pascal.bart@epita.fr>
20794
20795 * src/bison.simple: Define type yystype instead of YYSTYPE, and
20796 define CPP macro, which substitute YYSTYPE by yystype.
20797 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
20798 with yyltype/YYLTYPE. This allows inclusion of the generated
20799 header within the parser if the compiler, such as GGC, accepts
20800 multiple equivalent #defines.
20801 From Akim.
20802
e3f1699f
AD
208032001-11-05 Akim Demaille <akim@epita.fr>
20804
20805 * src/reader.c (symbols_output): New, extracted from...
20806 (packsymbols): here.
20807 (reader): Adjust.
20808
65be0866
AD
208092001-11-05 Akim Demaille <akim@epita.fr>
20810
20811 * src/lex.c (parse_percent_token): s/quotearg/quote/.
20812
e4d910bf
AD
208132001-11-05 Akim Demaille <akim@epita.fr>
20814
20815 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
20816 pattern.
20817
951366c1
AD
208182001-11-05 Akim Demaille <akim@epita.fr>
20819
20820 * src/options.h (struct option_table_struct): set_flags is void*.
20821 * src/options.c (longopts): Support `--output' and `%output'.
20822 (usage): Adjust.
20823 * src/lex.h (tok_setopt): Remove, replaced with...
20824 (tok_intopt, tok_stropt): these new guys.
20825 * src/lex.c (getopt.h): Not needed.
20826 (token_buffer, unlexed_token_buffer): Not const.
20827 (percent_table): Promote `-' over `_' in directive names.
20828 Active `%name-prefix', `file-prefix', and `output'.
20829 (parse_percent_token): Accept possible arguments to directives.
20830 Promote `-' over `_' in directive names.
20831
d8988b2f
AD
208322001-11-04 Akim Demaille <akim@epita.fr>
20833
20834 * doc/bison.texinfo (Decl Summary): Split the list into
20835 `directives for grammars' and `directives for bison'.
20836 Sort'em.
20837 Add description of `%name-prefix', `file-prefix', and `output'.
20838 Promote `-' over `_' in directive names.
20839 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
20840 Simplify the description of `--name-prefix'.
20841 Promote `-' over `_' in directive names.
20842 Promote `--output' over `--output-file'.
20843 Fix the description of `--defines'.
20844 * tests/output.at: Exercise %file-prefix and %output.
20845
6468d18e
AD
208462001-11-02 Akim Demaille <akim@epita.fr>
20847
20848 * doc/refcard.tex: Update.
20849
6b7e85b9
AD
208502001-11-02 Akim Demaille <akim@epita.fr>
20851
20852 * src/symtab.h (SUNDEF): New.
20853 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
20854 stand for `uninitialized', instead of 0.
20855 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
20856 * src/lex.c (lex): Adjust.
20857
20858 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
20859 Number it 0.
20860 Let yylex return it instead of a plain 0.
20861 Reported by Dick Streefland.
20862
cd5aafcf
AD
208632001-11-02 Akim Demaille <akim@epita.fr>
20864
20865 * tests/regression.at (Mixing %token styles): New test.
20866
037ca2f1
AD
208672001-11-02 Akim Demaille <akim@epita.fr>
20868
20869 * src/reader.c (parse_thong_decl): Formatting changes.
20870 (token_translations_init): New, extracted from...
20871 (packsymbols): Here.
20872 Adjust.
20873
270a173c
AD
208742001-11-01 Akim Demaille <akim@epita.fr>
20875
20876 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
20877 Check that `9foo.y' produces correct cpp guards.
20878 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
20879 guards.
20880 Reported by Wwp.
20881
561f9a30
AD
208822001-11-01 Akim Demaille <akim@epita.fr>
20883
20884 * tests/regression.at (Invalid input: 2): New.
20885 * src/lex.c (unlexed_token_buffer): New.
20886 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
20887 too.
20888 Reported by Wwp.
20889
f987e9d2
AD
208902001-11-01 Akim Demaille <akim@epita.fr>
20891
20892 * tests/calc.at: Catch up with 1.30.
20893 * configure.in: Bump to 1.49a.
20894 Adjust to newer Autotest.
20895
0846f581
PB
208962001-10-19 Pascal Bart <pascal.bart@epita.fr>
20897
20898 * src/conflicts.c: Move global variables rrc_total and src_total ...
20899 (print_conflicts): here.
20900 * src/output.c (output): Free global variable user_toknums.
20901 * src/lex.c (token_obstack): Become static.
20902
3c1a79b3
AD
209032001-10-18 Akim Demaille <akim@epita.fr>
20904
20905 * tests/atlocal.in (GCC): Add.
20906 * tests/calc.at: s/m4_match/m4_bmatch/.
20907 s/m4_patsubst/m4_bpatsubst/.
20908 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
20909 * configure.in: AC_SUBST(GCC).
20910
5d52e7d0
MA
209112001-10-14 Marc Autret <autret_m@epita.fr>
20912
20913 * src/options.c (create_long_option_table): Fix.
20914
631aa1d3
AD
209152001-10-10 Akim Demaille <akim@epita.fr>
20916
20917 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
20918
f6ec6d13
AD
209192001-10-04 Akim Demaille <akim@epita.fr>
20920
20921 * src/reader.c (parse_union_decl): Push the caracters in
20922 union_obstack, not attrs_obstack.
20923
342b8b6e
AD
209242001-10-04 Akim Demaille <akim@epita.fr>
20925
20926 Merge in the branch 1.29.
20927
20928 * src/reader.c (packsymbols): Use a temporary obstack for
20929 `%%tokendef', since output_stack is already used elsewhere.
20930
20931 2001-10-02 Akim Demaille <akim@epita.fr>
20932
20933 Bump 1.29d.
20934
20935 2001-10-02 Akim Demaille <akim@epita.fr>
20936
20937 Version 1.29c.
20938
20939 2001-10-02 Akim Demaille <akim@epita.fr>
20940
20941 * tests/regression.at (Invalid CPP headers): New.
20942 From Alexander Belopolsky.
20943 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
20944
20945 2001-10-02 Akim Demaille <akim@epita.fr>
20946
20947 * tests/regression.at (Invalid input): New.
20948 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
20949 Reported by Shura.
20950
20951 2001-10-02 Akim Demaille <akim@epita.fr>
20952
20953 * tests/calc.at: Now that --debug works, the tests must be adjusted.
20954
20955 2001-10-02 Akim Demaille <akim@epita.fr>
20956
20957 * src/output.c (output_parser): Assert `skeleton'.
20958 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
20959 systems.
20960 From Shura.
20961
20962 2001-10-01 Marc Autret <autret_m@epita.fr>
20963
20964 * src/lex.h: Echo modifications.
20965 * src/lex.c (unlex): Parameter is now token_t.
20966 From Hans Aberg.
20967
20968 2001-10-01 Marc Autret <autret_m@epita.fr>
20969
20970 * src/main.c: Include lex.h.
20971 From Hans Aberg.
20972
20973 2001-09-29 Akim Demaille <akim@epita.fr>
20974
20975 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
20976
20977 2001-09-28 Akim Demaille <akim@epita.fr>
20978
20979 * tests/testsuite.at: Update to newer Autotest.
20980 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
20981
20982 2001-09-27 Akim Demaille <akim@epita.fr>
20983
20984 Position independent wrapper.
20985
20986 * tests/bison: Remove.
20987 * tests/bison.in: New.
20988 * configure.in: Adjust.
20989
20990 2001-09-27 Paul Eggert <eggert@twinsun.com>
20991
20992 Port quotearg fixes from tar 1.13.24.
20993
20994 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
20995 tm to be declared.
20996 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
20997 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
20998
20999 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
21000 * m4/mbrtowc.m4: New file.
21001 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
21002 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
21003
21004 2001-09-27 Akim Demaille <akim@epita.fr>
21005
21006 Bump to 1.29c.
21007
21008 2001-09-27 Akim Demaille <akim@epita.fr>
21009
21010 Version 1.29b.
21011
21012 2001-09-25 Akim Demaille <akim@epita.fr>
21013
21014 * src/system.h: Include `xalloc.h'.
21015 Remove it from the C files.
21016 * src/files.c (output_files): Free the obstacks.
21017 * src/lex.c (init_lex): Rename as...
21018 (lex_init): this.
21019 (lex_free): New.
21020 * src/main.c (main): Use it.
21021
21022 2001-09-24 Marc Autret <autret_m@epita.fr>
21023
21024 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
21025 to output informations in fout (FILE*).
21026 (open_graph, close_graph): Likewise.
21027 (output_graph, output_edge, output_node): Likewise.
21028 * src/vcg.h: Update function prototypes.
21029 * src/print_graph.c (print_graph): Open output graph file.
21030 (print_actions): Adjust.
21031 * src/files.h: Remove extern declaration.
21032 * src/files.c: Remove graph_obstack declaration.
21033 (open_files): Remove graph_obstack initialization.
21034 (output_files): Remove graph_obstack saving.
21035
21036 2001-09-24 Marc Autret <autret_m@epita.fr>
21037
21038 * src/files.c (compute_output_file_names): Fix.
21039
21040 2001-09-24 Marc Autret <autret_m@epita.fr>,
21041 Akim Demaille <akim@epita.fr>
21042
21043 * src/reader.c (reader): Remove call to free_symtab ().
21044 * src/main.c (main): Call it here.
21045 Include symtab.h.
21046 * src/conflicts.c (initialize_conflicts): Rename as...
21047 (solve_conflicts): this.
21048 * src/print.c (print_core, print_actions, print_state)
21049 (print_grammar): Dump to a file instead a `output_obstack'.
21050 (print_results): Dump `output_obstack', and then proceed with the
21051 FILE *.
21052 * src/files.c (compute_output_file_names, close_files): New.
21053 (output_files): Adjust.
21054 * src/main.c (main): Adjust.
21055
21056 2001-09-23 Marc Autret <autret_m@epita.fr>
21057
21058 * src/files.c (compute_header_macro): Computes header macro name
21059 from spec_defines_file when given.
21060
21061 2001-09-23 Marc Autret <autret_m@epita.fr>
21062
21063 * src/files.c (output_files): Add default extensions.
21064
21065 2001-09-22 Akim Demaille <akim@epita.fr>
21066
21067 * src/conflicts.c (finalize_conflicts): Rename as...
21068 (free_conflicts): this.
21069
21070 2001-09-22 Akim Demaille <akim@epita.fr>
21071
21072 * src/gram.c (gram_free): Rename back as...
21073 (dummy): this.
21074 (output_token_translations): Free `token_translations'.
21075 * src/symtab.c (free_symtab): Free the tag field.
21076
21077 2001-09-22 Akim Demaille <akim@epita.fr>
21078
21079 Remove `translations' as it is always set to true.
21080
21081 * src/gram.h: Adjust.
21082 * src/reader.c (packsymbols, parse_token_decl): Adjust
21083 * src/print.c (print_grammar): Adjust.
21084 * src/output.c (output_token_translations): Adjust.
21085 * src/lex.c (lex): Adjust.
21086 * src/gram.c: Be sure the set pointers to NULL.
21087 (dummy): Rename as...
21088 (gram_free): this.
21089
21090 2001-09-22 Akim Demaille <akim@epita.fr>
21091
21092 * configure.in: Invoke AM_LIB_DMALLOC.
21093 * src/system.h: Use dmalloc.
21094 * src/LR0.c: Be sure to have pointers initialized to NULL.
21095 (allocate_itemsets): Allocate kernel_items only if needed.
21096
21097 2001-09-22 Akim Demaille <akim@epita.fr>
21098
21099 * configure.in: Bump to 1.29b.
21100 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
21101 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
21102 need xmalloc.c in calc.y.
21103 From Pascal Bart.
21104
21105 2001-09-21 Akim Demaille <akim@epita.fr>
21106
21107 Version 1.29a.
21108 * Makefile.maint, config/config.guess, config/config.sub,
21109 * config/missing: Update from masters.
21110 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
21111 upon package.m4.
21112 * configure.in (ALL_LINGUAS): Add `tr'.
21113
21114 2001-09-21 Akim Demaille <akim@epita.fr>
21115
21116 * tests/Makefile.am (package.m4): Move to...
21117 ($(srcdir)/$(TESTSUITE)): here.
21118
21119 2001-09-20 Akim Demaille <akim@epita.fr>
21120
21121 * src/complain.c: No longer try to be standalone: use system.h.
21122 Don't assume __STDC__ is defined to 1. Just test if it is defined.
21123 * src/complain.h: Likewise.
21124 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
21125 Remove the unused variable `n'.
21126 From Albert Chin-A-Young.
21127
21128 2001-09-18 Marc Autret <autret_m@epita.fr>
21129
21130 * doc/bison.1: Update.
21131 * doc/bison.texinfo (Bison Options): Update --defines and --graph
21132 descriptions.
21133 (Option Cross Key): Update.
21134 Add --graph.
21135
21136 2001-09-18 Marc Autret <autret_m@epita.fr>
21137
21138 * tests/regression.at: New test (comment in %union).
21139
21140 2001-09-18 Marc Autret <autret_m@epita.fr>
21141
21142 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
21143 do that.
21144 Reported by Keith Browne.
21145
21146 2001-09-18 Marc Autret <autret_m@epita.fr>
21147
21148 * tests/output.at: Add tests for --defines and --graph.
21149
21150 2001-09-18 Marc Autret <autret_m@epita.fr>
21151
21152 * tests/output.at: Removes tests of %{header,src}_extension features.
21153
21154 2001-09-18 Akim Demaille <akim@epita.fr>
21155
21156 * tests/Makefile.am (package.m4): New.
21157 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
21158 (_AT_CHECK_CALC_ERROR): Likewise.
21159 Factor the `, ' part of verbose error messages.
21160
21161 2001-09-18 Marc Autret <autret_m@epita.fr>
21162
21163 * src/getargs.c (longopts): Declare --defines and --graph as options
21164 with optional arguments.
21165 * src/files.h: Add extern declarations.
21166 * src/files.c (spec_graph_file, spec_defines_file): New.
21167 (output_files): Update.
21168 Remove CPP-outed code.
21169
21170 2001-09-18 Marc Autret <autret_m@epita.fr>
21171
21172 Turn off %{source,header}_extension feature.
21173
21174 * src/files.c (compute_exts_from_gf): Update.
21175 (compute_exts_from_src): Update.
21176 (output_files): CPP-out useless code.
21177 * src/files.h: Remove {header,source}_extension extern declarations.
21178 * src/reader.c (parse_dquoted_param): CPP-out.
21179 (parse_header_extension_decl): Remove.
21180 (parse_source_extension_decl): Remove.
21181 (read_declarations): Remove cases tok_{hdrext,srcext}.
21182 * src/lex.c (percent_table): Remove {header,source}_extension entries.
21183 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
21184
21185 2001-09-10 Akim Demaille <akim@epita.fr>
21186
21187 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
21188 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
21189 (AT_CHECK_OUTPUT): this.
21190 Merely check ls' exit status, its output is useless.
21191
21192 2001-09-10 Akim Demaille <akim@epita.fr>
21193
21194 * tests/calc.at: Use m4_match.
21195 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
21196
21197 2001-09-10 Marc Autret <autret_m@epita.fr>,
21198 Akim Demaille <akim@epita.fr>
21199
21200 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
21201 enum color_e.
21202 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
21203 to `normal'.
21204 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
21205 * src/lex.h: Adjust prototype.
21206 (token_t): Add `tok_undef'.
21207 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
21208 (parse_percent_token): Now returns token_t.
21209 Add default statement in switch.
21210 (lex): Separate `c' as an input variable, from the token_t result
21211 part.
21212 (unlexed): Is a token_t.
21213
21214 2001-09-10 Akim Demaille <akim@epita.fr>
21215
21216 * configure.in: Bump to 1.29a.
21217
21218 2001-09-07 Akim Demaille <akim@epita.fr>
21219
21220 Version 1.29.
21221
21222 2001-08-30 Akim Demaille <akim@epita.fr>
21223
21224 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
21225 * m4/atconfig.m4: Remove.
21226 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
21227 * tests/bison: New.
21228 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
21229 m4_if, m4_patsubst, and m4_regexp.
21230 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
21231 `input' file instead of echo.
21232
21233 2001-08-29 Akim Demaille <akim@epita.fr>
21234
21235 Bump to 1.28e.
21236
21237 2001-08-29 Akim Demaille <akim@epita.fr>
21238
21239 Version 1.28d.
21240
21241 2001-08-29 Paul Eggert <eggert@twinsun.com>
21242
21243 * src/bison.simple (yyparse): Don't take the address of an
21244 item before the start of an array, as that doesn't conform to
21245 the C Standard.
21246
21247 2001-08-29 Robert Anisko <anisko_r@epita.fr>
21248
21249 * doc/bison.texinfo (Location Tracking Calc): New node.
21250
21251 2001-08-29 Paul Eggert <eggert@twinsun.com>
21252
21253 * src/output.c (output): Do not define const, as this now
21254 causes more problems than it cures.
21255
21256 2001-08-29 Akim Demaille <akim@epita.fr>
21257
21258 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
21259 the nodes.
21260 Be sure to tag the `detailmenu'.
21261
21262 2001-08-29 Akim Demaille <akim@epita.fr>
21263
21264 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
21265 download in a tmp dir.
21266
21267 2001-08-28 Marc Autret <autret_m@epita.fr>
21268
21269 * config/depcomp: New file.
21270
21271 2001-08-28 Marc Autret <autret_m@epita.fr>
21272
21273 * doc/bison.1 (mandoc): Adjust.
21274 From Juan Manuel Guerrero.
21275
21276 2001-08-28 Marc Autret <autret_m@epita.fr>
21277
21278 * src/print_graph.c (print_state): Fix.
21279
21280 2001-08-27 Marc Autret <autret_m@epita.fr>
21281
21282 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
21283 char * members.
21284 Echo modifications to the functions prototypes.
21285 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
21286
21287 2001-08-27 Marc Autret <autret_m@epita.fr>
21288
21289 * src/vcg.c: Include `xalloc.h'.
21290 (add_colorentry): New.
21291 (add_classname): New.
21292 (add_infoname): New.
21293 * src/vcg.h: Add new prototypes.
21294
21295 2001-08-27 Akim Demaille <akim@epita.fr>
21296
21297 * Makefile.maint: Sync. again with CVS Autoconf.
21298
21299 2001-08-27 Akim Demaille <akim@epita.fr>
21300
21301 * Makefile.maint: Formatting changes.
21302 (po-update, cvs-update, update): New targets.
21303 (AMTAR): Remove.
21304
21305 2001-08-27 Akim Demaille <akim@epita.fr>
21306
21307 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
21308 * Makefile.maint: Sync. with CVS Autoconf.
21309
21310 2001-08-27 Marc Autret <autret_m@epita.fr>
21311
21312 * src/vcg.h (struct infoname_s): New.
21313 (struct colorentry_s): New.
21314 (graph_s): New fields {vertical,horizontal}_order in structure.
21315 Add `infoname' field.
21316 Add `colorentry' field;
21317 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
21318 (G_HORIZONTAL_ORDER): New.
21319 (G_INFONAME): New.
21320 (G_COLORENTRY): New.
21321 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
21322 Add output of `infoname'.
21323 Add output of `colorentry'.
21324
21325 2001-08-27 Marc Autret <autret_m@epita.fr>
21326
21327 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
21328 This one shadowed a global parameter.
21329
21330 2001-08-24 Marc Autret <autret_m@epita.fr>
21331
21332 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
21333 instead of `unsigned'.
21334 (print_state): Do not call obstack_object_size () in obstack_grow ()
21335 to avoid macro variables shadowing.
21336
21337 2001-08-23 Marc Autret <autret_m@epita.fr>
21338
21339 * src/lex.c (percent_table): Typo: s/naem/name/.
21340 Add graph option.
21341 Normalize new options declarations.
21342
21343 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
21344
21345 * tests/suite.at: Exercise %header_extension and %source_extension.
21346
21347 2001-08-16 Marc Autret <autret_m@epita.fr>
21348
21349 * src/reader.c (parse_dquoted_param): New.
21350 (parse_header_extension_decl): Use it.
21351 (parse_source_extension_decl): Likewise.
21352
21353 2001-08-16 Marc Autret <autret_m@epita.fr>
21354
21355 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
21356 (get_xxxx_str): Use assert () instead of complain ().
21357 Remove return invokations in default cases.
21358 (get_decision_str): Modify default behaviour. Remove second argument.
21359 Echo modifications on calls.
21360 (output_graph): Fix.
21361
21362 2001-08-16 Marc Autret <autret_m@epita.fr>
21363
21364 * src/getargs.c (usage): Update with ``-g, --graph''.
21365
21366 2001-08-16 Marc Autret <autret_m@epita.fr>
21367
21368 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
21369 (Option Cross Key): Likewise.
21370 * doc/bison.1: Update.
21371
1c8c2190
PB
213722001-09-25 Pascal Bart <pascal.bart@epita.fr>
21373
21374 * src/output.c (output_master_parser): Don't finish action_obstack.
21375 (output_parser): Don't care about the muscle action, here.
21376 (prepare): Copy the action_obstack in the action muscle.
21377 (output): Free action_obstack.
21378
180d45ba
PB
213792001-09-23 Pascal Bart <pascal.bart@epita.fr>
21380
21381 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
21382 will contain `%union' declaration.
21383 (parse_union_decl): Delete #line directive output.
21384 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
21385 informations about %union.
21386 (parse_union_decl): Copy the union_obstack in the muscle stype.
21387 * src/bison.simple: Add new #line directive.
21388 Add typdef %%stype YYSTYPE.
21389
c51d1a19
PB
213902001-09-23 Pascal Bart <pascal.bart@epita.fr>
21391
21392 * src/bison.simple: Add new `#line' directive.
21393
6f9344da
PB
213942001-09-22 Pascal Bart <pascal.bart@epita.fr>
21395
21396 * src/bison.simple: New `#line' directive.
21397 * src/output.c (output_parser): Support new dynamic muscle input_line.
21398
652def80
MA
213992001-09-22 Marc Autret <autret_m@epita.fr>
21400
21401 * src/output.c (output_master_parser): New.
21402 (output_parser): Be more re-entrant.
21403
25b222fa
MA
214042001-09-21 Marc Autret <autret_m@epita.fr>
21405
21406 * src/reader.c (copy_definition, parse_union_decl): Update and use
21407 `linef' muscle.
21408 (copy_action): Likewise.
21409 Use obstack_1grow ().
21410 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
21411
6bc35ae5
MA
214122001-09-21 Marc Autret <autret_m@epita.fr>
21413
21414 * src/options.c (option_table): Adjust.
21415 * src/lex.c (parse_percent_token): Fix.
21416
c0629aa1
PB
214172001-09-20 Pascal Bart <pascal.bart@epita.fr>
21418
21419 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 21420
82b6d266
PB
214212001-09-20 Pascal Bart <pascal.bart@epita.fr>
21422
21423 * src/lex.c (parse_percent_token): Change type of variable `tx', which
21424 is now an option_table_struct*.
21425 (option_strcmp): New function option_strcmp.
21426 (parse_percent_token): Call option_strcmp.
21427 * src/getargs.c (xalloc.h, options.h): Include it.
21428 (getargs): Call create_long_option_table.
21429 (getargs): Free longopts at the end of the function.
21430 (shortopts): Move in options.c.
21431 * src/options.c (create_long_option_table): New function. Convert
21432 information from option_table to option structure.
21433 * src/reader.c (options.h): Include it.
21434
21435 * src/Makefile.am: Adjust.
21436 * src/options.c (option_table): Create from longopts and percent_table.
21437 * src/getargs.c (longopts): Delete.
21438 * src/lex.c (struct percent_table_struct): Delete.
21439 (percent_table): Delete.
21440 (options.h): Include it.
21441 * src/options.c: Create.
21442 * src/options.h: Create.
21443 Declare enum opt_access_e.
21444 Define struct option_table_struct.
21445
75f5aaea
MA
214462001-09-20 Marc Autret <autret_m@epita.fr>
21447
21448 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
21449 sections of Bison.
21450
f508cb0a
PB
214512001-09-19 Pascal Bart <pascal.bart@epita.fr>
21452
21453 * src/bison.simple: s/%%filename/%%skeleton.
21454 * src/muscle_tab.c (getargs.h): Include it.
21455 (muscle_init): Insert new muscle skeleton.
21456
13105fc1
PB
214572001-09-18 Pascal Bart <pascal.bart@epita.fr>
21458
21459 * src/output.c (output_parser): Delete unused variable actions_dumped.
21460
b0c4483e
PB
214612001-09-07 Pascal Bart <pascal.bart@epita.fr>
21462
21463 * src/output.c (output): Delete call to reader_output_yylsp.
21464 * src/reader.c (reader): Likewise.
ba0fe3c7 21465 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 21466
11d82f03
MA
214672001-09-02 Marc Autret <autret_m@epita.fr>
21468
21469 * src/reader.c: Include muscle_tab.h.
21470 (parse_union_decl): Update.
21471 (parse_macro_decl): Rename parse_muscle_decl.
21472 Update to use renamed functions and variable.
21473 (read_declarations, copy_action, read_additionnal_code, : Updated
21474 with correct variables and functions names.
21475 (packsymbols, reader): Likewise.
342b8b6e 21476
11d82f03 21477 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 21478
11d82f03
MA
21479 * src/output.c: Include muscle_tab.h
21480 In all functions using macro_insert, change by using muscle_insert ().
21481 (macro_obstack): Rename muscle_obstack.
21482 Echo modifications in the whole file.
21483 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
21484 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
21485 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
21486
21487 * src/muscle_tab.h: Update double inclusion macros.
21488 (macro_entry_s): Rename muscle_entry_s.
21489 Update prototypes.
342b8b6e 21490
11d82f03
MA
21491 * src/muscle_tab.c: Include muscle_tab.h.
21492 Rename macro_tabble to muscle_table.
21493 (mhash1, mhash2, mcmp): Use muscle_entry.
21494 (macro_init): Rename muscle_init. Update.
21495 (macro_insert): Rename muscle_insert. Update.
21496 (macro_find): Rename muscle_find. Update.
21497
21498 * src/main.c: Include muscle_tab.h.
21499 (main): Call muscle_init ().
21500 * src/Makefile.am (bison_SOURCES): Echo modifications.
21501
93a37297
MA
215022001-09-02 Marc Autret <autret_m@epita.fr>
21503
f753cd62 21504 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 21505
f753cd62
MA
21506 * src/muscle_tab.c, src/muscle_tab.h: Add files.
21507
215082001-09-02 Marc Autret <autret_m@epita.fr>
21509
21510 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 21511
682d48cd
PB
215122001-09-01 Pascal Bart <pascal.bart@epita.fr>
21513
342b8b6e 21514 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
21515 filename.
21516
087c8fda
MA
215172001-09-01 Marc Autret <autret_m@epita.fr>
21518
21519 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
21520 to an explicit value to activate the feature. We do it here.
21521
dda680cb
PB
215222001-08-31 Pascal Bart <pascal.bart@epita.fr>
21523
21524 * src/output.c (prepare): Delete the `filename' muscule insertion.
21525 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
21526 (parse_union_decl): Likewise.
21527 * src/macrotab.c (macro_init): Initialize filename by infile.
21528
9e644e64
MA
215292001-08-31 Marc Autret <autret_m@epita.fr>
21530
21531 * src/bison.simple (YYLSP_NEEDED): New definition.
21532 * src/output.c (prepare): Add macro insertion of `locations_flag'
21533
17da6427
PB
215342001-08-31 Pascal Bart <pascal.bart@epita.fr>
21535
21536 * src/output.c (prepare): Delete insertion of previous muscles,
21537 and insert the `prefix' muscles.
21538 * src/macrotab.c (macro_init): Likewise.
21539 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 21540 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
21541 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
21542 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 21543 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
21544 name_prefix.
21545
e8cb70b9
PB
215462001-08-31 Pascal Bart <pascal.bart@epita.fr>
21547
21548 * src/main.c (main): Standardize.
21549 * src/output.c (output_table_data, output_parser): Likewise.
21550 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
21551
63c2d5de
MA
215522001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
21553
342b8b6e 21554 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
21555 %%epilogue.
21556 * src/output.c (output): Rename %%declarations to %%prologue.
21557 * src/bison.simple: Echo modifications.
342b8b6e 21558
d8cb5183
MA
215592001-08-31 Marc Autret <autret_m@epita.fr>
21560
21561 * src/reader.c (readgram): CleanUp.
21562 (output_token_defines): Likewise.
21563 (packsymbols): Likewise.
21564 (reader): Likewise.
21565 * src/output.c (output): CPP-out useless code.
21566
6c686258
PB
215672001-08-31 Pascal Bart <pascal.bart@epita.fr>
21568
342b8b6e 21569 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
21570 output_trailers and output_headers.
21571 * src/output.h: Remove obsolete functions prototypes of output_headers
21572 and output_trailers.
21573
8f451ef7
PB
215742001-08-30 Pascal Bart <pascal.bart@epita.fr>
21575
21576 * src/main.c: Include macrotab.h.
342b8b6e 21577 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
21578 Adjust functions prototypes.
21579 * src/macrotab.c (macro_insert): Constify key and value.
21580 (macro_find): Constify key.
21581 (macro_insert): Include 'xalloc.h'
21582 (macro_insert): Use XMALLOC.
21583 (macro_find): Constify return value.
21584 * src/output.c (output_table_data): Rename table to table_data.
21585 (output_parser): Constify macro_key, macro_value.
21586
997b6fd0 215872001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
21588
21589 * src/reader.c (parse_skel_decl): New.
342b8b6e 21590 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
21591 * src/lex.h (token_t): New token `tok_skel'.
21592 * src/lex.c (percent_table): Add skeleton option entry.
21593 Standardize.
21594
ff48177d
MA
215952001-08-29 Marc Autret <autret_m@epita.fr>
21596
21597 * src/bison.simple: Add %%user_code directive at the end.
21598 * src/reader.c (read_additionnal_code): New.
21599 (reader): Use it.
21600 * src/output.c (output_program): Remove.
21601 (output): Update.
21602
b33160bf
MA
216032001-08-28 Marc Autret <autret_m@epita.fr>
21604
21605 * src/output.c (output_actions): Clean up.
4e5caae2 21606 (output_gram): CPP-out useless code.
b33160bf
MA
21607 * src/reader.c (reader): Clean up, CPP-out useless code.
21608
d1a2daf7
PB
216092001-08-28 Pascal Bart <pascal.bart@epita.fr>
21610
342b8b6e 21611 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 21612 directive.
d1a2daf7
PB
21613 * src/bison.simple: Add `%%definitions'.
21614
2b763dfe
MA
216152001-08-28 Marc Autret <autret_m@epita.fr>
21616
21617 * config/depcomp: New file.
21618
f1a87ef6
PE
216192001-08-27 Paul Eggert <eggert@twinsun.com>
21620
21621 * src/bison.simple (yyparse): Don't take the address of an
21622 item before the start of an array, as that doesn't conform to
21623 the C Standard.
21624
82e236e2
RA
216252001-08-27 Robert Anisko <robert.anisko@epita.fr>
21626
f1a87ef6 21627 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
21628 obstack. It was done too late here.
21629
21630 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
21631 completely wrong.
21632 (reader): Initialize the macro obstack here, since we need it to grow
21633 '%define' directives.
21634
21635 * src/reader.h: Declare the macro obstack as extern.
21636
b0cfa28a
RA
216372001-08-27 Robert Anisko <robert.anisko@epita.fr>
21638
21639 * src/output.c (output_parser): Fix. Store single '%' characters in
21640 the output obstack instead of throwing them away.
21641
6fc74234
AD
216422001-08-27 Akim Demaille <akim@epita.fr>
21643
21644 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
21645
9c76d118
RA
216462001-08-25 Robert Anisko <robert.anisko@epita.fr>
21647
21648 * lib/Makefile.am: Adjust.
21649
a8289c62
RA
216502001-08-25 Robert Anisko <robert.anisko@epita.fr>
21651
21652 * src/bison.simple: Update and add '%%' directives.
21653
b6610515
RA
216542001-08-25 Robert Anisko <robert.anisko@epita.fr>
21655
21656 * src/reader.c (reader): Remove calls to 'output_headers' and
21657 'output_trailers'. Remove some C output.
21658 (readgram): Disable a piece of code that was writing a default
21659 definition for 'YYSTYPE'.
21660 (reader_output_yylsp): Remove.
21661 (packsymbols): Output token defintions to a macro.
21662 (copy_definition): Disable C output.
6fc74234 21663
b6610515
RA
21664 * src/reader.c (parse_macro_decl): New function used to parse macro
21665 declarations.
21666 (copy_string2): Put the body of copy_string into this new function.
21667 Add a parameter to let the caller choose whether he wants to copy the
21668 string delimiters or not.
21669 (copy_string): Be a simple call to copy_string2 with the last argument
21670 bound to true.
21671 (read_declarations): Add case for macro definition.
21672 (copy_identifier): New.
6fc74234 21673 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
21674 rather than lex.
21675
26f609ff
RA
216762001-08-25 Robert Anisko <robert.anisko@epita.fr>
21677
21678 * src/output.c (prepare): Add prefixed names.
21679 (output_parser): Output semantic actions.
21680 (output_parser): Fix bug on '%%line' directives.
6fc74234 21681
26f609ff
RA
21682 * src/output.c (output_headers): Remove. The C code printed by this
21683 function should now be in the skeletons.
21684 (output_trailers): Remove.
21685 (output): Disable call to 'reader_output_yylsp'.
21686 (output_rule_data): Do not output tables to the table obstack.
21687
21688 * src/output.c: Remove some C dedicated output.
21689 Improve the use of macro and output obstacks.
21690 (output_defines): Remove.
6fc74234 21691
26f609ff
RA
21692 * src/output.c (output_token_translations): Associate 'translate'
21693 table with a macro. No output to the table obstack.
21694 (output_gram): Same for 'rhs' and 'prhs'.
21695 (output_stos): Same for 'stos'.
21696 (output_rule_data): Same for 'r1' and 'r2'.
21697 (token_actions): Same for 'defact'.
21698 (goto_actions): Same for 'defgoto'.
21699 (output_base): Same for 'pact' and 'pgoto'.
21700 (output_table): Same for 'table'.
21701 (output_check): Same for 'check'.
6fc74234 21702
26f609ff
RA
21703 * src/output.c (output_table_data): New function.
21704 (output_short_table): Remove.
21705 (output_short_or_char_table): Remove.
6fc74234 21706
26f609ff
RA
21707 * src/output.c (output_parser): Replace most of the skeleton copy code
21708 with something new. Skeletons are now processed character by character
21709 rather than line by line, and Bison looks for '%%' macros. This is the
21710 first step in making Bison's output process (a lot) more flexible.
21711 (output_parser): Use the macro table.
21712
6f43b113
RA
217132001-08-25 Robert Anisko <robert.anisko@epita.fr>
21714
21715 * src/main.c (main): Initialize the macro table.
21716
dd3127cf
RA
217172001-08-25 Robert Anisko <robert.anisko@epita.fr>
21718
21719 * src/lex.c (percent_table): Add tok_define.
21720 * src/lex.h: Add tok_define.
21721
aa321494
RA
217222001-08-25 Robert Anisko <robert.anisko@epita.fr>
21723
21724 * src/macrotab.c: New file.
21725 * src/macrotab.h: New file.
21726 * src/Makefile.am: Update.
21727
68bd3b6b
RA
217282001-08-25 Robert Anisko <robert.anisko@epita.fr>
21729
21730 * lib/hash.c: New file.
21731 * lib/hash.h: New file.
21732 * lib/Makefile.am: Update.
21733
45f8dd1e
AD
217342001-08-15 Akim Demaille <akim@epita.fr>
21735
21736 Version 1.28c.
21737
40a64a7a 217382001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
21739
21740 * src/reader.c (readgram): Indent output macro YYSTYPE.
21741 (packsymbols): Likewise.
21742 (output_token_defines): Likewise.
21743 * src/files.c: Standardize.
21744 (compute_header_macro): New.
21745 (defines_obstack_save): New. Use compute_header_macro.
21746 (output_files): Update. Use defines_obstack_save.
21747
f9a8293a
AD
217482001-08-15 Akim Demaille <akim@epita.fr>
21749
21750 * doc/bison.texinfo (Table of Symbols): Document
21751 YYSTACK_USE_ALLOCA.
21752
150ca7a7
AD
217532001-08-15 Akim Demaille <akim@epita.fr>
21754
21755 * missing: Update from CVS Automake.
21756 * config/config.guess, config/config.sub, config/texinfo.tex:
21757 Update from gnu.org.
21758
69b5cec4
AD
217592001-08-15 Akim Demaille <akim@epita.fr>
21760
21761 * Makefile.maint: Sync with CVS Autoconf.
21762
f2b5126e
PB
217632001-08-14 Pascal Bart <pascal.bart@epita.fr>
21764
69b5cec4 21765 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
21766 `fdl.texi'.
21767 * doc/fdl.texi: Add to package.
21768
4ecbf796
MA
217692001-08-14 Marc Autret <autret_m@epita.fr>
21770
21771 Turn on %{source,header}_extension features.
21772
69b5cec4 21773 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
21774 source_extension.
21775 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 21776 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
21777 between options.
21778
95fb5662
MA
217792001-08-14 Marc Autret <autret_m@epita.fr>
21780
21781 * src/files.c (compute_base_names): Add extensions computing when
21782 `--file-prefix' used.
21783 Standardize function calls.
21784
78d09da9
MA
217852001-08-13 Marc Autret <autret_m@epita.fr>
21786
69b5cec4 21787 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
21788 defining it (defined but null disables alloca).
21789
5a009f2c
MA
217902001-08-13 Marc Autret <autret_m@epita.fr>
21791
21792 * src/bison.simple (_yy_memcpy): CPP reformat.
21793
1e41465a
PB
217942001-08-13 Pascal Bart <pascal.bart@epita.fr>
21795
21796 * tests/atconfig.in (CPPFLAGS): Fix.
21797
c67a198d
PB
217982001-08-10 Pascal Bart <pascal.bart@epita.fr>
21799
79282c6c 21800 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
21801 `gpl.texi'.
21802 * doc/gpl.texi: Add to package.
21803
09a6de7e
MA
218042001-08-10 Marc Autret <autret_m@epita.fr>
21805
21806 * src/print_graph.h: Fix.
21807 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
21808
b77b9ee0
AD
218092001-08-10 Akim Demaille <akim@epita.fr>
21810
21811 * src/system.h: Provide default declarations for stpcpy, strndup,
21812 and strnlen.
21813
3e259915
MA
218142001-08-10 Robert Anisko <anisko_r@epita.fr>
21815
21816 * doc/bison.texinfo (Locations): Update @$ stuff.
21817
ca96bc2d
MA
218182001-08-09 Robert Anisko <anisko_r@epita.fr>
21819
21820 * src/bison.simple (YYLLOC_DEFAULT): Update.
21821 (yyparse): Adjust.
21822
fdc6758b
MA
218232001-08-08 Marc Autret <autret_m@epita.fr>
21824
b77b9ee0 21825 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
21826 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
21827 Reported by Fabrice Bauzac.
957d4dbf 21828
600cad3b
MA
218292001-08-08 Marc Autret <autret_m@epita.fr>
21830
21831 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
21832 * src/vcg.c (output_node): Fix.
21833 * src/vcg.h: Cleanup.
21834 * src/print_graph.c: Add comments.
b77b9ee0 21835 (node_output_size): New global variable. Simplify the formatting of
600cad3b 21836 the VCG graph output.
b77b9ee0 21837 (print_actions): Unused code is now used. It notifies the final state
600cad3b 21838 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 21839 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
21840 blue.
21841 Get the current node name and node_obstack by argument.
21842 (node_obstack): New variable.
21843 (print_state): Manage node_obstack.
21844 (print_core): Use node_obstack given by argument.
21845 A node is not only computed here but in print_actions also.
21846 (print_graph): CPP out useless code instead of commenting it.
21847
976e528f
AD
218482001-08-07 Pascal Bart <pascal.bart@epita.fr>
21849
21850 * tests/atconfig.in (CPPFLAGS): Fix.
21851
20e8e5ca
AD
218522001-08-07 Akim Demaille <akim@epita.fr>
21853
21854 * src/print_graph.c (quote): New.
21855 (print_core): Use it.
21856
957d4dbf 218572001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 21858
3e3da797
AD
21859 * src/vcg.c (complain.h): Include it.
21860 Unepitaize `return' invocations.
c4b66126 21861 [NDEBUG] (main): Remove.
79282c6c 21862 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
21863 * src/files.c (open_files): Initialize graph_obstack.
21864 * src/print_graph.c (print_actions): CPP out useless code.
21865 (print_core): Don't output the last `\n' in labels.
21866 Use `quote'.
21867 * src/files.c (output_files): Output the VCG file.
21868 * src/main.c (main): Invoke print_graph ();
3e3da797 21869
957d4dbf 218702001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
21871
21872 Automaton VCG graph output.
21873 Using option ``-g'' or long option ``--graph'', you can generate
21874 a gram_filename.vcg file containing a VCG description of the LALR (1)
21875 automaton of your grammar.
21876
21877 * src/main.c: Call to print_graph() function.
21878 * src/getargs.h: Update.
21879 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
21880 (graph_flag): New flag.
21881 (longopts): Update.
21882 (getargs): Add case `g'.
21883 * src/files.c (graph_obstack): New obstack struct.
21884 (open_files): Initialize new obstack.
21885 (output_files): Saves graph_obstack if required.
21886 * src/files.h (graph_obstack): New extern declaration.
21887 * src/Makefile.am: Add new source files.
21888
927c1557 218892001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
21890
21891 * src/print_graph.c, src/print_graph.h (graph): New.
21892 * src/vcg.h: New file.
21893 * src/vcg.c: New file, VCG graph handling.
21894
7333d403
AD
218952001-08-06 Marc Autret <autret_m@epita.fr>
21896
21897 Add of %source_extension and %header_extension which specify
21898 the source or/and the header output file extension.
21899
21900 * src/files.c (compute_base_names): Remove initialisation of
21901 src_extension and header_extension.
21902 (compute_exts_from_gf): Update.
21903 (compute_exts_from_src): Update.
21904 (output_files): Update.
21905 * src/reader.c (parse_header_extension_decl): New.
21906 (parse_source_extension_decl): New.
21907 (read_declarations): New case statements for the new tokens.
21908 * src/lex.c (percent_table): Add entries for %source_extension
21909 and %header_extension.
21910 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
21911
84163231
AD
219122001-08-06 Marc Autret <autret_m@epita.fr>
21913
21914 * configure.in: Bump to 1.28c.
21915 * doc/bison.texinfo: Texinfo thingies.
21916
8303fc42
AD
219172001-08-04 Pascal Bart <pascal.bart@epita.fr>
21918
21919 * tests/atconfig.in (CPPFLAGS): Add.
21920 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
21921
70a84437
AD
219222001-08-03 Akim Demaille <akim@epita.fr>
21923
21924 Version 1.28b.
21925
2ce10144
AD
219262001-08-03 Akim Demaille <akim@epita.fr>
21927
21928 * tests/Makefile.am (check-local): Ship testsuite.
21929 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
21930 Include `string.h'.
21931
1e3e4bc1
AD
219322001-08-03 Akim Demaille <akim@epita.fr>
21933
21934 * configure.in: Try using -Wformat when compiling.
21935
42b45b7f
AD
219362001-08-03 Akim Demaille <akim@epita.fr>
21937
21938 * configure.in: Bump to 1.28b.
21939
8f13fe33
AD
219402001-08-03 Akim Demaille <akim@epita.fr>
21941
21942 * src/complain.c: Adjust strerror_r portability issues.
21943
b37ba92c
AD
219442001-08-03 Akim Demaille <akim@epita.fr>
21945
21946 Version 1.28a.
21947
b0ce6046
AD
219482001-08-03 Akim Demaille <akim@epita.fr>
21949
21950 * src/getargs.c, src/getarg.h (skeleton)): Constify.
21951 * src/lex.c (literalchar): Avoid name clashes on `buf'.
21952 * src/getargs.c: Include complain.h.
21953 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
21954 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
21955
d01c415b
AD
219562001-08-03 Akim Demaille <akim@epita.fr>
21957
21958 * src/reader.c (readgram): Display hidden chars in error messages.
21959
459dd1a6
AD
219602001-08-03 Akim Demaille <akim@epita.fr>
21961
21962 Update to gettext 0.10.39.
21963
53b74c0c
AD
219642001-08-03 Akim Demaille <akim@epita.fr>
21965
21966 * lib/strspn.c: New.
21967
234a3be3
AD
219682001-08-01 Marc Autret <autret_m@epita.fr>
21969
21970 * doc/bison.texinfo: Update.
21971 * doc/bison.1 (mandoc): Update.
21972 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
21973 * src/files.c: Support output files extensions computing.
21974 (src_extension): New static variable.
21975 (header_extension): New static variable.
21976 (tr): New function.
21977 (get_extension_index): New function, gets the index of an extension
21978 filename in a string.
21979 (compute_exts_from_gf): New function, computes extensions from the
21980 grammar file extension.
21981 (compute_exts_from_src): New functions, computes extensions from the
21982 C source file extension, file given by ``-o'' option.
21983 (compute_base_names): Update.
21984 (output_files): Update.
21985
847bf1f5
AD
219862001-08-01 Robert Anisko <anisko_r@epita.fr>
21987
d995fee7 21988 * doc/bison.texi: Document @$.
847bf1f5
AD
21989 (Locations): New section.
21990
d074a105
AD
219912001-07-18 Akim Demaille <akim@epita.fr>
21992
21993 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
21994 * config/prev-version.txt, config/move-if-change: New.
21995 * Makefile.am: Adjust.
21996
3419715d
AD
219972001-07-08 Pascal Bart <pascal.bart@epita.fr>
21998
21999 * src/bison.simple (yyparse): Suppress warning `comparaison
22000 between signed and unsigned'.
22001
62ab6972
AD
220022001-07-05 Pascal Bart <pascal.bart@epita.fr>
22003
22004 * src/getargs.h (raw_flag): Remove.
22005 * src/getargs.c: Die on `-r'/`--raw'.
22006 * src/lex.c (parse_percent_token): Die on `%raw'.
22007 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
22008 * tests/calc.at: Suppress test with option `--raw'.
22009
1e24cc5b
AD
220102001-07-14 Akim Demaille <akim@epita.fr>
22011
22012 * config/: New.
22013 * configure.in: Require Autoconf 2.50.
22014 Update to gettext 0.10.38.
22015
32dfccf8
AD
220162001-03-16 Akim Demaille <akim@epita.fr>
22017
22018 * doc/bison.texinfo: ANSIfy the examples.
22019
cd5bd6ac
AD
220202001-03-16 Akim Demaille <akim@epita.fr>
22021
22022 * getargs.c (skeleton): New variable.
22023 (longopts): --skeleton is a new option.
22024 (shortopts, getargs): -S is a new option.
22025 * getargs.h: Declare skeleton.
22026 * output.c (output_parser): Use it.
22027
5141b016
AD
220282001-03-16 Akim Demaille <akim@epita.fr>
22029
22030 * m4/strerror_r.m4: New.
22031 * m4/error.m4: Run AC_FUNC_STRERROR_R.
22032 * lib/error.h, lib/error.c: Update.
22033
447992b9
AD
220342001-03-16 Akim Demaille <akim@epita.fr>
22035
22036 * src/getargs.c (longopts): Clean up.
22037
274d42ce
AD
220382001-02-21 Akim Demaille <akim@epita.fr>
22039
22040 * src/reader.c (gensym): `gensym_count' is your own.
22041 Use a static buf to create the symbol name, as token_buffer is no
22042 longer a buffer.
22043
22c821f3
AD
220442001-02-08 Akim Demaille <akim@epita.fr>
22045
22046 * src/conflicts.c (conflict_report): Be sure not to append to res
22047 between two calls, which could happen if both first sprintf were
22048 skipped, but not the first cp += strlen.
22049
18569462
AD
220502001-02-08 Akim Demaille <akim@epita.fr>
22051
22052 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
22053 New, from fileutils 4.0.37.
22054 * configure.in: Require Autoconf 2.49c. I took some time before
22055 making this decision. This is the only way out for portability
22056 issues in Bison, it would mean way too much duplicate effort to
22057 import in Bison features implemented in 2.49c since 2.13.
22058 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
22059
0d8f3c8a
AD
220602001-02-02 Akim Demaille <akim@epita.fr>
22061
22062 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 22063 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 22064
f17bcd1f
AD
220652001-01-19 Akim Demaille <akim@epita.fr>
22066
22067 Get rid of the ad hoc handling of token_buffer in the scanner: use
22068 the obstacks.
22069
22070 * src/lex.c (token_obstack): New.
22071 (init_lex): Initialize it. No longer call...
22072 (grow_token_buffer): this. Remove it.
22073 Adjust all the places which used it to use the obstack.
22074
511e79b3
AD
220752001-01-19 Akim Demaille <akim@epita.fr>
22076
22077 * src/lex.h: Rename all the tokens:
22078 s/\bENDFILE\b/tok_eof/g;
22079 s/\bIDENTIFIER\b/tok_identifier/g;
22080 etc.
22081 Let them be enums, not #define, to ease debugging.
22082 Adjust all the code.
22083
0d6508ef
AD
220842001-01-18 Akim Demaille <akim@epita.fr>
22085
22086 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
22087 * src/lex.c (maxtoken, grow_token_buffer): Static.
22088
6deb4447
AD
220892001-01-18 Akim Demaille <akim@epita.fr>
22090
22091 Since we now use obstacks, more % directives can be enabled.
22092
22093 * src/lex.c (percent_table): Also accept `%yacc',
22094 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
22095 `%debug'.
22096 Handle the actions for `%semantic_parser' and `%pure_parser' here,
22097 instead of returning a token.
22098 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
22099 * src/reader.c (read_declarations): Adjust.
22100 * src/files.c (open_files): Don't call `compute_base_names', don't
22101 compute `attrsfile' since they depend upon data which might be
22102 *in* the input file now.
22103 (output_files): Do it here.
22104 * src/output.c (output_headers): Document the fact that this patch
22105 introduces a guaranteed SEGV for semantic parsers.
22106 * doc/bison.texinfo: Document them.
22107 * tests/suite.at: Exercise these %options.
22108
ff4423cc
AD
221092000-12-20 Akim Demaille <akim@epita.fr>
22110
22111 Also handle the output file (--verbose) with obstacks.
22112
22113 * files.c (foutput): Remove.
22114 (output_obstack): New.
22115 Adjust all dependencies.
22116 * src/conflicts.c: Return a string.
22117 * src/system.h (obstack_grow_string): Rename as...
22118 (obstack_sgrow): this. Be ready to work with non literals.
22119 (obstack_fgrow4): New.
22120
956dba3a
AD
221212000-12-20 Akim Demaille <akim@epita.fr>
22122
22123 * src/files.c (open_files): Fix the computation of short_base_name
22124 in the case of `-o foo.tab.c'.
22125
337bab46
AD
221262000-12-20 Akim Demaille <akim@epita.fr>
22127
22128 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
22129 (copy_dollar): Now that everything uses obstacks, get rid of the
22130 FILE * parameters.
22131
5d3214b8
AD
221322000-12-20 Akim Demaille <akim@epita.fr>
22133
22134 * src/files.c (open_files): Actually the `.output' file is based
22135 on the short_base_name, not base_name.
22136 * tests/suite.at (Checking output file names): Adjust.
22137
29092a57
AD
221382000-12-20 Akim Demaille <akim@epita.fr>
22139
22140 * src/bison.s1: Remove, we now use directly...
22141 * src/bison.simple: this.
22142 * src/Makefile.am: Use pkgdata instead of data.
22143
ea5607fd
AD
221442000-12-20 Akim Demaille <akim@epita.fr>
22145
22146 * src/files.c (guard_obstack): New.
22147 (open_files): Initialize it.
22148 (output_files): Dump it...
22149 * src/files.h: Export it.
22150 * src/reader.c (copy_guard): Use it.
22151
27110317
AD
221522000-12-19 Akim Demaille <akim@epita.fr>
22153
22154 * src/files.c (outfile, defsfile, actfile): Removed as global
22155 vars.
22156 (open_files): Don't compute them.
22157 (output_files): Adjust.
22158 (base_name, short_base_name): Be global.
22159 Adjust dependencies.
22160
19c50364
AD
221612000-12-19 Akim Demaille <akim@epita.fr>
22162
22163 * src/files.c (strsuffix): New.
22164 (stringappend): Be just like strcat but allocate.
22165 (base_names): Eve out from open_files.
22166 Try to simplify the rather hairy computation of base_name and
22167 short_base_name.
22168 (open_files): Use it.
22169 * tests/suite.at (Checking output file names): New test.
22170
573c1d9f
AD
221712000-12-19 Akim Demaille <akim@epita.fr>
22172
22173 * src/system.h (obstack_grow_literal_string): Rename as...
22174 (obstack_grow_string): this.
22175 * src/output.c (output_parser): Recognize `%% actions' instead of
22176 `$'.
22177 * src/bison.s1: s/$/%% actions/.
22178 * src/bison.hairy: Likewise.
22179
ef7ddedd
AD
221802000-12-19 Akim Demaille <akim@epita.fr>
22181
22182 * src/output.c (output_parser): Compute the `#line' lines when
22183 there are.
22184 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
22185 Suggested by Hans Aberg.
22186
ff61dabd
AD
221872000-12-19 Akim Demaille <akim@epita.fr>
22188
22189 Let the handling of the skeleton files be local to the procedures
22190 that use it.
22191
22192 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
22193 longer static.
22194 (fparser, open_extra_files): Remove.
22195 (open_files, output_files): Don't take care of fparser.
22196 * src/files.h: Adjust.
22197 * src/output.c (output_parser): Open and close the file to the
22198 skeleton.
22199 * src/reader.c (read_declarations): When %semantic_parser, open
22200 fguard.
22201
55b96341
AD
222022000-12-19 Akim Demaille <akim@epita.fr>
22203
22204 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
22205 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
22206
358c15b7
AD
222072000-12-19 Akim Demaille <akim@epita.fr>
22208
22209 * src/files.c (open_files): Yipee! We no longer need all the code
22210 looking for `/tmp' since we have no tmp file.
22211
7de3329e
AD
222122000-12-19 Akim Demaille <akim@epita.fr>
22213
22214 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
22215 New macros.
22216 * src/files.c (open_files): Less dependency on MSDOS etc.
22217
3abcd459
AD
222182000-12-14 Akim Demaille <akim@epita.fr>
22219
22220 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
22221 Provide a default definition.
22222 Use it when executing the default @ action.
22223 * src/reader.c (reader_output_yylsp): No longer include
22224 `timestamp' and `text' in the default YYLTYPE.
22225
2a91a95e
AD
222262000-12-12 Akim Demaille <akim@epita.fr>
22227
22228 * src/reader.c (copy_definition, parse_union_decl, copy_action)
22229 (copy_guard): Quote the file names.
22230 Reported by Laurent Mascherpa.
22231
14d3eb9b
AD
222322000-12-12 Akim Demaille <akim@epita.fr>
22233
22234 * src/output.c (output_headers, output_program, output): Be sure
22235 to escape special characters when outputting filenames.
22236 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
22237 (output_headers): Don't depend on them, Use ACTSTR.
22238
d7045ec6
AD
222392000-11-17 Akim Demaille <akim@epita.fr>
22240
22241 * lib/obstack.h: Formatting changes.
22242 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
22243 prevents type checking.
22244 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
22245 cast the value to (void *): assigning a `foo *' to a `void *'
22246 variable is valid.
22247 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
22248 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
22249 append characters.
22250
6fd54b73
AD
222512000-11-17 Akim Demaille <akim@epita.fr>
22252
22253 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
22254 as...
22255 (suite.m4, regression.m4, calc.m4): these.
22256 * tests/atgeneral.m4: Update from CVS Autoconf.
22257
4c50eae6
AD
222582000-11-17 Akim Demaille <akim@epita.fr>
22259
22260 * tests/regression.m4 (%union and --defines): New test,
22261 demonstrating a current bug in the obstack implementation.
22262
a35f64ea
AD
222632000-11-17 Akim Demaille <akim@epita.fr>
22264
22265 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
22266 macros.
22267 Use them to declare the variables which are global or local to
22268 `yyparse'.
22269
7de23534
AD
222702000-11-17 Akim Demaille <akim@epita.fr>
22271
22272 * acconfig.h: Remove, no longer used.
22273
aa7815f5
AD
222742000-11-07 Akim Demaille <akim@epita.fr>
22275
22276 * src: s/Copyright (C)/Copyright/g.
22277
5af1f549
AD
222782000-11-07 Akim Demaille <akim@epita.fr>
22279
22280 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
22281 defining.
22282 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
22283
553e2b22
AD
222842000-11-07 Akim Demaille <akim@epita.fr>
22285
22286 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
22287 Merge in a single CPP if/else.
22288
8a4f41d6
AD
222892000-11-07 Akim Demaille <akim@epita.fr>
22290
22291 * src/output.c (output): Remove useless variables.
22292 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
22293 argument `data' for consistency with the prototypes.
22294 Qualify it `const'.
22295 (obstack_copy, obstack_copy0): Rename the second argument as
22296 `address' for consistency. Qualify it `const'.
22297 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
22298 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
22299 `const' their input argument (`data' or `address').
22300 Adjust the corresponding macros to include `const' in casts.
22301
095a3fb5
AD
223022000-11-03 Akim Demaille <akim@epita.fr>
22303
22304 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
22305 s/PFILE1/BISON_HAIRY/.
22306 Adjust dependencies.
22307
d1cdce7c
AD
223082000-11-03 Akim Demaille <akim@epita.fr>
22309
090c5ebf 22310 For some reason, this was not applied.
d1cdce7c
AD
22311
22312 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
22313 `unlink': it's no longer used.
22314
9311529b
AD
223152000-11-03 Akim Demaille <akim@epita.fr>
22316
22317 * src/files.c (skeleton_find): New function, eved out of...
22318 (open_files, open_extra_files): here.
22319
d8880f69
AD
223202000-11-03 Akim Demaille <akim@epita.fr>
22321
22322 Don't use `atexit'.
22323
22324 * src/files.c (obstack_save): New function.
22325 (done): Rename as...
22326 (output_files): this.
22327 Use `obstack_save'.
22328 * src/main.c (main): Don't use `atexit' to register `done', since
22329 it no longer has to remove tmp files, just call `output_files'
22330 when there are no errors.
22331
0dbb648e
AD
223322000-11-02 Akim Demaille <akim@epita.fr>
22333
22334 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
22335 `unlink': it's no longer used.
22336 * src/files.h: Formatting changes.
22337
896fe5c1
AD
223382000-11-02 Akim Demaille <akim@epita.fr>
22339
22340 Remove the last uses of mktemp and unlink/delete.
22341
22342 * src/files.c (fdefines, ftable): Removed.
22343 (defines_ostack, table_obstack): New.
22344 Adjust dependencies of the former into uses of the latter.
22345 * src/output.c (output_short_or_char_table, output_short_table):
22346 Convert to using obstacks.
22347 * src/reader.c (copy_comment2): Accept one FILE * and two
22348 obstacks.
22349 (output_token_defines, reader_output_yylsp): Use obstacks.
22350 * src/system.h (obstack_fgrow3): New.
1f65350a 22351 * po/POTFILES.in: Adjust.
896fe5c1 22352
dd60faec
AD
223532000-11-01 Akim Demaille <akim@epita.fr>
22354
22355 Change each use of `fattrs' into a use of `attrs_obstack'.
22356
22357 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
22358 * src/files.c (fattrs): Remove.
22359 (attrs_obstack): New.
22360 Adjust all dependencies.
22361 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
22362
8c7ebe49
AD
223632000-11-01 Akim Demaille <akim@epita.fr>
22364
22365 Introduce obstacks.
22366 Change each use of `faction' into a use of `action_obstack'.
22367
22368 * lib/obstack.h, lib/obstack.c: New files.
22369 * src/files.c (faction): Remove.
22370 (action_obstack): New.
22371 Adjust all dependencies.
22372
77aee789
AD
223732000-10-20 Akim Demaille <akim@epita.fr>
22374
22375 * lib/quote.h (PARAMS): New macro. Use it.
22376
43591cec
AD
223772000-10-16 Akim Demaille <akim@epita.fr>
22378
22379 * src/output.c (output_short_or_char_table): New function.
22380 (output_short_table, output_token_translations): Use it.
22381 (goto_actions): Use output_short_table.
22382
1e9798d5
AD
223832000-10-16 Akim Demaille <akim@epita.fr>
22384
22385 * src/symtab.c (bucket_new): New function.
22386 (getsym): Use it.
22387
22388 * src/output.c (output_short_table): New argument to display the
22389 comment associated with the table.
22390 Adjust dependencies.
22391 (output_gram): Use it.
22392 (output_rule_data): Nicer output layout for YYTNAME.
22393
f282676b
AD
223942000-10-16 Akim Demaille <akim@epita.fr>
22395
22396 * src/lex.c (read_typename): New function.
22397 (lex): Use it.
22398 * src/reader.c (copy_dollar): Likewise.
22399
550a72a3
AD
224002000-10-16 Akim Demaille <akim@epita.fr>
22401
22402 * src/reader.c (copy_comment2): Expect the input stream to be on
22403 the `/' which is suspected to open a comment, instead of being
22404 called after `//' or `/*' was read.
22405 (copy_comment, copy_definition, parse_union_decl, copy_action)
22406 (copy_guard): Adjust.
22407
131e2fef
AD
224082000-10-16 Akim Demaille <akim@epita.fr>
22409
22410 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
22411 `read_signed_integer'.
22412
79282c5a
AD
224132000-10-16 Akim Demaille <akim@epita.fr>
22414
22415 * src/reader.c (copy_dollar): New function.
22416 (copy_guard, copy_action): Use it.
22417
ff4a34be
AD
224182000-10-16 Akim Demaille <akim@epita.fr>
22419
22420 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
22421 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
22422 New files, from Fileutils 4.0.27.
22423 * src/main.c (printable_version): Remove.
22424 * src/lex.c, src/reader.c: Use `quote'.
22425
224262000-10-04 Akim Demaille <akim@epita.fr>
22427
22428 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
22429
14ded682
AD
224302000-10-04 Akim Demaille <akim@epita.fr>
22431
22432 * doc/bison.texinfo: Various typos spotted by Neil Booth.
22433
8e03724b
AD
224342000-10-04 Akim Demaille <akim@epita.fr>
22435
22436 When a literal string is used to define two different tokens,
22437 `bison -v' segfaults.
22438 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
22439
22440 * tests/regression.m4: New file.
22441 Include the core of the sample provided by Piotr Gackiewicz.
22442 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
22443 properly.
22444
a9e64249
AD
224452000-10-04 Akim Demaille <akim@epita.fr>
22446
22447 * src/reader.c (parse_expect_decl): Keep `count' within the size
22448 of `buffer'.
22449 From Neil Booth.
22450
da9abf43
AD
224512000-10-02 Paul Eggert <eggert@twinsun.com>
22452
22453 * bison.s1 (yyparse): Assign the default value
22454 unconditionally, to avoid a GCC warning and make the parser a
22455 tad smaller.
22456
c33638bb
AD
224572000-10-02 Akim Demaille <akim@epita.fr>
22458
22459 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
22460 options.
22461
444c570a
AD
224622000-10-02 Akim Demaille <akim@epita.fr>
22463
22464 * src/derives.c, src/print.c, src/reduce.c: To ease the
22465 translation, move some `\n' out of the translated strings.
22466
89cab50d
AD
224672000-10-02 Akim Demaille <akim@epita.fr>
22468
22469 The location tracking mechanism is precious for parse error
22470 messages. Nevertheless, it is enabled only when `@n' is used in
22471 the grammar, which is a different issue (you can use it in error
22472 message, but not in the grammar per se). Therefore, there should
22473 be another means to enable it.
22474
22475 * src/getargs.c (getargs): Support `--locations'.
22476 (usage): Report it.
22477 * src/getargs.h (locationsflag): Export it.
22478 * src/lex.c (percent_table): Support `%locations'.
22479 * src/reader.c (yylsp_needed): Remove this variable, now replaced
22480 with `locationsflag'.
22481 * doc/bison.texinfo: Document `--locations' and `%locations'.
22482 Sort the options.
22483 * tests/calc.m4: Test it.
22484
22485 For regularity of the names, replace each
22486 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
22487 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
22488 In addition replace each `flag' with `_flag'.
22489
d6c2cba0
AD
224902000-10-02 Akim Demaille <akim@epita.fr>
22491
22492 Also test parse error messages, including with YYERROR_VERBOSE.
22493
22494 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
22495 associative).
22496 Use it to check the computations.
22497 Use it to check `nonassoc' is honored.
22498 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
22499 `--yyerror-verbose'.
22500 (_AT_CHECK_CALC): Adjust to this option.
22501 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
22502
5a35a6cb
AD
225032000-10-02 Akim Demaille <akim@epita.fr>
22504
22505 Test also `--verbose', `--defines' and `--name-prefix'. Testing
22506 the latter demonstrates a flaw in the handling of non debugging
22507 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
22508 was used in order to simplify:
22509
22510 #if YYDEBUG
22511 if (yydebug)
22512 {
22513 ...
22514 }
22515 #endif
22516
22517 into
22518
22519 if (yydebug)
22520 {
22521 ...
22522 }
22523
22524 unfortunately this leads to a CPP conflict when
22525 `--name-prefix=foo' is used since it produces `#define yydebug
22526 foodebug'.
22527
22528 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
22529 (YYDPRINTF): New macro.
22530 Spread its use.
22531 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
22532 the bison options.
22533 Also test `--verbose', `--defines' and `--name-prefix'.
22534
71da9eea
AD
225352000-10-02 Akim Demaille <akim@epita.fr>
22536
22537 Improve the readability of the produced parsers.
22538
22539 * src/bison.s1: Formatting changes.
22540 Improve the comment related to the `$' mark.
22541 (yydefault): Don't fall through to `yyresume': `goto' there.
22542 * src/output.c (output_parser): When the `$' is met, skip the end
22543 of its line.
22544 New variable, `number_of_dollar_signs', to check there's exactly
22545 one `$' in the parser skeleton.
22546
95e36146
AD
225472000-10-02 Akim Demaille <akim@epita.fr>
22548
22549 * lib/xstrdup.c: New file, from the fileutils.
22550 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
22551 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
22552 instead of strlen + xmalloc + strcpy.
22553 * src/symtab.c (copys): Remove, use xstrdup instead.
22554
d7020c20
AD
225552000-10-02 Akim Demaille <akim@epita.fr>
22556
22557 * src/gram.h (associativity): New enum type which replaces the
22558 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
22559 `right_assoc', `left_assoc' and `non_assoc'.
22560 Adjust all dependencies.
22561 * src/reader.c: Formatting changes.
22562 (LTYPESTR): Don't define it, use it as a literal in
22563 `reader_output_yylsp'.
22564 * src/symtab.h (symbol_class): New enum type which replaces the
22565 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
22566 `sunknown', `stoken and `snterm'.
22567
1916f98e
AD
225682000-10-02 Akim Demaille <akim@epita.fr>
22569
22570 * src/getargs.c (fixed_outfiles): Rename as...
22571 (yaccflag): for consistency and accuracy.
22572 Adjust dependencies.
22573
d7913476
AD
225742000-10-02 Akim Demaille <akim@epita.fr>
22575
22576 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
22577 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
22578 difficult and introduced a lot of core dump. It turns out that
22579 Bison used an implementation of `xmalloc' based on `calloc', and
22580 at various places it does depend upon the initialization to 0. I
22581 have not tried to isolate the pertinent places, and all the former
22582 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
22583 someone should address this issue.
22584
22585 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
22586 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
22587 files.
22588 Adjust dependencies.
22589 * src/warshall.h: New file.
22590 Propagate.
22591
340ef489
AD
225922000-10-02 Akim Demaille <akim@epita.fr>
22593
22594 Various anti-`extern in *.c' changes.
22595
22596 * src/system.h: Include `assert.h'.
22597
b2ca4022
AD
225982000-10-02 Akim Demaille <akim@epita.fr>
22599
22600 * src/state.h (nstates, final_state, first_state, first_shift)
22601 (first_reduction): Move their exportation from here...
22602 * src/LR0.h: to here.
22603 Adjust dependencies.
22604 * src/getargs.c (statisticsflag): New variable.
22605 Add support for `--statistics'.
22606 Adjust dependencies.
22607
22608 Remove a lot of now useless `extern' statements in most files.
22609
403b315b
AD
226102000-10-02 Akim Demaille <akim@epita.fr>
22611
22612 * src/LR0.h: New file.
22613 Propagate its use.
22614
07a58c13
AD
226152000-10-02 Akim Demaille <akim@epita.fr>
22616
22617 * src/print.h: New file.
22618 Propagate its use.
22619 * src/print.c: Formatting and ordering changes.
22620 (verbose, terse): Replace with...
22621 (print_results): this new function.
22622 Adjust dependencies.
22623
0619caf0
AD
226242000-10-02 Akim Demaille <akim@epita.fr>
22625
22626 * src/conflicts.c (conflict_report): New function.
22627 (conflict_log, verbose_conflict_log): Replace with...
22628 (print_conflicts): this function.
22629 Adjust dependencies.
22630 * src/conflicts.h: New file.
22631 Propagate its inclusion.
22632
3519ec76
AD
226332000-10-02 Akim Demaille <akim@epita.fr>
22634
22635 * src/nullable.h: New file.
22636 Propagate its inclusion.
22637 * src/nullable.c: Formatting changes.
22638
015acc48
AD
226392000-10-02 Akim Demaille <akim@epita.fr>
22640
22641 * src/reduce.h: New file.
22642 Propagate its inclusion.
22643 * src/reduce.c: Topological sort and other formatting changes.
22644 (bool, TRUE, FALSE): Move their definition to...
22645 * src/system.h: here.
22646
8963a27b
AD
226472000-10-02 Akim Demaille <akim@epita.fr>
22648
22649 * src/files.c: Formatting changes.
22650 (tryopen, tryclose, openfiles): Rename as...
22651 (xfopen, xfclose, open_files): this.
22652 (stringappend): static.
22653 * src/files.h: Complete the list of exported symbols.
22654 Propagate its use.
22655
a70083a3
AD
226562000-10-02 Akim Demaille <akim@epita.fr>
22657
22658 * src/reader.h: New file.
22659 Propagate its use instead of tedious list of `extern' and
22660 prototypes.
22661 * src/reader.c: Formatting changes, topological sort,
22662 s/register//.
22663
abadc117
AD
226642000-10-02 Akim Demaille <akim@epita.fr>
22665
22666 * src/lex.h: Prototype `lex.c' exported functions.
22667 * src/reader.c: Adjust.
22668 * src/lex.c: Formatting changes.
22669 (safegetc): Rename as...
22670 (xgetc): this.
22671
720d742f
AD
226722000-10-02 Akim Demaille <akim@epita.fr>
22673
22674 * src/lalr.h: New file.
22675 Propagate its inclusion instead of prototypes and `extern'.
22676 * src/lalr.c: Formatting changes, topological sorting etc.
22677
f2acea59
AD
226782000-10-02 Akim Demaille <akim@epita.fr>
22679
22680 * src/output.c (token_actions): Introduce a temporary array,
22681 YYDEFACT, that makes it possible for this function to use
22682 output_short_table.
22683
d019d655
AD
226842000-10-02 Akim Demaille <akim@epita.fr>
22685
22686 `user_toknums' is output as a `short[]' in `output.c', while it is
22687 defined as a `int[]' in `reader.c'. For consistency with the
22688 other output tables, `user_toknums' is now defined as a table of
22689 shorts.
22690
22691 * src/reader.c (user_toknums): Be a short table instead of an int
22692 table.
22693 Adjust dependencies.
22694
22695 Factor the short table outputs.
22696
22697 * src/output.c (output_short_table): New function.
22698 * src/output.c (output_gram, output_stos, output_rule_data)
22699 (output_base, output_table, output_check): Use it.
22700
6c89f1c1
AD
227012000-10-02 Akim Demaille <akim@epita.fr>
22702
22703 * src/output.c (output): Topological sort of the functions, in
22704 order to get rid of the `static' prototypes.
22705 No longer use `register'.
22706 * src/output.h: New file.
22707 Propagate its inclusion in files explicitly prototyping functions
22708 from output.c.
22709
d9efd181
AD
227102000-09-21 Akim Demaille <akim@epita.fr>
22711
22712 * src/atgeneral.m4: Update from Autoconf.
22713
c29240e7 227142000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
22715
22716 * src/closure.h: New file.
22717 * src/closure.c: Formatting changes, topological sort over the
22718 functions, use of closure.h.
22719 (initialize_closure, finalize_closure): Rename as...
22720 (new_closure, free_closure): these. Adjust dependencies.
22721 * src/LR0.c: Formatting changes, topological sort, use of
22722 cloture.h.
22723 (initialize_states): Rename as...
22724 (new_states): this.
22725 * src/Makefile.am (noinst_HEADERS): Adjust.
22726
499daa50
AD
227272000-09-20 Akim Demaille <akim@epita.fr>
22728
22729 * src/acconfig.h: Don't protect config.h against multiple
22730 inclusion.
22731 Don't define PARAMS.
22732 * src/system.h: Define PARAMS.
22733 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
22734 purpose of config.h. system.h must not try to fix wrong
22735 definitions in config.h.
22736
cc84fd5d
AD
227372000-09-20 Akim Demaille <akim@epita.fr>
22738
22739 * src/derives.h: New file.
22740 * src/main.c, src/derives.h: Use it.
22741 Formatting changes.
22742 * src/Makefile.am (noinst_HEADERS): Adjust.
22743
db5b3a89
AD
227442000-09-20 Akim Demaille <akim@epita.fr>
22745
22746 * tests/atgeneral.m4: Update from Autoconf.
22747 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
22748 (AT_CHECK_CALC): New macros.
22749 Use these macros to test bison with options `', `--raw',
22750 `--debug', `--yacc', `--yacc --debug'.
22751
ceed8467
AD
227522000-09-19 Akim Demaille <akim@epita.fr>
22753
22754 * src/output.c: Formatting changes.
22755 * src/machine.h: Remove, leaving its contents in...
22756 * src/system.h: here.
22757 Include stdio.h.
22758 Adjust all dependencies on stdio.h and machine.h.
22759 * src/getargs.h: New file.
22760 Let all `extern' declarations about getargs.c be replaced with
22761 inclusion of `getargs.h'.
22762 * src/Makefile.am (noinst_HEADERS): Adjust.
22763
22764 * tests/calc.m4 (yyin): Be initialized in main, not on the global
22765 scope.
22766 (yyerror): Returns void, not int.
22767 * doc/bison.texinfo: Formatting changes.
22768
05a1d24b
AD
227692000-09-19 Akim Demaille <akim@epita.fr>
22770
22771 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
22772 portable.
22773
cbd25751
AD
227742000-09-18 Akim Demaille <akim@epita.fr>
22775
22776 * configure.in: Append WARNING_CFLAGS to CFLAGS.
22777 * src/Makefile.am (INCLUDES): Don't.
22778 Be ready to fetch headers in lib/.
22779
13863333
AD
227802000-09-18 Akim Demaille <akim@epita.fr>
22781
22782 * doc/bison.texinfo: Update the copyright.
22783 ANSIfy and GNUify the examples.
22784 Remove the old menu.
22785
0d533154
AD
227862000-09-18 Akim Demaille <akim@epita.fr>
22787
22788 First set of tests: use the `calc' example from the documentation.
22789
22790 * src/bison.s1 (yyparse): Condition the code using `yytname' which
22791 is defined only when YYDEBUG is.
22792 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
22793 * src/files.c (tryopen, tryclose): Formatting changes.
22794 Move to the top and be static.
22795 * src/reader.c (read_signed_integer): Likewise.
22796 * tests/calc.m4: New file.
22797 * Makefile.am, suite.m4: Adjust.
22798 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
22799
e79137ac
AD
228002000-09-18 Akim Demaille <akim@epita.fr>
22801
22802 Add support for an Autotest test suite for Bison.
22803
22804 * m4/m4.m4, m4/atconfig.m4: New files.
22805 * m4/Makefile.am (EXTRA_DIST): Adjust.
22806 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
22807 files.
22808 * src/getargs.c: Display a more standard --version message.
22809 * src/reader.c (reader): Formatting changes.
22810 No longer depend upon VERSION_STRING.
22811 * configure.in: No longer use `dnl'.
22812 Set up the test suite and the new directory `tests/.
22813 (VERSION_STRING): Remove.
22814
27821bff
AD
228152000-04-14 Akim Demaille <akim@epita.fr>
22816
22817 * src/reader.c (copy_comment2): New function, same as former
22818 `copy_comment', but outputs into two FILE *.
22819 (copy_comment): Use it.
22820 (parse_union_decl): Use it.
22821 (get_type, parse_start_decl): Use the same `invalid' message.
22822 (parse_start_decl, parse_union_decl): Use the same `multiple'
22823 message.
22824 (parse_union_decl, copy_guard, copy_action): Use the same
22825 `unmatched' message.
22826 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
22827
cfe5fbc0
AD
228282000-03-31 Akim Demaille <akim@epita.fr>
22829
22830 * src/files.c (tryopen, tryclose): Move to the top.
22831 Be static.
22832
cb7db13e
AD
228332000-03-31 Akim Demaille <akim@epita.fr>
22834
22835 * src/main.c (main): Don't call `done', exit does it.
22836
a0f6b076
AD
228372000-03-31 Akim Demaille <akim@epita.fr>
22838
36281465
AD
22839 * allocate.c: s/return (foo)/return foo/.
22840 * lalr.c: Likewise.
22841 * LR0.c: Likewise.
22842 * output.c: Likewise.
22843 * reader.c: Likewise.
22844 * symtab.c: Likewise.
22845 * vmsgetargs.c: Likewise.
22846
228472000-03-31 Akim Demaille <akim@epita.fr>
22848
22849 Clean up the error reporting functions.
a0f6b076
AD
22850
22851 * src/report.c: New file.
22852 * src/report.h: Likewise.
22853 * src/Makefile.am: Adjust.
22854 * m4/error.m4: New file.
22855 * m4/Makefile.am: Adjust.
22856 * configure.in (jm_PREREQ_ERROR): Call it.
22857 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
22858 Remove.
22859 (fatal, fatals): Remove. All callers use complain.c::fatal.
22860 (warn, warni, warns, warnss, warnss): Remove. All callers use
22861 complain.c::complain.
22862 (toomany): Remove, use fatal instead.
22863 * src/files.c (done): No argument, use complain_message_count.
22864 * src/main.c (main): Register `done' to `atexit'.
22865
22866 * src/getargs.c (usage): More `fputs', less `fprintf'.
22867
18539825
AD
228682000-03-28 Akim Demaille <akim@epita.fr>
22869
22870 * lib/: New directory.
22871 * Makefile.am (SUBDIRS): Adjust.
22872 * configure.in: Adjust.
22873 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
22874 useless.
22875 * src/alloca.c: Moved to lib/.
22876 * src/getopt.c: Likewise.
22877 * src/getopt1.c: Likewise.
22878 * src/getopt.h: Likewise.
22879 * src/ansi2knr.c: Likewise.
22880 * src/ansi2knr.1: Likewise.
22881 * src/Makefile.am: Adjust.
22882 * lib/Makefile.am: New file.
22883
9f306f2a
AD
228842000-03-28 Akim Demaille <akim@epita.fr>
22885
22886 * src/getargs.c (usage): Refresh the help message.
22887
0ba347b6
AD
228882000-03-17 Akim Demaille <akim@epita.fr>
22889
22890 * src/getopt1.c: Updated from textutils 2.0e
22891 * src/getopt.c: Likewise.
22892 * src/getopt.h: Likewise.
22893
dbe7f271
AD
228942000-03-17 Akim Demaille <akim@epita.fr>
22895
22896 * src/Makefile.am (bison.simple): Fix the awk program: quote only
22897 the file name, not the whole `#line LINE FILE'.
22898
75bbe78d
AD
228992000-03-17 Akim Demaille <akim@epita.fr>
22900
22901 On syntax errors, report the token on which we choked.
22902
aa5fd0ee
AD
22903 * src/bison.s1 (yyparse): In the label yyerrlab, when
22904 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 22905
7b306f52
AD
229062000-03-17 Akim Demaille <akim@epita.fr>
22907
aa5fd0ee 22908 * src/reader.c (copy_at): New function.
7b306f52
AD
22909 (copy_guard): Use it.
22910 (copy_action): Use it.
22911
e87b5700
AD
229122000-03-17 Akim Demaille <akim@epita.fr>
22913
22914 Be kind to translators, save some useless translations.
22915
aa5fd0ee 22916 * src/main.c (banner): New function.
e87b5700
AD
22917 (fatal_banner): Use it.
22918 (warn_banner): Use it.
22919
ae3c3164
AD
229202000-03-17 Akim Demaille <akim@epita.fr>
22921
aa5fd0ee
AD
22922 * src/reader.c (copy_definition): Use copy_string and
22923 copy_comment. Removed now unused `match', `ended',
22924 `cplus_comment'.
ae3c3164
AD
22925 (copy_comment, copy_string): Moved, to be visible from
22926 copy_definition.
22927
4dc58e7c
AD
229282000-03-17 Akim Demaille <akim@epita.fr>
22929
aa5fd0ee
AD
22930 * src/reader.c (copy_string): Declare `static inline'. No
22931 problems with inline, since it is checked by configure.
4dc58e7c
AD
22932 (copy_comment): Likewise.
22933
0a6384c4
AD
229342000-03-17 Akim Demaille <akim@epita.fr>
22935
aa5fd0ee 22936 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 22937
3cef001a
AD
229382000-03-17 Akim Demaille <akim@epita.fr>
22939
aa5fd0ee 22940 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
22941 (copy_action): Use it. Removed now unused `match', `ended',
22942 `cplus_comment'.
22943 (copy_guard): Likewise.
22944
ca36d2ef
AD
229452000-03-17 Akim Demaille <akim@epita.fr>
22946
aa5fd0ee 22947 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
22948 (copy_action): Use it.
22949 (copy_guard): Likewise.
22950
6666f98f
AD
229512000-03-17 Akim Demaille <akim@epita.fr>
22952
22953 Change the handling of @s so that they behave exactly like $s.
22954 There is now a pseudo variable @$ (readble and writable), location
22955 of the lhs of the rule (by default ranging from the location of
22956 the first symbol of the rhs, to the location of the last symbol,
22957 or, if the rhs is empty, YYLLOC).
22958
22959 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
22960 yyval.
22961 (yyparse): When providing a default semantic action, provide a
22962 default location action.
22963 (after the $): No longer change `*YYLSP', just stack YYLOC the
22964 same way you stack YYVAL.
22965 * src/reader.c (read_declarations): Use warns.
22966 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
22967 (copy_action, case '@'): Likewise.
22968 Use a standard error message, to save useless work from
22969 translators.
22970
41aca2e0
AD
229712000-03-17 Akim Demaille <akim@epita.fr>
22972
aa5fd0ee
AD
22973 * src/bison.s1: Formatting and cosmetics changes.
22974 * src/reader.c: Likewise.
41aca2e0
AD
22975 Update the Copyright notice.
22976
dc08c1d5
AD
229772000-03-17 Akim Demaille <akim@epita.fr>
22978
aa5fd0ee
AD
22979 * src/bison.s1 (#line): All set to `#line' only, since the
22980 Makefile now handles them.
dc08c1d5 22981
9ee3c97b
AD
229822000-03-16 Akim Demaille <akim@epita.fr>
22983
22984 * src/output.c (output_rule_data): Output the documentation of
22985 some of the tables.
22986 (Copyright notice): Update.
22987 Formatting changes.
22988
0de741ca
AD
229892000-03-16 Akim Demaille <akim@epita.fr>
22990
22991 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
22992 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
22993 One `#if YYDEBUG' remains, since it uses variables which are
22994 defined only if `YYDEBUG != 0'.
22995
bb10be54
AD
229962000-03-16 Akim Demaille <akim@epita.fr>
22997
22998 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
22999 and related variables so that the similarities are highlighted.
23000
b07b484a
AD
230012000-03-16 Akim Demaille <akim@epita.fr>
23002
23003 * src/bison.s1: Properly indent CPP directives.
23004
361f60b3
AD
230052000-03-16 Akim Demaille <akim@epita.fr>
23006
23007 * src/bison.s1: Properly indent the `alloca' CPP section.
23008
8c44d3ec
AD
230092000-03-16 Akim Demaille <akim@epita.fr>
23010
23011 Do not hard code values of directories in `configure.in'.
23012 Update the `configure' tool chain.
23013
23014 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
23015 src/makefile.am.
23016 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
23017 (AC_OUTPUT): Add m4/Makefile.
23018 Bump to bison 1.28a, 1.29 has never been released.
23019 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
23020 handled via src/Makefile.am.
23021 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
23022 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
23023 autoheader.
23024 * Makefile.am (SUBDIRS): Add m4.
23025 (ACLOCAL_AM_FLAGS): New variable.
23026 (AUTOMAKE_OPTIONS): Add check-news.
23027 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
23028 the proper line number and file name.
23029 (DEFS): Propagate the location of bison library files and of the
23030 locale files.
23031 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
23032 builddir.
23033 * acinclude.m4: Remove, replaced by the directory m4.
23034 * m4/Makefile.am (EXTRA_DIST): New variable.
23035 * m4/gettext.m4: New file, from the fileutils.
23036 * m4/lcmessage.m4: Likewise
23037 * m4/progtest.m4: Likewise.
23038 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
23039
f95997e7
AD
230402000-03-10 Akim Demaille <akim@epita.fr>
23041
23042 * src/closure.c:
23043 Formatting changes of various comments.
23044 Respect the GNU coding standards at various places.
23045 Don't use `_()' when no translation is needed.
23046
230471999-12-13 Jesse Thilo <jthilo@gnu.org>
23048
23049 * src/files.c:
23050 OS/2 honors TMPDIR environment variable.
23051
230521999-12-13 Jesse Thilo <jthilo@gnu.org>
23053
23054 * doc/bison.texinfo: Tweaked spelling and grammar.
23055 Updated ISBN.
23056 Removed reference to price of printed copy.
23057 Mention BISON_SIMPLE and BISON_HAIRY.
23058
230591999-12-13 Jesse Thilo <jthilo@gnu.org>
23060
23061 * configure.in, NEWS:
23062 Bison 1.29 released.
23063
230641999-10-27 Jesse Thilo <jthilo@gnu.org>
23065
23066 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
23067 Added reference card.
23068
230691999-07-26 Jesse Thilo <jthilo@gnu.org>
23070
23071 * po/ru.po: Added Russian translation.
23072
230731999-07-26 Jesse Thilo <jthilo@gnu.org>
23074
23075 * configure.in: Added Russian translation.
23076
230771999-07-06 Jesse Thilo <jthilo@gnu.org>
23078
23079 * configure.in, NEWS, README:
23080 Released version 1.28.
23081
230821999-06-14 Jesse Thilo <jthilo@gnu.org>
23083
23084 * src/system.h:
23085 Squashed redefinition warning on some systems.
23086
23087 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
23088 Have configure build version string instead of relying on ANSI string
23089 concatentation.
23090
230911999-06-14 Jesse Thilo <jthilo@gnu.org>
23092
23093 * po/POTFILES.in: Got rid of version.c.
23094
230951999-06-14 Jesse Thilo <jthilo@gnu.org>
23096
23097 * acconfig.h, configure.in:
23098 Have configure build version string instead of relying on ANSI string
23099 concatentation.
23100
231011999-06-08 Jesse Thilo <jthilo@gnu.org>
23102
23103 * doc/bison.1:
23104 Dropped mention of `+' for long-named options.
23105
231061999-05-30 Jesse Thilo <jthilo@gnu.org>
23107
23108 * src/files.c: Added <unistd.h> for unlink().
23109
23110 * src/Makefile.am, src/system.h:
23111 I18n fixes.
23112
231131999-05-30 Jesse Thilo <jthilo@gnu.org>
23114
23115 * README: Added a FAQ list.
23116
23117 * configure.in, acconfig.h:
23118 I18n fixes.
23119
231201999-05-30 Jesse Thilo <jthilo@gnu.org>
23121
23122 * doc/FAQ, doc/Makefile.am:
23123 Added a FAQ list.
23124
231251999-05-19 Jesse Thilo <jthilo@gnu.org>
23126
23127 * src/alloc.h, src/symtab.h, src/version.c:
23128 Protected inclusion of "config.h" with HAVE_CONFIG_H.
23129
231301999-04-18 Jesse Thilo <jthilo@gnu.org>
23131
23132 * src/.cvsignore, src/Makefile.am:
23133 Reorganized: sources in `src', documentation in `doc'.
23134
23135 * src/lex.c (literalchar):
23136 fixed the code for escaping double quotes (thanks
23137 Jonathan Czisny.)
23138
231391999-04-18 Jesse Thilo <jthilo@gnu.org>
23140
23141 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
23142 Adjusted paths to reflect directory reorganization.
23143
231441999-04-18 Jesse Thilo <jthilo@gnu.org>
23145
23146 * doc/.cvsignore, doc/Makefile.am:
23147 Reorganized: sources in `src', documentation in `doc'.
23148
231491999-04-18 Jesse Thilo <jthilo@gnu.org>
23150
23151 * configure.in:
23152 Updated AC_INIT file to reflect directory reorganization.
23153
23154 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
23155 Reorganized: sources in `src', documentation in `doc'.
23156
231571999-04-13 Jesse Thilo <jthilo@gnu.org>
23158
23159 * src/allocate.c:
23160 Don't declare calloc() and realloc() if not necessary.
23161
231621999-04-13 Jesse Thilo <jthilo@gnu.org>
23163
23164 * configure.in, acconfig.h, acinclude.m4:
23165 Don't declare calloc() and realloc() if not necessary.
23166
231671999-03-23 Jesse Thilo <jthilo@gnu.org>
23168
23169 * po/.cvsignore: Added i18n support.
23170
231711999-03-23 Jesse Thilo <jthilo@gnu.org>
23172
23173 * acconfig.h, configure.in, Makefile.am:
23174 Added i18n support.
23175
231761999-03-22 Jesse Thilo <jthilo@gnu.org>
23177
23178 * src/bison.s1: Fixed #line numbers.
23179
231801999-03-15 Jesse Thilo <jthilo@gnu.org>
23181
23182 * po/es.po, po/fr.po, po/nl.po, po/de.po:
23183 Added PO files from Translation Project.
23184
231851999-03-03 Jesse Thilo <jthilo@gnu.org>
23186
23187 * Makefile.am:
23188 Added support for non-ANSI compilers (ansi2knr).
23189
231901999-02-16 Jesse Thilo <jthilo@gnu.org>
23191
23192 * configure.in: Bumped version number to 1.27.
23193
23194 * Makefile.am:
23195 Added `bison.simple' to list of files removed by `make distclean'.
23196
231971999-02-12 Jesse Thilo <jthilo@gnu.org>
23198
23199 * src/files.c, src/files.h:
23200 Defined locations of parser files in config.h instead of Makefile.
23201
232021999-02-12 Jesse Thilo <jthilo@gnu.org>
23203
23204 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
23205 Defined locations of parser files in config.h instead of Makefile.
23206
232071999-02-09 Jesse Thilo <jthilo@gnu.org>
23208
23209 * Makefile.am:
23210 Removed inappropriate use of $< macro.
23211
232121999-02-05 Jesse Thilo <jthilo@gnu.org>
23213
23214 * po/Makefile.in.in, po/POTFILES.in:
23215 Add `po' directory skeleton.
23216
232171999-01-27 Jesse Thilo <jthilo@gnu.org>
23218
23219 * README: Document help-bison list.
23220
23221 * configure.in: Add check for mkstemp().
23222
232231999-01-20 Jesse Thilo <jthilo@gnu.org>
23224
23225 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
23226 Hush a few compiler warnings.
23227
23228 * src/files.c:
23229 Add tryclose(), which verifies that fclose was successful.
23230 Hush a couple of compiler warnings.
23231
232321999-01-20 Jesse Thilo <jthilo@gnu.org>
23233
23234 * Makefile.am, OChangeLog:
23235 ChangeLog is now automatically generated. Include the old version as
23236 OChangeLog.
23237
232381999-01-14 Jesse Thilo <jthilo@gnu.org>
23239
23240 * 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:
23241 Update FSF address.
23242
232431999-01-14 Jesse Thilo <jthilo@gnu.org>
23244
23245 * doc/bison.texinfo: Fix formatting glitch.
23246
23247 * doc/bison.texinfo: Update FSF address.
23248
232491999-01-14 Jesse Thilo <jthilo@gnu.org>
23250
23251 * acconfig.h: Update FSF address.
23252
232531999-01-08 Jesse Thilo <jthilo@gnu.org>
23254
23255 * src/system.h:
23256 Don't define PACKAGE here, since config.h defines it.
23257
232581998-12-30 Jesse Thilo <jthilo@gnu.org>
23259
23260 * src/reader.c: Update copyright date.
23261
23262 * src/main.c:
23263 Ditch sprintf to statically-sized buffers in fatal/warn functions in
23264 favor of output directly to stderr (avoids buffer overruns).
23265
23266 * src/reader.c: Some checks for premature EOF.
23267
23268 * 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:
23269 Use prototypes if the compiler understands them.
23270
23271 * src/files.c: Honor TMPDIR on Unix hosts.
23272 Use prototypes if the compiler understands them.
23273
23274 * src/reader.c:
23275 Fix a couple of buffer overrun bugs.
23276 Use prototypes if the compiler understands them.
23277
23278 * src/system.h: Include unistd.h and ctype.h.
23279 Use #ifdef instead of #if for NLS symbols.
23280
232811998-12-30 Jesse Thilo <jthilo@gnu.org>
23282
23283 * doc/bison.texinfo:
23284 Delete comment "consider using @set for edition number, etc..." since
23285 we now are doing so.
23286
232871998-12-30 Jesse Thilo <jthilo@gnu.org>
23288
23289 * configure.in:
23290 Use prototypes if the compiler understands them.
23291
23292 * NEWS: Document 1.26 highlights.
23293
23294 * Makefile.am: Require Automake 1.3 or later.
23295
23296 * acconfig.h:
23297 Use prototypes if the compiler understands them.
23298
232991998-12-29 Jesse Thilo <jthilo@gnu.org>
23300
23301 * src/version.c:
23302 Use VERSION symbol from automake for version number.
23303
233041998-12-29 Jesse Thilo <jthilo@gnu.org>
23305
23306 * acconfig.h, configure.in, version.cin:
23307 Use VERSION symbol from automake for version number.
23308
233091998-11-28 Jesse Thilo <jthilo@gnu.org>
23310
23311 * Makefile.am:
23312 Distribute original version of simple parser (bison.s1), not built
23313 version (bison.simple).
23314
233151998-11-28 Jesse Thilo <jthilo@gnu.org>
23316
23317 * doc/bison.texinfo: Add info dir entry.
23318
23319 * doc/bison.texinfo:
23320 Let automake put version number into documentation.
23321
233221998-11-26 Jesse Thilo <jthilo@gnu.org>
23323
23324 * src/bison.cld, src/build.com, src/vmshlp.mar:
23325 Add non-RCS files from /gd/gnu/bison.
23326
233271998-11-26 Jesse Thilo <jthilo@gnu.org>
23328
23329 * doc/bison.1:
23330 Document the BISON_HAIRY and BISON_SIMPLE variables.
23331
233321998-11-25 Jesse Thilo <jthilo@gnu.org>
23333
23334 * src/version.c: Build version.c automatically.
23335
23336 * src/reader.c:
23337 Fix token numbering (used to start at 258, not 257).
23338
23339 * src/system.h: Include config.h.
23340
23341 * src/getargs.c: Update bug report address.
23342
23343 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
23344 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
23345
233461998-11-25 Jesse Thilo <jthilo@gnu.org>
23347
23348 * Makefile.am:
23349 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
23350
23351 * configure.in, version.cin:
23352 Build version.c automatically.
23353
23354 * AUTHORS: Add AUTHORS file.
23355
23356 * README: Update bug report address.
23357
23358 * bison.simple:
23359 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
23360
23361 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
23362 Add automake stuff.
23363
233641998-11-25 Jesse Thilo <jthilo@gnu.org>
23365
23366 * doc/bison.texinfo: Clean up some formatting.
23367
233681998-05-05 Richard Stallman <rms@gnu.org>
23369
23370 * doc/bison.texinfo:
23371 Explain better why to make a pure parser.
23372
233731998-01-05 Richard Stallman <rms@gnu.org>
23374
23375 * src/files.c (openfiles):
23376 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
23377 find a temporary directory, if possible. Do not unlink files while
23378 they are open.
23379
233801997-08-25 Richard Stallman <rms@gnu.org>
23381
23382 * src/reader.c (stack_offset;):
23383 Change some warni to warns.
23384
23385 * src/lex.c (literalchar): Use warns, not warni.
23386
233871997-06-28 Richard Stallman <rms@gnu.org>
23388
23389 * src/bison.s1: Add a Bison version comment.
23390
23391 * src/main.c (fatal, warn, berror):
23392 Use program_name.
23393
233941997-06-28 Richard Stallman <rms@gnu.org>
23395
23396 * Makefile.in (bison_version): New variable.
23397 (dist): Use that variable.
23398 (bison.s1): Substitute the Bison version into bison.simple.
23399
23400 * bison.simple: Add a Bison version comment.
23401
234021997-06-18 Richard Stallman <rms@gnu.org>
23403
23404 * src/main.c (fatal, warn, berror):
23405 Make error messages standard.
23406 (toomany): Improve error message text.
23407
23408 * 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:
23409 new.h renamed to alloc.h.
23410
234111997-06-18 Richard Stallman <rms@gnu.org>
23412
23413 * Makefile.in: new.h renamed to alloc.h.
23414
234151997-05-24 Richard Stallman <rms@gnu.org>
23416
23417 * src/lex.c (literalchar):
23418 Fix the code for escaping \, " and '.
23419
23420 (lex): Avoid trouble when there are many chars
23421 to discard in a char literal with just several chars in it.
23422
234231997-05-17 Richard Stallman <rms@gnu.org>
23424
23425 * src/bison.s1:
23426 Use malloc, if using alloca is troublesome.
23427 (YYSTACK_USE_ALLOCA): New flag macro.
23428 Define it for some systems and compilers.
23429 (YYSTACK_ALLOC): New macro.
23430 (yyparse): Use YYSTACK_ALLOC to allocate stack.
23431 If it was malloc'd, free it.
23432
234331997-05-17 Richard Stallman <rms@gnu.org>
23434
23435 * bison.simple:
23436 Use malloc, if using alloca is troublesome.
23437 (YYSTACK_USE_ALLOCA): New flag macro.
23438 Define it for some systems and compilers.
23439 (YYSTACK_ALLOC): New macro.
23440 (yyparse): Use YYSTACK_ALLOC to allocate stack.
23441 If it was malloc'd, free it.
23442
234431997-04-23 Richard Stallman <rms@gnu.org>
23444
23445 * src/bison.s1:
23446 (alloca) [__hpux]: Always define as __builtin_alloca.
23447
234481997-04-23 Richard Stallman <rms@gnu.org>
23449
23450 * bison.simple:
23451 (alloca) [__hpux]: Always define as __builtin_alloca.
23452
234531997-04-22 Richard Stallman <rms@gnu.org>
23454
23455 * src/bison.s1:
23456 [__hpux]: Include alloca.h (right for HPUX 10)
23457 instead of declaring alloca (right for HPUX 9).
23458
23459 * src/bison.s1 (__yy_memcpy):
23460 Declare arg `count' as unsigned int.
23461 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
23462
234631997-04-22 Richard Stallman <rms@gnu.org>
23464
23465 * bison.simple:
23466 [__hpux]: Include alloca.h (right for HPUX 10)
23467 instead of declaring alloca (right for HPUX 9).
23468
23469 * bison.simple (__yy_memcpy):
23470 Declare arg `count' as unsigned int.
23471 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
23472
234731997-01-03 Richard Stallman <rms@gnu.org>
23474
23475 * src/allocate.c: [__STDC__ or _MSC_VER]:
23476 Declare calloc and realloc to return void *.
23477
234781997-01-02 Richard Stallman <rms@gnu.org>
23479
23480 * src/system.h:
23481 [_MSC_VER]: Include stdlib.h and process.h.
23482 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
23483
23484 * src/main.c (main): Return FAILURE as a value.
23485 (printable_version): Declare arg as int, not char.
23486
234871997-01-02 Richard Stallman <rms@gnu.org>
23488
23489 * Makefile.in (dist):
23490 Explicitly check for symlinks, and copy them.
23491
234921996-12-19 Richard Stallman <rms@gnu.org>
23493
23494 * src/files.c:
23495 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
23496
234971996-12-18 Paul Eggert <eggert@gnu.org>
23498
23499 * src/bison.s1 (yyparse):
23500 If __GNUC__ and YYPARSE_PARAM are both defined,
23501 declare yyparse to have a void * argument.
23502
235031996-12-18 Paul Eggert <eggert@gnu.org>
23504
23505 * bison.simple (yyparse):
23506 If __GNUC__ and YYPARSE_PARAM are both defined,
23507 declare yyparse to have a void * argument.
23508
235091996-12-17 Richard Stallman <rms@gnu.org>
23510
23511 * src/reduce.c (nbits): Add some casts.
23512
235131996-08-12 Richard Stallman <rms@gnu.org>
23514
23515 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
23516
235171996-08-12 Richard Stallman <rms@gnu.org>
23518
23519 * bison.simple: Test _MSDOS as well as _MSDOS_.
23520
235211996-07-31 Richard Stallman <rms@gnu.org>
23522
23523 * src/bison.s1:
23524 [__sun && __i386]: Include alloca.h.
23525
235261996-07-31 Richard Stallman <rms@gnu.org>
23527
23528 * bison.simple:
23529 [__sun && __i386]: Include alloca.h.
23530
235311996-07-30 Richard Stallman <rms@gnu.org>
23532
23533 * src/bison.s1: Comment change.
23534
23535 * src/bison.s1: Test _MSDOS_, not MSDOS.
23536
235371996-07-30 Richard Stallman <rms@gnu.org>
23538
23539 * bison.simple: Comment change.
23540
23541 * bison.simple: Test _MSDOS_, not MSDOS.
23542
235431996-06-01 Richard Stallman <rms@gnu.org>
23544
23545 * 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:
23546 Insert `_' macro around many string constants.
23547
23548 * src/main.c:
23549 Insert `_' macro around many string constants.
23550
23551 (main): Call setlocale, bindtextdomain and textdomain.
23552
23553 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
23554 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
23555 [ENABLE_NLS]: Include libintl.h.
23556 [ENABLE_NLS] (gettext): Define.
23557 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
23558 (N_, PACKAGE, LOCALEDIR): New macros.
23559
235601996-06-01 Richard Stallman <rms@gnu.org>
23561
23562 * POTFILES.in: New file.
23563
23564 * Makefile.in (allocate.o):
23565 Define target explicitly.
23566
23567 * Makefile.in (CFLAGS): Set to @CFLAGS@.
23568 (LDFLAGS): Set to @LDFLAGS@.
23569 (configure): Run autoconf only if preceding `cd' succeeds.
23570 (bison.s1): Redirect output to temporary file then move the
23571 temporary to the target, rather than redirecting directly to bison.s1.
23572 (clean): Remove config.status and config.log.
23573 (distclean): Don't remove config.status here.
23574
235751996-05-12 Richard Stallman <rms@gnu.org>
23576
23577 * src/bison.s1:
23578 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
23579
235801996-05-12 Richard Stallman <rms@gnu.org>
23581
23582 * bison.simple:
23583 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
23584
235851996-05-11 Richard Stallman <rms@gnu.org>
23586
23587 * src/bison.s1 (__yy_memcpy):
23588 Really reorder the args, as was supposedly done on Feb 14 1995.
23589 (yyparse): Calls changed accordingly.
23590
235911996-05-11 Richard Stallman <rms@gnu.org>
23592
23593 * Makefile.in (dist): Don't use $(srcdir).
23594
23595 * bison.simple (__yy_memcpy):
23596 Really reorder the args, as was supposedly done on Feb 14 1995.
23597 (yyparse): Calls changed accordingly.
23598
235991996-01-27 Richard Stallman <rms@gnu.org>
23600
23601 * src/output.c (output_rule_data):
23602 Test YYERROR_VERBOSE in the conditional
23603 around the definition of ttyname.
23604
236051995-12-29 Richard Stallman <rms@gnu.org>
23606
23607 * src/bison.s1:
23608 Fix line numbers in #line commands.
23609
236101995-12-29 Richard Stallman <rms@gnu.org>
23611
23612 * bison.simple:
23613 Fix line numbers in #line commands.
23614
236151995-12-27 Richard Stallman <rms@gnu.org>
23616
23617 * src/bison.s1 (YYPARSE_PARAM_DECL):
23618 In C++, make it always null.
23619 (YYPARSE_PARAM_ARG): New macro.
23620 (yyparse): Use YYPARSE_PARAM_ARG.
23621
236221995-12-27 Richard Stallman <rms@gnu.org>
23623
23624 * bison.simple (YYPARSE_PARAM_DECL):
23625 In C++, make it always null.
23626 (YYPARSE_PARAM_ARG): New macro.
23627 (yyparse): Use YYPARSE_PARAM_ARG.
23628
236291995-11-29 Richard Stallman <rms@gnu.org>
23630
23631 * doc/bison.texinfo:
23632 Describe literal string tokens, %raw, %no_lines, %token_table.
23633
236341995-11-29 Daniel Hagerty <hag@gnu.org>
23635
23636 * doc/bison.texinfo: Fixed update date
23637
236381995-10-16 Richard Stallman <rms@gnu.org>
23639
23640 * src/version.c: Version 1.25.
23641
236421995-10-16 Richard Stallman <rms@gnu.org>
23643
23644 * NEWS: *** empty log message ***
23645
236461995-10-16 Richard Stallman <rms@gnu.org>
23647
23648 * doc/bison.1, doc/bison.rnh:
23649 Add new options.
23650
236511995-10-15 Richard Stallman <rms@gnu.org>
23652
23653 * src/vmsgetargs.c, src/getargs.c:
23654 Added -n, -k, and -raw switches.
23655 (noparserflag, toknumflag, rawtoknumflag): New variables.
23656
23657 * src/symtab.h (SALIAS):
23658 New #define for adding aliases to %token.
23659 (struct bucket): Added `alias' field.
23660
23661 * src/reduce.c (reduce_grammar):
23662 Revise error message.
23663 (print_notices): Remove final `.' from error message.
23664
23665 * src/reader.c (reader_output_yylsp):
23666 New function.
23667 (readgram): Use `#if 0' around code that accepted %command
23668 inside grammar rules: The documentation doesn't allow it,
23669 and it will fail since the %command processors scan for the next %.
23670 (parse_token_decl): Extended the %token
23671 declaration to allow a multi-character symbol as an alias.
23672 (parse_thong_decl): New function.
23673 (read_declarations): Added %thong declarations.
23674 (read_declarations): Handle NOOP to deal with allowing
23675 % declarations as another means to specify the flags.
23676 (readgram): Allow %prec prior to semantics embedded in a rule.
23677 (skip_to_char, read_declarations, copy_definition)
23678 (parse_token_decl, parse_start_decl, parse_type_decl)
23679 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
23680 (get_type_name, copy_guard, copy_action, readgram)
23681 (get_type, packsymbols): Revised most error messages.
23682 Changed `fatal' to `warnxxx' to avoid aborting for error.
23683 Revised and use multiple warnxxx functions to avoid using VARARGS1.
23684 (read_declarations): Improve the error message for
23685 an invalid character. Do not abort.
23686 (read_declarations, copy_guard, copy_action): Use
23687 printable_version to avoid unprintable characters in printed output.
23688 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
23689 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
23690 Allow the type of a non-terminal can be given
23691 more than once, as long as all specifications give the same type.
23692
23693 * src/output.c:
23694 (output_headers, output_trailers, output, output_gram)
23695 (output_rule_data): Implement noparserflag variable.
23696 Implement toknumflag variable.
23697 (output): Call reader_output_yylsp to output LTYPESTR.
23698
23699 * src/main.c (main):
23700 If reader sees an error, don't process the grammar.
23701 (fatals): Updated to not use VARARGS1.
23702 (printable_version, int_to_string, warn, warni, warns, warnss)
23703 (warnsss): New error reporting functions. Avoid abort for error.
23704
23705 * src/lex.h:
23706 Added THONG and NOOP for alias processing.
23707 Added SETOPT for the new code that allows setting options with %flags.
23708
23709 * src/lex.c:
23710 Include getopt.h. Add some extern decls.
23711 (safegetc): New function to deal with EOF gracefully.
23712 (literalchar); new function to deal with reading \ escapes.
23713 (lex): Use literalchar.
23714 (lex): Implemented "..." tokens.
23715 (literalchar, lex, parse_percent_token): Made tokenbuffer
23716 always contain the token. This includes growing the token
23717 buffer while reading an integer.
23718 (parse_percent_token): Replaced if-else statement with percent_table.
23719 (parse_percent_token): Added % declarations as another
23720 way to specify the flags -n, -l, and -r. Also added hooks for
23721 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
23722 major changes to files.c.
23723 (lex) Retain in the incoming stream a character following
23724 an incorrect '/'.
23725 (skip_white_space, lex): Revised most error messages
23726 and changed fatal to warn to avoid aborting.
23727 (percent_table): Added %thong declarations.
23728
23729 * src/gram.h: Comment changes.
23730
23731 * src/files.c (openfiles, open_extra_files, done):
23732 Add faction flag
23733 and actfile file. Handle noparserflag. Both for -n switch.
23734
23735 * src/conflicts.c (resolve_sr_conflict):
23736 Remove use of alloca.
23737
237381995-06-01 Jim Meyering <meyering@gnu.org>
23739
23740 * doc/bison.texinfo: *** empty log message ***
23741
237421995-05-06 Richard Stallman <rms@gnu.org>
23743
23744 * src/bison.s1: Comment change.
23745
237461995-05-06 Richard Stallman <rms@gnu.org>
23747
23748 * bison.simple: Comment change.
23749
237501995-05-03 Richard Stallman <rms@gnu.org>
23751
23752 * src/version.c: Version now 1.24.
23753
23754 * src/bison.s1: Change distribution terms.
23755
23756 * src/version.c: Version now 1.23.
23757
237581995-05-03 Richard Stallman <rms@gnu.org>
23759
23760 * doc/bison.texinfo:
23761 Rewrite "Conditions for Using Bison".
23762 Update version to 1.24.
23763
237641995-05-03 Richard Stallman <rms@gnu.org>
23765
23766 * bison.simple: Change distribution terms.
23767
237681995-02-23 Richard Stallman <rms@gnu.org>
23769
23770 * src/files.c: Test __VMS_POSIX as well as VMS.
23771
237721995-02-14 Jim Meyering <meyering@gnu.org>
23773
23774 * src/bison.s1 (__yy_memcpy):
23775 Renamed from __yy_bcopy to avoid
23776 confusion. Reverse FROM and TO arguments to be consistent with
23777 those of memcpy.
23778
237791995-02-14 Jim Meyering <meyering@gnu.org>
23780
23781 * bison.simple (__yy_memcpy):
23782 Renamed from __yy_bcopy to avoid
23783 confusion. Reverse FROM and TO arguments to be consistent with
23784 those of memcpy.
23785
237861994-11-10 David J. MacKenzie <djm@gnu.org>
23787
23788 * NEWS: reformat
23789
23790 * NEWS: New file.
23791
23792 * Makefile.in (DISTFILES): Include NEWS.
23793
23794 * Makefile.in (DISTFILES):
23795 Include install-sh, not install.sh.
23796
23797 * configure.in: Update to Autoconf v2 macro names.
23798
237991994-10-05 David J. MacKenzie <djm@gnu.org>
23800
23801 * Makefile.in: fix typo
23802
23803 * Makefile.in (prefix, exec_prefix):
23804 Let configure set them.
23805
238061994-09-28 David J. MacKenzie <djm@gnu.org>
23807
23808 * Makefile.in: Set datadir to $(prefix)/share.
23809
238101994-09-15 Richard Stallman <rms@gnu.org>
23811
23812 * src/bison.s1:
23813 Update copyright notice and GPL version.
23814
238151994-09-15 Richard Stallman <rms@gnu.org>
23816
23817 * bison.simple:
23818 Update copyright notice and GPL version.
23819
238201994-07-12 Richard Stallman <rms@gnu.org>
23821
23822 * src/reduce.c, src/reader.c:
23823 entered into RCS
23824
238251994-05-05 David J. MacKenzie <djm@gnu.org>
23826
23827 * Makefile.in: entered into RCS
23828
238291994-03-26 Richard Stallman <rms@gnu.org>
23830
23831 * src/bison.s1: entered into RCS
23832
238331994-03-26 Richard Stallman <rms@gnu.org>
23834
23835 * bison.simple: entered into RCS
23836
238371994-03-25 Richard Stallman <rms@gnu.org>
23838
23839 * src/main.c: entered into RCS
23840
238411994-03-24 Richard Stallman <rms@gnu.org>
23842
23843 * src/conflicts.c: entered into RCS
23844
238451994-01-02 Richard Stallman <rms@gnu.org>
23846
23847 * Makefile.in: *** empty log message ***
23848
238491993-11-21 Richard Stallman <rms@gnu.org>
23850
23851 * src/bison.s1: *** empty log message ***
23852
238531993-11-21 Richard Stallman <rms@gnu.org>
23854
23855 * doc/bison.texinfo: entered into RCS
23856
23857 * doc/bison.texinfo: *** empty log message ***
23858
238591993-11-21 Richard Stallman <rms@gnu.org>
23860
23861 * bison.simple: *** empty log message ***
23862
238631993-10-25 David J. MacKenzie <djm@gnu.org>
23864
23865 * doc/bison.texinfo: *** empty log message ***
23866
238671993-10-19 Richard Stallman <rms@gnu.org>
23868
23869 * src/bison.s1: *** empty log message ***
23870
238711993-10-19 Richard Stallman <rms@gnu.org>
23872
23873 * bison.simple: *** empty log message ***
23874
238751993-10-14 Richard Stallman <rms@gnu.org>
23876
23877 * src/bison.s1: *** empty log message ***
23878
238791993-10-14 Richard Stallman <rms@gnu.org>
23880
23881 * bison.simple: *** empty log message ***
23882
238831993-09-14 David J. MacKenzie <djm@gnu.org>
23884
23885 * doc/bison.texinfo: *** empty log message ***
23886
238871993-09-13 Noah Friedman <friedman@gnu.org>
23888
23889 * Makefile.in: *** empty log message ***
23890
238911993-09-10 Richard Stallman <rms@gnu.org>
23892
23893 * src/conflicts.c: *** empty log message ***
23894
23895 * src/system.h: entered into RCS
23896
238971993-09-10 Richard Stallman <rms@gnu.org>
23898
23899 * doc/bison.1: entered into RCS
23900
239011993-09-06 Noah Friedman <friedman@gnu.org>
23902
23903 * src/version.c: entered into RCS
23904
239051993-09-06 Noah Friedman <friedman@gnu.org>
23906
23907 * Makefile.in: *** empty log message ***
23908
239091993-07-30 David J. MacKenzie <djm@gnu.org>
23910
23911 * Makefile.in: *** empty log message ***
23912
239131993-07-24 Richard Stallman <rms@gnu.org>
23914
23915 * src/bison.s1: *** empty log message ***
23916
239171993-07-24 Richard Stallman <rms@gnu.org>
23918
23919 * bison.simple: *** empty log message ***
23920
239211993-07-08 David J. MacKenzie <djm@gnu.org>
23922
23923 * Makefile.in: *** empty log message ***
23924
239251993-07-04 Richard Stallman <rms@gnu.org>
23926
23927 * src/bison.s1: *** empty log message ***
23928
239291993-07-04 Richard Stallman <rms@gnu.org>
23930
23931 * bison.simple: *** empty log message ***
23932
239331993-06-26 David J. MacKenzie <djm@gnu.org>
23934
23935 * src/getargs.c: entered into RCS
23936
239371993-06-26 David J. MacKenzie <djm@gnu.org>
23938
23939 * doc/bison.texinfo: *** empty log message ***
23940
23941 * doc/bison.1: New file.
23942
239431993-06-25 Richard Stallman <rms@gnu.org>
23944
23945 * src/getargs.c: New file.
23946
239471993-06-16 Richard Stallman <rms@gnu.org>
23948
23949 * src/bison.s1: *** empty log message ***
23950
239511993-06-16 Richard Stallman <rms@gnu.org>
23952
23953 * bison.simple: *** empty log message ***
23954
239551993-06-03 Richard Stallman <rms@gnu.org>
23956
23957 * src/bison.s1: New file.
23958
239591993-06-03 Richard Stallman <rms@gnu.org>
23960
23961 * doc/bison.texinfo: *** empty log message ***
23962
239631993-06-03 Richard Stallman <rms@gnu.org>
23964
23965 * bison.simple: New file.
23966
239671993-05-19 Richard Stallman <rms@gnu.org>
23968
23969 * doc/bison.texinfo: New file.
23970
239711993-05-07 Noah Friedman <friedman@gnu.org>
23972
23973 * Makefile.in: *** empty log message ***
23974
239751993-04-28 Noah Friedman <friedman@gnu.org>
23976
23977 * src/reader.c: *** empty log message ***
23978
239791993-04-23 Noah Friedman <friedman@gnu.org>
23980
23981 * src/alloc.h: entered into RCS
23982
239831993-04-20 David J. MacKenzie <djm@gnu.org>
23984
23985 * src/version.c: *** empty log message ***
23986
23987 * src/files.c, src/allocate.c:
23988 entered into RCS
23989
23990 * src/reader.c: *** empty log message ***
23991
23992 * src/lex.c: entered into RCS
23993
23994 * src/conflicts.c: New file.
23995
23996 * src/symtab.c: entered into RCS
23997
23998 * src/alloc.h: New file.
23999
24000 * src/LR0.c: entered into RCS
24001
240021993-04-18 Noah Friedman <friedman@gnu.org>
24003
24004 * src/reader.c: New file.
24005
24006 * src/version.c: *** empty log message ***
24007
240081993-04-18 Noah Friedman <friedman@gnu.org>
24009
24010 * Makefile.in: *** empty log message ***
24011
240121993-04-17 Noah Friedman <friedman@gnu.org>
24013
24014 * Makefile.in: *** empty log message ***
24015
240161993-04-15 Richard Stallman <rms@gnu.org>
24017
24018 * src/main.c, src/files.c:
24019 New file.
24020
240211993-04-15 Noah Friedman <friedman@gnu.org>
24022
24023 * configure.in: entered into RCS
24024
24025 * configure.in: *** empty log message ***
24026
24027 * configure.in: New file.
24028
240291993-04-14 Richard Stallman <rms@gnu.org>
24030
24031 * Makefile.in: New file.
24032
240331993-04-13 Richard Stallman <rms@gnu.org>
24034
24035 * src/version.c: New file.
24036
240371993-03-25 Richard Stallman <rms@gnu.org>
24038
24039 * src/output.c: entered into RCS
24040
240411992-09-25 Richard Stallman <rms@gnu.org>
24042
24043 * configure.bat: entered into RCS
24044
240451992-06-22 Richard Stallman <rms@gnu.org>
24046
24047 * src/vmsgetargs.c: entered into RCS
24048
240491992-06-22 Richard Stallman <rms@gnu.org>
24050
24051 * doc/bison.rnh: entered into RCS
24052
240531992-04-20 David J. MacKenzie <djm@gnu.org>
24054
24055 * README: entered into RCS
24056
240571992-01-22 Richard Stallman <rms@gnu.org>
24058
24059 * src/machine.h: entered into RCS
24060
240611991-12-21 Richard Stallman <rms@gnu.org>
24062
24063 * src/lalr.c, src/closure.c:
24064 entered into RCS
24065
240661991-12-20 Richard Stallman <rms@gnu.org>
24067
24068 * src/state.h: entered into RCS
24069
240701991-12-18 Richard Stallman <rms@gnu.org>
24071
24072 * src/print.c, src/nullable.c, src/derives.c:
24073 entered into RCS
24074
240751991-11-03 David J. MacKenzie <djm@gnu.org>
24076
24077 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
24078 entered into RCS
24079
240801988-09-09 Richard Stallman <rms@gnu.org>
24081
24082 * src/bison.hairy: entered into RCS
24083
240841987-12-16 Richard Stallman <rms@gnu.org>
24085
24086 * REFERENCES: entered into RCS
dc546b0f 24087
f294a2c2 24088
04098407 24089 -----
f294a2c2 24090
ea0a7676
JD
24091 Copyright (C) 1987-1988, 1991-2011 Free Software Foundation,
24092 Inc.
f294a2c2 24093
04098407
PE
24094 Copying and distribution of this file, with or without
24095 modification, are permitted provided the copyright notice and this
24096 notice are preserved.