]> git.saurik.com Git - bison.git/blame - ChangeLog
Don't use IF_LINT in Bison sources.
[bison.git] / ChangeLog
CommitLineData
77bb73e7
JD
12011-05-14 Joel E. Denny <joeldenny@joeldenny.org>
2
3 Don't use IF_LINT in Bison sources.
4 It creates unnecessary differences between the sources that Bison
5 maintainers build and test (given that maintainers normally
6 configure with --enable-gcc-warnings) and the sources that Bison
7 users build. Instead, use PACIFY_CC, which doesn't. This change
8 fixes compiler warnings reported by Tys Lefering at
9 <http://lists.gnu.org/archive/html/bison-patches/2011-05/msg00004.html>.
10 * configure.ac: Don't AC_DEFINE lint regardless of the configure
11 options. This change affects imported gnulib sources, where
12 IF_LINT still appears and depends on lint.
13 * src/scan-gram.l, src/scan-skel.l: Replace uses of IF_LINT with
14 PACIFY_CC.
15 * src/system.h (IF_LINT): Remove cpp macro.
16 (PACIFY_CC): New cpp macro.
17
9d6af153
JD
182011-05-01 Joel E. Denny <joeldenny@joeldenny.org>
19
20 Fix precedence for end token.
21 Since Bison 2.3b, which restored the ability of precedence
22 directives to assign user token numbers, doing so for user token
23 number 0 has produced an assertion failure.
24 * NEWS (2.5): Document fix.
25 * src/symtab.c (symbol_user_token_number_set): In the case of the
26 end token, don't decrement ntokens if it was never incremented.
27 * tests/regression.at (Token number in precedence declaration):
28 Extend.
29
44173502
JD
302011-05-01 Joel E. Denny <joeldenny@joeldenny.org>
31
32 Prepare for 2.5 release.
33 * NEWS (2.5_rc1): Rename back to...
34 (2.5): ... this, and unset date.
35
1e811aac
JD
362011-05-01 Joel E. Denny <joeldenny@joeldenny.org>
37
38 Version 2.5_rc1.
39 * NEWS (2.5): Rename to...
40 (2.5_rc1): ... this, and set date.
41
d143e9c3
JD
422011-05-01 Joel E. Denny <joeldenny@joeldenny.org>
43
44 Pacify -DGNULIB_POSIXCHECK.
45 * bootstrap.conf (gnulib_modules): Add all modules suggested by
46 -DGNULIB_POSIXCHECK.
47 * src/files.c (file_name_split)
48 * src/getargs.c (getargs)
49 * src/location.c (boundary_set_from_string)
50 * src/output.c (token_definitions_output, output_skeleton)
51 * src/parse-gram.y (prologue_declaration)
52 * src/scan-gram.l (handle_syncline)
53 * src/symtab.c (symbol_new): Use mbschr and mbsrchr instead of
54 strchr and strrchr. In the cases of command-line options, file
55 names, and thus locations, functionality may be improved. In the
56 case of symbol names, there should be no functional difference as
57 all characters are ASCII, so the intended benefit is just warning
58 suppression.
59
723206df
JD
602011-05-01 Joel E. Denny <joeldenny@joeldenny.org>
61
62 * NEWS (2.5): Fix minor typos.
63
ac3297d5
JD
642011-05-01 Joel E. Denny <joeldenny@joeldenny.org>
65
66 doc: clean up quotation style in NEWS.
67 * NEWS (2.5): For multi-character tokens in example grammar rules,
68 use "token" not 'token'. In English, use a consistent quotation
69 style; we might as well follow the precedent seen in info pages:
70 `quote' not "quote".
71
c9e2da4f
JD
722011-04-16 Joel E. Denny <joeldenny@joeldenny.org>
73
74 tests: pacify gcc 4.6.0's -Wunused-but-set-variable.
75 Reported by Jim Meyering at
76 <http://lists.gnu.org/archive/html/bug-bison/2011-04/msg00002.html>.
77 * tests/actions.at
78 (Default %printer and %destructor for mid-rule values): Define
79 YYLLOC_DEFAULT so that it uses its Rhs argument.
80
55dd3563
JD
812011-04-16 Joel E. Denny <joeldenny@joeldenny.org>
82
83 glr.c: omit yyresolveLocations when locations are disabled.
84 This prevents gcc 4.6.0's -Wunused-but-set-variable from warning
85 about yyresolveLocations's local yyrhsloc. When locations are
86 enabled, there's no such warning because YYLLOC_DEFAULT then uses
87 yyrhsloc. Reported by Jim Meyering at
88 <http://lists.gnu.org/archive/html/bug-bison/2011-04/msg00002.html>.
89 * data/glr.c (yyresolveLocations): Omit definition when locations
90 are disabled.
91 (yyresolveValue): Omit yyresolveLocations invocation when
92 locations are disabled.
93
a898435b
JD
942011-04-16 Joel E. Denny <joeldenny@joeldenny.org>
95
96 gnulib, autoconf: update.
97 * README-hacking (Updating a submodule): Give advice on how to
98 determine the versions of gnulib and autoconf to which we should
99 update.
100 (Release Procedure): Note that submodules should be updated.
101 * bootstrap.conf (gnulib_modules): Rename pipe to spawn-pipe as
102 suggested in updated gnulib NEWS.
103 * gnulib: Choose a stable snapshot according to advice in Bison's
104 README-hacking.
105 * po/POTFILES.in (lib/pipe.c): Rename to...
106 (lib/spawn-pipe.c): ... this.
107 * src/output.c: Update to include spawn-pipe.h.
108 * submodules/autoconf: Update to latest for improvement in m4.m4
109 that excludes M4 with buggy strstr. The only other changes to
110 files that we use are copyright updates.
111
fea2d6b0
JD
1122011-04-09 Joel E. Denny <joeldenny@joeldenny.org>
113
114 Fix missing updates to GPLv3.
115 Reported by Tys Lefering at
116 <http://lists.gnu.org/archive/html/bison-patches/2011-04/msg00000.html>.
117 * src/print-xml.c, src/print-xml.h: In these files.
118
6f8bdce2
JD
1192011-03-27 Joel E. Denny <joeldenny@joeldenny.org>
120
121 Add -Wconflicts-sr and -Wconflicts-rr.
122 Thus, conflict reports are now affected by -Werror and -Wnone
123 (unless %expect or %expect-rr is specified). Reported by George
124 Neuner at
125 <http://lists.gnu.org/archive/html/bug-bison/2010-08/msg00002.html>.
126 * NEWS (2.5): Document.
127 * doc/bison.texinfo (Bison Options): Document.
128 * src/complain.c, src/complain.h (set_warning_issued): Export
129 function.
130 * src/conflicts.c (conflicts_print): Suppress conflict report
131 based on -Wno-conflicts-sr and -Wno-conflicts-rr, and treat
132 conflicts as errors if -Werror.
133 * src/getargs.c (warnings_flag): Initialize with
134 warnings_conflicts_sr and warnings_conflicts_rr as well.
135 (warnings_args, warnings_types): Add entries for
136 warnings_conflicts_sr and warnings_conflicts_rr.
137 (usage): Update.
138 * src/getargs.h (enum warnings): Add entries for
139 warnings_conflicts_sr and warnings_conflicts_rr.
140 * tests/conflicts.at (-W versus %expect and %expect-rr): New test
141 group.
142 * tests/local.at (AT_BISON_CHECK_NO_XML): Update now that the
143 conflict report can produce a "warnings being treated as errors"
144 message. Also, check that stderr is now fully scrubbed by -Wnone
145 when the exit status is 0.
146
fc7ce997
JD
1472011-03-27 Joel E. Denny <joeldenny@joeldenny.org>
148
149 Pacify maintainer-check-posix.
150 Adding command-line options after the grammar file name is not
151 permitted, so disable checks that do that when
152 maintainer-check-posix is running.
153 * tests/local.at (AT_BISON_CHECK_NO_XML): Don't run the
154 problematic checks when POSIXLY_CORRECT=1. Also, for readability,
155 remove an unnecessary m4_if.
156
8ffd7912
JD
1572011-03-27 Joel E. Denny <joeldenny@joeldenny.org>
158
159 Add -Wother so -Wnone suppresses all warnings.
160 Reported by George Neuner at
161 <http://lists.gnu.org/archive/html/bug-bison/2010-08/msg00002.html>.
162 * NEWS (2.5): Document.
163 * THANKS (George Neuner): Add.
164 * doc/bison.texinfo (Bison Options): Document.
165 * src/complain.c, src/complain.h
166 (warn_at, warn_at_indent, warn): Suppress warning if -Wno-other.
167 (midrule_value_at): New warning function, similar to yacc_at in
168 that it's controlled by its own warning category.
169 * src/getargs.c (warnings_flag): Initialize to warnings_other.
170 (warnings_args, warnings_types): Add entry for warnings_other.
171 (usage): Update.
172 * src/getargs.h (enum warnings): Add entry for warnings_other.
173 * src/gram.c (grammar_rules_useless_report): If -Wno-other, then
174 don't print useless rules.
175 * src/reader.c (symbol_should_be_used): Rather than adjusting the
176 return value based on whether midrule value warnings are enabled,
177 accept a new parameter for telling the caller whether true is
178 being returned for a potential midrule warning.
179 (grammar_rule_check): Use midrule_value_at for midrule value
180 warnings, and continue to use warn_at for all other warnings. Let
181 them check whether the warnings are enabled.
182 * tests/local.at (AT_BISON_CHECK): Update documentation.
183 (AT_BISON_CHECK_NO_XML): Check that -Wnone and --warnings=none
184 disable all warnings exercised in the test suite.
185
dab96632
JD
1862011-03-27 Joel E. Denny <joeldenny@joeldenny.org>
187
188 Don't let -Wnone disable -Werror.
189 Discussed at
190 <http://lists.gnu.org/archive/html/bison-patches/2010-08/msg00009.html>.
191 * NEWS (2.5): Document.
192 * src/getargs.c (flags_argmatch): Accept a new argument that
193 specifies what flags "all" and thus "none" affect.
194 (FLAGS_ARGMATCH): Update flags_argmatch invocation.
195 * tests/input.at (-Werror is not affected by -Wnone and -Wall):
196 New test group.
197
248dba53
JD
1982011-03-27 Joel E. Denny <joeldenny@joeldenny.org>
199
200 * NEWS (2.5): Document fix for -Wno-CATEGORY.
201
20cc7149
DJ
2022008-11-21 Di-an Jan <dianj@freeshell.org>
203
204 Implement no-XXX arguments for --warnings, --report, --trace.
205 * src/getargs.c (flags_argmatch): Handles no-XXX.
206 Fix typo in doxygen comment.
207
56706c61
JD
2082011-03-20 Joel E. Denny <joeldenny@joeldenny.org>
209
210 doc: fix confusing citation of LAC publication.
211 Suggested by Akim Demaille.
212 * doc/bison.texinfo (LAC): Here.
213
a6e5a280
JD
2142011-03-20 Joel E. Denny <joeldenny@joeldenny.org>
215
216 lr.default-reductions: rename "full" value to "most".
217 Unlike "consistent" and "accepting", "full" doesn't answer the
218 question of "which states".
219 * doc/bison.texinfo (%define Summary): Update.
220 (Default Reductions): Update.
221 * src/print.c (print_reductions): Update.
222 * src/reader.c (prepare_percent_define_front_end_variables):
223 Update.
224 * src/tables.c (action_row): Update.
225 * tests/input.at (%define enum variables): Update.
226 * tests/reduce.at (%define lr.default-reductions): Update.
227
49e8e901
JD
2282011-03-13 Joel E. Denny <joeldenny@joeldenny.org>
229
230 * src/parse-gram.c, src/parse-gram.h: Regenerate.
231
8f462efe
AD
2322011-03-09 Akim Demaille <akim@lrde.epita.fr>
233
234 named references: fix double free.
235 In `rhs[name]: "a" | "b"', do not free "name" twice.
236 Reported by Tys Lefering.
237 <http://lists.gnu.org/archive/html/bug-bison/2010-06/msg00002.html>
238 * src/named-ref.h, src/named-ref.c (named_ref_copy): New.
239 * src/parse-gram.y (current_lhs): Rename as...
240 (current_lhs_symbol): this.
241 (current_lhs): New function. Use it to free the current lhs
242 named reference.
243 * src/reader.c: Bind lhs to a copy of the current named reference.
244 * src/symlist.c: Rely on free (0) being valid.
245 * tests/named-refs.at: Test this.
246
686e83e3
AD
2472011-03-09 Akim Demaille <akim@lrde.epita.fr>
248
249 tests: style changes.
250 * tests/named-refs.at (Redundant words in LHS brackets)
251 (Unresolved references): here.
252
f0e2c228
JD
2532011-03-06 Joel E. Denny <joeldenny@joeldenny.org>
254
255 java: fix parser tracing bug.
256 * NEWS (2.5): Document.
257 * data/lalr1.java (YYParser::YYStack::print): Don't skip top
258 element.
259
4c2a6e42
JD
2602011-03-06 Joel E. Denny <joeldenny@joeldenny.org>
261
262 java: finish fixing parser stack popping bug.
263 * NEWS (2.5): Document.
264 * data/lalr1.java (YYParser::YYStack::pop): Fix off-by-one error
265 in clearing the location stack. Also fix pop function that
266 accepts no arguments.
267
6f75992b
AB
2682011-03-06 Angelo Borsotti <angelo.borsotti@gmail.com> (tiny change)
269
270 java: fix parser stack popping bug.
271 Reported at
272 <http://lists.gnu.org/archive/html/bug-bison/2011-02/msg00005.html>.
273 * THANKS (Angelo Borsotti): Add.
274 * data/lalr1.java (YYParser::YYStack::pop): Fix off-by-one error
275 in clearing the value stack. Previously, the top element of the
276 stack wasn't cleared and so the value was not garbage collected.
277
121c4982
JD
2782011-03-06 Joel E. Denny <joeldenny@joeldenny.org>
279
280 doc: cite publication for LAC.
281 * doc/bison.texinfo (LAC): Here.
282
5da0355a
JD
2832011-03-06 Joel E. Denny <joeldenny@joeldenny.org>
284
285 doc: clean up terminology for mysterious conflicts.
286 * doc/bison.texinfo (Mystery Conflicts): Rename node to...
287 (Mysterious Conflicts): ... this, which is already the section
288 title and the name used in the index. Update all cross-references
289 to this node. Also, don't imply that R/R conflicts are the only
290 kind of mysterious conflict.
291
d815ec4a
JD
2922011-03-06 Joel E. Denny <joeldenny@joeldenny.org>
293
294 lr.default-reductions: rename "all" value to "full".
295 States that shift the error token do not have default reductions,
296 and GLR disables some default reductions, so "all" was a misnomer.
297 * doc/bison.texinfo (%define Summary): Update.
298 (Default Reductions): Update.
299 * src/print.c (print_reductions): Update.
300 * src/reader.c (prepare_percent_define_front_end_variables):
301 Update.
302 * src/tables.c (action_row): Update.
303 * tests/input.at (%define enum variables): Update.
304 * tests/reduce.at (%define lr.default-reductions): Update.
305
6f04ee6c
JD
3062011-03-06 Joel E. Denny <joeldenny@joeldenny.org>
307
308 doc: create a new Tuning LR section in the manual.
309 And clean up all other documentation of the features described
310 there.
311 * NEWS (2.5): Tweak wording of lr.type and parse.lac entries a
312 bit, update the cross-references to the manual, and point out that
313 LAC has caveats. Don't be so adamant that IELR+LAC=canonical LR.
314 That is, as the referenced section in the manual documents, LAC
315 does not fix infinite parsing loops on syntax errors.
316 * doc/bison.texinfo: Consistently drop the "(1)" suffix from LALR,
317 IELR, and LR in @cindex.
318 (%define Summary): Condense the entries for lr.default-reductions,
319 lr.keep-unreachable-states, lr.type, and parse.lac into brief
320 summaries, and cross-reference the appropriate subsections of
321 Tuning LR. For parse.lac, mention that it's only implemented for
322 deterministic parsers in C.
323 (Error Reporting): When mentioning %error-verbose, mention LAC,
324 and add cross-reference to the LAC section.
325 (Tuning LR): New section with an extended version of the
326 documentation removed from %define Summary. Change all
327 cross-references in the manual to point here instead of there.
328 (Calc++ Parser): When mentioning %error-verbose, mention LAC, and
329 add cross-reference to the LAC section.
330 (Table of Symbols): In %error-verbose and YYERROR_VERBOSE entries,
331 add cross-references to Error Reporting.
332 (Glossary): Capitalize entry titles consistently. Add definitions
333 for "defaulted state" and "unreachable state". Expand IELR
334 acronym in IELR's entry.
335
71caec06
JD
3362011-02-20 Joel E. Denny <joeldenny@joeldenny.org>
337
338 doc: add bibliography to manual.
339 * doc/bison.texinfo (Mystery Conflicts): Cross-reference
340 bibliography instead of citing publications directly.
341 (Generalized LR Parsing): Likewise.
342 (Bibliography): New section. Not all entries are cross-referenced
343 yet, but that will come in future patches.
344
77768165
JD
3452011-02-19 Joel E. Denny <joeldenny@joeldenny.org>
346
347 java: test and document previous bug fix.
348 * NEWS (2.5): Document it.
349 * tests/java.at (_AT_DATA_JAVA_CALC_Y): To one of the yyerror
350 invocations, pass a location that spans multiple tokens. Change
351 yyerror to report all of a location rather than just the begin
352 position. Extend yylex and Position to count tokens on a line.
353 Remove getHashCode as it's unused. Update all expected output.
354
8db68289
BK
3552011-02-19 Bernd Kiefer <kiefer@dfki.de> (tiny change)
356
357 java: fix location handling bug.
358 Reported at
359 <http://lists.gnu.org/archive/html/bison-patches/2011-02/msg00005.html>.
360 * data/lalr1.java (YYParser::yylloc): For non-empty RHS, fix
361 reversed access to location stack.
362 * THANKS (Bernd Kiefer): Add.
363
f3103c5b
AD
3642010-05-11 Akim Demaille <demaille@gostai.com>
365
366 doc: please Emacs.
367 * doc/bison.texinfo (Local Variables): Move this after the
368 LocalWords, since the latter are looked for in the whole document,
369 while the former are looked for only at its end.
370 Require american spell checking.
371
406dec82
JD
3722011-02-06 Joel E. Denny <joeldenny@joeldenny.org>
373
374 doc: clean up new subsections in manual.
375 * doc/bison.texinfo (%define Summary): Reword so it reads well as
376 a separate section. For example, add an intro, and move most of
377 the text outside of the @deffn so it is not indented so far.
378 (%code Summary): Likewise.
379 (Table of Symbols): Reword %code entry to match the %code entry in
380 Decl Summary.
381
2f4518a1
JD
3822011-02-06 Joel E. Denny <joeldenny@joeldenny.org>
383
384 doc: finish splitting apart the manual's Decl Summary section.
385 Suggested by Akim Demaille at
386 <http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00013.html>.
387 * doc/bison.texinfo (Decl Summary): Extract most of the %define
388 entry into...
389 (%define Summary): ... this new subsection, and update all
390 cross-references. For readability of the patches, rewriting of
391 the text so it makes sense as a separate subsection will come in a
392 later patch. Moreover, the majority of the text describing the
393 various new LR features should likely move to another new section
394 somewhere.
395
8e6f2266
JD
3962011-02-06 Joel E. Denny <joeldenny@joeldenny.org>
397
398 doc: begin to split apart the manual's Decl Summary section.
399 Discussed in thread starting at
400 <http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00013.html>.
401 * doc/bison.texinfo (Decl Summary): Extract most of the %code
402 entry into...
403 (%code Summary): ... this new subsection, and update all
404 cross-references. For readability of the patches, rewriting of
405 the text so it makes sense as a separate subsection will come in a
406 later patch.
407
9913d6e4
JD
4082011-02-06 Joel E. Denny <joeldenny@joeldenny.org>
409
410 doc: clean up naming of various Bison files.
411 The Bison manual's names for various files associated with a Bison
412 parser has devolved into inconsistency. This patch makes the
413 naming consistent for the most important files. First, it chooses
414 "grammar file" over "input file". The former appears to be more
415 traditional in the Bison manual, and Bison has other input
416 files (skeletons). Second, it chooses "parser implementation
417 file" over names like "parser file", "parser source file", "parser
418 source code file", and "parser output file". The new name makes
419 it clearer where Bison generates the main parser implementation,
420 and it is easily distinguishable from "parser header file".
421 * doc/bison.texinfo: Implement throughout.
422
840341d6
JD
4232011-02-06 Joel E. Denny <joeldenny@joeldenny.org>
424
425 doc: give credit to more of Bison's developers.
426 * doc/bison.texinfo (Introduction): Don't imply that only Robert
427 Corbett, Richard Stallman, and Wilfred Hansen have contributed to
428 Bison. However, I don't have time to write a full history, so
429 just point readers to THANKS and ChangeLog.
430
d89e48b3
JD
4312011-02-06 Joel E. Denny <joeldenny@joeldenny.org>
432
433 doc: document experimental features better.
434 * doc/bison.texinfo (Introduction): Say that IELR(1) and canonical
435 LR(1) are experimental. Mention Java. Normally experimental
436 features probably shouldn't be mentioned in the introduction.
437 However, if Bison's limitations to LALR(1), C, and C++ are so
438 important that they should be mentioned here, then it's important
439 to point out that Bison is beginning to escape those limitations.
440 Moreover, these particular experimental features have very little
441 chance of being removed.
442 * src/getargs.c (usage): Say that IELR(1) and canonical LR(1) are
443 experimental.
444
eb8c66bb
JD
4452011-01-29 Joel E. Denny <joeldenny@joeldenny.org>
446
447 Do not allow identifiers that start with a dash.
448 This cleans up our previous fixes for a bug whereby Bison
449 discarded `.field' in `$-1.field'. The previous fixes were less
450 restrictive about where a dash could appear in an identifier, but
451 the restrictions were hard to explain. That bug was reported and
452 this final fix was originally suggested by Paul Hilfinger. This
453 also fixes a remaining bug reported by Paul Eggert whereby Bison
454 parses `%token ID -123' as `%token ID - 123' and handles `-' as an
455 identifier. Now, `-' cannot be an identifier. Discussed in
456 threads beginning at
457 <http://lists.gnu.org/archive/html/bug-bison/2011-01/msg00000.html>,
458 <http://lists.gnu.org/archive/html/bug-bison/2011-01/msg00004.html>.
459 * NEWS (2.5): Update entry describing the dash extension to
460 grammar symbol names. Also, move that entry before the named
461 references entry because the latter mentions the former.
462 * doc/bison.texinfo (Symbol): Update documentation for symbol
463 names. As suggested by Paul Eggert, mention the effect of periods
464 and dashes on named references.
465 (Decl Summary): Update documentation for unquoted %define values,
466 which, as a side effect, can no longer start with dashes either.
467 * src/scan-code.l (id): Implement.
468 * src/scan-gram.l (id): Implement.
469 * tests/actions.at (Exotic Dollars): Extend test group to exercise
470 bug reported by Paul Hilfinger.
471 * tests/input.at (Symbols): Update test group, and extend to
472 exercise bug reported by Paul Eggert.
473 * tests/named-refs.at (Stray symbols in brackets): Update test
474 group.
475 ($ or @ followed by . or -): Likewise.
476 * tests/regression.at (Invalid inputs): Likewise.
477
448dc38b
JD
4782011-01-24 Joel E. Denny <joeldenny@joeldenny.org>
479
480 * data/yacc.c: Fix last apostrophe warning from xgettext.
481
7e5ef706
PE
4822011-01-09 Paul Eggert <eggert@cs.ucla.edu>
483
484 Fix minor problems encountered by a fresh bootstrap.
485 * data/glr.c, data/yacc.c: Do not use apostrophes in '#' comments,
486 as they confuse xgettext, which tries to parse them as C character
487 constants in a preprocessor directive.
488 * data/yacc.c (yy_lac): Don't use printf %d format on *yyesp, as
489 that expression might not promote to int on some platforms.
490 * src/parse-gram.c, src/parse-gram.h: Regenerate.
491
8cbbf178
JD
4922011-01-09 Joel E. Denny <joeldenny@joeldenny.org>
493
494 Improve error messages for `$' or `@' followed by `.' or `-'.
495 Previously, for this special case of an invalid reference, the
496 usual "symbol not found in production:" was printed. However,
497 because the symbol name was parsed as the empty string, that
498 message was followed immediately by a newline instead of a symbol
499 name. In reality, this is a syntax error, so the reference is
500 invalid regardless of the symbols actually appearing in the
501 production. Discussed at
502 <http://lists.gnu.org/archive/html/bison-patches/2011-01/msg00012.html>.
503 * src/scan-code.l (parse_ref): Report the above case as a syntax
504 error. Other than that, continue to handle this case like any
505 other invalid reference that Bison manages to parse because
506 "possibly meant" messages can still be helpful to the user.
507 * tests/named-refs.at ($ or @ followed by . or -): New test group.
508
35430378
JD
5092011-01-08 Joel E. Denny <joeldenny@joeldenny.org>
510
511 doc: don't use @acronym.
512 Lately, many GNU packages are dropping it. See
513 <http://lists.gnu.org/archive/html/bison-patches/2011-01/msg00003.html>.
514 * doc/bison.texinfo: Remove all uses.
515
d236ad94
AR
5162011-01-05 Alex Rozenman <rozenman@gmail.com>
517
518 Do not allow identifiers that start with a negative number.
519 Reported by Paul Hilfinger as a side effect of named references
520 support at
521 <http://lists.gnu.org/archive/html/bug-bison/2011-01/msg00000.html>.
522 Suggested by Paul Eggert.
523 * src/scan-code.l ({letter}, {id}): Adjust lexical definitions.
524 * src/scan-gram.l ({letter}, {id}): Likewise.
525
9a4292e5
JD
5262011-01-03 Joel E. Denny <joeldenny@joeldenny.org>
527
528 * ChangeLog (2011-01-02): improve description.
529
17300e83
JD
5302011-01-03 Joel E. Denny <joeldenny@joeldenny.org>
531
532 maint: don't update copyright years in bootstrap.
533 * .x-update-copyright: Add entry for bootstrap.
534 * bootstrap: Remove 2011 from copyright years. The bootstrap
535 version we're currently using comes from an older version of
536 gnulib.
537 * bootstrap.conf (bootstrap_sync): Add comments explaining this
538 issue.
539
ea0a7676
JD
5402011-01-02 Joel E. Denny <joeldenny@joeldenny.org>
541
542 maint: run "make update-copyright".
543
f52e1e5e
JD
5442011-01-02 Joel E. Denny <joeldenny@joeldenny.org>
545
9a4292e5 546 maint: prepare to use year ranges in copyright notices.
f52e1e5e 547 * README (Copyright statements): New section explaining the range
9a4292e5
JD
548 notation. The GNU maintainers document requires this explanation:
549 <http://www.gnu.org/prep/maintain/maintain.html#Copyright-Notices>.
550 I copied our explanation from coreutils.
f52e1e5e
JD
551 * build-aux/update-b4-copyright: Revert 2010-06-17 changes that
552 disabled Bison's automated use of ranges.
553 * cfg.mk (update-copyright-env): Likewise.
554
210c1eef
JD
5552011-01-02 Joel E. Denny <joeldenny@joeldenny.org>
556
557 Correct my email address.
558 * ChangeLog: In all recent entries.
559 * THANKS (Joel E. Denny): Here.
560
5612010-12-19 Joel E. Denny <joeldenny@joeldenny.org>
6ee881f6
JD
562
563 doc: cleanup.
564 * NEWS (2.5): Try to sort entries according to how interesting
565 users might find them.
566
210c1eef 5672010-12-19 Joel E. Denny <joeldenny@joeldenny.org>
3b1977ea
JD
568
569 doc: cleanup.
570 * NEWS (2.5): Make some minor improvements to wording, and format
571 entries more consistently.
572 * doc/bison.texinfo (Language and Grammar): Point out that IELR
573 and canonical LR are experimental features.
574 (Decl Summary): In list of %define variables, make wording more
575 consistent. Improve discussion of using LALR for GLR.
576
210c1eef 5772010-12-19 Joel E. Denny <joeldenny@joeldenny.org>
4c38b19e
JD
578
579 parse.lac: document.
580 * NEWS (2.5): Add entry for LAC, and mention LAC in entry for
581 other corrections to verbose syntax error messages.
582 * doc/bison.texinfo (Decl Summary): Rewrite entries for
583 lr.default-reductions and lr.type to be clearer, to mention
584 %nonassoc's effect on canonical LR, and to mention LAC. Add entry
585 for parse.lac.
586 (Glossary): Add entry for LAC.
587
210c1eef 5882010-12-11 Joel E. Denny <joeldenny@joeldenny.org>
723fe7d1
JD
589
590 parse.lac: implement exploratory stack reallocations.
591 * data/yacc.c: Rename %define variable parse.lac.es-capacity to
592 parse.lac.es-capacity-initial. Accept parse.lac.memory-trace
593 with values of "failures" (default) or "full".
594 (b4_declare_parser_state_variables): Add yyesa, yyes, and
595 yyes_capacity variables.
596 (YYSTACK_USE_ALLOCA): Ignore it if LAC requested.
597 (YYSTACK_ALLOC, YYSTACK_FREE, YYSTACK_ALLOC_MAXIMUM): Define if
598 LAC requested.
599 (YYCOPY_NEEDED): New cpp macro.
600 (YYCOPY): Define if LAC requested.
601 (yy_lac_stack_realloc): New function implementing stack
602 reallocations. Use YYMAXDEPTH for maximum stack size given that
603 the stack should never need to grow larger than the main state
604 stack needs to grow without LAC.
605 (YY_LAC_ESTABLISH): Update yy_lac invocation.
606 (yy_lac): Add arguments for exploratory stack memory data
607 recorded in the main parser. Invoke yy_lac_stack_realloc when
608 reallocation is necessary.
609 (yysyntax_error): Add the same new arguments and pass them to
610 yy_lac.
611 (yypstate_delete): Free yyes if necessary.
612 (yyesa, yyes, yyes_capacity): #define these to yypstate members
613 in the case of push parsing.
614 (yyparse, yypush_parse): Initialize yyes and yyes_capacity.
615 Update yysyntax_error invocations. At yyreturn, free yyes if
616 necessary.
617 * src/parse-gram.y: %define parse.lac full.
618 * tests/input.at (LAC: errors for %define): Extend for
619 parse.lac-memory-trace.
620 * tests/regression.at (LAC: Exploratory stack): Extend to check
621 that stack reallocs happen when expected.
622 (LAC: Memory exhaustion): Update to use YYMAXDEPTH and
623 parse.lac.es-capacity-initial.
624
210c1eef 6252010-12-11 Joel E. Denny <joeldenny@joeldenny.org>
ea13bea8
JD
626
627 parse.lac: implement as %define variable.
628 LAC = lookahead correction. See discussion at
629 <http://lists.gnu.org/archive/html/bison-patches/2009-09/msg00034.html>.
630 However, one point there must be corrected: because of %nonassoc,
631 LAC is *not* always redundant for lr.type=canonical-lr.
632 * data/yacc.c: Accept values of "none" (default) or "full" for
633 parse.lac. Accept %define parse.lac.es-capacity to specify
634 capacity of LAC's temporary exploratory stack. It defaults to 20
635 and, for now, will not grow dynamically.
636 (b4_lac_flag, b4_lac_if): New m4 macros. Evaluate as true for
637 parse.lac!=none.
638 (YYBACKUP): Invoke YY_LAC_DISCARD.
639 (YY_LAC_ESTABLISH, YY_LAC_DISCARD): New cpp macros that invoke
640 yy_lac and track when it needs to be invoked
641 (yy_lac): New function that, given the current stack, determines
642 whether a token can eventually be shifted. Return status mimics
643 yyparse return status.
644 (yysyntax_error): Change yystate argument to yyssp so stack top
645 can be passed to yy_lac. If LAC is requested, build expected
646 token list by invoking yy_lac for every token instead of just
647 checking the current state for lookaheads. Return 2 if yy_lac
648 exhausts memory.
649 (yyparse, yypush_parse): Use local variable yy_lac_established and
650 cpp macros YY_LAC_ESTABLISH and YY_LAC_DISCARD to implement LAC.
651 Update yysyntax_error invocation. Add yyexhaustedlab code if LAC
652 is requested.
653 * tests/conflicts.at (%nonassoc and eof): Extend to check the
654 effect of each of -Dlr.type=canonical-lr and -Dparse.lac=full.
655 (%error-verbose and consistent errors): Likewise.
656 (LAC: %nonassoc requires splitting canonical LR states): New test
657 group demonstrating how LAC can fix canonical LR.
658 * tests/input.at (LAC: Errors for %define): New test group.
659 * tests/regression.at (LAC: Exploratory stack): New test group.
660 (LAC: Memory exhaustion): New test group.
661
210c1eef 6622010-11-21 Joel E. Denny <joeldenny@joeldenny.org>
dcd39f1d
JD
663
664 build: use gnulib's new bootstrap_sync option.
665 Now, whenever we update bison's copy of gnulib, bootstrap will
666 update itself the next time it's run.
667 * bootstrap: Copy from latest gnulib for bootstrap_sync support.
668 * bootstrap.conf (bootstrap_sync): Set to true.
669 * gnulib: Update to latest so bootstrap is in sync now.
670
210c1eef 6712010-11-07 Joel E. Denny <joeldenny@joeldenny.org>
3b837882
JD
672
673 yysyntax_error: adjust prior fixes for branch-2.5's lalr1.cc.
674 On master, there is no yychar in lalr1.cc, but there is on
675 branch-2.5, and the prior cherry-pick of "Fix handling of yychar
676 manipulation in user semantic actions" wasn't adjusted for that
677 difference.
678 * data/lalr1.cc (yy::parser::parse): Translate yychar before
679 every use of yytoken, and add comments explaining this approach.
680 * tests/conflicts.at (%error-verbose and consistent errors):
681 Extend to test yychar manipulation with lalr1.cc.
682
210c1eef 6832010-11-07 Joel E. Denny <joeldenny@joeldenny.org>
095a1d11
JD
684
685 yysyntax_error: fix for consistent error with lookahead.
686 * NEWS (2.5): Document.
687 * data/yacc.c (yysyntax_error): In a verbose syntax error
688 message while in a consistent state with a default action (which
689 must be an error action given that yysyntax_error is being
690 invoked), continue to drop the expected token list, but don't
691 drop the unexpected token unless there actually is no lookahead.
692 Moreover, handle that internally instead of returning 1 to tell
693 the caller to do it. With that meaning of 1 gone, renumber
694 return codes more usefully.
695 (yyparse, yypush_parse): Update yysyntax_error usage. Most
696 importantly, set yytoken to YYEMPTY when there's no lookahead.
697 * data/glr.c (yyreportSyntaxError): As in yacc.c, don't drop the
698 unexpected token unless there actually is no lookahead.
699 * data/lalr1.cc (yy::parser::parse): If there's no lookahead,
700 set yytoken to yyempty_ before invoking yysyntax_error_.
701 (yy::parser::yysyntax_error_): Again, don't drop the unexpected
702 token unless there actually is no lookahead.
703 * data/lalr1.java (YYParser::parse): If there's no lookahead,
704 set yytoken to yyempty_ before invoking yysyntax_error.
705 (YYParser::yysyntax_error): Again, don't drop the unexpected
706 token unless there actually is no lookahead.
707 * tests/conflicts.at (%error-verbose and consistent
708 errors): Extend test group to further reveal how the previous
709 use of the simple "syntax error" message was too general. Test
710 yacc.c, glr.c, lalr1.cc, and lalr1.java. No longer an expected
711 failure.
712 * tests/java.at (AT_JAVA_COMPILE, AT_JAVA_PARSER_CHECK): Move
713 to...
714 * tests/local.at: ... here.
715 (_AT_BISON_OPTION_PUSHDEFS): Push AT_SKEL_JAVA_IF definition.
716 (AT_BISON_OPTION_POPDEFS): Pop it.
717 (AT_FULL_COMPILE): Extend to handle Java.
718
210c1eef 7192010-11-07 Joel E. Denny <joeldenny@joeldenny.org>
678094a2
JD
720
721 yysyntax_error: more preparation for readability of next patch.
722 There are no behavioral changes here.
723 * data/glr.c (yyreportSyntaxError): Reorganize.
724 * data/lalr1.cc (yy::parser::yysyntax_error_): Reorganize.
725 * tests/conflicts.at (%error-verbose and consistent errors):
726 Reorganize.
727
210c1eef 7282010-11-07 Joel E. Denny <joeldenny@joeldenny.org>
f953cb20
JD
729
730 yysyntax_error: prepare for readability of next patches.
731 These are purely whitespace changes that result in ugly code
732 but that make the next couple of patches much easier to read.
733 * data/glr.c (yyreportSyntaxError): Reindent.
734 * data/lalr1.cc (yy::parser::yysyntax_error_): Reindent.
735 * data/lalr1.java (YYParser::yysyntax_error): Reindent.
736 * data/yacc.c (yysyntax_error): Reindent.
737
0e0f066b
JD
7382010-10-31 Joel E. Denny <joeldenny@joeldenny.org>
739
740 yysyntax_error: improve invocation readability.
741 * data/yacc.c (yyparse, yypush_parse): For yysyntax_error
742 invocation, get rid of the while loop, which is misleading
743 because there are really at most two iterations.
744
5f1485d8
JD
7452010-10-31 Joel E. Denny <joeldenny@joeldenny.org>
746
747 * ChangeLog: Correct some errors in previous entries.
748
2f3fd8f9
JD
7492010-10-17 Joel E. Denny <joeldenny@joeldenny.org>
750
751 maint: re-anchor all .gitignore entries.
752 * bootstrap: Copy from gnulib's latest for the fix to
753 automatically anchor entries it constructs.
754 * gnulib: Update to latest just so it has the same bootstrap.
755 * .gitignore, build-aux/.gitignore, doc/.gitignore:
756 * lib/.gitignore, m4/.gitignore, po/.gitignore:
757 * runtime-po/.gitignore: Re-anchor all entries.
758
86996fca
PE
7592010-10-08 Paul Eggert <eggert@cs.ucla.edu>
760
ea6046b9
PE
761 Fix portability problem on OpenBSD 4.7.
762
763 Jim Meyering reported this in
764 <http://lists.gnu.org/archive/html/bug-bison/2010-10/msg00007.html>.
765 * data/yacc.c: Use EXIT_SUCCESS as a witness for stdlib.h,
766 not _STDLIB_H. EXIT_SUCCESS has been defined by the standard
767 for quite some time.
768 * src/parse-gram.c, src/parse-gram.h: Regenerate.
769 * tests/regression.at: Tamper with the renamed witness.
770
86996fca
PE
771 Adjust to recent changes to gnulib bootstrap.
772
773 * .cvsignore, build-aux/.cvsignore, doc/.cvsignore, etc/.cvsignore:
774 * examples/calc++/.cvsignore, lib/.cvsignore, m4/.cvsignore:
775 * po/.cvsignore, runtime-po/.cvsignore, src/.cvsignore:
776 * tests/.cvsignore: Remove; I don't use CVS to maintain Bison
777 anymore and don't know of anybody else who does. If someone needs
778 these files, they can resurrect them.
779 * .gitignore, build-aux/.gitignore, doc/.gitignore, lib/.gitignore:
780 * m4/.gitignore, po/.gitignore, runtime-po/.gitignore:
781 Omit leading '/', since bootstrap omits it.
782 Adjust file names to match current contents better.
783 * bootstrap: Sync from gnulib: this contains the new gnulib_mk_hook
784 installed just for us.
785 * bootstrap.conf (excluded_files): Don't exclude codeset.m4,
786 glibc21.m4, inttypes_h.m4, size_max.m4, xsize.m4, as they are now
787 needed somehow. Don't have time to look into why.
788 (gnulib_modules): Change malloc to malloc-gnu. Do we really assume
789 the GNU malloc behavior, where malloc (0) != NULL unless we're
790 out of storage? If not, we can omit malloc-gnu; but for now I left
791 it in to be safe.
792 (vc_ignore): Remove.
793 * README-hacking: Renamed from HACKING, since gnulib bootstrap now
794 uses that convention.
795
7527c744
JD
7962010-08-05 Joel E. Denny <joeldenny@joeldenny.org>
797
798 Version 2.4.3.
799 * NEWS (2.4.3): Set date.
800
d034d520
JD
8012010-08-04 Joel E. Denny <joeldenny@joeldenny.org>
802
803 maint: add gettext version to release announcements.
804 Suggested by Paul Hilfinger at
805 <http://lists.gnu.org/archive/html/bison-patches/2010-07/msg00019.html>
806 <http://lists.gnu.org/archive/html/bison-patches/2010-08/msg00002.html>.
807 * cfg.mk (bootstrap-tools): Add gettext.
808
cf22447c
JD
8092010-08-04 Joel E. Denny <joeldenny@joeldenny.org>
810
811 doc: fix -W and %expect documentation some.
812 * NEWS (2.4.3): Mention that there are documentation fixes.
813 * doc/bison.texinfo (Expect Decl): Make it clear that %expect
814 turns conflicts into errors not warnings.
815 (Shift/Reduce): Likewise.
816 (Bison Options): Don't mention -Wsyntax. It doesn't exist.
817
4631c34f
JD
8182010-08-01 Joel E. Denny <joeldenny@joeldenny.org>
819
820 -Werror: fix for rules useless in parser after conflicts.
821 * NEWS (2.4.3): Document fix.
822 * src/complain.c (error_message): Extend to handle incomplete
823 error messages so warn and warn_at can be used in more cases.
824 * src/gram.c (grammar_rules_useless_report): Use warn_at so that
825 -Werror is always obeyed.
826 * src/reduce.c (reduce_print): Use warn so that the "warnings
827 being treated as errors" message is printed consistently before
828 the first warning message. This makes testing easier.
829 * tests/local.at (AT_BISON_WERROR_MSG): New macro.
830 (AT_BISON_CHECK_NO_XML): Extend to check -Werror and
831 --warnings=error when warnings appear in bison's stderr.
832
3e948170
JD
8332010-07-29 Joel E. Denny <joeldenny@joeldenny.org>
834
835 maint: enable gnits only at stable releases.
836 * configure.ac (AM_INIT_AUTOMAKE): Underscore or dash in a
837 version string should disable gnits. Explain in comments.
838
82df2d6d
JD
8392010-07-28 Joel E. Denny <joeldenny@joeldenny.org>
840
841 i18n: update.
842 * po/POTFILES.in: Add src/graphviz.c.
843
6e0ecb9a
JD
8442010-07-28 Joel E. Denny <joeldenny@joeldenny.org>
845
846 i18n: fix for gnulib.
847 * po/POTFILES.in: Add remaining gnulib files that have
848 translatable strings.
849
83e34842
JD
8502010-07-25 Joel E. Denny <joeldenny@joeldenny.org>
851
852 maint: use announce-gen's new --mail-headers.
853 * HACKING (Announce): Update instructions.
854 * cfg.mk (announcement_Cc_): Define.
855 * configure.ac (AM_GNU_GETTEXT_VERSION): Update to 0.18 as
856 required by latest gnulib.
857 * gnulib: Update to latest.
858
0162a44c
JD
8592010-07-24 Joel E. Denny <joeldenny@joeldenny.org>
860
861 tests: handle Valgrind that complains about >&-.
862 * tests/output.at (AT_CHECK_OUTPUT): Extend to accept pre-tests.
863 (Output files: -dv >&-): Skip test group if running
864 maintainer-check-valgrind.
865
241ac701
AD
8662010-06-17 Paul Eggert <eggert@cs.ucla.edu>
867
868 Update from GFDL GFDL 1.2 to 1.3.
869 * doc/bison.texinfo: Update GFDL version number.
870 * doc/fdl.texi: Update to version 1.3, taken from:
871 http://www.gnu.org/licenses/fdl.texi
872
6e30ede8
PE
8732010-06-17 Paul Eggert <eggert@cs.ucla.edu>
874
875 Do not use date ranges in copyright notices.
876 See http://www.gnu.org/prep/maintain/maintain.html#Copyright-Notices
877
878 * HACKING, Makefile.am, NEWS, PACKAGING, README, README-alpha:
879 * TODO, bootstrap, bootstrap.conf:
880 * build-aux/update-b4-copyright, cfg.mk, configure.ac:
881 * data/README, data/bison.m4, data/c++-skel.m4, data/c++.m4:
882 * data/c-skel.m4, data/c.m4, data/glr.c, data/glr.cc:
883 * data/java-skel.m4, data/java.m4, data/lalr1.cc:
884 * data/lalr1.java, data/location.cc:
885 * data/xslt/bison.xsl:
886 * data/xslt/xml2dot.xsl, data/xslt/xml2text.xsl:
887 * data/xslt/xml2xhtml.xsl, data/yacc.c, djgpp/Makefile.maint:
888 * djgpp/README.in, djgpp/config.bat, djgpp/config.sed:
889 * djgpp/config.site, djgpp/config_h.sed, djgpp/djunpack.bat:
890 * djgpp/subpipe.c, djgpp/subpipe.h:
891 * djgpp/testsuite.sed, doc/bison.texinfo:
892 * doc/refcard.tex, etc/README, etc/bench.pl.in:
893 * examples/calc++/Makefile.am, examples/extexi:
894 * lib/abitset.c, lib/abitset.h:
895 * lib/bbitset.h, lib/bitset.c, lib/bitset.h:
896 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
897 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
898 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
899 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
900 * lib/libiberty.h, lib/main.c, lib/timevar.c:
901 * lib/timevar.def, lib/timevar.h, lib/vbitset.c:
902 * lib/vbitset.h, lib/yyerror.c, m4/bison-i18n.m4:
903 * m4/c-working.m4, m4/cxx.m4, m4/subpipe.m4, m4/timevar.m4:
904 * src/AnnotationList.c, src/AnnotationList.h:
905 * src/InadequacyList.c, src/InadequacyList.h, src/LR0.c:
906 * src/LR0.h, src/Sbitset.c, src/Sbitset.h, src/assoc.c:
907 * src/assoc.h, src/closure.c, src/closure.h, src/complain.c:
908 * src/complain.h, src/conflicts.c, src/conflicts.h:
909 * src/derives.c, src/derives.h, src/files.c, src/files.h:
910 * src/flex-scanner.h, src/getargs.c, src/getargs.h:
911 * src/gram.c, src/gram.h, src/graphviz.c, src/ielr.c:
912 * src/ielr.h, src/lalr.c, src/lalr.h:
913 * src/location.c, src/location.h, src/main.c:
914 * src/muscle-tab.c, src/muscle-tab.h, src/named-ref.c:
915 * src/named-ref.h, src/nullable.c, src/nullable.h:
916 * src/output.c, src/output.h, src/parse-gram.y:
917 * src/print-xml.c, src/print-xml.h, src/print.c, src/print.h:
918 * src/print_graph.c, src/print_graph.h, src/reader.c:
919 * src/reader.h, src/reduce.c, src/reduce.h, src/relation.c:
920 * src/relation.h, src/scan-code.h, src/scan-code.l:
921 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
922 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
923 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
924 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
925 * tests/actions.at, tests/atlocal.in, tests/c++.at:
926 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
927 * tests/existing.at, tests/glr-regression.at:
928 * tests/headers.at, tests/input.at, tests/java.at:
929 * tests/local.at, tests/named-refs.at:
930 * tests/output.at, tests/push.at, tests/reduce.at:
931 * tests/regression.at, tests/sets.at, tests/skeletons.at:
932 * tests/synclines.at, tests/testsuite.at, tests/torture.at:
933 * data/Makefile.am, data/location.cc, doc/Makefile.am, src/Makefile.am:
934 * tests/Makefile.am, lib/Makefile.am, examples/Makefile.am:
935 * etc/Makefile.am:
936 Don't use date ranges in copyright notices.
937
3d4a0cad
AD
9382010-05-11 Akim Demaille <demaille@gostai.com>
939
940 lalrl1.cc: give a chance to user defined YYLLOC_DEFAULT.
941 * data/lalr1.cc (YYLLOC_DEFAULT): Move its definition from the
942 header file to the implementation file, after the user %code
943 sections.
944 * NEWS (2.5): Document this.
945
e7bab2df
AD
9462010-05-07 Akim Demaille <demaille@gostai.com>
947
948 c++: use YYRHSLOC.
949 * data/lalr1.cc (YYRHSLOC): New.
950 (YYLLOC_DEFAULT): Use it.
951 * data/glr.cc: If location_type was user defined, do not include
952 location.hh, and do not produce location.hh and position.hh.
953 * tests/calc.at (YYLLOC_DEFAULT): Use YYRHSLOC.
954 Check that glr.cc supports user defined location_type.
955 * NEWS: Document this.
956
baacae49
AD
9572010-05-10 Akim Demaille <demaille@gostai.com>
958
959 doc: fix lalr1.cc documentation.
960 * doc/bison.texinfo (C++ Scanner Interface): Fix yylex signature.
961 (C++ Bison Interface): Fix lalr1.cc skeleton name.
962 (C++ Parser Interface): Fix semantic_type and location_type names.
963 Document yy::parser::token.
964 Reported by Jerry Quinn.
965
95a2de56
AD
9662010-05-04 Akim Demaille <demaille@gostai.com>
967
968 lalr1.cc: don't generate location.hh when location_type is defined
969 * data/bison.m4 (b4_percent_define_use): New.
970 (b4_percent_define_get): Use it.
971 Accept a default value.
972 * data/c++.m4: Do not provide a default value for the %define
973 variable location_type, rather, use b4_percent_define_get with a
974 default argument where its value is needed.
975 * data/lalr1.cc: Do not load location.cc (which outputs both
976 location.hh and position.hh) if the user defined location_type.
977 Do not include location.hh either.
978 * data/glr.cc: Likewise.
979
0f404a0a
AD
9802010-05-04 Akim Demaille <demaille@gostai.com>
981
982 lalr1.cc: location_type: make sure we don't depend on loc.(begin|end).
983 * tests/calc.at (Span): Instead of begin/end, as in the built-in
984 location class, use first and last.
985 Define YYLLOC_DEFAULT to adjust to these changes.
986 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Adjust to the
987 location_type changes.
988
bdc360ae
AD
9892010-05-04 Akim Demaille <demaille@gostai.com>
990
991 tests: enhance AT_SYNCLINES_COMPILE.
992 * tests/synclines.at (AT_TEST_SYNCLINE): Move GCC 4.5 protection
993 into...
994 (AT_SYNCLINES_COMPILE): here.
995 Add more distcc patterns.
996
ca7a59e8
JD
9972010-05-01 Joel E. Denny <joeldenny@joeldenny.org>
998
999 tests: fix maintainer-xml-check.
1000 * data/xslt/xml2dot.xsl (xsl:template match="bison-xml-report"):
1001 Update output to include comments now produced by --graph.
1002 (xsl:template match="automaton"): As for --graph, name the
1003 digraph after the grammar file.
1004 * src/print-xml.c (escape_bufs): Enlarge array.
1005 (print_xml): Add bug-report and url attributes to
1006 bison-xml-report element.
1007
ad6f84e5
JD
10082010-05-01 Joel E. Denny <joeldenny@joeldenny.org>
1009
1010 In DOT output, convert from "/*" comments to "//" comments.
1011 This handles the possibility that a "*/" might appear in
1012 variable portions of those comments at some point in the future.
1013 * src/graphviz.c (start_graph): Implement.
1014
43fdc9fd
JD
10152010-04-30 Joel E. Denny <joeldenny@joeldenny.org>
1016
1017 Document that undefined %prec identifier warnings will remain.
1018 * NEWS (2.4.3): Here.
1019 (2.4.2): Here.
1020
e02df72c
JD
10212010-04-30 Joel E. Denny <joeldenny@joeldenny.org>
1022
1023 Revert 2009-12-30 change for undefined %prec token complaints.
1024 That is, keep them as warnings because that should be sufficient
1025 to satisfy POSIX without creating backward compatibility issues.
1026 Suggested by Richard Stallman at
1027 <http://lists.gnu.org/archive/html/bison-patches/2010-03/msg00033.html>.
1028 * NEWS (2.5): Remove mention of complaint.
21279295
JD
1029 * src/reader.c (grammar_rule_check): Convert complaint back to
1030 warning.
e02df72c
JD
1031 * tests/input.at (%prec's token must be defined): Update.
1032
ba3063f6
JD
10332010-04-25 Joel E. Denny <joeldenny@joeldenny.org>
1034
1035 build: don't require src/bison during bootstrap.
1036 Suggested by Eric Blake at
1037 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00003.html>.
1038 * bootstrap.conf (bootstrap_epilogue): New function to make sure
1039 src/parse-gram.[ch] are stamped later than src/parse-gram.y.
1040
e0fda26c
JD
10412010-04-25 Joel E. Denny <joeldenny@joeldenny.org>
1042
1043 i18n: fix untranslatable string.
1044 Reported by Goran Uddeborg at
1045 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00000.html>.
1046 * src/muscle-tab.c (muscle_percent_define_insert): Here.
1047
ecbca7db
AD
10482010-04-13 Akim Demaille <demaille@gostai.com>
1049
1050 tests: calc: minor refactoring.
1051 * tests/calc.at (_AT_DATA_CALC_Y): Simplify yylex.
1052
ed228e60
AD
10532010-04-13 Akim Demaille <demaille@gostai.com>
1054
1055 tests: calc: simplify location management.
1056 * tests/local.at (AT_LOC_PUSHDEF, AT_LOC_POPDEF): New.
1057 (_AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS): Use them to
1058 define the appropriate AT_LOC accessors.
1059 * tests/calc.at: Use AT_LOC accessors.
1060
cacfdef7
AD
10612010-04-13 Akim Demaille <demaille@gostai.com>
1062
1063 test location_type.
1064 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS):
1065 Define AT_LOCATION_TYPE_IF.
1066 (_AT_BISON_OPTION_POPDEFS): Undefine AT_LOCATION_TYPE_IF.
1067 * tests/calc.at (_AT_DATA_CALC_Y): When %define location_type is
1068 used, provide a user location type and use it.
1069 (Simple LALR1 C++ Calculator): Add a test case for location_type.
1070
2f61c4a2
AD
10712010-04-13 Akim Demaille <demaille@gostai.com>
1072
1073 tests: check fclose's return value.
1074 * tests/calc.at (_AT_DATA_CALC_Y): Check fclose's return status.
1075
16d9244d
AD
10762010-04-13 Akim Demaille <demaille@gostai.com>
1077
1078 tests: don't depend on the actual location type.
1079 * tests/calc.at: Use yy::parser::location_type rather than
1080 yy::location, since the former is always right, and might point to
1081 another type than the latter.
1082
3e4a253b
AD
10832010-04-13 Akim Demaille <demaille@gostai.com>
1084
1085 formatting changes.
1086 * tests/calc.at: Formatting changes.
1087
df5df58d
AD
10882010-04-13 Akim Demaille <demaille@gostai.com>
1089
1090 lalr1.cc: remove useless forward declaration.
1091 * data/lalr1.cc: Include location.hh before stack.hh.
1092 Remove the useless forward declarations of position and location.
1093 Reported by Chris Morley.
1094 * data/glr.cc: Likewise.
1095
88bb35d6
JD
10962010-04-11 Joel E. Denny <joeldenny@joeldenny.org>
1097
1098 * NEWS (2.4.3): Mention fix for Sun Studio C++.
1099
585ef2eb
JD
11002010-04-10 Joel E. Denny <joeldenny@joeldenny.org>
1101
1102 tests: fix for newer Sun Studio C++.
1103 Reported by Dagobert Michelsen at
1104 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00023.html>.
1105 * THANKS (Dagobert Michelsen): Add.
1106 * configure.ac (AC_PREREQ): Set to 2.64 so we get the latest
1107 Autoconf macro for handling the restrict keyword.
1108 * gnulib: Update to latest, which no longer overrides that macro
1109 from Autoconf.
1110
a005dbcb
JD
11112010-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1112
1113 portability: fix pointer arithmetic to conform to C standard.
1114 Reported by Tys Lefering at
1115 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00035.html>.
1116 This fix is already implemented in glr.c and does not apply to
1117 lalr1.java.
1118 * data/lalr1.cc (yy::parser::parse): Increase size of
1119 yyerror_range and adjust subscripting so you don't have to
1120 subtract one from the beginning of the array.
1121 * data/yacc.c (b4_declare_parser_state_variables,
1122 yyparse, yypush_parse): Likewise.
1123
8a8b33e8
AD
11242010-04-05 Akim Demaille <demaille@gostai.com>
1125
1126 remove useless include.
1127 * src/graphviz.h: Don't include stdbool.h.
1128
a0279765
AD
11292010-04-05 Akim Demaille <demaille@gostai.com>
1130
1131 graph: sign the output file.
1132 * src/graphviz.c (start_graph): Issue comments about Bison.
1133 Suggested by Tys Lefering.
1134
132247cd
JD
11352010-03-31 Joel E. Denny <jdenny@ces.clemson.edu>
1136
1137 portability: fix test suite for GCC 4.5's new #error message.
1138 Reported by Tys Lefering at
1139 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00030.html>.
1140 * NEWS (2.4.3): Mention.
1141 * tests/synclines.at (AT_TEST_SYNCLINE): Implement.
1142
c0259969
AD
11432010-03-30 Akim Demaille <demaille@gostai.com>
1144
1145 fix comments.
1146 * src/graphviz.h: Add missing license notice.
1147 Document.
1148
23761f42
AD
11492010-03-25 Akim Demaille <demaille@gostai.com>
1150
1151 tests: fix 250: parse.error=verbose overflow.
1152 * tests/regression.at (parse.error=verbose overflow): Avoid the
1153 double inclusion of stdlib.h as it triggers hard errors.
1154
9097fda0
JD
11552010-03-23 Joel E. Denny <jdenny@ces.clemson.edu>
1156
1157 portability: fix for BSD make.
1158 Reported by Johan van Selst at
1159 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00016.html>.
1160 * tests/Makefile.am ($(TESTSUITE)): Qualify package.m4 in
1161 this dependency list as in package.m4's target rule.
1162
7a9c3cb3
JD
11632010-03-23 Joel E. Denny <jdenny@ces.clemson.edu>
1164
1165 portability: fix spawning on at least FreeBSD 8 and FreeBSD 9.
1166 Reported by Johan van Selst at
1167 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00014.html>.
1168 * NEWS (2.4.3): New.
1169 * THANKS (Johan van Selst): Add.
1170 * gnulib: Update to latest.
1171
5a3c69f1
JD
11722010-03-20 Joel E. Denny <jdenny@ces.clemson.edu>
1173
1174 maint: update for changes to gnulib's announce-gen.
1175 * HACKING (Announce): RELEASE_TYPE=major must now be written
1176 RELEASE_TYPE=stable.
1177
ea66d039
JD
11782010-03-20 Joel E. Denny <jdenny@ces.clemson.edu>
1179
1180 Version 2.4.2.
1181 * NEWS (2.4.2): Set version and date. For the recent test suite
1182 portability fixes, don't be so optimistic about their success
1183 given the lack of feedback on the affected platforms.
1184
c50befe6
JD
11852010-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
1186
1187 tests: fix maintainer-xml-check for recent changes.
1188 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Use
1189 AT_BISON_CHECK_NO_XML rather than AT_BISON_CHECK because an
1190 output file whose name conflicts with a previous output file
1191 is now never generated.
1192
47fa5747
JD
11932010-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
1194
1195 portability: fix several issues with M4 subprocess.
1196
1197 M4's output pipe was not being drained upon fatal errors during
1198 scan_skel. As a result, broken-pipe messages from M4 were seen
1199 on at least AIX, HP-UX, Solaris, and RHEL4, and this caused a
1200 failure in the test suite. The problem was that, on platforms
1201 where the default disposition for SIGPIPE is ignore instead of
1202 terminate, M4 sometimes saw fwrite fail with errno=EPIPE and
1203 then reported it. However, there's some sort of race condition,
1204 because the new test group occasionally succeeded.
1205 Reported by Albert Chin at
1206 <http://lists.gnu.org/archive/html/bug-bison/2010-02/msg00004.html>.
1207
1208 There were also problems with the test suite livelocking on
1209 Tru64 5.1b. Reported by Didier Godefroy at
1210 <http://lists.gnu.org/archive/html/bug-bison/2009-05/msg00005.html>.
1211 Switching to create_pipe_bidi suggested by Akim Demaille.
1212
1213 To attempt to solve both of these problems, switch to gnulib's
1214 create_pipe_bidi and register M4 process as a slave. Along the
1215 way, clean up file name conflict handling, which was affected by
1216 the broken-pipe problem before the switch.
1217 * NEWS (2.4.2): Document.
1218 * THANKS (Didier Godefroy): Add.
1219 * bootstrap.conf (gnulib_modules): Add pipe.
1220 * gnulib: Update to latest to make sure we have all the latest
1221 fixes.
1222 * lib/Makefile.am (libbison_a_SOURCES): Remove subpipe.h and
1223 subpipe.c.
1224 * po/POTFILES.in (lib/subpipe.c): Remove.
1225 * src/files.c (compute_output_file_names): Update invocations
1226 of output_file_name_check.
1227 (output_file_name_check): In the case that the grammar file
1228 would be overwritten, use complain instead of fatal, but replace
1229 the output file name with /dev/null. Use the /dev/null solution
1230 for the case of two conflicting output files as well because it
1231 seems safer in case Bison one day tries to open both files at
1232 the same time.
1233 * src/files.h (output_file_name_check): Update prototype.
1234 * src/output.c (output_skeleton): Use create_pipe_bidi and
1235 wait_subprocess. Assert that scan_skel completely drains the
1236 pipe.
1237 * src/scan-skel.l (at_directive_perform): Update
1238 output_file_name_check invocation.
1239 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Check that the
1240 grammar file actually isn't overwritten.
1241 (Conflicting output files: -o foo.y): Update expected output.
1242 * tests/skeletons.at (Fatal errors but M4 continues producing
1243 output): New test group.
1244
d67e37a7
JD
12452010-02-04 Joel E. Denny <jdenny@ces.clemson.edu>
1246
1247 Update POTFILES.
1248 * HACKING (Release Procedure): Add reminder about keeping
1249 POTFILES files up-to-date.
1250 * po/POTFILES.in (src/muscle-tab.c, src/scan-skel.l): Add.
1251
0ee1af2e
JD
12522010-02-01 Joel E. Denny <jdenny@clemson.edu>
1253
1254 Code cleanup.
1255 * tests/atlocal.in (abs_top_srcdir): Remove shell variable,
1256 which is already defined in atconfig.
1257
2655c7cd
JD
12582010-01-21 Joel E. Denny <jdenny@clemson.edu>
1259
1260 * cfg.mk (gnulib_dir): Assume gnulib is a subdirectory.
1261
8ebc7dca
JD
12622010-01-21 Joel E. Denny <jdenny@clemson.edu>
1263
1264 maint: automate PACKAGE_COPYRIGHT_YEAR update, and update it.
1265 * HACKING (Release Procedure): Update notes on copyright years.
1266 * Makefile.am (update-package-copyright-year): New target rule.
1267 * build-aux/update-package-copyright-year: New file.
1268 * cfg.mk (update-copyright): Add update-package-copyright-year
1269 as a dependency.
1270
f0a43dd1
JD
12712010-01-19 Joel E. Denny <jdenny@clemson.edu>
1272
1273 * bootstrap: Import improvements from latest gnulib.
1274
e4ca7a85
JD
12752010-01-19 Joel E. Denny <jdenny@clemson.edu>
1276
1277 build: require Automake 1.11.1 to avoid a security flaw.
1278 * HACKING (Release Procedure): Don't document Automake security
1279 flaw here.
1280 * configure.ac (AM_INIT_AUTOMAKE): Require 1.11.1, and explain
1281 why here.
1282
8d830047
JD
12832010-01-19 Joel E. Denny <jdenny@clemson.edu>
1284
1285 gnulib: update to latest.
1286
e5926647
JD
12872010-01-19 Joel E. Denny <jdenny@clemson.edu>
1288
1289 ChangeLog (2006-09-15): add Odd Arild Olsen's role for push.c.
1290
5a2f6eb4
JD
12912010-01-15 Joel E. Denny <jdenny@clemson.edu>
1292
1293 Thank the developer of the initial push parser implementation.
1294 This unfortunate oversight is several years old.
1295 * THANKS (Odd Arild Olsen): Add.
1296
1c4ad777
JD
12972010-01-04 Joel E. Denny <jdenny@clemson.edu>
1298
1299 Fix some comments concerning LR(0) versus LALR(1).
1300
1301 Stop equating LR(0) with nondeterminism and LALR(1) with
1302 determinism. That is, if all states are consistent, then LR(0)
1303 tables are deterministic. On the other hand, LALR(1) tables
1304 might be nondeterministic before conflict resolution, and GLR
1305 permits LALR(1) tables to remain nondeterministic.
1306 * src/LR0.c, src/LR0.h: Here.
1307 * src/lalr.c, src/lalr.h: Here.
1308 * src/main.c (main): Here.
1309 * src/state.c, src/state.h: Here.
1310
1311 * src/ielr.h (ielr): In preconditions, expect LR(0) not LALR(1)
1312 parser tables.
1313
1462fcee
JD
13142010-01-04 Joel E. Denny <jdenny@clemson.edu>
1315
1316 maint: run "make update-copyright"
1317
510df951
JD
13182009-12-30 Joel E. Denny <jdenny@clemson.edu>
1319
1320 POSIX: complain if %prec's token was not defined.
1321 * NEWS (2.5): Document.
1322 * src/reader.c (grammar_rule_check): Convert warning to
1323 complaint.
1324 * tests/input.at (%prec's token must be defined): Update.
1325
2c203528
JD
13262009-12-30 Joel E. Denny <jdenny@clemson.edu>
1327
1328 POSIX: warn if %prec's token was not defined.
1329 Reported by Florian Krohm at
1330 <http://lists.gnu.org/archive/html/bug-bison/2009-12/msg00005.html>.
1331 * NEWS (2.4.2): Document.
1332 * src/reader.c (grammar_rule_check): Implement.
1333 (grammar_current_rule_prec_set): Add comments explaining that we
1334 here assume a %prec identifier is a token, but we still manage
1335 to support POSIX.
1336 * tests/input.at (%prec's token must be defined): New test
1337 group.
1338
a93cdd3d
JD
13392009-12-31 Joel E. Denny <jdenny@clemson.edu>
1340
1341 * HACKING (Release Procedure): Recommend a secure automake.
1342
bb57985c
AD
13432008-12-11 Akim Demaille <demaille@gostai.com>
1344
1345 Propagate i18n changes into glr.c.
1346 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
1347 building the error message format dynamically.
1348 * data/lalr1.java: Formatting changes.
1349
70afaf26
JD
13502009-12-22 Joel E. Denny <jdenny@clemson.edu>
1351
1352 Port small part of master's 11707b2b so future ports are easier.
1353 * data/lalr1.java (YYParser::yysyntax_error): Untabify.
1354
8200219a
AD
13552008-12-11 Akim Demaille <demaille@gostai.com>
1356
1357 Simplify the i18n of the error messages.
1358 * data/lalr1.cc: Comment changes.
1359
39f6a8d1
AD
13602008-11-11 Akim Demaille <demaille@gostai.com>
1361
1362 Prefer M4 to CPP.
1363 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
1364 YYERROR_VERBOSE.
1365
e657f369
AD
13662008-11-11 Akim Demaille <demaille@gostai.com>
1367
1368 Support i18n of the parse error messages.
1369 * TODO (lalr1.cc/I18n): Remove.
1370 * data/lalr1.cc (yysyntax_error_): Support the translation of the
1371 error messages, as done in yacc.c.
1372 Stay within the yy* pseudo namespace.
1373
1e05521d
JD
13742009-12-22 Joel E. Denny <jdenny@clemson.edu>
1375
1376 Port small part of master's 8901f32e so future ports are easier.
1377 * data/lalr1.cc (yy::parser::yysyntax_error_): Always add second
1378 argument, but name it in the function definition only when
1379 verbose error messages are enabled and it'll thus be used.
1380 (yy::parser::parse): Update use of yysyntax_error_.
1381
2728ac7e
JD
13822009-12-29 Joel E. Denny <jdenny@clemson.edu>
1383
1384 portability: `<' and `>' are not always defined on addresses.
1385 Specifically, don't sort objects by their memory addresses when
1386 they're not allocated in the same array or other object. Though
1387 I haven't found a test case where that fails on my platform, C
1388 says the behavior is undefined.
1389 * src/AnnotationList.c (AnnotationList__insertInto): Remove
1390 FIXME. Use new id field of InadequacyList nodes rather than
1391 their memory addresses when sorting.
1392 (AnnotationList__compute_from_inadequacies): Add
1393 inadequacy_list_node_count argument to pass to
1394 InadequacyList__new_conflict.
1395 * src/AnnotationList.h
1396 (AnnotationList__compute_from_inadequacies): Update prototype
1397 and documentation for new argument.
1398 * src/InadequacyList.c (InadequacyList__new_conflict): Add
1399 node_count argument and use it to assign a unique ID.
1400 * src/InadequacyList.h (InadequacyListNodeCount): New typedef.
1401 (InadequacyList): Add id field.
1402 (InadequacyList__new_conflict): Update prototype and
1403 documentation for new argument.
1404 * src/ielr.c (ielr_compute_annotation_lists): Update
1405 AnnotationList__compute_from_inadequacies invocation.
1406
abcc7c03
JD
14072009-12-20 Joel E. Denny <jdenny@clemson.edu>
1408
1409 Fix handling of yychar manipulation in user semantic actions.
1410 The problem was that yacc.c didn't always update the yychar
1411 translation afterwards. However, other skeletons appear to be
1412 fine. glr.c appears to already translate yychar before every
1413 use. lalr1.cc does not define yychar and does not document its
1414 replacement, yyla, for users. It does provide yyclearin, but
1415 that does not manipulate yyla and thus requires no translation
1416 update. In lalr1.java, yychar is out of scope during semantic
1417 actions.
1418 * NEWS (2.5): Document.
1419 * data/yacc.c (YYBACKUP): Don't bother translating yychar into
1420 yytoken here.
1421 (yyparse, yypush_parse): Instead, translate before every use of
1422 yytoken, and add comments explaining this approach.
1423 * tests/actions.at (Destroying lookahead assigned by semantic
1424 action): New test group checking that translation happens before
1425 lookahead destructor calls at parser return. Previously,
1426 incorrect destructors were called.
1427 * tests/conflicts.at (%error-verbose and consistent
1428 errors): New test group checking that translation happens at
1429 syntax error detection before the associated verbose error
1430 message and the associated lookahead destructor calls. While
1431 the destructor call is fixed by this patch, the verbose error
1432 message is currently incorrect due to another bug (see
1433 comments in test group), so this is an expected failure for now.
1434
62efdd2a
JD
14352009-12-21 Joel E. Denny <jdenny@clemson.edu>
1436
1437 YYFAIL: warn about uses and remove from lalr1.java.
1438 * NEWS (2.5): Document.
5f1485d8 1439 * data/lalr1.java (YYParser::YYFAIL): Rename to YYERRLAB,
62efdd2a
JD
1440 and make it private. Update all uses.
1441 * src/scan-code.l (SC_RULE_ACTION): Implement warning.
1442
41d35e54
JD
14432009-12-21 Joel E. Denny <jdenny@clemson.edu>
1444
1445 YYFAIL: deprecate.
1446 * NEWS (2.4.2): Document deprecation and the phase-out plan.
5f1485d8 1447 * data/lalr1.java (YYParser::YYFAIL): Add comment about
41d35e54
JD
1448 deprecation.
1449 * data/yacc.c (YYFAIL): Likewise, and suppress warnings about
1450 YYFAIL from GCC cpp's -Wunused-macros.
1451 * doc/bison.texinfo (Java Action Features): Remove YYFAIL
1452 documentation.
1453 (LocalWords): Remove YYFAIL.
1454
692d04cb
JD
14552009-12-17 Joel E. Denny <jdenny@clemson.edu>
1456
1457 Code cleanup.
1458 * src/symtab.c, src/symtab.h (symbol_class_get_string): Remove
1459 function, which is no longer used.
1460
34731471
JD
14612009-12-16 Joel E. Denny <jdenny@clemson.edu>
1462
1463 Add gcc's -Wundef to test suite and fix another warning from it.
1464 * NEWS (2.4.2): Update description of -Wundef fix.
1465 * configure.ac (WARN_CXXFLAGS_TEST): New substitution.
1466 (WARN_CFLAGS_TEST): New substitution.
1467 * data/glr.c: Avoid warning about __STRICT_ANSI__.
1468 * tests/atlocal.in (CFLAGS): Use WARN_CFLAGS_TEST instead of
1469 WARN_CFLAGS.
1470 (NO_WERROR_CFLAGS): Likewise.
1471 (CXXFLAGS): Use WARN_CXXFLAGS_TEST instead of WARN_CXXFLAGS.
1472
3bba2dad
JD
14732009-12-16 Joel E. Denny <jdenny@clemson.edu>
1474
1475 * data/yacc.c: Reformat m4 a little.
1476
af2ffe5c
JD
14772009-12-16 Joel E. Denny <jdenny@clemson.edu>
1478
1479 Document gcc -Wundef fix.
1480 * NEWS (2.4.2): Here.
1481 * THANKS (Jonathan Nieder): Add.
1482
874ac415
JN
14832009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
1484
1485 Simplify y.tab.c when location tracking is disabled.
1486 * data/yacc.c: Do not check YYLTYPE_IS_TRIVIAL if location
1487 tracking is not enabled. Instead, unconditionally define
1488 YY_LOCATION_PRINT as a no-op for backward compatibility.
1489
06caf0e1
JN
14902009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
1491
1492 Avoid warnings from gcc -Wundef y.tab.c.
1493 * data/glr.c: Check if YYENABLE_NLS and YYLTYPE_IS_TRIVIAL are
1494 defined before using them.
1495 * data/lalr1.cc: Likewise.
1496 * data/yacc.c: Likewise.
1497
687f011a
JD
14982009-12-15 Joel E. Denny <jdenny@clemson.edu>
1499
1500 autoconf: update to latest for fix of M4 detection.
1501 Reported by Eric Blake.
1502 * submodules/autoconf: Update.
1503
fb9a3976
JD
15042009-12-15 Joel E. Denny <jdenny@clemson.edu>
1505
1506 portability: use -DGNULIB_POSIXCHECK.
1507 Reported by Eric Blake. See discussions at
1508 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00008.html>
1509 and
1510 <http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00108.html>.
1511 * HACKING (Release checks): Suggest -DGNULIB_POSIXCHECK.
1512 * bootstrap.conf (gnulib_modules): Add all the printf modules
1513 suggested by -DGNULIB_POSIXCHECK. Add realloc-posix as
1514 suggested by -DGNULIB_POSIXCHECK for gnulib's own vasnprintf.c.
1515 (excluded_files): Remove m4/printf-posix.m4.
1516 * tests/atlocal.in (LIBS): As for LDADD in src/local.mk, add
1517 lib/libbison.a so gnulib libraries can be linked.
1518
f1fb412c
JD
15192009-12-14 Joel E. Denny <jdenny@clemson.edu>
1520
1521 Enable assertion output and --disable-assert for configure.
1522 * bootstrap.conf (gnulib_modules): Add assert module.
1523 * src/system.h (aver): Define as assert, and summarize the
1524 discussion on this issue.
1525
51c7ca01
JD
15262009-12-14 Joel E. Denny <jdenny@clemson.edu>
1527
1528 Expand GLR acronym in summary of Bison.
1529 Based on discussion with Akim Demaille starting at
1530 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00087.html>.
1531 * doc/bison.texinfo (Introduction): Here.
1532 * src/getargs.c (usage): Here.
1533
1f68dca5
AR
15342009-10-03 Alex Rozenman <rozenman@gmail.com>
1535
1536 Document named references.
1537 * doc/bison.texinfo (Actions): Add new example and xref to
1538 Using Named References node.
1539 (Using Named References): New node.
1540
aa01d193
JD
15412009-10-16 Joel E. Denny <jdenny@clemson.edu>
1542
1543 cleanup.
1544 * src/Sbitset.c (Sbitset__new_on_obstack): Use Sbitset instead
1545 of char*.
1546 (Sbitset__isEmpty): Use Sbitset instead of char*.
1547 * src/Sbitset.h (Sbitset): Make it a pointer to unsigned char
1548 instead of char. This helps to avoid casting errors.
1549 (Sbitset__or): Use Sbitset instead of char*.
1550
61747047
JD
15512009-10-16 Joel E. Denny <jdenny@clemson.edu>
1552
1553 portability: don't assume 8-bit bytes.
1554 That is, use CHAR_BIT and UCHAR_MAX instead of 8 and 0xff.
1555 * src/Sbitset.h (Sbitset__nbytes): Here.
1556 (Sbitset__byteAddress): Here.
1557 (Sbitset__bit_mask): Here.
1558 (Sbitset__last_byte_mask): Here.
1559 (Sbitset__ones): Here.
1560 (SBITSET__FOR_EACH): Here.
1561
a70596de
JD
15622009-10-11 Joel E. Denny <jdenny@clemson.edu>
1563
1564 portability: use va_start and va_end in the same function.
1565 * src/complain.c (error_message): Move va_end from here...
1566 (ERROR_MESSAGE): ... to here.
1567
51f255a5
JD
15682009-10-08 Joel E. Denny <jdenny@clemson.edu>
1569
1570 * data/bison.m4: Update comments for rename to muscle-tab.h.
1571
23ec25b7
JD
15722009-10-08 Joel E. Denny <jdenny@clemson.edu>
1573
1574 Rename muscle_tab.* to muscle-tab.* for consistency with master.
1575 * src/Makefile.am (bison_SOURCES): Update.
1576 * src/getargs.c, src/ielr.c, src/lalr.c, src/main.c,
1577 src/output.c, src/parse-gram.y, src/print.c, src/reader.c,
1578 src/tables.c: Update include.
1579 * src/muscle_tab.c, src/muscle_tab.h: Rename to...
1580 * src/muscle-tab.c, src/muscle-tab.h: ... these and update
1581 include.
1582
0ab402b4
JD
15832009-10-07 Joel E. Denny <jdenny@clemson.edu>
1584
1585 Minor code cleanup.
1586 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT): Remove macro and
1587 replace all uses with UNIQSTR_CONCAT.
1588 * src/uniqstr.c (uniqstr_vsprintf): New function.
1589 * src/uniqstr.h (uniqstr_vsprintf): Add prototype.
1590 (UNIQSTR_CONCAT, UNIQSTR_GEN_FORMAT, UNIQSTR_GEN_FORMAT_): New
1591 macros.
1592
42ec0ae1
JD
15932009-10-04 Joel E. Denny <jdenny@clemson.edu>
1594
1595 Minor code cleanup.
1596 * src/parse-gram.y: Clean up sorting of declarations.
1597 Use types to simplify %printer declarations where possible.
1598 Provide %printer for BRACKETED_ID and symbol.prec.
1599 * src/symtab.c: Whitespace change.
1600
9637e0ed
JD
16012009-10-04 Joel E. Denny <jdenny@clemson.edu>
1602
1603 tests: skip tests of file names that platform does not support.
1604 Reported by Michael Raskin at
1605 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00001.html>.
1606 * THANKS (Michael Raskin): Add.
1607 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Fix. Cygwin used
1608 to fail at least for file names containing ":" or "\".
1609
69a2ab11
JD
16102009-09-23 Joel E. Denny <jdenny@clemson.edu>
1611
1612 yysyntax_error: avoid duplicate lookahead collection.
1613 Except when memory reallocation is required, this change
1614 eliminates the need to invoke yysyntax_error twice and thus to
1615 repeat the collection of lookaheads. It also prepares for
1616 future extensions that will make those repetitions more
1617 expensive and that will require additional memory management in
1618 yysyntax_error. Finally, it fixes an obscure bug already
1619 exercised in the test suite.
1620 * data/yacc.c (yysyntax_error): Add arguments for message
1621 buffer variables stored in the parser. Instead of size, return
1622 status similar to yyparse status but indicating success of
1623 message creation. Other than the actual reallocation of the
1624 message buffer, import and clean up memory management code
1625 from...
1626 (yyparse, yypush_parse): ... here.
1627 * tests/regression.at (%error-verbose overflow): No longer an
1628 expected failure.
1629
d88cf117
JD
16302009-09-23 Joel E. Denny <jdenny@clemson.edu>
1631
1632 yysyntax_error: test memory management more.
1633 * tests/atlocal.in (NO_WERROR_CFLAGS): New cpp macro.
1634 * tests/regression.at (%error-verbose and YYSTACK_USE_ALLOCA):
1635 New test group.
1636 (%error-verbose overflow): New test group that reveals an
1637 obscure bug. Expected fail for now.
1638
9da640ea
AD
16392008-12-11 Akim Demaille <demaille@gostai.com>
1640
1641 Pass the token type to yysyntax_error.
1642 * data/yacc.c (yysyntax_error): Take the transated token instead
1643 of the raw number.
1644 Adjust callers.
1645
d3d3628b
AD
16462008-12-11 Akim Demaille <demaille@gostai.com>
1647
1648 Simplify the i18n of the error messages.
1649 * data/yacc.c (yysyntax_error): Rewrite, using a switch instead
1650 of building dynamically the format string.
1651
4c6b13f3
JD
16522009-10-03 Joel E. Denny <jdenny@clemson.edu>
1653
1654 Remove dead code.
1655 * src/symtab.c (symbol_pack): Here because every symbol's number
1656 is always defined by this time.
1657
f840c05a
AR
16582009-10-03 Alex Rozenman <rozenman@gmail.com>
1659
1660 Add additional space after periods in NEWS.
1661 * NEWS (2.5): here.
1662
17a407dc
JD
16632009-09-29 Joel E. Denny <jdenny@clemson.edu>
1664
1665 Use the correct conversion specifier for size_t.
1666 Reported by Jim Meyering.
1667 * src/Sbitset.h (SBITSET__INDEX__CONVERSION_SPEC): New, "zu"
1668 because Sbitset__Index is size_t.
1669 * src/Sbitset.c (Sbitset__fprint): Use it instead of %d.
1670
4b7a4c1b
JD
16712009-09-27 Joel E. Denny <jdenny@clemson.edu>
1672
1673 tests: don't abuse AT_BISON_CHECK.
1674 * tests/regression.at (parse-gram.y: LALR = IELR): Move
1675 additional shell commands outside of AT_BISON_CHECK.
1676
873ac263
JD
16772009-09-26 Joel E. Denny <jdenny@clemson.edu>
1678
1679 tests: check that parse-gram.y's IELR and LALR are identical.
1680 * tests/atlocal.in (abs_top_srcdir): New shell variable.
1681 * tests/regression.at (parse-gram.y: LALR = IELR): New test
1682 group.
1683
232be91a
AD
16842009-09-16 Akim Demaille <demaille@gostai.com>
1685
1686 doc: comment changes.
1687 * doc/bison.texinfo: Comment changes.
1688
c781580d
AD
16892009-09-16 Akim Demaille <demaille@gostai.com>
1690
1691 doc: spell checking.
1692 * doc/bison.texinfo: here.
1693
348f5608
AR
16942009-09-19 Alex Rozenman <rozenman@gmail.com>
1695
1696 Keep sub-messages aligned. Fix strings for translation.
f840c05a
AR
1697 * src/location.h (location_print): Add return value.
1698 * src/location.c (location_print): Return number of printed
348f5608 1699 characters.
f840c05a
AR
1700 * src/complain.h (complain_at_indent, warn_at_indent): Prototype
1701 new functions.
1702 * src/complain.cpp (indent_ptr): New static variable.
1703 (error_message, complain_at_indent, warn_at_indent): Implement
1704 the alignment mechanism.
1705 * src/scan-code.l (parse_ref, show_sub_messages): Fix strings
1706 for translations. Use new alignment mechanism.
1707 * tests/named-ref.at: Adjust test-cases.
348f5608
AR
1708 * NEWS (2.5): Add an announcement about named references.
1709
d93b5f50
JD
17102009-09-13 Joel E. Denny <jdenny@clemson.edu>
1711
1712 tests: clean up push.at test group titles.
1713 * tests/push.at: Remove "Push Parsing: " from test group titles
1714 because these are already under the banner "Push Parsing Tests".
1715
4c56b131
AR
17162009-09-12 Alex Rozenman <rozenman@gmail.com>
1717
1718 Provide an additional sub-message for clarity.
1719 Add "symbol not found in production" error message when
1720 an "invalid reference" is detected in named references
1721 resolution.
1722 * src/scan-code.l: Update "invalid reference" case.
1723 * tests/named-ref.at: Adjust test-cases.
1724
93d0103d
JD
17252009-09-10 Joel E. Denny <jdenny@clemson.edu>
1726
1727 Clean up yacc.c a little.
1728 * data/yacc.c: Clean up M4 for readability, and make output
1729 whitespace more consistent. For the main parse function
1730 comment, instead of saying "yyparse or yypush_parse", say either
1731 "yyparse" or "yypush_parse" depending on which it actually is.
1732
628be6c9
JD
17332009-09-03 Joel E. Denny <jdenny@clemson.edu>
1734
1735 Complain about unused %define variables and %code qualifiers.
1736 * NEWS (2.5): Document.
1737 * data/bison.m4 (b4_check_user_names): Complain instead of warn.
1738 * doc/bison.texinfo (Decl Summary): Document complaint, and
1739 improve %define documentation a little otherwise.
1740 * tests/input.at (Reject unused %code qualifiers): Update.
1741 (%define errors): Update.
1742 (%define, --define, --force-define): Update.
1743 (%define backward compatibility): Update.
1744 (Unused %define api.pure): Update.
1745 * tests/push.at (Push Parsing: Unsupported Skeletons): Update.
1746
c842365a
JD
17472009-09-03 Joel E. Denny <jdenny@clemson.edu>
1748
1749 Use aver not assert.
1750 * src/output.c: Don't include assert.h.
1751 (output_skeleton): Use aver not assert.
1752 * src/system.h (aver): In documentation of why, add links to
1753 Paul Eggert's explanations in the mailing lists.
1754
14e568d7
AR
17552009-09-05 Alex Rozenman <rozenman@gmail.com>
1756
1757 Use "Unresolved reference" error message when no symbols were found
1758 in a symbolic reference resolution. Remove .expr and -expr from
1759 the shown reference when the reference is unresolved.
1760 * src/scan-code.l: Change the error message, adjust location columns,
1761 rename variable "exact_mode" to "explicit_bracketing".
1762 * tests/named-ref.at: Adjust existing tests and add a new one.
1763
dac8cc0d
AD
17642009-09-03 Akim Demaille <demaille@gostai.com>
1765
1766 * NEWS (2.4.2): Add "Internationalization" item.
1767
3710dd02
AD
17682009-09-03 Akim Demaille <demaille@gostai.com>
1769
1770 bootstrap: fix/improve find_tool.
1771 * bootstrap (find_tool): Improve error messages.
1772 Fix typo about find_tool_names.
1773
9852b61c
JD
17742009-08-29 Joel E. Denny <jdenny@clemson.edu>
1775
1776 Fix gcc 3.4.4 shadowing warning reported by Eric Blake.
1777 See
1778 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00093.html>.
1779 * src/scan-code.h (code_props_rule_action_init): Rename
1780 named_ref arg to name so it doesn't shadow named_ref type. This
1781 makes it consistent with the function definition in scan-code.l
1782 anyway.
1783
f37495f6
JD
17842009-08-28 Joel E. Denny <jdenny@clemson.edu>
1785
1786 %define: accept unquoted values.
1787 * NEWS (2.5): Group all %define changes together, and document
1788 this one. Remove quotes in IELR and canonical LR entry.
1789 * doc/bison.texinfo: Remove quotes in most examples throughout.
1790 (Decl Summary): Update %define documentation.
1791 (Table of Symbols): Likewise.
1792 * src/ielr.c (LrType): Update documentation.
1793 * src/parse-gram.y (content.opt): Add production for ID.
5bf2bf7a 1794 * tests/calc.at: Remove quotes in most tests.
f37495f6
JD
1795 * tests/existing.at: Likewise.
1796 * tests/input.at: Likewise.
1797 * tests/local.at: Likewise.
1798 * tests/push.at: Likewise.
1799 * tests/reduce.at: Likewise.
1800 * tests/torture.at: Likewise.
1801
3a414bbf
JD
18022009-08-28 Joel E. Denny <jdenny@clemson.edu>
1803
1804 %define lr.type: make values lowercase IDs.
1805 That is, "LALR" => "lalr", "IELR" => "ielr", and
1806 "canonical LR" => "canonical-lr".
1807 * NEWS (2.5): Update documentation.
1808 * doc/bison.texinfo (Decl Summary): Likewise.
1809 * src/ielr.c (ielr): Use new values.
1810 * src/ielr.h (ielr): Update documentation.
1811 * src/reader.c (prepare_percent_define_front_end_variables): Use
1812 and validate new values.
1813 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): Update test
1814 grammars.
1815 * tests/reduce.at (AT_TEST_LR_TYPE): Likewise.
1816
4bb975e1
EB
18172009-08-27 Eric Blake <ebb9@byu.net>
1818
1819 scan-gram: avoid portability trap with ctype usage.
1820 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
1821 Avoid compiler warning.
1822
74baf5c9
JD
18232009-08-27 Joel E. Denny <jdenny@clemson.edu>
1824
1825 tests: use perl for printing special sequences to files.
1826 And skip tests if perl is not available. This is better than
1827 playing tricks with shell portability. Suggested by Akim
1828 Demaille.
1829 * tests/input.at (Bad character literals): Use it here for
1830 omitting final newlines.
1831 (Bad escapes in literals): Use it here for special characters.
1832
d63e1279
JD
18332009-08-26 Joel E. Denny <jdenny@clemson.edu>
1834
1835 tests: show a use of %define lr.default-reductions "consistent"
1836 * tests/conflicts.at (%nonassoc and eof): Extend to test that it
1837 prevents the omission of expected tokens for %error-verbose.
1838
833d1720
AD
18392009-08-26 Akim Demaille <demaille@gostai.com>
1840
1841 tests: portability fix.
1842 * tests/input.at (Bad escapes in literals): Don't expect "echo
1843 '\0'" to output \ then 0.
1844
e4bcae3c
JD
18452009-08-26 Joel E. Denny <jdenny@clemson.edu>
1846
1847 Actually handle the yytable zero value correctly this time.
1848 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c: Don't
1849 mention zero values in the YYTABLE comments.
1850 * data/glr.c (yytable_value_is_error): Don't check for zero
1851 value.
1852 * data/lalr1.cc (yy_table_value_is_error_): Likewise.
1853 * data/yacc.c (yytable_value_is_error): Likewise.
1854 * data/lalr1.java (yy_table_value_is_error_): Likewise.
1855 (yysyntax_error): Fix typo in code: use yytable_ not yycheck_.
1856 * src/tables.h: In header comments, explain why it's useless to
1857 check for a zero value in yytable.
1858
d5eb0826
JD
18592009-08-25 Joel E. Denny <jdenny@clemson.edu>
1860
1861 More fixes related to last two patches.
1862 * data/c.m4 (b4_table_value_equals): Comment that YYID must be
1863 defined.
1864 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c: Fix
1865 yytable comments: zero indicates syntax error not default
1866 action.
1867 * data/glr.c (yyis_pact_ninf): Rename to...
1868 (yypact_value_is_default): ... this.
1869 (yyisDefaultedState): Update for rename.
1870 (yyis_table_ninf): Rename to...
1871 (yytable_value_is_error): ... this, and check for value zero
1872 besides just YYTABLE_NINF.
1873 (yygetLRActions): Check for default value from yypact. It
1874 appears that this check is always performed before this function
1875 is invoked, and so adding the check here is probably redundant.
1876 However, the code may evolve after this subtlety is forgotten.
1877 Also, update for rename to yytable_value_is_error. Because that
1878 macro now checks for zero, a different but equivalent branch of
1879 the if-then-else here is evaluated.
1880 (yyreportSyntaxError): Update for rename to
1881 yytable_value_is_error. The zero condition was mishandled
1882 before.
1883 (yyrecoverSyntaxError): Update for renames. No behavioral
1884 changes.
1885 * data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_):
1886 New function.
1887 (yy_table_value_is_error_): New function.
1888 (parse): Use new functions where possible. No behavioral
1889 changes.
1890 (yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_.
1891 The zero condition was mishandled before.
1892 * data/yacc.c (yyis_pact_ninf): Rename to...
1893 (yypact_value_is_default): ... this.
1894 (yyis_table_ninf): Rename to...
1895 (yytable_value_is_error): ... this, and check for value zero
1896 besides just YYTABLE_NINF.
1897 (yysyntax_error): Update for rename to yytable_value_is_error.
1898 The zero condition was mishandled before.
1899 (yyparse): Update for renames. No behavioral changes.
1900 * src/tables.h: Improve comments about yypact, yytable, etc.
1901 more. Most importantly, say yytable value of zero means syntax
1902 error not default action.
1903
1fa30307
JD
19042009-08-25 Joel E. Denny <jdenny@clemson.edu>
1905
1906 Fix %error-verbose for conflicts resolved by %nonassoc.
1907 * NEWS (2.5): Document.
1908 * data/glr.c (yyreportSyntaxError): Fix this by checking
1909 yyis_table_ninf.
1910 * data/yacc.c (yysyntax_error): Likewise.
1911 * data/lalr1.cc (yysyntax_error_): Fix this by checking
1912 yytable_ninf_.
1913 * data/lalr1.java (yysyntax_error): Likewise.
1914 * tests/conflicts.at (%nonassoc and eof): Update expected output
1915 and remove FIXME.
1916
77373efa
JD
19172009-08-25 Joel E. Denny <jdenny@clemson.edu>
1918
1919 Some code and documentation improvements.
1920 * data/c.m4 (b4_table_value_equals): New macro to capture
1921 some repeated code.
1922 * data/glr.c (yyis_pact_ninf): Use it here.
1923 (yyis_table_ninf): Likewise.
1924 (yyreportSyntaxError): Improve internal comments.
1925 * data/yacc.c (yyis_pact_ninf): New macro copied from glr.c.
1926 Use it everywhere possible.
1927 (yyis_table_ninf): Likewise.
1928 (yysyntax_error): Improve internal comments.
1929 * data/lalr1.cc (yysyntax_error_): Likewise.
1930 * data/lalr1.java (yysyntax_error): Likewise.
1931 * src/tables.h: Improve comments about yypact, yytable, etc.
1932
890ab17c
JD
19332009-08-21 Joel E. Denny <jdenny@clemson.edu>
1934
1935 Use locale when quoting.
1936 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
1937 quote rather than implementing quoting here.
1938
c5196098
EB
19392009-08-20 Eric Blake <ebb9@byu.net>
1940
aa50ba7b
EB
1941 Make previous patch more robust.
1942 * src/output.c (ARRAY_CARDINALITY): New macro, copied from
1943 argmatch.h.
1944 (output_skeleton): Use it.
1945 Suggested by Akim Demaille.
1946
c5196098
EB
1947 Import latest m4/m4.m4.
1948 * submodules/autoconf: Update to autoconf 2.64.
1949 * configure.ac (M4_GNU_OPTION): New define.
1950 * src/output.c (output_skeleton): Use it to resolve FIXME.
1951 * NEWS: Mention this.
1952
39fb7e62
JD
19532009-08-19 Joel E. Denny <jdenny@clemson.edu>
1954
1955 Fix complaints about escape sequences.
1956 Discussed starting at
1957 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
1958 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
1959 For a \0 and similar escape sequences meaning the null
1960 character, report an invalid escape sequence instead of an
1961 invalid null character because the latter does not actually
1962 appear in the user's input.
1963 In all escape sequence complaints, don't escape the initial
1964 backslash, and don't quote when the sequence appears at the end
1965 of the complaint line unless there's whitespace that quotearg
1966 won't escape.
1967 Consistently say "invalid" not "unrecognized".
1968 Consistently prefer "empty character literal" over "extra
1969 characters in character literal" warning for invalid escape
1970 sequences; that is, consistently discard those sequences.
1971 * tests/input.at (Bad escapes in literals): New.
1972
c33bc800
AD
19732009-08-19 Akim Demaille <demaille@gostai.com>
1974
1975 doc: fixes.
1976 * doc/bison.texinfo: Fix minor Texinfo errors.
1977
8fbbeba2
AD
19782009-08-19 Akim Demaille <demaille@gostai.com>
1979
1980 doc: %initial-action to initialize yylloc.
1981 Reported by Bill Allombert.
1982 * doc/bison.texinfo: Set fill-column to 76.
1983 (Location Type): Document the use of %initial-action to initialize
1984 yylloc.
1985
1874a474
JD
19862009-08-18 Joel E. Denny <jdenny@clemson.edu>
1987
1988 maint: update for gnulib's recent update-copyright changes
1989 * gnulib: Update.
1990 * .x-update-copyright (COPYING): Add as it's no longer implied
1991 when .x-update-copyright is present.
1992 * cfg.mk (update-copyright-local): Remove, now ignored.
1993 (update-copyright): Declare update-b4-copyright as a dependency.
1994
f4bfd5a9
AD
19952009-08-17 Akim Demaille <demaille@gostai.com>
1996
1997 build: require gettext 0.17.
1998
1999 Suggested by Bruno Haible.
2000 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
2001 * configure.ac: require gettext 0.17 to ensure compatibility with
2002 gnulib.
2003
2509eba6
AD
20042009-08-17 Akim Demaille <demaille@gostai.com>
2005
2006 build: lower gettext requirements.
2007
2008 Bison was uselessly requiring the formatstring macros from
2009 gettext, which resulted in mo files not being installed on systems
2010 that perfectly supported Bison mo files. Lower the requirement.
2011 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
2012
aa50ba7b
EB
2013 * configure.ac: Require need-ngettext instead of
2014 need-formatstring-macros.
2015 Reported by Martin Jabocs.
2016 Suggested by Bruno Haible.
2017 * INSTALL: Restructure.
2018 (Internationalization): New.
2509eba6 2019
314542f9
JD
20202009-08-14 Joel E. Denny <jdenny@clemson.edu>
2021
2022 maint: fix use of copyright year intervals.
2023 * gnulib: Update.
2024 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
2025 as now recommended in gnulib/NEWS.
2026 * build-aux/update-b4-copyright: Fix.
2027 * cfg.mk (update-copyright-env): Configure update-copyright.
2028
24985964
JD
20292009-08-13 Joel E. Denny <jdenny@clemson.edu>
2030
2031 Make it easier to write deterministic tests.
2032 Continues Akim's work from his 2009-06-10 commits.
2033 * src/reader.c (check_and_convert_grammar): Don't add any
2034 symbols after the first symbols_do invocation.
2035 * src/symtab.c (symbols_sorted): New static global.
2036 (user_token_number_redeclaration): Update comments.
2037 (symbol_from_uniqstr): If a new symbol is being created, assert
2038 that symbols_sorted hasn't been allocated yet.
2039 (symbols_free): Free symbols_sorted.
2040 (symbols_cmp, symbols_cmp_qsort): New functions.
2041 (symbols_do): Sort symbol_table into symbols_sorted on first
2042 invocation.
2043 * tests/input.at (Numbered tokens): Recombine tests now that the
2044 output should be deterministic across multiple numbers.
2045
47076da5
AD
20462009-08-12 Akim Demaille <demaille@gostai.com>
2047
2048 distcheck: fix.
2049
aa50ba7b 2050 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
47076da5 2051
36dfe466
JD
20522009-08-10 Joel E. Denny <jdenny@clemson.edu>
2053
2054 * tests/Makefile.am (TESTSUITE_AT): Add named-refs.at.
2055
07c0db18
JD
20562009-08-10 Joel E. Denny <jdenny@clemson.edu>
2057
2058 Miscellaneous code readability improvements.
2059
2060 * src/reader.c (reader): Move %define front-end variable
2061 defaults and checking into...
2062 (prepare_percent_define_front_end_variables): ... this new
2063 function.
2064
2065 * src/scan-gram.l (INITIAL): For consistency with string
2066 literals, don't store open quote on character literal. It's
2067 discarded before returning anyway.
2068 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
2069 Make length test more readable, and make the character stored
2070 for an empty literal more obvious while consistent with the
2071 previous behavior.
2072
2073 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
2074 USER_NUMBER_HAS_STRING_ALIAS throughout.
2075 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
2076 that is repeated in symtab.h. Improve argument names to make it
2077 clear which side of the symbol-string alias pair is which.
2078 (symbol_check_alias_consistency): Improve local variable names
2079 for the same purpose.
2080 * src/symtab.h (struct symbol): Make comments about aliases
2081 clearer.
2082 (symbol_make_alias): Improve comments and argument name.
2083 * src/output.c (token_definitions_output): Update for rename to
2084 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
2085
1a323c2f
AR
20862009-08-08 Alex Rozenman <rozenman@gmail.com>
2087
2088 Convert "misleading reference" messages to warnings.
2089 * src/scan-code.l: New function 'show_sub_messages', more
2090 factoring.
2091 * tests/named-ref.at: Adjust tests.
2092
38609c34
JD
20932009-08-06 Joel E. Denny <jdenny@clemson.edu>
2094
2095 maint: run "make update-copyright"
2096
642f240e
JD
20972009-08-06 Joel E. Denny <jdenny@clemson.edu>
2098
2099 maint: make update-b4-copyright easier to use
2100 * build-aux/update-b4-copyright: In warnings, report line
2101 numbers rather than character positions.
2102 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
2103 that update-copyright runs it.
2104 * gnulib: Update.
2105
d0caad01
JD
21062009-08-05 Joel E. Denny <jdenny@clemson.edu>
2107
2108 maint: clean up update-b4-copyright code
2109 * build-aux/update-b4-copyright: Do not accept 2-digit
2110 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
2111 Don't accept a `[' in a b4_copyright argument.
2112 Format code more consistently.
2113 Don't assume b4*copyright never occurs.
2114
ac2def56
JD
21152009-08-04 Joel E. Denny <jdenny@clemson.edu>
2116
2117 maint: automate b4_copyright updates.
2118 * Makefile.am (update-b4-copyright): New target rule.
2119 * build-aux/Makefile.am (EXTRA_DIST): Add update-b4-copyright.
2120 * build-aux/update-b4-copyright: New.
2121 * data/yacc.c: Remove stray characters around b4_copyright
2122 invocations.
2123
dbbb64f0
JD
21242009-08-04 Joel E. Denny <jdenny@clemson.edu>
2125
2126 maint: automate annual package-wide copyright-year update.
2127 * .x-update-copyright: New.
2128 * Makefile.am (EXTRA_DIST): Remove maint.mk.
2129 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
2130 update-copyright. Remove gnumakefile, which is implied by
2131 maintainer-makefile.
2132 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
2133 * gnulib: Update.
2134 * maint.mk: Remove, now copied from gnulib.
2135 * examples/extexi: Add missing "(C)" in copyright statement so
2136 update-copyright can recognize it.
2137 * src/LR0.h: Likewise.
2138 * src/print.h: Likewise.
2139 * src/print_graph.h: Likewise.
2140 * src/gram.c: Add missing comma in copyright statement.
2141 * src/gram.h: Likewise.
2142
bfa018d4
JD
21432009-08-04 Joel E. Denny <jdenny@clemson.edu>
2144
2145 Fix "make distcheck".
2146 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
2147 of just calc.stamp.
2148
4521fcdf
JD
21492009-08-01 Joel E. Denny <jdenny@clemson.edu>
2150
2151 Pacify "gcc -Wunused" for the input function from Flex.
2152 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
2153 and later.
2154 * src/scan-code.l: Add "%option noinput", which I cannot find in
2155 the Flex manual, but which Flex has supported since at least as
2156 far back as 2.5.4. However, if any of our developers still use
2157 Flex 2.5.4, they'll need to stop configuring with
2158 --enable-gcc-warnings because "%option noinput" didn't work
2159 correctly until Flex 2.5.6.
2160 * src/scan-gram.l: Likewise.
2161 * src/scan-skel.l: Likewise.
2162
992e874a
AR
21632009-07-31 Alex Rozenman <rozenman@gmail.com>
2164
2165 Fix --enable-gcc-warnings problems.
2166 * src/reader.c: Adjust variable names.
2167 * src/scan-code.l: Fix prototypes and adjust names.
2168 * src/named-ref.c: Remove redundant "if".
2169
a1ed2b71
JD
21702009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
2171
2172 Fix a --enable-gcc-warnings problem.
2173 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
2174 variable.
2175
cbc6a70e 21762009-07-24 Alex Rozenman <rozenman@gmail.com>
1e20ad11
AR
2177
2178 Fix some memory leaks.
2179 * src/named-ref.c: Add a pointer check (named_ref_free).
2180 * src/scan-code.l: New function (variant_table_free). Called in
2181 code_scanner_free.
2182 * src/symlist.c: Call to named_ref_free (symbol_list_free).
2183
ac9b0e95
JD
21842009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
2185
2186 Warn about character literals not of length one.
2187 * NEWS (2.5): Document.
2188 * src/scan-gram.l (INITIAL): Remove comment that we don't check
2189 the length.
2190 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
2191 * tests/input.at (Bad character literals): New test group.
2192
2de160e1
JD
21932009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
2194
2195 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
2196
cba97506
JD
21972009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
2198
2199 Some M4 cleanup in the testsuite.
2200 Suggested by Eric Blake at
2201 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
2202 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
2203 complicate the code by distinguishing between a missing value
2204 and an empty string value for an optional argument. This fix is
2205 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
2206 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
2207 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
2208 arguments are not needed because of the following changes.
2209 Fix stale comments.
2210 Bison developers should use GNU M4 and should not use
2211 POSIXLY_CORRECT when building the test suite, so do not
2212 complicate the code by avoiding $10 and above.
2213 Do not quote an empty string value for an optional argument, and
2214 do not distinguish between a missing value and an empty string
2215 value.
2216
62eb2d1b
JD
22172009-07-21 Joel E. Denny <jdenny@ces.clemson.edu>
2218
2219 * m4/m4.m4: Make it a sym link to submodules/autoconf/m4/m4.m4.
2220
620b2e36
JD
22212009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
2222
2223 Revert unnecessary column realignment in --help output.
2224 Reported by Akim Demaille at
2225 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
2226 * src/getargs.c (usage): Here.
2227
cbc6a70e 22282009-07-04 Alex Rozenman <rozenman@gmail.com>
dad6544d
AR
2229
2230 Alphabetical order in src/Makefile.am.
2231 * src/Makefile.am: Adjust.
2232
cbc6a70e 22332009-07-04 Alex Rozenman <rozenman@gmail.com>
d5e8574b
AR
2234
2235 Style changes and factoring.
2236 * src/named-ref.h: Add comments.
2237 * src/parse-gram.y: Readability and style changes.
2238 * src/reader.c: Factoring: assign_named_ref function.
2239 * src/scan-code.l: Factoring and style changes. Rename
2240 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
2241 Use "unsigned" type for variant index. Improve readablity.
2242 * src/scan-gram.l: Change error messages and add comments.
2243 * src/symlist.h: symbol_list_null: New function decl.
2244 * src/symlist.c: symbol_list_null: Implement here.
2245 * tests/named-refs.at: Adjust for new error messages.
2246
ae09ec85
EB
22472009-06-29 Eric Blake <ebb9@byu.net>
2248
2249 scan-code: avoid compiler warnings
2250 * src/scan-code.l (parse_named_ref): Use correct specifiers.
2251
80d653fd
AD
22522009-06-29 Akim Demaille <demaille@gostai.com>
2253
2254 build: avoid concurrent extraction of calc++.
2255 * examples/calc++/Makefile.am (calc.stamp): New.
2256 Depend on it to create the sources of calc++ so that concurrent
2257 builds don't launch several "extexi" in parallel.
2258 Not only this is inefficient, this also builds incorrect sources
2259 with several extractions mixed together.
2260
7685e2f7
AR
22612009-06-27 Alex Rozenman <rozenman@gmail.com>
2262
2263 Implement support for named symbol references.
2264 * src/parse-gram.y: Add new syntax (named_ref.opt).
2265 * src/reader.c: Store named refs in symbol lists.
2266 * src/reader.h: New argument for symbol_append and
2267 action_append functions.
2268 * src/scan-code.h: Add new field (named_ref) into
2269 code_props data structure. Keeps named ref of midrule
2270 actions.
2271 * src/scan-code.l: Support for named refs in semantic
2272 action code. New function 'parse_named_ref'.
2273 * src/scan-gram.l: Support bracketed id.
2274 * src/symlist.c: Store named refs in symbol lists.
2275 * src/symlist.h: New field in symbol list: named_ref.
2276 * src/named-ref.h: New file, a struct for named_ref.
2277 * src/named-ref.cp: New file, named_ref_new function.
2278 * src/local.mk: Add two new files.
2279 * tests/testsuite.at: Include new test group:
2280 * tests/named-refs.at: this new file.
2281
67f8cf51
AD
22822009-06-25 Akim Demaille <demaille@gostai.com>
2283
2284 hash: check insertion for memory exhaustion.
2285 * src/uniqstr.c (uniqstr_new): New.
2286
83b66ddd
AD
22872009-06-11 Akim Demaille <demaille@gostai.com>
2288
2289 style changes.
2290 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
2291 * src/print-xml.c: Style changes.
2292 * tests/conflicts.at: Comment changes.
2293
517cb0ad
AD
22942009-06-11 Akim Demaille <demaille@gostai.com>
2295
2296 xml: beware of user strings used to give a %prec to rules.
2297 * tests/conflicts.at (%prec with user strings): New.
2298 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
2299 XML output.
2300
75c7a52a
AD
23012009-06-11 Akim Demaille <demaille@gostai.com>
2302
2303 hash: check insertion for memory exhaustion.
2304 * src/muscle-tab.c (muscle_insert, muscle_grow)
2305 * src/state.c (state_hash_insert): Check the return value of
2306 hash_insert.
2307
66ed9753
AD
23082009-06-10 Akim Demaille <demaille@gostai.com>
2309
2310 deterministic test suite.
2311 Some consistency checks on symbols are performed after all the
2312 symbols were read, by an iteration over the symbol table. This
2313 traversal is nondeterministic, which can be a problem for test
2314 cases.
2315 Avoid this.
2316 Addresses another form of nondeterminism reported by Joel E. Denny.
2317 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
2318
2319 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
2320 test in two.
2321 Use different file names for the three tests to make the
2322 maintenance easier.
2323
ed15d907
AD
23242009-06-10 Akim Demaille <demaille@gostai.com>
2325
95d176ff
AD
2326 deterministic user-token-number redeclaration errors.
2327 Address nondeterminism reported by Joel E. Denny.
2328 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
2329
2330 * src/uniqstr.h: Comment changes.
2331 * src/location.h (boundary_cmp, location_cmp): New.
2332 * src/symtab.c (user_token_number_redeclaration): New.
2333 (symbol_translation): Use it.
2334 * tests/input.at (Numbered tokens): Adjust the expected output.
2335
23362009-05-25 Akim Demaille <demaille@gostai.com>
2337
ed15d907 2338 gnulib: update.
aa50ba7b
EB
2339 * gnulib: Update to latest.
2340 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
2341 * m4/.gitignore: Regen.
2342 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
2343 Call xalloc_die on hash_insert failures.
2344 Requested by the new __warn_unused_result__ attribute of
2345 hash_insert.
ed15d907 2346
e3a33f7c
JD
23472009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
2348
2349 Convert multiple variable definition warnings to complaints.
2350 * NEWS (2.5): Add a new entry for that change.
2351 * doc/bison.texinfo (Decl Summary): Update %define entry.
2352 (Bison Options): Update -D/--define/-F/--force-define entry.
2353 * src/muscle_tab.c (muscle_percent_define_insert): Implement.
2354 * src/muscle_tab.h (muscle_percent_define_insert): Update
2355 comments.
2356 * tests/input.at (`%define errors'): Update.
2357 (`%define, --define, --force-define'): Update.
2358
34d41938
JD
23592009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
2360
2361 -F/--force-define and relative %define/-D/--define priorities.
2362 * NEWS (2.5): Add documentation to -D/--define entry.
2363 * build-aux/cross-options.pl: Hard-code association of
2364 --force-define with %define.
2365 * doc/bison.texinfo (Decl Summary): In %define entry,
2366 cross-reference command-line options.
2367 (Bison Options): Add documentation to -D/--define entry.
2368 (Option Cross Key): Widen column for --force-define row.
2369 * src/getargs.c (usage): Document -F/--force-define. Realign
2370 options in output.
2371 (short_options, long_options, getargs): Parse -F/--force-define,
2372 and update muscle_percent_define_insert invocation.
2373 * src/muscle_tab.h (muscle_percent_define_how): New enum type.
2374 (muscle_percent_define_insert): Add argument with that type.
2375 * src/muscle_tab.c (muscle_percent_define_insert): Implement
2376 -F/--force-define behavior and priorities.
2377 * src/parse-gram.y (prologue_declaration): Update
2378 muscle_percent_define_insert invocations.
2379 * tests/input.at (`%define, --define'): Rename to...
2380 (`%define, --define, --force-define'): ... this and extend.
2381
246c4efa
JD
23822009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
2383
2384 Update some comments to make sense for -D.
2385 * data/bison.m4 (b4_check_user_names): In header comments, say
2386 "user occurrence" instead of "grammar occurrence".
2387 * src/muscle_tab.h (muscle_percent_define_insert): Likewise.
2388 (muscle_percent_code_grow): Likewise just for consistency.
2389
531683e7
JD
23902009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
2391
2392 * data/c++.m4: Update copyright year.
2393
e7bfa8b7
JD
23942009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
2395
2396 * data/c++.m4 (b4_namespace_close): Simplify slightly.
2397
8c221795
JD
23982009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
2399
2400 Handle a trailing `:' in a user-supplied C++ namespace better.
2401 * data/c++.m4 (b4_namespace_close): Don't let it be printed
2402 among the closing braces here. This fix might make the
2403 generated code easier to debug, but otherwise it should be
2404 insignificant because a trailing `:' is a C++ error already.
2405
c8bf65f0
AD
24062009-05-19 Akim Demaille <demaille@gostai.com>
2407
2408 remove useless variable.
2409 * src/getargs.c (skeleton_arg): Remove now useless variable.
2410 Should help the compiler see that this printf-like call is sane.
2411
7ac45a46
AD
24122009-05-11 Akim Demaille <demaille@gostai.com>
2413
2414 doc: use C++ headers.
2415 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
2416 headers.
2417
601bdfab
AD
24182009-05-05 Akim Demaille <demaille@gostai.com>
2419
2420 fix hexadecimal token number support.
2421 * src/scan-gram.l: Catch incorrect ids after hexadecimal numbers.
2422
d19123e6
AD
24232009-05-05 Akim Demaille <demaille@gostai.com>
2424
2425 tests: check token numbers.
2426 * tests/input.at (Numbered tokens): New.
2427
ecdfea9a
AD
24282009-05-04 Akim Demaille <demaille@gostai.com>
2429
2430 bison: catch bad symbol names.
2431 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
2432 * tests/input.at: Adjust.
2433
43e6aea5
AD
24342009-05-04 Akim Demaille <demaille@gostai.com>
2435
2436 space changes.
2437 * src/scan-gram.l: Untabify to be robust to zealous editors.
2438
c046698e
AD
24392009-05-04 Akim Demaille <demaille@gostai.com>
2440
2441 identifiers: dashes are letters.
2442 Dashes can now start identifiers (symbols and directives).
b10dd689 2443
c046698e
AD
2444 * src/scan-gram.l ({letter}): Add dash.
2445 ({id}): Remove it.
2446 * tests/input.at (Symbols): Adjust.
2447 Remove stray comment.
2448 * tests/regression.at (Invalid inputs): Adjust error message.
2449 * doc/bison.texinfo (Symbols): Update.
2450
966aba65
JD
24512009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
2452
2453 Declare %code to be a permanent feature.
2454 * NEWS (2.4.2): Here.
2455 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
2456 experimental.
2457 (Decl Summary): Likewise.
2458
812775a0
JD
24592009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
2460
2461 Convert underscores to dashes in some %define variable names.
2462 For now, just api.push-pull and lr.keep-unreachable-states.
2463 Maintain old names for backward compatibility.
2464 * NEWS (2.5): Document.
2465 * data/c.m4 (b4_identification): Update comment.
2466 * data/yacc.c: Update access.
2467 * doc/bison.texinfo: Update.
2468 * etc/bench.pl.in (bench_grammar): Update use.
2469 * src/files.c (tr): Move to...
2470 * src/getargs.c, src/getargs.h (tr): ... here because I can't
2471 think of a better place to expose it. My logic is that, for all
2472 uses of tr so far, command-line arguments can be involved, and
2473 getargs.h is already included.
2474 * src/main.c (main): Update access.
2475 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
2476 variable names to new variable names before assigning value.
2477 * src/reader.c (reader): Update setting default.
2478 * tests/calc.at: Update uses.
2479 * tests/conflicts.at (Unreachable States After Conflict
2480 Resolution): Update use.
2481 * tests/input.at (%define enum variables): Update use.
2482 (%define backward compatibility): New test group.
2483 * tests/push.at: Update uses.
2484 * tests/reduce.at: Update uses.
2485 * tests/torture.at: Update uses.
2486
1c4aa81d
JD
24872009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
2488
2489 Set all front-end %define defaults in one place.
2490 * src/main.c (main): Move lr.keep_unreachable_states default...
2491 * src/reader.c (reader): ... to here.
2492
1d0f55cc
JD
24932009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
2494
2495 Rename lr.default_reductions to lr.default-reductions.
2496 * NEWS (2.5): Here.
2497 * doc/bison.texinfo: Here.
2498 * src/lalr.c (initialize_LA): Here.
2499 * src/print.c (print_reductions): Here.
2500 * src/reader.c (reader): Here.
2501 * src/tables.c (action_row): Here.
2502 * tests/input.at (%define enum variables): Here.
2503 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
2504
0b593457
JD
25052009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
2506
2507 Pacify ./configure --enable-gcc-warnings.
2508 * tests/input.at (Symbols): Prototype yyerror and yylex.
2509
0939aa2d
AD
25102009-04-21 Akim Demaille <demaille@gostai.com>
2511
2512 tests: check the use of dashes and periods in symbols.
2513 * tests/input.at (Symbol): New test group.
2514
0b593457 25152009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
ae618dcc
JD
2516
2517 Document how `%define "var" "value"' is not M4-friendly.
2518 * src/parse-gram.y (variable): In comments here.
2519
0b593457 25202009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
6789b8bd
JD
2521
2522 Add copyright updates missed during previous cherry pick.
2523 * src/output.c: Here.
2524 * src/parse-gram.y: Here.
2525 * src/scan-gram.l: Here.
2526
663ce7bb
AD
25272009-04-20 Akim Demaille <demaille@gostai.com>
2528
2529 variables: accept dashes.
2530 * src/scan-gram.l ({id}): Also accept dashes after the initial
2531 letter.
2532 ({directive}): Use {id}.
2533 * src/parse-gram.y: Comment and formatting changes.
2534 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
2535 symbols.
2536 * src/complain.h, src/complain.c (yacc_at): New.
2537 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
2538 symbol names.
2539 * src/output.c (token_definitions_output): Do not #define token
2540 names with dashes.
2541
379261b3
JD
25422009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
2543
2544 Clean up recent patches a little.
2545 Reported by Akim Demaille.
2546 * doc/bison.texinfo (Understanding): Fix typos.
2547 * src/print.c (print_reductions): Don't use negated variable.
2548
25029e16
JD
25492009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
2550
2551 List accepted values for a %define enum variable with an invalid value.
2552 Suggested by Akim Demaille at
2553 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
2554 * data/bison.m4 (_b4_percent_define_check_values): Implement.
2555 * src/muscle_tab.c (muscle_percent_define_check_values): Implement.
2556 * tests/input.at (%define lr.default_reductions invalid values): Merge
2557 into...
2558 (%define enum variables): ... here, and update output.
2559
620b5727
JD
25602009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
2561
2562 Rename "default rule" to "default reduction".
2563 This includes changing variable names in code, changing
2564 comments, and renaming %define lr.default_rules to %define
2565 lr.default_reductions.
2566 * NEWS (2.5): Update IELR documentation.
2567 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c:
2568 Adjust YYDEFACT and yydefact_ documentation.
2569 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
2570 and lr.type documentation. Make some other wording
2571 improvements.
2572 (Glossary): Adjust cross-references and Default Reduction
2573 definition.
2574 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
2575 Remove a confusing comment pointed out by Akim Demaille.
2576 (initialize_LA): Adjust code.
2577 * src/print-xml.c (print_reductions): Adjust code.
2578 * src/print.c (print_reductions): Adjust code.
2579 * src/reader.c (reader): Adjust code.
2580 * src/tables.c (action_row): Adjust code.
2581 (token_actions): Adjust code.
2582 * src/tables.h: Adjust YYDEFACT documentation.
2583 * tests/input.at (%define lr.default_rules invalid values):
2584 Rename test group to...
2585 (%define lr.default_reductions invalid values): ... this, and
2586 update grammar file and expected output.
2587 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
2588 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
2589
34a6c2d1
JD
25902009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2591
2592 Document %define lr.type and lr.default_rules.
2593 * NEWS (2.5): Add an entry.
2594 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
2595 besides just LALR(1) and GLR(1).
2596 * doc/bison.texinfo (Introduction): Likewise.
2597 (Language and Grammar): Bison is no longer limited to LALR(1)
2598 restrictions.
2599 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
2600 when trying to distinguish from GLR. Talk about LR(1) grammars
2601 rather than LALR(1) grammars.
2602 (Decl Summary): In %define api.push_pull entry, say it applies
2603 to deterministic parsers in C rather than LALR(1) parsers in C.
2604 Add lr.default_rules entry.
2605 Add lr.type entry.
2606 (Mystery Conflicts): Bison is no longer limited to LALR(1)
2607 restrictions.
2608 (Generalized LR Parsing): Same changes as for the previous GLR
2609 section.
2610 (Memory Management): Say deterministic rather than LALR(1).
2611 (Understanding): Correct some bison output.
2612 Index discussion of "accepting state".
2613 Say deterministic rather than LALR(1).
2614 (Bison Options): In --yacc entry, say deterministic rather than
2615 LALR(1).
2616 In --report, --graph, and --xml entries, just don't mention
2617 LALR(1).
2618 (C++ Parsers): Say deterministic rather than LALR(1).
2619 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
2620 (Glossary): Add Accepting State, Consistent State, Default Rule,
2621 and IELR(1) definitions.
2622 In Generalized LR (GLR) definition, make same changes as in
2623 previous GLR sections.
2624 In LALR(1) definition, say Bison uses LALR(1) by default rather
2625 than implying Bison is limited to LALR(1).
2626 (LocalWords): Add IELR.
2627
f805dfcb
JD
26282009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2629
2630 Finish implementing %define lr.type.
2631 Its value can be "LALR", "IELR", or "canonical LR".
2632 * lib/timevar.def (TV_IELR_PHASE1): New var.
2633 (TV_IELR_PHASE2): New var.
2634 (TV_IELR_PHASE3): New var.
2635 (TV_IELR_PHASE4): New var.
2636 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
2637 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
2638 Sbitset.h, ielr.h, and ielr.c.
2639 * src/getargs.h, src/getargs.c (enum trace, trace_args,
2640 trace_types): Add trace_ielr.
2641 * src/lalr.h, src/lalr.c (ngotos): Export it.
2642 (F): Rename to...
2643 (goto_follows): ... this, update all uses, and export it.
2644 (set_goto_map): Export it.
2645 (map_goto): Export it.
2646 (compute_lookahead_tokens): Don't free goto_follows yet. Now
2647 handled in ielr.
2648 (initialize_LA): Export it. Move lookback allocation to...
2649 (lalr): ... here because, for canonical LR, initialize_LA must
2650 be invoked but lookback and much of the rest of LALR isn't
2651 needed.
2652 * main.c (main): Instead of lalr, invoke ielr, which invokes
2653 lalr.
2654 * src/reader.c (reader): Default lr.type to "LALR".
2655 Default lr.default_rules to "accepting" if lr.type is "canonical
2656 LR". Leave the default as "all" otherwise.
2657 Check for a valid lr.type value.
2658 * src/state.h, src/state.c (struct state_list): Add state_list
2659 member.
2660 (state_new): Initialize state_list member to NULL.
2661 (state_new_isocore): New function, exported.
2662 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
2663 exercises all values of lr.type.
2664 (GNU AWK Grammar): Rename test group to...
2665 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
2666 AT_TEST_EXISTING_GRAMMAR.
2667 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
2668 (GNU pic Grammar): Rename test group to...
2669 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
2670 AT_TEST_EXISTING_GRAMMAR.
2671 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
2672 all values of lr.type.
2673 (Single State Split): New test groups using AT_TEST_LR_TYPE.
2674 (Lane Split): Likewise.
2675 (Complex Lane Split): Likewise.
2676 (Split During Added Lookahead Propagation): Likewise.
2677
166366b2
JD
26782009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2679
2680 Add new files for IELR and canonical LR implementation.
2681 * src/AnnotationList.c: New.
2682 * src/AnnotationList.h: New.
2683 * src/InadequacyList.c: New.
2684 * src/InadequacyList.h: New.
2685 * src/Sbitset.c: New.
2686 * src/Sbitset.h: New.
2687 * src/ielr.c: New.
2688 * src/ielr.h: New.
2689
03c07b03
JD
26902009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
2691
2692 Implement %define lr.default_rules.
2693 Its value describes the states that are permitted to contain
2694 default rules: "all", "consistent", or "accepting".
2695 * src/reader.c (reader): Default lr.default_rules to "all".
2696 Check for a valid lr.default_rules value.
2697 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
2698 is "accepting", then only mark the accepting state as
2699 consistent.
2700 (initialize_LA): Tell state_lookahead_tokens_count whether
2701 lr.default_rules is "accepting".
2702 * src/tables.c (action_row): If lr.default_rules is not "all",
2703 then disable default rules in inconsistent states.
2704 * src/print.c (print_reductions): Use this opportunity to
2705 perform some assertions about whether lr.default_rules was
2706 obeyed correctly.
2707 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
2708 helps with checking the parser tables for a grammar.
2709 * tests/input.at (%define lr.default_rules invalid values): New
2710 test group.
2711 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
2712 AT_TEST_TABLES_AND_PARSE.
2713 (`no %define lr.default_rules'): New test group generated by
2714 AT_TEST_LR_DEFAULT_RULES.
2715 (`%define lr.default_rules "all"'): Likewise.
2716 (`%define lr.default_rules "consistent"'): Likewise.
2717 (`%define lr.default_rules "accepting"'): Likewise.
2718
44c124a3
AD
27192009-04-20 Akim Demaille <demaille@gostai.com>
2720
2721 Consistently refer to Yacc, not YACC.
2722 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
2723
42660736
JD
27242009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
2725
2726 Pacify make maintainer-check-posix.
2727 * tests/input.at (%define, --define): Move bison command-line
2728 options before grammar file name.
2729
a2d05674
JD
27302009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
2731
2732 Document semicolon warnings.
2733 * NEWS (2.5): Here.
2734
c4fae1ef
AD
27352008-12-08 Akim Demaille <demaille@gostai.com>
2736
2737 Fix portability issue in the test suite.
2738 * tests/local.at (AT_MATCHES_CHECK): New.
2739 Based on Perl instead of Sed. Sed has too many portability
2740 pitfalls, not ever Sed is GNU Sed.
2741 * tests/actions.at (Fix user actions without a trailing semicolon):
2742 Use it.
2743
42f4393a
DJ
27442008-12-07 Di-an Jan <dianj@freeshell.org>
2745
2746 Implement the FIXME that ends an user action with a semicolon
2747 if it seems necessary.
2748 * src/scan-code.l (flex rules section): Flag cpp directive from
2749 any `#' to the first unescaped end-of-line. Semicolon is not
2750 needed after `;', `{', '}', or cpp directives and is needed after
2751 any other token (whitespaces and comments have no effect).
2752 * tests/actions.at (Fix user actions without a trailing semicolon):
2753 New test.
2754 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
2755 to make user actions complete statements.
2756 Adjust column numbers in error messages.
2757 * tests/regression.at (Fix user actions without a trailing semicolon):
2758 Remove. Covered by new test.
2759
bd5df716
AD
27602009-04-14 Akim Demaille <demaille@gostai.com>
2761
2762 doc: minor fixes.
2763 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
2764 (Table of Symbols): Remove duplicate entry for %debug.
2765
7ba0d59d
EB
27662009-04-10 Eric Blake <ebb9@byu.net>
2767
2768 submodules: update to latest
2769 * submodules/autoconf: Use latest upstream Autoconf.
2770
b4d71a96
EB
27712009-04-06 Eric Blake <ebb9@byu.net>
2772
2773 Work around autoconf 2.63b bug in testsuite.
2774 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
2775 autoconf bug related to # in test.
2776
4ecd3681
JD
27772009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2778
2779 * NEWS (2.5): Describe new -D/--define feature.
2780
c65e5292
AD
27812008-11-10 Akim Demaille <demaille@gostai.com>
2782
2783 --trace=muscles
2784 * src/getargs.h, src/getargs.c (trace_muscle): New.
2785 (trace_types, trace_args): Support it.
2786 * src/output.c (output_skeleton): Use it.
2787
96002de2
AD
27882008-11-10 Akim Demaille <demaille@gostai.com>
2789
2790 muscles_output.
2791 * src/output.c (muscles_output): New, extracted from...
2792 (output_skeleton): here.
2793 Adjust.
2794
fadb13b5
AD
27952008-11-21 Akim Demaille <demaille@gostai.com>
2796
2797 Display the changes in cross-options.texi.
2798 * build-aux/cross-options.pl ($sep): New, to separate items.
2799 * doc/Makefile.am ($(srcdir)/cross-options.texi): Use diff to display
2800 the changes.
2801
72183df4
DJ
28022008-11-20 Di-an Jan <dianj@freeshell.org>
2803
2804 Improves options in the manual.
2805 * doc/bison.texinfo (-g, -x): Add space before argument.
2806 (Option Cross Key): Implement FIXME: listing directives also.
2807 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
2808 (Short Option): Special case -d. Put arguments inside @option.
fadb13b5 2809 (Bison Directive): Add column, automatically extracted from
72183df4
DJ
2810 src/scan-gram.l (actual name passed as the first argument)
2811 with special case for %define.
2812 * doc/Makefile.am (doc/cross-options.texi): Pass src/scan-gram.l
2813 to build-aux/cross-options.pl.
2814 * src/getargs.c (usage): Document limitations of cross-options.pl.
2815 * src/scan-gram.l: Likewise.
2816
e80b068c
AD
28172009-02-25 Akim Demaille <demaille@gostai.com>
2818
2819 Copyright years.
2820 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
2821
e3ee30b8
AD
28222008-12-08 Akim Demaille <demaille@gostai.com>
2823
2824 Install autoconf as a submodule to get m4sugar.
2825 * .gitmodules: Add submodules/autoconf.
2826 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
2827 submodules/autoconf.
2828
c4eb1e84
JD
28292008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2830
2831 Simplify last patch slightly.
2832 * src/getargs.c (getargs): Here.
2833
10fa0146
JD
28342008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2835
2836 Fix last warning from --enable-gcc-warnings.
2837 * src/getargs.c (getargs): Don't assign const address to non-const
2838 pointer.
2839
6f5be1ab
DJ
28402008-11-17 Di-an Jan <dianj@freeshell.org>
2841
2842 Handle --enable-gcc-warnings.
2843 * src/getargs.c (command_line_location): Set parameters to void.
2844
11c4e57d
AD
28452008-11-11 Akim Demaille <demaille@gostai.com>
2846
2847 AT_FULL_COMPILE.
2848 * tests/actions.at, tests/regression.at: Use it.
2849
e186a284
AD
28502008-11-07 Akim Demaille <demaille@gostai.com>
2851
2852 Pass command line location to skeleton_arg and language_argmatch.
2853 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
2854 The location argument is now mandatory.
2855 Adjust all dependencies.
2856 (getargs): Use command_line_location.
2857
e14c6831
AD
28582008-11-07 Akim Demaille <demaille@gostai.com>
2859
2860 -D, --define.
2861 * src/getargs.c (usage): Document -D.
2862 Fix help string for --locations.
2863 (command_line_location): New.
2864 (short_options, long_options, getargs): Support -D, --define.
2865 (getargs): Move -d support at the right place.
2866 * doc/bison.texinfo (Bison Options): Update.
2867 * tests/input.at (%define, --define): New.
2868
75c21b61
AD
28692008-11-07 Akim Demaille <demaille@gostai.com>
2870
2871 Initialize the muscle table before parsing the command line.
2872 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
2873 (getargs): Define file_name.
2874 * src/main.c (main): Initialize muscle_tab before calling
2875 getargs.
2876 * src/muscle_tab.c (muscle_init): No longer define file_name, as
2877 its value is not available yet.
2878
33d2a860
AD
28792008-11-09 Akim Demaille <demaille@gostai.com>
2880
2881 Require the generation of parse-gram.output.
2882 * src/Makefile.am (YACC): Pass --report=all.
2883
006faedf
JD
28842009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2885
2886 * NEWS (2.5): New stub.
2887
ecd1b61c
JD
28882009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2889
2890 Fix options documentation.
2891 * build-aux/cross-options.pl: As in --help output, write optional
2892 arguments as [=ARG] not =[ARG].
2893 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
2894
f67c4037
AD
28952008-11-07 Akim Demaille <demaille@gostai.com>
2896
2897 Fix --help.
2898 * src/getargs.c (usage): Fix help string for -W.
2899
0213d651
AD
29002008-11-07 Akim Demaille <demaille@gostai.com>
2901
2902 Handle more general types of option arguments.
2903 * build-aux/cross-options.pl: The argument ends at the first
2904 space, not the first non-symbol character.
2905 Use @var for each word appearing the argument description.
2906
c19178bf
JD
29072009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
2908
2909 Remove spurious initial empty lines.
2910 * data/location.cc: End the @output lines with an @.
2911
0d2b2ab0
AD
29122008-11-04 Akim Demaille <demaille@gostai.com>
2913
2914 Remove spurious initial empty lines.
2915 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
2916 * data/yacc.c: End the @output lines with an @.
2917
8ba62e3e
JD
29182009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
2919
2920 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
2921 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
2922 requirements for a correct m4 are stricter.
2923 * m4/m4.m4: Replace with Autoconf 2.63's m4/m4.m4.
2924 * configure.ac: Update to use AC_PROG_GNU_M4.
2925 Reported by Eric Blake.
2926
5bc993d9
JD
29272009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2928
2929 Help with updating web manual.
2930 * HACKING: Incorporate instructions from gnulib/doc/README.
2931 * bootstrap.conf (gnulib_modules): Add gendocs.
2932
580c075d
JD
29332009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2934
2935 Fix strange %define locations for default values.
2936 Reported by Akim Demaille at
2937 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
2938 and discussed again starting at
2939 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
2940 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
2941 because location information is bogus.
2942 Use angle brackets to delimit fake file name because square brackets
2943 look like underexpanded m4. Choose a better fake file name.
2944 Use negative line numbers.
2945 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
2946 * src/location.c (location_print): If line for a boundary is negative,
2947 only print that boundary's file name.
2948 * src/location.h: Document that.
2949 * tests/skeletons.at (%define Boolean variables: invalid skeleton
2950 defaults): Update output.
2951
5d3a1ecb
AD
29522008-11-07 Akim Demaille <demaille@gostai.com>
2953
2954 Locations without columns for command line arguments.
2955 * src/location.c (location_print): Don't display negative columns.
2956 * src/location.h: Document this.
2957
015e86a7
JD
29582009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
2959
2960 Add reminder about uploading public key to keys.gnupg.net.
2961 * HACKING (Release Procedure): Here.
2962
c1455bab
AD
29632009-03-31 Akim Demaille <demaille@gostai.com>
2964
2965 bootstrap: --help to stdout.
2966 * bootstrap (usage): Don't send --help to stderr.
2967 Use a here doc instead of a long string.
2968
2075a82a
AD
29692009-03-31 Akim Demaille <demaille@gostai.com>
2970
2971 bootstrap: README-hacking no longer exists
2972 * bootstrap (checkout_only_file): Set to HACKING.
2973
26fccd4d
AD
29742009-03-26 Akim Demaille <demaille@gostai.com>
2975
2976 doc: merge HACKING and README-hacking.
2977 Two files is confusing.
2978 Reported by Alexandre Duret-Lutz.
5bc993d9 2979
26fccd4d
AD
2980 * README-hacking: Merge into...
2981 * HACKING (Working from the repository): here.
2982
6469c4d7
AD
29832009-03-26 Akim Demaille <demaille@gostai.com>
2984
2985 doc: update README-hacking.
2986 * README-hacking: We now use git and git submodules.
2987 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
2988
b328890a
AD
29892009-03-26 Akim Demaille <demaille@gostai.com>
2990
2991 lalr1.cc: avoid GCC 4.3 warnings.
2992 GCC 4.3 now warns about "a || b && c" and asks for explicit
2993 parentheses.
2994 Reported by Alexandre Duret-Lutz.
2995 * data/location.cc: Update copyright years.
2996 (Position::operator==): Use parens to make precedence explicit.
2997 Compare lines and columns first, as they are more likely to be
2998 different, and they are faster to compare.
2999
f3079439
AD
30002009-03-26 Akim Demaille <demaille@gostai.com>
3001
3002 gnulib: update.
3003 * gnulib: Update to latest.
3004 * lib/Makefile.am (AM_CPPFLAGS): It is now defined by gnulib, so
3005 use +=.
3006
8defe11b
AD
30072009-01-08 Akim Demaille <demaille@gostai.com>
3008
3009 Fix grep portability issues.
3010 Grep on Solaris does not support -q.
3011 Reported by Summum Bonum.
5bc993d9 3012
8defe11b
AD
3013 * NEWS: Add a stub for 2.4.2.
3014 * THANKS: Add Summum Bonum.
3015 * tests/atlocal.in (EGREP): New.
3016 (CC, CXX, XSLTPROC): Make it possible to override them via
3017 envvars.
3018 * tests/java.at: Use $EGREP instead of egrep.
3019 Use AT_CHECK's ignore instead of grep's -q.
3020
41930e7a
JD
30212008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
3022
3023 Version 2.4.1.
3024 * NEWS: Set version and date.
3025 * lib/Makefile.am: Update copyright year.
3026 * tests/atlocal.in: Update copyright year.
3027
d07932ef
JD
30282008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
3029
3030 Semicolon feature removal is not about future language support.
3031 * NEWS: The semicolon feature is no longer active for newer languages,
3032 so don't claim that it causes trouble for them.
3033
0364b334
JD
30342008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
3035
3036 * gnulib: Update submodule to HEAD.
3037
876fd835
AD
30382008-12-09 Akim Demaille <demaille@gostai.com>
3039
3040 Update data/README.
3041 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
3042
bee1df15
EB
30432008-12-05 Eric Blake <ebb9@byu.net>
3044
3045 Build testsuite with newer autoconf.
3046 * tests/output.at (m4_expand): Don't override in newer autoconf,
3047 where the underlying implementation changed.
3048 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
3049 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
3050 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
3051 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
3052 since some of them contain unbalanced ')'.
3053
7e6d1e22
JD
30542008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
3055
3056 * NEWS: Clarify a little.
3057
a957d06c
JD
30582008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
3059
3060 * NEWS: Update for recent changes.
3061
462503f8
JD
30622008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
3063
3064 Fix unexpanded macros in GLR defines file.
3065 Reported by Csaba Raduly at
3066 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
3067 * THANKS (Csaba Raduly): Add.
3068 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
3069 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
3070 lexer in a separate module that includes the defines file.
3071 (AT_CHECK_CALC): Use AT_FULL_COMPILE and request compilation of lexer
3072 source.
3073 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
3074 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
3075 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
3076 (AT_DATA_SOURCE_PROLOGUE): New.
3077 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
3078 (AT_DATA_SOURCE): New.
3079 (AT_FULL_COMPILE): New, copied from master branch and extended to
3080 support an additional source file.
3081
bf151b75
JD
30822008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
3083
3084 Don't let maintainer-*-check targets force a version update.
3085 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
3086 handled.
3087
f56274a8
DJ
30882008-11-17 Di-an Jan <dianj@freeshell.org>
3089
3090 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
3091 Align menus. Adjust word wrapping. Use node names for menu names.
3092 (Examples): Don't abbreviate node names.
3093 (LocalWords): Remove abbreviations.
3094 (Copying): Make description a sentence.
bf151b75 3095 (Java Action Features): Remove period to match the rest of menu.
f56274a8 3096
b5775a81
PB
30972008-11-11 Paolo Bonzini <bonzini@gnu.org>
3098
3099 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
3100 * configure.ac: Adjust usage.
3101 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
3102 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
3103 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
3104
7ed73f82
JD
31052008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
3106
3107 Don't add a semicolon to actions for %skeleton or %language.
3108 It breaks Java test cases as reported by Akim Demaille.
3109 * src/scan-code.l: Implement.
3110
4b1ebc49
JD
31112008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
3112
3113 Clean up %skeleton and %language priority implementation.
3114 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
3115 remove static qualifier because others will soon need to see it.
3116 (language_prio): Likewise.
3117 (getargs): Use command_line_prio rather than 0.
3118 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
3119 enum fields.
3120 (skeleton_prio): Extern it.
3121 (language_prio): Extern it.
3122 * src/parse-gram.y: Use grammar_prio rather than 1.
3123
738cde3e
AD
31242008-11-04 Akim Demaille <demaille@gostai.com>
3125
3126 * NEWS: Mention the trailing semicolon in action.
3127
d6fb461d
AD
31282008-11-04 Akim Demaille <demaille@gostai.com>
3129
3130 Reformat NEWS.
3131 * NEWS: Use more outline-mode markup.
3132 Suggested by Jim Meyering.
3133
14da0cdd
JD
31342008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
3135
3136 Fix user actions without a trailing semicolon.
3137 Reported by Sergei Steshenko at
3138 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
3139 * THANKS (Sergei Steshenko): Add.
3140 * src/scan-code.l (SC_RULE_ACTION): Fix it.
3141 * tests/regression.at (Fix user actions without a trailing semicolon):
3142 New test case.
3143
c9ba9e59
JD
31442008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3145
3146 Initiate further development.
3147 * NEWS: Create an empty section for new entries.
3148 * gnulib: Update submodule to HEAD.
3149
bfb40910
JD
31502008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3151
3152 * NEWS: Version 2.4.
3153
241fda7a
JD
31542008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3155
3156 Prepare for next release.
3157 * NEWS: Briefly mention changes since 2.3b.
3158 * README: Say GNU m4 1.4.6, which we've been requiring in release
3159 announcements already, not 1.4.3, which breaks the build.
3160
ed4d67dc
JD
31612008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3162
3163 Say %language is experimental.
3164 We're thinking of extending it's effect on output file naming. See the
3165 thread at
3166 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
3167 * NEWS: Say it's experimental.
3168 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
3169 recommend it over %skeleton for now.
3170 (Bison Options): Likewise.
3171 (C++ Bison Interface): Use %skeleton not %language.
3172 (Calc++ Parser): Use %skeleton not %language.
3173 * src/getargs.c (usage): Say it's experimental.
3174
e254a580
DJ
31752008-11-01 Di-an Jan <dianj@freeshell.org>
3176 Paolo Bonzini <bonzini@gnu.org>
3177
3178 Support all Java parser class modifiers.
3179 * data/java.m4 (b4_percent_define_get3): New.
3180 (b4_final_if, b4_strictfp_if): New.
3181 * data/lalr1.java (final, strictfp, extends, implements): Support.
3182 * doc/bison.texinfo (final, strictfp, extends, implements): Add
3183 documentation.
3184 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
3185 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
3186 (AT_CHECK_JAVA_GREP): New.
3187 (Java parser class modifiers): New test.
3188 (Java parser class extends and implements): New test.
3189
3190 Model exception propagation better with throws and lex_throws.
3191 * data/java.m4 (b4_list2): New.
3192 (throws): Change default.
3193 * data/lalr1.java (yyaction): Add throws.
3194 (parse): Add lex_throws in addition to throws.
3195 * doc/bison.texinfo (throws, lex_throws): Add documentation.
3196 * tests/java.at (Java throws specifications): New test.
3197
3198 Improve documentation for Java parsers.
3199 * doc/bison.texinfo (Java Parsers): Add subsections.
3200 Don't quote first argument of %define.
3201 (Java Bison Interface): Document output files. Move documentation
3202 of parser class and merge into Java Parser Interface. Document
3203 features that error out. Document directives with no effect.
3204 Move note about Javadoc higher.
3205 (Java Semantic Values): Explicitly mention stype.
3206 Document that generic types cannot be used.
3207 (Java Location Values): Use @deftypeivar. Document constructors.
3208 Correct return value for toString.
3209 (Java Parser Interface): List undocumented constants/fields.
3210 Move documentation of fields added by %parse-param closer to list
3211 of members. Document that token names are added as fields.
3212 Document constructors accurately. Remove error method.
3213 (Java Scanner Interface): Move note on %pure-parser to Java Bison
3214 Interface. Describe %code lexer and yylex accutately.
3215 Remove documentation that does not match the code.
3216 (Java Action Features): New.
3217 (Java Differences): Add reference. Add item on semantic values.
3218 Add note about @{ ... @}. Clarify %% epilogue placement.
3219 (Java Declarations Summary): New.
3220
3221 Fix Java skeleton.
3222 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
3223 (b4_remove_comma): Quote test argument.
3224 (b4_identification): Remove "bison" field.
3225 * tests/java.at (Java parser class and package names): New test.
3226 (Java %parse-param and %lex-param): New test.
3227 (Java stype, position_class and location_class): New test.
3228
f259e4e6
PB
32292008-10-31 Di-an Jan <dianj@freeshell.org>
3230
3231 * data/lalr1.jave: Update copyright years.
3232 (YYParser): Correct name of "generated from" file in Javadoc:
3233 use b4_file_name instead of @ofile@.
3234 (Location constructor): Correct Javadoc parameter name.
3235 (yylloc): Add missing opening m4 quote after b4_location_if.
3236 This removes a stray [ in the Javadoc of Lexer.getStartPos.
3237 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
3238 (YYParser constructor): Correct Javadoc parameter name.
3239
cae5057f
JD
32402008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
3241
3242 Always put auxiliary code files in the same dir as other output files.
3243 * src/files.c (compute_file_name_parts): When the user specifies
3244 --output but not --file-prefix, extract the directory prefix from the
3245 file prefix not from the grammar file name. This affects the location
3246 of files like location.hh generated by the C++ skeleton. The includes
3247 in the other output files require this fix.
3248 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
3249 for expected output files.
3250 (Output files): Add a test for the above.
3251
4af432ba
JD
32522008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
3253
3254 * gnulib: Update submodule to HEAD.
3255
e26d4e43
JD
32562008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
3257
3258 Update copyright year.
3259 * src/files.c: Here.
3260
c0ee9e21
DJ
32612008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
3262
3263 Don't overwrite the input file.
3264 * src/files.c (output_file_name_check): Fatal error if using input file
3265 for output.
3266 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
3267 argument.
3268 (Conflicting output files): Add test.
3269
482dc52f
AD
32702008-10-28 Akim Demaille <demaille@gostai.com>
3271
3272 Space changes.
3273 * data/lalr1.cc: Formatting changes.
3274
52cbbe84
AD
32752008-10-28 Akim Demaille <demaille@gostai.com>
3276
3277 Don't define debugging functions when !YYDEBUG.
3278 * data/lalr1.cc (debug_stream, set_debug_stream)
3279 (debug_level_type, debug_level, set_debug_level): Don't
3280 declare them when YYDEBUG is not defined.
3281 The implementation are already YYDEBUG-aware.
3282
0925d5bf
AD
32832008-10-28 Akim Demaille <demaille@gostai.com>
3284
3285 Prefer "continue" for empty loop bodies.
3286 * etc/bench.pl.in: Use "continue" instead of {}.
3287
cf98343c
AD
32882008-10-28 Akim Demaille <demaille@gostai.com>
3289
3290 Space and comments changes.
3291 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
3292 * data/c.m4, data/lalr1.cc: Space changes.
3293
9f467b7d
AD
32942008-10-28 Akim Demaille <demaille@gostai.com>
3295
3296 Make gnulib a submodule.
3297 * gnulib: New.
3298 * .gitmodules (gnulib): New.
3299
0f0e1ace
JD
33002008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
3301
3302 Fix yyerror_range for user-defined location type in C++. Reported by
3303 Georg Sauthoff at
3304 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
3305 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
3306 * THANKS (Georg Sauthoff): Add.
3307
548e2104
JD
33082008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
3309
3310 Update several administrative files mainly to facilitate releasing.
3311 * HACKING (Administrivia): Make the git-merge-changelog notes more
3312 helpful.
3313 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
3314 (Release Procedure): Update for git and add numerous details that were
3315 previously missing.
3316 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
3317 * maint.mk (announcement): Don't list bison as a bootstrap tool so
3318 that announcements don't claim we bootstrapped with whatever bison
3319 happened to be in PATH. Add flex as a bootstrap tool.
3320 * Makefile.maint: Remove, previously replaced by maint.mk.
3321 * Makefile.cfg: Remove, and migrate settings to...
3322 * cfg.mk: ... here for the sake of `make announcement'.
3323 * bootstrap.conf (gnulib_modules): Add announce-gen.
3324 * README: Say GNU Bison instead of just Bison. Suggested by Karl
3325 Berry.
3326
ddf17a6e
PB
33272008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
3328
3329 Small but important bugfixes for the Java skeleton.
3330 * data/lalr1.java (yyerror): Change Location to b4_location_type.
3331 (yy_symbol_print): Call toString on yyvaluep.
3332
e1145ad8
AD
33332008-08-29 Akim Demaille <demaille@gostai.com>
3334
3335 Clarify UPDATED use.
bee1df15 3336 * doc/bison.texinfo: It refers to the last edition of this file,
e1145ad8 3337 not to the release date of Bison.
bee1df15 3338 Reported by Joel E. Denny.
e1145ad8 3339
0df72d78
AD
33402008-08-29 Akim Demaille <demaille@gostai.com>
3341
3342 * README: Update FAQ pointer.
3343 Reported by Joel E. Denny.
3344
9a90b6bb
EB
33452008-08-27 Eric Blake <ebb9@byu.net>
3346
3347 Resync m4sugar from autoconf.
3348 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
3349 (m4_init): Adjust to latest m4.git changes.
3350 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
3351 effects.
3352 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
3353 (_m4_list_cmp): Reduce side effects.
3354
65015668
AD
33552008-08-27 Akim Demaille <demaille@gostai.com>
3356
3357 Check yyerrok in calc.at.
bee1df15
EB
3358 * tests/calc.at (calc.y): Use yyerrok on "( error )".
3359 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
3360 expected.
65015668 3361
98e26a92
AD
33622008-08-27 Akim Demaille <demaille@gostai.com>
3363
3364 Support yyerrok in lalr1.cc.
3365 YYBACKUP is still to import back into lalr1.cc.
bee1df15 3366 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
98e26a92 3367
86c0e784
JD
33682008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
3369
3370 For maintainer-check*, don't recompile for a $(VERSION) update.
3371 * cfg.mk: New file.
3372 (_is-dist-target): Override the one in GNUmakefile.
3373 * Makefile.am (EXTRA_DIST): Add cfg.mk.
3374
88511166
JD
33752008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
3376
3377 Update for recent change to gnulib.
3378 * src/parse-gram.y: Don't include strverscmp.h. It comes from
3379 string.h now.
3380
6bbb2ed5
EB
33812008-08-15 Eric Blake <ebb9@byu.net>
3382
d67c52e8
EB
3383 Remaining m4sugar merge from autoconf.
3384 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
3385 * data/m4sugar/foreach.m4: New file, copied from autoconf.
3386 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
3387 * src/output.c (output_skeleton): Tell m4 how to find it.
3388
6bbb2ed5
EB
3389 Partial m4sugar merge from autoconf: m4_map.
3390 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
3391 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
3392 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
3393 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
3394 for empty list.
3395 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
3396 Likewise.
3397 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
3398 declares it.
3399
8dce3875
JD
34002008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
3401
3402 Keep .version and PACKAGE_VERSION in sync.
3403 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
3404 dependency, and add comments justifying this in more detail. Discussed
3405 starting at
3406 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
3407
882a1fbf
EB
34082008-08-06 Eric Blake <ebb9@byu.net>
3409
a3764451
EB
3410 Partial m4sugar merge from autoconf: m4_shiftn.
3411 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
3412 (m4_shift2, m4_shift3): New macros.
3413 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
3414 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
3415 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
3416 * data/java.m4 (b4_remove_comma): Likewise.
3417
882a1fbf
EB
3418 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
3419 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
3420 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
3421 (m4_init): Consolidate wrapped text into single m4_wrap.
3422 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
3423 in wrapped text.
3424
a30e920d
EB
34252008-08-05 Eric Blake <ebb9@byu.net>
3426
dfcc5959
EB
3427 Partial m4sugar merge from autoconf: builtins, version.m4.
3428 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
3429 (m4_prepend): Remove, as it is unused and inherently quadratic,
3430 whereas m4_append is linear in newer m4.
3431 (m4_mkstemp): New builtin.
3432 (m4_symbols): Make rename conditional.
3433 (m4_version_prereq): Ensure fatal error if used in bison, which
3434 intentionally lacks version.m4.
3435
a30e920d
EB
3436 Fix comments in m4sugar.
3437 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
3438
445b7470
JD
34392008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
3440
3441 Update for recent .gitignore fix in Gnulib.
3442 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
3443 anchored .gitignore entries.
3444
a1e50014
JD
34452008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
3446
3447 Set gnu or gnits strictness.
3448 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
3449 development and gnits strictness for releases. Based on Eric Blake's
3450 suggestion at
3451 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
3452
d43f77e7
PB
34532008-07-31 Paolo Bonzini <bonzini@gnu.org>
3454
3455 * NEWS: Clarify documentation of %language.
3456
fee2ed87
PB
34572008-07-31 Paolo Bonzini <bonzini@gnu.org>
3458
3459 Support usage of git-merge-changelog.
3460 * .gitattributes: New.
3461 * HACKING: Document usage of git-merge-changelog.
3462 * bootstrap: Install git-merge-changelog entries in .git/config
3463 if appropriate.
3464
78029cd5
JD
34652008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3466
3467 Remove remaining dependence on CVS Id keyword.
3468 * ChangeLog: For the sake of people still using CVS, don't use dollars
3469 when mentioning Id.
3470 * data/xslt/bison.xsl: Remove Id from header comments, where it was
3471 unusual anyway.
3472 * data/xslt/xml2dot.xsl: Likewise.
3473 * data/xslt/xml2text.xsl: Likewise.
3474 * data/xslt/xml2xhtml.xsl: Likewise.
3475 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
3476 * doc/Makefile.am (neutralize): Remove, no longer needed.
3477 (.x.1): Don't use neutralize.
3478 (edit): Don't substitute for ID.
3479 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
3480
c53d18b1
JD
34812008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3482
3483 Fix dependence on computed configure variables.
3484 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
3485 $(top_srcdir)/configure.ac so that changes to computed variables, such
3486 as PACKAGE_VERSION, are seen.
3487 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
3488
5523ac79
JD
34892008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
3490
3491 Update copyright dates for recent changes.
3492 * Makefile.am: Here.
3493 * src/Makefile.am: Here.
3494 * src/reduce.c: Here.
3495 * tests/reduce.at: Here.
3496
8fa36911
JD
34972008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
3498
3499 Use git-version-gen for version names between releases.
3500 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
3501 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
3502 * .prev-version: New.
3503 * .version.in: Remove.
78029cd5 3504 * ChangeLog: Remove the Id previously used for capturing the CVS
8fa36911
JD
3505 revision.
3506 * GNUmakefile: Remove, now copied from Gnulib.
3507 * Makefile.am: Add code suggested by comments in
3508 build-aux/git-version-gen.
3509 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
3510 .prev-version, and .version.
3511 * NEWS (2.3b+): Rename to...
3512 (?.?): ... this because we're dropping the "+" version naming scheme,
3513 but, in general, we still can't be sure of our next release name.
3514 * bootstrap: Add a quick hack to remove from .gitignore the
3515 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
3516 entry. This should really be fixed in gnulib instead.
3517 * bootstrap.conf (gnulib_modules): Add gnumakefile.
3518 * configure.ac (AC_INIT): Set version name by invoking
3519 build-aux/git-version-gen.
3520 (AC_CONFIG_FILES): Remove .version, now generated by
3521 build-aux/git-version-gen.
3522 * maint.mk: New, copied from coreutils.
3523 * doc/.cvsignore (bison.1): Add.
3524 * doc/.gitignore (/bison.1): Add.
3525 * doc/bison.1: Remove, generated.
3526 * src/.cvsignore (revision.c): Remove.
3527 * src/.gitignore (/revision.c): Remove.
3528 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
3529 (BUILT_SOURCES): Remove revision.c.
3530 (revision.c): Remove.
3531 * src/getargs.c (version): Don't print revision after the VERSION.
3532 * src/revision.h: Remove.
3533
bcf07cb7
JD
35342008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
3535
3536 Fix untranslatable composition of sentences. Reported by Goran
3537 Uddeborg at
3538 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
3539 * THANKS (Goran Uddeborg): Add.
3540 * src/reduce.c (reduce_print): Report the number of nonterminals and
3541 rules useless in the grammar in separate sentences.
3542 * tests/reduce.at (Useless Rules): Update output.
3543 (Reduced Automaton): Likewise.
3544 (Underivable Rules): Likewise.
3545 (Empty Language): Likewise.
3546
9aacab9a
JD
35472008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
3548
3549 Fix some .gitignore and .cvsignore problems.
3550 * bootstrap (insert_sorted_if_absent): Replace all uses with...
3551 (insert_vc_ignore): ... this new function, which prepends `/' to all
3552 .gitignore entries before passing them to insert_sorted_if_absent.
3553 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
3554 .cvsignore files are maintained even though Bison developers run
3555 bootstrap while using Git.
3556 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
3557 unneeded by Bison.
3558 (gnulib): Add.
3559 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
3560 unneeded. Reported by Eric Blake.
3561 * lib/.gitignore (/*~): Add.
3562 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
3563 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
3564 Blake.
3565 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
3566
a9fc7990
JD
35672008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
3568
3569 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
3570 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
3571 * bootstrap.conf (gnulib_modules): Add unsetenv.
3572 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
3573 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
3574 (/setenv.m4): Add.
3575 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
3576 the first argument because it may become position-dependent, and unset
3577 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
3578 Add comments explaining these issues in more detail.
3579
0f1d6f10
JD
35802008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
3581
3582 Add .gitignore everywhere based on .cvsignore.
3583 * .gitignore: New.
3584 * build-aux/.gitignore: New.
3585 * data/.gitignore: New.
3586 * doc/.gitignore: New.
3587 * etc/.gitignore: New.
3588 * examples/.gitignore: New.
3589 * examples/calc++/.gitignore: New.
3590 * lib/.gitignore: New.
3591 * m4/.gitignore: New.
3592 * po/.gitignore: New.
3593 * runtime-po/.gitignore: New.
3594 * src/.gitignore: New.
3595 * tests/.gitignore: New.
3596
7bd1665a
JD
35972008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
3598
3599 * NEWS (2.3b+): New section, empty for now.
3600 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
3601
72c5b982
JD
36022008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
3603
3604 * NEWS (2.3b): Update release date since there has been a delay in
3605 getting the announcements and tarballs out.
3606
bd02cd5d
JD
36072008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
3608
3609 * NEWS: Version 2.3b.
3610 * configure.ac (AC_INIT): Likewise.
3611 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
3612
9126263e
JD
36132008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
3614
3615 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
3616 been doing it for years.
3617 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
3618 (Release Procedure): Add FIXME about make alpha being unmaintained.
3619
fa6aa7b3
JD
36202008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
3621
3622 * data/yacc.c: Reformat m4 a little for readability.
3623 * src/lalr.c (build_relations): Correct comment.
3624
d30b312d
JMG
36252008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3626
3627 DJGPP specific issue.
3628 * djgpp/config.sed: Fixes required to run configure scripts generated
3629 by autoconf 2.62.
3630
138d4cd9
JD
36312008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
3632
3633 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
3634 coordinator@translationproject.org.
3635
8f7e2e1f
JD
36362008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3637
3638 * THANKS: Add Eric Blake.
3639
f55efa38
JD
36402008-04-23 Eric Blake <ebb9@byu.net>
3641
3642 Revert prior patch, by working around autoconf regression.
3643 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
3644 ("Output file name: ("): Uncomment test.
3645 ("Output file name: )"): Likewise.
3646 Based on an idea from Noah Misch.
3647
096c9f9d
JD
36482008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
3649
3650 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
3651 2.61. Reported by Juan Manuel Guerrero at
3652 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
3653 * tests/output.at ("Output file name: ("): Comment out test case for
3654 now.
3655 ("Output file name: )"): Likewise.
3656
0f664b89
JD
36572008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
3658
3659 * GNUmakefile: Update git-version-gen invocation so make dist
3660 succeeds.
3661
1cfe6375
JD
36622008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
3663
3664 Update to the current gnulib CVS repository, and fix trigraph handling
3665 in Bison.
3666 * bootstrap: Update gnulib CVS repository URL.
3667 (symlink_to_dir): Encapsulate the code that guarantees the destination
3668 directory exists into...
3669 (check_dst_dir): ... this new function, and...
3670 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
3671 fail when copying files into lib/uniwidth/.
3672 * src/output.c (prepare_symbols): When writing yytname muscles, where
3673 symbol names will be encoded in C-string literals, tell quotearg to
3674 escape trigraphs. This used to be the default in gnulib.
3675 * tests/regression.at (Token definitions): Because of the change in
3676 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
3677 escapes trigraphs in symbol names. Thus, yytname no longer has
3678 trigraphs unnecessarily doubly escaped. Update test case output.
3679 Extend test case to be sure Bison's own error messages will no longer
3680 have trigraphs in symbol names unnecessarily escaped once.
3681
74c52fc8
JD
36822008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
3683
3684 Fix make dist infinite loop reported by Juan Manuel Guerrero at
3685 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
3686 * .cvsignore: Add .version.
3687 * .version.in: New.
3688 * bootstrap.conf (gnulib_modules): Add git-version-gen.
3689 * configure.ac (AC_CONFIG_FILES): Add .version.
3690 * build-aux/.cvsignore: Add git-version-gen.
3691
8e55b3aa
JD
36922008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
3693
3694 * NEWS (2.3a+): Mention that -g now takes an argument.
3695 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
3696 consistency. Update the -g and -x entries now that they take
3697 arguments. Use brackets to indicate optional arguments.
3698 * src/getargs.c (usage): Explain the relationship between arguments of
3699 long and short options more completely. Document --defines and -d
3700 separately since the former takes an argument but, for POSIX Yacc, the
3701 latter does not.
3702 (short_options): Let -W take an optional argument like --warnings.
8452fdd9 3703 (getargs): Sort cases.
8e55b3aa 3704
59c5ac72
AD
37052008-02-28 Akim Demaille <demaille@gostai.com>
3706
3707 * doc/bison.texinfo: Fix a few typos.
3708
118d4978
AD
37092008-02-28 Akim Demaille <akim@epita.fr>
3710
3711 * doc/bison.texinfo (Bison Options): Document -W.
3712 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
3713
7020f1e9
AD
37142008-02-28 Akim Demaille <akim@epita.fr>
3715
3716 * src/getargs.c (short_options): Split and sort for readability.
3717 -g and -x take optional arguments, just like their long options.
3718 * build-aux/cross-options.pl: Use /x to make the regexp easier to
3719 understand.
3720 Fix the handling of $opt which resulted in all the argument to be
3721 considered as optional.
3722
59da312b
JD
37232008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
3724
3725 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
3726 say its interface is experimental.
3727 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
3728 Java.
3729 (Bison Options): In the -L and --language entry, mention Java.
3730 (Java Bison Interface): Say the interface is experimental.
3731 * src/getargs.c (usage): Mention -L and --language.
3732
3733 * NEWS (2.3a+): Say the push parsing interface is experimental.
3734 * doc/bison.texinfo (Push Decl): Likewise.
3735 (Decl Summary): Likewise in the "%define api.push_pull" entry.
3736 (Push Parser Function): Likewise.
3737 (Pull Parser Function): Likewise.
3738 (Parser Create Function): Likewise.
3739 (Parser Delete Function): Likewise.
3740 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
3741 yypull_parse, and yypush_parse entries.
3742
3743 * NEWS (2.3a+): Mention XML support, and say the schema is
3744 experimental.
3745 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
3746 * src/getargs.c (usage): Say the XML schema is experimental.
3747
3748 * NEWS (2.3a+): Say option instead of flag.
3749
2bb3ebec
WP
37502008-02-21 Wojciech Polak <polak@gnu.org>
3751
3752 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
3753 text.
3754
333e670c
JD
37552008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
3756
3757 Fix impure push parser compile error reported by Bob Rossi at
3758 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
3759 * data/yacc.c: Clean up whitespace in the output a little.
3760 (yypstate_allocated): Define for impure push parsers regardless of
3761 whether the pull interface is also requested.
3762 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
3763 check impure push parsers without the pull interface.
3764
3765 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
3766 yyerror takes arguments specified by %parse-param while yypstate_new
3767 does not.
3768 * doc/bison.texinfo (Parser Create Function): Document that
3769 yypstate_new returns 0 for multiple impure parser instances.
3770 * tests/push.at (Push Parsing: Multiple impure instances): Update
3771 expected stderr output.
3772
798096e1
JD
37732008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
3774
3775 * runtime-po/POTFILES.in (push.c): Remove.
3776
9ca7f077
JD
37772008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
3778
3779 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
3780 * data/push.c: Rename to...
3781 * data/yacc.c: ... this, overwriting it.
3782 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
3783 `%push-pull-parser' -> `%define api.push_pull "both"'.
3784 Remove old yacc.c tests, and update push.c tests to yacc.c.
3785
42ee26bb
JD
37862008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
3787
3788 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
3789 `"%code top" blocks' instead of `%code "top" blocks'.
3790 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
3791 Clean up whitespace in the output a little.
3792
b1cc23c4
JD
37932008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
3794
3795 Fix documentation problems reported by Tim Josling at
3796 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
3797 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
3798 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
3799 integers. Explain the effect of literal string aliases on error
3800 messages. Copy token 0 documentation from the C++ skeleton
3801 documentation.
3802
ab7f29f8
JD
38032008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
3804
3805 Accept a token number in a %left, %right, or %nonassoc for POSIX
3806 conformance. Reported by Tim Josling at
3807 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
3808 * NEWS (2.3a+): Mention.
3809 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
3810 and code numbers are treated by precedence declarations.
3811 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
3812 of symbols.1.
3813 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
3814 of symbol.
3815 (symbol.prec): New, just like symbol but allows INT.
3816 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
3817 longer holds.
3818 * tests/regression.at (Token number in precedence declaration): New
3819 test case.
3820
a924ef36
JMG
38212008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3822
3823 DJGPP specific issues.
3824 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
3825 be changed. Copyright timestamp adjusted.
3826 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
3827 be changed. Copyright timestamp adjusted.
3828 * djgpp/config.site: Copyright timestamp adjusted.
3829 * djgpp/config_h.sed: Copyright timestamp adjusted.
3830 * djgpp/djunpack.bat: Copyright timestamp adjusted.
3831 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
3832 filename translation list.
3833 * djgpp/subpipe.c (init_subpipe): Check the environment variables
3834 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
3835 files shall be created. Before trying to use the temp dir where the
3836 environment variable points to check that the dir really exists. If
3837 not default to the cwd as temp dir. Copyright timestamp adjusted.
3838 * djgpp/subpipe.h: Copyright timestamp adjusted.
3839 * djgpp/testsuite.sed: Copyright timestamp adjusted.
3840
389c8cfd
PE
38412008-01-30 Paul Eggert <eggert@cs.ucla.edu>
3842
3843 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
3844
5d1cfef4
PE
38452008-01-09 Paul Eggert <eggert@cs.ucla.edu>
3846
3847 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
3848 Problem reported by Claudio Saavedra in
3849 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
3850
e2dcf996
WP
38512008-01-05 Wojciech Polak <polak@gnu.org>
3852
3853 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
3854 document's title with the input grammar file name.
3855
da730230
JD
38562007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
3857
3858 Automate regression testing of the XML/XSLT implementation. Discussed
3859 starting at
3860 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
3861 * configure.ac (XSLTPROC): New substitution.
3862 * Makefile.am (maintainer-xml-check): New phony target invoking...
3863 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
3864 invoking make maintainer-check with BISON_TEST_XML=1.
3865 * tests/atlocal.in (XSLTPROC): New.
3866 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
3867 not to report reachable memory when Bison is expected to have a
3868 non-zero exit status and (2) to compare XML/XSLT output with --graph
3869 and --report=all output for every working grammar when
3870 BISON_TEST_XML=1.
3871 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
3872 (AT_BISON_CHECK_XML): New.
3873 (AT_QUELL_VALGRIND): New.
3874 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
3875 (AT_CHECK): ... don't redefine this since this was the old way to
3876 quell Valgrind.
3877 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
3878 AT_BISON_CHECK invocations.
3879 * tests/c++.at: Likewise.
3880 * tests/calc.at: Likewise.
3881 * tests/conflicts.at: Likewise.
3882 * tests/cxx-type.at: Likewise.
3883 * tests/existing.at: Likewise.
3884 * tests/glr-regression.at: Likewise.
3885 * tests/headers.at: Likewise.
3886 * tests/input.at: Likewise.
3887 * tests/java.at: Likewise.
3888 * tests/output.at: Likewise.
3889 * tests/push.at: Likewise.
3890 * tests/reduce.at: Likewise.
3891 * tests/regression.at: Likewise.
3892 * tests/sets.at: Likewise.
3893 * tests/skeletons.at: Likewise.
3894 * tests/synclines.at: Likewise.
3895 * tests/torture.at: Likewise.
3896 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
3897 tends to hang xsltproc.
3898 (Big horizontal): Likewise.
3899
408476bc
JD
39002007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
3901
3902 In XML output, remove redundant class attribute on symbol element.
3903 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
3904 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
3905 look up a symbol to determine whether it's a nonterminal or terminal.
3906 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
3907 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
3908
3909 Add prec/assoc information to XML output.
3910 * src/gram.c (grammar_rules_print_xml): For each rule that has a
3911 %prec, add a percent_prec attribute.
3912 * src/print-xml.c (print_grammar): For each terminal that has a
3913 precedence or associativity, add a prec or assoc attribute.
3914 (xml_indent): New.
3915 (xml_puts): Use xml_indent.
3916 (xml_printf): Use xml_indent.
3917 * src/print-xml.h (xml_indent): Prototype.
3918
3919 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
3920 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
3921
d4a26c48
JD
39222007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
3923
3924 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
3925 (bison:ruleByNumber): ... this for clarity.
3926 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
3927 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
3928 (xsl:template match="reduction"): Update.
3929 (xsl:template match="item"): Update.
3930 (xsl:template match="reduction"): Update.
3931
3932 In the XML output, don't print the list of rules where symbols appear.
3933 Compute it in XSLT instead. Discussed at
3934 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
3935 * data/xslt/bison.xsl (bison:ruleByLhs): New.
3936 (bison:ruleByRhs): New.
3937 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
3938 bison:ruleByRhs.
3939 (xsl:template match="terminal/rule"): Remove.
3940 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
3941 bison:ruleByRhs.
3942 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
3943 Remove.
3944 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
3945 bison:ruleByRhs and mode="number-link" for rule template.
3946 (xsl:template match="terminal/rule"): Remove.
3947 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
3948 bison:ruleByRhs and mode="number-link" for rule template.
3949 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
3950 Rewrite as...
3951 (xsl:template match="rule" mode="number-link"): ... this.
3952 * src/print-xml.c (print_grammar): Don't print the list of rules.
3953
ef1b4273
JD
39542007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
3955
3956 Don't let --report affect XML output; always print all information.
3957 Discussed at
3958 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
3959 * src/conflicts.c (log_resolution): Implement.
3960 * src/print-xml.c (print_core): Implement.
3961 (print_state): Implement.
3962 (print_xml): Implement.
3963
3964 * NEWS (2.3a+): Fix quotes.
3965 * src/parse-gram.y (prologue_declaration): For consistency with -v,
3966 don't let %verbose clear the list specified by --report.
3967
0f6cd9e3
AD
39682007-11-26 Akim Demaille <akim@epita.fr>
3969
3970 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
3971
d80fb37a
JD
39722007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
3973
3974 In the XML output, list useless and unused symbols and rules with the
3975 useful ones and add a "usefulness" attribute. Discussed starting at
3976 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
3977 * src/gram.c (grammar_rules_partial_print_xml): Remove.
3978 (grammar_rules_print_xml): Print all rules instead of just those
3979 useful in the grammar, and add a "usefulness" attribute.
3980 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
3981 * src/print-xml.c (print_rules_useless_in_parser): Remove.
3982 (print_grammar): Print all nonterminals instead of just useful ones,
3983 and add a "usefulness" attribute to nonterminals and terminals.
3984 (print_xml): Don't print a separate "reductions" or
3985 "rules-useless-in-parser" element.
3986 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
3987 (reduce_xml): Remove.
3988 (reduce_token_unused_in_grammar): New.
3989 (reduce_nonterminal_useless_in_grammar): New.
3990 * src/reduce.h (reduce_xml): Remove prototype.
3991 (reduce_token_unused_in_grammar): Add prototype.
3992 (reduce_nonterminal_useless_in_grammar): Add prototype.
3993 * data/xslt/xml2text.xsl: Update for XML changes.
3994 * data/xslt/xml2xhtml.xsl: Update for XML changes.
3995 * tests/reduce.at (Useless Terminals): Update output.
3996 (Useless Rules): Update output.
3997 (Reduced Automaton): Update output.
3998
3999 Say "Terminals unused in grammar" instead of "Unused terminals".
4000 * NEWS (2.3a+): Update.
4001 * doc/bison.texinfo (Understanding): Update example output.
4002 * src/reduce.c (reduce_output): Implement.
4003 * data/xslt/xml2text.xsl: Implement.
4004 * data/xslt/xml2xhtml.xsl: Implement.
4005
1bb2bd75
JD
40062007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
4007
4008 Accept --report-file=FILE to override the default `.output' filename.
4009 * NEWS (2.3a+): Mention.
4010 * doc/bison.texinfo (Bison Options): Add an entry.
4011 * src/files.c (compute_output_file_names): Don't override
4012 spec_verbose_file if already set.
4013 * src/getargs.c (usage): Document --report-file.
4014 (REPORT_FILE_OPTION): New anonymous enum member.
4015 (long_options): Add entry for it.
4016 (getargs): Add case for it setting spec_verbose_file.
4017
4018 * build-aux/cross-options.pl: Don't record a short option just because
4019 there's an arg.
4020 * doc/.cvsignore: Add yacc.1.
4021
a005a9c4
AD
40222007-11-14 Akim Demaille <akim@epita.fr>
4023
4024 * doc/yacc.1.in: New.
4025 * configure.ac, doc/Makefile.am: Adjust.
4026 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
4027 config.h symbol.
4028 Use AC_SUBST for assignments too.
4029 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
4030
cff03fb2
JD
40312007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4032
4033 * src/gram.c: Remove comments that duplicate comments in gram.h.
4034
4035 When reporting useless rules and nonterminals, say "useless in grammar"
4036 instead of "useless", and say "useless in parser" instead of "never
4037 reduced". Discussed starting at
4038 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
4039 * NEWS (2.3a+): Mention this change.
4040 * data/xslt/xml2text.xsl: Update output text and expected input XML
4041 element names to match changes below.
4042 * data/xslt/xml2xhtml.xsl: Likewise.
4043 (xsl:template match="bison-xml-report"): Add missing entry in Table of
4044 Contents: "Rules useless in parser due to conflicts".
4045 * doc/bison.texinfo (Decl Summary): Reword a little.
4046 (Understanding): Update example output for changes below.
4047 * src/gram.c: (rule_useful_p): Rename to...
4048 (rule_useful_in_grammar_p): ... this.
4049 (rule_useless_p): Rename to...
4050 (rule_useless_in_grammar_p): ... this.
4051 (rule_never_reduced_p): Rename to...
4052 (rule_useless_in_parser_p): ... this.
4053 (grammar_rules_print): Update for renames.
4054 (grammar_rules_print_xml): Update for renames.
4055 (grammar_rules_never_reduced_report): Rename to...
4056 (grammar_rules_useless_report): ... this since it is used for either
4057 kind of useless rule.
4058 * src/gram.h: Reword comments and update function names in prototypes.
4059 * src/main.c (main): Say "rule useless in parser due to conflicts".
4060 * src/print-xml.c (print_rules_never_reduced): Rename to...
4061 (print_rules_useless_in_parser): ... this, and rename output XML
4062 element "rules-never-reduced" to "rules-useless-in-parser".
4063 (print_xml): Update for rename.
4064 * src/print.c (print_results): Say "Rules useless in parser due to
4065 conflicts".
4066 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
4067 (nonterminals_reduce): Say "nonterminal useless in grammar".
4068 (reduce_output): Say "Nonterminals useless in grammar".
4069 Say "Rules useless in grammar".
4070 (reduce_xml): Rename output XML element "useless" to
4071 "useless-in-grammar".
4072 (reduce_print): Don't report the count of grammatically useless rules
4073 as "rules never reduced" just because %yacc is specified.
4074 In the correct report of this count, say nonterminal(s) and rule(s)
4075 "useless in grammar".
4076 * tests/conflicts.at (S/R in initial): Update expected output.
4077 (Defaulted Conflicted Reduction): Likewise.
4078 (Unreachable States After Conflict Resolution): Likewise.
4079 * tests/existing.at (GNU pic Grammar): Likewise.
4080 * tests/reduce.at (Useless Nonterminals): Likewise.
4081 (Useless Rules): Likewise.
4082 (Reduced Automaton): Likewise.
4083 (Underivable Rules): Likewise.
4084 (Empty Language): Likewise.
4085
66f0441d
JD
40862007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
4087
4088 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
4089 here document and before the EOF so that BSD's implementation of Bourne
4090 shell doesn't parse the delimiter as part of the here document.
4091 * doc/.cvsignore: Add cross-options.texi.
4092 * src/getargs.c (usage): Add a blank line after the warning categories.
4093
d0ee4105
PB
40942007-11-08 Paolo Bonzini <bonzini@gnu.org>
4095
4096 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
4097
e8b1fb9b
AD
40982007-11-05 Akim Demaille <akim@epita.fr>
4099
4100 Remove Id: from bison.1.
4101 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
4102 (perl -0777 -pi -e 's/\.PP\nId): New.
4103 (.x.1): Use it to ignore the version control revision.
4104
2f7a96b5
AD
41052007-11-05 Akim Demaille <demaille@gostai.com>
4106
4107 * build-aux/Makefile.am: Ship cross-options.pl.
4108 * doc/Makefile.am: Always refer to cross-options.texi with
4109 $(srcdir).
4110 (MAINTAINERCLEANFILES): Add it.
4111
f4101aa6
AD
41122007-11-04 Akim Demaille <demaille@gostai.com>
4113
4114 Generate the long/short option cross-table.
4115 * build-aux/cross-options.pl: New.
4116 * doc/Makefile.am (cross-options.texi): New.
4117 * doc/bison.texinfo: Use it.
4118
727a1401
AD
41192007-11-04 Akim Demaille <demaille@gostai.com>
4120
4121 Generate bison.1 using help2man.
4122 * doc/common.x, doc/bison.x: New.
4123 * doc/Makefile.am (bison.1, .x.1): New.
4124 The code is taken from autoconf-2.61/man/Makefile.am.
4125 * configure.ac: Look for help2man.
4126
6aeb9c57
AD
41272007-11-04 Akim Demaille <demaille@gostai.com>
4128
4129 Complete --help.
4130 * src/getargs.c (usage): Document -W, make it clear that -d,
4131 -g and -x have optional arguments.
4132
d7be4085
AD
41332007-11-04 Akim Demaille <demaille@gostai.com>
4134
4135 Find sha1sum when named gsha1sum.
4136 * bootstrap (find_tool): New.
4137 ($SHA1SUM): New.
4138
d9df47b6
JD
41392007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
4140
4141 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
4142 at
4143 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
4144 * NEWS (2.3a+): Mention.
4145 * data/bison.m4 (b4_pure_if): Don't define it here.
4146 * data/c.m4 (b4_identification): Depend on individual skeletons to
4147 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
4148 values of the %define variables api.pure or api.push_pull. Define
4149 YYPURE, YYPUSH, and YYPULL accordingly.
4150 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
4151 glr.cc has already defined b4_pure_flag.
4152 * data/push.c: Define b4_pure_if based on `%define api.pure'.
4153 Remove YYPUSH and YYPULL since they're back in b4_identification again.
42ee26bb 4154 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
d9df47b6
JD
4155 * doc/bison.texinfo (Pure Decl): Update.
4156 (Push Decl): Update.
4157 (Decl Summary): Add api.pure to %define entry.
4158 In %pure-parser entry, say it's deprecated and reference %define.
4159 (Pure Calling): Update.
4160 (Error Reporting): Update.
4161 (C++ Scanner Interface): Update.
4162 (How Can I Reset the Parser): Update.
4163 (Table of Symbols): In %pure-parser entry, say it's deprecated and
4164 reference %define.
4165 * src/getargs.c (pure_parser): Remove global variable.
4166 * src/getargs.h (pure_parser): Remove extern.
4167 * src/output.c (prepare): Don't define pure_flag muscle.
4168 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
4169 wrapper around `%define api.pure'.
4170 * tests/calc.at (Simple LALR Calculator): Update.
4171 (Simple GLR Calculator): Update.
4172 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
4173 Update.
4174 (GLR: Resolve ambiguity, pure, locations): Update.
4175 (GLR: Merge conflicting parses, pure, no locations): Update.
4176 (GLR: Merge conflicting parses, pure, locations): Update.
4177 * tests/glr-regression.at (Uninitialized location when reporting
4178 ambiguity): Update
4179 * tests/input.at (Unused %define api.pure): New test case.
4180 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
4181 AT_PURE_IF and AT_PURE_AND_LOC_IF.
4182 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
4183
c373bf8b
JD
41842007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
4185
4186 %define push_pull -> %define api.push_pull. Discussed starting at
4187 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
4188 * data/push.c: Expect the new name.
4189 * data/yacc.c: Likewise.
4190 * doc/bison.texinfo (Push Decl): Update.
4191 (Decl Summary): Update %define entry.
4192 (Push Parser Function): Update.
4193 (Pull Parser Function): Update.
4194 (Parser Create Function): Update.
4195 (Parser Delete Function): Update.
4196 * tests/calc.at (Simple LALR Calculator): Update.
4197 * tests/input.at (%define enum variables): Update.
4198 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
4199 (Push Parsing: Multiple impure instances): Update.
4200 (Push Parsing: Unsupported Skeletons): Update.
4201 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
4202 (Exploding the Stack Size with Malloc): Update.
4203
4204 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
4205 other entries some.
4206
32f19b6b
JD
42072007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
4208
4209 For the XML output's terminal element, rename @number to @token-number,
4210 and add @symbol-number. In the nonterminal element, rename @number to
4211 @symbol-number. Discussed starting at
4212 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
4213 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
4214 renames.
4215 (xsl:template match="nonterminal"): Likewise.
4216 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
4217 (xsl:template match="nonterminal"): Likewise.
4218 * src/print-xml.c (print_grammar): Implement.
4219
255a6b90
JD
42202007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4221
4222 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
4223 2007-10-11 change, the child elements here are items not rules.
408476bc 4224 (xsl:template match="item"): New.
255a6b90
JD
4225 (xsl:template match="rule"): Update for new reduced itemset.
4226 (xsl:template match="point"): Remove.
4227 (xsl:template match="empty"): For consistency with --graph, don't
4228 output "/* empty */".
4229 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
4230 line-wrap, don't pass a negative value as first-line-length since this
4231 won't work with the following changes.
4232 (xsl:template name="line-wrap"): Simplify slightly.
4233 (xsl:template name="ws-search"): Eliminate recursion.
4234 * src/print_graph.c (print_core): Don't print a reduction's lookahead
4235 set next to an item whose dot is not at the end of the RHS even if it
4236 happens to be associated with the same rule.
4237
88c78747
JD
42382007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
4239
31984206
JD
4240 Add %define lr.keep_unreachable_states.
4241 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
4242 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
4243 * src/main.c (main): Implement it.
4244 * tests/conflicts.at (Unreachable States After Conflict Resolution):
4245 Extend to test it, and fix a typo.
4246
42472007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
4248
4249 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
4250 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
4251 the example .output text.
4252 * tests/regression.at (Extra lookahead sets in report): Improve wording
4253 of comments.
4254
b7a70162
WP
42552007-10-17 Wojciech Polak <polak@gnu.org>
4256
4257 * src/print-xml.c (print_grammar): Renamed
4258 <terminal> and <nonterminal> attributes:
4259 "type" to "number" and "symbol" to "name".
4260 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
4261 Use new attribute names.
4262 (xsl:template match="nonterminal"): Likewise.
4263 * data/xslt/xml2xhtml.xsl: Likewise.
4264
a0de5091
JD
42652007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
4266
4267 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
4268 (Option Cross Key): Likewise.
4269
4270 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
4271 next to an item whose dot is not at the end of the RHS even if it
4272 happens to be associated with the same rule.
4273 * src/print.c (print_core): Likewise.
4274 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
4275 (Resolved SR Conflicts): Update output.
4276 * tests/regression.at (Extra lookahead sets in report): New test case.
4277
4c20d18d
WP
42782007-10-11 Wojciech Polak <polak@gnu.org>
4279
4280 * src/print-xml.c (print_core): Remove item set
4281 redundancy.
4282 * data/xslt/bison.xsl (bison:ruleNumber): New key.
4283 Improve processing time. Suggested by Joel E. Denny.
4284 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
4285 Write xsl:param "required" attribute as comment.
4286 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
4287 (xsl:template match="rule"): Support new reduced itemset.
4288 (xsl:template match="point"): Remove.
4289 * data/xslt/xml2xhtml.xsl: Likewise.
4290
f506ad1c
JD
42912007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
4292
4293 * src/getargs.c (version): Update copyright year.
4294
21f1b063
JD
42952007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
4296
4297 Make xml2dot.xsl and --graph produce the same output.
4298 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
4299 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
4300 escaped later.
4301 (xsl:template name="output-node"): Use the new escape template instead
4302 of the string-replace template directly.
4303 (xsl:template name="output-edge"): Likewise.
4304 (xsl:template name="escape"): New, escapes backslashes and newlines in
4305 addition to quotation marks.
4306 * src/graphviz.c (start_graph, output_node, output_edge): Add
4307 whitespace to output for legibility.
4308
4309 Make xml2text.xsl and --report produce the same output, and remove the
4310 XML "conflicts" element since a conflict summary is easily extracted
4311 from the automaton.
4312 * data/xslt/bison.xsl: New.
4313 (xsl:template match="state" mode="bison:count-conflicts): New.
4314 * data/xslt/xml2text.xsl: Import bison.xsl.
4315 (xsl:template match="bison-xml-report"): Instead of styling the
4316 "conflicts" element, style the "automaton" element with mode
4317 "conflicts". Unlike the former, the latter lists S/R and R/R
4318 conflicts for a state on the same line.
4319 (xsl:template match="conflicts"): Remove.
4320 (xsl:template match="conflict"): Remove.
4321 (xsl:template match="terminal"): Line-wrap the list of rules in which
4322 the terminal is used.
4323 (xsl:template match="nonterminal"): Likewise for nonterminals.
4324 (xsl:template match="automaton" mode="conflicts"): New.
4325 (xsl:template match="state" mode="conflicts"): New.
4326 (xsl:template name="line-wrap"): New.
4327 (xsl:template name="ws-search"): New.
4328 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
4329 (xsl:template match="bison-xml-report"): Instead of styling the
4330 "conflicts" element, style the "automaton" element with mode
4331 "conflicts."
4332 (xsl:template match="conflicts"): Remove.
4333 (xsl:template match="conflict"): Remove.
4334 (xsl:template match="automaton" mode="conflicts"): New.
4335 (xsl:template match="state" mode="conflicts): New.
4336 * src/conflicts.c (conflicts_output_xml): Remove.
4337 * src/conflicts.h (conflicts_output_xml): Remove prototype.
4338 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
4339 * src/print.c (print_grammar): Consistently wrap at the 66th column so
4340 the corresponding XSLT is easier. Also, never wrap between a word and
4341 the comma that follows it.
4342
793fbca5
JD
43432007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
4344
4345 Improve C++ namespace support. Discussed starting at
4346 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
4347 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
4348 b4_namespace_close): New macros that interpret the %define variable
4349 "namespace" so its value can contain "::" to indicate nested
4350 namespaces.
4351 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
4352 the above macros.
4353 * data/lalr1.cc (b4_namespace): Likewise.
4354 * data/location.cc (b4_namespace): Likewise.
4355 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
4356 inside a new table in the general %define entry. Document `%define
4357 namespace' there as well. Point the %name-prefix entry to it since it
4358 explains it more completely in the case of C++.
4359 (C++ Bison Interface): Mention `%define namespace' instead of
4360 %name-prefix.
4361 (Table of Symbols): Remove the `%define push_pull' entry. The %define
4362 entry suffices.
4363 * tests/c++.at (Relative namespace references): New test case.
4364 (Absolute namespace references): New test case.
4365 (Syntactically invalid namespace references): New test case.
4366 * tests/input.at (C++ namespace reference errors): New test case.
4367
35b8730d
JD
43682007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
4369
4370 Add syncline support and location accessor to internal %define
4371 interfaces.
4372 * data/bison.m4 (b4_percent_define_get_loc): New.
4373 (b4_percent_define_get_syncline): New.
4374 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
4375 (b4_percent_define_default): Record defining location as line 1 rather
4376 than 0 for the sake of synchronizing #line's, and define
4377 b4_percent_define_syncline(VARIABLE).
4378 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
4379 * src/muscle_tab.c (muscle_syncline_grow): New.
4380 (muscle_code_grow): Use muscle_syncline_grow.
4381 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
4382 define b4_percent_define_syncline(VARIABLE).
4383 (muscle_percent_define_get_loc): New.
4384 (muscle_percent_define_get_syncline): New.
4385 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
4386 remove some unused variables.
4387 (muscle_percent_define_default): Record defining location as line 1
4388 rather than 0 for the sake of synchronizing #line's, and define
4389 b4_percent_define_syncline(VARIABLE).
4390 (muscle_percent_define_check_values): Use
4391 muscle_percent_define_get_loc.
4392 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
4393 (muscle_percent_define_get_syncline): Prototype.
4394 * tests/skeletons.at (%define Boolean variables: invalid skeleton
4395 defaults): Update output for location change.
4396 (Complaining during macro argument expansion): Extend to test
4397 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
4398
7dc4a694
JD
43992007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
4400
4401 Fix some error-reporting macro bugs.
4402 * data/bison.m4 (b4_cat): New.
4403 (b4_error, b4_error_at): Use b4_cat to send error directives directly
4404 to stdout so they don't become arguments to other macros. Update
4405 comments and add examples.
4406 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
4407 add examples.
4408 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
4409 after printing the error directive so that M4 doesn't report subsequent
4410 problems that are induced by this problem.
4411 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
4412 instead of just in them. Recognize @\n in both places. Both expand to
4413 the empty string. Needed by b4_cat.
4414 * tests/skeletons.at (Complaining during macro argument expansion):
4415 New test case.
4416 (Fatal errors make M4 exit immediately): New test case.
4417
d4bd2295
JD
44182007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
4419
4420 Implement --print-datadir.
4421 * src/getargs.c (usage): Mention.
4422 (PRINT_DATADIR_OPTION): New anonymous enum member.
4423 (long_options): Add entry for it.
4424 (getargs): Add case for it calling compute_pkgdatadir.
4425 * src/output.c (output_skeleton): Encapsulate data directory
4426 computation from here...
4427 (prepare): ... and from here...
4428 (compute_pkgdatadir): ... into this new function.
4429 * src/output.h (compute_pkgdatadir): Prototype.
4430
34cdeddf
JD
44312007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
4432
4433 * src/print-xml.c (escape_bufs): New static global variable
4434 replacing...
4435 (xml_escape_n): ... the static local variable buf here.
4436 (print_xml): Free memory for escape_bufs.
4437 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
4438
d782395d
JD
44392007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
4440
4441 Replace `%push-parser' and `%push-pull-parser' with
4442 `%define push_pull "push"' and `%define push_pull "both"'.
4443 `%define push_pull "pull"' is the default.
4444 * doc/bison.texinfo (Push Decl, Push Parser Function,
4445 Pull Parser Function, Parser Create Function, Parser Delete Function):
4446 Update declarations.
4447 (Decl Summary, Table of Symbols): Replace %push-parser and
4448 %push-pull-parser entries with a %define push_pull entry.
4449 * data/bison.m4 (b4_percent_define_check_values): New macro.
4450 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
4451 definitions...
4452 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
4453 definitions...
4454 * data/push.c: ... to here and compute them from the value of the
4455 %define variable push_pull.
4456 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
4457 parsing requests here...
4458 * data/yacc.c: ... hack this to switch to push.c any time
4459 b4_use_push_pull_flag or the %define variable push_pull is set. This
4460 will go away when we mv push.c yacc.c.
4461 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
4462 push parsing is not supported since unused %define variables are
4463 reported anyway.
4464 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
4465 * src/muscle_tab.h (muscle_percent_define_check_values): Update
4466 comments for consistency with b4_percent_define_check_values.
4467 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
4468 muscles.
4469 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
4470 Remove.
4471 (prologue_declaration): Remove %push-parser and %push-pull-parser
4472 rules.
4473 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
4474 * tests/calc.at: Update declarations.
4475 * tests/input.at (%define enum variables): New test case.
4476 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
4477 declaration.
4478 (Push Parsing: Multiple impure instances): Update declaration.
4479 (Push Parsing: Unsupported Skeletons): New test case.
4480 * tests/torture.at (Exploding the Stack Size with Alloca): Update
4481 declaration.
4482 (Exploding the Stack Size with Malloc): Update declaration.
4483
3f999f78
WP
44842007-09-24 Wojciech Polak <polak@gnu.org>
4485
4486 Add XSLT transformations.
4487
4488 * data/xslt/xml2dot.xsl: Transform XML into DOT.
4489 * data/xslt/xml2text.xsl: Transform XML into plain text.
4490 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
4491 * data/Makefile.am (xsltdir): New variable.
4492 (dist_xslt_DATA): Add xslt/*.xsl files.
4493
a4f75309
PE
44942007-09-23 Paul Eggert <eggert@cs.ucla.edu>
4495
4496 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
4497 Problem reported by Wojciech Polak.
4498 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
4499 (xml_printf): Undo change I made on 21 September; that is,
4500 indent 2 spaces, not 1.
4501
ad5feac4
JD
45022007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
4503
4504 Pacify ./configure --enable-gcc-warnings.
4505 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
4506 `char const *' instead of `char *'.
4507 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
4508 local variable `sep'.
4509
41d7a5f2
PE
45102007-09-21 Paul Eggert <eggert@cs.ucla.edu>
4511
4512 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
4513 elsewhere.
4514 * src/print-xml.c: Prefer "const" after types; that's more consistent.
4515 (xml_printf): Indent just 1 space for level.
4516 (e_char, xlate_char): Remove.
4517 (xml_escape_string): Rewrite to avoid undefined behavior (used
4518 storage that was freed from the stack).
4519 (xml_escape_n): Don't bother checking for subscript error.
4520
3f999f78
WP
45212007-09-21 Wojciech Polak <polak@gnu.org>
4522
4523 Add Bison XML Automaton Report.
41d7a5f2
PE
4524
4525 Add support for an -x option to generate an XML report.
4526 It is not documented yet.
4527 * src/print-xml.c: New file.
4528 * src/print-xml.h: Likewise.
4529 * lib/timevar.def (TV_XML): New var.
4530 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
4531 * src/conflicts.c: Include print-xml.h.
4532 (solved_conflicts_xml_obstack): New var.
4533 (log_resolution, conflicts_solve, conflicts_free):
4534 Add support for XML report.
4535 (conflicts_output_val): New function.
4536 * src/conflicts.h (conflicts_output_val): New decl.
4537 * src/files.c (spec_xml_file): New var.
4538 (compute_output_file_names, output_file_names_free): Add XML support.
4539 * src/files.h (spec_xml_file): New decl.
4540 * src/getargs.c (xml_flag): New var.
4541 (usage, short_options, long_options, getargs): Add XML support.
4542 * src/getargs.h (xml_flag): New decl.
4543 * src/gram.c: Include print-xml.h.
4544 (rule_lhs_print_xml, rule_rhs_print_xml):
4545 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
4546 New functions.
4547 * src/gram.h: Declare external ones.
4548 * src/main.c: Include print-xml.h.
4549 (main): Add XML support.
4550 * src/reduce.c: Include print-xml.h.
4551 (reduce_xml): New function.
4552 * src/reduce.h: Declare it.
4553 * src/state.c: Include print-xml.h.
4554 (state_new): Add XML support.
4555 (state_rule_lookahead_tokens_print_xml): New function.
4556 * src/state.h: Declare it.
4557 (struct state): New member solved_conflicts_xml.
4558 * src/symtab.c (symbol_class_get_string): New function.
4559 * src/symtab.h: Declare it.
4560
6d8e724d
PE
45612007-09-21 Paul Eggert <eggert@cs.ucla.edu>
4562
4563 * GNUmakefile: Switch to coreutils's version.
4564 * bootstrap: Likewise.
4565 * Makefile.cfg: Adjust to new GNUmakefile.
4566 * README-hacking: Likewise.
4567
4568 Import from gnulib:
4569
4570 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
4571 Bruno Haible <bruno@clisp.org>
4572
4573 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
4574 and is a script that invokes bison. Tighten the code. Add comments.
4575
922bdd7f
JD
45762007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
4577
4578 Spell "boolean" as "Boolean". Reported by Akim Demaille.
4579 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
4580 * doc/bison.texinfo (Decl Summary): Fix.
4581 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
4582 * tests/input.at (Boolean %define variables): Update output.
4583 * tests/skeletons.at (%define boolean variables: invalid skeleton
4584 defaults): Rename to...
4585 (%define Boolean variables: invalid skeleton defaults): ... this and
4586 update output.
4587
1b17b01d
JD
45882007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
4589
4590 In impure push mode, don't allow more than one yypstate to be allocated
4591 since multiple impure parsers would corrupt yynerrs.
4592 * data/push.c (yypstate_allocated): New static global variable
4593 initialized to 0.
4594 (yypull_parse): If yypstate_new returns 0, don't report it as memory
4595 exhaustion if yypstate_allocated is 1, but still return 2.
4596 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
4597 already 1. Otherwise, set it to 1.
4598 (yypstate_delete): Set it to 0.
4599 * tests/push.at (Push Parsing: Multiple impure instances): New test
4600 case.
4601
9987d1b3
JD
46022007-08-17 Bob Rossi <bob@brasko.net>
4603
4604 * doc/bison.texinfo (Push Decl): Document the push parser.
4605 (Table of Symbols): Ditto.
4606 (Pure Decl): Ditto.
4607 (Decl Summary): Ditto.
4608 (Multiple Parsers, Push Parser Function, Pull Parser Function,
4609 Parser Create Function, Parser Delete Function):
4610 Add new push parser symbols.
4611 (Table of Symbols): Document push-parser, push-pull-parser,
4612 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
4613
f16b0819
PE
46142007-08-15 Paul Eggert <eggert@cs.ucla.edu>
4615
4616 Update to GPLv3.
4617 * doc/gpl-3.0.texi: New file.
4618 * doc/gpl.texi: Remove.
4619 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
4620 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
4621 * README-hacking, TODO, bootstrap, bootstrap.conf:
4622 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
4623 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
4624 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
4625 * data/lalr1.cc, data/lalr1.java, data/location.cc:
4626 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
4627 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
4628 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
4629 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
4630 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
4631 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
4632 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
4633 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
4634 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
4635 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
4636 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
4637 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
4638 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
4639 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
4640 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
4641 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
4642 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
4643 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
4644 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
4645 * src/complain.c, src/complain.h, src/conflicts.c:
4646 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
4647 * src/files.h, src/flex-scanner.h, src/getargs.c:
4648 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
4649 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
4650 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
4651 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
4652 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
4653 * src/print.c, src/print.h, src/print_graph.c:
4654 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
4655 * src/reduce.h, src/relation.c, src/relation.h:
4656 * src/revision.h, src/scan-code.h, src/scan-code.l:
4657 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
4658 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
4659 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
4660 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
4661 * tests/Makefile.am, tests/actions.at, tests/c++.at:
4662 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
4663 * tests/existing.at, tests/glr-regression.at:
4664 * tests/headers.at, tests/input.at, tests/java.at:
4665 * tests/local.at, tests/output.at, tests/push.at:
4666 * tests/reduce.at, tests/regression.at, tests/sets.at:
4667 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
4668 * tests/torture.at:
4669 Update to GPLv3.
4670
728c4be2
JD
46712007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
4672
4673 Get rid of broken %no-parser, -n, and --no-parser implementation and
4674 documentation.
4675 * TODO: Don't mention them.
4676 * doc/bison.1: Likewise.
4677 * doc/bison.texinfo (Decl Summary): Likewise.
4678 (Bison Options): Likewise.
4679 (Option Cross Key): Likewise.
4680 * src/getargs.c (no_parser_flag): Remove global variable.
4681 (usage): Don't print description of -n and --no-parser.
4682 (long_options): Remove --no-parser entry here.
4683 (getargs): Remove -n case in the switch here.
4684 * src/getargs.h (no_parser_flag): Remove extern.
4685 * tests/regression.at (Web2c Actions): Remove comment that mentions
4686 --no-parser.
4687
5d31a216
JD
46882007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
4689
4690 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
4691 name user variables starting with `yy'. Just pass NULL instead of a
4692 dummy local &yylval to yypush_parse.
4693 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
4694 starting with `yy'.
4695
a2ea208d
JD
46962007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
4697
4698 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
4699 true since it's then always used regardless of whether yyoverflow is
4700 defined. Reported by Christian Burger at
4701 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
4702 * THANKS: Add Christian Burger.
4703
91661ebb
JD
4704 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
4705 node names: say "Decl Summary" not "Bison Declaration Summary".
4706
cbd50549
JD
47072007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
4708
4709 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
4710 determine whether this function has already complained about an invalid
4711 value for a %define boolean variable, don't check whether Bison has
4712 ever examined the value. As written, the check was a tautology.
4713 Instead, record and check for this complaint using a separate muscle.
4714
eb1b0740
JD
47152007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4716
4717 Fix push parsing memory leak reported by Brandon Lucia at
4718 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
4719 * THANKS: Add Brandon Lucia.
4720 * data/push.c (yypstate_delete): Free the stack if it was reallocated
4721 but the parse never completed and thus freed it.
4722 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
4723 * tests/testsuite.at: Include push.at.
4724 * test/push.at: New.
4725 (Push Parsing: Memory Leak for Early Deletion): New test case.
4726
9d774aff
JD
47272007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
4728
4729 Improve handling of multiple S/R conflicts in the same state and of S/R
4730 conflicts involving multiple reductions.
4731 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
4732 set for a state here or Bison will abort if it is reassigned on a
4733 later conflicted reduction in the same state.
4734 Similarly, don't finalize and assign the solved conflicts report here
4735 or it will be lost if it is reassigned on a later conflicted reduction
4736 in the same state.
4737 (set_conflicts): Instead, assign them both here after all S/R conflicts
4738 in the state have been fully examined.
4739 * src/print.c (shift_set): Rename to...
4740 (no_reduce_set): ... this.
4741 (print_reductions): Update for rename, and add %nonassoc error action
4742 tokens to no_reduce_set so that, when printing the first remaining
4743 reduction on an error action token, the reduction is enclosed in
4744 brackets.
4745 (print_results): Update for rename.
4746 * tests/conflicts.at (Solved conflicts report for multiple reductions
4747 in a state): New test case.
4748 (%nonassoc error actions for multiple reductions in a state): New test
4749 case.
4750
4751 * src/main.c (main): Don't depend on C99 features.
4752
10159d2a
JD
47532007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
4754
4755 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
4756 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
4757 uniwidth.
10159d2a 4758
953b3935
JD
47592007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
4760
4761 * bootstrap (slurp): Create target directories that don't exist.
4762 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
4763
6ce2d93a
JD
47642007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
4765
4766 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
4767 than item number.
4768 * closure.c (closure): Likewise.
4769 * state.h (reductions): Comment sorting of rules.
4770 (state): Comment sorting of items.
4771
ce3448d5
JD
47722007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
4773
4774 Fix C++ test cases after recent Gnulib changes. Discussed starting at
4775 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
4776 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
4777 definition in order to avoid Gnulib headers since we don't use config.h
4778 here.
4779 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
4780 rather than AT_DATA so that config.h is included.
4781
8a86eef0
JD
47822007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
4783
4784 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
4785 instead of fprintf. Guard these functions with #if YYDEBUG instead of
4786 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
4787 and so that YYFPRINTF is guaranteed to be defined here.
4788
b1a81613
JD
47892007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
4790
4791 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
4792 with...
4793 (muscle_percent_define_check_values): ... this more helpful function.
4794 Again, it's not used yet, but it will be.
4795 * src/muscle_tab.h: Likewise.
4796
71b61d4d
JD
4797 Improve some comments in parser table construction.
4798 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
4799 (generate_states): Don't mention ruleset, which is internal to closure.
4800 * src/closure.c (closure): Explain sorting of core and itemset, which
4801 is required for this function to behave correctly.
4802 * src/closure.h (closure): Mention sorting.
4803
2a6b783d
JD
48042007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
4805
4806 * src/lalr.c (state_lookahead_tokens_count): For code readability,
4807 move the check for disabled transitions to an aver since conflict
4808 resolution hasn't happened yet.
4809
4810 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
4811 labels a state as inconsistent just because it has error transitions.
4812 The original form of this check appeared in revision 1.1 of lalr.c,
4813 which was committed on 1991-12-21. Now (at least), changing the
4814 consistency label on such a state appears to have no useful effect in
4815 any of the places it is examined, which I enumerate below. The key
4816 point to understanding each item in this enumeration is that a state
4817 with an error transition is labelled consistent in the first place only
4818 if it has no rules, so the check cannot matter for states that have
4819 rules. (1) Labelling a state as inconsistent will cause set_conflicts
4820 to try to identify its conflicts, and a state must have *rules* to have
4821 conflicts. (2) Labelling a state as inconsistent will affect how
4822 action_row sets the default *rule* for the state. (3) Labelling a
4823 state as inconsistent will cause build_relations to add lookback edges
4824 to *rules* in that state.
4825 * src/state.h (struct state): Word the comment for member consistent
4826 more carefully.
4827
14462c2b
JD
48282007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4829
4830 Don't depend on C99 features.
4831 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
4832 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
4833 * src/reader.c (check_and_convert_grammar): Fix for-loop.
4834 * src/state.c (state_mark_reachable_states): Fix for-loop.
4835 (state_remove_unreachable_states): Fix for-loop.
4836
4837 Don't widen struct state with member reachable just to temporarily
4838 record reachability. Instead, use a local bitset.
4839 * src/state.h (struct state): Remove member.
4840 * src/state.c (state_new): Don't initialize it.
4841 (state_mark_reachable_states): Rename to...
4842 (state_record_reachable_states): ... this, and use bitset.
4843 (state_remove_unreachable_states): Use bitset.
4844
5a43d418
JD
48452007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
4846
4847 * src/Makefile.am (yacc): Quote target action commands properly so
4848 that the yacc script isn't corrupt. Reported by Hans Aberg at
4849 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
4850
0c650a20
JD
4851 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
4852 the case of pure parsers. Reported by Frans Englich at
4853 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
4854 * THANKS: Add Frans Englich.
4855
61fee93e
JD
4856 * NEWS (2.3a+): In the %code entry, reference section `Bison
4857 Declaration Summary' from the manual now since the %code summary has
4858 moved there.
4859 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
4860 in the rules section must be terminated by semicolons.
4861
f124d423
JD
48622007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
4863
4864 Extend the front-end API for %define variables to more completely
4865 mirror the back-end. This will be useful in the future.
4866 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
4867 Update comments to mention the new front-end counterparts of these
4868 macros.
4869 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
4870 for muscle_string_decode and muscle_location_decode.
4871 (muscle_string_decode): New static function.
4872 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
4873 (muscle_percent_define_get, muscle_percent_define_ifdef): New
4874 functions.
4875 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
4876 muscle_percent_define_get to mimic the b4_percent_define_flag_if
4877 implementation more closely.
4878 (muscle_percent_define_invalid_value): New function.
4879 * src/muscle_tab.h (muscle_percent_define_get,
4880 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
4881 Prototype.
4882
75ad86ee
JD
48832007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
4884
4885 * NEWS (2.3a+): Mention yesterday's state-removal change.
4886 (2.3a): Remove the %language entry, which was added after 2.3a.
4887 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
4888 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
4889 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
4890 tests/existing.at: Update copyright date.
4891
5967f0cf
JD
48922007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4893
4894 If conflict resolution makes states unreachable, remove those states,
4895 report rules that are then unused, and don't report conflicts in those
4896 states.
4897 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
4898 New global function.
4899 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
4900 function.
4901 * src/main.c (main): After conflict resolution, remove the unreachable
4902 states and update all data structures that reference states by number.
4903 * src/state.c (state_new): Initialize each state's reachable member to
4904 false.
4905 (state_mark_reachable_states): New static function.
4906 (state_remove_unreachable_states): New global function.
4907 * src/state.h (struct state): Add member bool reachable.
4908 (state_remove_unreachable_states): Prototype.
4909 * tests/conflicts.at (Unreachable States After Conflict Resolution):
4910 New test case.
4911 * tests/existing.at (GNU pic Grammar): Update test case output now that
4912 an unused rule is discovered.
4913
b09f4f48
JD
49142007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4915
4916 Minor code cleanup in parser table construction.
4917 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
4918 (new_itemsets, save_reductions): Update for rename to nitemset.
4919 * src/closure.c (nritemset): Rename to...
4920 (nitemset): ... this since the "r" appears to meaningless and isn't
4921 used in the comments.
4922 (closure): Update for rename.
4923 * src/closure.h (nritemset): Update extern to...
4924 (nitemset): ... this.
4925 * src/lalr.c (LA): Fix a typo in comments.
4926 * src/print.c (print_core): Update for rename to nitemset.
4927 * src/print_graph.c (print_graph): Likewise.
4928 * src/state.h: Fix some typos in header comments.
4929
bbb44d83
PE
49302007-04-04 Paul Eggert <eggert@cs.ucla.edu>
4931
9b33de72
PE
4932 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
4933 still sticks to ASCII. Sorry!
4934
bbb44d83
PE
4935 * README-hacking: New file, taken mostly from coreutils, with changes
4936 for Bison. Contains much of the contents of:
4937 * README-cvs: Remove.
4938 * bootstrap: Sync from gnulib.
4939 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
4940 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
4941
29553547
JD
49422007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
4943
4944 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
4945 Setzer.
4946 (Java Differences): Fix some typos.
4947 * THANKS: Add Sebastian Setzer.
4948
01b477c6
PB
49492007-03-07 Paolo Bonzini <bonzini@gnu.org>
4950
730739e4
AD
4951 * data/java.m4 (b4_single_class_if): Remove.
4952 (b4_abstract_if): Look at "%define abstract".
4953 (b4_lexer_if): New.
4954 (b4_union_name): Rename...
4955 (b4_yystype): ... to this. Map to "%define stype".
4956 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
4957 b4_maybe_throws): Fix quoting.
4958 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
4959 * data/lalr1.java (Lexer interface): Always define.
4960 (Lexer interface within parser class): Remove.
4961 (YYLexer class): New, used when "%code lexer" is present.
4962 (constructor): When "%code lexer" is used, pass %lex-param
4963 to the lexer constructor.
4964 (yylex, yyparse): Remove %lex-param from method invocations
4965 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
4966
4967 * doc/bison.texinfo (Java Bison Interface): Mention "%define
4968 abstract". Rename "%define union_name" to "%define stype".
4969 Rename method names according to previous patch.
4970 (Java Scanner Interface): Describe "%code lexer" instead of
4971 "%pure-parser" and "%define single_class".
4972 (Java Differences): Mention "%code lexer".
4973
4974 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
4975 Include scanner here, using macros from tests/local.at.
4976 (AT_DATA_CALC_Y): Remove final argument.
4977 (_AT_CHECK_JAVA_CALC): Likewise.
4978 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
4979 of %locations and %error-verbose.
4980 (main): Test with and without %lex-param.
4981 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
4982 (AT_BISON_OPTION_POPDEFS): Pop it.
01b477c6 4983
122bea3a
JMG
49842007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4985
4986 DJGPP spefic issue. Inhibit the use of disallowed characters for
4987 file name genertion on Win98, WinXP, etc. These are |<>":?*\
4988 and concern testsuite case 46.
4989 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
4990 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
4991 * djgpp/config.bat: Inhibit the use of disallowed characters.
4992
9611cfa2
JD
49932007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4994
4995 Miscellaneous %define and %code cleanup.
4996 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
4997 values are interpreted.
4998 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
4999 documentation a little more.
5000 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
5001 muscle_percent_define_insert, muscle_percent_code_grow): New
5002 functions/macros.
5003 * src/muscle_tab.h (muscle_percent_define_insert,
5004 muscle_percent_code_grow): Prototype.
5005 * src/parse-gram.y (prologue_declaration): Use
5006 muscle_percent_define_insert and muscle_percent_code_grow when parsing
5007 %define and %code directives.
5008
5009 Make it easy to share %define boolean variables between the front-end
5010 and back-end. Though not used yet, this will be useful in the future.
5011 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
5012 Bison uses of names rather than just skeleton uses of names.
5013 (b4_percent_define_get, b4_percent_define_ifdef): Rename
5014 b4_percent_define_skeleton_variables(VARIABLE) to
5015 b4_percent_define_bison_variables(VARIABLE).
5016 (b4_percent_code_get, b4_percent_code_ifdef): Rename
5017 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
5018 b4_percent_code_bison_qualifiers(QUALIFIER).
5019 (b4_check_user_names_wrap): Update for renames.
5020 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
5021 muscle_percent_define_default): New functions mimicking
5022 b4_percent_define_flag_if and b4_percent_define_default.
5023
5024 For %define variables, report locations for invalid values and
bbb44d83 5025 redefinitions.
9611cfa2
JD
5026 * data/bison.m4 (b4_percent_define_flag_if): Read
5027 b4_percent_define_loc(VARIABLE) to report the location of an invalid
5028 value for VARIABLE.
5029 (b4_percent_define_default): Save a special location in
5030 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
5031 must later be reported as invalid.
5032 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
5033 functions.
5034 (muscle_percent_define_insert): Record the location of VARIABLE in
5035 muscle percent_define_loc(VARIABLE), and use it to report the previous
5036 location for a redefinition.
5037 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
5038 (muscle_percent_define_default): Update like b4_percent_define_default.
5039 (muscle_grow_user_name_list): Rename to...
5040 (muscle_user_name_list_grow): ... this for consistency and use
5041 muscle_location_grow.
5042 * src/muscle_tab.h (muscle_location_grow): Prototype.
5043 * tests/input.at (%define errors): Update expected output.
5044 * tests/skeletons.at (%define boolean variables: invalid skeleton
5045 defaults): New test case.
5046
0bf92491
JD
50472007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
5048
5049 * src/print.c (lookahead_set, state_default_rule): Remove.
5050 (print_reductions): Replace state_default_rule invocation with
5051 equivalent use of yydefact, which was computed in token_actions in
5052 tables.c.
5053 (print_results): Don't allocate lookahead_set.
5054
d3b12988
PB
50552007-02-27 Paolo Bonzini <bonzini@gnu.org>
5056
5057 * data/lalr1.java: Prefix all private members with yy.
5058
f57a7536
JD
50592007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
5060
5061 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 5062 Sebastien Fricker at
f57a7536 5063 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 5064 * THANKS: Add Sebastien Fricker.
f57a7536
JD
5065 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
5066 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
5067 accept a variable number of arguments.
5068
6404a5bf
JD
50692007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
5070
5071 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
5072
e4e09639
JMG
50732007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5074
5075 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
5076 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
5077 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
5078
d7e0a1a7
PE
50792007-02-11 Paul Eggert <eggert@cs.ucla.edu>
5080
5081 Undo my 2007-02-07 change, switching back to the c-strcase module
5082 introduced in the 2007-02-03 change. Bruno Haible reported that
5083 the 2007-02-07 change would be dangerous in Turkish if we add a
5084 language whose name contains "i", since "i" is not lowercase "I"
5085 in Turkish.
5086 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
5087 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
5088 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
5089 * m4/.cvsignore: Remove strcase.m4.
5090 * src/getargs.c: Revert 2007-02-07 change, as follows.
5091 Include c-strcase.h.
5092 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
5093
deee93a1
JD
50942007-02-11 Bruno Haible <bruno@clisp.org>
5095
5096 Enable the Java related testsuite tests when the only Java compiler
5097 found is a gcj < 4.3. Discussed at
5098 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
5099 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
5100
574add85
JD
51012007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
5102
5103 * data/Makefile.am: Update copyright date.
5104 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
5105 yypstate_new returns NULL.
5106 (yypstate_new): Return NULL if malloc does.
5107 * src/reader.c (packgram): Move translation of rule actions from the
5108 beginning of packgram to...
5109 (check_and_convert_grammar): ... here right before packgram is invoked
5110 so it's easier to write more complete comments, and remove redundant
5111 code.
5112
e785ccf7
JD
51132007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
5114
5115 As in semantic actions, make @$ in %initial-action, %destructor, and
5116 %printer imply %locations.
5117 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
5118 scanning @$.
5119 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
5120 (@$ in %initial-action implies %locations,
5121 @$ in %destructor implies %locations,
5122 @$ in %printer implies %locations): ... these new test cases.
5123
1cfe1ed7
PE
51242007-02-07 Paul Eggert <eggert@cs.ucla.edu>
5125
5126 Undo most of the 2007-02-03 change, switching to the strcase module
5127 now that gnulib strcase has been fixed.
5128 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
5129 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
5130 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
5131 * m4/.cvsignore: Add strcase.m4.
5132 * src/getargs.c: Revert 2007-02-03 change, as follows.
5133 Don't include c-strcase.h.
5134 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
5135 strcasecmp has "unspecified behavior" outside the POSIX locale,
5136 but it works fine in practice if at least one argument is ASCII,
5137 as is the case in Bison.
5138
0049ec86
PB
51392007-02-07 Paolo Bonzini <bonzini@gnu.org>
5140
5141 * tests/java.at: Skip tests if only one of javac/java is present.
5142 Reported by Joel E. Denny.
5143 * tests/atlocal.in: Adjust copyright years.
5144
51452007-02-05 Paolo Bonzini <bonzini@gnu.org>
5146
5147 * data/lalr1.java (Stack): Work around old verifiers that disallow
5148 access to the private fields of an inner class, from the outer class.
5149 We can make Stack's fields public because user code doesn't have access
5150 to the instance of Stack used by parse(). Reported by Paul Eggert.
5151
2c2b7220
PE
51522007-02-03 Paul Eggert <eggert@cs.ucla.edu>
5153
5154 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
5155 the right spot for these files?
5156 * bootstrap.conf (gnulib_modules): Add c-strcase.
5157 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
5158 c-strncasecmp.c.
5159 * src/getargs.c: Include c-strcase.h.
5160 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
5161 to avoid unspecified behavior.
5162
b2b81dae
JD
51632007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
5164
5165 * doc/bison.texinfo (Decl Summary): Correct typo.
5166
c1d19e10
PB
51672007-01-30 Paolo Bonzini <bonzini@gnu.org>
5168
5169 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
5170 Complain if the value does not match empty, "true" or "false".
5171 * data/c++.m4: Adjust default definitions of %define variables.
5172 * data/java.m4: Adjust default definitions of %define variables.
5173 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
5174 to above behavior.
5175 * tests/input.at (Boolean %define variables): Test new behavior.
5176
8405b70c
PB
51772007-01-29 Paolo Bonzini <bonzini@gnu.org>
5178
5179 * NEWS: Mention java.
5180 * TODO: Remove things that are done.
5181 * bootstrap.conf: Add javacomp-script and javaexec-script.
5182 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
5183
5184 * data/Makefile.am: Add new files.
5185 * data/java-skel.m4: New.
5186 * data/java.m4: New.
5187 * data/lalr1.java: New.
5188
5189 * doc/bison.texinfo: Put "A Complete C++ Example" under
5190 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
5191 under Other Languages.
5192
5193 * src/getargs.c (valid_languages): Add Java.
5194 * src/getargs.h (struct bison_language): Update size of string fields.
5195
5196 * tests/Makefile.am: Add java.at.
5197 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
5198 * tests/java.at: New.
5199 * tests/testsuite.at: Include it.
5200
3eb82471
JD
52012007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
5202
5203 Clean up.
5204 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
5205 at_directive_argv arguments so these no longer have to be global
5206 variables. Also, update the implementation for the following changes.
5207 (fail_for_at_directive_too_many_args,
5208 fail_for_at_directive_too_few_args): Add at_directive_name argument.
5209 (at_directive_name): Remove as at_directive_argv[0] will be used for
5210 this now.
5211 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
5212 for the directive name.
5213 (at_directive_argc, at_directive_argv): Make these local within
5214 skel_lex instead of global.
5215 (INITIAL): Update directive start action for above changes.
5216 (SC_AT_DIRECTIVE_ARG): Rename to...
5217 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
5218 (SC_AT_DIRECTIVE_SKIP_WS): Update.
5219 (scan_skel): Move yylex_destroy to...
5220 (skel_scanner_free): ... here.
5221 * tests/skeletons.at (installed skeleton file name): Rename to...
5222 (installed skeleton file names): ... this.
5223
148d66d8
JD
52242007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
5225
5226 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
5227 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
5228 Summary" not "Directives".
5229 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
5230 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
5231 since the former is now the more complete one.
5232 (Prologue Alternatives): Likewise and do the same for %defines.
5233 (Table of Symbols): Add summary of %code, add summary of %define, and
5234 move full %code documentation to...
5235 (Decl Summary): ... here for consistency with other entries in these
5236 sections.
5237 Move %define entry in order to keep this list alphabetized.
5238 Reword %define entry a little to put less emphasis on the skeleton
5239 concept, which most users shouldn't have to think about.
5240
665f0c24
PE
52412007-01-26 Paul Eggert <eggert@cs.ucla.edu>
5242
5243 Adjust to recent gnulib changes.
5244 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
5245 Add string.h, string_.h, unistd_.h, wchar_.h.
5246 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
5247 * src/system.h: Don't include <stpcpy.h>; this is now done by
5248 <string.h>.
5249
592d0b1e
PB
52502007-01-23 Paolo Bonzini <bonzini@gnu.org>
5251
5252 Simplify implementation of unqualified %code, implement macros for
5253 uniform treatment of boolean %define flags. Document %define.
5254 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
5255 b4_percent_code_ifdef): New.
5256 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
5257 * data/c++.m4: Define default value for global_tokens_and_yystype.
5258 * data/glr.cc: Likewise.
5259 * data/location.cc: Use b4_percent_define_flag_if.
5260
148d66d8 5261 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
5262
5263 * src/parse-gram.y (Unqualified %code): Change muscle name to
5264 b4_percent_code().
5265 (content.opt): Default to empty.
5266
a7867f53
JD
52672007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
5268
5269 Implement support for relative and absolute skeleton file names.
5270 Discussed starting at
5271 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
5272 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
5273 (Bison Options): Document in --skeleton entry.
5274 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
5275 full_skeleton can't necessarily hold all of pkgdatadir.
5276 If the specified skeleton file name contains a `/', don't prepend
5277 pkgdatadir.
5278 * src/parse-gram.y (prologue_declaration): If the specified skeleton
5279 file name contains a `/', prepend the grammar file directory.
5280 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
5281 * skeletons.at: New file.
5282 (relative skeleton file names): New test case.
5283 (installed skeleton file names): New test case.
5284 * tests/testsuite.at: Include skeletons.at.
5285
5286 * bootstrap: Update copyright to 2007.
5287
830c9b18
PB
52882007-01-17 Paolo Bonzini <bonzini@gnu.org>
5289
5290 * bootstrap: Remove occurrences of .#bootmp from the files.
5291
a8c2e813
AD
52922007-01-17 Akim Demaille <akim@epita.fr>
5293
5294 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
5295 nonterminals.
5296 Use per-type %printer.
5297
279cabb6
JD
52982007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
5299
5300 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
5301 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5302 djgpp/config.site, src/files.c, src/files.h, src/main.c,
5303 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
5304 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
5305 tests/glr-regression.at, tests/input.at, tests/local.at,
5306 tests/output.at, tests/torture.at: Update copyright to 2007.
5307
bb32f4f2
AD
53082007-01-16 Akim Demaille <akim@epita.fr>
5309
5310 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
5311 error code.
5312 (Calc++ Scanner): Exit with failure if we can't open the input
5313 file.
5314 Accept "-" standing for stdin.
5315 (Calc++ Top Level): Print the result only if the parsing was
5316 successful.
5317
7cff04b5
AD
53182007-01-16 Akim Demaille <akim@epita.fr>
5319
5320 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
5321
a4e25e1d
JD
53222007-01-15 Paolo Bonzini <bonzini@gnu.org>
5323 and Joel E. Denny <jdenny@ces.clemson.edu>
5324
5325 Clean up %define and %code implementation in M4 some. Most
5326 importantly, rename all related macros to be in the b4_percent_define
5327 and b4_percent_code namespaces. Also, complete support for `.' in
5328 %define variable names and %code qualifiers.
5329 * data/bison.m4 (b4_check_user_names): Check for special
5330 "SKELETON-NAMESPACE(name)" macros instead of using two nested
5331 m4_foreach loops.
5332 (b4_get_percent_define, b4_get_percent_code): Rename to...
5333 (b4_percent_define_get, b4_percent_code_get): ... these.
5334 Extend documentation with examples.
5335 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
5336 b4_percent_define_skeleton_variables and
5337 b4_percent_code_skeleton_qualifiers.
5338 Expect any value for the %define variable `foo' to be stored in the
5339 macro named `b4_percent_define(foo)'; expect any %code blocks for the
5340 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
5341 expect any unqualified %code blocks to be stored in a macro named
5342 `b4_percent_code_unqualified'.
5343 Use m4_indir so that %define variable names and %code qualifiers can
5344 contain `.', which is allowed by the grammar parser.
5345 (b4_percent_define_default): New macro to set a default value for a
5346 %define variable.
5347 (m4_wrap): Update wrapped code, and fix some underquoting.
5348 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
5349 Expect grammar uses of %define variables and %code qualifiers to be
5350 defined in b4_percent_define_user_variables and
5351 b4_percent_code_user_qualifiers.
5352 * data/c++.m4: Use b4_percent_define_default rather than
5353 m4_define_default. Fix some underquoting. Skeleton usage of %define
5354 variable define_location_comparison now implies skeleton usage of
5355 %define variable filename_type.
5356 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5357 data/push.c, data/yacc.c: Update macro names.
5358 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
5359 muscle names.
5360
e37c665c
JMG
53612007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5362
5363 DJGPP specific issues.
5364
5365 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
5366 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
5367
7d2d521f
JD
53682007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5369
5370 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
5371 run parsers in all tests so that Valgrind is invoked during
5372 maintainer-check-valgrind.
5373 (Duplicate representation of merged trees): Free all semantic values.
5374 (Duplicated user destructor for lookahead): Likewise.
5375
e0ac9b4b
JD
53762007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5377
5378 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
5379 command-line prefix.
5380 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
5381 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
5382 miss Valgrind messages.
5383 (Exploding the Stack Size with Malloc): Likewise.
5384
78143faa
JD
53852007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5386
5387 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
5388 locals. Reported by Juan Manuel Guerrero at
5389 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
5390 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
5391 Fix some indentation also.
5392 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
5393 explaining this issue.
5394
7ecec4dd
JD
53952007-01-09 Paolo Bonzini <bonzini@gnu.org>
5396 and Joel E. Denny <jdenny@ces.clemson.edu>
5397
5398 Simplify union and prologue handling, and escape union and lex/parse
5399 params with digraphs.
5400 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
5401 values to the empty string since these are no longer guaranteed
5402 initialized by the front-end.
5403 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
5404 braces around b4_user_stype since this is no longer done by the
5405 front-end.
5406 * src/files.c, src/files.h (pre_prologue_obstack,
5407 post_prologue_obstack): Remove.
5408 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
5409 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
5410 with digraphs. This fixes lex params and parse params.
5411 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
5412 * src/output.c (prepare): Remove muscle insertion of the prologues.
5413 (output): Remove freeing of pre_prologue_obstack and
5414 post_prologue_obstack.
5415 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
5416 than prologue_augment for prologue parsing so you don't need prologue
5417 obstacks.
5c80250c
JD
5418 (grammar_declaration): For %union RHS, use `braceless' instead of
5419 "{...}" so that braces are already stripped and code is escaped with
5420 digraphs.
7ecec4dd
JD
5421 * src/reader.c (prologue_augment): Remove.
5422 (reader): Remove initialization of pre_prologue_obstack and
5423 post_prologue_obstack.
5424 * src/reader.h (prologue_augment): Remove.
5425
5426 * data/c.m4: Remove stray parenthesis.
5427
16dc6a9e
JD
54282007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5429
5430 Remove quotes from variables names in %define directives and from
5431 qualifiers in %code directives, and restrict the characters that are
5432 allowed in them to M4-friendly ones. For %define, continue to support
5433 the quoted form as a deprecated feature. Discussed starting at
5434 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
5435 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
5436 %code.
5437 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
5438 (Decl Summary): In %defines entry, update mention of `%code requires'
5439 and `%code provides'.
16dc6a9e
JD
5440 (C++ Location Values): Update %define uses.
5441 (Calc++ Parser Interface): Likewise.
5442 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 5443 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
5444 * src/parse-gram.y (prologue_declaration): For %define variables, use
5445 `variable' instead of `STRING'.
5446 (grammar_declaration): For %code qualifiers, use `ID' instead of
5447 `STRING'.
5448 (variable): New nonterminal that takes an `ID' or a `STRING'.
5449 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
5450 and %define uses.
5451 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
5452 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
5453 (%define errors): Update %define uses.
5454
e9813cd4
JD
54552007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5456
5457 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
5458 instead of muscle_insert for %define values so that M4-special
5459 characters are replaced with digraphs.
5460 * tests/input.at (%define errors): Extend to check weird values.
5461
6afc30cc
JD
54622007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5463
5464 Instead of having skeletons declare all valid %define variables and
5465 %code qualifiers, provide macros that retrieve the associated values
5466 and build these lists automatically. Thus Bison will now warn when a
5467 variable or qualifier is not used by the skeleton in the current
5468 invocation regardless of whether it might sometimes be used by that
5469 skeleton in other invocations. Also, move all %define value macros to
5470 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
5471 form, which is replaced by %code.
5472 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
5473 (b4_check_user_names): ... this, and change the series of valid name
5474 arguments to a single list argument for names used in the skeleton
5475 similar to the existing list argument for names used in the grammar.
5476 Warn instead of complaining.
5477 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
5478 values and %code code, to format %code code properly, and to build
5479 lists of all %define variables and %code qualifiers used in the
5480 skeleton: b4_skeleton_percent_define_variables and
5481 b4_skeleton_percent_code_qualifiers.
5482 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
5483 Remove, and...
5484 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
5485 the skeleton names lists can finish building first. In place of
5486 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
5487 expect the lists b4_user_percent_define_variables and
5488 b4_user_percent_code_qualifiers.
5489 * data/c++.m4: Where setting default values for b4_parser_class_name,
5490 b4_location_type, b4_filename_type, b4_namespace, and
5491 b4_define_location_comparison, update their names to the
5492 b4_percent_define_ namespace.
5493 * data/glr.c: Don't use b4_check_percent_define_variables and
5494 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
5495 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
5496 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 5497 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
5498 * data/location.cc: Use b4_get_percent_define.
5499 * data/push.c: Don't use b4_check_percent_define_variables and
5500 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
5501 * data/yacc.c: Likewise, and don't call m4_exit in
5502 b4_use_push_for_pull_if or m4_wrap code will never execute.
5503 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
5504 Rename to...
5505 (muscle_grow_user_name_list): ... this for consistency with the
5506 terminology used in bison.m4.
5507 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
5508 %define variable names, and rename muscle used_percent_define_variables
5509 to user_percent_define_variables.
5510 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
5511 user_percent_code_qualifiers.
5512 (content): Remove.
5513 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
5514 {CODE} form is no longer accepted.
5515 * tests/input.at (Reject bad %code qualifiers): Rename to...
5516 (Reject unused %code qualifiers): ... this, and update test output.
5517 (%define error): Update test output.
5518
7eb8a0bc
JD
55192007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
5520
5521 Check for unrecognized %define variables similar to checking for
5522 unrecognized %code qualifiers. Check for redefined %define variables.
5523 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
5524 generalizes...
5525 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
5526 (b4_check_percent_define_variables): New, also wraps it.
5527 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
5528 variables using b4_check_percent_define_variables.
5529 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
5530 all those exercised in the test suite and all those listed in the
5531 `Default values' section of c++.m4. Are there others?
5532 * data/push.c, data/yacc.c: Declare no valid %define variables.
5533 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
5534 similar to muscle_find, but it works even when the muscle stores a
5535 const value.
5536 (muscle_grow_used_name_list): New function for constructing the used
5537 name list muscles that b4_check_for_unrecognized_names requires.
5538 * src/parse-gram.y (prologue_declaration): Warn if a variable is
5539 %define'd more than once. Define the b4_used_percent_define_variables
5540 muscle with muscle_grow_used_name_list.
5541 (grammar_declaration): Abbreviate %code code with
5542 muscle_grow_used_name_list.
5543 * tests/input.at (%define errors): New.
5544
3fc65ead
JD
55452007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5546
5547 Provide warn_at, complain_at, and fatal_at function callbacks to the
5548 skeletons, and use this for %code qualifier complaints.
5549 * data/bison.m4 (b4_error_at): New, invoked by...
5550 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
5551 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
5552 @fatal_at(...@) directives.
5553 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
5554 qualifiers in b4_used_percent_code_qualifiers and to use
5555 b4_complain_at.
5556 * src/location.c, src/location.h (boundary_set_from_string): New global
5557 function.
5558 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
5559 function.
5560 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
5561 to b4_used_percent_code_qualifiers.
5562 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
5563 function.
5564 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
5565 (lineno): Rename to...
5566 (out_lineno): ... this so I don't misunderstand it again.
5567 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
5568 here; these newlines are in the input but not the output file.
5569 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
5570 (at_directive_perform): ... this new static function, and add handling
5571 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
5572 directives.
5573 * tests/input.at (Reject bad %code qualifiers): Update test output with
5574 locations and extend.
5575
5576 * tests/output.at (Output file name: [, Output file name: ]): Remove
5577 bogus comment about these tests failing.
5578
1c7b7e1d
JD
55792007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5580
5581 Clean up b4_check_percent_code_qualifiers a little.
5582 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
5583 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
5584 documentation and add examples.
5585 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
5586 qualifiers here.
5587
08af01c2
JD
55882007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
5589
5590 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
5591 unreliable -- especially when they're hidden inside another macro.
5592 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
5593 data/c.m4: Remove m4_divert(-1).
5594 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5595 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
5596 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 5597 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
5598 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
5599 pushed and popped by m4sugar, should be first on the stack.
5600
5601 Provide warn, complain, and fatal function callbacks to the skeletons.
5602 This provides more flexibility than m4_fatal, improves the error
5603 message format, and captures messages for translation. Discussed
5604 starting at
5605 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
5606 * data/bison.m4 (b4_error): New, invoked by...
5607 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
5608 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
5609 directives. Because these M4 macros might be called when the current
5610 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
5611 the previous removal of uses of m4_divert, which caused trouble.
5612 (b4_check_percent_code_qualifiers): Use b4_complain instead of
5613 m4_fatal to report unrecognized %code qualifiers.
5614 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
5615 push parser requests.
5616 * data/glr.c: Use b4_complain instead of m4_fatal to report
5617 non-deterministic push parser requests.
5618 Update @output usage to @output(...@) form.
5619 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
5620 report missing %defines. Update @output usage to @output(...@) form.
5621 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
5622 @output(...@) form.
5623 * src/main.c (main): Invoke skel_scanner_free.
5624 * src/scan-skel.h (skel_scanner_free): Prototype new function.
5625 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
5626 obstack_for_string from flex-scanner.h.
5627 (YY_DECL): Use to declare skel_lex static.
5628 (decode_at_digraphs): Remove; now handled in the new
5629 SC_AT_DIRECTIVE_ARG start condition.
5630 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
5631 functions.
5632 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
5633 at_directive_argv): New static globals.
5634 (INITIAL): Use fail_for_invalid_at.
5635 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
5636 recognize the start of a generalized `@directive(...@)' form and
5637 start...
5638 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
5639 directive args (using the new obstack_for_string), to decode the
5640 contained @ diagraphs, and to perform the directive. It recognizes
5641 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
5642 @output(...@).
5643 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
5644 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
5645 `@,'.
5646 (scan_skel): Initialize obstack_for_string on the first call.
5647 (skel_scanner_free): New function to free obstack_for_string.
5648 * tests/input.at (Reject bad %code qualifiers): Update test output.
5649
8e0a5e9e
JD
56502007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
5651
5652 Consolidate the 4 prologue alternative directives (%code, %requires,
5653 %provides, and %code-top) into a single %code directive with an
5654 optional qualifier field. Discussed at
5655 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
5656 * NEWS (2.3a+): Rewrite the existing entry for the prologue
5657 alternatives.
5658 * doc/bison.texinfo (Prologue Alternatives): Update.
5659 (Decl Summary): Update to %code "requires" and %code "provides".
5660 (Calc++ Parser): Update to %code "requires".
148d66d8 5661 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
5662 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
5663 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
5664 are replaced by b4_percent_code_provides and b4_percent_code_requires,
5665 which are skeleton-specific.
5666 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
5667 declare what %code qualifiers it supports and to complain if any other
5668 qualifiers were used in the grammar.
5669 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
5670 and b4_user_code([b4_percent_code_provides]) in place of
5671 b4_user_requires and b4_user_provides.
5672 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
5673 Add b4_user_code([b4_percent_code_top]) and
5674 b4_user_code([b4_percent_code]).
5675 Invoke b4_check_percent_code_qualifiers.
5676 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
5677 PERCENT_REQUIRES): Remove.
5678 (grammar_declaration): Remove RHS's for %code-top, %provides, and
5679 %requires. Rewrite the %code RHS as the unqualified form defining the
5680 muscle b4_percent_code. Add another RHS for the qualified %code form,
5681 which defines muscles of the form b4_percent_code_QUALIFIER and the
5682 b4_used_percent_code_qualifiers muscle.
5683 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
5684 PERCENT_REQUIRES): Remove.
5685 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
5686 %code "requires" and %code "provides".
5687 * tests/input.at (Reject bad %code qualifiers): New.
5688
95021767
JD
56892007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
5690
5691 Use the new code_props interface for destructors and printers.
5692 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
5693 printer_location members, and change the type of the destructor and
5694 printer members to code_props.
5695 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
5696 symbol_printer_get, semantic_type_destructor_set,
5697 semantic_type_printer_set, default_tagged_destructor_set,
5698 default_tagless_destructor_set, default_tagged_printer_set,
5699 default_tagless_printer_set): Use code_props in arguments and return
5700 types in place of char const * and location.
5701 (symbol_destructor_location_get, symbol_printer_location_get): Remove
5702 since the locations are now contained in the return of
5703 symbol_destructor_get and symbol_printer_get.
5704 * src/output.c (symbol_destructors_output, symbol_printers_output):
5705 Replace with...
5706 (symbol_code_props_output): ... this to eliminate duplicate code.
5707 (output_skeleton): Update to use symbol_code_props_output.
5708 * src/reader.c (symbol_should_be_used): Update use of
5709 symbol_destructor_get.
5710 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
5711 Update uses of the various _destructor_set and _printer_set functions.
5712 * src/symtab.c: (default_tagged_destructor_location,
5713 default_tagless_destructor_location, default_tagged_printer_location,
5714 default_tagless_printer_location): Remove since we...
5715 (default_tagged_destructor, default_tagless_destructor,
5716 default_tagged_printer, default_tagless_printer): ... change the type
5717 of these to code_props.
5718 (symbol_new, semantic_type_new, symbol_destructor_set,
5719 semantic_type_destructor_set, symbol_destructor_get,
5720 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
5721 symbol_check_alias_consistency, default_tagged_destructor_set,
5722 default_tagless_destructor_set, default_tagged_printer_set,
5723 default_tagless_printer_set): Update.
5724 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
5725 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
5726 code_props members.
5727 (symbol_print): Use SYMBOL_CODE_PRINT.
5728
f6857bbf
JD
57292007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
5730
5731 Use the new code_props interface for rule actions.
5732 * src/symlist.h (symbol_list): Replace action, action_location, and
5733 used members with a code_props action_props member.
5734 * src/reader.c (symbol_should_be_used, grammar_rule_check,
5735 grammar_midrule_action, grammar_current_rule_merge_set,
5736 grammar_current_rule_symbol_append, packgram): Update.
5737 * src/scan-code.h (translate_rule_action): Remove, no longer used.
5738 * src/scan-code.l (handle_action_dollar): Update.
5739 (translate_rule_action): Remove, no longer used.
5740 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
5741
7c0c6181
JD
57422007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5743
5744 Use the new code_props interface in parse-gram.y.
5745 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
5746 Update all uses of translate_* functions to use the new code_props
5747 interface and to use gram_scanner_last_string_free and
5748 code_scanner_last_string_free where possible.
5749 (grammar_declaration): symbol_list_destructor_set and
5750 symbol_list_printer_set now perform the translation, so don't do it
5751 here. Use gram_scanner_last_string_free where possible.
5752 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
5753 translate_code): Remove, no longer used.
5754 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
5755 symbol_list_printer_set): Perform code translation here rather than
5756 depending on the caller to do so.
5757
5758 * src/symlist.h (struct symbol_list): Correct some documentation typos.
5759 * src/scan-gram.h (gram_last_string): Remove declaration.
5760 * src/scan-gram.l (last_string): Declare it static.
5761
28e52c0d
JD
57622007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5763
5764 Encapsulate code properties and related functionality for the various
5765 destructors, printers, and actions into a code_props structure and
5766 interface. This patch merely implements code_props in scan-code.h and
5767 scan-code.l. Future patches will rewrite other modules to use it.
5768 Discussed starting at
5769 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
5770 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
5771 consistently initialize const structs that have an empty location
5772 field.
5773 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
5774 to ensure consistency.
5775 * src/scan-code.h (code_props): New structure.
5776 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
5777 function, macro, and const global variable for initializing a
5778 code_props with no code.
5779 (code_props_plain_init, code_props_symbol_action_init,
5780 code_props_rule_action_init, code_props_translate_code): The rest of
5781 the new code_props functional interface. Among other things, the init
5782 functions set the code_props kind field so that
5783 code_props_translate_code will know whether to behave like
5784 translate_symbol_action, translate_rule_action, or translate_code.
5785 These old translate functions must remain until all other modules are
5786 updated to use the new code_props interface.
5787 (code_scanner_last_string_free): New function similar to
5788 gram_scanner_last_string_free.
5789 (code_scanner_free): Add documentation.
5790 * src/scan-code.l: Implement the new interface.
5791 (code_lex): Make it static, add a code_props* argument, and remove the
5792 rule argument.
5793 (last_string): New static global similar to the one in scan-gram.l.
5794 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
5795 instead of rule.
5796 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
5797 code_props since Bison may one day use this information for destructors
5798 and printers.
5799 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
5800 (handle_action_dollar): Use symbol_list_n_get and set used flag
5801 directly since symbol_list_n_used_set is removed.
5802 (translate_action): Add a code_props* argument and remove the rule,
5803 action, and location arguments. Pass the code_props* on to code_lex.
5804 (translate_rule_action, translate_symbol_action, translate_code):
5805 Rewrite as wrappers around the new code_props interface.
5806 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
5807 it would eventually need to break the encapsulation of code_props.
5808
96034983
JD
58092007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
5810
5811 * etc/.cvsignore: New.
5812
945e396c
JD
58132007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
5814
5815 Add maintainer-push-check to run maintainer-check using push parsing in
5816 place of pull parsing where available.
5817 * Makefile.am (maintainer-push-check): New.
5818 * data/bison.m4 (b4_use_push_for_pull_if): New.
5819 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
5820 appropriately based on their existing values.
5821 (yypush_parse): Don't print push-parser-specific diagnostics if push
5822 parsing is being used in place of pull parsing.
5823 * data/yacc.c: If push parsing should replace pull parsing, redirect to
5824 push.c.
5825 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
5826 variable, and insert b4_use_push_for_pull_flag into muscles.
5827 * tests/Makefile.am (maintainer-push-check): New.
5828
7d596384
JD
58292006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
5830
5831 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
5832 (whether successful or failed) so that yypush_parse can be invoked
5833 again to start a new parse using the same yypstate.
5834 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
5835 check multiple yypull_parse invocations on the same yypstate. For pull
5836 mode, extend to check multiple yyparse invocations.
5837 (Exploding the Stack Size with Alloca): Extend to try with
5838 %push-pull-parser.
5839 (Exploding the Stack Size with Malloc): Likewise.
5840
5841 * tests/calc.at (Simple LALR Calculator): Don't specify
5842 %skeleton "push.c" since %push-pull-parser implies that now.
5843 * tests/headers.at (export YYLTYPE): Don't check for the push
5844 declarations. Otherwise, this test case can't be used to see if push
5845 mode can truly emulate pull mode.
5846 * tests/input.at (Torturing the Scanner): Likewise.
5847 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
5848 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
5849 AT_YACC_IF, which now includes the case of push mode since %skeleton
5850 need not be used for push mode. This will be more intuitive once
5851 push.c is renamed to yacc.c.
5852
7172e23e
JD
58532006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
5854
5855 For push mode, convert yyparse from a macro to a function, invoke yylex
5856 instead of passing a yylexp argument to yypull_parse, and don't
5857 generate yypull_parse or yyparse unless %push-pull-parser is declared.
5858 Discussed starting at
5859 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
5860 * data/bison.m4 (b4_pull_if): New.
5861 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
5862 * data/push.c: Improve M4 quoting a little.
5863 (b4_generate_macro_args, b4_parenthesize): Remove.
5864 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
5865 any time a pull parser is requested.
5866 Don't #define this as a wrapper around yypull_parse. Instead, when
5867 both push and pull are requested, make it a function that does that
5868 same thing.
5869 (yypull_parse): If there's a b4_prefix, #define this to
5870 b4_prefix[pull_parse] when both push and pull are requested.
5871 Don't define this as a function unless both push and pull are
5872 requested.
5873 Remove the yylexp argument and hard-code yylex invocation instead.
5874 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
5875 %push-parser.
5876 * src/getargs.c (pull_parser): New global initialized to true.
5877 * getargs.h (pull_parser): extern it.
5878 * src/output.c (prepare): Insert pull_flag muscle.
5879 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
5880 (prologue_declaration): Set both push_parser and pull_parser = true for
5881 %push-pull-parser. Set push_parser = true and pull_parser = false for
5882 %push-parser.
5883 * src/scan-gram.l: Don't accept %push_parser as an alternative to
5884 %push-parser since there's no backward-compatibility concern here.
5885 Scan %push-pull-parser.
5886 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
5887 instead of %push-parser.
5888 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
5889 prototype it in the module that calls yyparse.
5890 * tests/input.at (Torturing the Scanner): Likewise.
5891 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
5892
2e7944cb
JD
58932006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
5894
5895 Update etc/bench.pl. Optimize push mode a little (the yyn change
5896 deserves most of the credit).
5897 * Makefile.am (SUBDIRS): Add etc subdirectory.
5898 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
5899 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
5900 yytoken, yyval, and yyloc declarations to...
5901 (yyparse or yypush_parse): ... here to improve performance. For
5902 yypush_parse invocations after the first, be sure to assign yyn its old
5903 value again.
5904 (yypstate_new): Don't bother initializing the yyresult field since the
5905 initial value isn't used.
5906 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
5907 remove the #define that, in push mode, set it to yyps->NAME.
5908 * etc/Makefile.am: New.
5909 * etc/bench.pl: Remove and build it instead from...
5910 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
5911 "tests/bison" from the build directory by default rather than just
5912 invoking "bison" from $PATH.
5913 (calc_grammar): Update push parser code: don't declare yylval globally,
5914 don't define yyparse_wrapper, and don't #define yyparse.
5915 (bench_grammar): Update to check all working combinations of yacc.c,
5916 push.c, impure, pure, pull, and push.
5917
c3d50342
JD
59182006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
5919
5920 For push mode, add pull wrappers around yypush_parse.
5921 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
5922 (yypull_parse): New function wrapping yypush_parse.
5923 (yyparse): New #define wrapping yypull_parse.
5924 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
5925 is declared.
5926 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
5927 prototype yylex in the module that calls yyparse, and don't prototype
5928 yyparse there. Otherwise, the yyparse expansion won't compile.
5929 * tests/input.at (Torturing the Scanner): Likewise.
5930
94ebeba5
JD
59312006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
5932
5933 Enable push parsers to operate in impure mode. Thus, %push-parser no
5934 longer implies %pure-parser. The point of this change is to move
5935 towards being able to test the push parser code by running the entire
5936 test suite as if %push-parser had been declared.
5937 * data/push.c (yypush_parse): For impure mode, remove the
5938 yypushed_char, yypushed_val, and yypushed_loc arguments.
5939 Instead, declare these as local variables initialized to the global
5940 yychar, yylval, and yylloc.
5941 For the first yypush_parse invocation only, restore the initial values
5942 of these global variables when it's time to read a token since they
5943 have been overwritten.
5944 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
5945 %push-parser.
5946 * tests/calc.at (Simple LALR(1) Calculator): Always declare
5947 %pure-parser along with %push-parser since this test case was designed
5948 for pure push parsers.
5949 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
5950 (AT_YACC_OR_PUSH_IF): New.
5951 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
5952 add a note that it's still wrong for some cases (as it has been for a
5953 while).
5954 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
5955 %push-parser no longer implies %pure-parser.
5956
a0633178
JD
59572006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5958
5959 Remove some unnecessary differences between the pull parser code and
5960 the push parser code. This patch enables yynerrs in push mode.
5961 * data/push.c: Reformat M4 a little.
5962 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
5963 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
5964 because push mode is on. Instead, if pure mode is on, move yynerrs
5965 to...
5966 (b4_declare_parser_state_variables): ... here.
5967 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
5968 to yyps->NAME so it can be used in yypush_parse.
5969 (yypush_parse): Don't omit uses of yynerrs in push mode.
5970
8646b6a3
JD
59712006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5972
5973 Fix bug such that the first pushed token's value and location are
5974 sometimes overwritten (sometimes by %initial-action) before being used.
5975 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
5976 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
5977 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
5978 more closely mimic the pull parser logic.
5979 Don't copy the pushed token to yychar, yylval, and yylloc until it's
5980 time to read a token, which is after any initialization of yylval and
5981 yylloc.
5982 (gottoken): Rename label to...
5983 (yyread_pushed_token): ... for clarity and to avoid infringing on the
5984 user namespace.
5985
9baf4d74
JD
59862006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5987
5988 Rearrange initialization of the parser state variables so that the
5989 skeleton doesn't have to have a copy for pull mode and another for push
5990 mode. This patch also fixes at least a bug such that yylloc was not
5991 initialized (with b4_location_initial_line and
5992 b4_location_initial_column) upon calling yypush_parse. However, that
5993 initialization now overwrites the first token's location;
5994 %initial-action assigning @$ already did the same thing, and both bugs
5995 will be fixed in a later patch.
5996 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
5997 (b4_declare_parser_state_variables): Remove initialization of yytoken,
5998 yyss, yyvs, yyls, and yystacksize.
5999 (yypstate_new): Remove initialization of some yypstate fields: yystate,
6000 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
6001 yylsp.
6002 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
6003 yyps->NAME so it can be used in yypush_parse.
6004 (yyparse or yypush_parse): For yypush_parse, don't print the
6005 "Starting parse" diagnostic for invocations after the first.
6006 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
6007 yypush_parse, only do it for the first invocation.
6008 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
6009 initialization to occur in yypush_parse but only on the first
6010 invocation.
6011
23522164
JD
60122006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
6013
6014 * data/push.c: Add CPP guards around push parser declarations in both
6015 the header and the code file.
6016 In the code file, move the push parser declarations to the same place
6017 they appear in the header file.
6018 Clean up the M4 some, especially the inconsistent underquoting in
6019 some b4_c_function_def and b4_c_function_decl uses.
6020
bb010fe5
JD
60212006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
6022
6023 Encapsulate the push parser state variables into an M4 macro so the
6024 push skeleton doesn't have to list them again for pull mode's yyparse.
6025 For push mode, remove yypush_parse's local equivalents of these
6026 variables to eliminate unnecessary copying between the two sets at
6027 run-time. This patch also fixes at least a bug related to multiple
6028 %initial-action invocations in push mode.
6029 * data/push.c (b4_declare_parser_variables): Rename to...
6030 (b4_declare_scanner_communication_variables): ... this for clarity and
6031 update both uses.
6032 (b4_declare_yyparse_variables): Remove and move its contents to the one
6033 spot where it was invoked.
6034 (b4_declare_parser_state_variables): New macro containing the parser
6035 state variables required by push mode.
6036 (struct yypstate): Replace all fields but yynew with
6037 b4_declare_parser_state_variables.
6038 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
6039 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
6040 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
6041 (yyparse or yypush_parse): For yyparse in pull mode, replace local
6042 parser state variable declarations with
6043 b4_declare_parser_state_variables.
6044 Don't initialize parser state variables when calling yypush_parse since
6045 yypstate_new already does that.
6046 Invoke the user's initial action only upon the first yypush_parse
6047 invocation.
6048 Remove all code that copies between the local parser state variables
6049 and the yypstate.
6050
2d212f8c
JD
60512006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
6052
6053 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
6054 prevent a name collision in a future patch where these names will
6055 sometimes be #define'd.
6056 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
6057 since it no longer has the same name as the existing argument.
6058 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
6059
e6e704dc
JD
60602006-12-19 Paolo Bonzini <bonzini@gnu.org>
6061 and Joel E. Denny <jdenny@ces.clemson.edu>
6062
6063 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
6064 that the argument is case-insensitive, and there's no `=' here.
6065 For the %skeleton entry, mention that %language is better.
6066 (Bison Options): Likewise for --language and --skeleton. Move the
6067 --skeleton entry so that the `Tuning the parser' section is sorted
6068 alphabetically on long options.
6069 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
6070 %language directive in detail here; cross-reference the %language
6071 documentation instead.
6072 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
6073 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 6074 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
6075 * examples/extexi (normalize): Instead of replacing every %require
6076 argument with the current Bison version, just substitute for
6077 `@value{VERSION}'. This guarantees that we're testing what actually
6078 appears in the documentation.
6079 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
6080 rather than `@VERSION@'.
6081
0e021770
PE
60822006-12-18 Paul Eggert <eggert@cs.ucla.edu>
6083
fd575f05
PE
6084 * NEWS: Reword the %language news a bit, and put it earlier.
6085
0e021770
PE
6086 * src/getargs.c (skeleton_arg): Last arg is now location const *.
6087 Rewrite to simplify the logic.
6088 (language_argmatch): Likewise.
fd575f05
PE
6089 (program_name): We now own this var.
6090 * src/getargs.h (struct bison_language): Use char[] rather than
6091 const char *.
0e021770
PE
6092
6093 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
6094 Java is supported.
6095 * src/complain.c (program_name): Remove decl; no longer needed.
6096 * src/main.c (program_name): Remove; now belongs to getargs.
6097
60982006-12-18 Paolo Bonzini <bonzini@gnu.org>
6099
6100 * NEWS: Document %language.
6101
6102 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
6103
6104 * data/c-skel.m4, data/c++-skel.m4: New files.
6105 * data/glr.c: Complain on push parsers.
6106
6107 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
6108 over %skeleton.
148d66d8 6109 (Decl Summary): Document %language and %skeleton.
0e021770
PE
6110 (Command line): Document -L.
6111
6112 * examples/extexi: Rewrite %require directive.
6113 * examples/calc++/Makefile.am: Pass VERSION to extexi.
6114
6115 * src/files.c (compute_exts_from_gc): Look in language structure
6116 for .y extension.
6117 (compute_file_name_parts): Check whether .tab should be added.
6118 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
6119 (language, skeleton_arg, language_argmatch): New.
6120 (long_options): Add --language.
6121 (getargs): Use skeleton_arg, add -L/--language.
6122 * src/getargs.h: Include location.h.
6123 (struct bison_language, language, skeleton_arg, language_argmatch): New.
6124 * src/output.c (prepare): Pick default skeleton from struct language.
6125 Don't dispatch C skeletons here.
6126 * src/parse-gram.y (PERCENT_LANGUAGE): New.
6127 (prologue_declaration): Add "%language" rule, use skeleton_arg.
6128 * src/scan-gram.l ("%language"): New rule.
6129
6130 * tests/calc.at: Test %skeleton and %language.
6131 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
6132 (AT_GLR_IF): Look for %skeleton "glr.cc".
6133 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
6134 (AT_YACC_IF): Reject %language.
6135
5691bf57
PE
61362006-12-18 Paul Eggert <eggert@cs.ucla.edu>
6137
db06f0ce
PE
6138 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
6139 since it wasn't used; only the typedef name 'semantic_type' is needed.
6140 Also, omit trailing white space.
6141
5691bf57
PE
6142 * bootstrap: Sync from coreutils.
6143 (gnulib_extra_files): Add build-aux/announce.gen.
6144 (slurp): Adjust .gitignore files like .cvsignore files.
6145 * build-aux/announce-gen: Remove from CVS, since bootstrap
6146 now creates this.
6147
791934e4
JD
61482006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
6149
6150 Make %push-parser imply %pure-parser. This fixes several bugs; see
6151 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
6152 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
6153 pure_parser = true.
6154 * data/push.c: Don't bother testing b4_push_if when deciding whether
6155 to expand b4_declare_parser_variables globally.
6156 (yypush_parse): Likewise in here.
6157
6158 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
6159 (yy_reduce_print): Reformat M4 for readability.
6160
ee5abb37
JD
61612006-12-15 Bob Rossi <bob@brasko.net>
6162 and Joel Denny <jdenny@ces.clemson.edu>
6163
6164 * data/push.c (yypstate): Add typedef, and update all uses of
6165 struct yypstate to just yypstate.
6166 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
6167
16ca01f9
JD
61682006-12-14 Bob Rossi <bob@brasko.net>
6169
6170 * data/push.c (yypush_parse): Declare prototype regardless of
6171 %locations option.
6172
ab8e7e1a
JD
61732006-12-14 Bob Rossi <bob@brasko.net>
6174
6175 * data/push.c (yyparse): Remove the prototype and the #define when in
6176 push-parser mode.
6177
9bf32be3
JD
61782006-12-13 Bob Rossi <bob@brasko.net>
6179
6180 * data/push.c (yypstate_init): Rename to...
6181 (yypstate_new): ... this and use b4_c_function_def.
6182 (yypstate_delete): New.
6183 (yypush_parse): Change parameters yynval and yynlloc to be const.
6184 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
6185 yypstate_delete functions.
6186
f02e2948
JD
61872006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
6188
6189 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
6190 strange test case titles. Reported by Bob Rossi.
6191
38eb7751
PE
61922006-12-13 Paul Eggert <eggert@cs.ucla.edu>
6193
6194 * TODO: Add pointer to Sylvain Schmitz's work on static detection
6195 of potential ambiguities in GLR grammers.
6196
bd9d212b
JD
61972006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
6198
6199 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
6200 `bison ', use m4_index instead of m4_substr since chopping up a string
6201 containing M4-special characters causes problems here.
6202
6203 Fix a couple of bugs related to special characters in user-specified
6204 file names, and make it easier for skeletons to compute output file
6205 names with the same file name prefix as Bison-computed output file
6206 names.
6207 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
6208 b4_parser_file_name and b4_spec_defines_file instead of
6209 @output_parser_name@ and @output_header_name@, which are now redundant.
6210 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
6211 b4_parser_file_name, b4_spec_defines_file, and the new
6212 @basename(FILENAME@) instead of @output_parser_name@ and
6213 @output_header_name@, which inappropriately escaped the file names as
6214 C string literals.
6215 * src/files.c (all_but_ext): Remove static qualifier.
6216 (compute_output_file_names): Move `free (all_but_ext)' to...
6217 (output_file_names_free): ... here since all_but_ext is needed later.
6218 * src/files.h (all_but_ext): Extern.
6219 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
6220 exactly what MUSCLE_INSERT_STRING used to do.
6221 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
6222 characters are escaped properly.
6223 * src/output.c (prepare): Define muscle file_name_all_but_ext as
6224 all_but_ext.
6225 For pkgdatadir muscle, maintain previous functionality by using
6226 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
6227 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
6228 digraphs would never be expanded. Hopefully no one has M4-special
6229 characters in his Bison installation path.
6230 * src/scan-skel.l: Don't parse @output_header_name@ and
6231 @output_parser_name@ anymore since they're now redundant.
6232 In @output, use decode_at_digraphs.
6233 Parse a new @basename command that invokes last_component.
6234 (decode_at_digraphs): New.
6235 (BASE_QPUTS): Remove unused.
6236 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
6237 (Output file name): New tests.
6238
3f7ca628
JD
62392006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
6240
6241 Warn about output files that are generated by the skeletons and that
6242 conflict with other output files.
6243 * data/glr.c: Don't generate the header file here when glr.cc does.
6244 * src/files.c (file_names, file_names_count): New static globals.
6245 (compute_output_file_names): Invoke output_file_name_check for files
6246 not generated by the skeletons and remove existing checks.
6247 (output_file_name_check): New function that warns about conflicting
6248 output file names.
6249 (output_file_names_free): Free file_names.
6250 * src/files.h (output_file_name_check): Declare.
6251 * src/scan-skel.l: Invoke output_file_name_check for files generated by
6252 the skeletons.
6253 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
6254 (Conflicting output files): New tests.
6255
178e123e
PE
62562006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6257
6258 * doc/bison.texinfo: Fix a couple of typos.
6259
62602006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
6261
6262 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
6263 Rename to...
6264 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
6265 update all uses.
6266 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
6267 (yypush_parse): Rename yypvars argument to yyps and remove redundant
6268 local pv.
6269 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
6270 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
6271
ea17f233
JD
62722006-12-07 Bob Rossi <bob@brasko.net>
6273 and Joel Denny <jdenny@ces.clemson.edu>
6274
6275 * data/push.c (yypvarsinit): Change return type from void* to struct
6276 yypvars*. No longer cast to void* on return.
6277 (struct yypvars): Remove yylen since it need not be remembered between
6278 yypushparse invocations.
6279 (yypushparse): Don't copy between yylen and pv->yylen.
6280
55a30bda
JD
62812006-12-05 Bob Rossi <bob@brasko.net>
6282
6283 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
6284 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
6285 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
6286 (struct yypvars): Remove b4_declare_parser_variables.
6287 (yypvarsinit): Remove init code for removed variables.
6288 (global scope): Do not declare b4_declare_parser_variables if
6289 push or pure mode.
6290 (yypushparse): Add b4_declare_parser_variables.
6291 Init new local variables, and remove init code for removed
6292 yypvars variables.
6293 (yyparse): Delete.
6294 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
6295 and yyparse for other modes.
6296 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
6297 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
6298 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
6299 (AT_PURE_LEX_IF): True if pure or push parser.
6300
85894313
JD
63012006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
6302
6303 Document Yacc prologue alternatives and default %destructor's and
6304 %printer's as experimental. Don't mention Java yet. Discussed at
6305 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
6306 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
6307 (2.3a): Annotate this entry to say the old forms of these features were
6308 also experimental.
6309 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 6310 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
6311 of Java (we'll want this back eventually).
6312
02975b9a
JD
63132006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
6314
6315 Support a file name argument to %defines. Deprecate `=' in
6316 %file-prefix, %name-prefix, and %output. Discussed at
6317 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
6318 * NEWS (2.3a+): Mention.
148d66d8 6319 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
6320 form of %defines, and remove `=' from entries for %file-prefix,
6321 %name-prefix, and %output.
6322 * src/parse-gram.y (prologue_declaration): Implement.
6323 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
6324 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
6325 all but one occurrence of %name-prefix.
6326 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
6327 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
6328 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
6329 occurrence of each of %file-prefix and %output. Add check for %defines
6330 with argument.
6331 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
6332 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
6333 Remove the `=' from %output.
6334
287b314e
JD
63352006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
6336
6337 Don't escape $ in test case titles since Autoconf 2.61 now does that
6338 correctly.
6339 * tests/actions.at (Default %printer and %destructor are not for error
6340 or $undefined): Here.
6341 (Default %printer and %destructor are not for $accept): Here.
6342 * tests/input.at (Invalid $n and @n): Here.
6343
3ebecc24
JD
63442006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
6345
6346 Rename <!> to <>. Discussed starting at
6347 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
6348 * NEWS (2.3a+): Update.
148d66d8 6349 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
6350 Update.
6351 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
6352 * src/scan-gram.l (INITIAL): Implement.
6353 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
6354 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
6355 comment.
6356 * tests/actions.at (Default tagless %printer and %destructor,
6357 Default tagged and per-type %printer and %destructor,
6358 Default %printer and %destructor are not for error or $undefined,
6359 Default %printer and %destructor are not for $accept,
6360 Default %printer and %destructor for mid-rule values): Update.
6361 * tests/input.at (Default %printer and %destructor redeclared,
6362 Unused values with default %destructor): Update.
6363
26b8a438
JD
63642006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
6365
6366 Don't let %prec take a nonterminal.
6367 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
6368 token.
6369 * tests/input.at (%prec takes a token): New test checking that %prec
6370 won't take a nonterminal.
6371
07c39ae9
JD
63722006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
6373
405d53b7
JD
6374 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
6375 it was double-quoted.
07c39ae9
JD
6376 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
6377 grammar is maintained with Bison's highest standards.
6378 * src/getargs.c: Fix some typos in Doxygen comments.
6379
580b8926
JD
63802006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
6381
6382 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
6383 later. Reported by Paul Eggert in
6384 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
6385 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
6386 * src/scan-code.l (translate_action): Don't bother invoking
6387 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
6388 (code_scanner_free): Instead of invoking
6389 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
6390 which frees more.
6391 * src/scan-gram.l (gram_scanner_free): Likewise.
6392 * src/scan-skel.l (scan_skel): Likewise.
6393
4502eadc
JD
63942006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
6395
6396 * src/files.c (tr): Change return type to void.
6397 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
6398 has been called previously for the same key.
6399 (muscle_find): Return storage instead of value so that
6400 --enable-gcc-warnings doesn't produce warnings that the return discards
6401 const. aver that the value and storage are the same since storage
6402 could potentially be NULL when value is not.
6403 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
6404 same as 0.
6405
7746c8f6
PE
64062006-11-08 Paul Eggert <eggert@cs.ucla.edu>
6407
6408 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
6409 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
6410 us a slightly cleaner distribution, and also works.
6411 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
6412 gnulib changes.
6413
eb095650
PE
64142006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
6415 and Paul Eggert <eggert@cs.ucla.edu>
6416
6417 Don't let Bison leak memory except when it complains.
6418 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
6419 (spec_defines_file, dir_prefix): Now char *, not const char *,
6420 since they are freed.
6421 * src/files.c: Likewise.
6422 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
6423 Likewise.
6424 (tr): Now operates in-place. All uses changed.
6425 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
6426 values.
6427 (compute_file_name_parts, compute_output_file_names): Don't store
6428 read-only data in variables that will be freed.
6429 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
6430 src_extension, and header_extension.
6431 (output_file_names_free): New public function to free
6432 spec_verbose_file, spec_graph_file, spec_defines_file,
6433 parser_file_name, and dir_prefix.
6434 * src/getargs.c (getargs): Don't store read-only data in variables that
6435 will be freed.
6436 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
6437 (which previously existed but was unused), and quotearg_free.
6438 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
6439 * src/muscle_tab.c: Likewise.
6440 (muscle_entry): Make the value char const *,
6441 and add a new storage member that is char * and can be freed.
6442 (muscle_entry_free): New private function.
6443 (muscle_init): Use it instead of free.
6444 (muscle_insert, muscle_grow): Update and use new storage member.
6445 (muscle_code_grow): Free the string passed to muscle_grow
6446 since it's not needed anymore.
6447 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
6448 add a new `char *code' member.
6449 ("{...}"): Declare semantic type as code.
6450 * src/scan-code.h (translate_rule_action):
6451 (translate_symbol_action, translate_code, translate_action): Return
6452 `char const *' rather than `char *' since external code should not free
6453 these strings.
6454 * src/scan-code.l: Likewise.
6455 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
6456 which is "{...}" in the parser.
6457 * tests/Makefile.am (maintainer-check-valgrind): Set
6458 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
6459 Valgrind.
6460 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
6461 complain.
6462 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
6463 expecting a non-zero exit status sets --leak-check=summary and
6464 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
6465 this case, and we don't want to hear about it.
6466
ac564be4
PE
64672006-11-08 Paul Eggert <eggert@cs.ucla.edu>
6468
6469 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
6470 instead of from the template, to simplify configuration a bit.
6471 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
6472 and m4/wint_t.m4, as they are needed with the latest gnulib.
6473
17bd8a73
JD
64742006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6475
6476 Disable unset/unused mid-rule value warnings by default, and recognize
6477 --warnings=midrule-values to enable them. Discussed starting at
6478 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
6479 * NEWS (2.3a+): Mention.
6480 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
6481 warnings): Add entry for midrule-values subargument.
6482 * src/reader.c (symbol_should_be_used): Don't return true just because
6483 the value is a set/used mid-rule value unless
6484 --warnings=midrule-values was specified.
6485 * tests/input.at (Unused values, Unused values before symbol
6486 declarations): Run tests with and without --warnings=midrule-values.
6487
6488 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
6489 than LIST_FREE directly.
6490
89eb3c76
JD
64912006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6492
6493 Finish implementing --warnings=error, which should not be implied by
6494 --warnings=all (or by its synonyms -W and --warnings without
6495 subarguments).
6496 * src/complain.c (set_warning_issued): New function to report that
6497 warnings are being treated as errors and to record an error if so.
6498 Invoke...
6499 (warn_at, warn): ... here.
6500 * src/getargs.c (warnings_args, warnings_types): Reorder so that
6501 "error - warnings are errors" does not appear above "all - all of the
6502 above".
6503 (getargs): For -W and --warnings without subarguments, don't let
6504 FLAGS_ARGMATCH set warnings_error in warnings_flag.
6505 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
6506
ba7560e2
JD
65072006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6508
6509 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
6510 empty subargument list. For example: `bison --warnings= parser.y'.
6511
31283fc3
JD
65122006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6513
6514 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
6515 the parser header file so that gcc doesn't warn.
6516
12e35840
JD
65172006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6518
6519 Split the default %destructor/%printer into two kinds: <*> and <!>.
6520 Discussed starting at
6521 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
6522 * NEWS (2.3a+): Mention.
6523 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
6524 previous change today related to mid-rules.
148d66d8 6525 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 6526 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
6527 (TYPE_TAG_ANY): Add as <*>.
6528 (TYPE_TAG_NONE): Add as <!>.
6529 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
6530 for <*> and <!>.
6531 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
6532 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
6533 * src/symlist.c (symbol_list_default_new): Split into tagged and
6534 tagless versions.
6535 (symbol_list_destructor_set, symbol_list_printer_set): Split
6536 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
6537 SYMLIST_DEFAULT_TAGLESS.
6538 * src/symlist.h: Update symbol_list_default*_new prototypes.
6539 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
6540 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
6541 * src/symtab.c (default_destructor, default_destructor_location,
6542 default_printer, default_printer_location): Split each into tagged and
6543 tagless versions.
6544 (symbol_destructor_get, symbol_destructor_location_get,
6545 symbol_printer_get, symbol_printer_location_get): Implement tagged
6546 default and tagless default cases.
6547 (default_destructor_set, default_printer_set): Split each into tagged
6548 and tagless versions.
6549 * src/symtab.h: Update prototypes.
6550 * tests/actions.at (Default %printer and %destructor): Rename to...
6551 (Default tagless %printer and %destructor): ... this, and extend.
6552 (Per-type %printer and %destructor): Rename to...
6553 (Default tagged and per-type %printer and %destructor): ... this, and
6554 extend.
6555 (Default %printer and %destructor for user-defined end token): Extend.
6556 (Default %printer and %destructor are not for error or $undefined):
6557 Update.
6558 (Default %printer and %destructor are not for $accept): Update.
6559 (Default %printer and %destructor for mid-rule values): Extend.
6560 * tests/input.at (Default %printer and %destructor redeclared): Extend.
6561 (Unused values with default %destructor): Extend.
6562
f91b1629
JD
65632006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6564
6565 Don't apply the default %destructor/%printer to an unreferenced midrule
6566 value. Mentioned at
6567 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
6568 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
6569 like $@n instead of just @n so that the default %destructor/%printer
6570 logic doesn't see them as user-defined symbols.
6571 (symbol_is_dummy): Check for both forms of the name.
6572 * src/reader.c (packgram): Remove the `$' from each midrule symbol
6573 name for which the midrule value is referenced in any action.
6574 * tests/actions.at (Default %printer and %destructor for mid-rule
6575 values): New test.
6576 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
6577 for change to dummy symbol names.
6578
519d0004
JD
65792006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
6580
6581 Warn about unset midrule $$ if the corresponding $n is used.
6582 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
6583 $n usage.
6584 (packgram): Before invoking grammar_rule_check on any rule, make sure
6585 all actions have already been scanned in order to set `used' flags.
6586 Otherwise, checking that a midrule's $$ is set will not always work
6587 properly because the midrule check must forward-reference the midrule's
6588 parent rule.
6589 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
6590 warning.
6591
a501eca9
JD
65922006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
6593
6594 More improvements to the documentation of the prologue alternatives:
6595 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
6596 Bison manual.
6597 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
6598 some text to clarify the relative importance of the new directives and
6599 to show how these directives may be viewed as code labels.
6600
2cbe6b7f
JD
66012006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
6602
6603 Similar to the recently removed %before-header, add %code-top as the
6604 alternative to the pre-prologue. Mentioned at
6605 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
6606 Also, let the prologue alternatives appear in the grammar section.
6607 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
6608 (prologue_declaration): Move the existing prologue alternatives to...
6609 (grammar_declaration): ... here and add %code-top.
6610 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
6611
6612 Clean up and extend documentation for the prologue alternatives.
6613 * NEWS (2.3a+): Describe prologue alternatives.
6614 * doc/bison.texinfo (Prologue): Move discussion of prologue
6615 alternatives to...
6616 (Prologue Alternatives): ... this new section, and extend it to discuss
6617 all 4 directives in detail.
148d66d8
JD
6618 (Table of Symbols): Clean up discussion of prologue alternatives and
6619 add %code-top.
2cbe6b7f 6620
e557d3ea
JMG
66212006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6622
6623 DJGPP specific issues.
6624
6625 * djgpp/config.bat: config.hin has been moved to lib. Adjust
6626 config.bat accordingly.
6627 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
6628 * djgpp/config.site: Likewise.
6629
136a0f76
PB
66302006-10-16 Paolo Bonzini <bonzini@gnu.org>
6631
27bd5d67
PB
6632 Replace %*-header with %provides, %requires, %code. See discussion at
6633 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
6634
136a0f76
PB
6635 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
6636 (b4_user_start_header): Remove.
6637 * data/glr.c: Use new macros instead of b4_*start_header
6638 and b4_*end_header.
6639 * data/glr.cc: Likewise.
6640 * data/lalr1.cc: Likewise.
6641 * data/push.c: Likewise.
6642 * data/yacc.c: Likewise.
6643
6644 * doc/bison.texinfo: Remove %before-header, rename
6645 %{start,end,after}-header to %requires, %provides, %code.
6646
6647 * src/parse-gram.y: Likewise (also rename token names accordingly).
6648 * src/scan-gram.l: Likewise.
6649 * tests/actions.at: Likewise.
6650
10f429ef
PE
66512006-10-14 Paul Eggert <eggert@cs.ucla.edu>
6652
6653 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
6654 Problem reported by Joel E. Denny.
6655
66562006-10-14 Jim Meyering <jim@meyering.net>
6657
6658 (Sync from coreutils.)
6659 Work also when the working directory (with e.g. coreutils sources)
6660 is version controlled with git, rather than CVS.
6661 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
6662 rather than CVS.
6663 In messages and comments, say e.g., "checked-out sources",
6664 rather than "CVS sources".
6665 (version_controlled_file): New function. Work for git as well as
6666 for CVS. Don't use grep's -q option.
6667 (slurp): Call it here, in place of CVS-specific code.
6668
c4bd5bf7
JD
66692006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
6670
6671 Fix testsuite for ./configure --enable-gcc-warnings:
6672 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
6673 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
6674 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
6675 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
6676 * test/regression.at (Diagnostic that expects two alternatives):
6677 Likewise.
6678
46356ea4
PE
66792006-10-12 Paul Eggert <eggert@cs.ucla.edu>
6680
231ed89a
PE
6681 * bootstrap.conf (gnulib_modules): Add config-h.
6682 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
6683 worry about HAVE_CONFIG_H.
6684 * lib/abitset.c: Likewise.
6685 * lib/bitset.c: Likewise.
6686 * lib/bitset_stats.c: Likewise.
6687 * lib/bitsetv-print.c: Likewise.
6688 * lib/bitsetv.c: Likewise.
6689 * lib/ebitset.c: Likewise.
6690 * lib/get-errno.c: Likewise.
6691 * lib/lbitset.c: Likewise.
6692 * lib/subpipe.c: Likewise.
6693 * lib/timevar.c: Likewise.
6694 * lib/vbitset.c: Likewise.
6695 * lib/bitset.c: Include "bitset.h" first, to test interface.
6696 * lib/bitset_stats.c: Include "bitset_stats.h" first.
6697 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
6698 * lib/bitsetv.c: Include "bitsetv.h" first.
6699 * lib/get-errno.c: Include "get-errno.h" first.
6700 * m4/.cvsignore: Add config-h.m4.
6701 * tests/actions.at (Default %printer and %destructor for ...):
6702 Adjust expected line numbers in output to reflect removal of #if
6703 HAVE_CONFIG_H lines.
6704 * tests/glr-regression.at (Missed %merge type warnings when ...):
6705 Likewise.
6706 * tests/regression.at (Braced code in declaration in rules section):
6707 Likewise.
6708 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
6709 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
6710 Include <config.h> unconditionally.
6711
46356ea4
PE
6712 * bootstrap: Sync from coreutils, as follows:
6713
6714 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
6715
6716 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
6717 variable was sometimes used without being initialized. This
6718 messed up the installation of the INSTALL file in some cases.
6719
6720 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
6721
6722 * bootstrap (usage, main program, symlink_to_gnulib): Add option
6723 --copy. Inspired by a suggestion from Bruno Haible.
6724
6725 2006-10-03 Jim Meyering <jim@meyering.net>
6726
6727 * bootstrap: Undo last change to this file, since now gnulib-tool
6728 sticks with the automake default in generating dependencies.
6729
dd4bf078
PE
67302006-10-12 Paul Eggert <eggert@cs.ucla.edu>
6731
cf2a5f7c
PE
6732 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
6733 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
6734
6735 * doc/bison.1: Add copyright notice.
6736
6737 * data/glr.c: Don't include <stdarg.h>; not used.
6738
35fe0834
PE
6739 * NEWS: The -g and --graph options now output graphs in Graphviz
6740 DOT format, not VCG format.
6741 * doc/bison.1: Likewise.
6742 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
6743 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
6744 of this change in
6745 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
6746 * TODO: Remove Graphviz entry.
6747 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
6748 remove vcg.c, vcg.h, vcg_defaults.h.
6749 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
6750 * src/graphviz.c, src/graphviz.h: New files.
6751 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
6752 * src/files.h: Make comment more generic.
6753 * src/main.c (main): Likewise.
6754 * src/print_graph.h: Likewise.
6755 * src/getargs.c (usage): Make usage description more generic.
6756 * src/print_graph.c: Include graphviz.h rather than vcg.h.
6757 (static_graph, fgraph): Remove. All uses changed to pass
6758 arguments instead of sharing a static var.
6759 (print_core, print_actions, print_state, print_graph):
6760 Output graphviz format rather than VCG format.
6761 * tests/.cvsignore: Remove *.vcg; add *.dot.
6762 * tests/output.at: Expect *.dot files, not *.vcg files.
6763
dd4bf078
PE
6764 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
6765 accommodates the 2006-10-08 change.
6766
efdd7421
PE
67672006-10-11 Bob Rossi <bob@brasko.net>
6768
6769 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
6770 (b4_yyssa, b4_yyerror_range): New macros.
6771 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
6772 (yypvarsinit): Remove init of removed fields.
6773 (yypushparse): Remove use of removed fields; use new macros instead.
6774
96a1981a
PE
67752006-10-11 Paul Eggert <eggert@cs.ucla.edu>
6776
6777 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
6778 in a push parser. Reindent slightly to match yacc.c better.
6779
67802006-10-11 Bob Rossi <bob@brasko.net>
6781
46356ea4
PE
6782 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
6783 yymsg_alloc fields.
6784 (yypvarsinit, yypushparse): Remove init of removed fields.
6785 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 6786
c1630a8b
PE
67872006-10-09 Paul Eggert <eggert@cs.ucla.edu>
6788
6789 * THANKS: Add Paolo Bonzini and Bob Rossi.
6790
90b9908d
PB
67912006-10-08 Paolo Bonzini <bonzini@gnu.org>
6792
6793 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
6794 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
6795 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
6796 b4_define_user_cde and uses): Remove.
6797 (b4_comment, b4_prefix, b4_sync_start): New.
6798 * data/bison.m4: New file, with most of the content removed from c.m4.
6799 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
6800 * src/output.c (output_skeleton): Pass bison.m4.
6801 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
6802 only if specified.
6803
cf806753
PE
68042006-10-05 Paul Eggert <eggert@cs.ucla.edu>
6805
6806 Fix test failure reported by Tom Lane in
6807 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
6808 and try to make such failures easier to catch in the future.
6809 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
6810 that's now the caller's responsibility.
6811 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
6812 Set yychar = YYEOF if it's negative.
6813 * tests/actions.at (yylex): Abort if asked to read past EOF.
6814 * tests/conflicts.at (yylex): Likewise.
6815 * tests/cxx-type.at (yylex): Likewise.
6816 * tests/glr-regression.at (yylex): Likewise.
6817 * tests/input.at (yylex): Likewise.
6818 * tests/regression.at (yylex): Likewise.
6819 * tests/torture.at (yylex): Likewise.
6820
0e2f006a
PE
68212006-10-01 Paul Eggert <eggert@cs.ucla.edu>
6822
6823 Fix problems with translating English-language diagnostics.
6824 * bootstrap: Fix bug introduced in recent bootstrap changes, with
6825 respect to bison-runtime pot generation. The YY_ stuff
6826 wasn't being captured.
6827 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
6828 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
6829 * runtime-po/POTFILES.in: Add data/push.c.
6830
e3ddc1e3
PE
68312006-09-29 Paul Eggert <eggert@cs.ucla.edu>
6832
6833 Merge bootstrap changes from coreutils.
6834
6835 2006-09-28 Jim Meyering <jim@meyering.net>
6836
6837 Automatically generated dependencies are important even
6838 when all of the sources in a directory come from gnulib.
6839 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
6840 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
6841
6842 2006-09-23 Jim Meyering <jim@meyering.net>
6843
6844 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
6845
6846 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6847
6848 * bootstrap: Add support for --force.
6849 (usage): New function. Describe usage less tersely.
6850 (CVS_only_file): New var.
6851
01e972b3
PE
68522006-09-21 Paul Eggert <eggert@cs.ucla.edu>
6853
6854 * data/push.c (YYPUSH_MORE): Make it an enum instead.
6855 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
6856 Adjust white space and comments to match GNU style better.
6857
c63d3e90
PE
68582006-09-20 Bob Rossi <bob@brasko.net>
6859
6860 * data/push.c (yyresult_get): Remove function.
6861 (YYPUSH_MORE): Add #define.
6862 (yypushparse): Modify return value.
6863
e70f46d1
PE
68642006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6865
6866 * stamp-h.in: Remove; no longer needed.
6867 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
6868 Remove config.h, config.hin, intl (no longer created).
6869 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
6870 stamp-h1.
6871
6872 Sync bootstrap from coreutils, as follows:
6873
6874 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
6875
6876 * bootstrap (symlink_to_gnulib): New function.
6877 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
6878 to copies-of-gnulib.
6879 (cp_mark_as_generated, slurp, gnulib_files):
6880 Avoid making a copy if it's the same as the old version.
6881 (gnulib_files): Add support for this variable (used by Bison).
6882
a92be413
PE
68832006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6884
6885 * src/getargs.c (usage): Rework to use conventions similar to
6886 coreutils, to make translation a bit easier and the code a bit
6887 smaller. Problem reported by Tim Van Holder.
6888
4f82b42a
PE
68892006-09-15 Paul Eggert <eggert@cs.ucla.edu>
6890
3b2942e6
PE
6891 Use some of gnulib's new modules, taken from coreutils.
6892
6893 * bootstrap: Sync from coreutils, except add support for gnulib_files.
6894 * bootstrap.conf: New file.
6895 (gnulib_modules): Add configmake, inttypes, unistd.
6896 (XGETTEXT_OPTIONS): Add complain, complain_at,
6897 fatal, fatal_at, warn, warn_at, unexpected_end.
6898 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
6899 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
6900 (gl_EARLY): Add.
6901 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
6902 (gl_INIT): Add
6903 (GNULIB_AUTOCONF_SNIPPET): Remove.
6904 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
6905 the pickiest.
6906 * lib/.cvsignore: Add inttypes_.h.
6907 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
6908 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
6909 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
6910 no-longer-necessary initializations.
6911 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
6912 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
6913 use the unistd module.
6914 * src/system.h: Likewise.
6915 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
6916 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
6917 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
6918 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
6919 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
6920 * src/system.h: Include inttypes.h unconditionally, now that we
6921 use the inttypes module. Don't bother to include stdint.h, since
6922 inttypes.h now does that for us.
6923 (LOCALEDIR): Remove, now that we use the configmake module.
6924 * src/getargs.c: Include configmake.h.
6925 * src/main.c: Likewise.
6926 * src/output.c: Likewise.
6927 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
6928 not from $abs_top_builddir, since config.h moved.
6929
6930
4f82b42a
PE
6931 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
6932 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
6933
6934 * src/parse-gram.y (symbol_declaration): Don't put statements
6935 before declarations; it's not portable to C89.
6936 * src/scan-code.l (handle_action_at): Likewise.
6937
6938 * src/scan-code.l: Always initialize braces_level; the old code
6939 left it uninitialized and therefore had undefined behavior.
6940
6941 Don't attempt to redefine 'assert', since it runs afoul of
6942 systems where standard headers (mistakenly) include <assert.h>.
6943 Instead, define and use our own alternative, called 'aver'.
6944 * src/reader.c: Don't include assert.h, since we no longer
6945 use assert.
6946 * src/scan-code.l: Likewise.
6947 * src/system.h (assert): Remove, replacing with....
6948 (aver): New function, taking a bool arg. All uses changed.
6949 * src/tables.c (pack_vector): Ensure that aver arg is bool,
6950 not merely an integer.
6951
31c10e38
PE
69522006-09-15 Bob Rossi <bob@brasko.net>
6953
e5926647
JD
6954 Add support for push parsing. Based on the original work of
6955 Odd Arild Olsen <oao@fibula.no>.
31c10e38
PE
6956 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
6957 * data/c.m4 (YYPUSH): New.
6958 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
e5926647 6959 * data/push.c: New file.
31c10e38
PE
6960 * src/getargs.c (push_parser): New var.
6961 * src/getargs.h (push_parser): New declaration.
6962 * src/output.c (prepare): Add macro insertion of `push_flag'.
6963 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
6964 (prologue_declaration): Parse %push-parser.
6965 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
6966 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
6967 list of removed lines from the traces observed.
6968 (AT_CHECK_CALC_LALR): Added push parser tests.
6969
fa7b79c0
PE
69702006-09-13 Paul Eggert <eggert@cs.ucla.edu>
6971
21fe08ca
PE
6972 * NEWS: Version 2.3a.
6973 * configure.ac (AC_INIT): Likewise.
6974
e8ec4d9b
PE
6975 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
6976 "#define YYSTYPE int" that caused "make maintainer-check" to fail
6977 due to header ordering dependencies. I don't know why the #define
6978 was there.
6979
fa7b79c0
PE
6980 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
6981 runtime cost when YYDEBUG is not defined, and so that some tests
6982 that used to fail now work. Problem and initial suggestion by
6983 Paolo Bonzini.
6984 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
6985 * data/glr.cc (b4_parser_class_name):
6986 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
6987 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
6988 (yydebug_) [YYDEBUG]: New member.
6989 (yycdebug_): Now defined only if YYDEBUG.
6990 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
6991 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
6992 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
6993 if YYYDEBUG.
6994 (debug_stream, set_debug_stream, debug_level, set_debug_level):
6995 Define only if YYDEBUG.
6996 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
6997 set_debug_level.
6998 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
6999 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
7000 AT_CHECK_CALC_GLR_CC that are working now.
7001
4ec13d60
PE
70022006-09-12 Paul Eggert <eggert@cs.ucla.edu>
7003
7004 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
7005 We don't need them in glr.cc, and glr.c defines them.
7006 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
7007 assumes that defining it to anything is the same as defining
7008 it to 1. Problem reported by Paolo Bonzini.
7009
8e1687ae
PE
70102006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
7011
7012 * data/c.m4 (b4_null, b4_case): Define.
7013 * src/output.c (prepare_symbols): Use b4_null.
7014 (user_actions_output): Use b4_case.
7015
3dc5e96b
PE
70162006-09-11 Paul Eggert <eggert@cs.ucla.edu>
7017
aef3da86
PE
7018 * data/glr.c (b4_shared_declarations): Put start-header first,
7019 before any #includes that we generate, so that feature-test
7020 macros work. Problem reported by Michael Deutschmann in
7021 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
7022 * data/lalr1.cc: Likewise.
7023 * doc/bison.texinfo (Prologue): Document that feature-test macros
7024 should be defined before any Bison declarations.
7025 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
7026 that depend on location.hh after, not before, Bison decls, since
7027 we now include location.hh after the first user prologue.
7028
3dc5e96b
PE
7029 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
7030 Sander Brandenburg in
7031 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
7032 Also, fix minor white space and comment issues.
aef3da86
PE
7033 (Prologue): Mention that it's better to define feature-test macros
7034 before Bison declarations. Problem reported by Michael Deutschmann.
7035
7036 * README-cvs: Fix typo: "&" should be "&&". Problem reported
7037 by Jim Meyering.
7038 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
7039 This adjusts to recent gnulib changes.
3dc5e96b 7040
b2a0b7ca
JD
70412006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
7042
7043 Finish implementation of per-type %destructor/%printer. Discussed
7044 starting at
7045 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
7046 and
7047 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
7048 * NEWS (2.3+): Add a description of this feature to the default
7049 %destructor/%printer description.
7050 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
7051 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
7052 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
7053 list node contains a semantic type.
7054 * src/symtab.c, src/symtab.h: Extend with a table that associates
7055 semantic types with their %destructor's and %printer's.
7056 (semantic_type_from_uniqstr, semantic_type_get,
7057 semantic_type_destructor_set, semantic_type_printer_set): New functions
7058 composing the public interface of that table.
7059 (symbol_destructor_get, symbol_destructor_location_get,
7060 symbol_printer_get, symbol_printer_location_get): If there's no
7061 per-symbol %destructor/%printer, look up the per-type before trying
7062 the default.
7063 * tests/actions.at (Per-type %printer and %destructor): New test case.
7064 * tests/input.at (Default %printer and %destructor redeclared):
7065 Extend to check that multiple occurrences of %symbol-default in a
7066 single %destructor/%printer declaration is an error.
7067 (Per-type %printer and %destructor redeclared, Unused values with
7068 per-type %destructor): New test cases.
7069
3be03b13
JD
70702006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
7071
7072 Require default %destructor/%printer to be declared using
7073 %symbol-default instead of an empty symbol list, and start working on
7074 new per-type %destructor/%printer. Discussed at
7075 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
7076 * NEWS (2.3+): Add %symbol-default to example.
7077 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 7078 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
7079 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
7080 (generic_symlist, generic_symlist_item): New nonterminals for creating
7081 a list in which each item is a symbol, semantic type, or
7082 %symbol-default.
7083 (grammar_declaration): Use generic_symlist in %destructor and %printer
7084 declarations instead of symbols.1 or an empty list.
7085 (symbol_declaration, precedence_declaration, symbols.1): Update actions
7086 for changes to symbol_list.
7087 * src/reader.c: Update for changes to symbol_list.
7088 * src/scan-code.l: Likewise.
7089 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
7090 * src/symlist.c, src/symlist.h: Extend such that a list node may
7091 represent a semantic type or a %symbol-default in addition to just an
7092 ordinary symbol. Add switched functions for setting %destructor's and
7093 %printer's.
7094 * tests/actions.at, tests/input.at: Add %symbol-default to all default
7095 %destructor/%printer declarations.
7096
3508ce36
JD
70972006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
7098
7099 Whether the default %destructor/%printer applies to a particular symbol
7100 isn't a question of whether the user *declares* that symbol (in %token,
7101 for example). It's a question of whether the user by any means
7102 *defines* the symbol at all (by simply using a char token, for
7103 example). $end is defined by Bison whereas any other token with token
7104 number 0 is defined by the user. The error token is always defined by
7105 Bison regardless of whether the user declares it with %token, but we
7106 may one day let the user define error as a nonterminal instead.
7107 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
7108 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
7109 the meaning of "user-defined".
7110 * tests/actions.at (Default %printer and %destructor for user-declared
7111 end token): Rename to...
7112 (Default %printer and %destructor for user-defined end token): ...
7113 this.
7114
7115 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
7116 computation of whether to apply the default, don't maintain a list of
7117 every Bison-defined symbol. Instead, just check for a first character
7118 of '$', which a user symbol cannot have, and check for the error token.
7119
9350499c
JD
71202006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
7121
7122 Don't apply the default %destructor or %printer to the error token,
7123 $undefined, or $accept. This change fits the general rule that the
7124 default %destructor and %printer are only for user-declared symbols,
7125 and it solves several difficulties that are described in the new test
7126 cases listed below.
7127 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
7128 * tests/actions.at (Default %printer and %destructor are not for error
7129 or $undefined, Default %printer and %destructor are not for $accept):
7130 New test cases.
7131
4d7370cb
JD
71322006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
7133
7134 Allow %start after the first rule.
7135 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
7136 when parsing the first rule.
7137 (check_and_convert_grammar): Search for it here after all grammar
7138 declarations have been parsed. Skip midrules, which have dummy LHS
7139 nonterminals.
7140 * src/symtab.c (symbol_is_dummy): New function.
7141 * src/symtab.h (symbol_is_dummy): Declare it.
7142 * tests/input.at (%start after first rule): New test.
7143
6d0ef4ec
JD
71442006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
7145
7146 Redo some of the previous commit: add back the ability to use
7147 non-aliased/undeclared string literals since it might be useful to
7148 those declaring %token-table.
7149 * src/reader.c (check_and_convert_grammar): Undo changes in previous
7150 commit: don't worry about complaints from symbols_pack.
7151 * src/symtab.c (symbol_new, symbol_class_set,
7152 symbol_check_alias_consistency): Undo changes in previous commit: count
7153 each string literal as a new symbol and token, assign it a symbol
7154 number, and don't complain about non-aliased string literals.
7155 (symbols_pack): Since symbol_make_alias still does not decrement symbol
7156 and token counts but does still set aliased tokens to the same number,
7157 symbol_pack_processor now leaves empty slots in the symbols array.
7158 Remove those slots.
7159 * tests/regression.at (Undeclared string literal): Remove test case
7160 added in previous commit since non-aliased string literals are allowed
7161 again.
7162 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
7163 remove unnecessary string literal declarations.
7164 * tests/sets.at (Firsts): Likewise.
7165
965537bc
JD
71662006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
7167
7168 Don't allow an undeclared string literal, but allow a string literal to
7169 be used before its declaration.
7170 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
7171 symbols_pack complained.
7172 * src/symtab.c (symbol_new): Don't count a string literal as a new
7173 symbol.
7174 (symbol_class_set): Don't count a string literal as a new token, and
7175 don't assign it a symbol number since symbol_make_alias does that.
7176 (symbol_make_alias): It's not necessary to decrement the symbol and
7177 token counts anymore. Don't assume that an alias declaration occurs
7178 before any uses of the identifier or string, and thus don't assert that
7179 one of them has the highest symbol number so far.
7180 (symbol_check_alias_consistency): Complain if there's a string literal
7181 that wasn't declared as an alias.
7182 (symbols_pack): Bail if symbol_check_alias_consistency failed since
7183 symbol_pack asserts that every token has been assigned a symbol number
7184 although undeclared string literals have not.
7185 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 7186 string literal): New test cases.
965537bc
JD
7187 (Characters Escapes, Web2c Actions): Declare string literals as
7188 aliases.
7189 * tests/sets.at (Firsts): Likewise.
7190
47aee066
JD
71912006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
7192
7193 In the grammar scanner, STRING_FINISH unclosed constructs and return
7194 them to the parser in order to improve error messages.
7195 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
7196 SC_BRACED_CODE, SC_PROLOGUE): Implement.
7197 * tests/input.at (Unclosed constructs): New test case.
7198 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
7199 seen.
7200
7201 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
7202 unused global.
7203
1f6b3679
JD
72042006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
7205
7206 Handle string aliases for character tokens correctly.
7207 * src/symtab.c (symbol_user_token_number_set): If the token has an
7208 alias, check and set its alias's user token number instead of its own,
7209 which is set to indicate the alias. Previously, every occurrence of
7210 the character token in the grammar overwrote that alias indicator with
7211 the character code.
7212 * tests/input.at (String aliases for character tokens): New test.
7213
219741d8
JD
72142006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
7215
7216 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
7217
11daa4e7
PE
72182006-08-11 Paul Eggert <eggert@cs.ucla.edu>
7219
7220 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
7221 to prevent failures when building on older platforms.
7222 Check for autopoint failure.
7223 Set XGETTEXT_OPTIONS to values that check for C format strings,
7224 so that translators are warned about them (this also helps
7225 prevent core dumps).
7226
7227 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
7228 function, since it simplifies our code a bit.
7229
7230 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
7231 rather than -W, so we don't get bogus warnings about sign comparisons.
7232 Add -Wpointer-arith, since that warning is useful (it reports code
7233 that does not conform to C89 and that some compilers reject).
7234 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
7235 since it's no longer needed.
7236
f9bfc42a
JD
72372006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
7238
7239 Clean up scanners a bit.
7240 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
7241 definitions so gcc won't warn when obstack_for_string is unused.
7242 * src/scan-code.l: config.h and system.h are already #include'd by
7243 scan-code-c.c, so get rid of them here.
7244 * src/scan-gram.l: Likewise.
7245 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
7246 definitions rather than duplicating the rest of it.
7247 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
7248
06e8700a
JD
72492006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
7250
7251 Suppress signed/unsigned comparison warnings for yycheck.
7252 * data/c.m4 (b4_safest_int_type): New macro.
7253 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
7254 a signed int type, cast it to b4_safest_int_type first.
7255 * data/yacc.c: Likewise.
7256 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
7257 also overwritten.
7258
9c437126
PE
72592006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
7260
7261 * doc/bison.texinfo: Fix some typos.
7262
284d8a13
PE
72632006-08-02 Paul Eggert <eggert@cs.ucla.edu>
7264
7265 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
7266 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
7267
7268 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
7269 the latest gnulib does this a different way.
7270 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
7271 translation was patched, so stop omitting it.
7272
ec5479ce
JD
72732006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
7274
7275 Enable declaration of default %printer/%destructor. Make the parser
7276 use these for all user-declared grammar symbols for which the user does
7277 not declare a specific %printer/%destructor. Thus, the parser uses it
7278 for token 0 if the user declares it but not if Bison generates it as
7279 $end. Discussed starting at
7280 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
7281 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
7282 and
7283 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
7284 * NEWS (2.3+): Mention.
7285 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
7286 declare a %destructor for a mid-rule's semantic value. It's just
7287 impossible to declare one specific to it.
7288 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
7289 code. Describe default %destructor form.
7290 * src/parse-gram.y (grammar_declaration): Parse default
7291 %printer/%destructor declarations.
7292 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
7293 and symbol_destructor_location_get rather than accessing the destructor
7294 and destructor_location members of struct symbol.
7295 (symbol_printers_output): Likewise but for %printer's.
7296 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
7297 again.
7298 * src/symtab.c (default_destructor, default_destructor_location,
7299 default_printer, default_printer_location): New static global
7300 variables to record the default %destructor and %printer.
7301 (symbol_destructor_get, symbol_destructor_location_get,
7302 symbol_printer_get, symbol_printer_location_get): New functions to
7303 compute the appropriate %destructor and %printer for a symbol.
7304 (default_destructor_set, default_printer_set): New functions to set the
7305 default %destructor and %printer.
7306 * src/symtab.h: Prototype all those new functions.
7307 * tests/actions.at (Default %printer and %destructor): New test to
7308 check that the right %printer and %destructor are called, that they're
7309 not called for $end, and that $$ and @$ work correctly.
7310 (Default %printer and %destructor for user-declared end token): New
7311 test to check that the default %printer and %destructor are called for
7312 a user-declared end token.
7313 * tests/input.at (Default %printer and %destructor redeclared, Unused
7314 values with default %destructor): New tests to check related grammar
7315 warnings and errors.
7316
868d2d96
JD
73172006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
7318
7319 Clean up handling of %destructor for the end token (token 0).
7320 Discussed starting at
7321 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
7322 and
7323 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
7324
7325 Make the skeletons consistent in how they pop the end token and invoke
7326 its %destructor.
7327 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
7328 state, which has token number 0, since this would invoke the
7329 %destructor for the end token.
7330 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
7331 until after shifting the end token, or else it won't be popped.
7332 * data/yacc.c (yyparse): Likewise.
7333
7334 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
7335 it's the end token. Upon termination, destroy an unshifted lookahead
7336 even when it's the end token.
7337 * data/lalr1.cc (yy::parser::parse): Likewise.
7338 * data/yacc.c (yyparse): Likewise.
7339
7340 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
7341 value warnings for the end token when the user gives the end token a
7342 %destructor.
7343
7344 * tests/actions.at (Printers and Destructors): Test all the above.
7345
62a9592d
PE
73462006-07-24 Paul Eggert <eggert@cs.ucla.edu>
7347
7348 Update to latest gnulib and gettext versions.
7349 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
7350 Add fopen-safer.
7351 (gnulib_files): Add m4/warning.m4. Don't worry about files
7352 overwritten by autopoint.
7353 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
7354 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
7355 rejects them.
7356 Don't use autoreconf; instead, invoke autopoint etc. by hand,
7357 so that we can remove the intl files at a better time.
7358 (intl_files_to_remove): Remove aclocal.m4, since it gets
7359 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
7360 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
7361 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
7362 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
7363 Remove datarootdir hack; no longer needed.
7364 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
7365 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
7366 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
7367 strdup.h.
7368 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
7369 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
7370
10d6970f
PE
73712006-07-20 Paul Eggert <eggert@cs.ucla.edu>
7372
7373 * bootstrap: Adjust to today's change to gnulib-tool by invoking
7374 it with --assume-autoconf='latest-stable'.
7375
50a33993
JD
73762006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
7377
7378 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
7379 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
7380 YYSTYPE' and `{'.
7381 * src/muscle_tab.h (muscle_grow): Replace the header comments with
7382 those from muscle_tab.c since the old ones are misleading.
7383
2ce4ed68
AD
73842006-07-13 Akim Demaille <akim@epita.fr>
7385
7386 Support %define "KEY" {VALUE}.
7387 * src/scan-code.h, src/scan-code.l (translate_action)
7388 (translate_rule_action, translate_symbol_action, translate_code):
7389 Return char *, not const char *.
7390 * src/parse-gram.y (declaration): Rename as...
7391 (prologue_declaration): this.
7392 (string_content): Remove this nonterminal, use STRING.
7393 (braceless, content, content.opt): New nonterminal.
7394 Use them.
7395 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
7396 as value.
7397 * src/scan-gram.l (getargs.h): Don't include it.
7398
db7e5eb5
PE
73992006-07-12 Paul Eggert <eggert@cs.ucla.edu>
7400
7401 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
7402 rather than a for-loop that declares a local bool variable. This
7403 should work around a compatibility problem with a Cray x1e C++
7404 compiler reported by Hung Nguyen in
7405 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
7406 The for-loop was introduced in the 2004-11-17 change but I don't
7407 know why it was needed.
7408
a5d80ba5
AD
74092006-07-12 Akim Demaille <akim@epita.fr>
7410
7411 * data/c.m4: Comment changes.
7412
23eb2a69
AD
74132006-07-10 Akim Demaille <akim@lrde.epita.fr>
7414
7415 * src/complain.c (error_message, ERROR_MESSAGE): New.
7416 To factor...
7417 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
7418 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
7419
ddc8ede1
PE
74202006-07-09 Paul Eggert <eggert@cs.ucla.edu>
7421
7422 * NEWS: Instead of %union, you can define and use your own union type
7423 YYSTYPE if your grammar contains at least one <type> tag.
7424 Your YYSTYPE need not be a macro; it can be a typedef.
7425 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
7426 (Union Decl, Decl Summary): Document this.
7427 * data/glr.c (YYSTYPE): Implement this.
7428 * data/glr.cc (YYSTYPE): Likewise.
7429 * data/lalr1.cc (YYSTYPE): Likewise.
7430 * data/yacc.c (YYSTYPE): Likewise.
7431 * src/output.c (prepare): Output tag_seen_flag.
7432 * src/parse-gram.y (declaration, grammar_declaration):
7433 Use 'union_seen' rather than 'typed' to determine whether
7434 %union has been seen, since grammars can now be typed without
7435 %union.
7436 (symbol_declaration, type.opt, symbol_def):
7437 Keep track of whether a tag has been seen.
7438 * src/reader.c (union_seen, tag_seen): New vars.
7439 (typed): remove.
7440 * src/reader.h (union_seen, tag_seen, typed): Likewise.
7441 * src/scan-code.l (untyped_var_seen): New variable.
7442 (handle_action_dollar): Adjust to above changes.
7443 (handle_action_dollar, handle_action_at):
7444 Improve overflow checking for outlandish numbers.
7445 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
7446 avoid new diagnostics generated by above changes.
7447 * tests/regression.at (YYSTYPE typedef): Add test to check
7448 for type tags without %union.
7449
7450 * src/symlist.c (symbol_list_length): Return int, not unsigned
7451 int, since callers expect int. This may need to get revisited
7452 once we have proper integer overflow checking.
7453
7454 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
7455 object is now static.
7456
7457 * src/getargs.c (flags_argmatch): Return void, not int,
7458 to pacify ./configure --enable-gcc-warnings.
7459
7460 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
7461 since last_string is already defined to FLEX_PREFIX (last_string).
7462
7b42569e
AD
74632006-07-09 Akim Demaille <akim@lrde.epita.fr>
7464
7465 Implement --warnings/-W.
7466 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
7467 replaced by...
7468 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
7469 Adjust callers.
7470 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
7471 (warnings_args, warnings_types): New.
7472 (getargs, short_options, long_options): Accept -W/--warnings.
7473 Sort the options by alphabetical order, upper case letter right
7474 before its lower case.
7475
3b452f4e
JD
74762006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
7477
7478 Change %merge result type clash warnings to errors. Discussed at
7479 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
7480 * src/reader.c (record_merge_function_type): Use complain_at.
7481 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7482 declared later): Update test case results.
7483
b8a41559
AD
74842006-07-09 Akim Demaille <akim@lrde.epita.fr>
7485
7486 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
7487 to be in alphabetical order.
7488 (trace_args): Spelling fixes.
7489
cd9e1ba2
PE
74902006-07-09 Paul Eggert <eggert@cs.ucla.edu>
7491
7492 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
7493 so they don't collide with user-defined macros.
7494 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
7495 this was never guaranteed, and now that we're using gnulib stdint,
7496 which defines int_fast16_t to long int, the problem is exposed.
7497
cb48f191
PE
74982006-07-08 Paul Eggert <eggert@cs.ucla.edu>
7499
b8445a15
PE
7500 * data/c.m4 (b4_basename): Simplify a bit, since we don't
7501 need the full POSIX semantics (and weren't implementing them
7502 anyway).
7503
cb48f191
PE
7504 Adjust to Autoconf 2.60 and today's gnulib.
7505 * bootstrap (gnulib_modules): Add stdint.
7506 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
7507 no longer copies it.
7508 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
7509 since stdint needs the former and wcwidth (which is now required
7510 by mbswidth) needs the latter.
7511 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
7512 work around a compatibility glitch between gettext 0.14.6 and
7513 Autoconf 2.60.
7514 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
7515 Do not check for uintptr_t, since new stdint module does the right
7516 thing.
7517 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
7518 Add stdint.h, stdint_.h, wcwidth.h.
7519 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
7520 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
7521 stdint.m4, wchar_t.m4, wcwidth.m4.
7522 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
7523 usual order for ../lib/*.h files.
7524 (file_name_split): Use last_component, not base_name, to adjust
7525 to gnulib changes.
7526 * src/parse-gram.h: Include <strverscmp.h> in the usual order
7527 for ../lib/*.h files.
7528 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
7529 Define unconditionally, since we now assume the stdint module.
7530 * src/scan-skel.l: Include <dirname.h>.
7531 (BASE_QPUTS): Use last_component, not base_name.
7532 * src/system.h: Include <unlocked-io.h> in the usual order
7533 for ../lib/*.h files. Include <stdint.h> unconditionally,
7534 since we now use the stdint module.
7535 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
7536 HAVE_UINTPTR_T, since we now use the stdint module.
7537 (base_name): Remove decl, since files now include <dirname.h>
7538 to get the decl.
7539
cd48d21d
AD
75402006-07-08 Akim Demaille <akim@lrde.epita.fr>
7541
7542 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
7543 New, default to 1.
7544 * data/yacc.c, data/glr.c, data/location.cc: Use them.
7545 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
7546 default.
7547 * tests/calc.at: Adjust.
7548
8ec0a172
AD
75492006-07-08 Akim Demaille <akim@lrde.epita.fr>
7550
b8445a15 7551 * data/c.m4 (b4_basename): New.
8ec0a172
AD
7552 (b4_syncline): Also output the location of its invocation (from
7553 the skeleton).
7554 (b4_user_action, b4_define_user_action, b4_user_actions)
7555 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
7556 (b4_user_stype): New.
7557 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
7558
4a678af8
JD
75592006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
7560
7561 In the grammar file, the first column is 1 not 0 on the first line as
7562 on every other line.
7563 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
7564 * tests/input.at (Torturing the Scanner): Update output.
7565
7566 * src/scan-gram.l (scanner_cursor): Declare it static.
7567
dd60572a
JD
75682006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
7569
7570 In warnings, say "previous declaration" rather than "first
7571 declaration".
7572 * src/symtab.c (redeclaration): Do that here.
7573 * src/reader.c (record_merge_function_type): In the case of a result
7574 type clash, report the previous declaration rather than the very first
7575 one in the grammar file.
7576 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7577 declared later): Add a third declaration to check this behavior.
7578 * tests/input.at (Incompatible Aliases): Update output.
7579
2073e1b6
AD
75802006-06-27 Akim Demaille <akim@epita.fr>
7581
7582 * doc/Doxyfile.in: New.
7583 * doc/Makefile.am: Use it.
7584 * src/lalr.h, src/symtab.h: Initial doxygenation.
7585
8ee5b538
JD
75862006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7587
7588 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
7589 declared after the %merge. This continues the effort of the previous
7590 patch.
8ee5b538
JD
7591 * src/reader.c (get_merge_function): Don't set the merger type yet.
7592 (record_merge_function_type): New function for setting the merger type
7593 and checking for clashes.
7594 (grammar_current_rule_merge_set): Set the location of the %merge for
7595 the current rule.
7596 (packgram): Invoke record_merge_function_type for each rule now that
7597 all symbol type declarations have been parsed.
7598 * src/reader.h (merger_list.type_declaration_location): New member
7599 storing the location of the first %merge from which the type for this
7600 merging function was derived.
7601 * src/symlist.h (symbol_list.merger_declaration_location): New member
7602 storing the location of a rule's %merge, if any.
7603 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7604 declared later): New test to catch the error fixed by the above patch.
7605
ffa4ba3a
JD
76062006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7607
7608 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
7609 declarations appear after the rules. Discussed at
7610 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
7611 and
7612 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
7613 Don't mistake the type of $$ in a midrule to be that of its parent
7614 rule's $$.
ffa4ba3a
JD
7615 * src/reader.c (grammar_current_rule_end): Don't invoke
7616 grammar_rule_check yet since not all symbol declarations may have been
7617 parsed yet.
7618 (grammar_midrule_action): Likewise.
7619 Don't record whether the midrule's $$ has been used yet since actions
7620 haven't been translated yet.
7621 Record the midrule's parent rule and its RHS index within the parent
7622 rule.
7623 (grammar_current_rule_action_append): Don't translate the action yet
7624 since not all symbol declarations may have been parsed yet and, thus,
7625 warnings about types for $$, $n, @$, and @n can't be reported yet.
7626 (packgram): Translate the action and invoke grammar_rule_check now that
7627 all symbol declarations have been parsed.
7628 * src/scan-code.l (handle_action_dollar): Now that this is invoked
7629 after parsing the entire grammar file, the symbol list here in the case
7630 of a midrule is actually the midrule's empty RHS, so reference its
7631 parent rule's RHS where necessary.
7632 On the other hand, now that you can already know it's a midrule, you
7633 aren't forced to think $$ has the same type as its parent rule's $$.
7634 (handle_action_at): In the case of a midrule, reference the parent rule
7635 where necessary.
7636 * src/symlist.c (symbol_list_new): Initialize new midrule-related
7637 members.
7638 (symbol_list_length): Now that this is invoked after all rules have
7639 been parsed, a NULL symbol (rather than a NULL symbol list node)
7640 terminates a rule. symbol_list_print already does this correctly.
7641 * src/symlist.h (symbol_list.midrule_parent_rule,
7642 symbol_list.midrule_parent_rhs_index): New members so that midrules can
7643 remember their relationships with their parents.
7644 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
7645 fixed by the above patch.
7646 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
7647 implementing...
7648 (Unused values): ... this old test case and...
7649 (Unused values before symbol declarations): ... this new test case.
7650 This one is the same as `Unused values' except that all symbol
7651 declarations appear after the rules in order to catch the rest of the
7652 errors fixed by the above patch.
7653
e256e17f
JD
76542006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7655
300a1930
JD
7656 More cleanup.
7657 * src/reader.c (current_rule): Declare it static since it's no longer
7658 used outside this file.
7659 (grammar_current_rule_action_append): Remove redundant arguments from
7660 translate_rule_action invocation.
7661 * src/reader.h (current_rule): Remove this unused extern.
7662 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
7663 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 7664
381ecb06
JD
76652006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
7666
7667 Clean up yesterday's patch.
7668 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
7669 to...
7670 * src/reader.c (grammar_current_rule_action_append): ... here for
7671 consistency with grammar_current_rule_symbol_append.
7672 * tests/regression.at (Braced code in declaration in rules section):
7673 Make yyerror and yylex static as usual.
7674
4210cd0b
JD
76752006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
7676
7677 Fix bug that mistakes braced code in a declaration in the rules section
7678 to be a rule action. Mentioned at
7679 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
7680 * src/scan-gram.l: Move midrule action detection from the start of the
7681 scanning of any braced code to...
7682 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
7683 action. For readability, use $2 and @2 rather than the equivalent
7684 global variables.
7685 * tests/regression.at (Braced code in declaration in rules section):
7686 New test to catch the error fixed by the above patch.
7687
7688 Work on code readability some.
7689 * src/scan-code.l (current_rule): Get rid of this misleading and
7690 redundant declaration: it's actually extern'ed in reader.h.
7691 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
7692 translate_action): Add a rule argument and use it instead of the global
7693 current_rule.
7694 (translate_rule_action): This already receives current_rule through an
7695 argument, so pass it on to translate_action instead of assigning
7696 current_rule to current_rule.
7697 (translate_symbol_action, translate_code): Pass rule = NULL to
7698 translate_action.
7699
34f98f46
JD
77002006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
7701
7702 Rename %before-definitions to %start-header and %after-definitions to
7703 %end-header. Don't use these declarations to separate pre-prologue
7704 blocks from post-prologue blocks. Add new order-independent
7705 declarations %before-header and %after-header as alternatives to the
7706 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
7707 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
7708 * NEWS (2.3+): Update for these changes.
7709 * data/glr.c (b4_before_definitions): Update to...
7710 (b4_start_header): ... this.
7711 (b4_after_definitions): Update to...
7712 (b4_end_header): ... this.
7713 * data/glr.cc: Likewise.
7714 * data/lalr1.cc: Likewise.
7715 * data/yacc.c: Likewise.
7716 * doc/bison.texinfo (The prologue): Update names, and replace remaining
7717 prologue blocks with %*-header declarations.
7718 (Calc++ Parser): Likewise.
91661ebb 7719 (Decl Summary): Update names.
148d66d8 7720 (Table of Symbols): Update description.
34f98f46
JD
7721 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
7722 (PERCENT_END_HEADER): ... this.
7723 (PERCENT_BEFORE_DEFINITIONS): Update to...
7724 (PERCENT_START_HEADER): ... this.
7725 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
7726 (declaration): Update token names and m4 macro names.
7727 When parsing %end-header and %start-header, invoke translate_code
7728 before muscle_code_grow, and no longer set global booleans to remember
7729 whether these declarations have been seen.
7730 Parse new %after-header and %before-header.
7731 * src/reader.c (before_definitions, after_definitions): Remove.
7732 (prologue_augment): Accept a new bool argument to specify whether to
7733 augment the pre-prologue or post-prologue.
7734 * src/reader.h (before_definitions, after_definitions): Remove these
7735 extern's.
7736 (prologue_augment): Add new bool argument.
7737 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
7738 (PERCENT_END_HEADER): ... this.
7739 (PERCENT_BEFORE_DEFINITIONS): Update to...
7740 (PERCENT_START_HEADER): ... this.
7741 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
7742 * tests/actions.at (Printers and Destructors): Update names.
7743
31b2b07e
JD
77442006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
7745
7746 Add comparison operators for C++ location classes. Discussed at
7747 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
7748 * data/c++.m4 (b4_define_location_comparison): New boolean %define
7749 declaration indicating whether filename_type has an operator==. If
7750 filename_type is `std::string', it defaults to `1', `0' otherwise.
7751 * data/location.cc: Iff b4_define_location_comparison is `1', add
7752 operator== and operator!= for class position and for class location.
7753
7754 Some minor fixes.
7755 * src/scan-action.l: Remove unused file.
7756 * src/symtab.c (symbol_printer_set): Use printer_location not
7757 destructor_location.
7758 * src/symtab.h (struct symbol): Replace incorrect source comment for
7759 printer members.
7760 * tests/input.at (Incompatible Aliases): Update output with correct
7761 printer location.
7762
9bc0dd67
JD
77632006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
7764
7765 Don't put the pre-prologue in the header file. For the yacc.c code
7766 file and the glr.c header and code files, move the pre-prologue before
7767 the token definitions. Add new %before-definitions and
7768 %after-definitions to declare code that will go in both the header file
7769 and code file. Discussed at
7770 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
7771 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
7772 and
7773 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
7774 * NEWS (2.3+): Describe these changes.
7775 * data/glr.c (b4_pre_prologue): Move from within to before...
7776 (b4_shared_declarations): ... this.
7777 Add new b4_before_definitions before b4_token_enums.
7778 Add new b4_after_definitions at the end.
7779 * data/glr.cc (b4_pre_prologue): Replace with...
7780 (b4_before_definitions): ... this in the header file.
7781 (b4_after_definitions): New near the end of the header file.
7782 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
7783 code file right before including the header file.
7784 (b4_before_definitions): New in the previous position of
7785 b4_pre_prologue in the header file.
7786 (b4_after_definitions): New near the end of the header file.
7787 * data/yacc.c: Clean up some m4 quoting especially in the header file.
7788 (b4_token_enums_defines): In the code file, move to right before
7789 YYSTYPE for consistency with the header file.
7790 (b4_before_definitions): New right before b4_token_enums_defines in
7791 both the header and code file.
7792 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
7793 header and code file.
7794 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
7795 of prologues for %union dependencies.
91661ebb
JD
7796 (Decl Summary): In %defines description, mention the effect of
7797 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
7798 (Calc++ Parser): Forward declare driver in a %before-definitions rather
7799 than in the pre-prologue so that make check succeeds.
148d66d8 7800 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
7801 %after-definitions.
7802 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
7803 %before-definitions.
7804 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
7805 (declaration): Parse those declarations and append to
7806 b4_before_definitions and b4_after_definitions, respectively.
7807 * src/reader.c (before_definitions, after_definitions): New bools to
7808 track whether those declarations have been seen.
7809 (prologue_augment): Add to the post-prologue if %union,
7810 %before-definitions, or %after-definitions has been seen.
7811 * src/reader.h (before_definitions, after_definitions): New extern's.
7812 * src/scan-gram.l: Scan the new declarations.
7813 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
7814 prologue block in a %before-definitions or a %after-definitions based
7815 on whether the %union is declared.
7816 * tests/regression.at (Early token definitions with --yacc, Early token
7817 definitions without --yacc): Move tests for token definitions into the
7818 post-prologue since token names are no longer defined in the
7819 pre-prologue.
7820
203b9274
AD
78212006-06-20 Akim Demaille <akim@epita.fr>
7822
7823 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
7824 (symbol_get): Use it.
7825 * src/parse-gram.y: Use it.
7826
a7ee59cf
JD
78272006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
7828
7829 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
7830 build succeeds when configured with --enable-gcc-warnings.
7831
5a2baae7
PE
78322006-06-19 Paul Eggert <eggert@cs.ucla.edu>
7833
33ad1a9c
PE
7834 * src/parse-gram.y (char_name): New function.
7835 (CHAR, STRING, string_content): For %printer, properly escape.
7836 (ID): Prefer fputs to fprintf.
7837 (id): Reindent to be consistent with other rules.
7838 Properly quote char.
7839
5a2baae7
PE
7840 The Translation Project changed its way of publishing translations
7841 to maintainers. I haven't received any responses to my request
7842 for supporting the old way, or for documenting the new way. I
7843 have modified 'bootstrap' to use screen scraping
7844 (in this case, HTML scraping). This is unreliable and inelegant,
7845 but I don't see any better way. Yuck.
7846 * bootstrap (TP_URL, WGET_COMMAND): New vars.
7847 (get_translations): New function, which uses HTML scraping to
7848 deduce locations of latest translations.
7849 Use this function to grab both bison and bison-runtime .po files.
7850 Don't bother priming the pump for the runtime-po domain any more,
7851 as it's now translated better than bison is.
7852
58d7a1a1
AD
78532006-06-19 Akim Demaille <akim@epita.fr>
7854
7855 * src/scan-gram.l: No longer "parse" things after `%union' until
7856 `{'. Rather, return a single "%union" token.
7857 No longer make symbols: return strings, and leave the conversion
7858 to symbols to the parser.
7859 (SC_PRE_CODE, token_type): Remove.
7860 * src/parse-gram.y (%union): New field `character'.
7861 Sort tokens.
7862 (CHAR): New token.
7863 (ID, ID_COLON): Now that the scanner no longer makes them
7864 identifiers, adjust all uses to invoke symbol_get.
7865 (id_colon): New, wraps the conversion from string to symbol.
7866 (%union): Accept a possible union_name.
7867 (symbol): Now can be a char.
7868 * data/c.m4 (b4_union_name): Leave a default value.
7869 * data/glr.c, data/yacc.c: Use it.
7870
b931235e
JD
78712006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
7872
7873 For associating token numbers with token names for "yacc.c", don't use
7874 #define statements unless `--yacc' is specified; always use enum
7875 yytokentype. Most important discussions start at:
7876 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
7877 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
7878 and
7879 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
7880 * NEWS (2.3+): Mention.
7881 * data/c.m4 (b4_yacc_if): New.
7882 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
7883 token #define's.
7884 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
7885 on token name definitions.
7886 * src/getargs.c (usage): Capitalize `Yacc' in English.
7887 * src/output.c (prepare): Define b4_yacc_flag.
7888 * tests/regression.at (Early token definitions): Test that tokens names
7889 are defined before the pre-prologue not just before the post-prologue.
7890 Remove this test case and copy to...
7891 (Early token definitions with --yacc): ... this to test #define's.
7892 (Early token definitions without --yacc): ... and this to test enums.
7893
9e6e7ed2
PE
78942006-06-11 Paul Eggert <eggert@cs.ucla.edu>
7895
7896 * NEWS: Reword the post-2.3 change to not be so optimistic about
7897 removing the old "look-ahead" spelling.
7898 Update previous look-ahead/lookahead change reports.
7899 * REFERENCES: look-ahead -> lookahead (since that's
7900 what he actually wrote).
7901 * doc/refcard.tex: look ahead -> lookahead,
7902 look-ahead -> lookahead
7903
742e4900
JD
79042006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
7905
7906 For consistency, use `lookahead' instead of `look-ahead' or
7907 `look_ahead'. Discussed starting at
7908 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
7909 and then at
7910 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
7911 * NEWS: For the next release, note the change to `--report'.
7912 * TODO, doc/bison.1: Update English.
7913 * doc/bison.texinfo: Update English.
7914 (Understanding Your Parser, Bison Options): Document as
7915 `--report=lookahead' rather than `--report=look-ahead'.
7916 * src/conflicts.c: Update English in comments.
7917 (lookahead_set): Rename from look_ahead_set.
7918 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
7919 (resolve_sr_conflict): Rename local look_ahead_tokens to
7920 lookahead_tokens, and update other uses.
7921 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
7922 count_rr_conflicts, conflicts_free): Update uses.
7923 * src/getargs.c (report_args): Move "lookahead" before alternate
7924 spellings.
7925 (report_types): Update uses.
7926 (usage): For `--report' usage description, state `lookahead' spelling
7927 rather than `look-ahead'.
7928 * src/getargs.h (report.report_lookahead_tokens): Rename from
7929 report_look_ahead_tokens.
7930 * src/lalr.c: Update English in comments.
7931 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
7932 (state_lookahead_tokens_count): Rename from
7933 state_look_ahead_tokens_count.
7934 Rename local n_look_ahead_tokens to n_lookahead_tokens.
7935 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
7936 Rename local n_look_ahead_tokens to n_lookahead_tokens.
7937 Update other uses.
7938 Update English in output.
7939 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
7940 * src/print.c: Update English in comments.
7941 (lookahead_set): Rename from look_ahead_set.
7942 (print_reduction): Rename argument lookahead_token from
7943 look_ahead_token.
7944 (print_core, state_default_rule, print_reductions, print_results):
7945 Update uses.
7946 * src/print_graph.c: Update English in comments.
7947 (print_core): Update uses.
7948 * src/state.c: Update English in comments.
7949 (reductions_new): Update uses.
7950 (state_rule_lookahead_tokens_print): Rename from
7951 state_rule_look_ahead_tokens_print, and update other uses.
7952 * src/state.h: Update English in comments.
7953 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
7954 (state_rule_lookahead_tokens_print): Rename from
7955 state_rule_look_ahead_tokens_print.
7956 * src/tables.c: Update English in comments.
7957 (conflict_row, action_row): Update uses.
7958 * tests/glr-regression.at
7959 (Incorrect lookahead during deterministic GLR,
7960 Incorrect lookahead during nondeterministic GLR): Rename
7961 print_look_ahead to print_lookahead.
7962 * tests/torture.at: Update English in comments.
7963 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
7964 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
7965 (Many lookahead tokens): Update uses.
7966 * data/glr.c: Update English in comments.
7967 * lalr1.cc: Likewise.
7968 * yacc.c: Likewise.
7969 * src/conflicts.h: Likewise.
7970 * src/lalr.h: Likewise.
7971 * src/main.c: Likewise.
7972 * src/output.c: Likewise.
7973 * src/parse-gram.c: Likewise.
7974 * src/tables.h: Likewise.
7975 * tests/calc.at: Likewise.
7976
3c40d0b5
JD
79772006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
7978
7979 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
7980
5d278082
PE
79812006-06-07 Paul Eggert <eggert@cs.ucla.edu>
7982
7983 * TODO: Add request from Nelson H. F. Beebe to be able to install
7984 Bison without installing the yacc script.
7985
9e668899
JD
79862006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
7987
7988 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
7989 and yytext if they're already #define'd.
7990 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
7991 * src/scan-code-c.c: ... here.
7992 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
7993 <config.h>.
7994
0c8e079f
JD
79952006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
7996
7997 Get Bison to build again when configured with --enable-gcc-warnings.
7998 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
7999 missing #include's.
8000 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
8001 loc argument as it shadows a global.
8002 * src/scan-gram.l: Remove stray comma that prevents boundary_set
8003 invocation.
8004
8005 * src/.cvsignore: Add scan-code.c.
8006
2346344a
AD
80072006-06-07 Akim Demaille <akim@epita.fr>
8008
8009 * src/scan-gram.l: Move the "add a trailing ; to actions" code
8010 to...
8011 * src/scan-code.l: here.
8012 * tests/input.at (Torturing the Scanner): Fix another location
8013 error.
8014
4862bdfd
AD
80152006-06-07 Akim Demaille <akim@epita.fr>
8016
8017 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
8018
e9071366
AD
80192006-06-06 Akim Demaille <akim@epita.fr>
8020
8021 Extract the parsing of user actions from the grammar scanner.
8022 As a consequence, the relation between the grammar scanner and
8023 parser is much simpler. We can also split "composite tokens" back
8024 into simple tokens.
8025 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
8026 * src/scan-gram.l (add_column_width, adjust_location): Move to and
8027 rename as...
8028 * src/location.h, src/location.c (add_column_width)
8029 (location_compute): these.
8030 Fix the column count: the initial column is 0.
8031 (location_print): Be robust to ending column being 0.
8032 * src/location.h (boundary_set): New.
8033 * src/main.c: Adjust to scanner_free being renamed as
8034 gram_scanner_free.
8035 * src/output.c: Include scan-code.h.
8036 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
8037 Use boundary_set.
8038 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
8039 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
8040 which is now, again, a separate token.
8041 Adjust all dependencies.
8042 Whereever actions with $ and @ are used, use translate_code.
8043 (action): Remove this nonterminal which is now useless.
8044 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
8045 (grammar_current_rule_action_append): Use translate_code.
8046 (packgram): Bound check ruleno, itemno, and rule_length.
8047 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
8048 (last_string, last_braced_code_loc, max_left_semantic_context)
8049 (scanner_initialize, scanner_free, scanner_last_string_free)
8050 (gram_out, gram_lineno, YY_DECL_): Move to...
8051 * src/scan-gram.h: this new file.
8052 (YY_DECL): Rename as...
8053 (GRAM_DECL): this.
8054 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
8055 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
8056 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
8057 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
8058 Move these declarations, and...
8059 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
8060 these to...
8061 * src/flex-scanner.h: this new file.
8062 * src/scan-gram.l (rule_length, rule_length_overflow)
8063 (increment_rule_length): Remove.
8064 (last_braced_code_loc): Rename as...
8065 (gram_last_braced_code_loc): this.
8066 Adjust to the changes of the parser.
8067 Move all the handling of $ and @ into...
8068 * src/scan-code.l: here.
8069 * src/scan-gram.l (handle_dollar, handle_at): Remove.
8070 (handle_action_dollar, handle_action_at): Move to...
8071 * src/scan-code.l: here.
8072 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
8073 scan-code.h, scan-code-c.c, scan-gram.h.
8074 (EXTRA_bison_SOURCES): Add scan-code.l.
8075 (BUILT_SOURCES): Add scan-code.c.
8076 (yacc): Be robust to white spaces.
8077
8078 * tests/conflicts.at, tests/input.at, tests/reduce.at,
8079 * tests/regression.at: Adjust the column numbers.
8080 * tests/regression.at: Adjust the error message.
7891a7c4 8081
184e42f0
JD
80822006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
8083
8084 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
8085 Use Akim's wording from
8086 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
8087
7891a7c4
JD
80882006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
8089
8090 Between Bison releases, manually append `+' to the previous Bison
8091 release number, and use that as a signal to automatically print the
8092 ChangeLog's CVS Id keyword from --version. Discussed starting at
8093 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
8094 * ChangeLog: Add Id header.
8095 * configure.ac (AC_INIT): Append `+' to `2.3'.
8096 * src/.cvsignore: Add revision.c.
8097 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
8098 (BUILT_SOURCES): Add revision.c.
8099 (revision.c): New target rule. This file defines a new global variable
8100 named revision. It initializes it with either the Id from ChangeLog
8101 or, if VERSION doesn't contain `+', with the empty string.
8102 * src/getargs.c (version): Print the value of revision.
8103 * src/revision.h: Extern revision.
8104
4ad3ed84
PE
81052006-06-05 Paul Eggert <eggert@cs.ucla.edu>
8106
8107 * NEWS: Version 2.3.
8108 * configure.ac (AC_INIT): Likewise.
8109
02103984
PE
81102006-05-30 Paul Eggert <eggert@cs.ucla.edu>
8111
8112 * data/glr.c (YYRECOVERING): Define to be a function-like macro
8113 with no arguments, not as an object-like macro. This is for
8114 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
8115 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
8116 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
8117 Document this.
8118
2c08afa5
JD
81192006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
8120
8121 * src/getargs.c (usage): Back out yesterday's modification of the
8122 --help output so that we don't have to wait for translation before
8123 releasing 2.3.
8124
6077da58
PE
81252006-05-29 Paul Eggert <eggert@cs.ucla.edu>
8126
8127 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
8128 Problem reported by Akim Demaille.
8129
2a26b6c2
JD
81302006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
8131
8132 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
8133
aefef0d6
PE
81342006-05-26 Paul Eggert <eggert@cs.ucla.edu>
8135
8136 * data/yacc.c (yy_reduce_print): Omit trailing white space in
8137 generated source code. Problem reported by Frans Englich in
8138 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
8139
fcd8e201
PE
81402006-05-22 Paul Eggert <eggert@cs.ucla.edu>
8141
8142 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
8143 shell, not within 'make', so that 'make' by an ordinary builder
8144 (using GNU make) does not worry about configuring gzip. This also
8145 works around a bug reported independently by Keith Thompson and by
8146 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
8147 stderr rather than stdout, messing up the build logs.
8148
7b5cdcbd
JD
81492006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
8150
8151 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
8152 to make sure that YYID will never be unused. This fixes a 'make
8153 maintainer-check' failure caused by the recent changes to the 'Trivial
8154 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
8155 not used.
8156 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
8157
5ad0a449
JD
81582006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
8159
8160 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
8161 state before an empty RHS is always resolved here. Only the location
8162 of that state is guaranteed to be resolved, and that's enough. This
8163 fixes the remaining bug reported by Derek M. Jones in
8164 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
8165 * tests/glr-regression.at (Uninitialized location when reporting
8166 ambiguity): Test the above case.
8167 Also, the embedded comments in this test case claim it checks the case
8168 of an empty RHS that has inherited the initial location. However, the
8169 corresponding LHS was already resolved, so yyresolveLocations didn't
8170 actually have reason to modify it. Fix this by forcing
8171 nondeterministic operation at the beginning of the parse.
8172
50cce58e
PE
81732006-05-20 Paul Eggert <eggert@cs.ucla.edu>
8174
8175 * data/c.m4 (b4_yy_symbol_print_generate):
8176 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
8177 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
8178 of the bugs reported today by Derek M Jones in
8179 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
8180 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
8181 defined to be a type name without parens or brackets.
8182 (Location Type): Similarly for YYLTYPE.
8183 * tests/regression.at (Trivial grammars): Put in a test for this
8184 bug that will be caught by 'make maintainer-check' (though not,
8185 alas, by 'make check' unless your compiler is picky).
8186
ab8d9dc5
PE
81872006-05-19 Paul Eggert <eggert@cs.ucla.edu>
8188
0d2c8934 8189 * NEWS: Version 2.2.
ab8d9dc5
PE
8190 * configure.ac (AC_INIT): Likewise.
8191
9138c575
JD
81922006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
8193
8194 * data/glr.c (yyreportTree): Make room in yystates for the state
8195 preceding the RHS. This fixes the segmentation fault reported by Derek
8196 M. Jones in
8197 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
8198 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
8199 to the user. Reported for yyreportTree by Derek M. Jones later in the
8200 same thread.
8201 * THANKS: Add Derek M. Jones.
8202 Update my email address.
8203 Fix typo in Steve Murphy's name.
8204
276f48df
PE
82052006-05-14 Paul Eggert <eggert@cs.ucla.edu>
8206
d6645148
PE
8207 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
8208 checking against YYLAST that caused the parser to miss a potential
8209 alternative in its diagnostic.
8210 Problem reported by Maria Jose Moron Fernandez in
8211 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
8212 * data/lalr1.cc (yysyntax_error_): Likewise.
8213 * data/yacc.c (yysyntax_error): Likewise.
8214 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
8215 tokens, in case we run into an older C compiler.
8216 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
8217 Use them to check for the off-by-one error fixed above.
8218
276f48df
PE
8219 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
8220 YYSIZE_T, not size_t.
8221 * tests/regression.at (Trivial grammars): New test, to catch
8222 the error fixed by the above patch.
8223
cd8b5791
AD
82242006-05-14 Akim Demaille <akim@lrde.epita.fr>
8225
8226 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
8227 scheme.
8228 Reported by Steve Murphy.
8229
34376418
AD
82302006-05-14 Akim Demaille <akim@lrde.epita.fr>
8231
8232 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
8233 * data/glr.cc: b4_location_flag is now b4_locations_flag.
8234
327afc7c
AD
82352006-05-14 Akim Demaille <akim@lrde.epita.fr>
8236
8237 Implement --trace=m4.
8238 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
8239 * src/output.c (output_skeleton): When set, pass -dV to m4.
8240
8241 Factor the handling of flags in m4.
8242 * src/output.c (prepare): Rename the muscle names debug, defines,
8243 error_verbose to debug_flag, defines_flag, error_verbose_flag.
8244 * data/c.m4: Adjust.
8245 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
8246 Use b4_define_flag_if to define other b4_FLAG_if macros.
8247 (b4_location_if): As a consequence, rename as...
8248 (b4_locations_if): this, for consistency.
8249 Adjust all the skeletons.
8250
ba9ecd19
AD
82512006-05-14 Akim Demaille <akim@lrde.epita.fr>
8252
8253 * etc/bench.pm: Shorten bench names.
8254
4e83ea15
AD
82552006-05-14 Akim Demaille <akim@lrde.epita.fr>
8256
8257 * src/output.h, src/output.c (error_verbose): Move to...
8258 * src/getargs.h, src/getargs.c: here.
8259 Sort the flags.
8260 Adjust dependencies.
8261
6e93d810
PE
82622006-05-13 Paul Eggert <eggert@cs.ucla.edu>
8263
8264 * data/c.m4 (b4_copyright): Put the special exception for Bison
8265 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
8266 uses changed. Suggested by Akim Demaille. Also, wrap the
8267 copyright notice, in case it is longer than 80 columns. Replace
8268 comma by newline after title.
6e93d810 8269
eaea13f5
PE
82702006-05-11 Paul Eggert <eggert@cs.ucla.edu>
8271
8272 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
8273 incompatibility, not a bug. Mention that it wasn't fixed as of
8274 flex 2.5.33.
8275
3cf084ec
AD
82762006-05-11 Akim Demaille <akim@lrde.epita.fr>
8277
8278 * examples/extexi: Enforce the precedence of concatenation over
8279 >>.
0a9f1c7d 8280 Reported by Tommy Nordgren.
3cf084ec 8281
32c96bd7
AD
82822006-05-11 Akim Demaille <akim@lrde.epita.fr>
8283
8284 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
8285 with the member "token".
f94705b2 8286 Reported by Martin Nylin.
32c96bd7 8287
eaea13f5
PE
82882006-05-08 Paul Eggert <eggert@cs.ucla.edu>
8289
8290 * data/glr.c: Switch to Bison 2.2 special-exception language in
8291 the copyright notice. Use more-regular format for titles and
8292 copyright notices.
8293 * data/glr.cc: Likewise.
8294 * data/location.cc: Likewise.
8295 * data/yacc.cc: Likewise.
8296 * doc/bison.texinfo (Conditions): Document this.
8297 * NEWS: likewise. Upgrade version to 2.2.
8298
6e2d1146
AD
82992006-04-27 Akim Demaille <akim@lrde.epita.fr>
8300
8301 * data/glr.cc: Remove dead code.
8302
47671055
PE
83032006-04-25 Paul Eggert <eggert@cs.ucla.edu>
8304
8305 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
8306 that variable and the line breaks the bootstrap. Problem reported
8307 by Juan M. Guerrero.
8308
ed2e6384
AD
83092006-04-24 Akim Demaille <akim@lrde.epita.fr>
8310
8311 * doc/bison.texinfo (Multiple start-symbols): New.
8312
3cedc2dc
AD
83132006-04-24 Akim Demaille <akim@lrde.epita.fr>
8314
8315 * etc/README, etc/bench.pl: New.
8316
b2ddc3f3
AD
83172006-04-03 Akim Demaille <akim@lrde.epita.fr>
8318
8319 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
8320 rule.
8321 Reported by Mickael Labau.
8322 * tests/input.at (Torturing the Scanner): Test it.
8323
91e3ac9a
PE
83242006-03-16 Paul Eggert <eggert@cs.ucla.edu>
8325
8326 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
8327 Problem reported by Bob Rossi.
8328
83292006-03-13 Paul Eggert <eggert@cs.ucla.edu>
8330
8331 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
8332 and didn't really work.
8333 For the index, use @ifnotinfo, not @iftex.
8334 Minor cleanups of spacing and terminology.
8335
5cf61e93
AD
83362006-03-12 Akim Demaille <akim@lrde.epita.fr>
8337
8338 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
8339 of AT_NAME_PREFIX when %name-prefix is not used.
8340
aa08666d
AD
83412006-03-12 Akim Demaille <akim@lrde.epita.fr>
8342
8343 Apply --prefix to C++ skeletons too: they change the namespace.
8344 The test suite already exercize these cases.
8345 * data/c++.m4 (b4_namespace): New.
8346 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
8347 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
8348 * data/yacc.c, data/glr.c: Remove a useless `[]'.
8349 * doc/bison.texinfo: Document it.
8350 (Option Cross Key): Use @multitable in all formats. It looks
8351 nicer, even in TeX outputs.
8352 (Rules): Use the same code whatever the output type is.
8353 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
8354 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
8355 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 8356
45567173
AD
83572006-03-10 Akim Demaille <akim@lrde.epita.fr>
8358
8359 * TODO: Remove dead items.
8360
e9d8f881 83612006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
8362
8363 * doc/FAQ: Remove, merged into...
8364 * doc/bison.texinfo (FAQ): this.
8365 * doc/Makefile.am (EXTRA_DIST): Adjust.
8366
c095d689
AD
83672006-03-10 Akim Demaille <akim@lrde.epita.fr>
8368
8369 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
8370 even if empty.
8371 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
8372 * doc/bison.texinfo (Calc++ Scanner): Use it.
8373
6e0f8287
PE
83742006-03-09 Paul Eggert <eggert@cs.ucla.edu>
8375
8376 Fix two nits reported by twlevo, plus one more that I discovered.
8377
8378 * src/assoc.h (assoc_to_string): Give a name to the arg, as
8379 this is the usual Bison style.
8380 * src/location.h (location_print): Likewise.
8381
8382 * src/reader.h (token_name): Likewise.
8383
d6b771c3
PE
83842006-03-08 Paul Eggert <eggert@cs.ucla.edu>
8385
8386 Fix some nits reported by twlevo.
8387 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
8388 and "POSIX". Use more-modern syntax for URLs. Mention C++
8389 and ask for Java. Don't hardwire OS version numbers. Add
8390 copyright notice.
8391 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
8392 * src/conflicts.c (solved_conflicts_obstack): Now static.
8393
1e137b71
JD
83942006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
8395
8396 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
8397 page. Say "you can use it" not "you may use it" as on the web page;
8398 we're describing capabilities not granting permission.
8399
73f2e47e
PE
84002006-03-06 Paul Eggert <eggert@cs.ucla.edu>
8401
6d05403d
PE
8402 * data/glr.c (yyresolveLocations): Rename local variables to avoid
8403 shadowing warnings. Use usual patter for iterating through RHS.
8404 * tests/glr-regression.at
8405 (Uninitialized location when reporting ambiguity):
8406 Modify yylex so that it uses its argument, rather than trying
8407 to rely on ARGSUSED (which doesn't work for gcc with warnings).
8408 const char -> char const.
8409
73f2e47e
PE
8410 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
8411 Don't use tabs inside commands; it messes up 'ps'.
8412 Problem reported by twlevo.
8413
8710fc41
JD
84142006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
8415
8416 * tests/glr-regression.at (Uninitialized location when reporting
8417 ambiguity): New test case.
8418 * data/glr.c (yyresolveLocations): New function, which uses
8419 YYLLOC_DEFAULT.
8420 (yyresolveValue): Invoke yyresolveLocations before reporting an
8421 ambiguity.
8422 * doc/bison.texinfo (Default Action for Locations): Note
8423 YYLLOC_DEFAULT's usage for ambiguity locations.
8424 (GLR Semantic Actions): Cross-reference those notes.
8425
ae952af2
JD
84262006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
8427
8428 * tests/glr-regression.at (Leaked semantic values when reporting
8429 ambiguity): Remove unnecessary union and type declarations.
8430 (Leaked lookahead after nondeterministic parse syntax error): New test
8431 case.
8432 * data/glr.c (yyparse): Check for zero stacks remaining before
8433 attempting to shift the lookahead so that you don't lose it.
8434
35ee866a
JD
84352006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
8436
8437 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
8438 * tests/glr-regression.at (Leaked semantic values when reporting
8439 ambiguity): New test case.
8440 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
8441 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
8442 now unnecessary yystackp parameter.
8443 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
8444 destructors can be called.
8445
8446 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
8447 in existing testcases.
8448
520181ab
JD
84492006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
8450
8451 Don't leak semantic values for parent RHS when a user action cuts the
8452 parser, and clean up related code a bit.
8453 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
8454 cuts parse): Rename to...
8455 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
8456 for leaked parent RHS values.
8457 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
8458 between an unresolved state (non-empty chain of semantic options) and
8459 an incomplete one (signaled by an empty chain).
ae952af2 8460 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
8461 successfully or unsuccessfully resolved yyGLRState to...
8462 (yyresolveValue): ... here so that yyresolveValue always leaves a
8463 yyGLRState with consistent data and thus is easier to understand.
8464 Remove the yyvalp and yylocp parameters since they are always just
8465 taken from the yys parameter. When reporting a discarded merged value
8466 in debugging output, note that it is incompletely merged. Document the
8467 interface.
8468 (yyresolveAction): If resolving any of the RHS states fails, destroy
8469 them all rather than leaking them. Thus, as long as user actions are
8470 written to clean up the RHS correctly, yyresolveAction always cleans up
8471 the RHS of a semantic option. Document the interface.
8472
18d9185c
PE
84732006-02-27 Paul Eggert <eggert@cs.ucla.edu>
8474
8475 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
8476 led to a segmentation fault in GNU Pascal. Problem reported
8477 by Waldek Hebisch.
8478
841a7737
JD
84792006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
8480
8481 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
8482 mid-rule action inside a nonterminal symbol in order to declare a
8483 destructor for its semantic value.
8484
fc3f467f
PE
84852006-02-16 Paul Eggert <eggert@cs.ucla.edu>
8486
8487 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
8488 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
8489 __cplusplus && ! defined _STDLIB_H && !
8490 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
8491 defined free))]: Include <stdlib.h> rather than rolling our own
8492 declarations of malloc and free, to avoid problems with
8493 incompatible declarations (using 'throw') C++'s stdlib.h. This
8494 should fix Debian bug 340012
8495 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
8496 reported by Guillaume Melquiond.
8497
a3af26dd
PE
84982006-02-13 Paul Eggert <eggert@cs.ucla.edu>
8499
4d7bc38c
PE
8500 * NEWS: Clarify symbols versus types in unused-value warnings.
8501
a3af26dd
PE
8502 * configure.ac (AC_INIT): Bump version number.
8503
4e26c69e
PE
85042006-02-13 Paul Eggert <eggert@cs.ucla.edu>
8505
8506 * NEWS: Version 2.1a.
8507 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
8508 since C99 requires this.
8509
498e897c
PE
85102006-02-11 Paul Eggert <eggert@cs.ucla.edu>
8511
8512 * m4/c-working.m4: New file.
8513 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
8514
57bb17ca
PE
85152006-02-10 Paul Eggert <eggert@cs.ucla.edu>
8516
8517 * Makefile.maint: Merge from coreutils.
8518
0be105dc
PE
85192006-02-09 Paul Eggert <eggert@cs.ucla.edu>
8520
8521 More portability fixes for problems summarized by Nelson H. F. Beebe.
8522
8523 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
8524 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
8525 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
8526 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
8527 messes up because C++ code is compiled in 32-bit mode but linked
8528 in 64-bit mode.
8529
6fc0c024
PE
85302006-02-08 Paul Eggert <eggert@cs.ucla.edu>
8531
8532 More portability fixes for problems summarized by Nelson H. F. Beebe.
8533
7870f699
PE
8534 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
8535 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
8536
6fc0c024
PE
8537 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
8538 nodist_PROGRAMS, since we don't need to actually compile the
8539 example if we're just doing a plain 'make'. This avoids bothering
8540 the installer unnecessarily about problems due to weird C++
8541 compilers.
8542
fe6c2fde
PE
85432006-02-06 Paul Eggert <eggert@cs.ucla.edu>
8544
8545 More portability fixes for problems summarized by Nelson H. F. Beebe.
8546
8547 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
8548 than #include "...", and compile with -I'.'. The old method was
8549 not portable, according to Posix and the C standard, and it does
8550 not work with Sun C 5.7, where previous #line directives affect
8551 the working directory used in later #include "..." directives.
8552
927b425b
JMG
85532006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8554
8555 Various DJGGP specific issues in /djgpp
8556
d9735e9e
PE
85572006-02-02 Paul Eggert <eggert@cs.ucla.edu>
8558
8559 More portability fixes for problems summarized by Nelson H. F. Beebe.
8560
8561 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
8562 '#include <map>' works and that you can apply ++ to iterators.
8563
5a6755af
PE
85642006-02-01 Paul Eggert <eggert@cs.ucla.edu>
8565
67a0dc4f
PE
8566 Work around portability problems summarized by Nelson H. F. Beebe in
8567 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
8568
8c86f0ef
PE
8569 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
8570 that '#include <string>' works.
8571
de35dd59
PE
8572 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
8573 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
8574 "warning: sorry: semantics of inline function static data `const
8575 unsigned char translate_table[262]' are wrong (you'll wind up with
8576 multiple copies)".
8577
67a0dc4f
PE
8578 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
8579 or, xor to not_, and_, or_, and xor_, respectively. This works
8580 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
8581 random system header somewhere that includes the equivalent of
8582 <iso646.h>.
8583
5a6755af
PE
8584 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
8585 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 8586 Suite Version 2.0.
5a6755af 8587
3f001415
JD
85882006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
8589
8590 During deterministic GLR operation, user actions should be able to
8591 influence the parse by changing yychar. To make this easier to fix and
8592 to make glr.c easier to evolve in general, don't maintain yytoken in
8593 parallel with yychar; just compute yytoken when needed.
8594 * tests/glr-regression.at (Incorrect lookahead during deterministic
8595 GLR): Check that setting yychar in a user action has the intended
8596 effect.
8597 * data/glr.c (yyGLRStack): Remove yytokenp member.
8598 (yyclearin): Don't set *yytokenp.
8599 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
8600 yychar rather than *yytokenp to determine the current lookahead.
8601 Compute yytoken locally when needed.
8602 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
8603 point to.
8604
8605 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
8606 after `--report' documentation.
8607
e2a8c0f5
PE
86082006-01-30 Paul Eggert <eggert@cs.ucla.edu>
8609
8610 * src/parse-gram.y (grammar_declaration): Location of printer
8611 symbol is @1, not list->location. Bug reported by twlevo.
8612 * tests/input.at (Incompatible Aliases): Adjust to above change.
8613
6b702268
PE
86142006-01-29 Paul Eggert <eggert@cs.ucla.edu>
8615
27622431
PE
8616 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
8617 all the test at once. This makes the output easier to read in the
8618 normal case.
8619
6b702268
PE
8620 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
8621 got from <http://bro-ids.org/download.html>. The bug is that
8622 when two actions appeared in succession, the second one was
8623 scanned before the first one was added to the grammar rule
8624 as a midrule action. Bison then output the incorrect warning
8625 "parse.y:905.17-906.36: warning: unused value: $3".
8626 * src/parse-gram.y (BRACED_CODE, action): These are no longer
8627 associated with a value.
8628 (rhs): Don't invoke grammar_current_rule_action_append.
8629 (action): Invoke it here instead.
8630 * src/reader.c (grammar_midrule_action): Now extern.
8631 (grammar_current_rule_action_append): Don't invoke
8632 grammar_midrule_action; that is now the scanner's job.
8633 * src/reader.h (last_string, last_braced_code_loc):
8634 (grammar_midrule_action): New decls.
8635 * src/scan-gram.l (last_string): Now extern, sigh.
8636 (last_braced_code_loc): New extern variable.
8637 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
8638 rule already has an action.
8639 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
8640 * tests/input.at (AT_CHECK_UNUSED_VALUES):
8641 Add some tests to check that the above changes fixed the bug.
8642
d40ba6c2
PE
86432006-01-27 Paul Eggert <eggert@cs.ucla.edu>
8644
8645 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
8646 All used changed. Check whether the symbol has a destructor,
8647 not whether it is typed.
8648 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
8649 that the values are still reported as unused. All line numbers
8650 adjusted.
8651
401aace6
PE
86522006-01-23 Paul Eggert <eggert@cs.ucla.edu>
8653
8654 Work around a bug in bro 0.8, which underparenthesizes its
8655 definition of YYLLOC_DEFAULT.
8656 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
8657 their arguments.
8658 * data/lalr1.cc: Likewise.
8659 * data/yacc.cc: Likewise.
8660
06f01bc4
PE
86612006-01-22 Paul Eggert <eggert@cs.ucla.edu>
8662
401aace6
PE
8663 Work around a bug in Pike 7.0, and give the Pike folks a
8664 better way to override the usual int widths.
8665 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
8666 user can override the types.
8667 (short): #undef, to work around a bug in Pike 7.0.
8668 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
8669 (union yyalloc.yyss): Use yytype_int16 rather than short.
8670 All uses changed.
8671 (yysigned_char): Remove.
8672 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
8673 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
8674 * tests/regression.at (Web2c Actions): Adjust to above changes.
8675
8676 * src/reader.c (check_and_convert_grammar): New function.
8677 (reader): Close the input file even if something went wrong during
8678 parsing. Minor file descriptor leak reported by twlevo.
8679
06f01bc4
PE
8680 * src/assoc.c (assoc_to_string): Use a default: abort (); case
8681 to pacify gcc -Wswitch-default.
8682 * src/scan-gram.l (adjust_location): Use a default: break; case
8683 to pacify gcc -Wswitch-default.
8684 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
8685 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
8686 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
8687 Move these decls to scan-skel.l, since they don't need to be
8688 visible elsewhere.
8689 * src/scan-skel.l: Accept the above decls.
8690 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
8691 is used.
8692
02650b7f
PE
86932006-01-21 Paul Eggert <eggert@cs.ucla.edu>
8694
8695 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
8696 since we don't want to insist on a version number at the start
8697 of the changelog every time.
8698 * Makefile.maint: Sync from coreutils a bit better.
8699 (sc_trailing_blank): Renamed from sc_trailing_space.
8700 All uses changed.
8701 (sc_no_if_have_config_h, sc_require_config_h):
8702 (sc_prohibit_assert_without_use): New rules.
8703 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
8704 (sc_dd_max_sym_length): Fix leading spaces in rule.
8705 (sc_system_h_headers): Prefix with @.
8706 (sc_useless_cpp_parens, m4-check): Output line numbers.
8707 (changelog-check): Allow version only in head.
8708 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
8709 satisfy new Makefile.maint rule.
8710 * data/glr.c: Likewise.
8711 * data/glr.cc: Likewise.
8712 * data/lalr1.cc: Likewise.
8713 * data/yacc.c: Likewise.
8714 * lib/ebitsetv.c: Likewise.
8715 * lib/lbitset.c: Likewise.
8716 * lib/subpipe.c: Likewise.
8717 * lib/timevar.c: Likewise.
8718 * src/system.h: Likewise.
8719 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
8720 * djgpp/Makefile.maint: Add copyright notice.
8721 * djgpp/README.in: Likewise.
8722 * djgpp/config.bat: Likewise.
8723 * djgpp/config.site: Likewise.
8724 * djgpp/config_h.sed: Likewise.
8725 * djgpp/djunpack.bat: Likewise.
8726 * djgpp/config.sed: Fix copyright notice to match standard format.
8727 * djgpp/subpipe.h: Likewise.
8728 * lib/bitsetv-print.c: Likewise.
8729 * lib/bitsetv.c: Likewise.
8730 * lib/subpipe.h: Likewise.
8731 * lib/timevar.c: Likewise.
8732 * lib/timevar.h: Likewise.
8733 * djgpp/subpipe.c: Use standard recipe for config.h.
8734 * lib/abitset.c: Likewise.
8735 * lib/bitset.c: Likewise.
8736 * lib/bitset_stats.c: Likewise.
8737 * lib/bitsetv-print.c: Likewise.
8738 * lib/bitsetv.c: Likewise.
8739 * lib/ebitsetv.c: Likewise.
8740 * lib/get-errno.c: Likewise.
8741 * lib/lbitset.c: Likewise.
8742 * lib/subpipe.c: Likewise.
8743 * lib/timevar.c: Likewise.
8744 * lib/vbitset.c: Likewise.
8745 * tests/local.at: Likewise.
8746 * src/scan-gram.l: Don't include verify.h, since system.h does
8747 that for us.
8748 * .x-sc_require_config_h: New file.
8749 * .x-sc_unmarked_diagnostics: New file.
8750
287c78f6
PE
87512006-01-20 Paul Eggert <eggert@cs.ucla.edu>
8752
287c78f6
PE
8753 Be a bit more systematic about using 'abort'.
8754 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
8755 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
8756 Put 'default: abort ();' before some other case, to satisfy older
8757 pedantic compilers.
8758 * lib/bitset_stats.c (bitset_stats_init): Likewise.
8759 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
8760 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
8761 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
8762 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
8763 (get_decision_str, get_orientation_str, get_node_alignment_str):
8764 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
8765 (get_linestyle_str, get_arrowstyle_str): Likewise.
8766 * src/conflicts.c (resolve_sr_conflict):
8767 Use a default case rather than one for the one remaining enum
8768 value, to catch invalid enum values as well.
8769 * src/lalr.c (set_goto_map, map_goto):
8770 Prefer "assert (FOO);" to "if (!FOO) abort ();".
8771 * src/nullable.c (nullable_compute, token_definitions_output):
8772 Likewise.
8773 * src/reader.c (packgram, reader): Likewise.
8774 * src/state.c (transitions_to, state_new, state_reduction_find):
8775 Likewise.
8776 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
8777 (symbol_pack): Likewise.
8778 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
8779 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
8780 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
8781 * src/system.h: Don't include <assert.h>.
8782 (assert): New macro.
8783
8784 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
8785 (Destructor Decl, Parser Function, Pure Calling):
8786 Describe rules for braces inside C code more carefully.
287c78f6 8787
c66dfadd
PE
87882006-01-19 Paul Eggert <eggert@cs.ucla.edu>
8789
c21493b8
PE
8790 Fix some porting glitches found by Nelson H. F. Beebe.
8791 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
8792 compilers that don't understand that abort () does not return.
8793 * src/state.c (transitions_to): Likewise.
8794 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
8795 that '#include <cstdlib>' works.
8796 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
8797 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
8798 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
8799 for the benefit of some pre-C99 compilers.
8800
b6e3facf
PE
8801 * bootstrap: Undo changes to gnulib files that autoreconf made.
8802
c66dfadd
PE
8803 Minor fixups to get 'make maintainer-check' to work.
8804 * configure.ac: Don't use -Wnested-externs, as it's incompatible
8805 with the new verify.h implementation.
8806 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
8807 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
8808 * data/yacc.c (YYUSE): Likewise.
8809 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
8810 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
8811 * src/parse-gram.y (declaration): Don't pass a string constant
8812 to a function that expects char *, since GCC might complain
8813 about the constant value.
8814 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
8815 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
8816 before #defining them.
8817 * tests/glr-regression.at
8818 (Incorrectly initialized location for empty right-hand side in GLR):
8819 In yyerror, use the msg arg.
8820 (Corrupted semantic options if user action cuts parse):
8821 (Incorrect lookahead during deterministic GLR):
8822 (Incorrect lookahead during nondeterministic GLR):
8823 Don't name a local var 'index'; it shadows string.h's 'index'.
8824
ed94ef2a
AD
88252006-01-19 Akim Demaille <akim@epita.fr>
8826
8827 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
8828 location, not just parts of it.
8829
e9ad4aec
PE
88302006-01-18 Paul Eggert <eggert@cs.ucla.edu>
8831
d6ca7905
PE
8832 * NEWS: Document the fact that multiple %unions are now allowed.
8833 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
8834 * TODO: This feature is now implemented, so remove it from
8835 the wishlist.
d6ca7905 8836
ef1b70e0
PE
8837 * Makefile.maint: Merge with coreutils Makefile.maint.
8838 (CVS_LIST): Use build-aux version if available.
8839 (VERSION_REGEXP): New macro.
8840 (syntax-check-rules): Add sc_no_if_have_config_h,
8841 sc_prohibit_assert_without_use, sc_require_config_h,
8842 sc_useless_cpp_parens.
8843 (sc_obsolete_symbols): Check for O_NDELAY.
8844 (sc_dd_max_sym_length): Track coreutils.
8845 (sc_unmarked_diagnostics): Look in all files, not just *.c.
8846 (sc_useless_cpp_parens): New rule.
8847 (news-date-check): Look for version or today's date.
8848 (changelog-check): Don't require version number near head.
8849 (copyright-check): Use current year instead of hardwiring 2005.
8850 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
8851 (announcement): Add --gpg-key-ID.
8852
8853 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
8854 with "file system".
8855
2073ce56 8856 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
8857 array. Problem reported by twlevo.
8858 * src/reader.c (packgram): Prepend a new sentinel before ritem.
8859 * src/lalr.c (build_relations): Rely on new sentinel.
8860 * src/gram.c (gram_free): Adjust to new sentinel.
8861
b7691f15
JD
88622006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
8863
8864 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
8865 yylookaheadNeeds. All uses updated.
8866 (yysplitStack): Rename local yynewLookaheadStatuses to
8867 yynewLookaheadNeeds.
8868 * data/glr-regression.at (Incorrect lookahead during nondeterministic
8869 GLR): In comments, change `lookahead status' to `lookahead need'.
8870
ddee1b06
PH
88712006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8872
8873 * data/glr.c (yysplitStack): A little stylistic rewrite.
8874
12f4614d
PH
88752006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8876
8877 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
8878
32c29292
JD
88792006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
8880
8881 * doc/bison.texinfo: Fix some typos.
8882 (GLR Semantic Actions): New subsection discussing special
8883 considerations because GLR semantic actions might be deferred.
8884 (Actions): Mention look-ahead usage of yylval.
8885 (Actions and Locations): Mention look-ahead usage of yylloc.
8886 (Special Features for Use in Actions): Add YYEOF entry and mention it
8887 in the yychar entry.
8888 In the yychar entry, remove mention of the local yychar case (pure
8889 parser) since this is irrelevant information when writing semantic
148d66d8 8890 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
8891 yychar is otherwise described as an external variable.
8892 In the yychar entry, don't call it the `current' look-ahead since it
8893 isn't when semantic actions are deferred.
8894 In the yychar and yyclearin entries, add note about deferred semantic
8895 actions.
8896 Add yylloc and yylval entries discussing look-ahead usage.
8897 (Look-Ahead Tokens): When discussing yychar, don't call it the
8898 `current' look-ahead, and do mention yylval and yylloc.
8899 (Error Recovery): Cross-reference `Action Features' when mentioning
8900 yyclearin.
148d66d8 8901 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
8902 look-ahead.
8903 In the yylloc and yylval entries, mention look-ahead usage.
8904
de366a2f 89052006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
8906
8907 * tests/glr-regression.at: Update copyright year to 2006.
8908
bf70fa87
JD
89092006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8910
8911 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
8912 use during nondeterministic operation to track which stacks have
8913 actually needed the current lookahead.
8914 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
8915 Allocate, deallocate, resize, and otherwise shuffle space for
8916 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
8917 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
8918 appropriately during nondeterministic operation.
8919 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
8920 members to store the current lookahead to be used by the deferred
8921 user action.
8922 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
8923 from which the RHS is taken. Set the lookahead members of the new
8924 yySemanticOption according to the lookahead status for stack yyk.
8925 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
8926 yyaddDeferredAction.
8927 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
8928 members of yySemanticOption before invoking yyuserAction, and then set
8929 them back to their current values afterward.
8930 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
8931 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
8932 * tests/glr-regression.at: Remove `.' from the ends of recent test case
8933 titles for consistency.
8934 (Leaked merged semantic value if user action cuts parse): In order to
8935 suppress lint warnings, use arguments in merge function, and assign
8936 char value < 128 in main.
8937 (Incorrect lookahead during deterministic GLR): New test case.
8938 (Incorrect lookahead during nondeterministic GLR): New test case.
8939
05449a2c
JD
89402006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8941
de366a2f 8942 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
8943 !yyvaluep as signal that no semantic value is available to print.
8944 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
8945 to print a semantic value.
8946
4158e0a1 89472006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 8948
4158e0a1
JD
8949 * tests/glr-regression.at: For consistency with my newer test cases,
8950 don't thank myself.
8951
d659304d
JD
89522006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
8953
8954 * data/glr.c (yyresolveValue): When merging semantic options, if at
8955 least one user action succeeds but a later one cuts the parse, then
8956 destroy the semantic value before returning rather than leaking it.
8957 (yyresolveStates): If a user action cuts the parse and thus
8958 yyresolveValue fails, ignore the (unset) semantic value rather than
8959 corrupting the yyGLRState, and empty the semantic options list since
8960 the user actions should have called all necessary destructors.
8961 Simplify code with YYCHK.
8962 * tests/glr-regression.at (Corrupted semantic options if user action
8963 cuts parse): New test case.
8964 (Undesirable destructors if user action cuts parse): New test case.
8965 Before applying any of this patch, this test case never actually failed
8966 for me... but only because the corrupted semantic options usually
8967 masked this bug.
8968 (Leaked merged semantic value if user action cuts parse): New test
8969 case.
8970
6ec2c0f2
AD
89712006-01-05 Akim Demaille <akim@epita.fr>
8972
8973 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
8974
1b9c21fb
PE
89752006-01-04 Paul Eggert <eggert@cs.ucla.edu>
8976
8977 * data/c.m4 (b4_c_modern): New macro, with a new provision for
8978 _MSC_VER. Problem reported by Cenzato Marco.
8979 (b4_c_function_def): Use it.
8980 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
8981 b4_c_modern.
8982 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
8983 than rolling our own.
8984
84866159
AD
89852006-01-04 Akim Demaille <akim@epita.fr>
8986
8987 Also warn about non-used mid-rule values.
8988 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
8989 member.
8990 (symbol_list_new): Adjust.
8991 * src/reader.c (symbol_typed_p): New.
8992 (grammar_rule_check): Use it.
8993 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
8994 Check its rule.
8995 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
8996 Use it.
8997 * tests/actions.at (Exotic Dollars): Adjust.
8998
378f4bd8
AD
89992006-01-04 Akim Demaille <akim@epita.fr>
9000
9001 * src/reader.c (grammar_midrule_action): If $$ is set in a
9002 mid-rule, move the `used' bit to its lhs.
9003 * tests/input.at (Unused values): New.
9004 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
9005
e2a21b6f
PE
90062006-01-03 Paul Eggert <eggert@cs.ucla.edu>
9007
54662697
PE
9008 * doc/bison.texinfo (Bison Options): Say more accurately what
9009 --yacc does.
9010 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
9011 about declarations in the grammar when in Yacc mode, as POSIX does
9012 not require a diagnostic when the grammar uses extensions.
9013
9014 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
9015
073f9288
PE
9016 Warn about dubious constructions like "%token T T".
9017 Reported by twlevo.
9018 * src/symtab.h (struct symbol.declared): New member.
9019 * src/symtab.c (symbol_new): Initialize it to false.
9020 (symbol_class_set): New arg DECLARING, specifying whether
9021 this is a declaration that we want to warn about, if there
9022 is more than one of them. All uses changed.
9023
1221b78a
PE
9024 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
9025 Allow multiple %union directives, whose contents concatenate.
9026 * src/parse-gram.y (grammar_declaration): Likewise.
9027 Use muscle_code_grow, so that we don't need stype_line any more.
9028 All uses changed.
9029
9030 * src/muscle_tab.c (muscle_grow): Fix comment.
9031
e2a21b6f
PE
9032 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
9033 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
9034 Update copyright year to 2006.
9035
8f7e3cf9
AD
90362006-01-03 Akim Demaille <akim@epita.fr>
9037
9038 Have glr.cc pass (some of) the calc.at tests.
9039 * data/glr.cc (b4_parse_param_orig): New.
9040 (b4_parse_param): Improve its definition, and bound it more
9041 clearly in the skeleton.
9042 (b4_epilogue): Append, instead of prepending, in order to keep
9043 #line consistency.
9044 Simplify the generation of auxiliary functions: locations and
9045 purity are mandated.
9046 (b4_global_tokens_and_yystype): Honor it.
9047 * data/location.cc (c++.m4): Don't include it.
9048 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
9049 and AT_SKEL_CC_IF.
9050 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
9051 AT_LALR1_CC_IF.
9052 Be sure to initialize the first position's filename.
9053 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
9054 mandated anyway.
9055 (AT_CHECK_CALC_GLR_CC): New.
9056 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
9057
3953ed88
AD
90582006-01-02 Akim Demaille <akim@epita.fr>
9059
9060 * src/output.c (output_skeleton): Don't hard wire the inclusion of
9061 c.m4.
0a96ba81 9062 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
9063 * data/glr.cc: Do not include stack.hh.
9064
9ecafbbf
AD
90652006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
9066
9067 * data/glr.c: Reformat whitespace with tabs.
9068 (b4_lpure_formals): Remove this unused m4 macro.
9069 * tests/cxx-type.at: Reformat whitespace with tabs.
9070 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
9071 since it's a member. Rename type to isNterm for clarity.
9072
c4d497a0
AD
90732005-12-29 Akim <akim@sulaco.local>
9074
9075 Let glr.cc catch up with symbol_value_print.
9076 * data/glr.cc (b4_yysymprint_generate): Replace by...
9077 (b4_yy_symbol_print_generate): this.
9078 (yy_symbol_print, yy_symbol_value_print): Declare them.
9079
4517da37
PE
90802005-12-28 Paul Eggert <eggert@cs.ucla.edu>
9081
9082 * src/location.h (boundary): Note that a line or column equal
9083 to INT_MAX indicates an overflow.
9084 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
9085 (rule_length_overflow, increment_rule_length, add_column_width):
9086 New functions.
9087 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
9088 (<SC_BRACED_CODE>"}"):
9089 Use increment_rule_length rather than incrementing it by hand.
9090 (adjust_location, handle_syncline): Diagnose overflow.
9091 (handle_action_dollar, handle_action_at):
9092 Fix bug with monstrosities like $-2147483648.
9093 Remove now-unnecessary checks.
9094 (scan_integer): Verify assumptions and remove now-unnecessary checks.
9095 (convert_ucn_to_byte): Verify assumptions.
9096 (handle_syncline): New arg LOC. All callers changed.
9097 Don't store through a value derived from char const * pointer.
9098
9099 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
9100 GCC warnings.
9101
e3233bf6
PE
91022005-12-27 Paul Eggert <eggert@cs.ucla.edu>
9103
9104 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
9105 Remove unnecessary forward static decls.
9106
8f3596a6
AD
91072005-12-27 Akim Demaille <akim@epita.fr>
9108
9109 * src/reader.c (grammar_current_rule_check): Also check that $$
9110 is used.
9111 Take the rule to check as argument, hence rename as...
9112 (grammar_rule_check): this.
9113 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
9114 Rename as...
9115 (grammar_rule_begin, grammar_rule_end): these, for consistency.
9116 (grammar_midrule_action, grammar_symbol_append): Now static.
9117 * tests/torture.at (input): Don't rely on the default action
9118 being always performed.
9119 * tests/calc.at: "Set" $$ even when the action is "cut" with
9120 YYERROR or other.
9121 * tests/actions.at (Exotic Dollars): Instead of using unused
9122 values, check that the warning is issued.
9123
721be13c
PE
91242005-12-22 Paul Eggert <eggert@cs.ucla.edu>
9125
9126 * NEWS: Improve wording for unused-value warnings.
9127
a0af42fc
AD
91282005-12-22 Akim Demaille <akim@epita.fr>
9129
9130 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
9131 (b4_yysymprint_generate): Rename as...
9132 (b4_yy_symbol_print_generate): this.
9133 Generate yy_symbol_print instead of yysymprint.
9134 Generate also yy_symbol_value_print, and use it.
9135
affac613
AD
91362005-12-22 Akim Demaille <akim@epita.fr>
9137
721be13c 9138 * NEWS: Warn about unused values.
affac613
AD
9139 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
9140 a `used' member.
9141 (symbol_list_n_get, symbol_list_n_used_set): New.
9142 (symbol_list_n_type_name_get): Use symbol_list_n_get.
9143 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
9144 * src/reader.c (grammar_current_rule_check): Check that values are
9145 used.
9146 * src/symtab.c (symbol_print): Accept 0.
9147 * tests/existing.at: Remove the type information.
9148 Empty the actions.
9149 Remove useless actions (beware of mid-rule actions: perl -000
9150 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
9151 * tests/actions.at (Exotic Dollars): Use unused values.
9152 * tests/calc.at: Likewise.
9153 * tests/glr-regression.at (No users destructors if stack 0 deleted):
9154 Likewise.
9155
9156 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
9157 rule_useful_p.
9158
9d9b8b70
PE
91592005-12-21 Paul Eggert <eggert@cs.ucla.edu>
9160
8bb4c753
PE
9161 Undo 2005-12-01 tentative license wording change. The wording is
9162 still being reviewed by the lawyers, and we don't want to wait for
9163 them before publishing a test release. For now, revert to the
9164 previous wording.
9165 * NEWS: Undo 2005-12-01 change.
9166 * data/glr.c: Revert to previous license wording.
9167 * data/glr.cc: Likewise.
9168 * data/lalr1.cc: Likewise.
9169 * data/location.cc: Likewise.
9170 * data/yacc.c: Likewise.
9171
9d9b8b70
PE
9172 * NEWS: Reword %destructor vs YYABORT etc.
9173 * data/glr.c: Use American spacing, for consistency.
9174 * data/glr.cc: Likewise.
9175 * data/lalr1.cc: Likewise.
9176 * data/yacc.c: Likewise.
9177 * data/yacc.c: Reformat comments slightly.
9178 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
9179 for consistency. Fix some spelling errors and reword recently-included
9180 text slightly.
9181 * tests/cxx-type.at: Cast results of malloc, for C++.
9182
2c3b392a
AD
91832005-12-21 Joel E. Denny <address@hidden>
9184
9185 * tests/cxx-type.at: Construct a tree, count the parents of shared
9186 nodes, and free each node once and only once. Previously, the memory
9187 for semantic values was leaked instead.
9188
d6cff4dc
AD
91892005-12-21 Joel E. Denny <address@hidden>
9190
9191 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
9192 (yylval, yylloc): If pure, #define to yystackp->yyval and
9193 yystackp->yyloc similar to yychar and yynerrs.
9194 (yyparse): If pure, remove local yylval and yylloc. Add local
9195 yystackp to accommodate pure definitions of yylval and yylloc.
9196 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
9197 yylvalp and yyllocp to &yylval and &yylloc.
9198 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
9199 namespace. Previously, nerrs and char were missing, but lval and lloc
9200 weren't necessary.
9201 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
9202 yylvalp and yyllocp parameters since, if pure, these are now always
9203 accessible through yystackp. If not pure, they are still accessible
9204 globally.
9205 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
9206 `if (YYID (N))' to pacify lint.
9207
a85284cf
AD
92082005-12-21 Akim Demaille <akim@epita.fr>
9209
9210 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
9211 destroy the RHS symbols of a rule.
9212 * data/yacc.c (yylen): Initialize to 0.
9213 Keep its value to the number of items to possibly shift.
9214 In particular, a regular successful parse that ends on YYFINAL by
9215 a (internal) YYACCEPT must not have yylen != 0.
9216 (yyerrorlab, yyreturn): Pop the RHS.
9217 Reorder a bit to emphasize the `shifting' bits of code.
9218 (YYPOPSTACK): Now accept a number of items to pop.
9219 * data/lalr1.cc: Likewise.
9220 * data/glr.c: Formatting changes.
9221 Use goto instead of fall through.
9222 * doc/bison.texinfo (Destructor Decl): Complete.
9223
d508c281
JMG
92242005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9225
9226 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
9227 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
9228 * djgpp/config.bat: Replace every occurence of the file name
9229 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
9230 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
9231 * djgpp/config.sed: Replace every occurence of the file name
9232 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
9233 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
9234 * djgpp/djunpack.bat: DJGPP specific file.
9235 * djgpp/fnchange.lst: DJGPP specific file.
9236 * djgpp/README.in: Add new information about how to unpack the bison
9237 source on MSDOS and other systems which have 8.3 file name restrictions
9238 using djunpack.bat and fnchange.lst.
9239
3e7a2cd9
PE
92402005-12-12 Paul Eggert <eggert@cs.ucla.edu>
9241
9242 * bootstrap (build_cvs_prefix): Remove; unused.
9243 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
9244 when getting gnulib.
9245
92462005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
9247
9248 * data/glr.c: Reorder typedef declarations for structs to match order
9249 of struct declarations.
9250 Rename yystack everywhere to yystackp except in yyparse where it's not
9251 a pointer.
9252 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
9253 consistency.
9254 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
9255 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
9256 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
9257 lint.
9258
877519f8
PE
92592005-12-09 Paul Eggert <eggert@cs.ucla.edu>
9260
0eca5a39
PE
9261 * tests/sets.at (Accept): Fix typos in regular expression used to
9262 sed out the final state number.
9263
2cec9080
PE
9264 Work around portability problem on Solaris 10: flex-generated
9265 files include <stdio.h> before <config.h>, which messes up
9266 because the latter defines __EXTENSIONS__. Address the problem
9267 by creating two new little files that include <config.h> first,
9268 then include the flex-generated files. Rewrite everyone else
9269 to include <config.h> first, as well.
9270 * lib/timevar.c: Always include "config.h".
9271 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
9272 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
9273 (EXTRA_bison_SOURCES): New macro.
9274 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
9275 * src/system.h: Don't include config.h.
9276 * src/LR0.c: Include <config.h> first.
9277 * src/assoc.c: Likewise.
9278 * src/closure.c: Likewise.
9279 * src/complain.c: Likewise.
9280 * src/conflicts.c: Likewise.
9281 * src/derives.c: Likewise.
9282 * src/files.c: Likewise.
9283 * src/getargs.c: Likewise.
9284 * src/gram.c: Likewise.
9285 * src/lalr.c: Likewise.
9286 * src/location.c: Likewise.
9287 * src/main.c: Likewise.
9288 * src/muscle_tab.c: Likewise.
9289 * src/nullable.c: Likewise.
9290 * src/output.c: Likewise.
9291 * src/parse-gram.y: Likewise.
9292 * src/print.c: Likewise.
9293 * src/print_graph.c: Likewise.
9294 * src/reader.c: Likewise.
9295 * src/reduce.c: Likewise.
9296 * src/relation.c: Likewise.
9297 * src/state.c: Likewise.
9298 * src/symlist.c: Likewise.
9299 * src/symtab.c: Likewise.
9300 * src/tables.c: Likewise.
9301 * src/uniqstr.c: Likewise.
9302 * src/vcg.c: Likewise.
9303
877519f8
PE
9304 * src/parse-gram.y: Fix minor problems uncovered by lint.
9305 (current_lhs, current_lhs_location): Now static.
9306 (current_assoc): Remove unused variable.
9307
9308 Cleanups so that Bison-generated parsers have less lint.
9309 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
9310 Prepend /*ARGSUSED*/, for lint's sake.
9311 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
9312 definition if 'lint' is defined.
9313 (YYID): New macro (or function, if lint).
9314 All uses of /*CONSTCOND*/0 replaced by YYID(0).
9315 * data/yacc.c: Likewise.
9316 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
9317 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
9318 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
9319 is C++ only.
9320 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
9321 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
9322 Use YYID(0) rather than 0, for lint.
9323 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
9324 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
9325
f5228370
PE
93262005-12-07 Paul Eggert <eggert@cs.ucla.edu>
9327
9328 * tests/glr-regression.at
9329 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
9330 Close memory leak reported by twlevo.
9331
69ce078b
PE
93322005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
9333
6ff99711
PE
9334 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
9335 all stacks.
9336 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
9337 * tests/glr-regression.at (No users destructors if stack 0 deleted):
9338 New test case.
9339 (Duplicated user destructor for lookahead): This test now is expected
9340 to succeed.
9341
af3412cd
PE
93422005-12-01 Paul Eggert <eggert@cs.ucla.edu>
9343
32b5b719 9344 * NEWS: Document the following change.
af3412cd
PE
9345 * data/yacc.c: Say "parser skeleton" rather than "file", since
9346 it's no longer just a file.
9347 * data/glr.c: Grant a special exception for C GLR parsers, that
9348 reads like the already-existing exception for C LALR(1) parsers.
9349 * data/glr.cc: Likewise.
9350 * data/lalr1.cc: Likewise.
9351 * data/location.cc: Likewise.
9352 * data/yacc.c: Reword the "written by" statement to clarify that
9353 it was the parser skeleton, not the entire output file.
9354 * data/glr.c: Written by Paul Hilfinger.
9355 * data/glr.cc: Written by Akim Demaille.
9356 * data/lalr1.cc: Likewise.
9357
035aa4a0
PE
93582005-11-18 Paul Eggert <eggert@cs.ucla.edu>
9359
d9963c85
PE
9360 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
9361 Fix typos in previous change that broke 'make check'.
9362 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
9363 supported in C.
9364 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
9365 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
9366 We can revert this once things settle down.
9367
035aa4a0
PE
9368 * src/conflicts.c (conflicts_print): Don't print file name twice
9369 when %expect fails because there were no conflicts.
9370 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
9371 change.
9372 * tests/conflicts.at (%expect not enough, %expect too much):
9373 (%expect with reduce conflicts): Adjust to new behavior.
9374
93752005-11-18 Akim Demaille <akim@epita.fr>
9376
9377 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
9378 errors.
9379 * NEWS: Document this.
9380 * doc/bison.texinfo (Expect Decl): Likewise.
9381
d1ff7a7c
AD
93822005-11-16 Akim Demaille <akim@epita.fr>
9383
9384 Generalize the display of semantic values and locations in traces.
9385 * data/glr.c (yy_reduce_print): Fix indices (again).
9386 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
9387 literal integers.
9388 * data/lalr1.cc (yyreduce_print): Rename as...
9389 (yy_reduce_print): this.
9390 Display values and locations.
9391 * data/yacc.c (yy_reduce_print): Likewise.
9392 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
9393 (yysymprint): Move higher to be visible from yy_reduce_print).
9394 (yyparse): Adjust.
9395 * tests/calc.at: Adjust the expected length of the traces.
9396
6de5398d
AD
93972005-11-14 Akim Demaille <akim@epita.fr>
9398
9399 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
9400 from 1 to N, while values and location start at 0.
9401 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
9402
a1373f55
AD
94032005-11-14 Akim Demaille <akim@epita.fr>
9404
9405 * data/glr.c (yy_reduce_print): Fix the $ number.
9406
613d8952
AD
94072005-11-14 Akim Demaille <akim@epita.fr>
9408
9409 "Use" parse parameters.
9410 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
9411 * data/glr.c, data/glr.cc: Use them.
9412 * data/glr.c (YYUSE): Have a C++ definition that supports
9413 non-pointer types.
9414
b2741627
AD
94152005-11-14 Akim Demaille <akim@epita.fr>
9416
9417 * data/glr.c (yyexpandGLRStack): Declare only if defined.
9418
5059b5c8
AD
94192005-11-14 Akim Demaille <akim@epita.fr>
9420
42249483
AD
9421 * data/glr.cc: New.
9422 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 9423
4626a15d
AD
94242005-11-12 Akim Demaille <akim@epita.fr>
9425
9426 Let position and location be PODs.
9427 * data/location.cc (position::initialize, location::initialize): New.
9428 (position::position, location::location): Define only if
9429 b4_location_constructors is defined.
9430 * data/lalr1.cc (b4_location_constructors): Define it for backward
9431 compatibility.
9432 * doc/bison.texinfo (Initial Action Decl): Use initialize.
9433
94342005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
9435
9436 * data/lalr1.cc: Move the body of the ctor and dtor into the
9437 parser file (instead of the header).
9438 Wrap the implementations in a "namespace yy".
9439
94402005-11-12 Akim Demaille <akim@epita.fr>
9441
9442 Have glr.c include its header file when created.
9443 * data/glr.c (b4_shared_declarations): New.
9444 Output them verbatim in the parser if !%defines, otherwise
9445 output then in the header file, and include it instead.
9446
1989d947
AD
94472005-11-11 Akim Demaille <akim@epita.fr>
9448
9449 * data/glr.c: Comment changes.
9450
94512005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
9452
9453 When yydebug, report semantic and location values for reductions.
9454 * data/glr.c (yy_reduce_print): Report the semantic values and the
9455 locations.
9456 (YY_REDUCE_PRINT): Adjust.
9457 (yyglrReduce): Use them.
9458 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
9459 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
9460 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
9461 traces.
9462
02998094
AD
94632005-11-10 Akim Demaille <akim@epita.fr>
9464
9465 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
9466 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
9467 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
9468
5210672f
PE
94692005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
9470
9471 * m4/cxx.m4, examples/Makefile.am: Don't build
9472 examples/calc++ if no C++ compiler is available. (trivial change)
9473
a8991a1d
AD
94742005-11-09 Akim Demaille <akim@epita.fr>
9475
9476 * src/scan-skel.l: Use a couple of asserts.
9477
36b5e963
AD
94782005-11-03 Akim Demaille <akim@epita.fr>
9479
9480 In some (weird) cases, the final state number is incorrect.
9481 Reported by Alexandre Duret-Lutz.
9482 * src/LR0.c (state_list_append): Remove the computation of
9483 final_state.
9484 (save_reductions): Do it here.
9485 (get_state): Alpha conversion.
9486 (generate_states): Use a for loop.
9487 * src/gram.h (item_number_is_rule_number)
9488 (item_number_is_symbol_number): New.
9489 * src/state.c: Use assert.
9490 * src/system.h: Include assert.h.
9491 * tests/sets.at (Accept): New.
9492
44e7ead1
PH
94932005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9494
9495 * data/glr.c (yyfill): Adjust comment.
36b5e963 9496 (yyresolveAction): Initialize default location properly
44e7ead1
PH
9497 for empty right-hand sides.
9498 (yydoAction): Ditto.
9499 Add comment explaining apparently dead code.
36b5e963
AD
9500 * tests/glr-regression.at
9501 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 9502 New test.
36b5e963 9503
e10a80ee
PE
95042005-10-30 Paul Eggert <eggert@cs.ucla.edu>
9505
9506 * bootstrap (cleanup_gnulib): New function. Use it to clean up
9507 gnulib when interrupted. This fixes some race conditions and
9508 works around some portability problems (one noted by Paul
9509 Hilfinger).
9510
067b32ee
AD
95112005-10-22 Akim <akim@epita.fr>
9512
9513 * Makefile.cfg: Adjust to config -> build-aux.
9514 Reported by twledo.
9515
4b367315
AD
95162005-10-21 Akim Demaille <akim@epita.fr>
9517
9518 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
9519 the %parse-params.
9520 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
9521 * data/yacc.c (b4_Pure_if): Rename as...
9522 (b4_yacc_pure_if): this.
9523 (YY_SYMBOL_PRINT, yyparse): Adjust.
9524 * doc/bison.texinfo: Formatting changes.
9525
24cc23d9
AD
95262005-10-21 Akim Demaille <akim@epita.fr>
9527
9528 Finish the transition config -> build-aux.
9529 * configure.ac, Makefile.am: Use build-aux.
9530 * config/prev-version, config/announce-gen, config/Makefile.am:
9531 Move to...
9532 * build-aux/prev-version, build-aux/announce-gen,
9533 * build-aux/Makefile.am: here.
9534
d4476375
AD
95352005-10-14 Akim Demaille <akim@epita.fr>
9536
9537 * examples/calc++/test: Use set -x only when VERBOSE.
9538
302c0aee
PE
95392005-10-13 Paul Eggert <eggert@cs.ucla.edu>
9540
9541 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
9542 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
9543
7625ec2c
AD
95442005-10-13 Akim Demaille <akim@epita.fr>
9545
9546 * src/scan-skel.l: Output the base name parts of the parser and
9547 header file names.
302c0aee 9548 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
9549 additional checks.
9550 Use this to exercise C++ outputs in subdirs.
9551 Reported by Oleg Smolsky.
9552
ba0fe3c7
PE
95532005-10-12 Paul Eggert <eggert@cs.ucla.edu>
9554
9555 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
9556 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
9557 Problem reported by John P. Hartmann.
9558 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
9559 already defined it.
9560
9b8a5ce0
AD
95612005-10-12 Akim Demaille <akim@epita.fr>
9562
9563 * src/parse-gram.y (version_check): Exit 63 to please missing
9564 (stands for "version mismatch).
9565 * tests/input.at, doc/bison.texinfo: Adjust.
9566
4f6e011e
PE
95672005-10-10 Paul Eggert <eggert@cs.ucla.edu>
9568
9569 Work around portability problems with Visual Age C compiler
9570 (xlc and xlC_r) reported by John P. Hartmann.
9571 * data/location.cc (initial_column, initial_line): Remove.
9572 All uses replaced by 0 and 1.
9573 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
9574 that xlc complains about.
9575 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 9576 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 9577 as __STDC__.
4d7aa45e
PE
9578 * data/yacc.c (YYMODERN_C): New macro, which also looks at
9579 __STDC_VERSION__. Use it everywhere instead of looking at
9580 __STDC__ and __cplusplus.
4f6e011e 9581
a1b3bf8c
AD
95822005-10-10 Akim Demaille <akim@epita.fr>
9583
9584 * examples/calc++/test: Be quiet unless VERBOSE.
9585
412e44aa
PE
95862005-10-05 Paul Eggert <eggert@cs.ucla.edu>
9587
2a4647a3
PE
9588 * data/c.m4 (yydestruct, yysymprint):
9589 Use YYUSE instead of casting to void.
9590 * data/glr.c (YYUSE): New macro.
9591 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
9592 Use it instead of rolling our own.
9593 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
9594 (YYCHK1):
9595 Use /*CONSTCOND*/ to suppress lint warnings.
9596 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
9597 (YY_STACK_PRINT): Use 'false' not '0'.
9598 (YYUSE): New macro.
9599 (yysymprint_, yydestruct_): Use it instead of rolling our own.
9600 * data/yacc.c (YYUSE): New macro.
9601 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
9602 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
9603 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
9604
9605
412e44aa
PE
9606 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
9607 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
9608
88c6637f
PE
96092005-10-04 Paul Eggert <eggert@cs.ucla.edu>
9610
2f4f028d
PE
9611 Undo the parts of the unlocked-I/O change that substituted
9612 putc or puts for printf. This might hurt performance a bit,
9613 but some people prefer the printf style.
9614 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
9615 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
9616 All uses replaced by YYFPRINTF and YYDPRINTF.
9617 * data/yacc.c: Likewise.
9618 * lib/bitset.c (bitset_print): Likewise.
9619 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
9620 putc and puts.
9621 * lib/lbitset.c (debug_lbitset): Likewise.
9622 * src/closure.c (print_firsts, print_fderives): Likewise.
9623 * src/gram.c (grammar_dump): Likewise.
9624 * src/lalr.c (look_ahead_tokens_print): Likewise.
9625 * src/output.c (escaped_output): Likewise.
9626 (user_actions_output): Break apart two printfs.
9627 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
9628 * src/reduce.c (reduce_print): Likewise.
9629 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
9630 * src/system.h: Include unlocked-io.h rathe than stdio.h.
9631
88c6637f
PE
9632 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
9633 Use assignments rather than casts-to-void to suppress
9634 unused-variable warnings. This pacifies 'lint'.
9635 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
9636 unused-variable warnings.
9637
fb32e373
JMG
96382005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9639
9640 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
9641
edb8f44f
PE
96422005-10-02 Paul Eggert <eggert@cs.ucla.edu>
9643
fb9c0b33
PE
9644 Use unlocked I/O for a minor performance improvement on hosts like
9645 GNU/Linux and Solaris that support unlocked I/O. The basic idea
9646 is to use the gnlib unlocked-io module, and to prefer putc and
9647 puts to printf when either will work (since the latter doesn't
9648 come in an unlocked flavor).
9649 * bootstrap (gnulib_modules): Add unlocked-io.
9650 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
9651 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
9652 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
9653 and similarly for puts and putc and printf.
9654 * data/yacc.c: Likewise.
9655 * lib/bitset.c (bitset_print): Likewise.
9656 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
9657 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
9658 to printf.
9659 * lib/lbitset.c (debug_lbitset): Likewise.
9660 * src/closure.c (print_firsts, print_fderives): Likewise.
9661 * src/gram.c (grammar_dump): Likewise.
9662 * src/lalr.c (look_ahead_tokens_print): Likewise.
9663 * src/output.c (escaped_output): Likewise.
9664 (user_actions_output): Coalesce two printfs.
2f4f028d 9665 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
9666 * src/reduce.c (reduce_print): Likewise.
9667 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 9668 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 9669
edb8f44f
PE
9670 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
9671 this confuses xgettext.
9672
b50d2359
AD
96732005-10-02 Akim Demaille <akim@epita.fr>
9674
9675 * bootstrap (gnulib_modules): Add strverscmp.
9676 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
9677 * m4/.cvsignore: Add strverscmp.m4.
9678 * src/parse-gram.y (%require): New token, new rule.
9679 (version_check): New.
9680 * src/scan-gram.l (%require): Adjust.
9681 * tests/input.at (AT_REQUIRE): New.
9682 Use it.
9683 * doc/bison.texinfo (Require Decl): New.
9684 (Calc++ Parser): Use %require.
9685
21667f64
AD
96862005-10-02 Akim Demaille <akim@epita.fr>
9687
9688 * data/location.cc: New.
9689
2b81e969
AD
96902005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
9691 Akim Demaille <akim@epita.fr>
9692
9693 Make sure -odir/foo.cc creates dir/location.hh etc.
9694 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
9695 (spec_file_prefix, spec_verbose_file, spec_graph_file)
9696 (spec_defines_file): Now const.
9697 (dir_prefix): New.
9698 (short_base_name): Remove.
9699 * src/files.c: Adjust.
9700 (dirname.h): Include.
9701 (base_name): Don't prototype it.
9702 (finput): Remove, duplicates gram_in.
9703 (full_base_name, short_base_name): Replace by...
9704 (all_but_ext, all_but_tab_ext): these.
9705 (compute_base_names): Rename as...
9706 (compute_file_name_parts): this.
9707 Update to compute the new variables, including dir_prefix.
9708 Adjust dependencies.
9709 * src/output.c (prepare): Output them.
9710 * src/reader.c: Adjust to use gram_in, not finput.
9711 * src/scan-skel.l (@dir_prefix@): New.
9712
ad6a9b97
JMG
97132005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9714
9715 * lib/subpipe.c: New function end_of_output_subpipe() added
9716 to allow support for non-posix systems. This is a no-op function
9717 for posix systems.
9718
9719 * lib/subpipe.h: New function end_of_output_subpipe() added
9720 to allow support for non-posix systems. This is a no-op function
9721 for posix systems.
9722
9723 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
9724 handle the lack of pipe/fork functionality on non-posix systems.
9725
9726 * djgpp/Makefile.maint: DJGPP specific file.
9727
9728 * djgpp/README.in: DJGPP specific file.
9729
9730 * djgpp/config.bat: DJGPP specific configuration file.
9731
9732 * djgpp/config.sed: DJGPP specific configuration file.
9733
9734 * djgpp/config.site: DJGPP specific configuration file.
9735
9736 * djgpp/config_h.sed: DJGPP specific configuration file.
9737
9738 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
9739
9740 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
9741
fc695704
AD
97422005-10-02 Akim Demaille <akim@epita.fr>
9743
9744 * data/location.cc: New, extract from...
9745 * data/lalr1.cc: here.
9746 (location.hh): Include it after the user prologue, in case the
9747 filename type is defined by the user.
9748 Forward declation location and position before the pre-prologue.
9749 (yyresult_): Rename as...
9750 (yyresult): this, it's a local variable, not an attribute.
9751 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
9752
97532005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
9754
9755 * examples/extexi: Restore the #line generation.
9756
fb9712a9
AD
97572005-09-30 Akim Demaille <akim@epita.fr>,
9758 Alexandre Duret-Lutz <adl@gnu.org>
9759
9760 Move the token type and YYSTYPE in the parser class.
9761 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
9762 (parser::token): New, from the moved free definition of tokens.
9763 (parser::semantic_value): Now a full definition instead of an
9764 indirection to YYSTYPE.
9765 (b4_post_prologue): No longer included in the header file, but
9766 in the implementation file.
9767 * doc/bison.texi (C+ Language Interface): Update.
9768 * src/parse-gram.y: Support unary %define.
9769 * tests/actions.at: Define global_tokens_and_yystype for backward
9770 compatibility until we update the tests.
9771 * tests/calc.at: Idem.
9772 (first_line, first_column, last_line, last_column): Define for lalr1.cc
9773 to simplify the code.
9774
55f0c7b1
PE
97752005-09-29 Paul Eggert <eggert@cs.ucla.edu>
9776
9777 Port to SunOS 4.1.4, which lacks strtoul and strerror.
9778 Ah, the good old days! Problem reported by Peter Klein.
9779 * bootstrap (gnulib_modules): Add strerror, strtoul.
9780 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
9781 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
9782
fb9712a9 97832005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
9784
9785 * data/c.m4 (b4_error_verbose_if): New.
9786 * data/lalr1.cc: Use it.
9787 (YYERROR_VERBOSE_IF): Remove.
9788 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
9789 parser members, replaced by...
9790 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
9791 local variables.
9792 (yysyntax_error_): Takes the state number as argument.
9793 (yyreduce_print_): Use the argument yyrule, not the former
9794 attribute yyn_.
9795
8a6f72f3
PE
97962005-09-26 Paul Eggert <eggert@cs.ucla.edu>
9797
9798 * bootstrap (gnulib_modules): Add verify.
9799 * lib/.cvsignore: Add verify.h.
9800 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
9801 * src/system.h (verify): Remove.
9802 Include verify.h instead.
9803 * src/tables.c (tables_generate): Use new API for 'verify'.
9804
0d50976f
PE
98052005-09-21 Paul Eggert <eggert@cs.ucla.edu>
9806
ebc3737e
PE
9807 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
9808 local variables whose names begin with 'yy'.
9809 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
9810 Trivial changes from Joel E. Denny.
9811
0d50976f
PE
9812 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
9813 it itself.
9814 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
9815 don't use alloca any more.
9816
9817 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
9818 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 9819 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
9820 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
9821 to match yacc.c, to test more hosts.
9822
a05b79df
PE
98232005-09-20 Paul Eggert <eggert@cs.ucla.edu>
9824
55289366
PE
9825 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
9826 doesn't affect behavior.
9827 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
9828 Solaris, AIX, MSC.
9829 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
9830 This works a bit better with glibc, if user code has already included
9831 stdlib.h.
9832 * doc/bison.texinfo (Bison Parser): Document that users can't
9833 arbitrarily use malloc and free for other purposes. Document
9834 that <alloca.h> and <malloc.h> might be included.
9835 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
9836 user must declare alloca.
9837
a05b79df
PE
9838 * HACKING (release): Forwarn the Translation Project about
9839 stable releses.
9840
3ab2ca22
AD
98412005-09-20 Akim Demaille <akim@epita.fr>
9842
9843 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
9844
a9739e7c
PE
98452005-09-19 Paul Eggert <eggert@cs.ucla.edu>
9846
a702593e
PE
9847 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
9848 (YYSTACK_ALLOC_MAXIMUM): Use it.
9849 (yysyntax_error): New function.
9850 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
9851 multiple syntax errors are reported, and alloca is being used.
9852 Instead, reallocate buffers twice as big each time, so that
9853 we waste at most half the allocated memory. Start with a small
9854 (128-byte) buffer that will suffice in most cases anyway.
9855 Use yysyntax_error to do most of the work.
9856
9857 * doc/bison.texinfo (Error Reporting, Table of Symbols):
9858 yynerrs is the number of errors reported, not the number of
9859 errors encountered.
9860
a9739e7c
PE
9861 * tests/glr-regression.at (Duplicated user destructor for lookahead):
9862 Mark it as expected to fail.
9863 Cast result of malloc; problem reported by twlevo@xs4all.nl.
9864 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
9865 Don't start user-code symbols with "yy", to avoid name space problems.
9866
f479c6c6
AD
98672005-09-19 Akim Demaille <akim@epita.fr>
9868
9869 Remove the traits, failed experiment.
9870 It never proved useful, and anyway because of the current
9871 definition, it was not possible to have several specialization of
9872 this traits, making it useless.
9873 * data/lalr1.cc (yy:traits): Remove.
9874 Inline its definitions in the parser class.
9875
e2586f82
AD
98762005-09-19 Akim Demaille <akim@epita.fr>
9877
9878 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
9879 least Mac OSX with a /usr/local install of gettext.
9880
2e8cf949
AD
98812005-09-19 Akim Demaille <akim@epita.fr>
9882
9883 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
9884 and yytoken for similarity with the other skeletons.
9885
c7fb0b90
AD
98862005-09-19 Akim Demaille <akim@epita.fr>
9887
4e26c69e 9888 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 9889
1bd0deda
PE
98902005-09-16 Paul Eggert <eggert@cs.ucla.edu>
9891
9892 * NEWS: Version 2.1.
9893
9894 * NEWS: Remove notice of yytname change, since it was never in an
9895 official release.
9896 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
9897 diagnostic.
9898 * src/output.c (prepare): Likewise.
9899 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
9900 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
9901 is not defined. This is an awful hack, but it's enough for now.
9902 All callers changed.
9903 * tests/glr-regression-at (make_value): Args are const pointers now,
9904 to avoid GCC warning.
9905 (Duplicated user destructor for lookahead): New test. Currently
9906 skipped. It fails on my host but I'm not sure it'll always fail.
9907
99082005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
9909
9910 * src/symtab.h (struct symbol): Declare the printer and destructor
9911 as const, to avoid accidental calls to free.
9912 (symbol_destructor_set, symbol_printer_set): Adjust.
9913 * src/symtab.c: Adjust.
9914
1bd0deda 99152005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
9916
9917 * data/c.m4 (b4_token_enums): New.
9918 (b4_token_defines): Rename as...
9919 (b4_token_enums_defines): this.
9920 (b4_token_defines): New, output only the #defines.
9921 * data/yacc.c, data/glr.c: Adjust.
9922 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
9923 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
9924 as default values.
9925
dbcdae2d
AD
99262005-09-16 Akim Demaille <akim@epita.fr>
9927
9928 * data/lalr1.cc (yylex_): Remove, inline its code.
9929 (yyreport_syntax_error_): Remove, replaced by...
9930 (yysyntax_error_): this which returns a string and leaves to the
9931 caller the call to the users' error function.
9932 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
9933 Move from members of the parser object...
9934 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
9935 to local variables of the parse function.
9936
70d8f291
AD
99372005-09-16 Akim Demaille <akim@epita.fr>
9938
9939 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
9940 since it's in Bison's name space.
9941
b47dbebe
PE
99422005-09-15 Paul Eggert <eggert@cs.ucla.edu>
9943
ae199bf1
PE
9944 * data/glr.c (yyresolveValue): Add default case to pacify
9945 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
9946
b47dbebe
PE
9947 * NEWS: Document when yyparse started to return 2.
9948 * doc/bison.texinfo (Parser Function): Document when yyparse
9949 returns 2.
9950
9951 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
9952 (b4_filename_type): Renamed back from b4_file_name_type. All uses
9953 changed.
9954 (class position): file_name -> filename (reverting). All uses changed.
9955
99562005-09-14 Paul Eggert <eggert@cs.ucla.edu>
9957
9958 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
9959 do anything if $@ exists. This reverts part of the 2005-07-07
9960 patch.
9961
00292f66
PE
99622005-09-11 Paul Eggert <eggert@cs.ucla.edu>
9963
9964 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
9965 contains obsolete information and isn't worth distributing as a
9966 separate file anyway.
9967 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
9968 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
9969 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
9970 (yyparse): Abort if user code uses longjmp to throw an unexpected
9971 value.
9972
a420f962
PE
99732005-09-09 Paul Eggert <eggert@cs.ucla.edu>
9974
00292f66
PE
9975 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
9976 Suggested by twlevo@xs4all.nl.
9977
127287e9
PE
9978 * data/glr.c (YYCHK1): Do not assume YYE is in range.
9979 This avoids a diagnostic from gcc -Wswitch-enum.
9980 Problem reported by twlevo@xs4all.nl.
9981
a420f962
PE
9982 * doc/bison.texinfo: Don't use "filename", as per GNU coding
9983 standards. Use "file name" or "file" or "name", depending on
9984 the context.
9985 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
9986 not to hack/foo.tab.c.
9987 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
9988 * data/glr.c: b4_filename -> b4_file_name.
9989 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
9990 All uses changed.
9991 (class position): filename -> file_name. All uses changed.
9992 * data/yacc.c: b4_filename -> b4_file_name.
9993 * lib/bitset.h: filename -> file_name in local vars.
9994 * lib/bitset_stats.c: Likewise.
9995 * src/files.c: Likewise.
9996 * src/scan-skel.l ("@output ".*\n): Likewise.
9997 * src/files.c (file_name_split): Renamed from filename_split.
9998 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
9999
100002005-09-08 Paul Eggert <eggert@cs.ucla.edu>
10001
10002 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
10003 to accommodate latest gnulib.
10004
10005 * tests/glr-regression.at (Duplicate representation of merged trees):
10006 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
10007
10008 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
10009 needed.
10010
42a6501d
PE
100112005-08-26 Paul Eggert <eggert@cs.ucla.edu>
10012
10013 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
10014 All uses changed. Invoke user destructor after an error during a
10015 split parse (trivial change from Joel E. Denny).
10016
10017 * tests/glr-regression.at
10018 (User destructor after an error during a split parse): New test case.
10019 Problem reported by Joel E. Denny in:
10020 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
10021
ef9a1faf
PE
100222005-08-25 Paul Eggert <eggert@cs.ucla.edu>
10023
5b4aaf78
PE
10024 * README-cvs: Give URLs for recommended tools.
10025 Mention Gzip version problem, and bootstrapping issues.
10026 Remove troubleshooting section, as it's somewhat obsolete.
10027
b5240ba5
PE
10028 * bootstrap (no_cache): New var, to accommodate different wget
10029 variants. Use it instead of '-C off'. Problem reported by
10030 twlevo@xs4all.nl.
10031
ef9a1faf
PE
10032 * data/glr.c (yydestroyStackItem): New function.
10033 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
10034 debugging information. Problem reported by Joel E. Denny.
10035
e6efa9da
AD
100362005-08-25 Akim Demaille <akim@epita.fr>
10037
10038 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
10039
adc90f13
PE
100402005-08-24 Paul Eggert <eggert@cs.ucla.edu>
10041
10042 * data/glr.c (yyrecoverSyntaxError, yyreturn):
10043 Don't invoke destructor on unresolved entries.
10044 * tests/glr-regression.at
10045 (User destructor for unresolved GLR semantic value): New test case.
10046 Problem reported by Joel E. Denny in:
10047 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
10048
f9315de5
PE
100492005-08-21 Paul Eggert <eggert@cs.ucla.edu>
10050
15d29c1f
PE
10051 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
10052 Add strnlen.c.
10053 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
10054 lib-prefix.m4, po.m4.
10055
dd5f2af2
PE
10056 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
10057 in yydestruct diagnostic, since it might not be an error.
10058 Problem reported by Joel Denny near end of
10059 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 10060 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
10061 * data/yacc.c (yyreturn): Likewise.
10062 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
10063
10064 * src/files.c: Remove obsolete FIXME comment.
10065
10066 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
10067 with the other templates, and to fix bogus run-on messages such
10068 as the one reported at the end of
10069 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
10070 All callers changed to avoid the newline.
10071 (yyprocessOneStack): Output two lines rather than one, to accommodate
10072 the above change. This changes the debug output format slightly.
10073
f9315de5
PE
10074 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
10075 reported by Joel E. Denny in
10076 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
10077 (trivial change).
10078 * tests/glr-regression.at (Duplicate representation of merged trees):
10079 New test, from Joel E. Denny in:
10080 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
10081 * THANKS: Add Joel E. Denny.
10082
10083 * configure.ac (AC_INIT): Bump to 2.0c.
10084
04098407
PE
100852005-07-24 Paul Eggert <eggert@cs.ucla.edu>
10086
10087 * NEWS: Version 2.0b.
10088
ca5d2013
PE
10089 * Makefile.am (SUBDIRS): Put examples before tests, so that
10090 "make check" doesn't finish with "All 1 tests passed".
10091
3d54b576
PE
10092 * tests/regression.at (Token definitions): Don't rely on
10093 AT_PARSER_CHECK for data that contains backslashes. It currently
10094 uses 'echo', and 'echo' isn't portable if its argument contains
10095 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
10096 that the byte '\0xff' is not printable in the C locale; it is,
10097 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
10098 not printable, so use '\0x81' to test.
10099
d53ae497
PE
10100 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
10101 version of GCC, since the macro is used with non-GCC compilers.
10102
fc01665e
PE
10103 Fix core dump reported by Pablo De Napoli in
10104 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
10105 * tests/regression.at (Invalid inputs with {}): New test.
10106 * src/parse-gram.y (token_name): Translate type before using
10107 it as an index.
10108
04098407
PE
10109 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
10110 the user's name space. All uses changed to __attribute__
10111 ((__unused__)).
10112 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
10113 Add __attribute__ ((__noreturn__)).
10114
10115 * etc/clcommit: Remove. We weren't using it, and it failed
10116 "make maintainer-distcheck".
10117 * Makefile.maint: Merge from coreutils.
10118 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
10119 (syntax-check-rules): Change list of rules as described below.
10120 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
10121 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
10122 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
10123 (sc_trailing_space): New rules.
10124 (sc_xalloc_h_in_src): Remove.
10125 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
10126 (sc_space_tab, sc_error_exit_success, sc_changelog):
10127 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
10128 (makefile-check, po-check, author_mark_check):
10129 (makefile_path_separator_check, copyright-check):
10130 Use grep -n, to make it easier to find violations.
10131 Use CVS_LIST and CVS_LIST_EXCEPT.
10132 (header_regexp, h_re): Remove.
10133 (dd_c): New macro.
10134 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
10135 (my-distcheck): Use more-modern GCC flags.
10136 (signatures, %.asc): Remove.
10137 (rel-files, announcement): Remove signatures.
10138 Restore old updating code, even though we don't use it, so
10139 that we're the same as coreutils.
10140 (alpha, beta, major): Depend on news-date-check.
10141 Make the upload commands.
10142
10143 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
10144 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
10145 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
10146 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
10147 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
10148 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
10149 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
10150 * tests/sets.at: Likewise.
10151
10152 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
10153 we comment out the Autoconf version number.
10154 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
10155 it's error-prone and "make maintainer-distcheck" rejects it.
10156
10157 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
10158 Indent calls to "error" to pacify "make maintainer-distcheck",
10159 when the calls are not intended to be translated.
10160 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
10161
10162 * src/Makefile.am (DEFS): Use +=, to pacify
10163 "make maintainer-distcheck".
10164 (bison_SOURCES): Add scan-skel.h.
10165 (sc_tight_scope): New rule, from coreutils.
10166
10167 * src/files.c (src_extension, header_extension):
10168 Now static, not extern.
10169 * src/getargs.c (short_options): Likewise.
10170 * src/muscle_tab.c (muscle_table): Likewise.
10171 * src/parse-gram.y (current_class, current_type, current_prec):
10172 Likewise.
10173 * src/reader.c (grammar_end, previous_rule_end): Likewise.
10174 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
10175 * src/main.c (main): Cast bindtextdomain and textdomain calls to
10176 void, to avoid warning when NLS is disabled.
10177 * src/output.c: Include scan-skel.h.
10178 (scan_skel): Remove decl, since scan-skel.h does this.
10179 (output_skeleton):
10180 Indent calls to "error" to pacify "make maintainer-distcheck".
10181 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
10182 * src/reader.h (gram_end, gram_lineno): New decls to pacify
10183 "make maintainer-distcheck".
10184 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
10185 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
10186 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
10187 (skel_lex_destroy, scan_skel): Move these decls to...
10188 * src/scan-skel.h: New file.
10189 * src/uniqstr.c (uniqstr_assert):
10190 Indent calls to "error" to pacify "make maintainer-distcheck".
10191
10192 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
10193 not @VAR@.
10194
10195 * tests/torture.at: Revamp to avoid misuse of atoi that
10196 "make maintainer-distcheck" complained about.
10197
10198 * examples/extexi (message): Don't print a message more than once,
10199 and omit line-number decoration that makes Emacs compile think
10200 that informative messages are worth worrying about.
10201
102022005-07-22 Paul Eggert <eggert@cs.ucla.edu>
10203
10204 * configure.ac: Update version number.
10205
10206 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
10207 accidentally.
10208 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
10209 autogenerated by the maintainer.
10210 * examples/calc++/.cvsignore: Add *.yy.
10211
10212 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
10213 * lib/bitset_stats.c (bitset_stats_init): Likewise.
10214 * lib/bitsetv.c (bitsetv_alloc): Likewise.
10215
10216 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
10217
10218 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
10219 from maintainer-distcheck about casting the argument of 'free'.
10220
10221 * NEWS: Mention recent yytname changes.
10222 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
10223
10224 * bootstrap: For translations that have not yet been upgraded to
10225 the new runtime-po domain, prime the pump by extracting the
10226 relevant strings from the obsolete translations. This code can be
10227 removed once the bison-runtime domain has been translated by each
10228 team.
10229
10230 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
10231 now that token names are already quoted.
10232
10233 Fix problem reported by Anthony Heading.
10234 * data/glr.c (YYTOKEN_TABLE): New macro.
10235 (yytname): Define if YYTOKEN_TABLE.
10236 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
10237 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
10238 (YYERROR_VERBOSE): Define the same way the other skeletons do.
10239 * src/output.c (prepare_symbols): Output token_table_flag.
10240
0ffda363
PE
102412005-07-21 Paul Eggert <eggert@cs.ucla.edu>
10242
10243 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
10244 again if the first call fails.
10245
10246 * data/glr.c (yytnamerr): New function.
10247 (yyreportSyntaxError): Use it to dequote most string literals.
10248 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
10249 with other skeletons. All uses changed.
10250 (yytnameerr_): New function.
10251 (yyreport_syntax_error): Use it to dequote most string literals.
10252 * data/yacc.c (yytnamerr): New function.
10253 (yyerrlab): Use it to decode most string literals.
10254 * doc/bison.texinfo (Decl Summary, Calling Convention):
10255 Clarify quoting convention of yytname.
10256 * src/output.c (prepare_symbols): Quote all names. This undoes
10257 the 2005-04-17 change, which is now accomplished (mostly) via
10258 changes in the parsers as described above.
10259 * tests/regression.at (Token definitions, Web2c Actions):
10260 Undo most 2005-04-17 change here, too.
10261
102622005-07-20 Paul Eggert <eggert@cs.ucla.edu>
10263
10264 Fix more problems reported by twlevo@xs4all.nl.
10265 * tests/cxx-type.at: Don't pipe output of ./types through sed to
10266 remove trailing spaces. This loses the exit status of ./types,
10267 and isn't needed since ./types shouldn't be emitting trailing
10268 spaces.
10269 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
10270 as the stack isn't valid in that case.
10271
10272 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
10273 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
10274 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
10275 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
10276 is used.
10277 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
10278 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
10279 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
10280 Likewise.
10281
10282 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
10283 overly-picky compilers that reject 'char *foo = "bar";'.
10284
10285 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
10286 to FILE * parameter, not to stderr. This fixes a typo introduced
10287 in the 2005-07-12 change.
10288
10289 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
10290 warnings from GCC 4.
10291
10292 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
10293 (yyglrShiftDefer, yysplitStack):
10294 Remove unused parameters b4_pure_formals. All uses changed.
10295 (yyglrShift): Remove unused parameters b4_user_formals.
10296 All uses changed.
10297 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
10298
6100a9aa
PE
102992005-07-18 Paul Eggert <eggert@cs.ucla.edu>
10300
258b75ca
PE
10301 Destructor cleanups and regularization among the three skeletons.
10302 * NEWS: Document the behavior changes.
10303 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
10304 stack before failing, as the cleanup code will do it for us now.
10305 * data/lalr1.cc (yyerrlab): Likewise.
10306 * data/glr.c (yyparse): Pop everything off the stack before
10307 freeing it, so that destructors get called properly.
10308 * data/lalr1.cc (yyreturn): Likewise.
10309 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
10310 This is more consistent.
10311 * doc/bison.texinfo (Destructor Decl): Mention more reasons
10312 why destructors might be called. 1.875 -> 2.1.
10313 (Destructor Decl, Decl Summary, Table of Symbols):
10314 Some English-language cleanups for %destructor.
10315 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
10316 Add output line for destructor of start symbol.
10317 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
10318 because of that same extra output line.
10319
1a059451
PE
10320 * NEWS: Document minor wording changes in diagnostics of
10321 Bison-generated parsers.
10322 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
10323 Remove unused formals. All uses changed.
10324 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
10325 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
10326 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
10327 Rename yyoverflowab to yyexhaustedlab.
10328 When memory exhaustion occurs during syntax-error reporting,
10329 report it separately rather than in a single diagnostic; this
10330 eases translation.
10331 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
10332 (Memory Exhausted): Renamed from Parser Stack Overflow.
10333 Revamp wording slightly to prefer "memory exhaustion".
10334 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
10335
97460c78
PE
10336 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
10337
30757c8c
PE
10338 Add i18n support to the GLR skeleton. Partially fix the C++
10339 skeleton; a C++ expert needs to finish this. Remove debugging
10340 msgids; there's little point to having them translated, since they
10341 can be understood only by someone who can read the
10342 (English-language) source code.
10343
10344 Generate runtime-po/bison-runtime.pot automatically, so that we
10345 don't have to worry about garbage getting in that file. We'll
10346 make sure after the next official release that old msgids don't
10347 get lost. See
10348 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
10349
10350 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
10351 Now auto-generated.
10352 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
10353 Fix typos in explanations of the runtime file.
10354 * bootstrap: Change gettext keyword from YYI18N to YY_.
10355 Use standard Makefile.in.in in runtime-po, since we'll arrange
10356 for backward-compatible bison-runtime.po files in a different way.
10357 * data/glr.c (YY_): New macro, from yacc.c.
10358 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
10359 Translate messages intended for users.
10360 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
10361 the wording in the other skeletons. We don't know that the memory
10362 is virtual.
10363 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
10364 Use same method that yacc.c uses.
10365 Don't translate debugging messages.
10366 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
10367 it doesn't work (yet), and requires C++ expertise to fix.
10368 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
10369 Move defn to a more logical place, to be consistent with other
10370 skeletons.
10371 Don't translate debugging messages.
10372 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
10373 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
10374 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
10375 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
10376
ac8c5689
PE
10377 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
10378 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
10379 void, not int.
10380 * tests/glr-regression.at (Badly Collapsed GLR States):
10381 Likewise.
10382 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
10383 yylex should return 0 at EOF rather than aborting.
10384
6100a9aa
PE
10385 Improve tests for stack overflow in GLR parser.
10386 Problem reported by twlevo@xs4all.nl.
10387 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
10388 All uses removed.
10389 (yyStackOverflow): Just longjmp, but with value 2 so that caller
10390 can handle the problem.
10391 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
10392 (yyparse): New local variable yyresult to record the result.
10393 Use result of setjmp to set it, rather than storing itinto
10394 struct.
10395 (yyDone): Remove label.
10396 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
10397 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
10398 if YYABORT is used).
10399 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
10400 yyparse status; put status > 1 into diagnostic.
10401 Check that status==2 works.
10402 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
10403 Use exit status 3 for failure to open (which shouldn't happen).
10404
15f40952
PE
104052005-07-17 Paul Eggert <eggert@cs.ucla.edu>
10406
67fd79c4
PE
10407 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
10408 1 on syntax error; just let yyparse do its thing.
10409 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
10410 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
10411 (Exploding the Stack Size with Alloca):
10412 (Exploding the Stack Size with Malloc):
10413 Expect exit status 2, not 1, since the parser is supposed to blow
10414 its stack. Problem reported by twlevo@xs4all.nl.
10415
15f40952
PE
10416 * data/glr.c (yyparse): Don't assume that the initial calls
10417 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
10418 Print a stack-overflow message and fail instead.
10419 Initialize the line-number information before creating the stack,
10420 so that the stack-overflow message can report line zero safely.
10421
f32c66b5
PE
104222005-07-14 Paul Eggert <eggert@cs.ucla.edu>
10423
a22ff96f 10424 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
10425 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
10426 (yyuserMerge): Provide a default case if b4_mergers is empty.
10427 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
10428 * tests/glr-regression.at
10429 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 10430 Add casts to pacify C++ compilers.
1beb0b24
PE
10431 * tests/glr-regression.at (Improper merging of GLR delayed action
10432 sets): Declare yylex before using it.
f32c66b5 10433 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
10434 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
10435 test for valgrind; valgrind is independent of g++.
10436 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
10437 for compatibility with POSIX 1003.1-2001 (if running coreutils).
10438 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
10439 Use a destructor, so that we can expand the stack. Change
10440 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 10441
d741bd1b
PE
104422005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10443
10444 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
10445 a valgrind failure. Problem reported by twlevo@xs4all.nl.
10446
0410a6e0
PE
104472005-07-13 Paul Eggert <eggert@cs.ucla.edu>
10448
10449 * PACKAGING: New file, suggested by Bruno Haible and taken from
10450 similar wording in gettext's PACKAGING file.
10451 * NEWS: Mention PACKAGING.
10452 * Makefile.am (EXTRA_DIST): Add PACKAGING.
10453
f7ab6a50
PE
104542005-07-12 Paul Eggert <eggert@cs.ucla.edu>
10455
baf785db 10456 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
10457 * bootstrap: Get runtime translations into runtime-po.
10458 Create runtime-po files automatically, if possible.
10459 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
10460 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
10461 does not infringe on the user's name space.
10462 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
10463 * doc/bison.texinfo (Internationalization): Revamp the English
10464 and Texinfo syntax a bit, to try to make it clearer.
10465 (Bison Options, Option Cross Key): Mention --print-localedir.
10466 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
10467 YYENABLE_NLS. Quote a bit more.
10468 * runtime-po/.cvsignore: New file.
10469 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
10470 * runtime-po/Rules-quot: Remove; now created by bootstrap.
10471 * runtime-po/quot.sed: Likewise.
10472 * runtime-po/boldquot.sed: Likewise.
10473 * runtime-po/en@quot.header: Likewise.
10474 * runtime-po/en@boldquot.header: Likewise.
10475 * runtime-po/insert-header.sin: Likewise.
10476 * runtime-po/remove-potcdate.sin: Likewise.
10477 * runtime-po/Makevars: Likewise.
10478 * runtime-po/LINGUAS: Likewise.
10479 * runtime-po/de.po: Likewise; we will rely on the translation project
10480 to maintain this, so "bootstrap" should get it.
0410a6e0 10481 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
10482 its value.
10483 * src/main.c (main): Bind the bison-runtime domain, too.
10484
104852005-07-12 Bruno Haible <bruno@clisp.org>
10486
10487 * data/yacc.c: Include <libintl.h> when NLS is enabled.
10488 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
10489 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
10490 * runtime-po: New directory.
10491 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
10492 $(DOMAIN).pot-update rule, so that old messages are never dropped.
10493 * runtime-po/Rules-quot: New file, copied from po/.
10494 * runtime-po/quot.sed: Likewise.
10495 * runtime-po/boldquot.sed: Likewise.
10496 * runtime-po/en@quot.header: Likewise.
10497 * runtime-po/en@boldquot.header: Likewise.
10498 * runtime-po/insert-header.sin: Likewise.
10499 * runtime-po/remove-potcdate.sin: Likewise.
10500 * runtime-po/Makevars: New file.
10501 * runtime-po/POTFILES.in: New file.
10502 * runtime-po/LINGUAS: New file.
10503 * runtime-po/bison-runtime.pot: New file.
10504 * runtime-po/de.po: New file.
10505 * m4/bison.m4: New file.
10506 * Makefile.am (SUBDIRS): Add runtime-po.
10507 (aclocaldir, aclocal_DATA): New variables.
10508 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
10509 Define aclocaldir.
10510 * src/getargs.c (usage): Document --print-localedir option.
10511 (PRINT_LOCALEDIR_OPTION): New enum item.
10512 (long_options): Add --print-localedir option.
10513 (getargs): Handle --print-localedir option.
10514 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
10515 (Internationalization): New section.
10516
22dda0f0
AD
105172005-07-12 Akim Demaille <akim@epita.fr>
10518
10519 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
10520 for consistency with the rest of the code.
10521 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
10522 Add separators.
10523
82b248ad
AD
105242005-07-12 Akim Demaille <akim@epita.fr>
10525
10526 * src/parse-gram.y: Use %printer instead of YYPRINT.
10527
fa0e9314
AD
105282005-07-12 Akim Demaille <akim@epita.fr>
10529
867a3e00
AD
10530 * src/symtab.h, src/symtab.c (symbol_print): New.
10531 * src/symlist.h, src/symlist.c (symbol_list_print): New.
10532 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
10533
105342005-07-12 Akim Demaille <akim@epita.fr>
10535
10536 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
10537 b4_at_dollar and b4_dollar_dollar.
10538
e054b190
PE
105392005-07-11 Paul Eggert <eggert@cs.ucla.edu>
10540
10541 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
10542 and Pennello's paper.
10543
34160ec4
PE
105442005-07-09 Paul Eggert <eggert@cs.ucla.edu>
10545
407d4a75
PE
10546 * data/yacc.c (yyparse): Undo previous patch. Instead,
10547 set yylsp[0] and yyvsp[0] only if the initial action
10548 sets yylloc and yylval, respectively.
10549
34160ec4
PE
10550 * data/yacc.c (yyparse): In the initial action, set
10551 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
10552 This avoids the use of undefined variables if the initial
10553 action does not set yylloc and/or yylval.
10554
c3d5a4a7
PE
105552005-07-07 Paul Eggert <eggert@cs.ucla.edu>
10556
b34d96c1
PE
10557 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
10558 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
10559 Remove from CVS. These files are automatically generated.
10560 * examples/extexi: Clarify that this file is now part of Bison,
10561 not GNU M4, and that it works with any POSIX-compatible Awk.
10562 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
10563 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
10564 so that we also get calc++-parser.yy. Geneate it.
10565 Use $(AWK), not gawk, since any conforming Awk will do.
10566 Put comment before action, since older 'make' can't handle comment
10567 in action.
10568 $(BUILT_SOURCES): List all built sources, not just some of them.
10569 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
10570 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
10571 $($(calc_sources_generated)): Remove unnecessary test for existence
10572 of target. (This had a shell syntax error anyway; a stray "x".)
10573 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
10574 calc++-parser.yy.
10575 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
10576
c3d5a4a7
PE
10577 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
10578 implied by the other modules.
10579
828c373b
AD
105802005-07-06 Akim Demaille <akim@epita.fr>
10581
10582 Bind examples/calc++ to the package.
10583 * examples/calc++/Makefile: Remove, replaced by...
10584 * examples/calc++/Makefile.am: ... this new file.
10585 * examples/calc++/test: Remove input.
10586 * examples/calc++/compile: Remove.
10587 * examples/Makefile.am: New.
10588 * configure.ac, Makefile.am: Adjust.
10589 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
10590
63cb01d6
PE
105912005-07-05 Paul Eggert <eggert@cs.ucla.edu>
10592
fd2df2ed
PE
10593 * data/glr.c (yyFail): Drastically simplify; since the format argument
10594 never had any % directives, we can simply pass it to yyerror.
10595 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
10596 be modified later, as that is the usual style in glr.c.
10597 Problems reported by Paul Hilfinger.
10598
63cb01d6
PE
10599 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
10600 and size overflow errors.
10601 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
10602 in case the user prolog sets feature-test macros like _GNU_SOURCE.
10603 (YYSIZEMAX): New macro.
10604 (yystpcpy): New function, taken from yacc.c.
10605 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
10606 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
10607 so that we don't have to maintain their signatures.
10608 (yyFail): Check for buffer overflow, by using vsnprintf rather
10609 than vsprintf. Allocate a bigger buffer if possible.
10610 Report an error if buffer allocation fails.
10611 (yyStackOverflow): New function.
10612 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
10613 the initialization was successful. It might fail if storage was
10614 exhausted.
10615 (yyexpandGLRStack): Add more checks for storage allocation failure.
10616 Use yyStackOverflow to report failures.
10617 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
10618 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
10619 Don't assume stack number fits in int.
10620 (yysplitStack): Check for storage allocation failure.
10621 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
10622 can print diagnostics on storage allocation failure. All callers
10623 changed.
10624 (yyresolveValue): Use yybool for boolean.
10625 (yyreportSyntaxError): Check for size-calculation overflow.
10626 This code is taken from yacc.c.
10627 (yyparse): Check for storage allocation errors when allocating
10628 the initial stack.
10629
1c59e0a1
AD
106302005-07-05 Akim Demaille <akim@epita.fr>
10631
10632 Extract calc++ from the documentation.
10633 * doc/bison.texinfo (Calc++): Add the extraction marks.
10634 * examples/extexi: New, from the aborted GNU Programming 2E.
10635 Separate the different paragraph of a file with empty lines.
10636 * examples/Makefile: Use it to extract the whole calc++ example.
10637
8a0adb01
AD
106382005-06-24 Akim Demaille <akim@epita.fr>
10639
10640 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
10641 class typedefs.
10642
12545799
AD
106432005-06-22 Akim Demaille <akim@epita.fr>
10644
10645 * doc/bison.texinfo (C++ Language Interface): First stab.
10646 (C++ Parsers): Remove.
10647
99be0235
AD
106482005-06-22 Akim Demaille <akim@epita.fr>
10649
10650 * data/lalr1.cc (yylex_): Honor %lex-param.
10651
0ffd4fd1
AD
106522005-06-22 Akim Demaille <akim@epita.fr>
10653
10654 Start a set of simple examples.
10655 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
10656 * examples/calc++/calc++-driver.hh,
10657 * examples/calc++/calc++-parser.yy,
10658 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
10659 * examples/calc++/compile, examples/calc++/test: New.
10660
0925ebb4
PE
106612005-06-09 Paul Eggert <eggert@cs.ucla.edu>
10662
10663 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
10664 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
10665 which stems from the 2005-05-27 patch.
10666
43d3b664
PH
106672005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10668
10669 * data/glr.c: Modify treatment of unused parameters to permit use
10670 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
10671
3062864d
PE
106722005-05-30 Paul Eggert <eggert@cs.ucla.edu>
10673
10674 Fix infringement on user name space reported by Janos Zoltan Szabo.
10675 * data/yacc.c (yyparse): strlen -> yystrlen.
10676
989b5b8e
AD
106772005-05-30 Akim Demaille <akim@epita.fr>
10678
10679 * data/lalr1.cc (_): New.
10680 Translate the various messages.
10681
bedf57f5
PE
106822005-05-27 Paul Eggert <eggert@cs.ucla.edu>
10683
10684 Fix infringement on user name space reported by Bruno Haible.
10685 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
10686 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
10687 the user's name space.
10688 (alloca): Include <stdlib.h> to get it, if it's not built in.
10689 (YYMALLOC, YYFREE): Define only if needed.
10690 (malloc, free): Declare, but only if needed, as this infringes on
10691 the user name space.
10692
4d1801f1
PE
106932005-05-25 Paul Eggert <eggert@cs.ucla.edu>
10694
10695 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
10696 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
10697 with %d format.
10698 * lib/ebitset.c (min, max): Undef before defining.
10699 * lib/vbitset.c (min, max): Likewise.
10700 * lib/subpipe.c (create_subpipe): Save local variables in case
10701 vfork clobbers them.
10702
107032005-05-24 Bruno Haible <bruno@clisp.org>
10704
10705 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
10706 error message syntax used by gcc-4.0.
10707
b94a9e1e
PE
107082005-05-23 Paul Eggert <eggert@cs.ucla.edu>
10709
85ac3861
PE
10710 * README: Mention m4 1.4.3. Remove obsolete advice about
10711 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
10712
b94a9e1e
PE
10713 * bootstrap: Remove workaround for problem I encountered with
10714 gettext 0.14.1; it seems to be fixed now.
10715
51c30d21
PE
107162005-05-22 Paul Eggert <eggert@cs.ucla.edu>
10717
009ce67d
PE
10718 * NEWS: Version 2.0a.
10719
f2a97c62
PE
10720 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
10721 the previous change.
10722
c8775f93
PE
10723 Various maintainer cleanups.
10724 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
10725 conftest*, for benefit of CVS commands run at the same time as
10726 "configure". Add build-aux, since "bootstrap" now creates it and
10727 its subfiles.
10728 * Makefile.cfg (move_if_change): Remove.
10729 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
10730 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
10731 (po_repo, do-po-update, po-update, wget_files, get-targets):
10732 (config.guess-url_prefix, config.sub-url_prefix):
10733 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
10734 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
10735 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
10736 Remove.
10737 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
10738 this is now the recommended name.
10739 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
10740 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
10741 ylwrap. These files now go into build-aux.
10742 * config/move-if-change: Remove.
10743 * config/prev-version.txt: Bump from 1.75 to 2.0.
10744
3ea5f0ec
PE
10745 * bootstrap: Add stdio-safer, unistd-safer modules.
10746 Remove m4/glibc2.m4 (introduced by latest gnulib, but
10747 we don't need it).
10748 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
10749 fopen-safer.c, stdio-safer.h, unistd-safer.h.
10750 * lib/subpipe.c: Include "unistd-safer.h".
10751 (create_subpipe): Make sure all the newly-created
10752 file descriptors are > 2, so that diagnostics don't
10753 get sent down them (which might cause Bison to hang, in theory).
10754 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
10755 * src/files.c (xfopen): Use fopen_safer, not fopen.
10756
51c30d21
PE
10757 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
10758 yesterday's yacc.c fix.
10759
cea1469d
PE
107602005-05-21 Paul Eggert <eggert@cs.ucla.edu>
10761
3ea5f0ec
PE
10762 * data/glr.c, data/lalr1.cc: Update copyright date.
10763
cea1469d
PE
10764 Fix a destructor bug reported by Wolfgang Spraul in
10765 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
10766 * data/yacc.c (yyabortlab): Don't call destructor, and
10767 don't set yychar to EMPTY.
10768 (yyoverflowlab): Don't call destructor.
10769 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
10770 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
10771 since we no longer output the message "discarding lookahead token
10772 end of input ()".
10773
5e6f62f2
PH
107742005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10775
10776 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
10777 fix a small glitch in debugging output.
10778 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
10779 after YY_SYMBOL_PRINT where needed.
10780
10781 (struct yyGLRState): Add some comments.
10782 (struct yySemanticOption): Add some comments.
10783 (union yyGLRStackItem): Add comment.
10784
10785 (yymergeOptionSets): Correct this to properly perform the union,
10786 avoiding infinite reported by Michael Rosien.
10787 Update comment.
10788
10789 * tests/glr-regression.at: Add test for GLR merging error reported
10790 by M. Rosien.
cea1469d 10791
0fb669f9
PE
107922005-05-13 Paul Eggert <eggert@cs.ucla.edu>
10793
10794 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
10795 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
10796 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
10797 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
10798 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
10799 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
10800 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
10801 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
10802 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
10803 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
10804 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
10805 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
10806 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
10807 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
10808 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
10809 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
10810 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
10811 src/derives.h, src/files.c, src/files.h, src/getargs.c,
10812 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
10813 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
10814 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
10815 src/output.h, src/parse-gram.c, src/parse-gram.h,
10816 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
10817 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
10818 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
10819 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
10820 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
10821 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
10822 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
10823 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
10824 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
10825 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
10826 tests/reduce.at, tests/regression.at, tests/sets.at,
10827 tests/synclines.at, tests/testsuite.at, tests/torture.at:
10828 Update FSF postal mail address.
10829
51f4735e
PE
108302005-05-11 Paul Eggert <eggert@cs.ucla.edu>
10831
10832 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
10833 Problem reported by Ralf Menzel.
10834
80ce3401
PE
108352005-05-01 Paul Eggert <eggert@cs.ucla.edu>
10836
10837 * tests/actions.at: Test that stack overflow invokes destructors.
10838 From Marcus Holland-Moritz.
10839 * data/yacc.c (yyerrlab): Move the code that destroys the stack
10840 from here....
10841 (yyreturn): to here. That way, destructors are called properly
10842 even if the stack overflows, or the user calls YYACCEPT or
10843 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
10844 (yyoverflowlab): Destroy the lookahead.
10845
108462005-04-24 Paul Eggert <eggert@cs.ucla.edu>
10847
10848 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
10849
72f000b0
PE
108502005-04-17 Paul Eggert <eggert@cs.ucla.edu>
10851
10852 * NEWS: Bison-generated C parsers no longer quote literal strings
10853 associated with tokens.
10854 * src/output.c (prepare_symbols): Don't escape strings,
10855 since users don't want to see C escapes.
10856 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
10857 in diagnostics.
c19683bb 10858 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
10859 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
10860
1094323f
PE
108612005-04-16 Paul Eggert <eggert@cs.ucla.edu>
10862
10863 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
10864 the data size is known to be too small and we can't increase it.
10865 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
10866
ca407bdf
PE
108672005-04-15 Paul Eggert <eggert@cs.ucla.edu>
10868
10869 * src/parse-gram.y: Include quotearg.h.
10870 (string_as_id): Quote $1 before using it as a key, since the
10871 lexer no longer quotes it for us.
10872 (string_content): Don't strip quotes, since lexer no longer
10873 quotes it for us.
10874 * src/scan-gram.l: Include quotearg.h.
10875 ("\""): Omit quote.
10876 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
10877 a key, since the rest of the lexer doesn't quote it.
10878 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
10879 * tests/regression.at (Token definitions): Check for backslashes
10880 in token strings.
10881
10882 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
10883 (YYSIZE_T): Define to unsigned long int when using an older compiler.
10884 (yyparse): Revamp code to generate long syntax error message, to
10885 make it easier to translate, and to avoid problems with arithmetic
10886 overflow. Change "virtual memory" to "memory" in diagnostic, since
10887 we don't know whether the memory is virtual.
10888
1ce59070
PE
108892005-04-13 Paul Eggert <eggert@cs.ucla.edu>
10890
10891 * NEWS: Bison-generated C parsers now use the _ macro to
10892 translate strings.
10893 * data/yacc.c (_) [!defined _]: New macro.
10894 All English strings wrapped inside this macro.
10895 * doc/bison.texinfo (Bison Parser): Document _.
10896 * po/POTFILES.in: Include src/parse-gram.c, since it now
10897 includes translateable strings that parse-gram.y doesn't.
10898
a749a695
PE
108992005-04-12 Paul Eggert <eggert@cs.ucla.edu>
10900
10901 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
10902 reverting the 2004-10-11 change to this function.
10903 (symbol_check_alias_consistency): Don't call symbol_type_set
10904 if the type name is already correct.
10905 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
10906
8fb1053b
PE
109072005-03-25 Paul Eggert <eggert@cs.ucla.edu>
10908
10909 * tests/regression.at (Token definitions): Don't use a token named
10910 c, as that generates a "#define c ..." that runs afoul of buggy
10911 stdlib.h that uses the identifier c as a member of struct
10912 drand48_data. Problem reported by Horst Wente.
10913
ff498c4a
PE
109142005-03-21 Paul Eggert <eggert@cs.ucla.edu>
10915
10916 * bootstrap: Change translation URL from
10917 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
10918 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
10919 redirection glitches. Problem reported by twlevo@xs4all.nl.
10920
65211d70
PE
109212005-03-20 Paul Eggert <eggert@cs.ucla.edu>
10922
10923 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
10924 after operands; POSIX says this isn't portable for the c99 command.
10925
9577fb1f
PE
109262005-03-18 Paul Eggert <eggert@cs.ucla.edu>
10927
10928 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
10929 immediately if a data overrun has occurred; this may help us track
10930 down what may be a spurious failure on MacOS.
10931
78b178f7
PE
109322005-03-17 Paul Eggert <eggert@cs.ucla.edu>
10933
a2599d0f
PE
10934 Respond to problems reported by twlevo@xs4all.nl.
10935
10936 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
10937
78b178f7
PE
10938 * src/vcg.h: Comment fix.
10939 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
10940 (G_CMAX): Change to -1 instead of INT_MAX.
10941
10942 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 10943
7296e729
PE
109442005-03-15 Paul Eggert <eggert@cs.ucla.edu>
10945
10946 * src/tables.c (state_number_to_vector_number): Put it inside an
10947 "#if 0", since it's not currently used. Problem reported by
10948 Roland McGrath.
10949
05ac60f3
PE
109502005-03-06 Paul Eggert <eggert@cs.ucla.edu>
10951
10952 * src/output.c (escaped_output): Renamed from
10953 escaped_file_name_output, since we now use it for symbol tags as
10954 well. All uses changed.
10955 (symbol_destructors_output, symbol_printers_output):
10956 Escape symbol tags too.
10957 Problem reported by Matyas Forstner in
10958 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
10959
10960 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
10961 not needed.
10962 * src/output.c (user_actions_output, token_definitions_output,
10963 symbol_destructors_output, symbol_printers_output): Likewise.
10964 * src/reader.c (prologue_augment): Likewise.
10965 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
10966
10967 * src/vcg.c (output_edge): Don't quote linestyle arg.
10968 Problem reported by twlevo@xs4all.nl.
10969
7eb453ac
PE
109702005-02-28 Paul Eggert <eggert@cs.ucla.edu>
10971
10972 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
10973 example, reported by Derek M Jones. Also, make the example even
10974 more outrageous, to better illustrate how bad the problem is.
10975
4c04c52a
PE
109762005-02-24 Paul Eggert <eggert@cs.ucla.edu>
10977
10978 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
10979 putsym. Typo reported by Sebastian Piping.
10980
a61e1620
PE
109812005-02-23 Paul Eggert <eggert@cs.ucla.edu>
10982
10983 * doc/bison.texinfo (Language and Grammar): some -> same
10984 (Epilogue): int he -> in the
10985 Typos reported by Sebastian Piping via Justin Pence.
10986
9ec93868
PE
109872005-02-07 Paul Eggert <eggert@cs.ucla.edu>
10988
10989 * tests/glr-regression.at (Improper handling of embedded actions
10990 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
10991 embedded actions and $-N in GLR parsers", work around an Autoconf bug
10992 with dollar signs in test names.
10993 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
10994 for a similar reason.
10995
73ce7e7e
PE
109962005-01-28 Paul Eggert <eggert@cs.ucla.edu>
10997
10998 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
10999 wants to redefine G_VIEW.
11000
2e72b98e
PE
110012005-01-27 Paul Eggert <eggert@cs.ucla.edu>
11002
11003 * src/vcg.c (get_view_str): Remove case for normal_view.
11004 Problem reported by twlevo@xs4all.nl.
11005
e0d634e5
PE
110062005-01-24 Paul Eggert <eggert@cs.ucla.edu>
11007
ccf830a4
PE
11008 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
11009 Problem reported by twlevo@xs4all.nl.
11010
e0d634e5
PE
11011 * doc/bison.texinfo: Change @dircategory from "GNU programming
11012 tools" to "Software development". Requested by Richard Stallman
11013 via Karl Berry.
11014
7bbc8cb0
PE
110152005-01-23 Paul Eggert <eggert@cs.ucla.edu>
11016
11017 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
11018 Problem reported by twlevo@xs4all.nl.
11019
08b770bc
PE
110202005-01-21 Paul Eggert <eggert@cs.ucla.edu>
11021
11022 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
11023 keyword; it's not needed with modern compilers, and it doesn't
11024 affect correctness with older compilers. Suggested by
11025 twlevo@xs4all.nl.
11026
95f22ad2
PE
110272005-01-17 Paul Eggert <eggert@cs.ucla.edu>
11028
11029 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
11030 gcc -Wswitch-default.
11031 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
11032 * data/yacc.c (yyparse): Likewise.
11033
d229d15c
PE
110342005-01-12 Paul Eggert <eggert@cs.ucla.edu>
11035
11036 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
11037 already. Let config.h define any nonstandard values.
11038
ecadd90f
PE
110392005-01-10 Paul Eggert <eggert@cs.ucla.edu>
11040
11041 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
11042 for the benefit of slower hosts. Problem reported by
11043 Nelson H. F. Beebe.
11044
213744b5
PE
110452005-01-07 Paul Eggert <eggert@cs.ucla.edu>
11046
11047 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
11048 being defined and not used.
11049 * data/lalr1.cc (yyparse): Likewise.
11050 Use "if (false)" rather than "if (0)".
11051
249d3236
PE
110522005-01-05 Paul Eggert <eggert@cs.ucla.edu>
11053
11054 * TODO: Mention that we should allow NUL bytes in tokens.
11055
987cc1fb
PE
110562005-01-02 Paul Eggert <eggert@cs.ucla.edu>
11057
11058 * src/scan-skel.l (<<EOF>>): Don't close standard output.
11059 Problem reported by Hans Aberg.
11060
08fe02d9
PE
110612005-01-01 Paul Eggert <eggert@cs.ucla.edu>
11062
11063 * src/getargs.c (version): Happy new year; update overall
11064 program copyright date from 2004 to 2005.
11065
11066 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
11067 Problem reported by Hans Aberg.
11068 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
11069 (Output file names.): Add a test for the case when standard output
11070 is closed.
11071
010c0266
PE
110722004-12-26 Paul Eggert <eggert@cs.ucla.edu>
11073
11074 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
11075 to fix an oversight in the Bison 2.0 manual.
11076
da12206a
PE
110772004-12-25 Paul Eggert <eggert@cs.ucla.edu>
11078
11079 * NEWS: Version 2.0. Reformat the existing news items since
11080 1.875, so that related items are grouped together.
3a4734aa 11081 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
11082 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
11083
c935d934
PE
11084 * tests/torture.at (Exploding the Stack Size with Alloca): Set
11085 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
11086 otherwise, we're not testing alloca. Unfortunately there's no
11087 simple way to consult HAVE_ALLOCA here.
11088
da12206a
PE
11089 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
11090 for yymsg, too.
11091
11092 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
11093 hand. This avoids a warning about comparing int to size_t when
11094 GCC warnings are enabled.
11095
0a2c5137
PE
110962004-12-22 Paul Eggert <eggert@cs.ucla.edu>
11097
d7e14fc0
PE
11098 * NEWS: Bison-generated parsers no longer default to using the
11099 alloca function (when available) to extend the parser stack, due
11100 to widespread problems in unchecked stack-overflow detection.
11101 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
11102 responsibility to set it to a positive value. This lets the user
11103 specify a value that is not a preprocessor constant.
11104 * data/yacc.c (YYMAXDEPTH): Likewise.
11105 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
11106 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
11107 to be a compile-time constant. However, explain the constraints on it.
11108 Also, explain the constraints on YYINITDEPTH.
11109 (Table of Symbols): Explain that alloca is no longer the default.
11110 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
11111 to 1.
11112
0a2c5137
PE
11113 * doc/bison.texinfo (Location Default Action): Mention that n must
11114 be zero when k is zero. Suggested by Frank Heckenbach.
11115
e019c247
AD
111162004-12-22 Akim Demaille <akim@epita.fr>
11117
11118 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
11119 (parser::state_type, parser::semantic_type, parser::location_type):
11120 Private, not public.
11121 (parser::parse): Return ints, not bool.
11122 Returning a bool introduces a problem: 0 corresponds to false, and
11123 it seems weird to return false on success. Returning true changes
11124 the conventions for yyparse.
11125 Alternatively we could return void and send an exception.
11126 There is no clear consensus (yet?).
11127 (state_stack, semantic_stack, location_stack): Rename as...
11128 (state_stack_type, semantic_stack_type, location_stack_type): these.
11129 Private, not public.
11130 * tests/c++.at: New.
11131 * tests/testsuite.at, tests/Makefile.am: Adjust.
11132
72731bb7
AD
111332004-12-21 Akim Demaille <akim@epita.fr>
11134
11135 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
11136
9a0d8bec
AD
111372004-12-21 Akim Demaille <akim@epita.fr>
11138
11139 Don't impose std::string for filenames.
11140
11141 * data/lalr1.cc (b4_filename_type): New.
11142 (position::filename): Use it.
11143 (parser.hh): Move the inclusion of stack.hh and location.hh below
11144 the user code, so that needed headers for the filename type can be
11145 included first.
72731bb7
AD
11146 Forward declare them before the user code.
11147 * tests/Makefile.am (check-local, installcheck-local): Pass
11148 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 11149
99880de5
AD
111502004-12-20 Akim Demaille <akim@epita.fr>
11151
11152 Use more STL like names: my_class instead of MyClass.
11153
11154 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
11155 (SemanticStack, SemanticType, StateStack, StateType)
11156 (TokenNumberType, Stack, Slice, Traits, Parser::location)
11157 (Parser::value): Rename as...
11158 (location_stack, location_type, rhs_number_type, semantic_stack)
11159 (semantic_type, state_stack, state_type, token_number_type, stack)
11160 (slice, traits, parser::yylloc, parser::yylval): these.
11161
11162 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
11163
9bec482e
PE
111642004-12-19 Paul Eggert <eggert@cs.ucla.edu>
11165
11166 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
11167 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
11168
f6fbd3da
PE
111692004-12-17 Paul Eggert <eggert@cs.ucla.edu>
11170
11171 Remove uses of 'short int' and 'unsigned short int'. This raises
11172 some arbitrary limits. It uses more memory but nowadays that's
11173 not much of an issue.
11174
11175 This change does not affect the generated parsers; that's a different
11176 task, as some users will want to conserve memory there.
11177
11178 Ideally we should use size_t to represent all object counts, and
11179 something like ptrdiff_t to represent signed differences of object
11180 counts; but that will require more code-cleanup than I have the
11181 time to do right now.
11182
11183 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
11184 Use size_t, not int or short int, to count objects.
11185 * src/closure.c (nritemset, closure): Likewise.
11186 * src/closure.h (nritemset, closure): Likewise.
11187 * src/nullable.c (nullable_compute): Likewise.
11188 * src/print.c (print_core): Likewise.
11189 * src/print_graph.c (print_core): Likewise.
11190 * src/state.c (state_compare, state_hash): Likewise.
11191 * src/state.h (struct state): Likewise.
11192 * src/tables.c (default_goto, goto_actions): Likewise.
11193
11194 * src/gram.h (rule_number, rule): Use int, not short int.
11195 * src/output.c (prepare_rules): Likewise.
11196 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
11197 errs, reductions): Likewise.
11198 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
11199 Likewise.
11200 * src/tables.c (vector_number, tally, action_number,
11201 ACTION_NUMBER_MINIMUM): Likewise.
11202 * src/output.c (muscle_insert_short_int_table): Remove.
11203
efeed023
AD
112042004-12-17 Akim Demaille <akim@epita.fr>
11205
11206 * data/lalr1.cc: Extensive Doxygenation.
11207 (error_): Rename as...
11208 (error): this, since it is visible to the user.
11209 Adjust callers.
11210 (Parser::message): Now an automatic variable from...
11211 (Parser::yyreport_syntax_error_): here.
11212 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
11213 Parser::error.
11214 * tests/input.at: Escape $.
11215
bc82c5a5
PE
112162004-12-16 Paul Eggert <eggert@cs.ucla.edu>
11217
11218 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
11219 Parenthesize rhs to avoid obscure problems with mistakes like
11220 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
11221 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
11222 b4_rhs_location): Likewise.
11223 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
11224 b4_rhs_location): Likewise.
11225
fd19f271
AD
112262004-12-16 Akim Demaille <akim@epita.fr>
11227
11228 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
11229 yacc.c: be sure to stay within yycheck_.
11230 * tests/actions.at: Re-enable C++ tests.
11231
10454ea4
AD
112322004-12-16 Akim Demaille <akim@epita.fr>
11233
11234 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
11235 real.
11236
c5b95ccf
AD
112372004-12-16 Akim Demaille <akim@epita.fr>
11238
11239 Use #define to handle the %name-prefix.
11240
11241 * data/glr.c, data/yacc.c: Comment changes.
11242 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
11243 so that one can refer to yylex in the parser file, and have it
11244 renamed, as is the case with other skeletons.
11245
617a8f12
AD
112462004-12-16 Akim Demaille <akim@epita.fr>
11247
11248 Move lalr1.cc internals into yy*.
11249
11250 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
11251 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
11252 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
11253 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
11254 (empty_, final_, terror_, errcode_, ntokens_)
11255 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
11256 (looka_, ilooka_, error_range_, nerrs_):
11257 Rename as...
11258 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
11259 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
11260 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
11261 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
11262 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
11263 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
11264 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
11265 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
11266 these.
11267
1e547e6e
PE
112682004-12-15 Paul Eggert <eggert@cs.ucla.edu>
11269
11270 Fix some problems reported by twlevo at xs4all.
11271 * src/symtab.c (symbol_new): Report an error if the input grammar
11272 contains too many symbols. This is better than calling abort() later.
11273 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
11274 (struct node, struct graph):
11275 Rename member expand to stretch. All uses changed.
11276 (struct graph): Remove member layoutalgorithm. All uses removed.
11277 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
11278 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
11279 All uses changed.
11280 (N_STRETCH): Rename from N_EXPAND. All uses changed.
11281
735d6bd4
AD
112822004-12-15 Akim Demaille <akim@epita.fr>
11283
11284 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
11285 Add more Doxygen comments.
11286 (symprint_, stack_print_, reduce_print_, destruct_, pop)
11287 (report_syntax_error_, translate_): Rename as...
11288 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
11289 (yypop_, yyreport_syntax_error_, yytranslate_): this.
11290
2e1f5829
AD
112912004-12-15 Akim Demaille <akim@epita.fr>
11292
11293 * data/lalr1.cc (lex_): Rename as...
11294 (yylex_): this.
11295 Move the trace here.
11296 Take the %name-prefix into account.
11297 Reported by Alexandre Duret-Lutz.
11298
a3cb6248
AD
112992004-12-15 Akim Demaille <akim@epita.fr>
11300
11301 Simplify the C++ parser constructor.
11302
11303 * data/lalr1.cc (debug_): Rename as...
11304 (yydebug_): so that the parser's internals are always in the yy*
11305 pseudo namespace.
11306 Adjust uses.
11307 (b4_parse_param_decl): Remove the leading comma as it is now only
11308 called as unique argument list.
11309 (Parser::Parser): Remove the constructor accepting a location and
11310 an initial debugging level.
11311 Remove from the other ctor the argument for the debugging level.
11312 (debug_level_type, debug_level, set_debug_level): New.
11313
11314 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
11315 constructor calls.
11316
07fed891
AD
113172004-12-15 Akim Demaille <akim@epita.fr>
11318
11319 Remove b4_root related material: failure experiment
a3cb6248 11320 (which goal was to allow to derive from a class).
07fed891
AD
11321
11322 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
11323 definitions and uses.
11324
e603eaa5
PE
113252004-12-14 Paul Eggert <eggert@cs.ucla.edu>
11326
11327 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
11328 not 2, since it's not portable to subtract 1 from the start of an
11329 array. The new item 0 is never set or used. All uses changed.
11330
11331 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
11332 the default definition of YYLLOC_DEFAULT. Problem reported
11333 by Frank Heckenbach.
11334
fafb007d
PE
113352004-12-12 Paul Eggert <eggert@cs.ucla.edu>
11336
11337 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
11338 the normal case and one for the error case. Just use the
11339 first one uniformly. Problem reported by Frank Heckenbach.
11340 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
11341 use exactly the same macro in both places.
11342 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
11343 so that the normal-case YYRHSLOC works for the error case too.
11344 All uses changed.
11345 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
11346 (YYLLOC_DEFAULT): Use the same macro as glr.c.
11347 * doc/bison.texinfo (Location Default Action): Don't claim that
11348 we have an array of locations. Use the same macro for both glr
11349 and lalr parsers. Mention YYRHSLOC. Mention what happens when
11350 the index is 0.
11351
48814dcd
PE
113522004-12-10 Paul Eggert <eggert@cs.ucla.edu>
11353
a4e1a53b
PE
11354 * HACKING: Update email addresses to send announcements to.
11355
48814dcd
PE
11356 * configure.ac (AC_INIT): Bump version to 1.875f.
11357
337116ba
PE
113582004-12-10 Paul Eggert <eggert@cs.ucla.edu>
11359
11360 * NEWS: Version 1.875e.
11361 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
11362
11363 * src/scan-skel.l: Include "complain.h", for "fatal".
11364
11365 * src/relation.h (relation_print, relation_digraph):
11366 Relation sizes are of type relation_node, not size_t (this is
11367 merely a doc fix, since the two types are equivalent).
11368 (relation_transpose): Relation sizes are of type relation_node,
11369 not int.
11370 * src/relation.c: Likewise.
11371 (top, infinity): Now of type relation_node, not int.
11372 (traverse, relation_transpose): Use relation_node, not int.
11373
11374 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
11375 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
11376 (yyparse): Remove unused local introduced in 2004-10-25 patch.
11377
11378 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 11379 specifying whether the test should be skipped. Use it tp
337116ba 11380 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 11381 fail on some hosts, and should be skipped.
337116ba 11382
da2a7671
PE
113832004-12-08 Paul Eggert <eggert@cs.ucla.edu>
11384
11385 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
11386 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
11387 unless otherwise specified below.
11388
11389 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
11390 to allocate kernel_base, kernel_items, kernel_size, since
11391 they needn't be initialized to 0.
11392 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
11393 * src/closure.c (new_closure): Likewise, for itemset.
11394 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
11395 * src/lalr.c (set_goto_map): Likewise, for temp_map.
11396 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
11397 (build_relations): Likewise for edge, states1, includes.
11398 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
11399 * src/reader.c (packgram): Likewise, for ritem, rules.
11400 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
11401 * src/relation.c (relation_digraph): Likewise for VERTICES.
11402 (relation_transpose): Likewise for new_R, end_R.
11403 * src/symtab.c (symbols_token_translations_init): Likewise for
11404 token_translations.
11405 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
11406 (token_actions): Likewise for yydefact, actrow, conflrow,
11407 conflict_list.
11408 (save_column): Likewise for froms[symno], tos[symno].
11409 (goto_actions): Likewise for state_count.
11410 (pack_table): Likewise for base, pos, check.
11411 (tables_generate): Likewise for width.
11412
11413 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
11414 for initial core. Just have a separate core, so we needn't worry
11415 about whether kernel_size and kernel_base are initialized.
11416
11417 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
11418 kernel_size, kernel_items): Remove unnecessary initialization.
11419 * src/conflicts.c (conflicts): Likewise.
11420 * src/derives.c (derives): Likewise.
11421 * src/muscle_tablc (muscle_insert): Likewise.
11422 * src/relation.c (relation_digraph): Likewise.
11423 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
11424 conflrow, conflict_table, conflict_list, table, check):
11425 Likewise.
11426
11427 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
11428 This is because all callers pass unsigned int.
11429 * src/closure.h (new_closure): Likewise.
11430
11431 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
11432 (build_relations): Initialize includes[i] in all cases.
11433 * src/reader.c (packgram): Always initialize rules[ruleno].prec
11434 and rules[ruleno].precsym. Initialize members in order.
11435 * src/relation.c (relation_transpose): Always initialize new_R[i]
11436 and end_R[i].
11437 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
11438
11439 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
11440 conflict_list[0] was always 0, but now it isn't initialized.
11441
11442 * src/table.c (table_grow): When conflict_table grew, the grown
11443 area wasn't cleared. Fix this.
11444
11445 * lib/.cvsignore: Add strdup.c, strdup.h.
11446 * m4/.cvsignore: Add strdup.m4.
11447
00baeeac
PE
114482004-12-07 Paul Eggert <eggert@cs.ucla.edu>
11449
11450 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
11451 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
11452 GOTO_NUMBER_MAXIMUM, since we occasionally compute
11453 ngotos + 1 without checking for overflow.
11454 (build_relations): Use END_NODE, not -1, to denote end of edges.
11455 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
11456 build_relations): Use goto_number, not int, for goto numbers.
11457 * src/tables.c (save_column, default_goto): Likewise.
11458
be3d9d42
AD
114592004-11-23 Akim Demaille <akim@epita.fr>
11460
11461 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
11462 of #defining from yystype.
11463 Don't typedef yystype, C++ does not need it.
11464 This lets it possible to forward declare it as union.
11465
78e526d5
PE
114662004-11-23 Paul Eggert <eggert@cs.ucla.edu>
11467
11468 * bootstrap (gnulib_modules): Add extensions.
11469 Problem reported by Jim Meyering.
11470
afbb696d
PE
114712004-11-22 Paul Eggert <eggert@cs.ucla.edu>
11472
11473 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
11474 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
11475 src/system.h, src/tables.c: XFREE -> free, to accommodate
11476 recent change to gnulib xalloc.h.
78e526d5 11477 Problem reported by Jim Meyering.
afbb696d 11478
c1f8f16a
AD
114792004-11-17 Akim Demaille <akim@epita.fr>
11480
11481 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
11482
db7e5eb5 114832004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
11484 Alexandre Duret-Lutz <adl@gnu.org>
11485
11486 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
11487 changes.
11488 (YYCDEBUG): Adjust.
11489 Use it instead of cdebug_.
11490 (Parser::debug_stream, Parser::set_debug_stream): New.
11491 (Parser::symprint_): Define cdebug_ for temporary backward
11492 compatibility.
11493 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
11494 debug_stream ().
11495
68e11668
AD
114962004-11-17 Akim Demaille <akim@epita.fr>
11497
11498 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
11499 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
11500 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
11501 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
11502
97cbc73e
PE
115032004-10-27 Paul Eggert <eggert@cs.ucla.edu>
11504
11505 * data/glr.c (yyloc_default): Remove; not used.
11506 Problem reported by Frank Heckenbach.
11507
e342c3be
AD
115082004-10-25 Akim Demaille <akim@epita.fr>
11509
11510 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
11511 Introduce another definition to address simple location arrays.
11512 (yyGLRStack): New member: yyerror_range.
11513 (yyrecoverSyntaxError, yyparse): Update it.
11514 (yyrecoverSyntaxError): Use it when shifting the error token to
11515 have an accurate range, equivalent to the one computed by both
11516 yacc.c and lalr1.cc.
11517 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
11518 that column numbers start at column 0, as per GNU Coding
11519 Standards, the others tests, and the doc.
11520 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
11521 Adjust to the above change (first column is 0).
11522 And adjust the location of the "<error>", now covering the whole
11523 line.
11524
93602feb 115252004-10-22 Akim Demaille <akim@epita.fr>
04098407 11526 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
11527
11528 Remove some arbitrary limits on goto numbers and relations.
11529 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
11530 initial values, since they're never used.
11531 (set_goto_map): ngotos is now unsigned, so test for overflow
11532 by seeing whether it wraps around to zero.
11533 * src/lalr.h (goto_number): Now size_t, not short int.
11534 (GOTO_NUMBER_MAXIMUM): Remove.
11535 * src/relation.c (relation_print, traverse, relation_transpose):
11536 Check for END_NODE rather than looking at sign.
11537 * src/relation.h (END_NODE): New macro.
11538 (relation_node): Now size_t, not short int.
11539
dba08b04
PE
115402004-10-22 Paul Eggert <eggert@cs.ucla.edu>
11541
11542 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
11543 keyword, not an identifier. Problem reported by Baron Schwartz in
11544 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
11545
df09ef2e
AD
115462004-10-11 Akim Demaille <akim@epita.fr>
11547
11548 * src/symtab.c (symbol_check_alias_consistency): Also check
11549 type names, destructors, and printers.
11550 Reported by Alexandre Duret-Lutz.
11551 Recode the handling of associativity and precedence in terms
11552 of symbol_precedence_set.
11553 Accept no redeclaration at all, not even equal to the previous
11554 value.
11555 (redeclaration): New.
11556 Use it to factor redeclaration complaints.
11557 (symbol_make_alias): Don't set the type of the alias, let
11558 symbol_check_alias_consistency do it as for other features.
11559 * src/symtab.h (symbol): Add new member prec_location, and
11560 type_location.
11561 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
11562 * tests/input.at (Incompatible Aliases): New.
11563
146bc99d
PE
115642004-10-09 Paul Eggert <eggert@cs.ucla.edu>
11565
11566 .cvsignore fixes to accommodate gnulib changes,
11567 and the practice of naming build directories "_build".
11568 * .cvsignore: Add "_*". Sort.
11569 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
11570 * m4/.cvsignore: Add "*_gl.m4".
11571
e503aa60
AD
115722004-10-06 Akim Demaille <akim@epita.fr>
11573
11574 * src/parse-gram.y (add_param): Fix the truncation of trailing
11575 spaces.
11576
b4a20338
AD
115772004-10-05 Akim Demaille <akim@epita.fr>
11578
11579 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
11580 whether the reducion was empty or not. This leaves room to
11581 improve the use of YYLLOC_DEFAULT in such a case.
11582 lalr1.cc is still experimental, so changing this is acceptable.
11583 And finally, there are probably not many users who changed the
11584 handling of locations in GLR, so changing is admissible too.
11585
11586 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
11587 empty reduction, set @$ to an empty location ending the previously
11588 stacked symbol.
11589 Adjust uses to make sure the code is triggered on empty
11590 reductions.
11591 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
11592 expected output: empty reductions have empty locations.
11593
f85a5e6f
AD
115942004-09-29 Akim Demaille <akim@epita.fr>
11595
11596 * data/lalr1.cc: Move towards a more standard C++ coding style
11597 for templates: Class < T > -> Class<T>.
11598
b203fc2c
AD
115992004-09-29 Akim Demaille <akim@epita.fr>
11600
11601 * data/lalr1.cc: Reinstall the former ctor, for sake of
11602 compatibility, but warn it will be removed.
11603 Move towards a more standard C++ coding style (i.e., type *var ->
11604 type* var).
11605
5b7e1e73
PE
116062004-09-27 Paul Eggert <eggert@cs.ucla.edu>
11607
3fee967f
PE
11608 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
11609 since it's less likely to work if NULs are involved in the future.
5b7e1e73 11610
0dcca5c2
AD
116112004-09-27 Akim Demaille <akim@epita.fr>
11612
11613 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
11614
6dde1c82
AD
116152004-09-27 Akim Demaille <akim@epita.fr>
11616
11617 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 11618 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
11619 and argument names.
11620 (b4_cc_constructor_call): Likewise.
11621
b233d555
AD
116222004-09-24 Akim Demaille <akim@epita.fr>
11623
11624 * src/parse-gram.y (add_param): Strip the leading and trailing
11625 blanks from a formal argument declaration.
11626 (YY_LOCATION_PRINT): New.
11627
619404e3
AD
116282004-09-24 Akim Demaille <akim@epita.fr>
11629
11630 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
11631 after the location.
11632
dd8d9022
AD
116332004-09-24 Akim Demaille <akim@epita.fr>
11634
11635 * doc/bison.texinfo (Table of Symbols): Sort.
11636
0092f063
AD
116372004-09-21 Akim Demaille <akim@epita.fr>
11638
11639 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
11640 the useless parentheses.
11641 Suggested by Paul Eggert.
11642
451364ed
AD
116432004-09-20 Akim Demaille <akim@epita.fr>
11644
11645 Let the initial-action act on the look-ahead, and use it for the
11646 "initial push" (corresponding to an hypothetical beginning-of-file).
11647 And let lalr1.cc honor %initial-action.
11648
11649 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
11650 example.
11651 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
11652 (Parser::Parser): Remove the ctor that used to initialize it.
11653 (Parser::parse): Like in the other skeletons, issue the "starting
11654 parse" message before any action.
11655 Honor %initial-action.
11656 Initialize the stacks with the lookahead.
11657 * data/yacc.c: Let $$ and @$ in %initial-action designate the
11658 look-ahead.
11659 Push them in the stacks.
11660 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
11661
18d192f0
AD
116622004-09-20 Akim Demaille <akim@epita.fr>
11663
11664 * doc/bison.texinfo (Initial Action Decl): New.
11665
b8458aa5
AD
116662004-09-20 Akim Demaille <akim@epita.fr>
11667
11668 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
11669 clearer criterion to define it.
11670 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
11671 When reducing on an empty RHS, use the latest stacked location as
11672 location.
11673 yylloc is not always available.
11674 * data/glr.c: Likewise.
11675 Also, honor initial-actions.
11676
3fc16193
AD
116772004-09-20 Akim Demaille <akim@epita.fr>
11678
11679 * data/yacc.c (YY_LOCATION_PRINT): New.
11680 Define when we know YYLTYPE's structure, i.e., when the default
11681 YYLLOC_DEFAULT is used.
11682 * data/c.m4 (b4_yysymprint_generate): Use it.
11683 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
11684 value of the result.
11685 (error_start_): Replace with...
11686 (error_range_): this location array.
11687 This allows to replace code relying on the implementation of
11688 locations by portable code.
11689 * data/yacc.c (yylerrsp): Replace with...
11690 (yyerror_range): this.
11691 Every time a token is popped, update yyerror_range[0], to have an
11692 accurate location for the error token.
11693 * data/glr.c (YY_LOCATION_PRINT): New.
11694 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
11695 deference a pointer.
11696 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
11697 report the location in %printers.
11698
11699 * src/scan-skel.l: Instead of abort, report error messages to ease
11700 understanding skeleton scanning failures.
11701
ecfe33e7
AD
117022004-09-16 Akim Demaille <akim@epita.fr>
11703
11704 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
11705 (iterator, const_iterator): these, to be more in the C++ spirit.
11706 Also, return reverse iterators so that when displaying the stack
11707 we display its bottom first.
11708 (Parser::stack_print_, Parser::reduce_print_): Match the messages
11709 from yacc.c.
11710 We should probably use vector here though.
11711
1576d44d
AD
117122004-09-16 Akim Demaille <akim@epita.fr>
11713
11714 Have more complete shift traces.
11715
11716 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
11717 to report Shifts instead of ad hoc YYDPRINTF invocations,
11718 including for the error token.
11719 * data/lalr1.cc (symprint_): Output the location.
11720 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
11721 output the location within the %printer.
11722 Activate GLR tests, at least to make sure they compile properly.
11723 They still don't pass though.
11724 * tests/calc.at: Adjust expect verbose output, since now "Entering
11725 state..." is on a different line than the "Shifting" message.
11726
9c66f418
AD
117272004-09-08 Akim Demaille <akim@epita.fr>
11728
11729 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
11730 Bison directive from the Bison file to the invocation of this
11731 macro, so that these directives are passed to
11732 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
11733 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
11734 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
11735 the extra Bison directives instead of the whole series.
11736 Change the grammar so that there are recoverable errors, and
11737 unrecoverable errors. Now we can have the parser give up before
11738 consuming the whole input. As a result we now can observe that
11739 the lookahead is freed when needed.
11740 Change the parser source to parse argv[1] instead of a hard coded
11741 string.
11742 Simplify yylex, and give a value and location to EOF.
11743 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
11744 passed directives already coded in the file.
11745 Add some tests to check the location of "error".
11746 For some tests, the C++ parser is correct, and not yacc.c.
11747 For other tests, they provide different, but unsatisfying, values,
11748 so keep the C++ value so that at least one parser is "correct"
11749 according to the test suite.
11750 (Actions after errors): Remove, this is subsumed by the
11751 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
11752
52d5733f
AD
117532004-09-06 Akim Demaille <akim@epita.fr>
11754
11755 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 11756 (Parser::pop): New.
52d5733f
AD
11757 Use it.
11758
a0e68930
AD
117592004-09-06 Akim Demaille <akim@epita.fr>
11760
11761 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
11762 argument, an informative message.
11763 Call YY_SYMBOL_PRINT.
11764 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
11765 * data/lalr1.cc (destruct_): Likewise.
11766 In addition, no longer depend on b4_yysymprint_generate and
11767 b4_yydestruct_generate to generate these functions, do it "by
11768 hand".
11769
e757bb10
AD
117702004-09-03 Akim Demaille <akim@epita.fr>
11771
11772 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
11773 invoked, yydestruct the lookahead.
11774 * tests/calc.at (Calculator $1): Update the expected lengths of
11775 traces: there is an added line for the discarded lookahead.
11776 * doc/bison.texinfo (Destructor Decl): Some rewording.
11777 Define "discarded" symbols.
11778
0fe1f06d
AD
117792004-09-02 Akim Demaille <akim@epita.fr>
11780
11781 * data/lalr1.cc (translate_, destruct_): No reason to be static.
11782
284acc8b
AD
117832004-09-02 Akim Demaille <akim@epita.fr>
11784
11785 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
11786 (YYDSYMPRINTF): Rename as...
11787 (YY_SYMBOL_PRINT): this.
11788 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
11789 two.
11790 Use it instead of direct symprint_ calls.
11791 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
11792 one.
11793
a5eb1ed2
AD
117942004-09-02 Akim Demaille <akim@epita.fr>
11795
b7c72fe1
AD
11796 * data/lalr1.cc (b4_yysymprint_generate): New.
11797 (symprint_): New member function, defined when YYDEBUG.
11798 Use it consistently instead of token/nterm debugging output by
11799 hand.
a5eb1ed2
AD
11800 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
11801 %printer calls to use cdebug_ when using lalr1.cc.
11802
417141dd
AD
118032004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
11804
11805 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
11806 with #ifdef YYDEBUG.
11807
2fa09258
AD
118082004-08-26 Akim Demaille <akim@epita.fr>
11809
11810 * doc/bison.texinfo (Implementing Loops): Rename as...
11811 (Implementing Gotos/Loops): this.
11812
9378b508
PE
118132004-08-13 Paul Eggert <eggert@cs.ucla.edu>
11814
11815 Adjust to latest gnulib.
11816 * bootstrap (gnulib_modules): Add xalloc-die.
11817 Set LC_ALL=C so that file names sort consistently.
11818 Prefer the gnulib copies of gettext.m4, glibc21.m4,
11819 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
11820 uintmax_t.m4, ulonglong.m4.
11821 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
11822 po.m4 since we are now using _gl.m4 instead.
11823
87a8ad5c
PE
118242004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
11825
11826 * src/scan-action.l: Remove. Scanning of semantic actions is
11827 handled in scan-gram.l.
11828
dca81a78
PE
118292004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
11830
11831 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
11832
11833 * src/location.h (struct): The file member is a uniqstr.
11834 (equal_boundaries): Use UNIQSTR_EQ for comparison.
11835
c9cbf7c5
PE
118362004-07-22 Paul Eggert <eggert@cs.ucla.edu>
11837
11838 Fix bug with non-%union parsers that have printers or destructors,
11839 which led to a Bison core dump. Reported by Peter Fales in
11840 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 11841
c9cbf7c5
PE
11842 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
11843 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
11844 not to our own type.
11845 * src/output.c (symbol_destructors_output, symbol_printers_output):
11846 Don't assume %union.
11847 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
11848 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
11849 UNION-FLAG. All callers changed.
11850 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
11851 Use type char, not unsigned int, when declaring an array of char;
11852 this lets us remove a cast.
11853 (Printers and Destructors): Add non-%union test cases.
11854
fa7e68c3
PE
118552004-06-21 Paul Eggert <eggert@cs.ucla.edu>
11856
11857 * doc/bison.texinfo: Minor editorial changes, mostly to the new
11858 GLR writeups. E.g., avoid frenchspacing and the future tense,
11859 change "lookahead" to "look-ahead", and change "wrt" to "with
11860 respect to".
2fa09258 11861
fa7e68c3
PE
118622004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11863
11864 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
11865 New sections, split off from the GLR Parsers section. Put the new
11866 Simple GLR Parser near the start of the GLR section, for clarity.
11867 Rewrite connective text.
11868
99a9344e
PE
118692004-06-21 Frank Heckenbach <frank@g-n-u.de>
11870
11871 * doc/bison.texinfo (Simple GLR Parsers): New section.
11872
8dd162d3
PE
118732004-06-21 Paul Eggert <eggert@cs.ucla.edu>
11874
11875 * NEWS, TODO, doc/bison.texinfo:
11876 Use "look-ahead" instead of "lookahead", to be consistent.
11877 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
11878 while we're fixing "look-ahead".
11879 * src/conflicts.c (shift_set): Renamed from shiftset.
11880 (look_ahead_set): Renamed from lookaheadset.
11881 * src/print.c: Likewise.
11882 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
11883 name for "lookahead".
11884 (report_types, usage): Likewise.
11885 * src/getargs.h (report_look_ahead_tokens): Renamed from
11886 report_lookaheads.
11887 * src/lalr.c (compute_look_ahead_tokens): Renamed from
11888 compute_lookaheads.
11889 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
11890 (look_ahead_tokens_print): Renamed from lookaheads_print.
11891 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
11892 state_rule_lookaheads_print.
11893 * src/state.h: Likewise.
11894 (reductions.look_ahead_tokens): Renamed from lookaheads.
11895 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
11896 AT_DATA_LOOKAHEADS_GRAMMAR.
11897
57a90331
PE
118982004-06-03 Paul Eggert <eggert@cs.ucla.edu>
11899
11900 * README: Update location of patched M4 distribution.
11901
8ed3234a
PE
119022004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
11903
11904 Don't assume the C++ compiler takes the same arguments as the C compiler
11905 (trivial change).
11906 * configure.ac (O0CXXFLAGS): New var.
11907 * tests/atlocal.in (CXXFLAGS): Use it.
11908
07971983
PE
119092004-05-29 Paul Eggert <eggert@cs.ucla.edu>
11910
11911 Fix some "make check" problems with C++ reported by
11912 Albert Chin-A-Young for Tru64 C++ in this thread:
11913 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
11914
11915 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
11916 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11917 Output to a .cc file for C++, not to a .c file.
11918 * tests/calc.at (AT_CHECK_CALC): Likewise.
11919 * tests/regression.at (AT_CHECK_DANCER): Likewise.
11920 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
11921
29058652
PE
119222004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
11923
11924 * tests/calc.at, tests/actions.at: Workaround for SGI
11925 C++ compiler. (trivial change)
11926
62cb8a99
PE
119272004-05-27 Paul Eggert <eggert@cs.ucla.edu>
11928
fd418816
PE
11929 Spent a few hours checking out which prerequisite versions the
11930 current sources actually require. I went all the way back to
11931 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
11932 a seemingly endless set of combinations of versions more recent
11933 than that. The bottom line is that the current sources require
11934 fairly recent versions of the build tools, and it'll be some work
11935 to change this.
11936 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
11937 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
11938 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
11939 Add comments explaining why those particular versions are
11940 currently needed.
2fa09258 11941
62cb8a99
PE
11942 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
11943 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 11944 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
11945
11946 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
11947 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
11948
caa52c10
PE
119492004-05-26 Paul Eggert <eggert@cs.ucla.edu>
11950
11951 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
11952 0.11.5. Suggested by Bruno Haible.
11953 * bootstrap: Remove gettext version checking.
11954
11955 * doc/bison.texinfo (Decl Summary): Also mention that %union
11956 can depend on prerequisite types. Problem reported by Tim
11957 Van Holder.
11958
4bfd5e4e
PE
119592004-05-25 Paul Eggert <eggert@cs.ucla.edu>
11960
2cef3017
PE
11961 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
11962 * README-alpha: Don't tell people not to package this.
11963
b9c85d5c
PE
11964 * bootstrap: Don't assume $(...) works; use `...` instead.
11965 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
11966 gettext better.
11967
4bfd5e4e
PE
11968 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
11969 put into the -d output file, and mention what to do if YYSTYPE is
11970 defined as a macro.
11971
6a36ff94
PE
119722004-05-24 Paul Eggert <eggert@cs.ucla.edu>
11973
6712933e
PE
11974 Undo change made earlier today: it caused autopoint to not bring
11975 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
11976 autopoint's.
11977
11978 * bootstrap: Check that gettext version matches what's in
11979 configure.ac. Warn users to ignore robots.txt ERROR 404.
11980 * bootstrap: Undo today's earlier change (logged below).
11981 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 11982
6a36ff94
PE
11983 The gettext version checking is causing more trouble than it's
11984 curing; remove it. Problem reported by Paul Hilfinger.
11985
11986 * bootstrap: Issue a warning that one can expect a message
11987 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
11988 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
11989
209ea708
PE
119902004-05-23 Paul Eggert <eggert@cs.ucla.edu>
11991
11992 Ensure that the C++ compiler used for testing actually works on a
11993 simple test program; if not, skip the C++-related tests. Problem
11994 reported by Vin Shelton in:
161a71f3 11995 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
11996
11997 * m4/cxx.m4: New file.
11998 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
11999 * tests/atlocal.in (BISON_CXX_WORKS): Add.
12000 * tests/local.at (AT_COMPILE_CXX): Use it.
12001
41ca2549
PE
120022004-05-21 Paul Eggert <eggert@cs.ucla.edu>
12003
383e69dc
PE
12004 * data/glr.c (yylloc): Output this macro even if locations are not
12005 being generated, as the GLR parser needs it even in that case.
12006 Problem reported by Troy A. Johnson
12007 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
12008
41ca2549
PE
12009 * configure.ac (AC_INIT): Update to 1.875e.
12010
e476c87d
PE
120112004-05-21 Paul Eggert <eggert@cs.ucla.edu>
12012
12013 * NEWS: Version 1.875d.
12014 * configure.ac (AC_INIT): Likewise.
12015 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
12016
12017 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
12018 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
12019 lalr1.cc runs afoul of the first, and the last two are no longer
12020 supported by GCC 3.4.0.
12021 * README: Mention GNU m4 1.4 or later; mention m4 patches.
12022 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
12023
233a88ad
PE
120242004-05-06 Paul Eggert <eggert@cs.ucla.edu>
12025
12026 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
12027 unsigned int, for compatibility with latest gnulib hash module.
12028 * src/state.c (state_hash, state_hasher): Likewise.
12029 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
12030 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 12031
12ffdd28
PE
120322004-05-03 Paul Eggert <eggert@cs.ucla.edu>
12033
12034 * NEWS: Unescaped newlines are no longer allowed in char & strings.
12035
12036 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
12037 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
12038 character and string literals.
12039 (unexpected_end): New function.
12040 (unexpected_eof): Use it.
12041 (unexpected_newline): New function.
12042 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
12043 actions.
e476c87d 12044
12ffdd28
PE
12045 * NEWS: Document %expect-rr.
12046
12047 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
12048 Fix typo by replacing $1 with $option.
12049 Remove more 'intl'-related files.
9668e2be 12050 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
12051
12052 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
12053 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
12054 strtoul.c.
12055 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
12056 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
12057 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
12058 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
12059 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
12060 * src/.cvsignore: Add *.output.
12061
12062 * src/parse-gram.y: Put copyright notice inside %{ %} so it
12063 gets copied to the output file.
e476c87d 12064
1f65350a
PE
120652004-04-28 Paul Eggert <eggert@twinsun.com>
12066
12067 Get files from the gnulib and po repositories, instead of relying
12068 on them being in our CVS. Upgrade to latest versions of gnulib
12069 and Automake.
12070
12071 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
12072 * bootstrap: Bootstrap from gnulib and po repositories.
12073 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
12074 * README-cvs: Document these changes. Remove version numbers from
12075 mentions of build tools, since they change so often. Mention Flex.
12076
12077 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
12078 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
12079 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
12080 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 12081 does this for us.
12ffdd28
PE
12082 (AC_ISC_POSIX): Remove; we no longer support this
12083 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
12084 (AC_HEADER_STDC): Remove: we now assume C89 or better.
12085 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
12086 Do not check for C89 headers, except for locale.h which is used
12087 by the Yacc library and must port to K&R hosts.
12088 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
12089 Do not check for C89 functions, except for setlocale which is
12090 used by the Yacc library.
12091 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
12092 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
12093 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
12094 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
12095 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
12096 AM_GNU_GETTEXT): Remove; now done by:
12097 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
12098 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
12099 for us.
12100
12101 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
12102 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
12103 Define to empty, as gnulib.mk will do the rest for us.
12104 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
12105 for us.
12106 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
12107 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
12108
12109 * src/files.c: Include gnulib's xstrndup.h.
12110
12111 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
12112 (REALLOC): Use xnrealloc, for likewise.
12113 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
12114 (strnlen, memrchr): Remove decls; functions no longer used.
12115 Include <stpcpy.h>.
12116
12117 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
12118 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
12119 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
12120 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
12121 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
12122 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
12123 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
12124 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
12125 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
12126 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
12127 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
12128 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
12129 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
12130 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
12131 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
12132 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
12133 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
12134 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
12135 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
12136 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
12137 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
12138 Remove, as these files are now generated automatically
12139 by bootstrap or automake.
12140
12141 * po/ChangeLog: Remove: all but one entry was a duplicate
12142 of this file, and I moved that 2000-11-02 entry here.
12143
12144 * config/.cvsignore: Add Makefile, depcomp, install-sh.
12145 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
12146 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
12147 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
12148 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
12149 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
12150 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
12151 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
12152 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
12153 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
12154 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
12155 xstrndup.h.
12156 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
12157 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
12158 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
12159 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
12160 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
12161 * src/.cvsignore: Remove *_.c.
12162
12163
12164 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
12165 support it. (The latest stable gzip doesn't.)
12166
121672004-04-27 Paul Eggert <eggert@twinsun.com>
12168
12169 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
12170 case, as stos_ is now used by destructors due to the 2004-02-09
12171 change.
12172
12173 Remove more K&R C support.
12174 * lib/libiberty.y (PARAMS): Remove. All uses removed.
12175 * lib/subpipe.c (errno): Remove decl.
12176 Include <stdlib.h> unconditionally.
12177 (EXIT_FAILURE): Remove macro.
12178 * src/complain.c (vfprintf, strerror): Remove.
12179 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
12180 unconditionally.
12181 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
12182 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
12183 (strchr, strspn, memchr): Remove decls.
12184 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
12185 unconditionally. Do not declare perror.
12186 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
12187 unconditionally.
12188
12189 * src/complain.c (_): Remove useless defn, as system.h defines this.
12190
12191 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
12192 with latest obstack.h.
12193 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
12194 to procedure types, as obstack.h now does that for us.
12195 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
12196
12197 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
12198 so that this include file can stand alone.
12199 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
12200 does this now. Include subpipe.h first after config.h, to
12201 test whether it can stand alone.
12202
12203 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
12204 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
12205 unused declaration.
12206
12207 * tests/synclines.at (%union synch line): Put a dummy member in
12208 the union, because empty unions aren't allowed in C. Caught
12209 by GCC 3.4.0.
12210
4f16766c
PE
122112004-04-13 Jim Meyering <jim@meyering.net>
12212
12213 * src/conflicts.c (conflicts_print): Correct format string typo:
12214 use `%%' to produce literal `%'. (trivial change)
12215
779e7ceb
PE
122162004-03-30 Paul Eggert <eggert@twinsun.com>
12217
12218 * src/getargs.c (version): Update copyright year to 2004.
12219
12220 * data/c.m4 (b4_int_type): Use 'short int' rather than
12221 'short', and similarly for 'long', 'unsigned', etc.
12222 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
12223 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
12224 yy_yypstack, yydumpstack): Likewise.
12225 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
12226 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
12227 Likewise.
12228 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
12229 yy_stack_print, yyparse): Likewise.
12230 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
12231 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
12232 * lib/bitset.c (bitset_print): Likewise.
12233 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
12234 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
12235 * lib/bitsetv.c (bitsetv_dump): Likewise.
12236 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
12237 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
12238 Likewise.
12239 * src/LR0.c (allocate_itemsets): Likewise.
12240 * src/gram.h (rule_number, rule): Likewise.
12241 * src/lalr.h (goto_number): Likewise.
12242 * src/nullable.c (nullable_compute): Likewise.
12243 * src/output.c (prepare_rules): Likewise.
12244 * src/relation.c (relation_print, relation_digraph): Likewise.
12245 * src/relation.h (relation_node): Likewise.
12246 * src/state.h (state_number, transitions, errs, reductions,
12247 struct state): Likewise.
12248 * src/symtab.h (symbol_number, struct symbol): Likewise.
12249 * src/tables.c (vector_number, tally, action_number,
12250 default_goto, goto_actions): Likewise.
12251 * tests/existing.at (GNU Cim Grammar): Likewise.
12252 * tests/regression.at (Web2c Actions): Likewise.
12253
12254 * src/output.c (muscle_insert_short_int_table): Renamed from
12255 muscle_insert_short_table. All uses changed.
12256
d6328241
PH
122572004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
12258
12259 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
12260 (declaration): Replace expected_conflicts with expected_sr_conflicts.
12261 Add %expect-rr rule.
4f16766c 12262
d6328241
PH
12263 * src/scan-gram.l: Recognize %expect-rr.
12264
4f16766c 12265 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 12266 expected_conflicts.
4f16766c 12267 (expected_rr_conflicts): Declare.
d6328241
PH
12268
12269 * src/conflicts.c (expected_sr_conflicts): Rename from
12270 expected_conflicts.
12271 (expected_rr_conflicts): Define.
12272 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
12273 for GLR parsers.
12274 Use expected_sr_conflicts in place of expected_conflicts.
12275 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 12276
d6328241 12277 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 12278
1452af69
PE
122792004-03-08 Paul Eggert <eggert@gnu.org>
12280
12281 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 12282 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
12283
12284 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
12285 in lalr1.cc.
12286 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
12287 * src/scan-gram.l (scan_integer): New function.
12288 ({int}): Use it.
12289 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
12290 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
12291 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
12292 Say "long int", not "long", for uniformity with GNU style.
12293
006d217d
PE
122942004-02-25 Paul Eggert <eggert@twinsun.com>
12295
12296 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
12297 compilers. This fixes a problem with Intel's C++ compiler being
12298 chatty, reported by Guido Trentalancia in
161a71f3 12299 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 12300
c2729758
ADL
123012004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
12302
12303 Support %destructor and merge error locations in lalr1.cc.
12304
12305 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
12306 (Parser::stos_): Define unconditionally.
12307 (Parser::destruct_): New method. Generate its body with
12308 b4_yydestruct_generate.
12309 (Parser::error_start_): New attribute.
12310 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
12311 token which are discarded.
12312 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
12313 error_start_ when erroneous token are discarded.
12314 (Parser::parse) <yyerrlab1>: Compute the location of the error
12315 token so that it covers all the discarded tokens.
12316 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
12317 it can be called with `%skeleton "lalr1.cc"', and do that.
12318
dd0e0635
PE
123192004-02-02 Paul Eggert <eggert@twinsun.com>
12320
12321 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
12322 $(top_srcdir)/lib and ../lib. This fixes a bug reported
12323 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
12324 There's no need to mention top_builddir since Automake does that
12325 for us.
12326 (INCLUDES): Remove, as Automake says it's obsolescent.
12327 Contents migrated into AM_CPPFLAGS as described above.
12328 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
12329
123302004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12331
12332 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
12333 (yyreportSyntaxError): Handle case where lookahead token is
12334 YYEMPTY.
12335
be16239b
PH
123362004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12337
12338 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
12339 resulting parsers are compilable with C++.
12340
5fa90832
PE
123412003-12-23 Paul Eggert <eggert@twinsun.com>
12342
12343 * config/depcomp, config/install-sh: Sync with Automake 1.8.
12344 * src/output.c (output_skeleton): Rename local var.
12345 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
12346 Bison tokens, as this runs afoul of the 2003-10-07 change that
12347 disallowed NUL bytes in character constants or string literals.
12348
12349 * tests/local.at: Require Autoconf 2.59's Autotest.
12350 * tests/testsuite.at: Don't include local.at, since we now assume
12351 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
12352 including it.
12353 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
12354 multiple inclusion warnings.
dd0e0635 12355
b165c324
AD
123562003-12-02 Akim Demaille <akim@epita.fr>
12357
12358 * doc/bison.texinfo (How Can I Reset the Parser): More about start
12359 conditions.
12360 From Bruno Haible.
12361
26e06a21
ADL
123622003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
12363
12364 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
12365
92ac3705
PE
123662003-10-07 Paul Eggert <eggert@twinsun.com>
12367
6a5ecb38
PE
12368 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
12369 if testsuite doesn't exist.
12370
92ac3705
PE
12371 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
12372 literals, unfortunately.
12373 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
12374 Complain about NUL bytes in character constants or string literals.
12375
91d2c560
PE
123762003-10-05 Paul Eggert <eggert@twinsun.com>
12377
12378 * NEWS: Don't document %no-default-prec, as it's still
12379 too experimental.
12380 * doc/bison.texinfo: Document %no-default-prec only if
12381 the defaultprec flag is set. Normally it's not.
12382
0cc3da3a
PE
123832003-10-04 Paul Eggert <eggert@twinsun.com>
12384
12385 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
12386 non-modifiable lvalue, instead of a modifiable one.
12387 * doc/bison.texinfo (Actions): Document that $$ can
12388 be assigned to. Do not claim that $$ and $N are
12389 array element references: user code should not rely on this.
12390
22fccf95
PE
123912003-10-01 Paul Eggert <eggert@twinsun.com>
12392
12393 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
12394 (grammar_declaration): Use it.
12395 * src/scan-gram.l: New token %no-default-prec.
12396 * tests/conflicts.at: Revamp tests to use %no-default-prec.
12397 * NEWS, doc/bison.texinfo: Document the above.
12398
fc8f2965
AD
123992003-10-01 Akim Demaille <akim@epita.fr>
12400
12401 VCG no longer supports long_straight_phase.
12402
12403 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
12404 * src/print_graph.c (print_graph): Adjust.
12405
39a06c25
PE
124062003-09-30 Frank Heckenbach <frank@g-n-u.de>
12407 and Paul Eggert <eggert@twinsun.com>
12408
12409 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
12410 Table of Symbols): Document %default-prec.
12411 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
12412 (grammar_declaration): Set default_prec on %default-prec.
12413 * src/scan-gram.l (%default-prec): New token.
12414 * src/reader.h (default_prec): New flag.
12415 * src/reader.c: Likewise.
12416 (packgram): Handle it.
12417 * tests/conflicts.at (%default-prec without %prec,
12418 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 12419
39a06c25
PE
124202003-09-30 Paul Eggert <eggert@twinsun.com>
12421
12422 * tests/testsuite.at: Include local.at, not input.at, fixing
12423 a typo in the 2003-08-25 patch.
12424
62b6aef9
AD
124252003-08-27 Akim Demaille <akim@epita.fr>
12426
12427 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
12428 GCC warnings.
12429
89e1cc61
AD
124302003-08-26 Akim Demaille <akim@epita.fr>
12431
12432 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
12433 "<\#" to avoid magic from Gnus when posting parts of this script.
12434
a08460b0
AD
124352003-08-26 Akim Demaille <akim@epita.fr>
12436
12437 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
12438 (Parser::parse): here.
12439 Adjust: nerrs and errstatus is now replaced by...
12440 (Parser::nerrs_, Parser::errstatus_): New.
12441
603f1cfd
AD
124422003-08-25 Akim Demaille <akim@epita.fr>
12443
12444 * config/announce-gen, Makefile.cfg: New.
12445 * Makefile.am: Adjust.
12446 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
12447 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
12448
cd3684cf
AD
124492003-08-25 Akim Demaille <akim@epita.fr>
12450
12451 When reducing initial empty rules, Bison parser read an initial
12452 location that is not defined. This results in garbage, and that
12453 affects Bison's own parser. Therefore we need (i) to extend Bison
12454 to support a means to initialize this location, and (ii) to use
12455 this CVS Bison to fix CVS Bison's parser.
12456
12457 * src/reader.h, reader.c (epilogue_augment): Remove, replace
12458 with...
12459 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
12460 * src/parse-gram.y: Adjust.
12461 (%initial-action): New.
12462 (%error-verbose): Since we require CVS Bison, there is no reason
12463 not to use it.
12464 * src/scan-gram.l: Adjust.
12465 * src/Makefile.am (YACC): New, to make sure we use our own parser.
12466 * data/yacc.c (yyparse): Use b4_initial_action.
12467
4e03e201
AD
124682003-08-25 Akim Demaille <akim@epita.fr>
12469
12470 * doc/bison.texinfo: Don't promote stdout for error messages.
12471
8c182d05
AD
124722003-08-25 Akim Demaille <akim@epita.fr>
12473
12474 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
12475 From Alexandre Duret-Lutz.
12476
6a60c4cf
PE
124772003-08-25 Akim Demaille <akim@epita.fr>
12478
12479 Version 1.875c.
12480
25f66e1a
AD
124812003-08-25 Akim Demaille <akim@epita.fr>
12482
12483 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
12484 Use them.
12485
5348bfbe
AD
124862003-08-25 Akim Demaille <akim@epita.fr>
12487
12488 * data/lalr1.cc (Parser::reduce_print_): New.
12489 Use it.
12490
47301314
AD
124912003-08-25 Akim Demaille <akim@epita.fr>
12492
12493 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
12494 error recovery loops. This patch is based on
161a71f3 12495 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
12496 Also, augment the similarity between lalr1.cc and yacc.c.
12497 Note: the locations of error recovery rules are not correct yet.
12498
12499 * data/lalr1.cc: Comment changes to augment the similarity between
12500 lalr1.cc and yacc.c.
12501 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
12502 (yyerrlab1): Remove, but where it used to be (now the bottom part of
12503 yyerrlab), when hitting EOF, pop the whole stack here instead of
12504 merely falling thru the default error handling mechanism.
12505 (yyerrorlab): New label, with the old contents of YYERROR,
12506 plus the following change: pop the stack of rhs corresponding
12507 to the production that invoked YYERROR. That is how Yacc
12508 behaves (required by POSIX).
12509 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
12510 fail.
12511
1f7a61ff
AD
125122003-08-25 Akim Demaille <akim@epita.fr>
12513
12514 Tune local.at so that people can "autom4te -l autotest calc.at -o
12515 calc" for instance, to extract a sub test suite.
12516
12517 * tests/testsuite.at: Move the initialization, Autotest version
12518 requirement, and AT_TESTED invocation into...
12519 * tests/local.at: here.
12520 * tests/testsuite.at: Include it for compatibility with Autoconf
12521 2.57.
12522 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
12523 be ignore.
12524
327b5b56
PE
125252003-08-04 Paul Eggert <eggert@twinsun.com>
12526
12527 Rework code slightly to avoid gcc -Wtraditional warnings.
12528 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
12529 The returned value is now stored in *YY0. All callers changed.
12530 * src/output.c (merge_output): Adjust to the above change.
12531
0051e3ed
PE
125322003-07-26 Paul Eggert <eggert@twinsun.com>
12533
12534 * data/glr.c (YYASSERT): New macro.
12535 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
12536 yyresolveStates, yyprocessOneStack):
12537 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
12538 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 12539
137437c6
PE
125402003-07-25 Paul Eggert <eggert@twinsun.com>
12541
5b620e06
PE
12542 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
12543 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 12544 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
12545 by Frank Heckenbach, though I have omitted the structure-initialization
12546 part of his glr-knr.diff patch since I recall that the Portable
12547 C Compiler didn't require that change.
12548
137437c6
PE
12549 Let the user specify how to allocate and free memory.
12550 Derived from a suggestion by Frank Heckenbach in
161a71f3 12551 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
12552 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
12553 All uses of free, malloc, realloc changed to use these macros,
12554 and unnecessary casts removed.
12555 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
12556
ddb85ca5
PE
125572003-07-06 Matthias Mann <MatthiasMann@gmx.de>
12558
12559 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
12560 use s.empty() rather than s == "" to test for empty string; see
161a71f3 12561 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
12562 (trivial change)
12563
39910e09
AD
125642003-06-25 Akim Demaille <akim@epita.fr>
12565
12566 * config/depcomp, config/install-sh: Update from masters.
12567
0ae99356
PE
125682003-06-20 Paul Eggert <eggert@twinsun.com>
12569
12570 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
12571 and return properly parenthesized result.
12572 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
12573 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
12574 Remove unnecessary parentheses from uses.
12575 * doc/bison.texinfo (Location Default Action): Describe the
12576 conventions for parentheses.
12577
cd05d13c
PE
125782003-06-19 Paul Eggert <eggert@twinsun.com>
12579
81fd08ca
PE
12580 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
12581 yyreportTree): Do not assume that size_t is the same width as int,
12582 when printing sizes. Print sizes using an unsigned format.
12583 Problem reported by Frank Heckenbach in
161a71f3 12584 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 12585
cd05d13c
PE
12586 Port to Forte Developer 7 C compiler.
12587 * data/glr.c (struct YYLTYPE): If locations are not being used,
12588 declare a single dummy member, as empty structs do not conform
12589 to the C standard.
12590 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
12591 the Forte Developer 7 C compiler complains that end-of-loop
12592 code is not reached.
12593
4dcf140b
PE
125942003-06-17 Paul Eggert <eggert@twinsun.com>
12595
12596 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
12597 avoid warnings from picky compilers about redefinition of PARAMS.
12598
8dd76bee
PE
125992003-06-17 Paul Eggert <eggert@twinsun.com>
12600
12601 Version 1.875b.
12602
12603 * NEWS: Document 1.875b.
12604
12605 * lib/bbitset.h: Do not include config.h; that's the includer's job.
12606 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
12607 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
12608 Don't use 'index' in comments, as it's a builtin fn on some hosts.
12609 * lib/bitset_stats.c: Include gettext.h unconditionally, as
12610 per recent gettext manual's suggestion.
12611 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
12612 Use prototypes, not old-style definitions.
12613 * lib/lbitset.c (lbitset_unused_clear): Likewise.
12614 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
12615 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
12616 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
12617 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
12618 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
12619 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
12620 vbitset_or_and_cmp, vbitset_copy): Likewise.
12621
12622 * lib/libiberty.h: Do not include config.h; that's the includer's job.
12623 Do not include <stdlib.h>.
12624 (PARAMS): Define unconditionally for C89.
12625 (ATTRIBUTE_NORETURN): Remove.
12626 (ATTRIBUTE_UNUSED): Define unconditionally.
12627
12628 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 12629 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
12630 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
12631 * lib/vbitset.c, lib/vbitset.h: New files.
12632 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
12633 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
12634 from libbitset.
12635
12636 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
12637 `How Can I Reset @code{yyparse}', since texinfo does not allow
12638 arbitrary @ in node names.
12639
12640 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
12641 shouldn't be needed according to the gettext 0.12.1 documentation
12642 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 12643 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 12644 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 12645 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 12646
8dd76bee
PE
12647 * lib/.cvsignore: Add stdbool.h.
12648 * m4/.cvsignore: Add nls.m4, po.m4.
12649
12650 Upgrade to CVS gnulib.
12651 * stdbool_.h: File renamed from stdbool.h.in.
12652 * configure.ac (AM_STDBOOL_H): Invoke this instead of
12653 AC_HEADER_STDBOOL.
12654 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
12655 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
12656 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
12657 (MOSTLYCLEANFILES): New var.
12658 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
12659 (stdbool.h): New rule.
12660 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
12661 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
12662 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
12663 m4/quote.m4: Upgrade to today's gnulib.
12664
12665 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
12666 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
12667 the tests right now.
12668 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
12669 yyerror are declared before use; C99 requires this.
12670
25005f6a
PH
126712003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12672
12673 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
12674 first.
12675 (yyrecoverSyntaxError): Correct the logic for setting and testing
12676 yyerrState.
12677 Correct comment on handling EOF.
12678 Allow states with only a default reduction, rather than failing
8dd76bee 12679 (I can't quite reconstruct why these were not allowed before).
25005f6a 12680
137437c6 12681 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 12682 buffer overruns, corrupting state.
8dd76bee
PE
12683
12684 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
12685 definition.
12686 * src/reader.h (max_left_semantic_context): New variable declaration.
12687 * src/scan-gram.l (max_left_semantic_context): Define.
12688 (handle_action_dollar): Update max_left_semantic_context.
12689 * data/glr.c (YYMAXLEFT): New definition.
12690 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
12691 (yyresolveAction): Ditto.
12692
12693 Fixes to problems with location handling in GLR parsers reported by
12694 Frank Heckenbach (2003/06/05).
12695
12696 * data/glr.c (YYLTYPE): Make trivial if locations not used.
12697 (YYRHSLOC): Add parentheses, and define only if locations used.
12698 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
12699 locations not used.
12700 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
12701 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 12702
25005f6a
PH
12703 * tests/cxx-type.at: Exercise location information; update tests
12704 to differentiate output with and without locations.
8dd76bee 12705 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
12706 because default YYLTYPE not yet defined.
12707 Change semantic actions to compute strings, rather than printing
12708 them directly (to test proper passing of semantics values). Change
12709 output to prefix notation and update test data and expected results.
12710 (yylex): Track locations.
12711 (stmtMerge): Return value rather than printing, and include arguments
12712 in value.
8dd76bee 12713
711f40b7
PE
127142003-06-03 Paul Eggert <eggert@twinsun.com>
12715
12716 Avoid warnings generated by GCC 2.95.4 when Bison is
12717 configured with --enable-gcc-warnings.
12718 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
12719 yy::]b4_parser_class_name[::translate_,
12720 yy::Stack::operator[] (unsigned),
12721 yy::Stack::operator[] (unsigned) const,
12722 yy::Slice::operator[] (unsigned),
12723 yy::Slice::operator[] (unsigned) const):
12724 Rename local vars to avoid warnings.
12725 * tests/glr-regression.at (Improper handling of embedded actions
12726 and $-N in GLR parsers): Remove unused local variable from yylex.
12727 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
12728 (void) as arg when not pure, since we now assume C89 when building
12729 Bison. Pacify GCC by using parameter.
12730
ac695f7d
PE
127312003-06-02 Paul Eggert <eggert@twinsun.com>
12732
12733 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
12734 yy::Location::lines, yy::Location::columns): Rename arguments
12735 to avoid shadowing; this removes a warning generated by GCC 3.3.
12736
26ec81e0
PE
127372003-06-01 Paul Eggert <eggert@twinsun.com>
12738
12739 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
12740 to g++, as GCC 3.3 complains if you do it.
12741 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
12742 everything that WARNING_CFLAGS has, except omit warnings
12743 not suitable for C++.
12744 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
12745 * tests/atlocal.in (CXXFLAGS): New var.
12746 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
12747
12748 Fix a GLR parser bug I reported in February; see
161a71f3 12749 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
12750 The problem was that GLR parsers did not conform to the C standard,
12751 because actions like { $1 = $2 + $3; } expanded to expressions
12752 that invoked YYFILL in separate subexpressions, and YYFILL assigned
12753 to a local variable. The C standard says that expressions
12754 like (var = f ()) + (var = f ()) have undefined behavior.
12755 Another problem was that GCC sometimes issues warnings that
12756 yyfill and its parameters are unused.
12757
12758 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
12759 as possibly unused.
12760 (yyfill): New function.
12761 (YYFILL): Use it.
12762 (yyuserAction): Change type of yynormal to bool, so that it matches
12763 the new yyfill signature. Mark it as possibly unused.
12764
12765
12766 Follow up on a bug I reported in February, where a Bison-generated
12767 parser can loop. Provide a test case and a fix for yacc.c. I
12768 don't have a fix for lalr1.cc or for glr.c, unfortunately.
12769 The original bug report is in:
161a71f3 12770 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
12771
12772 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
12773 macro's size was becoming unwieldy.
12774 (yyerrlab): Do not discard an empty lookahead symbol, as this
12775 might destroy garbage.
12776 (yyerrorlab): New label, with the old contents of YYERROR,
12777 plus the following change: pop the stack of rhs corresponding
12778 to the production that invoked YYERROR. That is how Yacc
12779 behaves, and POSIX requires this behavior.
12780 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
12781 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
12782 Define 'alarm' to do nothing if unistd.h is not available.
12783 Add a new rule "exp: '-' error;" to test the above change to
12784 data/yacc.c. Use 'alarm' to abort any test taking longer than
12785 10 seconds, as it's probably looping.
12786 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
12787 Also, the new yacc.c generates two fewer diagnostics for an
12788 existing test.
12789
d0829076
PE
127902003-05-24 Paul Eggert <eggert@twinsun.com>
12791
c6ae27df
PE
12792 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
12793 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
12794 This fixes a problem reported by John Bowman when the Compaq/HP
12795 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
12796 -ansi -Wall -gall).
12797 * data/yacc.c (union yyalloc): Likewise.
12798 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 12799
d0829076
PE
12800 Switch from 'int' to 'bool' where that makes sense.
12801
12802 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
12803 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
12804 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
12805 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
12806 Return or accept bool, not int. All callers changed.
12807 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
12808 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
12809 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
12810 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
12811 bitset_or_and_cmp_): Likewise.
12812 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
12813 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
12814 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
12815 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
12816 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
12817 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
12818 bitset_stats_or_and_cmp): Likewise.
12819 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
12820 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
12821 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
12822 ebitset_xor_cmp): Likewise.
12823 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
12824 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
12825 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
12826 lbitset_xor_cmp): Likewise.
12827 * lib/bbitset.h: Include <stdbool.h>.
12828 (struct bitset_vtable): The following members now return bool, not
12829 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
12830 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
12831 or_and_cmp).
12832 * src/conflicts.c (count_rr_conflicts): Likewise.
12833 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
12834 All uses changed.
12835 * lib/ebitset.c (ebitset_obstack_init): Likewise.
12836 * lib/lbitset.c (lbitset_obstack_init): Likewise.
12837 * src/getargs.c (debug_flag, defines_flag, locations_flag,
12838 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
12839 graph_flag): Likewise.
12840 * src/getargs.h (debug_flag, defines_flag, locations_flag,
12841 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
12842 graph_flag): Likewise.
12843 * src/output.c (error_verbose): Likewise.
12844 * src/output.h (error_verbose): Likewise.
12845 * src/reader.c (start_flag, typed): Likewise.
12846 * src/reader.h (typed): Likewise.
12847 * src/getargs.c (LOCATIONS_OPTION): New constant.
12848 (long_options, getargs): Use it.
12849 * src/lalr.c (build_relations): Use bool, not int.
12850 * src/nullable.c (nullable_compute): Likewise.
12851 * src/print.c (print_reductions): Likewise.
12852 * src/tables.c (action_row, pack_vector): Likewise.
12853 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
12854 * src/output.c (prepare): Use it.
12855 * src/output.c (token_definitions_output,
12856 symbol_destructors_output, symbol_destructors_output): Use string,
12857 not boolean integer, to keep track of whether to output separator.
12858 * src/print_graph.c (print_core): Likewise.
12859 * src/state.c (state_rule_lookaheads_print): Likewise.
12860
12861 * config/install-sh: Sync from automake 1.7.5.
12862
6b2584b7
PE
128632003-05-14 Paul Eggert <eggert@twinsun.com>
12864
12865 * src/parse-gram.y (rules_or_grammar_declaration): Require a
12866 semicolon after a grammar declaration, in the interest of possible
12867 future changes to the Bison input language.
12868 Do not allow a stray semicolon at the start of the grammar.
12869 (rhses.1): Allow one or more semicolons after any rule, including
12870 just before "|" as required by POSIX.
12871 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
12872 grammar.
12873
caf37a36
ADL
128742003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
12875
12876 %parse-param support for lalr1.cc.
12877
12878 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
12879 b4_cc_constructor_calls, b4_cc_constructor_call,
12880 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
12881 definitions.
12882 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
12883 parse-param arguments.
12884 (yy::b4_parser_class_name): Declare instance variables to
12885 hold parse-param arguments.
12886 * tests/calc.at: s/value/semantic_value/ because value clashes
12887 with a member of yy::b4_parser_class_name. Adjust C++ code
12888 to handle %parse-param. Enable %parse-param test in C++.
12889
3ab37077
PE
128902003-05-12 Paul Eggert <eggert@twinsun.com>
12891
12892 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
12893 English a bit. Fix fclose typo. Change "const char" to "char
12894 const", and use ANSI C rather than K&R for "main". Suggest
12895 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
12896 and suggest yy_switch_to_buffer.
12897
128982003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
12899
12900 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
12901 C89. This avoids a diagnostic on compilers that define __STDC__
12902 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 12903 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 12904
e743727f
PE
129052003-05-03 Paul Eggert <eggert@twinsun.com>
12906
12907 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
12908 Do not overrun array bounds.
12909 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 12910 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 12911
916708d5
AD
129122003-04-29 Akim Demaille <akim@epita.fr>
12913
12914 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
12915 * src/getargs.c, src/getargs.h: here, as bool, not int.
12916 (nondeterministic_parser): New.
12917 * src/parse-gram.y, src/scan-gram.l: Support
12918 %nondeterministic-parser.
12919 * src/output.c (prepare): Use nondeterministic_parser instead
12920 of glr_parser where appropriate.
12921 * src/tables.c (conflict_row, action_row, save_row)
12922 (token_actions, token_actions, pack_vector): Ditto.
12923
a06ea4aa
AD
129242003-04-29 Akim Demaille <akim@epita.fr>
12925
12926 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
12927
211074ca
AD
129282003-04-29 Akim Demaille <akim@epita.fr>
12929
12930 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
12931 with %pure-parser and %locations to exercise the patch from Yakov
12932 Markovitch below.
12933
6175ffe3
PE
129342003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
12935
12936 * data/yacc.c: (b4_lex_param): Corrected for the case where
12937 %lex-param is provided and %pure-parser isn't.
12938
b1e95857
PE
129392003-04-27 Paul Eggert <eggert@twinsun.com>
12940
12941 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 12942 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
12943 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
12944 if it is not defined.
12945 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
12946
acda9df6
PE
129472003-04-26 Paul Eggert <eggert@twinsun.com>
12948
3470c57b
PE
12949 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
12950 Declare to be of type suitable for the ninf value itself, not of
12951 type suitable for the corresponding table, since the latter might
12952 be unsigned but the ninf value might be negative. This fixes a
12953 bug reported by Alexandre Duret-Lutz in
161a71f3 12954 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 12955
acda9df6
PE
12956 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
12957 invokes it. We shouldn't invoke it twice because it will attempt
12958 to put error.o in the archive twice. This fixes a glitch reported
12959 by Martin Mokrejs in
161a71f3 12960 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 12961
b5250f26
PE
129622003-04-21 Paul Eggert <eggert@twinsun.com>
12963
12964 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
12965 to gnulib.
12966
089ac0f1
PE
129672003-04-21 Yakov Markovitch <Markovitch@iso.ru>
12968
12969 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
12970 Fix obvious typo that results in uncompilable GLR parsers
12971 when both %pure-parser and %locations are used. (trivial change)
12972
5ededac6
PE
129732003-04-17 Paul Eggert <eggert@twinsun.com>
12974
1b8f2fff
PE
12975 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
12976 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
12977 Do not insert the expected token via unput, as this runs afoul
12978 of a POSIX-compatibility bug in flex 2.5.31.
12979 All uses changed to BEGIN the parent state,
12980 since we no longer insert the expected token via unput.
12981 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
12982 that is no longer emitted after the above change.
12983
5ededac6
PE
12984 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
12985 the first one. This change is from Paul Hilfinger, and it fixes
12986 regression reported by Werner Lemberg in
161a71f3 12987 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
12988
12989 (resolve_sr_conflict): Don't invoke state_errs_set
12990 unless one or more tokens have been explicitly made errors.
12991 Otherwise, the above change causes Bison to abort.
12992
12993 * tests/existing.at (GNU pic Grammar): New test case, taken from
12994 Lemberg's email.
12995
b8be9132
AD
129962003-03-31 Akim Demaille <akim@epita.fr>
12997
12998 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
12999
d423d460
AD
130002003-03-31 Akim Demaille <akim@epita.fr>
13001
13002 * src/output.c (prepare_symbols): Avoid trailing spaces in the
13003 output.
13004
c7e441b4
AD
130052003-03-31 Akim Demaille <akim@epita.fr>
13006
13007 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
13008 From Paul Hilfinger.
13009
231897ad
AD
130102003-03-29 Akim Demaille <akim@epita.fr>
13011
13012 * m4/error.m4: Do not put under dynamic conditions some code which
13013 expansion is under static control.
13014
5b066063
AD
130152003-03-29 Akim Demaille <akim@epita.fr>
13016
13017 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
13018
22a74fec
AD
130192003-03-29 Akim Demaille <akim@epita.fr>
13020
13021 * doc/bison.texinfo (Strings are Destroyed): New.
13022
0eee27e7
PE
130232003-03-13 Paul Eggert <eggert@twinsun.com>
13024
13025 * .cvsignore: Add configure.lineno.
13026 * src/.cvsignore: Add yacc.
13027 * tests/.cvsignore: Add testsuite.log.
13028 * doc/fdl.texi: Sync with latest FSF version.
13029
f61aad93
PE
130302003-03-12 Paul Eggert <eggert@twinsun.com>
13031
537636c7
PE
13032 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
13033 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
13034 cursor, instead of leaving it undefined. This fixes a bug
13035 reported by Tim Van Holder in
161a71f3 13036 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
13037 * tests/input.at (Torturing the Scanner): Test the scanner on
13038 an empty input file, which was Tim Van Holder's test case.
13039
13040 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
13041 <sys/resource.h> can be included, include sys/time.h and
13042 sys/times.h first, if available. This works around the SunOS
13043 4.1.4 porting bug reported by Bruce Becker in
161a71f3 13044 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
13045
13046 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
13047 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
13048 AC_HEADER_SYS_WAIT.
13049
f61aad93
PE
13050 Merge changes from gnulib. This was prompted because the CVS
13051 snapshot didn't build on Solaris 7 due to strnlen problems.
13052
13053 These changes need to be merged back into gnulib:
13054 * lib/hash.c: Include <stdbool.h> unconditionally.
13055 * m4/onceonly.m4 (m4_quote): New macro.
13056 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
13057 Quote AC_FOREACH variable-expansions properly.
13058 The 2003-01-03 obstack.h change also needs merging.
13059 {end of changes requiring merging}
5b066063 13060
f61aad93
PE
13061 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
13062 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
13063 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
13064 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
13065 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
13066 New files, imported from gnulib.
13067 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
13068 above.
13069
13070 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
13071 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
13072 gnulib sources.
13073
13074 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
13075 Add.
13076 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
13077 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
13078 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
13079 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
13080 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
13081 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
13082 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
13083 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
13084 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
13085 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
13086 (jm_PREREQ_ARGMATCH): Remove.
13087 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
13088 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
13089
13090 * src/system.h: Include <stdbool.h> unconditionally.
13091
13092 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
13093 assuming at least C89 in the bitset code for some time now.
13094
d2ffe116
AD
130952003-03-03 Akim Demaille <akim@epita.fr>
13096
13097 * ro.po: New.
13098
052826fd
AD
130992003-03-02 Akim Demaille <akim@epita.fr>
13100
13101 * doc/bison.texinfo (Table of Symbols): Reactivate the
13102 documentation for %lex-param, and %parse-param.
13103
c4749565
AD
131042003-03-02 Akim Demaille <akim@epita.fr>
13105
13106 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
13107 generate verbose error messages.
13108 Use the number of tokens as an upper bound in yytname, as it
13109 cannot be a non terminal.
13110
d5286af1
AD
131112003-03-02 Akim Demaille <akim@epita.fr>
13112
13113 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
13114 message.
13115
22e304a6
AD
131162003-03-02 Akim Demaille <akim@epita.fr>
13117
22e304a6
AD
13118 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
13119 Use them to exercise yycheck overrun.
13120 Based on Andrew Suffield's grammar.
13121
67a25fed
AD
131222003-03-02 Akim Demaille <akim@epita.fr>
13123
13124 Create tests/local.at for Bison generic testing macros.
13125
13126 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
13127 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
13128 This new file.
13129 * tests/calc.at (AT_CHECK_CALC): Adjust.
13130 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
13131 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
13132 * tests/local.at: here.
13133 (AT_COMPILE_CXX): Tags the tests using it as c++.
13134 Ignore the test if CXX is not functional.
13135
9c2b381f
PE
131362003-03-01 Paul Eggert <eggert@twinsun.com>
13137
13138 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
13139 not loc->end, since loc->end might contain garbage and this leads
13140 to undefined behavior on some platforms.
13141 (id_loc, token_start): Use (IF_LINTed) initial values that do not
13142 depend on *loc, so that the reader doesn't give the the false
13143 impression that *loc is initialized.
13144 (<INITIAL>"%%"): Do not bother setting code_start, since its value
13145 does not survive the return.
13146
0433ba88
AD
131472003-03-01 Akim Demaille <akim@epita.fr>
13148
13149 * src/scan-gram.l (code_start): Always initialize it when entering
13150 into yylex, as SC_EPILOGUE is activated *before* the corresponding
13151 yylex invocation. An alternative would be making it static, but
13152 then it starts with the second %%'s beginning, instead of its end.
13153
b305ea69
PE
131542003-02-28 Paul Eggert <eggert@twinsun.com>
13155
13156 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
13157 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 13158 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 13159
c3d25e01
PE
131602003-02-26 Paul Eggert <eggert@twinsun.com>
13161
13162 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
13163 Remove Sequent/Pyramid discussion (nobody uses them any more).
13164 Merge VMS and MS-DOS discussion; these ports may well be dead
13165 but let's keep mentioning them for now. Put <> around email
13166 addresses. Add copyright notice.
13167
c267ffbc
PE
131682003-02-24 Paul Eggert <eggert@twinsun.com>
13169
13170 * data/glr.c (yy_reduce_print): yylineno -> yylno,
13171 to avoid collision with flex use of yylineno.
13172 Problem reported by Bruce Lilly in
161a71f3 13173 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
13174 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
13175 * data/yacc.c (yy_reduce_print): Likewise.
13176
13177 * config/depcomp: Sync with Automake 1.7.3.
13178
f939fc12
AD
131792003-02-21 Akim Demaille <akim@epita.fr>
13180
13181 * data/lalr1.cc: Use temporary variables instead of casts to
13182 change integer types.
13183 Suggested by Paul Eggert.
13184
95923bd6
AD
131852003-02-21 Akim Demaille <akim@epita.fr>
13186
13187 * doc/bison.texinfo: Use "location" consistently to refer to @n,
13188 to avoid confusions with lalr1.cc's notion of Position.
13189 Suggested by Paul Eggert.
13190
2cdc240e
AD
131912003-02-20 Akim Demaille <akim@epita.fr>
13192
13193 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
13194 before initial_columns.
13195 (location.hh): Use consistent variable names when defining the
13196 operator<<.
13197 Use "last" so that we subtract from Positions, not from unsigned.
13198
5d003116
AD
131992003-02-20 Akim Demaille <akim@epita.fr>
13200
13201 * data/lalr1.cc (position.hh): New subfile, including the extended
13202 and Doxygen'ed documentation of class Position.
13203 (location.hh): Use it.
13204 Document a` la Doxygen.
ba1ecc07 13205 With the help of Benoit Perrot.
5d003116 13206
d02b25f9
AD
132072003-02-20 Akim Demaille <akim@epita.fr>
13208
13209 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
13210 AT_YACC_IF.
13211 Redefine AT_YYERROR_SEES_LOC_IF using it.
13212 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
13213 not defined.
13214 Don't use the location in yy::Parser::error_ and
13215 yy::Parser::print_ when not %locations.
13216 Activate more lalr1.cc tests.
13217
0d1c3a04
AD
132182003-02-19 Akim Demaille <akim@epita.fr>
13219
13220 * data/lalr1.cc: When displaying a line number, be sure to make it
13221 an int.
13222
60a777aa
AD
132232003-02-19 Akim Demaille <akim@epita.fr>
13224
13225 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
13226 Remove, useless.
13227 (YYABORT, YYACCEPT, YYERROR): New.
13228 * tests/calc.at: Renable the lalr1.cc test.
13229
0b86fc41
AD
132302003-02-19 Akim Demaille <akim@epita.fr>
13231
13232 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
13233 error recovery, mixing with/without pops and discarding of the
13234 lookahead.
13235 Exercise YYERROR.
13236 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
13237
da99a5dc
PE
132382003-02-17 Paul Eggert <eggert@twinsun.com>
13239
13240 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
13241 * tests/testsuite.at (AT_COMPILE): Use them.
13242 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 13243 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 13244
93b8c255
PE
132452003-02-12 Paul Eggert <eggert@twinsun.com>
13246
13247 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
13248 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 13249 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
13250 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
13251 Check for malloc failure, for consistency with yacc.c.
13252 (yytname_size): Remove, for consistency with yacc.c.
13253
13254 The bug still remains in data/lalr1.cc, as I didn't have time
13255 to fix it there.
13256
7548fed2
AD
132572003-02-06 Akim Demaille <akim@epita.fr>
13258
13259 * configure.ac (GXX): Rename as...
13260 (CXX): this, to keep the original Autoconf semantics.
13261 Require 2.57.
13262 * data/lalr1.cc: Fix b4_copyright invocations.
13263 If YYDEBUG is not defined, don't depend upon name_ being defined.
13264 (location.hh): Include string and iostream.
13265 (Position::filename): New member.
13266 (Position::Position ()): New.
13267 (operator<< (Position)): New.
13268 (operator- (Position, int)): New.
13269 (Location::first, Location::last): Rename as...
13270 (Location::begin, Location::end): these, to mock the conventional
13271 iterator names.
13272 (operator<< (Location)): New.
13273 * tests/atlocal.in (CXX): New.
13274 * tests/testsuite.at (AT_COMPILE_CXX): New.
13275 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
13276 locations in a more synthetic way.
13277 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
13278 lalr1.cc is used.
13279 Adjust the C locations to match those from Emacs: first column is
13280 column 0.
13281 Change all the expected results.
13282 Conform to the GCS: simplify the locations when applicable.
13283 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
13284 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
13285 these CPP macros with the m4 macros new defined by...
13286 (AT_CHECK_PUSHDEFS): this, i.e.:
13287 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 13288 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
13289 New macros.
13290 (AT_CHECK_POPDEFS): Undefine them.
13291 (AT_CHECK_CALC_LALR1_CC): New.
13292 Use it for the first lalr1.cc test.
13293
43a176ef
AD
132942003-02-04 Akim Demaille <akim@epita.fr>
13295
13296 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
13297 Location as is defined.
13298
fc049e9c
AD
132992003-02-04 Akim Demaille <akim@epita.fr>
13300
13301 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
13302 name_ being defined.
13303
a737b216
PE
133042003-02-03 Paul Eggert <eggert@twinsun.com>
13305
13306 * src/gram.h (start_symbol): Remove unused decl.
13307
13308 Use more-consistent naming conventions for local vars.
13309
13310 * src/derives.c (derives_compute): Change type of local var from
13311 int to rule_number.
13312 * src/gram.c (grammar_rules_partial_print): Likewise.
13313 * src/print.c (print_core): Likewise.
13314 * src/reduce.c (reduce_grammar_tables): Likewise.
13315
13316 * src/gram.c (grammar_dump): Change name of item_number *
13317 local var from r to rp.
13318 * src/nullable.c (nullable_compute): Likewise.
13319
13320 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
13321
13322 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
13323 for symbol or symbol_number var.
13324 * src/reader.c (grammar_start_symbol_set): Likewise.
13325 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
13326 Likewise.
13327 * src/state.c (transitions_to): Likewise.
13328 * src/state.h: Likewise.
13329 * src/tables.c (symbol_number_to_vector_number): Likewise.
13330
13331 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
13332 char * var.
13333
13334 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
13335 var.
13336
13337 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
13338 var.
13339
13340 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
13341 Use str, not s, for char * var. Use ch, not c, for character var.
13342 Use size for size var.
13343
13344 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
13345 char * var.
13346 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
13347 uniqstr var.
13348 * src/uniqstr.h: Likewise.
13349
13350 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
13351 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
13352 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
13353 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
13354 param to have same name as that of enum, so that we don't use
13355 "s" to stand for a non-state.
13356
68e93ad5
AD
133572003-02-02 Akim Demaille <akim@epita.fr>
13358
13359 * src/scan-skel.l: Scan more than one inert character per yylex
13360 invocation.
13361
92898986
PE
133622003-02-01 Paul Eggert <eggert@twinsun.com>
13363
13364 Version 1.875a.
13365
1d9d5d71
PE
13366 * po/LINGUAS: Add ms.
13367
0435d061
AD
133682003-01-30 Akim Demaille <akim@epita.fr>
13369
13370 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
13371
6029a57f
PH
133722003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13373
13374 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
13375 of $1.
0435d061
AD
13376
13377 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 13378 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 13379 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 13380
6029a57f
PH
13381 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
13382 (b4_rhs_location): Ditto.
0435d061 13383 (yyfill): New function to copy from stack tree into array
6029a57f 13384 incrementally.
0435d061
AD
13385 (yyuserAction): Modify to allow incremental move of semantic values
13386 to rhs array when in GLR mode.
13387 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
13388 as needed.
13389 Remove dummy use of yystack, as there is now a guaranteed use.
13390 (yydoAction): Modify to allow incremental move of semantic values
13391 to rhs array when in GLR mode.
13392 (yyresolveAction): Ditto.
13393 (yyglrShiftDefer): Update comment.
0435d061 13394 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
13395 (yyglrReduce): Ditto.
13396 (yydoAction): Ditto
0435d061 13397
6029a57f
PH
13398 * tests/glr-regr1.at: Rename to ...
13399 * tests/glr-regression.at: Add new regression test for the problems
13400 described above (adapted from S. Eken).
13401 Update copyright notice.
13402 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
13403 * tests/Makefile.am: Ditto.
13404
6cee6297
PE
134052003-01-28 Paul Eggert <eggert@twinsun.com>
13406
13407 * data/lalr1.cc: Do not use @output_header_name@ unless
13408 b4_defines_flag is set. This fixes two bugs reported by
13409 Tim Van Holder in
161a71f3
PE
13410 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
13411 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 13412
b2a836b5
PE
134132003-01-21 Paul Eggert <eggert@twinsun.com>
13414
13415 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
13416 we don't need to worry about yyerrlab1 being reported as an
13417 "unused label" by non-GCC C compilers. The downside is that if
13418 locations are used then a couple of statements are duplicated each
13419 time YYERROR is invoked, but the upside is that the warnings
13420 should vanish.
13421 (yyerrlab1): Move code to YERROR.
13422 (yyerrlab2): Remove. Change uses back to yyerrlab1.
13423 This reverts some of the 2002-12-27 change.
13424
4196b931
PE
134252003-01-17 Paul Eggert <eggert@twinsun.com>
13426
13427 * src/output.c (symbol_printers_output): Fix typo that led
13428 to core dump. Problem reported by Antonio Rus in
161a71f3 13429 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 13430
3ae831b4
AD
134312003-01-13 Akim Demaille <akim@epita.fr>,
13432 Quoc Peyrot <chojin@lrde.epita.fr>,
13433 Robert Anisko <anisko_r@lrde.epita.fr>
13434
13435 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
13436 when the stacks contain one element, as the loop would otherwise
13437 free the last state, and then use the top state (the one we just
13438 popped). This means that the initial elements will not be freed
13439 explicitly, as is the case in yacc.c; it is not a problem, as
13440 these elements have fake values.
13441
e3aa65c5
PE
134422003-01-11 Paul Eggert <eggert@twinsun.com>
13443
13444 * NEWS: %expect-violations are now just warnings, reverting
13445 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
13446 bootstrapping problem reported by Matthias Klose; see
161a71f3 13447 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
13448 * src/conflicts.c (conflicts_print): Likewise.
13449 * tests/conflicts.at (%expect not enough, %expect too much,
13450 %expect with reduce conflicts): Likewise.
13451 * doc/bison.texinfo (Expect Decl): Document this. Also mention
13452 that the warning is enabled if the number of conflicts changes
13453 (not necessarily increases).
13454
13455 * src/getargs.c (version): Update copyright year.
13456
f0057011
AD
134572003-01-09 Akim Demaille <akim@epita.fr>
13458
13459 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
13460
1ee6d2a0
PE
134612003-01-08 Paul Eggert <eggert@twinsun.com>
13462
13463 * Makefile.maint (WGETFLAGS):
13464 New macro, containing "-C off" to disable proxy caches.
13465 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
13466 (rel-check): Use $(WGET) instead of wget.
13467
d4fd77c4
PE
134682003-01-06 Paul Eggert <eggert@twinsun.com>
13469
13470 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
13471 the GLR paper of Scott, Johnstone and Hussain.
13472
464c6927
PE
134732003-01-04 Paul Eggert <eggert@twinsun.com>
13474
d600ee67
PE
13475 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
13476 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
13477 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
13478 (EXTRA_LIBRARIES): New var, for liby.a.
13479 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
13480 (EXTRA_SCRIPTS): New var, for yacc.
13481
464c6927
PE
13482 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
13483 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
13484 Problem reported by Nelson H. F. Beebe.
13485
134862003-01-03 Paul Eggert <eggert@twinsun.com>
13487
13488 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
13489 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
13490 when compiling Bison 1.875's `bitset bset = obstack_alloc
13491 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
13492
13493 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
13494 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
13495 grow to a huge size with typical invocation.
d600ee67 13496
464c6927
PE
13497 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
13498 Use the pattern recommended by Autoconf 2.57, except also protect
13499 against double-definition.
13500 * src/system.h: Likewise.
13501 Portability issues reported by Nelson H. F. Beebe.
d600ee67 13502
464c6927
PE
13503 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
13504 All uses changed. Provide a definition in both C and C++.
13505 (yytrue, yyfalse): Define even if defined (__cplusplus).
13506
13507 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
13508 Reported by Nelson H. F. Beebe.
d600ee67 13509
464c6927
PE
13510 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
13511
0f42c7d5
PE
135122003-01-02 Paul Eggert <eggert@twinsun.com>
13513
13514 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
13515 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
13516 Bug reported by Nelson H. F. Beebe.
13517
dc546b0f
PE
135182003-01-01 Paul Eggert <eggert@twinsun.com>
13519
13520 * Version 1.875.
13521
2c09b6a7
PE
135222002-12-30 Paul Eggert <eggert@twinsun.com>
13523
13524 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
13525 Moved here from...
13526 (<INITIAL>","): Here. This causes stray "," to be treated
13527 more uniformly.
13528
dc546b0f 13529 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
13530 last brace in braced code when not in Yacc mode, for compatibility
13531 with Bison 1.35. This resurrects the 2001-12-15 patch to
13532 src/reader.c.
13533
13534 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
13535 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
13536
535c0f63
PE
135372002-12-28 Paul Eggert <eggert@twinsun.com>
13538
13539 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
13540 that of SYM's type. This fixes Debian bug 168069, reported by
13541 Thomas Olsson.
d600ee67 13542
963fcc17
PE
135432002-12-28 Paul Eggert <eggert@twinsun.com>
13544
13545 Version 1.75f.
13546
13547 Switch back to the Yacc style of conflict reports, undoing some
13548 of the 2002-07-30 change.
13549 * doc/bison.texinfo (Understanding): Use Yacc style for
13550 conflict reports. Also, use new way of locating rules.
13551 * src/conflicts.c (conflict_report):
13552 Renamed from conflict_report_yacc, removing the old
13553 'conflict_report'. Translate the entire conflict report at once,
13554 so that we don't assume that "," has the same interpretation in
13555 all languages.
13556 (conflicts_output): Use Yacc-style conflict report for each state,
13557 instead of our more-complicated style.
13558 (conflicts_print): Use Yacc-style conflict report, except print
13559 the input file name when not emulating Yacc.
13560 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
13561 Conflicted Reduction, %expect not enough, %expect too much,
13562 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
13563 * tests/existing.at (GNU Cim Grammar): Likewise.
13564 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
13565
13566 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
13567 fatal): Don't invoke fflush; it's not needed and it might even be
13568 harmful for stdout, as stdout might not be open.
13569 * src/reduce.c (reduce_print): Likewise.
13570
b1efe548
PE
135712002-12-27 Paul Eggert <eggert@twinsun.com>
13572
13573 Fix a bug where error locations were not being recorded correctly.
13574 This problem was originally reported by Paul Hilfinger in
161a71f3 13575 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
13576
13577 * data/yacc.c (yyparse): New local var yylerrsp, to record the
13578 top of the location stack's error locations.
13579 (yyerrlab): Set it. When discarding a token, push its location
13580 onto yylerrsp so that we don't lose track of the error's end.
13581 (yyerrlab1): Now is only the target of YYERROR, so that we can
13582 properly record the location of the action that failed. For GCC
13583 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
13584 GCC warning about yyerrlab1 being unused if YYERROR is unused.
13585 (yyerrlab2): New label, which yyerrlab now falls through to.
13586 Compute the error's location by applying YYLLOC_DEFAULT to
13587 the locations of all the symbols that went into the error.
13588 * doc/bison.texinfo (Location Default Action): Mention that
13589 YYLLOC_DEFAULT is also invoked for syntax errors.
13590 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
13591 Error locations include the locations of all the tokens that were
13592 discarded, not just the last token.
d600ee67 13593
983c5c2c
PE
135942002-12-26 Paul Eggert <eggert@twinsun.com>
13595
b1efe548
PE
13596 * src/files.c: Include quote.h.
13597 (compute_output_file_names): Warn if we detect conflicting
13598 outputs to the same file. This should catch the misunderstanding
13599 exemplified by Debian Bug 165349, reported by Bruce Stephens..
13600
13601 * src/conflicts.c (conflicts_print): If the user specifies
13602 "%expect N", report an error if there are any reduce/reduce
13603 conflicts. This is what the manual says should happen.
13604 This fixes Debian bug 130890, reported by Anthony DeRobertis.
13605 * tests/conflicts.at (%expect with reduce conflicts): New test.
13606
983c5c2c
PE
13607 Don't use m4_include on relative file names, as it doesn't work as
13608 desired if there happens to be a file with that name under ".".
d600ee67 13609
983c5c2c
PE
13610 * m4sugar/version.m4: Remove; it was included but it wasn't used.
13611 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
13612 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
13613 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
13614 * src/output.c (output_skeleton): Use full path names when
13615 specifying a file to include; don't rely on include path, as
13616 it's unreliable when the working file contains a file with
13617 that name.
d600ee67 13618
983c5c2c
PE
136192002-12-25 Paul Eggert <eggert@twinsun.com>
13620
13621 Remove obsolete references to bison.simple and bison.hairy.
13622 Problem mentioned by Aubin Mahe in
161a71f3 13623 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
13624 * data/glr.c: Comment fix.
13625 * doc/bison.1: Remove references. Also, mention "yacc".
13626
13627 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
13628 with -g option.
13629
13630 * src/parse-gram.y (declaration): Use enum "report_states" rather
13631 than its numeric value 1.
13632
13633 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
13634 opening a new one. This fixes Debian bug 165349, reported by
13635 Bruce Stephens.
13636
23f2d9dc
PE
136372002-12-24 Paul Eggert <eggert@twinsun.com>
13638
13639 Version 1.75e.
13640
13641 * Makefile.maint (cvs-update): Don't assume that the shell
13642 supports $(...), as Solaris sh doesn't.
13643
13644 * src/parse-gram.y (lloc_default): Remove test for empty
13645 nonterminals at the end, since it didn't change the result.
13646
136472002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
13648
13649 If the user does not define YYSTYPE as a macro, Bison now declares it
13650 using typedef instead of defining it as a macro. POSIX requires this.
13651 For consistency, YYLTYPE is also declared instead of defined.
13652
13653 %union directives can now have a tag before the `{', e.g., the
13654 directive `%union foo {...}' now generates the C code
13655 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
13656 The default union tag is `YYSTYPE', for compatibility with Solaris 9
13657 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
13658 instead of `yyltype'.
13659
13660 `yystype' and `yyltype' are now obsolescent macros instead of being
13661 typedefs or tags; they are no longer documented and will be
13662 withdrawn in a future release.
13663
13664 * data/glr.c (b4_location_type): Remove.
13665 (YYSTYPE): Renamed from yystype.
13666 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
13667 (struct YYLTYPE): Renamed from struct yyltype.
13668 (YYLTYPE): Renamed from yyltype.
13669 (yyltype, yystype): New (and obsolescent) macros,
13670 for backward compatibility.
13671 * data/yacc.c: Likewise.
13672
13673 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
13674 does not specify a union tag. This is for compatibility with
13675 Solaris 9 yacc.
13676
13677 * src/parse-gram.y (add_param): 2nd arg is now char * not char
13678 const *, since it is now modified by stripping surrounding { }.
13679 (current_braced_code): Remove.
13680 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
13681 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
13682 trailing " {...}". Now of type <chars>.
13683 (grammar_declaration): Adjust to bundled tokens.
13684 (code_content): Remove; stripping is now done by add_param.
13685 (print_token_value): Print contents of bundled tokens.
13686 (token_name): New function.
13687
13688 * src/reader.h (braced_code, current_braced_code): Remove.
13689 (token_name): New decl.
13690
13691 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
13692 token_type, not braced_code code_kind. All uses changed.
13693 (SC_PRE_CODE): New state, for scanning after a keyword that
13694 has (or usually has) an immediately-following braced code.
13695 (token_type): New local var, to keep track of which token type
13696 to return when scanning braced code.
13697 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 13698 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
13699 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
13700 instead of returning a token type immediately.
13701 (<INITIAL>"{"): Set token type.
13702 (<SC_BRACED_CODE>"}"): Use it.
13703 (handle_action_dollar, handle_action_at): Now returns bool
13704 indicating success. Fail if ! current_rule; this prevents a core dump.
13705 (handle_symbol_code_dollar, handle_symbol_code_at):
13706 Remove; merge body into caller.
13707 (handle_dollar, handle_at): Complain in invalid contexts.
13708
13709 * NEWS, doc/bison.texinfo: Document the above.
13710 * NEWS: Fix years and program names in copyright notice.
13711
879ca4f8
PE
137122002-12-17 Paul Eggert <eggert@twinsun.com>
13713
13714 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
13715 Reporting, Table of Symbols): Omit mentions of %lex-param and
13716 %parse-param from the documentation for now.
13717
1c5fe69d
PE
137182002-12-15 Paul Eggert <eggert@twinsun.com>
13719
13720 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
13721 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
13722 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
13723 disagreed with the Bison documentation. Bug
13724 reported by Andrew Walrond.
d600ee67 13725
1c5fe69d
PE
13726 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
13727 as the caller now does that.
13728 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
13729 (YYEMPTY): Parenthesize right hand side, since others use it.
13730 (yyparse): Don't assume that our generated code is the only code
13731 that sets yychar.
13732
d1de5372
PE
137332002-12-13 Paul Eggert <eggert@twinsun.com>
13734
13735 Version 1.75d.
13736
13737 POSIX requires a "yacc" command.
13738 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
13739 (MOSTLYCLEANFILES): Add yacc.
13740 (yacc): New rule.
1c5fe69d 13741 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
13742 as an alias for bison y.
13743
13744 * po/LINGUAS: Add da.
d600ee67 13745
d1de5372
PE
13746 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
13747 problem with latest <getopt.h>.
13748 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
13749
13750 * doc/fdl.texi: Upgrade to 1.2.
13751 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
13752 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
13753 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
13754 gnulib.
13755 * config/install-sh: Sync with autotools.
13756
13757 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 13758 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
13759 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
13760 locations are requested.
13761 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
13762 locations are requested.
13763
d0f3fe23
PE
137642002-12-12 Paul Eggert <eggert@twinsun.com>
13765
13766 Remove unportable casts and storage allocation tricks.
13767 While we're at it, remove almost all casts, since they
13768 usually aren't needed and are a sign of trouble.
13769
13770 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
13771
13772 * src/derives.c (derives_compute): Do not subtract NTOKENS from
13773 the pointer DSET returned by malloc; this isn't portable.
13774 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
13775 Similarly for DERIVES.
13776 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
13777 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
13778 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
13779
13780 * src/derives.c (derives_compute): Do not bother invoking
13781 int_of_rule_number, since rule numbers are integers.
13782
13783 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
13784 rather than XMALLOC (char, N).
13785
13786 * src/files.c (filename_split): Rewrite to avoid cast.
13787
13788 * src/gram.h (symbol_number_as_item_number,
13789 item_number_as_symbol_number, rule_number_as_item_number,
13790 item_number_as_rule_number):
13791 Now inline functions rather than macros, to avoid casts.
13792 * src/state.h (state_number_as_int): Likewise.
13793 * src/tables.c (state_number_to_vector_number,
13794 symbol_number_to_vector_number): Likewise.
13795
13796 * src/gram.h (int_of_rule_number): Remove; no longer used.
13797
13798 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
13799 since the resulting storage is always stored into.
13800
13801 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
13802 where it's needed.
13803
13804 * src/muscle_tab.c (muscle_m4_output):
13805 Now inline. Return bool, not int.
13806 * src/state.c (state_compare): Likewise.
13807 * src/symtab.c (symbol_check_defined,
13808 symbol_check_alias_consistency, symbol_pack, symbol_translation,
13809 hash_compare_symbol, hash_symbol):
13810 Likewise.
13811 * src/uniqstr.c (uniqstr_print): Likewise.
13812 * src/muscle_tab.c (muscle_m4_output_processor):
13813 New function, to avoid casts.
13814 * src/state.c (state_comparator, stage_hasher): Likewise.
13815 * src/symtab.c (symbol_check_defined_processor,
13816 symbol_check_alias_consistency_processor, symbol_pack_processor,
13817 symbol_translation_processor, hash_symbol_comparator,
13818 hash_symbol_hasher): Likewise.
13819 * src/uniqstr.c (uniqstr_print_processor): Likewise.
13820 * src/muscle_tab.c (muscles_m4_output):
13821 Use new functions instead of casting old functions unportably.
13822 * src/state.c (state_hash_new): Likewise.
13823 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
13824 symbols_token_translations_init):
13825 Likewise.
13826 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
13827
13828 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
13829 var instead of casting to long, to avoid casts.
13830 (prepare_states): Use MALLOC rather than alloca, so that we don't
13831 have to worry about alloca.
13832 * src/state.c (state_hash_lookup): Likewise.
13833
13834 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
13835 local var instead of casting to unsigned char, to avoid casts.
13836
13837 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
13838 STATE_ALLOC): Remove.
13839 (transitions_new, errs_new, reductions_new, state_new): Use malloc
13840 rather than calloc, and use offsetof to avoid allocating slightly
13841 too much storage.
13842 (state_new): Initialize all members.
13843
13844 * src/state.c (state_hash): Use unsigned accumulator, not signed.
13845
13846 * src/symtab.c (symbol_free): Remove; unused.
13847 (symbol_get): Remove cast in lhs of assignment.
13848 (symbols_do): Now static. Accept generic arguments, not
13849 hashing-related ones.
13850
13851 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
13852 (symbol_processor): Remove.
13853 (symbols_do): Remove decl; now static.
13854
13855 * src/system.h (alloca): Remove; decl no longer needed.
13856 (<stddef.h>): Include, for offsetof.
13857 (<inttypes.>, <stdint.h>): Include if available.
13858 (uintptr_t): New type, if system lacks it.
13859 (CALLOC, MALLOC, REALLOC): New macros.
13860 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
13861 new macros.
13862
13863 * src/tables.c (table_size): Now int, to pacify GCC.
13864 (table_grow, table_ninf_remap): Use signed table size.
13865 (save_row): Don't bother initializing locals when not needed.
13866 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
13867 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
13868
13869 * src/vcg.h: Correct misspellings.
13870
13871 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
13872
13873
13874 * src/getargs.c (getargs): Don't assume EOF == -1.
13875
26b4a969
PE
138762002-12-09 Paul Eggert <eggert@twinsun.com>
13877
13878 Change identifier spellings to avoid collisions with names
13879 that are reserved by POSIX.
13880
13881 Don't use names ending in _t, since POSIX reserves them.
13882 For consistency, remove _e and _s endings -- they're weren't
13883 needed to remove ambiguity. All uses changed.
13884 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
13885 turn was just renamed from struniq_t.
13886 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
13887 which in turn was just renamed from struniq_processor_t.
13888 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
13889 in turn was renamed from hash_compare_struniq_t.
13890 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
13891 (state_list): Renamed from state_list_t.
13892 * src/assoc.h (assoc): Renamed from assoc_t.
13893 * src/conflicts.c (enum conflict_resolution): Renamed from
13894 enum conflict_resolution_e.
13895 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
13896 (rule_list): Renamed from rule_list_t.
13897 * src/getargs.h (enum trace): Renamed from enum trace_e.
13898 (enum report): Renamed from enum report_e.
13899 * src/gram.h (item_number): Renamed from item_number_t.
13900 (rule_number): Renamed from rule_number_t.
13901 (struct rule_s): Remove the "rule_s" part; not used.
13902 (rule): Renamed from rule_t.
13903 (rule_filter): Renamed from rule_filter_t.
13904 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
13905 (goto_list): Renamed from goto_list_t.
13906 * src/lalr.h (goto_number): Renamed from goto_number_t.
13907 * src/location.h (location): Renamed from location_t.
13908 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
13909 and moved here from:
13910 * src/muscle_tab.h (muscle_entry_t): here.
13911 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
13912 (rule_list): Renamed from rule_list_t.
13913 * src/print_graph.c (static_graph): Renamed from graph.
13914 * src/reader.h (braced_code): Renamed from braced_code_t.
13915 Remove brace_code_e tag.
13916 * src/relation.h (relation_node): Renamed from relation_node_t.
13917 (relation_nodes): Renamed from relation_nodes_t.
13918 (relation): Renamed from relation_t.
13919 * src/state.h (state_number): Renamed from state_number_t.
13920 (struct state): Renamed from struct state_s.
13921 (state): Renamed from state_t.
13922 (transitions): Renamed from transitions_t. Unused (and
13923 misspelled) transtion_s tag removed.
13924 (errs): Renamed from errs_t. Unused errs_s tag removed.
13925 (reductions): Renamed from reductions_t. Unused tag
13926 reductions_s removed.
13927 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
13928 (struct symbol_list): Renamed from struct symbol_list_s.
13929 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
13930 (struct symbol): Renamed from struct symbol_s.
13931 (symbol): Renamed from symbol_t.
13932 * src/tables.c (vector_number): Renamed from vector_number_t.
13933 (action_number): Renamed from action_t.
13934 * src/tables.h (base_number): Renamed from base_t.
13935 * src/vcg.h (enum color): Renamed from enum color_e.
13936 (enum textmode): Renamed from enum textmode_e.
13937 (enum shape): Renamed from enum shape_e.
13938 (struct colorentry): Renamed from struct colorentry_s.
13939 (struct classname): Renamed from struct classname_s.
13940 (struct infoname): Renamed from struct infoname_s.
13941 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
13942 (enum decision): Renamed from enum decision_e.
13943 (enum orientation): Renamed from enum orientation_e.
13944 (enum alignment): Renamed from enum alignment_e.
13945 (enum arrow_mode): Renamed from enum arrow_mode_e.
13946 (enum crossing_type): Renamed from enum crossing_type_e.
13947 (enum view): Renamed from enum view_e.
13948 (struct node): Renamed from struct node_s.
13949 (node): Renamed from node_t.
13950 (enum linestyle): Renamed from enum linestyle_e.
13951 (enum arrowstyle): Renamed from enum arrowstyle_e.
13952 (struct edge): Renamed from struct edge.
13953 (edge): Renamed from edge_t.
13954 (struct graph): Renamed from struct graph_s.
13955 (graph): Renamed from graph_t.
13956 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
13957 Rename value_t -> value.
13958 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
13959 value_t_as_yystype -> value_as_yystype.
13960
13961 Don't include <errno.h> in the mainstream code, since it
13962 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
13963 * lib/get-errno.c, lib/get-errno.h: New files.
13964 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
13965 get-errno.c.
13966 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
13967 * src/output.c (output_skeleton): Likewise.
13968 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
13969 instead of errno.
13970 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
13971 Likewise.
13972 (handle_action_dollar, handle_action_at): Likewise.
13973 * src/system.h: Do not include <errno.h>.
13974 (TAB_EXT): Renamed from EXT_TAB.
13975 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
13976
13977 Avoid str[a-z]*, since <string.h> reserves that name space.
13978 Change all instances of "struniq" in names to "uniqstr", and
13979 likewise for "STRUNIQ" and "UNIQSTR".
13980 * src/uniqstr.c: Renamed from src/struniq.c.
13981 * src/uniqstr.h: Renamed from src/struniq.h.
13982 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
13983 * src/files.c (strsuffix): Remove; unused.
13984 (concat2): Renamed from stringappend. Now static.
13985 * src/files.h (strsuffix, stringappend): Remove; unused.
13986 * src/parse-gram.y (<chars>): Renamed from <string>.
13987 (<uniqstr>): Renamed from <struniq>.
13988 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
13989 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
13990 (struct graph_s.expand): Renamed from struct graph_s.stretch.
13991 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
13992 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
13993 (N_EXPAND): Renamed from N_STRETCH.
13994
13995 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
13996 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
13997 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
13998 Remove; unused.
13999 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
14000 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
14001 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
14002 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
14003 (BASE_MAXIMUM): Renamed from BASE_MAX.
14004 (BASE_MINIMUM): Renamed from BASE_MIN.
14005 (ACTION_MAX): Remove; unused.
14006 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
14007 Unnecessary casts removed from above defines.
14008
14009
14010 Fix misspelling in names.
14011 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
14012 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
14013 G_NODE_ALIGNEMENT.
14014
14015
14016 * lib/timevar.c (timevar_report): Renamed from time_report,
14017 for consistency with other names.
14018 * lib/timevar.h (timevar_report): New decl.
14019 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
14020
14021
14022 Sort include-file uses.
14023
14024 Reorder all include files under src to be in the order "system.h".
14025 then the ../lib include files in angle brackets (alphabetized),
14026 then the . include files in double-quotes (alphabetized). Fix
14027 dependency breakages encountered in this process, as follows:
14028 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
14029 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
14030 * src/state.h: Include "symtab.h".
14031
996b1c7e
PE
140322002-12-08 Paul Eggert <eggert@twinsun.com>
14033
14034 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
14035 since this causes problems when __file__ contains character
14036 sequences like "@" that are treated specially by src/scan-skel.l.
14037 Instead, just use the file's basename. This fixes the bug
14038 reported by Martin Mokrejs in
161a71f3 14039 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 14040
e19c4e5d
PE
140412002-12-06 Paul Eggert <eggert@twinsun.com>
14042
14043 Add support for rules that do not have trailing semicolons, as
14044 POSIX requires. Improve the quality of locations in Bison
14045 diagnostics.
26b4a969 14046
e19c4e5d
PE
14047 * src/location.c: Include <quotearg.h>.
14048 (empty_location): Now const.
14049 (location_print): New function. Follow the recommendation of the
14050 GNU Coding Standards for locations that span file boundaries.
14051 * src/location.h: Do not include <quotearg.h>; no longer needed.
14052 (boundary): New type.
14053 (location_t): Use it. This allows locations to span file boundaries.
14054 All member uses changed: file -> start.file or end.file (as needed),
14055 first_line -> start.line, first_column -> start.column,
14056 last_line -> end.line, last_column -> end.column.
14057 (equal_boundaries): New function.
14058 (LOCATION_RESET, LOCATION_STEP): Remove.
14059 (LOCATION_PRINT): Remove. All callers changed to use location_print.
14060 (empty_location): Now const.
14061 (location_print): New decl.
14062 * src/parse-gram.y (lloc_default): New function, which handles
14063 empty locations more accurately.
14064 (YYLLOC_DEFAULT): Use it.
14065 (%token COLON): Remove.
14066 (%token ID_COLON): New token.
26b4a969 14067 (rules): Use it.
e19c4e5d
PE
14068 (declarations, rules): Remove trailing semicolon.
14069 (declaration, rules_or_grammar_declaration):
14070 Allow empty (";") declaration.
14071 (symbol_def): Remove empty actions; no longer needed.
14072 (rules_or_grammar_declaration): Remove trailing semicolon.
14073 (semi_colon.opt): Remove.
14074 * src/reader.h: Include location.h.
14075 (scanner_cursor): New decl.
14076 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
14077 rolling our own.
14078 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
14079 of *loc.
14080 (STEP): Remove. No longer needed, now that adjust_location does
14081 the work. All uses removed.
14082 (scanner_cursor): New var.
14083 (adjust_location): Renamed from extend_location. It now sets
14084 *loc and adjusts the scanner cursor. All uses changed.
14085 Don't bother testing for CR.
14086 (handle_syncline): Remove location arg; now updates scanner cursor.
14087 All callers changed.
14088 (unexpected_end_of_file): Now accepts start boundary of token or
14089 comment, not location. All callers changed. Update scanner cursor,
14090 not the location.
14091 (SC_AFTER_IDENTIFIER): New state.
14092 (context_state): Renamed from c_context. All uses changed.
14093 (id_loc, code_start, token_start): New local vars.
14094 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
14095 processing of Yacc white space and equivalents here.
14096 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
14097 instead of returning ID immediately, since we need to search for
14098 a subsequent colon.
14099 (<INITIAL>"'", "\""): Save token_start.
14100 (<INITIAL>"%{", "{", "%%"): Save code_start.
14101 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
14102 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
14103 BEGIN context_state at end, not INITIAL.
14104 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
14105 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
14106 Return correct token start.
14107 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
14108 the start of a character, string or multiline comment is found.
14109 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
14110 Reduction): Adjust reported locations to match the more-precise
14111 results now expected.
14112 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
14113 * tests/reduce.at (Useless Rules, Reduced Automaton,
14114 Underivable Rules): Likewise.
14115 * tests/regression.at (Invalid inputs): No longer `expecting ";"
14116 or "|"' now that so many other tokens are allowed by the new grammar.
14117
14118 * src/complain.h (current_file): Remove duplicate decl;
14119 current_file is now owned by files.h.
14120 * src/complain.c, src/scan-gram.l: Include files.h.
14121
141222002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 14123
e19c4e5d
PE
14124 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
14125 promotes to int; it might be unsigned int.
14126 * data/yacc.c (yy_reduce_print): Likewise.
14127
14128 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
14129 be #defined in the prologue, not in the Bison declarations.
14130 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 14131
b64755e3
PE
141322002-12-02 Paul Eggert <eggert@twinsun.com>
14133
14134 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
14135 * lib/strtoul.c: New file, from gnulib.
14136 This fixes a porting bug reported by Peter Klein in
161a71f3 14137 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 14138
6e746484
PE
141392002-11-30 Paul Eggert <eggert@twinsun.com>
14140
b64755e3
PE
14141 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
14142 and put only a forward declaration in the prologue. This is for
14143 consistency with the other scanner helper functions.
14144
6ba55592
PE
14145 Type clashes now generate warnings, not errors, since it
14146 appears that POSIX may allow some grammars with type clashes.
14147 * src/reader.c (grammar_current_rule_check): Warn about
14148 type clashes instead of complaining.
14149 * tests/input.at (Type Clashes): Expect warnings, not complaints.
14150
6e746484
PE
14151 Add Yacc library, since POSIX requires it.
14152 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
14153 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
14154 * lib/main.c, lib/yyerror.c: New files.
14155
14156 gram_error can be static; it need not be extern.
14157 * src/reader.h (gram_error): Remove decl.
14158 * src/parse-gram.y (gram_error): Now static. Add static decl.
14159 (print_token_value): Omit parameter names from forward decl,
14160 for consistency.
14161
88510f9c
PE
141622002-11-29 Paul Eggert <eggert@twinsun.com>
14163
6e746484
PE
14164 * doc/bison.texinfo: Emphasize that yylex and yyerror must
14165 be declared before being used. E.g., one should typically
14166 declare them in the prologue. Use GNU coding style in examples.
14167 Put "const" consistently after the type it modifies. Mention
14168 that C99 supports "inline". Mention that yyerror traditionally
14169 returns "int".
14170
88510f9c
PE
14171 %parse-param and %lex-param now take just one argument, the
14172 declaration; the argument name is deduced from the declaration.
14173
14174 * doc/bison.texinfo (Parser Function, Pure Calling, Error
14175 Reporting, Table of Symbols): Document this.
14176 * src/parse-gram.y (add_param): New function.
14177 (COMMA): Remove.
14178 (declaration): Implement new rule for %parse-param and %lex-param.
14179 * src/scan-gram.l: "," now elicits a warning, rather than being
14180 a token; this is more compatible with byacc.
14181 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
14182
bb92250c
PE
141832002-11-27 Paul Eggert <eggert@twinsun.com>
14184
14185 Rename identifiers to avoid real and potential collisions.
14186
14187 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
14188 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 14189 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
14190 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
14191 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
14192 * src/parse-gram.y (print_token_value): Renamed from yyprint.
14193 All uses changed.
14194 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
14195 The name "yycontrol" violates the name space rules, and this stuff
14196 wasn't being used anyway.
14197 (input): Remove action; this stuff wasn't being used.
14198 (gram_error): Rename local variable yylloc -> loc.
14199 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
14200 (YY_DECL): Don't use "yy" at start of local variables.
14201 All uses changed, e.g., yylloc -> loc.
14202 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
14203 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
14204 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
14205 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
14206
14207 * src/parse-gram.y (gram_error): loc is now const *.
14208 * src/reader.h (gram_error): Likewise.
14209
3af4feb2
PE
142102002-11-24 Paul Eggert <eggert@twinsun.com>
14211
14212 Version 1.75c.
14213
14214 * tests/actions.at (Actions after errors): Use an output format
14215 more similar to that of the Printers and Destructors test.
14216 Test the position of the ';' token too.
14217 (Printers and Destructors): Likewise.
14218 (Printers and Destructors: %glr-parser): Remove for now, to avoid
14219 unnecessarily alarming people when the test fails.
14220
14221 * data/yacc.c (yyerrlab1): Move this label down, so that the
14222 parser does not discard the lookahead token if the user code
14223 invokes YYERROR. This change is required for POSIX conformance.
14224
14225 * lib/error.c: Sync with gnulib.
14226
142272002-11-22 Paul Eggert <eggert@twinsun.com>
14228
14229 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
14230 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
14231 * lib/xmalloc.c: Likewise.
26b4a969 14232
58004308
PE
142332002-11-20 Paul Eggert <eggert@twinsun.com>
14234
14235 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
14236
142372002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 14238
58004308
PE
14239 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
14240 should use `if (! x) abort ();' rather than `assert (x);', and
14241 anyway it's one less thing to worry about configuring.
14242
14243 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
14244 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
14245 and replace all instances of assert with abort.
14246 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
14247 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
14248
14249 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
14250 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
14251 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
14252 hash_find_entry, hash_rehash, hash_insert): Likewise.
14253 * src/conflicts.c (resolve_sr_conflict): Likewise.
14254 * src/lalr.c (set_goto_map, map_goto): Likewise.
14255 * src/nullable.c (nullable_compute): Likewise.
14256 * src/output.c (prepare_rules, token_definitions_output): Likewise.
14257 * src/reader.c (packgram, reader): Likewise.
14258 * src/state.c (state_new, state_free, state_transitions_set,
14259 state_reduction_find): Likewise.
14260 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
14261 symbol_pack): Likewise.
14262 * src/tables.c (conflict_row, pack_vector): Likewise.
14263 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
14264 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
14265 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
14266 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
14267
14268 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
14269 (ARGMATCH_CONSTRAINT): New macro.
14270 (ARGMATCH_ASSERT): Use it.
14271
14272 * src/system.h (verify): New macro.
14273 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
14274 rather than assert.
14275 * src/tables.c (tables_generate): Likewise.
14276
14277 * src/struniq.c (struniq_assert): Now returns void, and aborts
14278 if the assertion is false.
14279 (struniq_assert_p): Remove.
14280 * src/struniq.h: Likewise.
14281
76ae8198
PE
142822002-11-18 Paul Eggert <eggert@twinsun.com>
14283
14284 * data/glr.c (yygetLRActions): Replace `yyindex' with
14285 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
14286 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 14287 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 14288
d3c4e709
AD
142892002-11-18 Akim Demaille <akim@epita.fr>
14290
14291 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
14292 space.
14293 From Tim Van Holder.
14294
8d8a7238
PE
142952002-11-17 Paul Eggert <eggert@twinsun.com>
14296
14297 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
14298 to "SyntaxError" for consistency with my 2002-11-15 change.
14299
14300 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
14301 not define to {}, since this breaks the common use of `YYDPRINTF
14302 ((...));' if a single statement is desired (e.g. before `else').
14303 Work around GCC warnings by surrounding corresponding calls with
14304 {} if needed.
14305 (yyhasResolvedValue): Remove unused function.
14306 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
14307 loop body.
14308 (yyreportSyntaxError): Renamed from yyreportParseError.
14309 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
14310 All uses changed.
14311 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
14312 extern when possible. Remove unused initializations.
14313
b0937b22
AD
143142002-11-16 Akim Demaille <akim@epita.fr>
14315
14316 Augment the similarity between GLR and LALR traces.
14317
14318 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
14319 (YY_REDUCE_PRINT): New.
14320 (yyparse): Use them.
14321 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
14322 YYDPRINT here.
14323 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
14324 state reached after the reduction/recovery, since...
14325 (yyparse, yyprocessOneStack): Report the state we are entering in.
14326
c5e3e510
AD
143272002-11-16 Akim Demaille <akim@epita.fr>
14328
14329 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
14330 Add support for --trace=skeleton.
14331 * src/scan-skel.l: %option debug.
14332 Scan strings of non-@ or \n instead of character by character.
14333 (scan_skel): Handle trace_skeleton.
14334 (QPUTS): New.
14335 (@output_parser_name@, @output_header_name@): ``Restore'' their
14336 support (used to be M4 macros).
14337 * data/yacc.c: Quote larger chunks, a la glr.c.
14338 * data/lalr1.cc: Likewise.
14339 The header guards are no longer available, so use some other
14340 string than `YYLSP_NEEDED'.
14341
4c6cc1db
AD
143422002-11-16 Akim Demaille <akim@epita.fr>
14343
14344 Make the ``Printers and Destructors'' test more verbose, taking
14345 `yacc.c''s behavior as (possibly wrong) reference.
14346
14347 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
14348 instead of fprint on stdout.
14349 Set and report the last_line of the symbols.
14350 Consistently display values and locations.
14351
6d9e8019
PE
143522002-11-16 Paul Eggert <eggert@twinsun.com>
14353
14354 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
14355
6e649e65
PE
143562002-11-15 Paul Eggert <eggert@twinsun.com>
14357
b25d88f6
PE
14358 * tests/actions.at (Actions after errors): New test case.
14359
6e649e65
PE
14360 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
14361 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
14362 tests/action.at, tests/calc.at, tests/conflicts.at,
14363 tests/cxx-type.at, tests/regression.at:
14364 "parse error" -> "syntax error" for POSIX compatibility.
14365 "parsing stack overflow..." -> "parser stack overflow" so
14366 that code matches Bison documentation.
14367
0f39aab9
AD
143682002-11-15 Akim Demaille <akim@epita.fr>
14369
14370 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
14371 take two BRACED_CODE, not two string_content.
14372 Free the scanner's obstack when we are done.
14373 (code_content): New.
14374 * tests/calc.at: Adjust.
14375 * doc/bison.texinfo: Adjust.
14376 Also, make sure to include the `,' for these declarations.
14377
761c1926
AD
143782002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
14379
14380 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
14381 definition; avoids potential autoreconf problems.
14382
b0f98b10
AD
143832002-11-15 Akim Demaille <akim@epita.fr>
14384
14385 Always check the value returned by yyparse.
14386
14387 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
14388 returned by yyparse.
14389 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
14390 Adjust calls.
14391 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
14392 returned by yyparse.
14393
970785f1
PH
143942002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14395
14396 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
14397 on input.at test.
14398
8fcc7db1
PE
143992002-11-14 Paul Eggert <eggert@twinsun.com>
14400
7ec1b48e
PE
14401 * src/output.c (output_skeleton): Call xfopen instead of
14402 duplicating xfopen's body.
14403
cfff7583 14404 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 14405 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 14406
8fcc7db1
PE
14407 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
14408 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
14409 Group compiler. Instead, use "$CC -E bar.c". Include the .h
14410 file twice in the grammar, as an extra check.
14411
14412 * tests/input.at (Torturing the Scanner): Surround the
14413 backslash-newline tests with "#if 0", to make it less likely that
14414 we'll run into compiler bugs. Bring back solitary \ inside
14415 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 14416 test backslash-newline in C character constant.
8fcc7db1 14417
4e8d992c
AD
144182002-11-14 Akim Demaille <akim@epita.fr>
14419
14420 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
14421 status of the compiler.
f32b346d 14422 Calling `exit 1' is no longer needed.
4e8d992c
AD
14423 Reported by Nelson H. F. Beebe.
14424
9501dc6e
AD
144252002-11-14 Akim Demaille <akim@epita.fr>
14426
14427 * tests/atlocal.in (CPPFLAGS): We have config.h.
14428 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
14429 New.
14430 * tests/actions.at, tests/calc.at, tests/conflicts.at,
14431 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
14432 * tests/regression.at, tests/torture.at: Use them for all the
14433 grammars that are to be compiled.
14434 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
14435 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
14436 * doc/bison.texinfo (GLR Parsers): Document `inline'.
14437
18b519c0
AD
144382002-11-14 Akim Demaille <akim@epita.fr>
14439
14440 * doc/bison.texinfo: Various formatting changes (alignments in
14441 samples, additional @group/@end group, GCS in samples.
14442 Use @deffn instead of simple @table to define the directives,
14443 macros, variables etc.
14444
9a86cdb9
PE
144452002-11-13 Paul Eggert <eggert@twinsun.com>
14446
daa33def 14447 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 14448 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 14449
daa33def 14450 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 14451 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
14452 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
14453 * tests/headers.at (export YYLTYPE): Likewise.
14454
14455 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 14456 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 14457
9a86cdb9
PE
14458 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
14459 comments, since they're not portable. Use GNU coding style.
14460
9c1e26bd
AD
144612002-11-13 Akim Demaille <akim@epita.fr>
14462
14463 * data/yacc.c: Leave bigger chunks of quoted text.
14464 (YYDSYMPRINTF): New.
14465 Use it to report symbol activities.
14466 * data/glr.c (YYDSYMPRINTF): New.
14467 Use it.
14468
87f721cc
PE
144692002-11-12 Paul Eggert <eggert@twinsun.com>
14470
14471 Version 1.75b.
14472
14473 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
14474 (yyglrReduce): Return yyok, not 0.
14475 This should avoid the enumerated-type warnings reported
464c6927 14476 by Nelson H. F. Beebe in
161a71f3 14477 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
14478
14479 * lib/bbitset.h (BITSET_INLINE): Remove.
14480 * lib/bitset.h [! BITSET_INLINE]: Remove.
14481 (bitset_set, bitset_reset, bitset_test): Rename local vars
14482 to avoid shadowing warnings by GCC.
14483
14484 * data/glr.c (inline): Remove #define. It's the user's
14485 responsibility to #define it away, just like 'const'.
464c6927 14486 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 14487 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 14488
87f721cc
PE
14489 * Makefile.maint (po-check): Scan .l and .y files instead of the
14490 .c and the .h files that they generate. This fixes the bug
14491 reported by Tim Van Holder in:
161a71f3 14492 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
14493 Look for N_ as well as for _. Try to avoid matching #define for
14494 N_ and _.
14495 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
14496 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
14497 * src/scan-gram.l: Revamp regular expressions so that " and '
14498 do not confuse xgettext.
14499
14500 * src/struniq.h (struniq_new): Do not declare the return type
14501 to be 'const'; this violates the C standard.
14502 * src/struniq.c (struniq_new): Likewise.
14503
be14ade5
AD
145042002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
14505
14506 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
14507 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
14508 linker.
14509
05291fbc
AD
145102002-11-12 Akim Demaille <akim@epita.fr>
14511
14512 * Makefile.maint: Sync with Autoconf:
14513 (local_updates): New.
14514
1f5fd52e
AD
145152002-11-12 Akim Demaille <akim@epita.fr>
14516
14517 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
14518
283f1e64
AD
145192002-11-12 Akim Demaille <akim@epita.fr>
14520
14521 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
14522 locations.
14523
886b69d1
AD
145242002-11-12 Akim Demaille <akim@epita.fr>
14525
14526 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
14527 not yyvalue.
14528
3df37415
AD
145292002-11-12 Akim Demaille <akim@epita.fr>
14530
14531 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
14532 Use it to test the GLR parser.
14533
7bd6c77e
AD
145342002-11-12 Akim Demaille <akim@epita.fr>
14535
14536 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
14537 defines it.
14538 * data/glr.c (yystos): New.
14539 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
14540 (YYDSYMPRINT): New.
14541 (yyval): Don't define it, it is handled via M4.
14542 (yyrecoverParseError): Free verbosely the discarded symbols.
14543 * data/yacc.c (yysymprint): Remove, rather...
14544 (b4_yysymprint_generate): invoke.
14545 * data/c.m4 (b4_yysymprint_generate): New.
14546 Accept pointers as arguments, as opposed to the version from
14547 yacc.c.
14548 (b4_yydestruct_generate): Likewise.
14549 * tests/cations.at (Printers and Destructors): Use Bison directives
14550 instead of CPP macros.
14551 Don't rely on internal details.
14552
b0400cc6
AD
145532002-11-12 Akim Demaille <akim@epita.fr>
14554
14555 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
14556 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
14557 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
14558 it against YYEMPTY and so forth), work on yytoken (i.e., set
14559 it to YYEMPTY etc.).
14560 (yydestruct): Replace with a b4_yydestruct_generate invocation.
14561 (b4_symbol_actions): Remove.
14562 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
14563 for 0, end-of-input.
14564
72f889cc
AD
145652002-11-12 Akim Demaille <akim@epita.fr>
14566
14567 * doc/bison.texinfo (Destructor Decl): New.
14568
b1ae9233
AD
145692002-11-12 Akim Demaille <akim@epita.fr>
14570
14571 * src/tables.c (tables_generate): Use free for pointers that
14572 cannot be NULL, not XFREE.
14573 (pack_vector): Use assert, not fatal, for bound violations.
14574 * src/state.c (state_new): Likewise.
14575 * src/reader.c (reader): Likewise.
14576 * src/lalr.c (set_goto_map): Likewise.
72f889cc 14577 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
14578 the file name.
14579
7ec2d4cd
AD
145802002-11-12 Akim Demaille <akim@epita.fr>
14581
14582 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
14583 Restore.
14584 * src/scan-gram.l (last_string): Is global to the file, not to
14585 yylex.
14586 * src/parse-gram.y (input): Don't append the epilogue here,
14587 (epilogue.opt): do it here, and free the scanner's obstack.
14588 * src/reader.c (epilogue_set): Rename as...
14589 (epilogue_augment): this.
14590 * data/c.m4 (b4_epilogue): Defaults to empty.
14591
573a6cd3
AD
145922002-11-12 Akim Demaille <akim@epita.fr>
14593
14594 * src/getargs.c (long_options): Remove duplicates.
14595 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
14596 Remove.
14597 * doc/bison.rnh: Remove.
14598 * doc/bison.texinfo (VMS Invocation): Remove.
14599
95612cfa
AD
146002002-11-12 Akim Demaille <akim@epita.fr>
14601
14602 * src/struniq.h, src/struniq.c (struniq_t): Is const.
14603 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
14604
14605 Use struniq for symbols.
14606
14607 * src/symtab.h (symbol_t): The tag member is a struniq.
14608 (symbol_type_set): Adjust.
14609 * src/symtab.c (symbol_new): Takes a struniq.
14610 (symbol_free): Don't free the tag member.
14611 (hash_compare_symbol_t, hash_symbol_t): Rename as...
14612 (hash_compare_symbol, hash_symbol): these.
14613 Use the fact that tags as struniqs.
14614 (symbol_get): Use struniq_new.
14615 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
14616 Returns a strniq.
14617 * src/reader.h (merger_list, grammar_currentmerge_set): The name
14618 and type members are struniqs.
14619 * src/reader.c (get_merge_function)
14620 (grammar_current_rule_merge_set): Adjust.
14621 (TYPE, current_type): Are struniq.
14622
14623 Use struniq for file names.
14624
14625 * src/files.h, src/files.c (infile): Split into...
14626 (grammar_file, current_file): these.
14627 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
14628 * src/reduce.c (reduce_print): Likewise.
14629 * src/getargs.c (getargs): Likewise.
14630 * src/complain.h, src/complain.c: Likewise.
14631 * src/main.c (main): Call struniqs_new early enough to use it for
14632 file names.
14633 Don't free the input file name.
14634
3e6656f9
AD
146352002-11-12 Akim Demaille <akim@epita.fr>
14636
14637 * src/symtab.c (symbol_free): Remove dead deactivated code:
14638 type_name are properly removed.
14639 Don't use XFREE to free items that cannot be NULL.
14640 * src/struniq.h, src/struniq.c: New.
14641 * src/main.c (main): Initialize/free struniqs.
14642 * src/parse-gram.y (%union): Add astruniq member.
14643 (yyprint): Adjust.
14644 * src/scan-gram.l (<{tag}>): Return a struniq.
14645 Free the obstack bit that used to store it.
14646 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
14647
7672019c
PE
146482002-11-11 Paul Eggert <eggert@twinsun.com>
14649
14650 Revamp to fix many (but not all) of the C- and M4-related quoting
14651 problems. Among other things, this fixes the Bison bug reported
14652 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 14653 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
14654
14655 Use new @ escapes consistently. Represent brackets with @{ and @}
14656 rather than @<:@ and @:>@, since this works a bit better with dumb
14657 editors like vi. Represent @ with @@, since @ is now consistently
14658 an escape. Use @oline@ and @ofile@ rather than __oline__ and
14659 __ofile__, to avoid unexpected expansions. Similarly, use @output
14660 rather than #output.
14661
14662 * data/c.m4 (b4_copyright): Omit file name from comment, since
14663 the file name could contain "*/".
14664 (b4_synclines_flag): Don't quote the 2nd argument; it should already
14665 be quoted. All uses changed.
14666
14667 * data/glr.c: Use new @ escapes consistently.
14668 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
14669 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
14670 Remove, since they couldn't handle arbitrary characters in file
14671 names.
14672 * data/lalr1.cc: Likewise.
14673 * data/yacc.c: Likewise.
14674
14675 * src/files.c (output_infix): Remove; all uses removed.
14676 * src/files.h: Likewise.
14677
14678 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
14679 mishandled funny characters in file names, and anyway it isn't
14680 needed any more.
14681 * data/yacc.c: Likewise.
14682 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
14683
14684 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
14685 * data/yacc.c: Likewise.
14686
14687 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
14688 strings now.
14689 (muscle_init): Quote filename as a C string.
14690 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
14691 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
14692 * src/output.c (escaped_file_name_output): New function.
14693 (prepare_symbols): Quote tokens for M4.
14694 (prepare): Don't insert output_infix, output_prefix,
14695 output_parser_name, output_header_name; this is now down by scan-skel.
14696 Insert skeleton as a C string.
14697
14698 * src/output.c (user_actions_output, symbol_destructors_output,
14699 symbol_printers_output): Quote filenames for C and M4.
14700 * src/reader.c (prologue_augment, epilogue_set): Likewise.
14701
14702 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
14703 escapes other than \\ and \'; this simplifies the code.
14704 (<SC_STRING>): Likewise, for \\ and \".
14705 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
14706 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
14707 Use new escapes @{ and @} for [ and ].
14708
14709 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
14710 them with auto vars.
14711 Switch to new escape scheme, where @ is the escape character uniformly.
14712 Abort if a stray escape character is found. Avoid unbounded input
14713 buffer when parsing non-escaped text.
14714
14715 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
14716 __oline__, #output, $@, and @{ do not have unintended meanings.
14717
acea4f3b
PE
147182002-11-09 Paul Eggert <eggert@twinsun.com>
14719
14720 Fix the test failure due to GCC warnings described in
161a71f3 14721 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
14722 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
14723 evaluate to 0 if it's impossible for NINF to be in the respective
14724 table.
14725 (yygetLRActions, yyrecoverParseError): Use them.
14726
14727 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
14728 counted in the token inserted at end of file. Now takes
14729 location_t *, not location_t, so that the location can be
14730 adjusted. All uses changed.
14731
14732 * tests/regression.at (Invalid inputs): Adjust wording in
14733 diagnostic to match the new behavior.
14734
14735 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
14736 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
14737 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
14738 abort ();'. This reduces the runtime of the "Many lookaheads"
14739 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
14740 GCC 3.2.
14741
20ef1ad5
PE
147422002-11-07 Paul Eggert <eggert@twinsun.com>
14743
14744 * src/parse-gram.y (CHARACTER): Remove unused token.
14745 All uses removed.
14746
14747 * src/scan-gram.l: Remove stack option. We no longer use the
14748 stack, since the stack was never deeper than 1; instead, use the
14749 new auto var c_context to record the stacked value.
14750
14751 Remove nounput option. At an unexpected end of file, we now unput
14752 the minimal input necessary to end cleanly; this simplifies the
14753 code.
14754
14755 Avoid unbounded token sizes where this is easy.
14756
14757 (unexpected_end_of_file): New function.
14758 Use it to systematize the error message on unexpected EOF.
14759 (last-string): Now auto, not static.
14760 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
14761 (scanner_last_string_free): Remove; not used.
14762 (percent_percent_count): Move decl to just before use.
14763 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
14764 not the (never otherwised-used) CHARACTER.
14765
93724f13
AD
147662002-11-07 Akim Demaille <akim@epita.fr>
14767
14768 Let yyerror always receive the msg as last argument, so that
14769 yyerror can be variadic.
14770
14771 * data/yacc.c (b4_yyerror_args): New.
14772 Use it when calling yyerror.
14773 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
14774 Use it when calling yyerror.
14775 * doc/bison.texinfo (Error Reporting): Adjust.
14776 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
14777 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
14778
6e40b4eb
AD
147792002-11-06 Akim Demaille <akim@epita.fr>
14780
14781 #line should have quoted strings.
14782 Ideally, this should be done by m4_quotearg.
14783
14784 * src/scan-skel.l: Include quotearg.h.
14785 Quote __ofile__.
14786 * src/output.c (symbol_printers_output)
14787 (symbol_destructors_output): Quote the file name.
14788
2dfbfc12
AD
147892002-11-06 Akim Demaille <akim@epita.fr>
14790
14791 * tests/regression.at (Invalid inputs): Adjust to the recent
14792 messages.
14793
437c2d80
AD
147942002-11-06 Akim Demaille <akim@epita.fr>
14795
14796 Restore --no-lines.
14797 Reported by Jim Kent.
14798
14799 * data/c.m4 (b4_syncline): New.
14800 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
14801 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
14802 * src/output.c (user_actions_output): Likewise.
14803 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 14804 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 14805
900c5db5
AD
148062002-11-06 Akim Demaille <akim@epita.fr>
14807
14808 * src/main.c (main): Free `infile'.
14809 * src/scan-gram.l (handle_syncline): New.
14810 Recognize `#line'.
14811 * src/output.c (user_actions_output, symbol_destructors_output)
14812 (symbol_printers_output): Use the location's file name, not
14813 infile.
14814 * src/reader.c (prologue_augment, epilogue_set): Likewise.
14815
e183b123 148162002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 14817
e183b123 14818 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 14819 either has GLR conflict entries.
e183b123 14820
193eb6b7
PE
148212002-11-05 Paul Eggert <eggert@twinsun.com>
14822
e183b123
PE
14823 * src/scan-gram.l: Use more accurate diagnostics, e.g.
14824 "integer out of range" rather than "invalid value".
14825 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
14826 accordingly.
14827
193eb6b7
PE
14828 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
14829 Also, remove one static variable in the scanner.
14830
14831 * src/scan-gram.l (braces_level): Now auto, not static.
14832 Initialize to zero if the compiler is being picky.
14833 (INITIAL): Clear braces_level instead of incrementing it.
14834 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
14835 as POSIX 1003.1-2001 requires.
14836 * src/system.h (IF_LINT): New macro, taken from coreutils.
14837 * configure.ac: Define "lint" if --enable-gcc-warnings.
14838
29c01725
AD
148392002-11-05 Akim Demaille <akim@epita.fr>
14840
14841 * src/scan-gram.l: When it starts with `%', complain about the
14842 whole directive, not just that `invalid character: %'.
14843
8aeac3ca
AD
148442002-11-04 Akim Demaille <akim@epita.fr>
14845
14846 * Makefile.maint: Update from Autoconf.
14847 (update, cvs-update, po-update, do-po-update): New.
14848
793a58bb
AD
148492002-11-04 Akim Demaille <akim@epita.fr>
14850
14851 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
14852 and yyerror.
14853 Have yyerror `use' its arguments.
14854 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
14855 returns true when location & yacc & pure & parse-param.
14856 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
14857
c4d720cd
AD
148582002-11-04 Akim Demaille <akim@epita.fr>
14859
14860 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
14861 clashes.
14862 * src/scan-gram.l: Use [\'] instead of ['] to pacify
14863 font-lock-mode.
14864 Use complain_at.
14865 Use quote, not quote_n since LOCATION_PRINT no longer uses the
14866 slot 0.
14867
613a0dc5
PE
148682002-11-03 Paul Eggert <eggert@twinsun.com>
14869
14870 * src/reader.c (get_merge_function, grammar_current_rule_check):
14871 Use consistent diagnostics for reporting type name clashes.
14872 Quote the types with <>, for consistency with Yacc.
14873 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
14874
2a8d363a
AD
148752002-11-03 Akim Demaille <akim@epita.fr>
14876
14877 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
14878 New.
14879 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
14880 (b4_parse_param): Remove.
14881 Use b4_identification.
14882 Propagate b4_pure_args where needed to pass them to yyerror.
14883 * data/glr.m4 (b4_parse_param): Remove.
14884 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
14885 (b4_lpure_formals): New.
14886 Use b4_identification.
14887 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
14888 b4_user_formals and b4_user_args.
14889 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
14890 (yyreportAmbiguity): When using a pure parser, also need
14891 the location, and the parse-params.
14892 Adjust callers.
14893 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
14894 When using a pure parser, also need the parse-params.
14895 Adjust callers.
14896 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
14897 (%pure-parser + %parse-param) LALR and GLR parsers.
14898 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
14899 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
14900 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
14901 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
14902 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
14903 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
14904 * doc/bison.texinfo: Untabify the whole file.
14905 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
14906 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
14907 (Error Reporting): Adjust to these new directives.
14908 Document %error-verbose, deprecate YYERROR_VERBOSE.
14909
9e32add8
AD
149102002-11-03 Akim Demaille <akim@epita.fr>
14911
14912 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
14913 AT_CHECK_CALC_GLR invocations to use % directives, instead of
14914 command line options.
14915 * tests/cxx-type.at: Formatting changes.
14916
b02d90a5
PE
149172002-11-03 Paul Eggert <eggert@twinsun.com>
14918
14919 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
14920 to count columns correctly, and to check for invalid inputs.
9e32add8 14921
b02d90a5
PE
14922 Use mbsnwidth to count columns correctly. Account for tabs, too.
14923 Include mbswidth.h.
14924 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
14925 (extend_location): New function.
14926 (YY_LINES): Remove.
14927
14928 Handle CRLF in C code rather than in Lex code.
14929 (YY_INPUT): New macro.
14930 (no_cr_read): New function.
14931
14932 Scan UCNs, even though we don't fully handle them yet.
14933 (convert_ucn_to_byte): New function.
14934
14935 Handle backslash-newline correctly in C code.
14936 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
14937 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
14938 all uses changed.
14939 (tag, splice): New EREs. Do not allow NUL or newline in tags.
14940 Use {splice} wherever C allows backslash-newline.
14941 YY_STEP after space, newline, vertical-tab.
14942 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 14943
b02d90a5
PE
14944 (letter, id): Don't assume ASCII; e.g., spell out a-z.
14945
14946 ({int}, handle_action_dollar, handle_action_at): Check for integer
14947 overflow.
9e32add8 14948
b02d90a5
PE
14949 (YY_STEP): Omit trailing semicolon, so that it's more like C.
14950
14951 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
14952 as well as \000. Check for UCHAR_MAX, not 255.
14953 Allow \x with an arbitrary positive number of digits, as in C.
14954 Check for overflow here.
14955 Allow \? and UCNs, for compatibility with C.
14956
14957 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
14958 with quote slot used by complain_at.
14959
14960 * tests/input.at: Add tests for backslash-newline, m4 quotes
14961 in symbols, long literals, and funny escapes in strings.
14962
14963 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
14964 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
14965 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
14966 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
14967 * m4/mbswidth.m4: New file, from GNU coreutils.
14968
14969 * doc/bison.texinfo (Grammar Outline): Document // comments.
14970 (Symbols): Document that trigraphs have no special meaning in Bison,
14971 nor is backslash-newline allowed.
14972 (Actions): Document that trigraphs have no special meaning.
14973
14974 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
14975 no longer used.
14976
149772002-11-02 Paul Eggert <eggert@twinsun.com>
14978
14979 * src/reader.c: Don't include quote.h; not needed.
14980 (get_merge_function): Reword warning to be consistent with
14981 type clash diagnostic in grammar_current_rule_check.
14982
14983 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
14984 bug in trigraph handling.
14985
14986 * src/output.c (prepare_symbols): When printing token names,
14987 escape "[" as "@<:@" and likewise for "]".
14988
14989 * src/system.h (errno): Remove declaration, as we are now
14990 assuming C89 or better, and C89 guarantees errno.
14991
762b212b
PE
149922002-10-30 Paul Eggert <eggert@twinsun.com>
14993
14994 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
14995 Check for close failures.
14996 * src/files.h (xfclose): Return void, not int, since it always
14997 returned zero.
14998 * src/files.c (xfclose): Likewise. Report I/O error if ferror
14999 indicates one.
15000 * src/output.c (output_skeleton): Use xfclose rather than fclose
15001 and ferror. xfclose now checks ferror.
15002
15003 * data/glr.c (YYLEFTMOST_STATE): Remove.
15004 (yyreportTree): Use a stack-based leftmost state. This avoids
15005 our continuing battles with bogus warnings about initializers.
15006
56100c60
AD
150072002-10-30 Akim Demaille <akim@epita.fr>
15008
15009 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
15010 #if.
15011
51b4a04c
PH
150122002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15013
15014 * tests/glr-regr1.at: New test for reported regressions.
15015 * tests/testsuite.at: Add glr-regr1.at test.
15016 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 15017
bf1ebda2
PE
150182002-10-24 Paul Eggert <eggert@twinsun.com>
15019
5c16c6b1
PE
15020 Version 1.75a.
15021
bf1ebda2
PE
15022 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
15023 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
15024 we use malloc. Don't assume 'A' through 'Z' are contiguous.
15025 Don't assume strdup exists; POSIX says its an XSI extension.
15026 Check for buffer overflow on input.
15027
b526ee61
AD
150282002-10-24 Akim Demaille <akim@epita.fr>
15029
15030 * src/output.c (output_skeleton): Don't disable M4sugar comments
15031 too soon: it results in comments being expanded.
15032 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
15033 first output.
15034
f1886bb2
AD
150352002-10-24 Akim Demaille <akim@epita.fr>
15036
15037 * data/yacc.c (m4_int_type): New.
15038 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
15039 char' as only yacc.c wants K&R portability.
15040 * data/glr.c (yysigned_char): Remove.
15041 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
15042 Reported by Quoc Peyrot.
15043
c5576256
PE
150442002-10-23 Paul Eggert <eggert@twinsun.com>
15045
15046 * src/main.c (main): With --trace=time, report times even if a
15047 non-fatal error occurs. Formerly, the times were reported in some
15048 such cases but not in others.
15049 * src/reader.c (reader): Just return if a complaint has been issued,
15050 instead of exiting, so that 'main' can report times.
15051
27b0ffea
AD
150522002-10-22 Akim Demaille <akim@epita.fr>
15053
15054 * src/system.h: Include sys/types.
15055 Reported by Bert Deknuydt.
15056
223a7883
PE
150572002-10-23 Paul Eggert <eggert@twinsun.com>
15058
15059 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
15060 Suggested by Art Haas.
15061
150622002-10-22 Paul Eggert <eggert@twinsun.com>
15063
15064 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
15065 decl; not needed any more.
15066 * src/main.c (main): Use return to exit, undoing yesterday's change.
15067 The last OS that we could find where this wouldn't work is
15068 SunOS 3.5, and that's too old to worry about now.
15069
15070 * data/glr.c (struct yyltype): Define members even when not
15071 doing locations. This is more consistent with yacc.c, and it
15072 works around the following bug reports:
161a71f3
PE
15073 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
15074 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 15075
223a7883
PE
15076 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
15077 @acronym consistently. Standardize on "Yacc" instead of "YACC",
15078 "Algol" instead of "ALGOL". Give a bit more history about BNF.
15079
8b76775a
AD
150802002-10-22 Akim Demaille <akim@epita.fr>
15081
15082 * data/README: New.
15083
6db10d14
PE
150842002-10-21 Paul Eggert <eggert@twinsun.com>
15085
15086 Be consistent about 'bool'; the old code used an enum in one
15087 module and an int in another, and this violates the C standard.
15088 * m4/stdbool.m4: New file, from coreutils 4.5.3.
15089 * configure.ac (AC_HEADER_STDBOOL): Add.
15090 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
15091 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
15092 * src/symtab.c (hash_compare_symbol_t): Likewise.
15093 * src/system.h (bool, false, true): Use a definition consistent
15094 with ../lib/hash.c. All uses changed.
15095
15096 * src/complain.c (warning_issued): Renamed from warn_message_count,
15097 so that we needn't worry about integer overflow (!).
15098 Now of type bool. All uses changed.
15099 (complaint_issued): Renamed from complain_message_count; likewise.
15100
15101 * src/main.c (main): Use exit to exit with failure.
27b0ffea 15102
6db10d14
PE
15103 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
15104 rather than 1 and 0.
15105 * src/main.c (main): Likewise.
15106 * src/getargs.c (getargs): Likewise.
15107 * src/reader.c (reader): Likewise.
15108
15109 * src/getarg.c (getargs): Remove duplicate code for
15110 "Try `bison --help'".
15111
15112 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
15113 What was that "2" for?
15114
15115 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
15116 * src/getargs.c (usage): Likewise.
15117
15118 * src/getargs.c (getargs): When there are too few operands, report
15119 the last one. When there are too many, report the first extra
15120 one. This is how diffutils does it.
15121
92a060fd
PE
151222002-10-20 Paul Eggert <eggert@twinsun.com>
15123
15124 Remove K&R vestiges.
15125 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
15126 * src/complain.c (VA_START): Remove. Assume prototypes.
15127 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
15128 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
15129 fatal): Assume prototypes.
15130 * src/complain.h: Assume prototypes.
15131 * src/system.h (PARAMS): Remove.
15132 Include <limits.h> unconditionally, since it's guaranteeed even
15133 for a freestanding C89 compiler.
15134 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
15135 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 15136
e7cb57c0
AD
151372002-10-20 Akim Demaille <akim@epita.fr>
15138
15139 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
15140 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
15141 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
15142 (yyresolveStates, yyresolveAction, yyresolveStack)
15143 (yyprocessOneStack): Use them.
15144 (yy_reduce_print): New.
15145 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
15146
0245f82d
AD
151472002-10-20 Akim Demaille <akim@epita.fr>
15148
15149 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
15150 arguments and output `void'.
15151 (b4_c_function): Rename as...
15152 (b4_c_function_def): this.
15153 (b4_c_function_decl, b4_c_ansi_function_def)
15154 (b4_c_ansi_function_decl): New.
15155 Change the interpretation of the arguments: before `int, foo', now
15156 `int foo, foo'.
15157 * data/yacc.c (yyparse): Prototype and define thanks to these.
15158 Adjust b4_c_function_def uses.
15159 * data/glr.c (yyparse): Likewise, but ANSI only.
15160
39912f52
AD
151612002-10-20 Akim Demaille <akim@epita.fr>
15162
15163 * src/output.c (prepare): Move the definition of `tokens_number',
15164 `nterms_number', `undef_token_number', `user_token_number_max'
15165 to...
15166 (prepare_tokens): Here.
15167 (prepare_tokens): Rename as...
15168 (prepare_symbols): this.
15169 (prepare): Move the definition of `rules_number' to...
15170 (prepare_rules): here.
15171 (prepare): Move the definition of `last', `final_state_number',
15172 `states_number' to...
15173 (prepare_states): here.
15174 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
15175
20c1e2ad
AD
151762002-10-20 Akim Demaille <akim@epita.fr>
15177
15178 * src/tables.h, src/tables.c, src/output.c: Comment changes.
15179
21964f43
AD
151802002-10-20 Akim Demaille <akim@epita.fr>
15181
15182 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
15183 * data/c.m4: here.
15184
66d30cd4
AD
151852002-10-20 Akim Demaille <akim@epita.fr>
15186
15187 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
15188 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
15189 `pair'.
15190 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
15191 `name' to...
15192 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
15193 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
15194 These.
15195
95f2c9fe
PE
151962002-10-19 Paul Eggert <eggert@twinsun.com>
15197
15198 Do not create a temporary file, as that involves security and
15199 cleanup headaches. Instead, use a pair of pipes.
15200 Derived from a suggestion by Florian Krohm.
15201 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
15202 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
15203 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
15204 (BISON_PREREQ_SUBPIPE): Add.
15205 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
15206 Add subpipe.h, subpipe.c.
15207 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
15208 * po/POTFILES.in: Add lib/subpipe.c.
15209 * src/output.c: Include "subpipe.h".
15210 (m4_invoke): Remove decl.
15211 (scan_skel): New decl.
15212 (output_skeleton): Use pipe rather than temporary file for m4 input.
15213 Check that m4sugar.m4 is readable, to avoid deadlock.
15214 Check for pipe I/O error.
15215 * src/scan-skel.l (readpipe): Remove decl.
15216 (scan_skel): New function, to be used in place of m4_invoke.
15217 Read from stream rather than file.
66d30cd4 15218
95f2c9fe
PE
15219 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
15220 float, as this generates a warning on Solaris 8 + GCC 3.2 with
15221 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
15222 this generates a more-accurate value anyway.
15223
15224 * lib/timevar.c (timervar_accumulate): Rename locals to
15225 avoid confusion with similarly-named more-global.
15226 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
15227
15228 * src/output.c (prepare): Use xstrdup to convert char const *
15229 to char *, to avoid GCC warning.
15230
c19988b7
AD
152312002-10-19 Akim Demaille <akim@epita.fr>
15232
15233 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
15234 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
15235 Use them to have `calc.y' ready for %pure-parser.
15236 * data/yacc.c (YYLEX): Pass a yylex return type to
15237 b4_c_function_call.
15238
ae7453f2
AD
152392002-10-19 Akim Demaille <akim@epita.fr>
15240
15241 Prototype support of %lex-param and %parse-param.
15242
15243 * src/parse-gram.y: Add the definition of the %lex-param and
15244 %parse-param tokens, plus their rules.
15245 Drop the `_' version of %glr-parser.
15246 Add the "," token.
15247 * src/scan-gram.l (INITIAL): Scan them.
15248 * src/muscle_tab.c: Comment changes.
15249 (muscle_insert, muscle_find): Rename `pair' as `probe'.
15250 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
15251 (muscle_entry_s): The `value' member is no longer const.
15252 Adjust all dependencies.
15253 * src/muscle_tab.c (muscle_init): Adjust: use
15254 MUSCLE_INSERT_STRING.
15255 Initialize the obstack earlier.
15256 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
15257 (muscle_pair_list_grow): New.
15258 * data/c.m4 (b4_c_function_call, b4_c_args): New.
15259 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
15260 * tests/calc.at: Use %locations, not --locations.
15261 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
15262
0e575721
AD
152632002-10-19 Akim Demaille <akim@epita.fr>
15264
15265 * src/getargs.c (usage): Take status as argument and exit
15266 accordingly.
15267 Report the traditional `Try ... --help' message when status != 0.
15268 (usage, version): Don't take a FILE * as arg, it is pointless.
15269 (getargs): When there is an incorrect number of arguments, make it
15270 an error, and report it GNUlically thanks to `usage ()'.
15271
724ce7f5
PE
152722002-10-18 Paul Eggert <eggert@twinsun.com>
15273
3a781eb2
PE
15274 * data/glr.c (yyreportParseError): Don't assume that sprintf
15275 yields the length of the printed string, as this is not true
15276 on SunOS 4.1.4. Reported by Peter Klein.
15277
724ce7f5
PE
15278 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
15279 * tests/conflicts.at (%nonassoc and eof): Likewise.
15280 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
15281
473d0a75
AD
152822002-10-17 Akim Demaille <akim@epita.fr>
15283
15284 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
15285 * src/getargs.c (trace_types, trace_args): Adjust.
15286 * src/reader.c (grammar_current_rule_prec_set)
15287 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
15288 Standardize error messages.
15289 And s/@prec/%prec/!
15290 (reader): Use trace_flag to enable scanner/parser debugging,
15291 instead of an adhoc scheme.
15292 * src/scan-gram.l: Remove trailing debugging code.
15293
e76d2469
PE
152942002-10-16 Paul Eggert <eggert@twinsun.com>
15295
93e2236a
PE
15296 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
15297 MUSCLE_TAB_H.
15298
e76d2469
PE
15299 * NEWS: Officially drop support for building Bison with K&R C,
15300 since it didn't work anyway and it's not worth worrying about.
15301 * Makefile.maint (wget_files): Remove ansi2knr.c.
15302 (ansi2knr.c-url_prefix): Remove.
15303 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
15304 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
15305 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
15306
5bd1c419
PE
153072002-10-15 Paul Eggert <eggert@twinsun.com>
15308
15309 Stop using the "enum_" trick for K&R-style function definitions;
15310 it confused me, and I was the author! Instead, assume that people
15311 who want to use K&R C compilers (when using these modules in GCC,
15312 perhaps?) will run ansi2knr.
15313
15314 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
15315 All uses of "enum_" changed to "enum ".
15316 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
15317 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 15318
5bd1c419
PE
15319 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
15320 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
15321 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
15322 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
15323 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
15324 abitset_not, abitset_ones, abitset_or, abitset_or_and,
15325 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
15326 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
15327 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
15328 Use function prototypes; this removes the need for declaring
15329 static functions simply to provide their prototypes.
15330 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
15331 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
15332 bitset_count_, bitset_create, bitset_dump, bitset_first,
15333 bitset_free, bitset_init, bitset_last, bitset_next,
15334 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
15335 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
15336 bitset_print, bitset_release_memory, bitset_toggle_,
15337 bitset_type_choose, bitset_type_get, bitset_type_name_get,
15338 debug_bitset): Likewise.
15339 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
15340 * lib/bitset_stats.c (bitset_log_histogram_print,
15341 bitset_percent_histogram_print, bitset_stats_and,
15342 bitset_stats_and_cmp, bitset_stats_and_or,
15343 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
15344 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
15345 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
15346 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
15347 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
15348 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
15349 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
15350 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
15351 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
15352 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
15353 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
15354 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
15355 bitset_stats_zero): Likewise.
15356 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
15357 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
15358 bitsetv_dump, debug_bitsetv): Likewise.
15359 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
15360 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
15361 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
15362 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
15363 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
15364 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
15365 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
15366 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
15367 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
15368 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
15369 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
15370 Likewise.
15371 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
15372 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
15373 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
15374 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
15375 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
15376 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
15377 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
15378 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
15379 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
15380 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
15381 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 15382
ae26e1f0
AD
153832002-10-14 Akim Demaille <akim@epita.fr>
15384
15385 Version 1.75.
15386
d43baf71
AD
153872002-10-14 Akim Demaille <akim@epita.fr>
15388
15389 * tests/Makefile.am (maintainer-check-posix): New.
15390
7ebc83e3
AD
153912002-10-14 Akim Demaille <akim@epita.fr>
15392
15393 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
15394 member.
15395
05846dae
AD
153962002-10-14 Akim Demaille <akim@epita.fr>
15397
15398 * src/tables.c (table_ninf_remap): base -> tab.
15399 Reported by Matt Rosing.
15400
1318e37d
PE
154012002-10-14 Paul Eggert <eggert@twinsun.com>
15402
447fbb17
PE
15403 * tests/action.at, tests/calc.at, tests/conflicts.at,
15404 tests/cxx-type.at, tests/headers.at, tests/input.at,
15405 tests/regression.at, tests/synclines.at, tests/torture.at:
15406 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
15407 so that the tests still work even if POSIXLY_CORRECT is set.
15408 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 15409
1318e37d
PE
15410 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
15411 for portability to K&R hosts. Fix typo: signed char is guaranteed
15412 only to 127, not to 128.
15413 * data/glr.c (yysigned_char): New type.
15414 * data/yacc.c (yysigned_char): Likewise.
15415 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
15416
cc0f0794
PE
154172002-10-13 Paul Eggert <eggert@twinsun.com>
15418
5038f418
PE
15419 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
15420 true due to limited range of data type" warning from GCC.
15421
cc0f0794
PE
15422 * data/c.m4 (b4_token_defines): Protect against double-inclusion
15423 by wrapping enum yytokentype's definition inside #ifndef
15424 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
15425
6fed0802
AD
154262002-10-13 Akim Demaille <akim@epita.fr>
15427
15428 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
15429 Un yy- yyrhs to avoid the name clash with the global YYRHS.
15430
32f0598d
AD
154312002-10-13 Akim Demaille <akim@epita.fr>
15432
15433 * Makefile.maint: Update from Autoconf 2.54.
15434 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
15435
7ea9a33f
AD
154362002-10-13 Akim Demaille <akim@epita.fr>
15437
15438 * src/print.c (print_state): Separate the list of solved conflicts
15439 from the other items.
15440 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
15441
ea99527d
AD
154422002-10-13 Akim Demaille <akim@epita.fr>
15443
15444 Let nondeterministic skeletons be usable with deterministic
15445 tables.
15446
15447 With the patch, GAWK compiled by GCC without -O2 passes its test
15448 suite using a GLR parser driven by LALR tables. It fails with -O2
15449 because `struct stat' gives two different answers on my machine:
15450 88 (definition of an auto var) and later 96 (memset on this var).
15451 Hence the stack is badly corrumpted. The headers inclusion is to
15452 blame: if I move the awk.h inclusion before GLR's system header
15453 inclusion, the two struct stat have the same size.
15454
15455 * src/tables.c (pack_table): Always create conflict_table.
15456 (token_actions): Always create conflict_list.
15457 * data/glr.c (YYFLAG): Remove, unused.
15458
f377f69f
AD
154592002-10-13 Akim Demaille <akim@epita.fr>
15460
15461 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
15462 (O0FLAGS): New.
15463 (VALGRIND, GXX): New.
15464 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
15465 * tests/bison.in: Run $PREBISON a pre-command.
15466 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
15467 (maintainer-check-g++): New.
15468 * Makefile.am (maintainer-check): New.
15469
2a1fe6ed
AD
154702002-10-13 Akim Demaille <akim@epita.fr>
15471
15472 * data/glr.c: Formatting changes.
15473 Tweak some trace messages to match yacc.c's.
15474
f50adbbd
AD
154752002-10-13 Akim Demaille <akim@epita.fr>
15476
15477 GLR parsers sometimes raise parse errors instead of performing the
15478 default reduction.
15479 Reported by Charles-Henry de Boysson.
15480
15481 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 15482 check the length of the traces when %glr.
f50adbbd
AD
15483 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
15484 GLR's traces.
15485 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
15486 Test GLR parsers.
15487 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
15488 (yyltype): Remove the yy prefix from the member names.
15489 (yytable): Complete its comment.
15490 (yygetLRActions): Map error action number from YYTABLE from
15491 YYTABLE_NINF to 0.
15492 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
15493 (which was a bug: it should have been YYTABEL_NINF, and yet it was
15494 not satisfying as we could compare an YYACTION computed from
15495 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
15496 only value for error actions.
15497 (yyreportParseError): In verbose parse error messages, don't issue
15498 `error' in the list of expected tokens.
15499 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
15500 next action to perform to match glr.c's decoding.
15501 (yytable): Complete its comment.
15502
bcbad5b9
PE
155032002-10-13 Paul Eggert <eggert@twinsun.com>
15504
15505 Fix problem reported by Henrik Grubbstroem in
161a71f3 15506 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
15507 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
15508 because the Bison parser reads the second action before reducing
15509 the first one.
15510 * src/scan-gram.l (rule_length): New static var.
15511 Use it to keep track of the rule length in the scanner, since
15512 we can't expect the parser to be in lock-step sync with the scanner.
15513 (handle_action_dollar, handle_action_at): Use this var.
15514 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 15515
14904b89
PE
155162002-10-12 Paul Eggert <eggert@twinsun.com>
15517
1fe611e5
PE
15518 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
15519 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
15520 Include <sys/time.h> when checking for clock_t and struct tms.
15521 Use same include order as source.
15522 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 15523 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 15524
1fe611e5
PE
15525 * lib/timevar.c: Update copyright date and clarify comments.
15526 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 15527
1fe611e5
PE
15528 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
15529 GCC version as of today, then merge Bison's changes.
15530 Change "GCC" to "Bison" in copyright notice. timevar.def's
15531 author is Akim, so change that too.
15532
98194095
PE
15533 * src/reader.c (grammar_current_rule_check):
15534 Don't worry about the default action if $$ is untyped.
15535 Prevents bogus warnings reported by Jim Gifford in
161a71f3 15536 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 15537
14904b89
PE
15538 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
15539 * data/glr.c, data/lalr1.cc, data/yacc.c:
15540 Output token definitions before the first part of user declarations.
15541 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 15542 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 15543
ff6dca18
PE
155442002-10-11 Paul Eggert <eggert@twinsun.com>
15545
15546 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
15547 (yyparse): here. This undoes some of the 2002-07-25 change.
15548 Compatibility problem reported by Ralf S. Engelschall with
15549 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
15550
eb714592
AD
155512002-10-11 Akim Demaille <akim@epita.fr>
15552
15553 * tests/regression.at Characters Escapes): New.
15554 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
15555 characters.
15556 Reported by Jan Nieuwenhuizen.
15557
b7195100
AD
155582002-10-11 Akim Demaille <akim@epita.fr>
15559
15560 * po/id.po: New.
15561
f28a0f2d
PE
155622002-10-10 Paul Eggert <eggert@twinsun.com>
15563
15564 Portability fixes for bitsets; this also avoids several GCC
15565 warnings.
15566
15567 * lib/abitset.c: Include <stddef.h>, for offsetof.
15568 * lib/lbitset.c: Likewise.
15569
15570 * lib/abitset.c (abitset_bytes): Return a size that is aligned
15571 properly for vectors of objects. Do not assume that adding a
15572 header size to a multiple of a word size yields a value that is
15573 properly aligned for the whole union.
15574 * lib/bitsetv.c (bitsetv_alloc): Likewise.
15575
15576 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
15577 unique names for structures.
15578 * lib/ebitset.c (ebitset_bytes): Likewise.
15579 * lib/lbitset.c (lbitset_bytes): Likewise.
15580
15581 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
15582 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
15583 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
15584 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
15585 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
15586 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
15587 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
15588 to improve the type-checking that GCC can do.
15589 * lib/bitset.c (bitset_op4_cmp): Likewise.
15590 * lib/bitset_stats.c (bitset_stats_count,
15591 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
15592 bitset_stats_copy, bitset_stats_disjoint_p,
15593 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
15594 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
15595 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
15596 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
15597 bitset_stats_and_or_cmp, bitset_stats_andn_or,
15598 bitset_stats_andn_or_cmp, bitset_stats_or_and,
15599 bitset_stats_or_and_cmp): Likewise.
15600 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
15601 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
15602 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
15603 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
15604
15605 * lib/abitset.h: Include bitset.h, not bbitset.h.
15606 * lib/ebitset.h: Likewise.
15607 * lib/lbitset.h: Likewise.
15608
15609 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
15610 All instances of parameters of type enum bitset_opts are now of
15611 type enum_bitset_opts, to conform to the C Standard, and similarly
15612 for enum_bitset_type.
15613 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
15614 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
15615
15616 Do not use "struct bitset_struct" to mean different things in
15617 different modules. Not only is this confusing, it violates
15618 the C Standard, which requires that structure types in different
15619 modules must be compatible if one is to be passed to the other.
15620 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
15621 All instances of "struct bitset_struct *" replaced with "bitset".
15622 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
15623 (union bitset_union, struct abitset_struct, struct ebitset_struct,
15624 struct lbitset_struct, struct bitset_stats_struct): New types.
15625 All uses of struct bitset_struct changed to union bitset_union,
15626 etc.
ba0fe3c7 15627 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
15628 struct bitset_struct): Remove.
15629 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
15630 struct bitset_struct): Remove.
15631 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
15632 bitset_struct): Remove.
15633 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
15634 Likewise.
15635
15636 Do not call a function of type T using a call that assumes the
15637 function is of a different type U. Standard C requires that a
15638 function must be called with a type that is compatible with its
15639 definition.
15640 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
15641 New decls.
15642 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
15643 New functions.
15644 * lib/ebitset.c (PFV): Remove.
15645 * lib/lbitset.c (PFV): Likewise.
15646 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
15647 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
15648 decls.
15649 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
15650 (ebitset_vtable): Use them.
15651 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
15652 lbitset_xor): New functions.
15653 (lbitset_vtable): Use them.
15654
15655 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
15656 Declare.
15657
15658 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
15659 GCC warning.
15660 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
15661 Use offsetof, for simplicity.
15662
6fbe4984
PE
156632002-10-06 Paul Eggert <eggert@twinsun.com>
15664
15665 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
15666 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 15667 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
15668 which was inadvertently undone by the 2002-09-30 patch.
15669 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
15670 the same width as int.
15671
420f93c8
PE
156722002-10-04 Paul Eggert <eggert@twinsun.com>
15673
15674 Version 1.50.
15675
15676 * configure.ac (AC_INIT), NEWS: Increment version number.
15677
15678 * doc/bison.texinfo: Minor spelling, grammar, and white space
15679 fixes.
15680 (Symbols): Mention that any negative value returned from yylex
15681 signifies end-of-input. Warn about negative chars. Mention
15682 the portable Standard C character set.
15683
15684 The GNU coding standard says CFLAGS and YFLAGS are reserved
15685 for the installer to set.
15686 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
15687 * src/Makefile.am (AM_CFLAGS): Likewise.
15688 (AM_YFLAGS): Renamed from YFLAGS.
15689
15690 Fix some MAX and MIN problems.
15691 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
15692 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
15693 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
15694 * src/reader.c (reader): Use it.
15695
15696 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
15697 POSIX 1003.1-2001 has removed fgrep.
15698
156992002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
15700
15701 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
15702 interpreted as signed.
15703 * lib/ebitset.c (ebitset_list): Fix bug.
15704
ff68026d
PE
157052002-10-01 Paul Eggert <eggert@twinsun.com>
15706
15707 More fixes for 64-bit hosts and large bitsets.
15708
15709 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
15710 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
15711 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
15712 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
15713 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
15714 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
15715 bitset_count_): Likewise.
15716 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
15717 bitset_first, bitset_last): Likewise.
15718 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
15719 bitset_stats_list_reverse, bitset_stats_size,
15720 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
15721 Likewise.
15722 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
15723 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
15724 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
15725 bitsetv_reflexive_transitive_closure): Likewise.
15726 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
15727 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
15728 Likewise.
15729 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
15730 Likewise.
420f93c8 15731
ff68026d
PE
15732 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
15733 Use size_t, not unsigned int, to count bytes.
15734 * lib/abitset.h (abitset_bytes): Likewise.
15735 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
15736 Likewise.
15737 * lib/bitset.h (bitset_bytes): Likewise.
15738 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
15739 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
15740 * lib/bitsetv.c (bitsetv_alloc): Likewise.
15741 * lib/ebitset.c (ebitset_bytes): Likewise.
15742 * lib/ebitset.h (ebitset_bytes): Likewise.
15743 * lib/lbitset.c (lbitset_bytes): Likewise.
15744 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 15745
ff68026d
PE
15746 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
15747 abitset_subset_p, abitset_disjoint_p, abitset_and,
15748 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
15749 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
15750 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
15751 abitset_or_and, abitset_or_and_cmp):
15752 Use bitset_windex instead of unsigned int.
15753 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
15754 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
15755 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
15756 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
15757 Likewise.
15758 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 15759
ff68026d
PE
15760 * lib/bitset.c (bitset_print):
15761 Use proper printf formats for widths of integer types.
15762 * lib/bitset_stats.c (bitset_percent_histogram_print,
15763 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
15764 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
15765 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
15766 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 15767
ff68026d
PE
15768 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
15769 BITSET_SIZE_MAX): New macros.
15770 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
15771 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
15772 to BITSET_WINDEX_MAX.
15773
15774 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
15775 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
15776 since we now return the bitset_bindex type (not int).
15777
15778 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
15779 when computing sizes.
15780 * lib/ebitset.c (ebitset_elts_grow): Likewise.
15781
15782 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
15783 and avoid cast to unsigned.
15784
6aa452a6
AD
157852002-09-30 Akim Demaille <akim@epita.fr>
15786
15787 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
15788 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
15789 Updates from Michael Hayes.
15790
927f7817
AD
157912002-09-30 Art Haas <ahaas@neosoft.com>
15792
15793 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
15794 invocations.
15795 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
15796 defined.
15797
9738f41e
AD
157982002-09-27 Akim Demaille <akim@epita.fr>
15799
15800 Version 1.49c.
15801
a5c75d7f
AD
158022002-09-27 Akim Demaille <akim@epita.fr>
15803
15804 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
15805 (Because of AC_LIBSOURCE).
15806
8280e179
AD
158072002-09-27 Akim Demaille <akim@epita.fr>
15808
15809 Playing with Autoscan.
15810
15811 * configure.ac: Remove the old LIBOBJ tweaks.
15812 (AC_REPLACE_FUNCS): Add strrchr and strtol.
15813 * lib/strrchr.c: New.
15814 * lib/strtol.c: New, from the Coreutils 4.5.1.
15815
ae64af35
AD
158162002-09-27 Akim Demaille <akim@epita.fr>
15817
15818 Playing with Autoscan.
15819
15820 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
15821 * lib/Makefile.am (libbison_a_SOURCES): No longer include
15822 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
15823 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
15824 Coreutils 4.5.1.
15825
d1a1114f
AD
158262002-09-24 Akim Demaille <akim@epita.fr>
15827
15828 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
15829 (Frequently Asked Questions, Parser Stack Overflow): New.
15830
b906441c
AD
158312002-09-13 Akim Demaille <akim@epita.fr>
15832
15833 Playing with autoscan.
15834
15835 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
15836 * src/files.c (skeleton_find): Remove, unused.
15837 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
15838 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
15839
bd701811
AD
158402002-09-13 Akim Demaille <akim@epita.fr>
15841
15842 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
15843 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
15844
e0a13e7b
AD
158452002-09-13 Akim Demaille <akim@epita.fr>
15846
15847 * configure.ac: Require 2.54.
15848 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
15849 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
15850 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
15851 Remove, provided by Autoconf macros.
15852
c97011bf
AD
158532002-09-12 Akim Demaille <akim@epita.fr>
15854
15855 * m4/prereq.m4: Update, from Coreutils 4.5.1.
15856
d862b1be
AD
158572002-09-12 Akim Demaille <akim@epita.fr>
15858
15859 * m4/prereq.m4: Update, from Fileutils 4.1.5.
15860 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
15861 Reported by Martin Mokrejs.
15862
3d38c03a
AD
158632002-09-10 Akim Demaille <akim@epita.fr>
15864
15865 * src/parse-gram.y: Associate a human readable string to each
15866 token type.
15867 * tests/regression.at (Invalid inputs): Adjust.
15868
b6347355
AD
158692002-09-10 Gary V. Vaughan <gary@gnu.org>
15870
15871 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
15872 with an Autoconf-2.5x style configure.ac.
15873
09ba4ab2
PE
158742002-09-06 Paul Eggert <eggert@twinsun.com>
15875
15876 * doc/bison.texinfo (Conditions): Make explicit that the GPL
15877 exception applies only to yacc.c. This is a modification of a
15878 patch originally suggested by Akim Demaille.
15879
21846f69
AD
158802002-09-06 Akim Demaille <akim@epita.fr>
15881
09ba4ab2
PE
15882 * data/c.m4 (b4_copyright): Move the GPL exception comment from
15883 here to...
15884 * data/yacc.c: here.
15885
21846f69
AD
15886 * data/lalr1.cc (struct yyltype): Don't define it, since we use
15887 LocationType.
15888 (b4_ltype): Default to yy::Location from location.hh.
15889
c0ad8bf3
AD
158902002-09-04 Jim Meyering <jim@meyering.net>
15891
15892 * data/yacc.c: Guard the declaration of yytoknum also with
15893 `#ifdef YYPRINT', so it is declared only when used.
15894
3a93251e
AD
158952002-09-04 Akim Demaille <akim@epita.fr>
15896
15897 * configure.in: Rename as...
15898 * configure.ac: this.
15899 Bump to 1.49c.
15900
427c0dda
AD
159012002-09-04 Akim Demaille <akim@epita.fr>
15902
15903 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
15904 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
15905 translate maintainer only messages.
15906
6a254321
PE
159072002-08-12 Paul Eggert <eggert@twinsun.com>
15908
645e30d1
PE
15909 Version 1.49b.
15910
6a254321
PE
15911 * Makefile.am (SUBDIRS): Remove intl.
15912 (DISTCLEANFILES): Remove.
15913 * NEWS: Mention that GNU M4 is now required. Clarify what is
15914 meant by "larger grammars". Mention the pt_BR translation.
15915 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
15916 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
15917 Bump version from 0.11.2 to 0.11.5.
15918 (BISON_PREREQ_STAGE): Remove.
15919 (AM_GNU_GETTEXT): Use external gettext.
15920 (AC_OUTPUT): Remove intl/Makefile.
15921
15922 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
15923
15924 * data/glr.c: Include string.h, for strlen.
15925 (yyreportParseError): Use size_t for yysize.
15926 (yy_yypstack): No longer nested inside yypstates, as nested
15927 functions are not portable. Do not assume size_t is the
15928 same width as int.
15929 (yypstates): Do not assume that ptrdiff_t is the same width
15930 as int, and similarly for yyposn and YYINDEX.
15931
15932 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
15933
15934 * lib/Makefile.am (INCLUDES): Do not include from the intl
15935 directory, which has been removed.
15936 * src/Makefile.am (INCLUDES): Likewise.
15937
15938 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
15939 (bitsets_sources, additional_bitsets_sources, timevars_sources):
15940 New vars.
15941
15942 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
15943 * tests/Makefile.am (EXTRA_DIST): Likewise.
15944
15945 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
15946 Do not assume that bitset_windex is the same width as unsigned.
15947
15948 * lib/abitset.c (abitset_unused_clear): Do not assume that
15949 bitset_word is the same width as int.
15950 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
15951 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
15952 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
15953 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
15954 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
15955
15956 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
15957 portability to one's complement hosts!).
15958 * lib/ebitset.c (ebitset_op1): Likewise.
15959 * lib/lbitset.c (lbitset_op1): Likewise.
15960
15961 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
15962 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
15963 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
15964 Sync with fileutils.
15965 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
15966 lib/gettext.h: Sync with diffutils.
15967
15968 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
15969 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
15970
15971 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
15972 PROTOTYPES to check for prototypes, and "defined __STDC__" to
15973 check for void *.
15974
15975 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
15976 size_t; the old version tried to do this but casted improperly.
15977 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
15978 (bitset_test): Now returns int, not unsigned long.
15979
15980 * lib/bitset_stats.c: Include "gettext.h".
15981 (_): New macro.
15982 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
15983 name locals "index", as it generates unnecessary warnings on some
15984 hosts that have an "index" function.
15985
15986 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
15987 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
15988 they need translation.
15989 * src/LR0.c (state_list_append, new_itemsets, get_state,
15990 append_states, generate_states): Likewise.
15991 * src/assoc.c (assoc_to_string): Likewise.
15992 * src/closure.c (print_closure, set_firsts, closure): Likewise.
15993 * src/gram.c (grammar_dump): Likewise.
15994 * src/injections.c (injections_compute): Likewise.
15995 * src/lalr.c (lookaheads_print): Likewise.
15996 * src/relation.c (relation_transpose): Likewise.
15997 * src/scan-gram.l: Likewise.
15998 * src/tables.c (table_grow, pack_vector): Likewise.
15999
16000 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
16001 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
16002 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
16003 * m4/mbstate_t.m4: Sync with fileutils.
16004 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
16005
16006 * po/LINGUAS: Add pt_BR.
16007 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
16008 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
16009 lib/timevar.c.
16010 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
16011 manual recommends.
16012 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
16013
16014 * src/complain.c (strerror_r): Remove decl; not needed.
16015 (strerror): Use same pattern as ../lib/error.c.
16016
16017 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
16018
16019 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
16020
16021 * src/main.c (main): Cast result of bindtextdomain and textdomain
16022 to void, to avoid a GCC warning when --disable-nls is in effect.
16023
16024 * src/scan-gram.l: Use strings rather than escapes when possible,
16025 to minimize the number of warnings from xgettext.
16026 (handle_action_dollar, handle_action_at): Don't use isdigit,
16027 as it mishandles negative chars and it may not work as expected
16028 outside the C locale.
16029
16030 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
16031 this is a GCC extension and is not portable to other compilers.
16032
16033 * src/system.h (alloca): Use same pattern as ../lib/error.c.
16034 Do not include <ctype.h>; no longer needed.
16035 Do not include <malloc.h>; no longer needed (and generates
16036 warnings on OpenBSD 3.0).
16037
16038 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
16039 it's not portable.
16040
16041 * tests/regression.at: Do not use 'cc -c input.c -o input';
16042 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
16043
16044 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
16045 exit status as failure, not just exit status 1. Sun C exits
16046 with status 2 sometimes.
16047
16048 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
16049 Use it for the two large tests.
16050
c8f002c7
AD
160512002-08-02 Akim Demaille <akim@epita.fr>
16052
16053 * src/conflicts.c (conflicts_output): Don't output rules never
16054 reduced here, since anyway that computation doesn't work.
16055 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
16056 (rule_useless_p, rule_never_reduced_p): New.
16057 (grammar_rules_partial_print): Use a filter instead of a range.
16058 Display the title only if needed.
16059 (grammar_rules_print): Adjust.
16060 (grammar_rules_never_reduced_report): New.
16061 * src/tables.c (action_row): Move the computation of rules never
16062 reduced to...
16063 (token_actions): here.
16064 * src/main.c (main): Make the parser before making the report, so
16065 that rules never reduced are computed.
16066 Call grammar_rules_never_reduced_report.
16067 * src/print.c (print_results): Report rules never reduced.
16068 * tests/conflicts.at, tests/reduce.at: Adjust.
16069
cd08e51e
AD
160702002-08-01 Akim Demaille <akim@epita.fr>
16071
16072 Instead of attaching lookaheads and duplicating the rules being
16073 reduced by a state, attach the lookaheads to the reductions.
16074
16075 * src/state.h (state_t): Remove the `lookaheads',
16076 `lookaheads_rule' member.
16077 (reductions_t): Add a `lookaheads' member.
16078 Use a regular array for the `rules'.
16079 * src/state.c (reductions_new): Initialize the lookaheads member
16080 to 0.
16081 (state_rule_lookaheads_print): Adjust.
16082 * src/state.h, src/state.c (state_reductions_find): New.
16083 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
16084 (count_rr_conflicts): Adjust.
16085 * src/lalr.c (LArule): Remove.
16086 (add_lookback_edge): Adjust.
16087 (state_lookaheads_count): New.
16088 (states_lookaheads_initialize): Merge into...
16089 (initialize_LA): this.
16090 (lalr_free): Adjust.
16091 * src/main.c (main): Don't free nullable and derives too early: it
16092 is used by --verbose.
16093 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
16094
bb0027a9
AD
160952002-08-01 Akim Demaille <akim@epita.fr>
16096
16097 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
16098 `rule_number_t**'.
16099 (set_derives, free_derives): Rename as...
16100 (derives_compute, derives_free): this.
16101 Adjust all dependencies.
16102 * src/nullable.c (set_nullable, free_nullable): Rename as...
16103 (nullable_compute, nullable_free): these.
16104 (rule_list_t): Store rule_t *, not rule_number_t.
16105 * src/state.c (state_rule_lookaheads_print): Directly compare rule
16106 pointers, instead of their numbers.
16107 * src/main.c (main): Call nullable_free, and derives_free earlier,
16108 as they were lo longer used.
16109
3325ddc4
AD
161102002-08-01 Akim Demaille <akim@epita.fr>
16111
16112 * lib/timevar.c (get_time): Include children time.
16113 * src/lalr.h (LA, LArule): Don't export them: used with the
16114 state_t.
16115 * src/lalr.c (LA, LArule): Static.
16116 * src/lalr.h, src/lalr.c (lalr_free): New.
16117 * src/main.c (main): Call it.
16118 * src/tables.c (pack_vector): Check whether loc is >= to the
16119 table_size, not >.
16120 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
16121 (tables_generate): do it, since that's also it which allocates
16122 them.
16123 Don't free LA and LArule, main does.
16124
c6f1a33c
AD
161252002-07-31 Akim Demaille <akim@epita.fr>
16126
16127 Separate parser tables computation and output.
16128
16129 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
16130 (conflict_list, conflict_list_cnt, table, check, table_ninf)
16131 (yydefgoto, yydefact, high): Move to...
16132 * src/tables.h, src/tables.c: here.
16133 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
16134 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
16135 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
16136 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
16137 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
16138 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
16139 (action_row, save_row, token_actions, save_column, default_goto)
16140 (goto_actions, sort_actions, matching_state, pack_vector)
16141 (table_ninf_remap, pack_table, prepare_actions): Move to...
16142 * src/tables.c: here.
16143 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
16144 * src/output.c (token_actions, output_base, output_conflicts)
16145 (output_check): Merge into...
16146 (prepare_actions): this.
16147 (actions_output): Rename as...
16148 (user_actions_output): this.
16149 * src/main.c (main): Call tables_generate and tables_free.
16150
1509d42f
AD
161512002-07-31 Akim Demaille <akim@epita.fr>
16152
16153 Steal GCC's --time-report support.
16154
16155 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
16156 stolen/adjusted from GCC.
16157 * m4/stage.m4: Remove time related checks.
16158 * m4/timevar.m4: New.
16159 * configure.in: Adjust.
16160 * src/system.h: Adjust to using timevar.h.
16161 * src/getargs.h, src/getargs.c: Support trace_time for
16162 --trace=time.
16163 * src/main.c (stage): Remove.
16164 (main): Replace `stage' invocations with timevar calls.
16165 * src/output.c: Insert pertinent timevar calls.
16166
273a74fa
AD
161672002-07-31 Akim Demaille <akim@epita.fr>
16168
16169 Let --trace have arguments.
16170
16171 * src/getargs.h (enum trace_e): New.
16172 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
16173 (long_options, short_options): --trace/-T takes an optional
16174 argument.
16175 Change all the uses of trace_flag to reflect the new flags.
16176 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
16177
16178 Strengthen `stage' portability.
16179
16180 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
16181 * configure.in: Use it.
16182 Don't check for malloc.h and sys/times.h.
16183 * src/system.h: Include them when appropriate.
16184 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
16185 times and struct tms are available.
16186
217598da
AD
161872002-07-30 Akim Demaille <akim@epita.fr>
16188
16189 In verbose parse error message, don't report `error' as an
16190 expected token.
16191 * tests/actions.at (Printers and Destructors): Adjust.
16192 * tests/calc.at (Calculator $1): Adjust.
16193 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
16194 error message, do not report the parser accepts the error token in
16195 that state.
16196
52489d44
AD
161972002-07-30 Akim Demaille <akim@epita.fr>
16198
16199 Normalize conflict related messages.
16200
16201 * src/complain.h, src/complain.c (warn, complain): New.
16202 * src/conflicts.c (conflicts_print): Use them.
16203 (conflict_report_yacc): New, extracted from...
16204 (conflicts_print): here.
16205 * tests/conflicts.at, tests/existing.at: Adjust.
16206
e8832397
AD
162072002-07-30 Akim Demaille <akim@epita.fr>
16208
16209 Report rules which are never reduced by the parser: those hidden
16210 by conflicts.
16211
16212 * src/LR0.c (save_reductions): Don't make the final state too
16213 different: save its reduction (accept) instead of having a state
16214 without any action (no shift or goto, no reduce).
16215 Note: the final state is now a ``regular'' state, i.e., the
16216 parsers now contain `reduce 0' as default reduction.
16217 Nevertheless, since they decide to `accept' when yystate =
16218 final_state, they still will not reduce rule 0.
16219 * src/print.c (print_actions, print_reduction): Adjust.
16220 * src/output.c (action_row): Track reduced rules.
16221 (token_actions): Report rules never reduced.
16222 * tests/conflicts.at, tests/regression.at: Adjust.
16223
caf23d24
AD
162242002-07-30 Akim Demaille <akim@epita.fr>
16225
16226 `stage' was accidently included in a previous patch.
16227 Initiate its autoconfiscation.
16228
16229 * configure.in: Look for malloc.h and sys/times.h.
16230 * src/main.c (stage): Adjust.
16231 Report only when trace_flag.
16232
640748ee
AD
162332002-07-29 Akim Demaille <akim@epita.fr>
16234
16235 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
16236 state_number_t.
16237 (errs_t): symbol_t*, not symbol_number_t.
16238 (reductions_t): rule_t*, not rule_number_t.
16239 (FOR_EACH_SHIFT): New.
16240 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
16241 * src/print.c, src/print_graph.c: Adjust.
16242
88bce5a2
AD
162432002-07-29 Akim Demaille <akim@epita.fr>
16244
16245 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
16246
16247 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
16248 (endtoken, accept): these.
16249 * src/reader.c (reader): Set endtoken's default tag to "$end".
16250 Set undeftoken's tag to "$undefined" instead of "$undefined.".
16251 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
16252 Adjust.
16253
1bfb97db
AD
162542002-07-29 Akim Demaille <akim@epita.fr>
16255
16256 * src/reduce.c (reduce_grammar): When the language is empty,
16257 complain about the start symbol, not the axiom.
16258 Use its location.
16259 * tests/reduce.at (Empty Language): New.
16260
fc5734fe
AD
162612002-07-26 Akim Demaille <akim@epita.fr>
16262
16263 * src/reader.h, src/reader.c (gram_error): ... can't get
16264 yycontrol without making too strong assumptions on the parser
16265 itself.
16266 * src/output.c (prepare_tokens): Use the real 0th value of
16267 token_translations instead of `0'.
16268 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
16269 visible here.
16270 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
16271 for the time being: %locations ought to provide it to yyerror.
16272
3650b4b8
AD
162732002-07-25 Akim Demaille <akim@epita.fr>
16274
16275 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
16276 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
16277 * tests/regression.at (Web2c Actions): Adjust.
16278
4b3d3a8e
AD
162792002-07-25 Akim Demaille <akim@epita.fr>
16280
16281 Stop storing rules from 1 to nrules + 1.
16282
16283 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
16284 * src/nullable.c, src/output.c, src/print.c, src/reader.c
16285 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
16286 Iterate from 0 to nrules.
16287 Use rule_number_as_item_number and item_number_as_rule_number.
16288 Adjust to `derive' now containing possibly 0.
16289 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
16290 Handle the `- 1' part in rule numbers from/to item numbers.
16291 * src/conflicts.c (log_resolution): Fix the message which reversed
16292 shift and reduce.
16293 * src/output.c (action_row): Initialize default_rule to -1.
16294 (token_actions): Adjust.
16295 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
16296 expected output.
16297 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
16298
4a2a22f4
AD
162992002-07-25 Akim Demaille <akim@epita.fr>
16300
16301 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
16302 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
16303 (b4_c_knr_arg_decl): New.
16304 * data/yacc.c: Use it to define yysymprint, yydestruct, and
16305 yyreport_parse_error.
16306
b8df3223
AD
163072002-07-25 Akim Demaille <akim@epita.fr>
16308
16309 * data/yacc.c (yyreport_parse_error): New, extracted from...
16310 (yyparse): here.
16311 (yydestruct, yysymprint): Move above yyparse.
16312 Be K&R compliant.
16313
a762e609
AD
163142002-07-25 Akim Demaille <akim@epita.fr>
16315
16316 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
16317 replace...
16318 (b4_sint_type, b4_uint_type): these.
16319 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
16320 * tests/regression.at (Web2c Actions): Adjust.
16321
12b0043a
AD
163222002-07-25 Akim Demaille <akim@epita.fr>
16323
16324 * src/gram.h (TIEM_NUMBER_MAX): New.
16325 (item_number_of_rule_number, rule_number_of_item_number): Rename
16326 as...
16327 (rule_number_as_item_number, item_number_as_rule_number): these.
16328 Adjust dependencies.
16329 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
16330 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
16331 (symbol_number_to_vector_number): New.
16332 (order): Of vector_number_t* type.
16333 (base_t, BASE_MAX, BASE_MIN): New.
16334 (froms, tos, width, pos, check): Of base_t type.
16335 (action_number_t, ACTION_MIN, ACTION_MAX): New.
16336 (actrow): Of action_number_t type.
16337 (conflrow): Of unsigned int type.
16338 (table_ninf, base_ninf): New.
16339 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
16340 (muscle_insert_int_table, muscle_insert_base_table)
16341 (muscle_insert_rule_number_table): New.
16342 (prepare_tokens): Output `toknum' as int_table.
16343 (action_row): Returns a rule_number_t.
16344 Use ACTION_MIN, not SHRT_MIN.
16345 (token_actions): yydefact is rule_number_t*.
16346 (table_ninf_remap): New.
16347 (pack_table): Use it for `base' and `table'.
16348 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
16349 replaced with...
16350 (YYPACT_NINF, YYTABLE_NINF): these.
16351 (yypact, yytable): Compute their types instead of hard-coded
16352 `short'.
16353 * tests/regression.at (Web2c Actions): Adjust.
16354
5dde258a
AD
163552002-07-19 Akim Demaille <akim@epita.fr>
16356
16357 * src/scan-gram.l (id): Can start with an underscore.
16358
a945ec39
AD
163592002-07-16 Akim Demaille <akim@epita.fr>
16360
16361 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
16362 Adjust all former `associativity' dependencies.
16363 * src/symtab.c (symbol_new): Default associativity is `undef', not
16364 `right'.
16365 (symbol_check_alias_consistence): Adjust.
16366
fae437e8
AD
163672002-07-09 Akim Demaille <akim@epita.fr>
16368
16369 * doc/bison.texinfo: Properly set the ``header'' part.
16370 Use @dircategory ``GNU programming tools'' as per Texinfo's
16371 documentation.
16372 Use @copying.
16373
1a715ef2
AD
163742002-07-09 Akim Demaille <akim@epita.fr>
16375
16376 * lib/quotearg.h: Protect against multiple inclusions.
16377 * src/location.h (location_t): Add a `file' member.
16378 (LOCATION_RESET, LOCATION_PRINT): Adjust.
16379 * src/complain.c (warn_at, complain_at, fatal_at): Drop
16380 `error_one_per_line' support.
16381
a5d50994
AD
163822002-07-09 Akim Demaille <akim@epita.fr>
16383
16384 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
16385 * src/reader.c (lineno): Remove.
16386 Adjust all dependencies.
16387 (get_merge_function): Take a location and use complain_at.
16388 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
16389 * tests/regression.at (Invalid inputs, Mixing %token styles):
16390 Adjust.
16391
b275314e
AD
163922002-07-09 Akim Demaille <akim@epita.fr>
16393
16394 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
16395 recovery rule, and forbid extensions when --yacc.
16396 (gram_error): Use complain_at.
16397 * src/reader.c (reader): Exit if there were parse errors.
16398
865b9df1
AD
163992002-07-09 Akim Demaille <akim@epita.fr>
16400
16401 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
16402 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
16403 Reported by R Blake <blakers@mac.com>.
16404
c76e14da
AD
164052002-07-09 Akim Demaille <akim@epita.fr>
16406
16407 * data/yacc.c: Output the copyright notive in the header.
16408
7db2ed2d
AD
164092002-07-03 Akim Demaille <akim@epita.fr>
16410
16411 * src/output.c (froms, tos): Are state_number_t.
16412 (save_column): sp, sp1, and sp2 are state_number_t.
16413 (prepare): Rename `final' as `final_state_number', `nnts' as
16414 `nterms_number', `nrules' as `rules_number', `nstates' as
16415 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
16416 unused.
16417 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
16418 * data/lalr1.cc (nsym_): Remove, unused.
16419
e68e0410
AD
164202002-07-03 Akim Demaille <akim@epita.fr>
16421
16422 * src/lalr.h, src/lalr.c (goto_number_t): New.
16423 * src/lalr.c (goto_list_t): New.
16424 Propagate them.
16425 * src/nullable.c (rule_list_t): New.
16426 Propagate.
16427 * src/types.h: Remove.
16428
e1a4f3a4
AD
164292002-07-03 Akim Demaille <akim@epita.fr>
16430
16431 * src/closure.c (print_fderives): Use rule_rhs_print.
16432 * src/derives.c (print_derives): Use rule_rhs_print.
16433 (rule_list_t): New, replaces `shorts'.
16434 (set_derives): Add comments.
16435 * tests/sets.at (Nullable, Firsts): Adjust.
16436
536545f3
AD
164372002-07-03 Akim Demaille <akim@epita.fr>
16438
16439 * src/output.c (prepare_actions): Free `tally' and `width'.
16440 (prepare_actions): Allocate and free `order'.
16441 * src/symtab.c (symbols_free): Free `symbols'.
16442 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
16443 * src/output.c (m4_invoke): Move to...
16444 * src/scan-skel.l: here.
16445 (<<EOF>>): Close yyout, and free its name.
16446
8b752b00
AD
164472002-07-03 Akim Demaille <akim@epita.fr>
16448
16449 Fix some memory leaks, and fix a bug: state 0 was examined twice.
16450
16451 * src/LR0.c (new_state): Merge into...
16452 (state_list_append): this.
16453 (new_states): Merge into...
16454 (generate_states): here.
16455 (set_states): Don't ensure a proper `errs' state member here, do it...
16456 * src/conflicts.c (conflicts_solve): here.
16457 * src/state.h, src/state.c: Comment changes.
16458 (state_t): Rename member `shifts' as `transitions'.
16459 Adjust all dependencies.
16460 (errs_new): For consistency, also take the values as argument.
16461 (errs_dup): Remove.
16462 (state_errs_set): New.
16463 (state_reductions_set, state_transitions_set): Assert that no
16464 previous value was assigned.
16465 (state_free): New.
16466 (states_free): Use it.
16467 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
16468 temporary storage: use `errs' and `nerrs' as elsewhere.
16469 (set_conflicts): Allocate and free this `errs'.
16470
613f5e1a
AD
164712002-07-02 Akim Demaille <akim@epita.fr>
16472
16473 * lib/libiberty.h: New.
16474 * lib: Update the bitset implementation from upstream.
16475 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
16476 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
16477 * src/main.c: Adjust bitset stats calls.
16478
26e0cadc
PE
164792002-07-01 Paul Eggert <eggert@twinsun.com>
16480
16481 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
16482 char, so that negative chars don't collide with $.
16483
1154cced
AD
164842002-06-30 Akim Demaille <akim@epita.fr>
16485
16486 Have the GLR tests be `warning' checked, and fix the warnings.
16487
16488 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
16489 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
16490 (yyremoveDeletes): `yyi' and `yyj' are size_t.
16491 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
16492 (yyaddDeferredAction): static.
16493 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
16494 (yyreportParseError): yyprefix is const.
16495 yytokenp is used only when verbose.
16496 (yy__GNUC__): Replace with __GNUC__.
16497 (yypdumpstack): yyi is size_t.
16498 (yypreference): Un-yy local variables and arguments, to avoid
16499 clashes with `yyr1'. Anyway, we are not in the user name space.
16500 (yytname_size): be an int, as is compared with ints.
16501 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
16502 Use them.
16503 * tests/cxx-gram.at: Use quotation to protect $1.
16504 Use AT_COMPILE to enable warnings hunts.
16505 Prototype yylex and yyerror.
16506 `Use' argc.
16507 Include `string.h', not `strings.h'.
16508 Produce and prototype stmtMerge only when used.
16509 yylex takes a location.
16510
97650f4e
AD
165112002-06-30 Akim Demaille <akim@epita.fr>
16512
16513 We spend a lot of time in quotearg, in particular when --verbose.
16514
16515 * src/symtab.c (symbol_get): Store a quoted version of the key.
16516 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
16517 Adjust all callers.
16518
d2576365
AD
165192002-06-30 Akim Demaille <akim@epita.fr>
16520
16521 * src/state.h (reductions_t): Rename member `nreds' as num.
16522 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
16523 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
16524
ccaf65bc
AD
165252002-06-30 Akim Demaille <akim@epita.fr>
16526
16527 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
16528 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
16529 (shifts_to): Rename as...
16530 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
16531 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
16532 (TRANSITION_IS_DISABLED, transitions_to): these.
16533
87675353
AD
165342002-06-30 Akim Demaille <akim@epita.fr>
16535
16536 * src/print.c (print_shifts, print_gotos): Merge into...
16537 (print_transitions): this.
16538 (print_transitions, print_errs, print_reductions): Align the
16539 lookaheads columns.
16540 (print_core, print_transitions, print_errs, print_state,
16541 print_grammar): Output empty lines separator before, not after.
16542 (state_default_rule_compute): Rename as...
16543 (state_default_rule): this.
16544 * tests/conflicts.at (Defaulted Conflicted Reduction),
16545 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
16546 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
16547
ce4ccb4b
AD
165482002-06-30 Akim Demaille <akim@epita.fr>
16549
16550 Display items as we display rules.
16551
16552 * src/gram.h, src/gram.c (rule_lhs_print): New.
16553 * src/gram.c (grammar_rules_partial_print): Use it.
16554 * src/print.c (print_core): Likewise.
16555 * tests/conflicts.at (Defaulted Conflicted Reduction),
16556 (Unresolved SR Conflicts): Adjust.
16557 (Unresolved SR Conflicts): Adjust and rename as...
16558 (Resolved SR Conflicts): this, as was meant.
16559 * tests/regression.at (Web2c Report): Adjust.
16560
bc933ef1
AD
165612002-06-30 Akim Demaille <akim@epita.fr>
16562
16563 * src/print.c (state_default_rule_compute): New, extracted from...
16564 (print_reductions): here.
16565 Pessimize, but clarify the code.
16566 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
16567
53d4308d
AD
165682002-06-30 Akim Demaille <akim@epita.fr>
16569
16570 * src/output.c (action_row): Let default_rule be always a rule
16571 number.
16572
574fb2d5
AD
165732002-06-30 Akim Demaille <akim@epita.fr>
16574
16575 * src/closure.c (print_firsts, print_fderives, closure):
16576 Use BITSET_EXECUTE.
16577 * src/lalr.c (lookaheads_print): Likewise.
16578 * src/state.c (state_rule_lookaheads_print): Likewise.
16579 * src/print_graph.c (print_core): Likewise.
16580 * src/print.c (print_reductions): Likewise.
16581 * src/output.c (action_row): Likewise.
16582 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
16583
05811fd7
AD
165842002-06-30 Akim Demaille <akim@epita.fr>
16585
16586 * src/print_graph.c: Use report_flag.
16587
0e4d5753
AD
165882002-06-30 Akim Demaille <akim@epita.fr>
16589
16590 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
16591 to...
16592 * src/relation.h, src/relation.c (traverse, relation_digraph)
16593 (relation_print, relation_transpose): New.
16594
24c7d800
AD
165952002-06-30 Akim Demaille <akim@epita.fr>
16596
16597 * src/state.h, src/state.c (shifts_to): New.
16598 * src/lalr.c (build_relations): Use it.
16599
9222837b
AD
166002002-06-30 Akim Demaille <akim@epita.fr>
16601
16602 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
16603 (item_number_of_rule_number, rule_number_of_item_number): New.
16604 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
16605 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
16606 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
16607 Propagate their use.
16608 Much remains to be done, in particular wrt `shorts' from types.h.
16609
260008e5
AD
166102002-06-30 Akim Demaille <akim@epita.fr>
16611
16612 * src/symtab.c (symbol_new): Initialize the `printer' member.
16613
8a731ca8
AD
166142002-06-30 Akim Demaille <akim@epita.fr>
16615
16616 * src/LR0.c (save_reductions): Remove, replaced by...
16617 * src/state.h, src/state.c (state_reductions_set): New.
16618 (reductions, errs): Rename as...
16619 (reductions_t, errs_t): these.
16620 Adjust all dependencies.
16621
32e1e0a4
AD
166222002-06-30 Akim Demaille <akim@epita.fr>
16623
16624 * src/LR0.c (state_list_t, state_list_append): New.
16625 (first_state, last_state): Now symbol_list_t.
16626 (this_state): Remove.
16627 (new_itemsets, append_states, save_reductions): Take a state_t as
16628 argument.
16629 (set_states, generate_states): Adjust.
16630 (save_shifts): Remove, replaced by...
16631 * src/state.h, src/state.c (state_shifts_set): New.
16632 (shifts): Rename as...
16633 (shifts_t): this.
16634 Adjust all dependencies.
16635 * src/state.h (state_t): Remove the `next' member.
16636
e5fb6710
AD
166372002-06-30 Akim Demaille <akim@epita.fr>
16638
16639 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
16640 escaped in slot 0.
16641
c7ca99d4
AD
166422002-06-30 Akim Demaille <akim@epita.fr>
16643
16644 Use hash.h for the state hash table.
16645
16646 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
16647 (allocate_storage): Use state_hash_new.
16648 (free_storage): Use state_hash_free.
16649 (new_state, get_state): Adjust.
16650 * src/lalr.h, src/lalr.c (states): Move to...
16651 * src/states.h (state_t): Remove the `link' member, no longer
16652 used.
16653 * src/states.h, src/states.c: here.
16654 (state_hash_new, state_hash_free, state_hash_lookup)
16655 (state_hash_insert, states_free): New.
16656 * src/states.c (state_table, state_compare, state_hash): New.
16657 * src/output.c (output_actions): Do not free states now, since we
16658 still need to know the final_state number in `prepare', called
16659 afterwards. Do it...
16660 * src/main.c (main): here: call states_free after `output'.
16661
df0e7316
AD
166622002-06-30 Akim Demaille <akim@epita.fr>
16663
16664 * src/state.h, src/state.c (state_new): New, extracted from...
16665 * src/LR0.c (new_state): here.
16666 * src/state.h (STATE_ALLOC): Move to...
16667 * src/state.c: here.
16668 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
16669 * src/state.h, src/state.c: here.
16670
39f41916
AD
166712002-06-30 Akim Demaille <akim@epita.fr>
16672
16673 * src/reader.c (gensym): Rename as...
16674 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
16675 (getsym): Rename as...
16676 (symbol_get): this.
16677
d57650a5
AD
166782002-06-30 Akim Demaille <akim@epita.fr>
16679
16680 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
16681 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
16682 * src/output.c, src/print.c, src/print_graph.c: Propagate.
16683 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
16684
5a08f1ce
AD
166852002-06-30 Akim Demaille <akim@epita.fr>
16686
16687 Make the test suite pass with warnings checked.
16688
16689 * tests/actions.at (Printers and Destructors): Improve.
16690 Avoid unsigned vs. signed issues.
16691 * tests/calc.at: Don't exercise the scanner here, do it...
16692 * tests/input.at (Torturing the Scanner): here.
16693
720623af
PH
166942002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16695
88e7e941 16696 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
16697 reorganize first lines parallel to yacc.c.
16698
fb8135fa
AD
166992002-06-28 Akim Demaille <akim@epita.fr>
16700
16701 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
16702 (b4_token_enum, b4_token_defines): New, factored from...
16703 * data/lalr1.cc, data/yacc.c, glr.c: here.
16704
41442480
AD
167052002-06-28 Akim Demaille <akim@epita.fr>
16706
16707 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
16708 unused variables.
16709 * src/output.c (merger_output): static.
16710
e0e5bf84
AD
167112002-06-28 Akim Demaille <akim@epita.fr>
16712
ba0fe3c7 16713 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
16714 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
16715 pacify GCC.
16716 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 16717
676385e2
PH
167182002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16719
16720 Accumulated changelog for new GLR parsing features.
16721
6a254321 16722 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
16723 conflicts_total_count.
16724 * src/conflicts.h: Ditto.
16725 * src/output.c (token_actions): Use the new name.
16726 (output_conflicts): Change conflp => conflict_list_heads, and
16727 confl => conflict_list for better readability.
16728 * data/glr.c: Use the new names.
16729 * NEWS: Add self to GLR announcement.
e0e5bf84 16730
676385e2
PH
16731 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
16732
16733 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
16734 Akim Demaille.
16735
16736 * data/bison.glr: Change name to glr.c
16737 * data/glr.c: Renamed from bison.glr.
16738 * data/Makefile.am: Add glr.c
e0e5bf84
AD
16739
16740 * src/getargs.c:
16741
676385e2 16742 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 16743 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 16744
676385e2
PH
16745 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16746
16747 * data/bison.glr: Be sure to restore the
16748 current #line when returning to the skeleton contents after having
16749 exposed the input file's #line.
16750
16751 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16752
16753 * data/bison.glr: Bring up to date with changes to bison.simple.
16754
16755 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16756
16757 * data/bison.glr: Correct definitions that use b4_prefix.
16758 Various reformatting.
16759 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
16760 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
16761 yytokenp argument; now part of stack.
16762 (yychar): Define to behave as documented.
16763 (yyclearin): Ditto.
e0e5bf84 16764
676385e2
PH
16765 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16766
16767 * src/reader.h: Add declaration for free_merger_functions.
16768
16769 * src/reader.c (merge_functions): New variable.
16770 (get_merge_function): New function.
16771 (free_merger_functions): New function.
16772 (readgram): Check for %prec that is not followed by a symbol.
16773 Handle %dprec and %merge declarations.
16774 (packgram): Initialize dprec and merger fields in rules array.
16775
16776 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
16777 conflict_list_cnt, conflict_list_free): New variables.
16778 (table_grow): Also grow conflict_table.
e0e5bf84 16779 (prepare_rules): Output dprec and merger tables.
676385e2 16780 (conflict_row): New function.
e0e5bf84 16781 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
16782 default reduction in conflicted states for GLR parser so that there
16783 are spaces for the conflict lists.
16784 (save_row): Also save conflict information.
16785 (token_actions): Allocate conflict list.
16786 (merger_output): New function.
16787 (pack_vector): Pack conflict table, too.
16788 (output_conflicts): New function to output yyconflp and yyconfl.
16789 (output_check): Allocate conflict_tos.
16790 (output_actions): Output conflict tables, also.
16791 (output_skeleton): Output b4_mergers definition.
16792 (prepare): Output b4_max_rhs_length definition.
16793 Use 'bison.glr' as default skeleton for GLR parsers.
16794
16795 * src/gram.c (glr_parser): New flag.
16796 (grammar_free): Call free_merger_functions.
16797
16798 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
16799 all pairs of conflicting reductions, rather than just all tokens
16800 causing conflicts. Needed to size conflict tables.
e0e5bf84 16801 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
16802 interface.
16803 (conflicts_print): Ditto.
16804 (count_total_conflicts): New function.
16805
16806 * src/reader.h (merger_list): New type.
16807 (merge_functions): New variable.
16808
16809 * src/lex.h (tok_dprec, tok_merge): New token types.
16810
16811 * src/gram.h (rule_s): Add dprec and merger fields.
16812 (glr_parser): New flag.
16813
16814 * src/conflicts.h (count_total_conflicts): New function.
16815
16816 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
16817
16818 * doc/bison.texinfo (Generalized LR Parsing): New section.
16819 (GLR Parsers): New section.
16820 (Language and Grammar): Mention GLR parsing.
16821 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
16822 Correct typo ("tge" -> "the").
16823
16824 * data/bison.glr: New skeleton for GLR parsing.
16825
16826 * tests/cxx-gram.at: New tests for GLR parsing.
16827
16828 * tests/testsuite.at: Include cxx-gram.at.
16829
16830 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 16831
676385e2
PH
16832 * src/parse-gram.y:
16833
16834 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
16835
16836 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 16837
b5480d74 168382002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
16839
16840 * src/options.h, src/options.c: Remove.
16841 * src/getargs.c (short_options, long_options): New.
16842
60491a94
AD
168432002-06-27 Akim Demaille <akim@epita.fr>
16844
16845 * data/bison.simple, data/bison.c++: Rename as...
16846 * data/yacc.c, data/lalr1.cc: these.
16847 * doc/bison.texinfo (Environment Variables): Remove.
16848
9be0c25b
AD
168492002-06-25 Raja R Harinath <harinath@cs.umn.edu>
16850
16851 * src/getargs.c (report_argmatch): Initialize strtok().
16852
1ae72863
AD
168532002-06-20 Akim Demaille <akim@epita.fr>
16854
16855 * data/bison.simple (b4_symbol_actions): New, replaces...
16856 (b4_symbol_destructor, b4_symbol_printer): these.
16857 (yysymprint): Be sure to call YYPRINT only for tokens, and using
16858 user token numbers.
16859
87542d29
AD
168602002-06-20 Akim Demaille <akim@epita.fr>
16861
16862 * data/bison.simple (yydestructor): Rename as...
16863 (yydestruct): this.
16864
1a31ed21
AD
168652002-06-20 Akim Demaille <akim@epita.fr>
16866
16867 * src/symtab.h, src/symtab.c (symbol_type_set)
16868 (symbol_destructor_set, symbol_precedence_set): The location is
16869 the last argument.
16870 Adjust all callers.
16871
e776192e
AD
168722002-06-20 Akim Demaille <akim@epita.fr>
16873
16874 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
16875 internals.
16876 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
16877 Takes a location.
16878 * src/symtab.h, src/symtab.c (symbol_class_set)
16879 (symbol_user_token_number_set): Likewise.
16880 Adjust all callers.
16881 Promote complain_at.
16882 * tests/input.at (Type Clashes): Adjust.
16883
5c1180b3
AD
168842002-06-20 Akim Demaille <akim@epita.fr>
16885
16886 * data/bison.simple (YYLEX): Fix the declaration when
16887 %pure-parser.
16888
e3170060
AD
168892002-06-20 Akim Demaille <akim@epita.fr>
16890
16891 * data/bison.simple (yysymprint): Don't print the token number,
16892 just its name.
16893 * tests/actions.at (Destructors): Rename as...
16894 (Printers and Destructors): this.
16895 Also exercise %printer.
16896
253862fd
AD
168972002-06-20 Akim Demaille <akim@epita.fr>
16898
16899 * data/bison.simple (YYDSYMPRINT): New.
16900 Use it to remove many of the #if YYDEBUG/if (yydebug).
16901
366eea36
AD
169022002-06-20 Akim Demaille <akim@epita.fr>
16903
16904 * src/symtab.h, src/symtab.c (symbol_t): printer and
16905 printer_location are new members.
16906 (symbol_printer_set): New.
16907 * src/parse-gram.y (PERCENT_PRINTER): New token.
16908 Handle its associated rule.
16909 * src/scan-gram.l: Adjust.
16910 (handle_destructor_at, handle_destructor_dollar): Rename as...
16911 (handle_symbol_code_at, handle_symbol_code_dollar): these.
16912 * src/output.c (symbol_printers_output): New.
16913 (output_skeleton): Call it.
16914 * data/bison.simple (yysymprint): New. Cannot be named yyprint
16915 since there are already many grammar files with a user `yyprint'.
16916 Replace the calls to YYPRINT to calls to yysymprint.
16917 * tests/calc.at: Adjust.
16918 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
16919 taking advantage of parser very internal details (stack size!).
16920
4f25ebb0
AD
169212002-06-20 Akim Demaille <akim@epita.fr>
16922
16923 * src/scan-gram.l: Complete the scanner with the missing patterns
16924 to pacify Flex.
16925 Use `quote' and `symbol_tag_get' where appropriate.
16926
93b68a0e
AD
169272002-06-19 Akim Demaille <akim@epita.fr>
16928
16929 * tests/actions.at (Destructors): Augment to test locations.
16930 * data/bison.simple (yydestructor): Pass it the current location
16931 if locations are enabled.
16932 Prototype only when __STDC__ or C++.
16933 Change the argument names to move into the yy name space: there is
16934 user code here.
16935
58612f1d
AD
169362002-06-19 Akim Demaille <akim@epita.fr>
16937
74310291
AD
16938 * data/bison.simple (b4_pure_if): New.
16939 Use it instead of #ifdef YYPURE.
16940
169412002-06-19 Akim Demaille <akim@epita.fr>
16942
16943 * data/bison.simple (b4_location_if): New.
58612f1d
AD
16944 Use it instead of #ifdef YYLSP_NEEDED.
16945
f25bfb75
AD
169462002-06-19 Akim Demaille <akim@epita.fr>
16947
16948 Prepare @$ in %destructor, but currently don't bind it in the
16949 skeleton, as %location use is not cleaned up yet.
16950
16951 * src/scan-gram.l (handle_dollar, handle_destructor_at)
16952 (handle_action_at): New.
16953 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
16954 a braced_code_t and a location as additional arguments.
16955 (handle_destructor_dollar): Instead of requiring `b4_eval', just
16956 unquote one when outputting `b4_dollar_dollar'.
16957 Adjust callers.
16958 * data/bison.simple (b4_eval): Remove.
16959 (b4_symbol_destructor): Adjust.
16960 * tests/input.at (Invalid @n): Adjust.
16961
c732d2c6
AD
169622002-06-19 Zack Weinberg <zack@codesourcery.com>
16963
16964 * doc/bison.texinfo: Document ability to have multiple
16965 prologue sections.
16966
8c165d89
AD
169672002-06-18 Akim Demaille <akim@epita.fr>
16968
16969 * src/files.c (compute_base_names): When computing the output file
16970 names from the input file name, strip the directory part.
16971
ca98bf57
AD
169722002-06-18 Akim Demaille <akim@epita.fr>
16973
16974 * data/bison.simple.new: Comment changes.
16975 Reported by Andreas Schwab.
16976
0bfb02ff
AD
169772002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
16978
16979 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
16980 there are no `label `yyoverflowlab' defined but not used' warnings
16981 when yyoverflow is defined.
16982
24c0aad7
AD
169832002-06-18 Akim Demaille <akim@epita.fr>
16984
16985 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
16986 new member.
16987 (symbol_destructor_set): Adjust.
16988 * src/output.c (symbol_destructors_output): Output the destructor
16989 locations.
16990 Output the symbol name.
16991 * data/bison.simple (b4_symbol_destructor): Adjust.
16992
5719c109
AD
169932002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
16994 and Akim Demaille <akim@epita.fr>
16995
16996 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
16997 what's left on the stack when the error recovery hits EOF.
16998 * tests/actions.at (Destructors): Complete to exercise this case.
16999
9280d3ef
AD
170002002-06-17 Akim Demaille <akim@epita.fr>
17001
17002 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
17003 arguments is really empty, not only equal to `[]'.
17004 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
17005 member.
17006 (symbol_destructor_set): New.
17007 * src/output.c (symbol_destructors_output): New.
17008 * src/reader.h (brace_code_t, current_braced_code): New.
17009 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
17010 (handle_dollar): Rename as...
17011 (handle_action_dollar): this.
17012 (handle_destructor_dollar): New.
17013 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
17014 (grammar_declaration): Use it.
17015 * data/bison.simple (yystos): Is always defined.
17016 (yydestructor): New.
17017 * tests/actions.at (Destructors): New.
17018 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
17019
dafdc66f
AD
170202002-06-17 Akim Demaille <akim@epita.fr>
17021
17022 * src/symlist.h, src/symlist.c (symbol_list_length): New.
17023 * src/scan-gram.l (handle_dollar, handle_at): Compute the
17024 rule_length only when needed.
17025 * src/output.c (actions_output, token_definitions_output): Output
17026 the full M4 block.
17027 * src/symtab.c: Don't access directly to the symbol tag, use
17028 symbol_tag_get.
17029 * src/parse-gram.y: Use symbol_list_free.
17030
56c47203
AD
170312002-06-17 Akim Demaille <akim@epita.fr>
17032
17033 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
17034 (symbol_list_prepend, get_type_name): Move to...
17035 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
17036 (symbol_list_prepend, symbol_list_n_type_name_get): here.
17037 Adjust all callers.
17038 (symbol_list_free): New.
17039 * src/scan-gram.l (handle_dollar): Takes a location.
17040 * tests/input.at (Invalid $n): Adjust.
17041
1e0bab92
AD
170422002-06-17 Akim Demaille <akim@epita.fr>
17043
17044 * src/reader.h, src/reader.c (symbol_list_new): Export it.
17045 (symbol_list_prepend): New.
17046 * src/parse-gram.y (%union): `list' is a new member.
17047 (symbols.1): New, replaces...
17048 (terms_to_prec.1, nterms_to_type.1): these.
17049 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
17050 Take a location as additional argument.
17051 Adjust all callers.
17052
04e60654
AD
170532002-06-15 Akim Demaille <akim@epita.fr>
17054
17055 * src/parse-gram.y: Move %token in the declaration section so that
17056 we don't depend upon CVS Bison.
17057
10e5b8bd
AD
170582002-06-15 Akim Demaille <akim@epita.fr>
17059
17060 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
17061 * src/print.c (print_core): Use it.
17062
9801d40c
AD
170632002-06-15 Akim Demaille <akim@epita.fr>
17064
17065 * src/conflicts.c (log_resolution): Accept the rule involved in
17066 the sr conflicts instead of the lookahead number that points to
17067 that rule.
17068 (flush_reduce): Accept the current lookahead vector as argument,
17069 instead of the index in LA.
17070 (resolve_sr_conflict): Accept the current number of lookahead
17071 bitset to consider for the STATE, instead of the index in LA.
17072 (set_conflicts): Adjust.
17073 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
17074
c0263492
AD
170752002-06-15 Akim Demaille <akim@epita.fr>
17076
17077 * src/state.h (state_t): Replace the `lookaheadsp' member, a
17078 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
17079 Adjust all dependencies.
17080 * src/lalr.c (initialize_lookaheads): Split into...
17081 (states_lookaheads_count, states_lookaheads_initialize): these.
17082 (lalr): Adjust.
17083
9757c359
AD
170842002-06-15 Akim Demaille <akim@epita.fr>
17085
17086 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
17087 out of...
17088 (grammar_rules_print): here.
17089 * src/reduce.c (reduce_output): Use it.
17090 * tests/reduce.at (Useless Rules, Reduced Automaton)
17091 (Underivable Rules): Adjust.
17092
6b98e4b5
AD
170932002-06-15 Akim Demaille <akim@epita.fr>
17094
17095 Copy BYacc's nice way to report the grammar.
17096
17097 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
17098 New.
17099 Don't print the rules' location, it is confusing and useless.
17100 (rule_print): Use grammar_rhs_print.
17101 * src/print.c (print_grammar): Use grammar_rules_print.
17102
6b98e4b5
AD
171032002-06-15 Akim Demaille <akim@epita.fr>
17104
17105 Complete and rationalize `useless thing' warnings.
17106
17107 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
17108 (symbol_tag_print): New.
17109 Use them everywhere in place of accessing directly the tag member.
17110 * src/gram.h, src/gram.c (rule_print): New.
17111 Use it where a rule used to be printed `by hand'.
17112 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
17113 (reduce_grammar_tables): Report the useless rules.
17114 (reduce_print): Useless things are a warning, not an error.
17115 Report it as such.
17116 * tests/reduce.at (Useless Nonterminals, Useless Rules):
17117 (Reduced Automaton, Underivable Rules): Adjust.
17118 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
17119 * tests/conflicts.at (Unresolved SR Conflicts)
17120 (Solved SR Conflicts): Adjust.
17121
ee000ba4
AD
171222002-06-15 Akim Demaille <akim@epita.fr>
17123
17124 Let symbols have a location.
17125
17126 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
17127 (getsym): Adjust.
17128 Adjust all callers.
17129 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
17130 Use location_t, not int.
17131 * src/symtab.c (symbol_check_defined): Take advantage of the
17132 location.
17133 * tests/regression.at (Invalid inputs): Adjust.
17134
8efe435c
AD
171352002-06-15 Akim Demaille <akim@epita.fr>
17136
17137 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
17138 (input): Don't try to initialize yylloc here, do it in the
17139 scanner.
17140 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
17141 * src/gram.h (rule_t): Change line and action_line into location
17142 and action_location, of location_t type.
17143 Adjust all dependencies.
17144 * src/location.h, src/location.c (empty_location): New.
17145 * src/reader.h, src/reader.c (grammar_start_symbol_set)
17146 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
17147 (grammar_current_rule_symbol_append)
17148 (grammar_current_rule_action_append): Expect a location as argument.
17149 * src/reader.c (grammar_midrule_action): Adjust to attach an
17150 action's location as dummy symbol location.
17151 * src/symtab.h, src/symtab.c (startsymbol_location): New.
17152 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
17153 the line numbers.
17154
1921f1d7
AD
171552002-06-14 Akim Demaille <akim@epita.fr>
17156
17157 Grammar declarations may be found in the grammar section.
17158
17159 * src/parse-gram.y (rules_or_grammar_declaration): New.
17160 (declarations): Each declaration may end with a semicolon, not
17161 just...
17162 (grammar_declaration): `"%union"'.
17163 (grammar): Branch to rules_or_grammar_declaration.
17164
4515534c
AD
171652002-06-14 Akim Demaille <akim@epita.fr>
17166
17167 * src/main.c (main): Invoke scanner_free.
17168
f958596b
AD
171692002-06-14 Akim Demaille <akim@epita.fr>
17170
17171 * src/output.c (m4_invoke): Extracted from...
17172 (output_skeleton): here.
17173 Free tempfile.
17174
2c569025
AD
171752002-06-14 Akim Demaille <akim@epita.fr>
17176
17177 * src/parse-gram.y (directives, directive, gram)
17178 (grammar_directives, precedence_directives, precedence_directive):
17179 Rename as...
17180 (declarations, declaration, grammar, grammar_declaration)
17181 (precedence_declaration, precedence_declarator): these.
17182 (symbol_declaration): New.
17183
592e8d4d
AD
171842002-06-14 Akim Demaille <akim@epita.fr>
17185
17186 * src/files.c (action_obstack): Remove, unused.
17187 (output_obstack): Remove it, and all its dependencies, as it is no
17188 longer needed.
17189 * src/reader.c (epilogue_set): Build the epilogue in the
17190 muscle_obstack.
17191 * src/output.h, src/output.c (muscle_obstack): Move to...
17192 * src/muscle_tab.h, src/muscle_tab.h: here.
17193 (muscle_init): Initialize muscle_obstack.
17194 (muscle_free): New.
17195 * src/main.c (main): Call it.
17196
0c15323d
AD
171972002-06-14 Akim Demaille <akim@epita.fr>
17198
17199 * src/location.h: New, extracted from...
17200 * src/reader.h: here.
17201 * src/Makefile.am (noinst_HEADERS): Merge into
17202 (bison_SOURCES): this.
17203 Add location.h.
17204 * src/parse-gram.y: Use location_t instead of Bison's.
17205 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
17206 Use location_t instead of ints.
17207
e96c9728
AD
172082002-06-14 Akim Demaille <akim@epita.fr>
17209
17210 * data/bison.simple, data/bison.c++: Be sure to restore the
17211 current #line when returning to the skeleton contents after having
17212 exposed the input file's #line.
17213
75d1fe16
AD
172142002-06-12 Akim Demaille <akim@epita.fr>
17215
17216 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
17217 eager.
17218 * tests/actions.at (Exotic Dollars): New.
17219
6c35d22c
AD
172202002-06-12 Akim Demaille <akim@epita.fr>
17221
17222 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
17223 ['"/] too eagerly.
17224 * tests/input.at (Torturing the Scanner): New.
17225
1d6412ad
AD
172262002-06-11 Akim Demaille <akim@epita.fr>
17227
17228 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
17229 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
17230 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
17231 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
17232 * src/reader.c (reader): Use it.
17233
4cdb01db
AD
172342002-06-11 Akim Demaille <akim@epita.fr>
17235
17236 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
17237 Adjust all callers.
17238 (scanner_last_string_free): New.
17239
44995b2e
AD
172402002-06-11 Akim Demaille <akim@epita.fr>
17241
17242 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
17243 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
17244 (last_string, YY_OBS_FREE): New.
17245 Use them when returning an ID.
17246
e9955c83
AD
172472002-06-11 Akim Demaille <akim@epita.fr>
17248
17249 Have Bison grammars parsed by a Bison grammar.
17250
17251 * src/reader.c, src/reader.h (prologue_augment): New.
17252 * src/reader.c (copy_definition): Remove.
17253
17254 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
17255 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
17256 (grammar_current_rule_prec_set, grammar_current_rule_check)
17257 (grammar_current_rule_symbol_append)
17258 (grammar_current_rule_action_append): Export.
17259 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
17260 (symbol_list_action_append): Remove.
17261 Hook the routines from reader.
17262 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
17263 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
17264
17265 * src/reader.c (read_declarations): Remove, unused.
17266
17267 * src/parse-gram.y: Handle the epilogue.
17268 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
17269 (grammar_start_symbol_set): this.
17270 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
17271 * src/reader.c (readgram): Remove, unused.
17272 (reader): Adjust to insert eoftoken and axiom where appropriate.
17273
17274 * src/reader.c (copy_dollar): Replace with...
17275 * src/scan-gram.h (handle_dollar): this.
17276 * src/parse-gram.y: Remove `%thong'.
17277
17278 * src/reader.c (copy_at): Replace with...
17279 * src/scan-gram.h (handle_at): this.
17280
17281 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
17282 New.
17283
17284 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
17285 time being.
17286
17287 * src/reader.h, src/reader.c (grammar_rule_end): New.
17288
17289 * src/parse.y (current_type, current_class): New.
17290 Implement `%nterm', `%token' support.
17291 Merge `%term' into `%token'.
17292 (string_as_id): New.
17293 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
17294 type name.
17295
17296 * src/parse-gram.y: Be sure to handle properly the beginning of
17297 rules.
17298
17299 * src/parse-gram.y: Handle %type.
17300 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
17301
17302 * src/parse-gram.y: More directives support.
17303 * src/options.c: No longer handle source directives.
17304
17305 * src/parse-gram.y: Fix %output.
17306
17307 * src/parse-gram.y: Handle %union.
17308 Use the prologue locations.
17309 * src/reader.c (parse_union_decl): Remove.
17310
17311 * src/reader.h, src/reader.c (epilogue_set): New.
17312 * src/parse-gram.y: Use it.
17313
17314 * data/bison.simple, data/bison.c++: b4_stype is now either not
17315 defined, then default to int, or to the contents of %union,
17316 without `union' itself.
17317 Adjust.
17318 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
17319
17320 * src/output.c (actions_output): Don't output braces, as they are
17321 already handled by the scanner.
17322
17323 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
17324 characters to themselves.
17325
17326 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
17327 that the epilogue has a proper #line.
17328
17329 * src/parse-gram.y: Handle precedence/associativity.
17330
17331 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
17332 a terminal.
17333 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
17334 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
17335 at all to define terminals that cannot be emitted.
17336
17337 * src/scan-gram.l: Escape M4 characters.
17338
17339 * src/scan-gram.l: Working properly with escapes in user
17340 strings/characters.
17341
17342 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
17343 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
17344 grammar.
17345 Use more modest sizes, as for the time being the parser does not
17346 release memory, and therefore the process swallows a huge amount
17347 of memory.
17348
17349 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
17350 stricter %token grammar.
17351
17352 * src/symtab.h (associativity): Add `undef_assoc'.
17353 (symbol_precedence_set): Do nothing when passed an undef_assoc.
17354 * src/symtab.c (symbol_check_alias_consistence): Adjust.
17355
17356 * tests/regression.at (Invalid %directive): Remove, as it is now
17357 meaningless.
17358 (Invalid inputs): Adjust to the new error messages.
17359 (Token definitions): The new grammar doesn't allow too many
17360 eccentricities.
17361
17362 * src/lex.h, src/lex.c: Remove.
17363 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
17364 (copy_character, copy_string2, copy_string, copy_identifier)
17365 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
17366 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
17367 (parse_action): Remove.
17368 * po/POTFILES.in: Adjust.
17369
2e047461
AD
173702002-06-11 Akim Demaille <akim@epita.fr>
17371
cd05d13c 17372 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
17373 rule's action member: return the action as a string.
17374 Don't require `rule_length' as an argument: compute it.
17375 (grammar_current_rule_symbol_append)
17376 (grammar_current_rule_action_append): New, eved out from
17377 (readgram): here.
17378 Remove `action_flag', `rulelength', unused now.
17379
9af3fbce
AD
173802002-06-11 Akim Demaille <akim@epita.fr>
17381
17382 * src/reader.c (grammar_current_rule_prec_set).
17383 (grammar_current_rule_check): New, eved out from...
17384 (readgram): here.
17385 Remove `xaction', `first_rhs': useless.
17386 * tests/input.at (Type clashes): New.
17387 * tests/existing.at (GNU Cim Grammar): Adjust.
17388
1485e106
AD
173892002-06-11 Akim Demaille <akim@epita.fr>
17390
17391 * src/reader.c (grammar_midrule_action): New, Eved out from
17392 (readgram): here.
17393
da4160c3
AD
173942002-06-11 Akim Demaille <akim@epita.fr>
17395
17396 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
17397 New.
17398 (readgram): Use them as replacement of inlined code, crule and
17399 crule1.
17400
f6d0f937
AD
174012002-06-11 Akim Demaille <akim@epita.fr>
17402
17403 * src/reader.c (grammar_end, grammar_symbol_append): New.
17404 (readgram): Use them.
17405 Make the use of `p' as local as possible.
17406
69078d4b
AD
174072002-06-10 Akim Demaille <akim@epita.fr>
17408
17409 GCJ's parser requires the tokens to be defined before the prologue.
17410
17411 * data/bison.simple: Output the token definition before the user's
17412 prologue.
17413 * tests/regression.at (Braces parsing, Duplicate string)
17414 (Mixing %token styles): Check the output from bison.
17415 (Early token definitions): New.
17416
5e424082
AD
174172002-06-10 Akim Demaille <akim@epita.fr>
17418
17419 * src/symtab.c (symbol_user_token_number_set): Don't complain when
17420 assigning twice the same user number to a token, so that we can
17421 use it in...
17422 * src/lex.c (lex): here.
17423 Also use `symbol_class_set' instead of hand written code.
17424 * src/reader.c (parse_assoc_decl): Likewise.
17425
44536b35
AD
174262002-06-10 Akim Demaille <akim@epita.fr>
17427
17428 * src/symtab.c, src/symtab.c (symbol_class_set)
17429 (symbol_user_token_number_set): New.
17430 * src/reader.c (parse_token_decl): Use them.
17431 Use a switch instead of ifs.
17432 Use a single argument.
17433
8b9f2372
AD
174342002-06-10 Akim Demaille <akim@epita.fr>
17435
17436 Remove `%thong' support as it is undocumented, unused, duplicates
17437 `%token's job, and creates useless e-mail traffic with people who
17438 want to know what it is, why it is undocumented, unused, and
17439 duplicates `%token's job.
17440
17441 * src/reader.c (parse_thong_decl): Remove.
17442 * src/options.c (option_table): Remove "thong".
17443 * src/lex.h (tok_thong): Remove.
17444
3ae2b51f
AD
174452002-06-10 Akim Demaille <akim@epita.fr>
17446
17447 * src/symtab.c, src/symtab.c (symbol_type_set)
17448 (symbol_precedence_set): New.
17449 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
17450 (value_components_used): Remove, unused.
17451
2f1afb73
AD
174522002-06-09 Akim Demaille <akim@epita.fr>
17453
17454 Move symbols handling code out of the reader.
17455
17456 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
17457 (axiom): Move to...
17458 * src/symtab.h, src/symtab.c: here.
17459
17460 * src/gram.c (start_symbol): Remove: use startsymbol->number.
17461 * src/reader.c (startval): Rename as...
17462 * src/symtab.h, src/symtab.c (startsymbol): this.
17463 * src/reader.c: Adjust.
17464
17465 * src/reader.c (symbol_check_defined, symbol_make_alias)
17466 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
17467 (token_translations_init)
17468 Move to...
17469 * src/symtab.c: here.
17470 * src/reader.c (packsymbols): Move to...
17471 * src/symtab.h, src/symtab.c (symbols_pack): here.
17472 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
17473 argument.
17474
e9bca3ad
AD
174752002-06-03 Akim Demaille <akim@epita.fr>
17476
17477 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
17478 then statements.
17479
86eff183
AD
174802002-06-03 Akim Demaille <akim@epita.fr>
17481
17482 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
17483 structs with non literals.
17484 * src/scan-skel.l: never-interactive.
17485 * src/conflicts.c (enum conflict_resolution_e): No trailing
17486 comma.
17487 * src/getargs.c (usage): Split long literal strings.
17488 Reported by Hans Aberg.
17489
717be197
AD
174902002-05-28 Akim Demaille <akim@epita.fr>
17491
17492 * data/bison.c++: Use C++ ostreams.
17493 (cdebug_): New member.
17494
670ddffd
AD
174952002-05-28 Akim Demaille <akim@epita.fr>
17496
17497 * src/output.c (output_skeleton): Be sure to allocate enough room
17498 for `/' _and_ for `\0' in full_skeleton.
17499
769b430f
AD
175002002-05-28 Akim Demaille <akim@epita.fr>
17501
17502 * data/bison.c++: Catch up with bison.simple:
17503 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17504 and Paul Eggert <eggert@twinsun.com>: `error' handing.
17505 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
17506 and popping traces.
17507
7067cb36
PH
175082002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17509
17510 * src/output.c (output_skeleton): Put an explicit path in front of
17511 the skeleton file name, rather than relying on the -I directory,
17512 to partially alleviate effects of having a skeleton file lying around
17513 in the current directory.
769b430f 17514
4a713ec2
PH
175152002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17516
769b430f 17517 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
17518 obstack_printf should be obstack_fgrow1.
17519
b408954b
AD
175202002-05-26 Akim Demaille <akim@epita.fr>
17521
17522 * src/state.h (state_t): `solved_conflicts' is a new member.
17523 * src/LR0.c (new_state): Set it to 0.
17524 * src/conflicts.h, src/conflicts.c (print_conflicts)
17525 (free_conflicts, solve_conflicts): Rename as...
17526 (conflicts_print, conflicts_free, conflicts_solve): these.
17527 Adjust callers.
17528 * src/conflicts.c (enum conflict_resolution_e)
17529 (solved_conflicts_obstack): New, used by...
17530 (log_resolution): this.
17531 Adjust to attach the conflict resolution to each state.
17532 Complete the description with the precedence/associativity
17533 information.
17534 (resolve_sr_conflict): Adjust.
17535 * src/print.c (print_state): Output its solved_conflicts.
17536 * tests/conflicts.at (Unresolved SR Conflicts)
17537 (Solved SR Conflicts): Exercise --report=all.
17538
a49aecd5
AD
175392002-05-26 Akim Demaille <akim@epita.fr>
17540
17541 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
17542 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
17543 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
17544 (token_number_t, item_number_as_token_number)
17545 (token_number_as_item_number, muscle_insert_token_number_table):
17546 Rename as...
17547 (symbol_number_t, item_number_as_symbol_number)
17548 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
17549 these, since it is more appropriate.
17550
5504898e
AD
175512002-05-26 Akim Demaille <akim@epita.fr>
17552
17553 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
17554 `Error:' lines.
17555 * data/bison.simple (yystos) [YYDEBUG]: New.
17556 (yyparse) [YYDEBUG]: Display the symbols which are popped during
17557 error recovery.
17558 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
17559
ec3bc396
AD
175602002-05-25 Akim Demaille <akim@epita.fr>
17561
17562 * doc/bison.texinfo (Debugging): Split into...
17563 (Tracing): this new section, its former contents, and...
17564 (Understanding): this new section.
17565 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
17566 by...
17567 (report_flag): this.
17568 Adjust all dependencies.
17569 (report_args, report_types, report_argmatch): New.
17570 (usage, getargs): Report/support -r, --report.
17571 * src/options.h
17572 (struct option_table_struct): Rename as..,
17573 (struct option_table_s): this.
17574 Rename the `set_flag' member to `flag' to match with getopt_long's
17575 struct.
17576 * src/options.c (option_table): Split verbose into an entry for
17577 %verbose, and another for --verbose.
17578 Support --report/-r, so remove -r from the obsolete --raw.
17579 * src/print.c: Attach full item sets and lookaheads reports to
17580 report_flag instead of trace_flag.
17581 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
17582
78df8250
PE
175832002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17584 and Paul Eggert <eggert@twinsun.com>
769b430f 17585
78df8250
PE
17586 * data/bison.simple (yyparse): Correct error handling to conform to
17587 POSIX and yacc. Specifically, after syntax error is discovered,
17588 do not reduce further before shifting the error token.
17589 Clean up the code a bit by removing the labels yyerrdefault,
17590 yyerrhandle, yyerrpop.
17591 * NEWS: Document the above.
17592
c0c9ea05
PH
175932002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17594
17595 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
17596 type; it isn't always big enough, since it doesn't necessarily
17597 include non-terminals.
769b430f 17598 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
17599 the latter can be removed.
17600 (yy_token_number_type): Remove, only one use.
17601 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
17602 don't use TokenNumberType as element type.
769b430f 17603
c0c9ea05
PH
17604 * tests/regression.at: Modify expected output to agree with change
17605 to yyr1 and yytranslate.
769b430f 17606
6390a83f
FK
176072002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
17608
17609 * src/reader.c (parse_action): Use copy_character instead of
17610 obstack_1grow.
17611
db7c8e9a
AD
176122002-05-13 Akim Demaille <akim@epita.fr>
17613
17614 * tests/regression.at (Token definitions): Prototype yylex and
17615 yyerror.
17616
fcc61800
PH
176172002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17618
158c687b 17619 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
17620 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
17621 32-bit arithmetic.
17622 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
17623
5683e9b2
AD
176242002-05-07 Akim Demaille <akim@epita.fr>
17625
17626 * tests/synclines.at: Be sure to prototype yylex and yyerror to
17627 avoid GCC warnings.
17628
0c2d3f4c
AD
176292002-05-07 Akim Demaille <akim@epita.fr>
17630
17631 Kill GCC warnings.
17632
17633 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
17634 over the RHS of each rule.
17635 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
17636 * src/state.h (state_t): Member `nitems' is unsigned short.
17637 * src/LR0.c (get_state): Adjust.
17638 * src/reader.c (packgram): Likewise.
17639 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
17640 `Type'.
17641 (muscle_insert_int_table): Remove, unused.
17642 (prepare_rules): Remove `max'.
17643
1565b720
AD
176442002-05-06 Akim Demaille <akim@epita.fr>
17645
17646 * src/closure.c (print_firsts): Display of the symbol tags.
17647 (bitmatrix_print): Move to...
17648 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
17649 here.
17650 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
17651
cfaee611
AD
176522002-05-06 Akim Demaille <akim@epita.fr>
17653
17654 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
17655 hash_do_for_each.
17656
458be8e0
AD
176572002-05-06 Akim Demaille <akim@epita.fr>
17658
17659 * src/LR0.c (new_state, get_state): Instead of using the global
17660 `kernel_size' and `kernel_base', have two new arguments:
17661 `core_size' and `core'.
17662 Adjust callers.
17663
a900a624
AD
176642002-05-06 Akim Demaille <akim@epita.fr>
17665
17666 * src/reader.c (packgram): No longer end `ritem' with a 0
17667 sentinel: it is not used.
17668
d4e7d3a1
AD
176692002-05-05 Akim Demaille <akim@epita.fr>
17670
17671 New experimental feature: display the lookaheads in the report and
17672 graph.
17673
17674 * src/print (print_core): When --trace-flag, display the rules
17675 lookaheads.
17676 * src/print_graph.c (print_core): Likewise.
17677 Swap the arguments.
17678 Adjust caller.
17679
39ceb25b
AD
176802002-05-05 Akim Demaille <akim@epita.fr>
17681
17682 * tests/torture.at (Many lookaheads): New test.
17683
5372019f
AD
176842002-05-05 Akim Demaille <akim@epita.fr>
17685
17686 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
17687 (GENERATE_MUSCLE_INSERT_TABLE): this.
17688 (output_int_table, output_unsigned_int_table, output_short_table)
17689 (output_token_number_table, output_item_number_table): Replace with...
17690 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
17691 (muscle_insert_short_table, muscle_insert_token_number_table)
17692 (muscle_insert_item_number_table): these.
17693 Adjust all callers.
17694 (prepare_tokens): Don't free `translations', since...
17695 * src/reader.h, src/reader.c (grammar_free): do it.
17696 Move to...
17697 * src/gram.h, src/gram.c (grammar_free): here.
17698 * data/bison.simple, data/bison.c++: b4_token_number_max is now
17699 b4_translate_max.
17700
5df5f6d5
AD
177012002-05-05 Akim Demaille <akim@epita.fr>
17702
17703 * src/output.c (output_unsigned_int_table): New.
17704 (prepare_rules): `i' is unsigned.
17705 `prhs', `rline', `r2' are unsigned int.
17706 Rename muscle `rhs_number_max' as `rhs_max'.
17707 Output muscles `prhs_max', `rline_max', and `r2_max'.
17708 Free rline and r1.
17709 * data/bison.simple, data/bison.c++: Adjust to use these muscles
17710 to compute types instead of constant types.
17711 * tests/regression.at (Web2c Actions): Adjust.
17712
b87f8b21
AD
177132002-05-04 Akim Demaille <akim@epita.fr>
17714
17715 * src/symtab.h (SALIAS, SUNDEF): Rename as...
17716 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
17717 Adjust dependencies.
17718 * src/output.c (token_definitions_output): Be sure not to output a
17719 `#define 'a'' when fed with `%token 'a' "a"'.
17720 * tests/regression.at (Token definitions): New.
17721
8bb936e4
PE
177222002-05-03 Paul Eggert <eggert@twinsun.com>
17723
17724 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
17725 for K&R C.
17726
177272002-05-03 gettextize <bug-gnu-gettext@gnu.org>
17728
17729 * Makefile.am (SUBDIRS): Remove intl.
17730 (EXTRA_DIST): Add config/config.rpath.
17731
53c71a12
AD
177322002-05-03 Akim Demaille <akim@epita.fr>
17733
17734 * data/bison.simple (m4_if): Don't output empty enums.
17735 And actually, output valid enum definitions :(.
17736
289dd0cf
AD
177372002-05-03 Akim Demaille <akim@epita.fr>
17738
17739 * configure.bat: Remove, completely obsolete.
17740 * Makefile.am (EXTRA_DIST): Adjust.
17741 Don't distribute config.rpath...
17742 * config/Makefile.am (EXTRA_DIST): Do it.
17743
db85e524
AD
177442002-05-03 Akim Demaille <akim@epita.fr>
17745
17746 * configure.in (GETTEXT_VERSION): New.
17747 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
17748
83ccf991
AD
177492002-05-03 Akim Demaille <akim@epita.fr>
17750
17751 * data/bison.simple (b4_token_enum): New.
17752 (b4_token_defines): Use it to output tokens both as #define and
17753 enums.
17754 Suggested by Paul Eggert.
17755 * src/output.c (token_definitions_output): Don't output spurious
17756 white spaces.
17757
1f418995
AD
177582002-05-03 Akim Demaille <akim@epita.fr>
17759
17760 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
17761
45119f04
RA
177622002-05-02 Robert Anisko <robert@lrde.epita.fr>
17763
17764 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
17765 Update the stack class, give a try to deque as the default container.
17766
b2d52318
AD
177672002-05-02 Akim Demaille <akim@epita.fr>
17768
17769 * data/bison.simple (yyparse): Do not implement @$ = @1.
17770 (YYLLOC_DEFAULT): Adjust to do it.
17771 * doc/bison.texinfo (Location Default Action): Fix.
17772
3a8b4109
AD
177732002-05-02 Akim Demaille <akim@epita.fr>
17774
17775 * src/reader.c (parse_braces): Merge into...
17776 (parse_action): this.
17777
84614e13
AD
177782002-05-02 Akim Demaille <akim@epita.fr>
17779
17780 * configure.in (ALL_LINGUAS): Remove.
17781 * po/LINGUAS, hr.po: New.
17782
fdbcd8e2
AD
177832002-05-02 Akim Demaille <akim@epita.fr>
17784
17785 Remove the so called hairy (semantic) parsers.
17786
17787 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
17788 * src/gram.h, src/gram.c (semantic_parser): Remove.
17789 (rule_t): Remove the guard and guard_line members.
17790 * src/lex.h (token_t): remove tok_guard.
17791 * src/options.c (option_table): Remove %guard and %semantic_parser
17792 support.
17793 * src/output.c, src/output.h (guards_output): Remove.
17794 (prepare): Adjust.
17795 (token_definitions_output): Don't output the `T'
17796 tokens (???).
17797 (output_skeleton): Don't output the guards.
17798 * src/files.c, src/files.c (attrsfile): Remove.
17799 * src/reader.c (symbol_list): Remove the guard and guard_line
17800 members.
17801 Adjust dependencies.
17802 (parse_guard): Remove.
17803 * data/bison.hairy: Remove.
17804 * doc/bison.texinfo (Environment Variables): Remove occurrences of
17805 BISON_HAIRY.
17806
82b6cb3f
AD
178072002-05-02 Akim Demaille <akim@epita.fr>
17808
17809 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
17810 (parse_guard): Rename the formal argument `stack_offset' as
17811 `rule_length', which is more readable.
17812 Adjust callers.
17813 (copy_at, copy_dollar): Instead of outputting the hard coded
17814 values of $$, $n and so forth, output invocation to b4_lhs_value,
17815 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
17816 Note: this patch partially drops `semantic-parser' support: it
17817 always does `rule_length - n', where semantic parsers ought to
17818 always use `-n'.
82b6cb3f
AD
17819 * data/bison.simple, data/bison.c++ (b4_lhs_value)
17820 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
17821
6cbfbcc5
AD
178222002-05-02 Akim Demaille <akim@epita.fr>
17823
17824 * configure.in (AC_INIT): Bump to 1.49b.
17825 (AM_INIT_AUTOMAKE): Short invocation.
17826
b8548114
AD
178272002-05-02 Akim Demaille <akim@epita.fr>
17828
17829 Version 1.49a.
17830
c20cd1fa
AD
178312002-05-01 Akim Demaille <akim@epita.fr>
17832
17833 * src/skeleton.h: Remove.
17834
8a9566d4
AD
178352002-05-01 Akim Demaille <akim@epita.fr>
17836
17837 * src/skeleton.h: Fix the #endif.
17838 Reported by Magnus Fromreide.
17839
8c6d399a
PE
178402002-04-26 Paul Eggert <eggert@twinsun.com>
17841
17842 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
17843 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 17844 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 17845
2b7ed18a
RA
178462002-04-25 Robert Anisko <robert@lrde.epita.fr>
17847
17848 * src/scan-skel.l: Postprocess quadrigraphs.
17849
17850 * src/reader.c (copy_character): New function, used to output
17851 single characters while replacing `[' and `]' with quadrigraphs, to
17852 avoid troubles with M4 quotes.
17853 (copy_comment): Output characters with copy_character.
17854 (read_additionnal_code): Likewise.
17855 (copy_string2): Likewise.
17856 (copy_definition): Likewise.
17857
17858 * tests/calc.at: Exercise M4 quoting.
17859
34a89c50
AD
178602002-04-25 Akim Demaille <akim@epita.fr>
17861
17862 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
17863 between `!' and the command.
17864 Reported by Paul Eggert.
17865
0dd1580a
RA
178662002-04-24 Robert Anisko <robert@lrde.epita.fr>
17867
17868 * tests/calc.at: Exercise prologue splitting.
17869
17870 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
17871 `b4_post_prologue' instead of `b4_prologue'.
17872
17873 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
17874 muscles.
17875 (output): Free pre_prologue_obstack and post_prologue_obstack.
17876 * src/files.h, src/files.c (attrs_obstack): Remove.
17877 (pre_prologue_obstack, post_prologue_obstack): New.
17878 * src/reader.c (copy_definition): Add a parameter to specify the
17879 obstack to fill, instead of using attrs_obstack unconditionally.
17880 (read_declarations): Pass pre_prologue_obstack to copy_definition if
17881 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
17882
83c1796f
PE
178832002-04-23 Paul Eggert <eggert@twinsun.com>
17884
17885 * data/bison.simple: Remove unnecessary commentary and white
17886 space differences from 1_29-branch.
17887 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
17888
17889 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
17890 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
17891 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
17892 constructors or destructors.
17893
17894 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
17895
1207eeac
AD
178962002-04-23 Akim Demaille <akim@epita.fr>
17897
17898 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
17899 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
17900 location with columns.
17901 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
17902 All reported by Paul Eggert.
17903
78ab8f67
AD
179042002-04-22 Akim Demaille <akim@epita.fr>
17905
17906 * src/reduce.c (dump_grammar): Move to...
17907 * src/gram.h, src/gram.c (grammar_dump): here.
17908 Be sure to separate long item numbers.
17909 Don't read the members of a rule's prec if its nil.
17910
133c20e2
AD
179112002-04-22 Akim Demaille <akim@epita.fr>
17912
17913 * src/output.c (table_size, table_grow): New.
17914 (MAXTABLE): Remove, replace uses with table_size.
17915 (pack_vector): Instead of dying when the table is too big, grow it.
17916
9515e8a7
AD
179172002-04-22 Akim Demaille <akim@epita.fr>
17918
17919 * data/bison.simple (yyr1): Its type is that of a token number.
17920 * data/bison.c++ (r1_): Likewise.
17921 * tests/regression.at (Web2c Actions): Adjust.
17922
23c5a174
AD
179232002-04-22 Akim Demaille <akim@epita.fr>
17924
17925 * src/reader.c (token_translations_init): 256 is now the default
17926 value for the error token, i.e., it will be assigned another
17927 number if the user assigned 256 to one of her tokens.
17928 (reader): Don't force 256 to error.
17929 * doc/bison.texinfo (Symbols): Adjust.
17930 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
17931 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
17932 etc. instead of 10, 20, 30 (which was used to `jump' over error
17933 (256) and undefined (2)).
17934
5fbb0954
AD
179352002-04-22 Akim Demaille <akim@epita.fr>
17936
17937 Propagate more token_number_t.
17938
17939 * src/gram.h (token_number_as_item_number)
17940 (item_number_as_token_number): New.
17941 * src/output.c (GENERATE_OUTPUT_TABLE): New.
17942 Use it to create output_item_number_table and
17943 output_token_number_table.
17944 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
17945 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
17946 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
17947 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
17948
4f940944
AD
179492002-04-22 Akim Demaille <akim@epita.fr>
17950
17951 * src/output.h, src/output.c (get_lines_number): Remove.
17952
3ded9a63
AD
179532002-04-19 Akim Demaille <akim@epita.fr>
17954
17955 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
17956 as Lex/Flex'.
17957 (Debugging): More details about enabling the debugging features.
17958 (Table of Symbols): Describe $$, $n, @$, and @n.
17959 Suggested by Tim Josling.
17960
e0c471a9
AD
179612002-04-19 Akim Demaille <akim@epita.fr>
17962
17963 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
17964
fecc10cd
AD
179652002-04-10 Akim Demaille <akim@epita.fr>
17966
17967 * src/system.h: Rely on HAVE_LIMITS_H.
17968 Suggested by Paul Eggert.
17969
51dec47b
AD
179702002-04-09 Akim Demaille <akim@epita.fr>
17971
17972 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
17973 full stderr, and strip it according to the bison options, instead
17974 of composing the error message from different bits.
17975 This makes it easier to check for several error messages.
17976 Adjust all the invocations.
17977 Add an invocation exercising the error token.
17978 Add an invocation demonstrating a stupid error message.
17979 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
17980 Adjust the tests.
17981 Error message are for stderr, not stdout.
17982
007a50a4
AD
179832002-04-09 Akim Demaille <akim@epita.fr>
17984
17985 * src/gram.h, src/gram.c (error_token_number): Remove, use
17986 errtoken->number.
17987 * src/reader.c (reader): Don't specify the user token number (2)
17988 for $undefined, as it uselessly prevents using it.
17989 * src/gram.h (token_number_t): Move to...
17990 * src/symtab.h: here.
17991 (state_t.number): Is a token_number_t.
17992 * src/print.c, src/reader.c: Use undeftoken->number instead of
17993 hard coded 2.
17994 (Even though this 2 is not the same as above: the number of the
17995 undeftoken remains being 2, it is its user token number which
17996 might not be 2).
17997 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
17998 `user_token_number_max'.
17999 Output `undef_token_number'.
18000 * data/bison.simple, data/bison.c++: Use them.
18001 Be sure to map invalid yylex return values to
18002 `undef_token_number'. This saves us from gratuitous SEGV.
18003
18004 * tests/conflicts.at (Solved SR Conflicts)
18005 (Unresolved SR Conflicts): Adjust.
18006 * tests/regression.at (Web2c Actions): Adjust.
18007
06446ccf
AD
180082002-04-08 Akim Demaille <akim@epita.fr>
18009
18010 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
18011 Adding #line.
18012 Remove the duplicate `typedefs'.
18013 (RhsNumberType): Fix the declaration and various other typos.
18014 Use __ofile__.
18015 * data/bison.simple: Use __ofile__.
18016 * src/scan-skel.l: Handle __ofile__.
18017
62a3e4f0
AD
180182002-04-08 Akim Demaille <akim@epita.fr>
18019
18020 * src/gram.h (item_number_t): New, the type of item numbers in
18021 RITEM. Note that it must be able to code symbol numbers as
18022 positive number, and the negation of rule numbers as negative
18023 numbers.
18024 Adjust all dependencies (pretty many).
18025 * src/reduce.c (rule): Remove this `short *' pointer: use
18026 item_number_t.
18027 * src/system.h (MINSHORT, MAXSHORT): Remove.
18028 Include `limits.h'.
18029 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
18030 (shortcpy): Remove.
18031 (MAXTABLE): Move to...
18032 * src/output.c (MAXTABLE): here.
18033 (prepare_rules): Use output_int_table to output rhs.
18034 * data/bison.simple, data/bison.c++: Adjust.
18035 * tests/torture.at (Big triangle): Move the limit from 254 to
18036 500.
18037 * tests/regression.at (Web2c Actions): Ajust.
18038
18039 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
18040 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
18041 passes, but produces negative #line number, once fixed, GCC is
18042 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
18043 C), it passes.
18044 * src/state.h (state_h): Code input lines on ints, not shorts.
18045
bb88b0fc
AD
180462002-04-08 Akim Demaille <akim@epita.fr>
18047
18048 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
18049 and then the grammar.
18050
9a636f47
AD
180512002-04-08 Akim Demaille <akim@epita.fr>
18052
18053 * src/system.h: No longer using strndup.
18054
680e8701
AD
180552002-04-07 Akim Demaille <akim@epita.fr>
18056
18057 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
18058 * src/output.c (output_table_data): Return the longest number.
18059 (prepare_tokens): Output `token_number_max').
18060 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
18061 New.
18062 Use them to define yy_token_number_type/TokenNumberType.
18063 Use this type for yytranslate.
18064 * tests/torture.at (Big triangle): Push the limit from 124 to
18065 253.
18066 * tests/regression.at (Web2c Actions): Adjust.
18067
817e9f41
AD
180682002-04-07 Akim Demaille <akim@epita.fr>
18069
18070 * tests/torture.at (Big triangle): New.
18071 (GNU AWK Grammar, GNU Cim Grammar): Move to...
18072 * tests/existing.at: here.
18073
5123689b
AD
180742002-04-07 Akim Demaille <akim@epita.fr>
18075
18076 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
18077 nritems.
18078 Adjust dependencies.
18079
f3849179
AD
180802002-04-07 Akim Demaille <akim@epita.fr>
18081
18082 * src/reader.c: Normalize increments to prefix form.
18083
bd02036a
AD
180842002-04-07 Akim Demaille <akim@epita.fr>
18085
18086 * src/reader.c, symtab.c: Remove debugging code.
18087
db8837cb
AD
180882002-04-07 Akim Demaille <akim@epita.fr>
18089
18090 Rename all the `bucket's as `symbol_t'.
18091
18092 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
18093 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
18094 * src/symtab.c, src/symtab.h (bucket): Rename as...
18095 (symbol_t): this.
18096 (symbol_list_new, bucket_check_defined, bucket_make_alias)
18097 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
18098 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
18099 (buckets_new, buckets_free, buckets_do): Rename as...
18100 (symbol_list_new, symbol_check_defined, symbol_make_alias)
18101 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
18102 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
18103 (symbols_new, symbols_free, symbols_do): these.
18104
72a23c97
AD
181052002-04-07 Akim Demaille <akim@epita.fr>
18106
18107 Use lib/hash for the symbol table.
18108
18109 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
18110 EOF.
18111 * src/lex.c (lex): Set the `number' member of new terminals.
18112 * src/reader.c (bucket_check_defined, bucket_make_alias)
18113 (bucket_check_alias_consistence, bucket_translation): New.
18114 (reader, grammar_free, readgram, token_translations_init)
18115 (packsymbols): Adjust.
18116 (reader): Number the predefined tokens.
18117 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
18118 for predefined tokens.
18119 * src/symtab.h (bucket): Remove all the hash table related
18120 members.
18121 * src/symtab.c (symtab): Replace by...
18122 (bucket_table): this.
18123 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
18124 (buckets_new, buckets_do): New.
18125
280a38c3
AD
181262002-04-07 Akim Demaille <akim@epita.fr>
18127
18128 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
18129 (start_symbol, max_user_token_number, semantic_parser)
18130 (error_token_number): Initialize.
18131 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
18132 Initialize.
18133 (reader): Don't.
18134 (errtoken, eoftoken, undeftoken, axiom): Extern.
18135
03b31c0c
AD
181362002-04-07 Akim Demaille <akim@epita.fr>
18137
18138 * src/gram.h (rule_s): prec and precsym are now pointers
18139 to the bucket giving the priority/associativity.
18140 Member `associativity' removed: useless.
18141 * src/reduce.c, src/conflicts.c: Adjust.
18142
8b3df748
AD
181432002-04-07 Akim Demaille <akim@epita.fr>
18144
18145 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
18146 Properly escape the symbols' TAG when outputting them.
18147
e601aa1d
AD
181482002-04-07 Akim Demaille <akim@epita.fr>
18149
18150 * src/lalr.h (LA): Is a bitsetv, not bitset*.
18151
b0299a2e
AD
181522002-04-07 Akim Demaille <akim@epita.fr>
18153
18154 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
18155 (LArule): this, which is an array to rule_t*.
18156 * src/print.c, src/conflicts.c: Adjust.
18157
d7e1f00c
AD
181582002-04-07 Akim Demaille <akim@epita.fr>
18159
18160 * src/gram.h (rule_t): Rename `number' as `user_number'.
18161 `number' is a new member.
18162 Adjust dependencies.
18163 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
18164
cc9305dd
AD
181652002-04-07 Akim Demaille <akim@epita.fr>
18166
18167 As a result of the previous patch, it is no longer needed
18168 to reorder ritem itself.
18169
18170 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
18171
b0940840
AD
181722002-04-07 Akim Demaille <akim@epita.fr>
18173
18174 Be sure never to walk through RITEMS, but use only data related to
18175 the rules themselves. RITEMS should be banished.
18176
18177 * src/output.c (output_token_translations): Rename as...
18178 (prepare_tokens): this.
18179 In addition to `translate', prepare the muscles `tname' and
18180 `toknum', which were handled by...
18181 (output_rule_data): this.
18182 Remove, and move the remainder of its outputs into...
18183 (prepare_rules): this new routines, which also merges content from
18184 (output_gram): this.
18185 (prepare_rules): Be sure never to walk through RITEMS.
18186 (output_stos): Rename as...
18187 (prepare_stos): this.
18188 (output): Always invoke prepare_states, after all, just don't use it
18189 in the output if you don't need it.
18190
643a5994
AD
181912002-04-07 Akim Demaille <akim@epita.fr>
18192
18193 * src/LR0.c (new_state): Display `nstates' as the name of the
18194 newly created state.
18195 Adjust to initialize first_state and last_state if needed.
18196 Be sure to distinguish the initial from the final state.
18197 (new_states): Create the itemset of the initial state, and use
18198 new_state.
18199 * src/closure.c (closure): Now that the initial state has its
18200 items properly set, there is no need for a special case when
18201 creating `ruleset'.
18202
18203 As a result, now the rule 0, reducing to $axiom, is visible in the
18204 outputs. Adjust the test suite.
18205
18206 * tests/conflicts.at (Solved SR Conflicts)
18207 (Unresolved SR Conflicts): Adjust.
18208 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
18209 * tests/conflicts.at (S/R in initial): New.
18210
b4c4ccc2
AD
182112002-04-07 Akim Demaille <akim@epita.fr>
18212
18213 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
18214 the RHS of the rules.
18215 * src/output.c (output_gram): Likewise.
18216
bba97eb2
AD
182172002-04-07 Akim Demaille <akim@epita.fr>
18218
18219 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
18220 bucket.
18221 Adjust all dependencies.
18222 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
18223 `number' of the buckets too.
18224 * src/gram.h: Include `symtab.h'.
18225 (associativity): Move to...
18226 * src/symtab.h: here.
18227 No longer include `gram.h'.
18228
c3b407f4
AD
182292002-04-07 Akim Demaille <akim@epita.fr>
18230
18231 * src/gram.h, src/gram.c (rules_rhs_length): New.
18232 (ritem_longest_rhs): Use it.
18233 * src/gram.h (rule_t): `number' is a new member.
18234 * src/reader.c (packgram): Set it.
18235 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
18236 the end of `rules', and count them out of `nrules'.
18237 (reduce_output, dump_grammar): Adjust.
18238 * src/print.c (print_grammar): It is no longer needed to check for
18239 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
18240 * tests/reduce.at (Reduced Automaton): New test.
18241
11652ab3
AD
182422002-04-07 Akim Demaille <akim@epita.fr>
18243
18244 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
18245 lacking `+ 1' to nrules, Bison reported as useless a token if it
18246 was used solely to set the precedence of the last rule...
18247
26b23c1a
AD
182482002-04-07 Akim Demaille <akim@epita.fr>
18249
18250 * data/bison.c++, data/bison.simple: Don't output the current file
18251 name in #line, to avoid useless diffs between two identical
18252 outputs under different names.
18253
18bcecb0
AD
182542002-04-07 Akim Demaille <akim@epita.fr>
18255
18256 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
18257 Normalize loops to using `< nrules + 1', not `<= nrules'.
18258
fa770c86
AD
182592002-04-07 Akim Demaille <akim@epita.fr>
18260
18261 * TODO: Update.
18262
d9b739c3
AD
182632002-04-07 Akim Demaille <akim@epita.fr>
18264
18265 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
18266 bucket.value as bucket.number.
18267
99013900
AD
182682002-04-07 Akim Demaille <akim@epita.fr>
18269
18270 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
18271 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
18272 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
18273 RHS, instead of being an index in RITEMS.
18274
e966383b
PE
182752002-04-04 Paul Eggert <eggert@twinsun.com>
18276
18277 * doc/bison.texinfo: Update copyright date.
18278 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
18279 (Symbols): Warn about running Bison in one character set,
18280 but compiling and/or running in an incompatible one.
18281 Warn about character code 256, too.
18282
182832002-04-03 Paul Eggert <eggert@twinsun.com>
18284
18285 * src/bison.data (YYSTACK_ALLOC): Depend on whether
18286 YYERROR_VERBOSE is nonzero, not whether it is defined.
18287
18288 Merge changes from bison-1_29-branch.
c307773e 18289
8d6c48b9
PE
182902002-03-20 Paul Eggert <eggert@twinsun.com>
18291
18292 Merge fixes from Debian bison_1.34-1.diff.
18293
18294 * configure.in (AC_PREREQ): 2.53.
18295
e53c6322
AD
182962002-03-20 Akim Demaille <akim@epita.fr>
18297
18298 * src/conflicts.c (log_resolution): Argument `resolution' is const.
18299
9ffbeca7
PE
183002002-03-19 Paul Eggert <eggert@twinsun.com>
18301
21db0b2a
PE
18302 * src/bison.simple (YYCOPY): New macro.
18303 (YYSTACK_RELOCATE): Use it.
18304 Remove Type arg; no longer needed. All callers changed.
18305 (yymemcpy): Remove; no longer needed.
18306
9ffbeca7
PE
18307 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
18308 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
18309
642cb8f8
AD
183102002-03-19 Akim Demaille <akim@epita.fr>
18311
18312 Test and fix the #line outputs.
18313
18314 * tests/atlocal.at (GCC): New.
18315 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 18316 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
18317 (Action synch line, Epilogue synch line): New tests.
18318 * src/reader.c (parse_union_decl): Define the muscle stype_line.
18319 * data/bison.simple, data/bison.c++: Use it.
18320
3c31a486
AD
183212002-03-19 Akim Demaille <akim@epita.fr>
18322
18323 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
18324 (Solved SR Conflicts, %expect not enough, %expect right)
18325 (%expect too much): Move to...
18326 * tests/conflicts.at: this new file.
18327
0d8bed56
AD
183282002-03-19 Akim Demaille <akim@epita.fr>
18329
18330 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
18331 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
18332 that we can move to enums for instance.
18333 * src/output.c (token_definitions_output): Output a list of
18334 `token-name, token-number' instead of the #define.
18335 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
18336
9208d17f
AD
183372002-03-14 Akim Demaille <akim@epita.fr>
18338
18339 Use Gettext 0.11.1.
18340
af27eacb
RA
183412002-03-09 Robert Anisko <robert@lrde.epita.fr>
18342
18343 * data/bison.c++: Make the user able to add members to the generated
18344 parser by subclassing.
18345
9101a310
RA
183462002-03-05 Robert Anisko <robert@lrde.epita.fr>
18347
18348 * src/reader.c (read_additionnal_code): `c' should be an integer, not
18349 a character.
18350 Reported by Nicolas Tisserand and Nicolas Burrus.
18351
fff9bf0b
RA
183522002-03-04 Robert Anisko <robert@lrde.epita.fr>
18353
18354 * src/reader.c: Warn about lacking semi-colons, do not complain.
18355
64dba31e
RA
183562002-03-04 Robert Anisko <robert@lrde.epita.fr>
18357
18358 * data/bison.c++: Remove a debug line.
18359
374f5a14
RA
183602002-03-04 Robert Anisko <robert@lrde.epita.fr>
18361
18362 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
18363 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
18364 provide a default implementation.
18365
bfcf1f3a
AD
183662002-03-04 Akim Demaille <akim@epita.fr>
18367
18368 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
18369 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
18370 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
18371 * tests/semantic.at (Parsing Guards): Similarly.
18372 * src/reader.at (readgram): Complain if the last rule is not ended
18373 with a semi-colon.
18374
65ccf9fc
AD
183752002-03-04 Akim Demaille <akim@epita.fr>
18376
18377 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
18378 * src/closure.c: here.
18379 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
18380 RTC.
18381 * src/warshall.h, src/warshall.c: Remove.
18382 * tests/sets.at (Broken Closure): Adjust.
18383
d0039cbc
AD
183842002-03-04 Akim Demaille <akim@epita.fr>
18385
18386 * src/output.c (output_skeleton): tempdir is const.
18387 bytes_read is unused.
18388
345cea78
AD
183892002-03-04 Akim Demaille <akim@epita.fr>
18390
18391 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
18392 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
18393 Update.
18394 From Michael Hayes.
18395
564801f7
AD
183962002-03-04 Akim Demaille <akim@epita.fr>
18397
18398 * src/closure.c (closure): `r' is unused.
18399
e5352bc7
AD
184002002-03-04 Akim Demaille <akim@epita.fr>
18401
18402 * tests/sets.at (Broken Closure): Add the ending `;'.
18403 * src/reader.at (readgram): Complain if a rule is not ended with a
18404 semi-colon.
18405
914feea9
AD
184062002-03-04 Akim Demaille <akim@epita.fr>
18407
18408 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
18409 (count_sr_conflicts): Use bitset_count.
18410 * src/reduce.c (inaccessable_symbols): Ditto.
18411 (bits_size): Remove.
18412 * src/warshall.h, src/warshall.c: Convert to bitsetv.
18413
f0250de6
AD
184142002-03-04 Akim Demaille <akim@epita.fr>
18415
18416 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
18417 * src/reduce.c: Remove the `bitset_zero's following the
18418 `bitset_create's, as now it is performed by the latter.
18419
ef017502
AD
184202002-03-04 Akim Demaille <akim@epita.fr>
18421
18422 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
18423 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
18424 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
18425 latest sources from Michael.
18426
76514394
AD
184272002-03-04 Akim Demaille <akim@epita.fr>
18428
18429 * src/output.c (output): Don't free the grammar.
18430 * src/reader.c (grammar_free): New.
18431 * src/main.c (main): Call it and don't free symtab here.
18432
55024580
AD
184332002-03-04 Akim Demaille <akim@epita.fr>
18434
18435 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
18436 before returning.
18437 Reported by Benoit Perrot.
18438
f9abaa2c
AD
184392002-03-04 Akim Demaille <akim@epita.fr>
18440
18441 Use bitset operations when possible, not loops over bits.
18442
18443 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
18444 bitset_or.
18445 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
18446 * src/reduce.c (useless_nonterminals): Formatting changes.
18447 * src/warshall.c (TC): Use bitset_or.
18448
0e721e75
AD
184492002-03-04 Akim Demaille <akim@epita.fr>
18450
18451 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
18452 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
18453 Ditto.
18454
0fb1ffb1
AD
184552002-03-04 Akim Demaille <akim@epita.fr>
18456
18457 * src/lalr.c (F): Now a bitset*.
18458 Adjust all dependencies.
18459
b86796bf
AD
184602002-03-04 Akim Demaille <akim@epita.fr>
18461
18462 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
18463 Adjust all dependencies.
18464
602bbf31
AD
184652002-03-04 Akim Demaille <akim@epita.fr>
18466
18467 * src/L0.c, src/LR0.h (nstates): Be size_t.
18468 Adjust comparisons (signed vs unsigned).
18469 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
18470 bitset*.
18471 Adjust all dependencies.
18472
d8a0245c
AD
184732002-03-04 Akim Demaille <akim@epita.fr>
18474
18475 * src/closure.c (firsts): Now, also a bitset.
18476 Adjust all dependencies.
18477 (varsetsize): Remove, now unused.
18478 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
18479
34ba9743
AD
184802002-03-04 Akim Demaille <akim@epita.fr>
18481
18482 * src/print.c: Convert to use bitset.h, not hand coded iterations
18483 over ints.
18484
ed86e78c
AD
184852002-03-04 Akim Demaille <akim@epita.fr>
18486
18487 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
18488
dfdb1797
AD
184892002-03-04 Akim Demaille <akim@epita.fr>
18490
18491 * src/closure.c (ruleset): Be a bitset.
18492 (rulesetsize): Remove.
18493
7086e707
AD
184942002-03-04 Akim Demaille <akim@epita.fr>
18495
18496 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
18497 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
18498 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
18499 * src/closure.c (fderives): Be an array of bitsets.
18500
98254360
RA
185012002-02-28 Robert Anisko <robert@lrde.epita.fr>
18502
18503 * data/bison.c++: Merge the two generated headers. Insert a copyright
18504 notice in each output file.
18505
a75c057f
AD
185062002-02-28 Akim Demaille <akim@epita.fr>
18507
18508 * data/bison.c++: Copy the prologue of bison.simple to fetch
18509 useful M4 definitions, such as b4_header_guard.
18510
06b00abc
AD
185112002-02-25 Akim Demaille <akim@epita.fr>
18512
18513 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
18514 translator friendly scheme for the bgr
18515 copyright notice.
06b00abc 18516
70e7d534
AD
185172002-02-25 Akim Demaille <akim@epita.fr>
18518
18519 * src/output.c (header_output): Remove, now handled completely via
18520 M4.
18521
abe017f6
AD
185222002-02-25 Akim Demaille <akim@epita.fr>
18523
18524 * m4/m4.m4: New, from CVS Autoconf.
18525 * configure.in: Invoke it.
18526 * src/output.c (output_skeleton): Use its result instead of the
18527 hard coded name.
18528
381fb12e
AD
185292002-02-25 Akim Demaille <akim@epita.fr>
18530
18531 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
18532 Fileutils 4.1.5.
18533 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
18534 * src/output.c (output_skeleton): Use mkstemp to create a real
18535 temporary file.
18536 Move the filling of `skeleton' and its muscle to...
18537 (prepare): here.
18538 (output): Move the definition of the prologue muscle to...
18539 (prepare): here.
18540 * src/system.h (DEFAULT_TMPDIR): New.
18541
6f38107f
PE
185422002-02-14 Paul Eggert <eggert@twinsun.com>
18543
18544 Remove the support for C++ namespace cleanliness; it was
18545 causing more problems than it was curing, since it didn't work
18546 properly on some nonstandard C++ compilers. This can wait
18547 for a proper C++ parser.
18548
18549 * NEWS: Document this.
18550 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
18551 of C++, as it's treated like C now.
18552 * src/bison.simple (YYSTD): Remove.
18553 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
18554 Treat C++ just like Standard C instead of trying to support
18555 namespace cleanliness.
18556
80cce3da
AD
185572002-02-14 Akim Demaille <akim@epita.fr>
18558
18559 * tests/regression.at (else): Adjust to Andreas' change.
18560
842e8679
AD
185612002-02-14 Akim Demaille <akim@epita.fr>
18562
18563 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
18564
4bda3f10
AD
185652002-02-13 Andreas Schwab <schwab@suse.de>
18566
18567 * src/output.c (output_rule_data): Don't output NULL, it might
18568 not be defined yet.
18569
4162fa07 185702002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 18571
4162fa07
RA
18572 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
18573 (Copyright notice): Update.
b418ecd8 18574
bd16a5dc
AD
185752002-02-11 Akim Demaille <akim@epita.fr>
18576
18577 * tests/regression.at (%nonassoc and eof): Don't include
18578 nonportable headers.
18579
8d69a1a3
RA
185802002-02-08 Robert Anisko <robert@lrde.epita.fr>
18581
18582 * data/bison.c++: Correct error recovery. Make the user able to
18583 initialize the starting location.
18584
9b2d0677
AD
185852002-02-07 Akim Demaille <akim@epita.fr>
18586
18587 * tests/input.at: New.
18588
69e2658b
RA
185892002-02-07 Robert Anisko <robert@lrde.epita.fr>
18590
18591 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 18592 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
18593 directives around tables only needed for debugging.
18594
4aacc3a7
RA
185952002-02-07 Robert Anisko <robert@lrde.epita.fr>
18596
18597 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
18598 C++ parsers.
18599 (yy::b4_name::parse): Use print_.
18600
762a801e
RA
186012002-02-07 Robert Anisko <robert@lrde.epita.fr>
18602
18603 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
18604
4bb2bc3f
RA
186052002-02-07 Robert Anisko <robert@lrde.epita.fr>
18606
18607 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
18608 C++ parsers.
18609 (yy::b4_name::parse): Build verbose error messages, and use error_.
18610
6b45a3ca
RA
186112002-02-06 Robert Anisko <robert@lrde.epita.fr>
18612
18613 * data/bison.c++: Fix m4 quoting in comments.
18614
50997c6e
RA
186152002-02-06 Robert Anisko <robert@lrde.epita.fr>
18616
18617 * data/bison.c++: Adjust the parser code. Fix some muscles that were
18618 not expanded by m4.
18619
3f3eed27
AD
186202002-02-05 Akim Demaille <akim@epita.fr>
18621
18622 * data/bison.c++: Adjust to the M4 back end.
18623 More is certainly needed.
18624
be2a1a68
AD
186252002-02-05 Akim Demaille <akim@epita.fr>
18626
18627 Give a try to M4 as a back end.
18628
18629 * lib/readpipe.c: New, from wdiff.
18630 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
18631 BISON_HAIRY.
18632 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
18633 specific values. Now it is m4 that performs the lookup.
18634 * src/parse-skel.y: Remove.
18635 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
18636 * src/output.c (actions_output, guards_output)
18637 (token_definitions_output): No longer keeps track of the output
18638 line number, hence remove the second argument.
18639 (guards_output): Check against the guard member of a rule, not the
18640 action member.
18641 Adjust callers.
18642 (output_skeleton): Don't look for the skeleton location, let m4 do
18643 that.
18644 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
18645 file will be used.
18646 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
18647 (prepare): Given that for the time being changesyntax is not
18648 usable in M4, rename the muscles using `-' to `_'.
18649 Define `defines_flag', `output_parser_name' and `output_header_name'.
18650 * src/output.h (actions_output, guards_output)
18651 (token_definitions_output): Adjust prototypes.
18652 * src/scan-skel.l: Instead of scanning the skeletons, it now
18653 processes the output of m4: `__oline__' and `#output'.
18654 * data/bison.simple: Adjust to be used by M4(sugar).
18655 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
18656 to date.
18657 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
18658 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
18659 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
18660 shamelessly stolen from CVS Autoconf.
18661
beda758b
AD
186622002-02-05 Akim Demaille <akim@epita.fr>
18663
18664 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
18665 * configure.in: Check for the declarations of free and malloc.
18666 * src/muscle_tab.c: Adjust.
18667
5ece6d43
AD
186682002-02-05 Akim Demaille <akim@epita.fr>
18669
18670 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
18671 which have no values.
18672
5bb18f9a
AD
186732002-02-05 Akim Demaille <akim@epita.fr>
18674
18675 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
18676 * data/: here.
18677
894dd62e
PE
186782002-01-29 Paul Eggert <eggert@twinsun.com>
18679
18680 * src/bison.simple (YYSIZE_T): Do not define merely because
18681 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
18682 On some platforms, <alloca.h> does not declare YYSTD (size_t).
18683
82841af7
AD
186842002-01-27 Akim Demaille <akim@epita.fr>
18685
18686 Fix `%nonassoc and eof'.
18687
18688 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
18689 which were not properly copied! Replace
18690 memcpy (res->errs, src->errs, src->nerrs);
18691 with
18692 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
18693 !!!
18694 * tests/regression.at (%nonassoc and eof): Adjust to newest
18695 Autotest: `.' is not in the PATH.
18696
318b76e9
AD
186972002-01-27 Akim Demaille <akim@epita.fr>
18698
18699 * tests/sets.at (AT_EXTRACT_SETS): New.
18700 (Nullable): Use it.
18701 (Firsts): New.
18702
30d2f3d5
AD
187032002-01-26 Akim Demaille <akim@epita.fr>
18704
18705 * tests/actions.at, tests/calc.at, tests/headers.at,
18706 * tests/torture.at: Adjust to the newest Autotest which no longer
18707 forces `.' in the PATH.
18708
30f8c395
AD
187092002-01-25 Akim Demaille <akim@epita.fr>
18710
18711 * tests/regression.at (%nonassoc and eof): New.
18712 Suggested by Robert Anisko.
18713
29ae55f1
AD
187142002-01-24 Akim Demaille <akim@epita.fr>
18715
18716 Bison dumps core when trying to complain about broken input files.
18717 Reported by Cris van Pelt.
18718
18719 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
18720 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
18721 into...
18722 (Invalid inputs): Strengthen: exercise parse_percent_token.
18723
2b548aa6
RA
187242002-01-24 Robert Anisko <robert.anisko@epita.fr>
18725
18726 * src/Makefile.am: Add bison.c++.
18727 * src/bison.c++: New skeleton.
18728
bb0146c2
AD
187292002-01-21 Paolo Bonzini <bonzini@gnu.org>
18730
18731 * po/it.po: New.
18732
bec30531
AD
187332002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
18734
18735 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
18736
fc6edc45
MA
187372002-01-20 Marc Autret <marc@gnu.org>
18738
18739 * src/files.c (compute_output_file_names): Fix
18740
5e5d5415
MA
187412002-01-20 Marc Autret <marc@gnu.org>
18742
18743 * tests/output.at: New test.
18744 * src/files.c (compute_base_names): Don't map extensions when
18745 the YACC flag is set, use defaults.
18746 Reported by Evgeny Stambulchik.
18747
44ea3fbd
MA
187482002-01-20 Marc Autret <marc@gnu.org>
18749
ba0fe3c7
PE
18750 * src/system.h: Need to define __attribute__ away for non-GCC
18751 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
18752 Suggested by Albert Chin-A-Young.
18753
338963d1
TVH
187542002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
18755
18756 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
18757 canonical definition.
18758 * src/system.h: Use the canonical definition for PARAMS (avoids
18759 a conflict with the macro from lib/hash.h).
18760
c57b2479
AD
187612002-01-11 Akim Demaille <akim@epita.fr>
18762
18763 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 18764 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 18765
b85810ae
AD
187662002-01-09 Akim Demaille <akim@epita.fr>
18767
18768 * src/files.c, src/files.h (output_infix): New.
18769 (tab_extension): Remove.
18770 (compute_base_names): Compute the former, drop the latter.
18771 * src/output.c (prepare): Insert the muscles `output-infix', and
18772 `output-suffix'.
18773 * src/parse-skel.y (string, string.1): New.
18774 (section.header): Use it.
18775 (section.yacc): Remove.
18776 (prefix): Remove too.
18777 * src/scan-skel.l: Adjust.
18778 * src/bison.simple, src/bison.hairy: Adjust.
18779
cae60122
AD
187802002-01-09 Akim Demaille <akim@epita.fr>
18781
18782 * configure.in (WERROR_CFLAGS): Compute it.
18783 * src/Makefile.am (CFLAGS): Pass it.
18784 * tests/atlocal.in (CFLAGS): Idem.
18785 * src/files.c: Fix a few warnings.
18786 (get_extension_index): Remove, unused.
18787
ae404801
AD
187882002-01-08 Akim Demaille <akim@epita.fr>
18789
18790 * src/getargs.c (AS_FILE_NAME): New.
18791 (getargs): Use it to convert DOSish file names.
18792 * src/files.c (base_name): Rename as full_base_name to avoid
18793 clashes with `base_name ()'.
18794 (filename_split): New.
18795 (compute_base_names): N-th rewrite, using filename_split.
18796
22312b71
AD
187972002-01-08 Akim Demaille <akim@epita.fr>
18798
18799 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
18800 New, stolen from the Fileutils 4.1.
18801 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
18802 * configure.in: Check for the presence of memrchr, and of its
18803 prototype.
18804
a67cef01
TVH
188052002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
18806
18807 * lib/hash.h (__P): Added definition for this macro.
18808 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
18809 BUILT_SOURCES, to ensure they are generated first.
18810 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
18811 %error-verbose to allow bootstrapping with bison 1.30x.
18812
2b25d624
AD
188132002-01-06 Akim Demaille <akim@epita.fr>
18814
18815 * src/reader.c (parse_braces): Don't fetch the next char, the
18816 convention is to fetch on entry.
18817 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
18818 'switch' without a following semicolon.
18819 * tests/regression.at (braces parsing): New.
18820
3460813b
AD
188212002-01-06 Akim Demaille <akim@epita.fr>
18822
18823 Bison is dead wrong in its RR conflict reports.
18824
18825 * tests/torture.at (GNU Cim Grammar): New.
18826 * src/conflicts.c (count_rr_conflicts): Fix.
18827
73784c64
AD
188282002-01-06 Akim Demaille <akim@epita.fr>
18829
18830 Creating package.m4 from configure.ac causes too many problems.
18831
18832 * tests/Makefile.am (package.m4): Create it by hand,
18833 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
18834
25d81090
AD
188352002-01-06 Akim Demaille <akim@epita.fr>
18836
18837 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
18838 skeleton.h.
18839
a9b8959e
PE
188402002-01-04 Paul Eggert <eggert@twinsun.com>
18841
18842 * doc/bison.texinfo (Debugging):
18843 Remove YYSTDERR; it's no longer defined or used.
18844 Also, s/cstdio.h/cstdio/.
18845
25d81090
AD
188462002-01-03 Akim Demaille <akim@epita.fr>
18847
18848 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
18849
1109455c
AD
188502002-01-03 Akim Demaille <akim@epita.fr>
18851
18852 * src/parse-skel.y (process_skeleton): Don't bind the parser's
18853 tracing code to --trace, wait for a better --trace option, with
18854 args.
18855
7ea5e977
AD
188562002-01-03 Akim Demaille <akim@epita.fr>
18857
18858 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
18859 The ISO C++ standard is extremely clear about it: stderr is
18860 considered a macro, not a regular symbol (see table 94 `Header
18861 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
18862 Therefore std:: does not apply to it. It still does with fprintf.
18863 Also, s/cstdio.h/cstdio/.
18864
fab5b110
AD
188652002-01-03 Akim Demaille <akim@epita.fr>
18866
18867 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
18868 for non system headers.
18869
aed7fd9b
AD
188702002-01-02 Akim Demaille <akim@epita.fr>
18871
18872 Equip the skeleton chain with location tracking, runtime trace,
18873 pure parser and scanner.
18874
18875 * src/parse-skel.y: Request a pure parser, locations, and prefix
18876 renaming.
18877 (%union): Having several members with the same type does not help
18878 type mismatches, simplify.
18879 (YYPRINT, yyprint): New.
18880 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
18881 (skel_error): this.
18882 Handle locations.
18883 * src/scan-skel.l: Adjust to these changes.
18884 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
18885 (LOCATION_PRINT, skel_control_t): New.
18886
24fad99e
AD
188872001-12-30 Akim Demaille <akim@epita.fr>
18888
18889 * src/parse-skel.y: Get rid of the shift/reduce conflict:
18890 replace `gb' with BLANKS.
18891 * src/scan-skel.l: Adjust.
18892
a4b36db4
AD
188932001-12-30 Akim Demaille <akim@epita.fr>
18894
18895 * src/system.h: We don't need nor want bcopy.
18896 Throw away MS-DOS crap: we don't need getpid.
18897 * configure.in: We don't need strndup. It was even causing
18898 problems: because Flex includes the headers *before* us,
18899 _GNU_SOURCE is not defined by config.h, and therefore strndup was
18900 not visible.
18901 * lib/xstrndup.c: New.
18902 * src/scan-skel.l: Use it.
18903 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
18904 * src/parse-skel.y: Use %directives instead of #defines.
18905
1239777d
AD
189062001-12-30 Akim Demaille <akim@epita.fr>
18907
18908 * src/skeleton.h: New.
18909 * src/output.c (output_parser, output_master_parser): Remove, dead
18910 code.
18911 * src/output.h (get_lines_number, actions_output, guards_output)
18912 (token_definitions_output): Prototype them.
18913 * src/parse-skel.y: Add the license notice.
18914 Include output.h and skeleton.h.
18915 (process_skeleton): Returns void, and takes a single parameter.
18916 * src/scan-skel.l: Add the license notice.
18917 Include skeleton.h.
18918 Don't use %option yylineno: it seems that then Flex imagines
18919 REJECT has been used, and therefore it won't reallocate its
18920 buffers (which makes no other sense to me than a bug). It results
18921 in warnings for `unused: yy_flex_realloc'.
18922
9b3add5b
RA
189232001-12-30 Robert Anisko <robert.anisko@epita.fr>
18924
18925 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
18926 (MUSCLE_INSERT_PREFIX): ...to there.
18927 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
18928 (MUSCLE_INSERT_PREFIX): Move from here...
18929
18930 * src/bison.hairy: Add a section directive. Put braces around muscle
18931 names. This parser skeleton is still broken, but Bison should not
18932 choke on a bad muscle 'syntax'.
18933 * src/bison.simple: Add a section directive. Put braces around muscle
18934 names.
18935
18936 * src/files.h (strsuffix, stringappend): Add declarations.
18937 (tab_extension): Add declaration.
18938 (short_base_name): Add declaration.
18939
18940 * src/files.c (strsuffix, stringappend): No longer static. These
18941 functions are used in the skeleton parser.
18942 (tab_extension): New.
18943 (compute_base_names): Use the computations done in this function
fab5b110 18944 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
18945 names.
18946 (short_base_name): No longer static.
18947
18948 * src/output.c (output_skeleton): New.
18949 (output): Disable call to output_master_parser, and give a try to
18950 a new skeleton handling system.
18951 (guards_output, actions_output): No longer static.
18952 (token_definitions_output, get_lines_number): No longer static.
18953
18954 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
18955
fab5b110 18956 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
18957 parse-skel.y.
18958
18959 * src/parse-skel.y: New file.
18960 * src/scan-skel.l: New file.
18961
b5b61c61
AD
189622001-12-29 Akim Demaille <akim@epita.fr>
18963
18964 %name-prefix is broken.
18965
18966 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
18967 Adjust all dependencies.
18968 * tests/headers.at (export YYLTYPE): Strengthen this test: use
18969 %name-prefix.
18970
18971 Renaming yylval but not yylloc is not consistent. Now we do.
18972
18973 * src/bison.simple: Prefix yylloc if used.
18974 * doc/bison.texinfo (Decl Summary): Document that.
18975
8c9a50be
AD
189762001-12-29 Akim Demaille <akim@epita.fr>
18977
18978 * doc/bison.texinfo: Promote `%long-directive' over
18979 `%long_directive'.
18980 Remove all references to fixed-output-files, yacc is enough.
18981
d99361e6
AD
189822001-12-29 Akim Demaille <akim@epita.fr>
18983
18984 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
18985 user prologue. These are defaults.
18986 * tests/actions.at (Mid-rule actions): Make sure the user can
18987 define YYDEBUG and YYERROR_VERBOSE.
18988
b9cecb91
AD
189892001-12-29 Akim Demaille <akim@epita.fr>
18990
18991 * src/output.c (header_output): Don't forget to export YYLTYPE and
18992 yylloc.
18993 * tests/headers.at (export YYLTYPE): New, make sure it does.
18994 * tests/regression.at (%union and --defines, Invalid CPP headers):
18995 Move to...
18996 * tests/headers.at: here.
18997
aea13e97
AD
189982001-12-29 Akim Demaille <akim@epita.fr>
18999
19000 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
19001
931394cb
AD
190022001-12-29 Akim Demaille <akim@epita.fr>
19003
19004 * tests/actions.at (Mid-rule actions): Output on a single line
19005 instead of several.
19006
704a47c4
AD
190072001-12-29 Akim Demaille <akim@epita.fr>
19008
19009 * doc/bison.texinfo: Formatting changes.
19010
091e20bb
AD
190112001-12-29 Akim Demaille <akim@epita.fr>
19012
19013 Don't store the token defs in a muscle, just be ready to output it
19014 on command. Now possible via `symbols'. Fixes a memory leak.
19015
19016 * src/output.c (token_definitions_output): New.
19017 (output_parser, header_output): Use it.
19018 * src/reader.c (symbols_save): Remove.
19019
cce71710
AD
190202001-12-29 Akim Demaille <akim@epita.fr>
19021
19022 * src/bison.simple: Do not provide a default for YYSTYPE and
19023 YYLTYPE before the user's prologue. Otherwise it's hardly... a
19024 default.
19025
82c035a8
AD
190262001-12-29 Akim Demaille <akim@epita.fr>
19027
19028 Mid-rule actions are simply... ignored!
19029
19030 * src/reader.c (readgram): Be sure to attach mid-rule actions to
19031 the empty-rule associated to the dummy symbol, not to the host
19032 rule.
19033 * tests/actions.at (Mid-rule actions): New.
19034
8419d367
AD
190352001-12-29 Akim Demaille <akim@epita.fr>
19036
19037 Memory leak.
19038
19039 * src/reader.c (reader): Free grammar.
19040
375d5806
AD
190412001-12-29 Akim Demaille <akim@epita.fr>
19042
19043 Memory leak.
19044
19045 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
19046 since it allocates it for each state, although only one is needed.
19047 (allocate_storage): Do it here.
19048
f51cb8ff
AD
190492001-12-29 Akim Demaille <akim@epita.fr>
19050
19051 * src/options.h, src/options.c (create_long_option_table): Rename
19052 as...
19053 (long_option_table_new): this, with a clearer prototype.
19054 (percent_table): Remove, unused,
19055 * src/getargs.c (getargs): Adjust.
19056
29e88316
AD
190572001-12-29 Akim Demaille <akim@epita.fr>
19058
19059 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
19060 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
19061 as states.
19062
b9f71f19
AD
190632001-12-29 Akim Demaille <akim@epita.fr>
19064
19065 * src/lalr.c (build_relations): Rename `states' as `states1'.
19066 Sorry, I don't understand exactly what it is, no better name...
19067
1a2b5d37
AD
190682001-12-29 Akim Demaille <akim@epita.fr>
19069
19070 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
19071 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
19072 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
19073 as rules.
19074
1cca533e
AD
190752001-12-29 Akim Demaille <akim@epita.fr>
19076
19077 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
19078 ago.
19079
c03ae966
AD
190802001-12-29 Akim Demaille <akim@epita.fr>
19081
19082 * src/reader.c, src/reader.h (user_toknums): Remove.
19083 Adjust all users to use symbols[i]->user_token_number.
19084
5a670b1e
AD
190852001-12-29 Akim Demaille <akim@epita.fr>
19086
19087 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
19088 Adjust all users to use symbols[i]->prec or ->assoc.
19089
ad949da9
AD
190902001-12-29 Akim Demaille <akim@epita.fr>
19091
19092 * src/reader.c, src/reader.h (tags): Remove.
19093 Adjust all users to use symbols[i]->tag.
19094
0e78e603
AD
190952001-12-29 Akim Demaille <akim@epita.fr>
19096
19097 * src/gram.h, src/gram.c (symbols): New, similar to state_table
19098 and rule_table.
19099 * src/reader.c (packsymbols): Fill this table.
19100 Drop sprec.
19101 * src/conflicts.c (resolve_sr_conflict): Adjust.
19102 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
19103 single table.
19104 Use symbols[i]->tag instead of tags[i].
19105
213e640e
AD
191062001-12-29 Akim Demaille <akim@epita.fr>
19107
19108 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
19109 In addition, put a comment in there, to replace...
19110 * tests/regression.at (%union and C comments): Remove.
19111
e7b8bef1
AD
191122001-12-29 Akim Demaille <akim@epita.fr>
19113
19114 * tests/regression.at (Web2c Actions): Blindly move the actual
19115 output as expected output. The contents *seem* right to me, but I
19116 can't pretend reading perfectly parser tables... Nonetheless, all
19117 the other tests pass correctly, the table look OK, even though the
19118 presence of `$axiom' is to be noted: AFAICS it is useless (but
19119 harmless).
19120
b68e7744
AD
191212001-12-29 Akim Demaille <akim@epita.fr>
19122
19123 * src/reader.c (readgram): Don't add the rule 0 if there were no
19124 rules read. In other words, add it _after_ having performed
19125 grammar sanity checks.
19126 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
19127
78d5bae9
AD
191282001-12-29 Akim Demaille <akim@epita.fr>
19129
19130 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
19131 visible, and some states have now a different number.
19132
ff442794
AD
191332001-12-29 Akim Demaille <akim@epita.fr>
19134
19135 * src/reader.c (readgram): Bind the initial rule's lineno to that
19136 of the first rule.
19137 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
19138 (Solved SR Conflicts): Adjust rule 0's line number.
19139
610ab194
AD
191402001-12-29 Akim Demaille <akim@epita.fr>
19141
19142 Fix the `GAWK Grammar' failure.
19143
19144 * src/LR0.c (final_state): Initialize to -1 so that we do compute
19145 the reductions of the first state which was mistakenly confused
19146 with the final state because precisely final_state was initialized
19147 to 0.
19148 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
19149 now noticed by Bison.
19150 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
19151 have a reduction on $default.
19152
29d29c8f
AD
191532001-12-29 Akim Demaille <akim@epita.fr>
19154
19155 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
19156 rule line numbers.
19157 * src/closure.c (print_closure): Likewise.
19158 * src/derives.c (print_derives): Likewise.
19159 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
19160 now.
19161
7c6b64d0
AD
191622001-12-29 Akim Demaille <akim@epita.fr>
19163
19164 * src/lalr.c (lookaheads_print): New.
19165 (lalr): Call it when --trace-flag.
19166 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
19167 are dumped.
19168
3d4daee3
AD
191692001-12-29 Akim Demaille <akim@epita.fr>
19170
19171 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
19172 when walking through ritem, even via rule->rhs.
19173 * src/reduce.c (dump_grammar, useful_production, reduce_output)
19174 (useful_production, useless_nonterminals): Likewise.
19175 (reduce_grammar_tables): Likewise, plus update nritems.
19176 * src/nullable.c (set_nullable): Likewise.
19177 * src/lalr.c (build_relations): Likewise.
19178 * tests/sets.at (Nullable): Adjust.
19179 Fortunately, now, the $axiom is no longer nullable.
19180
9e7f6bbd
AD
191812001-12-29 Akim Demaille <akim@epita.fr>
19182
19183 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
19184 the 0-sentinel.
19185 * src/gram.c (ritem_longest_rhs): Likewise.
19186 * src/reduce.c (nonterminals_reduce): Likewise.
19187 * src/print_graph.c (print_graph): Likewise.
19188 * src/output.c (output_rule_data): Likewise.
19189 * src/nullable.c (set_nullable): Likewise.
19190
255ef638
AD
191912001-12-29 Akim Demaille <akim@epita.fr>
19192
19193 * src/output.c: Comment changes.
19194
0d8a7363
AD
191952001-12-27 Paul Eggert <eggert@twinsun.com>
19196
19197 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
19198 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
19199 Sparc, as they were causing more porting problems than the
19200 (minor) performance improvement was worth.
19201
19202 Also, catch up with 1.31's YYSTD.
19203
3db472b9
AD
192042001-12-27 Akim Demaille <akim@epita.fr>
19205
19206 * src/output.c (output_gram): Rely on nritems, not the
19207 0-sentinel. See below.
19208 Use -1 as separator, not 0.
19209 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
19210 Rely on -1 as separator in yyrhs, instead of 0.
19211 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
19212 twice `Now at end of input', therefore there are two lines less to
19213 expect.
19214
b365aa05
AD
192152001-12-27 Akim Demaille <akim@epita.fr>
19216
19217 * tests/regression.at (Unresolved SR Conflicts):
19218 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
19219 below.
19220
30171f79
AD
192212001-12-27 Akim Demaille <akim@epita.fr>
19222
19223 * src/LR0.c (new_state): Recognize the final state by the fact it
19224 is reached by eoftoken.
19225 (insert_start_shifting_state, insert_eof_shifting_state)
19226 (insert_accepting_state, augment_automaton): Remove, since now
19227 these states are automatically computed from the initial state.
19228 (generate_states): Adjust.
19229 * src/print.c: When reporting a rule number to the user, substract
19230 1, so that the axiom rule is rule 0, and the first user rule is 1.
19231 * src/reduce.c: Likewise.
19232 * src/print_graph.c (print_core): For the time being, just as for
19233 the report, depend upon --trace-flags to dump the full set of
19234 items.
19235 * src/reader.c (readgram): Once the grammar read, insert the rule
19236 0: `$axiom: START-SYMBOL $'.
19237 * tests/set.at: Adjust: rule 0 is now displayed, and since the
19238 number of the states has changed (the final state is no longer
19239 necessarily the last), catch up.
19240
75142d45
AD
192412001-12-27 Akim Demaille <akim@epita.fr>
19242
19243 Try to make the use of the eoftoken valid. Given that its value
19244 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
19245 is used instead of > 0 where appropriate, (ii), depend upon nritems
19246 instead of the 0-sentinel.
19247
19248 * src/gram.h, src/gram.c (nritems): New.
19249 Expected to be duplication of nitems, but for the time being...
19250 * src/reader.c (packgram): Assert nritems and nitems are equal.
19251 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
19252 * src/closure.c (print_closure, print_fderives): Likewise.
19253 * src/gram.c (ritem_print): Likewise.
19254 * src/print.c (print_core, print_grammar): Likewise.
19255 * src/print_graph.c: Likewise.
19256
b7c49edf
AD
192572001-12-27 Akim Demaille <akim@epita.fr>
19258
19259 * src/main.c (main): If there are complains after grammar
19260 reductions, then output the report anyway if requested, then die.
19261 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
19262 * src/reader.c (eoftoken): New.
19263 (parse_token_decl): If the token being defined has value `0', it
19264 is the eoftoken.
19265 (packsymbols): No longer hack `tags' to insert `$' by hand.
19266 Be sure to preserve the value of the eoftoken.
19267 (reader): Make sure eoftoken is defined.
19268 Initialize nsyms to 0: now eoftoken is created just like the others.
19269 * src/print.c (print_grammar): Don't special case the eof token.
19270 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
19271 lie anyway, albeit pleasant.
19272 * tests/calc.at: Exercise error messages with eoftoken.
19273 Change the grammar so that empty input is invalid.
19274 Adjust expectations.
19275 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
19276
ec2da99f
AD
192772001-12-27 Akim Demaille <akim@epita.fr>
19278
19279 * configure.in: Check the protos of strchr ans strspn.
19280 Replace strchr if needed.
19281 * src/system.h: Provide the protos of strchr, strspn and memchr if
19282 missing.
19283 * lib/strchr.c: New.
19284 * src/reader.c (symbols_save): Use strchr.
19285
8adfa272
AD
192862001-12-27 Akim Demaille <akim@epita.fr>
19287
19288 * src/print.c, src/print_graph.c (escape): New.
19289 Use it to quote the TAGS outputs.
19290 * src/print_graph.c (print_state): Now errors are in red, and
19291 reductions in green.
19292 Prefer high to wide: output the state number on a line of its own.
19293
80dac38c
AD
192942001-12-27 Akim Demaille <akim@epita.fr>
19295
19296 * src/state.h, src/state.c (reductions_new): New.
19297 * src/LR0.c (set_state_table): Let all the states have a
19298 `reductions', even if reduced to 0.
19299 (save_reductions): Adjust.
19300 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
19301 * src/print.c (print_reductions, print_actions): Adjust.
19302 * src/output.c (action_row): Adjust.
19303
2cec70b9
AD
193042001-12-27 Akim Demaille <akim@epita.fr>
19305
19306 * src/state.h, src/state.c (errs_new, errs_dup): New.
19307 * src/LR0.c (set_state_table): Let all the states have an errs,
19308 even if reduced to 0.
19309 * src/print.c (print_errs, print_reductions): Adjust.
19310 * src/output.c (output_actions, action_row): Adjust.
19311 * src/conflicts.c (resolve_sr_conflict): Adjust.
19312
13ca549a
AD
193132001-12-27 Akim Demaille <akim@epita.fr>
19314
19315 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
19316
5092aba5
AD
193172001-12-27 Akim Demaille <akim@epita.fr>
19318
19319 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
19320 * src/print.c: here.
19321 (lookaheadset, shiftset): New, used as additional storage by
19322 print_reductions.
19323 (print_results): Adjust.
19324 (print_shifts, print_gotos, print_errs): New, extracted from...
19325 (print_actions): here.
19326 * src/print_graph.c (print_actions): Remove dead code.
19327
11e2beca
AD
193282001-12-27 Akim Demaille <akim@epita.fr>
19329
19330 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
19331 `$n' and `@n'.
19332
dac3c910
AD
193332001-12-27 Akim Demaille <akim@epita.fr>
19334
19335 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
19336 (build_relations): Adjust.
19337
d0b0fefa
AD
193382001-12-27 Akim Demaille <akim@epita.fr>
19339
19340 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
19341 duplication.
19342
adc8c848
AD
193432001-12-27 Akim Demaille <akim@epita.fr>
19344
19345 * src/reader.c (packgram): Catch nitems overflows.
19346
14d293ac
AD
193472001-12-27 Akim Demaille <akim@epita.fr>
19348
19349 * src/files.c, src/files.h (guard_obstack): Remove.
19350 * src/output.c (output): Adjust.
19351 * src/reader.c (parse_braces): New, factoring...
19352 (copy_action, copy_guard): these two which are renamed as...
19353 (parse_action, parse_guard): these.
19354 As a voluntary consequence, using braces around guards is now
19355 mandatory.
19356
f499b062
AD
193572001-12-27 Akim Demaille <akim@epita.fr>
19358
19359 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
19360 * src/reader.c (symbol_list): `guard' and `guard_line' are new
19361 members.
19362 (symbol_list_new): Adjust.
19363 (copy_action): action_line is the first line, not the last.
19364 (copy_guard): Just as for actions, store the `action' only, not
19365 the switch/case/break flesh.
19366 Don't parse the user action that might follow the guard, let...
19367 (readgram): do it, i.e., now, there can be an action after a
19368 guard.
19369 In other words the guard is just explicitly optional.
19370 (packgram): Adjust.
19371 * src/output.c (guards_output): New.
19372 (output_parser): Call it when needed.
19373 (output): Also free the guard and attrs obstacks.
19374 * src/files.c, src/files.h (obstack_save): Remove.
19375 (output_files): Remove.
19376 As a result, if one needs the former `.act' file, using an
19377 appropriate skeleton which requires actions and guards is now
19378 required.
19379 * src/main.c (main): Adjust.
19380 * tests/semantic.at: New.
19381 * tests/regression.at: Use `input.y' as input file name.
19382 Avoid 8+3 problems by requiring input.c when the test needs the
19383 parser.
19384
d945f5cd
AD
193852001-12-27 Akim Demaille <akim@epita.fr>
19386
19387 * src/reader.c (symbol_list_new): Be sure to initialize all the
19388 fields.
19389
d200e455
AD
193902001-12-27 Akim Demaille <akim@epita.fr>
19391
19392 All the hacks using a final pseudo state are now useless.
19393
19394 * src/LR0.c (set_state_table): state_table holds exactly nstates.
19395 * src/lalr.c (nLA): New.
19396 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
19397 instead of lookaheadsp from the pseudo state (nstate + 1).
19398
f9507c28
AD
193992001-12-27 Akim Demaille <akim@epita.fr>
19400
19401 * src/output.c (action_row, token_actions): Use a state_t instead
19402 of a integer, and nlookaheads instead of the following state's
19403 lookaheadsp.
19404
065fbd27
AD
194052001-12-27 Akim Demaille <akim@epita.fr>
19406
19407 * src/conflicts.c (log_resolution, flush_shift)
19408 (resolve_sr_conflict, set_conflicts, solve_conflicts)
19409 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
19410 (conflicts_print, print_reductions): Use a state_t instead of an
19411 integer when referring to a state.
19412 As much as possible, depend upon nlookaheads, instead of the
19413 `lookaheadsp' member of the following state (since lookaheads of
19414 successive states are successive, the difference between state n + 1
19415 and n served as the number of lookaheads for state n).
19416 * src/lalr.c (add_lookback_edge): Likewise.
19417 * src/print.c (print_core, print_actions, print_state)
19418 (print_results): Likewise.
19419 * src/print_graph.c (print_core, print_actions, print_state)
19420 (print_graph): Likewise.
19421 * src/conflicts.h: Adjust.
19422
1b177bd7
AD
194232001-12-27 Akim Demaille <akim@epita.fr>
19424
19425 * src/bison.hairy: Formatting/comment changes.
19426 ANSIfy.
19427 Remove `register' indications.
19428 Add plenty of `static'.
19429
7742ddeb
AD
194302001-12-27 Akim Demaille <akim@epita.fr>
19431
19432 * src/output.c (prepare): Drop the muscle `ntbase' which
19433 duplicates ntokens.
19434 * src/bison.simple: Formatting/comment changes.
19435 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
19436 is an undocumented synonym.
19437
1fa14068
AD
194382001-12-22 Akim Demaille <akim@epita.fr>
19439
19440 * src/output.c (output_table_data): Change the prototype to use
19441 `int' for array ranges: some invocations do pass an int, not a
19442 short.
19443 Reported by Wayne Green.
19444
b9752825
AD
194452001-12-22 Akim Demaille <akim@epita.fr>
19446
19447 Some actions of web2c.y are improperly triggered.
19448 Reported by Mike Castle.
19449
19450 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
19451 * tests/regression.at (Web2c): Rename as...
19452 (Web2c Report): this.
19453 (Web2c Actions): New.
19454
776209d6
AD
194552001-12-22 Akim Demaille <akim@epita.fr>
19456
19457 Reductions in web2c.y are improperly reported.
19458 Reported by Mike Castle.
19459
19460 * src/conflicts.c (print_reductions): Fix.
19461 * tests/regression.at (Web2c): New.
19462
275fc3ad
AD
194632001-12-18 Akim Demaille <akim@epita.fr>
19464
19465 Some host fail on `assert (!"foo")', which expands to
19466 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
19467 Reported by Nelson Beebee.
19468
19469 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
19470 `#define it_succeeded 0' and `assert (it_succeeded)'.
19471
897668ee
MA
194722001-12-17 Marc Autret <autret_m@epita.fr>
19473
19474 * src/bison.simple: Don't hard code the skeleton line and filename.
19475 * src/output.c (output_parser): Rename 'line' as 'output_line'.
19476 New line counter 'skeleton_line' (skeleton-line muscle).
19477
ab3399e0
PE
194782001-12-17 Paul Eggert <eggert@twinsun.com>
19479
19480 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
19481 YYDEBUG must be defined to a nonzero value.
19482
19483 * src/bison.simple (yytname): Do not assume that the user defines
19484 YYDEBUG to a properly parenthesized expression.
19485
3877f72b
AD
194862001-12-17 Akim Demaille <akim@epita.fr>
19487
19488 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
19489 nlookaheads is a new member.
19490 Adjust all users.
19491 * src/lalr.h (nlookaheads): Remove this orphan declaration.
19492 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
19493 state.
776209d6 19494
331dbc1b
AD
194952001-12-17 Akim Demaille <akim@epita.fr>
19496
19497 * src/files.h, src/files.c (open_files, close_files): Remove.
19498 * src/main.c (main): Don't open/close files, nor invoke lex_free,
19499 let...
19500 * src/reader.c (reader): Do it.
776209d6 19501
be750e4c
AD
195022001-12-17 Akim Demaille <akim@epita.fr>
19503
19504 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 19505
709ae8c6
AD
195062001-12-17 Akim Demaille <akim@epita.fr>
19507
19508 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
19509 (flush_reduce): New.
19510 (resolve_sr_conflict): Adjust.
776209d6 19511
f87685c3
AD
195122001-12-17 Akim Demaille <akim@epita.fr>
19513
19514 * src/output.c (output_obstack): Be static and rename as...
19515 (format_obstack): this, to avoid any confusion with files.c's
19516 output_obstack.
19517 * src/reader.h (muscle_obstack): Move to...
19518 * src/output.h: here, since it's defined in output.c.
19519
837491d8
AD
195202001-12-17 Akim Demaille <akim@epita.fr>
19521
19522 * src/output.c (action_row, save_column, default_goto)
19523 (sort_actions, matching_state, pack_vector): Better variable
19524 locality.
19525
796d61fb
AD
195262001-12-17 Akim Demaille <akim@epita.fr>
19527
19528 * src/output.c: Various formatting changes.
776209d6 19529
64d15509
AD
195302001-12-17 Akim Demaille <akim@epita.fr>
19531
19532 * src/files.c (output_files): Free the output_obstack.
19533 * src/main.c (main): Call print and print_graph conditionally.
19534 * src/print.c (print): Work unconditionally.
19535 * src/print_graph.c (print_graph): Work unconditionally.
19536 * src/conflicts.c (log_resolution): Output only if verbose_flag.
19537
fbc8ecb7
MA
195382001-12-16 Marc Autret <autret_m@epita.fr>
19539
19540 * src/output.c (actions_output): Fix. When we use %no-lines,
19541 there is one less line per action.
19542
f0440388
MA
195432001-12-16 Marc Autret <autret_m@epita.fr>
19544
19545 * src/bison.simple: Remove a useless #line directive.
19546 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
19547 * src/output.c (get_lines_number): New.
776209d6 19548 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
19549 output muscles.
19550 Fix line numbering.
19551 (actions_output): Computes the number of lines taken by actions.
19552 (output_master_parser): Insert new skeleton which is the name of
19553 the output parser file name.
19554
a79986b8
MA
195552001-12-15 Marc Autret <autret_m@epita.fr>
19556
19557 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
19558
4ec8e00f
MA
195592001-12-15 Marc Autret <autret_m@epita.fr>
19560
19561 * src/output.c (output_gram): Keep track of the hairy one.
19562
1a4648ff
AD
195632001-12-15 Akim Demaille <akim@epita.fr>
19564
19565 Make `make distcheck' work.
19566
19567 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
19568 system.h which uses libgettext.h.
19569
9c2c67e6
AD
195702001-12-15 Akim Demaille <akim@epita.fr>
19571
19572 * src/nullable.c (set_nullable): Useless rules must be skipped,
19573 otherwise, since we range over their symbols, we might look at a
19574 nonterminal which no longer ``exists'', i.e., it is not counted in
19575 `nvars', hence we overflow our arrays.
19576
93ede233
AD
195772001-12-15 Akim Demaille <akim@epita.fr>
19578
19579 The header can also be produced directly, without any obstack!
19580 Yahoo!
19581
19582 * src/files.c, src/files.h (defines_obstack): Remove.
19583 (compute_header_macro): Global.
19584 (defines_obstack_save): Remove.
19585 * src/reader.c (parse_union_decl): No longer output to
19586 defines_obstack: its content can be found in the `stype' muscle
19587 anyway.
19588 (output_token_translations): Merge into...
19589 (symbols_output): this.
19590 Rename as...
19591 (symbols_save): this.
19592 (reader): Adjust.
19593 * src/output.c (header_output): New.
19594 (output): Call it.
19595
2666f928
AD
195962001-12-15 Akim Demaille <akim@epita.fr>
19597
19598 * src/reader.c (parse_union_decl): Instead of handling two obstack
19599 simultaneously, use one to define the `stype' muscle, and use the
19600 value of the latter to fill defines_obstack.
19601 (copy_comment): Remove.
19602 (copy_comment2): Work for a single obstack.
19603 Rename as...
19604 (copy_comment): this.
19605
428046f8
AD
196062001-12-15 Akim Demaille <akim@epita.fr>
19607
19608 * src/lex.c, src/lex.h (xgetc): No longer static.
19609 * src/reader.c (parse_union_decl): Revamp.
19610
ea52d706
AD
196112001-12-15 Akim Demaille <akim@epita.fr>
19612
19613 Still making progress in separating Bison into (i) input, (ii)
19614 process, (iii) output: now we can directly output the parser file
19615 without using table_obstack at all.
19616
19617 * src/files.c, src/files.h (table_obstack): Bye bye.
19618 (parser_file_name): New.
19619 * src/files.c (compute_output_file_names): Compute it.
19620 * src/output.c (actions_output, output_parser)
19621 (output_master_parser): To a file instead of an obstack.
19622
3f96f4dc
AD
196232001-12-15 Akim Demaille <akim@epita.fr>
19624
19625 Attach actions to rules, instead of pre-outputting them to
19626 actions_obstack.
19627
19628 * src/gram.h (rule_t): action and action_line are new members.
19629 * src/reader.c (symbol_list): Likewise.
19630 (copy_action): Save the actions within the rule.
19631 (packgram): Save them in rule_table.
19632 * src/output.c (actions_output): New.
19633 (output_parser): Use it on `%%actions'.
19634 (output_rule_data): Don't free rule_table.
19635 (output): Do it.
19636 (prepare): Don't save the `action' muscle.
19637 * src/bison.simple: s/%%action/%%actions/.
19638
51576fb3
AD
196392001-12-15 Akim Demaille <akim@epita.fr>
19640
19641 * src/reader.c (copy_action): When --yacc, don't append a `;'
19642 to the user action: let it fail if lacking.
dee049eb 19643 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 19644
2648a72d
AD
196452001-12-14 Akim Demaille <akim@epita.fr>
19646
19647 * src/lex.c (literalchar): Simply return the char you decoded, non
19648 longer mess around with obstacks and int pointers.
19649 Adjust all callers.
19650
92790e5b
AD
196512001-12-14 Akim Demaille <akim@epita.fr>
19652
19653 * src/lex.c (literalchar): Don't escape the special characters,
19654 just decode them, and keep them as char (before, eol was output as
19655 the 2 char string `\n' etc.).
19656 * src/output.c (output_rule_data): Use quotearg to output the
19657 token strings.
19658
927c1557
PE
196592001-12-13 Paul Eggert <eggert@twinsun.com>
19660
19661 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
19662 Do not infringe on the global user namespace when using C++.
19663 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
19664 All uses of `fprintf' and `stderr' changed.
19665
19666 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
19667
ed8e1f68
AD
196682001-12-13 Akim Demaille <akim@epita.fr>
19669
19670 The computation of nullable is broken: it doesn't handle empty
19671 RHS's properly.
19672
19673 * tests/torture.at (GNU AWK Grammar): New.
19674 * tests/sets.at (Nullable): New.
19675 * src/nullable.c (set_nullable): Instead of blindly looping over
19676 `ritems', loop over the rules, and then over their rhs's.
19677
19678 Work around Autotest bugs.
19679
19680 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
19681 frame, because Autotest understand lines starting with a `+' as
19682 traces from the shell. Then, they are not processed properly.
19683 Admittedly an Autotest bug, but we don't have time to wait for
19684 Autotest to catch up.
19685 * tests/regression.at (Broken Closure): Adjust to the new table
19686 frames.
19687 Move to...
19688 * tests/sets.at: here.
19689
cb581495
AD
196902001-12-13 Akim Demaille <akim@epita.fr>
19691
19692 * src/closure.c (closure): Use nrules instead of playing tricks
19693 with BITS_PER_WORD.
19694
2e729273
AD
196952001-12-13 Akim Demaille <akim@epita.fr>
19696
19697 * src/print.c (print_actions): Output the handling of `$' as the
19698 traces do: shifting the token EOF. Before EOF was treated as a
19699 nonterminal.
19700 * tests/regression.at: Adjust some tests.
19701 * src/print_graph.c (print_core): Complete the set of items via
19702 closure. The next-to-final and final states are still unsatisfying,
19703 but that's to be addressed elsewhere.
19704 No longer output the rule numbers, but do output the state number.
19705 A single loop for the shifts + gotos is enough, but picked a
19706 distinct color for each.
19707 (print_graph): Initialize and finalize closure.
19708
107f7dfb
AD
197092001-12-13 Akim Demaille <akim@epita.fr>
19710
19711 * src/reader.c (readgram): Remove dead code, an strip useless
19712 braces.
19713 (get_type): Remove, unused.
19714
9b53a24f
AD
197152001-12-12 Akim Demaille <akim@epita.fr>
19716
19717 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
19718 on that of lib/error.c.
19719
dbfb6dcd
AD
197202001-12-12 Akim Demaille <akim@epita.fr>
19721
19722 Some hosts don't like `/' in includes.
19723
19724 * src/system.h: Include libgettext.h without qualifying the path.
19725 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
19726 $(top_srcdir).
19727
c25fb648
MA
197282001-12-11 Marc Autret <autret_m@epita.fr>
19729
19730 * src/output.c (output_parser): Remove useless muscle.
19731
710ddc4f
MA
197322001-12-11 Marc Autret <autret_m@epita.fr>
19733
19734 * src/bison.simple: Remove #line just before %%epilogue. It
19735 is now handled in ...
19736 * src/reader.c (read_additionnal_code): Add the output of a
19737 #line for the epilogue.
19738
e83d80b8
MA
197392001-12-10 Marc Autret <autret_m@epita.fr>
19740
927c1557 19741 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
19742 replace precedent remove.
19743 * src/bison.simple: Remove #line before %%prologue because
19744 %%input-line is wrong at this time.
19745
971d5158
MA
197462001-12-10 Marc Autret <autret_m@epita.fr>
19747
19748 * src/reader.c (symbols_output): Clean up.
927c1557 19749 * src/output.c (output_gram, output): Clean up.
971d5158 19750
5edafffd
AD
197512001-12-10 Akim Demaille <akim@epita.fr>
19752
19753 * src/lalr.c (initialize_lookaheads): New. Extracted from...
19754 * src/LR0.c (set_state_table): here.
19755 * src/lalr.c (lalr): Call it.
19756
0279f8e9
AD
197572001-12-10 Akim Demaille <akim@epita.fr>
19758
19759 * src/state.h (shifts): Remove the `number' member: shifts are
19760 attached to state, hence no longer need to be labelled with a
19761 state number.
19762
190c4f5f
AD
197632001-12-10 Akim Demaille <akim@epita.fr>
19764
19765 Now that states have a complete set of members, the linked list of
19766 shifts is useless: just fill directly the state's shifts member.
19767
19768 * src/state.h (shifts): Remove the `next' member.
19769 * src/LR0.c (first_state, last_state): Remove.
19770 Adjust the callers.
19771 (augment_automaton): Don't look for the shifts that must be added
19772 a shift on EOF: it is those of the state we looked for! But now,
19773 since shifts are attached, it is no longer needed to looking
19774 merely by its id: its number.
19775
2a73b93d
AD
197762001-12-10 Akim Demaille <akim@epita.fr>
19777
19778 * src/LR0.c (augment_automaton): Better variable locality.
19779 Remove an impossible branch: if there is a state corresponding to
19780 the start symbol being shifted, then there is shift for the start
19781 symbol from the initial state.
19782
74392f6a
AD
197832001-12-10 Akim Demaille <akim@epita.fr>
19784
19785 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
19786 only when appropriate: when insert_start_shifting_state' is not
19787 invoked.
19788 * tests/regression.at (Rule Line Numbers): Adjust.
19789
37c82725
AD
197902001-12-10 Akim Demaille <akim@epita.fr>
19791
19792 * src/LR0.c (augment_automaton): Now that all states have shifts,
19793 merge the two cases addition shifts to the initial state.
19794
6a164e0c
AD
197952001-12-10 Akim Demaille <akim@epita.fr>
19796
19797 * src/lalr.c (set_state_table): Move to...
19798 * src/LR0.c: here.
19799 * src/lalr.c (lalr): Don't call it...
19800 * src/LR0.c (generate_states): do it.
19801 * src/LR0.h (first_state): Remove, only the table is used.
19802
7215de24
AD
198032001-12-10 Akim Demaille <akim@epita.fr>
19804
19805 * src/LR0.h (first_shift, first_reduction): Remove.
19806 * src/lalr.c: Don't use first_shift: find shifts through the
19807 states.
19808
80e25d4d
AD
198092001-12-10 Akim Demaille <akim@epita.fr>
19810
19811 * src/LR0.c: Attach shifts to states as soon as they are
19812 computed.
19813 * src/lalr.c (set_state_table): Instead of assigning shifts to
19814 state, just assert that the mapping was properly done.
19815
0ab3728b
AD
198162001-12-10 Akim Demaille <akim@epita.fr>
19817
19818 * src/LR0.c (insert_start_shift): Rename as...
19819 (insert_start_shifting_state): this.
19820 (insert_eof_shifting_state, insert_accepting_state): New.
19821 (augment_automaton): Adjust.
19822 Better locality of the variables.
19823 When looking if the start_symbol is shifted from the initial
19824 state, using `while (... symbol != start_symbol ...)' sounds
19825 better than `while (... symbol < start_symbol ...)': If fail
19826 to see how the order between symbols could be relevant!
19827
78af9bbc
AD
198282001-12-10 Akim Demaille <akim@epita.fr>
19829
19830 * src/getargs.h: Don't declare `spec_name_prefix' and
19831 `spec_file_prefix', declared by src/files.h.
19832 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
19833 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
19834 * src/output.c (prepare): Adjust.
19835 * src/reader.c (symbols_output): Likewise.
19836 * src/vmsgetargs.c: Vaguely adjust, but who cares?
19837
bdef2a41
AD
198382001-12-10 Akim Demaille <akim@epita.fr>
19839
19840 * src/muscle_tab.c (muscle_init): NULL is a better default than
19841 `"0"'.
19842
3735969c
AD
198432001-12-10 Akim Demaille <akim@epita.fr>
19844
19845 * src/reader.c (reader): Calling symbols_output once is enough.
19846
49701457
AD
198472001-12-10 Akim Demaille <akim@epita.fr>
19848
19849 Now that states have a complete set of members, the linked list of
19850 reductions is useless: just fill directly the state's reductions
19851 member.
19852
19853 * src/state.h (struct reductions): Remove member `number' and
19854 `next'.
19855 * src/LR0.c (first_reduction, last_reduction): Remove.
19856 (save_reductions): Don't link the new reductions, store them in
19857 this_state.
19858 * src/lalr.c (set_state_table): No need to attach reductions to
19859 states, it's already done.
19860 * src/output.c (output_actions): No longer free the shifts, then
19861 the reductions, then the states: free all the states and their
19862 members.
19863
0edad749
AD
198642001-12-10 Akim Demaille <akim@epita.fr>
19865
19866 * src/options.c (OPTN, DRTV, BOTH): New.
19867 (option_table): Use them.
19868
0edad749
AD
19869 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
19870 the job of system.h.
19871 * src/options.c: Don't include stdio.h and xalloc.h for the same
19872 reasons.
19873
5449dd0f
AD
198742001-12-10 Akim Demaille <akim@epita.fr>
19875
19876 * src/output.c (output, prepare): Make sure the values of the
19877 muscles `action' and `prologue' are 0-terminated.
19878
a870c567
AD
198792001-12-10 Akim Demaille <akim@epita.fr>
19880
19881 Clean up GCC warnings.
19882
19883 * src/reader.c (copy_action): `buf' is not used.
19884 (parse_skel_decl): Be static.
19885 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
19886 * src/options.h (create_long_option_table): Have a real prototype.
19887 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
19888 (hash_delete_at): Return const void *.
19889 Adjust casts to preserve the const.
19890
80df8768
AD
198912001-12-10 Akim Demaille <akim@epita.fr>
19892
19893 * configure.in: Require 2.52g.
19894 M4 is not needed, but AUTOM4TE is.
19895 * m4/m4.m4: Remove.
19896 * tests/Makefile.am: Adjust.
19897
f693ad14
AD
198982001-12-10 Akim Demaille <akim@epita.fr>
19899
19900 One structure for states is enough, even though theoretically
19901 there are LR(0) states and LALR(1) states.
19902
19903 * src/lalr.h (state_t): Remove.
19904 (state_table): Be state_t **, not state_t *.
19905 * src/state.h (core, CORE_ALLOC): Rename as...
19906 (state_t, STATE_ALLOC): this.
19907 Add the LALR(1) members: shifts, reductions, errs.
19908 * src/LR0.c (state_table): Rename as...
19909 (state_hash): this, to avoid name clashes with the global
19910 `state_table'.
19911 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
19912 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
19913
74ffbcb6
AD
199142001-12-10 Akim Demaille <akim@epita.fr>
19915
19916 Bison dumps core on bash.y.
19917 Reported by Pascal Bart.
19918
19919 * src/warshall.c (bitmatrix_print): New.
19920 (TC): Use it.
ba0fe3c7 19921 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
19922 j must be the outer loop.
19923 * tests/regression.at (Broken Closure): New.
19924
07708e19
AD
199252001-12-05 Akim Demaille <akim@epita.fr>
19926
19927 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
19928 its argument.
ba1ecc07 19929 Reported by Peter Hamorsky.
07708e19 19930
92b16366
AD
199312001-12-05 Akim Demaille <akim@epita.fr>
19932
19933 * src/conflicts.c (err_table): Remove.
19934 (resolve_sr_conflict): Adjust.
19935 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
19936 Rename as...
19937 (state_t.reductions, state_t.shifts): this.
19938
076ab033
AD
199392001-12-05 Akim Demaille <akim@epita.fr>
19940
19941 * src/reduce.c (reduce_grammar_tables): No longer disable the
19942 removal of useless rules via CPP but via `if (0)', so that the
19943 compiler still check the code is valid.
19944 For instance, it should have noticed `rline' no longer exists: use
19945 the `line' member of rule_t.
19946 * src/gram.c (dummy, rline): Remove, unused.
19947
3843c413
AD
199482001-12-05 Akim Demaille <akim@epita.fr>
19949
19950 * src/output.c (pack_vector): Use assert, not berror.
19951 * src/main.c (berror): Remove, unused.
19952
43168960
AD
199532001-12-05 Akim Demaille <akim@epita.fr>
19954
19955 New experimental feature: if --verbose --trace output all the
19956 items of a state, not only its kernel.
19957
19958 * src/print.c (print_core): If `trace_flag', then invoke closure
19959 before outputting the items of the state (print_core is no longer
19960 a correct name them).
19961 (print_results): Invoke new_closure/free_closure if needed.
19962
b2872512
AD
199632001-12-05 Akim Demaille <akim@epita.fr>
19964
19965 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
19966 * src/closure.c, src/closure.h (itemsetsize): Rename as...
19967 (nitemset): for consistency with the rest of the project.
19968
23cbcc6c
AD
199692001-12-05 Akim Demaille <akim@epita.fr>
19970
19971 * src/closure.c (print_closure): Improve.
19972 (closure): Use it for printing input and output.
19973
03ec521c
AD
199742001-12-05 Akim Demaille <akim@epita.fr>
19975
19976 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
19977 indexed by nonterminals.
19978
3a7456dd
AD
199792001-12-05 Akim Demaille <akim@epita.fr>
19980
19981 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
19982 what it was!).
19983 * src/warshall.h: Remove accidental duplication of the content.
19984
1cbcf2e7
AD
199852001-12-05 Akim Demaille <akim@epita.fr>
19986
19987 * src/closure.c (set_fderives): De-obfuscate.
19988
84182270
AD
199892001-12-05 Akim Demaille <akim@epita.fr>
19990
19991 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
19992
3f6f053c
AD
199932001-12-05 Akim Demaille <akim@epita.fr>
19994
19995 * src/closure.c (set_firsts): De-obfuscate.
19996
7a5350ba
AD
199972001-12-05 Akim Demaille <akim@epita.fr>
19998
19999 * src/output.c (action_row): De-obfuscate
20000 using the good o' techniques: arrays not pointers, variable
20001 locality, BITISSET, RESETBIT etc.
20002
d954473d
AD
200032001-12-05 Akim Demaille <akim@epita.fr>
20004
20005 Pessimize the code to simplify it: from now on, all the states
20006 have a valid SHIFTS, which NSHIFTS is possibly 0.
20007
20008 * src/LR0.c (shifts_new): Be global and move to..
20009 * src/state.c, src/state.h: here.
20010 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
20011 * src/print_graph: Adjust.
20012
9839bbe5
AD
200132001-12-05 Akim Demaille <akim@epita.fr>
20014
20015 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
20016 * src/conflicts.c: Use it.
20017 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
20018 incorrectly ``simplified''.
20019
9f136c07
AD
200202001-12-05 Akim Demaille <akim@epita.fr>
20021
20022 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
20023 using the good o' techniques: arrays not pointers, variable
20024 locality, BITISSET, RESETBIT etc.
20025
b608206e
AD
200262001-12-05 Akim Demaille <akim@epita.fr>
20027
20028 * src/state.h (SHIFT_SYMBOL): New.
20029 * src/conflicts.c: Use it to deobfuscate.
20030
52afa962
AD
200312001-12-05 Akim Demaille <akim@epita.fr>
20032
20033 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
20034 (print_reductions): De-obfuscate using the good o' techniques:
20035 arrays not pointers, variable locality, BITISSET.
20036
e74dc321
AD
200372001-12-05 Akim Demaille <akim@epita.fr>
20038
20039 * src/conflicts.c (print_reductions): Arrays, not pointers.
20040 Use BITISSET.
20041
768fca83
AD
200422001-12-05 Akim Demaille <akim@epita.fr>
20043
20044 * src/conflicts.c (print_reductions): Pessimize, but clarify.
20045
a17e599f
AD
200462001-12-05 Akim Demaille <akim@epita.fr>
20047
20048 * src/conflicts.c (print_reductions): Improve variable locality.
20049
a04bc341
AD
200502001-12-05 Akim Demaille <akim@epita.fr>
20051
20052 * src/conflicts.c (print_reductions): Pessimize, but clarify.
20053
c8ea038e
AD
200542001-12-05 Akim Demaille <akim@epita.fr>
20055
20056 * src/conflicts.c (print_reductions): Improve variable locality.
20057
aa2aab3c
AD
200582001-12-05 Akim Demaille <akim@epita.fr>
20059
20060 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
20061 * src/lalr.c: Use them.
20062
b178c8cc
AD
200632001-12-05 Akim Demaille <akim@epita.fr>
20064
20065 * src/LR0.c (augment_automaton): Formatting changes.
20066 Better variable locality.
20067
f67d13aa
AD
200682001-12-05 Akim Demaille <akim@epita.fr>
20069
20070 * src/lalr.c (matrix_print): New.
20071 (transpose): Use it.
20072 Use arrays instead of pointers.
20073
c2713865
AD
200742001-12-05 Akim Demaille <akim@epita.fr>
20075
20076 * src/lalr.c (maxrhs): Move to...
20077 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
20078 * src/lalr.c (build_relations): Adjust.
20079
9887c18a
AD
200802001-12-05 Akim Demaille <akim@epita.fr>
20081
20082 * src/lalr.c (transpose): Free the memory allocated to the
20083 argument, as it is replaced by the results by the unique caller.
20084 (build_relations): Merely invoke transpose: it handles the memory
20085 deallocation.
20086 Improve variable locality.
20087 Avoid variables used as mere abbreviations.
20088 (compute_lookaheads): Use arrays instead of pointers.
20089
4d4f699c
AD
200902001-12-05 Akim Demaille <akim@epita.fr>
20091
20092 * src/lalr.c (initialize_F): Improve variable locality.
20093 Avoid variables used as mere abbreviations.
20094
80a69750
AD
200952001-12-05 Akim Demaille <akim@epita.fr>
20096
20097 * src/derives.c (print_derives): Display the ruleno.
20098 * src/lalr.c (initialize_F, transpose): Better variable locality
20099 to improve readability.
20100 Avoid variables used as mere abbreviations.
20101
fe961097
AD
201022001-12-05 Akim Demaille <akim@epita.fr>
20103
20104 * src/lalr.c (traverse): Use arrays instead of pointers.
20105
e3e4e814
AD
201062001-12-05 Akim Demaille <akim@epita.fr>
20107
20108 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
20109 the handling of squeue.
20110 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
20111
630e182b
AD
201122001-12-05 Akim Demaille <akim@epita.fr>
20113
20114 Because useless nonterminals are now kept alive (instead of being
20115 `destroyed'), we now sometimes examine them, and store information
20116 related to them. Hence we need to know their number, and adjust
20117 memory allocations.
20118
20119 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
20120 static.
20121 * src/LR0.c (allocate_itemsets): The memory allocated to
20122 `symbol_count' was used for two different purpose: once to count
20123 the number of occurrences of each symbol, and later reassigned to
20124 `shift_symbol', containing the symbol that can be shifted from a
20125 given state.
20126 Deobfuscate, i.e., allocate, use and free `symbol_count' here
20127 only, and...
20128 (new_itemsets): Allocate `shift_symbol' here.
20129 (allocate_itemsets): symbol_count includes useless nonterminals.
20130 Make room for them.
20131 (free_storage): Use `free', not `XFREE', for pointers that cannot
20132 be null.
20133
81b51460
AD
201342001-12-05 Akim Demaille <akim@epita.fr>
20135
20136 * src/nullable.c (set_nullable): Deobfuscate the handling of
20137 ritem.
20138 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
20139
3067fbef
AD
201402001-12-05 Akim Demaille <akim@epita.fr>
20141
20142 * src/gram.c, src/gram.h (ritem_print): New.
20143 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
20144 (This useless function was defined only to work around VMS linkers
20145 that can't handle compilation units with variables only).
20146 * src/reduce.c (dump_grammar): Use it to trace the construction of
20147 ritem.
20148
c2bea5f9
PE
201492001-12-04 Paul Eggert <eggert@twinsun.com>
20150
7d27c823
PE
20151 * src/bison.simple (union yyalloc): Change member names
20152 to be the same as the stack names.
20153 (yyparse): yyptr is now union yyalloc *, not char *.
20154 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
20155 and may generate better code on some machines.
c2bea5f9
PE
20156 (yystpcpy): Use prototype if __STDC__ is defined, not just
20157 if __cplusplus is defined.
35687a9d 20158
2c8a9dfa
AD
201592001-11-30 Akim Demaille <akim@epita.fr>
20160
20161 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
20162 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
20163 Gettext doesn't compile cleanly, and dies with -Werror.
20164 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
20165 Include WARNING_CFLAGS here.
20166 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
20167 before being defined.
20168
f4e421e6
AD
201692001-11-27 Paul Eggert <eggert@twinsun.com>
20170
20171 * lib/quotearg.h (quotearg_n, quotearg_n_style):
20172 First arg is int, not unsigned.
20173 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
20174 (SIZE_MAX, UINT_MAX): New macros.
20175 (quotearg_n_options): Abort if N is negative.
20176 Avoid overflow check on hosts where size_t is 64 bits and int
20177 is 32 bits, as overflow is impossible there.
20178 Fix off-by-one typo that caused unnecessary reallocation.
20179
7093d0f5
AD
201802001-11-29 Paul Eggert <eggert@twinsun.com>
20181
20182 Name space cleanup in generated parser.
20183
20184 * doc/bison.texinfo (Bison Parser): Discuss system headers
20185 and their effect on the user name space.
20186
20187 * src/bison.simple:
20188 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
20189 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
20190 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
20191
20192 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
20193 on user names when possible.
20194
20195 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
20196 Simplify test for whather <alloca.h> exists.
20197
20198 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
20199
20200 (<stdio.h>): Include if YYDEBUG.
20201
20202 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
20203 ! defined (yyoverflow) && ! defined (yymemcpy).
20204
20205 (yymemcpy, yyparse): Rename local variables as needed so that
20206 they all begin with 'yy'.
20207
20208 (yystrlen, yystpcpy): New functions.
20209
20210 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
20211 All uses changed.
20212
20213 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
20214 instead of relying on string.h functions. Use YYSTACK_ALLOC
20215 and YYSTACK_FREE instead of malloc and free.
20216
fd51e5ff
AD
202172001-11-30 Akim Demaille <akim@epita.fr>
20218
20219 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
20220 before their first uses.
20221 (YYBISON, YYPURE): Move to the top of the output.
20222
7d13ff5f
AD
202232001-11-30 Akim Demaille <akim@epita.fr>
20224
20225 * tests/reduce.at (Useless Nonterminals): Fix.
20226
892a3995
AD
202272001-11-30 Akim Demaille <akim@epita.fr>
20228
20229 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
20230 if body instead of `;' to pacify GCC's warnings.
20231
68f1e3ed
AD
202322001-11-30 Akim Demaille <akim@epita.fr>
20233
20234 Instead of mapping the LHS of unused rules to -1, keep the LHS
20235 valid, but flag the rules as invalid.
20236
20237 * src/gram.h (rule_t): `useful' is a new member.
20238 * src/print.c (print_grammar): Adjust.
20239 * src/derives.c (set_derives): Likewise.
20240 * src/reader.c (packgram, reduce_output): Likewise.
20241 * src/reduce.c (reduce_grammar_tables): Likewise.
20242 * tests/reduce.at (Underivable Rules, Useless Rules): New.
20243
d2d1b42b
AD
202442001-11-30 Akim Demaille <akim@epita.fr>
20245
20246 * src/reduce.c (reduce_output): Formatting changes.
20247 * src/print.c (print_results, print_grammar): Likewise.
20248 * tests/regression.at (Rule Line Numbers)
20249 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
20250
760b53a8
AD
202512001-11-30 Akim Demaille <akim@epita.fr>
20252
20253 * src/reduce.c (nonterminals_reduce): Instead of throwing away
20254 useless nonterminals, move them at the end of the symbol arrays.
20255 (reduce_output): Adjust.
20256 * tests/reduce.at (Useless Nonterminals): Adjust.
20257
00238958
AD
202582001-11-30 Akim Demaille <akim@epita.fr>
20259
20260 * src/reduce.c: Various comment/formatting changes.
20261 (nonterminals_reduce): New, extracted from...
20262 (reduce_grammar_tables): here.
20263 (reduce_grammar): Call nonterminals_reduce.
20264
396452de
PE
202652001-11-29 Paul Eggert <eggert@twinsun.com>
20266
20267 * src/bison.simple (YYSTACK_REALLOC): Remove.
20268 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
20269 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
20270 New macros.
20271 (union yyalloc): New type.
20272 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
20273 an arbitrary restriction on hosts where size_t is wider than int.
20274
20275 (yyparse): Don't dump core if alloca or malloc fails; instead, report
20276 a parser stack overflow. Allocate just one block of memory for all
20277 three stacks, instead of allocating three blocks; this typically is
20278 faster and reduces fragmentation.
20279
20280 Do not limit the number of items in the stack to a value that fits
20281 in 'int', as this is an arbitrary limit on hosts with 64-bit
20282 size_t and 32-bit int.
20283
147e184c
MA
202842001-11-29 Marc Autret <autret_m@epita.fr>
20285
20286 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
20287 of defining YYERROR_VERBOSE.
20288 [AT_DATA]: $4 is now out of C declarations in the prologue.
20289
426cf563
MA
202902001-11-28 Marc Autret <autret_m@epita.fr>
20291
20292 * src/reader.c (parse_dquoted_param): New.
20293 (parse_skel_decl): Use it.
20294 * src/lex.h: Add its prototype.
20295 * src/lex.c (literalchar): Become not static.
20296
c7925b99
MA
202972001-11-28 Marc Autret <autret_m@epita.fr>
20298
20299 * src/output.h: And put its extern declaration here.
20300 * src/output.c (error_verbose): Define here.
20301 (prepare): Echo name modification.
20302 * src/getargs.h: Clean its extern declaration.
20303 * src/getargs.c (error_verbose_flag): Remove.
20304 (getargs): Remove case 'e'.
20305 * src/options.c (option_table): 'error-verbose' is now seen as simple
20306 percent option.
20307 Include output.h.
20308
20309 * src/reader.c (read_declarations): Remove case tok_include.
20310 (parse_include_decl): Remove.
20311 * src/lex.h (token_t): Remove tok_include.
20312 * src/options.c (option_table): 'include' is now a simple command line
20313 option.
20314
5b5d1929
MA
203152001-11-28 Marc Autret <autret_m@epita.fr>
20316
20317 * src/bison.simple: Adjust muscle names.
20318 * src/muscle_tab.c (muscle_init): Also rename the muscles.
20319 * src/output.c (prepare): s/_/-/ for the muscles names.
20320 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
20321
8850be4b
MA
203222001-11-28 Marc Autret <autret_m@epita.fr>
20323
20324 * src/bison.simple: Fix debug.
20325 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
20326
4a38e613
AD
203272001-11-28 Akim Demaille <akim@epita.fr>
20328
20329 * src/LR0.c (shifts_new): New.
20330 (save_shifts, insert_start_shift, augment_automaton): Use it.
20331
4b35e1c1
AD
203322001-11-28 Akim Demaille <akim@epita.fr>
20333
20334 * src/closure.c (closure): `b' and `ruleno' denote the same value:
20335 keep ruleno only.
20336
d2b04478
AD
203372001-11-28 Akim Demaille <akim@epita.fr>
20338
20339 * src/closure.c (closure): Instead of looping over word in array
20340 then bits in words, loop over bits in array.
20341
2c4c30aa
AD
203422001-11-28 Akim Demaille <akim@epita.fr>
20343
20344 * src/closure.c (closure): No longer optimize the special case
20345 where all the bits of `ruleset[r]' are set to 0, to make the code
20346 clearer.
20347
576890b7
AD
203482001-11-28 Akim Demaille <akim@epita.fr>
20349
20350 * src/closure.c (closure): `r' and `c' are new variables, used to
20351 de-obfuscate accesses to RULESET and CORE.
20352
cb487d7d
AD
203532001-11-28 Akim Demaille <akim@epita.fr>
20354
20355 * src/reduce.c (reduce_print): Use ngettext.
20356 (dump_grammar): Improve the trace accuracy.
20357
6013d43f
AD
203582001-11-28 Akim Demaille <akim@epita.fr>
20359
20360 * src/reduce.c (dump_grammar): Don't translate trace messages.
20361
cb4956ee
AD
203622001-11-28 Akim Demaille <akim@epita.fr>
20363
20364 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
20365 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
20366 as all tags are free'ed afterwards.
20367 From Enrico Scholz.
20368
648185ab
PE
203692001-11-27 Paul Eggert <eggert@twinsun.com>
20370
20371 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
20372 use alloca when we didn't want to, and vice versa.
20373
68254a03
MA
203742001-11-27 Marc Autret <autret_m@epita.fr>
20375
9113b58f
AD
20376 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
20377 initialization.
68254a03
MA
20378 * src/output.c (prepare): Remove its update.
20379
04d843a2
MA
203802001-11-27 Marc Autret <autret_m@epita.fr>
20381
20382 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
20383 Use %error-verbose.
20384
d2079671 203852001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
20386
20387 * src/bison.simple: Remove YYERROR_VERBOSE using.
20388 Use %%error_verbose.
20389 (yyparse): Likewise.
20390 * src/output.c (prepare): Give its final value.
20391 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
20392 * src/getargs.h: Add its extern declaration.
20393 * src/getargs.c (error_verbose_flag): New int.
20394 (getargs): Update to catch new case.
20395 * src/options.c (option_table): 'error-verbose' is a new option.
20396 (shortopts): Update.
20397
e0327bc8
AD
203982001-11-27 Akim Demaille <akim@epita.fr>
20399
20400 * src/system.h: Use intl/libgettext.h.
20401 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
20402
000f1a3c
AD
204032001-11-27 Akim Demaille <akim@epita.fr>
20404
20405 * tests/torture.at (Exploding the Stack Size with Malloc):
20406 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
20407
26cfe0be
AD
204082001-11-27 Akim Demaille <akim@epita.fr>
20409
20410 * src/files.c: Include error.h.
20411 Reported by Hans Aberg.
20412
f6bd5427
MA
204132001-11-26 Marc Autret <autret_m@epita.fr>
20414
d2079671 20415 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
20416 (read_declarations): Add case tok_include.
20417 * src/getargs.h (include): Add its extern definition.
20418 * src/getargs.c (include): New const char *.
20419 (getargs): Add case '-I'.
20420 * src/options.c (option_table): Add include as command line and
20421 percent option.
20422 * src/lex.h (token_t): Add tok_include.
20423
2ca209c1
AD
204242001-11-26 Akim Demaille <akim@epita.fr>
20425
20426 * src/reader.c (readgram): Make sure rules for mid-rule actions
20427 have a lineno equal to that of their host rule.
20428 Reported by Hans Aberg.
20429 * tests/regression.at (Rule Line Numbers): New.
20430
0e41b407
AD
204312001-11-26 Akim Demaille <akim@epita.fr>
20432
20433 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
20434 size_ts.
20435
204362001-11-26 Akim Demaille <akim@epita.fr>
20437
20438 * src/complain.c, src/complain.h (error): Remove, provided by
20439 lib/error.[ch].
20440
e0c40012
AD
204412001-11-26 Akim Demaille <akim@epita.fr>
20442
20443 * src/reader.c (read_declarations): Don't abort on tok_illegal,
20444 issue an error message.
20445 * tests/regression.at (Invalid %directive): New.
20446 Reported by Hans Aberg.
20447
5e147124
AD
204482001-11-26 Akim Demaille <akim@epita.fr>
20449
20450 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
20451 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
20452
a034c8b8
AD
204532001-11-26 Akim Demaille <akim@epita.fr>
20454
20455 * src/conflicts.c (conflicts_print): Don't complain at all when
20456 there are no reduce/reduce conflicts, and as many shift/reduce
20457 conflicts as expected.
20458 * tests/regression.at (%expect right): Adjust.
20459
c64a20f3
AD
204602001-11-23 Akim Demaille <akim@epita.fr>
20461
20462 * lib/alloca.c: Update, from fileutils.
20463
5b0d29bb
AD
204642001-11-23 Akim Demaille <akim@epita.fr>
20465
20466 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
20467
722c4bfe
AD
204682001-11-23 Akim Demaille <akim@epita.fr>
20469
20470 * src/system.h: Include alloca.h.
20471 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
20472
6255b435
AD
204732001-11-23 Akim Demaille <akim@epita.fr>
20474
20475 * src/print_graph.c (print_actions): Remove `rule', unused.
20476 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
20477 pacify GCC's signed < unsigned warnings.
20478 * src/closure.c (itemsetsize): Likewise.
20479 * src/reader.c (symbol_list_new): Static.
20480
b29b2ed5
AD
204812001-11-23 Akim Demaille <akim@epita.fr>
20482
20483 Attaching lineno to buckets is stupid, since only one copy of each
20484 symbol is kept, only the line of the first occurrence is kept too.
20485
20486 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
20487 * src/reader.c (rline_allocated): Remove, unused.
20488 (symbol_list): Have a `line' member.
20489 (symbol_list_new): New.
20490 (readgram): Use it.
20491 * src/print.c (print_grammar): Output the rule line numbers.
20492 * tests/regression.at (Solved SR Conflicts)
20493 (Unresolved SR Conflicts): Adjust.
20494 Reported by Hans Aberg.
20495
a81b1d4a
MA
204962001-11-22 Marc Autret <autret_m@epita.fr>
20497
20498 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
20499
c1ecb3c1
MA
205002001-11-22 Marc Autret <autret_m@epita.fr>
20501
20502 * src/muscle_tab.c (muscle_init): Remove initialization of
20503 skeleton muscle.
20504 * src/output.c (output_master_parser): Do it here.
20505
fbe01355
AD
205062001-11-20 Akim Demaille <akim@epita.fr>
20507
20508 * po/sv.po: New.
20509 * configure.in (ALL_LINGUAS): Adjust.
20510 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
20511 longer contains strings to translate.
20512
81e895c0
AD
205132001-11-19 Akim Demaille <akim@epita.fr>
20514
20515 * src/conflicts.c (conflicts_print): Add a missing \n.
20516
6bb1878b
AD
205172001-11-19 Akim Demaille <akim@epita.fr>
20518
20519 * src/nullable.c (nullable_print): New.
20520 (set_nullable): Call it when tracing.
20521 Better locality of variables.
20522
d9ec2d07
AD
205232001-11-19 Akim Demaille <akim@epita.fr>
20524
20525 * src/print.c (print_actions): Better locality of variables.
20526
720e5c1b
AD
205272001-11-19 Akim Demaille <akim@epita.fr>
20528
20529 * src/derives.c (print_derives): Fix and enrich.
20530 * src/closure.c (print_fderives): Likewise.
20531
fb908786
AD
205322001-11-19 Akim Demaille <akim@epita.fr>
20533
20534 * src/closure.c (itemsetend): Remove, replaced with...
20535 (itemsetsize): new.
20536
125ecb56
AD
205372001-11-19 Akim Demaille <akim@epita.fr>
20538
20539 * src/LR0.c (kernel_end): Remove, replaced with...
20540 (kernel_size): new.
20541
d8cf039f
AD
205422001-11-19 Akim Demaille <akim@epita.fr>
20543
20544 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
20545 to clarify.
20546
7bec0760
AD
205472001-11-19 Akim Demaille <akim@epita.fr>
20548
20549 * src/closure.c (closure): Use arrays instead of pointers to clarify.
20550
c87d4863
AD
205512001-11-19 Akim Demaille <akim@epita.fr>
20552
20553 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
20554 trace messages.
20555 * src/LR0.c: Likewise.
20556 (allocate_itemsets): Use arrays instead of pointers to clarify.
20557
9bfe901c
AD
205582001-11-19 Akim Demaille <akim@epita.fr>
20559
20560 * src/getargs.c (statistics_flag): Replace with...
20561 (trace_flag): New.
20562 (longopts): Accept --trace instead of --statistics.
20563 * src/getargs.h, src/options.c: Adjust.
20564 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
20565 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
20566
97db7bd4
AD
205672001-11-19 Akim Demaille <akim@epita.fr>
20568
cc72668c 20569 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
20570 pointers to clarify the code.
20571 (save_reductions, save_shifts): Factor common parts of alternatives.
20572
2c5f66ed
AD
205732001-11-19 Akim Demaille <akim@epita.fr>
20574
20575 * src/LR0.c (new_state, get_state): Complete TRACE code.
20576 * src/closure.c: Include `reader.h' to get `tags', needed by the
20577 trace code.
20578 Rename the conditional DEBUG as TRACE.
20579 Output consistently TRACEs to stderr, not stdout.
20580 * src/derives.c: Likewise.
20581 * src/reduce.c: (inaccessable_symbols): Using if is better style
20582 than goto.
20583 Use `#if TRACE' instead of `#if 0' for tracing code.
20584
300f275f
AD
205852001-11-19 Akim Demaille <akim@epita.fr>
20586
20587 * src/system.h (LIST_FREE, shortcpy): New.
20588 * src/LR0.c: Use them.
20589 * src/output.c (free_itemsets, free_reductions, free_shifts):
20590 Remove, replaced by LIST_FREE.
20591
f59c437a
AD
205922001-11-19 Akim Demaille <akim@epita.fr>
20593
20594 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
20595 (REDUCTIONS_ALLOC): New.
20596 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
20597 allocation.
20598
6986fd9e
AD
205992001-11-19 Akim Demaille <akim@epita.fr>
20600
20601 * src/LR0.c (new_state): Complete trace code.
20602 * src/nullable.c (set_nullable): Don't translate traces.
20603
4bc30f78
AD
206042001-11-19 Akim Demaille <akim@epita.fr>
20605
20606 * src/print_graph.c (print_core): Better locality of variables.
20607 * src/print.c (print_core): Likewise.
20608
08a946e0
AD
206092001-11-19 Akim Demaille <akim@epita.fr>
20610
20611 * src/vcg.c: You do the output, so you are responsible of the
20612 handling of VCG syntax, in particular: use quotearg.
20613 * src/print_graph.c: Don't.
20614 (print_actions): Don't output the actions as part of the nodes,
20615 since that's the job of the edges.
20616 (print_state): Don't output by hand: fill the node description,
9bfe901c 20617 and ask for its output.
08a946e0 20618
f0473484
AD
206192001-11-19 Akim Demaille <akim@epita.fr>
20620
cc72668c
AD
20621 * src/bison.simple (yyparse): When verbosely reporting an error,
20622 no longer put additional quotes around token names.
f0473484
AD
20623 * tests/calc.at: Adjust.
20624
e41dc700
AD
206252001-11-19 Akim Demaille <akim@epita.fr>
20626
20627 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
20628 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
20629 * src/output.c: Adjust.
20630
652a871c
AD
206312001-11-19 Akim Demaille <akim@epita.fr>
20632
20633 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
20634 (rule_t): this.
20635 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
20636
b2ed6e58
AD
206372001-11-19 Akim Demaille <akim@epita.fr>
20638
20639 * src/gram.h (rule_t): New.
20640 (rule_table): New.
20641 (rrhs, rlhs): Remove, part of state_t.
20642 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
20643 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
20644 * src/reader.c, src/reduce.c: Adjust.
20645
edad7067
AD
206462001-11-19 Akim Demaille <akim@epita.fr>
20647
20648 * src/reader.c (symbols_output): New, extracted from...
20649 (packsymbols): Here.
20650 (reader): Call it.
20651
3feec034
AD
206522001-11-19 Akim Demaille <akim@epita.fr>
20653
20654 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
20655 (maxrhs): this new function.
20656
ddcd5fdf
AD
206572001-11-19 Akim Demaille <akim@epita.fr>
20658
cc72668c 20659 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
20660 Adjust.
20661
bb527fc2
AD
206622001-11-19 Akim Demaille <akim@epita.fr>
20663
cc72668c 20664 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
20665 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20666 * src/lalr.c: Adjust.
20667
a845a697
AD
206682001-11-19 Akim Demaille <akim@epita.fr>
20669
20670 * src/lalr.c (initialize_LA): Only initialize LA. Let...
20671 (set_state_table): handle the `lookaheads' members.
20672
f004bf6a
AD
206732001-11-19 Akim Demaille <akim@epita.fr>
20674
cc72668c
AD
20675 * src/lalr.h (lookaheads): Removed array, whose contents is now
20676 a member of...
f004bf6a
AD
20677 (state_t): this structure.
20678 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20679 Adjust.
20680
de326cc0
AD
206812001-11-19 Akim Demaille <akim@epita.fr>
20682
cc72668c
AD
20683 * src/lalr.h (consistent): Removed array, whose contents is now
20684 a member of...
de326cc0
AD
20685 (state_t): this structure.
20686 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20687 Adjust.
20688
90b4416b
AD
206892001-11-19 Akim Demaille <akim@epita.fr>
20690
cc72668c
AD
20691 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
20692 contents are now members of...
90b4416b
AD
20693 (state_t): this structure.
20694 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20695 Adjust.
20696
9703cc49
AD
206972001-11-19 Akim Demaille <akim@epita.fr>
20698
20699 * src/lalr.h (state_t): New.
20700 (state_table): Be a state_t * instead of a core **.
20701 (accessing_symbol): Remove, part of state_t.
20702 * src/lalr.c: Adjust.
20703 (set_accessing_symbol): Merge into...
20704 (set_state_table): this.
20705 * src/print_graph.c, src/conflicts.c: Adjust.
20706
d803322e
AD
207072001-11-14 Akim Demaille <akim@epita.fr>
20708
20709 * tests/calc.at, tests/output.at, tests/regression.at,
20710 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
20711 now the tests are run in private dirs, therefore AC_CLEANUP and
20712 family can be simplified to 0-ary.
20713 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
20714 use abs. path to find config.h.
20715 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
20716 stderr, there can be way too much random noise.
20717 Instead pass -Werror to GCC and rely on the exit status.
20718 Reported by Wolfram Wagner.
20719
3d76b07d
AD
207202001-11-14 Akim Demaille <akim@epita.fr>
20721
20722 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
20723 defined only if yyoverflow is defined, to avoid `warning: unused
20724 variable `yyvs1''.
20725 Reported by The Test Suite.
20726
09b503c8
AD
207272001-11-14 Akim Demaille <akim@epita.fr>
20728
20729 * src/print.c: Include reduce.h.
20730 Reported by Hans Aberg.
20731
207322001-11-14 Akim Demaille <akim@epita.fr>
20733
20734 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
20735 Revert a previous patch: these are really const.
20736 * src/conflicts.c (conflict_report): Additional useless pair of
20737 braces to pacify GCC's warnings for `if () if () {} else {}'.
20738 * src/lex.c (parse_percent_token): Replace equal_offset with
20739 arg_offset.
20740 arg is const.
20741 Be sure to strdup `arg' when used, since there is no reason for
20742 token_buffer not to change.
20743
0f37a994
AD
207442001-11-14 Akim Demaille <akim@epita.fr>
20745
20746 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
20747 definition.
20748 * src/main.c (main): Use them.
20749 Suggested by Hans Aberg.
20750
d39d93b8
AD
207512001-11-12 Akim Demaille <akim@epita.fr>
20752
20753 * src/system.h (ngettext): Now that we use ngettext, be sure to
20754 provide a default definition when NLS are not used.
20755
9edcd895
AD
207562001-11-12 Akim Demaille <akim@epita.fr>
20757
20758 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
20759 Use @kbd to denote user input.
20760 (Language and Grammar): ANSIfy the example.
20761 Adjust its layout for info/notinfo.
20762 (Location Tracking Calc): Output error messages to stderr.
20763 Output locations in a more GNUtically correct way.
20764 Fix a couple of Englishos.
20765 Adjust @group/@end group pairs.
20766
7da99ede
AD
207672001-11-12 Akim Demaille <akim@epita.fr>
20768
e3aa65c5 20769 %expect was not functioning at all.
7da99ede
AD
20770
20771 * src/conflicts.c (expected_conflicts): Set to -1.
20772 (conflict_report): Use ngettext.
20773 (conflicts_print): Check %expect and make its violation an error.
20774 * doc/bison.texinfo (Expect Decl): Adjust.
20775 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
20776 * tests/regression.at (%expect not enough, %expect right)
20777 (%expect too much): New.
20778
ba9dda1a
AD
207792001-11-12 Akim Demaille <akim@epita.fr>
20780
20781 * tests/regression.at (Conflicts): Rename as...
20782 (Unresolved SR Conflicts): this.
20783 (Solved SR Conflicts): New.
20784
337c5bd1
AD
207852001-11-12 Akim Demaille <akim@epita.fr>
20786
20787 * src/reduce.c (print_results): Rename as...
20788 (reduce_output): This.
20789 Output to OUT, passed as argument, instead of output_obstack.
20790 (dump_grammar): Likewise.
20791 (reduce_free): New.
20792 Also free V1.
20793 (reduce_grammar): No longer call reduce_output, since...
20794 * src/print.c (print_results): do it.
20795 * src/main.c (main): Call reduce_free;
20796
c73a41af
AD
207972001-11-12 Akim Demaille <akim@epita.fr>
20798
20799 * src/conflicts.c (print_reductions): Accept OUT as argument.
20800 Output to it, not to output_obstack.
20801 * src/print.c (print_actions): Adjust.
20802
0df87bb6
AD
208032001-11-12 Akim Demaille <akim@epita.fr>
20804
20805 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
20806 the result instead of using...
20807 (src_total, rrc_total, src_count, rrc_count): Remove.
20808 (any_conflicts): Remove.
20809 (print_conflicts): Split into...
20810 (conflicts_print, conflicts_output): New.
20811 * src/conflicts.h: Adjust.
20812 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 20813 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
20814 * tests/regression.at (Conflicts): New.
20815 Reported by Tom Lane.
20816
e4d3d4de
AD
208172001-11-12 Akim Demaille <akim@epita.fr>
20818
20819 * tests/regression.at (Invalid input): Remove, duplicate with
20820 ``Invalid input: 1''.
20821
6d7d248e
AD
208222001-11-12 Akim Demaille <akim@epita.fr>
20823
20824 * tests/torture.at (AT_DATA_STACK_TORTURE)
20825 (Exploding the Stack Size with Alloca)
20826 (Exploding the Stack Size with Malloc): New.
20827
e9e4c321
AD
208282001-11-12 Akim Demaille <akim@epita.fr>
20829
20830 * src/bison.simple (YYSTACK_REALLOC): New.
20831 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 20832 Reported by Per Allansson.
e9e4c321 20833
5f7e0832
AD
208342001-11-12 Pascal Bart <pascal.bart@epita.fr>
20835
20836 * src/bison.simple: Define type yystype instead of YYSTYPE, and
20837 define CPP macro, which substitute YYSTYPE by yystype.
20838 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
20839 with yyltype/YYLTYPE. This allows inclusion of the generated
20840 header within the parser if the compiler, such as GGC, accepts
20841 multiple equivalent #defines.
20842 From Akim.
20843
e3f1699f
AD
208442001-11-05 Akim Demaille <akim@epita.fr>
20845
20846 * src/reader.c (symbols_output): New, extracted from...
20847 (packsymbols): here.
20848 (reader): Adjust.
20849
65be0866
AD
208502001-11-05 Akim Demaille <akim@epita.fr>
20851
20852 * src/lex.c (parse_percent_token): s/quotearg/quote/.
20853
e4d910bf
AD
208542001-11-05 Akim Demaille <akim@epita.fr>
20855
20856 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
20857 pattern.
20858
951366c1
AD
208592001-11-05 Akim Demaille <akim@epita.fr>
20860
20861 * src/options.h (struct option_table_struct): set_flags is void*.
20862 * src/options.c (longopts): Support `--output' and `%output'.
20863 (usage): Adjust.
20864 * src/lex.h (tok_setopt): Remove, replaced with...
20865 (tok_intopt, tok_stropt): these new guys.
20866 * src/lex.c (getopt.h): Not needed.
20867 (token_buffer, unlexed_token_buffer): Not const.
20868 (percent_table): Promote `-' over `_' in directive names.
20869 Active `%name-prefix', `file-prefix', and `output'.
20870 (parse_percent_token): Accept possible arguments to directives.
20871 Promote `-' over `_' in directive names.
20872
d8988b2f
AD
208732001-11-04 Akim Demaille <akim@epita.fr>
20874
20875 * doc/bison.texinfo (Decl Summary): Split the list into
20876 `directives for grammars' and `directives for bison'.
20877 Sort'em.
20878 Add description of `%name-prefix', `file-prefix', and `output'.
20879 Promote `-' over `_' in directive names.
20880 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
20881 Simplify the description of `--name-prefix'.
20882 Promote `-' over `_' in directive names.
20883 Promote `--output' over `--output-file'.
20884 Fix the description of `--defines'.
20885 * tests/output.at: Exercise %file-prefix and %output.
20886
6468d18e
AD
208872001-11-02 Akim Demaille <akim@epita.fr>
20888
20889 * doc/refcard.tex: Update.
20890
6b7e85b9
AD
208912001-11-02 Akim Demaille <akim@epita.fr>
20892
20893 * src/symtab.h (SUNDEF): New.
20894 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
20895 stand for `uninitialized', instead of 0.
20896 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
20897 * src/lex.c (lex): Adjust.
20898
20899 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
20900 Number it 0.
20901 Let yylex return it instead of a plain 0.
20902 Reported by Dick Streefland.
20903
cd5aafcf
AD
209042001-11-02 Akim Demaille <akim@epita.fr>
20905
20906 * tests/regression.at (Mixing %token styles): New test.
20907
037ca2f1
AD
209082001-11-02 Akim Demaille <akim@epita.fr>
20909
20910 * src/reader.c (parse_thong_decl): Formatting changes.
20911 (token_translations_init): New, extracted from...
20912 (packsymbols): Here.
20913 Adjust.
20914
270a173c
AD
209152001-11-01 Akim Demaille <akim@epita.fr>
20916
20917 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
20918 Check that `9foo.y' produces correct cpp guards.
20919 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
20920 guards.
20921 Reported by Wwp.
20922
561f9a30
AD
209232001-11-01 Akim Demaille <akim@epita.fr>
20924
20925 * tests/regression.at (Invalid input: 2): New.
20926 * src/lex.c (unlexed_token_buffer): New.
20927 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
20928 too.
20929 Reported by Wwp.
20930
f987e9d2
AD
209312001-11-01 Akim Demaille <akim@epita.fr>
20932
20933 * tests/calc.at: Catch up with 1.30.
20934 * configure.in: Bump to 1.49a.
20935 Adjust to newer Autotest.
20936
0846f581
PB
209372001-10-19 Pascal Bart <pascal.bart@epita.fr>
20938
20939 * src/conflicts.c: Move global variables rrc_total and src_total ...
20940 (print_conflicts): here.
20941 * src/output.c (output): Free global variable user_toknums.
20942 * src/lex.c (token_obstack): Become static.
20943
3c1a79b3
AD
209442001-10-18 Akim Demaille <akim@epita.fr>
20945
20946 * tests/atlocal.in (GCC): Add.
20947 * tests/calc.at: s/m4_match/m4_bmatch/.
20948 s/m4_patsubst/m4_bpatsubst/.
20949 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
20950 * configure.in: AC_SUBST(GCC).
20951
5d52e7d0
MA
209522001-10-14 Marc Autret <autret_m@epita.fr>
20953
20954 * src/options.c (create_long_option_table): Fix.
20955
631aa1d3
AD
209562001-10-10 Akim Demaille <akim@epita.fr>
20957
20958 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
20959
f6ec6d13
AD
209602001-10-04 Akim Demaille <akim@epita.fr>
20961
20962 * src/reader.c (parse_union_decl): Push the caracters in
20963 union_obstack, not attrs_obstack.
20964
342b8b6e
AD
209652001-10-04 Akim Demaille <akim@epita.fr>
20966
20967 Merge in the branch 1.29.
20968
20969 * src/reader.c (packsymbols): Use a temporary obstack for
20970 `%%tokendef', since output_stack is already used elsewhere.
20971
20972 2001-10-02 Akim Demaille <akim@epita.fr>
20973
20974 Bump 1.29d.
20975
20976 2001-10-02 Akim Demaille <akim@epita.fr>
20977
20978 Version 1.29c.
20979
20980 2001-10-02 Akim Demaille <akim@epita.fr>
20981
20982 * tests/regression.at (Invalid CPP headers): New.
20983 From Alexander Belopolsky.
20984 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
20985
20986 2001-10-02 Akim Demaille <akim@epita.fr>
20987
20988 * tests/regression.at (Invalid input): New.
20989 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
20990 Reported by Shura.
20991
20992 2001-10-02 Akim Demaille <akim@epita.fr>
20993
20994 * tests/calc.at: Now that --debug works, the tests must be adjusted.
20995
20996 2001-10-02 Akim Demaille <akim@epita.fr>
20997
20998 * src/output.c (output_parser): Assert `skeleton'.
20999 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
21000 systems.
21001 From Shura.
21002
21003 2001-10-01 Marc Autret <autret_m@epita.fr>
21004
21005 * src/lex.h: Echo modifications.
21006 * src/lex.c (unlex): Parameter is now token_t.
21007 From Hans Aberg.
21008
21009 2001-10-01 Marc Autret <autret_m@epita.fr>
21010
21011 * src/main.c: Include lex.h.
21012 From Hans Aberg.
21013
21014 2001-09-29 Akim Demaille <akim@epita.fr>
21015
21016 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
21017
21018 2001-09-28 Akim Demaille <akim@epita.fr>
21019
21020 * tests/testsuite.at: Update to newer Autotest.
21021 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
21022
21023 2001-09-27 Akim Demaille <akim@epita.fr>
21024
21025 Position independent wrapper.
21026
21027 * tests/bison: Remove.
21028 * tests/bison.in: New.
21029 * configure.in: Adjust.
21030
21031 2001-09-27 Paul Eggert <eggert@twinsun.com>
21032
21033 Port quotearg fixes from tar 1.13.24.
21034
21035 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
21036 tm to be declared.
21037 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
21038 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
21039
21040 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
21041 * m4/mbrtowc.m4: New file.
21042 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
21043 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
21044
21045 2001-09-27 Akim Demaille <akim@epita.fr>
21046
21047 Bump to 1.29c.
21048
21049 2001-09-27 Akim Demaille <akim@epita.fr>
21050
21051 Version 1.29b.
21052
21053 2001-09-25 Akim Demaille <akim@epita.fr>
21054
21055 * src/system.h: Include `xalloc.h'.
21056 Remove it from the C files.
21057 * src/files.c (output_files): Free the obstacks.
21058 * src/lex.c (init_lex): Rename as...
21059 (lex_init): this.
21060 (lex_free): New.
21061 * src/main.c (main): Use it.
21062
21063 2001-09-24 Marc Autret <autret_m@epita.fr>
21064
21065 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
21066 to output informations in fout (FILE*).
21067 (open_graph, close_graph): Likewise.
21068 (output_graph, output_edge, output_node): Likewise.
21069 * src/vcg.h: Update function prototypes.
21070 * src/print_graph.c (print_graph): Open output graph file.
21071 (print_actions): Adjust.
21072 * src/files.h: Remove extern declaration.
21073 * src/files.c: Remove graph_obstack declaration.
21074 (open_files): Remove graph_obstack initialization.
21075 (output_files): Remove graph_obstack saving.
21076
21077 2001-09-24 Marc Autret <autret_m@epita.fr>
21078
21079 * src/files.c (compute_output_file_names): Fix.
21080
21081 2001-09-24 Marc Autret <autret_m@epita.fr>,
21082 Akim Demaille <akim@epita.fr>
21083
21084 * src/reader.c (reader): Remove call to free_symtab ().
21085 * src/main.c (main): Call it here.
21086 Include symtab.h.
21087 * src/conflicts.c (initialize_conflicts): Rename as...
21088 (solve_conflicts): this.
21089 * src/print.c (print_core, print_actions, print_state)
21090 (print_grammar): Dump to a file instead a `output_obstack'.
21091 (print_results): Dump `output_obstack', and then proceed with the
21092 FILE *.
21093 * src/files.c (compute_output_file_names, close_files): New.
21094 (output_files): Adjust.
21095 * src/main.c (main): Adjust.
21096
21097 2001-09-23 Marc Autret <autret_m@epita.fr>
21098
21099 * src/files.c (compute_header_macro): Computes header macro name
21100 from spec_defines_file when given.
21101
21102 2001-09-23 Marc Autret <autret_m@epita.fr>
21103
21104 * src/files.c (output_files): Add default extensions.
21105
21106 2001-09-22 Akim Demaille <akim@epita.fr>
21107
21108 * src/conflicts.c (finalize_conflicts): Rename as...
21109 (free_conflicts): this.
21110
21111 2001-09-22 Akim Demaille <akim@epita.fr>
21112
21113 * src/gram.c (gram_free): Rename back as...
21114 (dummy): this.
21115 (output_token_translations): Free `token_translations'.
21116 * src/symtab.c (free_symtab): Free the tag field.
21117
21118 2001-09-22 Akim Demaille <akim@epita.fr>
21119
21120 Remove `translations' as it is always set to true.
21121
21122 * src/gram.h: Adjust.
21123 * src/reader.c (packsymbols, parse_token_decl): Adjust
21124 * src/print.c (print_grammar): Adjust.
21125 * src/output.c (output_token_translations): Adjust.
21126 * src/lex.c (lex): Adjust.
21127 * src/gram.c: Be sure the set pointers to NULL.
21128 (dummy): Rename as...
21129 (gram_free): this.
21130
21131 2001-09-22 Akim Demaille <akim@epita.fr>
21132
21133 * configure.in: Invoke AM_LIB_DMALLOC.
21134 * src/system.h: Use dmalloc.
21135 * src/LR0.c: Be sure to have pointers initialized to NULL.
21136 (allocate_itemsets): Allocate kernel_items only if needed.
21137
21138 2001-09-22 Akim Demaille <akim@epita.fr>
21139
21140 * configure.in: Bump to 1.29b.
21141 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
21142 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
21143 need xmalloc.c in calc.y.
21144 From Pascal Bart.
21145
21146 2001-09-21 Akim Demaille <akim@epita.fr>
21147
21148 Version 1.29a.
21149 * Makefile.maint, config/config.guess, config/config.sub,
21150 * config/missing: Update from masters.
21151 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
21152 upon package.m4.
21153 * configure.in (ALL_LINGUAS): Add `tr'.
21154
21155 2001-09-21 Akim Demaille <akim@epita.fr>
21156
21157 * tests/Makefile.am (package.m4): Move to...
21158 ($(srcdir)/$(TESTSUITE)): here.
21159
21160 2001-09-20 Akim Demaille <akim@epita.fr>
21161
21162 * src/complain.c: No longer try to be standalone: use system.h.
21163 Don't assume __STDC__ is defined to 1. Just test if it is defined.
21164 * src/complain.h: Likewise.
21165 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
21166 Remove the unused variable `n'.
21167 From Albert Chin-A-Young.
21168
21169 2001-09-18 Marc Autret <autret_m@epita.fr>
21170
21171 * doc/bison.1: Update.
21172 * doc/bison.texinfo (Bison Options): Update --defines and --graph
21173 descriptions.
21174 (Option Cross Key): Update.
21175 Add --graph.
21176
21177 2001-09-18 Marc Autret <autret_m@epita.fr>
21178
21179 * tests/regression.at: New test (comment in %union).
21180
21181 2001-09-18 Marc Autret <autret_m@epita.fr>
21182
21183 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
21184 do that.
21185 Reported by Keith Browne.
21186
21187 2001-09-18 Marc Autret <autret_m@epita.fr>
21188
21189 * tests/output.at: Add tests for --defines and --graph.
21190
21191 2001-09-18 Marc Autret <autret_m@epita.fr>
21192
21193 * tests/output.at: Removes tests of %{header,src}_extension features.
21194
21195 2001-09-18 Akim Demaille <akim@epita.fr>
21196
21197 * tests/Makefile.am (package.m4): New.
21198 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
21199 (_AT_CHECK_CALC_ERROR): Likewise.
21200 Factor the `, ' part of verbose error messages.
21201
21202 2001-09-18 Marc Autret <autret_m@epita.fr>
21203
21204 * src/getargs.c (longopts): Declare --defines and --graph as options
21205 with optional arguments.
21206 * src/files.h: Add extern declarations.
21207 * src/files.c (spec_graph_file, spec_defines_file): New.
21208 (output_files): Update.
21209 Remove CPP-outed code.
21210
21211 2001-09-18 Marc Autret <autret_m@epita.fr>
21212
21213 Turn off %{source,header}_extension feature.
21214
21215 * src/files.c (compute_exts_from_gf): Update.
21216 (compute_exts_from_src): Update.
21217 (output_files): CPP-out useless code.
21218 * src/files.h: Remove {header,source}_extension extern declarations.
21219 * src/reader.c (parse_dquoted_param): CPP-out.
21220 (parse_header_extension_decl): Remove.
21221 (parse_source_extension_decl): Remove.
21222 (read_declarations): Remove cases tok_{hdrext,srcext}.
21223 * src/lex.c (percent_table): Remove {header,source}_extension entries.
21224 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
21225
21226 2001-09-10 Akim Demaille <akim@epita.fr>
21227
21228 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
21229 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
21230 (AT_CHECK_OUTPUT): this.
21231 Merely check ls' exit status, its output is useless.
21232
21233 2001-09-10 Akim Demaille <akim@epita.fr>
21234
21235 * tests/calc.at: Use m4_match.
21236 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
21237
21238 2001-09-10 Marc Autret <autret_m@epita.fr>,
21239 Akim Demaille <akim@epita.fr>
21240
21241 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
21242 enum color_e.
21243 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
21244 to `normal'.
21245 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
21246 * src/lex.h: Adjust prototype.
21247 (token_t): Add `tok_undef'.
21248 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
21249 (parse_percent_token): Now returns token_t.
21250 Add default statement in switch.
21251 (lex): Separate `c' as an input variable, from the token_t result
21252 part.
21253 (unlexed): Is a token_t.
21254
21255 2001-09-10 Akim Demaille <akim@epita.fr>
21256
21257 * configure.in: Bump to 1.29a.
21258
21259 2001-09-07 Akim Demaille <akim@epita.fr>
21260
21261 Version 1.29.
21262
21263 2001-08-30 Akim Demaille <akim@epita.fr>
21264
21265 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
21266 * m4/atconfig.m4: Remove.
21267 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
21268 * tests/bison: New.
21269 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
21270 m4_if, m4_patsubst, and m4_regexp.
21271 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
21272 `input' file instead of echo.
21273
21274 2001-08-29 Akim Demaille <akim@epita.fr>
21275
21276 Bump to 1.28e.
21277
21278 2001-08-29 Akim Demaille <akim@epita.fr>
21279
21280 Version 1.28d.
21281
21282 2001-08-29 Paul Eggert <eggert@twinsun.com>
21283
21284 * src/bison.simple (yyparse): Don't take the address of an
21285 item before the start of an array, as that doesn't conform to
21286 the C Standard.
21287
21288 2001-08-29 Robert Anisko <anisko_r@epita.fr>
21289
21290 * doc/bison.texinfo (Location Tracking Calc): New node.
21291
21292 2001-08-29 Paul Eggert <eggert@twinsun.com>
21293
21294 * src/output.c (output): Do not define const, as this now
21295 causes more problems than it cures.
21296
21297 2001-08-29 Akim Demaille <akim@epita.fr>
21298
21299 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
21300 the nodes.
21301 Be sure to tag the `detailmenu'.
21302
21303 2001-08-29 Akim Demaille <akim@epita.fr>
21304
21305 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
21306 download in a tmp dir.
21307
21308 2001-08-28 Marc Autret <autret_m@epita.fr>
21309
21310 * config/depcomp: New file.
21311
21312 2001-08-28 Marc Autret <autret_m@epita.fr>
21313
21314 * doc/bison.1 (mandoc): Adjust.
21315 From Juan Manuel Guerrero.
21316
21317 2001-08-28 Marc Autret <autret_m@epita.fr>
21318
21319 * src/print_graph.c (print_state): Fix.
21320
21321 2001-08-27 Marc Autret <autret_m@epita.fr>
21322
21323 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
21324 char * members.
21325 Echo modifications to the functions prototypes.
21326 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
21327
21328 2001-08-27 Marc Autret <autret_m@epita.fr>
21329
21330 * src/vcg.c: Include `xalloc.h'.
21331 (add_colorentry): New.
21332 (add_classname): New.
21333 (add_infoname): New.
21334 * src/vcg.h: Add new prototypes.
21335
21336 2001-08-27 Akim Demaille <akim@epita.fr>
21337
21338 * Makefile.maint: Sync. again with CVS Autoconf.
21339
21340 2001-08-27 Akim Demaille <akim@epita.fr>
21341
21342 * Makefile.maint: Formatting changes.
21343 (po-update, cvs-update, update): New targets.
21344 (AMTAR): Remove.
21345
21346 2001-08-27 Akim Demaille <akim@epita.fr>
21347
21348 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
21349 * Makefile.maint: Sync. with CVS Autoconf.
21350
21351 2001-08-27 Marc Autret <autret_m@epita.fr>
21352
21353 * src/vcg.h (struct infoname_s): New.
21354 (struct colorentry_s): New.
21355 (graph_s): New fields {vertical,horizontal}_order in structure.
21356 Add `infoname' field.
21357 Add `colorentry' field;
21358 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
21359 (G_HORIZONTAL_ORDER): New.
21360 (G_INFONAME): New.
21361 (G_COLORENTRY): New.
21362 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
21363 Add output of `infoname'.
21364 Add output of `colorentry'.
21365
21366 2001-08-27 Marc Autret <autret_m@epita.fr>
21367
21368 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
21369 This one shadowed a global parameter.
21370
21371 2001-08-24 Marc Autret <autret_m@epita.fr>
21372
21373 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
21374 instead of `unsigned'.
21375 (print_state): Do not call obstack_object_size () in obstack_grow ()
21376 to avoid macro variables shadowing.
21377
21378 2001-08-23 Marc Autret <autret_m@epita.fr>
21379
21380 * src/lex.c (percent_table): Typo: s/naem/name/.
21381 Add graph option.
21382 Normalize new options declarations.
21383
21384 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
21385
21386 * tests/suite.at: Exercise %header_extension and %source_extension.
21387
21388 2001-08-16 Marc Autret <autret_m@epita.fr>
21389
21390 * src/reader.c (parse_dquoted_param): New.
21391 (parse_header_extension_decl): Use it.
21392 (parse_source_extension_decl): Likewise.
21393
21394 2001-08-16 Marc Autret <autret_m@epita.fr>
21395
21396 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
21397 (get_xxxx_str): Use assert () instead of complain ().
21398 Remove return invokations in default cases.
21399 (get_decision_str): Modify default behaviour. Remove second argument.
21400 Echo modifications on calls.
21401 (output_graph): Fix.
21402
21403 2001-08-16 Marc Autret <autret_m@epita.fr>
21404
21405 * src/getargs.c (usage): Update with ``-g, --graph''.
21406
21407 2001-08-16 Marc Autret <autret_m@epita.fr>
21408
21409 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
21410 (Option Cross Key): Likewise.
21411 * doc/bison.1: Update.
21412
1c8c2190
PB
214132001-09-25 Pascal Bart <pascal.bart@epita.fr>
21414
21415 * src/output.c (output_master_parser): Don't finish action_obstack.
21416 (output_parser): Don't care about the muscle action, here.
21417 (prepare): Copy the action_obstack in the action muscle.
21418 (output): Free action_obstack.
21419
180d45ba
PB
214202001-09-23 Pascal Bart <pascal.bart@epita.fr>
21421
21422 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
21423 will contain `%union' declaration.
21424 (parse_union_decl): Delete #line directive output.
21425 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
21426 informations about %union.
21427 (parse_union_decl): Copy the union_obstack in the muscle stype.
21428 * src/bison.simple: Add new #line directive.
21429 Add typdef %%stype YYSTYPE.
21430
c51d1a19
PB
214312001-09-23 Pascal Bart <pascal.bart@epita.fr>
21432
21433 * src/bison.simple: Add new `#line' directive.
21434
6f9344da
PB
214352001-09-22 Pascal Bart <pascal.bart@epita.fr>
21436
21437 * src/bison.simple: New `#line' directive.
21438 * src/output.c (output_parser): Support new dynamic muscle input_line.
21439
652def80
MA
214402001-09-22 Marc Autret <autret_m@epita.fr>
21441
21442 * src/output.c (output_master_parser): New.
21443 (output_parser): Be more re-entrant.
21444
25b222fa
MA
214452001-09-21 Marc Autret <autret_m@epita.fr>
21446
21447 * src/reader.c (copy_definition, parse_union_decl): Update and use
21448 `linef' muscle.
21449 (copy_action): Likewise.
21450 Use obstack_1grow ().
21451 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
21452
6bc35ae5
MA
214532001-09-21 Marc Autret <autret_m@epita.fr>
21454
21455 * src/options.c (option_table): Adjust.
21456 * src/lex.c (parse_percent_token): Fix.
21457
c0629aa1
PB
214582001-09-20 Pascal Bart <pascal.bart@epita.fr>
21459
21460 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 21461
82b6d266
PB
214622001-09-20 Pascal Bart <pascal.bart@epita.fr>
21463
21464 * src/lex.c (parse_percent_token): Change type of variable `tx', which
21465 is now an option_table_struct*.
21466 (option_strcmp): New function option_strcmp.
21467 (parse_percent_token): Call option_strcmp.
21468 * src/getargs.c (xalloc.h, options.h): Include it.
21469 (getargs): Call create_long_option_table.
21470 (getargs): Free longopts at the end of the function.
21471 (shortopts): Move in options.c.
21472 * src/options.c (create_long_option_table): New function. Convert
21473 information from option_table to option structure.
21474 * src/reader.c (options.h): Include it.
21475
21476 * src/Makefile.am: Adjust.
21477 * src/options.c (option_table): Create from longopts and percent_table.
21478 * src/getargs.c (longopts): Delete.
21479 * src/lex.c (struct percent_table_struct): Delete.
21480 (percent_table): Delete.
21481 (options.h): Include it.
21482 * src/options.c: Create.
21483 * src/options.h: Create.
21484 Declare enum opt_access_e.
21485 Define struct option_table_struct.
21486
75f5aaea
MA
214872001-09-20 Marc Autret <autret_m@epita.fr>
21488
21489 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
21490 sections of Bison.
21491
f508cb0a
PB
214922001-09-19 Pascal Bart <pascal.bart@epita.fr>
21493
21494 * src/bison.simple: s/%%filename/%%skeleton.
21495 * src/muscle_tab.c (getargs.h): Include it.
21496 (muscle_init): Insert new muscle skeleton.
21497
13105fc1
PB
214982001-09-18 Pascal Bart <pascal.bart@epita.fr>
21499
21500 * src/output.c (output_parser): Delete unused variable actions_dumped.
21501
b0c4483e
PB
215022001-09-07 Pascal Bart <pascal.bart@epita.fr>
21503
21504 * src/output.c (output): Delete call to reader_output_yylsp.
21505 * src/reader.c (reader): Likewise.
ba0fe3c7 21506 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 21507
11d82f03
MA
215082001-09-02 Marc Autret <autret_m@epita.fr>
21509
21510 * src/reader.c: Include muscle_tab.h.
21511 (parse_union_decl): Update.
21512 (parse_macro_decl): Rename parse_muscle_decl.
21513 Update to use renamed functions and variable.
21514 (read_declarations, copy_action, read_additionnal_code, : Updated
21515 with correct variables and functions names.
21516 (packsymbols, reader): Likewise.
342b8b6e 21517
11d82f03 21518 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 21519
11d82f03
MA
21520 * src/output.c: Include muscle_tab.h
21521 In all functions using macro_insert, change by using muscle_insert ().
21522 (macro_obstack): Rename muscle_obstack.
21523 Echo modifications in the whole file.
21524 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
21525 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
21526 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
21527
21528 * src/muscle_tab.h: Update double inclusion macros.
21529 (macro_entry_s): Rename muscle_entry_s.
21530 Update prototypes.
342b8b6e 21531
11d82f03
MA
21532 * src/muscle_tab.c: Include muscle_tab.h.
21533 Rename macro_tabble to muscle_table.
21534 (mhash1, mhash2, mcmp): Use muscle_entry.
21535 (macro_init): Rename muscle_init. Update.
21536 (macro_insert): Rename muscle_insert. Update.
21537 (macro_find): Rename muscle_find. Update.
21538
21539 * src/main.c: Include muscle_tab.h.
21540 (main): Call muscle_init ().
21541 * src/Makefile.am (bison_SOURCES): Echo modifications.
21542
93a37297
MA
215432001-09-02 Marc Autret <autret_m@epita.fr>
21544
f753cd62 21545 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 21546
f753cd62
MA
21547 * src/muscle_tab.c, src/muscle_tab.h: Add files.
21548
215492001-09-02 Marc Autret <autret_m@epita.fr>
21550
21551 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 21552
682d48cd
PB
215532001-09-01 Pascal Bart <pascal.bart@epita.fr>
21554
342b8b6e 21555 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
21556 filename.
21557
087c8fda
MA
215582001-09-01 Marc Autret <autret_m@epita.fr>
21559
21560 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
21561 to an explicit value to activate the feature. We do it here.
21562
dda680cb
PB
215632001-08-31 Pascal Bart <pascal.bart@epita.fr>
21564
21565 * src/output.c (prepare): Delete the `filename' muscule insertion.
21566 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
21567 (parse_union_decl): Likewise.
21568 * src/macrotab.c (macro_init): Initialize filename by infile.
21569
9e644e64
MA
215702001-08-31 Marc Autret <autret_m@epita.fr>
21571
21572 * src/bison.simple (YYLSP_NEEDED): New definition.
21573 * src/output.c (prepare): Add macro insertion of `locations_flag'
21574
17da6427
PB
215752001-08-31 Pascal Bart <pascal.bart@epita.fr>
21576
21577 * src/output.c (prepare): Delete insertion of previous muscles,
21578 and insert the `prefix' muscles.
21579 * src/macrotab.c (macro_init): Likewise.
21580 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 21581 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
21582 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
21583 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 21584 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
21585 name_prefix.
21586
e8cb70b9
PB
215872001-08-31 Pascal Bart <pascal.bart@epita.fr>
21588
21589 * src/main.c (main): Standardize.
21590 * src/output.c (output_table_data, output_parser): Likewise.
21591 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
21592
63c2d5de
MA
215932001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
21594
342b8b6e 21595 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
21596 %%epilogue.
21597 * src/output.c (output): Rename %%declarations to %%prologue.
21598 * src/bison.simple: Echo modifications.
342b8b6e 21599
d8cb5183
MA
216002001-08-31 Marc Autret <autret_m@epita.fr>
21601
21602 * src/reader.c (readgram): CleanUp.
21603 (output_token_defines): Likewise.
21604 (packsymbols): Likewise.
21605 (reader): Likewise.
21606 * src/output.c (output): CPP-out useless code.
21607
6c686258
PB
216082001-08-31 Pascal Bart <pascal.bart@epita.fr>
21609
342b8b6e 21610 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
21611 output_trailers and output_headers.
21612 * src/output.h: Remove obsolete functions prototypes of output_headers
21613 and output_trailers.
21614
8f451ef7
PB
216152001-08-30 Pascal Bart <pascal.bart@epita.fr>
21616
21617 * src/main.c: Include macrotab.h.
342b8b6e 21618 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
21619 Adjust functions prototypes.
21620 * src/macrotab.c (macro_insert): Constify key and value.
21621 (macro_find): Constify key.
21622 (macro_insert): Include 'xalloc.h'
21623 (macro_insert): Use XMALLOC.
21624 (macro_find): Constify return value.
21625 * src/output.c (output_table_data): Rename table to table_data.
21626 (output_parser): Constify macro_key, macro_value.
21627
997b6fd0 216282001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
21629
21630 * src/reader.c (parse_skel_decl): New.
342b8b6e 21631 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
21632 * src/lex.h (token_t): New token `tok_skel'.
21633 * src/lex.c (percent_table): Add skeleton option entry.
21634 Standardize.
21635
ff48177d
MA
216362001-08-29 Marc Autret <autret_m@epita.fr>
21637
21638 * src/bison.simple: Add %%user_code directive at the end.
21639 * src/reader.c (read_additionnal_code): New.
21640 (reader): Use it.
21641 * src/output.c (output_program): Remove.
21642 (output): Update.
21643
b33160bf
MA
216442001-08-28 Marc Autret <autret_m@epita.fr>
21645
21646 * src/output.c (output_actions): Clean up.
4e5caae2 21647 (output_gram): CPP-out useless code.
b33160bf
MA
21648 * src/reader.c (reader): Clean up, CPP-out useless code.
21649
d1a2daf7
PB
216502001-08-28 Pascal Bart <pascal.bart@epita.fr>
21651
342b8b6e 21652 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 21653 directive.
d1a2daf7
PB
21654 * src/bison.simple: Add `%%definitions'.
21655
2b763dfe
MA
216562001-08-28 Marc Autret <autret_m@epita.fr>
21657
21658 * config/depcomp: New file.
21659
f1a87ef6
PE
216602001-08-27 Paul Eggert <eggert@twinsun.com>
21661
21662 * src/bison.simple (yyparse): Don't take the address of an
21663 item before the start of an array, as that doesn't conform to
21664 the C Standard.
21665
82e236e2
RA
216662001-08-27 Robert Anisko <robert.anisko@epita.fr>
21667
f1a87ef6 21668 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
21669 obstack. It was done too late here.
21670
21671 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
21672 completely wrong.
21673 (reader): Initialize the macro obstack here, since we need it to grow
21674 '%define' directives.
21675
21676 * src/reader.h: Declare the macro obstack as extern.
21677
b0cfa28a
RA
216782001-08-27 Robert Anisko <robert.anisko@epita.fr>
21679
21680 * src/output.c (output_parser): Fix. Store single '%' characters in
21681 the output obstack instead of throwing them away.
21682
6fc74234
AD
216832001-08-27 Akim Demaille <akim@epita.fr>
21684
21685 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
21686
9c76d118
RA
216872001-08-25 Robert Anisko <robert.anisko@epita.fr>
21688
21689 * lib/Makefile.am: Adjust.
21690
a8289c62
RA
216912001-08-25 Robert Anisko <robert.anisko@epita.fr>
21692
21693 * src/bison.simple: Update and add '%%' directives.
21694
b6610515
RA
216952001-08-25 Robert Anisko <robert.anisko@epita.fr>
21696
21697 * src/reader.c (reader): Remove calls to 'output_headers' and
21698 'output_trailers'. Remove some C output.
21699 (readgram): Disable a piece of code that was writing a default
21700 definition for 'YYSTYPE'.
21701 (reader_output_yylsp): Remove.
21702 (packsymbols): Output token defintions to a macro.
21703 (copy_definition): Disable C output.
6fc74234 21704
b6610515
RA
21705 * src/reader.c (parse_macro_decl): New function used to parse macro
21706 declarations.
21707 (copy_string2): Put the body of copy_string into this new function.
21708 Add a parameter to let the caller choose whether he wants to copy the
21709 string delimiters or not.
21710 (copy_string): Be a simple call to copy_string2 with the last argument
21711 bound to true.
21712 (read_declarations): Add case for macro definition.
21713 (copy_identifier): New.
6fc74234 21714 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
21715 rather than lex.
21716
26f609ff
RA
217172001-08-25 Robert Anisko <robert.anisko@epita.fr>
21718
21719 * src/output.c (prepare): Add prefixed names.
21720 (output_parser): Output semantic actions.
21721 (output_parser): Fix bug on '%%line' directives.
6fc74234 21722
26f609ff
RA
21723 * src/output.c (output_headers): Remove. The C code printed by this
21724 function should now be in the skeletons.
21725 (output_trailers): Remove.
21726 (output): Disable call to 'reader_output_yylsp'.
21727 (output_rule_data): Do not output tables to the table obstack.
21728
21729 * src/output.c: Remove some C dedicated output.
21730 Improve the use of macro and output obstacks.
21731 (output_defines): Remove.
6fc74234 21732
26f609ff
RA
21733 * src/output.c (output_token_translations): Associate 'translate'
21734 table with a macro. No output to the table obstack.
21735 (output_gram): Same for 'rhs' and 'prhs'.
21736 (output_stos): Same for 'stos'.
21737 (output_rule_data): Same for 'r1' and 'r2'.
21738 (token_actions): Same for 'defact'.
21739 (goto_actions): Same for 'defgoto'.
21740 (output_base): Same for 'pact' and 'pgoto'.
21741 (output_table): Same for 'table'.
21742 (output_check): Same for 'check'.
6fc74234 21743
26f609ff
RA
21744 * src/output.c (output_table_data): New function.
21745 (output_short_table): Remove.
21746 (output_short_or_char_table): Remove.
6fc74234 21747
26f609ff
RA
21748 * src/output.c (output_parser): Replace most of the skeleton copy code
21749 with something new. Skeletons are now processed character by character
21750 rather than line by line, and Bison looks for '%%' macros. This is the
21751 first step in making Bison's output process (a lot) more flexible.
21752 (output_parser): Use the macro table.
21753
6f43b113
RA
217542001-08-25 Robert Anisko <robert.anisko@epita.fr>
21755
21756 * src/main.c (main): Initialize the macro table.
21757
dd3127cf
RA
217582001-08-25 Robert Anisko <robert.anisko@epita.fr>
21759
21760 * src/lex.c (percent_table): Add tok_define.
21761 * src/lex.h: Add tok_define.
21762
aa321494
RA
217632001-08-25 Robert Anisko <robert.anisko@epita.fr>
21764
21765 * src/macrotab.c: New file.
21766 * src/macrotab.h: New file.
21767 * src/Makefile.am: Update.
21768
68bd3b6b
RA
217692001-08-25 Robert Anisko <robert.anisko@epita.fr>
21770
21771 * lib/hash.c: New file.
21772 * lib/hash.h: New file.
21773 * lib/Makefile.am: Update.
21774
45f8dd1e
AD
217752001-08-15 Akim Demaille <akim@epita.fr>
21776
21777 Version 1.28c.
21778
40a64a7a 217792001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
21780
21781 * src/reader.c (readgram): Indent output macro YYSTYPE.
21782 (packsymbols): Likewise.
21783 (output_token_defines): Likewise.
21784 * src/files.c: Standardize.
21785 (compute_header_macro): New.
21786 (defines_obstack_save): New. Use compute_header_macro.
21787 (output_files): Update. Use defines_obstack_save.
21788
f9a8293a
AD
217892001-08-15 Akim Demaille <akim@epita.fr>
21790
21791 * doc/bison.texinfo (Table of Symbols): Document
21792 YYSTACK_USE_ALLOCA.
21793
150ca7a7
AD
217942001-08-15 Akim Demaille <akim@epita.fr>
21795
21796 * missing: Update from CVS Automake.
21797 * config/config.guess, config/config.sub, config/texinfo.tex:
21798 Update from gnu.org.
21799
69b5cec4
AD
218002001-08-15 Akim Demaille <akim@epita.fr>
21801
21802 * Makefile.maint: Sync with CVS Autoconf.
21803
f2b5126e
PB
218042001-08-14 Pascal Bart <pascal.bart@epita.fr>
21805
69b5cec4 21806 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
21807 `fdl.texi'.
21808 * doc/fdl.texi: Add to package.
21809
4ecbf796
MA
218102001-08-14 Marc Autret <autret_m@epita.fr>
21811
21812 Turn on %{source,header}_extension features.
21813
69b5cec4 21814 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
21815 source_extension.
21816 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 21817 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
21818 between options.
21819
95fb5662
MA
218202001-08-14 Marc Autret <autret_m@epita.fr>
21821
21822 * src/files.c (compute_base_names): Add extensions computing when
21823 `--file-prefix' used.
21824 Standardize function calls.
21825
78d09da9
MA
218262001-08-13 Marc Autret <autret_m@epita.fr>
21827
69b5cec4 21828 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
21829 defining it (defined but null disables alloca).
21830
5a009f2c
MA
218312001-08-13 Marc Autret <autret_m@epita.fr>
21832
21833 * src/bison.simple (_yy_memcpy): CPP reformat.
21834
1e41465a
PB
218352001-08-13 Pascal Bart <pascal.bart@epita.fr>
21836
21837 * tests/atconfig.in (CPPFLAGS): Fix.
21838
c67a198d
PB
218392001-08-10 Pascal Bart <pascal.bart@epita.fr>
21840
79282c6c 21841 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
21842 `gpl.texi'.
21843 * doc/gpl.texi: Add to package.
21844
09a6de7e
MA
218452001-08-10 Marc Autret <autret_m@epita.fr>
21846
21847 * src/print_graph.h: Fix.
21848 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
21849
b77b9ee0
AD
218502001-08-10 Akim Demaille <akim@epita.fr>
21851
21852 * src/system.h: Provide default declarations for stpcpy, strndup,
21853 and strnlen.
21854
3e259915
MA
218552001-08-10 Robert Anisko <anisko_r@epita.fr>
21856
21857 * doc/bison.texinfo (Locations): Update @$ stuff.
21858
ca96bc2d
MA
218592001-08-09 Robert Anisko <anisko_r@epita.fr>
21860
21861 * src/bison.simple (YYLLOC_DEFAULT): Update.
21862 (yyparse): Adjust.
21863
fdc6758b
MA
218642001-08-08 Marc Autret <autret_m@epita.fr>
21865
b77b9ee0 21866 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
21867 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
21868 Reported by Fabrice Bauzac.
957d4dbf 21869
600cad3b
MA
218702001-08-08 Marc Autret <autret_m@epita.fr>
21871
21872 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
21873 * src/vcg.c (output_node): Fix.
21874 * src/vcg.h: Cleanup.
21875 * src/print_graph.c: Add comments.
b77b9ee0 21876 (node_output_size): New global variable. Simplify the formatting of
600cad3b 21877 the VCG graph output.
b77b9ee0 21878 (print_actions): Unused code is now used. It notifies the final state
600cad3b 21879 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 21880 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
21881 blue.
21882 Get the current node name and node_obstack by argument.
21883 (node_obstack): New variable.
21884 (print_state): Manage node_obstack.
21885 (print_core): Use node_obstack given by argument.
21886 A node is not only computed here but in print_actions also.
21887 (print_graph): CPP out useless code instead of commenting it.
21888
976e528f
AD
218892001-08-07 Pascal Bart <pascal.bart@epita.fr>
21890
21891 * tests/atconfig.in (CPPFLAGS): Fix.
21892
20e8e5ca
AD
218932001-08-07 Akim Demaille <akim@epita.fr>
21894
21895 * src/print_graph.c (quote): New.
21896 (print_core): Use it.
21897
957d4dbf 218982001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 21899
3e3da797
AD
21900 * src/vcg.c (complain.h): Include it.
21901 Unepitaize `return' invocations.
c4b66126 21902 [NDEBUG] (main): Remove.
79282c6c 21903 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
21904 * src/files.c (open_files): Initialize graph_obstack.
21905 * src/print_graph.c (print_actions): CPP out useless code.
21906 (print_core): Don't output the last `\n' in labels.
21907 Use `quote'.
21908 * src/files.c (output_files): Output the VCG file.
21909 * src/main.c (main): Invoke print_graph ();
3e3da797 21910
957d4dbf 219112001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
21912
21913 Automaton VCG graph output.
21914 Using option ``-g'' or long option ``--graph'', you can generate
21915 a gram_filename.vcg file containing a VCG description of the LALR (1)
21916 automaton of your grammar.
21917
21918 * src/main.c: Call to print_graph() function.
21919 * src/getargs.h: Update.
21920 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
21921 (graph_flag): New flag.
21922 (longopts): Update.
21923 (getargs): Add case `g'.
21924 * src/files.c (graph_obstack): New obstack struct.
21925 (open_files): Initialize new obstack.
21926 (output_files): Saves graph_obstack if required.
21927 * src/files.h (graph_obstack): New extern declaration.
21928 * src/Makefile.am: Add new source files.
21929
927c1557 219302001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
21931
21932 * src/print_graph.c, src/print_graph.h (graph): New.
21933 * src/vcg.h: New file.
21934 * src/vcg.c: New file, VCG graph handling.
21935
7333d403
AD
219362001-08-06 Marc Autret <autret_m@epita.fr>
21937
21938 Add of %source_extension and %header_extension which specify
21939 the source or/and the header output file extension.
21940
21941 * src/files.c (compute_base_names): Remove initialisation of
21942 src_extension and header_extension.
21943 (compute_exts_from_gf): Update.
21944 (compute_exts_from_src): Update.
21945 (output_files): Update.
21946 * src/reader.c (parse_header_extension_decl): New.
21947 (parse_source_extension_decl): New.
21948 (read_declarations): New case statements for the new tokens.
21949 * src/lex.c (percent_table): Add entries for %source_extension
21950 and %header_extension.
21951 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
21952
84163231
AD
219532001-08-06 Marc Autret <autret_m@epita.fr>
21954
21955 * configure.in: Bump to 1.28c.
21956 * doc/bison.texinfo: Texinfo thingies.
21957
8303fc42
AD
219582001-08-04 Pascal Bart <pascal.bart@epita.fr>
21959
21960 * tests/atconfig.in (CPPFLAGS): Add.
21961 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
21962
70a84437
AD
219632001-08-03 Akim Demaille <akim@epita.fr>
21964
21965 Version 1.28b.
21966
2ce10144
AD
219672001-08-03 Akim Demaille <akim@epita.fr>
21968
21969 * tests/Makefile.am (check-local): Ship testsuite.
21970 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
21971 Include `string.h'.
21972
1e3e4bc1
AD
219732001-08-03 Akim Demaille <akim@epita.fr>
21974
21975 * configure.in: Try using -Wformat when compiling.
21976
42b45b7f
AD
219772001-08-03 Akim Demaille <akim@epita.fr>
21978
21979 * configure.in: Bump to 1.28b.
21980
8f13fe33
AD
219812001-08-03 Akim Demaille <akim@epita.fr>
21982
21983 * src/complain.c: Adjust strerror_r portability issues.
21984
b37ba92c
AD
219852001-08-03 Akim Demaille <akim@epita.fr>
21986
21987 Version 1.28a.
21988
b0ce6046
AD
219892001-08-03 Akim Demaille <akim@epita.fr>
21990
21991 * src/getargs.c, src/getarg.h (skeleton)): Constify.
21992 * src/lex.c (literalchar): Avoid name clashes on `buf'.
21993 * src/getargs.c: Include complain.h.
21994 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
21995 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
21996
d01c415b
AD
219972001-08-03 Akim Demaille <akim@epita.fr>
21998
21999 * src/reader.c (readgram): Display hidden chars in error messages.
22000
459dd1a6
AD
220012001-08-03 Akim Demaille <akim@epita.fr>
22002
22003 Update to gettext 0.10.39.
22004
53b74c0c
AD
220052001-08-03 Akim Demaille <akim@epita.fr>
22006
22007 * lib/strspn.c: New.
22008
234a3be3
AD
220092001-08-01 Marc Autret <autret_m@epita.fr>
22010
22011 * doc/bison.texinfo: Update.
22012 * doc/bison.1 (mandoc): Update.
22013 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
22014 * src/files.c: Support output files extensions computing.
22015 (src_extension): New static variable.
22016 (header_extension): New static variable.
22017 (tr): New function.
22018 (get_extension_index): New function, gets the index of an extension
22019 filename in a string.
22020 (compute_exts_from_gf): New function, computes extensions from the
22021 grammar file extension.
22022 (compute_exts_from_src): New functions, computes extensions from the
22023 C source file extension, file given by ``-o'' option.
22024 (compute_base_names): Update.
22025 (output_files): Update.
22026
847bf1f5
AD
220272001-08-01 Robert Anisko <anisko_r@epita.fr>
22028
d995fee7 22029 * doc/bison.texi: Document @$.
847bf1f5
AD
22030 (Locations): New section.
22031
d074a105
AD
220322001-07-18 Akim Demaille <akim@epita.fr>
22033
22034 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
22035 * config/prev-version.txt, config/move-if-change: New.
22036 * Makefile.am: Adjust.
22037
3419715d
AD
220382001-07-08 Pascal Bart <pascal.bart@epita.fr>
22039
22040 * src/bison.simple (yyparse): Suppress warning `comparaison
22041 between signed and unsigned'.
22042
62ab6972
AD
220432001-07-05 Pascal Bart <pascal.bart@epita.fr>
22044
22045 * src/getargs.h (raw_flag): Remove.
22046 * src/getargs.c: Die on `-r'/`--raw'.
22047 * src/lex.c (parse_percent_token): Die on `%raw'.
22048 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
22049 * tests/calc.at: Suppress test with option `--raw'.
22050
1e24cc5b
AD
220512001-07-14 Akim Demaille <akim@epita.fr>
22052
22053 * config/: New.
22054 * configure.in: Require Autoconf 2.50.
22055 Update to gettext 0.10.38.
22056
32dfccf8
AD
220572001-03-16 Akim Demaille <akim@epita.fr>
22058
22059 * doc/bison.texinfo: ANSIfy the examples.
22060
cd5bd6ac
AD
220612001-03-16 Akim Demaille <akim@epita.fr>
22062
22063 * getargs.c (skeleton): New variable.
22064 (longopts): --skeleton is a new option.
22065 (shortopts, getargs): -S is a new option.
22066 * getargs.h: Declare skeleton.
22067 * output.c (output_parser): Use it.
22068
5141b016
AD
220692001-03-16 Akim Demaille <akim@epita.fr>
22070
22071 * m4/strerror_r.m4: New.
22072 * m4/error.m4: Run AC_FUNC_STRERROR_R.
22073 * lib/error.h, lib/error.c: Update.
22074
447992b9
AD
220752001-03-16 Akim Demaille <akim@epita.fr>
22076
22077 * src/getargs.c (longopts): Clean up.
22078
274d42ce
AD
220792001-02-21 Akim Demaille <akim@epita.fr>
22080
22081 * src/reader.c (gensym): `gensym_count' is your own.
22082 Use a static buf to create the symbol name, as token_buffer is no
22083 longer a buffer.
22084
22c821f3
AD
220852001-02-08 Akim Demaille <akim@epita.fr>
22086
22087 * src/conflicts.c (conflict_report): Be sure not to append to res
22088 between two calls, which could happen if both first sprintf were
22089 skipped, but not the first cp += strlen.
22090
18569462
AD
220912001-02-08 Akim Demaille <akim@epita.fr>
22092
22093 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
22094 New, from fileutils 4.0.37.
22095 * configure.in: Require Autoconf 2.49c. I took some time before
22096 making this decision. This is the only way out for portability
22097 issues in Bison, it would mean way too much duplicate effort to
22098 import in Bison features implemented in 2.49c since 2.13.
22099 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
22100
0d8f3c8a
AD
221012001-02-02 Akim Demaille <akim@epita.fr>
22102
22103 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 22104 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 22105
f17bcd1f
AD
221062001-01-19 Akim Demaille <akim@epita.fr>
22107
22108 Get rid of the ad hoc handling of token_buffer in the scanner: use
22109 the obstacks.
22110
22111 * src/lex.c (token_obstack): New.
22112 (init_lex): Initialize it. No longer call...
22113 (grow_token_buffer): this. Remove it.
22114 Adjust all the places which used it to use the obstack.
22115
511e79b3
AD
221162001-01-19 Akim Demaille <akim@epita.fr>
22117
22118 * src/lex.h: Rename all the tokens:
22119 s/\bENDFILE\b/tok_eof/g;
22120 s/\bIDENTIFIER\b/tok_identifier/g;
22121 etc.
22122 Let them be enums, not #define, to ease debugging.
22123 Adjust all the code.
22124
0d6508ef
AD
221252001-01-18 Akim Demaille <akim@epita.fr>
22126
22127 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
22128 * src/lex.c (maxtoken, grow_token_buffer): Static.
22129
6deb4447
AD
221302001-01-18 Akim Demaille <akim@epita.fr>
22131
22132 Since we now use obstacks, more % directives can be enabled.
22133
22134 * src/lex.c (percent_table): Also accept `%yacc',
22135 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
22136 `%debug'.
22137 Handle the actions for `%semantic_parser' and `%pure_parser' here,
22138 instead of returning a token.
22139 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
22140 * src/reader.c (read_declarations): Adjust.
22141 * src/files.c (open_files): Don't call `compute_base_names', don't
22142 compute `attrsfile' since they depend upon data which might be
22143 *in* the input file now.
22144 (output_files): Do it here.
22145 * src/output.c (output_headers): Document the fact that this patch
22146 introduces a guaranteed SEGV for semantic parsers.
22147 * doc/bison.texinfo: Document them.
22148 * tests/suite.at: Exercise these %options.
22149
ff4423cc
AD
221502000-12-20 Akim Demaille <akim@epita.fr>
22151
22152 Also handle the output file (--verbose) with obstacks.
22153
22154 * files.c (foutput): Remove.
22155 (output_obstack): New.
22156 Adjust all dependencies.
22157 * src/conflicts.c: Return a string.
22158 * src/system.h (obstack_grow_string): Rename as...
22159 (obstack_sgrow): this. Be ready to work with non literals.
22160 (obstack_fgrow4): New.
22161
956dba3a
AD
221622000-12-20 Akim Demaille <akim@epita.fr>
22163
22164 * src/files.c (open_files): Fix the computation of short_base_name
22165 in the case of `-o foo.tab.c'.
22166
337bab46
AD
221672000-12-20 Akim Demaille <akim@epita.fr>
22168
22169 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
22170 (copy_dollar): Now that everything uses obstacks, get rid of the
22171 FILE * parameters.
22172
5d3214b8
AD
221732000-12-20 Akim Demaille <akim@epita.fr>
22174
22175 * src/files.c (open_files): Actually the `.output' file is based
22176 on the short_base_name, not base_name.
22177 * tests/suite.at (Checking output file names): Adjust.
22178
29092a57
AD
221792000-12-20 Akim Demaille <akim@epita.fr>
22180
22181 * src/bison.s1: Remove, we now use directly...
22182 * src/bison.simple: this.
22183 * src/Makefile.am: Use pkgdata instead of data.
22184
ea5607fd
AD
221852000-12-20 Akim Demaille <akim@epita.fr>
22186
22187 * src/files.c (guard_obstack): New.
22188 (open_files): Initialize it.
22189 (output_files): Dump it...
22190 * src/files.h: Export it.
22191 * src/reader.c (copy_guard): Use it.
22192
27110317
AD
221932000-12-19 Akim Demaille <akim@epita.fr>
22194
22195 * src/files.c (outfile, defsfile, actfile): Removed as global
22196 vars.
22197 (open_files): Don't compute them.
22198 (output_files): Adjust.
22199 (base_name, short_base_name): Be global.
22200 Adjust dependencies.
22201
19c50364
AD
222022000-12-19 Akim Demaille <akim@epita.fr>
22203
22204 * src/files.c (strsuffix): New.
22205 (stringappend): Be just like strcat but allocate.
22206 (base_names): Eve out from open_files.
22207 Try to simplify the rather hairy computation of base_name and
22208 short_base_name.
22209 (open_files): Use it.
22210 * tests/suite.at (Checking output file names): New test.
22211
573c1d9f
AD
222122000-12-19 Akim Demaille <akim@epita.fr>
22213
22214 * src/system.h (obstack_grow_literal_string): Rename as...
22215 (obstack_grow_string): this.
22216 * src/output.c (output_parser): Recognize `%% actions' instead of
22217 `$'.
22218 * src/bison.s1: s/$/%% actions/.
22219 * src/bison.hairy: Likewise.
22220
ef7ddedd
AD
222212000-12-19 Akim Demaille <akim@epita.fr>
22222
22223 * src/output.c (output_parser): Compute the `#line' lines when
22224 there are.
22225 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
22226 Suggested by Hans Aberg.
22227
ff61dabd
AD
222282000-12-19 Akim Demaille <akim@epita.fr>
22229
22230 Let the handling of the skeleton files be local to the procedures
22231 that use it.
22232
22233 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
22234 longer static.
22235 (fparser, open_extra_files): Remove.
22236 (open_files, output_files): Don't take care of fparser.
22237 * src/files.h: Adjust.
22238 * src/output.c (output_parser): Open and close the file to the
22239 skeleton.
22240 * src/reader.c (read_declarations): When %semantic_parser, open
22241 fguard.
22242
55b96341
AD
222432000-12-19 Akim Demaille <akim@epita.fr>
22244
22245 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
22246 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
22247
358c15b7
AD
222482000-12-19 Akim Demaille <akim@epita.fr>
22249
22250 * src/files.c (open_files): Yipee! We no longer need all the code
22251 looking for `/tmp' since we have no tmp file.
22252
7de3329e
AD
222532000-12-19 Akim Demaille <akim@epita.fr>
22254
22255 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
22256 New macros.
22257 * src/files.c (open_files): Less dependency on MSDOS etc.
22258
3abcd459
AD
222592000-12-14 Akim Demaille <akim@epita.fr>
22260
22261 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
22262 Provide a default definition.
22263 Use it when executing the default @ action.
22264 * src/reader.c (reader_output_yylsp): No longer include
22265 `timestamp' and `text' in the default YYLTYPE.
22266
2a91a95e
AD
222672000-12-12 Akim Demaille <akim@epita.fr>
22268
22269 * src/reader.c (copy_definition, parse_union_decl, copy_action)
22270 (copy_guard): Quote the file names.
22271 Reported by Laurent Mascherpa.
22272
14d3eb9b
AD
222732000-12-12 Akim Demaille <akim@epita.fr>
22274
22275 * src/output.c (output_headers, output_program, output): Be sure
22276 to escape special characters when outputting filenames.
22277 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
22278 (output_headers): Don't depend on them, Use ACTSTR.
22279
d7045ec6
AD
222802000-11-17 Akim Demaille <akim@epita.fr>
22281
22282 * lib/obstack.h: Formatting changes.
22283 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
22284 prevents type checking.
22285 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
22286 cast the value to (void *): assigning a `foo *' to a `void *'
22287 variable is valid.
22288 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
22289 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
22290 append characters.
22291
6fd54b73
AD
222922000-11-17 Akim Demaille <akim@epita.fr>
22293
22294 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
22295 as...
22296 (suite.m4, regression.m4, calc.m4): these.
22297 * tests/atgeneral.m4: Update from CVS Autoconf.
22298
4c50eae6
AD
222992000-11-17 Akim Demaille <akim@epita.fr>
22300
22301 * tests/regression.m4 (%union and --defines): New test,
22302 demonstrating a current bug in the obstack implementation.
22303
a35f64ea
AD
223042000-11-17 Akim Demaille <akim@epita.fr>
22305
22306 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
22307 macros.
22308 Use them to declare the variables which are global or local to
22309 `yyparse'.
22310
7de23534
AD
223112000-11-17 Akim Demaille <akim@epita.fr>
22312
22313 * acconfig.h: Remove, no longer used.
22314
aa7815f5
AD
223152000-11-07 Akim Demaille <akim@epita.fr>
22316
22317 * src: s/Copyright (C)/Copyright/g.
22318
5af1f549
AD
223192000-11-07 Akim Demaille <akim@epita.fr>
22320
22321 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
22322 defining.
22323 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
22324
553e2b22
AD
223252000-11-07 Akim Demaille <akim@epita.fr>
22326
22327 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
22328 Merge in a single CPP if/else.
22329
8a4f41d6
AD
223302000-11-07 Akim Demaille <akim@epita.fr>
22331
22332 * src/output.c (output): Remove useless variables.
22333 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
22334 argument `data' for consistency with the prototypes.
22335 Qualify it `const'.
22336 (obstack_copy, obstack_copy0): Rename the second argument as
22337 `address' for consistency. Qualify it `const'.
22338 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
22339 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
22340 `const' their input argument (`data' or `address').
22341 Adjust the corresponding macros to include `const' in casts.
22342
095a3fb5
AD
223432000-11-03 Akim Demaille <akim@epita.fr>
22344
22345 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
22346 s/PFILE1/BISON_HAIRY/.
22347 Adjust dependencies.
22348
d1cdce7c
AD
223492000-11-03 Akim Demaille <akim@epita.fr>
22350
090c5ebf 22351 For some reason, this was not applied.
d1cdce7c
AD
22352
22353 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
22354 `unlink': it's no longer used.
22355
9311529b
AD
223562000-11-03 Akim Demaille <akim@epita.fr>
22357
22358 * src/files.c (skeleton_find): New function, eved out of...
22359 (open_files, open_extra_files): here.
22360
d8880f69
AD
223612000-11-03 Akim Demaille <akim@epita.fr>
22362
22363 Don't use `atexit'.
22364
22365 * src/files.c (obstack_save): New function.
22366 (done): Rename as...
22367 (output_files): this.
22368 Use `obstack_save'.
22369 * src/main.c (main): Don't use `atexit' to register `done', since
22370 it no longer has to remove tmp files, just call `output_files'
22371 when there are no errors.
22372
0dbb648e
AD
223732000-11-02 Akim Demaille <akim@epita.fr>
22374
22375 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
22376 `unlink': it's no longer used.
22377 * src/files.h: Formatting changes.
22378
896fe5c1
AD
223792000-11-02 Akim Demaille <akim@epita.fr>
22380
22381 Remove the last uses of mktemp and unlink/delete.
22382
22383 * src/files.c (fdefines, ftable): Removed.
22384 (defines_ostack, table_obstack): New.
22385 Adjust dependencies of the former into uses of the latter.
22386 * src/output.c (output_short_or_char_table, output_short_table):
22387 Convert to using obstacks.
22388 * src/reader.c (copy_comment2): Accept one FILE * and two
22389 obstacks.
22390 (output_token_defines, reader_output_yylsp): Use obstacks.
22391 * src/system.h (obstack_fgrow3): New.
1f65350a 22392 * po/POTFILES.in: Adjust.
896fe5c1 22393
dd60faec
AD
223942000-11-01 Akim Demaille <akim@epita.fr>
22395
22396 Change each use of `fattrs' into a use of `attrs_obstack'.
22397
22398 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
22399 * src/files.c (fattrs): Remove.
22400 (attrs_obstack): New.
22401 Adjust all dependencies.
22402 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
22403
8c7ebe49
AD
224042000-11-01 Akim Demaille <akim@epita.fr>
22405
22406 Introduce obstacks.
22407 Change each use of `faction' into a use of `action_obstack'.
22408
22409 * lib/obstack.h, lib/obstack.c: New files.
22410 * src/files.c (faction): Remove.
22411 (action_obstack): New.
22412 Adjust all dependencies.
22413
77aee789
AD
224142000-10-20 Akim Demaille <akim@epita.fr>
22415
22416 * lib/quote.h (PARAMS): New macro. Use it.
22417
43591cec
AD
224182000-10-16 Akim Demaille <akim@epita.fr>
22419
22420 * src/output.c (output_short_or_char_table): New function.
22421 (output_short_table, output_token_translations): Use it.
22422 (goto_actions): Use output_short_table.
22423
1e9798d5
AD
224242000-10-16 Akim Demaille <akim@epita.fr>
22425
22426 * src/symtab.c (bucket_new): New function.
22427 (getsym): Use it.
22428
22429 * src/output.c (output_short_table): New argument to display the
22430 comment associated with the table.
22431 Adjust dependencies.
22432 (output_gram): Use it.
22433 (output_rule_data): Nicer output layout for YYTNAME.
22434
f282676b
AD
224352000-10-16 Akim Demaille <akim@epita.fr>
22436
22437 * src/lex.c (read_typename): New function.
22438 (lex): Use it.
22439 * src/reader.c (copy_dollar): Likewise.
22440
550a72a3
AD
224412000-10-16 Akim Demaille <akim@epita.fr>
22442
22443 * src/reader.c (copy_comment2): Expect the input stream to be on
22444 the `/' which is suspected to open a comment, instead of being
22445 called after `//' or `/*' was read.
22446 (copy_comment, copy_definition, parse_union_decl, copy_action)
22447 (copy_guard): Adjust.
22448
131e2fef
AD
224492000-10-16 Akim Demaille <akim@epita.fr>
22450
22451 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
22452 `read_signed_integer'.
22453
79282c5a
AD
224542000-10-16 Akim Demaille <akim@epita.fr>
22455
22456 * src/reader.c (copy_dollar): New function.
22457 (copy_guard, copy_action): Use it.
22458
ff4a34be
AD
224592000-10-16 Akim Demaille <akim@epita.fr>
22460
22461 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
22462 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
22463 New files, from Fileutils 4.0.27.
22464 * src/main.c (printable_version): Remove.
22465 * src/lex.c, src/reader.c: Use `quote'.
22466
224672000-10-04 Akim Demaille <akim@epita.fr>
22468
22469 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
22470
14ded682
AD
224712000-10-04 Akim Demaille <akim@epita.fr>
22472
22473 * doc/bison.texinfo: Various typos spotted by Neil Booth.
22474
8e03724b
AD
224752000-10-04 Akim Demaille <akim@epita.fr>
22476
22477 When a literal string is used to define two different tokens,
22478 `bison -v' segfaults.
22479 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
22480
22481 * tests/regression.m4: New file.
22482 Include the core of the sample provided by Piotr Gackiewicz.
22483 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
22484 properly.
22485
a9e64249
AD
224862000-10-04 Akim Demaille <akim@epita.fr>
22487
22488 * src/reader.c (parse_expect_decl): Keep `count' within the size
22489 of `buffer'.
22490 From Neil Booth.
22491
da9abf43
AD
224922000-10-02 Paul Eggert <eggert@twinsun.com>
22493
22494 * bison.s1 (yyparse): Assign the default value
22495 unconditionally, to avoid a GCC warning and make the parser a
22496 tad smaller.
22497
c33638bb
AD
224982000-10-02 Akim Demaille <akim@epita.fr>
22499
22500 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
22501 options.
22502
444c570a
AD
225032000-10-02 Akim Demaille <akim@epita.fr>
22504
22505 * src/derives.c, src/print.c, src/reduce.c: To ease the
22506 translation, move some `\n' out of the translated strings.
22507
89cab50d
AD
225082000-10-02 Akim Demaille <akim@epita.fr>
22509
22510 The location tracking mechanism is precious for parse error
22511 messages. Nevertheless, it is enabled only when `@n' is used in
22512 the grammar, which is a different issue (you can use it in error
22513 message, but not in the grammar per se). Therefore, there should
22514 be another means to enable it.
22515
22516 * src/getargs.c (getargs): Support `--locations'.
22517 (usage): Report it.
22518 * src/getargs.h (locationsflag): Export it.
22519 * src/lex.c (percent_table): Support `%locations'.
22520 * src/reader.c (yylsp_needed): Remove this variable, now replaced
22521 with `locationsflag'.
22522 * doc/bison.texinfo: Document `--locations' and `%locations'.
22523 Sort the options.
22524 * tests/calc.m4: Test it.
22525
22526 For regularity of the names, replace each
22527 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
22528 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
22529 In addition replace each `flag' with `_flag'.
22530
d6c2cba0
AD
225312000-10-02 Akim Demaille <akim@epita.fr>
22532
22533 Also test parse error messages, including with YYERROR_VERBOSE.
22534
22535 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
22536 associative).
22537 Use it to check the computations.
22538 Use it to check `nonassoc' is honored.
22539 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
22540 `--yyerror-verbose'.
22541 (_AT_CHECK_CALC): Adjust to this option.
22542 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
22543
5a35a6cb
AD
225442000-10-02 Akim Demaille <akim@epita.fr>
22545
22546 Test also `--verbose', `--defines' and `--name-prefix'. Testing
22547 the latter demonstrates a flaw in the handling of non debugging
22548 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
22549 was used in order to simplify:
22550
22551 #if YYDEBUG
22552 if (yydebug)
22553 {
22554 ...
22555 }
22556 #endif
22557
22558 into
22559
22560 if (yydebug)
22561 {
22562 ...
22563 }
22564
22565 unfortunately this leads to a CPP conflict when
22566 `--name-prefix=foo' is used since it produces `#define yydebug
22567 foodebug'.
22568
22569 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
22570 (YYDPRINTF): New macro.
22571 Spread its use.
22572 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
22573 the bison options.
22574 Also test `--verbose', `--defines' and `--name-prefix'.
22575
71da9eea
AD
225762000-10-02 Akim Demaille <akim@epita.fr>
22577
22578 Improve the readability of the produced parsers.
22579
22580 * src/bison.s1: Formatting changes.
22581 Improve the comment related to the `$' mark.
22582 (yydefault): Don't fall through to `yyresume': `goto' there.
22583 * src/output.c (output_parser): When the `$' is met, skip the end
22584 of its line.
22585 New variable, `number_of_dollar_signs', to check there's exactly
22586 one `$' in the parser skeleton.
22587
95e36146
AD
225882000-10-02 Akim Demaille <akim@epita.fr>
22589
22590 * lib/xstrdup.c: New file, from the fileutils.
22591 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
22592 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
22593 instead of strlen + xmalloc + strcpy.
22594 * src/symtab.c (copys): Remove, use xstrdup instead.
22595
d7020c20
AD
225962000-10-02 Akim Demaille <akim@epita.fr>
22597
22598 * src/gram.h (associativity): New enum type which replaces the
22599 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
22600 `right_assoc', `left_assoc' and `non_assoc'.
22601 Adjust all dependencies.
22602 * src/reader.c: Formatting changes.
22603 (LTYPESTR): Don't define it, use it as a literal in
22604 `reader_output_yylsp'.
22605 * src/symtab.h (symbol_class): New enum type which replaces the
22606 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
22607 `sunknown', `stoken and `snterm'.
22608
1916f98e
AD
226092000-10-02 Akim Demaille <akim@epita.fr>
22610
22611 * src/getargs.c (fixed_outfiles): Rename as...
22612 (yaccflag): for consistency and accuracy.
22613 Adjust dependencies.
22614
d7913476
AD
226152000-10-02 Akim Demaille <akim@epita.fr>
22616
22617 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
22618 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
22619 difficult and introduced a lot of core dump. It turns out that
22620 Bison used an implementation of `xmalloc' based on `calloc', and
22621 at various places it does depend upon the initialization to 0. I
22622 have not tried to isolate the pertinent places, and all the former
22623 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
22624 someone should address this issue.
22625
22626 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
22627 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
22628 files.
22629 Adjust dependencies.
22630 * src/warshall.h: New file.
22631 Propagate.
22632
340ef489
AD
226332000-10-02 Akim Demaille <akim@epita.fr>
22634
22635 Various anti-`extern in *.c' changes.
22636
22637 * src/system.h: Include `assert.h'.
22638
b2ca4022
AD
226392000-10-02 Akim Demaille <akim@epita.fr>
22640
22641 * src/state.h (nstates, final_state, first_state, first_shift)
22642 (first_reduction): Move their exportation from here...
22643 * src/LR0.h: to here.
22644 Adjust dependencies.
22645 * src/getargs.c (statisticsflag): New variable.
22646 Add support for `--statistics'.
22647 Adjust dependencies.
22648
22649 Remove a lot of now useless `extern' statements in most files.
22650
403b315b
AD
226512000-10-02 Akim Demaille <akim@epita.fr>
22652
22653 * src/LR0.h: New file.
22654 Propagate its use.
22655
07a58c13
AD
226562000-10-02 Akim Demaille <akim@epita.fr>
22657
22658 * src/print.h: New file.
22659 Propagate its use.
22660 * src/print.c: Formatting and ordering changes.
22661 (verbose, terse): Replace with...
22662 (print_results): this new function.
22663 Adjust dependencies.
22664
0619caf0
AD
226652000-10-02 Akim Demaille <akim@epita.fr>
22666
22667 * src/conflicts.c (conflict_report): New function.
22668 (conflict_log, verbose_conflict_log): Replace with...
22669 (print_conflicts): this function.
22670 Adjust dependencies.
22671 * src/conflicts.h: New file.
22672 Propagate its inclusion.
22673
3519ec76
AD
226742000-10-02 Akim Demaille <akim@epita.fr>
22675
22676 * src/nullable.h: New file.
22677 Propagate its inclusion.
22678 * src/nullable.c: Formatting changes.
22679
015acc48
AD
226802000-10-02 Akim Demaille <akim@epita.fr>
22681
22682 * src/reduce.h: New file.
22683 Propagate its inclusion.
22684 * src/reduce.c: Topological sort and other formatting changes.
22685 (bool, TRUE, FALSE): Move their definition to...
22686 * src/system.h: here.
22687
8963a27b
AD
226882000-10-02 Akim Demaille <akim@epita.fr>
22689
22690 * src/files.c: Formatting changes.
22691 (tryopen, tryclose, openfiles): Rename as...
22692 (xfopen, xfclose, open_files): this.
22693 (stringappend): static.
22694 * src/files.h: Complete the list of exported symbols.
22695 Propagate its use.
22696
a70083a3
AD
226972000-10-02 Akim Demaille <akim@epita.fr>
22698
22699 * src/reader.h: New file.
22700 Propagate its use instead of tedious list of `extern' and
22701 prototypes.
22702 * src/reader.c: Formatting changes, topological sort,
22703 s/register//.
22704
abadc117
AD
227052000-10-02 Akim Demaille <akim@epita.fr>
22706
22707 * src/lex.h: Prototype `lex.c' exported functions.
22708 * src/reader.c: Adjust.
22709 * src/lex.c: Formatting changes.
22710 (safegetc): Rename as...
22711 (xgetc): this.
22712
720d742f
AD
227132000-10-02 Akim Demaille <akim@epita.fr>
22714
22715 * src/lalr.h: New file.
22716 Propagate its inclusion instead of prototypes and `extern'.
22717 * src/lalr.c: Formatting changes, topological sorting etc.
22718
f2acea59
AD
227192000-10-02 Akim Demaille <akim@epita.fr>
22720
22721 * src/output.c (token_actions): Introduce a temporary array,
22722 YYDEFACT, that makes it possible for this function to use
22723 output_short_table.
22724
d019d655
AD
227252000-10-02 Akim Demaille <akim@epita.fr>
22726
22727 `user_toknums' is output as a `short[]' in `output.c', while it is
22728 defined as a `int[]' in `reader.c'. For consistency with the
22729 other output tables, `user_toknums' is now defined as a table of
22730 shorts.
22731
22732 * src/reader.c (user_toknums): Be a short table instead of an int
22733 table.
22734 Adjust dependencies.
22735
22736 Factor the short table outputs.
22737
22738 * src/output.c (output_short_table): New function.
22739 * src/output.c (output_gram, output_stos, output_rule_data)
22740 (output_base, output_table, output_check): Use it.
22741
6c89f1c1
AD
227422000-10-02 Akim Demaille <akim@epita.fr>
22743
22744 * src/output.c (output): Topological sort of the functions, in
22745 order to get rid of the `static' prototypes.
22746 No longer use `register'.
22747 * src/output.h: New file.
22748 Propagate its inclusion in files explicitly prototyping functions
22749 from output.c.
22750
d9efd181
AD
227512000-09-21 Akim Demaille <akim@epita.fr>
22752
22753 * src/atgeneral.m4: Update from Autoconf.
22754
c29240e7 227552000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
22756
22757 * src/closure.h: New file.
22758 * src/closure.c: Formatting changes, topological sort over the
22759 functions, use of closure.h.
22760 (initialize_closure, finalize_closure): Rename as...
22761 (new_closure, free_closure): these. Adjust dependencies.
22762 * src/LR0.c: Formatting changes, topological sort, use of
22763 cloture.h.
22764 (initialize_states): Rename as...
22765 (new_states): this.
22766 * src/Makefile.am (noinst_HEADERS): Adjust.
22767
499daa50
AD
227682000-09-20 Akim Demaille <akim@epita.fr>
22769
22770 * src/acconfig.h: Don't protect config.h against multiple
22771 inclusion.
22772 Don't define PARAMS.
22773 * src/system.h: Define PARAMS.
22774 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
22775 purpose of config.h. system.h must not try to fix wrong
22776 definitions in config.h.
22777
cc84fd5d
AD
227782000-09-20 Akim Demaille <akim@epita.fr>
22779
22780 * src/derives.h: New file.
22781 * src/main.c, src/derives.h: Use it.
22782 Formatting changes.
22783 * src/Makefile.am (noinst_HEADERS): Adjust.
22784
db5b3a89
AD
227852000-09-20 Akim Demaille <akim@epita.fr>
22786
22787 * tests/atgeneral.m4: Update from Autoconf.
22788 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
22789 (AT_CHECK_CALC): New macros.
22790 Use these macros to test bison with options `', `--raw',
22791 `--debug', `--yacc', `--yacc --debug'.
22792
ceed8467
AD
227932000-09-19 Akim Demaille <akim@epita.fr>
22794
22795 * src/output.c: Formatting changes.
22796 * src/machine.h: Remove, leaving its contents in...
22797 * src/system.h: here.
22798 Include stdio.h.
22799 Adjust all dependencies on stdio.h and machine.h.
22800 * src/getargs.h: New file.
22801 Let all `extern' declarations about getargs.c be replaced with
22802 inclusion of `getargs.h'.
22803 * src/Makefile.am (noinst_HEADERS): Adjust.
22804
22805 * tests/calc.m4 (yyin): Be initialized in main, not on the global
22806 scope.
22807 (yyerror): Returns void, not int.
22808 * doc/bison.texinfo: Formatting changes.
22809
05a1d24b
AD
228102000-09-19 Akim Demaille <akim@epita.fr>
22811
22812 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
22813 portable.
22814
cbd25751
AD
228152000-09-18 Akim Demaille <akim@epita.fr>
22816
22817 * configure.in: Append WARNING_CFLAGS to CFLAGS.
22818 * src/Makefile.am (INCLUDES): Don't.
22819 Be ready to fetch headers in lib/.
22820
13863333
AD
228212000-09-18 Akim Demaille <akim@epita.fr>
22822
22823 * doc/bison.texinfo: Update the copyright.
22824 ANSIfy and GNUify the examples.
22825 Remove the old menu.
22826
0d533154
AD
228272000-09-18 Akim Demaille <akim@epita.fr>
22828
22829 First set of tests: use the `calc' example from the documentation.
22830
22831 * src/bison.s1 (yyparse): Condition the code using `yytname' which
22832 is defined only when YYDEBUG is.
22833 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
22834 * src/files.c (tryopen, tryclose): Formatting changes.
22835 Move to the top and be static.
22836 * src/reader.c (read_signed_integer): Likewise.
22837 * tests/calc.m4: New file.
22838 * Makefile.am, suite.m4: Adjust.
22839 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
22840
e79137ac
AD
228412000-09-18 Akim Demaille <akim@epita.fr>
22842
22843 Add support for an Autotest test suite for Bison.
22844
22845 * m4/m4.m4, m4/atconfig.m4: New files.
22846 * m4/Makefile.am (EXTRA_DIST): Adjust.
22847 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
22848 files.
22849 * src/getargs.c: Display a more standard --version message.
22850 * src/reader.c (reader): Formatting changes.
22851 No longer depend upon VERSION_STRING.
22852 * configure.in: No longer use `dnl'.
22853 Set up the test suite and the new directory `tests/.
22854 (VERSION_STRING): Remove.
22855
27821bff
AD
228562000-04-14 Akim Demaille <akim@epita.fr>
22857
22858 * src/reader.c (copy_comment2): New function, same as former
22859 `copy_comment', but outputs into two FILE *.
22860 (copy_comment): Use it.
22861 (parse_union_decl): Use it.
22862 (get_type, parse_start_decl): Use the same `invalid' message.
22863 (parse_start_decl, parse_union_decl): Use the same `multiple'
22864 message.
22865 (parse_union_decl, copy_guard, copy_action): Use the same
22866 `unmatched' message.
22867 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
22868
cfe5fbc0
AD
228692000-03-31 Akim Demaille <akim@epita.fr>
22870
22871 * src/files.c (tryopen, tryclose): Move to the top.
22872 Be static.
22873
cb7db13e
AD
228742000-03-31 Akim Demaille <akim@epita.fr>
22875
22876 * src/main.c (main): Don't call `done', exit does it.
22877
a0f6b076
AD
228782000-03-31 Akim Demaille <akim@epita.fr>
22879
36281465
AD
22880 * allocate.c: s/return (foo)/return foo/.
22881 * lalr.c: Likewise.
22882 * LR0.c: Likewise.
22883 * output.c: Likewise.
22884 * reader.c: Likewise.
22885 * symtab.c: Likewise.
22886 * vmsgetargs.c: Likewise.
22887
228882000-03-31 Akim Demaille <akim@epita.fr>
22889
22890 Clean up the error reporting functions.
a0f6b076
AD
22891
22892 * src/report.c: New file.
22893 * src/report.h: Likewise.
22894 * src/Makefile.am: Adjust.
22895 * m4/error.m4: New file.
22896 * m4/Makefile.am: Adjust.
22897 * configure.in (jm_PREREQ_ERROR): Call it.
22898 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
22899 Remove.
22900 (fatal, fatals): Remove. All callers use complain.c::fatal.
22901 (warn, warni, warns, warnss, warnss): Remove. All callers use
22902 complain.c::complain.
22903 (toomany): Remove, use fatal instead.
22904 * src/files.c (done): No argument, use complain_message_count.
22905 * src/main.c (main): Register `done' to `atexit'.
22906
22907 * src/getargs.c (usage): More `fputs', less `fprintf'.
22908
18539825
AD
229092000-03-28 Akim Demaille <akim@epita.fr>
22910
22911 * lib/: New directory.
22912 * Makefile.am (SUBDIRS): Adjust.
22913 * configure.in: Adjust.
22914 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
22915 useless.
22916 * src/alloca.c: Moved to lib/.
22917 * src/getopt.c: Likewise.
22918 * src/getopt1.c: Likewise.
22919 * src/getopt.h: Likewise.
22920 * src/ansi2knr.c: Likewise.
22921 * src/ansi2knr.1: Likewise.
22922 * src/Makefile.am: Adjust.
22923 * lib/Makefile.am: New file.
22924
9f306f2a
AD
229252000-03-28 Akim Demaille <akim@epita.fr>
22926
22927 * src/getargs.c (usage): Refresh the help message.
22928
0ba347b6
AD
229292000-03-17 Akim Demaille <akim@epita.fr>
22930
22931 * src/getopt1.c: Updated from textutils 2.0e
22932 * src/getopt.c: Likewise.
22933 * src/getopt.h: Likewise.
22934
dbe7f271
AD
229352000-03-17 Akim Demaille <akim@epita.fr>
22936
22937 * src/Makefile.am (bison.simple): Fix the awk program: quote only
22938 the file name, not the whole `#line LINE FILE'.
22939
75bbe78d
AD
229402000-03-17 Akim Demaille <akim@epita.fr>
22941
22942 On syntax errors, report the token on which we choked.
22943
aa5fd0ee
AD
22944 * src/bison.s1 (yyparse): In the label yyerrlab, when
22945 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 22946
7b306f52
AD
229472000-03-17 Akim Demaille <akim@epita.fr>
22948
aa5fd0ee 22949 * src/reader.c (copy_at): New function.
7b306f52
AD
22950 (copy_guard): Use it.
22951 (copy_action): Use it.
22952
e87b5700
AD
229532000-03-17 Akim Demaille <akim@epita.fr>
22954
22955 Be kind to translators, save some useless translations.
22956
aa5fd0ee 22957 * src/main.c (banner): New function.
e87b5700
AD
22958 (fatal_banner): Use it.
22959 (warn_banner): Use it.
22960
ae3c3164
AD
229612000-03-17 Akim Demaille <akim@epita.fr>
22962
aa5fd0ee
AD
22963 * src/reader.c (copy_definition): Use copy_string and
22964 copy_comment. Removed now unused `match', `ended',
22965 `cplus_comment'.
ae3c3164
AD
22966 (copy_comment, copy_string): Moved, to be visible from
22967 copy_definition.
22968
4dc58e7c
AD
229692000-03-17 Akim Demaille <akim@epita.fr>
22970
aa5fd0ee
AD
22971 * src/reader.c (copy_string): Declare `static inline'. No
22972 problems with inline, since it is checked by configure.
4dc58e7c
AD
22973 (copy_comment): Likewise.
22974
0a6384c4
AD
229752000-03-17 Akim Demaille <akim@epita.fr>
22976
aa5fd0ee 22977 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 22978
3cef001a
AD
229792000-03-17 Akim Demaille <akim@epita.fr>
22980
aa5fd0ee 22981 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
22982 (copy_action): Use it. Removed now unused `match', `ended',
22983 `cplus_comment'.
22984 (copy_guard): Likewise.
22985
ca36d2ef
AD
229862000-03-17 Akim Demaille <akim@epita.fr>
22987
aa5fd0ee 22988 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
22989 (copy_action): Use it.
22990 (copy_guard): Likewise.
22991
6666f98f
AD
229922000-03-17 Akim Demaille <akim@epita.fr>
22993
22994 Change the handling of @s so that they behave exactly like $s.
22995 There is now a pseudo variable @$ (readble and writable), location
22996 of the lhs of the rule (by default ranging from the location of
22997 the first symbol of the rhs, to the location of the last symbol,
22998 or, if the rhs is empty, YYLLOC).
22999
23000 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
23001 yyval.
23002 (yyparse): When providing a default semantic action, provide a
23003 default location action.
23004 (after the $): No longer change `*YYLSP', just stack YYLOC the
23005 same way you stack YYVAL.
23006 * src/reader.c (read_declarations): Use warns.
23007 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
23008 (copy_action, case '@'): Likewise.
23009 Use a standard error message, to save useless work from
23010 translators.
23011
41aca2e0
AD
230122000-03-17 Akim Demaille <akim@epita.fr>
23013
aa5fd0ee
AD
23014 * src/bison.s1: Formatting and cosmetics changes.
23015 * src/reader.c: Likewise.
41aca2e0
AD
23016 Update the Copyright notice.
23017
dc08c1d5
AD
230182000-03-17 Akim Demaille <akim@epita.fr>
23019
aa5fd0ee
AD
23020 * src/bison.s1 (#line): All set to `#line' only, since the
23021 Makefile now handles them.
dc08c1d5 23022
9ee3c97b
AD
230232000-03-16 Akim Demaille <akim@epita.fr>
23024
23025 * src/output.c (output_rule_data): Output the documentation of
23026 some of the tables.
23027 (Copyright notice): Update.
23028 Formatting changes.
23029
0de741ca
AD
230302000-03-16 Akim Demaille <akim@epita.fr>
23031
23032 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
23033 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
23034 One `#if YYDEBUG' remains, since it uses variables which are
23035 defined only if `YYDEBUG != 0'.
23036
bb10be54
AD
230372000-03-16 Akim Demaille <akim@epita.fr>
23038
23039 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
23040 and related variables so that the similarities are highlighted.
23041
b07b484a
AD
230422000-03-16 Akim Demaille <akim@epita.fr>
23043
23044 * src/bison.s1: Properly indent CPP directives.
23045
361f60b3
AD
230462000-03-16 Akim Demaille <akim@epita.fr>
23047
23048 * src/bison.s1: Properly indent the `alloca' CPP section.
23049
8c44d3ec
AD
230502000-03-16 Akim Demaille <akim@epita.fr>
23051
23052 Do not hard code values of directories in `configure.in'.
23053 Update the `configure' tool chain.
23054
23055 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
23056 src/makefile.am.
23057 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
23058 (AC_OUTPUT): Add m4/Makefile.
23059 Bump to bison 1.28a, 1.29 has never been released.
23060 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
23061 handled via src/Makefile.am.
23062 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
23063 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
23064 autoheader.
23065 * Makefile.am (SUBDIRS): Add m4.
23066 (ACLOCAL_AM_FLAGS): New variable.
23067 (AUTOMAKE_OPTIONS): Add check-news.
23068 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
23069 the proper line number and file name.
23070 (DEFS): Propagate the location of bison library files and of the
23071 locale files.
23072 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
23073 builddir.
23074 * acinclude.m4: Remove, replaced by the directory m4.
23075 * m4/Makefile.am (EXTRA_DIST): New variable.
23076 * m4/gettext.m4: New file, from the fileutils.
23077 * m4/lcmessage.m4: Likewise
23078 * m4/progtest.m4: Likewise.
23079 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
23080
f95997e7
AD
230812000-03-10 Akim Demaille <akim@epita.fr>
23082
23083 * src/closure.c:
23084 Formatting changes of various comments.
23085 Respect the GNU coding standards at various places.
23086 Don't use `_()' when no translation is needed.
23087
230881999-12-13 Jesse Thilo <jthilo@gnu.org>
23089
23090 * src/files.c:
23091 OS/2 honors TMPDIR environment variable.
23092
230931999-12-13 Jesse Thilo <jthilo@gnu.org>
23094
23095 * doc/bison.texinfo: Tweaked spelling and grammar.
23096 Updated ISBN.
23097 Removed reference to price of printed copy.
23098 Mention BISON_SIMPLE and BISON_HAIRY.
23099
231001999-12-13 Jesse Thilo <jthilo@gnu.org>
23101
23102 * configure.in, NEWS:
23103 Bison 1.29 released.
23104
231051999-10-27 Jesse Thilo <jthilo@gnu.org>
23106
23107 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
23108 Added reference card.
23109
231101999-07-26 Jesse Thilo <jthilo@gnu.org>
23111
23112 * po/ru.po: Added Russian translation.
23113
231141999-07-26 Jesse Thilo <jthilo@gnu.org>
23115
23116 * configure.in: Added Russian translation.
23117
231181999-07-06 Jesse Thilo <jthilo@gnu.org>
23119
23120 * configure.in, NEWS, README:
23121 Released version 1.28.
23122
231231999-06-14 Jesse Thilo <jthilo@gnu.org>
23124
23125 * src/system.h:
23126 Squashed redefinition warning on some systems.
23127
23128 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
23129 Have configure build version string instead of relying on ANSI string
23130 concatentation.
23131
231321999-06-14 Jesse Thilo <jthilo@gnu.org>
23133
23134 * po/POTFILES.in: Got rid of version.c.
23135
231361999-06-14 Jesse Thilo <jthilo@gnu.org>
23137
23138 * acconfig.h, configure.in:
23139 Have configure build version string instead of relying on ANSI string
23140 concatentation.
23141
231421999-06-08 Jesse Thilo <jthilo@gnu.org>
23143
23144 * doc/bison.1:
23145 Dropped mention of `+' for long-named options.
23146
231471999-05-30 Jesse Thilo <jthilo@gnu.org>
23148
23149 * src/files.c: Added <unistd.h> for unlink().
23150
23151 * src/Makefile.am, src/system.h:
23152 I18n fixes.
23153
231541999-05-30 Jesse Thilo <jthilo@gnu.org>
23155
23156 * README: Added a FAQ list.
23157
23158 * configure.in, acconfig.h:
23159 I18n fixes.
23160
231611999-05-30 Jesse Thilo <jthilo@gnu.org>
23162
23163 * doc/FAQ, doc/Makefile.am:
23164 Added a FAQ list.
23165
231661999-05-19 Jesse Thilo <jthilo@gnu.org>
23167
23168 * src/alloc.h, src/symtab.h, src/version.c:
23169 Protected inclusion of "config.h" with HAVE_CONFIG_H.
23170
231711999-04-18 Jesse Thilo <jthilo@gnu.org>
23172
23173 * src/.cvsignore, src/Makefile.am:
23174 Reorganized: sources in `src', documentation in `doc'.
23175
23176 * src/lex.c (literalchar):
23177 fixed the code for escaping double quotes (thanks
23178 Jonathan Czisny.)
23179
231801999-04-18 Jesse Thilo <jthilo@gnu.org>
23181
23182 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
23183 Adjusted paths to reflect directory reorganization.
23184
231851999-04-18 Jesse Thilo <jthilo@gnu.org>
23186
23187 * doc/.cvsignore, doc/Makefile.am:
23188 Reorganized: sources in `src', documentation in `doc'.
23189
231901999-04-18 Jesse Thilo <jthilo@gnu.org>
23191
23192 * configure.in:
23193 Updated AC_INIT file to reflect directory reorganization.
23194
23195 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
23196 Reorganized: sources in `src', documentation in `doc'.
23197
231981999-04-13 Jesse Thilo <jthilo@gnu.org>
23199
23200 * src/allocate.c:
23201 Don't declare calloc() and realloc() if not necessary.
23202
232031999-04-13 Jesse Thilo <jthilo@gnu.org>
23204
23205 * configure.in, acconfig.h, acinclude.m4:
23206 Don't declare calloc() and realloc() if not necessary.
23207
232081999-03-23 Jesse Thilo <jthilo@gnu.org>
23209
23210 * po/.cvsignore: Added i18n support.
23211
232121999-03-23 Jesse Thilo <jthilo@gnu.org>
23213
23214 * acconfig.h, configure.in, Makefile.am:
23215 Added i18n support.
23216
232171999-03-22 Jesse Thilo <jthilo@gnu.org>
23218
23219 * src/bison.s1: Fixed #line numbers.
23220
232211999-03-15 Jesse Thilo <jthilo@gnu.org>
23222
23223 * po/es.po, po/fr.po, po/nl.po, po/de.po:
23224 Added PO files from Translation Project.
23225
232261999-03-03 Jesse Thilo <jthilo@gnu.org>
23227
23228 * Makefile.am:
23229 Added support for non-ANSI compilers (ansi2knr).
23230
232311999-02-16 Jesse Thilo <jthilo@gnu.org>
23232
23233 * configure.in: Bumped version number to 1.27.
23234
23235 * Makefile.am:
23236 Added `bison.simple' to list of files removed by `make distclean'.
23237
232381999-02-12 Jesse Thilo <jthilo@gnu.org>
23239
23240 * src/files.c, src/files.h:
23241 Defined locations of parser files in config.h instead of Makefile.
23242
232431999-02-12 Jesse Thilo <jthilo@gnu.org>
23244
23245 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
23246 Defined locations of parser files in config.h instead of Makefile.
23247
232481999-02-09 Jesse Thilo <jthilo@gnu.org>
23249
23250 * Makefile.am:
23251 Removed inappropriate use of $< macro.
23252
232531999-02-05 Jesse Thilo <jthilo@gnu.org>
23254
23255 * po/Makefile.in.in, po/POTFILES.in:
23256 Add `po' directory skeleton.
23257
232581999-01-27 Jesse Thilo <jthilo@gnu.org>
23259
23260 * README: Document help-bison list.
23261
23262 * configure.in: Add check for mkstemp().
23263
232641999-01-20 Jesse Thilo <jthilo@gnu.org>
23265
23266 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
23267 Hush a few compiler warnings.
23268
23269 * src/files.c:
23270 Add tryclose(), which verifies that fclose was successful.
23271 Hush a couple of compiler warnings.
23272
232731999-01-20 Jesse Thilo <jthilo@gnu.org>
23274
23275 * Makefile.am, OChangeLog:
23276 ChangeLog is now automatically generated. Include the old version as
23277 OChangeLog.
23278
232791999-01-14 Jesse Thilo <jthilo@gnu.org>
23280
23281 * 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:
23282 Update FSF address.
23283
232841999-01-14 Jesse Thilo <jthilo@gnu.org>
23285
23286 * doc/bison.texinfo: Fix formatting glitch.
23287
23288 * doc/bison.texinfo: Update FSF address.
23289
232901999-01-14 Jesse Thilo <jthilo@gnu.org>
23291
23292 * acconfig.h: Update FSF address.
23293
232941999-01-08 Jesse Thilo <jthilo@gnu.org>
23295
23296 * src/system.h:
23297 Don't define PACKAGE here, since config.h defines it.
23298
232991998-12-30 Jesse Thilo <jthilo@gnu.org>
23300
23301 * src/reader.c: Update copyright date.
23302
23303 * src/main.c:
23304 Ditch sprintf to statically-sized buffers in fatal/warn functions in
23305 favor of output directly to stderr (avoids buffer overruns).
23306
23307 * src/reader.c: Some checks for premature EOF.
23308
23309 * 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:
23310 Use prototypes if the compiler understands them.
23311
23312 * src/files.c: Honor TMPDIR on Unix hosts.
23313 Use prototypes if the compiler understands them.
23314
23315 * src/reader.c:
23316 Fix a couple of buffer overrun bugs.
23317 Use prototypes if the compiler understands them.
23318
23319 * src/system.h: Include unistd.h and ctype.h.
23320 Use #ifdef instead of #if for NLS symbols.
23321
233221998-12-30 Jesse Thilo <jthilo@gnu.org>
23323
23324 * doc/bison.texinfo:
23325 Delete comment "consider using @set for edition number, etc..." since
23326 we now are doing so.
23327
233281998-12-30 Jesse Thilo <jthilo@gnu.org>
23329
23330 * configure.in:
23331 Use prototypes if the compiler understands them.
23332
23333 * NEWS: Document 1.26 highlights.
23334
23335 * Makefile.am: Require Automake 1.3 or later.
23336
23337 * acconfig.h:
23338 Use prototypes if the compiler understands them.
23339
233401998-12-29 Jesse Thilo <jthilo@gnu.org>
23341
23342 * src/version.c:
23343 Use VERSION symbol from automake for version number.
23344
233451998-12-29 Jesse Thilo <jthilo@gnu.org>
23346
23347 * acconfig.h, configure.in, version.cin:
23348 Use VERSION symbol from automake for version number.
23349
233501998-11-28 Jesse Thilo <jthilo@gnu.org>
23351
23352 * Makefile.am:
23353 Distribute original version of simple parser (bison.s1), not built
23354 version (bison.simple).
23355
233561998-11-28 Jesse Thilo <jthilo@gnu.org>
23357
23358 * doc/bison.texinfo: Add info dir entry.
23359
23360 * doc/bison.texinfo:
23361 Let automake put version number into documentation.
23362
233631998-11-26 Jesse Thilo <jthilo@gnu.org>
23364
23365 * src/bison.cld, src/build.com, src/vmshlp.mar:
23366 Add non-RCS files from /gd/gnu/bison.
23367
233681998-11-26 Jesse Thilo <jthilo@gnu.org>
23369
23370 * doc/bison.1:
23371 Document the BISON_HAIRY and BISON_SIMPLE variables.
23372
233731998-11-25 Jesse Thilo <jthilo@gnu.org>
23374
23375 * src/version.c: Build version.c automatically.
23376
23377 * src/reader.c:
23378 Fix token numbering (used to start at 258, not 257).
23379
23380 * src/system.h: Include config.h.
23381
23382 * src/getargs.c: Update bug report address.
23383
23384 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
23385 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
23386
233871998-11-25 Jesse Thilo <jthilo@gnu.org>
23388
23389 * Makefile.am:
23390 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
23391
23392 * configure.in, version.cin:
23393 Build version.c automatically.
23394
23395 * AUTHORS: Add AUTHORS file.
23396
23397 * README: Update bug report address.
23398
23399 * bison.simple:
23400 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
23401
23402 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
23403 Add automake stuff.
23404
234051998-11-25 Jesse Thilo <jthilo@gnu.org>
23406
23407 * doc/bison.texinfo: Clean up some formatting.
23408
234091998-05-05 Richard Stallman <rms@gnu.org>
23410
23411 * doc/bison.texinfo:
23412 Explain better why to make a pure parser.
23413
234141998-01-05 Richard Stallman <rms@gnu.org>
23415
23416 * src/files.c (openfiles):
23417 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
23418 find a temporary directory, if possible. Do not unlink files while
23419 they are open.
23420
234211997-08-25 Richard Stallman <rms@gnu.org>
23422
23423 * src/reader.c (stack_offset;):
23424 Change some warni to warns.
23425
23426 * src/lex.c (literalchar): Use warns, not warni.
23427
234281997-06-28 Richard Stallman <rms@gnu.org>
23429
23430 * src/bison.s1: Add a Bison version comment.
23431
23432 * src/main.c (fatal, warn, berror):
23433 Use program_name.
23434
234351997-06-28 Richard Stallman <rms@gnu.org>
23436
23437 * Makefile.in (bison_version): New variable.
23438 (dist): Use that variable.
23439 (bison.s1): Substitute the Bison version into bison.simple.
23440
23441 * bison.simple: Add a Bison version comment.
23442
234431997-06-18 Richard Stallman <rms@gnu.org>
23444
23445 * src/main.c (fatal, warn, berror):
23446 Make error messages standard.
23447 (toomany): Improve error message text.
23448
23449 * 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:
23450 new.h renamed to alloc.h.
23451
234521997-06-18 Richard Stallman <rms@gnu.org>
23453
23454 * Makefile.in: new.h renamed to alloc.h.
23455
234561997-05-24 Richard Stallman <rms@gnu.org>
23457
23458 * src/lex.c (literalchar):
23459 Fix the code for escaping \, " and '.
23460
23461 (lex): Avoid trouble when there are many chars
23462 to discard in a char literal with just several chars in it.
23463
234641997-05-17 Richard Stallman <rms@gnu.org>
23465
23466 * src/bison.s1:
23467 Use malloc, if using alloca is troublesome.
23468 (YYSTACK_USE_ALLOCA): New flag macro.
23469 Define it for some systems and compilers.
23470 (YYSTACK_ALLOC): New macro.
23471 (yyparse): Use YYSTACK_ALLOC to allocate stack.
23472 If it was malloc'd, free it.
23473
234741997-05-17 Richard Stallman <rms@gnu.org>
23475
23476 * bison.simple:
23477 Use malloc, if using alloca is troublesome.
23478 (YYSTACK_USE_ALLOCA): New flag macro.
23479 Define it for some systems and compilers.
23480 (YYSTACK_ALLOC): New macro.
23481 (yyparse): Use YYSTACK_ALLOC to allocate stack.
23482 If it was malloc'd, free it.
23483
234841997-04-23 Richard Stallman <rms@gnu.org>
23485
23486 * src/bison.s1:
23487 (alloca) [__hpux]: Always define as __builtin_alloca.
23488
234891997-04-23 Richard Stallman <rms@gnu.org>
23490
23491 * bison.simple:
23492 (alloca) [__hpux]: Always define as __builtin_alloca.
23493
234941997-04-22 Richard Stallman <rms@gnu.org>
23495
23496 * src/bison.s1:
23497 [__hpux]: Include alloca.h (right for HPUX 10)
23498 instead of declaring alloca (right for HPUX 9).
23499
23500 * src/bison.s1 (__yy_memcpy):
23501 Declare arg `count' as unsigned int.
23502 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
23503
235041997-04-22 Richard Stallman <rms@gnu.org>
23505
23506 * bison.simple:
23507 [__hpux]: Include alloca.h (right for HPUX 10)
23508 instead of declaring alloca (right for HPUX 9).
23509
23510 * bison.simple (__yy_memcpy):
23511 Declare arg `count' as unsigned int.
23512 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
23513
235141997-01-03 Richard Stallman <rms@gnu.org>
23515
23516 * src/allocate.c: [__STDC__ or _MSC_VER]:
23517 Declare calloc and realloc to return void *.
23518
235191997-01-02 Richard Stallman <rms@gnu.org>
23520
23521 * src/system.h:
23522 [_MSC_VER]: Include stdlib.h and process.h.
23523 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
23524
23525 * src/main.c (main): Return FAILURE as a value.
23526 (printable_version): Declare arg as int, not char.
23527
235281997-01-02 Richard Stallman <rms@gnu.org>
23529
23530 * Makefile.in (dist):
23531 Explicitly check for symlinks, and copy them.
23532
235331996-12-19 Richard Stallman <rms@gnu.org>
23534
23535 * src/files.c:
23536 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
23537
235381996-12-18 Paul Eggert <eggert@gnu.org>
23539
23540 * src/bison.s1 (yyparse):
23541 If __GNUC__ and YYPARSE_PARAM are both defined,
23542 declare yyparse to have a void * argument.
23543
235441996-12-18 Paul Eggert <eggert@gnu.org>
23545
23546 * bison.simple (yyparse):
23547 If __GNUC__ and YYPARSE_PARAM are both defined,
23548 declare yyparse to have a void * argument.
23549
235501996-12-17 Richard Stallman <rms@gnu.org>
23551
23552 * src/reduce.c (nbits): Add some casts.
23553
235541996-08-12 Richard Stallman <rms@gnu.org>
23555
23556 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
23557
235581996-08-12 Richard Stallman <rms@gnu.org>
23559
23560 * bison.simple: Test _MSDOS as well as _MSDOS_.
23561
235621996-07-31 Richard Stallman <rms@gnu.org>
23563
23564 * src/bison.s1:
23565 [__sun && __i386]: Include alloca.h.
23566
235671996-07-31 Richard Stallman <rms@gnu.org>
23568
23569 * bison.simple:
23570 [__sun && __i386]: Include alloca.h.
23571
235721996-07-30 Richard Stallman <rms@gnu.org>
23573
23574 * src/bison.s1: Comment change.
23575
23576 * src/bison.s1: Test _MSDOS_, not MSDOS.
23577
235781996-07-30 Richard Stallman <rms@gnu.org>
23579
23580 * bison.simple: Comment change.
23581
23582 * bison.simple: Test _MSDOS_, not MSDOS.
23583
235841996-06-01 Richard Stallman <rms@gnu.org>
23585
23586 * 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:
23587 Insert `_' macro around many string constants.
23588
23589 * src/main.c:
23590 Insert `_' macro around many string constants.
23591
23592 (main): Call setlocale, bindtextdomain and textdomain.
23593
23594 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
23595 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
23596 [ENABLE_NLS]: Include libintl.h.
23597 [ENABLE_NLS] (gettext): Define.
23598 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
23599 (N_, PACKAGE, LOCALEDIR): New macros.
23600
236011996-06-01 Richard Stallman <rms@gnu.org>
23602
23603 * POTFILES.in: New file.
23604
23605 * Makefile.in (allocate.o):
23606 Define target explicitly.
23607
23608 * Makefile.in (CFLAGS): Set to @CFLAGS@.
23609 (LDFLAGS): Set to @LDFLAGS@.
23610 (configure): Run autoconf only if preceding `cd' succeeds.
23611 (bison.s1): Redirect output to temporary file then move the
23612 temporary to the target, rather than redirecting directly to bison.s1.
23613 (clean): Remove config.status and config.log.
23614 (distclean): Don't remove config.status here.
23615
236161996-05-12 Richard Stallman <rms@gnu.org>
23617
23618 * src/bison.s1:
23619 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
23620
236211996-05-12 Richard Stallman <rms@gnu.org>
23622
23623 * bison.simple:
23624 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
23625
236261996-05-11 Richard Stallman <rms@gnu.org>
23627
23628 * src/bison.s1 (__yy_memcpy):
23629 Really reorder the args, as was supposedly done on Feb 14 1995.
23630 (yyparse): Calls changed accordingly.
23631
236321996-05-11 Richard Stallman <rms@gnu.org>
23633
23634 * Makefile.in (dist): Don't use $(srcdir).
23635
23636 * bison.simple (__yy_memcpy):
23637 Really reorder the args, as was supposedly done on Feb 14 1995.
23638 (yyparse): Calls changed accordingly.
23639
236401996-01-27 Richard Stallman <rms@gnu.org>
23641
23642 * src/output.c (output_rule_data):
23643 Test YYERROR_VERBOSE in the conditional
23644 around the definition of ttyname.
23645
236461995-12-29 Richard Stallman <rms@gnu.org>
23647
23648 * src/bison.s1:
23649 Fix line numbers in #line commands.
23650
236511995-12-29 Richard Stallman <rms@gnu.org>
23652
23653 * bison.simple:
23654 Fix line numbers in #line commands.
23655
236561995-12-27 Richard Stallman <rms@gnu.org>
23657
23658 * src/bison.s1 (YYPARSE_PARAM_DECL):
23659 In C++, make it always null.
23660 (YYPARSE_PARAM_ARG): New macro.
23661 (yyparse): Use YYPARSE_PARAM_ARG.
23662
236631995-12-27 Richard Stallman <rms@gnu.org>
23664
23665 * bison.simple (YYPARSE_PARAM_DECL):
23666 In C++, make it always null.
23667 (YYPARSE_PARAM_ARG): New macro.
23668 (yyparse): Use YYPARSE_PARAM_ARG.
23669
236701995-11-29 Richard Stallman <rms@gnu.org>
23671
23672 * doc/bison.texinfo:
23673 Describe literal string tokens, %raw, %no_lines, %token_table.
23674
236751995-11-29 Daniel Hagerty <hag@gnu.org>
23676
23677 * doc/bison.texinfo: Fixed update date
23678
236791995-10-16 Richard Stallman <rms@gnu.org>
23680
23681 * src/version.c: Version 1.25.
23682
236831995-10-16 Richard Stallman <rms@gnu.org>
23684
23685 * NEWS: *** empty log message ***
23686
236871995-10-16 Richard Stallman <rms@gnu.org>
23688
23689 * doc/bison.1, doc/bison.rnh:
23690 Add new options.
23691
236921995-10-15 Richard Stallman <rms@gnu.org>
23693
23694 * src/vmsgetargs.c, src/getargs.c:
23695 Added -n, -k, and -raw switches.
23696 (noparserflag, toknumflag, rawtoknumflag): New variables.
23697
23698 * src/symtab.h (SALIAS):
23699 New #define for adding aliases to %token.
23700 (struct bucket): Added `alias' field.
23701
23702 * src/reduce.c (reduce_grammar):
23703 Revise error message.
23704 (print_notices): Remove final `.' from error message.
23705
23706 * src/reader.c (reader_output_yylsp):
23707 New function.
23708 (readgram): Use `#if 0' around code that accepted %command
23709 inside grammar rules: The documentation doesn't allow it,
23710 and it will fail since the %command processors scan for the next %.
23711 (parse_token_decl): Extended the %token
23712 declaration to allow a multi-character symbol as an alias.
23713 (parse_thong_decl): New function.
23714 (read_declarations): Added %thong declarations.
23715 (read_declarations): Handle NOOP to deal with allowing
23716 % declarations as another means to specify the flags.
23717 (readgram): Allow %prec prior to semantics embedded in a rule.
23718 (skip_to_char, read_declarations, copy_definition)
23719 (parse_token_decl, parse_start_decl, parse_type_decl)
23720 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
23721 (get_type_name, copy_guard, copy_action, readgram)
23722 (get_type, packsymbols): Revised most error messages.
23723 Changed `fatal' to `warnxxx' to avoid aborting for error.
23724 Revised and use multiple warnxxx functions to avoid using VARARGS1.
23725 (read_declarations): Improve the error message for
23726 an invalid character. Do not abort.
23727 (read_declarations, copy_guard, copy_action): Use
23728 printable_version to avoid unprintable characters in printed output.
23729 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
23730 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
23731 Allow the type of a non-terminal can be given
23732 more than once, as long as all specifications give the same type.
23733
23734 * src/output.c:
23735 (output_headers, output_trailers, output, output_gram)
23736 (output_rule_data): Implement noparserflag variable.
23737 Implement toknumflag variable.
23738 (output): Call reader_output_yylsp to output LTYPESTR.
23739
23740 * src/main.c (main):
23741 If reader sees an error, don't process the grammar.
23742 (fatals): Updated to not use VARARGS1.
23743 (printable_version, int_to_string, warn, warni, warns, warnss)
23744 (warnsss): New error reporting functions. Avoid abort for error.
23745
23746 * src/lex.h:
23747 Added THONG and NOOP for alias processing.
23748 Added SETOPT for the new code that allows setting options with %flags.
23749
23750 * src/lex.c:
23751 Include getopt.h. Add some extern decls.
23752 (safegetc): New function to deal with EOF gracefully.
23753 (literalchar); new function to deal with reading \ escapes.
23754 (lex): Use literalchar.
23755 (lex): Implemented "..." tokens.
23756 (literalchar, lex, parse_percent_token): Made tokenbuffer
23757 always contain the token. This includes growing the token
23758 buffer while reading an integer.
23759 (parse_percent_token): Replaced if-else statement with percent_table.
23760 (parse_percent_token): Added % declarations as another
23761 way to specify the flags -n, -l, and -r. Also added hooks for
23762 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
23763 major changes to files.c.
23764 (lex) Retain in the incoming stream a character following
23765 an incorrect '/'.
23766 (skip_white_space, lex): Revised most error messages
23767 and changed fatal to warn to avoid aborting.
23768 (percent_table): Added %thong declarations.
23769
23770 * src/gram.h: Comment changes.
23771
23772 * src/files.c (openfiles, open_extra_files, done):
23773 Add faction flag
23774 and actfile file. Handle noparserflag. Both for -n switch.
23775
23776 * src/conflicts.c (resolve_sr_conflict):
23777 Remove use of alloca.
23778
237791995-06-01 Jim Meyering <meyering@gnu.org>
23780
23781 * doc/bison.texinfo: *** empty log message ***
23782
237831995-05-06 Richard Stallman <rms@gnu.org>
23784
23785 * src/bison.s1: Comment change.
23786
237871995-05-06 Richard Stallman <rms@gnu.org>
23788
23789 * bison.simple: Comment change.
23790
237911995-05-03 Richard Stallman <rms@gnu.org>
23792
23793 * src/version.c: Version now 1.24.
23794
23795 * src/bison.s1: Change distribution terms.
23796
23797 * src/version.c: Version now 1.23.
23798
237991995-05-03 Richard Stallman <rms@gnu.org>
23800
23801 * doc/bison.texinfo:
23802 Rewrite "Conditions for Using Bison".
23803 Update version to 1.24.
23804
238051995-05-03 Richard Stallman <rms@gnu.org>
23806
23807 * bison.simple: Change distribution terms.
23808
238091995-02-23 Richard Stallman <rms@gnu.org>
23810
23811 * src/files.c: Test __VMS_POSIX as well as VMS.
23812
238131995-02-14 Jim Meyering <meyering@gnu.org>
23814
23815 * src/bison.s1 (__yy_memcpy):
23816 Renamed from __yy_bcopy to avoid
23817 confusion. Reverse FROM and TO arguments to be consistent with
23818 those of memcpy.
23819
238201995-02-14 Jim Meyering <meyering@gnu.org>
23821
23822 * bison.simple (__yy_memcpy):
23823 Renamed from __yy_bcopy to avoid
23824 confusion. Reverse FROM and TO arguments to be consistent with
23825 those of memcpy.
23826
238271994-11-10 David J. MacKenzie <djm@gnu.org>
23828
23829 * NEWS: reformat
23830
23831 * NEWS: New file.
23832
23833 * Makefile.in (DISTFILES): Include NEWS.
23834
23835 * Makefile.in (DISTFILES):
23836 Include install-sh, not install.sh.
23837
23838 * configure.in: Update to Autoconf v2 macro names.
23839
238401994-10-05 David J. MacKenzie <djm@gnu.org>
23841
23842 * Makefile.in: fix typo
23843
23844 * Makefile.in (prefix, exec_prefix):
23845 Let configure set them.
23846
238471994-09-28 David J. MacKenzie <djm@gnu.org>
23848
23849 * Makefile.in: Set datadir to $(prefix)/share.
23850
238511994-09-15 Richard Stallman <rms@gnu.org>
23852
23853 * src/bison.s1:
23854 Update copyright notice and GPL version.
23855
238561994-09-15 Richard Stallman <rms@gnu.org>
23857
23858 * bison.simple:
23859 Update copyright notice and GPL version.
23860
238611994-07-12 Richard Stallman <rms@gnu.org>
23862
23863 * src/reduce.c, src/reader.c:
23864 entered into RCS
23865
238661994-05-05 David J. MacKenzie <djm@gnu.org>
23867
23868 * Makefile.in: entered into RCS
23869
238701994-03-26 Richard Stallman <rms@gnu.org>
23871
23872 * src/bison.s1: entered into RCS
23873
238741994-03-26 Richard Stallman <rms@gnu.org>
23875
23876 * bison.simple: entered into RCS
23877
238781994-03-25 Richard Stallman <rms@gnu.org>
23879
23880 * src/main.c: entered into RCS
23881
238821994-03-24 Richard Stallman <rms@gnu.org>
23883
23884 * src/conflicts.c: entered into RCS
23885
238861994-01-02 Richard Stallman <rms@gnu.org>
23887
23888 * Makefile.in: *** empty log message ***
23889
238901993-11-21 Richard Stallman <rms@gnu.org>
23891
23892 * src/bison.s1: *** empty log message ***
23893
238941993-11-21 Richard Stallman <rms@gnu.org>
23895
23896 * doc/bison.texinfo: entered into RCS
23897
23898 * doc/bison.texinfo: *** empty log message ***
23899
239001993-11-21 Richard Stallman <rms@gnu.org>
23901
23902 * bison.simple: *** empty log message ***
23903
239041993-10-25 David J. MacKenzie <djm@gnu.org>
23905
23906 * doc/bison.texinfo: *** empty log message ***
23907
239081993-10-19 Richard Stallman <rms@gnu.org>
23909
23910 * src/bison.s1: *** empty log message ***
23911
239121993-10-19 Richard Stallman <rms@gnu.org>
23913
23914 * bison.simple: *** empty log message ***
23915
239161993-10-14 Richard Stallman <rms@gnu.org>
23917
23918 * src/bison.s1: *** empty log message ***
23919
239201993-10-14 Richard Stallman <rms@gnu.org>
23921
23922 * bison.simple: *** empty log message ***
23923
239241993-09-14 David J. MacKenzie <djm@gnu.org>
23925
23926 * doc/bison.texinfo: *** empty log message ***
23927
239281993-09-13 Noah Friedman <friedman@gnu.org>
23929
23930 * Makefile.in: *** empty log message ***
23931
239321993-09-10 Richard Stallman <rms@gnu.org>
23933
23934 * src/conflicts.c: *** empty log message ***
23935
23936 * src/system.h: entered into RCS
23937
239381993-09-10 Richard Stallman <rms@gnu.org>
23939
23940 * doc/bison.1: entered into RCS
23941
239421993-09-06 Noah Friedman <friedman@gnu.org>
23943
23944 * src/version.c: entered into RCS
23945
239461993-09-06 Noah Friedman <friedman@gnu.org>
23947
23948 * Makefile.in: *** empty log message ***
23949
239501993-07-30 David J. MacKenzie <djm@gnu.org>
23951
23952 * Makefile.in: *** empty log message ***
23953
239541993-07-24 Richard Stallman <rms@gnu.org>
23955
23956 * src/bison.s1: *** empty log message ***
23957
239581993-07-24 Richard Stallman <rms@gnu.org>
23959
23960 * bison.simple: *** empty log message ***
23961
239621993-07-08 David J. MacKenzie <djm@gnu.org>
23963
23964 * Makefile.in: *** empty log message ***
23965
239661993-07-04 Richard Stallman <rms@gnu.org>
23967
23968 * src/bison.s1: *** empty log message ***
23969
239701993-07-04 Richard Stallman <rms@gnu.org>
23971
23972 * bison.simple: *** empty log message ***
23973
239741993-06-26 David J. MacKenzie <djm@gnu.org>
23975
23976 * src/getargs.c: entered into RCS
23977
239781993-06-26 David J. MacKenzie <djm@gnu.org>
23979
23980 * doc/bison.texinfo: *** empty log message ***
23981
23982 * doc/bison.1: New file.
23983
239841993-06-25 Richard Stallman <rms@gnu.org>
23985
23986 * src/getargs.c: New file.
23987
239881993-06-16 Richard Stallman <rms@gnu.org>
23989
23990 * src/bison.s1: *** empty log message ***
23991
239921993-06-16 Richard Stallman <rms@gnu.org>
23993
23994 * bison.simple: *** empty log message ***
23995
239961993-06-03 Richard Stallman <rms@gnu.org>
23997
23998 * src/bison.s1: New file.
23999
240001993-06-03 Richard Stallman <rms@gnu.org>
24001
24002 * doc/bison.texinfo: *** empty log message ***
24003
240041993-06-03 Richard Stallman <rms@gnu.org>
24005
24006 * bison.simple: New file.
24007
240081993-05-19 Richard Stallman <rms@gnu.org>
24009
24010 * doc/bison.texinfo: New file.
24011
240121993-05-07 Noah Friedman <friedman@gnu.org>
24013
24014 * Makefile.in: *** empty log message ***
24015
240161993-04-28 Noah Friedman <friedman@gnu.org>
24017
24018 * src/reader.c: *** empty log message ***
24019
240201993-04-23 Noah Friedman <friedman@gnu.org>
24021
24022 * src/alloc.h: entered into RCS
24023
240241993-04-20 David J. MacKenzie <djm@gnu.org>
24025
24026 * src/version.c: *** empty log message ***
24027
24028 * src/files.c, src/allocate.c:
24029 entered into RCS
24030
24031 * src/reader.c: *** empty log message ***
24032
24033 * src/lex.c: entered into RCS
24034
24035 * src/conflicts.c: New file.
24036
24037 * src/symtab.c: entered into RCS
24038
24039 * src/alloc.h: New file.
24040
24041 * src/LR0.c: entered into RCS
24042
240431993-04-18 Noah Friedman <friedman@gnu.org>
24044
24045 * src/reader.c: New file.
24046
24047 * src/version.c: *** empty log message ***
24048
240491993-04-18 Noah Friedman <friedman@gnu.org>
24050
24051 * Makefile.in: *** empty log message ***
24052
240531993-04-17 Noah Friedman <friedman@gnu.org>
24054
24055 * Makefile.in: *** empty log message ***
24056
240571993-04-15 Richard Stallman <rms@gnu.org>
24058
24059 * src/main.c, src/files.c:
24060 New file.
24061
240621993-04-15 Noah Friedman <friedman@gnu.org>
24063
24064 * configure.in: entered into RCS
24065
24066 * configure.in: *** empty log message ***
24067
24068 * configure.in: New file.
24069
240701993-04-14 Richard Stallman <rms@gnu.org>
24071
24072 * Makefile.in: New file.
24073
240741993-04-13 Richard Stallman <rms@gnu.org>
24075
24076 * src/version.c: New file.
24077
240781993-03-25 Richard Stallman <rms@gnu.org>
24079
24080 * src/output.c: entered into RCS
24081
240821992-09-25 Richard Stallman <rms@gnu.org>
24083
24084 * configure.bat: entered into RCS
24085
240861992-06-22 Richard Stallman <rms@gnu.org>
24087
24088 * src/vmsgetargs.c: entered into RCS
24089
240901992-06-22 Richard Stallman <rms@gnu.org>
24091
24092 * doc/bison.rnh: entered into RCS
24093
240941992-04-20 David J. MacKenzie <djm@gnu.org>
24095
24096 * README: entered into RCS
24097
240981992-01-22 Richard Stallman <rms@gnu.org>
24099
24100 * src/machine.h: entered into RCS
24101
241021991-12-21 Richard Stallman <rms@gnu.org>
24103
24104 * src/lalr.c, src/closure.c:
24105 entered into RCS
24106
241071991-12-20 Richard Stallman <rms@gnu.org>
24108
24109 * src/state.h: entered into RCS
24110
241111991-12-18 Richard Stallman <rms@gnu.org>
24112
24113 * src/print.c, src/nullable.c, src/derives.c:
24114 entered into RCS
24115
241161991-11-03 David J. MacKenzie <djm@gnu.org>
24117
24118 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
24119 entered into RCS
24120
241211988-09-09 Richard Stallman <rms@gnu.org>
24122
24123 * src/bison.hairy: entered into RCS
24124
241251987-12-16 Richard Stallman <rms@gnu.org>
24126
24127 * REFERENCES: entered into RCS
dc546b0f 24128
f294a2c2 24129
04098407 24130 -----
f294a2c2 24131
ea0a7676
JD
24132 Copyright (C) 1987-1988, 1991-2011 Free Software Foundation,
24133 Inc.
f294a2c2 24134
04098407
PE
24135 Copying and distribution of this file, with or without
24136 modification, are permitted provided the copyright notice and this
24137 notice are preserved.