]> git.saurik.com Git - bison.git/blame - ChangeLog
doc: clean up terminology for mysterious conflicts.
[bison.git] / ChangeLog
CommitLineData
cc09e5be
JD
12011-03-06 Joel E. Denny <joeldenny@joeldenny.org>
2
3 doc: clean up terminology for mysterious conflicts.
4 * doc/bison.texinfo (Mystery Conflicts): Rename node to...
5 (Mysterious Conflicts): ... this, which is already the section
6 title and the name used in the index. Update all cross-references
7 to this node. Also, don't imply that R/R conflicts are the only
8 kind of mysterious conflict.
9
32493bc8
JD
102011-03-06 Joel E. Denny <joeldenny@joeldenny.org>
11
12 lr.default-reductions: rename "all" value to "full".
13 States that shift the error token do not have default reductions,
14 and GLR disables some default reductions, so "all" was a misnomer.
15 * doc/bison.texinfo (%define Summary): Update.
16 (Default Reductions): Update.
17 * src/print.c (print_reductions): Update.
18 * src/reader.c (prepare_percent_define_front_end_variables):
19 Update.
20 * src/tables.c (action_row): Update.
21 * tests/input.at (%define enum variables): Update.
22 * tests/reduce.at (%define lr.default-reductions): Update.
23
7fceb615
JD
242011-03-06 Joel E. Denny <joeldenny@joeldenny.org>
25
26 doc: create a new Tuning LR section in the manual.
27 And clean up all other documentation of the features described
28 there.
29 * NEWS (2.5): Tweak wording of lr.type and parse.lac entries a
30 bit, update the cross-references to the manual, and point out that
31 LAC has caveats. Don't be so adamant that IELR+LAC=canonical LR.
32 That is, as the referenced section in the manual documents, LAC
33 does not fix infinite parsing loops on syntax errors.
34 * doc/bison.texinfo: Consistently drop the "(1)" suffix from LALR,
35 IELR, and LR in @cindex.
36 (%define Summary): Condense the entries for lr.default-reductions,
37 lr.keep-unreachable-states, lr.type, and parse.lac into brief
38 summaries, and cross-reference the appropriate subsections of
39 Tuning LR. For parse.lac, mention that it's only implemented for
40 deterministic parsers in C. In parse.error entry, mention LAC,
41 and add cross-reference to the LAC section.
42 (Error Reporting): When mentioning parse.error, mention LAC, and
43 add cross-reference to the LAC section.
44 (Tuning LR): New section with an extended version of the
45 documentation removed from %define Summary. Change all
46 cross-references in the manual to point here instead of there.
47 (Calc++ Parser): When mentioning parse.error, mention LAC, and add
48 cross-reference to the LAC section.
49 (Table of Symbols): In %error-verbose entry, add cross-reference
50 to Error Reporting.
51 (Glossary): Capitalize entry titles consistently. Add definitions
52 for "defaulted state" and "unreachable state". Expand IELR
53 acronym in IELR's entry.
54
5e528941
JD
552011-02-20 Joel E. Denny <joeldenny@joeldenny.org>
56
57 doc: add bibliography to manual.
58 * doc/bison.texinfo (Mystery Conflicts): Cross-reference
59 bibliography instead of citing publications directly.
60 (Generalized LR Parsing): Likewise.
61 (Bibliography): New section. Not all entries are cross-referenced
62 yet, but that will come in future patches.
63
6771a463
JD
642011-02-19 Joel E. Denny <joeldenny@joeldenny.org>
65
66 java: test and document previous bug fix.
67 * NEWS (2.5): Document it.
68 * tests/java.at (_AT_DATA_JAVA_CALC_Y): To one of the yyerror
69 invocations, pass a location that spans multiple tokens. Change
70 yyerror to report all of a location rather than just the begin
71 position. Extend yylex and Position to count tokens on a line.
72 Remove getHashCode as it's unused. Update all expected output.
73
aa3bcdf3
BK
742011-02-19 Bernd Kiefer <kiefer@dfki.de> (tiny change)
75
76 java: fix location handling bug.
77 Reported at
78 <http://lists.gnu.org/archive/html/bison-patches/2011-02/msg00005.html>.
79 * data/lalr1.java (YYParser::yylloc): For non-empty RHS, fix
80 reversed access to location stack.
81 * THANKS (Bernd Kiefer): Add.
82
84072495
JD
832011-02-13 Joel E. Denny <joeldenny@joeldenny.org>
84
85 doc: fix some minor inconsistencies.
86 * doc/bison.texinfo (%define Summary): Fix mislabeled entry for
87 lex_symbol.
88 (%code Summary): For consistency with the variable list in the
89 %define Summary, enclose the list of %code qualifiers in a table
90 instead of an itemize.
91
51151d91
JD
922011-02-06 Joel E. Denny <joeldenny@joeldenny.org>
93
94 doc: clean up new subsections in manual.
95 * doc/bison.texinfo (%define Summary): Reword so it reads well as
96 a separate section. For example, add an intro, and move most of
97 the text outside of the @deffn so it is not indented so far.
98 (%code Summary): Likewise.
99 (Table of Symbols): Reword %code entry to match the %code entry in
100 Decl Summary.
101
35c1e5f0
JD
1022011-02-06 Joel E. Denny <joeldenny@joeldenny.org>
103
104 doc: finish splitting apart the manual's Decl Summary section.
105 Suggested by Akim Demaille at
106 <http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00013.html>.
107 * doc/bison.texinfo (Decl Summary): Extract most of the %define
108 entry into...
109 (%define Summary): ... this new subsection, and update all
110 cross-references. For readability of the patches, rewriting of
111 the text so it makes sense as a separate subsection will come in a
112 later patch. Moreover, the majority of the text describing the
113 various new LR features should likely move to another new section
114 somewhere.
115
e0c07222
JD
1162011-02-06 Joel E. Denny <joeldenny@joeldenny.org>
117
118 doc: begin to split apart the manual's Decl Summary section.
119 Discussed in thread starting at
120 <http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00013.html>.
121 * doc/bison.texinfo (Decl Summary): Extract most of the %code
122 entry into...
123 (%code Summary): ... this new subsection, and update all
124 cross-references. For readability of the patches, rewriting of
125 the text so it makes sense as a separate subsection will come in a
126 later patch.
127
ff7571c0
JD
1282011-02-06 Joel E. Denny <joeldenny@joeldenny.org>
129
130 doc: clean up naming of various Bison files.
131 The Bison manual's names for various files associated with a Bison
132 parser has devolved into inconsistency. This patch makes the
133 naming consistent for the most important files. First, it chooses
134 "grammar file" over "input file". The former appears to be more
135 traditional in the Bison manual, and Bison has other input
136 files (skeletons). Second, it chooses "parser implementation
137 file" over names like "parser file", "parser source file", "parser
138 source code file", and "parser output file". The new name makes
139 it clearer where Bison generates the main parser implementation,
140 and it is easily distinguishable from "parser header file".
141 * doc/bison.texinfo: Implement throughout.
142
679e9935
JD
1432011-02-06 Joel E. Denny <joeldenny@joeldenny.org>
144
145 doc: give credit to more of Bison's developers.
146 * doc/bison.texinfo (Introduction): Don't imply that only Robert
147 Corbett, Richard Stallman, and Wilfred Hansen have contributed to
148 Bison. However, I don't have time to write a full history, so
149 just point readers to THANKS and ChangeLog.
150
af28d414
JD
1512011-02-06 Joel E. Denny <joeldenny@joeldenny.org>
152
153 doc: document experimental features better.
154 * doc/bison.texinfo (Introduction): Say that IELR(1) and canonical
155 LR(1) are experimental. Mention Java. Normally experimental
156 features probably shouldn't be mentioned in the introduction.
157 However, if Bison's limitations to LALR(1), C, and C++ are so
158 important that they should be mentioned here, then it's important
159 to point out that Bison is beginning to escape those limitations.
160 Moreover, these particular experimental features have very little
161 chance of being removed.
162 * src/getargs.c (usage): Say that IELR(1) and canonical LR(1) are
163 experimental.
164
82f3355e
JD
1652011-01-29 Joel E. Denny <joeldenny@joeldenny.org>
166
167 Do not allow identifiers that start with a dash.
168 This cleans up our previous fixes for a bug whereby Bison
169 discarded `.field' in `$-1.field'. The previous fixes were less
170 restrictive about where a dash could appear in an identifier, but
171 the restrictions were hard to explain. That bug was reported and
172 this final fix was originally suggested by Paul Hilfinger. This
173 also fixes a remaining bug reported by Paul Eggert whereby Bison
174 parses `%token ID -123' as `%token ID - 123' and handles `-' as an
175 identifier. Now, `-' cannot be an identifier. Discussed in
176 threads beginning at
177 <http://lists.gnu.org/archive/html/bug-bison/2011-01/msg00000.html>,
178 <http://lists.gnu.org/archive/html/bug-bison/2011-01/msg00004.html>.
179 * NEWS (2.5): Update entry describing the dash extension to
180 grammar symbol names. Also, move that entry before the named
181 references entry because the latter mentions the former.
182 * doc/bison.texinfo (Symbol): Update documentation for symbol
183 names. As suggested by Paul Eggert, mention the effect of periods
184 and dashes on named references.
185 (Decl Summary): Update documentation for unquoted %define values,
186 which, as a side effect, can no longer start with dashes either.
187 * src/scan-code.l (id): Implement.
188 * src/scan-gram.l (id): Implement.
189 * tests/actions.at (Exotic Dollars): Extend test group to exercise
190 bug reported by Paul Hilfinger.
191 * tests/input.at (Symbols): Update test group, and extend to
192 exercise bug reported by Paul Eggert.
193 * tests/named-refs.at (Stray symbols in brackets): Update test
194 group.
195 ($ or @ followed by . or -): Likewise.
196 * tests/regression.at (Invalid inputs): Likewise.
197
fe3cae17
JD
1982011-01-24 Joel E. Denny <joeldenny@joeldenny.org>
199
200 * data/yacc.c: Fix last apostrophe warning from xgettext.
201
3c9b20ff
PE
2022011-01-09 Paul Eggert <eggert@cs.ucla.edu>
203
204 Fix minor problems encountered by a fresh bootstrap.
205 * data/glr.c, data/yacc.c: Do not use apostrophes in '#' comments,
206 as they confuse xgettext, which tries to parse them as C character
207 constants in a preprocessor directive.
208 * data/yacc.c (yy_lac): Don't use printf %d format on *yyesp, as
209 that expression might not promote to int on some platforms.
210 * src/parse-gram.c, src/parse-gram.h: Regenerate.
211
5c9efc75
JD
2122011-01-09 Joel E. Denny <joeldenny@joeldenny.org>
213
214 Improve error messages for `$' or `@' followed by `.' or `-'.
215 Previously, for this special case of an invalid reference, the
216 usual "symbol not found in production:" was printed. However,
217 because the symbol name was parsed as the empty string, that
218 message was followed immediately by a newline instead of a symbol
219 name. In reality, this is a syntax error, so the reference is
220 invalid regardless of the symbols actually appearing in the
221 production. Discussed at
222 <http://lists.gnu.org/archive/html/bison-patches/2011-01/msg00012.html>.
223 * src/scan-code.l (parse_ref): Report the above case as a syntax
224 error. Other than that, continue to handle this case like any
225 other invalid reference that Bison manages to parse because
226 "possibly meant" messages can still be helpful to the user.
227 * tests/named-refs.at ($ or @ followed by . or -): New test group.
228
8a4281b9
JD
2292011-01-08 Joel E. Denny <joeldenny@joeldenny.org>
230
231 doc: don't use @acronym.
232 Lately, many GNU packages are dropping it. See
233 <http://lists.gnu.org/archive/html/bison-patches/2011-01/msg00003.html>.
234 * doc/bison.texinfo: Remove all uses.
235
e0319547
AR
2362011-01-05 Alex Rozenman <rozenman@gmail.com>
237
238 Do not allow identifiers that start with a negative number.
239 Reported by Paul Hilfinger as a side effect of named references
240 support at
241 <http://lists.gnu.org/archive/html/bug-bison/2011-01/msg00000.html>.
242 Suggested by Paul Eggert.
243 * src/scan-code.l ({letter}, {id}): Adjust lexical definitions.
244 * src/scan-gram.l ({letter}, {id}): Likewise.
245
15fe6bb4
JD
2462011-01-03 Joel E. Denny <joeldenny@joeldenny.org>
247
248 * ChangeLog (2011-01-02): improve description.
249
355bdbdc
JD
2502011-01-03 Joel E. Denny <joeldenny@joeldenny.org>
251
252 maint: don't update copyright years in bootstrap.
253 * .x-update-copyright: Add entry for bootstrap.
254 * bootstrap: Remove 2011 from copyright years. The bootstrap
255 version we're currently using comes from an older version of
256 gnulib.
257 * bootstrap.conf (bootstrap_sync): Add comments explaining this
258 issue.
259
575619af
JD
2602011-01-02 Joel E. Denny <joeldenny@joeldenny.org>
261
262 maint: run "make update-copyright".
263
cb3f7f33
JD
2642011-01-02 Joel E. Denny <joeldenny@joeldenny.org>
265
15fe6bb4 266 maint: prepare to use year ranges in copyright notices.
cb3f7f33 267 * README (Copyright statements): New section explaining the range
15fe6bb4
JD
268 notation. The GNU maintainers document requires this explanation:
269 <http://www.gnu.org/prep/maintain/maintain.html#Copyright-Notices>.
270 I copied our explanation from coreutils.
cb3f7f33
JD
271 * build-aux/update-b4-copyright: Revert 2010-06-17 changes that
272 disabled Bison's automated use of ranges.
273 * cfg.mk (update-copyright-env): Likewise.
274
1eb63504
JD
2752011-01-02 Joel E. Denny <joeldenny@joeldenny.org>
276
277 Correct my email address.
278 * ChangeLog: In all recent entries.
279 * THANKS (Joel E. Denny): Here.
280
2812010-12-19 Joel E. Denny <joeldenny@joeldenny.org>
d397d9f0
JD
282
283 doc: cleanup.
284 * NEWS (2.5): Try to sort entries according to how interesting
285 users might find them.
286
1eb63504 2872010-12-19 Joel E. Denny <joeldenny@joeldenny.org>
f1b238df
JD
288
289 doc: cleanup.
290 * NEWS (2.5): Make some minor improvements to wording, and format
291 entries more consistently.
292 * doc/bison.texinfo (Language and Grammar): Point out that IELR
293 and canonical LR are experimental features.
294 (Decl Summary): In list of %define variables, make wording more
295 consistent. Improve discussion of using LALR for GLR.
296
1eb63504 2972010-12-19 Joel E. Denny <joeldenny@joeldenny.org>
fcf834f9
JD
298
299 parse.lac: document.
300 * NEWS (2.5): Add entry for LAC, and mention LAC in entry for
301 other corrections to verbose syntax error messages.
302 * doc/bison.texinfo (Decl Summary): Rewrite entries for
303 lr.default-reductions and lr.type to be clearer, to mention
304 %nonassoc's effect on canonical LR, and to mention LAC. Add entry
305 for parse.lac.
306 (Glossary): Add entry for LAC.
307
1eb63504 3082010-12-11 Joel E. Denny <joeldenny@joeldenny.org>
107844a3
JD
309
310 parse.lac: implement exploratory stack reallocations.
311 * data/yacc.c: Rename %define variable parse.lac.es-capacity to
312 parse.lac.es-capacity-initial. Accept parse.lac.memory-trace
313 with values of "failures" (default) or "full".
314 (b4_declare_parser_state_variables): Add yyesa, yyes, and
315 yyes_capacity variables.
316 (YYSTACK_USE_ALLOCA): Ignore it if LAC requested.
317 (YYSTACK_ALLOC, YYSTACK_FREE, YYSTACK_ALLOC_MAXIMUM): Define if
318 LAC requested.
319 (YYCOPY_NEEDED): New cpp macro.
320 (YYCOPY): Define if LAC requested.
321 (yy_lac_stack_realloc): New function implementing stack
322 reallocations. Use YYMAXDEPTH for maximum stack size given that
323 the stack should never need to grow larger than the main state
324 stack needs to grow without LAC.
325 (YY_LAC_ESTABLISH): Update yy_lac invocation.
326 (yy_lac): Add arguments for exploratory stack memory data
327 recorded in the main parser. Invoke yy_lac_stack_realloc when
328 reallocation is necessary.
329 (yysyntax_error): Add the same new arguments and pass them to
330 yy_lac.
331 (yypstate_delete): Free yyes if necessary.
332 (yyesa, yyes, yyes_capacity): #define these to yypstate members
333 in the case of push parsing.
334 (yyparse, yypush_parse): Initialize yyes and yyes_capacity.
335 Update yysyntax_error invocations. At yyreturn, free yyes if
336 necessary.
337 * src/parse-gram.y: %define parse.lac full.
338 * tests/input.at (LAC: errors for %define): Extend for
339 parse.lac-memory-trace.
340 * tests/regression.at (LAC: Exploratory stack): Extend to check
341 that stack reallocs happen when expected.
342 (LAC: Memory exhaustion): Update to use YYMAXDEPTH and
343 parse.lac.es-capacity-initial.
344
1eb63504 3452010-12-11 Joel E. Denny <joeldenny@joeldenny.org>
bf35c71c
JD
346
347 parse.lac: implement as %define variable.
348 LAC = lookahead correction. See discussion at
349 <http://lists.gnu.org/archive/html/bison-patches/2009-09/msg00034.html>.
350 However, one point there must be corrected: because of %nonassoc,
351 LAC is *not* always redundant for lr.type=canonical-lr.
352 * data/yacc.c: Accept values of "none" (default) or "full" for
353 parse.lac. Accept %define parse.lac.es-capacity to specify
354 capacity of LAC's temporary exploratory stack. It defaults to 20
355 and, for now, will not grow dynamically.
356 (b4_lac_flag, b4_lac_if): New m4 macros. Evaluate as true for
357 parse.lac!=none.
358 (YYBACKUP): Invoke YY_LAC_DISCARD.
359 (YY_LAC_ESTABLISH, YY_LAC_DISCARD): New cpp macros that invoke
360 yy_lac and track when it needs to be invoked
361 (yy_lac): New function that, given the current stack, determines
362 whether a token can eventually be shifted. Return status mimics
363 yyparse return status.
364 (yysyntax_error): Change yystate argument to yyssp so stack top
365 can be passed to yy_lac. If LAC is requested, build expected
366 token list by invoking yy_lac for every token instead of just
367 checking the current state for lookaheads. Return 2 if yy_lac
368 exhausts memory.
369 (yyparse, yypush_parse): Use local variable yy_lac_established and
370 cpp macros YY_LAC_ESTABLISH and YY_LAC_DISCARD to implement LAC.
371 Update yysyntax_error invocation. Add yyexhaustedlab code if LAC
372 is requested.
373 * tests/conflicts.at (%nonassoc and eof): Extend to check the
374 effect of each of -Dlr.type=canonical-lr and -Dparse.lac=full.
375 (parse.error=verbose and consistent errors): Likewise.
376 (LAC: %nonassoc requires splitting canonical LR states): New test
377 group demonstrating how LAC can fix canonical LR.
378 * tests/input.at (LAC: Errors for %define): New test group.
379 * tests/regression.at (LAC: Exploratory stack): New test group.
380 (LAC: Memory exhaustion): New test group.
381
1eb63504 3822010-11-21 Joel E. Denny <joeldenny@joeldenny.org>
10bae98a
JD
383
384 build: use gnulib's new bootstrap_sync option.
385 Now, whenever we update bison's copy of gnulib, bootstrap will
386 update itself the next time it's run.
387 * bootstrap: Copy from latest gnulib for bootstrap_sync support.
388 * bootstrap.conf (bootstrap_sync): Set to true.
389 * gnulib: Update to latest so bootstrap is in sync now.
390
1eb63504 3912010-11-07 Joel E. Denny <joeldenny@joeldenny.org>
d2060f06
JD
392
393 yysyntax_error: fix for consistent error with lookahead.
394 * NEWS (2.5): Document.
395 * data/yacc.c (yysyntax_error): In a verbose syntax error
396 message while in a consistent state with a default action (which
397 must be an error action given that yysyntax_error is being
398 invoked), continue to drop the expected token list, but don't
399 drop the unexpected token unless there actually is no lookahead.
400 Moreover, handle that internally instead of returning 1 to tell
401 the caller to do it. With that meaning of 1 gone, renumber
402 return codes more usefully.
403 (yyparse, yypush_parse): Update yysyntax_error usage. Most
404 importantly, set yytoken to YYEMPTY when there's no lookahead.
405 * data/glr.c (yyreportSyntaxError): As in yacc.c, don't drop the
406 unexpected token unless there actually is no lookahead.
407 * data/lalr1.cc (yy::parser::parse): If there's no lookahead,
408 pass yyempty_ not yyla.type to yysyntax_error_.
409 (yy::parser::yysyntax_error_): Again, don't drop the unexpected
410 token unless there actually is no lookahead.
411 * data/lalr1.java (YYParser::parse): If there's no lookahead,
412 set yytoken to yyempty_ before invoking yysyntax_error.
413 (YYParser::yysyntax_error): Again, don't drop the unexpected
414 token unless there actually is no lookahead.
415 * tests/conflicts.at (parse.error=verbose and consistent
416 errors): Extend test group to further reveal how the previous
417 use of the simple "syntax error" message was too general. Test
418 yacc.c, glr.c, lalr1.cc, and lalr1.java. No longer an expected
419 failure.
420 * tests/java.at (AT_JAVA_COMPILE, AT_JAVA_PARSER_CHECK): Move
421 to...
422 * tests/local.at: ... here.
423 (_AT_BISON_OPTION_PUSHDEFS): Push AT_SKEL_JAVA_IF definition.
424 (AT_BISON_OPTION_POPDEFS): Pop it.
425 (AT_FULL_COMPILE): Extend to handle Java.
426
1eb63504 4272010-11-07 Joel E. Denny <joeldenny@joeldenny.org>
25a648d8
JD
428
429 yysyntax_error: more preparation for readability of next patch.
430 There are no behavioral changes here.
431 * data/glr.c (yyreportSyntaxError): Reorganize.
432 * data/lalr1.cc (yy::parser::yysyntax_error_): Reorganize.
433 * tests/conflicts.at (parse.error=verbose and consistent errors):
434 Reorganize.
435
1eb63504 4362010-11-07 Joel E. Denny <joeldenny@joeldenny.org>
b4bbc4a0
JD
437
438 yysyntax_error: prepare for readability of next patches.
439 These are purely whitespace changes that result in ugly code
440 but that make the next couple of patches much easier to read.
441 * data/glr.c (yyreportSyntaxError): Reindent.
442 * data/lalr1.cc (yy::parser::yysyntax_error_): Reindent.
443 * data/lalr1.java (YYParser::yysyntax_error): Reindent.
444 * data/yacc.c (yysyntax_error): Reindent.
445
71431084
JD
4462010-10-31 Joel E. Denny <joeldenny@joeldenny.org>
447
448 Fix memory leak.
449 * src/output.c (prepare_rules): Free temporary array.
450
34db451c
JD
4512010-10-31 Joel E. Denny <joeldenny@joeldenny.org>
452
453 yysyntax_error: improve invocation readability.
454 * data/yacc.c (yyparse, yypush_parse): For yysyntax_error
455 invocation, get rid of the while loop, which is misleading
456 because there are really at most two iterations.
457
9d6bc5c4
JD
4582010-10-31 Joel E. Denny <joeldenny@joeldenny.org>
459
460 * ChangeLog: Correct some errors in previous entries.
461
e503b9cb
JD
4622010-10-17 Joel E. Denny <joeldenny@joeldenny.org>
463
464 maint: re-anchor all .gitignore entries.
465 * bootstrap: Copy from gnulib's latest for the fix to
466 automatically anchor entries it constructs.
467 * gnulib: Update to latest just so it has the same bootstrap.
468 * .gitignore, build-aux/.gitignore, doc/.gitignore:
469 * lib/.gitignore, m4/.gitignore, po/.gitignore:
470 * runtime-po/.gitignore: Re-anchor all entries.
471
95aed8db
PE
4722010-10-08 Paul Eggert <eggert@cs.ucla.edu>
473
8ff146cd
PE
474 Fix portability problem on OpenBSD 4.7.
475
476 Jim Meyering reported this in
477 <http://lists.gnu.org/archive/html/bug-bison/2010-10/msg00007.html>.
478 * data/yacc.c: Use EXIT_SUCCESS as a witness for stdlib.h,
479 not _STDLIB_H. EXIT_SUCCESS has been defined by the standard
480 for quite some time.
481 * src/parse-gram.c, src/parse-gram.h: Regenerate.
482 * tests/regression.at: Tamper with the renamed witness.
483
95aed8db
PE
484 Adjust to recent changes to gnulib bootstrap.
485
486 * .cvsignore, build-aux/.cvsignore, doc/.cvsignore, etc/.cvsignore:
487 * examples/calc++/.cvsignore, lib/.cvsignore, m4/.cvsignore:
488 * po/.cvsignore, runtime-po/.cvsignore, src/.cvsignore:
489 * tests/.cvsignore: Remove; I don't use CVS to maintain Bison
490 anymore and don't know of anybody else who does. If someone needs
491 these files, they can resurrect them.
492 * .gitignore, build-aux/.gitignore, doc/.gitignore, lib/.gitignore:
493 * m4/.gitignore, po/.gitignore, runtime-po/.gitignore:
494 Omit leading '/', since bootstrap omits it.
495 Adjust file names to match current contents better.
496 * bootstrap: Sync from gnulib: this contains the new gnulib_mk_hook
497 installed just for us.
498 * bootstrap.conf (excluded_files): Don't exclude codeset.m4,
499 glibc21.m4, inttypes_h.m4, size_max.m4, xsize.m4, as they are now
500 needed somehow. Don't have time to look into why.
501 (gnulib_modules): Change malloc to malloc-gnu. Do we really assume
502 the GNU malloc behavior, where malloc (0) != NULL unless we're
503 out of storage? If not, we can omit malloc-gnu; but for now I left
504 it in to be safe.
505 (vc_ignore): Remove.
506 (gnulib_mk_hook): New function.
507 * README-hacking: Renamed from HACKING, since gnulib bootstrap now
508 uses that convention.
509
39f5757a
PH
5102010-09-09 Paul Hilfinger <hilfinger@cs.berkeley.edu>
511
512 * data/glr.c (yySymbol): Define as int to avoid compiler warnings about
513 possible change of value.
514
d467f443
PH
5152010-09-08 Paul Hilfinger <hilfinger@cs.berkeley.edu>
516
517 * data/glr.c (yy_reduce_print): Change yyrhsVals to yyvsp to remove
518 compiler errors when using %debug.
519 Add declaration of yylow when locations in use to avoid compilation
520 error.
521 (yyglrReduce): Conditionalize message "Parse ... rejected by rule..."
522 on whether we are in split mode, for consistency with behavior of
523 non-GLR parsing.
524
c49784f5
AD
5252010-09-01 Akim Demaille <demaille@gostai.com>
526
527 Address GCC warnings about shadowed local variables (yyflag).
528 * data/glr.c (YYCHK): Rename yyflag as yychk_flag.
529 (yyprocessOneStack): Reduce the scope of yyaction, yyconflicts,
530 yyrule, and yyflag.
531
64877e5e
JD
5322010-08-05 Joel E. Denny <joeldenny@joeldenny.org>
533
534 Version 2.4.3.
535 * NEWS (2.4.3): Set date.
536
83af6585
JD
5372010-08-04 Joel E. Denny <joeldenny@joeldenny.org>
538
539 maint: add gettext version to release announcements.
540 Suggested by Paul Hilfinger at
541 <http://lists.gnu.org/archive/html/bison-patches/2010-07/msg00019.html>
542 <http://lists.gnu.org/archive/html/bison-patches/2010-08/msg00002.html>.
543 * cfg.mk (bootstrap-tools): Add gettext.
544
93d7dde9
JD
5452010-08-04 Joel E. Denny <joeldenny@joeldenny.org>
546
547 doc: fix -W and %expect documentation some.
548 * NEWS (2.4.3): Mention that there are documentation fixes.
549 * doc/bison.texinfo (Expect Decl): Make it clear that %expect
550 turns conflicts into errors not warnings.
551 (Shift/Reduce): Likewise.
552 (Bison Options): Don't mention -Wsyntax. It doesn't exist.
553
2bfcac9a
JD
5542010-08-01 Joel E. Denny <joeldenny@joeldenny.org>
555
556 -Werror: fix for rules useless in parser after conflicts.
557 * NEWS (2.4.3): Document fix.
558 * src/complain.c (error_message): Extend to handle incomplete
559 error messages so warn and warn_at can be used in more cases.
560 * src/gram.c (grammar_rules_useless_report): Use warn_at so that
561 -Werror is always obeyed.
562 * src/reduce.c (reduce_print): Use warn so that the "warnings
563 being treated as errors" message is printed consistently before
564 the first warning message. This makes testing easier.
565 * tests/local.at (AT_BISON_WERROR_MSG): New macro.
566 (AT_BISON_CHECK_NO_XML): Extend to check -Werror and
567 --warnings=error when warnings appear in bison's stderr.
568
c61d4fa1
JD
5692010-07-29 Joel E. Denny <joeldenny@joeldenny.org>
570
571 maint: enable gnits only at stable releases.
572 * configure.ac (AM_INIT_AUTOMAKE): Underscore or dash in a
573 version string should disable gnits. Explain in comments.
574
825c88e8
JD
5752010-07-28 Joel E. Denny <joeldenny@joeldenny.org>
576
577 i18n: update.
578 * po/POTFILES.in: Add src/graphviz.c.
579
343c3db8
JD
5802010-07-28 Joel E. Denny <joeldenny@joeldenny.org>
581
582 i18n: fix for gnulib.
583 * po/POTFILES.in: Add remaining gnulib files that have
584 translatable strings.
585
42765f8e
JD
5862010-07-25 Joel E. Denny <joeldenny@joeldenny.org>
587
588 build: fix our adjustments for gnulib files in lib.
589 * configure.ac: For prepending lib/ to the values of config
590 variables, fix detection of empty values. Also, due to recent
591 gnulib changes, add LIBUNISTRING_UNITYPES_H and
592 LIBUNISTRING_UNIWIDTH_H to the list of those variables.
593
e35bc778
JD
5942010-07-25 Joel E. Denny <joeldenny@joeldenny.org>
595
596 maint: use announce-gen's new --mail-headers.
597 * HACKING (Announce): Update instructions.
598 * cfg.mk (announcement_Cc_): Define.
599 * configure.ac (AM_GNU_GETTEXT_VERSION): Update to 0.18 as
600 required by latest gnulib.
601 * gnulib: Update to latest.
602
b6ca79e8
JD
6032010-07-24 Joel E. Denny <joeldenny@joeldenny.org>
604
605 tests: handle Valgrind that complains about >&-.
606 * tests/output.at (AT_CHECK_OUTPUT): Extend to accept pre-tests.
607 (Output files: -dv >&-): Skip test group if running
608 maintainer-check-valgrind.
609
ca2a6d15
PH
6102010-07-23 Paul Hilfinger <hilfingr@EECS.Berkeley.EDU>
611
612 * NEWS: Describe new semantic-predicate feature.
9d6bc5c4
JD
613 * data/c.m4 (b4_predicate_case): New definition.
614 * data/java.m4 (b4_predicate_case): New definition.
615 * data/glr.c (yyimmediate): Add definition.
616 (yydoAction): Remove comment, now obsolete.
617 Do YY_REDUCE_PRINT here.
618 (yyglrReduce): Alter comment to indicate that semantic values
619 need not be deferred.
620 Remove YY_REDUCE_PRINT from here; done in yydoAction.
621 (yyprocessOneStack): Pass immediate flag.
622 Delete stacks rejected by predicates in newly split-off parsers.
623 Change handling of yyerr so that only current stack gets deleted
624 when semantic predicate fails.
625 (yyfillin): Don't crash if a semantic value is unresolved (as may
626 happen in predicate rules).
627 Copy lr state as well in debugging mode.
628 Update comment on setting of yysval to include yyloc as well.
629 (yy_reduce_print): Add yynormal argument. Perform fillin properly.
630 Report unresolved RHS values.
631 (yyimmediate): New table.
632 * src/gram.h (struct rule): Add is_predicate field.
633 * src/output.c (user_actions_output): Use b4_predicate_case for
634 predicates.
635 (prepare_symbols): Output yyimmediate.
636 * src/scan-gram.l: Add %? token, SC_PREDICATE state.
637 * src/scan-code.l (code_props_rule_action_init): Add is_predicate
638 argument.
639 * src/scan-code.h (struct code_props): Add is_predicate field.
640 (code_props_rule_action_init): New interface.
641 * src/parse-gram.y (%?{...}): New token.
642 (rhs): Add %?{...} rule.
643 * src/parse-gram.c: Regenerate.
644 * src/parse-gram.h: Regenerate.
645 * src/reader.c (grammar_current_rule_action_append): Add
646 immediate argument.
647 (grammar_midrule_action): Use new interface for
648 code_props_rule_action_init.
649 (grammar_current_rule_action_append): Ditto.
650 (packgram): Transfer is_predicate value.
651 * src/reader.h (grammar_current_rule_action_append): New interface.
652 * doc/bison.texinfo: Document semantic predicates (%?).
653
654 * data/glr.c (yylhsNonterm, yyisDefaultedState,yyDefaultAction)
655 (yygetLRActions,yynewGLRStackItem,yyaddDeferredAction,yyinitStateSet)
656 (yyinitGLRStack,yyexpandGLRStack,yyupdateSplit,yymarkStackDeleted)
657 (yyundeleteLastStack,yyglrShift,yyglrShiftDefer,yydoAction,yyglrReduce)
658 (yyidenticalOptions,yymergeOptionSets,yyresolveStates,yyresolveAction)
659 (yyresolveLocations,yyresolveValue,yyreducePrint): Update parameter
660 names in comments and mention all parameters.
661 (struct yyGLRState): Fix description of yyposn field.
662 (yyresolveLocations): Correct comment so as not to imply action when
663 yyn1==0.
c49784f5 664
7d424de1
PE
6652010-06-17 Paul Eggert <eggert@cs.ucla.edu>
666
804e83b2
PE
667 Update from GFDL GFDL 1.2 to 1.3.
668 * doc/bison.texinfo: Update GFDL version number.
669 * doc/fdl.texi: Update to version 1.3, taken from:
670 http://www.gnu.org/licenses/fdl.texi
671
7d424de1
PE
672 Do not use date ranges in copyright notices.
673 See http://www.gnu.org/prep/maintain/maintain.html#Copyright-Notices
674
675 * HACKING, Makefile.am, NEWS, PACKAGING, README, README-alpha:
676 * TODO, bootstrap, bootstrap.conf:
677 * build-aux/update-b4-copyright, cfg.mk, configure.ac:
678 * data/README, data/bison.m4, data/c++-skel.m4, data/c++.m4:
679 * data/c-skel.m4, data/c.m4, data/glr.c, data/glr.cc:
680 * data/java-skel.m4, data/java.m4, data/lalr1.cc:
681 * data/lalr1.java, data/local.mk, data/location.cc:
682 * data/stack.hh, data/variant.hh, data/xslt/bison.xsl:
683 * data/xslt/xml2dot.xsl, data/xslt/xml2text.xsl:
684 * data/xslt/xml2xhtml.xsl, data/yacc.c, djgpp/Makefile.maint:
685 * djgpp/README.in, djgpp/config.bat, djgpp/config.sed:
686 * djgpp/config.site, djgpp/config_h.sed, djgpp/djunpack.bat:
687 * djgpp/local.mk, djgpp/subpipe.c, djgpp/subpipe.h:
688 * djgpp/testsuite.sed, doc/bison.texinfo, doc/local.mk:
689 * doc/refcard.tex, etc/README, etc/bench.pl.in, etc/local.mk:
690 * examples/calc++/Makefile.am, examples/extexi:
691 * examples/local.mk, lib/abitset.c, lib/abitset.h:
692 * lib/bbitset.h, lib/bitset.c, lib/bitset.h:
693 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
694 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
695 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
696 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
697 * lib/libiberty.h, lib/local.mk, lib/main.c, lib/timevar.c:
698 * lib/timevar.def, lib/timevar.h, lib/vbitset.c:
699 * lib/vbitset.h, lib/yyerror.c, m4/bison-i18n.m4:
700 * m4/c-working.m4, m4/cxx.m4, m4/subpipe.m4, m4/timevar.m4:
701 * src/AnnotationList.c, src/AnnotationList.h:
702 * src/InadequacyList.c, src/InadequacyList.h, src/LR0.c:
703 * src/LR0.h, src/Sbitset.c, src/Sbitset.h, src/assoc.c:
704 * src/assoc.h, src/closure.c, src/closure.h, src/complain.c:
705 * src/complain.h, src/conflicts.c, src/conflicts.h:
706 * src/derives.c, src/derives.h, src/files.c, src/files.h:
707 * src/flex-scanner.h, src/getargs.c, src/getargs.h:
708 * src/gram.c, src/gram.h, src/graphviz.c, src/ielr.c:
709 * src/ielr.h, src/lalr.c, src/lalr.h, src/local.mk:
710 * src/location.c, src/location.h, src/main.c:
711 * src/muscle-tab.c, src/muscle-tab.h, src/named-ref.c:
712 * src/named-ref.h, src/nullable.c, src/nullable.h:
713 * src/output.c, src/output.h, src/parse-gram.y:
714 * src/print-xml.c, src/print-xml.h, src/print.c, src/print.h:
715 * src/print_graph.c, src/print_graph.h, src/reader.c:
716 * src/reader.h, src/reduce.c, src/reduce.h, src/relation.c:
717 * src/relation.h, src/scan-code.h, src/scan-code.l:
718 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
719 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
720 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
721 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
722 * tests/actions.at, tests/atlocal.in, tests/c++.at:
723 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
724 * tests/existing.at, tests/glr-regression.at:
725 * tests/headers.at, tests/input.at, tests/java.at:
726 * tests/local.at, tests/local.mk, tests/named-refs.at:
727 * tests/output.at, tests/push.at, tests/reduce.at:
728 * tests/regression.at, tests/sets.at, tests/skeletons.at:
729 * tests/synclines.at, tests/testsuite.at, tests/torture.at:
730 Don't use date ranges in copyright notices.
731
38435078
AD
7322010-05-11 Akim Demaille <demaille@gostai.com>
733
734 lalrl1.cc: give a chance to user defined YYLLOC_DEFAULT.
735 * data/lalr1.cc (YYLLOC_DEFAULT): Move its definition from the
736 header file to the implementation file, after the user %code
737 sections.
738 * NEWS (2.5): Document this.
739
e944aaff
AD
7402010-05-11 Akim Demaille <demaille@gostai.com>
741
742 doc: please Emacs.
743 * doc/bison.texinfo (Local Variables): Move this after the
744 LocalWords, since the latter are looked for in the whole document,
745 while the former are looked for only at its end.
746 Require american spell checking.
747
86e5b440
AD
7482010-05-10 Akim Demaille <demaille@gostai.com>
749
750 doc: fix lalr1.cc documentation.
751 * doc/bison.texinfo (C++ Scanner Interface): Fix yylex signature.
752 (C++ Bison Interface): Fix lalr1.cc skeleton name.
753 (C++ Parser Interface): Fix semantic_type and location_type names.
754 Document yy::parser::token.
755 Reported by Jerry Quinn.
756
bb9191dd
AD
7572010-05-10 Akim Demaille <demaille@gostai.com>
758
759 c++: use YYRHSLOC.
760 * data/lalr1.cc (YYRHSLOC): New.
761 (YYLLOC_DEFAULT): Use it.
762 * data/glr.cc: If location_type was user defined, do not include
763 location.hh, and do not produce location.hh and position.hh.
764 * tests/calc.at (YYLLOC_DEFAULT): Use YYRHSLOC.
765 Check that glr.cc supports user defined location_type.
766 * NEWS: Document this.
767
8aec287e
AD
7682010-05-07 Akim Demaille <demaille@gostai.com>
769
770 doc: fix typo.
771 * tests/synclines.at: here.
772
c826013f
AD
7732010-05-04 Akim Demaille <demaille@gostai.com>
774
775 tests: enhance AT_SYNCLINES_COMPILE.
776 * tests/synclines.at (AT_SYNCLINES_COMPILE): More distcc patterns.
777 (AT_TEST_SYNCLINE): Remove GCC 4.5 protection which is already
778 taken care of in AT_SYNCLINES_COMPILE.
779
7789b6e3
AD
7802010-05-04 Akim Demaille <demaille@gostai.com>
781
782 lalr1.cc: don't generate location.hh when location_type is defined
783 * data/bison.m4 (b4_percent_define_get): Accept a default value.
784 * data/c++.m4: Do not provide a default value for the %define
785 variable location_type, rather, use b4_percent_define_get with a
786 default argument where its value is needed.
787 * data/lalr1.cc: Do not load location.cc (which outputs both
788 location.hh and position.hh) if the user defined location_type.
789 Do not include location.hh either.
790
19ad326b
AD
7912010-05-04 Akim Demaille <demaille@gostai.com>
792
793 lalr1.cc: minor refactoring.
794 * data/lalr1.cc: Don't issue empty namespaces.
795
f5da8149
AD
7962010-05-04 Akim Demaille <demaille@gostai.com>
797
798 tests: fix %printer.
799 Currently, there is no check that %printer ... <foo> (nor
800 %destructor) is about an existing <foo> type. This C++ test had
801 it wrong (<::std::string> vs. <std::string>).
802
803 * tests/c++.at (AT_CHECK_VARIANTS): In list.yy, redefine the
804 pretty-printing of lists into something better for parser traces.
805 Update the expected output.
806 Fix correspondance between %type/%token and %printer.
807
49976d5c
AD
8082010-05-04 Akim Demaille <demaille@gostai.com>
809
810 lalr1.cc: location_type: make sure we don't depend on loc.(begin|end).
811 * tests/calc.at (Span): Instead of begin/end, as in the built-in
812 location class, use first and last.
813 Define YYLLOC_DEFAULT to adjust to these changes.
814 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Adjust to the
815 location_type changes.
816
bc81de36
JD
8172010-05-01 Joel E. Denny <joeldenny@joeldenny.org>
818
819 tests: fix maintainer-xml-check.
820 * data/xslt/xml2dot.xsl (xsl:template match="bison-xml-report"):
821 Update output to include comments now produced by --graph.
822 (xsl:template match="automaton"): As for --graph, name the
823 digraph after the grammar file.
824 * src/print-xml.c (escape_bufs): Enlarge array.
825 (print_xml): Add bug-report and url attributes to
826 bison-xml-report element.
827
b7666378
JD
8282010-05-01 Joel E. Denny <joeldenny@joeldenny.org>
829
830 In DOT output, convert from "/*" comments to "//" comments.
831 This handles the possibility that a "*/" might appear in
832 variable portions of those comments at some point in the future.
833 * src/graphviz.c (start_graph): Implement.
834
9b5049bd
JD
8352010-04-30 Joel E. Denny <joeldenny@joeldenny.org>
836
837 Document that undefined %prec identifier warnings will remain.
838 * NEWS (2.4.3): Here.
839 (2.4.2): Here.
840
02354690
JD
8412010-04-30 Joel E. Denny <joeldenny@joeldenny.org>
842
843 Revert 2009-12-30 change for undefined %prec token complaints.
844 That is, keep them as warnings because that should be sufficient
845 to satisfy POSIX without creating backward compatibility issues.
846 Suggested by Richard Stallman at
847 <http://lists.gnu.org/archive/html/bison-patches/2010-03/msg00033.html>.
848 * NEWS (2.5): Remove mention of complaint.
56e92e0b
JD
849 * src/reader.c (grammar_rule_check): Convert complaint back to
850 warning.
02354690
JD
851 * tests/input.at (%prec's token must be defined): Update.
852
a7ddefd1
JD
8532010-04-25 Joel E. Denny <joeldenny@joeldenny.org>
854
855 build: don't require src/bison during bootstrap.
856 Suggested by Eric Blake at
857 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00003.html>.
858 * bootstrap.conf (bootstrap_epilogue): New function to make sure
859 src/parse-gram.[ch] are stamped later than src/parse-gram.y.
860
c1bd4b2b
JD
8612010-04-25 Joel E. Denny <joeldenny@joeldenny.org>
862
863 i18n: fix untranslatable string.
864 Reported by Goran Uddeborg at
865 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00000.html>.
866 * src/muscle-tab.c (muscle_percent_define_insert): Here.
867
67f1a2c2
AD
8682010-04-13 Akim Demaille <demaille@gostai.com>
869
870 tests: calc: minor refactoring.
871 * tests/calc.at (_AT_DATA_CALC_Y): Simplify yylex.
872
4f756f88
AD
8732010-04-13 Akim Demaille <demaille@gostai.com>
874
875 tests: calc: simplify location management.
876 * tests/local.at (AT_LOC_PUSHDEF, AT_LOC_POPDEF): New.
877 (_AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS): Use them to
878 define the appropriate AT_LOC accessors.
879 * tests/calc.at: Use AT_LOC accessors.
880
24bb8c8c
AD
8812010-04-13 Akim Demaille <demaille@gostai.com>
882
883 test location_type.
884 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS):
885 Define AT_LOCATION_TYPE_IF.
886 (_AT_BISON_OPTION_POPDEFS): Undefine AT_LOCATION_TYPE_IF.
887 * tests/calc.at (_AT_DATA_CALC_Y): When %define location_type is
888 used, provide a user location type and use it.
889 (Simple LALR1 C++ Calculator): Add a test case for location_type.
890
af129079
AD
8912010-04-13 Akim Demaille <demaille@gostai.com>
892
893 tests: check fclose's return value.
894 * tests/calc.at (_AT_DATA_CALC_Y): Check fclose's return status.
895
36dc3637
AD
8962010-04-13 Akim Demaille <demaille@gostai.com>
897
898 tests: don't depend on the actual location type.
899 * tests/calc.at: Use yy::parser::location_type rather than
900 yy::location, since the former is always right, and might point to
901 another type than the latter.
902
c499231d
AD
9032010-04-13 Akim Demaille <demaille@gostai.com>
904
905 formatting changes.
906 * tests/calc.at: Formatting changes.
907
7799ef15
AD
9082010-04-13 Akim Demaille <demaille@gostai.com>
909
910 lalr1.cc: remove useless forward declaration.
911 * data/lalr1.cc: Include location.hh before stack.hh.
912 Remove the useless forward declarations of position and location.
913 Reported by Chris Morley.
914 * data/glr.cc: Likewise.
915
06cb07d5
JD
9162010-04-11 Joel E. Denny <joeldenny@joeldenny.org>
917
918 * NEWS (2.4.3): Mention fix for Sun Studio C++.
919
4586c8cd
JD
9202010-04-10 Joel E. Denny <joeldenny@joeldenny.org>
921
922 tests: fix for newer Sun Studio C++.
923 Reported by Dagobert Michelsen at
924 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00023.html>.
925 * THANKS (Dagobert Michelsen): Add.
926 * configure.ac (AC_PREREQ): Set to 2.64 so we get the latest
927 Autoconf macro for handling the restrict keyword.
928 * gnulib: Update to latest, which no longer overrides that macro
929 from Autoconf.
930
44c2b42d
JD
9312010-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
932
933 portability: fix pointer arithmetic to conform to C standard.
934 Reported by Tys Lefering at
935 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00035.html>.
936 This fix is already implemented in glr.c and does not apply to
937 lalr1.java.
938 * data/lalr1.cc (yy::parser::parse): Increase size of
939 yyerror_range and adjust subscripting so you don't have to
940 subtract one from the beginning of the array.
941 * data/yacc.c (b4_declare_parser_state_variables,
942 yyparse, yypush_parse): Likewise.
943
218287f5
AD
9442010-04-05 Akim Demaille <demaille@gostai.com>
945
946 remove useless include.
947 * src/graphviz.h: Don't include stdbool.h.
948
8176ab33
AD
9492010-04-05 Akim Demaille <demaille@gostai.com>
950
951 graph: sign the output file.
952 * src/graphviz.c (start_graph): Issue comments about Bison.
953 Suggested by Tys Lefering.
954
4ad3921d
JD
9552010-03-31 Joel E. Denny <jdenny@ces.clemson.edu>
956
957 portability: fix test suite for GCC 4.5's new #error message.
958 Reported by Tys Lefering at
959 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00030.html>.
960 * NEWS (2.4.3): Mention.
961 * tests/synclines.at (AT_TEST_SYNCLINE): Implement.
962
10a697de
AD
9632010-03-30 Akim Demaille <demaille@gostai.com>
964
965 fix comments.
966 * src/graphviz.h: Add missing license notice.
967 Document.
968
d6b347e4
AD
9692010-03-25 Akim Demaille <demaille@gostai.com>
970
971 tests: fix 250: parse.error=verbose overflow.
972 * tests/regression.at (parse.error=verbose overflow): Avoid the
973 double inclusion of stdlib.h as it triggers hard errors.
974
b8675840
JD
9752010-03-23 Joel E. Denny <jdenny@ces.clemson.edu>
976
977 portability: fix for BSD make.
978 Reported by Johan van Selst at
979 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00016.html>.
980 * tests/local.mk ($(TESTSUITE)): Qualify package.m4 in
981 this dependency list as in package.m4's target rule.
982
8b9e021f
JD
9832010-03-23 Joel E. Denny <jdenny@ces.clemson.edu>
984
985 portability: fix spawning on at least FreeBSD 8 and FreeBSD 9.
986 Reported by Johan van Selst at
987 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00014.html>.
988 * NEWS (2.4.3): New.
989 * THANKS (Johan van Selst): Add.
990 * etc/prefix-gnulib-mk (prefix): Adjust regex for makefile
991 targets so that gnulib's new c++defs.h is matched.
992 * gnulib: Update to latest.
993
96a381c5
JD
9942010-03-20 Joel E. Denny <jdenny@ces.clemson.edu>
995
996 maint: update for changes to gnulib's announce-gen.
997 * HACKING (Announce): RELEASE_TYPE=major must now be written
998 RELEASE_TYPE=stable.
999
e19a049c
JD
10002010-03-20 Joel E. Denny <jdenny@ces.clemson.edu>
1001
1002 Version 2.4.2.
1003 * NEWS (2.4.2): Set version and date. For the recent test suite
1004 portability fixes, don't be so optimistic about their success
1005 given the lack of feedback on the affected platforms.
1006
890aeb28
JD
10072010-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
1008
1009 tests: fix maintainer-xml-check for recent changes.
1010 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Use
1011 AT_BISON_CHECK_NO_XML rather than AT_BISON_CHECK because an
1012 output file whose name conflicts with a previous output file
1013 is now never generated.
1014
f39ab286
JD
10152010-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
1016
1017 portability: fix several issues with M4 subprocess.
1018
1019 M4's output pipe was not being drained upon fatal errors during
1020 scan_skel. As a result, broken-pipe messages from M4 were seen
1021 on at least AIX, HP-UX, Solaris, and RHEL4, and this caused a
1022 failure in the test suite. The problem was that, on platforms
1023 where the default disposition for SIGPIPE is ignore instead of
1024 terminate, M4 sometimes saw fwrite fail with errno=EPIPE and
1025 then reported it. However, there's some sort of race condition,
1026 because the new test group occasionally succeeded.
1027 Reported by Albert Chin at
1028 <http://lists.gnu.org/archive/html/bug-bison/2010-02/msg00004.html>.
1029
1030 There were also problems with the test suite livelocking on
1031 Tru64 5.1b. Reported by Didier Godefroy at
1032 <http://lists.gnu.org/archive/html/bug-bison/2009-05/msg00005.html>.
1033 Switching to create_pipe_bidi suggested by Akim Demaille.
1034
1035 To attempt to solve both of these problems, switch to gnulib's
1036 create_pipe_bidi and register M4 process as a slave. Along the
1037 way, clean up file name conflict handling, which was affected by
1038 the broken-pipe problem before the switch.
1039 * NEWS (2.4.2): Document.
1040 * THANKS (Didier Godefroy): Add.
1041 * bootstrap.conf (gnulib_modules): Add pipe.
1042 * gnulib: Update to latest to make sure we have all the latest
1043 fixes.
1044 * lib/local.mk (lib_libbison_a_SOURCES): Remove subpipe.h and
1045 subpipe.c.
1046 * po/POTFILES.in (lib/subpipe.c): Remove.
1047 * src/files.c (compute_output_file_names): Update invocations
1048 of output_file_name_check.
1049 (output_file_name_check): In the case that the grammar file
1050 would be overwritten, use complain instead of fatal, but replace
1051 the output file name with /dev/null. Use the /dev/null solution
1052 for the case of two conflicting output files as well because it
1053 seems safer in case Bison one day tries to open both files at
1054 the same time.
1055 * src/files.h (output_file_name_check): Update prototype.
1056 * src/output.c (output_skeleton): Use create_pipe_bidi and
1057 wait_subprocess. Assert that scan_skel completely drains the
1058 pipe.
1059 * src/scan-skel.l (at_directive_perform): Update
1060 output_file_name_check invocation.
1061 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Check that the
1062 grammar file actually isn't overwritten.
1063 (Conflicting output files: -o foo.y): Update expected output.
1064 * tests/skeletons.at (Fatal errors but M4 continues producing
1065 output): New test group.
1066
e32050b0
JD
10672010-02-04 Joel E. Denny <jdenny@ces.clemson.edu>
1068
1069 Update POTFILES.
1070 * HACKING (Release Procedure): Add reminder about keeping
1071 POTFILES files up-to-date.
1072 * po/POTFILES.in (src/muscle-tab.c, src/scan-skel.l): Add.
1073
efc4ed4a
JD
10742010-02-01 Joel E. Denny <jdenny@clemson.edu>
1075
1076 Code cleanup.
1077 * tests/atlocal.in (abs_top_srcdir): Remove shell variable,
1078 which is already defined in atconfig.
1079
95611b56
JD
10802010-01-22 Joel E. Denny <jdenny@clemson.edu>
1081
1082 tests: fix missing include caught by g++ 4.4.1.
1083 Reported by Tys Lefering.
1084 * HACKING (Release checks): Add note about trying a recent GCC.
1085 * tests/regression.at (_AT_DATA_DANCER_Y): For C++, include
1086 cstdlib for abort.
1087 (_AT_DATA_EXPECT2_Y): Likewise.
1088
d6e40cba
JD
10892010-01-21 Joel E. Denny <jdenny@clemson.edu>
1090
1091 * cfg.mk (gnulib_dir): Assume gnulib is a subdirectory.
1092
80b70223
JD
10932010-01-21 Joel E. Denny <jdenny@clemson.edu>
1094
1095 maint: automate PACKAGE_COPYRIGHT_YEAR update, and update it.
1096 * HACKING (Release Procedure): Update notes on copyright years.
1097 * Makefile.am (update-package-copyright-year): New target rule.
1098 * build-aux/update-package-copyright-year: New file.
1099 * cfg.mk (update-copyright): Add update-package-copyright-year
1100 as a dependency.
1101
3320a276
JD
11022010-01-19 Joel E. Denny <jdenny@clemson.edu>
1103
1104 * bootstrap: Import improvements from latest gnulib.
1105
e30c0477
JD
11062010-01-19 Joel E. Denny <jdenny@clemson.edu>
1107
1108 build: require Automake 1.11.1 to avoid a security flaw.
1109 * HACKING (Release Procedure): Don't document Automake security
1110 flaw here.
1111 * configure.ac (AM_INIT_AUTOMAKE): Require 1.11.1, and explain
1112 why here.
1113
a538eeb1
JD
11142010-01-19 Joel E. Denny <jdenny@clemson.edu>
1115
1116 gnulib: update to latest.
1117
d6bdb90a
JD
11182010-01-19 Joel E. Denny <jdenny@clemson.edu>
1119
1120 ChangeLog (2006-09-15): add Odd Arild Olsen's role for push.c.
1121
326e5cf8
JD
11222010-01-15 Joel E. Denny <jdenny@clemson.edu>
1123
1124 Thank the developer of the initial push parser implementation.
1125 This unfortunate oversight is several years old.
1126 * THANKS (Odd Arild Olsen): Add.
1127
fca9c5ef
JD
11282010-01-04 Joel E. Denny <jdenny@clemson.edu>
1129
1130 Fix some comments concerning LR(0) versus LALR(1).
1131
1132 Stop equating LR(0) with nondeterminism and LALR(1) with
1133 determinism. That is, if all states are consistent, then LR(0)
1134 tables are deterministic. On the other hand, LALR(1) tables
1135 might be nondeterministic before conflict resolution, and GLR
1136 permits LALR(1) tables to remain nondeterministic.
1137 * src/LR0.c, src/LR0.h: Here.
1138 * src/lalr.c, src/lalr.h: Here.
1139 * src/main.c (main): Here.
1140 * src/state.c, src/state.h: Here.
1141
1142 * src/ielr.h (ielr): In preconditions, expect LR(0) not LALR(1)
1143 parser tables.
1144
e141f4d4
JD
11452010-01-04 Joel E. Denny <jdenny@clemson.edu>
1146
1147 maint: run "make update-copyright"
1148
882be728
JD
11492009-12-30 Joel E. Denny <jdenny@clemson.edu>
1150
1151 POSIX: complain if %prec's token was not defined.
1152 * NEWS (2.5): Document.
1153 * src/reader.c (grammar_rule_check): Convert warning to
1154 complaint.
1155 * tests/input.at (%prec's token must be defined): Update.
1156
8bb3a2e7
JD
11572009-12-30 Joel E. Denny <jdenny@clemson.edu>
1158
1159 POSIX: warn if %prec's token was not defined.
1160 Reported by Florian Krohm at
1161 <http://lists.gnu.org/archive/html/bug-bison/2009-12/msg00005.html>.
1162 * NEWS (2.4.2): Document.
1163 * src/reader.c (grammar_rule_check): Implement.
1164 (grammar_current_rule_prec_set): Add comments explaining that we
1165 here assume a %prec identifier is a token, but we still manage
1166 to support POSIX.
1167 * tests/input.at (%prec's token must be defined): New test
1168 group.
1169
505e1551
JD
11702009-12-31 Joel E. Denny <jdenny@clemson.edu>
1171
1172 * HACKING (Release Procedure): Recommend a secure automake.
1173
b8d19cf8
JD
11742009-12-29 Joel E. Denny <jdenny@clemson.edu>
1175
1176 portability: `<' and `>' are not always defined on addresses.
1177 Specifically, don't sort objects by their memory addresses when
1178 they're not allocated in the same array or other object. Though
1179 I haven't found a test case where that fails on my platform, C
1180 says the behavior is undefined.
1181 * src/AnnotationList.c (AnnotationList__insertInto): Remove
1182 FIXME. Use new id field of InadequacyList nodes rather than
1183 their memory addresses when sorting.
1184 (AnnotationList__compute_from_inadequacies): Add
1185 inadequacy_list_node_count argument to pass to
1186 InadequacyList__new_conflict.
1187 * src/AnnotationList.h
1188 (AnnotationList__compute_from_inadequacies): Update prototype
1189 and documentation for new argument.
1190 * src/InadequacyList.c (InadequacyList__new_conflict): Add
1191 node_count argument and use it to assign a unique ID.
1192 * src/InadequacyList.h (InadequacyListNodeCount): New typedef.
1193 (InadequacyList): Add id field.
1194 (InadequacyList__new_conflict): Update prototype and
1195 documentation for new argument.
1196 * src/ielr.c (ielr_compute_annotation_lists): Update
1197 AnnotationList__compute_from_inadequacies invocation.
1198
df222dfa
JD
11992009-12-20 Joel E. Denny <jdenny@clemson.edu>
1200
1201 Fix handling of yychar manipulation in user semantic actions.
1202 The problem was that yacc.c didn't always update the yychar
1203 translation afterwards. However, other skeletons appear to be
1204 fine. glr.c appears to already translate yychar before every
1205 use. lalr1.cc does not define yychar and does not document its
1206 replacement, yyla, for users. It does provide yyclearin, but
1207 that does not manipulate yyla and thus requires no translation
1208 update. In lalr1.java, yychar is out of scope during semantic
1209 actions.
1210 * NEWS (2.5): Document.
1211 * data/yacc.c (YYBACKUP): Don't bother translating yychar into
1212 yytoken here.
1213 (yyparse, yypush_parse): Instead, translate before every use of
1214 yytoken, and add comments explaining this approach.
1215 * tests/actions.at (Destroying lookahead assigned by semantic
1216 action): New test group checking that translation happens before
1217 lookahead destructor calls at parser return. Previously,
1218 incorrect destructors were called.
1219 * tests/conflicts.at (parse.error=verbose and consistent
1220 errors): New test group checking that translation happens at
1221 syntax error detection before the associated verbose error
1222 message and the associated lookahead destructor calls. While
1223 the destructor call is fixed by this patch, the verbose error
1224 message is currently incorrect due to another bug (see
1225 comments in test group), so this is an expected failure for now.
1226
4395a9ff
JD
12272009-12-21 Joel E. Denny <jdenny@clemson.edu>
1228
1229 YYFAIL: warn about uses and remove from lalr1.java.
1230 * NEWS (2.5): Document.
9d6bc5c4 1231 * data/lalr1.java (YYParser::YYFAIL): Rename to YYERRLAB,
4395a9ff
JD
1232 and make it private. Update all uses.
1233 * src/scan-code.l (SC_RULE_ACTION): Implement warning.
1234
1625df5b
JD
12352009-12-21 Joel E. Denny <jdenny@clemson.edu>
1236
1237 YYFAIL: deprecate.
1238 * NEWS (2.4.2): Document deprecation and the phase-out plan.
9d6bc5c4 1239 * data/lalr1.java (YYParser::YYFAIL): Add comment about
1625df5b
JD
1240 deprecation.
1241 * data/yacc.c (YYFAIL): Likewise, and suppress warnings about
1242 YYFAIL from GCC cpp's -Wunused-macros.
1243 * doc/bison.texinfo (Java Action Features): Remove YYFAIL
1244 documentation.
1245 (LocalWords): Remove YYFAIL.
1246
5335b65a
JD
12472009-12-20 Joel E. Denny <jdenny@clemson.edu>
1248
1249 tests: cleanup.
1250 * tests/c++.at (Syntax error discarding no lookahead): Don't
1251 ignore stderr. Instead, eliminate remaining warnings.
1252
d59beda0
JD
12532009-12-18 Joel E. Denny <jdenny@clemson.edu>
1254
1255 lalr1.cc: don't discard non-existent lookahead on syntax error.
9d6bc5c4 1256 * data/lalr1.cc (yy::parser::parse): Check yyempty first.
d59beda0
JD
1257 * tests/c++.at (Syntax error discarding no lookahead): New test
1258 group.
1259
387b4d50
JD
12602009-12-17 Joel E. Denny <jdenny@clemson.edu>
1261
1262 Code cleanup.
1263 * src/symtab.c, src/symtab.h (symbol_class_get_string): Remove
1264 function, which is no longer used.
1265
a603c6e0
JD
12662009-12-16 Joel E. Denny <jdenny@clemson.edu>
1267
1268 Add gcc's -Wundef to test suite and fix another warning from it.
1269 * NEWS (2.4.2): Update description of -Wundef fix.
1270 * configure.ac (WARN_CXXFLAGS_TEST): New substitution.
1271 (WARN_CFLAGS_TEST): New substitution.
1272 * data/glr.c: Avoid warning about __STRICT_ANSI__.
1273 * tests/atlocal.in (CFLAGS): Use WARN_CFLAGS_TEST instead of
1274 WARN_CFLAGS.
1275 (NO_WERROR_CFLAGS): Likewise.
1276 (CXXFLAGS): Use WARN_CXXFLAGS_TEST instead of WARN_CXXFLAGS.
1277
19750d31
JD
12782009-12-16 Joel E. Denny <jdenny@clemson.edu>
1279
1280 * data/yacc.c: Reformat m4 a little.
1281
c938d650
JD
12822009-12-16 Joel E. Denny <jdenny@clemson.edu>
1283
1284 Document gcc -Wundef fix.
1285 * NEWS (2.4.2): Here.
1286 * THANKS (Jonathan Nieder): Add.
1287
fcd32abd
JN
12882009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
1289
1290 Simplify y.tab.c when location tracking is disabled.
1291 * data/yacc.c: Do not check YYLTYPE_IS_TRIVIAL if location
1292 tracking is not enabled. Instead, unconditionally define
1293 YY_LOCATION_PRINT as a no-op for backward compatibility.
1294
ae93128c
JN
12952009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
1296
1297 Avoid warnings from gcc -Wundef y.tab.c.
1298 * data/glr.c: Check if YYENABLE_NLS and YYLTYPE_IS_TRIVIAL are
1299 defined before using them.
1300 * data/lalr1.cc: Likewise.
1301 * data/yacc.c: Likewise.
1302
c843aaab
JD
13032009-12-15 Joel E. Denny <jdenny@clemson.edu>
1304
1305 autoconf: update to latest for fix of M4 detection.
1306 Reported by Eric Blake.
1307 * submodules/autoconf: Update.
1308
5c99151a
JD
13092009-12-15 Joel E. Denny <jdenny@clemson.edu>
1310
1311 portability: use -DGNULIB_POSIXCHECK.
1312 Reported by Eric Blake. See discussions at
1313 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00008.html>
1314 and
1315 <http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00108.html>.
1316 * HACKING (Release checks): Suggest -DGNULIB_POSIXCHECK.
1317 * bootstrap.conf (gnulib_modules): Add all the printf modules
1318 suggested by -DGNULIB_POSIXCHECK. Add realloc-posix as
1319 suggested by -DGNULIB_POSIXCHECK for gnulib's own vasnprintf.c.
1320 (excluded_files): Remove m4/printf-posix.m4.
1321 * tests/atlocal.in (LIBS): As for LDADD in src/local.mk, add
1322 lib/libbison.a so gnulib libraries can be linked.
1323
75f94c6d
JD
13242009-12-15 Joel E. Denny <jdenny@clemson.edu>
1325
1326 gnulib: update for fix of fprintf-posix, which we'll use soon.
1327 * etc/prefix-gnulib-mk (prefix): Adjust regex for make file
1328 targets so that gnulib's new arg-nonnull.h and link-warning.h
1329 are matched.
1330 * gnulib: Update.
1331
ca01f454
JD
13322009-12-14 Joel E. Denny <jdenny@clemson.edu>
1333
1334 Enable assertion output and --disable-assert for configure.
1335 * bootstrap.conf (gnulib_modules): Add assert module.
1336 * src/system.h (aver): Define as assert, and summarize the
1337 discussion on this issue.
1338
9dc3ee6d
JD
13392009-12-14 Joel E. Denny <jdenny@clemson.edu>
1340
1341 Expand GLR acronym in summary of Bison.
1342 Based on discussion with Akim Demaille starting at
1343 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00087.html>.
1344 * doc/bison.texinfo (Introduction): Here.
1345 * src/getargs.c (usage): Here.
1346
d013372c
AR
13472009-10-03 Alex Rozenman <rozenman@gmail.com>
1348
1349 Document named references.
1350 * doc/bison.texinfo (Actions): Add new example and xref to
1351 Using Named References node.
1352 (Using Named References): New node.
1353
5297ebb3
JD
13542009-10-16 Joel E. Denny <jdenny@clemson.edu>
1355
1356 cleanup.
1357 * src/Sbitset.c (Sbitset__new_on_obstack): Use Sbitset instead
1358 of char*.
1359 (Sbitset__isEmpty): Use Sbitset instead of char*.
1360 * src/Sbitset.h (Sbitset): Make it a pointer to unsigned char
1361 instead of char. This helps to avoid casting errors.
1362 (Sbitset__or): Use Sbitset instead of char*.
1363
175620d3
JD
13642009-10-16 Joel E. Denny <jdenny@clemson.edu>
1365
1366 portability: don't assume 8-bit bytes.
1367 That is, use CHAR_BIT and UCHAR_MAX instead of 8 and 0xff.
1368 * src/Sbitset.h (Sbitset__nbytes): Here.
1369 (Sbitset__byteAddress): Here.
1370 (Sbitset__bit_mask): Here.
1371 (Sbitset__last_byte_mask): Here.
1372 (Sbitset__ones): Here.
1373 (SBITSET__FOR_EACH): Here.
1374
786578e3
JD
13752009-10-11 Joel E. Denny <jdenny@clemson.edu>
1376
1377 portability: use va_start and va_end in the same function.
1378 * src/complain.c (error_message): Move va_end from here...
1379 (ERROR_MESSAGE): ... to here.
1380
416a9da6
JD
13812009-10-08 Joel E. Denny <jdenny@clemson.edu>
1382
1383 * data/bison.m4: Update comments for rename to muscle-tab.h.
1384
10659d0e
JD
13852009-10-07 Joel E. Denny <jdenny@clemson.edu>
1386
1387 Minor code cleanup.
1388 * src/muscle-tab.c (MUSCLE_USER_NAME_CONVERT): Remove macro and
1389 replace all uses with UNIQSTR_CONCAT.
1390 * src/uniqstr.c (uniqstr_vsprintf): New function.
1391 * src/uniqstr.h (uniqstr_vsprintf): Add prototype.
1392 (UNIQSTR_CONCAT, UNIQSTR_GEN_FORMAT, UNIQSTR_GEN_FORMAT_): New
1393 macros.
1394
3c5362b8
JD
13952009-10-06 Joel E. Denny <jdenny@clemson.edu>
1396
1397 * TODO (Complaint submessage indentation): New.
1398
b143f404
JD
13992009-10-04 Joel E. Denny <jdenny@clemson.edu>
1400
1401 Minor code cleanup.
1402 * src/parse-gram.y: Clean up sorting of declarations.
1403 Use types to simplify %printer declarations where possible.
1404 Provide %printer for BRACKETED_ID and symbol.prec.
1405 * src/symtab.c: Whitespace change.
1406
7439c5c0
JD
14072009-10-04 Joel E. Denny <jdenny@clemson.edu>
1408
1409 tests: skip tests of file names that platform does not support.
1410 Reported by Michael Raskin at
1411 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00001.html>.
1412 * THANKS (Michael Raskin): Add.
1413 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Fix. Cygwin used
1414 to fail at least for file names containing ":" or "\".
1415
45319f13
JD
14162009-09-23 Joel E. Denny <jdenny@clemson.edu>
1417
1418 yysyntax_error: avoid duplicate lookahead collection.
1419 Except when memory reallocation is required, this change
1420 eliminates the need to invoke yysyntax_error twice and thus to
1421 repeat the collection of lookaheads. It also prepares for
1422 future extensions that will make those repetitions more
1423 expensive and that will require additional memory management in
1424 yysyntax_error. Finally, it fixes an obscure bug already
1425 exercised in the test suite.
1426 * data/yacc.c (yysyntax_error): Add arguments for message
1427 buffer variables stored in the parser. Instead of size, return
1428 status similar to yyparse status but indicating success of
1429 message creation. Other than the actual reallocation of the
1430 message buffer, import and clean up memory management code
1431 from...
1432 (yyparse, yypush_parse): ... here.
1433 * tests/regression.at (parse.error=verbose overflow): No longer
1434 an expected failure.
1435
52cea04a
JD
14362009-09-23 Joel E. Denny <jdenny@clemson.edu>
1437
1438 yysyntax_error: test memory management more.
1439 * tests/atlocal.in (NO_WERROR_CFLAGS): New cpp macro.
1440 * tests/regression.at (parse.error=verbose and
1441 YYSTACK_USE_ALLOCA): New test group.
1442 (parse.error=verbose overflow): New test group that reveals an
1443 obscure bug. Expected fail for now.
1444
37318e2f
JD
14452009-10-04 Joel E. Denny <jdenny@clemson.edu>
1446
1447 benchmarks: use %debug consistently among grammars.
1448 * etc/bench.pl.in (generate_grammar_triangular): Do not activate
1449 %debug by default. It can affect the timings even if yydebug=0.
1450 (generate_grammar_calc): For consistency with other grammars,
1451 use YYDEBUG environment variable to set yydebug.
1452
f74d6d25
JD
14532009-10-03 Joel E. Denny <jdenny@clemson.edu>
1454
1455 Remove dead code.
1456 * src/symtab.c (symbol_pack): Here because every symbol's number
1457 is always defined by this time.
1458
5b1ff423
AR
14592009-10-03 Alex Rozenman <rozenman@gmail.com>
1460
1461 Add additional space after periods in NEWS.
1462 * NEWS (2.5): here.
1463
47eced30
JD
14642009-09-29 Joel E. Denny <jdenny@clemson.edu>
1465
1466 Use the correct conversion specifier for size_t.
1467 Reported by Jim Meyering.
1468 * src/Sbitset.h (SBITSET__INDEX__CONVERSION_SPEC): New, "zu"
1469 because Sbitset__Index is size_t.
1470 * src/Sbitset.c (Sbitset__fprint): Use it instead of %d.
1471
d8f68fc2
JD
14722009-09-27 Joel E. Denny <jdenny@clemson.edu>
1473
1474 tests: don't abuse AT_BISON_CHECK.
1475 * tests/regression.at (parse-gram.y: LALR = IELR): Move
1476 additional shell commands outside of AT_BISON_CHECK.
1477
43aabb70
JD
14782009-09-26 Joel E. Denny <jdenny@clemson.edu>
1479
1480 tests: check that parse-gram.y's IELR and LALR are identical.
1481 * tests/atlocal.in (abs_top_srcdir): New shell variable.
1482 * tests/regression.at (parse-gram.y: LALR = IELR): New test
1483 group.
1484
66381412
AR
14852009-09-19 Alex Rozenman <rozenman@gmail.com>
1486
1487 Keep sub-messages aligned. Fix strings for translation.
5b1ff423
AR
1488 * src/location.h (location_print): Add return value.
1489 * src/location.c (location_print): Return number of printed
66381412 1490 characters.
5b1ff423
AR
1491 * src/complain.h (complain_at_indent, warn_at_indent): Prototype
1492 new functions.
1493 * src/complain.cpp (indent_ptr): New static variable.
1494 (error_message, complain_at_indent, warn_at_indent): Implement
1495 the alignment mechanism.
1496 * src/scan-code.l (parse_ref, show_sub_messages): Fix strings
1497 for translations. Use new alignment mechanism.
1498 * tests/named-ref.at: Adjust test-cases.
66381412
AR
1499 * NEWS (2.5): Add an announcement about named references.
1500
a6ca4ce2
AD
15012009-09-17 Akim Demaille <demaille@gostai.com>
1502
1503 doc: fixes.
1504 * doc/bison.texinfo: here.
1505 Reported by Alex Rozenman.
1506
3cdc21cf
AD
15072009-09-16 Akim Demaille <demaille@gostai.com>
1508
1509 doc: lalr1.cc and variants.
1510 * doc/bison.texinfo (Decl Summary): Document the "lex_symbol" and
1511 "variant" %define variables.
1512 (C++ Semantic Values): Split into...
1513 (C++ Unions, C++ Variants): these.
1514 The latter is new.
1515 (C++ Parser Interface): Fix type names.
1516 Document parser::syntax_error.
1517 Document the fact that locations are not mandatory.
1518 (C++ Scanner Interface): Split into...
1519 (Split Symbols, Complete Symbols): these.
1520 The later is new.
1521 (Calc++ Parsing Driver): Use variants.
1522 Add more comments.
1523 Adjust style.
1524 (Calc++ Parser): Declare all the tokens, no
1525 longer accept raw characters.
1526 Remove %union.
1527 Adjust types and printers.
1528 Remove destructors.
1529 (Calc++ Scanner): Use make_<SYMBOL> functions.
1530 Use strerror in error message.
1531
f50bfcd6
AD
15322009-09-16 Akim Demaille <demaille@gostai.com>
1533
1534 doc: spell checking.
1535 * doc/bison.texinfo: here.
1536
6b5a0de9
AD
15372009-09-16 Akim Demaille <demaille@gostai.com>
1538
1539 doc: comment changes.
1540 * doc/bison.texinfo: Comment changes.
1541
2b08bceb
AD
15422009-09-16 Akim Demaille <demaille@gostai.com>
1543
1544 lalr1.cc: factor the yytranslate_ invocation in make_SYMBOLS.
1545 * data/c++.m4, data/lalr1.cc (parser::symbol_type): Change the
1546 constructor to take a token_type instead of the (internal) symbol
1547 number.
1548 Call yytranslate_.
1549 * data/variant.hh (b4_symbol_constructor_define_): Therefore,
1550 don't call yytranslate_ here.
1551
c981ce9b
AD
15522009-09-16 Akim Demaille <demaille@gostai.com>
1553
1554 TODO: statistics.
1555 * TODO (Figures): New.
1556
00d80a9c
JD
15572009-09-13 Joel E. Denny <jdenny@clemson.edu>
1558
1559 tests: clean up push.at test group titles.
1560 * tests/push.at: Remove "Push Parsing: " from test group titles
1561 because these are already under the banner "Push Parsing Tests".
1562
f64e406b
AR
15632009-09-12 Alex Rozenman <rozenman@gmail.com>
1564
1565 Provide an additional sub-message for clarity.
1566 Add "symbol not found in production" error message when
1567 an "invalid reference" is detected in named references
1568 resolution.
1569 * src/scan-code.l: Update "invalid reference" case.
1570 * tests/named-ref.at: Adjust test-cases.
1571
bb31eb56
JD
15722009-09-10 Joel E. Denny <jdenny@clemson.edu>
1573
1574 Clean up yacc.c a little.
1575 * data/yacc.c: Clean up M4 for readability, and make output
1576 whitespace more consistent. For the main parse function
1577 comment, instead of saying "yyparse or yypush_parse", say either
1578 "yyparse" or "yypush_parse" depending on which it actually is.
1579
2d399888
JD
15802009-09-10 Joel E. Denny <jdenny@clemson.edu>
1581
1582 Fix --enable-gcc-warnings.
1583 * src/parse-gram.y (%printer <param>): Handle param_none.
1584
ff601366
AD
15852009-09-09 Akim Demaille <demaille@gostai.com>
1586
1587 lalr1.cc: syntax_error as exceptions.
1588 It is common to use sort of factories in the user actions. These
1589 factories may check some "syntactic" constraints that are not
1590 enforced by the grammar itself. This is possible using YYERROR
1591 within the action itself. Provide the user with a means to throw
1592 a syntax_error exception.
1593
1594 * data/c++.m4 (b4_public_types_declare, b4_public_types_define):
1595 Declare and define yy::parser::syntax_error.
1596 * data/lalr1.cc: Include stdexcept.
1597 (yy::parser::parse): Wrap the user action within a try/catch.
1598 * data/glr.cc: Include stdexcept.
1599
29660062
AD
16002009-09-09 Akim Demaille <demaille@gostai.com>
1601
1602 lalr1.cc: add missing "inline".
1603 * data/c++.m4 (b4_public_types_define): Add missing inline to
1604 implementations provided in headers.
1605
2055a44e
AD
16062009-09-09 Akim Demaille <demaille@gostai.com>
1607
1608 %param: documentation.
1609 * NEWS (2.6): Document %param, %lex-param, and %parse-param
1610 changes.
1611 * doc/bison.texinfo: Document that %lex-param and %parse-param
1612 are n-ary.
1613 Changes some examples to demonstrate it.
1614 (Calc++ Parser): Use %param.
1615
dd875058
AD
16162009-09-09 Akim Demaille <demaille@gostai.com>
1617
1618 Regen.
1619
f71db70b
AD
16202009-09-09 Akim Demaille <demaille@gostai.com>
1621
1622 style changes.
1623 * src/parse-gram.y (add_param): Scope changes.
1624
eaca4c11
AD
16252009-09-09 Akim Demaille <demaille@gostai.com>
1626
1627 %parse: support several arguments.
1628 * src/parse-gram.y (current_param): New.
1629 (param_type): Add param_none.
1630 (params): New nonterminal.
1631 Use it.
1632
b18cdd91
AD
16332009-09-09 Akim Demaille <demaille@gostai.com>
1634
1635 Regen.
1636
a7706735
AD
16372009-09-09 Akim Demaille <demaille@gostai.com>
1638
1639 %param.
1640 Provide a means to factor lex-param and parse-param common
1641 declarations.
1642
1643 * src/parse-gram.y (param_type): New.
1644 Define a %printer for it.
1645 (add_param): Use it.
1646 (%parse-param, %lex-param): Merge into...
1647 (%parse): this new token.
1648 Adjust the grammar to use it.
1649 * src/scan-gram.l (RETURN_VALUE): New.
1650 (RETURN_PERCENT_FLAG): Use it.
1651 (RETURN_PERCENT_PARAM): New.
1652 Use it to support %parse-param, %lex-param and %param.
1653
9789acf0
JD
16542009-09-03 Joel E. Denny <jdenny@clemson.edu>
1655
1656 Use aver not assert.
1657 * src/output.c: Don't include assert.h.
1658 (output_skeleton): Use aver not assert.
1659 * src/system.h (aver): In documentation of why, add links to
1660 Paul Eggert's explanations in the mailing lists.
1661
61bc57e5
AR
16622009-09-05 Alex Rozenman <rozenman@gmail.com>
1663
1664 Use "Unresolved reference" error message when no symbols were found
1665 in a symbolic reference resolution. Remove .expr and -expr from
1666 the shown reference when the reference is unresolved.
1667 * src/scan-code.l: Change the error message, adjust location columns,
1668 rename variable "exact_mode" to "explicit_bracketing".
1669 * tests/named-ref.at: Adjust existing tests and add a new one.
1670
f4c75eaf
AD
16712009-09-04 Akim Demaille <demaille@gostai.com>
1672
1673 Adjust synclines in src/parse-gram.[ch].
1674 * tests/bison.in: Do some magic (including working around issues
1675 with ylwrap) when this wrapper is used to compile
1676 src/parse-gram.y.
1677
c6abeab1
JD
16782009-09-03 Joel E. Denny <jdenny@clemson.edu>
1679
1680 Complain about unused %define variables and %code qualifiers.
1681 * NEWS (2.5): Document.
1682 * data/bison.m4 (b4_check_user_names): Complain instead of warn.
1683 * doc/bison.texinfo (Decl Summary): Document complaint, and
1684 improve %define documentation a little otherwise.
1685 * tests/input.at (Reject unused %code qualifiers): Update.
1686 (%define errors): Update.
1687 (%define, --define, --force-define): Update.
1688 (%define backward compatibility): Update.
1689 (Unused %define api.pure): Update.
1690 * tests/push.at (Push Parsing: Unsupported Skeletons): Update.
1691
82db7cdb
JD
16922009-09-03 Joel E. Denny <jdenny@clemson.edu>
1693
1694 Don't suppress warnings about unused parse.error.
1695 * data/bison.m4 (b4_error_verbose_flag): Don't examine value of
1696 %define variable parse.error unless b4_error_verbose_flag is
1697 actually expanded in a skeleton.
1698
2755de8f
AD
16992009-09-03 Akim Demaille <demaille@gostai.com>
1700
1701 * NEWS (2.4.2): Add "Internationalization" item.
1702
1deef26d
AD
17032009-09-03 Akim Demaille <demaille@gostai.com>
1704
1705 bootstrap: fix/improve find_tool.
1706 * bootstrap (find_tool): Improve error messages.
1707 Fix typo about find_tool_names.
1708
2646cd54
JD
17092009-08-29 Joel E. Denny <jdenny@clemson.edu>
1710
1711 Fix gcc 3.4.4 shadowing warning reported by Eric Blake.
1712 See
1713 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00093.html>.
1714 * src/scan-code.h (code_props_rule_action_init): Rename
1715 named_ref arg to name so it doesn't shadow named_ref type. This
1716 makes it consistent with the function definition in scan-code.l
1717 anyway.
1718
cf499cff
JD
17192009-08-28 Joel E. Denny <jdenny@clemson.edu>
1720
1721 %define: accept unquoted values.
1722 * NEWS (2.5): Group all %define changes together, and document
1723 this one. Remove quotes in IELR and canonical LR entry.
1724 * doc/bison.texinfo: Remove quotes in most examples throughout.
1725 (Decl Summary): Update %define documentation.
1726 (Table of Symbols): Likewise.
1727 * src/ielr.c (LrType): Update documentation.
1728 * src/parse-gram.y (content.opt): Add production for ID.
1729 * tests/actions.at: Remove quotes in most tests.
1730 * tests/calc.at: Likewise.
1731 * tests/existing.at: Likewise.
1732 * tests/input.at: Likewise.
1733 * tests/local.at: Likewise.
1734 * tests/push.at: Likewise.
1735 * tests/reduce.at: Likewise.
1736 * tests/torture.at: Likewise.
1737
6ba96404
JD
17382009-08-28 Joel E. Denny <jdenny@clemson.edu>
1739
1740 %define lr.type: make values lowercase IDs.
1741 That is, "LALR" => "lalr", "IELR" => "ielr", and
1742 "canonical LR" => "canonical-lr".
1743 * NEWS (2.5): Update documentation.
1744 * doc/bison.texinfo (Decl Summary): Likewise.
1745 * src/ielr.c (ielr): Use new values.
1746 * src/ielr.h (ielr): Update documentation.
1747 * src/reader.c (prepare_percent_define_front_end_variables): Use
1748 and validate new values.
1749 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): Update test
1750 grammars.
1751 * tests/reduce.at (AT_TEST_LR_TYPE): Likewise.
1752
4413bbd3
EB
17532009-08-27 Eric Blake <ebb9@byu.net>
1754
1755 scan-gram: avoid portability trap with ctype usage.
1756 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
1757 Avoid compiler warning.
1758
b70c7fb4
JD
17592009-08-27 Joel E. Denny <jdenny@clemson.edu>
1760
1761 tests: use perl for printing special sequences to files.
1762 And skip tests if perl is not available. This is better than
1763 playing tricks with shell portability. Suggested by Akim
1764 Demaille.
1765 * tests/input.at (Bad character literals): Use it here for
1766 omitting final newlines.
1767 (Bad escapes in literals): Use it here for special characters.
1768
d1cc31c5
JD
17692009-08-26 Joel E. Denny <jdenny@clemson.edu>
1770
1771 tests: show a use of %define lr.default-reductions "consistent"
1772 * tests/conflicts.at (%nonassoc and eof): Extend to test that it
1773 prevents the omission of expected tokens for %error-verbose.
1774
3bed3a75
AD
17752009-08-26 Akim Demaille <demaille@gostai.com>
1776
1777 tests: portability fix.
1778 * tests/input.at (Bad escapes in literals): Don't expect "echo
1779 '\0'" to output \ then 0.
1780
aa0cb40d
JD
17812009-08-26 Joel E. Denny <jdenny@clemson.edu>
1782
1783 Actually handle the yytable zero value correctly this time.
1784 * data/bison.m4 (b4_integral_parser_tables_map): Don't mention
1785 zero values in the YYTABLE comments.
1786 * data/glr.c (yytable_value_is_error): Don't check for zero
1787 value.
1788 * data/lalr1.cc (yy_table_value_is_error_): Likewise.
1789 * data/yacc.c (yytable_value_is_error): Likewise.
1790 * data/lalr1.java (yy_table_value_is_error_): Likewise.
1791 (yysyntax_error): Fix typo in code: use yytable_ not yycheck_.
1792 * src/tables.h: In header comments, explain why it's useless to
1793 check for a zero value in yytable.
1794
f2b30bdf
JD
17952009-08-25 Joel E. Denny <jdenny@clemson.edu>
1796
1797 More fixes related to last two patches.
1798 * data/bison.m4 (b4_integral_parser_tables_map): Fix YYTABLE
1799 comments: zero indicates syntax error not default action.
1800 * data/c.m4 (b4_table_value_equals): Comment that YYID must be
1801 defined.
1802 * data/glr.c (yyis_pact_ninf): Rename to...
1803 (yypact_value_is_default): ... this.
1804 (yyisDefaultedState): Update for rename.
1805 (yyis_table_ninf): Rename to...
1806 (yytable_value_is_error): ... this, and check for value zero
1807 besides just YYTABLE_NINF.
1808 (yygetLRActions): Check for default value from yypact. It
1809 appears that this check is always performed before this function
1810 is invoked, and so adding the check here is probably redundant.
1811 However, the code may evolve after this subtlety is forgotten.
1812 Also, update for rename to yytable_value_is_error. Because that
1813 macro now checks for zero, a different but equivalent branch of
1814 the if-then-else here is evaluated.
1815 (yyreportSyntaxError): Update for rename to
1816 yytable_value_is_error. The zero condition was mishandled
1817 before.
1818 (yyrecoverSyntaxError): Update for renames. No behavioral
1819 changes.
1820 * data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_):
1821 New function.
1822 (yy_table_value_is_error_): New function.
1823 (parse): Use new functions where possible. No behavioral
1824 changes.
1825 (yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_.
1826 The zero condition was mishandled before.
1827 * data/yacc.c (yyis_pact_ninf): Rename to...
1828 (yypact_value_is_default): ... this.
1829 (yyis_table_ninf): Rename to...
1830 (yytable_value_is_error): ... this, and check for value zero
1831 besides just YYTABLE_NINF.
1832 (yysyntax_error): Update for rename to yytable_value_is_error.
1833 The zero condition was mishandled before.
1834 (yyparse): Update for renames. No behavioral changes.
1835 * src/tables.h: Improve comments about yypact, yytable, etc.
1836 more. Most importantly, say yytable value of zero means syntax
1837 error not default action.
1838
53f036ce
JD
18392009-08-25 Joel E. Denny <jdenny@clemson.edu>
1840
1841 Fix %error-verbose for conflicts resolved by %nonassoc.
1842 * NEWS (2.5): Document.
1843 * data/glr.c (yyreportSyntaxError): Fix this by checking
1844 yyis_table_ninf.
1845 * data/yacc.c (yysyntax_error): Likewise.
1846 * data/lalr1.cc (yysyntax_error_): Fix this by checking
1847 yytable_ninf_.
1848 * data/lalr1.java (yysyntax_error): Likewise.
1849 * tests/conflicts.at (%nonassoc and eof): Update expected output
1850 and remove FIXME.
1851
87412882
JD
18522009-08-25 Joel E. Denny <jdenny@clemson.edu>
1853
1854 Some code and documentation improvements.
1855 * data/c.m4 (b4_table_value_equals): New macro to capture
1856 some repeated code.
1857 * data/glr.c (yyis_pact_ninf): Use it here.
1858 (yyis_table_ninf): Likewise.
1859 (yyreportSyntaxError): Improve internal comments.
1860 * data/yacc.c (yyis_pact_ninf): New macro copied from glr.c.
1861 Use it everywhere possible.
1862 (yyis_table_ninf): Likewise.
1863 (yysyntax_error): Improve internal comments.
1864 * data/lalr1.cc (yysyntax_error_): Likewise.
1865 * data/lalr1.java (yysyntax_error): Likewise.
1866 * src/tables.h: Improve comments about yypact, yytable, etc.
1867
e6c849d8
JD
18682009-08-21 Joel E. Denny <jdenny@clemson.edu>
1869
1870 Use locale when quoting.
1871 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
1872 quote rather than implementing quoting here.
1873
d8911864
EB
18742009-08-20 Eric Blake <ebb9@byu.net>
1875
b0778bdd
EB
1876 Make previous patch more robust.
1877 * src/output.c (ARRAY_CARDINALITY): New macro, copied from
1878 argmatch.h.
1879 (output_skeleton): Use it.
1880 Suggested by Akim Demaille.
1881
d8911864
EB
1882 Import latest m4/m4.m4.
1883 * submodules/autoconf: Update to autoconf 2.64.
1884 * configure.ac (M4_GNU_OPTION): New define.
1885 * src/output.c (output_skeleton): Use it to resolve FIXME.
1886 * NEWS: Mention this.
1887
c2724603
JD
18882009-08-19 Joel E. Denny <jdenny@clemson.edu>
1889
1890 Fix complaints about escape sequences.
1891 Discussed starting at
1892 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
1893 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
1894 For a \0 and similar escape sequences meaning the null
1895 character, report an invalid escape sequence instead of an
1896 invalid null character because the latter does not actually
1897 appear in the user's input.
1898 In all escape sequence complaints, don't escape the initial
1899 backslash, and don't quote when the sequence appears at the end
1900 of the complaint line unless there's whitespace that quotearg
1901 won't escape.
1902 Consistently say "invalid" not "unrecognized".
1903 Consistently prefer "empty character literal" over "extra
1904 characters in character literal" warning for invalid escape
1905 sequences; that is, consistently discard those sequences.
1906 * tests/input.at (Bad escapes in literals): New.
1907
17aed602
AD
19082009-08-19 Akim Demaille <demaille@gostai.com>
1909
1910 doc: fixes.
1911 * doc/bison.texinfo: Fix minor Texinfo errors.
1912
9142239a
AD
19132009-08-19 Akim Demaille <demaille@gostai.com>
1914
1915 tests: distcc compliance.
1916 * tests/synclines.at (AT_SYNCLINES_COMPILE): Discard distcc's
1917 error messages from the output.
1918
171ad99d
AD
19192009-08-19 Akim Demaille <demaille@gostai.com>
1920
1921 variables: simplify the upgrade of namespace into api.namespace.
1922
1923 This patch simplifies "variables: rename namespace as
1924 api.namespace", commit 67501061076ba46355cfd9f9361c7eed861b389c.
1925 Suggested by Joel E. Denny in
1926 http://lists.gnu.org/archive/html/bison-patches/2009-07/msg00006.html
1927
1928 * src/muscle-tab.c (muscle_percent_variable_update): New.
1929 (muscle_percent_define_insert): Use it in replacement of the
1930 previous tr invocation.
1931 Remove variable_tr, no longer needed.
1932 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
1933 Remove.
1934 * data/c++.m4: No longer handle namespace -> api.namespace.
1935 * tests/input.at (%define backward compatibility): Check that
1936 namespace is treated as api.namespace.
1937
d59e456d
AD
19382009-08-19 Akim Demaille <demaille@gostai.com>
1939
1940 doc: %initial-action to initialize yylloc.
1941 Reported by Bill Allombert.
1942 * doc/bison.texinfo: Set fill-column to 76.
1943 (Location Type): Document the use of %initial-action to initialize
1944 yylloc.
1945
ceb8b8e6
AD
19462009-08-19 Akim Demaille <demaille@gostai.com>
1947
1948 lalr1.cc: use state_type.
1949 * data/lalr1.cc (yysyntax_error_): Use state_type.
1950 Move argument names into yy*.
1951
7580c379
AD
19522009-08-19 Akim Demaille <demaille@gostai.com>
1953
1954 lalr1.cc: get rid of yyparse's yystate.
1955 yystate and yystack_[0].state are equal, keep only the latter.
1956 The former was also used as a temporary variable to compute the
1957 post-reduction state. Move this computation into an auxiliary
1958 function.
1959
1960 * data/glr.c (yyLRgotoState): Fuse variable definition and first
1961 assignment.
1962 * data/lalr1.cc (yy_lr_goto_state_): New.
1963 (yyparse): Use it.
1964 Replace remaining uses of yystate by yystate_[0].state.
1965 Remove the former.
1966
c4dc4c46
AD
19672009-08-19 Akim Demaille <demaille@gostai.com>
1968
1969 lalr1.cc: destroy $$ when YYERROR is called.
1970 * data/lalr1.cc (yyreduce): Compute the resulting state before
1971 running the user action so that yylhs is a valid symbol.
1972 (yyerrorlab): Since yylhs is complete (it knows its type), we can
1973 simply call yy_destroy_ to destroy $$ on YYERROR invocations.
1974 * tests/c++.at (AT_CHECK_VARIANTS): Test YYERROR with variants.
1975
c67e466f
JD
19762009-08-18 Joel E. Denny <jdenny@clemson.edu>
1977
1978 maint: update for gnulib's recent update-copyright changes
1979 * gnulib: Update.
1980 * .x-update-copyright (COPYING): Add as it's no longer implied
1981 when .x-update-copyright is present.
1982 * cfg.mk (update-copyright-local): Remove, now ignored.
1983 (update-copyright): Declare update-b4-copyright as a dependency.
1984
af6d2358
AD
19852009-08-17 Akim Demaille <demaille@gostai.com>
1986
1987 build: require gettext 0.17.
1988
1989 Suggested by Bruno Haible.
1990 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
1991 * configure.ac: require gettext 0.17 to ensure compatibility with
1992 gnulib.
1993
91a2b9b1
AD
19942009-08-17 Akim Demaille <demaille@gostai.com>
1995
1996 build: lower gettext requirements.
1997
1998 Bison was uselessly requiring the formatstring macros from
1999 gettext, which resulted in mo files not being installed on systems
2000 that perfectly supported Bison mo files. Lower the requirement.
2001 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
2002
b0778bdd
EB
2003 * configure.ac: Require need-ngettext instead of
2004 need-formatstring-macros.
2005 Reported by Martin Jabocs.
2006 Suggested by Bruno Haible.
2007 * INSTALL: Restructure.
2008 (Internationalization): New.
91a2b9b1 2009
585935e8
JD
20102009-08-14 Joel E. Denny <jdenny@clemson.edu>
2011
2012 maint: fix use of copyright year intervals.
2013 * gnulib: Update.
2014 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
2015 as now recommended in gnulib/NEWS.
2016 * build-aux/update-b4-copyright: Fix.
2017 * cfg.mk (update-copyright-env): Configure update-copyright.
2018
83b60c97
JD
20192009-08-13 Joel E. Denny <jdenny@clemson.edu>
2020
2021 Make it easier to write deterministic tests.
2022 Continues Akim's work from his 2009-06-10 commits.
2023 * src/reader.c (check_and_convert_grammar): Don't add any
2024 symbols after the first symbols_do invocation.
2025 * src/symtab.c (symbols_sorted): New static global.
2026 (user_token_number_redeclaration): Update comments.
2027 (symbol_from_uniqstr): If a new symbol is being created, assert
2028 that symbols_sorted hasn't been allocated yet.
2029 (symbols_free): Free symbols_sorted.
2030 (symbols_cmp, symbols_cmp_qsort): New functions.
2031 (symbols_do): Sort symbol_table into symbols_sorted on first
2032 invocation.
2033 * tests/input.at (Numbered tokens): Recombine tests now that the
2034 output should be deterministic across multiple numbers.
2035
28169bab
AD
20362009-08-12 Akim Demaille <demaille@gostai.com>
2037
2038 tests: GCC 4.5 compliance.
2039 * tests/synclines.at (AT_SYNCLINES_COMPILE): Adjust to GCC 4.5's
2040 messages about #error.
2041
9f14e187
AD
20422009-08-12 Akim Demaille <demaille@gostai.com>
2043
2044 build: fix the generation of the documentation.
2045 Some of our targets use "bison --help", but they can't depend on
2046 "bison" itself (to avoid additional requirements on the user), so
2047 they used to call "make src/bison" in the commands. Then
2048 concurrent builds may fail: one make might be aiming one of its
2049 jobs at compiling src/bison, and another job at generating the man
2050 page. If the latter is faster than the former, then we have two
2051 makes that concurrently try to compile src/bison.
2052
2053 This might also be a more convincing explanation for the failure
2054 described in the patch "build: fix paths".
2055
2056 * Makefile.am (SUFFIXES): Initialize.
2057 * build-aux/move-if-change: New, symlink to gnulib's.
2058 * build-aux/local.mk: Ship it.
2059 * doc/common.x: Remove, merged into...
2060 * doc/bison.x: here.
2061 * doc/local.mk (doc/bison.help): New.
2062 ($(CROSS_OPTIONS_TEXI)): Depend on it.
2063 Use src/bison.
2064 (.x.1): Replace with...
2065 (doc/bison.1): this explicit, simpler, target.
2066 (common_dep): Remove, inlined where appropriate.
2067 (SUFFIXES, PREPATH): Remove, unused.
2068
d1b55e81
AD
20692009-08-12 Akim Demaille <demaille@gostai.com>
2070
2071 gnulib: improve prefixing.
2072 * configure.ac (gl_PREFIXED_LIBOBJS): Don't rename it, rather,
2073 change the value of...
2074 (gl_LIBOBJS): this.
2075 Adjust more variables.
2076 * etc/prefix-gnulib-mk (prefix_assignment): Don't rename
2077 gl_LIBOBJS.
2078 (prefix): Also transform rules whose targets have slashes.
2079 Use $prefix liberally.
2080 Map @MKDIR_P@ to $(MKDIR_P).
2081 Prefix directories that are mkdir'd.
2082
838205d5
AD
20832009-08-12 Akim Demaille <demaille@gostai.com>
2084
2085 build: fix paths.
2086 When using $(top_builddir) inconsistently, Make (including GNU
2087 Make) is sometimes confused. As a result it may want to build
2088 lib/libbison.la and $(top_builddir)/lib/libbison.la (the same
2089 file, different names) concurrently, which, amusingly enough,
2090 might end with:
2091
2092 ranlib lib/libbison.a
2093 ranlib lib/libbison.a
2094 make[2]: *** [lib/libbison.a] Segmentation fault
2095
2096 on OS X.
2097
2098 * doc/local.mk, src/local.mk: Do not use $(top_builddir) when not
2099 needed.
2100
67af7198
AD
21012009-08-12 Akim Demaille <demaille@gostai.com>
2102
2103 distcheck: fix.
2104
b0778bdd 2105 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
67af7198 2106
c467dc42
JD
21072009-08-10 Joel E. Denny <jdenny@clemson.edu>
2108
2109 * tests/local.mk (TESTSUITE_AT): Add named-refs.at.
2110
dfaa4860
JD
21112009-08-10 Joel E. Denny <jdenny@clemson.edu>
2112
2113 Miscellaneous code readability improvements.
2114
2115 * src/reader.c (reader): Move %define front-end variable
2116 defaults and checking into...
2117 (prepare_percent_define_front_end_variables): ... this new
2118 function.
2119
2120 * src/scan-gram.l (INITIAL): For consistency with string
2121 literals, don't store open quote on character literal. It's
2122 discarded before returning anyway.
2123 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
2124 Make length test more readable, and make the character stored
2125 for an empty literal more obvious while consistent with the
2126 previous behavior.
2127
2128 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
2129 USER_NUMBER_HAS_STRING_ALIAS throughout.
2130 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
2131 that is repeated in symtab.h. Improve argument names to make it
2132 clear which side of the symbol-string alias pair is which.
2133 (symbol_check_alias_consistency): Improve local variable names
2134 for the same purpose.
2135 * src/symtab.h (struct symbol): Make comments about aliases
2136 clearer.
2137 (symbol_make_alias): Improve comments and argument name.
2138 * src/output.c (token_definitions_output): Update for rename to
2139 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
2140
ce268795
AR
21412009-08-08 Alex Rozenman <rozenman@gmail.com>
2142
2143 Convert "misleading reference" messages to warnings.
2144 * src/scan-code.l: New function 'show_sub_messages', more
2145 factoring.
2146 * tests/named-ref.at: Adjust tests.
2147
401b73af
JD
21482009-08-06 Joel E. Denny <jdenny@clemson.edu>
2149
2150 maint: run "make update-copyright"
2151
a1a9422d
JD
21522009-08-06 Joel E. Denny <jdenny@clemson.edu>
2153
2154 maint: make update-b4-copyright easier to use
2155 * build-aux/update-b4-copyright: In warnings, report line
2156 numbers rather than character positions.
2157 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
2158 that update-copyright runs it.
2159 * gnulib: Update.
2160
0b61a8ec
JD
21612009-08-05 Joel E. Denny <jdenny@clemson.edu>
2162
2163 maint: clean up update-b4-copyright code
2164 * build-aux/update-b4-copyright: Do not accept 2-digit
2165 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
2166 Don't accept a `[' in a b4_copyright argument.
2167 Format code more consistently.
2168 Don't assume b4*copyright never occurs.
2169
269e222e
JD
21702009-08-04 Joel E. Denny <jdenny@clemson.edu>
2171
2172 maint: automate b4_copyright updates.
2173 * Makefile.am (update-b4-copyright): New target rule.
2174 * build-aux/local.mk (EXTRA_DIST): Add update-b4-copyright.
2175 * build-aux/update-b4-copyright: New.
2176 * data/yacc.c: Remove stray characters around b4_copyright
2177 invocations.
2178
35905f2b
JD
21792009-08-04 Joel E. Denny <jdenny@clemson.edu>
2180
2181 maint: automate annual package-wide copyright-year update.
2182 * .x-update-copyright: New.
2183 * Makefile.am (EXTRA_DIST): Remove maint.mk.
2184 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
2185 update-copyright. Remove gnumakefile, which is implied by
2186 maintainer-makefile.
2187 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
2188 * gnulib: Update.
2189 * maint.mk: Remove, now copied from gnulib.
2190 * examples/extexi: Add missing "(C)" in copyright statement so
2191 update-copyright can recognize it.
2192 * src/LR0.h: Likewise.
2193 * src/print.h: Likewise.
2194 * src/print_graph.h: Likewise.
2195 * src/gram.c: Add missing comma in copyright statement.
2196 * src/gram.h: Likewise.
2197
b30e18dc
JD
21982009-08-04 Joel E. Denny <jdenny@clemson.edu>
2199
2200 Fix "make distcheck".
2201 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
2202 of just calc.stamp.
2203
8d90395d
JD
22042009-08-01 Joel E. Denny <jdenny@clemson.edu>
2205
2206 Pacify "gcc -Wunused" for the input function from Flex.
2207 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
2208 and later.
2209 * src/scan-code.l: Add "%option noinput", which I cannot find in
2210 the Flex manual, but which Flex has supported since at least as
2211 far back as 2.5.4. However, if any of our developers still use
2212 Flex 2.5.4, they'll need to stop configuring with
2213 --enable-gcc-warnings because "%option noinput" didn't work
2214 correctly until Flex 2.5.6.
2215 * src/scan-gram.l: Likewise.
2216 * src/scan-skel.l: Likewise.
2217
ba4184ec
AR
22182009-07-31 Alex Rozenman <rozenman@gmail.com>
2219
2220 Fix --enable-gcc-warnings problems.
2221 * src/reader.c: Adjust variable names.
2222 * src/scan-code.l: Fix prototypes and adjust names.
2223 * src/named-ref.c: Remove redundant "if".
2224
91a2af97
JD
22252009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
2226
2227 Fix a --enable-gcc-warnings problem.
2228 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
2229 variable.
2230
3208e3f4
JD
22312009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
2232
2233 Warn about character literals not of length one.
2234 * NEWS (2.5): Document.
2235 * src/scan-gram.l (INITIAL): Remove comment that we don't check
2236 the length.
2237 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
2238 * tests/input.at (Bad character literals): New test group.
2239
5add20ab 22402009-07-24 Alex Rozenman <rozenman@gmail.com>
13cdf208
AR
2241
2242 Fix some memory leaks.
2243 * src/named-ref.c: Add a pointer check (named_ref_free).
2244 * src/scan-code.l: New function (variant_table_free). Called in
2245 code_scanner_free.
2246 * src/symlist.c: Call to named_ref_free (symbol_list_free).
2247
e459fb0e
JD
22482009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
2249
2250 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
2251
c4be5517
JD
22522009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
2253
2254 Some M4 cleanup in the testsuite.
2255 Suggested by Eric Blake at
2256 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
2257 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
2258 complicate the code by distinguishing between a missing value
2259 and an empty string value for an optional argument. This fix is
2260 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
2261 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
2262 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
2263 arguments are not needed because of the following changes.
2264 Fix stale comments.
2265 Bison developers should use GNU M4 and should not use
2266 POSIXLY_CORRECT when building the test suite, so do not
2267 complicate the code by avoiding $10 and above.
2268 Do not quote an empty string value for an optional argument, and
2269 do not distinguish between a missing value and an empty string
2270 value.
2271
feeb56cd
JD
22722009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
2273
2274 Revert unnecessary column realignment in --help output.
2275 Reported by Akim Demaille at
2276 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
2277 * src/getargs.c (usage): Here.
2278
5add20ab 22792009-07-04 Alex Rozenman <rozenman@gmail.com>
629e4def
AR
2280
2281 Alphabetical order in src/local.mk.
2282 * src/local.mk: Adjust.
2283
5add20ab 22842009-07-04 Alex Rozenman <rozenman@gmail.com>
872b52bc
AR
2285
2286 Style changes and factoring.
2287 * src/named-ref.h: Add comments.
2288 * src/parse-gram.y: Readability and style changes.
2289 * src/reader.c: Factoring: assign_named_ref function.
2290 * src/scan-code.l: Factoring and style changes. Rename
2291 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
2292 Use "unsigned" type for variant index. Improve readablity.
2293 * src/scan-gram.l: Change error messages and add comments.
2294 * src/symlist.h: symbol_list_null: New function decl.
2295 * src/symlist.c: symbol_list_null: Implement here.
2296 * tests/named-refs.at: Adjust for new error messages.
2297
83ea2423
EB
22982009-06-29 Eric Blake <ebb9@byu.net>
2299
2300 scan-code: avoid compiler warnings
2301 * src/scan-code.l (parse_named_ref): Use correct specifiers.
2302
5ece73ea
AD
23032009-06-29 Akim Demaille <demaille@gostai.com>
2304
2305 build: avoid concurrent extraction of calc++.
2306 * examples/calc++/Makefile.am (calc.stamp): New.
2307 Depend on it to create the sources of calc++ so that concurrent
2308 builds don't launch several "extexi" in parallel.
2309 Not only this is inefficient, this also builds incorrect sources
2310 with several extractions mixed together.
2311
ad597a78
AD
23122009-06-29 Akim Demaille <demaille@gostai.com>
2313
2314 parse.error: fix.
2315 * data/bison.m4: Move code related to specific variables after the
2316 definition of the variable-maintaining macros so that we don't
2317 "invoke" b4_percent_define_check_values before it is defined.
2318
31b850d2
AD
23192009-06-29 Akim Demaille <demaille@gostai.com>
2320
2321 variables: parse.error
2322
2323 Implement, document, and test the replacement of %error-verbose
2324 by %define parse.error "verbose".
2325 * data/bison.m4 (b4_error_verbose_if): Reimplement to track the
2326 values of the parse.error variable.
2327 Make "simple" its default value.
2328 Check the valid values.
2329 * src/parse-gram.y: Use %define parse.error.
2330 (PERCENT_ERROR_VERBOSE): New token.
2331 Support it.
2332 * src/scan-gram.l: Support %error-verbose.
2333
2334 * doc/bison.texinfo (Decl Summary): Replace the documentation of
2335 %define error-verbose by that of %define parse.error.
2336 * NEWS: Document it.
2337
2338 * tests/actions.at, tests/calc.at: Use parse.error instead of
2339 %error-verbose.
2340
b9f1d9a4
AR
23412009-06-27 Alex Rozenman <rozenman@gmail.com>
2342
2343 Implement support for named symbol references.
2344 * src/parse-gram.y: Add new syntax (named_ref.opt).
2345 * src/reader.c: Store named refs in symbol lists.
2346 * src/reader.h: New argument for symbol_append and
2347 action_append functions.
2348 * src/scan-code.h: Add new field (named_ref) into
2349 code_props data structure. Keeps named ref of midrule
2350 actions.
2351 * src/scan-code.l: Support for named refs in semantic
2352 action code. New function 'parse_named_ref'.
2353 * src/scan-gram.l: Support bracketed id.
2354 * src/symlist.c: Store named refs in symbol lists.
2355 * src/symlist.h: New field in symbol list: named_ref.
2356 * src/named-ref.h: New file, a struct for named_ref.
2357 * src/named-ref.cp: New file, named_ref_new function.
2358 * src/local.mk: Add two new files.
2359 * tests/testsuite.at: Include new test group:
2360 * tests/named-refs.at: this new file.
2361
b5c212b6
AD
23622009-06-25 Akim Demaille <demaille@gostai.com>
2363
2364 hash: check insertion for memory exhaustion.
2365 * src/uniqstr.c (uniqstr_new): New.
2366
67501061
AD
23672009-06-24 Akim Demaille <demaille@gostai.com>
2368
2369 variables: rename namespace as api.namespace.
2370 Discussed in
2371 http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00033.html
2372
2373 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
2374 New.
2375 (b4_percent_define_use): New.
2376 Use it where applicable.
2377 * data/c++.m4: Replace uses of the variable "namespace" by
2378 "api.namespace".
2379 Default the latter to the former.
2380 * doc/bison.texinfo (Decl Summary): Document "namespace" as
2381 obsolete.
2382 Document api.namespace.
2383 Use @samp to document %define uses, keep @code for identifiers.
2384 * NEWS: Likewise.
2385 * tests/c++.at, tests/input.at: Test api.namespace instead of
2386 namespace. (The tests passed with namespace.)
2387
41976786
AD
23882009-06-11 Akim Demaille <demaille@gostai.com>
2389
2390 style changes.
2391 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
2392 * src/print-xml.c: Style changes.
2393 * tests/conflicts.at: Comment changes.
2394
44bb9084
AD
23952009-06-11 Akim Demaille <demaille@gostai.com>
2396
2397 xml: beware of user strings used to give a %prec to rules.
2398 * tests/conflicts.at (%prec with user strings): New.
2399 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
2400 XML output.
2401
04d1e39d
AD
24022009-06-11 Akim Demaille <demaille@gostai.com>
2403
2404 hash: check insertion for memory exhaustion.
2405 * src/muscle-tab.c (muscle_insert, muscle_grow)
2406 * src/state.c (state_hash_insert): Check the return value of
2407 hash_insert.
2408
a8873669
AD
24092009-06-11 Akim Demaille <demaille@gostai.com>
2410
2411 tests: honor TESTSUITEFLAGS in every check target.
2412 * tests/local.mk (RUN_TESTSUITE): New.
2413 (check-local, installcheck-local, maintainer-check-g++)
2414 (maintainer-check-posix, maintainer-check-valgrind): Use it.
2415
8893145a
AD
24162009-06-10 Akim Demaille <demaille@gostai.com>
2417
2418 deterministic test suite.
2419 Some consistency checks on symbols are performed after all the
2420 symbols were read, by an iteration over the symbol table. This
2421 traversal is nondeterministic, which can be a problem for test
2422 cases.
2423 Avoid this.
2424 Addresses another form of nondeterminism reported by Joel E. Denny.
2425 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
2426
2427 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
2428 test in two.
2429 Use different file names for the three tests to make the
2430 maintenance easier.
2431
92d7a23a
AD
24322009-06-10 Akim Demaille <demaille@gostai.com>
2433
2434 gnulib: update.
b0778bdd
EB
2435 * gnulib: Update to latest.
2436 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
2437 * m4/.gitignore: Regen.
2438 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
2439 Call xalloc_die on hash_insert failures.
2440 Requested by the new __warn_unused_result__ attribute of
2441 hash_insert.
92d7a23a 2442
12cf133f
AD
24432009-06-10 Akim Demaille <demaille@gostai.com>
2444
2445 deterministic user-token-number redeclaration errors.
2446 Address nondeterminism reported by Joel E. Denny.
2447 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
2448
2449 * src/uniqstr.h: Comment changes.
2450 * src/location.h (boundary_cmp, location_cmp): New.
2451 * src/symtab.c (user_token_number_redeclaration): New.
2452 (symbol_translation): Use it.
2453 * tests/input.at (Numbered tokens): Adjust the expected output.
2454
796a2b0a
AD
24552009-05-25 Akim Demaille <demaille@gostai.com>
2456
2457 build: avoid ignored errors.
2458 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Don't generate ignored
2459 errors, they pollute the output.
2460
0b6d43c5
JD
24612009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
2462
2463 Convert multiple variable definition warnings to complaints.
2464 * NEWS (2.5): Add a new entry for that change.
2465 * doc/bison.texinfo (Decl Summary): Update %define entry.
2466 (Bison Options): Update -D/--define/-F/--force-define entry.
2467 * src/muscle-tab.c (muscle_percent_define_insert): Implement.
2468 * src/muscle-tab.h (muscle_percent_define_insert): Update
2469 comments.
2470 * tests/input.at (`%define errors'): Update.
2471 (`%define, --define, --force-define'): Update.
2472
de5ab940
JD
24732009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
2474
2475 -F/--force-define and relative %define/-D/--define priorities.
2476 * NEWS (2.5): Add documentation to -D/--define entry.
2477 * build-aux/cross-options.pl: Hard-code association of
2478 --force-define with %define.
2479 * doc/bison.texinfo (Decl Summary): In %define entry,
2480 cross-reference command-line options.
2481 (Bison Options): Add documentation to -D/--define entry.
2482 (Option Cross Key): Widen column for --force-define row.
2483 * src/getargs.c (usage): Document -F/--force-define. Realign
2484 options in output.
2485 (short_options, long_options, getargs): Parse -F/--force-define,
2486 and update muscle_percent_define_insert invocations.
2487 * src/muscle-tab.h (muscle_percent_define_how): New enum type.
2488 (muscle_percent_define_insert): Add argument with that type.
2489 * src/muscle-tab.c (muscle_percent_define_insert): Implement
2490 -F/--force-define behavior and priorities.
2491 (muscle_percent_define_ensure): Update
2492 muscle_percent_define_insert invocation.
2493 * src/parse-gram.y (prologue_declaration): Update
2494 muscle_percent_define_insert invocations.
2495 * tests/input.at (`%define, --define'): Rename to...
2496 (`%define, --define, --force-define'): ... this and extend.
2497
f8e7258f
JD
24982009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
2499
2500 Update some comments to make sense for -D.
2501 * data/bison.m4 (b4_check_user_names): In header comments, say
2502 "user occurrence" instead of "grammar occurrence".
2503 * src/muscle-tab.h (muscle_percent_define_insert): Likewise.
2504 (muscle_percent_code_grow): Likewise just for consistency.
2505
b987342b
JD
25062009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
2507
2508 * data/c++.m4 (b4_namespace_close): Simplify slightly.
2509
4977e0a7
JD
25102009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
2511
2512 Handle a trailing `:' in a user-supplied C++ namespace better.
2513 * data/c++.m4 (b4_namespace_close): Don't let it be printed
2514 among the closing braces here. This fix might make the
2515 generated code easier to debug, but otherwise it should be
2516 insignificant because a trailing `:' is a C++ error already.
2517
9b04dad7
AD
25182009-05-19 Akim Demaille <demaille@gostai.com>
2519
2520 remove useless variable.
2521 * src/getargs.c (skeleton_arg): Remove now useless variable.
2522 Should help the compiler see that this printf-like call is sane.
2523
4c6622c2
AD
25242009-05-15 Akim Demaille <demaille@gostai.com>
2525
2526 Rename token.prefix as api.tokens.prefix.
2527 Discussed here.
2528 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00024.html.
2529
2530 * NEWS, data/bison.m4, data/c.m4, data/java.m4, doc/bison.texinfo,
2531 * tests/c++.at, tests/calc.at, tests/java.at, tests/local.at
2532 (token.prefix): Rename as...
2533 (api.tokens.prefix): this.
2534
3c248d70
AD
25352009-05-11 Akim Demaille <demaille@gostai.com>
2536
2537 doc: use C++ headers.
2538 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
2539 headers.
2540
99c08fb6
AD
25412009-05-11 Akim Demaille <demaille@gostai.com>
2542
2543 doc: token.prefix
2544 * doc/bison.simple (Decl Summary): Document token.prefix.
2545 (Calc++ Parser): Various fixes.
2546 Formatting changes.
2547 Use token.prefix.
2548 Introduce a macro TOKEN to shorten the code and make it more
2549 readable.
2550 (Calc++ Scanner): Adjust.
2551 * NEWS (Variable token.prefix): New.
2552
84a1cb5a
AD
25532009-05-04 Akim Demaille <demaille@gostai.com>
2554
2555 bison: catch bad symbol names.
2556 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
2557 * tests/input.at: Adjust.
2558
cdf3f113
AD
25592009-05-04 Akim Demaille <demaille@gostai.com>
2560
2561 identifiers: dashes are letters.
2562 Dashes can now start identifiers (symbols and directives).
84a1cb5a 2563
cdf3f113
AD
2564 * src/scan-gram.l ({letter}): Add dash.
2565 ({id}): Remove it.
2566 * tests/input.at (Symbols): Adjust.
2567 Remove stray comment.
2568 * tests/regression.at (Invalid inputs): Adjust error message.
2569 * doc/bison.texinfo (Symbols): Update.
2570
98a345a2
JD
25712009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
2572
2573 Declare %code to be a permanent feature.
2574 * NEWS (2.4.2): Here.
2575 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
2576 experimental.
2577 (Decl Summary): Likewise.
2578
67212941
JD
25792009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
2580
2581 Convert underscores to dashes in some %define variable names.
2582 For now, just api.push-pull and lr.keep-unreachable-states.
2583 Maintain old names for backward compatibility.
2584 * NEWS (2.5): Document.
2585 * data/c.m4 (b4_identification): Update comment.
2586 * data/yacc.c: Update access.
2587 * doc/bison.texinfo: Update.
2588 * etc/bench.pl.in (bench_push_parser): Update use.
2589 * src/files.c (tr): Move to...
2590 * src/getargs.c, src/getargs.h (tr): ... here because I can't
2591 think of a better place to expose it. My logic is that, for all
2592 uses of tr so far, command-line arguments can be involved, and
2593 getargs.h is already included.
2594 * src/main.c (main): Update access.
2595 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
2596 variable names to new variable names before assigning value.
2597 * src/reader.c (reader): Update setting default.
2598 * tests/calc.at: Update uses.
2599 * tests/conflicts.at (Unreachable States After Conflict
2600 Resolution): Update use.
2601 * tests/input.at (%define enum variables): Update use.
2602 (%define backward compatibility): New test group.
2603 * tests/push.at: Update uses.
2604 * tests/reduce.at: Update uses.
2605 * tests/torture.at: Update uses.
2606
ba5c6d94
JD
26072009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
2608
2609 Set all front-end %define defaults in one place.
2610 * src/main.c (main): Move lr.keep_unreachable_states default...
2611 * src/reader.c (reader): ... to here.
2612
5bab9d08
JD
26132009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
2614
2615 Rename lr.default_reductions to lr.default-reductions.
2616 * NEWS (2.5): Here.
2617 * doc/bison.texinfo: Here.
2618 * src/lalr.c (initialize_LA): Here.
2619 * src/print.c (print_reductions): Here.
2620 * src/reader.c (reader): Here.
2621 * src/tables.c (action_row): Here.
2622 * tests/input.at (%define enum variables): Here.
2623 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
2624
d521ee19
JD
26252009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
2626
2627 Pacify ./configure --enable-gcc-warnings.
2628 * tests/input.at (Symbols): Prototype yyerror and yylex.
2629
26302009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
c9aded4b
JD
2631
2632 Document how `%define "var" "value"' is not M4-friendly.
2633 * src/parse-gram.y (variable): In comments here.
2634
8f0d265e
JD
26352009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
2636
2637 Clean up recent patches a little.
2638 Reported by Akim Demaille.
2639 * doc/bison.texinfo (Understanding): Fix typos.
2640 * src/print.c (print_reductions): Don't use negated variable.
2641
f4909773
JD
26422009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
2643
2644 List accepted values for a %define enum variable with an invalid value.
2645 Suggested by Akim Demaille at
2646 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
2647 * data/bison.m4 (_b4_percent_define_check_values): Implement.
2648 * src/muscle-tab.c (muscle_percent_define_check_values): Implement.
2649 * tests/input.at (%define lr.default_reductions invalid values): Merge
2650 into...
2651 (%define enum variables): ... here, and update output.
2652
110ef36a
JD
26532009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
2654
2655 Rename "default rule" to "default reduction".
2656 This includes changing variable names in code, changing
2657 comments, and renaming %define lr.default_rules to %define
2658 lr.default_reductions.
2659 * NEWS (2.5): Update IELR documentation.
2660 * data/bison.m4 (b4_integral_parser_tables_map): Adjust YYDEFACT
2661 documentation.
2662 * data/glr.c, data/lalr1.java: Sync copyright dates.
2663 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
2664 and lr.type documentation. Make some other wording
2665 improvements.
2666 (Glossary): Adjust cross-references and Default Reduction
2667 definition.
2668 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
2669 Remove a confusing comment pointed out by Akim Demaille.
2670 (initialize_LA): Adjust code.
2671 * src/print-xml.c (print_reductions): Adjust code.
2672 * src/print.c (print_reductions): Adjust code.
2673 * src/reader.c (reader): Adjust code.
2674 * src/tables.c (action_row): Adjust code.
2675 (token_actions): Adjust code.
2676 * src/tables.h: Adjust YYDEFACT documentation.
2677 * tests/input.at (%define lr.default_rules invalid values):
2678 Rename test group to...
2679 (%define lr.default_reductions invalid values): ... this, and
2680 update grammar file and expected output.
2681 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
2682 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
2683
746ee38c
AD
26842009-04-21 Akim Demaille <demaille@gostai.com>
2685
2686 tests: check the use of dashes and periods in symbols.
2687 * tests/input.at (Symbol): New test group.
2688
eb45ef3b
JD
26892009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2690
2691 Document %define lr.type and lr.default_rules.
2692 * NEWS (2.5): Add an entry.
2693 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
2694 besides just LALR(1) and GLR(1).
2695 * doc/bison.texinfo (Introduction): Likewise.
2696 (Language and Grammar): Bison is no longer limited to LALR(1)
2697 restrictions.
2698 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
2699 when trying to distinguish from GLR. Talk about LR(1) grammars
2700 rather than LALR(1) grammars.
2701 (Decl Summary): In %define api.push_pull entry, say it applies
2702 to deterministic parsers in C rather than LALR(1) parsers in C.
2703 Add lr.default_rules entry.
2704 Add lr.type entry.
2705 (Mystery Conflicts): Bison is no longer limited to LALR(1)
2706 restrictions.
2707 (Generalized LR Parsing): Same changes as for the previous GLR
2708 section.
2709 (Memory Management): Say deterministic rather than LALR(1).
2710 (Understanding): Correct some bison output.
2711 Index discussion of "accepting state".
2712 Say deterministic rather than LALR(1).
2713 (Bison Options): In --yacc entry, say deterministic rather than
2714 LALR(1).
2715 In --report, --graph, and --xml entries, just don't mention
2716 LALR(1).
2717 (C++ Parsers): Say deterministic rather than LALR(1).
2718 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
2719 (Glossary): Add Accepting State, Consistent State, Default Rule,
2720 and IELR(1) definitions.
2721 In Generalized LR (GLR) definition, make same changes as in
2722 previous GLR sections.
2723 In LALR(1) definition, say Bison uses LALR(1) by default rather
2724 than implying Bison is limited to LALR(1).
2725 (LocalWords): Add IELR.
2726
db34f798
JD
27272009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2728
2729 Finish implementing %define lr.type.
2730 Its value can be "LALR", "IELR", or "canonical LR".
2731 * lib/timevar.def (TV_IELR_PHASE1): New var.
2732 (TV_IELR_PHASE2): New var.
2733 (TV_IELR_PHASE3): New var.
2734 (TV_IELR_PHASE4): New var.
2735 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
2736 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
2737 Sbitset.h, ielr.h, and ielr.c.
2738 * src/getargs.h, src/getargs.c (enum trace, trace_args,
2739 trace_types): Add trace_ielr.
2740 * src/lalr.h, src/lalr.c (ngotos): Export it.
2741 (F): Rename to...
2742 (goto_follows): ... this, update all uses, and export it.
2743 (set_goto_map): Export it.
2744 (map_goto): Export it.
2745 (compute_lookahead_tokens): Don't free goto_follows yet. Now
2746 handled in ielr.
2747 (initialize_LA): Export it. Move lookback allocation to...
2748 (lalr): ... here because, for canonical LR, initialize_LA must
2749 be invoked but lookback and much of the rest of LALR isn't
2750 needed.
2751 * main.c (main): Instead of lalr, invoke ielr, which invokes
2752 lalr.
2753 * src/reader.c (reader): Default lr.type to "LALR".
2754 Default lr.default_rules to "accepting" if lr.type is "canonical
2755 LR". Leave the default as "all" otherwise.
2756 Check for a valid lr.type value.
2757 * src/state.h, src/state.c (struct state_list): Add state_list
2758 member.
2759 (state_new): Initialize state_list member to NULL.
2760 (state_new_isocore): New function, exported.
2761 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
2762 exercises all values of lr.type.
2763 (GNU AWK Grammar): Rename test group to...
2764 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
2765 AT_TEST_EXISTING_GRAMMAR.
2766 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
2767 (GNU pic Grammar): Rename test group to...
2768 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
2769 AT_TEST_EXISTING_GRAMMAR.
2770 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
2771 all values of lr.type.
2772 (Single State Split): New test groups using AT_TEST_LR_TYPE.
2773 (Lane Split): Likewise.
2774 (Complex Lane Split): Likewise.
2775 (Split During Added Lookahead Propagation): Likewise.
2776
7fe11bb5
JD
27772009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2778
2779 Add new files for IELR and canonical LR implementation.
2780 * src/AnnotationList.c: New.
2781 * src/AnnotationList.h: New.
2782 * src/InadequacyList.c: New.
2783 * src/InadequacyList.h: New.
2784 * src/Sbitset.c: New.
2785 * src/Sbitset.h: New.
2786 * src/ielr.c: New.
2787 * src/ielr.h: New.
2788
7254f6a8
JD
27892009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
2790
2791 Implement %define lr.default_rules.
2792 Its value describes the states that are permitted to contain
2793 default rules: "all", "consistent", or "accepting".
2794 * src/reader.c (reader): Default lr.default_rules to "all".
2795 Check for a valid lr.default_rules value.
2796 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
2797 is "accepting", then only mark the accepting state as
2798 consistent.
2799 (initialize_LA): Tell state_lookahead_tokens_count whether
2800 lr.default_rules is "accepting".
2801 * src/tables.c (action_row): If lr.default_rules is not "all",
2802 then disable default rules in inconsistent states.
2803 * src/print.c (print_reductions): Use this opportunity to
2804 perform some assertions about whether lr.default_rules was
2805 obeyed correctly.
2806 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
2807 helps with checking the parser tables for a grammar.
2808 * tests/input.at (%define lr.default_rules invalid values): New
2809 test group.
2810 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
2811 AT_TEST_TABLES_AND_PARSE.
2812 (`no %define lr.default_rules'): New test group generated by
2813 AT_TEST_LR_DEFAULT_RULES.
2814 (`%define lr.default_rules "all"'): Likewise.
2815 (`%define lr.default_rules "consistent"'): Likewise.
2816 (`%define lr.default_rules "accepting"'): Likewise.
2817
72e727f2
AD
28182009-04-20 Akim Demaille <demaille@gostai.com>
2819
2820 Formatting change.
2821
90462b8d
AD
28222009-04-20 Akim Demaille <demaille@gostai.com>
2823
2824 bison: factoring.
2825 * src/output.c (token_definitions_output): Use symbol_id_get
2826 instead of duplicating its logic.
2827 * TODO (YYERRCODE): Extend.
2828
4f646c37
AD
28292009-04-20 Akim Demaille <demaille@gostai.com>
2830
71b00ed8
AD
2831 variables: prefer error-verbose to error_verbose.
2832 * data/bison.m4 (b4_error_verbose_if): Based on error-verbose
2833 instead of error_verbose.
2834 * src/scan-gram.l (%error-verbose): Map to the error-verbose
2835 variable.
2836 * doc/bison.texinfo: Promote %define error-verbose instead of
2837 %error-verbose.
2838 * tests/actions.at: Prefer %define error-verbose to %error-verbose.
2839
28402009-04-15 Akim Demaille <demaille@gostai.com>
2841
4f646c37
AD
2842 variables: accept dashes.
2843 * data/bison.m4 (b4_percent_define_if_define_): Also map dashes to
2844 underscores.
2845 * src/scan-gram.l ({id}): Also accept dashes after the initial
2846 letter.
2847 ({directive}): Use {id}.
2848 * src/parse-gram.y: Comment and formatting changes.
2849 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
2850 symbols.
2851 * src/complain.h, src/complain.c (yacc_at): New.
2852 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
2853 symbol names.
2854 * src/output.c (token_definitions_output): Do not #define token
2855 names with dashes.
2856
184e3179
AD
28572009-04-20 Akim Demaille <demaille@gostai.com>
2858
2859 Consistently refer to Yacc, not YACC.
2860 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
2861
41253c3a
JD
28622009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
2863
2864 Pacify make maintainer-check-posix.
2865 * tests/input.at (%define, --define): Move bison command-line
2866 options before grammar file name.
2867
197b82ba
JD
28682009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
2869
2870 Document semicolon warnings.
2871 * NEWS (2.5): Here.
2872
0c90a1f5
AD
28732009-04-14 Akim Demaille <demaille@gostai.com>
2874
2875 variables: use `parse.assert' instead of `assert'.
2876 * TODO (assert): Remove.
2877 * data/bison.m4 (b4_assert_if): Replace with...
2878 (b4_parse_assert_if): this.
2879 * data/lalr1.cc, data/variant.hh, tests/c++.at: Adjust.
2880 * doc/bison.texinfo (Decl Summary): Document parse.assert.
2881
fa819509
AD
28822009-04-14 Akim Demaille <demaille@gostai.com>
2883
16dc0d90 2884 variables: use `parse.trace' instead of `debug'.
fa819509
AD
2885 * src/getargs.c (getargs): Map -t to %define trace.parse.
2886 * src/scan-gram.l (%debug): Map to %define trace.parse.
2887 * data/bison.m4 (b4_percent_define_if_define): Map `.' in variable
2888 names to `_' in macro names.
2889 (b4_debug_if): Replace with...
2890 (b4_parse_trace_if): this.
2891 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
2892 * data/yacc.c: Adjust.
2893 * doc/bison.texinfo (Decl Summary): Document %debug as obsoleted.
2894 Use @code to label the variable list.
2895 Document the variable parse.trace.
2896 (Tracing): Promote the parse.trace variable.
2897 * TODO: %printer is not documented.
2898
f7dae1ea
AD
28992009-04-14 Akim Demaille <demaille@gostai.com>
2900
2901 doc: minor fixes.
2902 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
2903 (Table of Symbols): Remove duplicate entry for %debug.
2904
3535c071
EB
29052009-04-10 Eric Blake <ebb9@byu.net>
2906
2907 submodules: update to latest
2908 * submodules/autoconf: Use latest upstream Autoconf.
2909
cf48f675
EB
29102009-04-06 Eric Blake <ebb9@byu.net>
2911
2912 Work around autoconf 2.63b bug in testsuite.
2913 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
2914 autoconf bug related to # in test.
2915
50cca368
JD
29162009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2917
2918 * NEWS (2.5): New section. Describe new -D/--define feature.
2919
3583d96b
AD
29202009-04-06 Akim Demaille <demaille@gostai.com>
2921
2922 Regen.
2923 * src/parse-gram.h, src/parse-gram.c: Regen.
2924
00f5d575
AD
29252009-04-06 Akim Demaille <demaille@gostai.com>
2926
2927 rename muscle_tab.* as muscle-tab.* for consistency.
2928 * src/muscle_tab.h, src/muscle_tab.c: Rename as...
2929 * src/muscle-tab.h, src/muscle-tab.c: these.
2930 * src/getargs.c, src/local.mk, src/main.c, src/output.c,
2931 * src/parse-gram.y, src/reader.c, src/scan-code.l: Adjust.
2932
76bf5102
AD
29332009-04-06 Akim Demaille <demaille@gostai.com>
2934
2935 Makefile: introduce $(BISON).
2936 * src/local.mk (BISON): New.
2937 (YACC): Use it.
2938
bc0f5737
AD
29392009-04-06 Akim Demaille <demaille@gostai.com>
2940
2941 parser: handle %locations as %define locations.
2942 * src/getargs.h, src/getargs.c (locations_flag): Remove.
2943 * src/getargs.c, src/scan-code.l: Use muscle_percent_define_ensure
2944 to set "locations" to true.
2945 * src/output.c (prepare): Don't output "locations".
2946 * src/scan-gram.l (%locations): Handle it as a %<flag>.
2947 * src/parse-gram.y: It's no longer a token.
2948 Don't handle it.
2949 * data/bison.m4 (b4_locations_if): Define it with
2950 b4_percent_define_if_define.
2951 * data/c.m4, data/glr.cc: Adjust.
2952
697c912f
AD
29532009-04-06 Akim Demaille <demaille@gostai.com>
2954
2955 Regen.
2956 * src/parse-gram.c: Regen.
2957
4920ae8b
AD
29582009-04-06 Akim Demaille <demaille@gostai.com>
2959
2960 muscle: factor the handling of obsolete of obsolete directives.
2961 Suggested by Joel E. Denny.
50cca368 2962
4920ae8b
AD
2963 * src/muscle_tab.h, src/muscle_tab.c (muscle_percent_define_ensure):
2964 New, extracted from...
2965 * src/parse-gram.y (prologue_declaration: pure-parser): here.
2966 Remove it.
2967 (prologue_declaration: "%<flag>"): Use
2968 muscle_percent_define_ensure.
2969 (%error-verbose, %pure-parser): No longer tokens.
2970 * src/scan-gram.l (pure-parser): Return as a %<flag>.
2971
1d5b3c08
JD
29722009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2973
2974 Fix options documentation.
2975 * build-aux/cross-options.pl: As in --help output, write optional
2976 arguments as [=ARG] not =[ARG].
2977 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
2978
62c99cf4
JD
29792009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
2980
2981 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
2982 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
2983 requirements for a correct m4 are stricter.
2984 * m4/m4.m4: Make it a symbolic link to submodules/autoconf/m4/m4.m4.
2985 * configure.ac: Update to use AC_PROG_GNU_M4.
2986 Reported by Eric Blake.
2987
1c93f35b
JD
29882009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2989
2990 Help with updating web manual.
2991 * HACKING: Incorporate instructions from gnulib/doc/README.
2992 * bootstrap.conf (gnulib_modules): Add gendocs.
2993
86cfae0a
AD
29942009-04-03 Akim Demaille <demaille@gostai.com>
2995
2996 Regen.
2997 * src/parse-gram.h, src/parse-gram.c: Regen.
2998
ba061fa6
AD
29992009-04-03 Akim Demaille <demaille@gostai.com>
3000
3001 Factor %FLAG at scan level.
3002 * src/parse-gram.y (PERCENT_DEBUG, PERCENT_ERROR_VERBOSE): Token
3003 definitions and associated rules, replaced by....
3004 (PERCENT_FLAG): this new token type, and rule.
3005 * src/scan-gram.l (RETURN_PERCENT_FLAG): New.
3006 Use it for %debug and %error-verbose.
3007
b19ebeb3
AD
30082009-04-03 Akim Demaille <demaille@gostai.com>
3009
3010 Regen.
3011 * src/parse-gram.h, src/parse-gram.c: Regen.
3012
001a16a9
AD
30132009-04-03 Akim Demaille <demaille@gostai.com>
3014
3015 Treat %debug as %define debug.
3016 * data/bison.m4 (b4_debug_if): New.
3017 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c,
3018 * data/lalr1.java: Use it instead of b4_debug_flag.
3019 * src/getargs.h, src/getargs.c (debug_flag): Remove.
3020 * src/output.c (prepare): Don't output it.
3021 * src/parse-gram.y: Treat %debug as %define debug.
3022
30232009-04-03 Akim Demaille <demaille@gostai.com>
3024
3025 Treat %error-verbose as %define error_verbose.
3026 This allows to pass -Derror_verbose on the command line. Better
3027 yet, it allows to pass -Derror_verbose=$(ERROR_VERBOSE), with
3028 ERROR_VERBOSE being defined as false or true.
3029 * data/bison.m4 (b4_percent_define_if_define): Instead of relying
3030 on b4_percent_define_ifdef, for does not check the defined value,
3031 but only whether the symbol is defined, rely on
3032 b4_percent_define_flag_if, so that a value of "false" is processed
3033 as a false.
3034 If not defined, define the flag to "false".
3035 (b4_error_verbose_if): New.
3036 * data/glr.c, data/lalr1.cc, data/yacc.c: Use it instead of
3037 b4_error_verbose_flag.
3038 * src/getargs.h, src/getargs.c (error_verbose_flag): Remove.
3039 * src/output.c (prepare): Don't output it.
3040 * src/parse-gram.y (%error-verbose): Treat as %define error_verbose.
3041
92822aff
JD
30422009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
3043
3044 Fix strange %define locations for default values.
3045 Reported by Akim Demaille at
3046 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
3047 and discussed again starting at
3048 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
3049 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
3050 because location information is bogus.
3051 Use angle brackets to delimit fake file name because square brackets
3052 look like underexpanded m4. Choose a better fake file name.
3053 Use negative line numbers.
3054 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
3055 * src/location.c (location_print): If line for a boundary is negative,
3056 only print that boundary's file name.
3057 * src/location.h: Document that.
3058 * tests/skeletons.at (%define Boolean variables: invalid skeleton
3059 defaults): Update output.
3060
e021191b
JD
30612009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
3062
3063 Pacify ./configure --enable-gcc-warnings.
3064 * Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS) because many files
3065 in lib won't compile with it.
3066 * src/local.mk (src_bison_CFLAGS): Use $(WERROR_CFLAGS) here only.
3067
78f65418
AD
30682009-03-31 Akim Demaille <demaille@gostai.com>
3069
3070 bootstrap: --help to stdout.
3071 * bootstrap (usage): Don't send --help to stderr.
3072 Use a here doc instead of a long string.
3073
f7e241f4
AD
30742009-03-31 Akim Demaille <demaille@gostai.com>
3075
3076 bootstrap: README-hacking no longer exists
3077 * bootstrap (checkout_only_file): Set to HACKING.
3078
31d3e510
AD
30792009-03-26 Akim Demaille <demaille@gostai.com>
3080
3081 doc: merge HACKING and README-hacking.
3082 Two files is confusing.
3083 Reported by Alexandre Duret-Lutz.
1f9d8248 3084
31d3e510
AD
3085 * README-hacking: Merge into...
3086 * HACKING (Working from the repository): here.
3087
81535bfa
AD
30882009-03-26 Akim Demaille <demaille@gostai.com>
3089
3090 doc: update README-hacking.
3091 * README-hacking: We now use git and git submodules.
3092 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
3093
56f772e9
AD
30942009-03-26 Akim Demaille <demaille@gostai.com>
3095
3096 lalr1.cc: avoid GCC 4.3 warnings.
3097 GCC 4.3 now warns about "a || b && c" and asks for explicit
3098 parentheses.
3099 Reported by Alexandre Duret-Lutz.
3100 * data/location.cc: Update copyright years.
3101 (Position::operator==): Use parens to make precedence explicit.
3102 Compare lines and columns first, as they are more likely to be
3103 different, and they are faster to compare.
3104
11c073b7
AD
31052009-03-26 Akim Demaille <demaille@gostai.com>
3106
3107 gnulib: update.
3108 * gnulib: Update to latest.
3109 * src/local.mk (AM_CFLAGS): Move to...
3110 * Makefile.am: here.
3111 * etc/prefix-gnulib-mk (prefix_assignment): Also transform
3112 AM_CFLAGS.
3113
91be6b28
AD
31142009-03-02 Akim Demaille <demaille@gostai.com>
3115
3116 Comment changes.
3117
cbf25ce7
AD
31182009-03-02 Akim Demaille <demaille@gostai.com>
3119
3120 Share b4_yytranslate_define.
3121 * data/lalr1.cc (b4_yytranslate_define): Move to...
3122 * data/c++.m4: here.
3123
882f02ed
AD
31242009-03-02 Akim Demaille <demaille@gostai.com>
3125
3126 Use locations in the variant example.
1f9d8248
AD
3127 Yes, this obfuscates the point of this example, variants only.
3128 But glr.cc cannot work (yet?) without locations. This change
3129 makes it easier to use this example with glr.cc.
11c073b7 3130
882f02ed
AD
3131 * examples/variant.yy (assert): %define it.
3132 (locations): Request them.
3133 (yylex): Bind the location to the stage.
3134
0623bacc
AD
31352009-03-02 Akim Demaille <demaille@gostai.com>
3136
3137 Dub make_TOKEN as a public type interface.
3138 * data/c++.m4 (b4_symbol_constructor_declare)
3139 (b4_symbol_constructor_define): New empty stubs.
3140 (b4_public_types_declare, b4_public_types_define): Use them.
3141 * data/lalr1.cc (b4_symbol_constructor_declare)
3142 (b4_symbol_constructor_declare_)
3143 (b4_symbol_constructor_define_, b4_symbol_constructor_define):
3144 Move to...
3145 * data/variant.hh: here.
3146 Remove the "b4_variant_if" parts, as variant.hh is loaded only if
3147 needed.
3148 * data/lalr1.cc: No longer invoke b4_symbol_constructor_define and
3149 b4_symbol_constructor_declare, as it is now done by
3150 b4_public_types_define and b4_public_types_declare.
3151
5f5a90df
AD
31522009-03-02 Akim Demaille <demaille@gostai.com>
3153
3154 Coding style changes.
3155 * data/lalr1.cc (b4_symbol_constructor_declaration_)
3156 (b4_symbol_constructor_declarations)
3157 (b4_symbol_constructor_definition_)
3158 (b4_symbol_constructor_definitions)
3159 (b4_yytranslate_definition): Rename as...
3160 (b4_symbol_constructor_declare_)
3161 (b4_symbol_constructor_declare)
3162 (b4_symbol_constructor_define_)
3163 (b4_symbol_constructor_define)
3164 (b4_yytranslate_define): these.
3165 * data/variant.hh (b4_variant_definition): Rename as...
3166 (b4_variant_define): this.
3167
b47b6ff7
AD
31682009-03-02 Akim Demaille <demaille@gostai.com>
3169
3170 Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if.
3171 * data/bison.m4 (b4_percent_define_if_define): New.
3172 * data/c++.m4 (b4_variant_if): Move to...
3173 * data/bison.m4: Here, using b4_percent_define_if_define.
3174 * data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to...
3175 * data/bison.m4: Here, using b4_percent_define_if_define.
3176
1d6b689b
AD
31772009-03-02 Akim Demaille <demaille@gostai.com>
3178
3179 Dub symbol_type_base as a public type.
3180 * data/c++.m4 (b4_public_types_declare): Now define
3181 symbol_type_base and symbol_type.
3182 (b4_public_types_define): New.
3183 In both cases, the definitions are taken verbatim from lalr1.cc.
3184 * data/lalr1.cc: Adjust.
3185
4f84717d
AD
31862009-03-02 Akim Demaille <demaille@gostai.com>
3187
3188 b4_public_types_declare.
3189 * data/c++.m4 (b4_public_types_declare): New.
3190 * data/glr.cc, data/lalr1.cc: Use it.
3191
b9e4eb5b
AD
31922009-03-02 Akim Demaille <demaille@gostai.com>
3193
3194 b4_semantic_type_declare.
3195 * data/c++.m4 (b4_semantic_type_declare): New.
3196 Factors and generalizes what was in glr.cc and lalr1.cc.
3197 * data/variant.hh (b4_semantic_type_declare): Redefine it for
3198 variants.
3199 * data/lalr1.cc, data/glr.cc: Use it.
3200
6a6e7f0c
AD
32012009-02-26 Akim Demaille <demaille@gostai.com>
3202
3203 Upgrade gnulib.
3204 * gnulib: Upgrade from master.
3205 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore:
3206 Regen.
3207
e9e61b00
AD
32082009-02-25 Akim Demaille <demaille@gostai.com>
3209
3210 Remove useless arguments.
3211 * data/glr.c (yy_reduce_print): $$ and @$ are not used and not
3212 relevant.
3213
3eead995
AD
32142009-02-25 Akim Demaille <demaille@gostai.com>
3215
3216 Comment changes.
3217 * data/lalr1.cc: here.
3218
87f28efe
AD
32192009-02-25 Akim Demaille <demaille@gostai.com>
3220
3221 Fix glr.cc's debug level handling.
3222 * data/glr.cc (yydebug_): Remove, as it is actually yydebug from
3223 glr.c which is used.
3224 (debug_level, set_debug_level): Adjust.
3225
9be2a009
AD
32262009-02-25 Akim Demaille <demaille@gostai.com>
3227
3228 Copyright years.
3229 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
3230
07a6e87d
AD
32312009-02-25 Akim Demaille <demaille@gostai.com>
3232
3233 Style changes.
3234 * etc/bench.pl.in (generate_grammar_list): Consitently use
3235 location_type, not yy::location.
3236
33c78bd2
AD
32372009-02-25 Akim Demaille <demaille@gostai.com>
3238
3239 Comment change.
3240 * data/lalr1.cc: here.
3241
49572920
AD
32422009-02-19 Akim Demaille <demaille@gostai.com>
3243
3244 Make yyparser::error public.
3245 * data/lalr1.cc: here.
3246 There is no good reason to keep it private (and it is convenient
3247 to use it from the scanner for instance). It is already public in
3248 glr.cc.
3249
88654b47
AD
32502009-02-19 Akim Demaille <demaille@gostai.com>
3251
3252 Comment changes.
3253 * data/glr.cc: here.
3254
4524c55b
AD
32552009-02-19 Akim Demaille <demaille@gostai.com>
3256
3257 Remove trailing blanks.
6a6e7f0c
AD
3258 The epilogue has its own ending \n, no need to add another.
3259
4524c55b
AD
3260 * data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the
3261 epilogue.
3262 * data/glr.cc: dnl when extending the epilogue.
3263 Remove stray "private:".
3264
6ceccee8
AD
32652009-02-19 Akim Demaille <demaille@gostai.com>
3266
3267 Use b4_c_modern.
3268 * data/c.m4 (b4_c_function_decl): Here.
3269
9c6a8966
AD
32702009-02-19 Akim Demaille <demaille@gostai.com>
3271
3272 Comment changes.
3273 * data/lalr1.cc: here.
3274
507aa0e2
AD
32752009-02-19 Akim Demaille <demaille@gostai.com>
3276
3277 Extract variant.hh
3278 * data/variant.hh: New, extracted from...
3279 * data/lalr1.cc: here.
3280 Adjust.
3281 * data/local.mk: Adjust.
3282
51bacae6
AD
32832009-02-19 Akim Demaille <demaille@gostai.com>
3284
3285 Extract stack.hh from lalr1.cc.
3286 * data/stack.hh: New.
3287 * data/lalr1.cc: Extract from here.
3288 * data/local.mk: Adjust.
3289
06c3084f
JD
32902009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
3291
3292 Add reminder about uploading public key to keys.gnupg.net.
3293 * HACKING (Release Procedure): Here.
3294
0ea583d2
AD
32952009-01-28 Akim Demaille <demaille@gostai.com>
3296
3297 * NEWS: Update information about 2.4.1 and 2.4.2.
3298
402b123d
AD
32992008-11-04 Akim Demaille <demaille@gostai.com>
3300
3301 Reformat NEWS.
3302 * NEWS: Use more outline-mode markup.
3303 Suggested by Jim Meyering.
3304
74553c98
AD
33052009-01-08 Akim Demaille <demaille@gostai.com>
3306
3307 Fix grep portability issues.
3308 Grep on Solaris does not support -q.
3309 Reported by Summum Bonum.
3310
3311 * NEWS: Add a stub for 2.4.2.
3312 * THANKS: Add Summum Bonum.
3313 * tests/atlocal.in (EGREP): New.
3314 (CC, CXX, XSLTPROC): Make it possible to override them via
3315 envvars.
3316 * tests/java.at: Use $EGREP instead of egrep.
3317 Use AT_CHECK's ignore instead of grep's -q.
3318
84eedf86
AD
33192008-12-11 Akim Demaille <demaille@gostai.com>
3320
3321 Pass the token type to yysyntax_error.
3322 * data/yacc.c (yysyntax_error): Take the transated token instead
3323 of the raw number.
3324 Adjust callers.
3325 * TODO: Update.
3326
5860cc8c
AD
33272008-12-11 Akim Demaille <demaille@gostai.com>
3328
3329 Formatting changes.
3330 * data/glr.c: Formatting changes.
3331
2b008529
AD
33322008-12-11 Akim Demaille <demaille@gostai.com>
3333
3334 Propagate i18n changes into glr.c.
3335 * TODO: Update.
3336 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
3337 building the error message format dynamically.
3338 * data/lalr1.java: Formatting changes.
3339
2cd1af95
AD
33402008-12-11 Akim Demaille <demaille@gostai.com>
3341
3342 Use testsuite -C.
3343 * tests/local.mk: Replace "cd && testsuite" by "testsuite -C".
3344 Solves problems when top_srcdir is an absolute path.
3345 Suggested by Eric Blake.
3346 * configure.ac: Require Autoconf 2.62.
3347
eeb29422
AD
33482008-12-11 Akim Demaille <demaille@gostai.com>
3349
3350 Simplify the i18n of the error messages.
3351 * data/lalr1.cc: Comment changes.
3352 * data/yacc.c (yysyntax_error): Rewrite, using a switch as in
3353 lalr1.cc instead of building dynamically the format string.
3354
6617622c
AD
33552008-12-08 Akim Demaille <demaille@gostai.com>
3356
3357 Fix portability issue in the test suite.
3358 * tests/local.at (AT_MATCHES_CHECK): New.
3359 Based on Perl instead of Sed. Sed has too many portability
3360 pitfalls, not ever Sed is GNU Sed.
3361 * tests/actions.at (Fix user actions without a trailing semicolon):
3362 Use it.
3363
2ca1136c
AD
33642008-12-08 Akim Demaille <demaille@gostai.com>
3365
3366 Update data/README.
3367 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
3368
6c63b895
AD
33692008-12-08 Akim Demaille <demaille@gostai.com>
3370
3371 Install autoconf as a submodule to get m4sugar.
3372 * .gitmodules: Add submodules/autoconf.
3373 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
3374 submodules/autoconf.
3375
417e31d2
AD
33762008-12-08 Akim Demaille <demaille@gostai.com>
3377
3378 Test token.prefix in all the skeletons.
3379 * data/java.m4 (b4_token_enum): Use the token.prefix.
3380 * tests/local.at (AT_BISON_OPTION_PUSHDEFS): Define AT_TOKEN_PREFIX.
3381 * tests/calc.at (_AT_DATA_CALC_Y): Use it.
3382 Add checks for yacc.c, glr.c, lalr1.cc and glr.cc.
3383 * tests/java.at: Comment changes.
3384 (AT_CHECK_JAVA_MINIMAL): Define the END token.
3385 (Java parser class and package names): Add token.prefix check.
3386
97abf544
AD
33872008-12-08 Akim Demaille <demaille@gostai.com>
3388
3389 Fix regeneration of atconfig.
3390 * tests/local.mk (tests/atconfig): The rule was incorrect, but
3391 remove it: now that there is no tests/Makefile.am, the top-level
3392 Makefile properly updates atconfig when needed.
3393
e8cd1ad6
DJ
33942008-12-07 Di-an Jan <dianj@freeshell.org>
3395
3396 Implement the FIXME that ends an user action with a semicolon
3397 if it seems necessary.
3398 * src/scan-code.l (flex rules section): Flag cpp directive from
3399 any `#' to the first unescaped end-of-line. Semicolon is not
3400 needed after `;', `{', '}', or cpp directives and is needed after
3401 any other token (whitespaces and comments have no effect).
3402 * tests/actions.at (Fix user actions without a trailing semicolon):
3403 New test.
3404 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
3405 to make user actions complete statements.
3406 Adjust column numbers in error messages.
3407 * tests/regression.at (Fix user actions without a trailing semicolon):
3408 Remove. Covered by new test.
3409
ce9447fc
AD
34102008-12-07 Akim Demaille <demaille@gostai.com>
3411
3412 Update gnulib.
3413 * gnulib: Update from master.
3414
d333175f
EB
34152008-12-05 Eric Blake <ebb9@byu.net>
3416
3417 Avoid compiler warning.
3418 * src/output.c (muscle_insert_item_number_table): Delete unused
3419 function.
3420
215b40ac
EB
34212008-12-02 Eric Blake <ebb9@byu.net>
3422
3423 Build testsuite with newer autoconf.
3424 * tests/output.at (m4_expand): Don't override in newer autoconf,
3425 where the underlying implementation changed.
3426 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
3427 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
3428 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
3429 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
3430 since some of them contain unbalanced ')'.
3431
3bb21113
AD
34322008-12-01 Akim Demaille <demaille@gostai.com>
3433
3434 Use b4_symbol for printers and destructors everywhere.
3435 * data/bison.m4 (b4_symbol_action_location): New.
3436 * data/c.m4 (b4_symbol_actions): Remove.
3437 Adjust all callers to use by b4_symbol_foreach and the corresponding
3438 b4_symbol_printer/destructor macro.
3439 * data/glr.cc: Adjust.
3440 * data/lalr1.java: Adjust the %destructor sanity check.
3441 * src/output.c (symbol_code_props_output): Remove, we no longer
3442 need the b4_symbol_printers/destructors tables.
3443
fb7c5b1f
AD
34442008-12-01 Akim Demaille <demaille@gostai.com>
3445
3446 Use b4_symbol_case_.
3447 * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use
3448 b4_symbol_case_.
3449
cf6fb222
AD
34502008-12-01 Akim Demaille <demaille@gostai.com>
3451
3452 Move b4_symbol based macro to bison.m4.
3453 * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if)
3454 (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer)
3455 (b4_symbol_case_, b4_symbol_foreach, b4_type_action_)
3456 (b4_type_foreach): Move to...
3457 * data/bison.m4: Here.
3458 * data/lalr1.cc (b4_symbol_action): Specialize for C++: use
3459 b4_symbol_value_template instead of b4_symbol_value.
cf6fb222 3460
e3c52a63
AD
34612008-12-01 Akim Demaille <demaille@gostai.com>
3462
3463 b4_symbol/type_foreach.
3464 * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New.
3465 Use them.
3466
2bde9113
AD
34672008-12-01 Akim Demaille <demaille@gostai.com>
3468
3469 Use the symbol properties to output the printer/destructor for lalr1.cc.
30c10faf
AD
3470 Instead of defining complex list of tuples to define various
3471 properties of the symbols, we now prefer to define symbols as
3472 "structs" in m4: using the symbol key (its number), and the
3473 property name, b4_symbol gives it value. Use this to handle
3474 destructors and printers.
3475
2bde9113
AD
3476 * src/output.c (CODE_PROP): New.
3477 (prepare_symbol_definitions): Use it to define the printer and
3478 destructor related attributes of the symbols.
3479 * data/lalr1.cc (b4_symbol_actions): Rename as...
3480 (b4_symbol_action): this.
3481 Use b4_symbol instead of 6 arguments.
3482 (b4_symbol_printer, b4_symbol_destructor): New.
3483 Use them instead of b4_symbol_actions.
3484
44494bf6
AD
34852008-12-01 Akim Demaille <demaille@gostai.com>
3486
3487 Avoid capturing variables too easily.
3488 * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use
3489 v__ and p__ instead of v and p.
3490
fad814bd
AD
34912008-12-01 Akim Demaille <demaille@gostai.com>
3492
3493 Remove spurious empty line before syncline.
3494 * data/bison.m4 (b4_syncline): Don't output an empty line before
3495 the output.
3496
feda5527
AD
34972008-11-26 Akim Demaille <demaille@gostai.com>
3498
3499 Convert lib/Makefile.am into lib/local.mk.
3500 The real problem is rather gnulib.mk, which itself is extracted
3501 from a Makefile.am that gnulib expects to the "recursive". The
3502 tool prefix-gnulib-mk converts such a gnulib.mk to be
3503 non-recursive. Also, some AC_SUBST variables need to be adjusted.
3504
3505 * etc/prefix-gnulib-mk: New.
3506 * bootstrap (slurp): Use it to convert further gnulib.mk.
3507 No longer try to avoid re-creation of lib/gnulib.mk as the changes
3508 are deeper.
3509 * lib/Makefile.am: Rename as...
3510 * lib/local.mk: this.
3511 Adjust to be prefixed.
3512 * Makefile.am, configure.ac: Adjust.
3513 * src/local.mk (AM_CPPFLAGS): Extend it, don't define it.
3514
56ddee7f
AD
35152008-11-26 Akim Demaille <demaille@gostai.com>
3516
3517 s/_FLAGS/FLAGS/.
3518 * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as...
3519 (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS.
3520 Reported by Eric Blake.
3521
728e89a0
AD
35222008-11-26 Akim Demaille <demaille@gostai.com>
3523
3524 Use b4_parser_tables_define in glr.cc.
3525 * data/glr.c: Use b4_parser_tables_define instead of defining the
3526 (deterministic integral) tables by hand.
3527
2c1bf9bd
AD
35282008-11-26 Akim Demaille <demaille@gostai.com>
3529
3530 Use b4_parser_tables_define in Java.
3531 * data/java.m4 (b4_typed_parser_table): Rename as...
3532 (b4_typed_parser_table_define): this, for consistency.
3533 Accept a comment as $4.
3534 Move $2 into yy*_.
3535 (b4_integral_parser_table): Rename as...
3536 (b4_integral_parser_table_define): this.
3537 * data/lalr1.java: Adjust all uses.
3538 Use b4_parser_tables_define instead of generation by hand.
3539
ba206cf4
AD
35402008-11-26 Akim Demaille <demaille@gostai.com>
3541
3542 Prepare the convergence bw C style and Java table generation.
3543 * data/bison.m4 (b4_tables_map, b4_tables_declare)
3544 (b4_tables_define): Rename as...
3545 (b4_integral_parser_tables_map, b4_parser_tables_declare)
3546 (b4_parser_tables_define): these.
3547 * data/c.m4 (b4_table_define): Rename as...
3548 (b4_integral_parser_table_define): this.
3549 * data/lalr1.cc: Adjust.
3550 (b4_table_define, b4_table_declare): Rename as...
3551 (b4_integral_parser_table_define)
3552 (b4_integral_parser_table_declare): these.
3553 (yyrline_): Move the comment where it is actually used.
3554 * data/yacc.c: Adjust.
3555 (yyrline): Use b4_integral_parser_table_define.
3556
d12f8e49
AD
35572008-11-26 Akim Demaille <demaille@gostai.com>
3558
3559 Regen.
3560 * src/parse-gram.h, src/parse-gram.c: Regen.
3561
0991e29b
AD
35622008-11-26 Akim Demaille <demaille@gostai.com>
3563
3564 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
3565 * data/lalr1.cc (b4_tables_map): Move to...
3566 * data/bison.m4: here.
3567 Update the comment for yytable during the flight.
3568 (b4_tables_declare, b4_tables_define): New.
3569 * data/lalr1.cc: Use them.
3570 * data/c.m4 (b4_table_define): New.
3571 * data/yacc.c: Use b4_tables_define instead of output the tables
3572 by hand.
3573 * tests/regression.at (Web2c Actions): Adjust the expected output,
3574 the order of the tables changed.
3575
3d3bc1fe
AD
35762008-11-26 Akim Demaille <demaille@gostai.com>
3577
3578 Get rid of (yy)rhs and (yy)prhs.
3579 These tables are no longer needed in the parsers, and they don't seem to
3580 be useful. They are not documented either.
feda5527 3581
3d3bc1fe
AD
3582 * src/output.c (prepare_rules): Get rid of rhs and prhs.
3583 Adjust the computation of (yy)r2.
3584
08c81469
AD
35852008-11-26 Akim Demaille <demaille@gostai.com>
3586
3587 Rule length is unsigned.
3588 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
3589
932b0c96
AD
35902008-11-26 Akim Demaille <demaille@gostai.com>
3591
3592 Get rid of lalr1-split.cc.
3593 It was no longer maintainer.
feda5527 3594
932b0c96
AD
3595 * data/lalr1-split.cc: Remove.
3596 * etc/bench.pl.in (bench_fusion_parser): Remove.
3597 Adjust.
3598
8452c667
AD
35992008-11-26 Akim Demaille <demaille@gostai.com>
3600
3601 Use yy* consistently.
3602 * data/glr.c: Now that yyrhs no longer exists as a global
3603 variable, rename local "rhs" variables into "yyrhs" for
3604 consistency.
3605
783aa653
AD
36062008-11-25 Akim Demaille <demaille@gostai.com>
3607
3608 Get rid of yyrhs and yyprhs in glr.c.
3609 * data/glr.c (yyrhs, yyprhs): Remove.
3610 Instead, use the state stack and yystos.
3611
6130b755
AD
36122008-11-25 Akim Demaille <demaille@gostai.com>
3613
3614 Flag glr tests.
3615 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
3616 as an Autotest keyword.
3617
95a7b1c9
AD
36182008-11-25 Akim Demaille <demaille@gostai.com>
3619
3620 Prefer TESTSUITE_FLAGS.
3621 TESTSUITEFLAGS is barely readable.
feda5527 3622
95a7b1c9
AD
3623 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
3624 for backward compatibility.
3625 Use the former instead of the latter.
3626
b4f18401
AD
36272008-11-25 Akim Demaille <demaille@gostai.com>
3628
3629 Get rid of yyrhs and yyprhs in larl1.java.
3630 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
3631 (yy_reduce_print): Rather, use yystos_ and the state stack.
3632
c265fd6b
AD
36332008-11-25 Akim Demaille <demaille@gostai.com>
3634
3635 Formatting changes.
3636
68dbdee8
AD
36372008-11-25 Akim Demaille <demaille@gostai.com>
3638
3639 Get rid of yyrhs and yyprhs in yacc.c.
30c10faf
AD
3640 They were used to get the symbol types, given a rule number, when
3641 displaying the top of the stack before a reduction. But the
3642 symbol type is available from the state stack. This has two be
3643 benefits: two tables less in the parser (making it smaller), and a
3644 more consistent use of the three stacks which will help to fuse
3645 them.
feda5527 3646
68dbdee8
AD
3647 * data/yacc.c (yyprhs, yyrhs): Remove.
3648 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
3649 (yy_reduce_print): Take yyssp as argument.
3650 Use it, together with yystos, to get the symbol type.
3651 * tests/regression.at (Web2c Report): Remove these tables from the
3652 expected output.
3653
6ab1adbe
AD
36542008-11-25 Akim Demaille <demaille@gostai.com>
3655
3656 b4_tables_map.
3657 The point is to factor the generation of the tables across skeletons.
3658 This is language dependant.
feda5527 3659
6ab1adbe
AD
3660 * data/c.m4 (b4_comment_): New.
3661 Should be usable to define how to generate tables independently of
3662 the language.
3663 (b4_c_comment): New.
3664 (b4_comment): Bounce to b4_c_comment.
3665 Now support $2 = [PREFIX] for indentation.
3666 * data/lalr1.cc (b4_table_declare): Don't output a comment if
3667 there is no comment.
3668 Indent it properly when there is one.
3669 Output the ending semicolon.
3670 (b4_table_define): Space changes.
3671 Output the ending semicolon.
3672 (b4_tables_map): New.
3673 Use it twice instead of declaring and defining the (integral)
3674 tables by hand.
3675
0fddb3d5
AD
36762008-11-25 Akim Demaille <demaille@gostai.com>
3677
3678 b4_table_declare.
3679 * data/lalr1.cc (b4_table_declare): New.
3680 Use it to declare the tables defined with b4_table_define.
3681 (b4_table_define): Declare a third arg to match b4_table_declare
3682 signature.
3683 Move all the comments around invocations of b4_table_define into
3684 the invocations itselves.
3685 Move things around to have the order for declarations and
3686 definitions.
3687
c4ddc0fb
AD
36882008-11-25 Akim Demaille <demaille@gostai.com>
3689
3690 Formatting changes.
3691 * data/lalr1.java: here.
3692
e0c653e7
AD
36932008-11-25 Akim Demaille <demaille@gostai.com>
3694
3695 b4_args is more general than only C++.
3696 * data/lalr1.cc (b4_args, _b4_args): Move to...
3697 * data/bison.m4: here.
3698
4182a0a1
DJ
36992008-11-21 Di-an Jan <dianj@freeshell.org>
3700
3701 Implement no-XXX arguments for --warnings, --report, --trace.
3702 * src/getargs.c (flags_argmatch): Handles no-XXX.
3703 Fix typo in doxygen comment.
3704
01466c3e
AD
37052008-11-21 Akim Demaille <demaille@gostai.com>
3706
3707 Display the changes in cross-options.texi.
3708 * build-aux/cross-options.pl ($sep): New, to separate items.
3709 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
3710 changes.
3711
a7c09cba
DJ
37122008-11-20 Di-an Jan <dianj@freeshell.org>
3713
3714 Improves options in the manual.
3715 * doc/bison.texinfo (-g, -x): Add space before argument.
3716 (Option Cross Key): Implement FIXME: listing directives also.
3717 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
3718 (Short Option): Special case -d. Put arguments inside @option.
feda5527 3719 (Bison Directive): Add column, automatically extracted from
a7c09cba
DJ
3720 src/scan-gram.l (actual name passed as the first argument)
3721 with special case for %define.
3722 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
3723 to build-aux/cross-options.pl.
3724 * src/getargs.c (usage): Document limitations of cross-options.pl.
3725 * src/scan-gram.l: Likewise.
3726
6c88b51e
JD
37272008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
3728
3729 Fix unexpanded macros in GLR defines file.
3730 Reported by Csaba Raduly at
3731 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
3732 * THANKS (Csaba Raduly): Add.
3733 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
3734 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
3735 lexer in a separate module that includes the defines file.
3736 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
3737 source.
3738 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
3739 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
3740 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
3741 (AT_DATA_SOURCE_PROLOGUE): New.
3742 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
3743 (AT_DATA_SOURCE): New.
3744 (AT_FULL_COMPILE): Extend to support an additional source file.
3745
1e034807
AD
37462008-11-18 Akim Demaille <demaille@gostai.com>
3747
3748 More TODO.
3749 * TODO: More short term issues.
3750
e3dda35c
AD
37512008-11-18 Akim Demaille <demaille@gostai.com>
3752
3753 Regen.
3754 * src/parse-gram.h, src/parse-gram.c: Regen.
3755
bd187d7b
AD
37562008-11-18 Akim Demaille <demaille@gostai.com>
3757
3758 Use b4_subtract where possible.
3759 * data/lalr1.cc (b4_subtract): Move to...
3760 * data/bison.m4: here.
3761 * data/glr.c (b4_rhs_data): Use it.
3762 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
3763
6085ab0d
AD
37642008-11-18 Akim Demaille <demaille@gostai.com>
3765
3766 Remove incorrect mode specification.
3767 * data/glr.cc: Don't pretend it's C code.
3768
9ce405ce
JD
37692008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
3770
3771 Simplify last patch slightly.
3772 * src/getargs.c (getargs): Here.
3773
a8beef7e
JD
37742008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
3775
3776 Fix last warning from --enable-gcc-warnings.
3777 * src/getargs.c (getargs): Don't assign const address to non-const
3778 pointer.
3779
d50eea6d
JD
37802008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
3781
3782 Don't let maintainer-*-check targets force a version update.
3783 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
3784 handled.
3785
f5f419de
DJ
37862008-11-17 Di-an Jan <dianj@freeshell.org>
3787
3788 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
3789 Align menus. Adjust word wrapping. Use node names for menu names.
3790 (Examples): Don't abbreviate node names.
3791 (LocalWords): Remove abbreviations.
3792 (Copying): Make description a sentence.
d50eea6d 3793 (Java Action Features): Remove period to match the rest of menu.
f5f419de 3794
d73e55e0
DJ
37952008-11-17 Di-an Jan <dianj@freeshell.org>
3796
3797 Handles several --enable-gcc-warnings.
3798 * src/getargs.c (command_line_location): Set parameters to void.
3799 * src/output.c (symbol_type_name_cmp): Make static.
3800 (symbols_by_type_name): Set parameters to void.
3801 (symbol_definitions_output): Remove unused parameter. Rename as...
3802 (prepare_symbol_definitions): this.
3803 (muscles_output): Move symbol_definitions_output to...
3804 (output): here as prepare_symbol_definitions.
3805 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
d50eea6d 3806 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
d73e55e0 3807
68c989de
DJ
38082008-11-17 Di-an Jan <dianj@freeshell.org>
3809
3810 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
3811 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
3812
23ce6f4c
AD
38132008-11-16 Akim Demaille <demaille@gostai.com>
3814
3815 Add missing $(EXEEXT).
3816 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
3817 "src/bison$(EXEEXT)".
3818 Reported by Di-an Jan.
3819
dd704c35
AD
38202008-11-15 Akim Demaille <demaille@gostai.com>
3821
3822 * TODO: Update.
3823
dab244d5
AD
38242008-11-15 Akim Demaille <demaille@gostai.com>
3825
3826 Formatting changes.
3827 * tests/input.at: here.
3828
4b4da9fb
AD
38292008-11-15 Akim Demaille <demaille@gostai.com>
3830
3831 Remove duplicate header inclusion.
3832 * src/LR0.c: here.
3833
4ea3f53d
AD
38342008-11-15 Akim Demaille <demaille@gostai.com>
3835
3836 * src/parse-gram.h, src/parse-gram.c: Regen.
3837
cb823b6f
AD
38382008-11-15 Akim Demaille <demaille@gostai.com>
3839
3840 Support parametric types.
b06df3c2
AD
3841
3842 There are two issues to handle: first scanning nested angle
3843 bracket pairs to support types such as std::pair< std::string,
3844 std::list<std::string> > >.
3845
3846 Another issue is to address idiosyncracies of C++: do not glue two
3847 closing angle brackets together (otherwise it's operator>>), and
3848 avoid sticking blindly a TYPE to the opening <, as it can result
3849 in '<:' which is a digraph for '['.
3850
cb823b6f
AD
3851 * src/scan-gram.l (brace_level): Rename as...
3852 (nesting): this.
3853 (SC_TAG): New.
3854 Implement support for complex tags.
b06df3c2 3855 (tag): Accept
cb823b6f
AD
3856 , but not <.
3857 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
3858 (b4_symbol_variant): Leave space around types as parameters.
3859 * examples/variant.yy: Use nested template types and leading ::.
3860 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
3861 Rename as...
3862 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
3863 * tests/c++.at: Test parametric types.
3864
7b6e6753
AD
38652008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3866
3867 Test token.prefix.
3868 This is not sufficient, but we test at least that the make_SYMBOL
3869 interface is not affected by token.prefix. A more general test
3870 will be implemented when the support of token.prefix is generalized
3871 to more skeletons.
b06df3c2 3872
7b6e6753
AD
3873 * tests/c++.at: One more variant test, using token.prefix.
3874
dddec537
AD
38752008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3876
3877 Test the make_TOKEN interface.
3878 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
3879 Factor the common code in yylex.
3880 Use it to test "%define lex_symbol".
3881
7d3e21ba
AD
38822008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3883
3884 Formatting change.
3885
4fc55348
AD
38862008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3887
3888 Simplify code for variants bench marks.
3889 * etc/bench.pl.in (&generate_grammar_list): Define and use
3890 location_type.
3891 Factor the common code in yylex.
3892
070e6509
AD
38932008-11-15 Akim Demaille <demaille@gostai.com>
3894
3895 Better error message.
3896 * bootstrap (find_tool): Fix the error message.
3897
0078681b
AD
38982008-11-15 Akim Demaille <demaille@gostai.com>
3899
3900 Update variant.yy to newest interface.
3901 * examples/variant.yy: Define lex_symbol.
3902 Adjust.
3903
ff084799
AD
39042008-11-15 Akim Demaille <demaille@gostai.com>
3905
3906 Don't use locations in variant.yy.
3907 * examples/variant.yy: Adjust to not using locations.
3908
b0d79ec6
AD
39092008-11-15 Akim Demaille <demaille@gostai.com>
3910
3911 Comment changes.
3912 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
3913 comments for the license.
3914
d4977ce3
AD
39152008-11-15 Akim Demaille <demaille@gostai.com>
3916
3917 Remove tests/Makefile.am.
3918 * tests/Makefile.am: Rename as...
3919 * tests/local.mk: this.
3920 * Makefile.am, configure.ac: Adjust.
3921 * Makefile.am (DISTCLEANFILES): Define.
3922 (maintainer-check, maintainer-xml-check, maintainer-push-check):
3923 Remove, we no longer need to bounce to the real targets.
3924
87f1149a
AD
39252008-11-15 Akim Demaille <demaille@gostai.com>
3926
3927 Comment changes.
3928
36415906
AD
39292008-11-15 Akim Demaille <demaille@gostai.com>
3930
3931 djgpp/local.mk.
3932 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
3933 * djgpp/local.mk: this new file.
3934
e2c2f696
AD
39352008-11-15 Akim Demaille <demaille@gostai.com>
3936
3937 Remove doc/Makefile.am.
3938 * doc/Makefile.am: Rename as...
3939 * doc/local.mk: this.
3940 Adjust paths
3941 * Makefile.am, configure.ac: Adjust.
3942 * Makefile.am (MOSTLYCLEANFILES): New.
3943 * src/local.mk: Adjust.
3944
2ead32e6
AD
39452008-11-15 Akim Demaille <demaille@gostai.com>
3946
3947 Move sc_tight_scope into maint.mk.
b06df3c2
AD
3948 It does not work, and I don't know how it was supposed to work: it
3949 seems to be looking for sources in the build tree. I just moved
3950 it at a better place, fixing it is still required.
3951
2ead32e6
AD
3952 * src/local.mk (echo): Remove.
3953 (sc_tight_scope): Move to...
3954 * maint.mk: here.
3955
2df9ec37
AD
39562008-11-15 Akim Demaille <demaille@gostai.com>
3957
3958 Regen.
3959 * src/parse-gram.h, src/parse-gram.h: Regen.
3960
0305d25e
AD
39612008-11-15 Akim Demaille <demaille@gostai.com>
3962
3963 Remove src/Makefile.am.
3964 * src/Makefile.am: Rename as...
3965 * src/local.mk: this.
3966 Prefix all the paths with src/.
3967 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
3968 (AM_CPPFLAGS): Find find in builddir/src.
3969 (YACC): Move the flags into...
3970 (AM_YFLAGS): here.
3971 * maint.mk (sc_tight_scope): Disable.
3972 It used to bounce to the version in src/Makefile.am which is now
3973 part of this very Makefile.
3974 * Makefile.am, configure.ac: Adjust.
3975 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
3976 include "..." to find files "here": we are no longer in src/, so
3977 qualify the includes with src/.
3978 * doc/Makefile.am (PREPATH): No longer include the top_builddir
3979 prefix.
3980 (.x.1): Adjust to be able to create src/foo from the top level
3981 Makefile, instead of going bounce to src/Makefile the creation of
3982 foo.
3983
5277c0a3
AD
39842008-11-15 Akim Demaille <demaille@gostai.com>
3985
3986 Remove useless variable.
3987 * doc/Makefile.am (srcsrcdir): Remove.
3988
6a5aa0cd
AD
39892008-11-15 Akim Demaille <demaille@gostai.com>
3990
3991 Remove data/Makefile.am.
3992 * data/Makefile.am: Rename as...
3993 * data/local.mk: this.
3994 Adjust paths.
3995 * Makefile.am, configure.ac: Adjust.
3996
7cb794dc
AD
39972008-11-15 Akim Demaille <demaille@gostai.com>
3998
3999 Remove etc/Makefile.am.
4000 * etc/Makefile.am: Rename as...
4001 * etc/local.mk: this.
4002 Adjust.
4003 * Makefile.am, configure.ac: Adjust.
4004
cd409e3b
AD
40052008-11-15 Akim Demaille <demaille@gostai.com>
4006
4007 Remove examples/local.mk.
4008 examples/calc++/Makefile.am might be interesting to keep as is, since
4009 it is an example in itself.
2df9ec37 4010
cd409e3b
AD
4011 * examples/Makefile.am: Rename as...
4012 * examples/local.mk: this.
4013 Adjust.
4014 * Makefile.am, configure.ac: Adjust.
4015
9a1e4214
AD
40162008-11-15 Akim Demaille <demaille@gostai.com>
4017
4018 Remove build-aux/Makefile.am.
4019 Recursive Makefiles are really way too slow, let's get rid of some of
4020 them.
2df9ec37 4021
9a1e4214
AD
4022 * build-aux/Makefile.am: Rename as...
4023 * build-aux/local.mk: this.
4024 Adjust paths.
4025 * Makefile.am, configure.ac: Adjust.
4026
0634493c
AD
40272008-11-15 Akim Demaille <demaille@gostai.com>
4028
4029 Provide convenience constructors for locations and positions.
4030 * data/location.cc (position::position): Accept file, line and
4031 column as arguments with default values.
4032 Always qualify initial line and column literals as unsigned.
4033 (location::location): Provide convenience constructors.
4034
fe1b448a
AD
40352008-11-15 Akim Demaille <demaille@gostai.com>
4036
b06df3c2
AD
4037 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
4038 token type.
fe1b448a
AD
4039 Using template buys us nothing, and makes it uselessly complex to
4040 construct a symbol. Besides, it could not be generalized to other
4041 languages, while make_FOO would work in C/Java etc.
2df9ec37 4042
fe1b448a
AD
4043 * data/lalr1.cc (b4_symbol_): New.
4044 (b4_symbol): Use it.
4045 (b4_symbol_constructor_declaration_)
4046 (b4_symbol_constructor_definition_): Instead of generating
4047 specializations of an overloaded template function, just generate
4048 several functions whose names are forged from the token names
4049 without the token.prefix.
4050 (b4_symbol_constructor_declarations): Generate them for all the
4051 symbols, not just by class of symbol type, now that instead of
4052 specializing a function template by the token, we generate a
4053 function named after the token.
4054 (b4_symbol_constructor_specialization_)
4055 (b4_symbol_constructor_specializations): Remove.
4056 * etc/bench.pl.in: Adjust to this new API.
4057
5679f311
AD
40582008-11-13 Akim Demaille <demaille@gostai.com>
4059
4060 %define token.prefix.
b06df3c2
AD
4061 Provide a means to add a prefix to the name of the tokens as
4062 output in the generated files. Because of name clashes, it is
4063 good to have such a prefix such as TOK_ that protects from names
4064 such as EOF, FILE etc. But it clutters the grammar itself.
2df9ec37 4065
5679f311
AD
4066 * data/bison.m4 (token.prefix): Empty by default.
4067 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
4068 * data/lalr1.cc (b4_symbol): Ditto.
4069
3204049e
AD
40702008-11-13 Akim Demaille <demaille@gostai.com>
4071
4072 Compute at M4 time some of the subtractions.
90290ce5 4073 * data/lalr1.cc (b4_subtract): New.
3204049e
AD
4074 (b4_rhs_data): Use it.
4075
202598d3
AD
40762008-11-13 Akim Demaille <demaille@gostai.com>
4077
4078 symbol::token.
b06df3c2 4079 This allows the user to get the type of a token returned by yylex.
2df9ec37 4080
202598d3
AD
4081 * data/lalr1.cc (symbol::token): New.
4082 (yytoknum_): Define when %define lex_symbol, independently of
4083 %debug.
4084 (yytoken_number_): Move into...
4085 (symbol::token): here, since that's the only use.
4086 The other one is YYPRINT which was not officially supported
4087 by lalr1.cc, and anyway it did not work since YYPRINT uses this
4088 array under a different name (yytoknum).
4089
fc2476c7
AD
40902008-11-13 Akim Demaille <demaille@gostai.com>
4091
4092 YYERRCODE.
4093 * TODO (YYERRCODE): Mention the case of $undef.
4094
865f1e9f
AD
40952008-11-13 Akim Demaille <demaille@gostai.com>
4096
4097 TODO: YYPRINT.
4098 * TODO (YYPRINT): New.
4099
cb0b136a
AD
41002008-11-13 Akim Demaille <demaille@gostai.com>
4101
4102 Comment changes.
4103 * data/lalr1.cc, data/yacc.c: Fix the description of the
4104 yytranslate and yytoknum tables.
4105
2c086d29
AD
41062008-11-13 Akim Demaille <demaille@gostai.com>
4107
4108 Define make_symbol in the header.
b06df3c2
AD
4109 To reach good performances these functions should be inlined (yet
4110 this is to measure precisely). To this end they must be available
4111 to the caller.
2df9ec37 4112
2c086d29
AD
4113 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
4114 location_type with the class name.
4115 Since will now be output in the header, declare "inline".
4116 No longer use b4_symbol_constructor_specializations, but
4117 b4_symbol_constructor_definitions in the header.
4118 Don't call it in the *.cc file.
4119
1c4af381
AD
41202008-11-13 Akim Demaille <demaille@gostai.com>
4121
4122 Define yytranslate in the header for lex_symbol.
4123 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
4124 into the header file when using %define lex_symbol.
4125 (yytranslate_): Declare inline.
4126
e51b0a82
AD
41272008-11-13 Akim Demaille <demaille@gostai.com>
4128
b06df3c2
AD
4129 Define the constructors of symbol_type in
4130 b4_symbol_constructor_definitions.
e51b0a82 4131 The constructors are called by the make_symbol functions, which a
b06df3c2
AD
4132 forthcoming patch will move elsewhere. Hence the interest of
4133 putting them together.
2df9ec37 4134
b06df3c2
AD
4135 The stack_symbol_type does not need to be moved, it is used only
4136 by the parser.
2df9ec37 4137
e51b0a82
AD
4138 * data/lalr1.cc: Move symbol_type and symbol_base_type
4139 constructors into...
4140 (b4_symbol_constructor_definitions): here.
4141 Adjust.
4142
78835571
AD
41432008-11-13 Akim Demaille <demaille@gostai.com>
4144
4145 Make it easier to move the definition of yytranslate_.
4146 Forthcoming changes will make it possible to use yytranslate_
4147 from outside the parser implementation file.
2df9ec37 4148
78835571
AD
4149 * data/lalr1.cc (b4_yytranslate_definition): New.
4150 Use it.
4151
c1e6c88c
AD
41522008-11-13 Akim Demaille <demaille@gostai.com>
4153
4154 Remove useless class specification.
4155 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
4156 to refer to the class name to use a type defined by the class for
4157 arguments of member functions.
4158
4654b0c0
AD
41592008-11-13 Akim Demaille <demaille@gostai.com>
4160
4161 Finer input type for yytranslate.
4162 This patch is debatable: the tradition expects yylex to return an int
4163 which happens to correspond to token_number (which is an enum). This
4164 allows for instance to return characters (such as '*' etc.). But this
4165 goes against the stronger typing I am trying to have with the new
4166 lex interface which return a symbol_type. So in this case, feed
4167 yytranslate_ with a token_type.
2df9ec37 4168
4654b0c0
AD
4169 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
4170 expect a token_type.
4171
dd735e4e
AD
41722008-11-13 Akim Demaille <demaille@gostai.com>
4173
4174 Honor lex-params in %define lex_symbol mode.
4175 * data/lalr1.cc: Use b4_lex_param.
4176
6659366c
AD
41772008-11-13 Akim Demaille <demaille@gostai.com>
4178
4179 Simplify names.
4180 * src/output.c (symbol_definitions_output): Rename symbol
4181 attributes type_name and has_type_name as type and has_type.
4182 * data/lalr1.cc: Adjust uses.
4183
e9805e57
AD
41842008-11-13 Akim Demaille <demaille@gostai.com>
4185
4186 Use b4_type_names for the union type.
b06df3c2
AD
4187 The union used to compute the size of the variant used to iterate
4188 over the type of all the symbols, with a lot of redundancy. Now
4189 iterate over the lists of symbols having the same type-name.
2df9ec37 4190
e9805e57
AD
4191 * data/lalr1.cc (b4_char_sizeof_): New.
4192 (b4_char_sizeof): Use it.
4193 Adjust to be called with a list of numbers instead of a single
4194 number.
4195 Adjust its caller for new-line issues.
4196
aea10ef4
AD
41972008-11-13 Akim Demaille <demaille@gostai.com>
4198
4199 Define the "identifier" of a symbol.
b06df3c2
AD
4200 Symbols may have several string representations, for instance if
4201 they have an alias. What I call its "id" is a string that can be
4202 used as an identifier. May not exist.
2df9ec37 4203
b06df3c2
AD
4204 Currently the symbols which have the "tag_is_id" flag set are
4205 those that don't have an alias. Look harder for the id.
2df9ec37 4206
aea10ef4
AD
4207 * src/output.c (is_identifier): Move to...
4208 * src/symtab.c (is_identifier): here.
4209 * src/symtab.h, src/symtab.c (symbol_id_get): New.
4210 * src/output.c (symbol_definitions_output): Use it to define "id"
4211 and "has_id".
4212 Remove the definition of "tag_is_id".
4213 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
4214 "tag_is_id" were used to produce code.
4215 We still use "tag" for documentation.
4216
2ea7730c
AD
42172008-11-11 Akim Demaille <demaille@gostai.com>
4218
4219 Locations are no longer required by lalr1.cc.
4220 * data/lalr1.cc (_b4_args, b4_args): New.
4221 Adjust all uses of locations to make them optional.
4222 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
4223 (AT_CHECK_NAMESPACE): Check the use of locations.
4224 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
4225 without locations with lalr1.cc.
4226 Test these cases.
4227 * tests/output.at: Check lalr1.cc with and without location
4228 support.
4229 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
4230 Don't use locations.
4231
7ca2266a
AD
42322008-11-11 Akim Demaille <demaille@gostai.com>
4233
4234 AT_FULL_COMPILE.
4235 * tests/local.at (AT_FULL_COMPILE): New.
4236 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
4237
1a7a65f9
AD
42382008-11-11 Akim Demaille <demaille@gostai.com>
4239
4240 Support parens in calc++.
4241 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
4242 * examples/calc++/test (run): Check the expected output.
4243 Adjust callers.
4244 Check parens too.
4245
c944f7f2
AD
42462008-11-11 Akim Demaille <demaille@gostai.com>
4247
4248 Simplify lalr1.cc since %defines is mandatory.
4249 * data/lalr1.cc: Remove useless calls to b4_defines_if.
4250
dada3cd1
AD
42512008-11-11 Akim Demaille <demaille@gostai.com>
4252
4253 TODO: yyfmt.
4254 * TODO (yysyntax_error): New item.
4255
422c18f4
AD
42562008-11-11 Akim Demaille <demaille@gostai.com>
4257
4258 Prefer M4 to CPP.
4259 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
4260 YYERROR_VERBOSE.
4261
a0ffc175
AD
42622008-11-11 Akim Demaille <demaille@gostai.com>
4263
4264 Support i18n of the parse error messages.
4265 * TODO (lalr1.cc/I18n): Remove.
4266 * data/lalr1.cc (yysyntax_error_): Support the translation of the
4267 error messages, as done in yacc.c.
4268 Stay within the yy* pseudo namespace.
4269
00a8a083
AD
42702008-11-11 Akim Demaille <demaille@gostai.com>
4271
4272 More TODO.
4273 * TODO (single stack, yysyntax_error): New.
4274
09277875
AD
42752008-11-11 Akim Demaille <demaille@gostai.com>
4276
4277 Make it possible to return a symbol_type from yylex.
4278 * data/lalr1.cc (b4_lex_symbol_if): New.
4279 (parse): When lex_symbol is defined, expected yylex to return the
4280 complete lookahead.
4281 * etc/bench.pl.in (generate_grammar_list): Extend to support this
4282 yylex interface.
4283 (bench_variant_parser): Exercise it.
4284
64c1b92a
AD
42852008-11-11 Akim Demaille <demaille@gostai.com>
4286
4287 Remove useless bench case.
4288 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
4289 no longer used.
4290
2722aa42
AD
42912008-11-11 Akim Demaille <demaille@gostai.com>
4292
4293 Improve display of directives.
4294 * etc/bench.pl.in (parse_term): Don't add useless eol.
4295
918eb7c5
AD
42962008-11-11 Akim Demaille <demaille@gostai.com>
4297
4298 Use string_cast in the bench.
4299 * etc/bench.pl.in (generate_grammar_list): Define and use
4300 string_cast.
4301
39be9022
AD
43022008-11-11 Akim Demaille <demaille@gostai.com>
4303
4304 Replace yychar with a Boolean.
4305 * data/lalr1.cc (parse::yychar): Replace by...
4306 (parse::yyempty): this.
4307
a2e3fa77
AD
43082008-11-11 Akim Demaille <demaille@gostai.com>
4309
4310 Factor the tables.
4311 * TODO: New item.
4312
aba12ad1
AD
43132008-11-11 Akim Demaille <demaille@gostai.com>
4314
4315 Let yytranslate handle the eof case.
4316 * data/lalr1.cc (yytranslate_): Handle the EOF case.
4317 Adjust callers.
4318 No longer expect yychar to be equal to yyeof_, rather, test the
4319 lookahead's (translated) kind.
4320
27cb5b59
AD
43212008-11-11 Akim Demaille <demaille@gostai.com>
4322
4323 yychar cannot be empty in yyerrlab.
4324 * TODO (yychar == yyempty_): New.
4325 * data/lalr1.cc: Remove the handling of this case.
4326 This eases forthcoming changes related to yychar and yytranslate.
4327
fce629c0
AD
43282008-11-11 Akim Demaille <demaille@gostai.com>
4329
4330 Bench: syntactic sugar for %define/#define.
4331 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
4332 (&bench_push_parser, bench_variant_parser): Use this feature.
4333 (&eat): New.
4334 Use it.
4335
ce671960
AD
43362008-11-11 Akim Demaille <demaille@gostai.com>
4337
4338 Less memory pressure on the "list" bench.
4339 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
4340 the values, to limit memory pressure.
4341
2873fdf8
AD
43422008-11-11 Akim Demaille <demaille@gostai.com>
4343
4344 Introduce make_symbol.
b06df3c2
AD
4345 make_symbol provides a means to construct a full symbol (kind,
4346 value, location) in a single shot. It is meant to be a Symbol
4347 constructor, parameterized by the symbol kind so that overloading
4348 would prevent incorrect kind/value pairs. Unfortunately
4349 parameterized constructors do not work well in C++ (unless the
4350 parameter also appears as an argument, which is not acceptable),
4351 hence the use of a function instead of a constructor.
2df9ec37 4352
2873fdf8
AD
4353 * data/lalr1.cc (b4_symbol_constructor_declaration_)
4354 (b4_symbol_constructor_declarations)
4355 (b4_symbol_constructor_specialization_)
4356 (b4_symbol_constructor_specializations)
4357 (b4_symbol_constructor_definition_)
4358 (b4_symbol_constructor_definitions): New.
4359 Use them where appropriate to generate declaration, declaration of
4360 the specializations, and implementations of the templated
4361 overloaded function "make_symbol".
4362 (variant::variant): Always define a default ctor.
4363 Also provide a copy ctor.
4364 (symbol_base_type, symbol_type): New ctor overloads for value-less
4365 symbols.
4366 (symbol_type): Now public, so that functions such as yylex can use
4367 it.
4368
8be046d7
AD
43692008-11-11 Akim Demaille <demaille@gostai.com>
4370
4371 Inform m4 whether a tag is a valid id.
4372 * src/output.c (is_identifier): New.
4373 (symbol_definitions_output): Use it to define tag_is_id.
4374 But maybe this should be done at m4 level?
4375
de62edee
AD
43762008-11-11 Akim Demaille <demaille@gostai.com>
4377
4378 Test 214 was failing: it greps with a pattern containing [ ]*
4379 which obviously meant to catch spaces and tabs, but contained only
4380 spaces. Tabulations in sources are a nuisance, so to simplify the
4381 matter, get rid of all the tabulations in the Java sources. The
4382 other skeletons will be treated equally later.
4383
4384 * data/java.m4, data/lalr1.java: Untabify.
4385 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
4386 tabulations are no longer generated.
4387
905f0697
PB
43882008-11-11 Paolo Bonzini <bonzini@gnu.org>
4389
4390 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
4391 * configure.ac: Adjust usage.
4392 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
4393 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
4394 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
4395
09ccae9b
DJ
43962008-11-10 Di-an Jan <dianj@freeshell.org>
4397
4398 Workaround Java's ``code too large'' problem for parser tables
4399 in most cases, by using one function per initialization.
4400 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
4401 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
4402 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
4403 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
4404 (yytname_): Use b4_typed_parser_table.
4405 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
4406 ``code too large'' error.
4407
1979121c
DJ
44082008-11-10 Di-an Jan <dianj@freeshell.org>
4409
4410 * NEWS: Document them.
de62edee 4411
1979121c
DJ
4412 General Java skeleton improvements.
4413 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
4414 using gcj < 4.3 in the testsuite, according to comments in
4415 gnulib/m4/javacomp.m4.
4416 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
4417 location_type, position_type): Remove extraneous brackets from
4418 b4_percent_define_default.
4419 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
4420 m4_define and m4_define_default.
4421 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
4422 which marks the end of user code with appropriate syncline, like all
4423 the other skeletons.
4424 (b4_user_post_prologue): Add. Don't silently drop.
4425 (yylex): Remove.
4426 (parse): Inline yylex.
4427 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
4428 (%{...%}): Fix typo of %code imports.
4429 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
4430
4431 Support annotations on parser class with %define annotations.
4432 * data/lalr1.java (annotations): Add to parser class modifier.
4433 * doc/bison.texinfo (Java Parser Interface): Document
4434 %define annotations.
4435 (Java Declarations Summary): Document %define annotations.
4436 * tests/java.at (Java parser class modifiers): Test annotations.
4437
4438 Do not generate code for %error-verbose unless requested.
4439 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
4440 Make private. Make conditional on %error-verbose.
4441 (getErrorVerbose, setErrorVerbose): New.
4442 (yytnamerr_): Make conditional on %error-verbose.
4443 (yysyntax_error): Make some code conditional on %error-verbose.
4444 * doc/bison.texinfo (Java Bison Interface): Remove the parts
4445 about %error-verbose having no effect.
4446 (getErrorVerbose, setErrorVerbose): Document.
4447
4448 Move constants for token names to Lexer interface.
4449 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
4450 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
4451 (parse): Qualify EOF to Lexer.EOF.
4452 * doc/bison.texinfo (Java Parser Interface): Move documentation of
4453 EOF and token names to Java Lexer Interface.
4454 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
4455
4456 Make yyerror public.
4457 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
4458 (yyerror): Change to public. Add Javadoc comments. Use longer
4459 parameter names. Make the body rather than the declarator
4460 conditional on %locations.
4461 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
4462
4463 Allow user to add code to the constructor with %code init.
4464 * data/java.m4 (b4_init_throws): New, for %define init_throws.
4465 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
4466 Add %code init to the front of the constructor body.
4467 * doc/bison.texinfo (YYParser.YYParser): Document %code init
4468 and %define init_throws.
4469 (Java Declarations Summary): Document %code init and
4470 %define init_throws.
4471 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
4472 (Java constructor init and init_throws): Add tests.
de62edee 4473
42f832d6
AD
44742008-11-10 Akim Demaille <demaille@gostai.com>
4475
4476 Update TODO.
4477 * TODO (-D): is implemented.
4478 (associativity): Same precedence must have the same associativity.
4479 For instance, how can a * b / c be parsed if * is %left and / is
4480 %right?
4481 (YYERRORCODE, YYFAIL, YYBACKUP): New.
4482
247efe34
AD
44832008-11-10 Akim Demaille <demaille@gostai.com>
4484
4485 Formatting changes.
4486
5d731440
AD
44872008-11-10 Akim Demaille <demaille@gostai.com>
4488
4489 More information about the symbols.
4490 * src/output.c (type_names_output): Document all the symbols,
4491 including those that don't have a type-name.
4492 (symbol_definitions_output): Define "is_token" and
4493 "has_type_name".
4494 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
4495 type-name, now that they are defined too in b4_type_names.
4496
21db118b
AD
44972008-11-10 Akim Demaille <demaille@gostai.com>
4498
4499 Regen.
4500
6ed15cde
AD
45012008-11-10 Akim Demaille <demaille@gostai.com>
4502
4503 Make parser::yytranslate static.
b06df3c2
AD
4504 Small speedup (1%) on the list grammar. And makes yytranslate_
4505 available in non member functions.
de62edee 4506
6ed15cde
AD
4507 * data/lalr1.cc (yytranslate_): Does not need to be a instance
4508 function.
4509
30bb2edc
AD
45102008-11-10 Akim Demaille <demaille@gostai.com>
4511
4512 Avoid trailing spaces.
4513 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
4514 * data/lalr1.cc: Don't indent before rule and symbol actions, as
4515 they can be empty, and anyway this incorrectly indents the first
4516 action.
4517
b3a28fd4
AD
45182008-11-10 Akim Demaille <demaille@gostai.com>
4519
4520 Comment changes.
4521
914202bd
AD
45222008-11-10 Akim Demaille <demaille@gostai.com>
4523
4524 Use "enum" for integral constants.
4525 This is just nicer to read, I observed no speedup.
de62edee 4526
914202bd
AD
4527 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
4528 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
4529 (yyuser_token_number_max_, yyundef_token_): Move into...
4530 (yytranslate_): here.
4531
c17f9a4a
AD
45322008-11-10 Akim Demaille <demaille@gostai.com>
4533
4534 Shortcuts in bench directives.
4535 * etc/bench.pl.in (parse_dirs): New.
4536 Use it.
4537 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
4538 Create the benches in "benches/".
4539
b9855ea5
AD
45402008-11-10 Akim Demaille <demaille@gostai.com>
4541
4542 Formatting changes.
4543 * data/lalr1.cc: here.
4544
6e097787
AD
45452008-11-10 Akim Demaille <demaille@gostai.com>
4546
4547 Adjust verbose message to using emacs.
4548 * etc/bench.pl.in: Inform compilation-mode when we change the
4549 directory.
4550 (generate_grammar_list): Recognize %define "variant" in addition
4551 to %define variant.
4552
4c3cc7da
AD
45532008-11-10 Akim Demaille <demaille@gostai.com>
4554
4555 Classify symbols by type-name.
4556 * src/uniqstr.h (UNIQSTR_CMP): New.
4557 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
4558 (type_names_output): New.
4559 (muscles_output): Use it.
4560 * data/lalr1.cc (b4_symbol_action_): Remove.
4561 (b4_symbol_case_, b4_type_action_): New.
4562 Adjust uses of b4_symbol_action_ to use b4_type_action_.
4563
d69c9694
AD
45642008-11-10 Akim Demaille <demaille@gostai.com>
4565
4566 Change the handling of the symbols in the skeletons.
4567 Before we were using tables which lines were the symbols and which
4568 columns were things like number, tag, type-name etc. It is was
4569 difficult to extend: each time a column was added, all the numbers had
4570 to be updated (you asked for colon $2, not for "tag"). Also, it was
4571 hard to filter these tables when only a subset of the symbols (say the
4572 tokens, or the nterms, or the tokens that have and external number
4573 *and* a type-name) was of interest.
de62edee 4574
d69c9694
AD
4575 Now instead of monolithic tables, we define one macro per cell. For
4576 instance "b4_symbol(0, tag)" is a macro name which contents is
4577 self-decriptive. The macro "b4_symbol" provides easier access to
4578 these cells.
de62edee 4579
d69c9694
AD
4580 * src/output.c (type_names_output): Remove.
4581 (symbol_numbers_output, symbol_definitions_output): New.
4582 (muscles_output): Call them.
4583 (prepare_symbols): Define b4_symbols_number.
4584
5263bea9
AD
45852008-11-10 Akim Demaille <demaille@gostai.com>
4586
4587 --trace=muscles
4588 * src/getargs.h, src/getargs.c (trace_muscle): New.
4589 (trace_types, trace_args): Support it.
4590 * src/output.c (output_skeleton): Use it.
4591
4175f6bb
AD
45922008-11-10 Akim Demaille <demaille@gostai.com>
4593
4594 muscles_output.
4595 * src/output.c (muscles_output): New, extracted from...
4596 (output_skeleton): here.
4597 Adjust.
4598
1de69d6a
AD
45992008-11-10 Akim Demaille <demaille@gostai.com>
4600
4601 Formatting changes.
4602
36db78a7
AD
46032008-11-10 Akim Demaille <demaille@gostai.com>
4604
4605 Update the variant example.
4606 * examples/variant.yy: Formatting changes.
4607 One stage build.
4608
e5eb92e7
AD
46092008-11-10 Akim Demaille <demaille@gostai.com>
4610
4611 Support constructor with an argument.
4612 This improves the "list" bench by 2%.
de62edee 4613
e5eb92e7
AD
4614 * data/lalr1.cc (variant::build): Add an overloaded version with
4615 an argument.
4616 * tests/c++.at (AT_CHECK_VARIANT): Check it.
4617
76307410
AD
46182008-11-10 Akim Demaille <demaille@gostai.com>
4619
4620 Test variants.
4621 * tests/c++.at (AT_CHECK_VARIANTS): New.
4622 Use it with and without %define assert.
4623
d78f0ac9
AD
46242008-11-10 Akim Demaille <demaille@gostai.com>
4625
4626 Add %precedence support.
4627 Unfortunately it is not possible to reuse the %prec directive. This
4628 is because to please POSIX, we do not require to end the rules with a
4629 semicolon. As a result,
de62edee 4630
d78f0ac9 4631 foo: bar %prec baz
de62edee 4632
d78f0ac9
AD
4633 is ambiguous: either a rule which precedence is that of baz, or a rule,
4634 and then a declaration of the precedence of the token baz.
de62edee 4635
d78f0ac9
AD
4636 * doc/bison.texinfo: Document %precedence.
4637 (Precedence Only): New.
4638 * src/assoc.h, src/assoc.c (precedence_assoc): New.
4639 * src/conflicts.c (resolve_sr_conflict): Support it.
4640 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
4641 Parse it.
4642 * tests/calc.at: Use %precedence for NEG.
4643 * tests/conflicts.at (%precedence does not suffice)
4644 (%precedence suffices): New tests.
4645
c85be41a
AD
46462008-11-09 Akim Demaille <demaille@gostai.com>
4647
4648 Make benches in a sub dirs.
4649 * etc/bench.pl.in ($dir): New.
4650 Use it.
4651 Check the use of constructors with an argument.
4652 (bench_variant_parser): Fix.
4653
db65ca1f
AD
46542008-11-09 Akim Demaille <demaille@gostai.com>
4655
4656 fix eof condition
4657
9b0efa5b
AD
46582008-11-09 Akim Demaille <demaille@gostai.com>
4659
4660 Fix --help.
4661
432ac57a
AD
46622008-11-09 Akim Demaille <demaille@gostai.com>
4663
4664 Require the generation of parse-gram.output.
4665 * src/Makefile.am (YACC): Pass --report=all.
4666
deef2a0a
AD
46672008-11-09 Akim Demaille <demaille@gostai.com>
4668
4669 Formatting changes.
4670
df72984a
AD
46712008-11-09 Akim Demaille <demaille@gostai.com>
4672
4673 Update TODO.
4674 * TODO: Remove obsolete items.
4675 Update others.
4676
f10e19fd
AD
46772008-11-09 Akim Demaille <demaille@gostai.com>
4678
4679 Enhance bench.pl.
4680 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
4681 (@token, $grammar, $bench): New.
4682 (generate_grammar_variant): Rename as...
4683 (generate_grammar_list): this.
4684 (generate_grammar): Adjust.
4685 (bench_grammar): Rename as...
4686 (bench): this.
4687 Use it in the various bench-marking routines.
4688 (-b, -g): New options.
4689
5de9c593
AD
46902008-11-09 Akim Demaille <demaille@gostai.com>
4691
4692 Use a static hierarchy for symbols in the C++ parser.
4693 * data/lalr1.cc (symbol_base_type, symbol_type)
4694 (stack_symbol_type): Make it a static hierarchy.
4695 Adjust dependencies.
4696
757f8f98
AD
46972008-11-09 Akim Demaille <demaille@gostai.com>
4698
4699 bench.pl -d, --directive.
4700 * etc/bench.pl.in (@directive): New.
4701 (&bench_grammar): Use it.
4702 (&bench_list_grammar): New, to provide access to the "variant"
4703 grammar.
4704 Use it.
4705 (getopts): Support -d, --directive.
4706
d3be4f6d
AD
47072008-11-09 Akim Demaille <demaille@gostai.com>
4708
4709 Use inline for small operations.
4710 * data/lalr1.cc (symbol_base_type, symbol_type)
4711 (stack_symbol_type): Declare constructor and other operations as
4712 inline.
4713 (yy_destroy_): Inline.
4714
1f7d007b
AD
47152008-11-09 Akim Demaille <demaille@gostai.com>
4716
4717 Introduce a hierarchy for symbols.
4718 * data/lalr1.cc (symbol_base_type, symbol_type): New.
4719 (data_type): Rename as...
4720 (stack_symbol_type): this.
4721 Derive from symbol_base_type.
4722 (yy_symbol_value_print_): Merge into...
4723 (yy_symbol_print_): this.
4724 Rename as...
4725 (yy_print_): this.
4726 (yydestruct_): Rename as...
4727 (yy_destroy_): this.
4728 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
4729 (parser::parse): yyla is now of symbol_type.
4730 Use its type member instead of yytoken.
4731
bc0b0477
AD
47322008-11-09 Akim Demaille <demaille@gostai.com>
4733
4734 Rename data_type and stack_symbol_type.
4735 * data/lalr1.cc (data_type): Rename as...
4736 (stack_symbol_type): this.
4737
57295d14
AD
47382008-11-09 Akim Demaille <demaille@gostai.com>
4739
4740 Handle semantic value and location together.
4741 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
4742 yydata.value and yydata.location.
4743 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
4744 (YY_SYMBOL_PRINT): Now take semantic value and location as a
4745 single arg.
4746 Adjust all callers.
4747 (yydestruct_): New overload for a stack symbol.
4748
e9b0834e
AD
47492008-11-09 Akim Demaille <demaille@gostai.com>
4750
4751 Push a complete symbol, not connected parts.
4752 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
4753 state, value and location.
4754 Adjust callers.
4755
6082531a
AD
47562008-11-09 Akim Demaille <demaille@gostai.com>
4757
4758 Agregate yylval and yylloc.
4759 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
4760 (parser::yyla): this.
4761
33c195cc
AD
47622008-11-09 Akim Demaille <demaille@gostai.com>
4763
4764 Rely on the state stack to display reduction traces.
b06df3c2
AD
4765 To display rhs symbols before a reduction, we used information
4766 about the rule reduced, which required the tables yyrhs and
4767 yyprhs. Now use rely only on the state stack to get the same
4768 information.
de62edee 4769
33c195cc
AD
4770 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
4771 Use them.
4772 (parser::yyrhs_, parser::yyprhs_): Remove.
4773 (parser::yy_reduce_print_): Use the state stack.
4774
e1f93869
AD
47752008-11-09 Akim Demaille <demaille@gostai.com>
4776
4777 Fuse yyval and yyloc into yylhs.
4778 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
4779 yylhs.
4780 (parse): Replace yyval and yyloc with yylhs.value and
4781 yylhs.location.
4782 After a user action, compute yylhs.state earlier.
4783 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
4784 fresh error_token.
4785
2935744b
DJ
47862008-11-09 Di-an Jan <dianj@freeshell.org>
4787
4788 Remove unused variable.
4789 * src/output.c (type_names_output): Remove unused variable sep.
4790
bbf9ca37
PB
47912008-11-09 Paolo Bonzini <bonzini@gnu.org>
4792
4793 Change tests/output.at quoting.
4794 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
4795 expanding arguments.
4796
d9a9b96b
JD
47972008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
4798
4799 Don't add a semicolon to actions for %skeleton or %language.
4800 It breaks Java test cases as reported by Akim Demaille.
4801 * src/scan-code.l: Implement.
4802
51365192
JD
48032008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
4804
4805 Clean up %skeleton and %language priority implementation.
4806 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
4807 remove static qualifier because others will soon need to see it.
4808 (language_prio): Likewise.
4809 (getargs): Use command_line_prio rather than 0.
4810 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
4811 enum fields.
4812 (skeleton_prio): Extern it.
4813 (language_prio): Extern it.
4814 * src/parse-gram.y: Use grammar_prio rather than 1.
4815
9380cfd0
AD
48162008-11-07 Akim Demaille <demaille@gostai.com>
4817
4818 Moving push traces into yypush_.
4819 * data/lalr1.cc (yypush_): Now takes a optional trace message.
4820 Adjust all uses.
4821
8901f32e
AD
48222008-11-07 Akim Demaille <demaille@gostai.com>
4823
4824 The single-stack C++ parser is now the standard one.
4825 * data/lalr1.cc: Rename as...
4826 * data/lalr1-split.cc: this.
4827 * data/lalr1-fusion.cc: Rename as...
4828 * data/lalr1.cc: this.
4829 * etc/bench.pl.in: Adjust.
4830
8cdabf02
AD
48312008-11-07 Akim Demaille <demaille@gostai.com>
4832
4833 Avoid empty-if warnings.
4834 Reported by Quentin Hocquet.
de62edee 4835
8cdabf02
AD
4836 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
4837 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
4838
5a893c2b
AD
48392008-11-07 Akim Demaille <demaille@gostai.com>
4840
4841 Pass command line location to skeleton_arg and language_argmatch.
4842 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
4843 The location argument is now mandatory.
4844 Adjust all dependencies.
4845 (getargs): Use command_line_location.
4846
58697c6d
AD
48472008-11-07 Akim Demaille <demaille@gostai.com>
4848
4849 -D, --define.
4850 * src/getargs.c (usage): Document -D.
4851 Fix help string for --locations.
4852 (command_line_location): New.
4853 (short_options, long_options, getargs): Support -D, --define.
4854 (getargs): Move -d support at the right place.
4855 * doc/bison.texinfo (Bison Options): Update.
4856 * tests/input.at (%define, --define): New.
4857
9fe5a457
AD
48582008-11-07 Akim Demaille <demaille@gostai.com>
4859
4860 Initialize the muscle table before parsing the command line.
4861 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
4862 (getargs): Define file_name.
4863 * src/main.c (main): Initialize muscle_tab before calling
4864 getargs.
4865 * src/muscle_tab.c (muscle_init): No longer define file_name, as
4866 its value is not available yet.
4867
56c5eca9
AD
48682008-11-07 Akim Demaille <demaille@gostai.com>
4869
4870 Locations without columns for command line arguments.
4871 * src/location.c (location_print): Don't display negative columns.
4872 * src/location.h: Document this.
4873
9b9e0a7d
AD
48742008-11-07 Akim Demaille <demaille@gostai.com>
4875
4876 Fix --help.
4877 * src/getargs.c (usage): Fix help string for -W.
4878
74eae918
AD
48792008-11-07 Akim Demaille <demaille@gostai.com>
4880
4881 Handle more general types of option arguments.
4882 * build-aux/cross-options.pl: The argument ends at the first
4883 space, not the first non-symbol character.
4884 Use @var for each word appearing the argument description.
4885
a3d4c6fb
AD
48862008-11-07 Akim Demaille <demaille@gostai.com>
4887
4888 Destroy the variants that remain on the stack in case of error.
4889 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
4890 destructor.
4891 Display the value only if yymsg is nonnull.
4892 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
4893
2d32fc9f
AD
48942008-11-07 Akim Demaille <demaille@gostai.com>
4895
4896 Add "%define assert" to variants.
4897 This is used to help the user catch cases where some value gets
4898 ovewritten by a new one. This should not happen, as this will
4899 probably leak.
de62edee 4900
2d32fc9f
AD
4901 Unfortunately this uncovered a bug in the C++ parser itself: the
4902 lookahead value was not destroyed between two calls to yylex. For
4903 instance if the previous lookahead was a std::string, and then an int,
4904 then the value of the std::string was correctly taken (i.e., the
4905 lookahead was now an empty string), but std::string structure itself
4906 was not reclaimed.
de62edee 4907
2d32fc9f
AD
4908 This is now done in variant::build(other&) (which is used to take the
4909 value of the lookahead): other is not only stolen from its value, it
4910 is also destroyed. This incurs a new performance penalty of a few
4911 percent, and union becomes faster again.
de62edee 4912
2d32fc9f
AD
4913 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
4914 (b4_variant_if): New.
4915 (variant::built): New.
4916 Use it whereever the status of the variant changes.
4917 * etc/bench.pl.in: Check the penalty of %define assert.
4918
f6038cb8
AD
49192008-11-07 Akim Demaille <demaille@gostai.com>
4920
4921 Use "%define variant" in bench.pl.
4922 * etc/bench.pl.in: No longer use the pseudo directive %variants,
4923 just use %define variants.
4924
ccde1f98
AD
49252008-11-07 Akim Demaille <demaille@gostai.com>
4926
4927 Regen.
4928 * src/parse-gram.h, src/parse-gram.c: Regen.
4929
58bd33b7
JD
49302008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
4931
4932 Fix user actions without a trailing semicolon.
4933 Reported by Sergei Steshenko at
4934 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
4935 * THANKS (Sergei Steshenko): Add.
4936 * src/scan-code.l (SC_RULE_ACTION): Fix it.
4937 * tests/regression.at (Fix user actions without a trailing semicolon):
4938 New test case.
4939
639867b5
AD
49402008-11-04 Akim Demaille <demaille@gostai.com>
4941
4942 Use b4_copyright_years.
4943 * data/yacc.c (b4_copyright_years): New.
4944 Fix its value according to the comments in the file.
4945 Use it and undefine it.
4946
3c262606
AD
49472008-11-04 Akim Demaille <demaille@gostai.com>
4948
4949 Formatting changes.
4950 * data/lalr1-fusion.cc, src/parse-gram.y: here.
4951
a2b93d52
AD
49522008-11-04 Akim Demaille <demaille@gostai.com>
4953
4954 Formatting changes.
4955 * data/lalr1-fusion.cc: here.
4956
3a2803df
AD
49572008-11-04 Akim Demaille <demaille@gostai.com>
4958
4959 Use strict on bench.pl.
4960 * etc/bench.pl.in (&run, &generate_grammar): New.
4961 Rename the grammar generating functions for consistency.
4962 Change the interface so that the list of benches to run is passed
4963 as (optionless) arguments.
4964 (&compile): Use &run.
4965
a0d4650a
AD
49662008-11-04 Akim Demaille <demaille@gostai.com>
4967
4968 Remove spurious initial empty lines.
4969 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
4970 * data/yacc.c: End the @output lines with an @.
4971
cac9e09b
AD
49722008-11-04 Akim Demaille <demaille@gostai.com>
4973
4974 Improve the display of sizes.
4975 * etc/bench.p.in: Higher precision.
4976 Sort by decreasing size.
4977
4af4348a
AD
49782008-11-04 Akim Demaille <demaille@gostai.com>
4979
4980 Don't memcpy C++ structures.
4981 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
4982 arguments.
4983 (variant::build): New overload for
4984 copy-construction-that-destroys.
4985 (variant::swap): New.
4986 (parser::yypush_): Use it in variant mode.
4987
ef05c4d6
AD
49882008-11-04 Akim Demaille <demaille@gostai.com>
4989
4990 Better defaults for bench.pl.
4991 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
4992 default values.
4993 Adjust &verbose uses.
4994 (-q, --quiet): New.
4995
9718cfa9
AD
49962008-11-04 Akim Demaille <demaille@gostai.com>
4997
4998 Make variant.yy more complex.
4999 std::list cannot be copied via memcpy, they are more demanding than
5000 std::string. Use one std::list to strengthen the test.
de62edee 5001
9718cfa9
AD
5002 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
5003 Adjust.
5004 Create a list of strings, instead of a single large string.
5005
a6df593d
AD
50062008-11-04 Akim Demaille <demaille@gostai.com>
5007
5008 bench.pl --bench.
5009 * etc/bench.pl.in (--bench, $bench): New.
5010
006a0303
AD
50112008-11-04 Akim Demaille <demaille@gostai.com>
5012
5013 Sort methods.
5014 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
5015 Define it after as().
5016
faef3466
AD
50172008-11-04 Akim Demaille <demaille@gostai.com>
5018
5019 Useless parens.
5020 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
5021
2141aded
AD
50222008-11-04 Akim Demaille <demaille@gostai.com>
5023
5024 Issue missing synclines after user actions.
5025 * data/c.m4 (b4_case): Issue synclines on the output file.
5026
e426d17b
AD
50272008-11-04 Akim Demaille <demaille@gostai.com>
5028
5029 Remove trailing empty line.
5030 * data/lalr1-fusion.cc: Don't add an empty line after the user's
5031 epilogue.
5032
a9ce3f54
AD
50332008-11-04 Akim Demaille <demaille@gostai.com>
5034
5035 Fix output of copyright years.
5036 * data/bison.m4 (b4_copyright): Fix the indentation of the
5037 copyright year paragraph.
5038 Use b4_copyright_years when no years are given.
5039 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
5040 (b4_copyright_years): New.
5041 Use it.
5042
59c544c2
AD
50432008-11-04 Akim Demaille <demaille@gostai.com>
5044
5045 Avoid the spurious initial empty line.
5046 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
5047 the end of @output request to suppress the empty line that
5048 results.
5049
96b15448
AD
50502008-11-04 Akim Demaille <demaille@gostai.com>
5051
5052 Remove parser::rhs_number_type.
5053 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
5054 (yyrhs_): Use b4_table_define.
5055
f0633174
AD
50562008-11-04 Akim Demaille <demaille@gostai.com>
5057
5058 Fix iteration type.
5059 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
5060
417b8004
AD
50612008-11-04 Akim Demaille <demaille@gostai.com>
5062
5063 Factor the declaration of the integer tables.
5064 * data/lalr1-fusion.cc (b4_table_define): New.
5065 Use it.
5066
1a5246c6
AD
50672008-11-03 Akim Demaille <demaille@gostai.com>
5068
5069 Fix indentation of tables in lalr1.cc
5070 * data/lalr1-fusion.cc: Fix the indentation.
5071
f8a95c9c
AD
50722008-11-03 Akim Demaille <demaille@gostai.com>
5073
5074 Destroy the lhs symbols after reduction.
5075 * data/lalr1-fusion.cc (parse): After the user action, when in
5076 variant mode, destroy the lhs symbols.
5077
d7f4d823
AD
50782008-11-03 Akim Demaille <demaille@gostai.com>
5079
5080 Simplify yysyntax_error_ use.
5081 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
5082 type, but make it unnamed in the declaration when it is not used.
5083
8b9c89fb
AD
50842008-11-03 Akim Demaille <demaille@gostai.com>
5085
5086 Let yy::variant::build return an lvalue.
5087 * data/lalr1-fusion.cc (variant::build): Return a reference to the
5088 object.
5089
83243c24
AD
50902008-11-03 Akim Demaille <demaille@gostai.com>
5091
5092 Define yy::variant only when needed.
5093 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
5094 used.
5095
429b4848
AD
50962008-11-03 Akim Demaille <demaille@gostai.com>
5097
5098 Bench the three-stack lalr1.cc.
5099 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
5100 one-stack one.
5101
414c76a4
AD
51022008-11-03 Akim Demaille <demaille@gostai.com>
5103
5104 Fail on parse error in calc++.
5105 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
5106 status.
5107 * examples/calc++/test ($me, $number, $exit, run): New.
5108 Use them to propagate errors to the exit status.
5109
8a5783fd
AD
51102008-11-03 Akim Demaille <demaille@gostai.com>
5111
5112 Don't specify the skeleton twice in the example.
5113 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
5114 file does what is needed.
5115
0cc5bead
AD
51162008-11-03 Akim Demaille <demaille@gostai.com>
5117
5118 bench: Improve output.
5119 * etc/bench.pl.in (bench_grammar): Tune the printf format.
5120
5b421a4e
AD
51212008-11-03 Akim Demaille <demaille@gostai.com>
5122
5123 bench: check impact of %debug on variants.
5124 * etc/bench.pl.in (variant_grammar): Fix the computation of
5125 $variant.
5126 Generate a grammar file that can work with or without %debug.
5127 Do use the @directive.
5128 (bench_variant_parser): Check impact of %debug.
5129 (@directives): Rename all the occurrences to...
5130 (@directive): this, for consistency.
5131
d11ee647
AD
51322008-11-03 Akim Demaille <demaille@gostai.com>
5133
5134 bench: report the size too.
5135 * etc/bench.pl.in ($iterations): Defaults to -3.
5136 (&bench_grammar): Require hireswallclock.
5137 Compute and display the size of the result.
5138 More comments.
5139
e1b74b92
AD
51402008-11-03 Akim Demaille <demaille@gostai.com>
5141
5142 bench: More use of the verbosity level.
5143 * etc/bench.pl.in ($verbose, &verbose): New.
5144 Use them.
5145 More POD documentation.
5146
7e5f9c54
AD
51472008-11-03 Akim Demaille <demaille@gostai.com>
5148
5149 bench.pl: a command line interface
5150 * etc/bench.pl.in: More doc.
5151 Some fixes in the documentation.
5152 ($cflags, $iterations, &help, &getopt): New.
5153 Use them.
5154 (&variant_grammar): Let the number of stages be 10 times what is
5155 specified.
5156
7109a18d
AD
51572008-11-03 Akim Demaille <demaille@gostai.com>
5158
5159 Bench the use of Boost.Variants.
5160 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
5161 New.
5162 (&compile): Be ready to compile C++ parsers.
5163 (&bench_push_parser): Move debug information to the outermost
5164 level.
5165 * THANKS: Add Michiel De Wilde.
5166
922730fe
AD
51672008-11-03 Akim Demaille <demaille@gostai.com>
5168
5169 bench.pl: Pass directives as a list instead of as a string.
5170 * etc/bench.pl.in (&directives): New.
5171 (&triangular_grammar, &calc_grammar): Use it to format the Bison
5172 directives.
5173 (&triangular_grammar): Do use the directives (were ignored).
5174 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
5175 directives.
5176
7484f1d4
AD
51772008-11-03 Akim Demaille <demaille@gostai.com>
5178
5179 Improve genericity of bench.pl.
5180 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
5181 argument.
5182 (&bench_push_parser): New.
5183 Call it.
5184
15129f25
AD
51852008-11-03 Akim Demaille <demaille@gostai.com>
5186
5187 Add documentation to bench.pl.
5188 * etc/bench.pl.in: Comment changes.
5189
0e0ed236
AD
51902008-11-03 Akim Demaille <demaille@gostai.com>
5191
5192 Fuse the three stacks into a single one.
de62edee 5193
b06df3c2
AD
5194 In order to make it easy to perform benchmarks to ensure that
5195 there are no performance loss, lalr1.cc is forked into
5196 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
5197 lalr1.cc.
5198
5199 Meanwhile, to make sure that lalr1-fusion.cc is correctly
5200 exercized by the test suite, the user must install a symbolic link
5201 from lalr1.cc to it.
de62edee 5202
b06df3c2
AD
5203 Instead of having three stacks (state, value, location), use a
5204 stack of triples. This considerably simplifies the code (and it
5205 will be easier not to require locations as currently does the C++
5206 parser), and also gives a 10% speedup according to
5207 etc/bench (probably mainly since memory allocation is done once
5208 instead of three times).
de62edee 5209
0e0ed236
AD
5210 Another motivation is to make it easier to destruct properly
5211 semantic values: now that they are bound to their state (hence
5212 symbol type) it will be easier to call the appropriate destructor.
de62edee 5213
0e0ed236 5214 These changes should probably benefit the C parser too.
de62edee 5215
b06df3c2
AD
5216 * data/lalr1.cc: Copy as...
5217 * data/lalr1-fusion.cc: this new file.
0e0ed236
AD
5218 (b4_rhs_value, b4_rhs_location): New definitions overriding those
5219 from c++.m4.
5220 (state_stack_type, semantic_stack_type, location_stack_type)
5221 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
5222 (data_type, stack_type, yystack_): New.
5223 (YYLLOC_DEFAULT, yypush_): Adjust.
5224 (yyerror_range): Now based on data_type, not location_type.
5225
7dedf26e
AD
52262008-11-03 Akim Demaille <demaille@gostai.com>
5227
5228 Push the state, value, and location at the same time.
5229 This is needed to prepare a forthcoming patch that fuses the three
5230 stacks into one.
de62edee 5231
7dedf26e
AD
5232 * data/lalr1.cc (parser::yypush_): New.
5233 (parser::yynewstate): Change the semantics: instead of arriving to
5234 this label when value and location have been pushed, but yystate
5235 is to be pushed on the state stack, now the three of them must
5236 have been pushed before. yystate still must be the new state.
5237 This allows to use yypush_ everywhere instead of individual
5238 handling of the stacks.
5239
c4585f1e
AD
52402008-11-03 Akim Demaille <demaille@gostai.com>
5241
5242 Prefer references to pointers.
5243 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
5244 definition to use references instead of pointers.
5245 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
5246 Take the value and location as references.
5247 Adjust callers.
5248
56017c17
AD
52492008-11-03 Akim Demaille <demaille@gostai.com>
5250
5251 stack::size instead of stack::height.
5252 * data/lalr1.cc (stack::height): Rename as...
5253 (stack::size): this.
5254 Fix the output type.
5255 Comment changes.
5256
5ab8c47b
AD
52572008-11-03 Akim Demaille <demaille@gostai.com>
5258
5259 Use variants to support objects as semantic values.
b06df3c2
AD
5260 This patch was inspired by work by Michiel De Wilde. But he used
5261 Boost variants which (i) requires Boost on the user side, (ii) is
5262 slow, and (iii) has useless overhead (the parser knows the type of
5263 the semantic value there is no reason to duplicate this
5264 information as Boost.Variants do).
5265
5266 This implementation reserves a buffer large enough to store the
5267 largest objects. yy::variant implements this buffer. It was
5268 implemented with Quentin Hocquet.
de62edee 5269
5ab8c47b
AD
5270 * src/output.c (type_names_output): New.
5271 (output_skeleton): Invoke it.
5272 * data/c++.m4 (b4_variant_if): New.
5273 (b4_symbol_value): If needed, provide a definition for variants.
5274 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
5275 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
5276 (b4_char_sizeof, yy::variant): New.
5277 (parser::parse): If variants are requested, define
5278 parser::union_type, parser::variant, change the definition of
5279 semantic_type, construct $$ before running the user action instead
5280 of performing a default $$ = $1.
5281 * examples/variant.yy: New.
5282 Based on an example by Michiel De Wilde.
5283
1fa5d8bb
AD
52842008-11-03 Akim Demaille <demaille@gostai.com>
5285
5286 Parameterize the extraction of semantic values.
5287 To make future changes easier, no longer rely on ".TYPE" being the
5288 way to get a semantic value.
de62edee 5289
1fa5d8bb
AD
5290 * data/c.m4 (b4_symbol_value): New.
5291 Use it.
5292 * data/c++.m4, data/yacc.c: Use it.
5293 * data/glr.c: Use b4_symbol_value.
5294 (b4_rhs_data): New.
5295 Use it.
5296
91ba8a55
AD
52972008-11-03 Akim Demaille <demaille@gostai.com>
5298
5299 Prepare easier M4 changes.
5300 * data/lalr1.cc: Use escaped [] instead of literals to prepare
5301 future changes.
5302
c9ba9e59
JD
53032008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
5304
5305 Initiate further development.
5306 * NEWS: Create an empty section for new entries.
5307 * gnulib: Update submodule to HEAD.
5308
bfb40910
JD
53092008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
5310
5311 * NEWS: Version 2.4.
5312
241fda7a
JD
53132008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
5314
5315 Prepare for next release.
5316 * NEWS: Briefly mention changes since 2.3b.
5317 * README: Say GNU m4 1.4.6, which we've been requiring in release
5318 announcements already, not 1.4.3, which breaks the build.
5319
ed4d67dc
JD
53202008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
5321
5322 Say %language is experimental.
5323 We're thinking of extending it's effect on output file naming. See the
5324 thread at
5325 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
5326 * NEWS: Say it's experimental.
5327 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
5328 recommend it over %skeleton for now.
5329 (Bison Options): Likewise.
5330 (C++ Bison Interface): Use %skeleton not %language.
5331 (Calc++ Parser): Use %skeleton not %language.
5332 * src/getargs.c (usage): Say it's experimental.
5333
e254a580
DJ
53342008-11-01 Di-an Jan <dianj@freeshell.org>
5335 Paolo Bonzini <bonzini@gnu.org>
5336
5337 Support all Java parser class modifiers.
5338 * data/java.m4 (b4_percent_define_get3): New.
5339 (b4_final_if, b4_strictfp_if): New.
5340 * data/lalr1.java (final, strictfp, extends, implements): Support.
5341 * doc/bison.texinfo (final, strictfp, extends, implements): Add
5342 documentation.
5343 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
5344 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
5345 (AT_CHECK_JAVA_GREP): New.
5346 (Java parser class modifiers): New test.
5347 (Java parser class extends and implements): New test.
5348
5349 Model exception propagation better with throws and lex_throws.
5350 * data/java.m4 (b4_list2): New.
5351 (throws): Change default.
5352 * data/lalr1.java (yyaction): Add throws.
5353 (parse): Add lex_throws in addition to throws.
5354 * doc/bison.texinfo (throws, lex_throws): Add documentation.
5355 * tests/java.at (Java throws specifications): New test.
5356
5357 Improve documentation for Java parsers.
5358 * doc/bison.texinfo (Java Parsers): Add subsections.
5359 Don't quote first argument of %define.
5360 (Java Bison Interface): Document output files. Move documentation
5361 of parser class and merge into Java Parser Interface. Document
5362 features that error out. Document directives with no effect.
5363 Move note about Javadoc higher.
5364 (Java Semantic Values): Explicitly mention stype.
5365 Document that generic types cannot be used.
5366 (Java Location Values): Use @deftypeivar. Document constructors.
5367 Correct return value for toString.
5368 (Java Parser Interface): List undocumented constants/fields.
5369 Move documentation of fields added by %parse-param closer to list
5370 of members. Document that token names are added as fields.
5371 Document constructors accurately. Remove error method.
5372 (Java Scanner Interface): Move note on %pure-parser to Java Bison
5373 Interface. Describe %code lexer and yylex accutately.
5374 Remove documentation that does not match the code.
5375 (Java Action Features): New.
5376 (Java Differences): Add reference. Add item on semantic values.
5377 Add note about @{ ... @}. Clarify %% epilogue placement.
5378 (Java Declarations Summary): New.
5379
5380 Fix Java skeleton.
5381 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
5382 (b4_remove_comma): Quote test argument.
5383 (b4_identification): Remove "bison" field.
5384 * tests/java.at (Java parser class and package names): New test.
5385 (Java %parse-param and %lex-param): New test.
5386 (Java stype, position_class and location_class): New test.
5387
f259e4e6
PB
53882008-10-31 Di-an Jan <dianj@freeshell.org>
5389
5390 * data/lalr1.jave: Update copyright years.
5391 (YYParser): Correct name of "generated from" file in Javadoc:
5392 use b4_file_name instead of @ofile@.
5393 (Location constructor): Correct Javadoc parameter name.
5394 (yylloc): Add missing opening m4 quote after b4_location_if.
5395 This removes a stray [ in the Javadoc of Lexer.getStartPos.
5396 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
5397 (YYParser constructor): Correct Javadoc parameter name.
5398
cae5057f
JD
53992008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
5400
5401 Always put auxiliary code files in the same dir as other output files.
5402 * src/files.c (compute_file_name_parts): When the user specifies
5403 --output but not --file-prefix, extract the directory prefix from the
5404 file prefix not from the grammar file name. This affects the location
5405 of files like location.hh generated by the C++ skeleton. The includes
5406 in the other output files require this fix.
5407 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
5408 for expected output files.
5409 (Output files): Add a test for the above.
5410
4af432ba
JD
54112008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
5412
5413 * gnulib: Update submodule to HEAD.
5414
e26d4e43
JD
54152008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
5416
5417 Update copyright year.
5418 * src/files.c: Here.
5419
c0ee9e21
DJ
54202008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
5421
5422 Don't overwrite the input file.
5423 * src/files.c (output_file_name_check): Fatal error if using input file
5424 for output.
5425 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
5426 argument.
5427 (Conflicting output files): Add test.
5428
482dc52f
AD
54292008-10-28 Akim Demaille <demaille@gostai.com>
5430
5431 Space changes.
5432 * data/lalr1.cc: Formatting changes.
5433
52cbbe84
AD
54342008-10-28 Akim Demaille <demaille@gostai.com>
5435
5436 Don't define debugging functions when !YYDEBUG.
5437 * data/lalr1.cc (debug_stream, set_debug_stream)
5438 (debug_level_type, debug_level, set_debug_level): Don't
5439 declare them when YYDEBUG is not defined.
5440 The implementation are already YYDEBUG-aware.
5441
0925d5bf
AD
54422008-10-28 Akim Demaille <demaille@gostai.com>
5443
5444 Prefer "continue" for empty loop bodies.
5445 * etc/bench.pl.in: Use "continue" instead of {}.
5446
cf98343c
AD
54472008-10-28 Akim Demaille <demaille@gostai.com>
5448
5449 Space and comments changes.
5450 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
5451 * data/c.m4, data/lalr1.cc: Space changes.
5452
9f467b7d
AD
54532008-10-28 Akim Demaille <demaille@gostai.com>
5454
5455 Make gnulib a submodule.
5456 * gnulib: New.
5457 * .gitmodules (gnulib): New.
5458
0f0e1ace
JD
54592008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
5460
5461 Fix yyerror_range for user-defined location type in C++. Reported by
5462 Georg Sauthoff at
5463 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
5464 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
5465 * THANKS (Georg Sauthoff): Add.
5466
548e2104
JD
54672008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
5468
5469 Update several administrative files mainly to facilitate releasing.
5470 * HACKING (Administrivia): Make the git-merge-changelog notes more
5471 helpful.
5472 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
5473 (Release Procedure): Update for git and add numerous details that were
5474 previously missing.
5475 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
5476 * maint.mk (announcement): Don't list bison as a bootstrap tool so
5477 that announcements don't claim we bootstrapped with whatever bison
5478 happened to be in PATH. Add flex as a bootstrap tool.
5479 * Makefile.maint: Remove, previously replaced by maint.mk.
5480 * Makefile.cfg: Remove, and migrate settings to...
5481 * cfg.mk: ... here for the sake of `make announcement'.
5482 * bootstrap.conf (gnulib_modules): Add announce-gen.
5483 * README: Say GNU Bison instead of just Bison. Suggested by Karl
5484 Berry.
5485
ddf17a6e
PB
54862008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
5487
5488 Small but important bugfixes for the Java skeleton.
5489 * data/lalr1.java (yyerror): Change Location to b4_location_type.
5490 (yy_symbol_print): Call toString on yyvaluep.
5491
e1145ad8
AD
54922008-08-29 Akim Demaille <demaille@gostai.com>
5493
5494 Clarify UPDATED use.
215b40ac 5495 * doc/bison.texinfo: It refers to the last edition of this file,
e1145ad8 5496 not to the release date of Bison.
215b40ac 5497 Reported by Joel E. Denny.
e1145ad8 5498
0df72d78
AD
54992008-08-29 Akim Demaille <demaille@gostai.com>
5500
5501 * README: Update FAQ pointer.
5502 Reported by Joel E. Denny.
5503
9a90b6bb
EB
55042008-08-27 Eric Blake <ebb9@byu.net>
5505
5506 Resync m4sugar from autoconf.
5507 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
5508 (m4_init): Adjust to latest m4.git changes.
5509 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
5510 effects.
5511 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
5512 (_m4_list_cmp): Reduce side effects.
5513
65015668
AD
55142008-08-27 Akim Demaille <demaille@gostai.com>
5515
5516 Check yyerrok in calc.at.
215b40ac
EB
5517 * tests/calc.at (calc.y): Use yyerrok on "( error )".
5518 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
5519 expected.
65015668 5520
98e26a92
AD
55212008-08-27 Akim Demaille <demaille@gostai.com>
5522
5523 Support yyerrok in lalr1.cc.
5524 YYBACKUP is still to import back into lalr1.cc.
215b40ac 5525 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
98e26a92 5526
86c0e784
JD
55272008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
5528
5529 For maintainer-check*, don't recompile for a $(VERSION) update.
5530 * cfg.mk: New file.
5531 (_is-dist-target): Override the one in GNUmakefile.
5532 * Makefile.am (EXTRA_DIST): Add cfg.mk.
5533
88511166
JD
55342008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
5535
5536 Update for recent change to gnulib.
5537 * src/parse-gram.y: Don't include strverscmp.h. It comes from
5538 string.h now.
5539
6bbb2ed5
EB
55402008-08-15 Eric Blake <ebb9@byu.net>
5541
d67c52e8
EB
5542 Remaining m4sugar merge from autoconf.
5543 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
5544 * data/m4sugar/foreach.m4: New file, copied from autoconf.
5545 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
5546 * src/output.c (output_skeleton): Tell m4 how to find it.
5547
6bbb2ed5
EB
5548 Partial m4sugar merge from autoconf: m4_map.
5549 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
5550 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
5551 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
5552 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
5553 for empty list.
5554 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
5555 Likewise.
5556 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
5557 declares it.
5558
8dce3875
JD
55592008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
5560
5561 Keep .version and PACKAGE_VERSION in sync.
5562 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
5563 dependency, and add comments justifying this in more detail. Discussed
5564 starting at
5565 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
5566
882a1fbf
EB
55672008-08-06 Eric Blake <ebb9@byu.net>
5568
a3764451
EB
5569 Partial m4sugar merge from autoconf: m4_shiftn.
5570 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
5571 (m4_shift2, m4_shift3): New macros.
5572 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
5573 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
5574 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
5575 * data/java.m4 (b4_remove_comma): Likewise.
5576
882a1fbf
EB
5577 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
5578 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
5579 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
5580 (m4_init): Consolidate wrapped text into single m4_wrap.
5581 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
5582 in wrapped text.
5583
a30e920d
EB
55842008-08-05 Eric Blake <ebb9@byu.net>
5585
dfcc5959
EB
5586 Partial m4sugar merge from autoconf: builtins, version.m4.
5587 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
5588 (m4_prepend): Remove, as it is unused and inherently quadratic,
5589 whereas m4_append is linear in newer m4.
5590 (m4_mkstemp): New builtin.
5591 (m4_symbols): Make rename conditional.
5592 (m4_version_prereq): Ensure fatal error if used in bison, which
5593 intentionally lacks version.m4.
5594
a30e920d
EB
5595 Fix comments in m4sugar.
5596 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
5597
445b7470
JD
55982008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
5599
5600 Update for recent .gitignore fix in Gnulib.
5601 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
5602 anchored .gitignore entries.
5603
a1e50014
JD
56042008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
5605
5606 Set gnu or gnits strictness.
5607 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
5608 development and gnits strictness for releases. Based on Eric Blake's
5609 suggestion at
5610 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
5611
d43f77e7
PB
56122008-07-31 Paolo Bonzini <bonzini@gnu.org>
5613
5614 * NEWS: Clarify documentation of %language.
5615
fee2ed87
PB
56162008-07-31 Paolo Bonzini <bonzini@gnu.org>
5617
5618 Support usage of git-merge-changelog.
5619 * .gitattributes: New.
5620 * HACKING: Document usage of git-merge-changelog.
5621 * bootstrap: Install git-merge-changelog entries in .git/config
5622 if appropriate.
5623
78029cd5
JD
56242008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
5625
5626 Remove remaining dependence on CVS Id keyword.
5627 * ChangeLog: For the sake of people still using CVS, don't use dollars
5628 when mentioning Id.
5629 * data/xslt/bison.xsl: Remove Id from header comments, where it was
5630 unusual anyway.
5631 * data/xslt/xml2dot.xsl: Likewise.
5632 * data/xslt/xml2text.xsl: Likewise.
5633 * data/xslt/xml2xhtml.xsl: Likewise.
5634 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
5635 * doc/Makefile.am (neutralize): Remove, no longer needed.
5636 (.x.1): Don't use neutralize.
5637 (edit): Don't substitute for ID.
5638 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
5639
c53d18b1
JD
56402008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
5641
5642 Fix dependence on computed configure variables.
5643 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
5644 $(top_srcdir)/configure.ac so that changes to computed variables, such
5645 as PACKAGE_VERSION, are seen.
5646 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
5647
5523ac79
JD
56482008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
5649
5650 Update copyright dates for recent changes.
5651 * Makefile.am: Here.
5652 * src/Makefile.am: Here.
5653 * src/reduce.c: Here.
5654 * tests/reduce.at: Here.
5655
8fa36911
JD
56562008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
5657
5658 Use git-version-gen for version names between releases.
5659 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
5660 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
5661 * .prev-version: New.
5662 * .version.in: Remove.
78029cd5 5663 * ChangeLog: Remove the Id previously used for capturing the CVS
8fa36911
JD
5664 revision.
5665 * GNUmakefile: Remove, now copied from Gnulib.
5666 * Makefile.am: Add code suggested by comments in
5667 build-aux/git-version-gen.
5668 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
5669 .prev-version, and .version.
5670 * NEWS (2.3b+): Rename to...
5671 (?.?): ... this because we're dropping the "+" version naming scheme,
5672 but, in general, we still can't be sure of our next release name.
5673 * bootstrap: Add a quick hack to remove from .gitignore the
5674 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
5675 entry. This should really be fixed in gnulib instead.
5676 * bootstrap.conf (gnulib_modules): Add gnumakefile.
5677 * configure.ac (AC_INIT): Set version name by invoking
5678 build-aux/git-version-gen.
5679 (AC_CONFIG_FILES): Remove .version, now generated by
5680 build-aux/git-version-gen.
5681 * maint.mk: New, copied from coreutils.
5682 * doc/.cvsignore (bison.1): Add.
5683 * doc/.gitignore (/bison.1): Add.
5684 * doc/bison.1: Remove, generated.
5685 * src/.cvsignore (revision.c): Remove.
5686 * src/.gitignore (/revision.c): Remove.
5687 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
5688 (BUILT_SOURCES): Remove revision.c.
5689 (revision.c): Remove.
5690 * src/getargs.c (version): Don't print revision after the VERSION.
5691 * src/revision.h: Remove.
5692
bcf07cb7
JD
56932008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
5694
5695 Fix untranslatable composition of sentences. Reported by Goran
5696 Uddeborg at
5697 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
5698 * THANKS (Goran Uddeborg): Add.
5699 * src/reduce.c (reduce_print): Report the number of nonterminals and
5700 rules useless in the grammar in separate sentences.
5701 * tests/reduce.at (Useless Rules): Update output.
5702 (Reduced Automaton): Likewise.
5703 (Underivable Rules): Likewise.
5704 (Empty Language): Likewise.
5705
9aacab9a
JD
57062008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
5707
5708 Fix some .gitignore and .cvsignore problems.
5709 * bootstrap (insert_sorted_if_absent): Replace all uses with...
5710 (insert_vc_ignore): ... this new function, which prepends `/' to all
5711 .gitignore entries before passing them to insert_sorted_if_absent.
5712 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
5713 .cvsignore files are maintained even though Bison developers run
5714 bootstrap while using Git.
5715 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
5716 unneeded by Bison.
5717 (gnulib): Add.
5718 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
5719 unneeded. Reported by Eric Blake.
5720 * lib/.gitignore (/*~): Add.
5721 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
5722 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
5723 Blake.
5724 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
5725
a9fc7990
JD
57262008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
5727
5728 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
5729 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
5730 * bootstrap.conf (gnulib_modules): Add unsetenv.
5731 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
5732 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
5733 (/setenv.m4): Add.
5734 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
5735 the first argument because it may become position-dependent, and unset
5736 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
5737 Add comments explaining these issues in more detail.
5738
0f1d6f10
JD
57392008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
5740
5741 Add .gitignore everywhere based on .cvsignore.
5742 * .gitignore: New.
5743 * build-aux/.gitignore: New.
5744 * data/.gitignore: New.
5745 * doc/.gitignore: New.
5746 * etc/.gitignore: New.
5747 * examples/.gitignore: New.
5748 * examples/calc++/.gitignore: New.
5749 * lib/.gitignore: New.
5750 * m4/.gitignore: New.
5751 * po/.gitignore: New.
5752 * runtime-po/.gitignore: New.
5753 * src/.gitignore: New.
5754 * tests/.gitignore: New.
5755
7bd1665a
JD
57562008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
5757
5758 * NEWS (2.3b+): New section, empty for now.
5759 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
5760
72c5b982
JD
57612008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
5762
5763 * NEWS (2.3b): Update release date since there has been a delay in
5764 getting the announcements and tarballs out.
5765
bd02cd5d
JD
57662008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
5767
5768 * NEWS: Version 2.3b.
5769 * configure.ac (AC_INIT): Likewise.
5770 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
5771
9126263e
JD
57722008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
5773
5774 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
5775 been doing it for years.
5776 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
5777 (Release Procedure): Add FIXME about make alpha being unmaintained.
5778
fa6aa7b3
JD
57792008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
5780
5781 * data/yacc.c: Reformat m4 a little for readability.
5782 * src/lalr.c (build_relations): Correct comment.
5783
d30b312d
JMG
57842008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5785
5786 DJGPP specific issue.
5787 * djgpp/config.sed: Fixes required to run configure scripts generated
5788 by autoconf 2.62.
5789
138d4cd9
JD
57902008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
5791
5792 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
5793 coordinator@translationproject.org.
5794
8f7e2e1f
JD
57952008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
5796
5797 * THANKS: Add Eric Blake.
5798
f55efa38
JD
57992008-04-23 Eric Blake <ebb9@byu.net>
5800
5801 Revert prior patch, by working around autoconf regression.
5802 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
5803 ("Output file name: ("): Uncomment test.
5804 ("Output file name: )"): Likewise.
5805 Based on an idea from Noah Misch.
5806
096c9f9d
JD
58072008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
5808
5809 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
5810 2.61. Reported by Juan Manuel Guerrero at
5811 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
5812 * tests/output.at ("Output file name: ("): Comment out test case for
5813 now.
5814 ("Output file name: )"): Likewise.
5815
0f664b89
JD
58162008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
5817
5818 * GNUmakefile: Update git-version-gen invocation so make dist
5819 succeeds.
5820
1cfe6375
JD
58212008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
5822
5823 Update to the current gnulib CVS repository, and fix trigraph handling
5824 in Bison.
5825 * bootstrap: Update gnulib CVS repository URL.
5826 (symlink_to_dir): Encapsulate the code that guarantees the destination
5827 directory exists into...
5828 (check_dst_dir): ... this new function, and...
5829 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
5830 fail when copying files into lib/uniwidth/.
5831 * src/output.c (prepare_symbols): When writing yytname muscles, where
5832 symbol names will be encoded in C-string literals, tell quotearg to
5833 escape trigraphs. This used to be the default in gnulib.
5834 * tests/regression.at (Token definitions): Because of the change in
5835 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
5836 escapes trigraphs in symbol names. Thus, yytname no longer has
5837 trigraphs unnecessarily doubly escaped. Update test case output.
5838 Extend test case to be sure Bison's own error messages will no longer
5839 have trigraphs in symbol names unnecessarily escaped once.
5840
74c52fc8
JD
58412008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
5842
5843 Fix make dist infinite loop reported by Juan Manuel Guerrero at
5844 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
5845 * .cvsignore: Add .version.
5846 * .version.in: New.
5847 * bootstrap.conf (gnulib_modules): Add git-version-gen.
5848 * configure.ac (AC_CONFIG_FILES): Add .version.
5849 * build-aux/.cvsignore: Add git-version-gen.
5850
8e55b3aa
JD
58512008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
5852
5853 * NEWS (2.3a+): Mention that -g now takes an argument.
5854 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
5855 consistency. Update the -g and -x entries now that they take
5856 arguments. Use brackets to indicate optional arguments.
5857 * src/getargs.c (usage): Explain the relationship between arguments of
5858 long and short options more completely. Document --defines and -d
5859 separately since the former takes an argument but, for POSIX Yacc, the
5860 latter does not.
5861 (short_options): Let -W take an optional argument like --warnings.
8452fdd9 5862 (getargs): Sort cases.
8e55b3aa 5863
59c5ac72
AD
58642008-02-28 Akim Demaille <demaille@gostai.com>
5865
5866 * doc/bison.texinfo: Fix a few typos.
5867
118d4978
AD
58682008-02-28 Akim Demaille <akim@epita.fr>
5869
5870 * doc/bison.texinfo (Bison Options): Document -W.
5871 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
5872
7020f1e9
AD
58732008-02-28 Akim Demaille <akim@epita.fr>
5874
5875 * src/getargs.c (short_options): Split and sort for readability.
5876 -g and -x take optional arguments, just like their long options.
5877 * build-aux/cross-options.pl: Use /x to make the regexp easier to
5878 understand.
5879 Fix the handling of $opt which resulted in all the argument to be
5880 considered as optional.
5881
59da312b
JD
58822008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
5883
5884 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
5885 say its interface is experimental.
5886 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
5887 Java.
5888 (Bison Options): In the -L and --language entry, mention Java.
5889 (Java Bison Interface): Say the interface is experimental.
5890 * src/getargs.c (usage): Mention -L and --language.
5891
5892 * NEWS (2.3a+): Say the push parsing interface is experimental.
5893 * doc/bison.texinfo (Push Decl): Likewise.
5894 (Decl Summary): Likewise in the "%define api.push_pull" entry.
5895 (Push Parser Function): Likewise.
5896 (Pull Parser Function): Likewise.
5897 (Parser Create Function): Likewise.
5898 (Parser Delete Function): Likewise.
5899 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
5900 yypull_parse, and yypush_parse entries.
5901
5902 * NEWS (2.3a+): Mention XML support, and say the schema is
5903 experimental.
5904 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
5905 * src/getargs.c (usage): Say the XML schema is experimental.
5906
5907 * NEWS (2.3a+): Say option instead of flag.
5908
2bb3ebec
WP
59092008-02-21 Wojciech Polak <polak@gnu.org>
5910
5911 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
5912 text.
5913
333e670c
JD
59142008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
5915
5916 Fix impure push parser compile error reported by Bob Rossi at
5917 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
5918 * data/yacc.c: Clean up whitespace in the output a little.
5919 (yypstate_allocated): Define for impure push parsers regardless of
5920 whether the pull interface is also requested.
5921 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
5922 check impure push parsers without the pull interface.
5923
5924 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
5925 yyerror takes arguments specified by %parse-param while yypstate_new
5926 does not.
5927 * doc/bison.texinfo (Parser Create Function): Document that
5928 yypstate_new returns 0 for multiple impure parser instances.
5929 * tests/push.at (Push Parsing: Multiple impure instances): Update
5930 expected stderr output.
5931
798096e1
JD
59322008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
5933
5934 * runtime-po/POTFILES.in (push.c): Remove.
5935
9ca7f077
JD
59362008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
5937
5938 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
5939 * data/push.c: Rename to...
5940 * data/yacc.c: ... this, overwriting it.
5941 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
5942 `%push-pull-parser' -> `%define api.push_pull "both"'.
5943 Remove old yacc.c tests, and update push.c tests to yacc.c.
5944
42ee26bb
JD
59452008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
5946
5947 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
5948 `"%code top" blocks' instead of `%code "top" blocks'.
5949 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
5950 Clean up whitespace in the output a little.
5951
b1cc23c4
JD
59522008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
5953
5954 Fix documentation problems reported by Tim Josling at
5955 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
5956 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
5957 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
5958 integers. Explain the effect of literal string aliases on error
5959 messages. Copy token 0 documentation from the C++ skeleton
5960 documentation.
5961
ab7f29f8
JD
59622008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
5963
5964 Accept a token number in a %left, %right, or %nonassoc for POSIX
5965 conformance. Reported by Tim Josling at
5966 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
5967 * NEWS (2.3a+): Mention.
5968 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
5969 and code numbers are treated by precedence declarations.
5970 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
5971 of symbols.1.
5972 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
5973 of symbol.
5974 (symbol.prec): New, just like symbol but allows INT.
5975 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
5976 longer holds.
5977 * tests/regression.at (Token number in precedence declaration): New
5978 test case.
5979
a924ef36
JMG
59802008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5981
5982 DJGPP specific issues.
5983 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
5984 be changed. Copyright timestamp adjusted.
5985 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
5986 be changed. Copyright timestamp adjusted.
5987 * djgpp/config.site: Copyright timestamp adjusted.
5988 * djgpp/config_h.sed: Copyright timestamp adjusted.
5989 * djgpp/djunpack.bat: Copyright timestamp adjusted.
5990 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
5991 filename translation list.
5992 * djgpp/subpipe.c (init_subpipe): Check the environment variables
5993 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
5994 files shall be created. Before trying to use the temp dir where the
5995 environment variable points to check that the dir really exists. If
5996 not default to the cwd as temp dir. Copyright timestamp adjusted.
5997 * djgpp/subpipe.h: Copyright timestamp adjusted.
5998 * djgpp/testsuite.sed: Copyright timestamp adjusted.
5999
389c8cfd
PE
60002008-01-30 Paul Eggert <eggert@cs.ucla.edu>
6001
6002 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
6003
5d1cfef4
PE
60042008-01-09 Paul Eggert <eggert@cs.ucla.edu>
6005
6006 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
6007 Problem reported by Claudio Saavedra in
6008 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
6009
e2dcf996
WP
60102008-01-05 Wojciech Polak <polak@gnu.org>
6011
6012 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
6013 document's title with the input grammar file name.
6014
da730230
JD
60152007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
6016
6017 Automate regression testing of the XML/XSLT implementation. Discussed
6018 starting at
6019 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
6020 * configure.ac (XSLTPROC): New substitution.
6021 * Makefile.am (maintainer-xml-check): New phony target invoking...
6022 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
6023 invoking make maintainer-check with BISON_TEST_XML=1.
6024 * tests/atlocal.in (XSLTPROC): New.
6025 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
6026 not to report reachable memory when Bison is expected to have a
6027 non-zero exit status and (2) to compare XML/XSLT output with --graph
6028 and --report=all output for every working grammar when
6029 BISON_TEST_XML=1.
6030 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
6031 (AT_BISON_CHECK_XML): New.
6032 (AT_QUELL_VALGRIND): New.
6033 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
6034 (AT_CHECK): ... don't redefine this since this was the old way to
6035 quell Valgrind.
6036 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
6037 AT_BISON_CHECK invocations.
6038 * tests/c++.at: Likewise.
6039 * tests/calc.at: Likewise.
6040 * tests/conflicts.at: Likewise.
6041 * tests/cxx-type.at: Likewise.
6042 * tests/existing.at: Likewise.
6043 * tests/glr-regression.at: Likewise.
6044 * tests/headers.at: Likewise.
6045 * tests/input.at: Likewise.
6046 * tests/java.at: Likewise.
6047 * tests/output.at: Likewise.
6048 * tests/push.at: Likewise.
6049 * tests/reduce.at: Likewise.
6050 * tests/regression.at: Likewise.
6051 * tests/sets.at: Likewise.
6052 * tests/skeletons.at: Likewise.
6053 * tests/synclines.at: Likewise.
6054 * tests/torture.at: Likewise.
6055 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
6056 tends to hang xsltproc.
6057 (Big horizontal): Likewise.
6058
408476bc
JD
60592007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
6060
6061 In XML output, remove redundant class attribute on symbol element.
6062 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
6063 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
6064 look up a symbol to determine whether it's a nonterminal or terminal.
6065 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
6066 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
6067
6068 Add prec/assoc information to XML output.
6069 * src/gram.c (grammar_rules_print_xml): For each rule that has a
6070 %prec, add a percent_prec attribute.
6071 * src/print-xml.c (print_grammar): For each terminal that has a
6072 precedence or associativity, add a prec or assoc attribute.
6073 (xml_indent): New.
6074 (xml_puts): Use xml_indent.
6075 (xml_printf): Use xml_indent.
6076 * src/print-xml.h (xml_indent): Prototype.
6077
6078 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
6079 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
6080
d4a26c48
JD
60812007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
6082
6083 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
6084 (bison:ruleByNumber): ... this for clarity.
6085 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
6086 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
6087 (xsl:template match="reduction"): Update.
6088 (xsl:template match="item"): Update.
6089 (xsl:template match="reduction"): Update.
6090
6091 In the XML output, don't print the list of rules where symbols appear.
6092 Compute it in XSLT instead. Discussed at
6093 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
6094 * data/xslt/bison.xsl (bison:ruleByLhs): New.
6095 (bison:ruleByRhs): New.
6096 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
6097 bison:ruleByRhs.
6098 (xsl:template match="terminal/rule"): Remove.
6099 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
6100 bison:ruleByRhs.
6101 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
6102 Remove.
6103 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
6104 bison:ruleByRhs and mode="number-link" for rule template.
6105 (xsl:template match="terminal/rule"): Remove.
6106 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
6107 bison:ruleByRhs and mode="number-link" for rule template.
6108 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
6109 Rewrite as...
6110 (xsl:template match="rule" mode="number-link"): ... this.
6111 * src/print-xml.c (print_grammar): Don't print the list of rules.
6112
ef1b4273
JD
61132007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
6114
6115 Don't let --report affect XML output; always print all information.
6116 Discussed at
6117 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
6118 * src/conflicts.c (log_resolution): Implement.
6119 * src/print-xml.c (print_core): Implement.
6120 (print_state): Implement.
6121 (print_xml): Implement.
6122
6123 * NEWS (2.3a+): Fix quotes.
6124 * src/parse-gram.y (prologue_declaration): For consistency with -v,
6125 don't let %verbose clear the list specified by --report.
6126
0f6cd9e3
AD
61272007-11-26 Akim Demaille <akim@epita.fr>
6128
6129 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
6130
d80fb37a
JD
61312007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
6132
6133 In the XML output, list useless and unused symbols and rules with the
6134 useful ones and add a "usefulness" attribute. Discussed starting at
6135 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
6136 * src/gram.c (grammar_rules_partial_print_xml): Remove.
6137 (grammar_rules_print_xml): Print all rules instead of just those
6138 useful in the grammar, and add a "usefulness" attribute.
6139 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
6140 * src/print-xml.c (print_rules_useless_in_parser): Remove.
6141 (print_grammar): Print all nonterminals instead of just useful ones,
6142 and add a "usefulness" attribute to nonterminals and terminals.
6143 (print_xml): Don't print a separate "reductions" or
6144 "rules-useless-in-parser" element.
6145 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
6146 (reduce_xml): Remove.
6147 (reduce_token_unused_in_grammar): New.
6148 (reduce_nonterminal_useless_in_grammar): New.
6149 * src/reduce.h (reduce_xml): Remove prototype.
6150 (reduce_token_unused_in_grammar): Add prototype.
6151 (reduce_nonterminal_useless_in_grammar): Add prototype.
6152 * data/xslt/xml2text.xsl: Update for XML changes.
6153 * data/xslt/xml2xhtml.xsl: Update for XML changes.
6154 * tests/reduce.at (Useless Terminals): Update output.
6155 (Useless Rules): Update output.
6156 (Reduced Automaton): Update output.
6157
6158 Say "Terminals unused in grammar" instead of "Unused terminals".
6159 * NEWS (2.3a+): Update.
6160 * doc/bison.texinfo (Understanding): Update example output.
6161 * src/reduce.c (reduce_output): Implement.
6162 * data/xslt/xml2text.xsl: Implement.
6163 * data/xslt/xml2xhtml.xsl: Implement.
6164
1bb2bd75
JD
61652007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
6166
6167 Accept --report-file=FILE to override the default `.output' filename.
6168 * NEWS (2.3a+): Mention.
6169 * doc/bison.texinfo (Bison Options): Add an entry.
6170 * src/files.c (compute_output_file_names): Don't override
6171 spec_verbose_file if already set.
6172 * src/getargs.c (usage): Document --report-file.
6173 (REPORT_FILE_OPTION): New anonymous enum member.
6174 (long_options): Add entry for it.
6175 (getargs): Add case for it setting spec_verbose_file.
6176
6177 * build-aux/cross-options.pl: Don't record a short option just because
6178 there's an arg.
6179 * doc/.cvsignore: Add yacc.1.
6180
a005a9c4
AD
61812007-11-14 Akim Demaille <akim@epita.fr>
6182
6183 * doc/yacc.1.in: New.
6184 * configure.ac, doc/Makefile.am: Adjust.
6185 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
6186 config.h symbol.
6187 Use AC_SUBST for assignments too.
6188 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
6189
cff03fb2
JD
61902007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
6191
6192 * src/gram.c: Remove comments that duplicate comments in gram.h.
6193
6194 When reporting useless rules and nonterminals, say "useless in grammar"
6195 instead of "useless", and say "useless in parser" instead of "never
6196 reduced". Discussed starting at
6197 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
6198 * NEWS (2.3a+): Mention this change.
6199 * data/xslt/xml2text.xsl: Update output text and expected input XML
6200 element names to match changes below.
6201 * data/xslt/xml2xhtml.xsl: Likewise.
6202 (xsl:template match="bison-xml-report"): Add missing entry in Table of
6203 Contents: "Rules useless in parser due to conflicts".
6204 * doc/bison.texinfo (Decl Summary): Reword a little.
6205 (Understanding): Update example output for changes below.
6206 * src/gram.c: (rule_useful_p): Rename to...
6207 (rule_useful_in_grammar_p): ... this.
6208 (rule_useless_p): Rename to...
6209 (rule_useless_in_grammar_p): ... this.
6210 (rule_never_reduced_p): Rename to...
6211 (rule_useless_in_parser_p): ... this.
6212 (grammar_rules_print): Update for renames.
6213 (grammar_rules_print_xml): Update for renames.
6214 (grammar_rules_never_reduced_report): Rename to...
6215 (grammar_rules_useless_report): ... this since it is used for either
6216 kind of useless rule.
6217 * src/gram.h: Reword comments and update function names in prototypes.
6218 * src/main.c (main): Say "rule useless in parser due to conflicts".
6219 * src/print-xml.c (print_rules_never_reduced): Rename to...
6220 (print_rules_useless_in_parser): ... this, and rename output XML
6221 element "rules-never-reduced" to "rules-useless-in-parser".
6222 (print_xml): Update for rename.
6223 * src/print.c (print_results): Say "Rules useless in parser due to
6224 conflicts".
6225 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
6226 (nonterminals_reduce): Say "nonterminal useless in grammar".
6227 (reduce_output): Say "Nonterminals useless in grammar".
6228 Say "Rules useless in grammar".
6229 (reduce_xml): Rename output XML element "useless" to
6230 "useless-in-grammar".
6231 (reduce_print): Don't report the count of grammatically useless rules
6232 as "rules never reduced" just because %yacc is specified.
6233 In the correct report of this count, say nonterminal(s) and rule(s)
6234 "useless in grammar".
6235 * tests/conflicts.at (S/R in initial): Update expected output.
6236 (Defaulted Conflicted Reduction): Likewise.
6237 (Unreachable States After Conflict Resolution): Likewise.
6238 * tests/existing.at (GNU pic Grammar): Likewise.
6239 * tests/reduce.at (Useless Nonterminals): Likewise.
6240 (Useless Rules): Likewise.
6241 (Reduced Automaton): Likewise.
6242 (Underivable Rules): Likewise.
6243 (Empty Language): Likewise.
6244
66f0441d
JD
62452007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
6246
6247 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
6248 here document and before the EOF so that BSD's implementation of Bourne
6249 shell doesn't parse the delimiter as part of the here document.
6250 * doc/.cvsignore: Add cross-options.texi.
6251 * src/getargs.c (usage): Add a blank line after the warning categories.
6252
d0ee4105
PB
62532007-11-08 Paolo Bonzini <bonzini@gnu.org>
6254
6255 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
6256
e8b1fb9b
AD
62572007-11-05 Akim Demaille <akim@epita.fr>
6258
6259 Remove Id: from bison.1.
6260 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
6261 (perl -0777 -pi -e 's/\.PP\nId): New.
6262 (.x.1): Use it to ignore the version control revision.
6263
2f7a96b5
AD
62642007-11-05 Akim Demaille <demaille@gostai.com>
6265
6266 * build-aux/Makefile.am: Ship cross-options.pl.
6267 * doc/Makefile.am: Always refer to cross-options.texi with
6268 $(srcdir).
6269 (MAINTAINERCLEANFILES): Add it.
6270
f4101aa6
AD
62712007-11-04 Akim Demaille <demaille@gostai.com>
6272
6273 Generate the long/short option cross-table.
6274 * build-aux/cross-options.pl: New.
6275 * doc/Makefile.am (cross-options.texi): New.
6276 * doc/bison.texinfo: Use it.
6277
727a1401
AD
62782007-11-04 Akim Demaille <demaille@gostai.com>
6279
6280 Generate bison.1 using help2man.
6281 * doc/common.x, doc/bison.x: New.
6282 * doc/Makefile.am (bison.1, .x.1): New.
6283 The code is taken from autoconf-2.61/man/Makefile.am.
6284 * configure.ac: Look for help2man.
6285
6aeb9c57
AD
62862007-11-04 Akim Demaille <demaille@gostai.com>
6287
6288 Complete --help.
6289 * src/getargs.c (usage): Document -W, make it clear that -d,
6290 -g and -x have optional arguments.
6291
d7be4085
AD
62922007-11-04 Akim Demaille <demaille@gostai.com>
6293
6294 Find sha1sum when named gsha1sum.
6295 * bootstrap (find_tool): New.
6296 ($SHA1SUM): New.
6297
d9df47b6
JD
62982007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
6299
6300 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
6301 at
6302 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
6303 * NEWS (2.3a+): Mention.
6304 * data/bison.m4 (b4_pure_if): Don't define it here.
6305 * data/c.m4 (b4_identification): Depend on individual skeletons to
6306 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
6307 values of the %define variables api.pure or api.push_pull. Define
6308 YYPURE, YYPUSH, and YYPULL accordingly.
6309 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
6310 glr.cc has already defined b4_pure_flag.
6311 * data/push.c: Define b4_pure_if based on `%define api.pure'.
6312 Remove YYPUSH and YYPULL since they're back in b4_identification again.
42ee26bb 6313 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
d9df47b6
JD
6314 * doc/bison.texinfo (Pure Decl): Update.
6315 (Push Decl): Update.
6316 (Decl Summary): Add api.pure to %define entry.
6317 In %pure-parser entry, say it's deprecated and reference %define.
6318 (Pure Calling): Update.
6319 (Error Reporting): Update.
6320 (C++ Scanner Interface): Update.
6321 (How Can I Reset the Parser): Update.
6322 (Table of Symbols): In %pure-parser entry, say it's deprecated and
6323 reference %define.
6324 * src/getargs.c (pure_parser): Remove global variable.
6325 * src/getargs.h (pure_parser): Remove extern.
6326 * src/output.c (prepare): Don't define pure_flag muscle.
6327 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
6328 wrapper around `%define api.pure'.
6329 * tests/calc.at (Simple LALR Calculator): Update.
6330 (Simple GLR Calculator): Update.
6331 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
6332 Update.
6333 (GLR: Resolve ambiguity, pure, locations): Update.
6334 (GLR: Merge conflicting parses, pure, no locations): Update.
6335 (GLR: Merge conflicting parses, pure, locations): Update.
6336 * tests/glr-regression.at (Uninitialized location when reporting
6337 ambiguity): Update
6338 * tests/input.at (Unused %define api.pure): New test case.
6339 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
6340 AT_PURE_IF and AT_PURE_AND_LOC_IF.
6341 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
6342
c373bf8b
JD
63432007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
6344
6345 %define push_pull -> %define api.push_pull. Discussed starting at
6346 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
6347 * data/push.c: Expect the new name.
6348 * data/yacc.c: Likewise.
6349 * doc/bison.texinfo (Push Decl): Update.
6350 (Decl Summary): Update %define entry.
6351 (Push Parser Function): Update.
6352 (Pull Parser Function): Update.
6353 (Parser Create Function): Update.
6354 (Parser Delete Function): Update.
6355 * tests/calc.at (Simple LALR Calculator): Update.
6356 * tests/input.at (%define enum variables): Update.
6357 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
6358 (Push Parsing: Multiple impure instances): Update.
6359 (Push Parsing: Unsupported Skeletons): Update.
6360 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
6361 (Exploding the Stack Size with Malloc): Update.
6362
6363 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
6364 other entries some.
6365
32f19b6b
JD
63662007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
6367
6368 For the XML output's terminal element, rename @number to @token-number,
6369 and add @symbol-number. In the nonterminal element, rename @number to
6370 @symbol-number. Discussed starting at
6371 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
6372 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
6373 renames.
6374 (xsl:template match="nonterminal"): Likewise.
6375 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
6376 (xsl:template match="nonterminal"): Likewise.
6377 * src/print-xml.c (print_grammar): Implement.
6378
255a6b90
JD
63792007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6380
6381 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
6382 2007-10-11 change, the child elements here are items not rules.
408476bc 6383 (xsl:template match="item"): New.
255a6b90
JD
6384 (xsl:template match="rule"): Update for new reduced itemset.
6385 (xsl:template match="point"): Remove.
6386 (xsl:template match="empty"): For consistency with --graph, don't
6387 output "/* empty */".
6388 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
6389 line-wrap, don't pass a negative value as first-line-length since this
6390 won't work with the following changes.
6391 (xsl:template name="line-wrap"): Simplify slightly.
6392 (xsl:template name="ws-search"): Eliminate recursion.
6393 * src/print_graph.c (print_core): Don't print a reduction's lookahead
6394 set next to an item whose dot is not at the end of the RHS even if it
6395 happens to be associated with the same rule.
6396
88c78747
JD
63972007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
6398
31984206
JD
6399 Add %define lr.keep_unreachable_states.
6400 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
6401 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
6402 * src/main.c (main): Implement it.
6403 * tests/conflicts.at (Unreachable States After Conflict Resolution):
6404 Extend to test it, and fix a typo.
6405
64062007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
6407
6408 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
6409 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
6410 the example .output text.
6411 * tests/regression.at (Extra lookahead sets in report): Improve wording
6412 of comments.
6413
b7a70162
WP
64142007-10-17 Wojciech Polak <polak@gnu.org>
6415
6416 * src/print-xml.c (print_grammar): Renamed
6417 <terminal> and <nonterminal> attributes:
6418 "type" to "number" and "symbol" to "name".
6419 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
6420 Use new attribute names.
6421 (xsl:template match="nonterminal"): Likewise.
6422 * data/xslt/xml2xhtml.xsl: Likewise.
6423
a0de5091
JD
64242007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
6425
6426 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
6427 (Option Cross Key): Likewise.
6428
6429 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
6430 next to an item whose dot is not at the end of the RHS even if it
6431 happens to be associated with the same rule.
6432 * src/print.c (print_core): Likewise.
6433 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
6434 (Resolved SR Conflicts): Update output.
6435 * tests/regression.at (Extra lookahead sets in report): New test case.
6436
4c20d18d
WP
64372007-10-11 Wojciech Polak <polak@gnu.org>
6438
6439 * src/print-xml.c (print_core): Remove item set
6440 redundancy.
6441 * data/xslt/bison.xsl (bison:ruleNumber): New key.
6442 Improve processing time. Suggested by Joel E. Denny.
6443 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
6444 Write xsl:param "required" attribute as comment.
6445 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
6446 (xsl:template match="rule"): Support new reduced itemset.
6447 (xsl:template match="point"): Remove.
6448 * data/xslt/xml2xhtml.xsl: Likewise.
6449
f506ad1c
JD
64502007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
6451
6452 * src/getargs.c (version): Update copyright year.
6453
21f1b063
JD
64542007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
6455
6456 Make xml2dot.xsl and --graph produce the same output.
6457 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
6458 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
6459 escaped later.
6460 (xsl:template name="output-node"): Use the new escape template instead
6461 of the string-replace template directly.
6462 (xsl:template name="output-edge"): Likewise.
6463 (xsl:template name="escape"): New, escapes backslashes and newlines in
6464 addition to quotation marks.
6465 * src/graphviz.c (start_graph, output_node, output_edge): Add
6466 whitespace to output for legibility.
6467
6468 Make xml2text.xsl and --report produce the same output, and remove the
6469 XML "conflicts" element since a conflict summary is easily extracted
6470 from the automaton.
6471 * data/xslt/bison.xsl: New.
6472 (xsl:template match="state" mode="bison:count-conflicts): New.
6473 * data/xslt/xml2text.xsl: Import bison.xsl.
6474 (xsl:template match="bison-xml-report"): Instead of styling the
6475 "conflicts" element, style the "automaton" element with mode
6476 "conflicts". Unlike the former, the latter lists S/R and R/R
6477 conflicts for a state on the same line.
6478 (xsl:template match="conflicts"): Remove.
6479 (xsl:template match="conflict"): Remove.
6480 (xsl:template match="terminal"): Line-wrap the list of rules in which
6481 the terminal is used.
6482 (xsl:template match="nonterminal"): Likewise for nonterminals.
6483 (xsl:template match="automaton" mode="conflicts"): New.
6484 (xsl:template match="state" mode="conflicts"): New.
6485 (xsl:template name="line-wrap"): New.
6486 (xsl:template name="ws-search"): New.
6487 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
6488 (xsl:template match="bison-xml-report"): Instead of styling the
6489 "conflicts" element, style the "automaton" element with mode
6490 "conflicts."
6491 (xsl:template match="conflicts"): Remove.
6492 (xsl:template match="conflict"): Remove.
6493 (xsl:template match="automaton" mode="conflicts"): New.
6494 (xsl:template match="state" mode="conflicts): New.
6495 * src/conflicts.c (conflicts_output_xml): Remove.
6496 * src/conflicts.h (conflicts_output_xml): Remove prototype.
6497 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
6498 * src/print.c (print_grammar): Consistently wrap at the 66th column so
6499 the corresponding XSLT is easier. Also, never wrap between a word and
6500 the comma that follows it.
6501
793fbca5
JD
65022007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
6503
6504 Improve C++ namespace support. Discussed starting at
6505 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
6506 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
6507 b4_namespace_close): New macros that interpret the %define variable
6508 "namespace" so its value can contain "::" to indicate nested
6509 namespaces.
6510 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
6511 the above macros.
6512 * data/lalr1.cc (b4_namespace): Likewise.
6513 * data/location.cc (b4_namespace): Likewise.
6514 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
6515 inside a new table in the general %define entry. Document `%define
6516 namespace' there as well. Point the %name-prefix entry to it since it
6517 explains it more completely in the case of C++.
6518 (C++ Bison Interface): Mention `%define namespace' instead of
6519 %name-prefix.
6520 (Table of Symbols): Remove the `%define push_pull' entry. The %define
6521 entry suffices.
6522 * tests/c++.at (Relative namespace references): New test case.
6523 (Absolute namespace references): New test case.
6524 (Syntactically invalid namespace references): New test case.
6525 * tests/input.at (C++ namespace reference errors): New test case.
6526
35b8730d
JD
65272007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
6528
6529 Add syncline support and location accessor to internal %define
6530 interfaces.
6531 * data/bison.m4 (b4_percent_define_get_loc): New.
6532 (b4_percent_define_get_syncline): New.
6533 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
6534 (b4_percent_define_default): Record defining location as line 1 rather
6535 than 0 for the sake of synchronizing #line's, and define
6536 b4_percent_define_syncline(VARIABLE).
6537 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
6538 * src/muscle_tab.c (muscle_syncline_grow): New.
6539 (muscle_code_grow): Use muscle_syncline_grow.
6540 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
6541 define b4_percent_define_syncline(VARIABLE).
6542 (muscle_percent_define_get_loc): New.
6543 (muscle_percent_define_get_syncline): New.
6544 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
6545 remove some unused variables.
6546 (muscle_percent_define_default): Record defining location as line 1
6547 rather than 0 for the sake of synchronizing #line's, and define
6548 b4_percent_define_syncline(VARIABLE).
6549 (muscle_percent_define_check_values): Use
6550 muscle_percent_define_get_loc.
6551 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
6552 (muscle_percent_define_get_syncline): Prototype.
6553 * tests/skeletons.at (%define Boolean variables: invalid skeleton
6554 defaults): Update output for location change.
6555 (Complaining during macro argument expansion): Extend to test
6556 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
6557
7dc4a694
JD
65582007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
6559
6560 Fix some error-reporting macro bugs.
6561 * data/bison.m4 (b4_cat): New.
6562 (b4_error, b4_error_at): Use b4_cat to send error directives directly
6563 to stdout so they don't become arguments to other macros. Update
6564 comments and add examples.
6565 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
6566 add examples.
6567 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
6568 after printing the error directive so that M4 doesn't report subsequent
6569 problems that are induced by this problem.
6570 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
6571 instead of just in them. Recognize @\n in both places. Both expand to
6572 the empty string. Needed by b4_cat.
6573 * tests/skeletons.at (Complaining during macro argument expansion):
6574 New test case.
6575 (Fatal errors make M4 exit immediately): New test case.
6576
d4bd2295
JD
65772007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
6578
6579 Implement --print-datadir.
6580 * src/getargs.c (usage): Mention.
6581 (PRINT_DATADIR_OPTION): New anonymous enum member.
6582 (long_options): Add entry for it.
6583 (getargs): Add case for it calling compute_pkgdatadir.
6584 * src/output.c (output_skeleton): Encapsulate data directory
6585 computation from here...
6586 (prepare): ... and from here...
6587 (compute_pkgdatadir): ... into this new function.
6588 * src/output.h (compute_pkgdatadir): Prototype.
6589
34cdeddf
JD
65902007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
6591
6592 * src/print-xml.c (escape_bufs): New static global variable
6593 replacing...
6594 (xml_escape_n): ... the static local variable buf here.
6595 (print_xml): Free memory for escape_bufs.
6596 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
6597
d782395d
JD
65982007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
6599
6600 Replace `%push-parser' and `%push-pull-parser' with
6601 `%define push_pull "push"' and `%define push_pull "both"'.
6602 `%define push_pull "pull"' is the default.
6603 * doc/bison.texinfo (Push Decl, Push Parser Function,
6604 Pull Parser Function, Parser Create Function, Parser Delete Function):
6605 Update declarations.
6606 (Decl Summary, Table of Symbols): Replace %push-parser and
6607 %push-pull-parser entries with a %define push_pull entry.
6608 * data/bison.m4 (b4_percent_define_check_values): New macro.
6609 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
6610 definitions...
6611 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
6612 definitions...
6613 * data/push.c: ... to here and compute them from the value of the
6614 %define variable push_pull.
6615 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
6616 parsing requests here...
6617 * data/yacc.c: ... hack this to switch to push.c any time
6618 b4_use_push_pull_flag or the %define variable push_pull is set. This
6619 will go away when we mv push.c yacc.c.
6620 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
6621 push parsing is not supported since unused %define variables are
6622 reported anyway.
6623 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
6624 * src/muscle_tab.h (muscle_percent_define_check_values): Update
6625 comments for consistency with b4_percent_define_check_values.
6626 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
6627 muscles.
6628 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
6629 Remove.
6630 (prologue_declaration): Remove %push-parser and %push-pull-parser
6631 rules.
6632 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
6633 * tests/calc.at: Update declarations.
6634 * tests/input.at (%define enum variables): New test case.
6635 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
6636 declaration.
6637 (Push Parsing: Multiple impure instances): Update declaration.
6638 (Push Parsing: Unsupported Skeletons): New test case.
6639 * tests/torture.at (Exploding the Stack Size with Alloca): Update
6640 declaration.
6641 (Exploding the Stack Size with Malloc): Update declaration.
6642
3f999f78
WP
66432007-09-24 Wojciech Polak <polak@gnu.org>
6644
6645 Add XSLT transformations.
6646
6647 * data/xslt/xml2dot.xsl: Transform XML into DOT.
6648 * data/xslt/xml2text.xsl: Transform XML into plain text.
6649 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
6650 * data/Makefile.am (xsltdir): New variable.
6651 (dist_xslt_DATA): Add xslt/*.xsl files.
6652
a4f75309
PE
66532007-09-23 Paul Eggert <eggert@cs.ucla.edu>
6654
6655 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
6656 Problem reported by Wojciech Polak.
6657 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
6658 (xml_printf): Undo change I made on 21 September; that is,
6659 indent 2 spaces, not 1.
6660
ad5feac4
JD
66612007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
6662
6663 Pacify ./configure --enable-gcc-warnings.
6664 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
6665 `char const *' instead of `char *'.
6666 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
6667 local variable `sep'.
6668
41d7a5f2
PE
66692007-09-21 Paul Eggert <eggert@cs.ucla.edu>
6670
6671 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
6672 elsewhere.
6673 * src/print-xml.c: Prefer "const" after types; that's more consistent.
6674 (xml_printf): Indent just 1 space for level.
6675 (e_char, xlate_char): Remove.
6676 (xml_escape_string): Rewrite to avoid undefined behavior (used
6677 storage that was freed from the stack).
6678 (xml_escape_n): Don't bother checking for subscript error.
6679
3f999f78
WP
66802007-09-21 Wojciech Polak <polak@gnu.org>
6681
6682 Add Bison XML Automaton Report.
41d7a5f2
PE
6683
6684 Add support for an -x option to generate an XML report.
6685 It is not documented yet.
6686 * src/print-xml.c: New file.
6687 * src/print-xml.h: Likewise.
6688 * lib/timevar.def (TV_XML): New var.
6689 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
6690 * src/conflicts.c: Include print-xml.h.
6691 (solved_conflicts_xml_obstack): New var.
6692 (log_resolution, conflicts_solve, conflicts_free):
6693 Add support for XML report.
6694 (conflicts_output_val): New function.
6695 * src/conflicts.h (conflicts_output_val): New decl.
6696 * src/files.c (spec_xml_file): New var.
6697 (compute_output_file_names, output_file_names_free): Add XML support.
6698 * src/files.h (spec_xml_file): New decl.
6699 * src/getargs.c (xml_flag): New var.
6700 (usage, short_options, long_options, getargs): Add XML support.
6701 * src/getargs.h (xml_flag): New decl.
6702 * src/gram.c: Include print-xml.h.
6703 (rule_lhs_print_xml, rule_rhs_print_xml):
6704 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
6705 New functions.
6706 * src/gram.h: Declare external ones.
6707 * src/main.c: Include print-xml.h.
6708 (main): Add XML support.
6709 * src/reduce.c: Include print-xml.h.
6710 (reduce_xml): New function.
6711 * src/reduce.h: Declare it.
6712 * src/state.c: Include print-xml.h.
6713 (state_new): Add XML support.
6714 (state_rule_lookahead_tokens_print_xml): New function.
6715 * src/state.h: Declare it.
6716 (struct state): New member solved_conflicts_xml.
6717 * src/symtab.c (symbol_class_get_string): New function.
6718 * src/symtab.h: Declare it.
6719
6d8e724d
PE
67202007-09-21 Paul Eggert <eggert@cs.ucla.edu>
6721
6722 * GNUmakefile: Switch to coreutils's version.
6723 * bootstrap: Likewise.
6724 * Makefile.cfg: Adjust to new GNUmakefile.
6725 * README-hacking: Likewise.
6726
6727 Import from gnulib:
6728
6729 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
6730 Bruno Haible <bruno@clisp.org>
6731
6732 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
6733 and is a script that invokes bison. Tighten the code. Add comments.
6734
922bdd7f
JD
67352007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
6736
6737 Spell "boolean" as "Boolean". Reported by Akim Demaille.
6738 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
6739 * doc/bison.texinfo (Decl Summary): Fix.
6740 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
6741 * tests/input.at (Boolean %define variables): Update output.
6742 * tests/skeletons.at (%define boolean variables: invalid skeleton
6743 defaults): Rename to...
6744 (%define Boolean variables: invalid skeleton defaults): ... this and
6745 update output.
6746
1b17b01d
JD
67472007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
6748
6749 In impure push mode, don't allow more than one yypstate to be allocated
6750 since multiple impure parsers would corrupt yynerrs.
6751 * data/push.c (yypstate_allocated): New static global variable
6752 initialized to 0.
6753 (yypull_parse): If yypstate_new returns 0, don't report it as memory
6754 exhaustion if yypstate_allocated is 1, but still return 2.
6755 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
6756 already 1. Otherwise, set it to 1.
6757 (yypstate_delete): Set it to 0.
6758 * tests/push.at (Push Parsing: Multiple impure instances): New test
6759 case.
6760
9987d1b3
JD
67612007-08-17 Bob Rossi <bob@brasko.net>
6762
6763 * doc/bison.texinfo (Push Decl): Document the push parser.
6764 (Table of Symbols): Ditto.
6765 (Pure Decl): Ditto.
6766 (Decl Summary): Ditto.
6767 (Multiple Parsers, Push Parser Function, Pull Parser Function,
6768 Parser Create Function, Parser Delete Function):
6769 Add new push parser symbols.
6770 (Table of Symbols): Document push-parser, push-pull-parser,
6771 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
6772
f16b0819
PE
67732007-08-15 Paul Eggert <eggert@cs.ucla.edu>
6774
6775 Update to GPLv3.
6776 * doc/gpl-3.0.texi: New file.
6777 * doc/gpl.texi: Remove.
6778 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
6779 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
6780 * README-hacking, TODO, bootstrap, bootstrap.conf:
6781 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
6782 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
6783 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
6784 * data/lalr1.cc, data/lalr1.java, data/location.cc:
6785 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
6786 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
6787 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
6788 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
6789 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
6790 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
6791 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
6792 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
6793 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
6794 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
6795 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
6796 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
6797 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
6798 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
6799 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
6800 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
6801 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
6802 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
6803 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
6804 * src/complain.c, src/complain.h, src/conflicts.c:
6805 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
6806 * src/files.h, src/flex-scanner.h, src/getargs.c:
6807 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
6808 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
6809 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
6810 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
6811 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
6812 * src/print.c, src/print.h, src/print_graph.c:
6813 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
6814 * src/reduce.h, src/relation.c, src/relation.h:
6815 * src/revision.h, src/scan-code.h, src/scan-code.l:
6816 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
6817 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
6818 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
6819 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
6820 * tests/Makefile.am, tests/actions.at, tests/c++.at:
6821 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
6822 * tests/existing.at, tests/glr-regression.at:
6823 * tests/headers.at, tests/input.at, tests/java.at:
6824 * tests/local.at, tests/output.at, tests/push.at:
6825 * tests/reduce.at, tests/regression.at, tests/sets.at:
6826 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
6827 * tests/torture.at:
6828 Update to GPLv3.
6829
728c4be2
JD
68302007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
6831
6832 Get rid of broken %no-parser, -n, and --no-parser implementation and
6833 documentation.
6834 * TODO: Don't mention them.
6835 * doc/bison.1: Likewise.
6836 * doc/bison.texinfo (Decl Summary): Likewise.
6837 (Bison Options): Likewise.
6838 (Option Cross Key): Likewise.
6839 * src/getargs.c (no_parser_flag): Remove global variable.
6840 (usage): Don't print description of -n and --no-parser.
6841 (long_options): Remove --no-parser entry here.
6842 (getargs): Remove -n case in the switch here.
6843 * src/getargs.h (no_parser_flag): Remove extern.
6844 * tests/regression.at (Web2c Actions): Remove comment that mentions
6845 --no-parser.
6846
5d31a216
JD
68472007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
6848
6849 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
6850 name user variables starting with `yy'. Just pass NULL instead of a
6851 dummy local &yylval to yypush_parse.
6852 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
6853 starting with `yy'.
6854
a2ea208d
JD
68552007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
6856
6857 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
6858 true since it's then always used regardless of whether yyoverflow is
6859 defined. Reported by Christian Burger at
6860 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
6861 * THANKS: Add Christian Burger.
6862
91661ebb
JD
6863 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
6864 node names: say "Decl Summary" not "Bison Declaration Summary".
6865
cbd50549
JD
68662007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
6867
6868 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
6869 determine whether this function has already complained about an invalid
6870 value for a %define boolean variable, don't check whether Bison has
6871 ever examined the value. As written, the check was a tautology.
6872 Instead, record and check for this complaint using a separate muscle.
6873
eb1b0740
JD
68742007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
6875
6876 Fix push parsing memory leak reported by Brandon Lucia at
6877 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
6878 * THANKS: Add Brandon Lucia.
6879 * data/push.c (yypstate_delete): Free the stack if it was reallocated
6880 but the parse never completed and thus freed it.
6881 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
6882 * tests/testsuite.at: Include push.at.
6883 * test/push.at: New.
6884 (Push Parsing: Memory Leak for Early Deletion): New test case.
6885
9d774aff
JD
68862007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
6887
6888 Improve handling of multiple S/R conflicts in the same state and of S/R
6889 conflicts involving multiple reductions.
6890 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
6891 set for a state here or Bison will abort if it is reassigned on a
6892 later conflicted reduction in the same state.
6893 Similarly, don't finalize and assign the solved conflicts report here
6894 or it will be lost if it is reassigned on a later conflicted reduction
6895 in the same state.
6896 (set_conflicts): Instead, assign them both here after all S/R conflicts
6897 in the state have been fully examined.
6898 * src/print.c (shift_set): Rename to...
6899 (no_reduce_set): ... this.
6900 (print_reductions): Update for rename, and add %nonassoc error action
6901 tokens to no_reduce_set so that, when printing the first remaining
6902 reduction on an error action token, the reduction is enclosed in
6903 brackets.
6904 (print_results): Update for rename.
6905 * tests/conflicts.at (Solved conflicts report for multiple reductions
6906 in a state): New test case.
6907 (%nonassoc error actions for multiple reductions in a state): New test
6908 case.
6909
6910 * src/main.c (main): Don't depend on C99 features.
6911
10159d2a
JD
69122007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
6913
6914 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
6915 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
6916 uniwidth.
10159d2a 6917
953b3935
JD
69182007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
6919
6920 * bootstrap (slurp): Create target directories that don't exist.
6921 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
6922
6ce2d93a
JD
69232007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
6924
6925 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
6926 than item number.
6927 * closure.c (closure): Likewise.
6928 * state.h (reductions): Comment sorting of rules.
6929 (state): Comment sorting of items.
6930
ce3448d5
JD
69312007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
6932
6933 Fix C++ test cases after recent Gnulib changes. Discussed starting at
6934 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
6935 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
6936 definition in order to avoid Gnulib headers since we don't use config.h
6937 here.
6938 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
6939 rather than AT_DATA so that config.h is included.
6940
8a86eef0
JD
69412007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
6942
6943 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
6944 instead of fprintf. Guard these functions with #if YYDEBUG instead of
6945 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
6946 and so that YYFPRINTF is guaranteed to be defined here.
6947
b1a81613
JD
69482007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
6949
6950 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
6951 with...
6952 (muscle_percent_define_check_values): ... this more helpful function.
6953 Again, it's not used yet, but it will be.
6954 * src/muscle_tab.h: Likewise.
6955
71b61d4d
JD
6956 Improve some comments in parser table construction.
6957 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
6958 (generate_states): Don't mention ruleset, which is internal to closure.
6959 * src/closure.c (closure): Explain sorting of core and itemset, which
6960 is required for this function to behave correctly.
6961 * src/closure.h (closure): Mention sorting.
6962
2a6b783d
JD
69632007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
6964
6965 * src/lalr.c (state_lookahead_tokens_count): For code readability,
6966 move the check for disabled transitions to an aver since conflict
6967 resolution hasn't happened yet.
6968
6969 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
6970 labels a state as inconsistent just because it has error transitions.
6971 The original form of this check appeared in revision 1.1 of lalr.c,
6972 which was committed on 1991-12-21. Now (at least), changing the
6973 consistency label on such a state appears to have no useful effect in
6974 any of the places it is examined, which I enumerate below. The key
6975 point to understanding each item in this enumeration is that a state
6976 with an error transition is labelled consistent in the first place only
6977 if it has no rules, so the check cannot matter for states that have
6978 rules. (1) Labelling a state as inconsistent will cause set_conflicts
6979 to try to identify its conflicts, and a state must have *rules* to have
6980 conflicts. (2) Labelling a state as inconsistent will affect how
6981 action_row sets the default *rule* for the state. (3) Labelling a
6982 state as inconsistent will cause build_relations to add lookback edges
6983 to *rules* in that state.
6984 * src/state.h (struct state): Word the comment for member consistent
6985 more carefully.
6986
14462c2b
JD
69872007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
6988
6989 Don't depend on C99 features.
6990 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
6991 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
6992 * src/reader.c (check_and_convert_grammar): Fix for-loop.
6993 * src/state.c (state_mark_reachable_states): Fix for-loop.
6994 (state_remove_unreachable_states): Fix for-loop.
6995
6996 Don't widen struct state with member reachable just to temporarily
6997 record reachability. Instead, use a local bitset.
6998 * src/state.h (struct state): Remove member.
6999 * src/state.c (state_new): Don't initialize it.
7000 (state_mark_reachable_states): Rename to...
7001 (state_record_reachable_states): ... this, and use bitset.
7002 (state_remove_unreachable_states): Use bitset.
7003
5a43d418
JD
70042007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
7005
7006 * src/Makefile.am (yacc): Quote target action commands properly so
7007 that the yacc script isn't corrupt. Reported by Hans Aberg at
7008 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
7009
0c650a20
JD
7010 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
7011 the case of pure parsers. Reported by Frans Englich at
7012 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
7013 * THANKS: Add Frans Englich.
7014
61fee93e
JD
7015 * NEWS (2.3a+): In the %code entry, reference section `Bison
7016 Declaration Summary' from the manual now since the %code summary has
7017 moved there.
7018 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
7019 in the rules section must be terminated by semicolons.
7020
f124d423
JD
70212007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
7022
7023 Extend the front-end API for %define variables to more completely
7024 mirror the back-end. This will be useful in the future.
7025 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
7026 Update comments to mention the new front-end counterparts of these
7027 macros.
7028 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
7029 for muscle_string_decode and muscle_location_decode.
7030 (muscle_string_decode): New static function.
7031 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
7032 (muscle_percent_define_get, muscle_percent_define_ifdef): New
7033 functions.
7034 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
7035 muscle_percent_define_get to mimic the b4_percent_define_flag_if
7036 implementation more closely.
7037 (muscle_percent_define_invalid_value): New function.
7038 * src/muscle_tab.h (muscle_percent_define_get,
7039 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
7040 Prototype.
7041
75ad86ee
JD
70422007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
7043
7044 * NEWS (2.3a+): Mention yesterday's state-removal change.
7045 (2.3a): Remove the %language entry, which was added after 2.3a.
7046 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
7047 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
7048 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
7049 tests/existing.at: Update copyright date.
7050
5967f0cf
JD
70512007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
7052
7053 If conflict resolution makes states unreachable, remove those states,
7054 report rules that are then unused, and don't report conflicts in those
7055 states.
7056 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
7057 New global function.
7058 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
7059 function.
7060 * src/main.c (main): After conflict resolution, remove the unreachable
7061 states and update all data structures that reference states by number.
7062 * src/state.c (state_new): Initialize each state's reachable member to
7063 false.
7064 (state_mark_reachable_states): New static function.
7065 (state_remove_unreachable_states): New global function.
7066 * src/state.h (struct state): Add member bool reachable.
7067 (state_remove_unreachable_states): Prototype.
7068 * tests/conflicts.at (Unreachable States After Conflict Resolution):
7069 New test case.
7070 * tests/existing.at (GNU pic Grammar): Update test case output now that
7071 an unused rule is discovered.
7072
b09f4f48
JD
70732007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
7074
7075 Minor code cleanup in parser table construction.
7076 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
7077 (new_itemsets, save_reductions): Update for rename to nitemset.
7078 * src/closure.c (nritemset): Rename to...
7079 (nitemset): ... this since the "r" appears to meaningless and isn't
7080 used in the comments.
7081 (closure): Update for rename.
7082 * src/closure.h (nritemset): Update extern to...
7083 (nitemset): ... this.
7084 * src/lalr.c (LA): Fix a typo in comments.
7085 * src/print.c (print_core): Update for rename to nitemset.
7086 * src/print_graph.c (print_graph): Likewise.
7087 * src/state.h: Fix some typos in header comments.
7088
bbb44d83
PE
70892007-04-04 Paul Eggert <eggert@cs.ucla.edu>
7090
9b33de72
PE
7091 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
7092 still sticks to ASCII. Sorry!
7093
bbb44d83
PE
7094 * README-hacking: New file, taken mostly from coreutils, with changes
7095 for Bison. Contains much of the contents of:
7096 * README-cvs: Remove.
7097 * bootstrap: Sync from gnulib.
7098 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
7099 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
7100
29553547
JD
71012007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
7102
7103 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
7104 Setzer.
7105 (Java Differences): Fix some typos.
7106 * THANKS: Add Sebastian Setzer.
7107
01b477c6
PB
71082007-03-07 Paolo Bonzini <bonzini@gnu.org>
7109
730739e4
AD
7110 * data/java.m4 (b4_single_class_if): Remove.
7111 (b4_abstract_if): Look at "%define abstract".
7112 (b4_lexer_if): New.
7113 (b4_union_name): Rename...
7114 (b4_yystype): ... to this. Map to "%define stype".
7115 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
7116 b4_maybe_throws): Fix quoting.
7117 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
7118 * data/lalr1.java (Lexer interface): Always define.
7119 (Lexer interface within parser class): Remove.
7120 (YYLexer class): New, used when "%code lexer" is present.
7121 (constructor): When "%code lexer" is used, pass %lex-param
7122 to the lexer constructor.
7123 (yylex, yyparse): Remove %lex-param from method invocations
7124 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
7125
7126 * doc/bison.texinfo (Java Bison Interface): Mention "%define
7127 abstract". Rename "%define union_name" to "%define stype".
7128 Rename method names according to previous patch.
7129 (Java Scanner Interface): Describe "%code lexer" instead of
7130 "%pure-parser" and "%define single_class".
7131 (Java Differences): Mention "%code lexer".
7132
7133 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
7134 Include scanner here, using macros from tests/local.at.
7135 (AT_DATA_CALC_Y): Remove final argument.
7136 (_AT_CHECK_JAVA_CALC): Likewise.
7137 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
7138 of %locations and %error-verbose.
7139 (main): Test with and without %lex-param.
7140 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
7141 (AT_BISON_OPTION_POPDEFS): Pop it.
01b477c6 7142
122bea3a
JMG
71432007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7144
7145 DJGPP spefic issue. Inhibit the use of disallowed characters for
7146 file name genertion on Win98, WinXP, etc. These are |<>":?*\
7147 and concern testsuite case 46.
7148 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
7149 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
7150 * djgpp/config.bat: Inhibit the use of disallowed characters.
7151
9611cfa2
JD
71522007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
7153
7154 Miscellaneous %define and %code cleanup.
7155 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
7156 values are interpreted.
7157 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
7158 documentation a little more.
7159 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
7160 muscle_percent_define_insert, muscle_percent_code_grow): New
7161 functions/macros.
7162 * src/muscle_tab.h (muscle_percent_define_insert,
7163 muscle_percent_code_grow): Prototype.
7164 * src/parse-gram.y (prologue_declaration): Use
7165 muscle_percent_define_insert and muscle_percent_code_grow when parsing
7166 %define and %code directives.
7167
7168 Make it easy to share %define boolean variables between the front-end
7169 and back-end. Though not used yet, this will be useful in the future.
7170 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
7171 Bison uses of names rather than just skeleton uses of names.
7172 (b4_percent_define_get, b4_percent_define_ifdef): Rename
7173 b4_percent_define_skeleton_variables(VARIABLE) to
7174 b4_percent_define_bison_variables(VARIABLE).
7175 (b4_percent_code_get, b4_percent_code_ifdef): Rename
7176 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
7177 b4_percent_code_bison_qualifiers(QUALIFIER).
7178 (b4_check_user_names_wrap): Update for renames.
7179 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
7180 muscle_percent_define_default): New functions mimicking
7181 b4_percent_define_flag_if and b4_percent_define_default.
7182
7183 For %define variables, report locations for invalid values and
bbb44d83 7184 redefinitions.
9611cfa2
JD
7185 * data/bison.m4 (b4_percent_define_flag_if): Read
7186 b4_percent_define_loc(VARIABLE) to report the location of an invalid
7187 value for VARIABLE.
7188 (b4_percent_define_default): Save a special location in
7189 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
7190 must later be reported as invalid.
7191 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
7192 functions.
7193 (muscle_percent_define_insert): Record the location of VARIABLE in
7194 muscle percent_define_loc(VARIABLE), and use it to report the previous
7195 location for a redefinition.
7196 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
7197 (muscle_percent_define_default): Update like b4_percent_define_default.
7198 (muscle_grow_user_name_list): Rename to...
7199 (muscle_user_name_list_grow): ... this for consistency and use
7200 muscle_location_grow.
7201 * src/muscle_tab.h (muscle_location_grow): Prototype.
7202 * tests/input.at (%define errors): Update expected output.
7203 * tests/skeletons.at (%define boolean variables: invalid skeleton
7204 defaults): New test case.
7205
0bf92491
JD
72062007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
7207
7208 * src/print.c (lookahead_set, state_default_rule): Remove.
7209 (print_reductions): Replace state_default_rule invocation with
7210 equivalent use of yydefact, which was computed in token_actions in
7211 tables.c.
7212 (print_results): Don't allocate lookahead_set.
7213
d3b12988
PB
72142007-02-27 Paolo Bonzini <bonzini@gnu.org>
7215
7216 * data/lalr1.java: Prefix all private members with yy.
7217
f57a7536
JD
72182007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
7219
7220 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 7221 Sebastien Fricker at
f57a7536 7222 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 7223 * THANKS: Add Sebastien Fricker.
f57a7536
JD
7224 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
7225 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
7226 accept a variable number of arguments.
7227
6404a5bf
JD
72282007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
7229
7230 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
7231
e4e09639
JMG
72322007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7233
7234 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
7235 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
7236 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
7237
d7e0a1a7
PE
72382007-02-11 Paul Eggert <eggert@cs.ucla.edu>
7239
7240 Undo my 2007-02-07 change, switching back to the c-strcase module
7241 introduced in the 2007-02-03 change. Bruno Haible reported that
7242 the 2007-02-07 change would be dangerous in Turkish if we add a
7243 language whose name contains "i", since "i" is not lowercase "I"
7244 in Turkish.
7245 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
7246 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
7247 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
7248 * m4/.cvsignore: Remove strcase.m4.
7249 * src/getargs.c: Revert 2007-02-07 change, as follows.
7250 Include c-strcase.h.
7251 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
7252
deee93a1
JD
72532007-02-11 Bruno Haible <bruno@clisp.org>
7254
7255 Enable the Java related testsuite tests when the only Java compiler
7256 found is a gcj < 4.3. Discussed at
7257 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
7258 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
7259
574add85
JD
72602007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
7261
7262 * data/Makefile.am: Update copyright date.
7263 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
7264 yypstate_new returns NULL.
7265 (yypstate_new): Return NULL if malloc does.
7266 * src/reader.c (packgram): Move translation of rule actions from the
7267 beginning of packgram to...
7268 (check_and_convert_grammar): ... here right before packgram is invoked
7269 so it's easier to write more complete comments, and remove redundant
7270 code.
7271
e785ccf7
JD
72722007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
7273
7274 As in semantic actions, make @$ in %initial-action, %destructor, and
7275 %printer imply %locations.
7276 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
7277 scanning @$.
7278 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
7279 (@$ in %initial-action implies %locations,
7280 @$ in %destructor implies %locations,
7281 @$ in %printer implies %locations): ... these new test cases.
7282
1cfe1ed7
PE
72832007-02-07 Paul Eggert <eggert@cs.ucla.edu>
7284
7285 Undo most of the 2007-02-03 change, switching to the strcase module
7286 now that gnulib strcase has been fixed.
7287 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
7288 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
7289 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
7290 * m4/.cvsignore: Add strcase.m4.
7291 * src/getargs.c: Revert 2007-02-03 change, as follows.
7292 Don't include c-strcase.h.
7293 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
7294 strcasecmp has "unspecified behavior" outside the POSIX locale,
7295 but it works fine in practice if at least one argument is ASCII,
7296 as is the case in Bison.
7297
0049ec86
PB
72982007-02-07 Paolo Bonzini <bonzini@gnu.org>
7299
7300 * tests/java.at: Skip tests if only one of javac/java is present.
7301 Reported by Joel E. Denny.
7302 * tests/atlocal.in: Adjust copyright years.
7303
73042007-02-05 Paolo Bonzini <bonzini@gnu.org>
7305
7306 * data/lalr1.java (Stack): Work around old verifiers that disallow
7307 access to the private fields of an inner class, from the outer class.
7308 We can make Stack's fields public because user code doesn't have access
7309 to the instance of Stack used by parse(). Reported by Paul Eggert.
7310
2c2b7220
PE
73112007-02-03 Paul Eggert <eggert@cs.ucla.edu>
7312
7313 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
7314 the right spot for these files?
7315 * bootstrap.conf (gnulib_modules): Add c-strcase.
7316 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
7317 c-strncasecmp.c.
7318 * src/getargs.c: Include c-strcase.h.
7319 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
7320 to avoid unspecified behavior.
7321
b2b81dae
JD
73222007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
7323
7324 * doc/bison.texinfo (Decl Summary): Correct typo.
7325
c1d19e10
PB
73262007-01-30 Paolo Bonzini <bonzini@gnu.org>
7327
7328 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
7329 Complain if the value does not match empty, "true" or "false".
7330 * data/c++.m4: Adjust default definitions of %define variables.
7331 * data/java.m4: Adjust default definitions of %define variables.
7332 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
7333 to above behavior.
7334 * tests/input.at (Boolean %define variables): Test new behavior.
7335
8405b70c
PB
73362007-01-29 Paolo Bonzini <bonzini@gnu.org>
7337
7338 * NEWS: Mention java.
7339 * TODO: Remove things that are done.
7340 * bootstrap.conf: Add javacomp-script and javaexec-script.
7341 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
7342
7343 * data/Makefile.am: Add new files.
7344 * data/java-skel.m4: New.
7345 * data/java.m4: New.
7346 * data/lalr1.java: New.
7347
7348 * doc/bison.texinfo: Put "A Complete C++ Example" under
7349 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
7350 under Other Languages.
7351
7352 * src/getargs.c (valid_languages): Add Java.
7353 * src/getargs.h (struct bison_language): Update size of string fields.
7354
7355 * tests/Makefile.am: Add java.at.
7356 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
7357 * tests/java.at: New.
7358 * tests/testsuite.at: Include it.
7359
3eb82471
JD
73602007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
7361
7362 Clean up.
7363 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
7364 at_directive_argv arguments so these no longer have to be global
7365 variables. Also, update the implementation for the following changes.
7366 (fail_for_at_directive_too_many_args,
7367 fail_for_at_directive_too_few_args): Add at_directive_name argument.
7368 (at_directive_name): Remove as at_directive_argv[0] will be used for
7369 this now.
7370 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
7371 for the directive name.
7372 (at_directive_argc, at_directive_argv): Make these local within
7373 skel_lex instead of global.
7374 (INITIAL): Update directive start action for above changes.
7375 (SC_AT_DIRECTIVE_ARG): Rename to...
7376 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
7377 (SC_AT_DIRECTIVE_SKIP_WS): Update.
7378 (scan_skel): Move yylex_destroy to...
7379 (skel_scanner_free): ... here.
7380 * tests/skeletons.at (installed skeleton file name): Rename to...
7381 (installed skeleton file names): ... this.
7382
148d66d8
JD
73832007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
7384
7385 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
7386 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
7387 Summary" not "Directives".
7388 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
7389 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
7390 since the former is now the more complete one.
7391 (Prologue Alternatives): Likewise and do the same for %defines.
7392 (Table of Symbols): Add summary of %code, add summary of %define, and
7393 move full %code documentation to...
7394 (Decl Summary): ... here for consistency with other entries in these
7395 sections.
7396 Move %define entry in order to keep this list alphabetized.
7397 Reword %define entry a little to put less emphasis on the skeleton
7398 concept, which most users shouldn't have to think about.
7399
665f0c24
PE
74002007-01-26 Paul Eggert <eggert@cs.ucla.edu>
7401
7402 Adjust to recent gnulib changes.
7403 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
7404 Add string.h, string_.h, unistd_.h, wchar_.h.
7405 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
7406 * src/system.h: Don't include <stpcpy.h>; this is now done by
7407 <string.h>.
7408
592d0b1e
PB
74092007-01-23 Paolo Bonzini <bonzini@gnu.org>
7410
7411 Simplify implementation of unqualified %code, implement macros for
7412 uniform treatment of boolean %define flags. Document %define.
7413 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
7414 b4_percent_code_ifdef): New.
7415 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
7416 * data/c++.m4: Define default value for global_tokens_and_yystype.
7417 * data/glr.cc: Likewise.
7418 * data/location.cc: Use b4_percent_define_flag_if.
7419
148d66d8 7420 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
7421
7422 * src/parse-gram.y (Unqualified %code): Change muscle name to
7423 b4_percent_code().
7424 (content.opt): Default to empty.
7425
a7867f53
JD
74262007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
7427
7428 Implement support for relative and absolute skeleton file names.
7429 Discussed starting at
7430 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
7431 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
7432 (Bison Options): Document in --skeleton entry.
7433 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
7434 full_skeleton can't necessarily hold all of pkgdatadir.
7435 If the specified skeleton file name contains a `/', don't prepend
7436 pkgdatadir.
7437 * src/parse-gram.y (prologue_declaration): If the specified skeleton
7438 file name contains a `/', prepend the grammar file directory.
7439 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
7440 * skeletons.at: New file.
7441 (relative skeleton file names): New test case.
7442 (installed skeleton file names): New test case.
7443 * tests/testsuite.at: Include skeletons.at.
7444
7445 * bootstrap: Update copyright to 2007.
7446
830c9b18
PB
74472007-01-17 Paolo Bonzini <bonzini@gnu.org>
7448
7449 * bootstrap: Remove occurrences of .#bootmp from the files.
7450
a8c2e813
AD
74512007-01-17 Akim Demaille <akim@epita.fr>
7452
7453 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
7454 nonterminals.
7455 Use per-type %printer.
7456
279cabb6
JD
74572007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
7458
7459 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
7460 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
7461 djgpp/config.site, src/files.c, src/files.h, src/main.c,
7462 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
7463 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
7464 tests/glr-regression.at, tests/input.at, tests/local.at,
7465 tests/output.at, tests/torture.at: Update copyright to 2007.
7466
bb32f4f2
AD
74672007-01-16 Akim Demaille <akim@epita.fr>
7468
7469 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
7470 error code.
7471 (Calc++ Scanner): Exit with failure if we can't open the input
7472 file.
7473 Accept "-" standing for stdin.
7474 (Calc++ Top Level): Print the result only if the parsing was
7475 successful.
7476
7cff04b5
AD
74772007-01-16 Akim Demaille <akim@epita.fr>
7478
7479 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
7480
a4e25e1d
JD
74812007-01-15 Paolo Bonzini <bonzini@gnu.org>
7482 and Joel E. Denny <jdenny@ces.clemson.edu>
7483
7484 Clean up %define and %code implementation in M4 some. Most
7485 importantly, rename all related macros to be in the b4_percent_define
7486 and b4_percent_code namespaces. Also, complete support for `.' in
7487 %define variable names and %code qualifiers.
7488 * data/bison.m4 (b4_check_user_names): Check for special
7489 "SKELETON-NAMESPACE(name)" macros instead of using two nested
7490 m4_foreach loops.
7491 (b4_get_percent_define, b4_get_percent_code): Rename to...
7492 (b4_percent_define_get, b4_percent_code_get): ... these.
7493 Extend documentation with examples.
7494 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
7495 b4_percent_define_skeleton_variables and
7496 b4_percent_code_skeleton_qualifiers.
7497 Expect any value for the %define variable `foo' to be stored in the
7498 macro named `b4_percent_define(foo)'; expect any %code blocks for the
7499 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
7500 expect any unqualified %code blocks to be stored in a macro named
7501 `b4_percent_code_unqualified'.
7502 Use m4_indir so that %define variable names and %code qualifiers can
7503 contain `.', which is allowed by the grammar parser.
7504 (b4_percent_define_default): New macro to set a default value for a
7505 %define variable.
7506 (m4_wrap): Update wrapped code, and fix some underquoting.
7507 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
7508 Expect grammar uses of %define variables and %code qualifiers to be
7509 defined in b4_percent_define_user_variables and
7510 b4_percent_code_user_qualifiers.
7511 * data/c++.m4: Use b4_percent_define_default rather than
7512 m4_define_default. Fix some underquoting. Skeleton usage of %define
7513 variable define_location_comparison now implies skeleton usage of
7514 %define variable filename_type.
7515 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
7516 data/push.c, data/yacc.c: Update macro names.
7517 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
7518 muscle names.
7519
e37c665c
JMG
75202007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7521
7522 DJGPP specific issues.
7523
7524 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
7525 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
7526
7d2d521f
JD
75272007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
7528
7529 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
7530 run parsers in all tests so that Valgrind is invoked during
7531 maintainer-check-valgrind.
7532 (Duplicate representation of merged trees): Free all semantic values.
7533 (Duplicated user destructor for lookahead): Likewise.
7534
e0ac9b4b
JD
75352007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
7536
7537 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
7538 command-line prefix.
7539 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
7540 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
7541 miss Valgrind messages.
7542 (Exploding the Stack Size with Malloc): Likewise.
7543
78143faa
JD
75442007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
7545
7546 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
7547 locals. Reported by Juan Manuel Guerrero at
7548 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
7549 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
7550 Fix some indentation also.
7551 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
7552 explaining this issue.
7553
7ecec4dd
JD
75542007-01-09 Paolo Bonzini <bonzini@gnu.org>
7555 and Joel E. Denny <jdenny@ces.clemson.edu>
7556
7557 Simplify union and prologue handling, and escape union and lex/parse
7558 params with digraphs.
7559 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
7560 values to the empty string since these are no longer guaranteed
7561 initialized by the front-end.
7562 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
7563 braces around b4_user_stype since this is no longer done by the
7564 front-end.
7565 * src/files.c, src/files.h (pre_prologue_obstack,
7566 post_prologue_obstack): Remove.
7567 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
7568 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
7569 with digraphs. This fixes lex params and parse params.
7570 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
7571 * src/output.c (prepare): Remove muscle insertion of the prologues.
7572 (output): Remove freeing of pre_prologue_obstack and
7573 post_prologue_obstack.
7574 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
7575 than prologue_augment for prologue parsing so you don't need prologue
7576 obstacks.
5c80250c
JD
7577 (grammar_declaration): For %union RHS, use `braceless' instead of
7578 "{...}" so that braces are already stripped and code is escaped with
7579 digraphs.
7ecec4dd
JD
7580 * src/reader.c (prologue_augment): Remove.
7581 (reader): Remove initialization of pre_prologue_obstack and
7582 post_prologue_obstack.
7583 * src/reader.h (prologue_augment): Remove.
7584
7585 * data/c.m4: Remove stray parenthesis.
7586
16dc6a9e
JD
75872007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
7588
7589 Remove quotes from variables names in %define directives and from
7590 qualifiers in %code directives, and restrict the characters that are
7591 allowed in them to M4-friendly ones. For %define, continue to support
7592 the quoted form as a deprecated feature. Discussed starting at
7593 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
7594 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
7595 %code.
7596 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
7597 (Decl Summary): In %defines entry, update mention of `%code requires'
7598 and `%code provides'.
16dc6a9e
JD
7599 (C++ Location Values): Update %define uses.
7600 (Calc++ Parser Interface): Likewise.
7601 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 7602 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
7603 * src/parse-gram.y (prologue_declaration): For %define variables, use
7604 `variable' instead of `STRING'.
7605 (grammar_declaration): For %code qualifiers, use `ID' instead of
7606 `STRING'.
7607 (variable): New nonterminal that takes an `ID' or a `STRING'.
7608 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
7609 and %define uses.
7610 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
7611 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
7612 (%define errors): Update %define uses.
7613
e9813cd4
JD
76142007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
7615
7616 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
7617 instead of muscle_insert for %define values so that M4-special
7618 characters are replaced with digraphs.
7619 * tests/input.at (%define errors): Extend to check weird values.
7620
6afc30cc
JD
76212007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
7622
7623 Instead of having skeletons declare all valid %define variables and
7624 %code qualifiers, provide macros that retrieve the associated values
7625 and build these lists automatically. Thus Bison will now warn when a
7626 variable or qualifier is not used by the skeleton in the current
7627 invocation regardless of whether it might sometimes be used by that
7628 skeleton in other invocations. Also, move all %define value macros to
7629 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
7630 form, which is replaced by %code.
7631 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
7632 (b4_check_user_names): ... this, and change the series of valid name
7633 arguments to a single list argument for names used in the skeleton
7634 similar to the existing list argument for names used in the grammar.
7635 Warn instead of complaining.
7636 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
7637 values and %code code, to format %code code properly, and to build
7638 lists of all %define variables and %code qualifiers used in the
7639 skeleton: b4_skeleton_percent_define_variables and
7640 b4_skeleton_percent_code_qualifiers.
7641 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
7642 Remove, and...
7643 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
7644 the skeleton names lists can finish building first. In place of
7645 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
7646 expect the lists b4_user_percent_define_variables and
7647 b4_user_percent_code_qualifiers.
7648 * data/c++.m4: Where setting default values for b4_parser_class_name,
7649 b4_location_type, b4_filename_type, b4_namespace, and
7650 b4_define_location_comparison, update their names to the
7651 b4_percent_define_ namespace.
7652 * data/glr.c: Don't use b4_check_percent_define_variables and
7653 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
7654 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
7655 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 7656 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
7657 * data/location.cc: Use b4_get_percent_define.
7658 * data/push.c: Don't use b4_check_percent_define_variables and
7659 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
7660 * data/yacc.c: Likewise, and don't call m4_exit in
7661 b4_use_push_for_pull_if or m4_wrap code will never execute.
7662 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
7663 Rename to...
7664 (muscle_grow_user_name_list): ... this for consistency with the
7665 terminology used in bison.m4.
7666 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
7667 %define variable names, and rename muscle used_percent_define_variables
7668 to user_percent_define_variables.
7669 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
7670 user_percent_code_qualifiers.
7671 (content): Remove.
7672 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
7673 {CODE} form is no longer accepted.
7674 * tests/input.at (Reject bad %code qualifiers): Rename to...
7675 (Reject unused %code qualifiers): ... this, and update test output.
7676 (%define error): Update test output.
7677
7eb8a0bc
JD
76782007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
7679
7680 Check for unrecognized %define variables similar to checking for
7681 unrecognized %code qualifiers. Check for redefined %define variables.
7682 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
7683 generalizes...
7684 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
7685 (b4_check_percent_define_variables): New, also wraps it.
7686 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
7687 variables using b4_check_percent_define_variables.
7688 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
7689 all those exercised in the test suite and all those listed in the
7690 `Default values' section of c++.m4. Are there others?
7691 * data/push.c, data/yacc.c: Declare no valid %define variables.
7692 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
7693 similar to muscle_find, but it works even when the muscle stores a
7694 const value.
7695 (muscle_grow_used_name_list): New function for constructing the used
7696 name list muscles that b4_check_for_unrecognized_names requires.
7697 * src/parse-gram.y (prologue_declaration): Warn if a variable is
7698 %define'd more than once. Define the b4_used_percent_define_variables
7699 muscle with muscle_grow_used_name_list.
7700 (grammar_declaration): Abbreviate %code code with
7701 muscle_grow_used_name_list.
7702 * tests/input.at (%define errors): New.
7703
3fc65ead
JD
77042007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7705
7706 Provide warn_at, complain_at, and fatal_at function callbacks to the
7707 skeletons, and use this for %code qualifier complaints.
7708 * data/bison.m4 (b4_error_at): New, invoked by...
7709 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
7710 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
7711 @fatal_at(...@) directives.
7712 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
7713 qualifiers in b4_used_percent_code_qualifiers and to use
7714 b4_complain_at.
7715 * src/location.c, src/location.h (boundary_set_from_string): New global
7716 function.
7717 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
7718 function.
7719 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
7720 to b4_used_percent_code_qualifiers.
7721 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
7722 function.
7723 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
7724 (lineno): Rename to...
7725 (out_lineno): ... this so I don't misunderstand it again.
7726 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
7727 here; these newlines are in the input but not the output file.
7728 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
7729 (at_directive_perform): ... this new static function, and add handling
7730 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
7731 directives.
7732 * tests/input.at (Reject bad %code qualifiers): Update test output with
7733 locations and extend.
7734
7735 * tests/output.at (Output file name: [, Output file name: ]): Remove
7736 bogus comment about these tests failing.
7737
1c7b7e1d
JD
77382007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7739
7740 Clean up b4_check_percent_code_qualifiers a little.
7741 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
7742 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
7743 documentation and add examples.
7744 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
7745 qualifiers here.
7746
08af01c2
JD
77472007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
7748
7749 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
7750 unreliable -- especially when they're hidden inside another macro.
7751 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
7752 data/c.m4: Remove m4_divert(-1).
7753 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
7754 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
7755 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 7756 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
7757 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
7758 pushed and popped by m4sugar, should be first on the stack.
7759
7760 Provide warn, complain, and fatal function callbacks to the skeletons.
7761 This provides more flexibility than m4_fatal, improves the error
7762 message format, and captures messages for translation. Discussed
7763 starting at
7764 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
7765 * data/bison.m4 (b4_error): New, invoked by...
7766 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
7767 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
7768 directives. Because these M4 macros might be called when the current
7769 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
7770 the previous removal of uses of m4_divert, which caused trouble.
7771 (b4_check_percent_code_qualifiers): Use b4_complain instead of
7772 m4_fatal to report unrecognized %code qualifiers.
7773 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
7774 push parser requests.
7775 * data/glr.c: Use b4_complain instead of m4_fatal to report
7776 non-deterministic push parser requests.
7777 Update @output usage to @output(...@) form.
7778 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
7779 report missing %defines. Update @output usage to @output(...@) form.
7780 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
7781 @output(...@) form.
7782 * src/main.c (main): Invoke skel_scanner_free.
7783 * src/scan-skel.h (skel_scanner_free): Prototype new function.
7784 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
7785 obstack_for_string from flex-scanner.h.
7786 (YY_DECL): Use to declare skel_lex static.
7787 (decode_at_digraphs): Remove; now handled in the new
7788 SC_AT_DIRECTIVE_ARG start condition.
7789 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
7790 functions.
7791 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
7792 at_directive_argv): New static globals.
7793 (INITIAL): Use fail_for_invalid_at.
7794 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
7795 recognize the start of a generalized `@directive(...@)' form and
7796 start...
7797 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
7798 directive args (using the new obstack_for_string), to decode the
7799 contained @ diagraphs, and to perform the directive. It recognizes
7800 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
7801 @output(...@).
7802 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
7803 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
7804 `@,'.
7805 (scan_skel): Initialize obstack_for_string on the first call.
7806 (skel_scanner_free): New function to free obstack_for_string.
7807 * tests/input.at (Reject bad %code qualifiers): Update test output.
7808
8e0a5e9e
JD
78092007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
7810
7811 Consolidate the 4 prologue alternative directives (%code, %requires,
7812 %provides, and %code-top) into a single %code directive with an
7813 optional qualifier field. Discussed at
7814 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
7815 * NEWS (2.3a+): Rewrite the existing entry for the prologue
7816 alternatives.
7817 * doc/bison.texinfo (Prologue Alternatives): Update.
7818 (Decl Summary): Update to %code "requires" and %code "provides".
7819 (Calc++ Parser): Update to %code "requires".
148d66d8 7820 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
7821 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
7822 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
7823 are replaced by b4_percent_code_provides and b4_percent_code_requires,
7824 which are skeleton-specific.
7825 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
7826 declare what %code qualifiers it supports and to complain if any other
7827 qualifiers were used in the grammar.
7828 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
7829 and b4_user_code([b4_percent_code_provides]) in place of
7830 b4_user_requires and b4_user_provides.
7831 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
7832 Add b4_user_code([b4_percent_code_top]) and
7833 b4_user_code([b4_percent_code]).
7834 Invoke b4_check_percent_code_qualifiers.
7835 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
7836 PERCENT_REQUIRES): Remove.
7837 (grammar_declaration): Remove RHS's for %code-top, %provides, and
7838 %requires. Rewrite the %code RHS as the unqualified form defining the
7839 muscle b4_percent_code. Add another RHS for the qualified %code form,
7840 which defines muscles of the form b4_percent_code_QUALIFIER and the
7841 b4_used_percent_code_qualifiers muscle.
7842 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
7843 PERCENT_REQUIRES): Remove.
7844 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
7845 %code "requires" and %code "provides".
7846 * tests/input.at (Reject bad %code qualifiers): New.
7847
95021767
JD
78482007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
7849
7850 Use the new code_props interface for destructors and printers.
7851 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
7852 printer_location members, and change the type of the destructor and
7853 printer members to code_props.
7854 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
7855 symbol_printer_get, semantic_type_destructor_set,
7856 semantic_type_printer_set, default_tagged_destructor_set,
7857 default_tagless_destructor_set, default_tagged_printer_set,
7858 default_tagless_printer_set): Use code_props in arguments and return
7859 types in place of char const * and location.
7860 (symbol_destructor_location_get, symbol_printer_location_get): Remove
7861 since the locations are now contained in the return of
7862 symbol_destructor_get and symbol_printer_get.
7863 * src/output.c (symbol_destructors_output, symbol_printers_output):
7864 Replace with...
7865 (symbol_code_props_output): ... this to eliminate duplicate code.
7866 (output_skeleton): Update to use symbol_code_props_output.
7867 * src/reader.c (symbol_should_be_used): Update use of
7868 symbol_destructor_get.
7869 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
7870 Update uses of the various _destructor_set and _printer_set functions.
7871 * src/symtab.c: (default_tagged_destructor_location,
7872 default_tagless_destructor_location, default_tagged_printer_location,
7873 default_tagless_printer_location): Remove since we...
7874 (default_tagged_destructor, default_tagless_destructor,
7875 default_tagged_printer, default_tagless_printer): ... change the type
7876 of these to code_props.
7877 (symbol_new, semantic_type_new, symbol_destructor_set,
7878 semantic_type_destructor_set, symbol_destructor_get,
7879 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
7880 symbol_check_alias_consistency, default_tagged_destructor_set,
7881 default_tagless_destructor_set, default_tagged_printer_set,
7882 default_tagless_printer_set): Update.
7883 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
7884 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
7885 code_props members.
7886 (symbol_print): Use SYMBOL_CODE_PRINT.
7887
f6857bbf
JD
78882007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
7889
7890 Use the new code_props interface for rule actions.
7891 * src/symlist.h (symbol_list): Replace action, action_location, and
7892 used members with a code_props action_props member.
7893 * src/reader.c (symbol_should_be_used, grammar_rule_check,
7894 grammar_midrule_action, grammar_current_rule_merge_set,
7895 grammar_current_rule_symbol_append, packgram): Update.
7896 * src/scan-code.h (translate_rule_action): Remove, no longer used.
7897 * src/scan-code.l (handle_action_dollar): Update.
7898 (translate_rule_action): Remove, no longer used.
7899 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
7900
7c0c6181
JD
79012007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7902
7903 Use the new code_props interface in parse-gram.y.
7904 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
7905 Update all uses of translate_* functions to use the new code_props
7906 interface and to use gram_scanner_last_string_free and
7907 code_scanner_last_string_free where possible.
7908 (grammar_declaration): symbol_list_destructor_set and
7909 symbol_list_printer_set now perform the translation, so don't do it
7910 here. Use gram_scanner_last_string_free where possible.
7911 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
7912 translate_code): Remove, no longer used.
7913 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
7914 symbol_list_printer_set): Perform code translation here rather than
7915 depending on the caller to do so.
7916
7917 * src/symlist.h (struct symbol_list): Correct some documentation typos.
7918 * src/scan-gram.h (gram_last_string): Remove declaration.
7919 * src/scan-gram.l (last_string): Declare it static.
7920
28e52c0d
JD
79212007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7922
7923 Encapsulate code properties and related functionality for the various
7924 destructors, printers, and actions into a code_props structure and
7925 interface. This patch merely implements code_props in scan-code.h and
7926 scan-code.l. Future patches will rewrite other modules to use it.
7927 Discussed starting at
7928 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
7929 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
7930 consistently initialize const structs that have an empty location
7931 field.
7932 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
7933 to ensure consistency.
7934 * src/scan-code.h (code_props): New structure.
7935 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
7936 function, macro, and const global variable for initializing a
7937 code_props with no code.
7938 (code_props_plain_init, code_props_symbol_action_init,
7939 code_props_rule_action_init, code_props_translate_code): The rest of
7940 the new code_props functional interface. Among other things, the init
7941 functions set the code_props kind field so that
7942 code_props_translate_code will know whether to behave like
7943 translate_symbol_action, translate_rule_action, or translate_code.
7944 These old translate functions must remain until all other modules are
7945 updated to use the new code_props interface.
7946 (code_scanner_last_string_free): New function similar to
7947 gram_scanner_last_string_free.
7948 (code_scanner_free): Add documentation.
7949 * src/scan-code.l: Implement the new interface.
7950 (code_lex): Make it static, add a code_props* argument, and remove the
7951 rule argument.
7952 (last_string): New static global similar to the one in scan-gram.l.
7953 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
7954 instead of rule.
7955 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
7956 code_props since Bison may one day use this information for destructors
7957 and printers.
7958 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
7959 (handle_action_dollar): Use symbol_list_n_get and set used flag
7960 directly since symbol_list_n_used_set is removed.
7961 (translate_action): Add a code_props* argument and remove the rule,
7962 action, and location arguments. Pass the code_props* on to code_lex.
7963 (translate_rule_action, translate_symbol_action, translate_code):
7964 Rewrite as wrappers around the new code_props interface.
7965 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
7966 it would eventually need to break the encapsulation of code_props.
7967
96034983
JD
79682007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
7969
7970 * etc/.cvsignore: New.
7971
945e396c
JD
79722007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
7973
7974 Add maintainer-push-check to run maintainer-check using push parsing in
7975 place of pull parsing where available.
7976 * Makefile.am (maintainer-push-check): New.
7977 * data/bison.m4 (b4_use_push_for_pull_if): New.
7978 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
7979 appropriately based on their existing values.
7980 (yypush_parse): Don't print push-parser-specific diagnostics if push
7981 parsing is being used in place of pull parsing.
7982 * data/yacc.c: If push parsing should replace pull parsing, redirect to
7983 push.c.
7984 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
7985 variable, and insert b4_use_push_for_pull_flag into muscles.
7986 * tests/Makefile.am (maintainer-push-check): New.
7987
7d596384
JD
79882006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
7989
7990 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
7991 (whether successful or failed) so that yypush_parse can be invoked
7992 again to start a new parse using the same yypstate.
7993 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
7994 check multiple yypull_parse invocations on the same yypstate. For pull
7995 mode, extend to check multiple yyparse invocations.
7996 (Exploding the Stack Size with Alloca): Extend to try with
7997 %push-pull-parser.
7998 (Exploding the Stack Size with Malloc): Likewise.
7999
8000 * tests/calc.at (Simple LALR Calculator): Don't specify
8001 %skeleton "push.c" since %push-pull-parser implies that now.
8002 * tests/headers.at (export YYLTYPE): Don't check for the push
8003 declarations. Otherwise, this test case can't be used to see if push
8004 mode can truly emulate pull mode.
8005 * tests/input.at (Torturing the Scanner): Likewise.
8006 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
8007 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
8008 AT_YACC_IF, which now includes the case of push mode since %skeleton
8009 need not be used for push mode. This will be more intuitive once
8010 push.c is renamed to yacc.c.
8011
7172e23e
JD
80122006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
8013
8014 For push mode, convert yyparse from a macro to a function, invoke yylex
8015 instead of passing a yylexp argument to yypull_parse, and don't
8016 generate yypull_parse or yyparse unless %push-pull-parser is declared.
8017 Discussed starting at
8018 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
8019 * data/bison.m4 (b4_pull_if): New.
8020 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
8021 * data/push.c: Improve M4 quoting a little.
8022 (b4_generate_macro_args, b4_parenthesize): Remove.
8023 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
8024 any time a pull parser is requested.
8025 Don't #define this as a wrapper around yypull_parse. Instead, when
8026 both push and pull are requested, make it a function that does that
8027 same thing.
8028 (yypull_parse): If there's a b4_prefix, #define this to
8029 b4_prefix[pull_parse] when both push and pull are requested.
8030 Don't define this as a function unless both push and pull are
8031 requested.
8032 Remove the yylexp argument and hard-code yylex invocation instead.
8033 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
8034 %push-parser.
8035 * src/getargs.c (pull_parser): New global initialized to true.
8036 * getargs.h (pull_parser): extern it.
8037 * src/output.c (prepare): Insert pull_flag muscle.
8038 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
8039 (prologue_declaration): Set both push_parser and pull_parser = true for
8040 %push-pull-parser. Set push_parser = true and pull_parser = false for
8041 %push-parser.
8042 * src/scan-gram.l: Don't accept %push_parser as an alternative to
8043 %push-parser since there's no backward-compatibility concern here.
8044 Scan %push-pull-parser.
8045 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
8046 instead of %push-parser.
8047 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
8048 prototype it in the module that calls yyparse.
8049 * tests/input.at (Torturing the Scanner): Likewise.
8050 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
8051
2e7944cb
JD
80522006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
8053
8054 Update etc/bench.pl. Optimize push mode a little (the yyn change
8055 deserves most of the credit).
8056 * Makefile.am (SUBDIRS): Add etc subdirectory.
8057 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
8058 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
8059 yytoken, yyval, and yyloc declarations to...
8060 (yyparse or yypush_parse): ... here to improve performance. For
8061 yypush_parse invocations after the first, be sure to assign yyn its old
8062 value again.
8063 (yypstate_new): Don't bother initializing the yyresult field since the
8064 initial value isn't used.
8065 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
8066 remove the #define that, in push mode, set it to yyps->NAME.
8067 * etc/Makefile.am: New.
8068 * etc/bench.pl: Remove and build it instead from...
8069 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
8070 "tests/bison" from the build directory by default rather than just
8071 invoking "bison" from $PATH.
8072 (calc_grammar): Update push parser code: don't declare yylval globally,
8073 don't define yyparse_wrapper, and don't #define yyparse.
8074 (bench_grammar): Update to check all working combinations of yacc.c,
8075 push.c, impure, pure, pull, and push.
8076
c3d50342
JD
80772006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
8078
8079 For push mode, add pull wrappers around yypush_parse.
8080 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
8081 (yypull_parse): New function wrapping yypush_parse.
8082 (yyparse): New #define wrapping yypull_parse.
8083 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
8084 is declared.
8085 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
8086 prototype yylex in the module that calls yyparse, and don't prototype
8087 yyparse there. Otherwise, the yyparse expansion won't compile.
8088 * tests/input.at (Torturing the Scanner): Likewise.
8089
94ebeba5
JD
80902006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
8091
8092 Enable push parsers to operate in impure mode. Thus, %push-parser no
8093 longer implies %pure-parser. The point of this change is to move
8094 towards being able to test the push parser code by running the entire
8095 test suite as if %push-parser had been declared.
8096 * data/push.c (yypush_parse): For impure mode, remove the
8097 yypushed_char, yypushed_val, and yypushed_loc arguments.
8098 Instead, declare these as local variables initialized to the global
8099 yychar, yylval, and yylloc.
8100 For the first yypush_parse invocation only, restore the initial values
8101 of these global variables when it's time to read a token since they
8102 have been overwritten.
8103 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
8104 %push-parser.
8105 * tests/calc.at (Simple LALR(1) Calculator): Always declare
8106 %pure-parser along with %push-parser since this test case was designed
8107 for pure push parsers.
8108 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
8109 (AT_YACC_OR_PUSH_IF): New.
8110 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
8111 add a note that it's still wrong for some cases (as it has been for a
8112 while).
8113 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
8114 %push-parser no longer implies %pure-parser.
8115
a0633178
JD
81162006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
8117
8118 Remove some unnecessary differences between the pull parser code and
8119 the push parser code. This patch enables yynerrs in push mode.
8120 * data/push.c: Reformat M4 a little.
8121 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
8122 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
8123 because push mode is on. Instead, if pure mode is on, move yynerrs
8124 to...
8125 (b4_declare_parser_state_variables): ... here.
8126 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
8127 to yyps->NAME so it can be used in yypush_parse.
8128 (yypush_parse): Don't omit uses of yynerrs in push mode.
8129
8646b6a3
JD
81302006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
8131
8132 Fix bug such that the first pushed token's value and location are
8133 sometimes overwritten (sometimes by %initial-action) before being used.
8134 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
8135 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
8136 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
8137 more closely mimic the pull parser logic.
8138 Don't copy the pushed token to yychar, yylval, and yylloc until it's
8139 time to read a token, which is after any initialization of yylval and
8140 yylloc.
8141 (gottoken): Rename label to...
8142 (yyread_pushed_token): ... for clarity and to avoid infringing on the
8143 user namespace.
8144
9baf4d74
JD
81452006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
8146
8147 Rearrange initialization of the parser state variables so that the
8148 skeleton doesn't have to have a copy for pull mode and another for push
8149 mode. This patch also fixes at least a bug such that yylloc was not
8150 initialized (with b4_location_initial_line and
8151 b4_location_initial_column) upon calling yypush_parse. However, that
8152 initialization now overwrites the first token's location;
8153 %initial-action assigning @$ already did the same thing, and both bugs
8154 will be fixed in a later patch.
8155 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
8156 (b4_declare_parser_state_variables): Remove initialization of yytoken,
8157 yyss, yyvs, yyls, and yystacksize.
8158 (yypstate_new): Remove initialization of some yypstate fields: yystate,
8159 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
8160 yylsp.
8161 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
8162 yyps->NAME so it can be used in yypush_parse.
8163 (yyparse or yypush_parse): For yypush_parse, don't print the
8164 "Starting parse" diagnostic for invocations after the first.
8165 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
8166 yypush_parse, only do it for the first invocation.
8167 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
8168 initialization to occur in yypush_parse but only on the first
8169 invocation.
8170
23522164
JD
81712006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
8172
8173 * data/push.c: Add CPP guards around push parser declarations in both
8174 the header and the code file.
8175 In the code file, move the push parser declarations to the same place
8176 they appear in the header file.
8177 Clean up the M4 some, especially the inconsistent underquoting in
8178 some b4_c_function_def and b4_c_function_decl uses.
8179
bb010fe5
JD
81802006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
8181
8182 Encapsulate the push parser state variables into an M4 macro so the
8183 push skeleton doesn't have to list them again for pull mode's yyparse.
8184 For push mode, remove yypush_parse's local equivalents of these
8185 variables to eliminate unnecessary copying between the two sets at
8186 run-time. This patch also fixes at least a bug related to multiple
8187 %initial-action invocations in push mode.
8188 * data/push.c (b4_declare_parser_variables): Rename to...
8189 (b4_declare_scanner_communication_variables): ... this for clarity and
8190 update both uses.
8191 (b4_declare_yyparse_variables): Remove and move its contents to the one
8192 spot where it was invoked.
8193 (b4_declare_parser_state_variables): New macro containing the parser
8194 state variables required by push mode.
8195 (struct yypstate): Replace all fields but yynew with
8196 b4_declare_parser_state_variables.
8197 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
8198 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
8199 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
8200 (yyparse or yypush_parse): For yyparse in pull mode, replace local
8201 parser state variable declarations with
8202 b4_declare_parser_state_variables.
8203 Don't initialize parser state variables when calling yypush_parse since
8204 yypstate_new already does that.
8205 Invoke the user's initial action only upon the first yypush_parse
8206 invocation.
8207 Remove all code that copies between the local parser state variables
8208 and the yypstate.
8209
2d212f8c
JD
82102006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
8211
8212 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
8213 prevent a name collision in a future patch where these names will
8214 sometimes be #define'd.
8215 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
8216 since it no longer has the same name as the existing argument.
8217 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
8218
e6e704dc
JD
82192006-12-19 Paolo Bonzini <bonzini@gnu.org>
8220 and Joel E. Denny <jdenny@ces.clemson.edu>
8221
8222 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
8223 that the argument is case-insensitive, and there's no `=' here.
8224 For the %skeleton entry, mention that %language is better.
8225 (Bison Options): Likewise for --language and --skeleton. Move the
8226 --skeleton entry so that the `Tuning the parser' section is sorted
8227 alphabetically on long options.
8228 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
8229 %language directive in detail here; cross-reference the %language
8230 documentation instead.
8231 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
8232 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 8233 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
8234 * examples/extexi (normalize): Instead of replacing every %require
8235 argument with the current Bison version, just substitute for
8236 `@value{VERSION}'. This guarantees that we're testing what actually
8237 appears in the documentation.
8238 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
8239 rather than `@VERSION@'.
8240
0e021770
PE
82412006-12-18 Paul Eggert <eggert@cs.ucla.edu>
8242
fd575f05
PE
8243 * NEWS: Reword the %language news a bit, and put it earlier.
8244
0e021770
PE
8245 * src/getargs.c (skeleton_arg): Last arg is now location const *.
8246 Rewrite to simplify the logic.
8247 (language_argmatch): Likewise.
fd575f05
PE
8248 (program_name): We now own this var.
8249 * src/getargs.h (struct bison_language): Use char[] rather than
8250 const char *.
0e021770
PE
8251
8252 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
8253 Java is supported.
8254 * src/complain.c (program_name): Remove decl; no longer needed.
8255 * src/main.c (program_name): Remove; now belongs to getargs.
8256
82572006-12-18 Paolo Bonzini <bonzini@gnu.org>
8258
8259 * NEWS: Document %language.
8260
8261 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
8262
8263 * data/c-skel.m4, data/c++-skel.m4: New files.
8264 * data/glr.c: Complain on push parsers.
8265
8266 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
8267 over %skeleton.
148d66d8 8268 (Decl Summary): Document %language and %skeleton.
0e021770
PE
8269 (Command line): Document -L.
8270
8271 * examples/extexi: Rewrite %require directive.
8272 * examples/calc++/Makefile.am: Pass VERSION to extexi.
8273
8274 * src/files.c (compute_exts_from_gc): Look in language structure
8275 for .y extension.
8276 (compute_file_name_parts): Check whether .tab should be added.
8277 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
8278 (language, skeleton_arg, language_argmatch): New.
8279 (long_options): Add --language.
8280 (getargs): Use skeleton_arg, add -L/--language.
8281 * src/getargs.h: Include location.h.
8282 (struct bison_language, language, skeleton_arg, language_argmatch): New.
8283 * src/output.c (prepare): Pick default skeleton from struct language.
8284 Don't dispatch C skeletons here.
8285 * src/parse-gram.y (PERCENT_LANGUAGE): New.
8286 (prologue_declaration): Add "%language" rule, use skeleton_arg.
8287 * src/scan-gram.l ("%language"): New rule.
8288
8289 * tests/calc.at: Test %skeleton and %language.
8290 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
8291 (AT_GLR_IF): Look for %skeleton "glr.cc".
8292 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
8293 (AT_YACC_IF): Reject %language.
8294
5691bf57
PE
82952006-12-18 Paul Eggert <eggert@cs.ucla.edu>
8296
db06f0ce
PE
8297 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
8298 since it wasn't used; only the typedef name 'semantic_type' is needed.
8299 Also, omit trailing white space.
8300
5691bf57
PE
8301 * bootstrap: Sync from coreutils.
8302 (gnulib_extra_files): Add build-aux/announce.gen.
8303 (slurp): Adjust .gitignore files like .cvsignore files.
8304 * build-aux/announce-gen: Remove from CVS, since bootstrap
8305 now creates this.
8306
791934e4
JD
83072006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
8308
8309 Make %push-parser imply %pure-parser. This fixes several bugs; see
8310 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
8311 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
8312 pure_parser = true.
8313 * data/push.c: Don't bother testing b4_push_if when deciding whether
8314 to expand b4_declare_parser_variables globally.
8315 (yypush_parse): Likewise in here.
8316
8317 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
8318 (yy_reduce_print): Reformat M4 for readability.
8319
ee5abb37
JD
83202006-12-15 Bob Rossi <bob@brasko.net>
8321 and Joel Denny <jdenny@ces.clemson.edu>
8322
8323 * data/push.c (yypstate): Add typedef, and update all uses of
8324 struct yypstate to just yypstate.
8325 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
8326
16ca01f9
JD
83272006-12-14 Bob Rossi <bob@brasko.net>
8328
8329 * data/push.c (yypush_parse): Declare prototype regardless of
8330 %locations option.
8331
ab8e7e1a
JD
83322006-12-14 Bob Rossi <bob@brasko.net>
8333
8334 * data/push.c (yyparse): Remove the prototype and the #define when in
8335 push-parser mode.
8336
9bf32be3
JD
83372006-12-13 Bob Rossi <bob@brasko.net>
8338
8339 * data/push.c (yypstate_init): Rename to...
8340 (yypstate_new): ... this and use b4_c_function_def.
8341 (yypstate_delete): New.
8342 (yypush_parse): Change parameters yynval and yynlloc to be const.
8343 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
8344 yypstate_delete functions.
8345
f02e2948
JD
83462006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
8347
8348 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
8349 strange test case titles. Reported by Bob Rossi.
8350
38eb7751
PE
83512006-12-13 Paul Eggert <eggert@cs.ucla.edu>
8352
8353 * TODO: Add pointer to Sylvain Schmitz's work on static detection
8354 of potential ambiguities in GLR grammers.
8355
bd9d212b
JD
83562006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
8357
8358 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
8359 `bison ', use m4_index instead of m4_substr since chopping up a string
8360 containing M4-special characters causes problems here.
8361
8362 Fix a couple of bugs related to special characters in user-specified
8363 file names, and make it easier for skeletons to compute output file
8364 names with the same file name prefix as Bison-computed output file
8365 names.
8366 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
8367 b4_parser_file_name and b4_spec_defines_file instead of
8368 @output_parser_name@ and @output_header_name@, which are now redundant.
8369 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
8370 b4_parser_file_name, b4_spec_defines_file, and the new
8371 @basename(FILENAME@) instead of @output_parser_name@ and
8372 @output_header_name@, which inappropriately escaped the file names as
8373 C string literals.
8374 * src/files.c (all_but_ext): Remove static qualifier.
8375 (compute_output_file_names): Move `free (all_but_ext)' to...
8376 (output_file_names_free): ... here since all_but_ext is needed later.
8377 * src/files.h (all_but_ext): Extern.
8378 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
8379 exactly what MUSCLE_INSERT_STRING used to do.
8380 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
8381 characters are escaped properly.
8382 * src/output.c (prepare): Define muscle file_name_all_but_ext as
8383 all_but_ext.
8384 For pkgdatadir muscle, maintain previous functionality by using
8385 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
8386 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
8387 digraphs would never be expanded. Hopefully no one has M4-special
8388 characters in his Bison installation path.
8389 * src/scan-skel.l: Don't parse @output_header_name@ and
8390 @output_parser_name@ anymore since they're now redundant.
8391 In @output, use decode_at_digraphs.
8392 Parse a new @basename command that invokes last_component.
8393 (decode_at_digraphs): New.
8394 (BASE_QPUTS): Remove unused.
8395 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
8396 (Output file name): New tests.
8397
3f7ca628
JD
83982006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
8399
8400 Warn about output files that are generated by the skeletons and that
8401 conflict with other output files.
8402 * data/glr.c: Don't generate the header file here when glr.cc does.
8403 * src/files.c (file_names, file_names_count): New static globals.
8404 (compute_output_file_names): Invoke output_file_name_check for files
8405 not generated by the skeletons and remove existing checks.
8406 (output_file_name_check): New function that warns about conflicting
8407 output file names.
8408 (output_file_names_free): Free file_names.
8409 * src/files.h (output_file_name_check): Declare.
8410 * src/scan-skel.l: Invoke output_file_name_check for files generated by
8411 the skeletons.
8412 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
8413 (Conflicting output files): New tests.
8414
178e123e
PE
84152006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8416
8417 * doc/bison.texinfo: Fix a couple of typos.
8418
84192006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
8420
8421 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
8422 Rename to...
8423 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
8424 update all uses.
8425 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
8426 (yypush_parse): Rename yypvars argument to yyps and remove redundant
8427 local pv.
8428 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
8429 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
8430
ea17f233
JD
84312006-12-07 Bob Rossi <bob@brasko.net>
8432 and Joel Denny <jdenny@ces.clemson.edu>
8433
8434 * data/push.c (yypvarsinit): Change return type from void* to struct
8435 yypvars*. No longer cast to void* on return.
8436 (struct yypvars): Remove yylen since it need not be remembered between
8437 yypushparse invocations.
8438 (yypushparse): Don't copy between yylen and pv->yylen.
8439
55a30bda
JD
84402006-12-05 Bob Rossi <bob@brasko.net>
8441
8442 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
8443 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
8444 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
8445 (struct yypvars): Remove b4_declare_parser_variables.
8446 (yypvarsinit): Remove init code for removed variables.
8447 (global scope): Do not declare b4_declare_parser_variables if
8448 push or pure mode.
8449 (yypushparse): Add b4_declare_parser_variables.
8450 Init new local variables, and remove init code for removed
8451 yypvars variables.
8452 (yyparse): Delete.
8453 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
8454 and yyparse for other modes.
8455 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
8456 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
8457 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
8458 (AT_PURE_LEX_IF): True if pure or push parser.
8459
85894313
JD
84602006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
8461
8462 Document Yacc prologue alternatives and default %destructor's and
8463 %printer's as experimental. Don't mention Java yet. Discussed at
8464 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
8465 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
8466 (2.3a): Annotate this entry to say the old forms of these features were
8467 also experimental.
8468 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 8469 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
8470 of Java (we'll want this back eventually).
8471
02975b9a
JD
84722006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
8473
8474 Support a file name argument to %defines. Deprecate `=' in
8475 %file-prefix, %name-prefix, and %output. Discussed at
8476 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
8477 * NEWS (2.3a+): Mention.
148d66d8 8478 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
8479 form of %defines, and remove `=' from entries for %file-prefix,
8480 %name-prefix, and %output.
8481 * src/parse-gram.y (prologue_declaration): Implement.
8482 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
8483 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
8484 all but one occurrence of %name-prefix.
8485 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
8486 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
8487 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
8488 occurrence of each of %file-prefix and %output. Add check for %defines
8489 with argument.
8490 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
8491 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
8492 Remove the `=' from %output.
8493
287b314e
JD
84942006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
8495
8496 Don't escape $ in test case titles since Autoconf 2.61 now does that
8497 correctly.
8498 * tests/actions.at (Default %printer and %destructor are not for error
8499 or $undefined): Here.
8500 (Default %printer and %destructor are not for $accept): Here.
8501 * tests/input.at (Invalid $n and @n): Here.
8502
3ebecc24
JD
85032006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
8504
8505 Rename <!> to <>. Discussed starting at
8506 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
8507 * NEWS (2.3a+): Update.
148d66d8 8508 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
8509 Update.
8510 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
8511 * src/scan-gram.l (INITIAL): Implement.
8512 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
8513 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
8514 comment.
8515 * tests/actions.at (Default tagless %printer and %destructor,
8516 Default tagged and per-type %printer and %destructor,
8517 Default %printer and %destructor are not for error or $undefined,
8518 Default %printer and %destructor are not for $accept,
8519 Default %printer and %destructor for mid-rule values): Update.
8520 * tests/input.at (Default %printer and %destructor redeclared,
8521 Unused values with default %destructor): Update.
8522
26b8a438
JD
85232006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
8524
8525 Don't let %prec take a nonterminal.
8526 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
8527 token.
8528 * tests/input.at (%prec takes a token): New test checking that %prec
8529 won't take a nonterminal.
8530
07c39ae9
JD
85312006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
8532
405d53b7
JD
8533 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
8534 it was double-quoted.
07c39ae9
JD
8535 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
8536 grammar is maintained with Bison's highest standards.
8537 * src/getargs.c: Fix some typos in Doxygen comments.
8538
580b8926
JD
85392006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
8540
8541 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
8542 later. Reported by Paul Eggert in
8543 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
8544 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
8545 * src/scan-code.l (translate_action): Don't bother invoking
8546 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
8547 (code_scanner_free): Instead of invoking
8548 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
8549 which frees more.
8550 * src/scan-gram.l (gram_scanner_free): Likewise.
8551 * src/scan-skel.l (scan_skel): Likewise.
8552
4502eadc
JD
85532006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
8554
8555 * src/files.c (tr): Change return type to void.
8556 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
8557 has been called previously for the same key.
8558 (muscle_find): Return storage instead of value so that
8559 --enable-gcc-warnings doesn't produce warnings that the return discards
8560 const. aver that the value and storage are the same since storage
8561 could potentially be NULL when value is not.
8562 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
8563 same as 0.
8564
7746c8f6
PE
85652006-11-08 Paul Eggert <eggert@cs.ucla.edu>
8566
8567 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
8568 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
8569 us a slightly cleaner distribution, and also works.
8570 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
8571 gnulib changes.
8572
eb095650
PE
85732006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
8574 and Paul Eggert <eggert@cs.ucla.edu>
8575
8576 Don't let Bison leak memory except when it complains.
8577 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
8578 (spec_defines_file, dir_prefix): Now char *, not const char *,
8579 since they are freed.
8580 * src/files.c: Likewise.
8581 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
8582 Likewise.
8583 (tr): Now operates in-place. All uses changed.
8584 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
8585 values.
8586 (compute_file_name_parts, compute_output_file_names): Don't store
8587 read-only data in variables that will be freed.
8588 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
8589 src_extension, and header_extension.
8590 (output_file_names_free): New public function to free
8591 spec_verbose_file, spec_graph_file, spec_defines_file,
8592 parser_file_name, and dir_prefix.
8593 * src/getargs.c (getargs): Don't store read-only data in variables that
8594 will be freed.
8595 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
8596 (which previously existed but was unused), and quotearg_free.
8597 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
8598 * src/muscle_tab.c: Likewise.
8599 (muscle_entry): Make the value char const *,
8600 and add a new storage member that is char * and can be freed.
8601 (muscle_entry_free): New private function.
8602 (muscle_init): Use it instead of free.
8603 (muscle_insert, muscle_grow): Update and use new storage member.
8604 (muscle_code_grow): Free the string passed to muscle_grow
8605 since it's not needed anymore.
8606 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
8607 add a new `char *code' member.
8608 ("{...}"): Declare semantic type as code.
8609 * src/scan-code.h (translate_rule_action):
8610 (translate_symbol_action, translate_code, translate_action): Return
8611 `char const *' rather than `char *' since external code should not free
8612 these strings.
8613 * src/scan-code.l: Likewise.
8614 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
8615 which is "{...}" in the parser.
8616 * tests/Makefile.am (maintainer-check-valgrind): Set
8617 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
8618 Valgrind.
8619 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
8620 complain.
8621 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
8622 expecting a non-zero exit status sets --leak-check=summary and
8623 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
8624 this case, and we don't want to hear about it.
8625
ac564be4
PE
86262006-11-08 Paul Eggert <eggert@cs.ucla.edu>
8627
8628 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
8629 instead of from the template, to simplify configuration a bit.
8630 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
8631 and m4/wint_t.m4, as they are needed with the latest gnulib.
8632
17bd8a73
JD
86332006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
8634
8635 Disable unset/unused mid-rule value warnings by default, and recognize
8636 --warnings=midrule-values to enable them. Discussed starting at
8637 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
8638 * NEWS (2.3a+): Mention.
8639 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
8640 warnings): Add entry for midrule-values subargument.
8641 * src/reader.c (symbol_should_be_used): Don't return true just because
8642 the value is a set/used mid-rule value unless
8643 --warnings=midrule-values was specified.
8644 * tests/input.at (Unused values, Unused values before symbol
8645 declarations): Run tests with and without --warnings=midrule-values.
8646
8647 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
8648 than LIST_FREE directly.
8649
89eb3c76
JD
86502006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
8651
8652 Finish implementing --warnings=error, which should not be implied by
8653 --warnings=all (or by its synonyms -W and --warnings without
8654 subarguments).
8655 * src/complain.c (set_warning_issued): New function to report that
8656 warnings are being treated as errors and to record an error if so.
8657 Invoke...
8658 (warn_at, warn): ... here.
8659 * src/getargs.c (warnings_args, warnings_types): Reorder so that
8660 "error - warnings are errors" does not appear above "all - all of the
8661 above".
8662 (getargs): For -W and --warnings without subarguments, don't let
8663 FLAGS_ARGMATCH set warnings_error in warnings_flag.
8664 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
8665
ba7560e2
JD
86662006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
8667
8668 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
8669 empty subargument list. For example: `bison --warnings= parser.y'.
8670
31283fc3
JD
86712006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
8672
8673 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
8674 the parser header file so that gcc doesn't warn.
8675
12e35840
JD
86762006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
8677
8678 Split the default %destructor/%printer into two kinds: <*> and <!>.
8679 Discussed starting at
8680 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
8681 * NEWS (2.3a+): Mention.
8682 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
8683 previous change today related to mid-rules.
148d66d8 8684 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 8685 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
8686 (TYPE_TAG_ANY): Add as <*>.
8687 (TYPE_TAG_NONE): Add as <!>.
8688 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
8689 for <*> and <!>.
8690 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
8691 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
8692 * src/symlist.c (symbol_list_default_new): Split into tagged and
8693 tagless versions.
8694 (symbol_list_destructor_set, symbol_list_printer_set): Split
8695 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
8696 SYMLIST_DEFAULT_TAGLESS.
8697 * src/symlist.h: Update symbol_list_default*_new prototypes.
8698 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
8699 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
8700 * src/symtab.c (default_destructor, default_destructor_location,
8701 default_printer, default_printer_location): Split each into tagged and
8702 tagless versions.
8703 (symbol_destructor_get, symbol_destructor_location_get,
8704 symbol_printer_get, symbol_printer_location_get): Implement tagged
8705 default and tagless default cases.
8706 (default_destructor_set, default_printer_set): Split each into tagged
8707 and tagless versions.
8708 * src/symtab.h: Update prototypes.
8709 * tests/actions.at (Default %printer and %destructor): Rename to...
8710 (Default tagless %printer and %destructor): ... this, and extend.
8711 (Per-type %printer and %destructor): Rename to...
8712 (Default tagged and per-type %printer and %destructor): ... this, and
8713 extend.
8714 (Default %printer and %destructor for user-defined end token): Extend.
8715 (Default %printer and %destructor are not for error or $undefined):
8716 Update.
8717 (Default %printer and %destructor are not for $accept): Update.
8718 (Default %printer and %destructor for mid-rule values): Extend.
8719 * tests/input.at (Default %printer and %destructor redeclared): Extend.
8720 (Unused values with default %destructor): Extend.
8721
f91b1629
JD
87222006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
8723
8724 Don't apply the default %destructor/%printer to an unreferenced midrule
8725 value. Mentioned at
8726 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
8727 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
8728 like $@n instead of just @n so that the default %destructor/%printer
8729 logic doesn't see them as user-defined symbols.
8730 (symbol_is_dummy): Check for both forms of the name.
8731 * src/reader.c (packgram): Remove the `$' from each midrule symbol
8732 name for which the midrule value is referenced in any action.
8733 * tests/actions.at (Default %printer and %destructor for mid-rule
8734 values): New test.
8735 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
8736 for change to dummy symbol names.
8737
519d0004
JD
87382006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
8739
8740 Warn about unset midrule $$ if the corresponding $n is used.
8741 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
8742 $n usage.
8743 (packgram): Before invoking grammar_rule_check on any rule, make sure
8744 all actions have already been scanned in order to set `used' flags.
8745 Otherwise, checking that a midrule's $$ is set will not always work
8746 properly because the midrule check must forward-reference the midrule's
8747 parent rule.
8748 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
8749 warning.
8750
a501eca9
JD
87512006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
8752
8753 More improvements to the documentation of the prologue alternatives:
8754 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
8755 Bison manual.
8756 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
8757 some text to clarify the relative importance of the new directives and
8758 to show how these directives may be viewed as code labels.
8759
2cbe6b7f
JD
87602006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
8761
8762 Similar to the recently removed %before-header, add %code-top as the
8763 alternative to the pre-prologue. Mentioned at
8764 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
8765 Also, let the prologue alternatives appear in the grammar section.
8766 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
8767 (prologue_declaration): Move the existing prologue alternatives to...
8768 (grammar_declaration): ... here and add %code-top.
8769 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
8770
8771 Clean up and extend documentation for the prologue alternatives.
8772 * NEWS (2.3a+): Describe prologue alternatives.
8773 * doc/bison.texinfo (Prologue): Move discussion of prologue
8774 alternatives to...
8775 (Prologue Alternatives): ... this new section, and extend it to discuss
8776 all 4 directives in detail.
148d66d8
JD
8777 (Table of Symbols): Clean up discussion of prologue alternatives and
8778 add %code-top.
2cbe6b7f 8779
e557d3ea
JMG
87802006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8781
8782 DJGPP specific issues.
8783
8784 * djgpp/config.bat: config.hin has been moved to lib. Adjust
8785 config.bat accordingly.
8786 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
8787 * djgpp/config.site: Likewise.
8788
136a0f76
PB
87892006-10-16 Paolo Bonzini <bonzini@gnu.org>
8790
27bd5d67
PB
8791 Replace %*-header with %provides, %requires, %code. See discussion at
8792 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
8793
136a0f76
PB
8794 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
8795 (b4_user_start_header): Remove.
8796 * data/glr.c: Use new macros instead of b4_*start_header
8797 and b4_*end_header.
8798 * data/glr.cc: Likewise.
8799 * data/lalr1.cc: Likewise.
8800 * data/push.c: Likewise.
8801 * data/yacc.c: Likewise.
8802
8803 * doc/bison.texinfo: Remove %before-header, rename
8804 %{start,end,after}-header to %requires, %provides, %code.
8805
8806 * src/parse-gram.y: Likewise (also rename token names accordingly).
8807 * src/scan-gram.l: Likewise.
8808 * tests/actions.at: Likewise.
8809
10f429ef
PE
88102006-10-14 Paul Eggert <eggert@cs.ucla.edu>
8811
8812 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
8813 Problem reported by Joel E. Denny.
8814
88152006-10-14 Jim Meyering <jim@meyering.net>
8816
8817 (Sync from coreutils.)
8818 Work also when the working directory (with e.g. coreutils sources)
8819 is version controlled with git, rather than CVS.
8820 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
8821 rather than CVS.
8822 In messages and comments, say e.g., "checked-out sources",
8823 rather than "CVS sources".
8824 (version_controlled_file): New function. Work for git as well as
8825 for CVS. Don't use grep's -q option.
8826 (slurp): Call it here, in place of CVS-specific code.
8827
c4bd5bf7
JD
88282006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
8829
8830 Fix testsuite for ./configure --enable-gcc-warnings:
8831 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
8832 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
8833 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
8834 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
8835 * test/regression.at (Diagnostic that expects two alternatives):
8836 Likewise.
8837
46356ea4
PE
88382006-10-12 Paul Eggert <eggert@cs.ucla.edu>
8839
231ed89a
PE
8840 * bootstrap.conf (gnulib_modules): Add config-h.
8841 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
8842 worry about HAVE_CONFIG_H.
8843 * lib/abitset.c: Likewise.
8844 * lib/bitset.c: Likewise.
8845 * lib/bitset_stats.c: Likewise.
8846 * lib/bitsetv-print.c: Likewise.
8847 * lib/bitsetv.c: Likewise.
8848 * lib/ebitset.c: Likewise.
8849 * lib/get-errno.c: Likewise.
8850 * lib/lbitset.c: Likewise.
8851 * lib/subpipe.c: Likewise.
8852 * lib/timevar.c: Likewise.
8853 * lib/vbitset.c: Likewise.
8854 * lib/bitset.c: Include "bitset.h" first, to test interface.
8855 * lib/bitset_stats.c: Include "bitset_stats.h" first.
8856 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
8857 * lib/bitsetv.c: Include "bitsetv.h" first.
8858 * lib/get-errno.c: Include "get-errno.h" first.
8859 * m4/.cvsignore: Add config-h.m4.
8860 * tests/actions.at (Default %printer and %destructor for ...):
8861 Adjust expected line numbers in output to reflect removal of #if
8862 HAVE_CONFIG_H lines.
8863 * tests/glr-regression.at (Missed %merge type warnings when ...):
8864 Likewise.
8865 * tests/regression.at (Braced code in declaration in rules section):
8866 Likewise.
8867 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
8868 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
8869 Include <config.h> unconditionally.
8870
46356ea4
PE
8871 * bootstrap: Sync from coreutils, as follows:
8872
8873 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
8874
8875 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
8876 variable was sometimes used without being initialized. This
8877 messed up the installation of the INSTALL file in some cases.
8878
8879 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
8880
8881 * bootstrap (usage, main program, symlink_to_gnulib): Add option
8882 --copy. Inspired by a suggestion from Bruno Haible.
8883
8884 2006-10-03 Jim Meyering <jim@meyering.net>
8885
8886 * bootstrap: Undo last change to this file, since now gnulib-tool
8887 sticks with the automake default in generating dependencies.
8888
dd4bf078
PE
88892006-10-12 Paul Eggert <eggert@cs.ucla.edu>
8890
cf2a5f7c
PE
8891 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
8892 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
8893
8894 * doc/bison.1: Add copyright notice.
8895
8896 * data/glr.c: Don't include <stdarg.h>; not used.
8897
35fe0834
PE
8898 * NEWS: The -g and --graph options now output graphs in Graphviz
8899 DOT format, not VCG format.
8900 * doc/bison.1: Likewise.
8901 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
8902 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
8903 of this change in
8904 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
8905 * TODO: Remove Graphviz entry.
8906 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
8907 remove vcg.c, vcg.h, vcg_defaults.h.
8908 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
8909 * src/graphviz.c, src/graphviz.h: New files.
8910 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
8911 * src/files.h: Make comment more generic.
8912 * src/main.c (main): Likewise.
8913 * src/print_graph.h: Likewise.
8914 * src/getargs.c (usage): Make usage description more generic.
8915 * src/print_graph.c: Include graphviz.h rather than vcg.h.
8916 (static_graph, fgraph): Remove. All uses changed to pass
8917 arguments instead of sharing a static var.
8918 (print_core, print_actions, print_state, print_graph):
8919 Output graphviz format rather than VCG format.
8920 * tests/.cvsignore: Remove *.vcg; add *.dot.
8921 * tests/output.at: Expect *.dot files, not *.vcg files.
8922
dd4bf078
PE
8923 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
8924 accommodates the 2006-10-08 change.
8925
efdd7421
PE
89262006-10-11 Bob Rossi <bob@brasko.net>
8927
8928 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
8929 (b4_yyssa, b4_yyerror_range): New macros.
8930 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
8931 (yypvarsinit): Remove init of removed fields.
8932 (yypushparse): Remove use of removed fields; use new macros instead.
8933
96a1981a
PE
89342006-10-11 Paul Eggert <eggert@cs.ucla.edu>
8935
8936 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
8937 in a push parser. Reindent slightly to match yacc.c better.
8938
89392006-10-11 Bob Rossi <bob@brasko.net>
8940
46356ea4
PE
8941 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
8942 yymsg_alloc fields.
8943 (yypvarsinit, yypushparse): Remove init of removed fields.
8944 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 8945
c1630a8b
PE
89462006-10-09 Paul Eggert <eggert@cs.ucla.edu>
8947
8948 * THANKS: Add Paolo Bonzini and Bob Rossi.
8949
90b9908d
PB
89502006-10-08 Paolo Bonzini <bonzini@gnu.org>
8951
8952 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
8953 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
8954 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
8955 b4_define_user_cde and uses): Remove.
8956 (b4_comment, b4_prefix, b4_sync_start): New.
8957 * data/bison.m4: New file, with most of the content removed from c.m4.
8958 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
8959 * src/output.c (output_skeleton): Pass bison.m4.
8960 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
8961 only if specified.
8962
cf806753
PE
89632006-10-05 Paul Eggert <eggert@cs.ucla.edu>
8964
8965 Fix test failure reported by Tom Lane in
8966 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
8967 and try to make such failures easier to catch in the future.
8968 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
8969 that's now the caller's responsibility.
8970 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
8971 Set yychar = YYEOF if it's negative.
8972 * tests/actions.at (yylex): Abort if asked to read past EOF.
8973 * tests/conflicts.at (yylex): Likewise.
8974 * tests/cxx-type.at (yylex): Likewise.
8975 * tests/glr-regression.at (yylex): Likewise.
8976 * tests/input.at (yylex): Likewise.
8977 * tests/regression.at (yylex): Likewise.
8978 * tests/torture.at (yylex): Likewise.
8979
0e2f006a
PE
89802006-10-01 Paul Eggert <eggert@cs.ucla.edu>
8981
8982 Fix problems with translating English-language diagnostics.
8983 * bootstrap: Fix bug introduced in recent bootstrap changes, with
8984 respect to bison-runtime pot generation. The YY_ stuff
8985 wasn't being captured.
8986 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
8987 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
8988 * runtime-po/POTFILES.in: Add data/push.c.
8989
e3ddc1e3
PE
89902006-09-29 Paul Eggert <eggert@cs.ucla.edu>
8991
8992 Merge bootstrap changes from coreutils.
8993
8994 2006-09-28 Jim Meyering <jim@meyering.net>
8995
8996 Automatically generated dependencies are important even
8997 when all of the sources in a directory come from gnulib.
8998 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
8999 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
9000
9001 2006-09-23 Jim Meyering <jim@meyering.net>
9002
9003 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
9004
9005 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
9006
9007 * bootstrap: Add support for --force.
9008 (usage): New function. Describe usage less tersely.
9009 (CVS_only_file): New var.
9010
01e972b3
PE
90112006-09-21 Paul Eggert <eggert@cs.ucla.edu>
9012
9013 * data/push.c (YYPUSH_MORE): Make it an enum instead.
9014 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
9015 Adjust white space and comments to match GNU style better.
9016
c63d3e90
PE
90172006-09-20 Bob Rossi <bob@brasko.net>
9018
9019 * data/push.c (yyresult_get): Remove function.
9020 (YYPUSH_MORE): Add #define.
9021 (yypushparse): Modify return value.
9022
e70f46d1
PE
90232006-09-20 Paul Eggert <eggert@cs.ucla.edu>
9024
9025 * stamp-h.in: Remove; no longer needed.
9026 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
9027 Remove config.h, config.hin, intl (no longer created).
9028 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
9029 stamp-h1.
9030
9031 Sync bootstrap from coreutils, as follows:
9032
9033 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
9034
9035 * bootstrap (symlink_to_gnulib): New function.
9036 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
9037 to copies-of-gnulib.
9038 (cp_mark_as_generated, slurp, gnulib_files):
9039 Avoid making a copy if it's the same as the old version.
9040 (gnulib_files): Add support for this variable (used by Bison).
9041
a92be413
PE
90422006-09-20 Paul Eggert <eggert@cs.ucla.edu>
9043
9044 * src/getargs.c (usage): Rework to use conventions similar to
9045 coreutils, to make translation a bit easier and the code a bit
9046 smaller. Problem reported by Tim Van Holder.
9047
4f82b42a
PE
90482006-09-15 Paul Eggert <eggert@cs.ucla.edu>
9049
3b2942e6
PE
9050 Use some of gnulib's new modules, taken from coreutils.
9051
9052 * bootstrap: Sync from coreutils, except add support for gnulib_files.
9053 * bootstrap.conf: New file.
9054 (gnulib_modules): Add configmake, inttypes, unistd.
9055 (XGETTEXT_OPTIONS): Add complain, complain_at,
9056 fatal, fatal_at, warn, warn_at, unexpected_end.
9057 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
9058 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
9059 (gl_EARLY): Add.
9060 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
9061 (gl_INIT): Add
9062 (GNULIB_AUTOCONF_SNIPPET): Remove.
9063 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
9064 the pickiest.
9065 * lib/.cvsignore: Add inttypes_.h.
9066 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
9067 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
9068 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
9069 no-longer-necessary initializations.
9070 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
9071 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
9072 use the unistd module.
9073 * src/system.h: Likewise.
9074 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
9075 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
9076 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
9077 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
9078 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
9079 * src/system.h: Include inttypes.h unconditionally, now that we
9080 use the inttypes module. Don't bother to include stdint.h, since
9081 inttypes.h now does that for us.
9082 (LOCALEDIR): Remove, now that we use the configmake module.
9083 * src/getargs.c: Include configmake.h.
9084 * src/main.c: Likewise.
9085 * src/output.c: Likewise.
9086 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
9087 not from $abs_top_builddir, since config.h moved.
9088
9089
4f82b42a
PE
9090 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
9091 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
9092
9093 * src/parse-gram.y (symbol_declaration): Don't put statements
9094 before declarations; it's not portable to C89.
9095 * src/scan-code.l (handle_action_at): Likewise.
9096
9097 * src/scan-code.l: Always initialize braces_level; the old code
9098 left it uninitialized and therefore had undefined behavior.
9099
9100 Don't attempt to redefine 'assert', since it runs afoul of
9101 systems where standard headers (mistakenly) include <assert.h>.
9102 Instead, define and use our own alternative, called 'aver'.
9103 * src/reader.c: Don't include assert.h, since we no longer
9104 use assert.
9105 * src/scan-code.l: Likewise.
9106 * src/system.h (assert): Remove, replacing with....
9107 (aver): New function, taking a bool arg. All uses changed.
9108 * src/tables.c (pack_vector): Ensure that aver arg is bool,
9109 not merely an integer.
9110
31c10e38
PE
91112006-09-15 Bob Rossi <bob@brasko.net>
9112
d6bdb90a
JD
9113 Add support for push parsing. Based on the original work of
9114 Odd Arild Olsen <oao@fibula.no>.
31c10e38
PE
9115 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
9116 * data/c.m4 (YYPUSH): New.
9117 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
d6bdb90a 9118 * data/push.c: New file.
31c10e38
PE
9119 * src/getargs.c (push_parser): New var.
9120 * src/getargs.h (push_parser): New declaration.
9121 * src/output.c (prepare): Add macro insertion of `push_flag'.
9122 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
9123 (prologue_declaration): Parse %push-parser.
9124 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
9125 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
9126 list of removed lines from the traces observed.
9127 (AT_CHECK_CALC_LALR): Added push parser tests.
9128
fa7b79c0
PE
91292006-09-13 Paul Eggert <eggert@cs.ucla.edu>
9130
21fe08ca
PE
9131 * NEWS: Version 2.3a.
9132 * configure.ac (AC_INIT): Likewise.
9133
e8ec4d9b
PE
9134 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
9135 "#define YYSTYPE int" that caused "make maintainer-check" to fail
9136 due to header ordering dependencies. I don't know why the #define
9137 was there.
9138
fa7b79c0
PE
9139 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
9140 runtime cost when YYDEBUG is not defined, and so that some tests
9141 that used to fail now work. Problem and initial suggestion by
9142 Paolo Bonzini.
9143 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
9144 * data/glr.cc (b4_parser_class_name):
9145 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
9146 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
9147 (yydebug_) [YYDEBUG]: New member.
9148 (yycdebug_): Now defined only if YYDEBUG.
9149 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
9150 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
9151 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
9152 if YYYDEBUG.
9153 (debug_stream, set_debug_stream, debug_level, set_debug_level):
9154 Define only if YYDEBUG.
9155 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
9156 set_debug_level.
9157 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
9158 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
9159 AT_CHECK_CALC_GLR_CC that are working now.
9160
4ec13d60
PE
91612006-09-12 Paul Eggert <eggert@cs.ucla.edu>
9162
9163 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
9164 We don't need them in glr.cc, and glr.c defines them.
9165 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
9166 assumes that defining it to anything is the same as defining
9167 it to 1. Problem reported by Paolo Bonzini.
9168
8e1687ae
PE
91692006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
9170
9171 * data/c.m4 (b4_null, b4_case): Define.
9172 * src/output.c (prepare_symbols): Use b4_null.
9173 (user_actions_output): Use b4_case.
9174
3dc5e96b
PE
91752006-09-11 Paul Eggert <eggert@cs.ucla.edu>
9176
aef3da86
PE
9177 * data/glr.c (b4_shared_declarations): Put start-header first,
9178 before any #includes that we generate, so that feature-test
9179 macros work. Problem reported by Michael Deutschmann in
9180 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
9181 * data/lalr1.cc: Likewise.
9182 * doc/bison.texinfo (Prologue): Document that feature-test macros
9183 should be defined before any Bison declarations.
9184 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
9185 that depend on location.hh after, not before, Bison decls, since
9186 we now include location.hh after the first user prologue.
9187
3dc5e96b
PE
9188 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
9189 Sander Brandenburg in
9190 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
9191 Also, fix minor white space and comment issues.
aef3da86
PE
9192 (Prologue): Mention that it's better to define feature-test macros
9193 before Bison declarations. Problem reported by Michael Deutschmann.
9194
9195 * README-cvs: Fix typo: "&" should be "&&". Problem reported
9196 by Jim Meyering.
9197 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
9198 This adjusts to recent gnulib changes.
3dc5e96b 9199
b2a0b7ca
JD
92002006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
9201
9202 Finish implementation of per-type %destructor/%printer. Discussed
9203 starting at
9204 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
9205 and
9206 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
9207 * NEWS (2.3+): Add a description of this feature to the default
9208 %destructor/%printer description.
9209 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
9210 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
9211 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
9212 list node contains a semantic type.
9213 * src/symtab.c, src/symtab.h: Extend with a table that associates
9214 semantic types with their %destructor's and %printer's.
9215 (semantic_type_from_uniqstr, semantic_type_get,
9216 semantic_type_destructor_set, semantic_type_printer_set): New functions
9217 composing the public interface of that table.
9218 (symbol_destructor_get, symbol_destructor_location_get,
9219 symbol_printer_get, symbol_printer_location_get): If there's no
9220 per-symbol %destructor/%printer, look up the per-type before trying
9221 the default.
9222 * tests/actions.at (Per-type %printer and %destructor): New test case.
9223 * tests/input.at (Default %printer and %destructor redeclared):
9224 Extend to check that multiple occurrences of %symbol-default in a
9225 single %destructor/%printer declaration is an error.
9226 (Per-type %printer and %destructor redeclared, Unused values with
9227 per-type %destructor): New test cases.
9228
3be03b13
JD
92292006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
9230
9231 Require default %destructor/%printer to be declared using
9232 %symbol-default instead of an empty symbol list, and start working on
9233 new per-type %destructor/%printer. Discussed at
9234 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
9235 * NEWS (2.3+): Add %symbol-default to example.
9236 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 9237 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
9238 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
9239 (generic_symlist, generic_symlist_item): New nonterminals for creating
9240 a list in which each item is a symbol, semantic type, or
9241 %symbol-default.
9242 (grammar_declaration): Use generic_symlist in %destructor and %printer
9243 declarations instead of symbols.1 or an empty list.
9244 (symbol_declaration, precedence_declaration, symbols.1): Update actions
9245 for changes to symbol_list.
9246 * src/reader.c: Update for changes to symbol_list.
9247 * src/scan-code.l: Likewise.
9248 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
9249 * src/symlist.c, src/symlist.h: Extend such that a list node may
9250 represent a semantic type or a %symbol-default in addition to just an
9251 ordinary symbol. Add switched functions for setting %destructor's and
9252 %printer's.
9253 * tests/actions.at, tests/input.at: Add %symbol-default to all default
9254 %destructor/%printer declarations.
9255
3508ce36
JD
92562006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
9257
9258 Whether the default %destructor/%printer applies to a particular symbol
9259 isn't a question of whether the user *declares* that symbol (in %token,
9260 for example). It's a question of whether the user by any means
9261 *defines* the symbol at all (by simply using a char token, for
9262 example). $end is defined by Bison whereas any other token with token
9263 number 0 is defined by the user. The error token is always defined by
9264 Bison regardless of whether the user declares it with %token, but we
9265 may one day let the user define error as a nonterminal instead.
9266 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
9267 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
9268 the meaning of "user-defined".
9269 * tests/actions.at (Default %printer and %destructor for user-declared
9270 end token): Rename to...
9271 (Default %printer and %destructor for user-defined end token): ...
9272 this.
9273
9274 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
9275 computation of whether to apply the default, don't maintain a list of
9276 every Bison-defined symbol. Instead, just check for a first character
9277 of '$', which a user symbol cannot have, and check for the error token.
9278
9350499c
JD
92792006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
9280
9281 Don't apply the default %destructor or %printer to the error token,
9282 $undefined, or $accept. This change fits the general rule that the
9283 default %destructor and %printer are only for user-declared symbols,
9284 and it solves several difficulties that are described in the new test
9285 cases listed below.
9286 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
9287 * tests/actions.at (Default %printer and %destructor are not for error
9288 or $undefined, Default %printer and %destructor are not for $accept):
9289 New test cases.
9290
4d7370cb
JD
92912006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
9292
9293 Allow %start after the first rule.
9294 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
9295 when parsing the first rule.
9296 (check_and_convert_grammar): Search for it here after all grammar
9297 declarations have been parsed. Skip midrules, which have dummy LHS
9298 nonterminals.
9299 * src/symtab.c (symbol_is_dummy): New function.
9300 * src/symtab.h (symbol_is_dummy): Declare it.
9301 * tests/input.at (%start after first rule): New test.
9302
6d0ef4ec
JD
93032006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
9304
9305 Redo some of the previous commit: add back the ability to use
9306 non-aliased/undeclared string literals since it might be useful to
9307 those declaring %token-table.
9308 * src/reader.c (check_and_convert_grammar): Undo changes in previous
9309 commit: don't worry about complaints from symbols_pack.
9310 * src/symtab.c (symbol_new, symbol_class_set,
9311 symbol_check_alias_consistency): Undo changes in previous commit: count
9312 each string literal as a new symbol and token, assign it a symbol
9313 number, and don't complain about non-aliased string literals.
9314 (symbols_pack): Since symbol_make_alias still does not decrement symbol
9315 and token counts but does still set aliased tokens to the same number,
9316 symbol_pack_processor now leaves empty slots in the symbols array.
9317 Remove those slots.
9318 * tests/regression.at (Undeclared string literal): Remove test case
9319 added in previous commit since non-aliased string literals are allowed
9320 again.
9321 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
9322 remove unnecessary string literal declarations.
9323 * tests/sets.at (Firsts): Likewise.
9324
965537bc
JD
93252006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
9326
9327 Don't allow an undeclared string literal, but allow a string literal to
9328 be used before its declaration.
9329 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
9330 symbols_pack complained.
9331 * src/symtab.c (symbol_new): Don't count a string literal as a new
9332 symbol.
9333 (symbol_class_set): Don't count a string literal as a new token, and
9334 don't assign it a symbol number since symbol_make_alias does that.
9335 (symbol_make_alias): It's not necessary to decrement the symbol and
9336 token counts anymore. Don't assume that an alias declaration occurs
9337 before any uses of the identifier or string, and thus don't assert that
9338 one of them has the highest symbol number so far.
9339 (symbol_check_alias_consistency): Complain if there's a string literal
9340 that wasn't declared as an alias.
9341 (symbols_pack): Bail if symbol_check_alias_consistency failed since
9342 symbol_pack asserts that every token has been assigned a symbol number
9343 although undeclared string literals have not.
9344 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 9345 string literal): New test cases.
965537bc
JD
9346 (Characters Escapes, Web2c Actions): Declare string literals as
9347 aliases.
9348 * tests/sets.at (Firsts): Likewise.
9349
47aee066
JD
93502006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
9351
9352 In the grammar scanner, STRING_FINISH unclosed constructs and return
9353 them to the parser in order to improve error messages.
9354 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
9355 SC_BRACED_CODE, SC_PROLOGUE): Implement.
9356 * tests/input.at (Unclosed constructs): New test case.
9357 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
9358 seen.
9359
9360 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
9361 unused global.
9362
1f6b3679
JD
93632006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
9364
9365 Handle string aliases for character tokens correctly.
9366 * src/symtab.c (symbol_user_token_number_set): If the token has an
9367 alias, check and set its alias's user token number instead of its own,
9368 which is set to indicate the alias. Previously, every occurrence of
9369 the character token in the grammar overwrote that alias indicator with
9370 the character code.
9371 * tests/input.at (String aliases for character tokens): New test.
9372
219741d8
JD
93732006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
9374
9375 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
9376
11daa4e7
PE
93772006-08-11 Paul Eggert <eggert@cs.ucla.edu>
9378
9379 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
9380 to prevent failures when building on older platforms.
9381 Check for autopoint failure.
9382 Set XGETTEXT_OPTIONS to values that check for C format strings,
9383 so that translators are warned about them (this also helps
9384 prevent core dumps).
9385
9386 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
9387 function, since it simplifies our code a bit.
9388
9389 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
9390 rather than -W, so we don't get bogus warnings about sign comparisons.
9391 Add -Wpointer-arith, since that warning is useful (it reports code
9392 that does not conform to C89 and that some compilers reject).
9393 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
9394 since it's no longer needed.
9395
f9bfc42a
JD
93962006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
9397
9398 Clean up scanners a bit.
9399 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
9400 definitions so gcc won't warn when obstack_for_string is unused.
9401 * src/scan-code.l: config.h and system.h are already #include'd by
9402 scan-code-c.c, so get rid of them here.
9403 * src/scan-gram.l: Likewise.
9404 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
9405 definitions rather than duplicating the rest of it.
9406 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
9407
06e8700a
JD
94082006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
9409
9410 Suppress signed/unsigned comparison warnings for yycheck.
9411 * data/c.m4 (b4_safest_int_type): New macro.
9412 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
9413 a signed int type, cast it to b4_safest_int_type first.
9414 * data/yacc.c: Likewise.
9415 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
9416 also overwritten.
9417
9c437126
PE
94182006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
9419
9420 * doc/bison.texinfo: Fix some typos.
9421
284d8a13
PE
94222006-08-02 Paul Eggert <eggert@cs.ucla.edu>
9423
9424 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
9425 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
9426
9427 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
9428 the latest gnulib does this a different way.
9429 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
9430 translation was patched, so stop omitting it.
9431
ec5479ce
JD
94322006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
9433
9434 Enable declaration of default %printer/%destructor. Make the parser
9435 use these for all user-declared grammar symbols for which the user does
9436 not declare a specific %printer/%destructor. Thus, the parser uses it
9437 for token 0 if the user declares it but not if Bison generates it as
9438 $end. Discussed starting at
9439 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
9440 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
9441 and
9442 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
9443 * NEWS (2.3+): Mention.
9444 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
9445 declare a %destructor for a mid-rule's semantic value. It's just
9446 impossible to declare one specific to it.
9447 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
9448 code. Describe default %destructor form.
9449 * src/parse-gram.y (grammar_declaration): Parse default
9450 %printer/%destructor declarations.
9451 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
9452 and symbol_destructor_location_get rather than accessing the destructor
9453 and destructor_location members of struct symbol.
9454 (symbol_printers_output): Likewise but for %printer's.
9455 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
9456 again.
9457 * src/symtab.c (default_destructor, default_destructor_location,
9458 default_printer, default_printer_location): New static global
9459 variables to record the default %destructor and %printer.
9460 (symbol_destructor_get, symbol_destructor_location_get,
9461 symbol_printer_get, symbol_printer_location_get): New functions to
9462 compute the appropriate %destructor and %printer for a symbol.
9463 (default_destructor_set, default_printer_set): New functions to set the
9464 default %destructor and %printer.
9465 * src/symtab.h: Prototype all those new functions.
9466 * tests/actions.at (Default %printer and %destructor): New test to
9467 check that the right %printer and %destructor are called, that they're
9468 not called for $end, and that $$ and @$ work correctly.
9469 (Default %printer and %destructor for user-declared end token): New
9470 test to check that the default %printer and %destructor are called for
9471 a user-declared end token.
9472 * tests/input.at (Default %printer and %destructor redeclared, Unused
9473 values with default %destructor): New tests to check related grammar
9474 warnings and errors.
9475
868d2d96
JD
94762006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
9477
9478 Clean up handling of %destructor for the end token (token 0).
9479 Discussed starting at
9480 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
9481 and
9482 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
9483
9484 Make the skeletons consistent in how they pop the end token and invoke
9485 its %destructor.
9486 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
9487 state, which has token number 0, since this would invoke the
9488 %destructor for the end token.
9489 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
9490 until after shifting the end token, or else it won't be popped.
9491 * data/yacc.c (yyparse): Likewise.
9492
9493 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
9494 it's the end token. Upon termination, destroy an unshifted lookahead
9495 even when it's the end token.
9496 * data/lalr1.cc (yy::parser::parse): Likewise.
9497 * data/yacc.c (yyparse): Likewise.
9498
9499 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
9500 value warnings for the end token when the user gives the end token a
9501 %destructor.
9502
9503 * tests/actions.at (Printers and Destructors): Test all the above.
9504
62a9592d
PE
95052006-07-24 Paul Eggert <eggert@cs.ucla.edu>
9506
9507 Update to latest gnulib and gettext versions.
9508 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
9509 Add fopen-safer.
9510 (gnulib_files): Add m4/warning.m4. Don't worry about files
9511 overwritten by autopoint.
9512 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
9513 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
9514 rejects them.
9515 Don't use autoreconf; instead, invoke autopoint etc. by hand,
9516 so that we can remove the intl files at a better time.
9517 (intl_files_to_remove): Remove aclocal.m4, since it gets
9518 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
9519 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
9520 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
9521 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
9522 Remove datarootdir hack; no longer needed.
9523 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
9524 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
9525 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
9526 strdup.h.
9527 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
9528 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
9529
10d6970f
PE
95302006-07-20 Paul Eggert <eggert@cs.ucla.edu>
9531
9532 * bootstrap: Adjust to today's change to gnulib-tool by invoking
9533 it with --assume-autoconf='latest-stable'.
9534
50a33993
JD
95352006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
9536
9537 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
9538 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
9539 YYSTYPE' and `{'.
9540 * src/muscle_tab.h (muscle_grow): Replace the header comments with
9541 those from muscle_tab.c since the old ones are misleading.
9542
2ce4ed68
AD
95432006-07-13 Akim Demaille <akim@epita.fr>
9544
9545 Support %define "KEY" {VALUE}.
9546 * src/scan-code.h, src/scan-code.l (translate_action)
9547 (translate_rule_action, translate_symbol_action, translate_code):
9548 Return char *, not const char *.
9549 * src/parse-gram.y (declaration): Rename as...
9550 (prologue_declaration): this.
9551 (string_content): Remove this nonterminal, use STRING.
9552 (braceless, content, content.opt): New nonterminal.
9553 Use them.
9554 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
9555 as value.
9556 * src/scan-gram.l (getargs.h): Don't include it.
9557
db7e5eb5
PE
95582006-07-12 Paul Eggert <eggert@cs.ucla.edu>
9559
9560 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
9561 rather than a for-loop that declares a local bool variable. This
9562 should work around a compatibility problem with a Cray x1e C++
9563 compiler reported by Hung Nguyen in
9564 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
9565 The for-loop was introduced in the 2004-11-17 change but I don't
9566 know why it was needed.
9567
a5d80ba5
AD
95682006-07-12 Akim Demaille <akim@epita.fr>
9569
9570 * data/c.m4: Comment changes.
9571
23eb2a69
AD
95722006-07-10 Akim Demaille <akim@lrde.epita.fr>
9573
9574 * src/complain.c (error_message, ERROR_MESSAGE): New.
9575 To factor...
9576 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
9577 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
9578
ddc8ede1
PE
95792006-07-09 Paul Eggert <eggert@cs.ucla.edu>
9580
9581 * NEWS: Instead of %union, you can define and use your own union type
9582 YYSTYPE if your grammar contains at least one <type> tag.
9583 Your YYSTYPE need not be a macro; it can be a typedef.
9584 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
9585 (Union Decl, Decl Summary): Document this.
9586 * data/glr.c (YYSTYPE): Implement this.
9587 * data/glr.cc (YYSTYPE): Likewise.
9588 * data/lalr1.cc (YYSTYPE): Likewise.
9589 * data/yacc.c (YYSTYPE): Likewise.
9590 * src/output.c (prepare): Output tag_seen_flag.
9591 * src/parse-gram.y (declaration, grammar_declaration):
9592 Use 'union_seen' rather than 'typed' to determine whether
9593 %union has been seen, since grammars can now be typed without
9594 %union.
9595 (symbol_declaration, type.opt, symbol_def):
9596 Keep track of whether a tag has been seen.
9597 * src/reader.c (union_seen, tag_seen): New vars.
9598 (typed): remove.
9599 * src/reader.h (union_seen, tag_seen, typed): Likewise.
9600 * src/scan-code.l (untyped_var_seen): New variable.
9601 (handle_action_dollar): Adjust to above changes.
9602 (handle_action_dollar, handle_action_at):
9603 Improve overflow checking for outlandish numbers.
9604 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
9605 avoid new diagnostics generated by above changes.
9606 * tests/regression.at (YYSTYPE typedef): Add test to check
9607 for type tags without %union.
9608
9609 * src/symlist.c (symbol_list_length): Return int, not unsigned
9610 int, since callers expect int. This may need to get revisited
9611 once we have proper integer overflow checking.
9612
9613 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
9614 object is now static.
9615
9616 * src/getargs.c (flags_argmatch): Return void, not int,
9617 to pacify ./configure --enable-gcc-warnings.
9618
9619 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
9620 since last_string is already defined to FLEX_PREFIX (last_string).
9621
7b42569e
AD
96222006-07-09 Akim Demaille <akim@lrde.epita.fr>
9623
9624 Implement --warnings/-W.
9625 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
9626 replaced by...
9627 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
9628 Adjust callers.
9629 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
9630 (warnings_args, warnings_types): New.
9631 (getargs, short_options, long_options): Accept -W/--warnings.
9632 Sort the options by alphabetical order, upper case letter right
9633 before its lower case.
9634
3b452f4e
JD
96352006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
9636
9637 Change %merge result type clash warnings to errors. Discussed at
9638 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
9639 * src/reader.c (record_merge_function_type): Use complain_at.
9640 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
9641 declared later): Update test case results.
9642
b8a41559
AD
96432006-07-09 Akim Demaille <akim@lrde.epita.fr>
9644
9645 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
9646 to be in alphabetical order.
9647 (trace_args): Spelling fixes.
9648
cd9e1ba2
PE
96492006-07-09 Paul Eggert <eggert@cs.ucla.edu>
9650
9651 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
9652 so they don't collide with user-defined macros.
9653 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
9654 this was never guaranteed, and now that we're using gnulib stdint,
9655 which defines int_fast16_t to long int, the problem is exposed.
9656
cb48f191
PE
96572006-07-08 Paul Eggert <eggert@cs.ucla.edu>
9658
b8445a15
PE
9659 * data/c.m4 (b4_basename): Simplify a bit, since we don't
9660 need the full POSIX semantics (and weren't implementing them
9661 anyway).
9662
cb48f191
PE
9663 Adjust to Autoconf 2.60 and today's gnulib.
9664 * bootstrap (gnulib_modules): Add stdint.
9665 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
9666 no longer copies it.
9667 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
9668 since stdint needs the former and wcwidth (which is now required
9669 by mbswidth) needs the latter.
9670 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
9671 work around a compatibility glitch between gettext 0.14.6 and
9672 Autoconf 2.60.
9673 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
9674 Do not check for uintptr_t, since new stdint module does the right
9675 thing.
9676 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
9677 Add stdint.h, stdint_.h, wcwidth.h.
9678 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
9679 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
9680 stdint.m4, wchar_t.m4, wcwidth.m4.
9681 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
9682 usual order for ../lib/*.h files.
9683 (file_name_split): Use last_component, not base_name, to adjust
9684 to gnulib changes.
9685 * src/parse-gram.h: Include <strverscmp.h> in the usual order
9686 for ../lib/*.h files.
9687 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
9688 Define unconditionally, since we now assume the stdint module.
9689 * src/scan-skel.l: Include <dirname.h>.
9690 (BASE_QPUTS): Use last_component, not base_name.
9691 * src/system.h: Include <unlocked-io.h> in the usual order
9692 for ../lib/*.h files. Include <stdint.h> unconditionally,
9693 since we now use the stdint module.
9694 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
9695 HAVE_UINTPTR_T, since we now use the stdint module.
9696 (base_name): Remove decl, since files now include <dirname.h>
9697 to get the decl.
9698
cd48d21d
AD
96992006-07-08 Akim Demaille <akim@lrde.epita.fr>
9700
9701 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
9702 New, default to 1.
9703 * data/yacc.c, data/glr.c, data/location.cc: Use them.
9704 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
9705 default.
9706 * tests/calc.at: Adjust.
9707
8ec0a172
AD
97082006-07-08 Akim Demaille <akim@lrde.epita.fr>
9709
b8445a15 9710 * data/c.m4 (b4_basename): New.
8ec0a172
AD
9711 (b4_syncline): Also output the location of its invocation (from
9712 the skeleton).
9713 (b4_user_action, b4_define_user_action, b4_user_actions)
9714 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
9715 (b4_user_stype): New.
9716 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
9717
4a678af8
JD
97182006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
9719
9720 In the grammar file, the first column is 1 not 0 on the first line as
9721 on every other line.
9722 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
9723 * tests/input.at (Torturing the Scanner): Update output.
9724
9725 * src/scan-gram.l (scanner_cursor): Declare it static.
9726
dd60572a
JD
97272006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
9728
9729 In warnings, say "previous declaration" rather than "first
9730 declaration".
9731 * src/symtab.c (redeclaration): Do that here.
9732 * src/reader.c (record_merge_function_type): In the case of a result
9733 type clash, report the previous declaration rather than the very first
9734 one in the grammar file.
9735 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
9736 declared later): Add a third declaration to check this behavior.
9737 * tests/input.at (Incompatible Aliases): Update output.
9738
2073e1b6
AD
97392006-06-27 Akim Demaille <akim@epita.fr>
9740
9741 * doc/Doxyfile.in: New.
9742 * doc/Makefile.am: Use it.
9743 * src/lalr.h, src/symtab.h: Initial doxygenation.
9744
8ee5b538
JD
97452006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
9746
9747 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
9748 declared after the %merge. This continues the effort of the previous
9749 patch.
8ee5b538
JD
9750 * src/reader.c (get_merge_function): Don't set the merger type yet.
9751 (record_merge_function_type): New function for setting the merger type
9752 and checking for clashes.
9753 (grammar_current_rule_merge_set): Set the location of the %merge for
9754 the current rule.
9755 (packgram): Invoke record_merge_function_type for each rule now that
9756 all symbol type declarations have been parsed.
9757 * src/reader.h (merger_list.type_declaration_location): New member
9758 storing the location of the first %merge from which the type for this
9759 merging function was derived.
9760 * src/symlist.h (symbol_list.merger_declaration_location): New member
9761 storing the location of a rule's %merge, if any.
9762 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
9763 declared later): New test to catch the error fixed by the above patch.
9764
ffa4ba3a
JD
97652006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
9766
9767 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
9768 declarations appear after the rules. Discussed at
9769 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
9770 and
9771 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
9772 Don't mistake the type of $$ in a midrule to be that of its parent
9773 rule's $$.
ffa4ba3a
JD
9774 * src/reader.c (grammar_current_rule_end): Don't invoke
9775 grammar_rule_check yet since not all symbol declarations may have been
9776 parsed yet.
9777 (grammar_midrule_action): Likewise.
9778 Don't record whether the midrule's $$ has been used yet since actions
9779 haven't been translated yet.
9780 Record the midrule's parent rule and its RHS index within the parent
9781 rule.
9782 (grammar_current_rule_action_append): Don't translate the action yet
9783 since not all symbol declarations may have been parsed yet and, thus,
9784 warnings about types for $$, $n, @$, and @n can't be reported yet.
9785 (packgram): Translate the action and invoke grammar_rule_check now that
9786 all symbol declarations have been parsed.
9787 * src/scan-code.l (handle_action_dollar): Now that this is invoked
9788 after parsing the entire grammar file, the symbol list here in the case
9789 of a midrule is actually the midrule's empty RHS, so reference its
9790 parent rule's RHS where necessary.
9791 On the other hand, now that you can already know it's a midrule, you
9792 aren't forced to think $$ has the same type as its parent rule's $$.
9793 (handle_action_at): In the case of a midrule, reference the parent rule
9794 where necessary.
9795 * src/symlist.c (symbol_list_new): Initialize new midrule-related
9796 members.
9797 (symbol_list_length): Now that this is invoked after all rules have
9798 been parsed, a NULL symbol (rather than a NULL symbol list node)
9799 terminates a rule. symbol_list_print already does this correctly.
9800 * src/symlist.h (symbol_list.midrule_parent_rule,
9801 symbol_list.midrule_parent_rhs_index): New members so that midrules can
9802 remember their relationships with their parents.
9803 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
9804 fixed by the above patch.
9805 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
9806 implementing...
9807 (Unused values): ... this old test case and...
9808 (Unused values before symbol declarations): ... this new test case.
9809 This one is the same as `Unused values' except that all symbol
9810 declarations appear after the rules in order to catch the rest of the
9811 errors fixed by the above patch.
9812
e256e17f
JD
98132006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
9814
300a1930
JD
9815 More cleanup.
9816 * src/reader.c (current_rule): Declare it static since it's no longer
9817 used outside this file.
9818 (grammar_current_rule_action_append): Remove redundant arguments from
9819 translate_rule_action invocation.
9820 * src/reader.h (current_rule): Remove this unused extern.
9821 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
9822 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 9823
381ecb06
JD
98242006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
9825
9826 Clean up yesterday's patch.
9827 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
9828 to...
9829 * src/reader.c (grammar_current_rule_action_append): ... here for
9830 consistency with grammar_current_rule_symbol_append.
9831 * tests/regression.at (Braced code in declaration in rules section):
9832 Make yyerror and yylex static as usual.
9833
4210cd0b
JD
98342006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
9835
9836 Fix bug that mistakes braced code in a declaration in the rules section
9837 to be a rule action. Mentioned at
9838 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
9839 * src/scan-gram.l: Move midrule action detection from the start of the
9840 scanning of any braced code to...
9841 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
9842 action. For readability, use $2 and @2 rather than the equivalent
9843 global variables.
9844 * tests/regression.at (Braced code in declaration in rules section):
9845 New test to catch the error fixed by the above patch.
9846
9847 Work on code readability some.
9848 * src/scan-code.l (current_rule): Get rid of this misleading and
9849 redundant declaration: it's actually extern'ed in reader.h.
9850 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
9851 translate_action): Add a rule argument and use it instead of the global
9852 current_rule.
9853 (translate_rule_action): This already receives current_rule through an
9854 argument, so pass it on to translate_action instead of assigning
9855 current_rule to current_rule.
9856 (translate_symbol_action, translate_code): Pass rule = NULL to
9857 translate_action.
9858
34f98f46
JD
98592006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
9860
9861 Rename %before-definitions to %start-header and %after-definitions to
9862 %end-header. Don't use these declarations to separate pre-prologue
9863 blocks from post-prologue blocks. Add new order-independent
9864 declarations %before-header and %after-header as alternatives to the
9865 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
9866 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
9867 * NEWS (2.3+): Update for these changes.
9868 * data/glr.c (b4_before_definitions): Update to...
9869 (b4_start_header): ... this.
9870 (b4_after_definitions): Update to...
9871 (b4_end_header): ... this.
9872 * data/glr.cc: Likewise.
9873 * data/lalr1.cc: Likewise.
9874 * data/yacc.c: Likewise.
9875 * doc/bison.texinfo (The prologue): Update names, and replace remaining
9876 prologue blocks with %*-header declarations.
9877 (Calc++ Parser): Likewise.
91661ebb 9878 (Decl Summary): Update names.
148d66d8 9879 (Table of Symbols): Update description.
34f98f46
JD
9880 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
9881 (PERCENT_END_HEADER): ... this.
9882 (PERCENT_BEFORE_DEFINITIONS): Update to...
9883 (PERCENT_START_HEADER): ... this.
9884 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
9885 (declaration): Update token names and m4 macro names.
9886 When parsing %end-header and %start-header, invoke translate_code
9887 before muscle_code_grow, and no longer set global booleans to remember
9888 whether these declarations have been seen.
9889 Parse new %after-header and %before-header.
9890 * src/reader.c (before_definitions, after_definitions): Remove.
9891 (prologue_augment): Accept a new bool argument to specify whether to
9892 augment the pre-prologue or post-prologue.
9893 * src/reader.h (before_definitions, after_definitions): Remove these
9894 extern's.
9895 (prologue_augment): Add new bool argument.
9896 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
9897 (PERCENT_END_HEADER): ... this.
9898 (PERCENT_BEFORE_DEFINITIONS): Update to...
9899 (PERCENT_START_HEADER): ... this.
9900 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
9901 * tests/actions.at (Printers and Destructors): Update names.
9902
31b2b07e
JD
99032006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
9904
9905 Add comparison operators for C++ location classes. Discussed at
9906 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
9907 * data/c++.m4 (b4_define_location_comparison): New boolean %define
9908 declaration indicating whether filename_type has an operator==. If
9909 filename_type is `std::string', it defaults to `1', `0' otherwise.
9910 * data/location.cc: Iff b4_define_location_comparison is `1', add
9911 operator== and operator!= for class position and for class location.
9912
9913 Some minor fixes.
9914 * src/scan-action.l: Remove unused file.
9915 * src/symtab.c (symbol_printer_set): Use printer_location not
9916 destructor_location.
9917 * src/symtab.h (struct symbol): Replace incorrect source comment for
9918 printer members.
9919 * tests/input.at (Incompatible Aliases): Update output with correct
9920 printer location.
9921
9bc0dd67
JD
99222006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
9923
9924 Don't put the pre-prologue in the header file. For the yacc.c code
9925 file and the glr.c header and code files, move the pre-prologue before
9926 the token definitions. Add new %before-definitions and
9927 %after-definitions to declare code that will go in both the header file
9928 and code file. Discussed at
9929 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
9930 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
9931 and
9932 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
9933 * NEWS (2.3+): Describe these changes.
9934 * data/glr.c (b4_pre_prologue): Move from within to before...
9935 (b4_shared_declarations): ... this.
9936 Add new b4_before_definitions before b4_token_enums.
9937 Add new b4_after_definitions at the end.
9938 * data/glr.cc (b4_pre_prologue): Replace with...
9939 (b4_before_definitions): ... this in the header file.
9940 (b4_after_definitions): New near the end of the header file.
9941 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
9942 code file right before including the header file.
9943 (b4_before_definitions): New in the previous position of
9944 b4_pre_prologue in the header file.
9945 (b4_after_definitions): New near the end of the header file.
9946 * data/yacc.c: Clean up some m4 quoting especially in the header file.
9947 (b4_token_enums_defines): In the code file, move to right before
9948 YYSTYPE for consistency with the header file.
9949 (b4_before_definitions): New right before b4_token_enums_defines in
9950 both the header and code file.
9951 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
9952 header and code file.
9953 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
9954 of prologues for %union dependencies.
91661ebb
JD
9955 (Decl Summary): In %defines description, mention the effect of
9956 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
9957 (Calc++ Parser): Forward declare driver in a %before-definitions rather
9958 than in the pre-prologue so that make check succeeds.
148d66d8 9959 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
9960 %after-definitions.
9961 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
9962 %before-definitions.
9963 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
9964 (declaration): Parse those declarations and append to
9965 b4_before_definitions and b4_after_definitions, respectively.
9966 * src/reader.c (before_definitions, after_definitions): New bools to
9967 track whether those declarations have been seen.
9968 (prologue_augment): Add to the post-prologue if %union,
9969 %before-definitions, or %after-definitions has been seen.
9970 * src/reader.h (before_definitions, after_definitions): New extern's.
9971 * src/scan-gram.l: Scan the new declarations.
9972 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
9973 prologue block in a %before-definitions or a %after-definitions based
9974 on whether the %union is declared.
9975 * tests/regression.at (Early token definitions with --yacc, Early token
9976 definitions without --yacc): Move tests for token definitions into the
9977 post-prologue since token names are no longer defined in the
9978 pre-prologue.
9979
203b9274
AD
99802006-06-20 Akim Demaille <akim@epita.fr>
9981
9982 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
9983 (symbol_get): Use it.
9984 * src/parse-gram.y: Use it.
9985
a7ee59cf
JD
99862006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
9987
9988 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
9989 build succeeds when configured with --enable-gcc-warnings.
9990
5a2baae7
PE
99912006-06-19 Paul Eggert <eggert@cs.ucla.edu>
9992
33ad1a9c
PE
9993 * src/parse-gram.y (char_name): New function.
9994 (CHAR, STRING, string_content): For %printer, properly escape.
9995 (ID): Prefer fputs to fprintf.
9996 (id): Reindent to be consistent with other rules.
9997 Properly quote char.
9998
5a2baae7
PE
9999 The Translation Project changed its way of publishing translations
10000 to maintainers. I haven't received any responses to my request
10001 for supporting the old way, or for documenting the new way. I
10002 have modified 'bootstrap' to use screen scraping
10003 (in this case, HTML scraping). This is unreliable and inelegant,
10004 but I don't see any better way. Yuck.
10005 * bootstrap (TP_URL, WGET_COMMAND): New vars.
10006 (get_translations): New function, which uses HTML scraping to
10007 deduce locations of latest translations.
10008 Use this function to grab both bison and bison-runtime .po files.
10009 Don't bother priming the pump for the runtime-po domain any more,
10010 as it's now translated better than bison is.
10011
58d7a1a1
AD
100122006-06-19 Akim Demaille <akim@epita.fr>
10013
10014 * src/scan-gram.l: No longer "parse" things after `%union' until
10015 `{'. Rather, return a single "%union" token.
10016 No longer make symbols: return strings, and leave the conversion
10017 to symbols to the parser.
10018 (SC_PRE_CODE, token_type): Remove.
10019 * src/parse-gram.y (%union): New field `character'.
10020 Sort tokens.
10021 (CHAR): New token.
10022 (ID, ID_COLON): Now that the scanner no longer makes them
10023 identifiers, adjust all uses to invoke symbol_get.
10024 (id_colon): New, wraps the conversion from string to symbol.
10025 (%union): Accept a possible union_name.
10026 (symbol): Now can be a char.
10027 * data/c.m4 (b4_union_name): Leave a default value.
10028 * data/glr.c, data/yacc.c: Use it.
10029
b931235e
JD
100302006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
10031
10032 For associating token numbers with token names for "yacc.c", don't use
10033 #define statements unless `--yacc' is specified; always use enum
10034 yytokentype. Most important discussions start at:
10035 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
10036 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
10037 and
10038 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
10039 * NEWS (2.3+): Mention.
10040 * data/c.m4 (b4_yacc_if): New.
10041 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
10042 token #define's.
10043 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
10044 on token name definitions.
10045 * src/getargs.c (usage): Capitalize `Yacc' in English.
10046 * src/output.c (prepare): Define b4_yacc_flag.
10047 * tests/regression.at (Early token definitions): Test that tokens names
10048 are defined before the pre-prologue not just before the post-prologue.
10049 Remove this test case and copy to...
10050 (Early token definitions with --yacc): ... this to test #define's.
10051 (Early token definitions without --yacc): ... and this to test enums.
10052
9e6e7ed2
PE
100532006-06-11 Paul Eggert <eggert@cs.ucla.edu>
10054
10055 * NEWS: Reword the post-2.3 change to not be so optimistic about
10056 removing the old "look-ahead" spelling.
10057 Update previous look-ahead/lookahead change reports.
10058 * REFERENCES: look-ahead -> lookahead (since that's
10059 what he actually wrote).
10060 * doc/refcard.tex: look ahead -> lookahead,
10061 look-ahead -> lookahead
10062
742e4900
JD
100632006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
10064
10065 For consistency, use `lookahead' instead of `look-ahead' or
10066 `look_ahead'. Discussed starting at
10067 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
10068 and then at
10069 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
10070 * NEWS: For the next release, note the change to `--report'.
10071 * TODO, doc/bison.1: Update English.
10072 * doc/bison.texinfo: Update English.
10073 (Understanding Your Parser, Bison Options): Document as
10074 `--report=lookahead' rather than `--report=look-ahead'.
10075 * src/conflicts.c: Update English in comments.
10076 (lookahead_set): Rename from look_ahead_set.
10077 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
10078 (resolve_sr_conflict): Rename local look_ahead_tokens to
10079 lookahead_tokens, and update other uses.
10080 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
10081 count_rr_conflicts, conflicts_free): Update uses.
10082 * src/getargs.c (report_args): Move "lookahead" before alternate
10083 spellings.
10084 (report_types): Update uses.
10085 (usage): For `--report' usage description, state `lookahead' spelling
10086 rather than `look-ahead'.
10087 * src/getargs.h (report.report_lookahead_tokens): Rename from
10088 report_look_ahead_tokens.
10089 * src/lalr.c: Update English in comments.
10090 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
10091 (state_lookahead_tokens_count): Rename from
10092 state_look_ahead_tokens_count.
10093 Rename local n_look_ahead_tokens to n_lookahead_tokens.
10094 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
10095 Rename local n_look_ahead_tokens to n_lookahead_tokens.
10096 Update other uses.
10097 Update English in output.
10098 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
10099 * src/print.c: Update English in comments.
10100 (lookahead_set): Rename from look_ahead_set.
10101 (print_reduction): Rename argument lookahead_token from
10102 look_ahead_token.
10103 (print_core, state_default_rule, print_reductions, print_results):
10104 Update uses.
10105 * src/print_graph.c: Update English in comments.
10106 (print_core): Update uses.
10107 * src/state.c: Update English in comments.
10108 (reductions_new): Update uses.
10109 (state_rule_lookahead_tokens_print): Rename from
10110 state_rule_look_ahead_tokens_print, and update other uses.
10111 * src/state.h: Update English in comments.
10112 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
10113 (state_rule_lookahead_tokens_print): Rename from
10114 state_rule_look_ahead_tokens_print.
10115 * src/tables.c: Update English in comments.
10116 (conflict_row, action_row): Update uses.
10117 * tests/glr-regression.at
10118 (Incorrect lookahead during deterministic GLR,
10119 Incorrect lookahead during nondeterministic GLR): Rename
10120 print_look_ahead to print_lookahead.
10121 * tests/torture.at: Update English in comments.
10122 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
10123 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
10124 (Many lookahead tokens): Update uses.
10125 * data/glr.c: Update English in comments.
10126 * lalr1.cc: Likewise.
10127 * yacc.c: Likewise.
10128 * src/conflicts.h: Likewise.
10129 * src/lalr.h: Likewise.
10130 * src/main.c: Likewise.
10131 * src/output.c: Likewise.
10132 * src/parse-gram.c: Likewise.
10133 * src/tables.h: Likewise.
10134 * tests/calc.at: Likewise.
10135
3c40d0b5
JD
101362006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
10137
10138 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
10139
5d278082
PE
101402006-06-07 Paul Eggert <eggert@cs.ucla.edu>
10141
10142 * TODO: Add request from Nelson H. F. Beebe to be able to install
10143 Bison without installing the yacc script.
10144
9e668899
JD
101452006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
10146
10147 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
10148 and yytext if they're already #define'd.
10149 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
10150 * src/scan-code-c.c: ... here.
10151 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
10152 <config.h>.
10153
0c8e079f
JD
101542006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
10155
10156 Get Bison to build again when configured with --enable-gcc-warnings.
10157 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
10158 missing #include's.
10159 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
10160 loc argument as it shadows a global.
10161 * src/scan-gram.l: Remove stray comma that prevents boundary_set
10162 invocation.
10163
10164 * src/.cvsignore: Add scan-code.c.
10165
2346344a
AD
101662006-06-07 Akim Demaille <akim@epita.fr>
10167
10168 * src/scan-gram.l: Move the "add a trailing ; to actions" code
10169 to...
10170 * src/scan-code.l: here.
10171 * tests/input.at (Torturing the Scanner): Fix another location
10172 error.
10173
4862bdfd
AD
101742006-06-07 Akim Demaille <akim@epita.fr>
10175
10176 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
10177
e9071366
AD
101782006-06-06 Akim Demaille <akim@epita.fr>
10179
10180 Extract the parsing of user actions from the grammar scanner.
10181 As a consequence, the relation between the grammar scanner and
10182 parser is much simpler. We can also split "composite tokens" back
10183 into simple tokens.
10184 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
10185 * src/scan-gram.l (add_column_width, adjust_location): Move to and
10186 rename as...
10187 * src/location.h, src/location.c (add_column_width)
10188 (location_compute): these.
10189 Fix the column count: the initial column is 0.
10190 (location_print): Be robust to ending column being 0.
10191 * src/location.h (boundary_set): New.
10192 * src/main.c: Adjust to scanner_free being renamed as
10193 gram_scanner_free.
10194 * src/output.c: Include scan-code.h.
10195 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
10196 Use boundary_set.
10197 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
10198 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
10199 which is now, again, a separate token.
10200 Adjust all dependencies.
10201 Whereever actions with $ and @ are used, use translate_code.
10202 (action): Remove this nonterminal which is now useless.
10203 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
10204 (grammar_current_rule_action_append): Use translate_code.
10205 (packgram): Bound check ruleno, itemno, and rule_length.
10206 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
10207 (last_string, last_braced_code_loc, max_left_semantic_context)
10208 (scanner_initialize, scanner_free, scanner_last_string_free)
10209 (gram_out, gram_lineno, YY_DECL_): Move to...
10210 * src/scan-gram.h: this new file.
10211 (YY_DECL): Rename as...
10212 (GRAM_DECL): this.
10213 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
10214 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
10215 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
10216 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
10217 Move these declarations, and...
10218 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
10219 these to...
10220 * src/flex-scanner.h: this new file.
10221 * src/scan-gram.l (rule_length, rule_length_overflow)
10222 (increment_rule_length): Remove.
10223 (last_braced_code_loc): Rename as...
10224 (gram_last_braced_code_loc): this.
10225 Adjust to the changes of the parser.
10226 Move all the handling of $ and @ into...
10227 * src/scan-code.l: here.
10228 * src/scan-gram.l (handle_dollar, handle_at): Remove.
10229 (handle_action_dollar, handle_action_at): Move to...
10230 * src/scan-code.l: here.
10231 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
10232 scan-code.h, scan-code-c.c, scan-gram.h.
10233 (EXTRA_bison_SOURCES): Add scan-code.l.
10234 (BUILT_SOURCES): Add scan-code.c.
10235 (yacc): Be robust to white spaces.
10236
10237 * tests/conflicts.at, tests/input.at, tests/reduce.at,
10238 * tests/regression.at: Adjust the column numbers.
10239 * tests/regression.at: Adjust the error message.
7891a7c4 10240
184e42f0
JD
102412006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
10242
10243 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
10244 Use Akim's wording from
10245 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
10246
7891a7c4
JD
102472006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
10248
10249 Between Bison releases, manually append `+' to the previous Bison
10250 release number, and use that as a signal to automatically print the
10251 ChangeLog's CVS Id keyword from --version. Discussed starting at
10252 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
10253 * ChangeLog: Add Id header.
10254 * configure.ac (AC_INIT): Append `+' to `2.3'.
10255 * src/.cvsignore: Add revision.c.
10256 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
10257 (BUILT_SOURCES): Add revision.c.
10258 (revision.c): New target rule. This file defines a new global variable
10259 named revision. It initializes it with either the Id from ChangeLog
10260 or, if VERSION doesn't contain `+', with the empty string.
10261 * src/getargs.c (version): Print the value of revision.
10262 * src/revision.h: Extern revision.
10263
4ad3ed84
PE
102642006-06-05 Paul Eggert <eggert@cs.ucla.edu>
10265
10266 * NEWS: Version 2.3.
10267 * configure.ac (AC_INIT): Likewise.
10268
02103984
PE
102692006-05-30 Paul Eggert <eggert@cs.ucla.edu>
10270
10271 * data/glr.c (YYRECOVERING): Define to be a function-like macro
10272 with no arguments, not as an object-like macro. This is for
10273 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
10274 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
10275 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
10276 Document this.
10277
2c08afa5
JD
102782006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
10279
10280 * src/getargs.c (usage): Back out yesterday's modification of the
10281 --help output so that we don't have to wait for translation before
10282 releasing 2.3.
10283
6077da58
PE
102842006-05-29 Paul Eggert <eggert@cs.ucla.edu>
10285
10286 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
10287 Problem reported by Akim Demaille.
10288
2a26b6c2
JD
102892006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
10290
10291 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
10292
aefef0d6
PE
102932006-05-26 Paul Eggert <eggert@cs.ucla.edu>
10294
10295 * data/yacc.c (yy_reduce_print): Omit trailing white space in
10296 generated source code. Problem reported by Frans Englich in
10297 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
10298
fcd8e201
PE
102992006-05-22 Paul Eggert <eggert@cs.ucla.edu>
10300
10301 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
10302 shell, not within 'make', so that 'make' by an ordinary builder
10303 (using GNU make) does not worry about configuring gzip. This also
10304 works around a bug reported independently by Keith Thompson and by
10305 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
10306 stderr rather than stdout, messing up the build logs.
10307
7b5cdcbd
JD
103082006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
10309
10310 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
10311 to make sure that YYID will never be unused. This fixes a 'make
10312 maintainer-check' failure caused by the recent changes to the 'Trivial
10313 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
10314 not used.
10315 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
10316
5ad0a449
JD
103172006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
10318
10319 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
10320 state before an empty RHS is always resolved here. Only the location
10321 of that state is guaranteed to be resolved, and that's enough. This
10322 fixes the remaining bug reported by Derek M. Jones in
10323 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
10324 * tests/glr-regression.at (Uninitialized location when reporting
10325 ambiguity): Test the above case.
10326 Also, the embedded comments in this test case claim it checks the case
10327 of an empty RHS that has inherited the initial location. However, the
10328 corresponding LHS was already resolved, so yyresolveLocations didn't
10329 actually have reason to modify it. Fix this by forcing
10330 nondeterministic operation at the beginning of the parse.
10331
50cce58e
PE
103322006-05-20 Paul Eggert <eggert@cs.ucla.edu>
10333
10334 * data/c.m4 (b4_yy_symbol_print_generate):
10335 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
10336 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
10337 of the bugs reported today by Derek M Jones in
10338 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
10339 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
10340 defined to be a type name without parens or brackets.
10341 (Location Type): Similarly for YYLTYPE.
10342 * tests/regression.at (Trivial grammars): Put in a test for this
10343 bug that will be caught by 'make maintainer-check' (though not,
10344 alas, by 'make check' unless your compiler is picky).
10345
ab8d9dc5
PE
103462006-05-19 Paul Eggert <eggert@cs.ucla.edu>
10347
0d2c8934 10348 * NEWS: Version 2.2.
ab8d9dc5
PE
10349 * configure.ac (AC_INIT): Likewise.
10350
9138c575
JD
103512006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
10352
10353 * data/glr.c (yyreportTree): Make room in yystates for the state
10354 preceding the RHS. This fixes the segmentation fault reported by Derek
10355 M. Jones in
10356 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
10357 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
10358 to the user. Reported for yyreportTree by Derek M. Jones later in the
10359 same thread.
10360 * THANKS: Add Derek M. Jones.
10361 Update my email address.
10362 Fix typo in Steve Murphy's name.
10363
276f48df
PE
103642006-05-14 Paul Eggert <eggert@cs.ucla.edu>
10365
d6645148
PE
10366 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
10367 checking against YYLAST that caused the parser to miss a potential
10368 alternative in its diagnostic.
10369 Problem reported by Maria Jose Moron Fernandez in
10370 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
10371 * data/lalr1.cc (yysyntax_error_): Likewise.
10372 * data/yacc.c (yysyntax_error): Likewise.
10373 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
10374 tokens, in case we run into an older C compiler.
10375 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
10376 Use them to check for the off-by-one error fixed above.
10377
276f48df
PE
10378 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
10379 YYSIZE_T, not size_t.
10380 * tests/regression.at (Trivial grammars): New test, to catch
10381 the error fixed by the above patch.
10382
cd8b5791
AD
103832006-05-14 Akim Demaille <akim@lrde.epita.fr>
10384
10385 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
10386 scheme.
10387 Reported by Steve Murphy.
10388
34376418
AD
103892006-05-14 Akim Demaille <akim@lrde.epita.fr>
10390
10391 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
10392 * data/glr.cc: b4_location_flag is now b4_locations_flag.
10393
327afc7c
AD
103942006-05-14 Akim Demaille <akim@lrde.epita.fr>
10395
10396 Implement --trace=m4.
10397 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
10398 * src/output.c (output_skeleton): When set, pass -dV to m4.
10399
10400 Factor the handling of flags in m4.
10401 * src/output.c (prepare): Rename the muscle names debug, defines,
10402 error_verbose to debug_flag, defines_flag, error_verbose_flag.
10403 * data/c.m4: Adjust.
10404 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
10405 Use b4_define_flag_if to define other b4_FLAG_if macros.
10406 (b4_location_if): As a consequence, rename as...
10407 (b4_locations_if): this, for consistency.
10408 Adjust all the skeletons.
10409
ba9ecd19
AD
104102006-05-14 Akim Demaille <akim@lrde.epita.fr>
10411
10412 * etc/bench.pm: Shorten bench names.
10413
4e83ea15
AD
104142006-05-14 Akim Demaille <akim@lrde.epita.fr>
10415
10416 * src/output.h, src/output.c (error_verbose): Move to...
10417 * src/getargs.h, src/getargs.c: here.
10418 Sort the flags.
10419 Adjust dependencies.
10420
6e93d810
PE
104212006-05-13 Paul Eggert <eggert@cs.ucla.edu>
10422
10423 * data/c.m4 (b4_copyright): Put the special exception for Bison
10424 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
10425 uses changed. Suggested by Akim Demaille. Also, wrap the
10426 copyright notice, in case it is longer than 80 columns. Replace
10427 comma by newline after title.
6e93d810 10428
eaea13f5
PE
104292006-05-11 Paul Eggert <eggert@cs.ucla.edu>
10430
10431 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
10432 incompatibility, not a bug. Mention that it wasn't fixed as of
10433 flex 2.5.33.
10434
3cf084ec
AD
104352006-05-11 Akim Demaille <akim@lrde.epita.fr>
10436
10437 * examples/extexi: Enforce the precedence of concatenation over
10438 >>.
0a9f1c7d 10439 Reported by Tommy Nordgren.
3cf084ec 10440
32c96bd7
AD
104412006-05-11 Akim Demaille <akim@lrde.epita.fr>
10442
10443 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
10444 with the member "token".
f94705b2 10445 Reported by Martin Nylin.
32c96bd7 10446
eaea13f5
PE
104472006-05-08 Paul Eggert <eggert@cs.ucla.edu>
10448
10449 * data/glr.c: Switch to Bison 2.2 special-exception language in
10450 the copyright notice. Use more-regular format for titles and
10451 copyright notices.
10452 * data/glr.cc: Likewise.
10453 * data/location.cc: Likewise.
10454 * data/yacc.cc: Likewise.
10455 * doc/bison.texinfo (Conditions): Document this.
10456 * NEWS: likewise. Upgrade version to 2.2.
10457
6e2d1146
AD
104582006-04-27 Akim Demaille <akim@lrde.epita.fr>
10459
10460 * data/glr.cc: Remove dead code.
10461
47671055
PE
104622006-04-25 Paul Eggert <eggert@cs.ucla.edu>
10463
10464 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
10465 that variable and the line breaks the bootstrap. Problem reported
10466 by Juan M. Guerrero.
10467
ed2e6384
AD
104682006-04-24 Akim Demaille <akim@lrde.epita.fr>
10469
10470 * doc/bison.texinfo (Multiple start-symbols): New.
10471
3cedc2dc
AD
104722006-04-24 Akim Demaille <akim@lrde.epita.fr>
10473
10474 * etc/README, etc/bench.pl: New.
10475
b2ddc3f3
AD
104762006-04-03 Akim Demaille <akim@lrde.epita.fr>
10477
10478 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
10479 rule.
10480 Reported by Mickael Labau.
10481 * tests/input.at (Torturing the Scanner): Test it.
10482
91e3ac9a
PE
104832006-03-16 Paul Eggert <eggert@cs.ucla.edu>
10484
10485 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
10486 Problem reported by Bob Rossi.
10487
104882006-03-13 Paul Eggert <eggert@cs.ucla.edu>
10489
10490 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
10491 and didn't really work.
10492 For the index, use @ifnotinfo, not @iftex.
10493 Minor cleanups of spacing and terminology.
10494
5cf61e93
AD
104952006-03-12 Akim Demaille <akim@lrde.epita.fr>
10496
10497 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
10498 of AT_NAME_PREFIX when %name-prefix is not used.
10499
aa08666d
AD
105002006-03-12 Akim Demaille <akim@lrde.epita.fr>
10501
10502 Apply --prefix to C++ skeletons too: they change the namespace.
10503 The test suite already exercize these cases.
10504 * data/c++.m4 (b4_namespace): New.
10505 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
10506 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
10507 * data/yacc.c, data/glr.c: Remove a useless `[]'.
10508 * doc/bison.texinfo: Document it.
10509 (Option Cross Key): Use @multitable in all formats. It looks
10510 nicer, even in TeX outputs.
10511 (Rules): Use the same code whatever the output type is.
10512 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
10513 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
10514 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 10515
45567173
AD
105162006-03-10 Akim Demaille <akim@lrde.epita.fr>
10517
10518 * TODO: Remove dead items.
10519
e9d8f881 105202006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
10521
10522 * doc/FAQ: Remove, merged into...
10523 * doc/bison.texinfo (FAQ): this.
10524 * doc/Makefile.am (EXTRA_DIST): Adjust.
10525
c095d689
AD
105262006-03-10 Akim Demaille <akim@lrde.epita.fr>
10527
10528 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
10529 even if empty.
10530 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
10531 * doc/bison.texinfo (Calc++ Scanner): Use it.
10532
6e0f8287
PE
105332006-03-09 Paul Eggert <eggert@cs.ucla.edu>
10534
10535 Fix two nits reported by twlevo, plus one more that I discovered.
10536
10537 * src/assoc.h (assoc_to_string): Give a name to the arg, as
10538 this is the usual Bison style.
10539 * src/location.h (location_print): Likewise.
10540
10541 * src/reader.h (token_name): Likewise.
10542
d6b771c3
PE
105432006-03-08 Paul Eggert <eggert@cs.ucla.edu>
10544
10545 Fix some nits reported by twlevo.
10546 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
10547 and "POSIX". Use more-modern syntax for URLs. Mention C++
10548 and ask for Java. Don't hardwire OS version numbers. Add
10549 copyright notice.
10550 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
10551 * src/conflicts.c (solved_conflicts_obstack): Now static.
10552
1e137b71
JD
105532006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
10554
10555 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
10556 page. Say "you can use it" not "you may use it" as on the web page;
10557 we're describing capabilities not granting permission.
10558
73f2e47e
PE
105592006-03-06 Paul Eggert <eggert@cs.ucla.edu>
10560
6d05403d
PE
10561 * data/glr.c (yyresolveLocations): Rename local variables to avoid
10562 shadowing warnings. Use usual patter for iterating through RHS.
10563 * tests/glr-regression.at
10564 (Uninitialized location when reporting ambiguity):
10565 Modify yylex so that it uses its argument, rather than trying
10566 to rely on ARGSUSED (which doesn't work for gcc with warnings).
10567 const char -> char const.
10568
73f2e47e
PE
10569 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
10570 Don't use tabs inside commands; it messes up 'ps'.
10571 Problem reported by twlevo.
10572
8710fc41
JD
105732006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
10574
10575 * tests/glr-regression.at (Uninitialized location when reporting
10576 ambiguity): New test case.
10577 * data/glr.c (yyresolveLocations): New function, which uses
10578 YYLLOC_DEFAULT.
10579 (yyresolveValue): Invoke yyresolveLocations before reporting an
10580 ambiguity.
10581 * doc/bison.texinfo (Default Action for Locations): Note
10582 YYLLOC_DEFAULT's usage for ambiguity locations.
10583 (GLR Semantic Actions): Cross-reference those notes.
10584
ae952af2
JD
105852006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
10586
10587 * tests/glr-regression.at (Leaked semantic values when reporting
10588 ambiguity): Remove unnecessary union and type declarations.
10589 (Leaked lookahead after nondeterministic parse syntax error): New test
10590 case.
10591 * data/glr.c (yyparse): Check for zero stacks remaining before
10592 attempting to shift the lookahead so that you don't lose it.
10593
35ee866a
JD
105942006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
10595
10596 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
10597 * tests/glr-regression.at (Leaked semantic values when reporting
10598 ambiguity): New test case.
10599 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
10600 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
10601 now unnecessary yystackp parameter.
10602 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
10603 destructors can be called.
10604
10605 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
10606 in existing testcases.
10607
520181ab
JD
106082006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
10609
10610 Don't leak semantic values for parent RHS when a user action cuts the
10611 parser, and clean up related code a bit.
10612 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
10613 cuts parse): Rename to...
10614 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
10615 for leaked parent RHS values.
10616 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
10617 between an unresolved state (non-empty chain of semantic options) and
10618 an incomplete one (signaled by an empty chain).
ae952af2 10619 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
10620 successfully or unsuccessfully resolved yyGLRState to...
10621 (yyresolveValue): ... here so that yyresolveValue always leaves a
10622 yyGLRState with consistent data and thus is easier to understand.
10623 Remove the yyvalp and yylocp parameters since they are always just
10624 taken from the yys parameter. When reporting a discarded merged value
10625 in debugging output, note that it is incompletely merged. Document the
10626 interface.
10627 (yyresolveAction): If resolving any of the RHS states fails, destroy
10628 them all rather than leaking them. Thus, as long as user actions are
10629 written to clean up the RHS correctly, yyresolveAction always cleans up
10630 the RHS of a semantic option. Document the interface.
10631
18d9185c
PE
106322006-02-27 Paul Eggert <eggert@cs.ucla.edu>
10633
10634 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
10635 led to a segmentation fault in GNU Pascal. Problem reported
10636 by Waldek Hebisch.
10637
841a7737
JD
106382006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
10639
10640 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
10641 mid-rule action inside a nonterminal symbol in order to declare a
10642 destructor for its semantic value.
10643
fc3f467f
PE
106442006-02-16 Paul Eggert <eggert@cs.ucla.edu>
10645
10646 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
10647 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
10648 __cplusplus && ! defined _STDLIB_H && !
10649 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
10650 defined free))]: Include <stdlib.h> rather than rolling our own
10651 declarations of malloc and free, to avoid problems with
10652 incompatible declarations (using 'throw') C++'s stdlib.h. This
10653 should fix Debian bug 340012
10654 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
10655 reported by Guillaume Melquiond.
10656
a3af26dd
PE
106572006-02-13 Paul Eggert <eggert@cs.ucla.edu>
10658
4d7bc38c
PE
10659 * NEWS: Clarify symbols versus types in unused-value warnings.
10660
a3af26dd
PE
10661 * configure.ac (AC_INIT): Bump version number.
10662
4e26c69e
PE
106632006-02-13 Paul Eggert <eggert@cs.ucla.edu>
10664
10665 * NEWS: Version 2.1a.
10666 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
10667 since C99 requires this.
10668
498e897c
PE
106692006-02-11 Paul Eggert <eggert@cs.ucla.edu>
10670
10671 * m4/c-working.m4: New file.
10672 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
10673
57bb17ca
PE
106742006-02-10 Paul Eggert <eggert@cs.ucla.edu>
10675
10676 * Makefile.maint: Merge from coreutils.
10677
0be105dc
PE
106782006-02-09 Paul Eggert <eggert@cs.ucla.edu>
10679
10680 More portability fixes for problems summarized by Nelson H. F. Beebe.
10681
10682 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
10683 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
10684 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
10685 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
10686 messes up because C++ code is compiled in 32-bit mode but linked
10687 in 64-bit mode.
10688
6fc0c024
PE
106892006-02-08 Paul Eggert <eggert@cs.ucla.edu>
10690
10691 More portability fixes for problems summarized by Nelson H. F. Beebe.
10692
7870f699
PE
10693 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
10694 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
10695
6fc0c024
PE
10696 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
10697 nodist_PROGRAMS, since we don't need to actually compile the
10698 example if we're just doing a plain 'make'. This avoids bothering
10699 the installer unnecessarily about problems due to weird C++
10700 compilers.
10701
fe6c2fde
PE
107022006-02-06 Paul Eggert <eggert@cs.ucla.edu>
10703
10704 More portability fixes for problems summarized by Nelson H. F. Beebe.
10705
10706 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
10707 than #include "...", and compile with -I'.'. The old method was
10708 not portable, according to Posix and the C standard, and it does
10709 not work with Sun C 5.7, where previous #line directives affect
10710 the working directory used in later #include "..." directives.
10711
927b425b
JMG
107122006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10713
10714 Various DJGGP specific issues in /djgpp
10715
d9735e9e
PE
107162006-02-02 Paul Eggert <eggert@cs.ucla.edu>
10717
10718 More portability fixes for problems summarized by Nelson H. F. Beebe.
10719
10720 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
10721 '#include <map>' works and that you can apply ++ to iterators.
10722
5a6755af
PE
107232006-02-01 Paul Eggert <eggert@cs.ucla.edu>
10724
67a0dc4f
PE
10725 Work around portability problems summarized by Nelson H. F. Beebe in
10726 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
10727
8c86f0ef
PE
10728 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
10729 that '#include <string>' works.
10730
de35dd59
PE
10731 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
10732 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
10733 "warning: sorry: semantics of inline function static data `const
10734 unsigned char translate_table[262]' are wrong (you'll wind up with
10735 multiple copies)".
10736
67a0dc4f
PE
10737 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
10738 or, xor to not_, and_, or_, and xor_, respectively. This works
10739 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
10740 random system header somewhere that includes the equivalent of
10741 <iso646.h>.
10742
5a6755af
PE
10743 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
10744 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 10745 Suite Version 2.0.
5a6755af 10746
3f001415
JD
107472006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
10748
10749 During deterministic GLR operation, user actions should be able to
10750 influence the parse by changing yychar. To make this easier to fix and
10751 to make glr.c easier to evolve in general, don't maintain yytoken in
10752 parallel with yychar; just compute yytoken when needed.
10753 * tests/glr-regression.at (Incorrect lookahead during deterministic
10754 GLR): Check that setting yychar in a user action has the intended
10755 effect.
10756 * data/glr.c (yyGLRStack): Remove yytokenp member.
10757 (yyclearin): Don't set *yytokenp.
10758 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
10759 yychar rather than *yytokenp to determine the current lookahead.
10760 Compute yytoken locally when needed.
10761 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
10762 point to.
10763
10764 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
10765 after `--report' documentation.
10766
e2a8c0f5
PE
107672006-01-30 Paul Eggert <eggert@cs.ucla.edu>
10768
10769 * src/parse-gram.y (grammar_declaration): Location of printer
10770 symbol is @1, not list->location. Bug reported by twlevo.
10771 * tests/input.at (Incompatible Aliases): Adjust to above change.
10772
6b702268
PE
107732006-01-29 Paul Eggert <eggert@cs.ucla.edu>
10774
27622431
PE
10775 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
10776 all the test at once. This makes the output easier to read in the
10777 normal case.
10778
6b702268
PE
10779 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
10780 got from <http://bro-ids.org/download.html>. The bug is that
10781 when two actions appeared in succession, the second one was
10782 scanned before the first one was added to the grammar rule
10783 as a midrule action. Bison then output the incorrect warning
10784 "parse.y:905.17-906.36: warning: unused value: $3".
10785 * src/parse-gram.y (BRACED_CODE, action): These are no longer
10786 associated with a value.
10787 (rhs): Don't invoke grammar_current_rule_action_append.
10788 (action): Invoke it here instead.
10789 * src/reader.c (grammar_midrule_action): Now extern.
10790 (grammar_current_rule_action_append): Don't invoke
10791 grammar_midrule_action; that is now the scanner's job.
10792 * src/reader.h (last_string, last_braced_code_loc):
10793 (grammar_midrule_action): New decls.
10794 * src/scan-gram.l (last_string): Now extern, sigh.
10795 (last_braced_code_loc): New extern variable.
10796 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
10797 rule already has an action.
10798 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
10799 * tests/input.at (AT_CHECK_UNUSED_VALUES):
10800 Add some tests to check that the above changes fixed the bug.
10801
d40ba6c2
PE
108022006-01-27 Paul Eggert <eggert@cs.ucla.edu>
10803
10804 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
10805 All used changed. Check whether the symbol has a destructor,
10806 not whether it is typed.
10807 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
10808 that the values are still reported as unused. All line numbers
10809 adjusted.
10810
401aace6
PE
108112006-01-23 Paul Eggert <eggert@cs.ucla.edu>
10812
10813 Work around a bug in bro 0.8, which underparenthesizes its
10814 definition of YYLLOC_DEFAULT.
10815 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
10816 their arguments.
10817 * data/lalr1.cc: Likewise.
10818 * data/yacc.cc: Likewise.
10819
06f01bc4
PE
108202006-01-22 Paul Eggert <eggert@cs.ucla.edu>
10821
401aace6
PE
10822 Work around a bug in Pike 7.0, and give the Pike folks a
10823 better way to override the usual int widths.
10824 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
10825 user can override the types.
10826 (short): #undef, to work around a bug in Pike 7.0.
10827 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
10828 (union yyalloc.yyss): Use yytype_int16 rather than short.
10829 All uses changed.
10830 (yysigned_char): Remove.
10831 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
10832 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
10833 * tests/regression.at (Web2c Actions): Adjust to above changes.
10834
10835 * src/reader.c (check_and_convert_grammar): New function.
10836 (reader): Close the input file even if something went wrong during
10837 parsing. Minor file descriptor leak reported by twlevo.
10838
06f01bc4
PE
10839 * src/assoc.c (assoc_to_string): Use a default: abort (); case
10840 to pacify gcc -Wswitch-default.
10841 * src/scan-gram.l (adjust_location): Use a default: break; case
10842 to pacify gcc -Wswitch-default.
10843 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
10844 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
10845 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
10846 Move these decls to scan-skel.l, since they don't need to be
10847 visible elsewhere.
10848 * src/scan-skel.l: Accept the above decls.
10849 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
10850 is used.
10851
02650b7f
PE
108522006-01-21 Paul Eggert <eggert@cs.ucla.edu>
10853
10854 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
10855 since we don't want to insist on a version number at the start
10856 of the changelog every time.
10857 * Makefile.maint: Sync from coreutils a bit better.
10858 (sc_trailing_blank): Renamed from sc_trailing_space.
10859 All uses changed.
10860 (sc_no_if_have_config_h, sc_require_config_h):
10861 (sc_prohibit_assert_without_use): New rules.
10862 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
10863 (sc_dd_max_sym_length): Fix leading spaces in rule.
10864 (sc_system_h_headers): Prefix with @.
10865 (sc_useless_cpp_parens, m4-check): Output line numbers.
10866 (changelog-check): Allow version only in head.
10867 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
10868 satisfy new Makefile.maint rule.
10869 * data/glr.c: Likewise.
10870 * data/glr.cc: Likewise.
10871 * data/lalr1.cc: Likewise.
10872 * data/yacc.c: Likewise.
10873 * lib/ebitsetv.c: Likewise.
10874 * lib/lbitset.c: Likewise.
10875 * lib/subpipe.c: Likewise.
10876 * lib/timevar.c: Likewise.
10877 * src/system.h: Likewise.
10878 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
10879 * djgpp/Makefile.maint: Add copyright notice.
10880 * djgpp/README.in: Likewise.
10881 * djgpp/config.bat: Likewise.
10882 * djgpp/config.site: Likewise.
10883 * djgpp/config_h.sed: Likewise.
10884 * djgpp/djunpack.bat: Likewise.
10885 * djgpp/config.sed: Fix copyright notice to match standard format.
10886 * djgpp/subpipe.h: Likewise.
10887 * lib/bitsetv-print.c: Likewise.
10888 * lib/bitsetv.c: Likewise.
10889 * lib/subpipe.h: Likewise.
10890 * lib/timevar.c: Likewise.
10891 * lib/timevar.h: Likewise.
10892 * djgpp/subpipe.c: Use standard recipe for config.h.
10893 * lib/abitset.c: Likewise.
10894 * lib/bitset.c: Likewise.
10895 * lib/bitset_stats.c: Likewise.
10896 * lib/bitsetv-print.c: Likewise.
10897 * lib/bitsetv.c: Likewise.
10898 * lib/ebitsetv.c: Likewise.
10899 * lib/get-errno.c: Likewise.
10900 * lib/lbitset.c: Likewise.
10901 * lib/subpipe.c: Likewise.
10902 * lib/timevar.c: Likewise.
10903 * lib/vbitset.c: Likewise.
10904 * tests/local.at: Likewise.
10905 * src/scan-gram.l: Don't include verify.h, since system.h does
10906 that for us.
10907 * .x-sc_require_config_h: New file.
10908 * .x-sc_unmarked_diagnostics: New file.
10909
287c78f6
PE
109102006-01-20 Paul Eggert <eggert@cs.ucla.edu>
10911
287c78f6
PE
10912 Be a bit more systematic about using 'abort'.
10913 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
10914 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
10915 Put 'default: abort ();' before some other case, to satisfy older
10916 pedantic compilers.
10917 * lib/bitset_stats.c (bitset_stats_init): Likewise.
10918 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
10919 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
10920 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
10921 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
10922 (get_decision_str, get_orientation_str, get_node_alignment_str):
10923 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
10924 (get_linestyle_str, get_arrowstyle_str): Likewise.
10925 * src/conflicts.c (resolve_sr_conflict):
10926 Use a default case rather than one for the one remaining enum
10927 value, to catch invalid enum values as well.
10928 * src/lalr.c (set_goto_map, map_goto):
10929 Prefer "assert (FOO);" to "if (!FOO) abort ();".
10930 * src/nullable.c (nullable_compute, token_definitions_output):
10931 Likewise.
10932 * src/reader.c (packgram, reader): Likewise.
10933 * src/state.c (transitions_to, state_new, state_reduction_find):
10934 Likewise.
10935 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
10936 (symbol_pack): Likewise.
10937 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
10938 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
10939 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
10940 * src/system.h: Don't include <assert.h>.
10941 (assert): New macro.
10942
10943 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
10944 (Destructor Decl, Parser Function, Pure Calling):
10945 Describe rules for braces inside C code more carefully.
287c78f6 10946
c66dfadd
PE
109472006-01-19 Paul Eggert <eggert@cs.ucla.edu>
10948
c21493b8
PE
10949 Fix some porting glitches found by Nelson H. F. Beebe.
10950 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
10951 compilers that don't understand that abort () does not return.
10952 * src/state.c (transitions_to): Likewise.
10953 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
10954 that '#include <cstdlib>' works.
10955 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
10956 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
10957 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
10958 for the benefit of some pre-C99 compilers.
10959
b6e3facf
PE
10960 * bootstrap: Undo changes to gnulib files that autoreconf made.
10961
c66dfadd
PE
10962 Minor fixups to get 'make maintainer-check' to work.
10963 * configure.ac: Don't use -Wnested-externs, as it's incompatible
10964 with the new verify.h implementation.
10965 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
10966 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
10967 * data/yacc.c (YYUSE): Likewise.
10968 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
10969 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
10970 * src/parse-gram.y (declaration): Don't pass a string constant
10971 to a function that expects char *, since GCC might complain
10972 about the constant value.
10973 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
10974 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
10975 before #defining them.
10976 * tests/glr-regression.at
10977 (Incorrectly initialized location for empty right-hand side in GLR):
10978 In yyerror, use the msg arg.
10979 (Corrupted semantic options if user action cuts parse):
10980 (Incorrect lookahead during deterministic GLR):
10981 (Incorrect lookahead during nondeterministic GLR):
10982 Don't name a local var 'index'; it shadows string.h's 'index'.
10983
ed94ef2a
AD
109842006-01-19 Akim Demaille <akim@epita.fr>
10985
10986 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
10987 location, not just parts of it.
10988
e9ad4aec
PE
109892006-01-18 Paul Eggert <eggert@cs.ucla.edu>
10990
d6ca7905
PE
10991 * NEWS: Document the fact that multiple %unions are now allowed.
10992 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
10993 * TODO: This feature is now implemented, so remove it from
10994 the wishlist.
d6ca7905 10995
ef1b70e0
PE
10996 * Makefile.maint: Merge with coreutils Makefile.maint.
10997 (CVS_LIST): Use build-aux version if available.
10998 (VERSION_REGEXP): New macro.
10999 (syntax-check-rules): Add sc_no_if_have_config_h,
11000 sc_prohibit_assert_without_use, sc_require_config_h,
11001 sc_useless_cpp_parens.
11002 (sc_obsolete_symbols): Check for O_NDELAY.
11003 (sc_dd_max_sym_length): Track coreutils.
11004 (sc_unmarked_diagnostics): Look in all files, not just *.c.
11005 (sc_useless_cpp_parens): New rule.
11006 (news-date-check): Look for version or today's date.
11007 (changelog-check): Don't require version number near head.
11008 (copyright-check): Use current year instead of hardwiring 2005.
11009 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
11010 (announcement): Add --gpg-key-ID.
11011
11012 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
11013 with "file system".
11014
2073ce56 11015 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
11016 array. Problem reported by twlevo.
11017 * src/reader.c (packgram): Prepend a new sentinel before ritem.
11018 * src/lalr.c (build_relations): Rely on new sentinel.
11019 * src/gram.c (gram_free): Adjust to new sentinel.
11020
b7691f15
JD
110212006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
11022
11023 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
11024 yylookaheadNeeds. All uses updated.
11025 (yysplitStack): Rename local yynewLookaheadStatuses to
11026 yynewLookaheadNeeds.
11027 * data/glr-regression.at (Incorrect lookahead during nondeterministic
11028 GLR): In comments, change `lookahead status' to `lookahead need'.
11029
ddee1b06
PH
110302006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
11031
11032 * data/glr.c (yysplitStack): A little stylistic rewrite.
11033
12f4614d
PH
110342006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
11035
11036 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
11037
32c29292
JD
110382006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
11039
11040 * doc/bison.texinfo: Fix some typos.
11041 (GLR Semantic Actions): New subsection discussing special
11042 considerations because GLR semantic actions might be deferred.
11043 (Actions): Mention look-ahead usage of yylval.
11044 (Actions and Locations): Mention look-ahead usage of yylloc.
11045 (Special Features for Use in Actions): Add YYEOF entry and mention it
11046 in the yychar entry.
11047 In the yychar entry, remove mention of the local yychar case (pure
11048 parser) since this is irrelevant information when writing semantic
148d66d8 11049 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
11050 yychar is otherwise described as an external variable.
11051 In the yychar entry, don't call it the `current' look-ahead since it
11052 isn't when semantic actions are deferred.
11053 In the yychar and yyclearin entries, add note about deferred semantic
11054 actions.
11055 Add yylloc and yylval entries discussing look-ahead usage.
11056 (Look-Ahead Tokens): When discussing yychar, don't call it the
11057 `current' look-ahead, and do mention yylval and yylloc.
11058 (Error Recovery): Cross-reference `Action Features' when mentioning
11059 yyclearin.
148d66d8 11060 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
11061 look-ahead.
11062 In the yylloc and yylval entries, mention look-ahead usage.
11063
de366a2f 110642006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
11065
11066 * tests/glr-regression.at: Update copyright year to 2006.
11067
bf70fa87
JD
110682006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
11069
11070 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
11071 use during nondeterministic operation to track which stacks have
11072 actually needed the current lookahead.
11073 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
11074 Allocate, deallocate, resize, and otherwise shuffle space for
11075 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
11076 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
11077 appropriately during nondeterministic operation.
11078 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
11079 members to store the current lookahead to be used by the deferred
11080 user action.
11081 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
11082 from which the RHS is taken. Set the lookahead members of the new
11083 yySemanticOption according to the lookahead status for stack yyk.
11084 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
11085 yyaddDeferredAction.
11086 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
11087 members of yySemanticOption before invoking yyuserAction, and then set
11088 them back to their current values afterward.
11089 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
11090 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
11091 * tests/glr-regression.at: Remove `.' from the ends of recent test case
11092 titles for consistency.
11093 (Leaked merged semantic value if user action cuts parse): In order to
11094 suppress lint warnings, use arguments in merge function, and assign
11095 char value < 128 in main.
11096 (Incorrect lookahead during deterministic GLR): New test case.
11097 (Incorrect lookahead during nondeterministic GLR): New test case.
11098
05449a2c
JD
110992006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
11100
de366a2f 11101 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
11102 !yyvaluep as signal that no semantic value is available to print.
11103 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
11104 to print a semantic value.
11105
4158e0a1 111062006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 11107
4158e0a1
JD
11108 * tests/glr-regression.at: For consistency with my newer test cases,
11109 don't thank myself.
11110
d659304d
JD
111112006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
11112
11113 * data/glr.c (yyresolveValue): When merging semantic options, if at
11114 least one user action succeeds but a later one cuts the parse, then
11115 destroy the semantic value before returning rather than leaking it.
11116 (yyresolveStates): If a user action cuts the parse and thus
11117 yyresolveValue fails, ignore the (unset) semantic value rather than
11118 corrupting the yyGLRState, and empty the semantic options list since
11119 the user actions should have called all necessary destructors.
11120 Simplify code with YYCHK.
11121 * tests/glr-regression.at (Corrupted semantic options if user action
11122 cuts parse): New test case.
11123 (Undesirable destructors if user action cuts parse): New test case.
11124 Before applying any of this patch, this test case never actually failed
11125 for me... but only because the corrupted semantic options usually
11126 masked this bug.
11127 (Leaked merged semantic value if user action cuts parse): New test
11128 case.
11129
6ec2c0f2
AD
111302006-01-05 Akim Demaille <akim@epita.fr>
11131
11132 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
11133
1b9c21fb
PE
111342006-01-04 Paul Eggert <eggert@cs.ucla.edu>
11135
11136 * data/c.m4 (b4_c_modern): New macro, with a new provision for
11137 _MSC_VER. Problem reported by Cenzato Marco.
11138 (b4_c_function_def): Use it.
11139 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
11140 b4_c_modern.
11141 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
11142 than rolling our own.
11143
84866159
AD
111442006-01-04 Akim Demaille <akim@epita.fr>
11145
11146 Also warn about non-used mid-rule values.
11147 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
11148 member.
11149 (symbol_list_new): Adjust.
11150 * src/reader.c (symbol_typed_p): New.
11151 (grammar_rule_check): Use it.
11152 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
11153 Check its rule.
11154 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
11155 Use it.
11156 * tests/actions.at (Exotic Dollars): Adjust.
11157
378f4bd8
AD
111582006-01-04 Akim Demaille <akim@epita.fr>
11159
11160 * src/reader.c (grammar_midrule_action): If $$ is set in a
11161 mid-rule, move the `used' bit to its lhs.
11162 * tests/input.at (Unused values): New.
11163 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
11164
e2a21b6f
PE
111652006-01-03 Paul Eggert <eggert@cs.ucla.edu>
11166
54662697
PE
11167 * doc/bison.texinfo (Bison Options): Say more accurately what
11168 --yacc does.
11169 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
11170 about declarations in the grammar when in Yacc mode, as POSIX does
11171 not require a diagnostic when the grammar uses extensions.
11172
11173 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
11174
073f9288
PE
11175 Warn about dubious constructions like "%token T T".
11176 Reported by twlevo.
11177 * src/symtab.h (struct symbol.declared): New member.
11178 * src/symtab.c (symbol_new): Initialize it to false.
11179 (symbol_class_set): New arg DECLARING, specifying whether
11180 this is a declaration that we want to warn about, if there
11181 is more than one of them. All uses changed.
11182
1221b78a
PE
11183 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
11184 Allow multiple %union directives, whose contents concatenate.
11185 * src/parse-gram.y (grammar_declaration): Likewise.
11186 Use muscle_code_grow, so that we don't need stype_line any more.
11187 All uses changed.
11188
11189 * src/muscle_tab.c (muscle_grow): Fix comment.
11190
e2a21b6f
PE
11191 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
11192 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
11193 Update copyright year to 2006.
11194
8f7e3cf9
AD
111952006-01-03 Akim Demaille <akim@epita.fr>
11196
11197 Have glr.cc pass (some of) the calc.at tests.
11198 * data/glr.cc (b4_parse_param_orig): New.
11199 (b4_parse_param): Improve its definition, and bound it more
11200 clearly in the skeleton.
11201 (b4_epilogue): Append, instead of prepending, in order to keep
11202 #line consistency.
11203 Simplify the generation of auxiliary functions: locations and
11204 purity are mandated.
11205 (b4_global_tokens_and_yystype): Honor it.
11206 * data/location.cc (c++.m4): Don't include it.
11207 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
11208 and AT_SKEL_CC_IF.
11209 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
11210 AT_LALR1_CC_IF.
11211 Be sure to initialize the first position's filename.
11212 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
11213 mandated anyway.
11214 (AT_CHECK_CALC_GLR_CC): New.
11215 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
11216
3953ed88
AD
112172006-01-02 Akim Demaille <akim@epita.fr>
11218
11219 * src/output.c (output_skeleton): Don't hard wire the inclusion of
11220 c.m4.
0a96ba81 11221 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
11222 * data/glr.cc: Do not include stack.hh.
11223
9ecafbbf
AD
112242006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
11225
11226 * data/glr.c: Reformat whitespace with tabs.
11227 (b4_lpure_formals): Remove this unused m4 macro.
11228 * tests/cxx-type.at: Reformat whitespace with tabs.
11229 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
11230 since it's a member. Rename type to isNterm for clarity.
11231
c4d497a0
AD
112322005-12-29 Akim <akim@sulaco.local>
11233
11234 Let glr.cc catch up with symbol_value_print.
11235 * data/glr.cc (b4_yysymprint_generate): Replace by...
11236 (b4_yy_symbol_print_generate): this.
11237 (yy_symbol_print, yy_symbol_value_print): Declare them.
11238
4517da37
PE
112392005-12-28 Paul Eggert <eggert@cs.ucla.edu>
11240
11241 * src/location.h (boundary): Note that a line or column equal
11242 to INT_MAX indicates an overflow.
11243 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
11244 (rule_length_overflow, increment_rule_length, add_column_width):
11245 New functions.
11246 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
11247 (<SC_BRACED_CODE>"}"):
11248 Use increment_rule_length rather than incrementing it by hand.
11249 (adjust_location, handle_syncline): Diagnose overflow.
11250 (handle_action_dollar, handle_action_at):
11251 Fix bug with monstrosities like $-2147483648.
11252 Remove now-unnecessary checks.
11253 (scan_integer): Verify assumptions and remove now-unnecessary checks.
11254 (convert_ucn_to_byte): Verify assumptions.
11255 (handle_syncline): New arg LOC. All callers changed.
11256 Don't store through a value derived from char const * pointer.
11257
11258 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
11259 GCC warnings.
11260
e3233bf6
PE
112612005-12-27 Paul Eggert <eggert@cs.ucla.edu>
11262
11263 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
11264 Remove unnecessary forward static decls.
11265
8f3596a6
AD
112662005-12-27 Akim Demaille <akim@epita.fr>
11267
11268 * src/reader.c (grammar_current_rule_check): Also check that $$
11269 is used.
11270 Take the rule to check as argument, hence rename as...
11271 (grammar_rule_check): this.
11272 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
11273 Rename as...
11274 (grammar_rule_begin, grammar_rule_end): these, for consistency.
11275 (grammar_midrule_action, grammar_symbol_append): Now static.
11276 * tests/torture.at (input): Don't rely on the default action
11277 being always performed.
11278 * tests/calc.at: "Set" $$ even when the action is "cut" with
11279 YYERROR or other.
11280 * tests/actions.at (Exotic Dollars): Instead of using unused
11281 values, check that the warning is issued.
11282
721be13c
PE
112832005-12-22 Paul Eggert <eggert@cs.ucla.edu>
11284
11285 * NEWS: Improve wording for unused-value warnings.
11286
a0af42fc
AD
112872005-12-22 Akim Demaille <akim@epita.fr>
11288
11289 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
11290 (b4_yysymprint_generate): Rename as...
11291 (b4_yy_symbol_print_generate): this.
11292 Generate yy_symbol_print instead of yysymprint.
11293 Generate also yy_symbol_value_print, and use it.
11294
affac613
AD
112952005-12-22 Akim Demaille <akim@epita.fr>
11296
721be13c 11297 * NEWS: Warn about unused values.
affac613
AD
11298 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
11299 a `used' member.
11300 (symbol_list_n_get, symbol_list_n_used_set): New.
11301 (symbol_list_n_type_name_get): Use symbol_list_n_get.
11302 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
11303 * src/reader.c (grammar_current_rule_check): Check that values are
11304 used.
11305 * src/symtab.c (symbol_print): Accept 0.
11306 * tests/existing.at: Remove the type information.
11307 Empty the actions.
11308 Remove useless actions (beware of mid-rule actions: perl -000
11309 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
11310 * tests/actions.at (Exotic Dollars): Use unused values.
11311 * tests/calc.at: Likewise.
11312 * tests/glr-regression.at (No users destructors if stack 0 deleted):
11313 Likewise.
11314
11315 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
11316 rule_useful_p.
11317
9d9b8b70
PE
113182005-12-21 Paul Eggert <eggert@cs.ucla.edu>
11319
8bb4c753
PE
11320 Undo 2005-12-01 tentative license wording change. The wording is
11321 still being reviewed by the lawyers, and we don't want to wait for
11322 them before publishing a test release. For now, revert to the
11323 previous wording.
11324 * NEWS: Undo 2005-12-01 change.
11325 * data/glr.c: Revert to previous license wording.
11326 * data/glr.cc: Likewise.
11327 * data/lalr1.cc: Likewise.
11328 * data/location.cc: Likewise.
11329 * data/yacc.c: Likewise.
11330
9d9b8b70
PE
11331 * NEWS: Reword %destructor vs YYABORT etc.
11332 * data/glr.c: Use American spacing, for consistency.
11333 * data/glr.cc: Likewise.
11334 * data/lalr1.cc: Likewise.
11335 * data/yacc.c: Likewise.
11336 * data/yacc.c: Reformat comments slightly.
11337 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
11338 for consistency. Fix some spelling errors and reword recently-included
11339 text slightly.
11340 * tests/cxx-type.at: Cast results of malloc, for C++.
11341
2c3b392a
AD
113422005-12-21 Joel E. Denny <address@hidden>
11343
11344 * tests/cxx-type.at: Construct a tree, count the parents of shared
11345 nodes, and free each node once and only once. Previously, the memory
11346 for semantic values was leaked instead.
11347
d6cff4dc
AD
113482005-12-21 Joel E. Denny <address@hidden>
11349
11350 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
11351 (yylval, yylloc): If pure, #define to yystackp->yyval and
11352 yystackp->yyloc similar to yychar and yynerrs.
11353 (yyparse): If pure, remove local yylval and yylloc. Add local
11354 yystackp to accommodate pure definitions of yylval and yylloc.
11355 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
11356 yylvalp and yyllocp to &yylval and &yylloc.
11357 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
11358 namespace. Previously, nerrs and char were missing, but lval and lloc
11359 weren't necessary.
11360 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
11361 yylvalp and yyllocp parameters since, if pure, these are now always
11362 accessible through yystackp. If not pure, they are still accessible
11363 globally.
11364 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
11365 `if (YYID (N))' to pacify lint.
11366
a85284cf
AD
113672005-12-21 Akim Demaille <akim@epita.fr>
11368
11369 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
11370 destroy the RHS symbols of a rule.
11371 * data/yacc.c (yylen): Initialize to 0.
11372 Keep its value to the number of items to possibly shift.
11373 In particular, a regular successful parse that ends on YYFINAL by
11374 a (internal) YYACCEPT must not have yylen != 0.
11375 (yyerrorlab, yyreturn): Pop the RHS.
11376 Reorder a bit to emphasize the `shifting' bits of code.
11377 (YYPOPSTACK): Now accept a number of items to pop.
11378 * data/lalr1.cc: Likewise.
11379 * data/glr.c: Formatting changes.
11380 Use goto instead of fall through.
11381 * doc/bison.texinfo (Destructor Decl): Complete.
11382
d508c281
JMG
113832005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
11384
11385 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
11386 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
11387 * djgpp/config.bat: Replace every occurence of the file name
11388 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
11389 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
11390 * djgpp/config.sed: Replace every occurence of the file name
11391 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
11392 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
11393 * djgpp/djunpack.bat: DJGPP specific file.
11394 * djgpp/fnchange.lst: DJGPP specific file.
11395 * djgpp/README.in: Add new information about how to unpack the bison
11396 source on MSDOS and other systems which have 8.3 file name restrictions
11397 using djunpack.bat and fnchange.lst.
11398
3e7a2cd9
PE
113992005-12-12 Paul Eggert <eggert@cs.ucla.edu>
11400
11401 * bootstrap (build_cvs_prefix): Remove; unused.
11402 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
11403 when getting gnulib.
11404
114052005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
11406
11407 * data/glr.c: Reorder typedef declarations for structs to match order
11408 of struct declarations.
11409 Rename yystack everywhere to yystackp except in yyparse where it's not
11410 a pointer.
11411 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
11412 consistency.
11413 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
11414 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
11415 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
11416 lint.
11417
877519f8
PE
114182005-12-09 Paul Eggert <eggert@cs.ucla.edu>
11419
0eca5a39
PE
11420 * tests/sets.at (Accept): Fix typos in regular expression used to
11421 sed out the final state number.
11422
2cec9080
PE
11423 Work around portability problem on Solaris 10: flex-generated
11424 files include <stdio.h> before <config.h>, which messes up
11425 because the latter defines __EXTENSIONS__. Address the problem
11426 by creating two new little files that include <config.h> first,
11427 then include the flex-generated files. Rewrite everyone else
11428 to include <config.h> first, as well.
11429 * lib/timevar.c: Always include "config.h".
11430 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
11431 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
11432 (EXTRA_bison_SOURCES): New macro.
11433 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
11434 * src/system.h: Don't include config.h.
11435 * src/LR0.c: Include <config.h> first.
11436 * src/assoc.c: Likewise.
11437 * src/closure.c: Likewise.
11438 * src/complain.c: Likewise.
11439 * src/conflicts.c: Likewise.
11440 * src/derives.c: Likewise.
11441 * src/files.c: Likewise.
11442 * src/getargs.c: Likewise.
11443 * src/gram.c: Likewise.
11444 * src/lalr.c: Likewise.
11445 * src/location.c: Likewise.
11446 * src/main.c: Likewise.
11447 * src/muscle_tab.c: Likewise.
11448 * src/nullable.c: Likewise.
11449 * src/output.c: Likewise.
11450 * src/parse-gram.y: Likewise.
11451 * src/print.c: Likewise.
11452 * src/print_graph.c: Likewise.
11453 * src/reader.c: Likewise.
11454 * src/reduce.c: Likewise.
11455 * src/relation.c: Likewise.
11456 * src/state.c: Likewise.
11457 * src/symlist.c: Likewise.
11458 * src/symtab.c: Likewise.
11459 * src/tables.c: Likewise.
11460 * src/uniqstr.c: Likewise.
11461 * src/vcg.c: Likewise.
11462
877519f8
PE
11463 * src/parse-gram.y: Fix minor problems uncovered by lint.
11464 (current_lhs, current_lhs_location): Now static.
11465 (current_assoc): Remove unused variable.
11466
11467 Cleanups so that Bison-generated parsers have less lint.
11468 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
11469 Prepend /*ARGSUSED*/, for lint's sake.
11470 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
11471 definition if 'lint' is defined.
11472 (YYID): New macro (or function, if lint).
11473 All uses of /*CONSTCOND*/0 replaced by YYID(0).
11474 * data/yacc.c: Likewise.
11475 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
11476 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
11477 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
11478 is C++ only.
11479 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
11480 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
11481 Use YYID(0) rather than 0, for lint.
11482 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
11483 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
11484
f5228370
PE
114852005-12-07 Paul Eggert <eggert@cs.ucla.edu>
11486
11487 * tests/glr-regression.at
11488 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
11489 Close memory leak reported by twlevo.
11490
69ce078b
PE
114912005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
11492
6ff99711
PE
11493 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
11494 all stacks.
11495 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
11496 * tests/glr-regression.at (No users destructors if stack 0 deleted):
11497 New test case.
11498 (Duplicated user destructor for lookahead): This test now is expected
11499 to succeed.
11500
af3412cd
PE
115012005-12-01 Paul Eggert <eggert@cs.ucla.edu>
11502
32b5b719 11503 * NEWS: Document the following change.
af3412cd
PE
11504 * data/yacc.c: Say "parser skeleton" rather than "file", since
11505 it's no longer just a file.
11506 * data/glr.c: Grant a special exception for C GLR parsers, that
11507 reads like the already-existing exception for C LALR(1) parsers.
11508 * data/glr.cc: Likewise.
11509 * data/lalr1.cc: Likewise.
11510 * data/location.cc: Likewise.
11511 * data/yacc.c: Reword the "written by" statement to clarify that
11512 it was the parser skeleton, not the entire output file.
11513 * data/glr.c: Written by Paul Hilfinger.
11514 * data/glr.cc: Written by Akim Demaille.
11515 * data/lalr1.cc: Likewise.
11516
035aa4a0
PE
115172005-11-18 Paul Eggert <eggert@cs.ucla.edu>
11518
d9963c85
PE
11519 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
11520 Fix typos in previous change that broke 'make check'.
11521 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
11522 supported in C.
11523 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
11524 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
11525 We can revert this once things settle down.
11526
035aa4a0
PE
11527 * src/conflicts.c (conflicts_print): Don't print file name twice
11528 when %expect fails because there were no conflicts.
11529 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
11530 change.
11531 * tests/conflicts.at (%expect not enough, %expect too much):
11532 (%expect with reduce conflicts): Adjust to new behavior.
11533
115342005-11-18 Akim Demaille <akim@epita.fr>
11535
11536 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
11537 errors.
11538 * NEWS: Document this.
11539 * doc/bison.texinfo (Expect Decl): Likewise.
11540
d1ff7a7c
AD
115412005-11-16 Akim Demaille <akim@epita.fr>
11542
11543 Generalize the display of semantic values and locations in traces.
11544 * data/glr.c (yy_reduce_print): Fix indices (again).
11545 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
11546 literal integers.
11547 * data/lalr1.cc (yyreduce_print): Rename as...
11548 (yy_reduce_print): this.
11549 Display values and locations.
11550 * data/yacc.c (yy_reduce_print): Likewise.
11551 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
11552 (yysymprint): Move higher to be visible from yy_reduce_print).
11553 (yyparse): Adjust.
11554 * tests/calc.at: Adjust the expected length of the traces.
11555
6de5398d
AD
115562005-11-14 Akim Demaille <akim@epita.fr>
11557
11558 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
11559 from 1 to N, while values and location start at 0.
11560 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
11561
a1373f55
AD
115622005-11-14 Akim Demaille <akim@epita.fr>
11563
11564 * data/glr.c (yy_reduce_print): Fix the $ number.
11565
613d8952
AD
115662005-11-14 Akim Demaille <akim@epita.fr>
11567
11568 "Use" parse parameters.
11569 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
11570 * data/glr.c, data/glr.cc: Use them.
11571 * data/glr.c (YYUSE): Have a C++ definition that supports
11572 non-pointer types.
11573
b2741627
AD
115742005-11-14 Akim Demaille <akim@epita.fr>
11575
11576 * data/glr.c (yyexpandGLRStack): Declare only if defined.
11577
5059b5c8
AD
115782005-11-14 Akim Demaille <akim@epita.fr>
11579
42249483
AD
11580 * data/glr.cc: New.
11581 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 11582
4626a15d
AD
115832005-11-12 Akim Demaille <akim@epita.fr>
11584
11585 Let position and location be PODs.
11586 * data/location.cc (position::initialize, location::initialize): New.
11587 (position::position, location::location): Define only if
11588 b4_location_constructors is defined.
11589 * data/lalr1.cc (b4_location_constructors): Define it for backward
11590 compatibility.
11591 * doc/bison.texinfo (Initial Action Decl): Use initialize.
11592
115932005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
11594
11595 * data/lalr1.cc: Move the body of the ctor and dtor into the
11596 parser file (instead of the header).
11597 Wrap the implementations in a "namespace yy".
11598
115992005-11-12 Akim Demaille <akim@epita.fr>
11600
11601 Have glr.c include its header file when created.
11602 * data/glr.c (b4_shared_declarations): New.
11603 Output them verbatim in the parser if !%defines, otherwise
11604 output then in the header file, and include it instead.
11605
1989d947
AD
116062005-11-11 Akim Demaille <akim@epita.fr>
11607
11608 * data/glr.c: Comment changes.
11609
116102005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
11611
11612 When yydebug, report semantic and location values for reductions.
11613 * data/glr.c (yy_reduce_print): Report the semantic values and the
11614 locations.
11615 (YY_REDUCE_PRINT): Adjust.
11616 (yyglrReduce): Use them.
11617 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
11618 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
11619 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
11620 traces.
11621
02998094
AD
116222005-11-10 Akim Demaille <akim@epita.fr>
11623
11624 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
11625 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
11626 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
11627
5210672f
PE
116282005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
11629
11630 * m4/cxx.m4, examples/Makefile.am: Don't build
11631 examples/calc++ if no C++ compiler is available. (trivial change)
11632
a8991a1d
AD
116332005-11-09 Akim Demaille <akim@epita.fr>
11634
11635 * src/scan-skel.l: Use a couple of asserts.
11636
36b5e963
AD
116372005-11-03 Akim Demaille <akim@epita.fr>
11638
11639 In some (weird) cases, the final state number is incorrect.
11640 Reported by Alexandre Duret-Lutz.
11641 * src/LR0.c (state_list_append): Remove the computation of
11642 final_state.
11643 (save_reductions): Do it here.
11644 (get_state): Alpha conversion.
11645 (generate_states): Use a for loop.
11646 * src/gram.h (item_number_is_rule_number)
11647 (item_number_is_symbol_number): New.
11648 * src/state.c: Use assert.
11649 * src/system.h: Include assert.h.
11650 * tests/sets.at (Accept): New.
11651
44e7ead1
PH
116522005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
11653
11654 * data/glr.c (yyfill): Adjust comment.
36b5e963 11655 (yyresolveAction): Initialize default location properly
44e7ead1
PH
11656 for empty right-hand sides.
11657 (yydoAction): Ditto.
11658 Add comment explaining apparently dead code.
36b5e963
AD
11659 * tests/glr-regression.at
11660 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 11661 New test.
36b5e963 11662
e10a80ee
PE
116632005-10-30 Paul Eggert <eggert@cs.ucla.edu>
11664
11665 * bootstrap (cleanup_gnulib): New function. Use it to clean up
11666 gnulib when interrupted. This fixes some race conditions and
11667 works around some portability problems (one noted by Paul
11668 Hilfinger).
11669
067b32ee
AD
116702005-10-22 Akim <akim@epita.fr>
11671
11672 * Makefile.cfg: Adjust to config -> build-aux.
11673 Reported by twledo.
11674
4b367315
AD
116752005-10-21 Akim Demaille <akim@epita.fr>
11676
11677 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
11678 the %parse-params.
11679 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
11680 * data/yacc.c (b4_Pure_if): Rename as...
11681 (b4_yacc_pure_if): this.
11682 (YY_SYMBOL_PRINT, yyparse): Adjust.
11683 * doc/bison.texinfo: Formatting changes.
11684
24cc23d9
AD
116852005-10-21 Akim Demaille <akim@epita.fr>
11686
11687 Finish the transition config -> build-aux.
11688 * configure.ac, Makefile.am: Use build-aux.
11689 * config/prev-version, config/announce-gen, config/Makefile.am:
11690 Move to...
11691 * build-aux/prev-version, build-aux/announce-gen,
11692 * build-aux/Makefile.am: here.
11693
d4476375
AD
116942005-10-14 Akim Demaille <akim@epita.fr>
11695
11696 * examples/calc++/test: Use set -x only when VERBOSE.
11697
302c0aee
PE
116982005-10-13 Paul Eggert <eggert@cs.ucla.edu>
11699
11700 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
11701 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
11702
7625ec2c
AD
117032005-10-13 Akim Demaille <akim@epita.fr>
11704
11705 * src/scan-skel.l: Output the base name parts of the parser and
11706 header file names.
302c0aee 11707 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
11708 additional checks.
11709 Use this to exercise C++ outputs in subdirs.
11710 Reported by Oleg Smolsky.
11711
ba0fe3c7
PE
117122005-10-12 Paul Eggert <eggert@cs.ucla.edu>
11713
11714 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
11715 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
11716 Problem reported by John P. Hartmann.
11717 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
11718 already defined it.
11719
9b8a5ce0
AD
117202005-10-12 Akim Demaille <akim@epita.fr>
11721
11722 * src/parse-gram.y (version_check): Exit 63 to please missing
11723 (stands for "version mismatch).
11724 * tests/input.at, doc/bison.texinfo: Adjust.
11725
4f6e011e
PE
117262005-10-10 Paul Eggert <eggert@cs.ucla.edu>
11727
11728 Work around portability problems with Visual Age C compiler
11729 (xlc and xlC_r) reported by John P. Hartmann.
11730 * data/location.cc (initial_column, initial_line): Remove.
11731 All uses replaced by 0 and 1.
11732 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
11733 that xlc complains about.
11734 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 11735 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 11736 as __STDC__.
4d7aa45e
PE
11737 * data/yacc.c (YYMODERN_C): New macro, which also looks at
11738 __STDC_VERSION__. Use it everywhere instead of looking at
11739 __STDC__ and __cplusplus.
4f6e011e 11740
a1b3bf8c
AD
117412005-10-10 Akim Demaille <akim@epita.fr>
11742
11743 * examples/calc++/test: Be quiet unless VERBOSE.
11744
412e44aa
PE
117452005-10-05 Paul Eggert <eggert@cs.ucla.edu>
11746
2a4647a3
PE
11747 * data/c.m4 (yydestruct, yysymprint):
11748 Use YYUSE instead of casting to void.
11749 * data/glr.c (YYUSE): New macro.
11750 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
11751 Use it instead of rolling our own.
11752 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
11753 (YYCHK1):
11754 Use /*CONSTCOND*/ to suppress lint warnings.
11755 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
11756 (YY_STACK_PRINT): Use 'false' not '0'.
11757 (YYUSE): New macro.
11758 (yysymprint_, yydestruct_): Use it instead of rolling our own.
11759 * data/yacc.c (YYUSE): New macro.
11760 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
11761 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
11762 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
11763
11764
412e44aa
PE
11765 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
11766 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
11767
88c6637f
PE
117682005-10-04 Paul Eggert <eggert@cs.ucla.edu>
11769
2f4f028d
PE
11770 Undo the parts of the unlocked-I/O change that substituted
11771 putc or puts for printf. This might hurt performance a bit,
11772 but some people prefer the printf style.
11773 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
11774 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
11775 All uses replaced by YYFPRINTF and YYDPRINTF.
11776 * data/yacc.c: Likewise.
11777 * lib/bitset.c (bitset_print): Likewise.
11778 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
11779 putc and puts.
11780 * lib/lbitset.c (debug_lbitset): Likewise.
11781 * src/closure.c (print_firsts, print_fderives): Likewise.
11782 * src/gram.c (grammar_dump): Likewise.
11783 * src/lalr.c (look_ahead_tokens_print): Likewise.
11784 * src/output.c (escaped_output): Likewise.
11785 (user_actions_output): Break apart two printfs.
11786 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
11787 * src/reduce.c (reduce_print): Likewise.
11788 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
11789 * src/system.h: Include unlocked-io.h rathe than stdio.h.
11790
88c6637f
PE
11791 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
11792 Use assignments rather than casts-to-void to suppress
11793 unused-variable warnings. This pacifies 'lint'.
11794 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
11795 unused-variable warnings.
11796
fb32e373
JMG
117972005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
11798
11799 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
11800
edb8f44f
PE
118012005-10-02 Paul Eggert <eggert@cs.ucla.edu>
11802
fb9c0b33
PE
11803 Use unlocked I/O for a minor performance improvement on hosts like
11804 GNU/Linux and Solaris that support unlocked I/O. The basic idea
11805 is to use the gnlib unlocked-io module, and to prefer putc and
11806 puts to printf when either will work (since the latter doesn't
11807 come in an unlocked flavor).
11808 * bootstrap (gnulib_modules): Add unlocked-io.
11809 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
11810 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
11811 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
11812 and similarly for puts and putc and printf.
11813 * data/yacc.c: Likewise.
11814 * lib/bitset.c (bitset_print): Likewise.
11815 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
11816 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
11817 to printf.
11818 * lib/lbitset.c (debug_lbitset): Likewise.
11819 * src/closure.c (print_firsts, print_fderives): Likewise.
11820 * src/gram.c (grammar_dump): Likewise.
11821 * src/lalr.c (look_ahead_tokens_print): Likewise.
11822 * src/output.c (escaped_output): Likewise.
11823 (user_actions_output): Coalesce two printfs.
2f4f028d 11824 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
11825 * src/reduce.c (reduce_print): Likewise.
11826 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 11827 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 11828
edb8f44f
PE
11829 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
11830 this confuses xgettext.
11831
b50d2359
AD
118322005-10-02 Akim Demaille <akim@epita.fr>
11833
11834 * bootstrap (gnulib_modules): Add strverscmp.
11835 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
11836 * m4/.cvsignore: Add strverscmp.m4.
11837 * src/parse-gram.y (%require): New token, new rule.
11838 (version_check): New.
11839 * src/scan-gram.l (%require): Adjust.
11840 * tests/input.at (AT_REQUIRE): New.
11841 Use it.
11842 * doc/bison.texinfo (Require Decl): New.
11843 (Calc++ Parser): Use %require.
11844
21667f64
AD
118452005-10-02 Akim Demaille <akim@epita.fr>
11846
11847 * data/location.cc: New.
11848
2b81e969
AD
118492005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
11850 Akim Demaille <akim@epita.fr>
11851
11852 Make sure -odir/foo.cc creates dir/location.hh etc.
11853 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
11854 (spec_file_prefix, spec_verbose_file, spec_graph_file)
11855 (spec_defines_file): Now const.
11856 (dir_prefix): New.
11857 (short_base_name): Remove.
11858 * src/files.c: Adjust.
11859 (dirname.h): Include.
11860 (base_name): Don't prototype it.
11861 (finput): Remove, duplicates gram_in.
11862 (full_base_name, short_base_name): Replace by...
11863 (all_but_ext, all_but_tab_ext): these.
11864 (compute_base_names): Rename as...
11865 (compute_file_name_parts): this.
11866 Update to compute the new variables, including dir_prefix.
11867 Adjust dependencies.
11868 * src/output.c (prepare): Output them.
11869 * src/reader.c: Adjust to use gram_in, not finput.
11870 * src/scan-skel.l (@dir_prefix@): New.
11871
ad6a9b97
JMG
118722005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
11873
11874 * lib/subpipe.c: New function end_of_output_subpipe() added
11875 to allow support for non-posix systems. This is a no-op function
11876 for posix systems.
11877
11878 * lib/subpipe.h: New function end_of_output_subpipe() added
11879 to allow support for non-posix systems. This is a no-op function
11880 for posix systems.
11881
11882 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
11883 handle the lack of pipe/fork functionality on non-posix systems.
11884
11885 * djgpp/Makefile.maint: DJGPP specific file.
11886
11887 * djgpp/README.in: DJGPP specific file.
11888
11889 * djgpp/config.bat: DJGPP specific configuration file.
11890
11891 * djgpp/config.sed: DJGPP specific configuration file.
11892
11893 * djgpp/config.site: DJGPP specific configuration file.
11894
11895 * djgpp/config_h.sed: DJGPP specific configuration file.
11896
11897 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
11898
11899 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
11900
fc695704
AD
119012005-10-02 Akim Demaille <akim@epita.fr>
11902
11903 * data/location.cc: New, extract from...
11904 * data/lalr1.cc: here.
11905 (location.hh): Include it after the user prologue, in case the
11906 filename type is defined by the user.
11907 Forward declation location and position before the pre-prologue.
11908 (yyresult_): Rename as...
11909 (yyresult): this, it's a local variable, not an attribute.
11910 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
11911
119122005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
11913
11914 * examples/extexi: Restore the #line generation.
11915
fb9712a9
AD
119162005-09-30 Akim Demaille <akim@epita.fr>,
11917 Alexandre Duret-Lutz <adl@gnu.org>
11918
11919 Move the token type and YYSTYPE in the parser class.
11920 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
11921 (parser::token): New, from the moved free definition of tokens.
11922 (parser::semantic_value): Now a full definition instead of an
11923 indirection to YYSTYPE.
11924 (b4_post_prologue): No longer included in the header file, but
11925 in the implementation file.
11926 * doc/bison.texi (C+ Language Interface): Update.
11927 * src/parse-gram.y: Support unary %define.
11928 * tests/actions.at: Define global_tokens_and_yystype for backward
11929 compatibility until we update the tests.
11930 * tests/calc.at: Idem.
11931 (first_line, first_column, last_line, last_column): Define for lalr1.cc
11932 to simplify the code.
11933
55f0c7b1
PE
119342005-09-29 Paul Eggert <eggert@cs.ucla.edu>
11935
11936 Port to SunOS 4.1.4, which lacks strtoul and strerror.
11937 Ah, the good old days! Problem reported by Peter Klein.
11938 * bootstrap (gnulib_modules): Add strerror, strtoul.
11939 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
11940 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
11941
fb9712a9 119422005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
11943
11944 * data/c.m4 (b4_error_verbose_if): New.
11945 * data/lalr1.cc: Use it.
11946 (YYERROR_VERBOSE_IF): Remove.
11947 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
11948 parser members, replaced by...
11949 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
11950 local variables.
11951 (yysyntax_error_): Takes the state number as argument.
11952 (yyreduce_print_): Use the argument yyrule, not the former
11953 attribute yyn_.
11954
8a6f72f3
PE
119552005-09-26 Paul Eggert <eggert@cs.ucla.edu>
11956
11957 * bootstrap (gnulib_modules): Add verify.
11958 * lib/.cvsignore: Add verify.h.
11959 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
11960 * src/system.h (verify): Remove.
11961 Include verify.h instead.
11962 * src/tables.c (tables_generate): Use new API for 'verify'.
11963
0d50976f
PE
119642005-09-21 Paul Eggert <eggert@cs.ucla.edu>
11965
ebc3737e
PE
11966 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
11967 local variables whose names begin with 'yy'.
11968 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
11969 Trivial changes from Joel E. Denny.
11970
0d50976f
PE
11971 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
11972 it itself.
11973 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
11974 don't use alloca any more.
11975
11976 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
11977 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 11978 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
11979 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
11980 to match yacc.c, to test more hosts.
11981
a05b79df
PE
119822005-09-20 Paul Eggert <eggert@cs.ucla.edu>
11983
55289366
PE
11984 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
11985 doesn't affect behavior.
11986 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
11987 Solaris, AIX, MSC.
11988 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
11989 This works a bit better with glibc, if user code has already included
11990 stdlib.h.
11991 * doc/bison.texinfo (Bison Parser): Document that users can't
11992 arbitrarily use malloc and free for other purposes. Document
11993 that <alloca.h> and <malloc.h> might be included.
11994 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
11995 user must declare alloca.
11996
a05b79df
PE
11997 * HACKING (release): Forwarn the Translation Project about
11998 stable releses.
11999
3ab2ca22
AD
120002005-09-20 Akim Demaille <akim@epita.fr>
12001
12002 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
12003
a9739e7c
PE
120042005-09-19 Paul Eggert <eggert@cs.ucla.edu>
12005
a702593e
PE
12006 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
12007 (YYSTACK_ALLOC_MAXIMUM): Use it.
12008 (yysyntax_error): New function.
12009 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
12010 multiple syntax errors are reported, and alloca is being used.
12011 Instead, reallocate buffers twice as big each time, so that
12012 we waste at most half the allocated memory. Start with a small
12013 (128-byte) buffer that will suffice in most cases anyway.
12014 Use yysyntax_error to do most of the work.
12015
12016 * doc/bison.texinfo (Error Reporting, Table of Symbols):
12017 yynerrs is the number of errors reported, not the number of
12018 errors encountered.
12019
a9739e7c
PE
12020 * tests/glr-regression.at (Duplicated user destructor for lookahead):
12021 Mark it as expected to fail.
12022 Cast result of malloc; problem reported by twlevo@xs4all.nl.
12023 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
12024 Don't start user-code symbols with "yy", to avoid name space problems.
12025
f479c6c6
AD
120262005-09-19 Akim Demaille <akim@epita.fr>
12027
12028 Remove the traits, failed experiment.
12029 It never proved useful, and anyway because of the current
12030 definition, it was not possible to have several specialization of
12031 this traits, making it useless.
12032 * data/lalr1.cc (yy:traits): Remove.
12033 Inline its definitions in the parser class.
12034
e2586f82
AD
120352005-09-19 Akim Demaille <akim@epita.fr>
12036
12037 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
12038 least Mac OSX with a /usr/local install of gettext.
12039
2e8cf949
AD
120402005-09-19 Akim Demaille <akim@epita.fr>
12041
12042 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
12043 and yytoken for similarity with the other skeletons.
12044
c7fb0b90
AD
120452005-09-19 Akim Demaille <akim@epita.fr>
12046
4e26c69e 12047 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 12048
1bd0deda
PE
120492005-09-16 Paul Eggert <eggert@cs.ucla.edu>
12050
12051 * NEWS: Version 2.1.
12052
12053 * NEWS: Remove notice of yytname change, since it was never in an
12054 official release.
12055 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
12056 diagnostic.
12057 * src/output.c (prepare): Likewise.
12058 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
12059 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
12060 is not defined. This is an awful hack, but it's enough for now.
12061 All callers changed.
12062 * tests/glr-regression-at (make_value): Args are const pointers now,
12063 to avoid GCC warning.
12064 (Duplicated user destructor for lookahead): New test. Currently
12065 skipped. It fails on my host but I'm not sure it'll always fail.
12066
120672005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
12068
12069 * src/symtab.h (struct symbol): Declare the printer and destructor
12070 as const, to avoid accidental calls to free.
12071 (symbol_destructor_set, symbol_printer_set): Adjust.
12072 * src/symtab.c: Adjust.
12073
1bd0deda 120742005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
12075
12076 * data/c.m4 (b4_token_enums): New.
12077 (b4_token_defines): Rename as...
12078 (b4_token_enums_defines): this.
12079 (b4_token_defines): New, output only the #defines.
12080 * data/yacc.c, data/glr.c: Adjust.
12081 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
12082 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
12083 as default values.
12084
dbcdae2d
AD
120852005-09-16 Akim Demaille <akim@epita.fr>
12086
12087 * data/lalr1.cc (yylex_): Remove, inline its code.
12088 (yyreport_syntax_error_): Remove, replaced by...
12089 (yysyntax_error_): this which returns a string and leaves to the
12090 caller the call to the users' error function.
12091 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
12092 Move from members of the parser object...
12093 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
12094 to local variables of the parse function.
12095
70d8f291
AD
120962005-09-16 Akim Demaille <akim@epita.fr>
12097
12098 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
12099 since it's in Bison's name space.
12100
b47dbebe
PE
121012005-09-15 Paul Eggert <eggert@cs.ucla.edu>
12102
ae199bf1
PE
12103 * data/glr.c (yyresolveValue): Add default case to pacify
12104 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
12105
b47dbebe
PE
12106 * NEWS: Document when yyparse started to return 2.
12107 * doc/bison.texinfo (Parser Function): Document when yyparse
12108 returns 2.
12109
12110 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
12111 (b4_filename_type): Renamed back from b4_file_name_type. All uses
12112 changed.
12113 (class position): file_name -> filename (reverting). All uses changed.
12114
121152005-09-14 Paul Eggert <eggert@cs.ucla.edu>
12116
12117 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
12118 do anything if $@ exists. This reverts part of the 2005-07-07
12119 patch.
12120
00292f66
PE
121212005-09-11 Paul Eggert <eggert@cs.ucla.edu>
12122
12123 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
12124 contains obsolete information and isn't worth distributing as a
12125 separate file anyway.
12126 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
12127 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
12128 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
12129 (yyparse): Abort if user code uses longjmp to throw an unexpected
12130 value.
12131
a420f962
PE
121322005-09-09 Paul Eggert <eggert@cs.ucla.edu>
12133
00292f66
PE
12134 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
12135 Suggested by twlevo@xs4all.nl.
12136
127287e9
PE
12137 * data/glr.c (YYCHK1): Do not assume YYE is in range.
12138 This avoids a diagnostic from gcc -Wswitch-enum.
12139 Problem reported by twlevo@xs4all.nl.
12140
a420f962
PE
12141 * doc/bison.texinfo: Don't use "filename", as per GNU coding
12142 standards. Use "file name" or "file" or "name", depending on
12143 the context.
12144 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
12145 not to hack/foo.tab.c.
12146 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
12147 * data/glr.c: b4_filename -> b4_file_name.
12148 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
12149 All uses changed.
12150 (class position): filename -> file_name. All uses changed.
12151 * data/yacc.c: b4_filename -> b4_file_name.
12152 * lib/bitset.h: filename -> file_name in local vars.
12153 * lib/bitset_stats.c: Likewise.
12154 * src/files.c: Likewise.
12155 * src/scan-skel.l ("@output ".*\n): Likewise.
12156 * src/files.c (file_name_split): Renamed from filename_split.
12157 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
12158
121592005-09-08 Paul Eggert <eggert@cs.ucla.edu>
12160
12161 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
12162 to accommodate latest gnulib.
12163
12164 * tests/glr-regression.at (Duplicate representation of merged trees):
12165 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
12166
12167 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
12168 needed.
12169
42a6501d
PE
121702005-08-26 Paul Eggert <eggert@cs.ucla.edu>
12171
12172 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
12173 All uses changed. Invoke user destructor after an error during a
12174 split parse (trivial change from Joel E. Denny).
12175
12176 * tests/glr-regression.at
12177 (User destructor after an error during a split parse): New test case.
12178 Problem reported by Joel E. Denny in:
12179 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
12180
ef9a1faf
PE
121812005-08-25 Paul Eggert <eggert@cs.ucla.edu>
12182
5b4aaf78
PE
12183 * README-cvs: Give URLs for recommended tools.
12184 Mention Gzip version problem, and bootstrapping issues.
12185 Remove troubleshooting section, as it's somewhat obsolete.
12186
b5240ba5
PE
12187 * bootstrap (no_cache): New var, to accommodate different wget
12188 variants. Use it instead of '-C off'. Problem reported by
12189 twlevo@xs4all.nl.
12190
ef9a1faf
PE
12191 * data/glr.c (yydestroyStackItem): New function.
12192 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
12193 debugging information. Problem reported by Joel E. Denny.
12194
e6efa9da
AD
121952005-08-25 Akim Demaille <akim@epita.fr>
12196
12197 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
12198
adc90f13
PE
121992005-08-24 Paul Eggert <eggert@cs.ucla.edu>
12200
12201 * data/glr.c (yyrecoverSyntaxError, yyreturn):
12202 Don't invoke destructor on unresolved entries.
12203 * tests/glr-regression.at
12204 (User destructor for unresolved GLR semantic value): New test case.
12205 Problem reported by Joel E. Denny in:
12206 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
12207
f9315de5
PE
122082005-08-21 Paul Eggert <eggert@cs.ucla.edu>
12209
15d29c1f
PE
12210 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
12211 Add strnlen.c.
12212 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
12213 lib-prefix.m4, po.m4.
12214
dd5f2af2
PE
12215 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
12216 in yydestruct diagnostic, since it might not be an error.
12217 Problem reported by Joel Denny near end of
12218 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 12219 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
12220 * data/yacc.c (yyreturn): Likewise.
12221 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
12222
12223 * src/files.c: Remove obsolete FIXME comment.
12224
12225 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
12226 with the other templates, and to fix bogus run-on messages such
12227 as the one reported at the end of
12228 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
12229 All callers changed to avoid the newline.
12230 (yyprocessOneStack): Output two lines rather than one, to accommodate
12231 the above change. This changes the debug output format slightly.
12232
f9315de5
PE
12233 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
12234 reported by Joel E. Denny in
12235 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
12236 (trivial change).
12237 * tests/glr-regression.at (Duplicate representation of merged trees):
12238 New test, from Joel E. Denny in:
12239 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
12240 * THANKS: Add Joel E. Denny.
12241
12242 * configure.ac (AC_INIT): Bump to 2.0c.
12243
04098407
PE
122442005-07-24 Paul Eggert <eggert@cs.ucla.edu>
12245
12246 * NEWS: Version 2.0b.
12247
ca5d2013
PE
12248 * Makefile.am (SUBDIRS): Put examples before tests, so that
12249 "make check" doesn't finish with "All 1 tests passed".
12250
3d54b576
PE
12251 * tests/regression.at (Token definitions): Don't rely on
12252 AT_PARSER_CHECK for data that contains backslashes. It currently
12253 uses 'echo', and 'echo' isn't portable if its argument contains
12254 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
12255 that the byte '\0xff' is not printable in the C locale; it is,
12256 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
12257 not printable, so use '\0x81' to test.
12258
d53ae497
PE
12259 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
12260 version of GCC, since the macro is used with non-GCC compilers.
12261
fc01665e
PE
12262 Fix core dump reported by Pablo De Napoli in
12263 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
12264 * tests/regression.at (Invalid inputs with {}): New test.
12265 * src/parse-gram.y (token_name): Translate type before using
12266 it as an index.
12267
04098407
PE
12268 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
12269 the user's name space. All uses changed to __attribute__
12270 ((__unused__)).
12271 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
12272 Add __attribute__ ((__noreturn__)).
12273
12274 * etc/clcommit: Remove. We weren't using it, and it failed
12275 "make maintainer-distcheck".
12276 * Makefile.maint: Merge from coreutils.
12277 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
12278 (syntax-check-rules): Change list of rules as described below.
12279 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
12280 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
12281 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
12282 (sc_trailing_space): New rules.
12283 (sc_xalloc_h_in_src): Remove.
12284 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
12285 (sc_space_tab, sc_error_exit_success, sc_changelog):
12286 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
12287 (makefile-check, po-check, author_mark_check):
12288 (makefile_path_separator_check, copyright-check):
12289 Use grep -n, to make it easier to find violations.
12290 Use CVS_LIST and CVS_LIST_EXCEPT.
12291 (header_regexp, h_re): Remove.
12292 (dd_c): New macro.
12293 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
12294 (my-distcheck): Use more-modern GCC flags.
12295 (signatures, %.asc): Remove.
12296 (rel-files, announcement): Remove signatures.
12297 Restore old updating code, even though we don't use it, so
12298 that we're the same as coreutils.
12299 (alpha, beta, major): Depend on news-date-check.
12300 Make the upload commands.
12301
12302 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
12303 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
12304 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
12305 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
12306 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
12307 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
12308 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
12309 * tests/sets.at: Likewise.
12310
12311 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
12312 we comment out the Autoconf version number.
12313 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
12314 it's error-prone and "make maintainer-distcheck" rejects it.
12315
12316 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
12317 Indent calls to "error" to pacify "make maintainer-distcheck",
12318 when the calls are not intended to be translated.
12319 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
12320
12321 * src/Makefile.am (DEFS): Use +=, to pacify
12322 "make maintainer-distcheck".
12323 (bison_SOURCES): Add scan-skel.h.
12324 (sc_tight_scope): New rule, from coreutils.
12325
12326 * src/files.c (src_extension, header_extension):
12327 Now static, not extern.
12328 * src/getargs.c (short_options): Likewise.
12329 * src/muscle_tab.c (muscle_table): Likewise.
12330 * src/parse-gram.y (current_class, current_type, current_prec):
12331 Likewise.
12332 * src/reader.c (grammar_end, previous_rule_end): Likewise.
12333 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
12334 * src/main.c (main): Cast bindtextdomain and textdomain calls to
12335 void, to avoid warning when NLS is disabled.
12336 * src/output.c: Include scan-skel.h.
12337 (scan_skel): Remove decl, since scan-skel.h does this.
12338 (output_skeleton):
12339 Indent calls to "error" to pacify "make maintainer-distcheck".
12340 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
12341 * src/reader.h (gram_end, gram_lineno): New decls to pacify
12342 "make maintainer-distcheck".
12343 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
12344 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
12345 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
12346 (skel_lex_destroy, scan_skel): Move these decls to...
12347 * src/scan-skel.h: New file.
12348 * src/uniqstr.c (uniqstr_assert):
12349 Indent calls to "error" to pacify "make maintainer-distcheck".
12350
12351 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
12352 not @VAR@.
12353
12354 * tests/torture.at: Revamp to avoid misuse of atoi that
12355 "make maintainer-distcheck" complained about.
12356
12357 * examples/extexi (message): Don't print a message more than once,
12358 and omit line-number decoration that makes Emacs compile think
12359 that informative messages are worth worrying about.
12360
123612005-07-22 Paul Eggert <eggert@cs.ucla.edu>
12362
12363 * configure.ac: Update version number.
12364
12365 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
12366 accidentally.
12367 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
12368 autogenerated by the maintainer.
12369 * examples/calc++/.cvsignore: Add *.yy.
12370
12371 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
12372 * lib/bitset_stats.c (bitset_stats_init): Likewise.
12373 * lib/bitsetv.c (bitsetv_alloc): Likewise.
12374
12375 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
12376
12377 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
12378 from maintainer-distcheck about casting the argument of 'free'.
12379
12380 * NEWS: Mention recent yytname changes.
12381 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
12382
12383 * bootstrap: For translations that have not yet been upgraded to
12384 the new runtime-po domain, prime the pump by extracting the
12385 relevant strings from the obsolete translations. This code can be
12386 removed once the bison-runtime domain has been translated by each
12387 team.
12388
12389 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
12390 now that token names are already quoted.
12391
12392 Fix problem reported by Anthony Heading.
12393 * data/glr.c (YYTOKEN_TABLE): New macro.
12394 (yytname): Define if YYTOKEN_TABLE.
12395 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
12396 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
12397 (YYERROR_VERBOSE): Define the same way the other skeletons do.
12398 * src/output.c (prepare_symbols): Output token_table_flag.
12399
0ffda363
PE
124002005-07-21 Paul Eggert <eggert@cs.ucla.edu>
12401
12402 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
12403 again if the first call fails.
12404
12405 * data/glr.c (yytnamerr): New function.
12406 (yyreportSyntaxError): Use it to dequote most string literals.
12407 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
12408 with other skeletons. All uses changed.
12409 (yytnameerr_): New function.
12410 (yyreport_syntax_error): Use it to dequote most string literals.
12411 * data/yacc.c (yytnamerr): New function.
12412 (yyerrlab): Use it to decode most string literals.
12413 * doc/bison.texinfo (Decl Summary, Calling Convention):
12414 Clarify quoting convention of yytname.
12415 * src/output.c (prepare_symbols): Quote all names. This undoes
12416 the 2005-04-17 change, which is now accomplished (mostly) via
12417 changes in the parsers as described above.
12418 * tests/regression.at (Token definitions, Web2c Actions):
12419 Undo most 2005-04-17 change here, too.
12420
124212005-07-20 Paul Eggert <eggert@cs.ucla.edu>
12422
12423 Fix more problems reported by twlevo@xs4all.nl.
12424 * tests/cxx-type.at: Don't pipe output of ./types through sed to
12425 remove trailing spaces. This loses the exit status of ./types,
12426 and isn't needed since ./types shouldn't be emitting trailing
12427 spaces.
12428 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
12429 as the stack isn't valid in that case.
12430
12431 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
12432 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
12433 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
12434 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
12435 is used.
12436 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
12437 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
12438 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
12439 Likewise.
12440
12441 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
12442 overly-picky compilers that reject 'char *foo = "bar";'.
12443
12444 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
12445 to FILE * parameter, not to stderr. This fixes a typo introduced
12446 in the 2005-07-12 change.
12447
12448 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
12449 warnings from GCC 4.
12450
12451 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
12452 (yyglrShiftDefer, yysplitStack):
12453 Remove unused parameters b4_pure_formals. All uses changed.
12454 (yyglrShift): Remove unused parameters b4_user_formals.
12455 All uses changed.
12456 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
12457
6100a9aa
PE
124582005-07-18 Paul Eggert <eggert@cs.ucla.edu>
12459
258b75ca
PE
12460 Destructor cleanups and regularization among the three skeletons.
12461 * NEWS: Document the behavior changes.
12462 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
12463 stack before failing, as the cleanup code will do it for us now.
12464 * data/lalr1.cc (yyerrlab): Likewise.
12465 * data/glr.c (yyparse): Pop everything off the stack before
12466 freeing it, so that destructors get called properly.
12467 * data/lalr1.cc (yyreturn): Likewise.
12468 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
12469 This is more consistent.
12470 * doc/bison.texinfo (Destructor Decl): Mention more reasons
12471 why destructors might be called. 1.875 -> 2.1.
12472 (Destructor Decl, Decl Summary, Table of Symbols):
12473 Some English-language cleanups for %destructor.
12474 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
12475 Add output line for destructor of start symbol.
12476 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
12477 because of that same extra output line.
12478
1a059451
PE
12479 * NEWS: Document minor wording changes in diagnostics of
12480 Bison-generated parsers.
12481 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
12482 Remove unused formals. All uses changed.
12483 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
12484 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
12485 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
12486 Rename yyoverflowab to yyexhaustedlab.
12487 When memory exhaustion occurs during syntax-error reporting,
12488 report it separately rather than in a single diagnostic; this
12489 eases translation.
12490 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
12491 (Memory Exhausted): Renamed from Parser Stack Overflow.
12492 Revamp wording slightly to prefer "memory exhaustion".
12493 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
12494
97460c78
PE
12495 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
12496
30757c8c
PE
12497 Add i18n support to the GLR skeleton. Partially fix the C++
12498 skeleton; a C++ expert needs to finish this. Remove debugging
12499 msgids; there's little point to having them translated, since they
12500 can be understood only by someone who can read the
12501 (English-language) source code.
12502
12503 Generate runtime-po/bison-runtime.pot automatically, so that we
12504 don't have to worry about garbage getting in that file. We'll
12505 make sure after the next official release that old msgids don't
12506 get lost. See
12507 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
12508
12509 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
12510 Now auto-generated.
12511 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
12512 Fix typos in explanations of the runtime file.
12513 * bootstrap: Change gettext keyword from YYI18N to YY_.
12514 Use standard Makefile.in.in in runtime-po, since we'll arrange
12515 for backward-compatible bison-runtime.po files in a different way.
12516 * data/glr.c (YY_): New macro, from yacc.c.
12517 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
12518 Translate messages intended for users.
12519 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
12520 the wording in the other skeletons. We don't know that the memory
12521 is virtual.
12522 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
12523 Use same method that yacc.c uses.
12524 Don't translate debugging messages.
12525 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
12526 it doesn't work (yet), and requires C++ expertise to fix.
12527 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
12528 Move defn to a more logical place, to be consistent with other
12529 skeletons.
12530 Don't translate debugging messages.
12531 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
12532 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
12533 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
12534 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
12535
ac8c5689
PE
12536 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
12537 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
12538 void, not int.
12539 * tests/glr-regression.at (Badly Collapsed GLR States):
12540 Likewise.
12541 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
12542 yylex should return 0 at EOF rather than aborting.
12543
6100a9aa
PE
12544 Improve tests for stack overflow in GLR parser.
12545 Problem reported by twlevo@xs4all.nl.
12546 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
12547 All uses removed.
12548 (yyStackOverflow): Just longjmp, but with value 2 so that caller
12549 can handle the problem.
12550 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
12551 (yyparse): New local variable yyresult to record the result.
12552 Use result of setjmp to set it, rather than storing itinto
12553 struct.
12554 (yyDone): Remove label.
12555 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
12556 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
12557 if YYABORT is used).
12558 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
12559 yyparse status; put status > 1 into diagnostic.
12560 Check that status==2 works.
12561 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
12562 Use exit status 3 for failure to open (which shouldn't happen).
12563
15f40952
PE
125642005-07-17 Paul Eggert <eggert@cs.ucla.edu>
12565
67fd79c4
PE
12566 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
12567 1 on syntax error; just let yyparse do its thing.
12568 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
12569 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
12570 (Exploding the Stack Size with Alloca):
12571 (Exploding the Stack Size with Malloc):
12572 Expect exit status 2, not 1, since the parser is supposed to blow
12573 its stack. Problem reported by twlevo@xs4all.nl.
12574
15f40952
PE
12575 * data/glr.c (yyparse): Don't assume that the initial calls
12576 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
12577 Print a stack-overflow message and fail instead.
12578 Initialize the line-number information before creating the stack,
12579 so that the stack-overflow message can report line zero safely.
12580
f32c66b5
PE
125812005-07-14 Paul Eggert <eggert@cs.ucla.edu>
12582
a22ff96f 12583 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
12584 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
12585 (yyuserMerge): Provide a default case if b4_mergers is empty.
12586 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
12587 * tests/glr-regression.at
12588 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 12589 Add casts to pacify C++ compilers.
1beb0b24
PE
12590 * tests/glr-regression.at (Improper merging of GLR delayed action
12591 sets): Declare yylex before using it.
f32c66b5 12592 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
12593 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
12594 test for valgrind; valgrind is independent of g++.
12595 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
12596 for compatibility with POSIX 1003.1-2001 (if running coreutils).
12597 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
12598 Use a destructor, so that we can expand the stack. Change
12599 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 12600
d741bd1b
PE
126012005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12602
12603 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
12604 a valgrind failure. Problem reported by twlevo@xs4all.nl.
12605
0410a6e0
PE
126062005-07-13 Paul Eggert <eggert@cs.ucla.edu>
12607
12608 * PACKAGING: New file, suggested by Bruno Haible and taken from
12609 similar wording in gettext's PACKAGING file.
12610 * NEWS: Mention PACKAGING.
12611 * Makefile.am (EXTRA_DIST): Add PACKAGING.
12612
f7ab6a50
PE
126132005-07-12 Paul Eggert <eggert@cs.ucla.edu>
12614
baf785db 12615 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
12616 * bootstrap: Get runtime translations into runtime-po.
12617 Create runtime-po files automatically, if possible.
12618 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
12619 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
12620 does not infringe on the user's name space.
12621 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
12622 * doc/bison.texinfo (Internationalization): Revamp the English
12623 and Texinfo syntax a bit, to try to make it clearer.
12624 (Bison Options, Option Cross Key): Mention --print-localedir.
12625 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
12626 YYENABLE_NLS. Quote a bit more.
12627 * runtime-po/.cvsignore: New file.
12628 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
12629 * runtime-po/Rules-quot: Remove; now created by bootstrap.
12630 * runtime-po/quot.sed: Likewise.
12631 * runtime-po/boldquot.sed: Likewise.
12632 * runtime-po/en@quot.header: Likewise.
12633 * runtime-po/en@boldquot.header: Likewise.
12634 * runtime-po/insert-header.sin: Likewise.
12635 * runtime-po/remove-potcdate.sin: Likewise.
12636 * runtime-po/Makevars: Likewise.
12637 * runtime-po/LINGUAS: Likewise.
12638 * runtime-po/de.po: Likewise; we will rely on the translation project
12639 to maintain this, so "bootstrap" should get it.
0410a6e0 12640 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
12641 its value.
12642 * src/main.c (main): Bind the bison-runtime domain, too.
12643
126442005-07-12 Bruno Haible <bruno@clisp.org>
12645
12646 * data/yacc.c: Include <libintl.h> when NLS is enabled.
12647 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
12648 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
12649 * runtime-po: New directory.
12650 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
12651 $(DOMAIN).pot-update rule, so that old messages are never dropped.
12652 * runtime-po/Rules-quot: New file, copied from po/.
12653 * runtime-po/quot.sed: Likewise.
12654 * runtime-po/boldquot.sed: Likewise.
12655 * runtime-po/en@quot.header: Likewise.
12656 * runtime-po/en@boldquot.header: Likewise.
12657 * runtime-po/insert-header.sin: Likewise.
12658 * runtime-po/remove-potcdate.sin: Likewise.
12659 * runtime-po/Makevars: New file.
12660 * runtime-po/POTFILES.in: New file.
12661 * runtime-po/LINGUAS: New file.
12662 * runtime-po/bison-runtime.pot: New file.
12663 * runtime-po/de.po: New file.
12664 * m4/bison.m4: New file.
12665 * Makefile.am (SUBDIRS): Add runtime-po.
12666 (aclocaldir, aclocal_DATA): New variables.
12667 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
12668 Define aclocaldir.
12669 * src/getargs.c (usage): Document --print-localedir option.
12670 (PRINT_LOCALEDIR_OPTION): New enum item.
12671 (long_options): Add --print-localedir option.
12672 (getargs): Handle --print-localedir option.
12673 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
12674 (Internationalization): New section.
12675
22dda0f0
AD
126762005-07-12 Akim Demaille <akim@epita.fr>
12677
12678 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
12679 for consistency with the rest of the code.
12680 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
12681 Add separators.
12682
82b248ad
AD
126832005-07-12 Akim Demaille <akim@epita.fr>
12684
12685 * src/parse-gram.y: Use %printer instead of YYPRINT.
12686
fa0e9314
AD
126872005-07-12 Akim Demaille <akim@epita.fr>
12688
867a3e00
AD
12689 * src/symtab.h, src/symtab.c (symbol_print): New.
12690 * src/symlist.h, src/symlist.c (symbol_list_print): New.
12691 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
12692
126932005-07-12 Akim Demaille <akim@epita.fr>
12694
12695 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
12696 b4_at_dollar and b4_dollar_dollar.
12697
e054b190
PE
126982005-07-11 Paul Eggert <eggert@cs.ucla.edu>
12699
12700 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
12701 and Pennello's paper.
12702
34160ec4
PE
127032005-07-09 Paul Eggert <eggert@cs.ucla.edu>
12704
407d4a75
PE
12705 * data/yacc.c (yyparse): Undo previous patch. Instead,
12706 set yylsp[0] and yyvsp[0] only if the initial action
12707 sets yylloc and yylval, respectively.
12708
34160ec4
PE
12709 * data/yacc.c (yyparse): In the initial action, set
12710 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
12711 This avoids the use of undefined variables if the initial
12712 action does not set yylloc and/or yylval.
12713
c3d5a4a7
PE
127142005-07-07 Paul Eggert <eggert@cs.ucla.edu>
12715
b34d96c1
PE
12716 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
12717 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
12718 Remove from CVS. These files are automatically generated.
12719 * examples/extexi: Clarify that this file is now part of Bison,
12720 not GNU M4, and that it works with any POSIX-compatible Awk.
12721 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
12722 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
12723 so that we also get calc++-parser.yy. Geneate it.
12724 Use $(AWK), not gawk, since any conforming Awk will do.
12725 Put comment before action, since older 'make' can't handle comment
12726 in action.
12727 $(BUILT_SOURCES): List all built sources, not just some of them.
12728 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
12729 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
12730 $($(calc_sources_generated)): Remove unnecessary test for existence
12731 of target. (This had a shell syntax error anyway; a stray "x".)
12732 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
12733 calc++-parser.yy.
12734 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
12735
c3d5a4a7
PE
12736 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
12737 implied by the other modules.
12738
828c373b
AD
127392005-07-06 Akim Demaille <akim@epita.fr>
12740
12741 Bind examples/calc++ to the package.
12742 * examples/calc++/Makefile: Remove, replaced by...
12743 * examples/calc++/Makefile.am: ... this new file.
12744 * examples/calc++/test: Remove input.
12745 * examples/calc++/compile: Remove.
12746 * examples/Makefile.am: New.
12747 * configure.ac, Makefile.am: Adjust.
12748 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
12749
63cb01d6
PE
127502005-07-05 Paul Eggert <eggert@cs.ucla.edu>
12751
fd2df2ed
PE
12752 * data/glr.c (yyFail): Drastically simplify; since the format argument
12753 never had any % directives, we can simply pass it to yyerror.
12754 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
12755 be modified later, as that is the usual style in glr.c.
12756 Problems reported by Paul Hilfinger.
12757
63cb01d6
PE
12758 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
12759 and size overflow errors.
12760 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
12761 in case the user prolog sets feature-test macros like _GNU_SOURCE.
12762 (YYSIZEMAX): New macro.
12763 (yystpcpy): New function, taken from yacc.c.
12764 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
12765 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
12766 so that we don't have to maintain their signatures.
12767 (yyFail): Check for buffer overflow, by using vsnprintf rather
12768 than vsprintf. Allocate a bigger buffer if possible.
12769 Report an error if buffer allocation fails.
12770 (yyStackOverflow): New function.
12771 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
12772 the initialization was successful. It might fail if storage was
12773 exhausted.
12774 (yyexpandGLRStack): Add more checks for storage allocation failure.
12775 Use yyStackOverflow to report failures.
12776 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
12777 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
12778 Don't assume stack number fits in int.
12779 (yysplitStack): Check for storage allocation failure.
12780 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
12781 can print diagnostics on storage allocation failure. All callers
12782 changed.
12783 (yyresolveValue): Use yybool for boolean.
12784 (yyreportSyntaxError): Check for size-calculation overflow.
12785 This code is taken from yacc.c.
12786 (yyparse): Check for storage allocation errors when allocating
12787 the initial stack.
12788
1c59e0a1
AD
127892005-07-05 Akim Demaille <akim@epita.fr>
12790
12791 Extract calc++ from the documentation.
12792 * doc/bison.texinfo (Calc++): Add the extraction marks.
12793 * examples/extexi: New, from the aborted GNU Programming 2E.
12794 Separate the different paragraph of a file with empty lines.
12795 * examples/Makefile: Use it to extract the whole calc++ example.
12796
8a0adb01
AD
127972005-06-24 Akim Demaille <akim@epita.fr>
12798
12799 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
12800 class typedefs.
12801
12545799
AD
128022005-06-22 Akim Demaille <akim@epita.fr>
12803
12804 * doc/bison.texinfo (C++ Language Interface): First stab.
12805 (C++ Parsers): Remove.
12806
99be0235
AD
128072005-06-22 Akim Demaille <akim@epita.fr>
12808
12809 * data/lalr1.cc (yylex_): Honor %lex-param.
12810
0ffd4fd1
AD
128112005-06-22 Akim Demaille <akim@epita.fr>
12812
12813 Start a set of simple examples.
12814 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
12815 * examples/calc++/calc++-driver.hh,
12816 * examples/calc++/calc++-parser.yy,
12817 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
12818 * examples/calc++/compile, examples/calc++/test: New.
12819
0925ebb4
PE
128202005-06-09 Paul Eggert <eggert@cs.ucla.edu>
12821
12822 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
12823 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
12824 which stems from the 2005-05-27 patch.
12825
43d3b664
PH
128262005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
12827
12828 * data/glr.c: Modify treatment of unused parameters to permit use
12829 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
12830
3062864d
PE
128312005-05-30 Paul Eggert <eggert@cs.ucla.edu>
12832
12833 Fix infringement on user name space reported by Janos Zoltan Szabo.
12834 * data/yacc.c (yyparse): strlen -> yystrlen.
12835
989b5b8e
AD
128362005-05-30 Akim Demaille <akim@epita.fr>
12837
12838 * data/lalr1.cc (_): New.
12839 Translate the various messages.
12840
bedf57f5
PE
128412005-05-27 Paul Eggert <eggert@cs.ucla.edu>
12842
12843 Fix infringement on user name space reported by Bruno Haible.
12844 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
12845 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
12846 the user's name space.
12847 (alloca): Include <stdlib.h> to get it, if it's not built in.
12848 (YYMALLOC, YYFREE): Define only if needed.
12849 (malloc, free): Declare, but only if needed, as this infringes on
12850 the user name space.
12851
4d1801f1
PE
128522005-05-25 Paul Eggert <eggert@cs.ucla.edu>
12853
12854 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
12855 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
12856 with %d format.
12857 * lib/ebitset.c (min, max): Undef before defining.
12858 * lib/vbitset.c (min, max): Likewise.
12859 * lib/subpipe.c (create_subpipe): Save local variables in case
12860 vfork clobbers them.
12861
128622005-05-24 Bruno Haible <bruno@clisp.org>
12863
12864 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
12865 error message syntax used by gcc-4.0.
12866
b94a9e1e
PE
128672005-05-23 Paul Eggert <eggert@cs.ucla.edu>
12868
85ac3861
PE
12869 * README: Mention m4 1.4.3. Remove obsolete advice about
12870 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
12871
b94a9e1e
PE
12872 * bootstrap: Remove workaround for problem I encountered with
12873 gettext 0.14.1; it seems to be fixed now.
12874
51c30d21
PE
128752005-05-22 Paul Eggert <eggert@cs.ucla.edu>
12876
009ce67d
PE
12877 * NEWS: Version 2.0a.
12878
f2a97c62
PE
12879 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
12880 the previous change.
12881
c8775f93
PE
12882 Various maintainer cleanups.
12883 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
12884 conftest*, for benefit of CVS commands run at the same time as
12885 "configure". Add build-aux, since "bootstrap" now creates it and
12886 its subfiles.
12887 * Makefile.cfg (move_if_change): Remove.
12888 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
12889 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
12890 (po_repo, do-po-update, po-update, wget_files, get-targets):
12891 (config.guess-url_prefix, config.sub-url_prefix):
12892 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
12893 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
12894 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
12895 Remove.
12896 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
12897 this is now the recommended name.
12898 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
12899 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
12900 ylwrap. These files now go into build-aux.
12901 * config/move-if-change: Remove.
12902 * config/prev-version.txt: Bump from 1.75 to 2.0.
12903
3ea5f0ec
PE
12904 * bootstrap: Add stdio-safer, unistd-safer modules.
12905 Remove m4/glibc2.m4 (introduced by latest gnulib, but
12906 we don't need it).
12907 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
12908 fopen-safer.c, stdio-safer.h, unistd-safer.h.
12909 * lib/subpipe.c: Include "unistd-safer.h".
12910 (create_subpipe): Make sure all the newly-created
12911 file descriptors are > 2, so that diagnostics don't
12912 get sent down them (which might cause Bison to hang, in theory).
12913 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
12914 * src/files.c (xfopen): Use fopen_safer, not fopen.
12915
51c30d21
PE
12916 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
12917 yesterday's yacc.c fix.
12918
cea1469d
PE
129192005-05-21 Paul Eggert <eggert@cs.ucla.edu>
12920
3ea5f0ec
PE
12921 * data/glr.c, data/lalr1.cc: Update copyright date.
12922
cea1469d
PE
12923 Fix a destructor bug reported by Wolfgang Spraul in
12924 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
12925 * data/yacc.c (yyabortlab): Don't call destructor, and
12926 don't set yychar to EMPTY.
12927 (yyoverflowlab): Don't call destructor.
12928 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
12929 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
12930 since we no longer output the message "discarding lookahead token
12931 end of input ()".
12932
5e6f62f2
PH
129332005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12934
12935 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
12936 fix a small glitch in debugging output.
12937 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
12938 after YY_SYMBOL_PRINT where needed.
12939
12940 (struct yyGLRState): Add some comments.
12941 (struct yySemanticOption): Add some comments.
12942 (union yyGLRStackItem): Add comment.
12943
12944 (yymergeOptionSets): Correct this to properly perform the union,
12945 avoiding infinite reported by Michael Rosien.
12946 Update comment.
12947
12948 * tests/glr-regression.at: Add test for GLR merging error reported
12949 by M. Rosien.
cea1469d 12950
0fb669f9
PE
129512005-05-13 Paul Eggert <eggert@cs.ucla.edu>
12952
12953 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
12954 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
12955 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
12956 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
12957 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
12958 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
12959 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
12960 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
12961 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
12962 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
12963 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
12964 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
12965 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
12966 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
12967 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
12968 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
12969 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
12970 src/derives.h, src/files.c, src/files.h, src/getargs.c,
12971 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
12972 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
12973 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
12974 src/output.h, src/parse-gram.c, src/parse-gram.h,
12975 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
12976 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
12977 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
12978 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
12979 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
12980 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
12981 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
12982 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
12983 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
12984 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
12985 tests/reduce.at, tests/regression.at, tests/sets.at,
12986 tests/synclines.at, tests/testsuite.at, tests/torture.at:
12987 Update FSF postal mail address.
12988
51f4735e
PE
129892005-05-11 Paul Eggert <eggert@cs.ucla.edu>
12990
12991 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
12992 Problem reported by Ralf Menzel.
12993
80ce3401
PE
129942005-05-01 Paul Eggert <eggert@cs.ucla.edu>
12995
12996 * tests/actions.at: Test that stack overflow invokes destructors.
12997 From Marcus Holland-Moritz.
12998 * data/yacc.c (yyerrlab): Move the code that destroys the stack
12999 from here....
13000 (yyreturn): to here. That way, destructors are called properly
13001 even if the stack overflows, or the user calls YYACCEPT or
13002 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
13003 (yyoverflowlab): Destroy the lookahead.
13004
130052005-04-24 Paul Eggert <eggert@cs.ucla.edu>
13006
13007 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
13008
72f000b0
PE
130092005-04-17 Paul Eggert <eggert@cs.ucla.edu>
13010
13011 * NEWS: Bison-generated C parsers no longer quote literal strings
13012 associated with tokens.
13013 * src/output.c (prepare_symbols): Don't escape strings,
13014 since users don't want to see C escapes.
13015 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
13016 in diagnostics.
c19683bb 13017 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
13018 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
13019
1094323f
PE
130202005-04-16 Paul Eggert <eggert@cs.ucla.edu>
13021
13022 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
13023 the data size is known to be too small and we can't increase it.
13024 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
13025
ca407bdf
PE
130262005-04-15 Paul Eggert <eggert@cs.ucla.edu>
13027
13028 * src/parse-gram.y: Include quotearg.h.
13029 (string_as_id): Quote $1 before using it as a key, since the
13030 lexer no longer quotes it for us.
13031 (string_content): Don't strip quotes, since lexer no longer
13032 quotes it for us.
13033 * src/scan-gram.l: Include quotearg.h.
13034 ("\""): Omit quote.
13035 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
13036 a key, since the rest of the lexer doesn't quote it.
13037 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
13038 * tests/regression.at (Token definitions): Check for backslashes
13039 in token strings.
13040
13041 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
13042 (YYSIZE_T): Define to unsigned long int when using an older compiler.
13043 (yyparse): Revamp code to generate long syntax error message, to
13044 make it easier to translate, and to avoid problems with arithmetic
13045 overflow. Change "virtual memory" to "memory" in diagnostic, since
13046 we don't know whether the memory is virtual.
13047
1ce59070
PE
130482005-04-13 Paul Eggert <eggert@cs.ucla.edu>
13049
13050 * NEWS: Bison-generated C parsers now use the _ macro to
13051 translate strings.
13052 * data/yacc.c (_) [!defined _]: New macro.
13053 All English strings wrapped inside this macro.
13054 * doc/bison.texinfo (Bison Parser): Document _.
13055 * po/POTFILES.in: Include src/parse-gram.c, since it now
13056 includes translateable strings that parse-gram.y doesn't.
13057
a749a695
PE
130582005-04-12 Paul Eggert <eggert@cs.ucla.edu>
13059
13060 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
13061 reverting the 2004-10-11 change to this function.
13062 (symbol_check_alias_consistency): Don't call symbol_type_set
13063 if the type name is already correct.
13064 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
13065
8fb1053b
PE
130662005-03-25 Paul Eggert <eggert@cs.ucla.edu>
13067
13068 * tests/regression.at (Token definitions): Don't use a token named
13069 c, as that generates a "#define c ..." that runs afoul of buggy
13070 stdlib.h that uses the identifier c as a member of struct
13071 drand48_data. Problem reported by Horst Wente.
13072
ff498c4a
PE
130732005-03-21 Paul Eggert <eggert@cs.ucla.edu>
13074
13075 * bootstrap: Change translation URL from
13076 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
13077 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
13078 redirection glitches. Problem reported by twlevo@xs4all.nl.
13079
65211d70
PE
130802005-03-20 Paul Eggert <eggert@cs.ucla.edu>
13081
13082 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
13083 after operands; POSIX says this isn't portable for the c99 command.
13084
9577fb1f
PE
130852005-03-18 Paul Eggert <eggert@cs.ucla.edu>
13086
13087 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
13088 immediately if a data overrun has occurred; this may help us track
13089 down what may be a spurious failure on MacOS.
13090
78b178f7
PE
130912005-03-17 Paul Eggert <eggert@cs.ucla.edu>
13092
a2599d0f
PE
13093 Respond to problems reported by twlevo@xs4all.nl.
13094
13095 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
13096
78b178f7
PE
13097 * src/vcg.h: Comment fix.
13098 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
13099 (G_CMAX): Change to -1 instead of INT_MAX.
13100
13101 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 13102
7296e729
PE
131032005-03-15 Paul Eggert <eggert@cs.ucla.edu>
13104
13105 * src/tables.c (state_number_to_vector_number): Put it inside an
13106 "#if 0", since it's not currently used. Problem reported by
13107 Roland McGrath.
13108
05ac60f3
PE
131092005-03-06 Paul Eggert <eggert@cs.ucla.edu>
13110
13111 * src/output.c (escaped_output): Renamed from
13112 escaped_file_name_output, since we now use it for symbol tags as
13113 well. All uses changed.
13114 (symbol_destructors_output, symbol_printers_output):
13115 Escape symbol tags too.
13116 Problem reported by Matyas Forstner in
13117 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
13118
13119 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
13120 not needed.
13121 * src/output.c (user_actions_output, token_definitions_output,
13122 symbol_destructors_output, symbol_printers_output): Likewise.
13123 * src/reader.c (prologue_augment): Likewise.
13124 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
13125
13126 * src/vcg.c (output_edge): Don't quote linestyle arg.
13127 Problem reported by twlevo@xs4all.nl.
13128
7eb453ac
PE
131292005-02-28 Paul Eggert <eggert@cs.ucla.edu>
13130
13131 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
13132 example, reported by Derek M Jones. Also, make the example even
13133 more outrageous, to better illustrate how bad the problem is.
13134
4c04c52a
PE
131352005-02-24 Paul Eggert <eggert@cs.ucla.edu>
13136
13137 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
13138 putsym. Typo reported by Sebastian Piping.
13139
a61e1620
PE
131402005-02-23 Paul Eggert <eggert@cs.ucla.edu>
13141
13142 * doc/bison.texinfo (Language and Grammar): some -> same
13143 (Epilogue): int he -> in the
13144 Typos reported by Sebastian Piping via Justin Pence.
13145
9ec93868
PE
131462005-02-07 Paul Eggert <eggert@cs.ucla.edu>
13147
13148 * tests/glr-regression.at (Improper handling of embedded actions
13149 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
13150 embedded actions and $-N in GLR parsers", work around an Autoconf bug
13151 with dollar signs in test names.
13152 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
13153 for a similar reason.
13154
73ce7e7e
PE
131552005-01-28 Paul Eggert <eggert@cs.ucla.edu>
13156
13157 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
13158 wants to redefine G_VIEW.
13159
2e72b98e
PE
131602005-01-27 Paul Eggert <eggert@cs.ucla.edu>
13161
13162 * src/vcg.c (get_view_str): Remove case for normal_view.
13163 Problem reported by twlevo@xs4all.nl.
13164
e0d634e5
PE
131652005-01-24 Paul Eggert <eggert@cs.ucla.edu>
13166
ccf830a4
PE
13167 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
13168 Problem reported by twlevo@xs4all.nl.
13169
e0d634e5
PE
13170 * doc/bison.texinfo: Change @dircategory from "GNU programming
13171 tools" to "Software development". Requested by Richard Stallman
13172 via Karl Berry.
13173
7bbc8cb0
PE
131742005-01-23 Paul Eggert <eggert@cs.ucla.edu>
13175
13176 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
13177 Problem reported by twlevo@xs4all.nl.
13178
08b770bc
PE
131792005-01-21 Paul Eggert <eggert@cs.ucla.edu>
13180
13181 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
13182 keyword; it's not needed with modern compilers, and it doesn't
13183 affect correctness with older compilers. Suggested by
13184 twlevo@xs4all.nl.
13185
95f22ad2
PE
131862005-01-17 Paul Eggert <eggert@cs.ucla.edu>
13187
13188 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
13189 gcc -Wswitch-default.
13190 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
13191 * data/yacc.c (yyparse): Likewise.
13192
d229d15c
PE
131932005-01-12 Paul Eggert <eggert@cs.ucla.edu>
13194
13195 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
13196 already. Let config.h define any nonstandard values.
13197
ecadd90f
PE
131982005-01-10 Paul Eggert <eggert@cs.ucla.edu>
13199
13200 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
13201 for the benefit of slower hosts. Problem reported by
13202 Nelson H. F. Beebe.
13203
213744b5
PE
132042005-01-07 Paul Eggert <eggert@cs.ucla.edu>
13205
13206 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
13207 being defined and not used.
13208 * data/lalr1.cc (yyparse): Likewise.
13209 Use "if (false)" rather than "if (0)".
13210
249d3236
PE
132112005-01-05 Paul Eggert <eggert@cs.ucla.edu>
13212
13213 * TODO: Mention that we should allow NUL bytes in tokens.
13214
987cc1fb
PE
132152005-01-02 Paul Eggert <eggert@cs.ucla.edu>
13216
13217 * src/scan-skel.l (<<EOF>>): Don't close standard output.
13218 Problem reported by Hans Aberg.
13219
08fe02d9
PE
132202005-01-01 Paul Eggert <eggert@cs.ucla.edu>
13221
13222 * src/getargs.c (version): Happy new year; update overall
13223 program copyright date from 2004 to 2005.
13224
13225 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
13226 Problem reported by Hans Aberg.
13227 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
13228 (Output file names.): Add a test for the case when standard output
13229 is closed.
13230
010c0266
PE
132312004-12-26 Paul Eggert <eggert@cs.ucla.edu>
13232
13233 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
13234 to fix an oversight in the Bison 2.0 manual.
13235
da12206a
PE
132362004-12-25 Paul Eggert <eggert@cs.ucla.edu>
13237
13238 * NEWS: Version 2.0. Reformat the existing news items since
13239 1.875, so that related items are grouped together.
3a4734aa 13240 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
13241 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
13242
c935d934
PE
13243 * tests/torture.at (Exploding the Stack Size with Alloca): Set
13244 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
13245 otherwise, we're not testing alloca. Unfortunately there's no
13246 simple way to consult HAVE_ALLOCA here.
13247
da12206a
PE
13248 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
13249 for yymsg, too.
13250
13251 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
13252 hand. This avoids a warning about comparing int to size_t when
13253 GCC warnings are enabled.
13254
0a2c5137
PE
132552004-12-22 Paul Eggert <eggert@cs.ucla.edu>
13256
d7e14fc0
PE
13257 * NEWS: Bison-generated parsers no longer default to using the
13258 alloca function (when available) to extend the parser stack, due
13259 to widespread problems in unchecked stack-overflow detection.
13260 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
13261 responsibility to set it to a positive value. This lets the user
13262 specify a value that is not a preprocessor constant.
13263 * data/yacc.c (YYMAXDEPTH): Likewise.
13264 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
13265 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
13266 to be a compile-time constant. However, explain the constraints on it.
13267 Also, explain the constraints on YYINITDEPTH.
13268 (Table of Symbols): Explain that alloca is no longer the default.
13269 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
13270 to 1.
13271
0a2c5137
PE
13272 * doc/bison.texinfo (Location Default Action): Mention that n must
13273 be zero when k is zero. Suggested by Frank Heckenbach.
13274
e019c247
AD
132752004-12-22 Akim Demaille <akim@epita.fr>
13276
13277 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
13278 (parser::state_type, parser::semantic_type, parser::location_type):
13279 Private, not public.
13280 (parser::parse): Return ints, not bool.
13281 Returning a bool introduces a problem: 0 corresponds to false, and
13282 it seems weird to return false on success. Returning true changes
13283 the conventions for yyparse.
13284 Alternatively we could return void and send an exception.
13285 There is no clear consensus (yet?).
13286 (state_stack, semantic_stack, location_stack): Rename as...
13287 (state_stack_type, semantic_stack_type, location_stack_type): these.
13288 Private, not public.
13289 * tests/c++.at: New.
13290 * tests/testsuite.at, tests/Makefile.am: Adjust.
13291
72731bb7
AD
132922004-12-21 Akim Demaille <akim@epita.fr>
13293
13294 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
13295
9a0d8bec
AD
132962004-12-21 Akim Demaille <akim@epita.fr>
13297
13298 Don't impose std::string for filenames.
13299
13300 * data/lalr1.cc (b4_filename_type): New.
13301 (position::filename): Use it.
13302 (parser.hh): Move the inclusion of stack.hh and location.hh below
13303 the user code, so that needed headers for the filename type can be
13304 included first.
72731bb7
AD
13305 Forward declare them before the user code.
13306 * tests/Makefile.am (check-local, installcheck-local): Pass
13307 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 13308
99880de5
AD
133092004-12-20 Akim Demaille <akim@epita.fr>
13310
13311 Use more STL like names: my_class instead of MyClass.
13312
13313 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
13314 (SemanticStack, SemanticType, StateStack, StateType)
13315 (TokenNumberType, Stack, Slice, Traits, Parser::location)
13316 (Parser::value): Rename as...
13317 (location_stack, location_type, rhs_number_type, semantic_stack)
13318 (semantic_type, state_stack, state_type, token_number_type, stack)
13319 (slice, traits, parser::yylloc, parser::yylval): these.
13320
13321 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
13322
9bec482e
PE
133232004-12-19 Paul Eggert <eggert@cs.ucla.edu>
13324
13325 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
13326 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
13327
f6fbd3da
PE
133282004-12-17 Paul Eggert <eggert@cs.ucla.edu>
13329
13330 Remove uses of 'short int' and 'unsigned short int'. This raises
13331 some arbitrary limits. It uses more memory but nowadays that's
13332 not much of an issue.
13333
13334 This change does not affect the generated parsers; that's a different
13335 task, as some users will want to conserve memory there.
13336
13337 Ideally we should use size_t to represent all object counts, and
13338 something like ptrdiff_t to represent signed differences of object
13339 counts; but that will require more code-cleanup than I have the
13340 time to do right now.
13341
13342 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
13343 Use size_t, not int or short int, to count objects.
13344 * src/closure.c (nritemset, closure): Likewise.
13345 * src/closure.h (nritemset, closure): Likewise.
13346 * src/nullable.c (nullable_compute): Likewise.
13347 * src/print.c (print_core): Likewise.
13348 * src/print_graph.c (print_core): Likewise.
13349 * src/state.c (state_compare, state_hash): Likewise.
13350 * src/state.h (struct state): Likewise.
13351 * src/tables.c (default_goto, goto_actions): Likewise.
13352
13353 * src/gram.h (rule_number, rule): Use int, not short int.
13354 * src/output.c (prepare_rules): Likewise.
13355 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
13356 errs, reductions): Likewise.
13357 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
13358 Likewise.
13359 * src/tables.c (vector_number, tally, action_number,
13360 ACTION_NUMBER_MINIMUM): Likewise.
13361 * src/output.c (muscle_insert_short_int_table): Remove.
13362
efeed023
AD
133632004-12-17 Akim Demaille <akim@epita.fr>
13364
13365 * data/lalr1.cc: Extensive Doxygenation.
13366 (error_): Rename as...
13367 (error): this, since it is visible to the user.
13368 Adjust callers.
13369 (Parser::message): Now an automatic variable from...
13370 (Parser::yyreport_syntax_error_): here.
13371 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
13372 Parser::error.
13373 * tests/input.at: Escape $.
13374
bc82c5a5
PE
133752004-12-16 Paul Eggert <eggert@cs.ucla.edu>
13376
13377 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
13378 Parenthesize rhs to avoid obscure problems with mistakes like
13379 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
13380 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
13381 b4_rhs_location): Likewise.
13382 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
13383 b4_rhs_location): Likewise.
13384
fd19f271
AD
133852004-12-16 Akim Demaille <akim@epita.fr>
13386
13387 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
13388 yacc.c: be sure to stay within yycheck_.
13389 * tests/actions.at: Re-enable C++ tests.
13390
10454ea4
AD
133912004-12-16 Akim Demaille <akim@epita.fr>
13392
13393 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
13394 real.
13395
c5b95ccf
AD
133962004-12-16 Akim Demaille <akim@epita.fr>
13397
13398 Use #define to handle the %name-prefix.
13399
13400 * data/glr.c, data/yacc.c: Comment changes.
13401 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
13402 so that one can refer to yylex in the parser file, and have it
13403 renamed, as is the case with other skeletons.
13404
617a8f12
AD
134052004-12-16 Akim Demaille <akim@epita.fr>
13406
13407 Move lalr1.cc internals into yy*.
13408
13409 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
13410 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
13411 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
13412 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
13413 (empty_, final_, terror_, errcode_, ntokens_)
13414 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
13415 (looka_, ilooka_, error_range_, nerrs_):
13416 Rename as...
13417 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
13418 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
13419 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
13420 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
13421 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
13422 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
13423 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
13424 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
13425 these.
13426
1e547e6e
PE
134272004-12-15 Paul Eggert <eggert@cs.ucla.edu>
13428
13429 Fix some problems reported by twlevo at xs4all.
13430 * src/symtab.c (symbol_new): Report an error if the input grammar
13431 contains too many symbols. This is better than calling abort() later.
13432 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
13433 (struct node, struct graph):
13434 Rename member expand to stretch. All uses changed.
13435 (struct graph): Remove member layoutalgorithm. All uses removed.
13436 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
13437 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
13438 All uses changed.
13439 (N_STRETCH): Rename from N_EXPAND. All uses changed.
13440
735d6bd4
AD
134412004-12-15 Akim Demaille <akim@epita.fr>
13442
13443 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
13444 Add more Doxygen comments.
13445 (symprint_, stack_print_, reduce_print_, destruct_, pop)
13446 (report_syntax_error_, translate_): Rename as...
13447 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
13448 (yypop_, yyreport_syntax_error_, yytranslate_): this.
13449
2e1f5829
AD
134502004-12-15 Akim Demaille <akim@epita.fr>
13451
13452 * data/lalr1.cc (lex_): Rename as...
13453 (yylex_): this.
13454 Move the trace here.
13455 Take the %name-prefix into account.
13456 Reported by Alexandre Duret-Lutz.
13457
a3cb6248
AD
134582004-12-15 Akim Demaille <akim@epita.fr>
13459
13460 Simplify the C++ parser constructor.
13461
13462 * data/lalr1.cc (debug_): Rename as...
13463 (yydebug_): so that the parser's internals are always in the yy*
13464 pseudo namespace.
13465 Adjust uses.
13466 (b4_parse_param_decl): Remove the leading comma as it is now only
13467 called as unique argument list.
13468 (Parser::Parser): Remove the constructor accepting a location and
13469 an initial debugging level.
13470 Remove from the other ctor the argument for the debugging level.
13471 (debug_level_type, debug_level, set_debug_level): New.
13472
13473 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
13474 constructor calls.
13475
07fed891
AD
134762004-12-15 Akim Demaille <akim@epita.fr>
13477
13478 Remove b4_root related material: failure experiment
a3cb6248 13479 (which goal was to allow to derive from a class).
07fed891
AD
13480
13481 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
13482 definitions and uses.
13483
e603eaa5
PE
134842004-12-14 Paul Eggert <eggert@cs.ucla.edu>
13485
13486 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
13487 not 2, since it's not portable to subtract 1 from the start of an
13488 array. The new item 0 is never set or used. All uses changed.
13489
13490 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
13491 the default definition of YYLLOC_DEFAULT. Problem reported
13492 by Frank Heckenbach.
13493
fafb007d
PE
134942004-12-12 Paul Eggert <eggert@cs.ucla.edu>
13495
13496 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
13497 the normal case and one for the error case. Just use the
13498 first one uniformly. Problem reported by Frank Heckenbach.
13499 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
13500 use exactly the same macro in both places.
13501 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
13502 so that the normal-case YYRHSLOC works for the error case too.
13503 All uses changed.
13504 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
13505 (YYLLOC_DEFAULT): Use the same macro as glr.c.
13506 * doc/bison.texinfo (Location Default Action): Don't claim that
13507 we have an array of locations. Use the same macro for both glr
13508 and lalr parsers. Mention YYRHSLOC. Mention what happens when
13509 the index is 0.
13510
48814dcd
PE
135112004-12-10 Paul Eggert <eggert@cs.ucla.edu>
13512
a4e1a53b
PE
13513 * HACKING: Update email addresses to send announcements to.
13514
48814dcd
PE
13515 * configure.ac (AC_INIT): Bump version to 1.875f.
13516
337116ba
PE
135172004-12-10 Paul Eggert <eggert@cs.ucla.edu>
13518
13519 * NEWS: Version 1.875e.
13520 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
13521
13522 * src/scan-skel.l: Include "complain.h", for "fatal".
13523
13524 * src/relation.h (relation_print, relation_digraph):
13525 Relation sizes are of type relation_node, not size_t (this is
13526 merely a doc fix, since the two types are equivalent).
13527 (relation_transpose): Relation sizes are of type relation_node,
13528 not int.
13529 * src/relation.c: Likewise.
13530 (top, infinity): Now of type relation_node, not int.
13531 (traverse, relation_transpose): Use relation_node, not int.
13532
13533 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
13534 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
13535 (yyparse): Remove unused local introduced in 2004-10-25 patch.
13536
13537 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 13538 specifying whether the test should be skipped. Use it tp
337116ba 13539 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 13540 fail on some hosts, and should be skipped.
337116ba 13541
da2a7671
PE
135422004-12-08 Paul Eggert <eggert@cs.ucla.edu>
13543
13544 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
13545 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
13546 unless otherwise specified below.
13547
13548 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
13549 to allocate kernel_base, kernel_items, kernel_size, since
13550 they needn't be initialized to 0.
13551 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
13552 * src/closure.c (new_closure): Likewise, for itemset.
13553 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
13554 * src/lalr.c (set_goto_map): Likewise, for temp_map.
13555 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
13556 (build_relations): Likewise for edge, states1, includes.
13557 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
13558 * src/reader.c (packgram): Likewise, for ritem, rules.
13559 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
13560 * src/relation.c (relation_digraph): Likewise for VERTICES.
13561 (relation_transpose): Likewise for new_R, end_R.
13562 * src/symtab.c (symbols_token_translations_init): Likewise for
13563 token_translations.
13564 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
13565 (token_actions): Likewise for yydefact, actrow, conflrow,
13566 conflict_list.
13567 (save_column): Likewise for froms[symno], tos[symno].
13568 (goto_actions): Likewise for state_count.
13569 (pack_table): Likewise for base, pos, check.
13570 (tables_generate): Likewise for width.
13571
13572 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
13573 for initial core. Just have a separate core, so we needn't worry
13574 about whether kernel_size and kernel_base are initialized.
13575
13576 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
13577 kernel_size, kernel_items): Remove unnecessary initialization.
13578 * src/conflicts.c (conflicts): Likewise.
13579 * src/derives.c (derives): Likewise.
13580 * src/muscle_tablc (muscle_insert): Likewise.
13581 * src/relation.c (relation_digraph): Likewise.
13582 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
13583 conflrow, conflict_table, conflict_list, table, check):
13584 Likewise.
13585
13586 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
13587 This is because all callers pass unsigned int.
13588 * src/closure.h (new_closure): Likewise.
13589
13590 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
13591 (build_relations): Initialize includes[i] in all cases.
13592 * src/reader.c (packgram): Always initialize rules[ruleno].prec
13593 and rules[ruleno].precsym. Initialize members in order.
13594 * src/relation.c (relation_transpose): Always initialize new_R[i]
13595 and end_R[i].
13596 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
13597
13598 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
13599 conflict_list[0] was always 0, but now it isn't initialized.
13600
13601 * src/table.c (table_grow): When conflict_table grew, the grown
13602 area wasn't cleared. Fix this.
13603
13604 * lib/.cvsignore: Add strdup.c, strdup.h.
13605 * m4/.cvsignore: Add strdup.m4.
13606
00baeeac
PE
136072004-12-07 Paul Eggert <eggert@cs.ucla.edu>
13608
13609 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
13610 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
13611 GOTO_NUMBER_MAXIMUM, since we occasionally compute
13612 ngotos + 1 without checking for overflow.
13613 (build_relations): Use END_NODE, not -1, to denote end of edges.
13614 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
13615 build_relations): Use goto_number, not int, for goto numbers.
13616 * src/tables.c (save_column, default_goto): Likewise.
13617
be3d9d42
AD
136182004-11-23 Akim Demaille <akim@epita.fr>
13619
13620 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
13621 of #defining from yystype.
13622 Don't typedef yystype, C++ does not need it.
13623 This lets it possible to forward declare it as union.
13624
78e526d5
PE
136252004-11-23 Paul Eggert <eggert@cs.ucla.edu>
13626
13627 * bootstrap (gnulib_modules): Add extensions.
13628 Problem reported by Jim Meyering.
13629
afbb696d
PE
136302004-11-22 Paul Eggert <eggert@cs.ucla.edu>
13631
13632 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
13633 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
13634 src/system.h, src/tables.c: XFREE -> free, to accommodate
13635 recent change to gnulib xalloc.h.
78e526d5 13636 Problem reported by Jim Meyering.
afbb696d 13637
c1f8f16a
AD
136382004-11-17 Akim Demaille <akim@epita.fr>
13639
13640 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
13641
db7e5eb5 136422004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
13643 Alexandre Duret-Lutz <adl@gnu.org>
13644
13645 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
13646 changes.
13647 (YYCDEBUG): Adjust.
13648 Use it instead of cdebug_.
13649 (Parser::debug_stream, Parser::set_debug_stream): New.
13650 (Parser::symprint_): Define cdebug_ for temporary backward
13651 compatibility.
13652 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
13653 debug_stream ().
13654
68e11668
AD
136552004-11-17 Akim Demaille <akim@epita.fr>
13656
13657 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
13658 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
13659 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
13660 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
13661
97cbc73e
PE
136622004-10-27 Paul Eggert <eggert@cs.ucla.edu>
13663
13664 * data/glr.c (yyloc_default): Remove; not used.
13665 Problem reported by Frank Heckenbach.
13666
e342c3be
AD
136672004-10-25 Akim Demaille <akim@epita.fr>
13668
13669 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
13670 Introduce another definition to address simple location arrays.
13671 (yyGLRStack): New member: yyerror_range.
13672 (yyrecoverSyntaxError, yyparse): Update it.
13673 (yyrecoverSyntaxError): Use it when shifting the error token to
13674 have an accurate range, equivalent to the one computed by both
13675 yacc.c and lalr1.cc.
13676 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
13677 that column numbers start at column 0, as per GNU Coding
13678 Standards, the others tests, and the doc.
13679 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
13680 Adjust to the above change (first column is 0).
13681 And adjust the location of the "<error>", now covering the whole
13682 line.
13683
93602feb 136842004-10-22 Akim Demaille <akim@epita.fr>
04098407 13685 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
13686
13687 Remove some arbitrary limits on goto numbers and relations.
13688 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
13689 initial values, since they're never used.
13690 (set_goto_map): ngotos is now unsigned, so test for overflow
13691 by seeing whether it wraps around to zero.
13692 * src/lalr.h (goto_number): Now size_t, not short int.
13693 (GOTO_NUMBER_MAXIMUM): Remove.
13694 * src/relation.c (relation_print, traverse, relation_transpose):
13695 Check for END_NODE rather than looking at sign.
13696 * src/relation.h (END_NODE): New macro.
13697 (relation_node): Now size_t, not short int.
13698
dba08b04
PE
136992004-10-22 Paul Eggert <eggert@cs.ucla.edu>
13700
13701 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
13702 keyword, not an identifier. Problem reported by Baron Schwartz in
13703 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
13704
df09ef2e
AD
137052004-10-11 Akim Demaille <akim@epita.fr>
13706
13707 * src/symtab.c (symbol_check_alias_consistency): Also check
13708 type names, destructors, and printers.
13709 Reported by Alexandre Duret-Lutz.
13710 Recode the handling of associativity and precedence in terms
13711 of symbol_precedence_set.
13712 Accept no redeclaration at all, not even equal to the previous
13713 value.
13714 (redeclaration): New.
13715 Use it to factor redeclaration complaints.
13716 (symbol_make_alias): Don't set the type of the alias, let
13717 symbol_check_alias_consistency do it as for other features.
13718 * src/symtab.h (symbol): Add new member prec_location, and
13719 type_location.
13720 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
13721 * tests/input.at (Incompatible Aliases): New.
13722
146bc99d
PE
137232004-10-09 Paul Eggert <eggert@cs.ucla.edu>
13724
13725 .cvsignore fixes to accommodate gnulib changes,
13726 and the practice of naming build directories "_build".
13727 * .cvsignore: Add "_*". Sort.
13728 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
13729 * m4/.cvsignore: Add "*_gl.m4".
13730
e503aa60
AD
137312004-10-06 Akim Demaille <akim@epita.fr>
13732
13733 * src/parse-gram.y (add_param): Fix the truncation of trailing
13734 spaces.
13735
b4a20338
AD
137362004-10-05 Akim Demaille <akim@epita.fr>
13737
13738 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
13739 whether the reducion was empty or not. This leaves room to
13740 improve the use of YYLLOC_DEFAULT in such a case.
13741 lalr1.cc is still experimental, so changing this is acceptable.
13742 And finally, there are probably not many users who changed the
13743 handling of locations in GLR, so changing is admissible too.
13744
13745 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
13746 empty reduction, set @$ to an empty location ending the previously
13747 stacked symbol.
13748 Adjust uses to make sure the code is triggered on empty
13749 reductions.
13750 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
13751 expected output: empty reductions have empty locations.
13752
f85a5e6f
AD
137532004-09-29 Akim Demaille <akim@epita.fr>
13754
13755 * data/lalr1.cc: Move towards a more standard C++ coding style
13756 for templates: Class < T > -> Class<T>.
13757
b203fc2c
AD
137582004-09-29 Akim Demaille <akim@epita.fr>
13759
13760 * data/lalr1.cc: Reinstall the former ctor, for sake of
13761 compatibility, but warn it will be removed.
13762 Move towards a more standard C++ coding style (i.e., type *var ->
13763 type* var).
13764
5b7e1e73
PE
137652004-09-27 Paul Eggert <eggert@cs.ucla.edu>
13766
3fee967f
PE
13767 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
13768 since it's less likely to work if NULs are involved in the future.
5b7e1e73 13769
0dcca5c2
AD
137702004-09-27 Akim Demaille <akim@epita.fr>
13771
13772 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
13773
6dde1c82
AD
137742004-09-27 Akim Demaille <akim@epita.fr>
13775
13776 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 13777 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
13778 and argument names.
13779 (b4_cc_constructor_call): Likewise.
13780
b233d555
AD
137812004-09-24 Akim Demaille <akim@epita.fr>
13782
13783 * src/parse-gram.y (add_param): Strip the leading and trailing
13784 blanks from a formal argument declaration.
13785 (YY_LOCATION_PRINT): New.
13786
619404e3
AD
137872004-09-24 Akim Demaille <akim@epita.fr>
13788
13789 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
13790 after the location.
13791
dd8d9022
AD
137922004-09-24 Akim Demaille <akim@epita.fr>
13793
13794 * doc/bison.texinfo (Table of Symbols): Sort.
13795
0092f063
AD
137962004-09-21 Akim Demaille <akim@epita.fr>
13797
13798 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
13799 the useless parentheses.
13800 Suggested by Paul Eggert.
13801
451364ed
AD
138022004-09-20 Akim Demaille <akim@epita.fr>
13803
13804 Let the initial-action act on the look-ahead, and use it for the
13805 "initial push" (corresponding to an hypothetical beginning-of-file).
13806 And let lalr1.cc honor %initial-action.
13807
13808 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
13809 example.
13810 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
13811 (Parser::Parser): Remove the ctor that used to initialize it.
13812 (Parser::parse): Like in the other skeletons, issue the "starting
13813 parse" message before any action.
13814 Honor %initial-action.
13815 Initialize the stacks with the lookahead.
13816 * data/yacc.c: Let $$ and @$ in %initial-action designate the
13817 look-ahead.
13818 Push them in the stacks.
13819 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
13820
18d192f0
AD
138212004-09-20 Akim Demaille <akim@epita.fr>
13822
13823 * doc/bison.texinfo (Initial Action Decl): New.
13824
b8458aa5
AD
138252004-09-20 Akim Demaille <akim@epita.fr>
13826
13827 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
13828 clearer criterion to define it.
13829 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
13830 When reducing on an empty RHS, use the latest stacked location as
13831 location.
13832 yylloc is not always available.
13833 * data/glr.c: Likewise.
13834 Also, honor initial-actions.
13835
3fc16193
AD
138362004-09-20 Akim Demaille <akim@epita.fr>
13837
13838 * data/yacc.c (YY_LOCATION_PRINT): New.
13839 Define when we know YYLTYPE's structure, i.e., when the default
13840 YYLLOC_DEFAULT is used.
13841 * data/c.m4 (b4_yysymprint_generate): Use it.
13842 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
13843 value of the result.
13844 (error_start_): Replace with...
13845 (error_range_): this location array.
13846 This allows to replace code relying on the implementation of
13847 locations by portable code.
13848 * data/yacc.c (yylerrsp): Replace with...
13849 (yyerror_range): this.
13850 Every time a token is popped, update yyerror_range[0], to have an
13851 accurate location for the error token.
13852 * data/glr.c (YY_LOCATION_PRINT): New.
13853 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
13854 deference a pointer.
13855 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
13856 report the location in %printers.
13857
13858 * src/scan-skel.l: Instead of abort, report error messages to ease
13859 understanding skeleton scanning failures.
13860
ecfe33e7
AD
138612004-09-16 Akim Demaille <akim@epita.fr>
13862
13863 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
13864 (iterator, const_iterator): these, to be more in the C++ spirit.
13865 Also, return reverse iterators so that when displaying the stack
13866 we display its bottom first.
13867 (Parser::stack_print_, Parser::reduce_print_): Match the messages
13868 from yacc.c.
13869 We should probably use vector here though.
13870
1576d44d
AD
138712004-09-16 Akim Demaille <akim@epita.fr>
13872
13873 Have more complete shift traces.
13874
13875 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
13876 to report Shifts instead of ad hoc YYDPRINTF invocations,
13877 including for the error token.
13878 * data/lalr1.cc (symprint_): Output the location.
13879 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
13880 output the location within the %printer.
13881 Activate GLR tests, at least to make sure they compile properly.
13882 They still don't pass though.
13883 * tests/calc.at: Adjust expect verbose output, since now "Entering
13884 state..." is on a different line than the "Shifting" message.
13885
9c66f418
AD
138862004-09-08 Akim Demaille <akim@epita.fr>
13887
13888 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
13889 Bison directive from the Bison file to the invocation of this
13890 macro, so that these directives are passed to
13891 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
13892 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
13893 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
13894 the extra Bison directives instead of the whole series.
13895 Change the grammar so that there are recoverable errors, and
13896 unrecoverable errors. Now we can have the parser give up before
13897 consuming the whole input. As a result we now can observe that
13898 the lookahead is freed when needed.
13899 Change the parser source to parse argv[1] instead of a hard coded
13900 string.
13901 Simplify yylex, and give a value and location to EOF.
13902 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
13903 passed directives already coded in the file.
13904 Add some tests to check the location of "error".
13905 For some tests, the C++ parser is correct, and not yacc.c.
13906 For other tests, they provide different, but unsatisfying, values,
13907 so keep the C++ value so that at least one parser is "correct"
13908 according to the test suite.
13909 (Actions after errors): Remove, this is subsumed by the
13910 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
13911
52d5733f
AD
139122004-09-06 Akim Demaille <akim@epita.fr>
13913
13914 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 13915 (Parser::pop): New.
52d5733f
AD
13916 Use it.
13917
a0e68930
AD
139182004-09-06 Akim Demaille <akim@epita.fr>
13919
13920 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
13921 argument, an informative message.
13922 Call YY_SYMBOL_PRINT.
13923 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
13924 * data/lalr1.cc (destruct_): Likewise.
13925 In addition, no longer depend on b4_yysymprint_generate and
13926 b4_yydestruct_generate to generate these functions, do it "by
13927 hand".
13928
e757bb10
AD
139292004-09-03 Akim Demaille <akim@epita.fr>
13930
13931 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
13932 invoked, yydestruct the lookahead.
13933 * tests/calc.at (Calculator $1): Update the expected lengths of
13934 traces: there is an added line for the discarded lookahead.
13935 * doc/bison.texinfo (Destructor Decl): Some rewording.
13936 Define "discarded" symbols.
13937
0fe1f06d
AD
139382004-09-02 Akim Demaille <akim@epita.fr>
13939
13940 * data/lalr1.cc (translate_, destruct_): No reason to be static.
13941
284acc8b
AD
139422004-09-02 Akim Demaille <akim@epita.fr>
13943
13944 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
13945 (YYDSYMPRINTF): Rename as...
13946 (YY_SYMBOL_PRINT): this.
13947 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
13948 two.
13949 Use it instead of direct symprint_ calls.
13950 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
13951 one.
13952
a5eb1ed2
AD
139532004-09-02 Akim Demaille <akim@epita.fr>
13954
b7c72fe1
AD
13955 * data/lalr1.cc (b4_yysymprint_generate): New.
13956 (symprint_): New member function, defined when YYDEBUG.
13957 Use it consistently instead of token/nterm debugging output by
13958 hand.
a5eb1ed2
AD
13959 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
13960 %printer calls to use cdebug_ when using lalr1.cc.
13961
417141dd
AD
139622004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
13963
13964 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
13965 with #ifdef YYDEBUG.
13966
2fa09258
AD
139672004-08-26 Akim Demaille <akim@epita.fr>
13968
13969 * doc/bison.texinfo (Implementing Loops): Rename as...
13970 (Implementing Gotos/Loops): this.
13971
9378b508
PE
139722004-08-13 Paul Eggert <eggert@cs.ucla.edu>
13973
13974 Adjust to latest gnulib.
13975 * bootstrap (gnulib_modules): Add xalloc-die.
13976 Set LC_ALL=C so that file names sort consistently.
13977 Prefer the gnulib copies of gettext.m4, glibc21.m4,
13978 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
13979 uintmax_t.m4, ulonglong.m4.
13980 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
13981 po.m4 since we are now using _gl.m4 instead.
13982
87a8ad5c
PE
139832004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
13984
13985 * src/scan-action.l: Remove. Scanning of semantic actions is
13986 handled in scan-gram.l.
13987
dca81a78
PE
139882004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
13989
13990 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
13991
13992 * src/location.h (struct): The file member is a uniqstr.
13993 (equal_boundaries): Use UNIQSTR_EQ for comparison.
13994
c9cbf7c5
PE
139952004-07-22 Paul Eggert <eggert@cs.ucla.edu>
13996
13997 Fix bug with non-%union parsers that have printers or destructors,
13998 which led to a Bison core dump. Reported by Peter Fales in
13999 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 14000
c9cbf7c5
PE
14001 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
14002 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
14003 not to our own type.
14004 * src/output.c (symbol_destructors_output, symbol_printers_output):
14005 Don't assume %union.
14006 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
14007 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
14008 UNION-FLAG. All callers changed.
14009 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
14010 Use type char, not unsigned int, when declaring an array of char;
14011 this lets us remove a cast.
14012 (Printers and Destructors): Add non-%union test cases.
14013
fa7e68c3
PE
140142004-06-21 Paul Eggert <eggert@cs.ucla.edu>
14015
14016 * doc/bison.texinfo: Minor editorial changes, mostly to the new
14017 GLR writeups. E.g., avoid frenchspacing and the future tense,
14018 change "lookahead" to "look-ahead", and change "wrt" to "with
14019 respect to".
2fa09258 14020
fa7e68c3
PE
140212004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
14022
14023 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
14024 New sections, split off from the GLR Parsers section. Put the new
14025 Simple GLR Parser near the start of the GLR section, for clarity.
14026 Rewrite connective text.
14027
99a9344e
PE
140282004-06-21 Frank Heckenbach <frank@g-n-u.de>
14029
14030 * doc/bison.texinfo (Simple GLR Parsers): New section.
14031
8dd162d3
PE
140322004-06-21 Paul Eggert <eggert@cs.ucla.edu>
14033
14034 * NEWS, TODO, doc/bison.texinfo:
14035 Use "look-ahead" instead of "lookahead", to be consistent.
14036 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
14037 while we're fixing "look-ahead".
14038 * src/conflicts.c (shift_set): Renamed from shiftset.
14039 (look_ahead_set): Renamed from lookaheadset.
14040 * src/print.c: Likewise.
14041 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
14042 name for "lookahead".
14043 (report_types, usage): Likewise.
14044 * src/getargs.h (report_look_ahead_tokens): Renamed from
14045 report_lookaheads.
14046 * src/lalr.c (compute_look_ahead_tokens): Renamed from
14047 compute_lookaheads.
14048 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
14049 (look_ahead_tokens_print): Renamed from lookaheads_print.
14050 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
14051 state_rule_lookaheads_print.
14052 * src/state.h: Likewise.
14053 (reductions.look_ahead_tokens): Renamed from lookaheads.
14054 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
14055 AT_DATA_LOOKAHEADS_GRAMMAR.
14056
57a90331
PE
140572004-06-03 Paul Eggert <eggert@cs.ucla.edu>
14058
14059 * README: Update location of patched M4 distribution.
14060
8ed3234a
PE
140612004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
14062
14063 Don't assume the C++ compiler takes the same arguments as the C compiler
14064 (trivial change).
14065 * configure.ac (O0CXXFLAGS): New var.
14066 * tests/atlocal.in (CXXFLAGS): Use it.
14067
07971983
PE
140682004-05-29 Paul Eggert <eggert@cs.ucla.edu>
14069
14070 Fix some "make check" problems with C++ reported by
14071 Albert Chin-A-Young for Tru64 C++ in this thread:
14072 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
14073
14074 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
14075 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
14076 Output to a .cc file for C++, not to a .c file.
14077 * tests/calc.at (AT_CHECK_CALC): Likewise.
14078 * tests/regression.at (AT_CHECK_DANCER): Likewise.
14079 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
14080
29058652
PE
140812004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
14082
14083 * tests/calc.at, tests/actions.at: Workaround for SGI
14084 C++ compiler. (trivial change)
14085
62cb8a99
PE
140862004-05-27 Paul Eggert <eggert@cs.ucla.edu>
14087
fd418816
PE
14088 Spent a few hours checking out which prerequisite versions the
14089 current sources actually require. I went all the way back to
14090 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
14091 a seemingly endless set of combinations of versions more recent
14092 than that. The bottom line is that the current sources require
14093 fairly recent versions of the build tools, and it'll be some work
14094 to change this.
14095 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
14096 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
14097 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
14098 Add comments explaining why those particular versions are
14099 currently needed.
2fa09258 14100
62cb8a99
PE
14101 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
14102 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 14103 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
14104
14105 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
14106 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
14107
caa52c10
PE
141082004-05-26 Paul Eggert <eggert@cs.ucla.edu>
14109
14110 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
14111 0.11.5. Suggested by Bruno Haible.
14112 * bootstrap: Remove gettext version checking.
14113
14114 * doc/bison.texinfo (Decl Summary): Also mention that %union
14115 can depend on prerequisite types. Problem reported by Tim
14116 Van Holder.
14117
4bfd5e4e
PE
141182004-05-25 Paul Eggert <eggert@cs.ucla.edu>
14119
2cef3017
PE
14120 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
14121 * README-alpha: Don't tell people not to package this.
14122
b9c85d5c
PE
14123 * bootstrap: Don't assume $(...) works; use `...` instead.
14124 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
14125 gettext better.
14126
4bfd5e4e
PE
14127 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
14128 put into the -d output file, and mention what to do if YYSTYPE is
14129 defined as a macro.
14130
6a36ff94
PE
141312004-05-24 Paul Eggert <eggert@cs.ucla.edu>
14132
6712933e
PE
14133 Undo change made earlier today: it caused autopoint to not bring
14134 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
14135 autopoint's.
14136
14137 * bootstrap: Check that gettext version matches what's in
14138 configure.ac. Warn users to ignore robots.txt ERROR 404.
14139 * bootstrap: Undo today's earlier change (logged below).
14140 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 14141
6a36ff94
PE
14142 The gettext version checking is causing more trouble than it's
14143 curing; remove it. Problem reported by Paul Hilfinger.
14144
14145 * bootstrap: Issue a warning that one can expect a message
14146 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
14147 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
14148
209ea708
PE
141492004-05-23 Paul Eggert <eggert@cs.ucla.edu>
14150
14151 Ensure that the C++ compiler used for testing actually works on a
14152 simple test program; if not, skip the C++-related tests. Problem
14153 reported by Vin Shelton in:
161a71f3 14154 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
14155
14156 * m4/cxx.m4: New file.
14157 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
14158 * tests/atlocal.in (BISON_CXX_WORKS): Add.
14159 * tests/local.at (AT_COMPILE_CXX): Use it.
14160
41ca2549
PE
141612004-05-21 Paul Eggert <eggert@cs.ucla.edu>
14162
383e69dc
PE
14163 * data/glr.c (yylloc): Output this macro even if locations are not
14164 being generated, as the GLR parser needs it even in that case.
14165 Problem reported by Troy A. Johnson
14166 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
14167
41ca2549
PE
14168 * configure.ac (AC_INIT): Update to 1.875e.
14169
e476c87d
PE
141702004-05-21 Paul Eggert <eggert@cs.ucla.edu>
14171
14172 * NEWS: Version 1.875d.
14173 * configure.ac (AC_INIT): Likewise.
14174 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
14175
14176 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
14177 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
14178 lalr1.cc runs afoul of the first, and the last two are no longer
14179 supported by GCC 3.4.0.
14180 * README: Mention GNU m4 1.4 or later; mention m4 patches.
14181 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
14182
233a88ad
PE
141832004-05-06 Paul Eggert <eggert@cs.ucla.edu>
14184
14185 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
14186 unsigned int, for compatibility with latest gnulib hash module.
14187 * src/state.c (state_hash, state_hasher): Likewise.
14188 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
14189 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 14190
12ffdd28
PE
141912004-05-03 Paul Eggert <eggert@cs.ucla.edu>
14192
14193 * NEWS: Unescaped newlines are no longer allowed in char & strings.
14194
14195 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
14196 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
14197 character and string literals.
14198 (unexpected_end): New function.
14199 (unexpected_eof): Use it.
14200 (unexpected_newline): New function.
14201 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
14202 actions.
e476c87d 14203
12ffdd28
PE
14204 * NEWS: Document %expect-rr.
14205
14206 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
14207 Fix typo by replacing $1 with $option.
14208 Remove more 'intl'-related files.
9668e2be 14209 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
14210
14211 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
14212 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
14213 strtoul.c.
14214 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
14215 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
14216 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
14217 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
14218 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
14219 * src/.cvsignore: Add *.output.
14220
14221 * src/parse-gram.y: Put copyright notice inside %{ %} so it
14222 gets copied to the output file.
e476c87d 14223
1f65350a
PE
142242004-04-28 Paul Eggert <eggert@twinsun.com>
14225
14226 Get files from the gnulib and po repositories, instead of relying
14227 on them being in our CVS. Upgrade to latest versions of gnulib
14228 and Automake.
14229
14230 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
14231 * bootstrap: Bootstrap from gnulib and po repositories.
14232 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
14233 * README-cvs: Document these changes. Remove version numbers from
14234 mentions of build tools, since they change so often. Mention Flex.
14235
14236 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
14237 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
14238 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
14239 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 14240 does this for us.
12ffdd28
PE
14241 (AC_ISC_POSIX): Remove; we no longer support this
14242 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
14243 (AC_HEADER_STDC): Remove: we now assume C89 or better.
14244 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
14245 Do not check for C89 headers, except for locale.h which is used
14246 by the Yacc library and must port to K&R hosts.
14247 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
14248 Do not check for C89 functions, except for setlocale which is
14249 used by the Yacc library.
14250 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
14251 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
14252 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
14253 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
14254 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
14255 AM_GNU_GETTEXT): Remove; now done by:
14256 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
14257 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
14258 for us.
14259
14260 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
14261 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
14262 Define to empty, as gnulib.mk will do the rest for us.
14263 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
14264 for us.
14265 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
14266 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
14267
14268 * src/files.c: Include gnulib's xstrndup.h.
14269
14270 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
14271 (REALLOC): Use xnrealloc, for likewise.
14272 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
14273 (strnlen, memrchr): Remove decls; functions no longer used.
14274 Include <stpcpy.h>.
14275
14276 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
14277 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
14278 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
14279 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
14280 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
14281 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
14282 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
14283 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
14284 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
14285 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
14286 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
14287 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
14288 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
14289 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
14290 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
14291 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
14292 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
14293 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
14294 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
14295 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
14296 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
14297 Remove, as these files are now generated automatically
14298 by bootstrap or automake.
14299
14300 * po/ChangeLog: Remove: all but one entry was a duplicate
14301 of this file, and I moved that 2000-11-02 entry here.
14302
14303 * config/.cvsignore: Add Makefile, depcomp, install-sh.
14304 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
14305 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
14306 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
14307 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
14308 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
14309 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
14310 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
14311 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
14312 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
14313 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
14314 xstrndup.h.
14315 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
14316 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
14317 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
14318 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
14319 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
14320 * src/.cvsignore: Remove *_.c.
14321
14322
14323 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
14324 support it. (The latest stable gzip doesn't.)
14325
143262004-04-27 Paul Eggert <eggert@twinsun.com>
14327
14328 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
14329 case, as stos_ is now used by destructors due to the 2004-02-09
14330 change.
14331
14332 Remove more K&R C support.
14333 * lib/libiberty.y (PARAMS): Remove. All uses removed.
14334 * lib/subpipe.c (errno): Remove decl.
14335 Include <stdlib.h> unconditionally.
14336 (EXIT_FAILURE): Remove macro.
14337 * src/complain.c (vfprintf, strerror): Remove.
14338 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
14339 unconditionally.
14340 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
14341 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
14342 (strchr, strspn, memchr): Remove decls.
14343 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
14344 unconditionally. Do not declare perror.
14345 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
14346 unconditionally.
14347
14348 * src/complain.c (_): Remove useless defn, as system.h defines this.
14349
14350 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
14351 with latest obstack.h.
14352 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
14353 to procedure types, as obstack.h now does that for us.
14354 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
14355
14356 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
14357 so that this include file can stand alone.
14358 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
14359 does this now. Include subpipe.h first after config.h, to
14360 test whether it can stand alone.
14361
14362 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
14363 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
14364 unused declaration.
14365
14366 * tests/synclines.at (%union synch line): Put a dummy member in
14367 the union, because empty unions aren't allowed in C. Caught
14368 by GCC 3.4.0.
14369
4f16766c
PE
143702004-04-13 Jim Meyering <jim@meyering.net>
14371
14372 * src/conflicts.c (conflicts_print): Correct format string typo:
14373 use `%%' to produce literal `%'. (trivial change)
14374
779e7ceb
PE
143752004-03-30 Paul Eggert <eggert@twinsun.com>
14376
14377 * src/getargs.c (version): Update copyright year to 2004.
14378
14379 * data/c.m4 (b4_int_type): Use 'short int' rather than
14380 'short', and similarly for 'long', 'unsigned', etc.
14381 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
14382 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
14383 yy_yypstack, yydumpstack): Likewise.
14384 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
14385 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
14386 Likewise.
14387 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
14388 yy_stack_print, yyparse): Likewise.
14389 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
14390 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
14391 * lib/bitset.c (bitset_print): Likewise.
14392 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
14393 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
14394 * lib/bitsetv.c (bitsetv_dump): Likewise.
14395 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
14396 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
14397 Likewise.
14398 * src/LR0.c (allocate_itemsets): Likewise.
14399 * src/gram.h (rule_number, rule): Likewise.
14400 * src/lalr.h (goto_number): Likewise.
14401 * src/nullable.c (nullable_compute): Likewise.
14402 * src/output.c (prepare_rules): Likewise.
14403 * src/relation.c (relation_print, relation_digraph): Likewise.
14404 * src/relation.h (relation_node): Likewise.
14405 * src/state.h (state_number, transitions, errs, reductions,
14406 struct state): Likewise.
14407 * src/symtab.h (symbol_number, struct symbol): Likewise.
14408 * src/tables.c (vector_number, tally, action_number,
14409 default_goto, goto_actions): Likewise.
14410 * tests/existing.at (GNU Cim Grammar): Likewise.
14411 * tests/regression.at (Web2c Actions): Likewise.
14412
14413 * src/output.c (muscle_insert_short_int_table): Renamed from
14414 muscle_insert_short_table. All uses changed.
14415
d6328241
PH
144162004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
14417
14418 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
14419 (declaration): Replace expected_conflicts with expected_sr_conflicts.
14420 Add %expect-rr rule.
4f16766c 14421
d6328241
PH
14422 * src/scan-gram.l: Recognize %expect-rr.
14423
4f16766c 14424 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 14425 expected_conflicts.
4f16766c 14426 (expected_rr_conflicts): Declare.
d6328241
PH
14427
14428 * src/conflicts.c (expected_sr_conflicts): Rename from
14429 expected_conflicts.
14430 (expected_rr_conflicts): Define.
14431 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
14432 for GLR parsers.
14433 Use expected_sr_conflicts in place of expected_conflicts.
14434 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 14435
d6328241 14436 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 14437
1452af69
PE
144382004-03-08 Paul Eggert <eggert@gnu.org>
14439
14440 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 14441 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
14442
14443 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
14444 in lalr1.cc.
14445 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
14446 * src/scan-gram.l (scan_integer): New function.
14447 ({int}): Use it.
14448 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
14449 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
14450 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
14451 Say "long int", not "long", for uniformity with GNU style.
14452
006d217d
PE
144532004-02-25 Paul Eggert <eggert@twinsun.com>
14454
14455 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
14456 compilers. This fixes a problem with Intel's C++ compiler being
14457 chatty, reported by Guido Trentalancia in
161a71f3 14458 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 14459
c2729758
ADL
144602004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
14461
14462 Support %destructor and merge error locations in lalr1.cc.
14463
14464 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
14465 (Parser::stos_): Define unconditionally.
14466 (Parser::destruct_): New method. Generate its body with
14467 b4_yydestruct_generate.
14468 (Parser::error_start_): New attribute.
14469 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
14470 token which are discarded.
14471 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
14472 error_start_ when erroneous token are discarded.
14473 (Parser::parse) <yyerrlab1>: Compute the location of the error
14474 token so that it covers all the discarded tokens.
14475 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
14476 it can be called with `%skeleton "lalr1.cc"', and do that.
14477
dd0e0635
PE
144782004-02-02 Paul Eggert <eggert@twinsun.com>
14479
14480 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
14481 $(top_srcdir)/lib and ../lib. This fixes a bug reported
14482 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
14483 There's no need to mention top_builddir since Automake does that
14484 for us.
14485 (INCLUDES): Remove, as Automake says it's obsolescent.
14486 Contents migrated into AM_CPPFLAGS as described above.
14487 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
14488
144892004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
14490
14491 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
14492 (yyreportSyntaxError): Handle case where lookahead token is
14493 YYEMPTY.
14494
be16239b
PH
144952004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14496
14497 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
14498 resulting parsers are compilable with C++.
14499
5fa90832
PE
145002003-12-23 Paul Eggert <eggert@twinsun.com>
14501
14502 * config/depcomp, config/install-sh: Sync with Automake 1.8.
14503 * src/output.c (output_skeleton): Rename local var.
14504 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
14505 Bison tokens, as this runs afoul of the 2003-10-07 change that
14506 disallowed NUL bytes in character constants or string literals.
14507
14508 * tests/local.at: Require Autoconf 2.59's Autotest.
14509 * tests/testsuite.at: Don't include local.at, since we now assume
14510 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
14511 including it.
14512 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
14513 multiple inclusion warnings.
dd0e0635 14514
b165c324
AD
145152003-12-02 Akim Demaille <akim@epita.fr>
14516
14517 * doc/bison.texinfo (How Can I Reset the Parser): More about start
14518 conditions.
14519 From Bruno Haible.
14520
26e06a21
ADL
145212003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
14522
14523 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
14524
92ac3705
PE
145252003-10-07 Paul Eggert <eggert@twinsun.com>
14526
6a5ecb38
PE
14527 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
14528 if testsuite doesn't exist.
14529
92ac3705
PE
14530 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
14531 literals, unfortunately.
14532 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
14533 Complain about NUL bytes in character constants or string literals.
14534
91d2c560
PE
145352003-10-05 Paul Eggert <eggert@twinsun.com>
14536
14537 * NEWS: Don't document %no-default-prec, as it's still
14538 too experimental.
14539 * doc/bison.texinfo: Document %no-default-prec only if
14540 the defaultprec flag is set. Normally it's not.
14541
0cc3da3a
PE
145422003-10-04 Paul Eggert <eggert@twinsun.com>
14543
14544 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
14545 non-modifiable lvalue, instead of a modifiable one.
14546 * doc/bison.texinfo (Actions): Document that $$ can
14547 be assigned to. Do not claim that $$ and $N are
14548 array element references: user code should not rely on this.
14549
22fccf95
PE
145502003-10-01 Paul Eggert <eggert@twinsun.com>
14551
14552 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
14553 (grammar_declaration): Use it.
14554 * src/scan-gram.l: New token %no-default-prec.
14555 * tests/conflicts.at: Revamp tests to use %no-default-prec.
14556 * NEWS, doc/bison.texinfo: Document the above.
14557
fc8f2965
AD
145582003-10-01 Akim Demaille <akim@epita.fr>
14559
14560 VCG no longer supports long_straight_phase.
14561
14562 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
14563 * src/print_graph.c (print_graph): Adjust.
14564
39a06c25
PE
145652003-09-30 Frank Heckenbach <frank@g-n-u.de>
14566 and Paul Eggert <eggert@twinsun.com>
14567
14568 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
14569 Table of Symbols): Document %default-prec.
14570 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
14571 (grammar_declaration): Set default_prec on %default-prec.
14572 * src/scan-gram.l (%default-prec): New token.
14573 * src/reader.h (default_prec): New flag.
14574 * src/reader.c: Likewise.
14575 (packgram): Handle it.
14576 * tests/conflicts.at (%default-prec without %prec,
14577 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 14578
39a06c25
PE
145792003-09-30 Paul Eggert <eggert@twinsun.com>
14580
14581 * tests/testsuite.at: Include local.at, not input.at, fixing
14582 a typo in the 2003-08-25 patch.
14583
62b6aef9
AD
145842003-08-27 Akim Demaille <akim@epita.fr>
14585
14586 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
14587 GCC warnings.
14588
89e1cc61
AD
145892003-08-26 Akim Demaille <akim@epita.fr>
14590
14591 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
14592 "<\#" to avoid magic from Gnus when posting parts of this script.
14593
a08460b0
AD
145942003-08-26 Akim Demaille <akim@epita.fr>
14595
14596 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
14597 (Parser::parse): here.
14598 Adjust: nerrs and errstatus is now replaced by...
14599 (Parser::nerrs_, Parser::errstatus_): New.
14600
603f1cfd
AD
146012003-08-25 Akim Demaille <akim@epita.fr>
14602
14603 * config/announce-gen, Makefile.cfg: New.
14604 * Makefile.am: Adjust.
14605 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
14606 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
14607
cd3684cf
AD
146082003-08-25 Akim Demaille <akim@epita.fr>
14609
14610 When reducing initial empty rules, Bison parser read an initial
14611 location that is not defined. This results in garbage, and that
14612 affects Bison's own parser. Therefore we need (i) to extend Bison
14613 to support a means to initialize this location, and (ii) to use
14614 this CVS Bison to fix CVS Bison's parser.
14615
14616 * src/reader.h, reader.c (epilogue_augment): Remove, replace
14617 with...
14618 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
14619 * src/parse-gram.y: Adjust.
14620 (%initial-action): New.
14621 (%error-verbose): Since we require CVS Bison, there is no reason
14622 not to use it.
14623 * src/scan-gram.l: Adjust.
14624 * src/Makefile.am (YACC): New, to make sure we use our own parser.
14625 * data/yacc.c (yyparse): Use b4_initial_action.
14626
4e03e201
AD
146272003-08-25 Akim Demaille <akim@epita.fr>
14628
14629 * doc/bison.texinfo: Don't promote stdout for error messages.
14630
8c182d05
AD
146312003-08-25 Akim Demaille <akim@epita.fr>
14632
14633 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
14634 From Alexandre Duret-Lutz.
14635
6a60c4cf
PE
146362003-08-25 Akim Demaille <akim@epita.fr>
14637
14638 Version 1.875c.
14639
25f66e1a
AD
146402003-08-25 Akim Demaille <akim@epita.fr>
14641
14642 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
14643 Use them.
14644
5348bfbe
AD
146452003-08-25 Akim Demaille <akim@epita.fr>
14646
14647 * data/lalr1.cc (Parser::reduce_print_): New.
14648 Use it.
14649
47301314
AD
146502003-08-25 Akim Demaille <akim@epita.fr>
14651
14652 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
14653 error recovery loops. This patch is based on
161a71f3 14654 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
14655 Also, augment the similarity between lalr1.cc and yacc.c.
14656 Note: the locations of error recovery rules are not correct yet.
14657
14658 * data/lalr1.cc: Comment changes to augment the similarity between
14659 lalr1.cc and yacc.c.
14660 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
14661 (yyerrlab1): Remove, but where it used to be (now the bottom part of
14662 yyerrlab), when hitting EOF, pop the whole stack here instead of
14663 merely falling thru the default error handling mechanism.
14664 (yyerrorlab): New label, with the old contents of YYERROR,
14665 plus the following change: pop the stack of rhs corresponding
14666 to the production that invoked YYERROR. That is how Yacc
14667 behaves (required by POSIX).
14668 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
14669 fail.
14670
1f7a61ff
AD
146712003-08-25 Akim Demaille <akim@epita.fr>
14672
14673 Tune local.at so that people can "autom4te -l autotest calc.at -o
14674 calc" for instance, to extract a sub test suite.
14675
14676 * tests/testsuite.at: Move the initialization, Autotest version
14677 requirement, and AT_TESTED invocation into...
14678 * tests/local.at: here.
14679 * tests/testsuite.at: Include it for compatibility with Autoconf
14680 2.57.
14681 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
14682 be ignore.
14683
327b5b56
PE
146842003-08-04 Paul Eggert <eggert@twinsun.com>
14685
14686 Rework code slightly to avoid gcc -Wtraditional warnings.
14687 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
14688 The returned value is now stored in *YY0. All callers changed.
14689 * src/output.c (merge_output): Adjust to the above change.
14690
0051e3ed
PE
146912003-07-26 Paul Eggert <eggert@twinsun.com>
14692
14693 * data/glr.c (YYASSERT): New macro.
14694 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
14695 yyresolveStates, yyprocessOneStack):
14696 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
14697 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 14698
137437c6
PE
146992003-07-25 Paul Eggert <eggert@twinsun.com>
14700
5b620e06
PE
14701 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
14702 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 14703 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
14704 by Frank Heckenbach, though I have omitted the structure-initialization
14705 part of his glr-knr.diff patch since I recall that the Portable
14706 C Compiler didn't require that change.
14707
137437c6
PE
14708 Let the user specify how to allocate and free memory.
14709 Derived from a suggestion by Frank Heckenbach in
161a71f3 14710 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
14711 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
14712 All uses of free, malloc, realloc changed to use these macros,
14713 and unnecessary casts removed.
14714 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
14715
ddb85ca5
PE
147162003-07-06 Matthias Mann <MatthiasMann@gmx.de>
14717
14718 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
14719 use s.empty() rather than s == "" to test for empty string; see
161a71f3 14720 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
14721 (trivial change)
14722
39910e09
AD
147232003-06-25 Akim Demaille <akim@epita.fr>
14724
14725 * config/depcomp, config/install-sh: Update from masters.
14726
0ae99356
PE
147272003-06-20 Paul Eggert <eggert@twinsun.com>
14728
14729 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
14730 and return properly parenthesized result.
14731 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
14732 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
14733 Remove unnecessary parentheses from uses.
14734 * doc/bison.texinfo (Location Default Action): Describe the
14735 conventions for parentheses.
14736
cd05d13c
PE
147372003-06-19 Paul Eggert <eggert@twinsun.com>
14738
81fd08ca
PE
14739 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
14740 yyreportTree): Do not assume that size_t is the same width as int,
14741 when printing sizes. Print sizes using an unsigned format.
14742 Problem reported by Frank Heckenbach in
161a71f3 14743 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 14744
cd05d13c
PE
14745 Port to Forte Developer 7 C compiler.
14746 * data/glr.c (struct YYLTYPE): If locations are not being used,
14747 declare a single dummy member, as empty structs do not conform
14748 to the C standard.
14749 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
14750 the Forte Developer 7 C compiler complains that end-of-loop
14751 code is not reached.
14752
4dcf140b
PE
147532003-06-17 Paul Eggert <eggert@twinsun.com>
14754
14755 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
14756 avoid warnings from picky compilers about redefinition of PARAMS.
14757
8dd76bee
PE
147582003-06-17 Paul Eggert <eggert@twinsun.com>
14759
14760 Version 1.875b.
14761
14762 * NEWS: Document 1.875b.
14763
14764 * lib/bbitset.h: Do not include config.h; that's the includer's job.
14765 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
14766 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
14767 Don't use 'index' in comments, as it's a builtin fn on some hosts.
14768 * lib/bitset_stats.c: Include gettext.h unconditionally, as
14769 per recent gettext manual's suggestion.
14770 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
14771 Use prototypes, not old-style definitions.
14772 * lib/lbitset.c (lbitset_unused_clear): Likewise.
14773 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
14774 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
14775 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
14776 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
14777 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
14778 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
14779 vbitset_or_and_cmp, vbitset_copy): Likewise.
14780
14781 * lib/libiberty.h: Do not include config.h; that's the includer's job.
14782 Do not include <stdlib.h>.
14783 (PARAMS): Define unconditionally for C89.
14784 (ATTRIBUTE_NORETURN): Remove.
14785 (ATTRIBUTE_UNUSED): Define unconditionally.
14786
14787 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 14788 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
14789 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
14790 * lib/vbitset.c, lib/vbitset.h: New files.
14791 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
14792 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
14793 from libbitset.
14794
14795 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
14796 `How Can I Reset @code{yyparse}', since texinfo does not allow
14797 arbitrary @ in node names.
14798
14799 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
14800 shouldn't be needed according to the gettext 0.12.1 documentation
14801 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 14802 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 14803 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 14804 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 14805
8dd76bee
PE
14806 * lib/.cvsignore: Add stdbool.h.
14807 * m4/.cvsignore: Add nls.m4, po.m4.
14808
14809 Upgrade to CVS gnulib.
14810 * stdbool_.h: File renamed from stdbool.h.in.
14811 * configure.ac (AM_STDBOOL_H): Invoke this instead of
14812 AC_HEADER_STDBOOL.
14813 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
14814 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
14815 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
14816 (MOSTLYCLEANFILES): New var.
14817 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
14818 (stdbool.h): New rule.
14819 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
14820 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
14821 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
14822 m4/quote.m4: Upgrade to today's gnulib.
14823
14824 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
14825 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
14826 the tests right now.
14827 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
14828 yyerror are declared before use; C99 requires this.
14829
25005f6a
PH
148302003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14831
14832 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
14833 first.
14834 (yyrecoverSyntaxError): Correct the logic for setting and testing
14835 yyerrState.
14836 Correct comment on handling EOF.
14837 Allow states with only a default reduction, rather than failing
8dd76bee 14838 (I can't quite reconstruct why these were not allowed before).
25005f6a 14839
137437c6 14840 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 14841 buffer overruns, corrupting state.
8dd76bee
PE
14842
14843 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
14844 definition.
14845 * src/reader.h (max_left_semantic_context): New variable declaration.
14846 * src/scan-gram.l (max_left_semantic_context): Define.
14847 (handle_action_dollar): Update max_left_semantic_context.
14848 * data/glr.c (YYMAXLEFT): New definition.
14849 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
14850 (yyresolveAction): Ditto.
14851
14852 Fixes to problems with location handling in GLR parsers reported by
14853 Frank Heckenbach (2003/06/05).
14854
14855 * data/glr.c (YYLTYPE): Make trivial if locations not used.
14856 (YYRHSLOC): Add parentheses, and define only if locations used.
14857 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
14858 locations not used.
14859 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
14860 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 14861
25005f6a
PH
14862 * tests/cxx-type.at: Exercise location information; update tests
14863 to differentiate output with and without locations.
8dd76bee 14864 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
14865 because default YYLTYPE not yet defined.
14866 Change semantic actions to compute strings, rather than printing
14867 them directly (to test proper passing of semantics values). Change
14868 output to prefix notation and update test data and expected results.
14869 (yylex): Track locations.
14870 (stmtMerge): Return value rather than printing, and include arguments
14871 in value.
8dd76bee 14872
711f40b7
PE
148732003-06-03 Paul Eggert <eggert@twinsun.com>
14874
14875 Avoid warnings generated by GCC 2.95.4 when Bison is
14876 configured with --enable-gcc-warnings.
14877 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
14878 yy::]b4_parser_class_name[::translate_,
14879 yy::Stack::operator[] (unsigned),
14880 yy::Stack::operator[] (unsigned) const,
14881 yy::Slice::operator[] (unsigned),
14882 yy::Slice::operator[] (unsigned) const):
14883 Rename local vars to avoid warnings.
14884 * tests/glr-regression.at (Improper handling of embedded actions
14885 and $-N in GLR parsers): Remove unused local variable from yylex.
14886 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
14887 (void) as arg when not pure, since we now assume C89 when building
14888 Bison. Pacify GCC by using parameter.
14889
ac695f7d
PE
148902003-06-02 Paul Eggert <eggert@twinsun.com>
14891
14892 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
14893 yy::Location::lines, yy::Location::columns): Rename arguments
14894 to avoid shadowing; this removes a warning generated by GCC 3.3.
14895
26ec81e0
PE
148962003-06-01 Paul Eggert <eggert@twinsun.com>
14897
14898 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
14899 to g++, as GCC 3.3 complains if you do it.
14900 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
14901 everything that WARNING_CFLAGS has, except omit warnings
14902 not suitable for C++.
14903 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
14904 * tests/atlocal.in (CXXFLAGS): New var.
14905 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
14906
14907 Fix a GLR parser bug I reported in February; see
161a71f3 14908 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
14909 The problem was that GLR parsers did not conform to the C standard,
14910 because actions like { $1 = $2 + $3; } expanded to expressions
14911 that invoked YYFILL in separate subexpressions, and YYFILL assigned
14912 to a local variable. The C standard says that expressions
14913 like (var = f ()) + (var = f ()) have undefined behavior.
14914 Another problem was that GCC sometimes issues warnings that
14915 yyfill and its parameters are unused.
14916
14917 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
14918 as possibly unused.
14919 (yyfill): New function.
14920 (YYFILL): Use it.
14921 (yyuserAction): Change type of yynormal to bool, so that it matches
14922 the new yyfill signature. Mark it as possibly unused.
14923
14924
14925 Follow up on a bug I reported in February, where a Bison-generated
14926 parser can loop. Provide a test case and a fix for yacc.c. I
14927 don't have a fix for lalr1.cc or for glr.c, unfortunately.
14928 The original bug report is in:
161a71f3 14929 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
14930
14931 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
14932 macro's size was becoming unwieldy.
14933 (yyerrlab): Do not discard an empty lookahead symbol, as this
14934 might destroy garbage.
14935 (yyerrorlab): New label, with the old contents of YYERROR,
14936 plus the following change: pop the stack of rhs corresponding
14937 to the production that invoked YYERROR. That is how Yacc
14938 behaves, and POSIX requires this behavior.
14939 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
14940 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
14941 Define 'alarm' to do nothing if unistd.h is not available.
14942 Add a new rule "exp: '-' error;" to test the above change to
14943 data/yacc.c. Use 'alarm' to abort any test taking longer than
14944 10 seconds, as it's probably looping.
14945 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
14946 Also, the new yacc.c generates two fewer diagnostics for an
14947 existing test.
14948
d0829076
PE
149492003-05-24 Paul Eggert <eggert@twinsun.com>
14950
c6ae27df
PE
14951 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
14952 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
14953 This fixes a problem reported by John Bowman when the Compaq/HP
14954 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
14955 -ansi -Wall -gall).
14956 * data/yacc.c (union yyalloc): Likewise.
14957 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 14958
d0829076
PE
14959 Switch from 'int' to 'bool' where that makes sense.
14960
14961 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
14962 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
14963 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
14964 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
14965 Return or accept bool, not int. All callers changed.
14966 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
14967 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
14968 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
14969 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
14970 bitset_or_and_cmp_): Likewise.
14971 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
14972 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
14973 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
14974 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
14975 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
14976 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
14977 bitset_stats_or_and_cmp): Likewise.
14978 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
14979 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
14980 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
14981 ebitset_xor_cmp): Likewise.
14982 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
14983 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
14984 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
14985 lbitset_xor_cmp): Likewise.
14986 * lib/bbitset.h: Include <stdbool.h>.
14987 (struct bitset_vtable): The following members now return bool, not
14988 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
14989 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
14990 or_and_cmp).
14991 * src/conflicts.c (count_rr_conflicts): Likewise.
14992 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
14993 All uses changed.
14994 * lib/ebitset.c (ebitset_obstack_init): Likewise.
14995 * lib/lbitset.c (lbitset_obstack_init): Likewise.
14996 * src/getargs.c (debug_flag, defines_flag, locations_flag,
14997 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
14998 graph_flag): Likewise.
14999 * src/getargs.h (debug_flag, defines_flag, locations_flag,
15000 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
15001 graph_flag): Likewise.
15002 * src/output.c (error_verbose): Likewise.
15003 * src/output.h (error_verbose): Likewise.
15004 * src/reader.c (start_flag, typed): Likewise.
15005 * src/reader.h (typed): Likewise.
15006 * src/getargs.c (LOCATIONS_OPTION): New constant.
15007 (long_options, getargs): Use it.
15008 * src/lalr.c (build_relations): Use bool, not int.
15009 * src/nullable.c (nullable_compute): Likewise.
15010 * src/print.c (print_reductions): Likewise.
15011 * src/tables.c (action_row, pack_vector): Likewise.
15012 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
15013 * src/output.c (prepare): Use it.
15014 * src/output.c (token_definitions_output,
15015 symbol_destructors_output, symbol_destructors_output): Use string,
15016 not boolean integer, to keep track of whether to output separator.
15017 * src/print_graph.c (print_core): Likewise.
15018 * src/state.c (state_rule_lookaheads_print): Likewise.
15019
15020 * config/install-sh: Sync from automake 1.7.5.
15021
6b2584b7
PE
150222003-05-14 Paul Eggert <eggert@twinsun.com>
15023
15024 * src/parse-gram.y (rules_or_grammar_declaration): Require a
15025 semicolon after a grammar declaration, in the interest of possible
15026 future changes to the Bison input language.
15027 Do not allow a stray semicolon at the start of the grammar.
15028 (rhses.1): Allow one or more semicolons after any rule, including
15029 just before "|" as required by POSIX.
15030 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
15031 grammar.
15032
caf37a36
ADL
150332003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
15034
15035 %parse-param support for lalr1.cc.
15036
15037 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
15038 b4_cc_constructor_calls, b4_cc_constructor_call,
15039 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
15040 definitions.
15041 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
15042 parse-param arguments.
15043 (yy::b4_parser_class_name): Declare instance variables to
15044 hold parse-param arguments.
15045 * tests/calc.at: s/value/semantic_value/ because value clashes
15046 with a member of yy::b4_parser_class_name. Adjust C++ code
15047 to handle %parse-param. Enable %parse-param test in C++.
15048
3ab37077
PE
150492003-05-12 Paul Eggert <eggert@twinsun.com>
15050
15051 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
15052 English a bit. Fix fclose typo. Change "const char" to "char
15053 const", and use ANSI C rather than K&R for "main". Suggest
15054 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
15055 and suggest yy_switch_to_buffer.
15056
150572003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
15058
15059 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
15060 C89. This avoids a diagnostic on compilers that define __STDC__
15061 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 15062 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 15063
e743727f
PE
150642003-05-03 Paul Eggert <eggert@twinsun.com>
15065
15066 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
15067 Do not overrun array bounds.
15068 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 15069 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 15070
916708d5
AD
150712003-04-29 Akim Demaille <akim@epita.fr>
15072
15073 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
15074 * src/getargs.c, src/getargs.h: here, as bool, not int.
15075 (nondeterministic_parser): New.
15076 * src/parse-gram.y, src/scan-gram.l: Support
15077 %nondeterministic-parser.
15078 * src/output.c (prepare): Use nondeterministic_parser instead
15079 of glr_parser where appropriate.
15080 * src/tables.c (conflict_row, action_row, save_row)
15081 (token_actions, token_actions, pack_vector): Ditto.
15082
a06ea4aa
AD
150832003-04-29 Akim Demaille <akim@epita.fr>
15084
15085 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
15086
211074ca
AD
150872003-04-29 Akim Demaille <akim@epita.fr>
15088
15089 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
15090 with %pure-parser and %locations to exercise the patch from Yakov
15091 Markovitch below.
15092
6175ffe3
PE
150932003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
15094
15095 * data/yacc.c: (b4_lex_param): Corrected for the case where
15096 %lex-param is provided and %pure-parser isn't.
15097
b1e95857
PE
150982003-04-27 Paul Eggert <eggert@twinsun.com>
15099
15100 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 15101 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
15102 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
15103 if it is not defined.
15104 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
15105
acda9df6
PE
151062003-04-26 Paul Eggert <eggert@twinsun.com>
15107
3470c57b
PE
15108 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
15109 Declare to be of type suitable for the ninf value itself, not of
15110 type suitable for the corresponding table, since the latter might
15111 be unsigned but the ninf value might be negative. This fixes a
15112 bug reported by Alexandre Duret-Lutz in
161a71f3 15113 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 15114
acda9df6
PE
15115 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
15116 invokes it. We shouldn't invoke it twice because it will attempt
15117 to put error.o in the archive twice. This fixes a glitch reported
15118 by Martin Mokrejs in
161a71f3 15119 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 15120
b5250f26
PE
151212003-04-21 Paul Eggert <eggert@twinsun.com>
15122
15123 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
15124 to gnulib.
15125
089ac0f1
PE
151262003-04-21 Yakov Markovitch <Markovitch@iso.ru>
15127
15128 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
15129 Fix obvious typo that results in uncompilable GLR parsers
15130 when both %pure-parser and %locations are used. (trivial change)
15131
5ededac6
PE
151322003-04-17 Paul Eggert <eggert@twinsun.com>
15133
1b8f2fff
PE
15134 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
15135 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
15136 Do not insert the expected token via unput, as this runs afoul
15137 of a POSIX-compatibility bug in flex 2.5.31.
15138 All uses changed to BEGIN the parent state,
15139 since we no longer insert the expected token via unput.
15140 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
15141 that is no longer emitted after the above change.
15142
5ededac6
PE
15143 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
15144 the first one. This change is from Paul Hilfinger, and it fixes
15145 regression reported by Werner Lemberg in
161a71f3 15146 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
15147
15148 (resolve_sr_conflict): Don't invoke state_errs_set
15149 unless one or more tokens have been explicitly made errors.
15150 Otherwise, the above change causes Bison to abort.
15151
15152 * tests/existing.at (GNU pic Grammar): New test case, taken from
15153 Lemberg's email.
15154
b8be9132
AD
151552003-03-31 Akim Demaille <akim@epita.fr>
15156
15157 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
15158
d423d460
AD
151592003-03-31 Akim Demaille <akim@epita.fr>
15160
15161 * src/output.c (prepare_symbols): Avoid trailing spaces in the
15162 output.
15163
c7e441b4
AD
151642003-03-31 Akim Demaille <akim@epita.fr>
15165
15166 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
15167 From Paul Hilfinger.
15168
231897ad
AD
151692003-03-29 Akim Demaille <akim@epita.fr>
15170
15171 * m4/error.m4: Do not put under dynamic conditions some code which
15172 expansion is under static control.
15173
5b066063
AD
151742003-03-29 Akim Demaille <akim@epita.fr>
15175
15176 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
15177
22a74fec
AD
151782003-03-29 Akim Demaille <akim@epita.fr>
15179
15180 * doc/bison.texinfo (Strings are Destroyed): New.
15181
0eee27e7
PE
151822003-03-13 Paul Eggert <eggert@twinsun.com>
15183
15184 * .cvsignore: Add configure.lineno.
15185 * src/.cvsignore: Add yacc.
15186 * tests/.cvsignore: Add testsuite.log.
15187 * doc/fdl.texi: Sync with latest FSF version.
15188
f61aad93
PE
151892003-03-12 Paul Eggert <eggert@twinsun.com>
15190
537636c7
PE
15191 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
15192 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
15193 cursor, instead of leaving it undefined. This fixes a bug
15194 reported by Tim Van Holder in
161a71f3 15195 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
15196 * tests/input.at (Torturing the Scanner): Test the scanner on
15197 an empty input file, which was Tim Van Holder's test case.
15198
15199 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
15200 <sys/resource.h> can be included, include sys/time.h and
15201 sys/times.h first, if available. This works around the SunOS
15202 4.1.4 porting bug reported by Bruce Becker in
161a71f3 15203 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
15204
15205 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
15206 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
15207 AC_HEADER_SYS_WAIT.
15208
f61aad93
PE
15209 Merge changes from gnulib. This was prompted because the CVS
15210 snapshot didn't build on Solaris 7 due to strnlen problems.
15211
15212 These changes need to be merged back into gnulib:
15213 * lib/hash.c: Include <stdbool.h> unconditionally.
15214 * m4/onceonly.m4 (m4_quote): New macro.
15215 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
15216 Quote AC_FOREACH variable-expansions properly.
15217 The 2003-01-03 obstack.h change also needs merging.
15218 {end of changes requiring merging}
5b066063 15219
f61aad93
PE
15220 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
15221 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
15222 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
15223 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
15224 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
15225 New files, imported from gnulib.
15226 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
15227 above.
15228
15229 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
15230 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
15231 gnulib sources.
15232
15233 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
15234 Add.
15235 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
15236 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
15237 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
15238 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
15239 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
15240 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
15241 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
15242 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
15243 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
15244 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
15245 (jm_PREREQ_ARGMATCH): Remove.
15246 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
15247 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
15248
15249 * src/system.h: Include <stdbool.h> unconditionally.
15250
15251 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
15252 assuming at least C89 in the bitset code for some time now.
15253
d2ffe116
AD
152542003-03-03 Akim Demaille <akim@epita.fr>
15255
15256 * ro.po: New.
15257
052826fd
AD
152582003-03-02 Akim Demaille <akim@epita.fr>
15259
15260 * doc/bison.texinfo (Table of Symbols): Reactivate the
15261 documentation for %lex-param, and %parse-param.
15262
c4749565
AD
152632003-03-02 Akim Demaille <akim@epita.fr>
15264
15265 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
15266 generate verbose error messages.
15267 Use the number of tokens as an upper bound in yytname, as it
15268 cannot be a non terminal.
15269
d5286af1
AD
152702003-03-02 Akim Demaille <akim@epita.fr>
15271
15272 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
15273 message.
15274
22e304a6
AD
152752003-03-02 Akim Demaille <akim@epita.fr>
15276
22e304a6
AD
15277 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
15278 Use them to exercise yycheck overrun.
15279 Based on Andrew Suffield's grammar.
15280
67a25fed
AD
152812003-03-02 Akim Demaille <akim@epita.fr>
15282
15283 Create tests/local.at for Bison generic testing macros.
15284
15285 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
15286 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
15287 This new file.
15288 * tests/calc.at (AT_CHECK_CALC): Adjust.
15289 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
15290 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
15291 * tests/local.at: here.
15292 (AT_COMPILE_CXX): Tags the tests using it as c++.
15293 Ignore the test if CXX is not functional.
15294
9c2b381f
PE
152952003-03-01 Paul Eggert <eggert@twinsun.com>
15296
15297 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
15298 not loc->end, since loc->end might contain garbage and this leads
15299 to undefined behavior on some platforms.
15300 (id_loc, token_start): Use (IF_LINTed) initial values that do not
15301 depend on *loc, so that the reader doesn't give the the false
15302 impression that *loc is initialized.
15303 (<INITIAL>"%%"): Do not bother setting code_start, since its value
15304 does not survive the return.
15305
0433ba88
AD
153062003-03-01 Akim Demaille <akim@epita.fr>
15307
15308 * src/scan-gram.l (code_start): Always initialize it when entering
15309 into yylex, as SC_EPILOGUE is activated *before* the corresponding
15310 yylex invocation. An alternative would be making it static, but
15311 then it starts with the second %%'s beginning, instead of its end.
15312
b305ea69
PE
153132003-02-28 Paul Eggert <eggert@twinsun.com>
15314
15315 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
15316 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 15317 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 15318
c3d25e01
PE
153192003-02-26 Paul Eggert <eggert@twinsun.com>
15320
15321 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
15322 Remove Sequent/Pyramid discussion (nobody uses them any more).
15323 Merge VMS and MS-DOS discussion; these ports may well be dead
15324 but let's keep mentioning them for now. Put <> around email
15325 addresses. Add copyright notice.
15326
c267ffbc
PE
153272003-02-24 Paul Eggert <eggert@twinsun.com>
15328
15329 * data/glr.c (yy_reduce_print): yylineno -> yylno,
15330 to avoid collision with flex use of yylineno.
15331 Problem reported by Bruce Lilly in
161a71f3 15332 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
15333 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
15334 * data/yacc.c (yy_reduce_print): Likewise.
15335
15336 * config/depcomp: Sync with Automake 1.7.3.
15337
f939fc12
AD
153382003-02-21 Akim Demaille <akim@epita.fr>
15339
15340 * data/lalr1.cc: Use temporary variables instead of casts to
15341 change integer types.
15342 Suggested by Paul Eggert.
15343
95923bd6
AD
153442003-02-21 Akim Demaille <akim@epita.fr>
15345
15346 * doc/bison.texinfo: Use "location" consistently to refer to @n,
15347 to avoid confusions with lalr1.cc's notion of Position.
15348 Suggested by Paul Eggert.
15349
2cdc240e
AD
153502003-02-20 Akim Demaille <akim@epita.fr>
15351
15352 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
15353 before initial_columns.
15354 (location.hh): Use consistent variable names when defining the
15355 operator<<.
15356 Use "last" so that we subtract from Positions, not from unsigned.
15357
5d003116
AD
153582003-02-20 Akim Demaille <akim@epita.fr>
15359
15360 * data/lalr1.cc (position.hh): New subfile, including the extended
15361 and Doxygen'ed documentation of class Position.
15362 (location.hh): Use it.
15363 Document a` la Doxygen.
ba1ecc07 15364 With the help of Benoit Perrot.
5d003116 15365
d02b25f9
AD
153662003-02-20 Akim Demaille <akim@epita.fr>
15367
15368 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
15369 AT_YACC_IF.
15370 Redefine AT_YYERROR_SEES_LOC_IF using it.
15371 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
15372 not defined.
15373 Don't use the location in yy::Parser::error_ and
15374 yy::Parser::print_ when not %locations.
15375 Activate more lalr1.cc tests.
15376
0d1c3a04
AD
153772003-02-19 Akim Demaille <akim@epita.fr>
15378
15379 * data/lalr1.cc: When displaying a line number, be sure to make it
15380 an int.
15381
60a777aa
AD
153822003-02-19 Akim Demaille <akim@epita.fr>
15383
15384 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
15385 Remove, useless.
15386 (YYABORT, YYACCEPT, YYERROR): New.
15387 * tests/calc.at: Renable the lalr1.cc test.
15388
0b86fc41
AD
153892003-02-19 Akim Demaille <akim@epita.fr>
15390
15391 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
15392 error recovery, mixing with/without pops and discarding of the
15393 lookahead.
15394 Exercise YYERROR.
15395 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
15396
da99a5dc
PE
153972003-02-17 Paul Eggert <eggert@twinsun.com>
15398
15399 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
15400 * tests/testsuite.at (AT_COMPILE): Use them.
15401 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 15402 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 15403
93b8c255
PE
154042003-02-12 Paul Eggert <eggert@twinsun.com>
15405
15406 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
15407 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 15408 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
15409 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
15410 Check for malloc failure, for consistency with yacc.c.
15411 (yytname_size): Remove, for consistency with yacc.c.
15412
15413 The bug still remains in data/lalr1.cc, as I didn't have time
15414 to fix it there.
15415
7548fed2
AD
154162003-02-06 Akim Demaille <akim@epita.fr>
15417
15418 * configure.ac (GXX): Rename as...
15419 (CXX): this, to keep the original Autoconf semantics.
15420 Require 2.57.
15421 * data/lalr1.cc: Fix b4_copyright invocations.
15422 If YYDEBUG is not defined, don't depend upon name_ being defined.
15423 (location.hh): Include string and iostream.
15424 (Position::filename): New member.
15425 (Position::Position ()): New.
15426 (operator<< (Position)): New.
15427 (operator- (Position, int)): New.
15428 (Location::first, Location::last): Rename as...
15429 (Location::begin, Location::end): these, to mock the conventional
15430 iterator names.
15431 (operator<< (Location)): New.
15432 * tests/atlocal.in (CXX): New.
15433 * tests/testsuite.at (AT_COMPILE_CXX): New.
15434 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
15435 locations in a more synthetic way.
15436 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
15437 lalr1.cc is used.
15438 Adjust the C locations to match those from Emacs: first column is
15439 column 0.
15440 Change all the expected results.
15441 Conform to the GCS: simplify the locations when applicable.
15442 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
15443 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
15444 these CPP macros with the m4 macros new defined by...
15445 (AT_CHECK_PUSHDEFS): this, i.e.:
15446 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 15447 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
15448 New macros.
15449 (AT_CHECK_POPDEFS): Undefine them.
15450 (AT_CHECK_CALC_LALR1_CC): New.
15451 Use it for the first lalr1.cc test.
15452
43a176ef
AD
154532003-02-04 Akim Demaille <akim@epita.fr>
15454
15455 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
15456 Location as is defined.
15457
fc049e9c
AD
154582003-02-04 Akim Demaille <akim@epita.fr>
15459
15460 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
15461 name_ being defined.
15462
a737b216
PE
154632003-02-03 Paul Eggert <eggert@twinsun.com>
15464
15465 * src/gram.h (start_symbol): Remove unused decl.
15466
15467 Use more-consistent naming conventions for local vars.
15468
15469 * src/derives.c (derives_compute): Change type of local var from
15470 int to rule_number.
15471 * src/gram.c (grammar_rules_partial_print): Likewise.
15472 * src/print.c (print_core): Likewise.
15473 * src/reduce.c (reduce_grammar_tables): Likewise.
15474
15475 * src/gram.c (grammar_dump): Change name of item_number *
15476 local var from r to rp.
15477 * src/nullable.c (nullable_compute): Likewise.
15478
15479 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
15480
15481 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
15482 for symbol or symbol_number var.
15483 * src/reader.c (grammar_start_symbol_set): Likewise.
15484 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
15485 Likewise.
15486 * src/state.c (transitions_to): Likewise.
15487 * src/state.h: Likewise.
15488 * src/tables.c (symbol_number_to_vector_number): Likewise.
15489
15490 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
15491 char * var.
15492
15493 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
15494 var.
15495
15496 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
15497 var.
15498
15499 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
15500 Use str, not s, for char * var. Use ch, not c, for character var.
15501 Use size for size var.
15502
15503 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
15504 char * var.
15505 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
15506 uniqstr var.
15507 * src/uniqstr.h: Likewise.
15508
15509 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
15510 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
15511 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
15512 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
15513 param to have same name as that of enum, so that we don't use
15514 "s" to stand for a non-state.
15515
68e93ad5
AD
155162003-02-02 Akim Demaille <akim@epita.fr>
15517
15518 * src/scan-skel.l: Scan more than one inert character per yylex
15519 invocation.
15520
92898986
PE
155212003-02-01 Paul Eggert <eggert@twinsun.com>
15522
15523 Version 1.875a.
15524
1d9d5d71
PE
15525 * po/LINGUAS: Add ms.
15526
0435d061
AD
155272003-01-30 Akim Demaille <akim@epita.fr>
15528
15529 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
15530
6029a57f
PH
155312003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15532
15533 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
15534 of $1.
0435d061
AD
15535
15536 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 15537 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 15538 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 15539
6029a57f
PH
15540 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
15541 (b4_rhs_location): Ditto.
0435d061 15542 (yyfill): New function to copy from stack tree into array
6029a57f 15543 incrementally.
0435d061
AD
15544 (yyuserAction): Modify to allow incremental move of semantic values
15545 to rhs array when in GLR mode.
15546 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
15547 as needed.
15548 Remove dummy use of yystack, as there is now a guaranteed use.
15549 (yydoAction): Modify to allow incremental move of semantic values
15550 to rhs array when in GLR mode.
15551 (yyresolveAction): Ditto.
15552 (yyglrShiftDefer): Update comment.
0435d061 15553 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
15554 (yyglrReduce): Ditto.
15555 (yydoAction): Ditto
0435d061 15556
6029a57f
PH
15557 * tests/glr-regr1.at: Rename to ...
15558 * tests/glr-regression.at: Add new regression test for the problems
15559 described above (adapted from S. Eken).
15560 Update copyright notice.
15561 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
15562 * tests/Makefile.am: Ditto.
15563
6cee6297
PE
155642003-01-28 Paul Eggert <eggert@twinsun.com>
15565
15566 * data/lalr1.cc: Do not use @output_header_name@ unless
15567 b4_defines_flag is set. This fixes two bugs reported by
15568 Tim Van Holder in
161a71f3
PE
15569 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
15570 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 15571
b2a836b5
PE
155722003-01-21 Paul Eggert <eggert@twinsun.com>
15573
15574 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
15575 we don't need to worry about yyerrlab1 being reported as an
15576 "unused label" by non-GCC C compilers. The downside is that if
15577 locations are used then a couple of statements are duplicated each
15578 time YYERROR is invoked, but the upside is that the warnings
15579 should vanish.
15580 (yyerrlab1): Move code to YERROR.
15581 (yyerrlab2): Remove. Change uses back to yyerrlab1.
15582 This reverts some of the 2002-12-27 change.
15583
4196b931
PE
155842003-01-17 Paul Eggert <eggert@twinsun.com>
15585
15586 * src/output.c (symbol_printers_output): Fix typo that led
15587 to core dump. Problem reported by Antonio Rus in
161a71f3 15588 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 15589
3ae831b4
AD
155902003-01-13 Akim Demaille <akim@epita.fr>,
15591 Quoc Peyrot <chojin@lrde.epita.fr>,
15592 Robert Anisko <anisko_r@lrde.epita.fr>
15593
15594 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
15595 when the stacks contain one element, as the loop would otherwise
15596 free the last state, and then use the top state (the one we just
15597 popped). This means that the initial elements will not be freed
15598 explicitly, as is the case in yacc.c; it is not a problem, as
15599 these elements have fake values.
15600
e3aa65c5
PE
156012003-01-11 Paul Eggert <eggert@twinsun.com>
15602
15603 * NEWS: %expect-violations are now just warnings, reverting
15604 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
15605 bootstrapping problem reported by Matthias Klose; see
161a71f3 15606 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
15607 * src/conflicts.c (conflicts_print): Likewise.
15608 * tests/conflicts.at (%expect not enough, %expect too much,
15609 %expect with reduce conflicts): Likewise.
15610 * doc/bison.texinfo (Expect Decl): Document this. Also mention
15611 that the warning is enabled if the number of conflicts changes
15612 (not necessarily increases).
15613
15614 * src/getargs.c (version): Update copyright year.
15615
f0057011
AD
156162003-01-09 Akim Demaille <akim@epita.fr>
15617
15618 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
15619
1ee6d2a0
PE
156202003-01-08 Paul Eggert <eggert@twinsun.com>
15621
15622 * Makefile.maint (WGETFLAGS):
15623 New macro, containing "-C off" to disable proxy caches.
15624 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
15625 (rel-check): Use $(WGET) instead of wget.
15626
d4fd77c4
PE
156272003-01-06 Paul Eggert <eggert@twinsun.com>
15628
15629 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
15630 the GLR paper of Scott, Johnstone and Hussain.
15631
464c6927
PE
156322003-01-04 Paul Eggert <eggert@twinsun.com>
15633
d600ee67
PE
15634 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
15635 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
15636 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
15637 (EXTRA_LIBRARIES): New var, for liby.a.
15638 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
15639 (EXTRA_SCRIPTS): New var, for yacc.
15640
464c6927
PE
15641 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
15642 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
15643 Problem reported by Nelson H. F. Beebe.
15644
156452003-01-03 Paul Eggert <eggert@twinsun.com>
15646
15647 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
15648 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
15649 when compiling Bison 1.875's `bitset bset = obstack_alloc
15650 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
15651
15652 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
15653 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
15654 grow to a huge size with typical invocation.
d600ee67 15655
464c6927
PE
15656 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
15657 Use the pattern recommended by Autoconf 2.57, except also protect
15658 against double-definition.
15659 * src/system.h: Likewise.
15660 Portability issues reported by Nelson H. F. Beebe.
d600ee67 15661
464c6927
PE
15662 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
15663 All uses changed. Provide a definition in both C and C++.
15664 (yytrue, yyfalse): Define even if defined (__cplusplus).
15665
15666 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
15667 Reported by Nelson H. F. Beebe.
d600ee67 15668
464c6927
PE
15669 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
15670
0f42c7d5
PE
156712003-01-02 Paul Eggert <eggert@twinsun.com>
15672
15673 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
15674 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
15675 Bug reported by Nelson H. F. Beebe.
15676
dc546b0f
PE
156772003-01-01 Paul Eggert <eggert@twinsun.com>
15678
15679 * Version 1.875.
15680
2c09b6a7
PE
156812002-12-30 Paul Eggert <eggert@twinsun.com>
15682
15683 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
15684 Moved here from...
15685 (<INITIAL>","): Here. This causes stray "," to be treated
15686 more uniformly.
15687
dc546b0f 15688 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
15689 last brace in braced code when not in Yacc mode, for compatibility
15690 with Bison 1.35. This resurrects the 2001-12-15 patch to
15691 src/reader.c.
15692
15693 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
15694 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
15695
535c0f63
PE
156962002-12-28 Paul Eggert <eggert@twinsun.com>
15697
15698 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
15699 that of SYM's type. This fixes Debian bug 168069, reported by
15700 Thomas Olsson.
d600ee67 15701
963fcc17
PE
157022002-12-28 Paul Eggert <eggert@twinsun.com>
15703
15704 Version 1.75f.
15705
15706 Switch back to the Yacc style of conflict reports, undoing some
15707 of the 2002-07-30 change.
15708 * doc/bison.texinfo (Understanding): Use Yacc style for
15709 conflict reports. Also, use new way of locating rules.
15710 * src/conflicts.c (conflict_report):
15711 Renamed from conflict_report_yacc, removing the old
15712 'conflict_report'. Translate the entire conflict report at once,
15713 so that we don't assume that "," has the same interpretation in
15714 all languages.
15715 (conflicts_output): Use Yacc-style conflict report for each state,
15716 instead of our more-complicated style.
15717 (conflicts_print): Use Yacc-style conflict report, except print
15718 the input file name when not emulating Yacc.
15719 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
15720 Conflicted Reduction, %expect not enough, %expect too much,
15721 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
15722 * tests/existing.at (GNU Cim Grammar): Likewise.
15723 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
15724
15725 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
15726 fatal): Don't invoke fflush; it's not needed and it might even be
15727 harmful for stdout, as stdout might not be open.
15728 * src/reduce.c (reduce_print): Likewise.
15729
b1efe548
PE
157302002-12-27 Paul Eggert <eggert@twinsun.com>
15731
15732 Fix a bug where error locations were not being recorded correctly.
15733 This problem was originally reported by Paul Hilfinger in
161a71f3 15734 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
15735
15736 * data/yacc.c (yyparse): New local var yylerrsp, to record the
15737 top of the location stack's error locations.
15738 (yyerrlab): Set it. When discarding a token, push its location
15739 onto yylerrsp so that we don't lose track of the error's end.
15740 (yyerrlab1): Now is only the target of YYERROR, so that we can
15741 properly record the location of the action that failed. For GCC
15742 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
15743 GCC warning about yyerrlab1 being unused if YYERROR is unused.
15744 (yyerrlab2): New label, which yyerrlab now falls through to.
15745 Compute the error's location by applying YYLLOC_DEFAULT to
15746 the locations of all the symbols that went into the error.
15747 * doc/bison.texinfo (Location Default Action): Mention that
15748 YYLLOC_DEFAULT is also invoked for syntax errors.
15749 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
15750 Error locations include the locations of all the tokens that were
15751 discarded, not just the last token.
d600ee67 15752
983c5c2c
PE
157532002-12-26 Paul Eggert <eggert@twinsun.com>
15754
b1efe548
PE
15755 * src/files.c: Include quote.h.
15756 (compute_output_file_names): Warn if we detect conflicting
15757 outputs to the same file. This should catch the misunderstanding
15758 exemplified by Debian Bug 165349, reported by Bruce Stephens..
15759
15760 * src/conflicts.c (conflicts_print): If the user specifies
15761 "%expect N", report an error if there are any reduce/reduce
15762 conflicts. This is what the manual says should happen.
15763 This fixes Debian bug 130890, reported by Anthony DeRobertis.
15764 * tests/conflicts.at (%expect with reduce conflicts): New test.
15765
983c5c2c
PE
15766 Don't use m4_include on relative file names, as it doesn't work as
15767 desired if there happens to be a file with that name under ".".
d600ee67 15768
983c5c2c
PE
15769 * m4sugar/version.m4: Remove; it was included but it wasn't used.
15770 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
15771 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
15772 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
15773 * src/output.c (output_skeleton): Use full path names when
15774 specifying a file to include; don't rely on include path, as
15775 it's unreliable when the working file contains a file with
15776 that name.
d600ee67 15777
983c5c2c
PE
157782002-12-25 Paul Eggert <eggert@twinsun.com>
15779
15780 Remove obsolete references to bison.simple and bison.hairy.
15781 Problem mentioned by Aubin Mahe in
161a71f3 15782 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
15783 * data/glr.c: Comment fix.
15784 * doc/bison.1: Remove references. Also, mention "yacc".
15785
15786 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
15787 with -g option.
15788
15789 * src/parse-gram.y (declaration): Use enum "report_states" rather
15790 than its numeric value 1.
15791
15792 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
15793 opening a new one. This fixes Debian bug 165349, reported by
15794 Bruce Stephens.
15795
23f2d9dc
PE
157962002-12-24 Paul Eggert <eggert@twinsun.com>
15797
15798 Version 1.75e.
15799
15800 * Makefile.maint (cvs-update): Don't assume that the shell
15801 supports $(...), as Solaris sh doesn't.
15802
15803 * src/parse-gram.y (lloc_default): Remove test for empty
15804 nonterminals at the end, since it didn't change the result.
15805
158062002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
15807
15808 If the user does not define YYSTYPE as a macro, Bison now declares it
15809 using typedef instead of defining it as a macro. POSIX requires this.
15810 For consistency, YYLTYPE is also declared instead of defined.
15811
15812 %union directives can now have a tag before the `{', e.g., the
15813 directive `%union foo {...}' now generates the C code
15814 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
15815 The default union tag is `YYSTYPE', for compatibility with Solaris 9
15816 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
15817 instead of `yyltype'.
15818
15819 `yystype' and `yyltype' are now obsolescent macros instead of being
15820 typedefs or tags; they are no longer documented and will be
15821 withdrawn in a future release.
15822
15823 * data/glr.c (b4_location_type): Remove.
15824 (YYSTYPE): Renamed from yystype.
15825 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
15826 (struct YYLTYPE): Renamed from struct yyltype.
15827 (YYLTYPE): Renamed from yyltype.
15828 (yyltype, yystype): New (and obsolescent) macros,
15829 for backward compatibility.
15830 * data/yacc.c: Likewise.
15831
15832 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
15833 does not specify a union tag. This is for compatibility with
15834 Solaris 9 yacc.
15835
15836 * src/parse-gram.y (add_param): 2nd arg is now char * not char
15837 const *, since it is now modified by stripping surrounding { }.
15838 (current_braced_code): Remove.
15839 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
15840 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
15841 trailing " {...}". Now of type <chars>.
15842 (grammar_declaration): Adjust to bundled tokens.
15843 (code_content): Remove; stripping is now done by add_param.
15844 (print_token_value): Print contents of bundled tokens.
15845 (token_name): New function.
15846
15847 * src/reader.h (braced_code, current_braced_code): Remove.
15848 (token_name): New decl.
15849
15850 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
15851 token_type, not braced_code code_kind. All uses changed.
15852 (SC_PRE_CODE): New state, for scanning after a keyword that
15853 has (or usually has) an immediately-following braced code.
15854 (token_type): New local var, to keep track of which token type
15855 to return when scanning braced code.
15856 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 15857 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
15858 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
15859 instead of returning a token type immediately.
15860 (<INITIAL>"{"): Set token type.
15861 (<SC_BRACED_CODE>"}"): Use it.
15862 (handle_action_dollar, handle_action_at): Now returns bool
15863 indicating success. Fail if ! current_rule; this prevents a core dump.
15864 (handle_symbol_code_dollar, handle_symbol_code_at):
15865 Remove; merge body into caller.
15866 (handle_dollar, handle_at): Complain in invalid contexts.
15867
15868 * NEWS, doc/bison.texinfo: Document the above.
15869 * NEWS: Fix years and program names in copyright notice.
15870
879ca4f8
PE
158712002-12-17 Paul Eggert <eggert@twinsun.com>
15872
15873 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
15874 Reporting, Table of Symbols): Omit mentions of %lex-param and
15875 %parse-param from the documentation for now.
15876
1c5fe69d
PE
158772002-12-15 Paul Eggert <eggert@twinsun.com>
15878
15879 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
15880 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
15881 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
15882 disagreed with the Bison documentation. Bug
15883 reported by Andrew Walrond.
d600ee67 15884
1c5fe69d
PE
15885 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
15886 as the caller now does that.
15887 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
15888 (YYEMPTY): Parenthesize right hand side, since others use it.
15889 (yyparse): Don't assume that our generated code is the only code
15890 that sets yychar.
15891
d1de5372
PE
158922002-12-13 Paul Eggert <eggert@twinsun.com>
15893
15894 Version 1.75d.
15895
15896 POSIX requires a "yacc" command.
15897 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
15898 (MOSTLYCLEANFILES): Add yacc.
15899 (yacc): New rule.
1c5fe69d 15900 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
15901 as an alias for bison y.
15902
15903 * po/LINGUAS: Add da.
d600ee67 15904
d1de5372
PE
15905 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
15906 problem with latest <getopt.h>.
15907 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
15908
15909 * doc/fdl.texi: Upgrade to 1.2.
15910 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
15911 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
15912 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
15913 gnulib.
15914 * config/install-sh: Sync with autotools.
15915
15916 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 15917 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
15918 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
15919 locations are requested.
15920 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
15921 locations are requested.
15922
d0f3fe23
PE
159232002-12-12 Paul Eggert <eggert@twinsun.com>
15924
15925 Remove unportable casts and storage allocation tricks.
15926 While we're at it, remove almost all casts, since they
15927 usually aren't needed and are a sign of trouble.
15928
15929 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
15930
15931 * src/derives.c (derives_compute): Do not subtract NTOKENS from
15932 the pointer DSET returned by malloc; this isn't portable.
15933 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
15934 Similarly for DERIVES.
15935 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
15936 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
15937 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
15938
15939 * src/derives.c (derives_compute): Do not bother invoking
15940 int_of_rule_number, since rule numbers are integers.
15941
15942 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
15943 rather than XMALLOC (char, N).
15944
15945 * src/files.c (filename_split): Rewrite to avoid cast.
15946
15947 * src/gram.h (symbol_number_as_item_number,
15948 item_number_as_symbol_number, rule_number_as_item_number,
15949 item_number_as_rule_number):
15950 Now inline functions rather than macros, to avoid casts.
15951 * src/state.h (state_number_as_int): Likewise.
15952 * src/tables.c (state_number_to_vector_number,
15953 symbol_number_to_vector_number): Likewise.
15954
15955 * src/gram.h (int_of_rule_number): Remove; no longer used.
15956
15957 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
15958 since the resulting storage is always stored into.
15959
15960 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
15961 where it's needed.
15962
15963 * src/muscle_tab.c (muscle_m4_output):
15964 Now inline. Return bool, not int.
15965 * src/state.c (state_compare): Likewise.
15966 * src/symtab.c (symbol_check_defined,
15967 symbol_check_alias_consistency, symbol_pack, symbol_translation,
15968 hash_compare_symbol, hash_symbol):
15969 Likewise.
15970 * src/uniqstr.c (uniqstr_print): Likewise.
15971 * src/muscle_tab.c (muscle_m4_output_processor):
15972 New function, to avoid casts.
15973 * src/state.c (state_comparator, stage_hasher): Likewise.
15974 * src/symtab.c (symbol_check_defined_processor,
15975 symbol_check_alias_consistency_processor, symbol_pack_processor,
15976 symbol_translation_processor, hash_symbol_comparator,
15977 hash_symbol_hasher): Likewise.
15978 * src/uniqstr.c (uniqstr_print_processor): Likewise.
15979 * src/muscle_tab.c (muscles_m4_output):
15980 Use new functions instead of casting old functions unportably.
15981 * src/state.c (state_hash_new): Likewise.
15982 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
15983 symbols_token_translations_init):
15984 Likewise.
15985 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
15986
15987 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
15988 var instead of casting to long, to avoid casts.
15989 (prepare_states): Use MALLOC rather than alloca, so that we don't
15990 have to worry about alloca.
15991 * src/state.c (state_hash_lookup): Likewise.
15992
15993 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
15994 local var instead of casting to unsigned char, to avoid casts.
15995
15996 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
15997 STATE_ALLOC): Remove.
15998 (transitions_new, errs_new, reductions_new, state_new): Use malloc
15999 rather than calloc, and use offsetof to avoid allocating slightly
16000 too much storage.
16001 (state_new): Initialize all members.
16002
16003 * src/state.c (state_hash): Use unsigned accumulator, not signed.
16004
16005 * src/symtab.c (symbol_free): Remove; unused.
16006 (symbol_get): Remove cast in lhs of assignment.
16007 (symbols_do): Now static. Accept generic arguments, not
16008 hashing-related ones.
16009
16010 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
16011 (symbol_processor): Remove.
16012 (symbols_do): Remove decl; now static.
16013
16014 * src/system.h (alloca): Remove; decl no longer needed.
16015 (<stddef.h>): Include, for offsetof.
16016 (<inttypes.>, <stdint.h>): Include if available.
16017 (uintptr_t): New type, if system lacks it.
16018 (CALLOC, MALLOC, REALLOC): New macros.
16019 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
16020 new macros.
16021
16022 * src/tables.c (table_size): Now int, to pacify GCC.
16023 (table_grow, table_ninf_remap): Use signed table size.
16024 (save_row): Don't bother initializing locals when not needed.
16025 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
16026 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
16027
16028 * src/vcg.h: Correct misspellings.
16029
16030 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
16031
16032
16033 * src/getargs.c (getargs): Don't assume EOF == -1.
16034
26b4a969
PE
160352002-12-09 Paul Eggert <eggert@twinsun.com>
16036
16037 Change identifier spellings to avoid collisions with names
16038 that are reserved by POSIX.
16039
16040 Don't use names ending in _t, since POSIX reserves them.
16041 For consistency, remove _e and _s endings -- they're weren't
16042 needed to remove ambiguity. All uses changed.
16043 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
16044 turn was just renamed from struniq_t.
16045 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
16046 which in turn was just renamed from struniq_processor_t.
16047 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
16048 in turn was renamed from hash_compare_struniq_t.
16049 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
16050 (state_list): Renamed from state_list_t.
16051 * src/assoc.h (assoc): Renamed from assoc_t.
16052 * src/conflicts.c (enum conflict_resolution): Renamed from
16053 enum conflict_resolution_e.
16054 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
16055 (rule_list): Renamed from rule_list_t.
16056 * src/getargs.h (enum trace): Renamed from enum trace_e.
16057 (enum report): Renamed from enum report_e.
16058 * src/gram.h (item_number): Renamed from item_number_t.
16059 (rule_number): Renamed from rule_number_t.
16060 (struct rule_s): Remove the "rule_s" part; not used.
16061 (rule): Renamed from rule_t.
16062 (rule_filter): Renamed from rule_filter_t.
16063 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
16064 (goto_list): Renamed from goto_list_t.
16065 * src/lalr.h (goto_number): Renamed from goto_number_t.
16066 * src/location.h (location): Renamed from location_t.
16067 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
16068 and moved here from:
16069 * src/muscle_tab.h (muscle_entry_t): here.
16070 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
16071 (rule_list): Renamed from rule_list_t.
16072 * src/print_graph.c (static_graph): Renamed from graph.
16073 * src/reader.h (braced_code): Renamed from braced_code_t.
16074 Remove brace_code_e tag.
16075 * src/relation.h (relation_node): Renamed from relation_node_t.
16076 (relation_nodes): Renamed from relation_nodes_t.
16077 (relation): Renamed from relation_t.
16078 * src/state.h (state_number): Renamed from state_number_t.
16079 (struct state): Renamed from struct state_s.
16080 (state): Renamed from state_t.
16081 (transitions): Renamed from transitions_t. Unused (and
16082 misspelled) transtion_s tag removed.
16083 (errs): Renamed from errs_t. Unused errs_s tag removed.
16084 (reductions): Renamed from reductions_t. Unused tag
16085 reductions_s removed.
16086 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
16087 (struct symbol_list): Renamed from struct symbol_list_s.
16088 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
16089 (struct symbol): Renamed from struct symbol_s.
16090 (symbol): Renamed from symbol_t.
16091 * src/tables.c (vector_number): Renamed from vector_number_t.
16092 (action_number): Renamed from action_t.
16093 * src/tables.h (base_number): Renamed from base_t.
16094 * src/vcg.h (enum color): Renamed from enum color_e.
16095 (enum textmode): Renamed from enum textmode_e.
16096 (enum shape): Renamed from enum shape_e.
16097 (struct colorentry): Renamed from struct colorentry_s.
16098 (struct classname): Renamed from struct classname_s.
16099 (struct infoname): Renamed from struct infoname_s.
16100 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
16101 (enum decision): Renamed from enum decision_e.
16102 (enum orientation): Renamed from enum orientation_e.
16103 (enum alignment): Renamed from enum alignment_e.
16104 (enum arrow_mode): Renamed from enum arrow_mode_e.
16105 (enum crossing_type): Renamed from enum crossing_type_e.
16106 (enum view): Renamed from enum view_e.
16107 (struct node): Renamed from struct node_s.
16108 (node): Renamed from node_t.
16109 (enum linestyle): Renamed from enum linestyle_e.
16110 (enum arrowstyle): Renamed from enum arrowstyle_e.
16111 (struct edge): Renamed from struct edge.
16112 (edge): Renamed from edge_t.
16113 (struct graph): Renamed from struct graph_s.
16114 (graph): Renamed from graph_t.
16115 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
16116 Rename value_t -> value.
16117 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
16118 value_t_as_yystype -> value_as_yystype.
16119
16120 Don't include <errno.h> in the mainstream code, since it
16121 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
16122 * lib/get-errno.c, lib/get-errno.h: New files.
16123 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
16124 get-errno.c.
16125 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
16126 * src/output.c (output_skeleton): Likewise.
16127 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
16128 instead of errno.
16129 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
16130 Likewise.
16131 (handle_action_dollar, handle_action_at): Likewise.
16132 * src/system.h: Do not include <errno.h>.
16133 (TAB_EXT): Renamed from EXT_TAB.
16134 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
16135
16136 Avoid str[a-z]*, since <string.h> reserves that name space.
16137 Change all instances of "struniq" in names to "uniqstr", and
16138 likewise for "STRUNIQ" and "UNIQSTR".
16139 * src/uniqstr.c: Renamed from src/struniq.c.
16140 * src/uniqstr.h: Renamed from src/struniq.h.
16141 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
16142 * src/files.c (strsuffix): Remove; unused.
16143 (concat2): Renamed from stringappend. Now static.
16144 * src/files.h (strsuffix, stringappend): Remove; unused.
16145 * src/parse-gram.y (<chars>): Renamed from <string>.
16146 (<uniqstr>): Renamed from <struniq>.
16147 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
16148 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
16149 (struct graph_s.expand): Renamed from struct graph_s.stretch.
16150 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
16151 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
16152 (N_EXPAND): Renamed from N_STRETCH.
16153
16154 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
16155 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
16156 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
16157 Remove; unused.
16158 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
16159 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
16160 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
16161 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
16162 (BASE_MAXIMUM): Renamed from BASE_MAX.
16163 (BASE_MINIMUM): Renamed from BASE_MIN.
16164 (ACTION_MAX): Remove; unused.
16165 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
16166 Unnecessary casts removed from above defines.
16167
16168
16169 Fix misspelling in names.
16170 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
16171 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
16172 G_NODE_ALIGNEMENT.
16173
16174
16175 * lib/timevar.c (timevar_report): Renamed from time_report,
16176 for consistency with other names.
16177 * lib/timevar.h (timevar_report): New decl.
16178 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
16179
16180
16181 Sort include-file uses.
16182
16183 Reorder all include files under src to be in the order "system.h".
16184 then the ../lib include files in angle brackets (alphabetized),
16185 then the . include files in double-quotes (alphabetized). Fix
16186 dependency breakages encountered in this process, as follows:
16187 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
16188 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
16189 * src/state.h: Include "symtab.h".
16190
996b1c7e
PE
161912002-12-08 Paul Eggert <eggert@twinsun.com>
16192
16193 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
16194 since this causes problems when __file__ contains character
16195 sequences like "@" that are treated specially by src/scan-skel.l.
16196 Instead, just use the file's basename. This fixes the bug
16197 reported by Martin Mokrejs in
161a71f3 16198 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 16199
e19c4e5d
PE
162002002-12-06 Paul Eggert <eggert@twinsun.com>
16201
16202 Add support for rules that do not have trailing semicolons, as
16203 POSIX requires. Improve the quality of locations in Bison
16204 diagnostics.
26b4a969 16205
e19c4e5d
PE
16206 * src/location.c: Include <quotearg.h>.
16207 (empty_location): Now const.
16208 (location_print): New function. Follow the recommendation of the
16209 GNU Coding Standards for locations that span file boundaries.
16210 * src/location.h: Do not include <quotearg.h>; no longer needed.
16211 (boundary): New type.
16212 (location_t): Use it. This allows locations to span file boundaries.
16213 All member uses changed: file -> start.file or end.file (as needed),
16214 first_line -> start.line, first_column -> start.column,
16215 last_line -> end.line, last_column -> end.column.
16216 (equal_boundaries): New function.
16217 (LOCATION_RESET, LOCATION_STEP): Remove.
16218 (LOCATION_PRINT): Remove. All callers changed to use location_print.
16219 (empty_location): Now const.
16220 (location_print): New decl.
16221 * src/parse-gram.y (lloc_default): New function, which handles
16222 empty locations more accurately.
16223 (YYLLOC_DEFAULT): Use it.
16224 (%token COLON): Remove.
16225 (%token ID_COLON): New token.
26b4a969 16226 (rules): Use it.
e19c4e5d
PE
16227 (declarations, rules): Remove trailing semicolon.
16228 (declaration, rules_or_grammar_declaration):
16229 Allow empty (";") declaration.
16230 (symbol_def): Remove empty actions; no longer needed.
16231 (rules_or_grammar_declaration): Remove trailing semicolon.
16232 (semi_colon.opt): Remove.
16233 * src/reader.h: Include location.h.
16234 (scanner_cursor): New decl.
16235 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
16236 rolling our own.
16237 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
16238 of *loc.
16239 (STEP): Remove. No longer needed, now that adjust_location does
16240 the work. All uses removed.
16241 (scanner_cursor): New var.
16242 (adjust_location): Renamed from extend_location. It now sets
16243 *loc and adjusts the scanner cursor. All uses changed.
16244 Don't bother testing for CR.
16245 (handle_syncline): Remove location arg; now updates scanner cursor.
16246 All callers changed.
16247 (unexpected_end_of_file): Now accepts start boundary of token or
16248 comment, not location. All callers changed. Update scanner cursor,
16249 not the location.
16250 (SC_AFTER_IDENTIFIER): New state.
16251 (context_state): Renamed from c_context. All uses changed.
16252 (id_loc, code_start, token_start): New local vars.
16253 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
16254 processing of Yacc white space and equivalents here.
16255 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
16256 instead of returning ID immediately, since we need to search for
16257 a subsequent colon.
16258 (<INITIAL>"'", "\""): Save token_start.
16259 (<INITIAL>"%{", "{", "%%"): Save code_start.
16260 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
16261 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
16262 BEGIN context_state at end, not INITIAL.
16263 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
16264 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
16265 Return correct token start.
16266 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
16267 the start of a character, string or multiline comment is found.
16268 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
16269 Reduction): Adjust reported locations to match the more-precise
16270 results now expected.
16271 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
16272 * tests/reduce.at (Useless Rules, Reduced Automaton,
16273 Underivable Rules): Likewise.
16274 * tests/regression.at (Invalid inputs): No longer `expecting ";"
16275 or "|"' now that so many other tokens are allowed by the new grammar.
16276
16277 * src/complain.h (current_file): Remove duplicate decl;
16278 current_file is now owned by files.h.
16279 * src/complain.c, src/scan-gram.l: Include files.h.
16280
162812002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 16282
e19c4e5d
PE
16283 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
16284 promotes to int; it might be unsigned int.
16285 * data/yacc.c (yy_reduce_print): Likewise.
16286
16287 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
16288 be #defined in the prologue, not in the Bison declarations.
16289 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 16290
b64755e3
PE
162912002-12-02 Paul Eggert <eggert@twinsun.com>
16292
16293 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
16294 * lib/strtoul.c: New file, from gnulib.
16295 This fixes a porting bug reported by Peter Klein in
161a71f3 16296 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 16297
6e746484
PE
162982002-11-30 Paul Eggert <eggert@twinsun.com>
16299
b64755e3
PE
16300 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
16301 and put only a forward declaration in the prologue. This is for
16302 consistency with the other scanner helper functions.
16303
6ba55592
PE
16304 Type clashes now generate warnings, not errors, since it
16305 appears that POSIX may allow some grammars with type clashes.
16306 * src/reader.c (grammar_current_rule_check): Warn about
16307 type clashes instead of complaining.
16308 * tests/input.at (Type Clashes): Expect warnings, not complaints.
16309
6e746484
PE
16310 Add Yacc library, since POSIX requires it.
16311 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
16312 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
16313 * lib/main.c, lib/yyerror.c: New files.
16314
16315 gram_error can be static; it need not be extern.
16316 * src/reader.h (gram_error): Remove decl.
16317 * src/parse-gram.y (gram_error): Now static. Add static decl.
16318 (print_token_value): Omit parameter names from forward decl,
16319 for consistency.
16320
88510f9c
PE
163212002-11-29 Paul Eggert <eggert@twinsun.com>
16322
6e746484
PE
16323 * doc/bison.texinfo: Emphasize that yylex and yyerror must
16324 be declared before being used. E.g., one should typically
16325 declare them in the prologue. Use GNU coding style in examples.
16326 Put "const" consistently after the type it modifies. Mention
16327 that C99 supports "inline". Mention that yyerror traditionally
16328 returns "int".
16329
88510f9c
PE
16330 %parse-param and %lex-param now take just one argument, the
16331 declaration; the argument name is deduced from the declaration.
16332
16333 * doc/bison.texinfo (Parser Function, Pure Calling, Error
16334 Reporting, Table of Symbols): Document this.
16335 * src/parse-gram.y (add_param): New function.
16336 (COMMA): Remove.
16337 (declaration): Implement new rule for %parse-param and %lex-param.
16338 * src/scan-gram.l: "," now elicits a warning, rather than being
16339 a token; this is more compatible with byacc.
16340 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
16341
bb92250c
PE
163422002-11-27 Paul Eggert <eggert@twinsun.com>
16343
16344 Rename identifiers to avoid real and potential collisions.
16345
16346 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
16347 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 16348 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
16349 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
16350 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
16351 * src/parse-gram.y (print_token_value): Renamed from yyprint.
16352 All uses changed.
16353 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
16354 The name "yycontrol" violates the name space rules, and this stuff
16355 wasn't being used anyway.
16356 (input): Remove action; this stuff wasn't being used.
16357 (gram_error): Rename local variable yylloc -> loc.
16358 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
16359 (YY_DECL): Don't use "yy" at start of local variables.
16360 All uses changed, e.g., yylloc -> loc.
16361 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
16362 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
16363 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
16364 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
16365
16366 * src/parse-gram.y (gram_error): loc is now const *.
16367 * src/reader.h (gram_error): Likewise.
16368
3af4feb2
PE
163692002-11-24 Paul Eggert <eggert@twinsun.com>
16370
16371 Version 1.75c.
16372
16373 * tests/actions.at (Actions after errors): Use an output format
16374 more similar to that of the Printers and Destructors test.
16375 Test the position of the ';' token too.
16376 (Printers and Destructors): Likewise.
16377 (Printers and Destructors: %glr-parser): Remove for now, to avoid
16378 unnecessarily alarming people when the test fails.
16379
16380 * data/yacc.c (yyerrlab1): Move this label down, so that the
16381 parser does not discard the lookahead token if the user code
16382 invokes YYERROR. This change is required for POSIX conformance.
16383
16384 * lib/error.c: Sync with gnulib.
16385
163862002-11-22 Paul Eggert <eggert@twinsun.com>
16387
16388 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
16389 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
16390 * lib/xmalloc.c: Likewise.
26b4a969 16391
58004308
PE
163922002-11-20 Paul Eggert <eggert@twinsun.com>
16393
16394 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
16395
163962002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 16397
58004308
PE
16398 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
16399 should use `if (! x) abort ();' rather than `assert (x);', and
16400 anyway it's one less thing to worry about configuring.
16401
16402 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
16403 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
16404 and replace all instances of assert with abort.
16405 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
16406 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
16407
16408 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
16409 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
16410 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
16411 hash_find_entry, hash_rehash, hash_insert): Likewise.
16412 * src/conflicts.c (resolve_sr_conflict): Likewise.
16413 * src/lalr.c (set_goto_map, map_goto): Likewise.
16414 * src/nullable.c (nullable_compute): Likewise.
16415 * src/output.c (prepare_rules, token_definitions_output): Likewise.
16416 * src/reader.c (packgram, reader): Likewise.
16417 * src/state.c (state_new, state_free, state_transitions_set,
16418 state_reduction_find): Likewise.
16419 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
16420 symbol_pack): Likewise.
16421 * src/tables.c (conflict_row, pack_vector): Likewise.
16422 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
16423 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
16424 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
16425 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
16426
16427 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
16428 (ARGMATCH_CONSTRAINT): New macro.
16429 (ARGMATCH_ASSERT): Use it.
16430
16431 * src/system.h (verify): New macro.
16432 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
16433 rather than assert.
16434 * src/tables.c (tables_generate): Likewise.
16435
16436 * src/struniq.c (struniq_assert): Now returns void, and aborts
16437 if the assertion is false.
16438 (struniq_assert_p): Remove.
16439 * src/struniq.h: Likewise.
16440
76ae8198
PE
164412002-11-18 Paul Eggert <eggert@twinsun.com>
16442
16443 * data/glr.c (yygetLRActions): Replace `yyindex' with
16444 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
16445 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 16446 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 16447
d3c4e709
AD
164482002-11-18 Akim Demaille <akim@epita.fr>
16449
16450 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
16451 space.
16452 From Tim Van Holder.
16453
8d8a7238
PE
164542002-11-17 Paul Eggert <eggert@twinsun.com>
16455
16456 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
16457 to "SyntaxError" for consistency with my 2002-11-15 change.
16458
16459 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
16460 not define to {}, since this breaks the common use of `YYDPRINTF
16461 ((...));' if a single statement is desired (e.g. before `else').
16462 Work around GCC warnings by surrounding corresponding calls with
16463 {} if needed.
16464 (yyhasResolvedValue): Remove unused function.
16465 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
16466 loop body.
16467 (yyreportSyntaxError): Renamed from yyreportParseError.
16468 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
16469 All uses changed.
16470 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
16471 extern when possible. Remove unused initializations.
16472
b0937b22
AD
164732002-11-16 Akim Demaille <akim@epita.fr>
16474
16475 Augment the similarity between GLR and LALR traces.
16476
16477 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
16478 (YY_REDUCE_PRINT): New.
16479 (yyparse): Use them.
16480 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
16481 YYDPRINT here.
16482 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
16483 state reached after the reduction/recovery, since...
16484 (yyparse, yyprocessOneStack): Report the state we are entering in.
16485
c5e3e510
AD
164862002-11-16 Akim Demaille <akim@epita.fr>
16487
16488 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
16489 Add support for --trace=skeleton.
16490 * src/scan-skel.l: %option debug.
16491 Scan strings of non-@ or \n instead of character by character.
16492 (scan_skel): Handle trace_skeleton.
16493 (QPUTS): New.
16494 (@output_parser_name@, @output_header_name@): ``Restore'' their
16495 support (used to be M4 macros).
16496 * data/yacc.c: Quote larger chunks, a la glr.c.
16497 * data/lalr1.cc: Likewise.
16498 The header guards are no longer available, so use some other
16499 string than `YYLSP_NEEDED'.
16500
4c6cc1db
AD
165012002-11-16 Akim Demaille <akim@epita.fr>
16502
16503 Make the ``Printers and Destructors'' test more verbose, taking
16504 `yacc.c''s behavior as (possibly wrong) reference.
16505
16506 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
16507 instead of fprint on stdout.
16508 Set and report the last_line of the symbols.
16509 Consistently display values and locations.
16510
6d9e8019
PE
165112002-11-16 Paul Eggert <eggert@twinsun.com>
16512
16513 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
16514
6e649e65
PE
165152002-11-15 Paul Eggert <eggert@twinsun.com>
16516
b25d88f6
PE
16517 * tests/actions.at (Actions after errors): New test case.
16518
6e649e65
PE
16519 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
16520 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
16521 tests/action.at, tests/calc.at, tests/conflicts.at,
16522 tests/cxx-type.at, tests/regression.at:
16523 "parse error" -> "syntax error" for POSIX compatibility.
16524 "parsing stack overflow..." -> "parser stack overflow" so
16525 that code matches Bison documentation.
16526
0f39aab9
AD
165272002-11-15 Akim Demaille <akim@epita.fr>
16528
16529 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
16530 take two BRACED_CODE, not two string_content.
16531 Free the scanner's obstack when we are done.
16532 (code_content): New.
16533 * tests/calc.at: Adjust.
16534 * doc/bison.texinfo: Adjust.
16535 Also, make sure to include the `,' for these declarations.
16536
761c1926
AD
165372002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
16538
16539 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
16540 definition; avoids potential autoreconf problems.
16541
b0f98b10
AD
165422002-11-15 Akim Demaille <akim@epita.fr>
16543
16544 Always check the value returned by yyparse.
16545
16546 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
16547 returned by yyparse.
16548 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
16549 Adjust calls.
16550 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
16551 returned by yyparse.
16552
970785f1
PH
165532002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16554
16555 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
16556 on input.at test.
16557
8fcc7db1
PE
165582002-11-14 Paul Eggert <eggert@twinsun.com>
16559
7ec1b48e
PE
16560 * src/output.c (output_skeleton): Call xfopen instead of
16561 duplicating xfopen's body.
16562
cfff7583 16563 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 16564 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 16565
8fcc7db1
PE
16566 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
16567 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
16568 Group compiler. Instead, use "$CC -E bar.c". Include the .h
16569 file twice in the grammar, as an extra check.
16570
16571 * tests/input.at (Torturing the Scanner): Surround the
16572 backslash-newline tests with "#if 0", to make it less likely that
16573 we'll run into compiler bugs. Bring back solitary \ inside
16574 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 16575 test backslash-newline in C character constant.
8fcc7db1 16576
4e8d992c
AD
165772002-11-14 Akim Demaille <akim@epita.fr>
16578
16579 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
16580 status of the compiler.
f32b346d 16581 Calling `exit 1' is no longer needed.
4e8d992c
AD
16582 Reported by Nelson H. F. Beebe.
16583
9501dc6e
AD
165842002-11-14 Akim Demaille <akim@epita.fr>
16585
16586 * tests/atlocal.in (CPPFLAGS): We have config.h.
16587 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
16588 New.
16589 * tests/actions.at, tests/calc.at, tests/conflicts.at,
16590 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
16591 * tests/regression.at, tests/torture.at: Use them for all the
16592 grammars that are to be compiled.
16593 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
16594 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
16595 * doc/bison.texinfo (GLR Parsers): Document `inline'.
16596
18b519c0
AD
165972002-11-14 Akim Demaille <akim@epita.fr>
16598
16599 * doc/bison.texinfo: Various formatting changes (alignments in
16600 samples, additional @group/@end group, GCS in samples.
16601 Use @deffn instead of simple @table to define the directives,
16602 macros, variables etc.
16603
9a86cdb9
PE
166042002-11-13 Paul Eggert <eggert@twinsun.com>
16605
daa33def 16606 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 16607 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 16608
daa33def 16609 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 16610 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
16611 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
16612 * tests/headers.at (export YYLTYPE): Likewise.
16613
16614 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 16615 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 16616
9a86cdb9
PE
16617 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
16618 comments, since they're not portable. Use GNU coding style.
16619
9c1e26bd
AD
166202002-11-13 Akim Demaille <akim@epita.fr>
16621
16622 * data/yacc.c: Leave bigger chunks of quoted text.
16623 (YYDSYMPRINTF): New.
16624 Use it to report symbol activities.
16625 * data/glr.c (YYDSYMPRINTF): New.
16626 Use it.
16627
87f721cc
PE
166282002-11-12 Paul Eggert <eggert@twinsun.com>
16629
16630 Version 1.75b.
16631
16632 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
16633 (yyglrReduce): Return yyok, not 0.
16634 This should avoid the enumerated-type warnings reported
464c6927 16635 by Nelson H. F. Beebe in
161a71f3 16636 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
16637
16638 * lib/bbitset.h (BITSET_INLINE): Remove.
16639 * lib/bitset.h [! BITSET_INLINE]: Remove.
16640 (bitset_set, bitset_reset, bitset_test): Rename local vars
16641 to avoid shadowing warnings by GCC.
16642
16643 * data/glr.c (inline): Remove #define. It's the user's
16644 responsibility to #define it away, just like 'const'.
464c6927 16645 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 16646 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 16647
87f721cc
PE
16648 * Makefile.maint (po-check): Scan .l and .y files instead of the
16649 .c and the .h files that they generate. This fixes the bug
16650 reported by Tim Van Holder in:
161a71f3 16651 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
16652 Look for N_ as well as for _. Try to avoid matching #define for
16653 N_ and _.
16654 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
16655 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
16656 * src/scan-gram.l: Revamp regular expressions so that " and '
16657 do not confuse xgettext.
16658
16659 * src/struniq.h (struniq_new): Do not declare the return type
16660 to be 'const'; this violates the C standard.
16661 * src/struniq.c (struniq_new): Likewise.
16662
be14ade5
AD
166632002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
16664
16665 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
16666 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
16667 linker.
16668
05291fbc
AD
166692002-11-12 Akim Demaille <akim@epita.fr>
16670
16671 * Makefile.maint: Sync with Autoconf:
16672 (local_updates): New.
16673
1f5fd52e
AD
166742002-11-12 Akim Demaille <akim@epita.fr>
16675
16676 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
16677
283f1e64
AD
166782002-11-12 Akim Demaille <akim@epita.fr>
16679
16680 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
16681 locations.
16682
886b69d1
AD
166832002-11-12 Akim Demaille <akim@epita.fr>
16684
16685 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
16686 not yyvalue.
16687
3df37415
AD
166882002-11-12 Akim Demaille <akim@epita.fr>
16689
16690 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
16691 Use it to test the GLR parser.
16692
7bd6c77e
AD
166932002-11-12 Akim Demaille <akim@epita.fr>
16694
16695 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
16696 defines it.
16697 * data/glr.c (yystos): New.
16698 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
16699 (YYDSYMPRINT): New.
16700 (yyval): Don't define it, it is handled via M4.
16701 (yyrecoverParseError): Free verbosely the discarded symbols.
16702 * data/yacc.c (yysymprint): Remove, rather...
16703 (b4_yysymprint_generate): invoke.
16704 * data/c.m4 (b4_yysymprint_generate): New.
16705 Accept pointers as arguments, as opposed to the version from
16706 yacc.c.
16707 (b4_yydestruct_generate): Likewise.
16708 * tests/cations.at (Printers and Destructors): Use Bison directives
16709 instead of CPP macros.
16710 Don't rely on internal details.
16711
b0400cc6
AD
167122002-11-12 Akim Demaille <akim@epita.fr>
16713
16714 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
16715 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
16716 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
16717 it against YYEMPTY and so forth), work on yytoken (i.e., set
16718 it to YYEMPTY etc.).
16719 (yydestruct): Replace with a b4_yydestruct_generate invocation.
16720 (b4_symbol_actions): Remove.
16721 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
16722 for 0, end-of-input.
16723
72f889cc
AD
167242002-11-12 Akim Demaille <akim@epita.fr>
16725
16726 * doc/bison.texinfo (Destructor Decl): New.
16727
b1ae9233
AD
167282002-11-12 Akim Demaille <akim@epita.fr>
16729
16730 * src/tables.c (tables_generate): Use free for pointers that
16731 cannot be NULL, not XFREE.
16732 (pack_vector): Use assert, not fatal, for bound violations.
16733 * src/state.c (state_new): Likewise.
16734 * src/reader.c (reader): Likewise.
16735 * src/lalr.c (set_goto_map): Likewise.
72f889cc 16736 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
16737 the file name.
16738
7ec2d4cd
AD
167392002-11-12 Akim Demaille <akim@epita.fr>
16740
16741 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
16742 Restore.
16743 * src/scan-gram.l (last_string): Is global to the file, not to
16744 yylex.
16745 * src/parse-gram.y (input): Don't append the epilogue here,
16746 (epilogue.opt): do it here, and free the scanner's obstack.
16747 * src/reader.c (epilogue_set): Rename as...
16748 (epilogue_augment): this.
16749 * data/c.m4 (b4_epilogue): Defaults to empty.
16750
573a6cd3
AD
167512002-11-12 Akim Demaille <akim@epita.fr>
16752
16753 * src/getargs.c (long_options): Remove duplicates.
16754 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
16755 Remove.
16756 * doc/bison.rnh: Remove.
16757 * doc/bison.texinfo (VMS Invocation): Remove.
16758
95612cfa
AD
167592002-11-12 Akim Demaille <akim@epita.fr>
16760
16761 * src/struniq.h, src/struniq.c (struniq_t): Is const.
16762 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
16763
16764 Use struniq for symbols.
16765
16766 * src/symtab.h (symbol_t): The tag member is a struniq.
16767 (symbol_type_set): Adjust.
16768 * src/symtab.c (symbol_new): Takes a struniq.
16769 (symbol_free): Don't free the tag member.
16770 (hash_compare_symbol_t, hash_symbol_t): Rename as...
16771 (hash_compare_symbol, hash_symbol): these.
16772 Use the fact that tags as struniqs.
16773 (symbol_get): Use struniq_new.
16774 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
16775 Returns a strniq.
16776 * src/reader.h (merger_list, grammar_currentmerge_set): The name
16777 and type members are struniqs.
16778 * src/reader.c (get_merge_function)
16779 (grammar_current_rule_merge_set): Adjust.
16780 (TYPE, current_type): Are struniq.
16781
16782 Use struniq for file names.
16783
16784 * src/files.h, src/files.c (infile): Split into...
16785 (grammar_file, current_file): these.
16786 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
16787 * src/reduce.c (reduce_print): Likewise.
16788 * src/getargs.c (getargs): Likewise.
16789 * src/complain.h, src/complain.c: Likewise.
16790 * src/main.c (main): Call struniqs_new early enough to use it for
16791 file names.
16792 Don't free the input file name.
16793
3e6656f9
AD
167942002-11-12 Akim Demaille <akim@epita.fr>
16795
16796 * src/symtab.c (symbol_free): Remove dead deactivated code:
16797 type_name are properly removed.
16798 Don't use XFREE to free items that cannot be NULL.
16799 * src/struniq.h, src/struniq.c: New.
16800 * src/main.c (main): Initialize/free struniqs.
16801 * src/parse-gram.y (%union): Add astruniq member.
16802 (yyprint): Adjust.
16803 * src/scan-gram.l (<{tag}>): Return a struniq.
16804 Free the obstack bit that used to store it.
16805 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
16806
7672019c
PE
168072002-11-11 Paul Eggert <eggert@twinsun.com>
16808
16809 Revamp to fix many (but not all) of the C- and M4-related quoting
16810 problems. Among other things, this fixes the Bison bug reported
16811 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 16812 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
16813
16814 Use new @ escapes consistently. Represent brackets with @{ and @}
16815 rather than @<:@ and @:>@, since this works a bit better with dumb
16816 editors like vi. Represent @ with @@, since @ is now consistently
16817 an escape. Use @oline@ and @ofile@ rather than __oline__ and
16818 __ofile__, to avoid unexpected expansions. Similarly, use @output
16819 rather than #output.
16820
16821 * data/c.m4 (b4_copyright): Omit file name from comment, since
16822 the file name could contain "*/".
16823 (b4_synclines_flag): Don't quote the 2nd argument; it should already
16824 be quoted. All uses changed.
16825
16826 * data/glr.c: Use new @ escapes consistently.
16827 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
16828 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
16829 Remove, since they couldn't handle arbitrary characters in file
16830 names.
16831 * data/lalr1.cc: Likewise.
16832 * data/yacc.c: Likewise.
16833
16834 * src/files.c (output_infix): Remove; all uses removed.
16835 * src/files.h: Likewise.
16836
16837 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
16838 mishandled funny characters in file names, and anyway it isn't
16839 needed any more.
16840 * data/yacc.c: Likewise.
16841 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
16842
16843 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
16844 * data/yacc.c: Likewise.
16845
16846 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
16847 strings now.
16848 (muscle_init): Quote filename as a C string.
16849 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
16850 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
16851 * src/output.c (escaped_file_name_output): New function.
16852 (prepare_symbols): Quote tokens for M4.
16853 (prepare): Don't insert output_infix, output_prefix,
16854 output_parser_name, output_header_name; this is now down by scan-skel.
16855 Insert skeleton as a C string.
16856
16857 * src/output.c (user_actions_output, symbol_destructors_output,
16858 symbol_printers_output): Quote filenames for C and M4.
16859 * src/reader.c (prologue_augment, epilogue_set): Likewise.
16860
16861 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
16862 escapes other than \\ and \'; this simplifies the code.
16863 (<SC_STRING>): Likewise, for \\ and \".
16864 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
16865 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
16866 Use new escapes @{ and @} for [ and ].
16867
16868 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
16869 them with auto vars.
16870 Switch to new escape scheme, where @ is the escape character uniformly.
16871 Abort if a stray escape character is found. Avoid unbounded input
16872 buffer when parsing non-escaped text.
16873
16874 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
16875 __oline__, #output, $@, and @{ do not have unintended meanings.
16876
acea4f3b
PE
168772002-11-09 Paul Eggert <eggert@twinsun.com>
16878
16879 Fix the test failure due to GCC warnings described in
161a71f3 16880 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
16881 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
16882 evaluate to 0 if it's impossible for NINF to be in the respective
16883 table.
16884 (yygetLRActions, yyrecoverParseError): Use them.
16885
16886 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
16887 counted in the token inserted at end of file. Now takes
16888 location_t *, not location_t, so that the location can be
16889 adjusted. All uses changed.
16890
16891 * tests/regression.at (Invalid inputs): Adjust wording in
16892 diagnostic to match the new behavior.
16893
16894 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
16895 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
16896 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
16897 abort ();'. This reduces the runtime of the "Many lookaheads"
16898 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
16899 GCC 3.2.
16900
20ef1ad5
PE
169012002-11-07 Paul Eggert <eggert@twinsun.com>
16902
16903 * src/parse-gram.y (CHARACTER): Remove unused token.
16904 All uses removed.
16905
16906 * src/scan-gram.l: Remove stack option. We no longer use the
16907 stack, since the stack was never deeper than 1; instead, use the
16908 new auto var c_context to record the stacked value.
16909
16910 Remove nounput option. At an unexpected end of file, we now unput
16911 the minimal input necessary to end cleanly; this simplifies the
16912 code.
16913
16914 Avoid unbounded token sizes where this is easy.
16915
16916 (unexpected_end_of_file): New function.
16917 Use it to systematize the error message on unexpected EOF.
16918 (last-string): Now auto, not static.
16919 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
16920 (scanner_last_string_free): Remove; not used.
16921 (percent_percent_count): Move decl to just before use.
16922 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
16923 not the (never otherwised-used) CHARACTER.
16924
93724f13
AD
169252002-11-07 Akim Demaille <akim@epita.fr>
16926
16927 Let yyerror always receive the msg as last argument, so that
16928 yyerror can be variadic.
16929
16930 * data/yacc.c (b4_yyerror_args): New.
16931 Use it when calling yyerror.
16932 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
16933 Use it when calling yyerror.
16934 * doc/bison.texinfo (Error Reporting): Adjust.
16935 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
16936 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
16937
6e40b4eb
AD
169382002-11-06 Akim Demaille <akim@epita.fr>
16939
16940 #line should have quoted strings.
16941 Ideally, this should be done by m4_quotearg.
16942
16943 * src/scan-skel.l: Include quotearg.h.
16944 Quote __ofile__.
16945 * src/output.c (symbol_printers_output)
16946 (symbol_destructors_output): Quote the file name.
16947
2dfbfc12
AD
169482002-11-06 Akim Demaille <akim@epita.fr>
16949
16950 * tests/regression.at (Invalid inputs): Adjust to the recent
16951 messages.
16952
437c2d80
AD
169532002-11-06 Akim Demaille <akim@epita.fr>
16954
16955 Restore --no-lines.
16956 Reported by Jim Kent.
16957
16958 * data/c.m4 (b4_syncline): New.
16959 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
16960 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
16961 * src/output.c (user_actions_output): Likewise.
16962 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 16963 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 16964
900c5db5
AD
169652002-11-06 Akim Demaille <akim@epita.fr>
16966
16967 * src/main.c (main): Free `infile'.
16968 * src/scan-gram.l (handle_syncline): New.
16969 Recognize `#line'.
16970 * src/output.c (user_actions_output, symbol_destructors_output)
16971 (symbol_printers_output): Use the location's file name, not
16972 infile.
16973 * src/reader.c (prologue_augment, epilogue_set): Likewise.
16974
e183b123 169752002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 16976
e183b123 16977 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 16978 either has GLR conflict entries.
e183b123 16979
193eb6b7
PE
169802002-11-05 Paul Eggert <eggert@twinsun.com>
16981
e183b123
PE
16982 * src/scan-gram.l: Use more accurate diagnostics, e.g.
16983 "integer out of range" rather than "invalid value".
16984 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
16985 accordingly.
16986
193eb6b7
PE
16987 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
16988 Also, remove one static variable in the scanner.
16989
16990 * src/scan-gram.l (braces_level): Now auto, not static.
16991 Initialize to zero if the compiler is being picky.
16992 (INITIAL): Clear braces_level instead of incrementing it.
16993 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
16994 as POSIX 1003.1-2001 requires.
16995 * src/system.h (IF_LINT): New macro, taken from coreutils.
16996 * configure.ac: Define "lint" if --enable-gcc-warnings.
16997
29c01725
AD
169982002-11-05 Akim Demaille <akim@epita.fr>
16999
17000 * src/scan-gram.l: When it starts with `%', complain about the
17001 whole directive, not just that `invalid character: %'.
17002
8aeac3ca
AD
170032002-11-04 Akim Demaille <akim@epita.fr>
17004
17005 * Makefile.maint: Update from Autoconf.
17006 (update, cvs-update, po-update, do-po-update): New.
17007
793a58bb
AD
170082002-11-04 Akim Demaille <akim@epita.fr>
17009
17010 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
17011 and yyerror.
17012 Have yyerror `use' its arguments.
17013 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
17014 returns true when location & yacc & pure & parse-param.
17015 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
17016
c4d720cd
AD
170172002-11-04 Akim Demaille <akim@epita.fr>
17018
17019 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
17020 clashes.
17021 * src/scan-gram.l: Use [\'] instead of ['] to pacify
17022 font-lock-mode.
17023 Use complain_at.
17024 Use quote, not quote_n since LOCATION_PRINT no longer uses the
17025 slot 0.
17026
613a0dc5
PE
170272002-11-03 Paul Eggert <eggert@twinsun.com>
17028
17029 * src/reader.c (get_merge_function, grammar_current_rule_check):
17030 Use consistent diagnostics for reporting type name clashes.
17031 Quote the types with <>, for consistency with Yacc.
17032 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
17033
2a8d363a
AD
170342002-11-03 Akim Demaille <akim@epita.fr>
17035
17036 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
17037 New.
17038 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
17039 (b4_parse_param): Remove.
17040 Use b4_identification.
17041 Propagate b4_pure_args where needed to pass them to yyerror.
17042 * data/glr.m4 (b4_parse_param): Remove.
17043 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
17044 (b4_lpure_formals): New.
17045 Use b4_identification.
17046 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
17047 b4_user_formals and b4_user_args.
17048 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
17049 (yyreportAmbiguity): When using a pure parser, also need
17050 the location, and the parse-params.
17051 Adjust callers.
17052 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
17053 When using a pure parser, also need the parse-params.
17054 Adjust callers.
17055 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
17056 (%pure-parser + %parse-param) LALR and GLR parsers.
17057 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
17058 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
17059 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
17060 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
17061 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
17062 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
17063 * doc/bison.texinfo: Untabify the whole file.
17064 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
17065 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
17066 (Error Reporting): Adjust to these new directives.
17067 Document %error-verbose, deprecate YYERROR_VERBOSE.
17068
9e32add8
AD
170692002-11-03 Akim Demaille <akim@epita.fr>
17070
17071 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
17072 AT_CHECK_CALC_GLR invocations to use % directives, instead of
17073 command line options.
17074 * tests/cxx-type.at: Formatting changes.
17075
b02d90a5
PE
170762002-11-03 Paul Eggert <eggert@twinsun.com>
17077
17078 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
17079 to count columns correctly, and to check for invalid inputs.
9e32add8 17080
b02d90a5
PE
17081 Use mbsnwidth to count columns correctly. Account for tabs, too.
17082 Include mbswidth.h.
17083 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
17084 (extend_location): New function.
17085 (YY_LINES): Remove.
17086
17087 Handle CRLF in C code rather than in Lex code.
17088 (YY_INPUT): New macro.
17089 (no_cr_read): New function.
17090
17091 Scan UCNs, even though we don't fully handle them yet.
17092 (convert_ucn_to_byte): New function.
17093
17094 Handle backslash-newline correctly in C code.
17095 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
17096 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
17097 all uses changed.
17098 (tag, splice): New EREs. Do not allow NUL or newline in tags.
17099 Use {splice} wherever C allows backslash-newline.
17100 YY_STEP after space, newline, vertical-tab.
17101 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 17102
b02d90a5
PE
17103 (letter, id): Don't assume ASCII; e.g., spell out a-z.
17104
17105 ({int}, handle_action_dollar, handle_action_at): Check for integer
17106 overflow.
9e32add8 17107
b02d90a5
PE
17108 (YY_STEP): Omit trailing semicolon, so that it's more like C.
17109
17110 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
17111 as well as \000. Check for UCHAR_MAX, not 255.
17112 Allow \x with an arbitrary positive number of digits, as in C.
17113 Check for overflow here.
17114 Allow \? and UCNs, for compatibility with C.
17115
17116 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
17117 with quote slot used by complain_at.
17118
17119 * tests/input.at: Add tests for backslash-newline, m4 quotes
17120 in symbols, long literals, and funny escapes in strings.
17121
17122 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
17123 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
17124 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
17125 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
17126 * m4/mbswidth.m4: New file, from GNU coreutils.
17127
17128 * doc/bison.texinfo (Grammar Outline): Document // comments.
17129 (Symbols): Document that trigraphs have no special meaning in Bison,
17130 nor is backslash-newline allowed.
17131 (Actions): Document that trigraphs have no special meaning.
17132
17133 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
17134 no longer used.
17135
171362002-11-02 Paul Eggert <eggert@twinsun.com>
17137
17138 * src/reader.c: Don't include quote.h; not needed.
17139 (get_merge_function): Reword warning to be consistent with
17140 type clash diagnostic in grammar_current_rule_check.
17141
17142 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
17143 bug in trigraph handling.
17144
17145 * src/output.c (prepare_symbols): When printing token names,
17146 escape "[" as "@<:@" and likewise for "]".
17147
17148 * src/system.h (errno): Remove declaration, as we are now
17149 assuming C89 or better, and C89 guarantees errno.
17150
762b212b
PE
171512002-10-30 Paul Eggert <eggert@twinsun.com>
17152
17153 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
17154 Check for close failures.
17155 * src/files.h (xfclose): Return void, not int, since it always
17156 returned zero.
17157 * src/files.c (xfclose): Likewise. Report I/O error if ferror
17158 indicates one.
17159 * src/output.c (output_skeleton): Use xfclose rather than fclose
17160 and ferror. xfclose now checks ferror.
17161
17162 * data/glr.c (YYLEFTMOST_STATE): Remove.
17163 (yyreportTree): Use a stack-based leftmost state. This avoids
17164 our continuing battles with bogus warnings about initializers.
17165
56100c60
AD
171662002-10-30 Akim Demaille <akim@epita.fr>
17167
17168 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
17169 #if.
17170
51b4a04c
PH
171712002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17172
17173 * tests/glr-regr1.at: New test for reported regressions.
17174 * tests/testsuite.at: Add glr-regr1.at test.
17175 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 17176
bf1ebda2
PE
171772002-10-24 Paul Eggert <eggert@twinsun.com>
17178
5c16c6b1
PE
17179 Version 1.75a.
17180
bf1ebda2
PE
17181 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
17182 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
17183 we use malloc. Don't assume 'A' through 'Z' are contiguous.
17184 Don't assume strdup exists; POSIX says its an XSI extension.
17185 Check for buffer overflow on input.
17186
b526ee61
AD
171872002-10-24 Akim Demaille <akim@epita.fr>
17188
17189 * src/output.c (output_skeleton): Don't disable M4sugar comments
17190 too soon: it results in comments being expanded.
17191 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
17192 first output.
17193
f1886bb2
AD
171942002-10-24 Akim Demaille <akim@epita.fr>
17195
17196 * data/yacc.c (m4_int_type): New.
17197 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
17198 char' as only yacc.c wants K&R portability.
17199 * data/glr.c (yysigned_char): Remove.
17200 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
17201 Reported by Quoc Peyrot.
17202
c5576256
PE
172032002-10-23 Paul Eggert <eggert@twinsun.com>
17204
17205 * src/main.c (main): With --trace=time, report times even if a
17206 non-fatal error occurs. Formerly, the times were reported in some
17207 such cases but not in others.
17208 * src/reader.c (reader): Just return if a complaint has been issued,
17209 instead of exiting, so that 'main' can report times.
17210
27b0ffea
AD
172112002-10-22 Akim Demaille <akim@epita.fr>
17212
17213 * src/system.h: Include sys/types.
17214 Reported by Bert Deknuydt.
17215
223a7883
PE
172162002-10-23 Paul Eggert <eggert@twinsun.com>
17217
17218 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
17219 Suggested by Art Haas.
17220
172212002-10-22 Paul Eggert <eggert@twinsun.com>
17222
17223 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
17224 decl; not needed any more.
17225 * src/main.c (main): Use return to exit, undoing yesterday's change.
17226 The last OS that we could find where this wouldn't work is
17227 SunOS 3.5, and that's too old to worry about now.
17228
17229 * data/glr.c (struct yyltype): Define members even when not
17230 doing locations. This is more consistent with yacc.c, and it
17231 works around the following bug reports:
161a71f3
PE
17232 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
17233 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 17234
223a7883
PE
17235 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
17236 @acronym consistently. Standardize on "Yacc" instead of "YACC",
17237 "Algol" instead of "ALGOL". Give a bit more history about BNF.
17238
8b76775a
AD
172392002-10-22 Akim Demaille <akim@epita.fr>
17240
17241 * data/README: New.
17242
6db10d14
PE
172432002-10-21 Paul Eggert <eggert@twinsun.com>
17244
17245 Be consistent about 'bool'; the old code used an enum in one
17246 module and an int in another, and this violates the C standard.
17247 * m4/stdbool.m4: New file, from coreutils 4.5.3.
17248 * configure.ac (AC_HEADER_STDBOOL): Add.
17249 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
17250 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
17251 * src/symtab.c (hash_compare_symbol_t): Likewise.
17252 * src/system.h (bool, false, true): Use a definition consistent
17253 with ../lib/hash.c. All uses changed.
17254
17255 * src/complain.c (warning_issued): Renamed from warn_message_count,
17256 so that we needn't worry about integer overflow (!).
17257 Now of type bool. All uses changed.
17258 (complaint_issued): Renamed from complain_message_count; likewise.
17259
17260 * src/main.c (main): Use exit to exit with failure.
27b0ffea 17261
6db10d14
PE
17262 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
17263 rather than 1 and 0.
17264 * src/main.c (main): Likewise.
17265 * src/getargs.c (getargs): Likewise.
17266 * src/reader.c (reader): Likewise.
17267
17268 * src/getarg.c (getargs): Remove duplicate code for
17269 "Try `bison --help'".
17270
17271 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
17272 What was that "2" for?
17273
17274 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
17275 * src/getargs.c (usage): Likewise.
17276
17277 * src/getargs.c (getargs): When there are too few operands, report
17278 the last one. When there are too many, report the first extra
17279 one. This is how diffutils does it.
17280
92a060fd
PE
172812002-10-20 Paul Eggert <eggert@twinsun.com>
17282
17283 Remove K&R vestiges.
17284 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
17285 * src/complain.c (VA_START): Remove. Assume prototypes.
17286 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
17287 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
17288 fatal): Assume prototypes.
17289 * src/complain.h: Assume prototypes.
17290 * src/system.h (PARAMS): Remove.
17291 Include <limits.h> unconditionally, since it's guaranteeed even
17292 for a freestanding C89 compiler.
17293 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
17294 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 17295
e7cb57c0
AD
172962002-10-20 Akim Demaille <akim@epita.fr>
17297
17298 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
17299 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
17300 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
17301 (yyresolveStates, yyresolveAction, yyresolveStack)
17302 (yyprocessOneStack): Use them.
17303 (yy_reduce_print): New.
17304 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
17305
0245f82d
AD
173062002-10-20 Akim Demaille <akim@epita.fr>
17307
17308 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
17309 arguments and output `void'.
17310 (b4_c_function): Rename as...
17311 (b4_c_function_def): this.
17312 (b4_c_function_decl, b4_c_ansi_function_def)
17313 (b4_c_ansi_function_decl): New.
17314 Change the interpretation of the arguments: before `int, foo', now
17315 `int foo, foo'.
17316 * data/yacc.c (yyparse): Prototype and define thanks to these.
17317 Adjust b4_c_function_def uses.
17318 * data/glr.c (yyparse): Likewise, but ANSI only.
17319
39912f52
AD
173202002-10-20 Akim Demaille <akim@epita.fr>
17321
17322 * src/output.c (prepare): Move the definition of `tokens_number',
17323 `nterms_number', `undef_token_number', `user_token_number_max'
17324 to...
17325 (prepare_tokens): Here.
17326 (prepare_tokens): Rename as...
17327 (prepare_symbols): this.
17328 (prepare): Move the definition of `rules_number' to...
17329 (prepare_rules): here.
17330 (prepare): Move the definition of `last', `final_state_number',
17331 `states_number' to...
17332 (prepare_states): here.
17333 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
17334
20c1e2ad
AD
173352002-10-20 Akim Demaille <akim@epita.fr>
17336
17337 * src/tables.h, src/tables.c, src/output.c: Comment changes.
17338
21964f43
AD
173392002-10-20 Akim Demaille <akim@epita.fr>
17340
17341 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
17342 * data/c.m4: here.
17343
66d30cd4
AD
173442002-10-20 Akim Demaille <akim@epita.fr>
17345
17346 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
17347 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
17348 `pair'.
17349 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
17350 `name' to...
17351 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
17352 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
17353 These.
17354
95f2c9fe
PE
173552002-10-19 Paul Eggert <eggert@twinsun.com>
17356
17357 Do not create a temporary file, as that involves security and
17358 cleanup headaches. Instead, use a pair of pipes.
17359 Derived from a suggestion by Florian Krohm.
17360 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
17361 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
17362 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
17363 (BISON_PREREQ_SUBPIPE): Add.
17364 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
17365 Add subpipe.h, subpipe.c.
17366 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
17367 * po/POTFILES.in: Add lib/subpipe.c.
17368 * src/output.c: Include "subpipe.h".
17369 (m4_invoke): Remove decl.
17370 (scan_skel): New decl.
17371 (output_skeleton): Use pipe rather than temporary file for m4 input.
17372 Check that m4sugar.m4 is readable, to avoid deadlock.
17373 Check for pipe I/O error.
17374 * src/scan-skel.l (readpipe): Remove decl.
17375 (scan_skel): New function, to be used in place of m4_invoke.
17376 Read from stream rather than file.
66d30cd4 17377
95f2c9fe
PE
17378 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
17379 float, as this generates a warning on Solaris 8 + GCC 3.2 with
17380 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
17381 this generates a more-accurate value anyway.
17382
17383 * lib/timevar.c (timervar_accumulate): Rename locals to
17384 avoid confusion with similarly-named more-global.
17385 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
17386
17387 * src/output.c (prepare): Use xstrdup to convert char const *
17388 to char *, to avoid GCC warning.
17389
c19988b7
AD
173902002-10-19 Akim Demaille <akim@epita.fr>
17391
17392 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
17393 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
17394 Use them to have `calc.y' ready for %pure-parser.
17395 * data/yacc.c (YYLEX): Pass a yylex return type to
17396 b4_c_function_call.
17397
ae7453f2
AD
173982002-10-19 Akim Demaille <akim@epita.fr>
17399
17400 Prototype support of %lex-param and %parse-param.
17401
17402 * src/parse-gram.y: Add the definition of the %lex-param and
17403 %parse-param tokens, plus their rules.
17404 Drop the `_' version of %glr-parser.
17405 Add the "," token.
17406 * src/scan-gram.l (INITIAL): Scan them.
17407 * src/muscle_tab.c: Comment changes.
17408 (muscle_insert, muscle_find): Rename `pair' as `probe'.
17409 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
17410 (muscle_entry_s): The `value' member is no longer const.
17411 Adjust all dependencies.
17412 * src/muscle_tab.c (muscle_init): Adjust: use
17413 MUSCLE_INSERT_STRING.
17414 Initialize the obstack earlier.
17415 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
17416 (muscle_pair_list_grow): New.
17417 * data/c.m4 (b4_c_function_call, b4_c_args): New.
17418 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
17419 * tests/calc.at: Use %locations, not --locations.
17420 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
17421
0e575721
AD
174222002-10-19 Akim Demaille <akim@epita.fr>
17423
17424 * src/getargs.c (usage): Take status as argument and exit
17425 accordingly.
17426 Report the traditional `Try ... --help' message when status != 0.
17427 (usage, version): Don't take a FILE * as arg, it is pointless.
17428 (getargs): When there is an incorrect number of arguments, make it
17429 an error, and report it GNUlically thanks to `usage ()'.
17430
724ce7f5
PE
174312002-10-18 Paul Eggert <eggert@twinsun.com>
17432
3a781eb2
PE
17433 * data/glr.c (yyreportParseError): Don't assume that sprintf
17434 yields the length of the printed string, as this is not true
17435 on SunOS 4.1.4. Reported by Peter Klein.
17436
724ce7f5
PE
17437 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
17438 * tests/conflicts.at (%nonassoc and eof): Likewise.
17439 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
17440
473d0a75
AD
174412002-10-17 Akim Demaille <akim@epita.fr>
17442
17443 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
17444 * src/getargs.c (trace_types, trace_args): Adjust.
17445 * src/reader.c (grammar_current_rule_prec_set)
17446 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
17447 Standardize error messages.
17448 And s/@prec/%prec/!
17449 (reader): Use trace_flag to enable scanner/parser debugging,
17450 instead of an adhoc scheme.
17451 * src/scan-gram.l: Remove trailing debugging code.
17452
e76d2469
PE
174532002-10-16 Paul Eggert <eggert@twinsun.com>
17454
93e2236a
PE
17455 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
17456 MUSCLE_TAB_H.
17457
e76d2469
PE
17458 * NEWS: Officially drop support for building Bison with K&R C,
17459 since it didn't work anyway and it's not worth worrying about.
17460 * Makefile.maint (wget_files): Remove ansi2knr.c.
17461 (ansi2knr.c-url_prefix): Remove.
17462 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
17463 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
17464 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
17465
5bd1c419
PE
174662002-10-15 Paul Eggert <eggert@twinsun.com>
17467
17468 Stop using the "enum_" trick for K&R-style function definitions;
17469 it confused me, and I was the author! Instead, assume that people
17470 who want to use K&R C compilers (when using these modules in GCC,
17471 perhaps?) will run ansi2knr.
17472
17473 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
17474 All uses of "enum_" changed to "enum ".
17475 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
17476 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 17477
5bd1c419
PE
17478 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
17479 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
17480 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
17481 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
17482 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
17483 abitset_not, abitset_ones, abitset_or, abitset_or_and,
17484 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
17485 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
17486 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
17487 Use function prototypes; this removes the need for declaring
17488 static functions simply to provide their prototypes.
17489 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
17490 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
17491 bitset_count_, bitset_create, bitset_dump, bitset_first,
17492 bitset_free, bitset_init, bitset_last, bitset_next,
17493 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
17494 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
17495 bitset_print, bitset_release_memory, bitset_toggle_,
17496 bitset_type_choose, bitset_type_get, bitset_type_name_get,
17497 debug_bitset): Likewise.
17498 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
17499 * lib/bitset_stats.c (bitset_log_histogram_print,
17500 bitset_percent_histogram_print, bitset_stats_and,
17501 bitset_stats_and_cmp, bitset_stats_and_or,
17502 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
17503 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
17504 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
17505 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
17506 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
17507 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
17508 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
17509 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
17510 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
17511 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
17512 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
17513 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
17514 bitset_stats_zero): Likewise.
17515 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
17516 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
17517 bitsetv_dump, debug_bitsetv): Likewise.
17518 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
17519 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
17520 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
17521 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
17522 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
17523 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
17524 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
17525 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
17526 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
17527 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
17528 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
17529 Likewise.
17530 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
17531 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
17532 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
17533 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
17534 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
17535 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
17536 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
17537 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
17538 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
17539 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
17540 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 17541
ae26e1f0
AD
175422002-10-14 Akim Demaille <akim@epita.fr>
17543
17544 Version 1.75.
17545
d43baf71
AD
175462002-10-14 Akim Demaille <akim@epita.fr>
17547
17548 * tests/Makefile.am (maintainer-check-posix): New.
17549
7ebc83e3
AD
175502002-10-14 Akim Demaille <akim@epita.fr>
17551
17552 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
17553 member.
17554
05846dae
AD
175552002-10-14 Akim Demaille <akim@epita.fr>
17556
17557 * src/tables.c (table_ninf_remap): base -> tab.
17558 Reported by Matt Rosing.
17559
1318e37d
PE
175602002-10-14 Paul Eggert <eggert@twinsun.com>
17561
447fbb17
PE
17562 * tests/action.at, tests/calc.at, tests/conflicts.at,
17563 tests/cxx-type.at, tests/headers.at, tests/input.at,
17564 tests/regression.at, tests/synclines.at, tests/torture.at:
17565 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
17566 so that the tests still work even if POSIXLY_CORRECT is set.
17567 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 17568
1318e37d
PE
17569 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
17570 for portability to K&R hosts. Fix typo: signed char is guaranteed
17571 only to 127, not to 128.
17572 * data/glr.c (yysigned_char): New type.
17573 * data/yacc.c (yysigned_char): Likewise.
17574 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
17575
cc0f0794
PE
175762002-10-13 Paul Eggert <eggert@twinsun.com>
17577
5038f418
PE
17578 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
17579 true due to limited range of data type" warning from GCC.
17580
cc0f0794
PE
17581 * data/c.m4 (b4_token_defines): Protect against double-inclusion
17582 by wrapping enum yytokentype's definition inside #ifndef
17583 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
17584
6fed0802
AD
175852002-10-13 Akim Demaille <akim@epita.fr>
17586
17587 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
17588 Un yy- yyrhs to avoid the name clash with the global YYRHS.
17589
32f0598d
AD
175902002-10-13 Akim Demaille <akim@epita.fr>
17591
17592 * Makefile.maint: Update from Autoconf 2.54.
17593 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
17594
7ea9a33f
AD
175952002-10-13 Akim Demaille <akim@epita.fr>
17596
17597 * src/print.c (print_state): Separate the list of solved conflicts
17598 from the other items.
17599 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
17600
ea99527d
AD
176012002-10-13 Akim Demaille <akim@epita.fr>
17602
17603 Let nondeterministic skeletons be usable with deterministic
17604 tables.
17605
17606 With the patch, GAWK compiled by GCC without -O2 passes its test
17607 suite using a GLR parser driven by LALR tables. It fails with -O2
17608 because `struct stat' gives two different answers on my machine:
17609 88 (definition of an auto var) and later 96 (memset on this var).
17610 Hence the stack is badly corrumpted. The headers inclusion is to
17611 blame: if I move the awk.h inclusion before GLR's system header
17612 inclusion, the two struct stat have the same size.
17613
17614 * src/tables.c (pack_table): Always create conflict_table.
17615 (token_actions): Always create conflict_list.
17616 * data/glr.c (YYFLAG): Remove, unused.
17617
f377f69f
AD
176182002-10-13 Akim Demaille <akim@epita.fr>
17619
17620 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
17621 (O0FLAGS): New.
17622 (VALGRIND, GXX): New.
17623 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
17624 * tests/bison.in: Run $PREBISON a pre-command.
17625 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
17626 (maintainer-check-g++): New.
17627 * Makefile.am (maintainer-check): New.
17628
2a1fe6ed
AD
176292002-10-13 Akim Demaille <akim@epita.fr>
17630
17631 * data/glr.c: Formatting changes.
17632 Tweak some trace messages to match yacc.c's.
17633
f50adbbd
AD
176342002-10-13 Akim Demaille <akim@epita.fr>
17635
17636 GLR parsers sometimes raise parse errors instead of performing the
17637 default reduction.
17638 Reported by Charles-Henry de Boysson.
17639
17640 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 17641 check the length of the traces when %glr.
f50adbbd
AD
17642 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
17643 GLR's traces.
17644 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
17645 Test GLR parsers.
17646 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
17647 (yyltype): Remove the yy prefix from the member names.
17648 (yytable): Complete its comment.
17649 (yygetLRActions): Map error action number from YYTABLE from
17650 YYTABLE_NINF to 0.
17651 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
17652 (which was a bug: it should have been YYTABEL_NINF, and yet it was
17653 not satisfying as we could compare an YYACTION computed from
17654 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
17655 only value for error actions.
17656 (yyreportParseError): In verbose parse error messages, don't issue
17657 `error' in the list of expected tokens.
17658 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
17659 next action to perform to match glr.c's decoding.
17660 (yytable): Complete its comment.
17661
bcbad5b9
PE
176622002-10-13 Paul Eggert <eggert@twinsun.com>
17663
17664 Fix problem reported by Henrik Grubbstroem in
161a71f3 17665 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
17666 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
17667 because the Bison parser reads the second action before reducing
17668 the first one.
17669 * src/scan-gram.l (rule_length): New static var.
17670 Use it to keep track of the rule length in the scanner, since
17671 we can't expect the parser to be in lock-step sync with the scanner.
17672 (handle_action_dollar, handle_action_at): Use this var.
17673 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 17674
14904b89
PE
176752002-10-12 Paul Eggert <eggert@twinsun.com>
17676
1fe611e5
PE
17677 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
17678 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
17679 Include <sys/time.h> when checking for clock_t and struct tms.
17680 Use same include order as source.
17681 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 17682 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 17683
1fe611e5
PE
17684 * lib/timevar.c: Update copyright date and clarify comments.
17685 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 17686
1fe611e5
PE
17687 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
17688 GCC version as of today, then merge Bison's changes.
17689 Change "GCC" to "Bison" in copyright notice. timevar.def's
17690 author is Akim, so change that too.
17691
98194095
PE
17692 * src/reader.c (grammar_current_rule_check):
17693 Don't worry about the default action if $$ is untyped.
17694 Prevents bogus warnings reported by Jim Gifford in
161a71f3 17695 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 17696
14904b89
PE
17697 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
17698 * data/glr.c, data/lalr1.cc, data/yacc.c:
17699 Output token definitions before the first part of user declarations.
17700 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 17701 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 17702
ff6dca18
PE
177032002-10-11 Paul Eggert <eggert@twinsun.com>
17704
17705 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
17706 (yyparse): here. This undoes some of the 2002-07-25 change.
17707 Compatibility problem reported by Ralf S. Engelschall with
17708 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
17709
eb714592
AD
177102002-10-11 Akim Demaille <akim@epita.fr>
17711
17712 * tests/regression.at Characters Escapes): New.
17713 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
17714 characters.
17715 Reported by Jan Nieuwenhuizen.
17716
b7195100
AD
177172002-10-11 Akim Demaille <akim@epita.fr>
17718
17719 * po/id.po: New.
17720
f28a0f2d
PE
177212002-10-10 Paul Eggert <eggert@twinsun.com>
17722
17723 Portability fixes for bitsets; this also avoids several GCC
17724 warnings.
17725
17726 * lib/abitset.c: Include <stddef.h>, for offsetof.
17727 * lib/lbitset.c: Likewise.
17728
17729 * lib/abitset.c (abitset_bytes): Return a size that is aligned
17730 properly for vectors of objects. Do not assume that adding a
17731 header size to a multiple of a word size yields a value that is
17732 properly aligned for the whole union.
17733 * lib/bitsetv.c (bitsetv_alloc): Likewise.
17734
17735 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
17736 unique names for structures.
17737 * lib/ebitset.c (ebitset_bytes): Likewise.
17738 * lib/lbitset.c (lbitset_bytes): Likewise.
17739
17740 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
17741 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
17742 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
17743 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
17744 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
17745 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
17746 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
17747 to improve the type-checking that GCC can do.
17748 * lib/bitset.c (bitset_op4_cmp): Likewise.
17749 * lib/bitset_stats.c (bitset_stats_count,
17750 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
17751 bitset_stats_copy, bitset_stats_disjoint_p,
17752 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
17753 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
17754 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
17755 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
17756 bitset_stats_and_or_cmp, bitset_stats_andn_or,
17757 bitset_stats_andn_or_cmp, bitset_stats_or_and,
17758 bitset_stats_or_and_cmp): Likewise.
17759 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
17760 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
17761 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
17762 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
17763
17764 * lib/abitset.h: Include bitset.h, not bbitset.h.
17765 * lib/ebitset.h: Likewise.
17766 * lib/lbitset.h: Likewise.
17767
17768 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
17769 All instances of parameters of type enum bitset_opts are now of
17770 type enum_bitset_opts, to conform to the C Standard, and similarly
17771 for enum_bitset_type.
17772 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
17773 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
17774
17775 Do not use "struct bitset_struct" to mean different things in
17776 different modules. Not only is this confusing, it violates
17777 the C Standard, which requires that structure types in different
17778 modules must be compatible if one is to be passed to the other.
17779 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
17780 All instances of "struct bitset_struct *" replaced with "bitset".
17781 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
17782 (union bitset_union, struct abitset_struct, struct ebitset_struct,
17783 struct lbitset_struct, struct bitset_stats_struct): New types.
17784 All uses of struct bitset_struct changed to union bitset_union,
17785 etc.
ba0fe3c7 17786 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
17787 struct bitset_struct): Remove.
17788 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
17789 struct bitset_struct): Remove.
17790 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
17791 bitset_struct): Remove.
17792 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
17793 Likewise.
17794
17795 Do not call a function of type T using a call that assumes the
17796 function is of a different type U. Standard C requires that a
17797 function must be called with a type that is compatible with its
17798 definition.
17799 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
17800 New decls.
17801 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
17802 New functions.
17803 * lib/ebitset.c (PFV): Remove.
17804 * lib/lbitset.c (PFV): Likewise.
17805 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
17806 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
17807 decls.
17808 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
17809 (ebitset_vtable): Use them.
17810 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
17811 lbitset_xor): New functions.
17812 (lbitset_vtable): Use them.
17813
17814 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
17815 Declare.
17816
17817 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
17818 GCC warning.
17819 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
17820 Use offsetof, for simplicity.
17821
6fbe4984
PE
178222002-10-06 Paul Eggert <eggert@twinsun.com>
17823
17824 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
17825 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 17826 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
17827 which was inadvertently undone by the 2002-09-30 patch.
17828 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
17829 the same width as int.
17830
420f93c8
PE
178312002-10-04 Paul Eggert <eggert@twinsun.com>
17832
17833 Version 1.50.
17834
17835 * configure.ac (AC_INIT), NEWS: Increment version number.
17836
17837 * doc/bison.texinfo: Minor spelling, grammar, and white space
17838 fixes.
17839 (Symbols): Mention that any negative value returned from yylex
17840 signifies end-of-input. Warn about negative chars. Mention
17841 the portable Standard C character set.
17842
17843 The GNU coding standard says CFLAGS and YFLAGS are reserved
17844 for the installer to set.
17845 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
17846 * src/Makefile.am (AM_CFLAGS): Likewise.
17847 (AM_YFLAGS): Renamed from YFLAGS.
17848
17849 Fix some MAX and MIN problems.
17850 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
17851 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
17852 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
17853 * src/reader.c (reader): Use it.
17854
17855 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
17856 POSIX 1003.1-2001 has removed fgrep.
17857
178582002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
17859
17860 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
17861 interpreted as signed.
17862 * lib/ebitset.c (ebitset_list): Fix bug.
17863
ff68026d
PE
178642002-10-01 Paul Eggert <eggert@twinsun.com>
17865
17866 More fixes for 64-bit hosts and large bitsets.
17867
17868 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
17869 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
17870 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
17871 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
17872 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
17873 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
17874 bitset_count_): Likewise.
17875 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
17876 bitset_first, bitset_last): Likewise.
17877 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
17878 bitset_stats_list_reverse, bitset_stats_size,
17879 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
17880 Likewise.
17881 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
17882 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
17883 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
17884 bitsetv_reflexive_transitive_closure): Likewise.
17885 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
17886 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
17887 Likewise.
17888 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
17889 Likewise.
420f93c8 17890
ff68026d
PE
17891 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
17892 Use size_t, not unsigned int, to count bytes.
17893 * lib/abitset.h (abitset_bytes): Likewise.
17894 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
17895 Likewise.
17896 * lib/bitset.h (bitset_bytes): Likewise.
17897 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
17898 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
17899 * lib/bitsetv.c (bitsetv_alloc): Likewise.
17900 * lib/ebitset.c (ebitset_bytes): Likewise.
17901 * lib/ebitset.h (ebitset_bytes): Likewise.
17902 * lib/lbitset.c (lbitset_bytes): Likewise.
17903 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 17904
ff68026d
PE
17905 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
17906 abitset_subset_p, abitset_disjoint_p, abitset_and,
17907 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
17908 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
17909 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
17910 abitset_or_and, abitset_or_and_cmp):
17911 Use bitset_windex instead of unsigned int.
17912 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
17913 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
17914 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
17915 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
17916 Likewise.
17917 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 17918
ff68026d
PE
17919 * lib/bitset.c (bitset_print):
17920 Use proper printf formats for widths of integer types.
17921 * lib/bitset_stats.c (bitset_percent_histogram_print,
17922 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
17923 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
17924 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
17925 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 17926
ff68026d
PE
17927 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
17928 BITSET_SIZE_MAX): New macros.
17929 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
17930 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
17931 to BITSET_WINDEX_MAX.
17932
17933 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
17934 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
17935 since we now return the bitset_bindex type (not int).
17936
17937 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
17938 when computing sizes.
17939 * lib/ebitset.c (ebitset_elts_grow): Likewise.
17940
17941 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
17942 and avoid cast to unsigned.
17943
6aa452a6
AD
179442002-09-30 Akim Demaille <akim@epita.fr>
17945
17946 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
17947 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
17948 Updates from Michael Hayes.
17949
927f7817
AD
179502002-09-30 Art Haas <ahaas@neosoft.com>
17951
17952 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
17953 invocations.
17954 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
17955 defined.
17956
9738f41e
AD
179572002-09-27 Akim Demaille <akim@epita.fr>
17958
17959 Version 1.49c.
17960
a5c75d7f
AD
179612002-09-27 Akim Demaille <akim@epita.fr>
17962
17963 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
17964 (Because of AC_LIBSOURCE).
17965
8280e179
AD
179662002-09-27 Akim Demaille <akim@epita.fr>
17967
17968 Playing with Autoscan.
17969
17970 * configure.ac: Remove the old LIBOBJ tweaks.
17971 (AC_REPLACE_FUNCS): Add strrchr and strtol.
17972 * lib/strrchr.c: New.
17973 * lib/strtol.c: New, from the Coreutils 4.5.1.
17974
ae64af35
AD
179752002-09-27 Akim Demaille <akim@epita.fr>
17976
17977 Playing with Autoscan.
17978
17979 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
17980 * lib/Makefile.am (libbison_a_SOURCES): No longer include
17981 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
17982 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
17983 Coreutils 4.5.1.
17984
d1a1114f
AD
179852002-09-24 Akim Demaille <akim@epita.fr>
17986
17987 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
17988 (Frequently Asked Questions, Parser Stack Overflow): New.
17989
b906441c
AD
179902002-09-13 Akim Demaille <akim@epita.fr>
17991
17992 Playing with autoscan.
17993
17994 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
17995 * src/files.c (skeleton_find): Remove, unused.
17996 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
17997 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
17998
bd701811
AD
179992002-09-13 Akim Demaille <akim@epita.fr>
18000
18001 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
18002 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
18003
e0a13e7b
AD
180042002-09-13 Akim Demaille <akim@epita.fr>
18005
18006 * configure.ac: Require 2.54.
18007 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
18008 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
18009 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
18010 Remove, provided by Autoconf macros.
18011
c97011bf
AD
180122002-09-12 Akim Demaille <akim@epita.fr>
18013
18014 * m4/prereq.m4: Update, from Coreutils 4.5.1.
18015
d862b1be
AD
180162002-09-12 Akim Demaille <akim@epita.fr>
18017
18018 * m4/prereq.m4: Update, from Fileutils 4.1.5.
18019 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
18020 Reported by Martin Mokrejs.
18021
3d38c03a
AD
180222002-09-10 Akim Demaille <akim@epita.fr>
18023
18024 * src/parse-gram.y: Associate a human readable string to each
18025 token type.
18026 * tests/regression.at (Invalid inputs): Adjust.
18027
b6347355
AD
180282002-09-10 Gary V. Vaughan <gary@gnu.org>
18029
18030 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
18031 with an Autoconf-2.5x style configure.ac.
18032
09ba4ab2
PE
180332002-09-06 Paul Eggert <eggert@twinsun.com>
18034
18035 * doc/bison.texinfo (Conditions): Make explicit that the GPL
18036 exception applies only to yacc.c. This is a modification of a
18037 patch originally suggested by Akim Demaille.
18038
21846f69
AD
180392002-09-06 Akim Demaille <akim@epita.fr>
18040
09ba4ab2
PE
18041 * data/c.m4 (b4_copyright): Move the GPL exception comment from
18042 here to...
18043 * data/yacc.c: here.
18044
21846f69
AD
18045 * data/lalr1.cc (struct yyltype): Don't define it, since we use
18046 LocationType.
18047 (b4_ltype): Default to yy::Location from location.hh.
18048
c0ad8bf3
AD
180492002-09-04 Jim Meyering <jim@meyering.net>
18050
18051 * data/yacc.c: Guard the declaration of yytoknum also with
18052 `#ifdef YYPRINT', so it is declared only when used.
18053
3a93251e
AD
180542002-09-04 Akim Demaille <akim@epita.fr>
18055
18056 * configure.in: Rename as...
18057 * configure.ac: this.
18058 Bump to 1.49c.
18059
427c0dda
AD
180602002-09-04 Akim Demaille <akim@epita.fr>
18061
18062 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
18063 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
18064 translate maintainer only messages.
18065
6a254321
PE
180662002-08-12 Paul Eggert <eggert@twinsun.com>
18067
645e30d1
PE
18068 Version 1.49b.
18069
6a254321
PE
18070 * Makefile.am (SUBDIRS): Remove intl.
18071 (DISTCLEANFILES): Remove.
18072 * NEWS: Mention that GNU M4 is now required. Clarify what is
18073 meant by "larger grammars". Mention the pt_BR translation.
18074 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
18075 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
18076 Bump version from 0.11.2 to 0.11.5.
18077 (BISON_PREREQ_STAGE): Remove.
18078 (AM_GNU_GETTEXT): Use external gettext.
18079 (AC_OUTPUT): Remove intl/Makefile.
18080
18081 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
18082
18083 * data/glr.c: Include string.h, for strlen.
18084 (yyreportParseError): Use size_t for yysize.
18085 (yy_yypstack): No longer nested inside yypstates, as nested
18086 functions are not portable. Do not assume size_t is the
18087 same width as int.
18088 (yypstates): Do not assume that ptrdiff_t is the same width
18089 as int, and similarly for yyposn and YYINDEX.
18090
18091 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
18092
18093 * lib/Makefile.am (INCLUDES): Do not include from the intl
18094 directory, which has been removed.
18095 * src/Makefile.am (INCLUDES): Likewise.
18096
18097 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
18098 (bitsets_sources, additional_bitsets_sources, timevars_sources):
18099 New vars.
18100
18101 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
18102 * tests/Makefile.am (EXTRA_DIST): Likewise.
18103
18104 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
18105 Do not assume that bitset_windex is the same width as unsigned.
18106
18107 * lib/abitset.c (abitset_unused_clear): Do not assume that
18108 bitset_word is the same width as int.
18109 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
18110 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
18111 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
18112 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
18113 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
18114
18115 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
18116 portability to one's complement hosts!).
18117 * lib/ebitset.c (ebitset_op1): Likewise.
18118 * lib/lbitset.c (lbitset_op1): Likewise.
18119
18120 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
18121 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
18122 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
18123 Sync with fileutils.
18124 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
18125 lib/gettext.h: Sync with diffutils.
18126
18127 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
18128 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
18129
18130 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
18131 PROTOTYPES to check for prototypes, and "defined __STDC__" to
18132 check for void *.
18133
18134 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
18135 size_t; the old version tried to do this but casted improperly.
18136 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
18137 (bitset_test): Now returns int, not unsigned long.
18138
18139 * lib/bitset_stats.c: Include "gettext.h".
18140 (_): New macro.
18141 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
18142 name locals "index", as it generates unnecessary warnings on some
18143 hosts that have an "index" function.
18144
18145 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
18146 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
18147 they need translation.
18148 * src/LR0.c (state_list_append, new_itemsets, get_state,
18149 append_states, generate_states): Likewise.
18150 * src/assoc.c (assoc_to_string): Likewise.
18151 * src/closure.c (print_closure, set_firsts, closure): Likewise.
18152 * src/gram.c (grammar_dump): Likewise.
18153 * src/injections.c (injections_compute): Likewise.
18154 * src/lalr.c (lookaheads_print): Likewise.
18155 * src/relation.c (relation_transpose): Likewise.
18156 * src/scan-gram.l: Likewise.
18157 * src/tables.c (table_grow, pack_vector): Likewise.
18158
18159 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
18160 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
18161 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
18162 * m4/mbstate_t.m4: Sync with fileutils.
18163 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
18164
18165 * po/LINGUAS: Add pt_BR.
18166 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
18167 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
18168 lib/timevar.c.
18169 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
18170 manual recommends.
18171 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
18172
18173 * src/complain.c (strerror_r): Remove decl; not needed.
18174 (strerror): Use same pattern as ../lib/error.c.
18175
18176 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
18177
18178 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
18179
18180 * src/main.c (main): Cast result of bindtextdomain and textdomain
18181 to void, to avoid a GCC warning when --disable-nls is in effect.
18182
18183 * src/scan-gram.l: Use strings rather than escapes when possible,
18184 to minimize the number of warnings from xgettext.
18185 (handle_action_dollar, handle_action_at): Don't use isdigit,
18186 as it mishandles negative chars and it may not work as expected
18187 outside the C locale.
18188
18189 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
18190 this is a GCC extension and is not portable to other compilers.
18191
18192 * src/system.h (alloca): Use same pattern as ../lib/error.c.
18193 Do not include <ctype.h>; no longer needed.
18194 Do not include <malloc.h>; no longer needed (and generates
18195 warnings on OpenBSD 3.0).
18196
18197 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
18198 it's not portable.
18199
18200 * tests/regression.at: Do not use 'cc -c input.c -o input';
18201 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
18202
18203 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
18204 exit status as failure, not just exit status 1. Sun C exits
18205 with status 2 sometimes.
18206
18207 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
18208 Use it for the two large tests.
18209
c8f002c7
AD
182102002-08-02 Akim Demaille <akim@epita.fr>
18211
18212 * src/conflicts.c (conflicts_output): Don't output rules never
18213 reduced here, since anyway that computation doesn't work.
18214 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
18215 (rule_useless_p, rule_never_reduced_p): New.
18216 (grammar_rules_partial_print): Use a filter instead of a range.
18217 Display the title only if needed.
18218 (grammar_rules_print): Adjust.
18219 (grammar_rules_never_reduced_report): New.
18220 * src/tables.c (action_row): Move the computation of rules never
18221 reduced to...
18222 (token_actions): here.
18223 * src/main.c (main): Make the parser before making the report, so
18224 that rules never reduced are computed.
18225 Call grammar_rules_never_reduced_report.
18226 * src/print.c (print_results): Report rules never reduced.
18227 * tests/conflicts.at, tests/reduce.at: Adjust.
18228
cd08e51e
AD
182292002-08-01 Akim Demaille <akim@epita.fr>
18230
18231 Instead of attaching lookaheads and duplicating the rules being
18232 reduced by a state, attach the lookaheads to the reductions.
18233
18234 * src/state.h (state_t): Remove the `lookaheads',
18235 `lookaheads_rule' member.
18236 (reductions_t): Add a `lookaheads' member.
18237 Use a regular array for the `rules'.
18238 * src/state.c (reductions_new): Initialize the lookaheads member
18239 to 0.
18240 (state_rule_lookaheads_print): Adjust.
18241 * src/state.h, src/state.c (state_reductions_find): New.
18242 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
18243 (count_rr_conflicts): Adjust.
18244 * src/lalr.c (LArule): Remove.
18245 (add_lookback_edge): Adjust.
18246 (state_lookaheads_count): New.
18247 (states_lookaheads_initialize): Merge into...
18248 (initialize_LA): this.
18249 (lalr_free): Adjust.
18250 * src/main.c (main): Don't free nullable and derives too early: it
18251 is used by --verbose.
18252 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
18253
bb0027a9
AD
182542002-08-01 Akim Demaille <akim@epita.fr>
18255
18256 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
18257 `rule_number_t**'.
18258 (set_derives, free_derives): Rename as...
18259 (derives_compute, derives_free): this.
18260 Adjust all dependencies.
18261 * src/nullable.c (set_nullable, free_nullable): Rename as...
18262 (nullable_compute, nullable_free): these.
18263 (rule_list_t): Store rule_t *, not rule_number_t.
18264 * src/state.c (state_rule_lookaheads_print): Directly compare rule
18265 pointers, instead of their numbers.
18266 * src/main.c (main): Call nullable_free, and derives_free earlier,
18267 as they were lo longer used.
18268
3325ddc4
AD
182692002-08-01 Akim Demaille <akim@epita.fr>
18270
18271 * lib/timevar.c (get_time): Include children time.
18272 * src/lalr.h (LA, LArule): Don't export them: used with the
18273 state_t.
18274 * src/lalr.c (LA, LArule): Static.
18275 * src/lalr.h, src/lalr.c (lalr_free): New.
18276 * src/main.c (main): Call it.
18277 * src/tables.c (pack_vector): Check whether loc is >= to the
18278 table_size, not >.
18279 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
18280 (tables_generate): do it, since that's also it which allocates
18281 them.
18282 Don't free LA and LArule, main does.
18283
c6f1a33c
AD
182842002-07-31 Akim Demaille <akim@epita.fr>
18285
18286 Separate parser tables computation and output.
18287
18288 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
18289 (conflict_list, conflict_list_cnt, table, check, table_ninf)
18290 (yydefgoto, yydefact, high): Move to...
18291 * src/tables.h, src/tables.c: here.
18292 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
18293 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
18294 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
18295 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
18296 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
18297 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
18298 (action_row, save_row, token_actions, save_column, default_goto)
18299 (goto_actions, sort_actions, matching_state, pack_vector)
18300 (table_ninf_remap, pack_table, prepare_actions): Move to...
18301 * src/tables.c: here.
18302 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
18303 * src/output.c (token_actions, output_base, output_conflicts)
18304 (output_check): Merge into...
18305 (prepare_actions): this.
18306 (actions_output): Rename as...
18307 (user_actions_output): this.
18308 * src/main.c (main): Call tables_generate and tables_free.
18309
1509d42f
AD
183102002-07-31 Akim Demaille <akim@epita.fr>
18311
18312 Steal GCC's --time-report support.
18313
18314 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
18315 stolen/adjusted from GCC.
18316 * m4/stage.m4: Remove time related checks.
18317 * m4/timevar.m4: New.
18318 * configure.in: Adjust.
18319 * src/system.h: Adjust to using timevar.h.
18320 * src/getargs.h, src/getargs.c: Support trace_time for
18321 --trace=time.
18322 * src/main.c (stage): Remove.
18323 (main): Replace `stage' invocations with timevar calls.
18324 * src/output.c: Insert pertinent timevar calls.
18325
273a74fa
AD
183262002-07-31 Akim Demaille <akim@epita.fr>
18327
18328 Let --trace have arguments.
18329
18330 * src/getargs.h (enum trace_e): New.
18331 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
18332 (long_options, short_options): --trace/-T takes an optional
18333 argument.
18334 Change all the uses of trace_flag to reflect the new flags.
18335 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
18336
18337 Strengthen `stage' portability.
18338
18339 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
18340 * configure.in: Use it.
18341 Don't check for malloc.h and sys/times.h.
18342 * src/system.h: Include them when appropriate.
18343 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
18344 times and struct tms are available.
18345
217598da
AD
183462002-07-30 Akim Demaille <akim@epita.fr>
18347
18348 In verbose parse error message, don't report `error' as an
18349 expected token.
18350 * tests/actions.at (Printers and Destructors): Adjust.
18351 * tests/calc.at (Calculator $1): Adjust.
18352 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
18353 error message, do not report the parser accepts the error token in
18354 that state.
18355
52489d44
AD
183562002-07-30 Akim Demaille <akim@epita.fr>
18357
18358 Normalize conflict related messages.
18359
18360 * src/complain.h, src/complain.c (warn, complain): New.
18361 * src/conflicts.c (conflicts_print): Use them.
18362 (conflict_report_yacc): New, extracted from...
18363 (conflicts_print): here.
18364 * tests/conflicts.at, tests/existing.at: Adjust.
18365
e8832397
AD
183662002-07-30 Akim Demaille <akim@epita.fr>
18367
18368 Report rules which are never reduced by the parser: those hidden
18369 by conflicts.
18370
18371 * src/LR0.c (save_reductions): Don't make the final state too
18372 different: save its reduction (accept) instead of having a state
18373 without any action (no shift or goto, no reduce).
18374 Note: the final state is now a ``regular'' state, i.e., the
18375 parsers now contain `reduce 0' as default reduction.
18376 Nevertheless, since they decide to `accept' when yystate =
18377 final_state, they still will not reduce rule 0.
18378 * src/print.c (print_actions, print_reduction): Adjust.
18379 * src/output.c (action_row): Track reduced rules.
18380 (token_actions): Report rules never reduced.
18381 * tests/conflicts.at, tests/regression.at: Adjust.
18382
caf23d24
AD
183832002-07-30 Akim Demaille <akim@epita.fr>
18384
18385 `stage' was accidently included in a previous patch.
18386 Initiate its autoconfiscation.
18387
18388 * configure.in: Look for malloc.h and sys/times.h.
18389 * src/main.c (stage): Adjust.
18390 Report only when trace_flag.
18391
640748ee
AD
183922002-07-29 Akim Demaille <akim@epita.fr>
18393
18394 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
18395 state_number_t.
18396 (errs_t): symbol_t*, not symbol_number_t.
18397 (reductions_t): rule_t*, not rule_number_t.
18398 (FOR_EACH_SHIFT): New.
18399 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
18400 * src/print.c, src/print_graph.c: Adjust.
18401
88bce5a2
AD
184022002-07-29 Akim Demaille <akim@epita.fr>
18403
18404 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
18405
18406 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
18407 (endtoken, accept): these.
18408 * src/reader.c (reader): Set endtoken's default tag to "$end".
18409 Set undeftoken's tag to "$undefined" instead of "$undefined.".
18410 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
18411 Adjust.
18412
1bfb97db
AD
184132002-07-29 Akim Demaille <akim@epita.fr>
18414
18415 * src/reduce.c (reduce_grammar): When the language is empty,
18416 complain about the start symbol, not the axiom.
18417 Use its location.
18418 * tests/reduce.at (Empty Language): New.
18419
fc5734fe
AD
184202002-07-26 Akim Demaille <akim@epita.fr>
18421
18422 * src/reader.h, src/reader.c (gram_error): ... can't get
18423 yycontrol without making too strong assumptions on the parser
18424 itself.
18425 * src/output.c (prepare_tokens): Use the real 0th value of
18426 token_translations instead of `0'.
18427 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
18428 visible here.
18429 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
18430 for the time being: %locations ought to provide it to yyerror.
18431
3650b4b8
AD
184322002-07-25 Akim Demaille <akim@epita.fr>
18433
18434 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
18435 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
18436 * tests/regression.at (Web2c Actions): Adjust.
18437
4b3d3a8e
AD
184382002-07-25 Akim Demaille <akim@epita.fr>
18439
18440 Stop storing rules from 1 to nrules + 1.
18441
18442 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
18443 * src/nullable.c, src/output.c, src/print.c, src/reader.c
18444 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
18445 Iterate from 0 to nrules.
18446 Use rule_number_as_item_number and item_number_as_rule_number.
18447 Adjust to `derive' now containing possibly 0.
18448 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
18449 Handle the `- 1' part in rule numbers from/to item numbers.
18450 * src/conflicts.c (log_resolution): Fix the message which reversed
18451 shift and reduce.
18452 * src/output.c (action_row): Initialize default_rule to -1.
18453 (token_actions): Adjust.
18454 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
18455 expected output.
18456 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
18457
4a2a22f4
AD
184582002-07-25 Akim Demaille <akim@epita.fr>
18459
18460 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
18461 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
18462 (b4_c_knr_arg_decl): New.
18463 * data/yacc.c: Use it to define yysymprint, yydestruct, and
18464 yyreport_parse_error.
18465
b8df3223
AD
184662002-07-25 Akim Demaille <akim@epita.fr>
18467
18468 * data/yacc.c (yyreport_parse_error): New, extracted from...
18469 (yyparse): here.
18470 (yydestruct, yysymprint): Move above yyparse.
18471 Be K&R compliant.
18472
a762e609
AD
184732002-07-25 Akim Demaille <akim@epita.fr>
18474
18475 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
18476 replace...
18477 (b4_sint_type, b4_uint_type): these.
18478 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
18479 * tests/regression.at (Web2c Actions): Adjust.
18480
12b0043a
AD
184812002-07-25 Akim Demaille <akim@epita.fr>
18482
18483 * src/gram.h (TIEM_NUMBER_MAX): New.
18484 (item_number_of_rule_number, rule_number_of_item_number): Rename
18485 as...
18486 (rule_number_as_item_number, item_number_as_rule_number): these.
18487 Adjust dependencies.
18488 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
18489 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
18490 (symbol_number_to_vector_number): New.
18491 (order): Of vector_number_t* type.
18492 (base_t, BASE_MAX, BASE_MIN): New.
18493 (froms, tos, width, pos, check): Of base_t type.
18494 (action_number_t, ACTION_MIN, ACTION_MAX): New.
18495 (actrow): Of action_number_t type.
18496 (conflrow): Of unsigned int type.
18497 (table_ninf, base_ninf): New.
18498 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
18499 (muscle_insert_int_table, muscle_insert_base_table)
18500 (muscle_insert_rule_number_table): New.
18501 (prepare_tokens): Output `toknum' as int_table.
18502 (action_row): Returns a rule_number_t.
18503 Use ACTION_MIN, not SHRT_MIN.
18504 (token_actions): yydefact is rule_number_t*.
18505 (table_ninf_remap): New.
18506 (pack_table): Use it for `base' and `table'.
18507 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
18508 replaced with...
18509 (YYPACT_NINF, YYTABLE_NINF): these.
18510 (yypact, yytable): Compute their types instead of hard-coded
18511 `short'.
18512 * tests/regression.at (Web2c Actions): Adjust.
18513
5dde258a
AD
185142002-07-19 Akim Demaille <akim@epita.fr>
18515
18516 * src/scan-gram.l (id): Can start with an underscore.
18517
a945ec39
AD
185182002-07-16 Akim Demaille <akim@epita.fr>
18519
18520 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
18521 Adjust all former `associativity' dependencies.
18522 * src/symtab.c (symbol_new): Default associativity is `undef', not
18523 `right'.
18524 (symbol_check_alias_consistence): Adjust.
18525
fae437e8
AD
185262002-07-09 Akim Demaille <akim@epita.fr>
18527
18528 * doc/bison.texinfo: Properly set the ``header'' part.
18529 Use @dircategory ``GNU programming tools'' as per Texinfo's
18530 documentation.
18531 Use @copying.
18532
1a715ef2
AD
185332002-07-09 Akim Demaille <akim@epita.fr>
18534
18535 * lib/quotearg.h: Protect against multiple inclusions.
18536 * src/location.h (location_t): Add a `file' member.
18537 (LOCATION_RESET, LOCATION_PRINT): Adjust.
18538 * src/complain.c (warn_at, complain_at, fatal_at): Drop
18539 `error_one_per_line' support.
18540
a5d50994
AD
185412002-07-09 Akim Demaille <akim@epita.fr>
18542
18543 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
18544 * src/reader.c (lineno): Remove.
18545 Adjust all dependencies.
18546 (get_merge_function): Take a location and use complain_at.
18547 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
18548 * tests/regression.at (Invalid inputs, Mixing %token styles):
18549 Adjust.
18550
b275314e
AD
185512002-07-09 Akim Demaille <akim@epita.fr>
18552
18553 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
18554 recovery rule, and forbid extensions when --yacc.
18555 (gram_error): Use complain_at.
18556 * src/reader.c (reader): Exit if there were parse errors.
18557
865b9df1
AD
185582002-07-09 Akim Demaille <akim@epita.fr>
18559
18560 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
18561 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
18562 Reported by R Blake <blakers@mac.com>.
18563
c76e14da
AD
185642002-07-09 Akim Demaille <akim@epita.fr>
18565
18566 * data/yacc.c: Output the copyright notive in the header.
18567
7db2ed2d
AD
185682002-07-03 Akim Demaille <akim@epita.fr>
18569
18570 * src/output.c (froms, tos): Are state_number_t.
18571 (save_column): sp, sp1, and sp2 are state_number_t.
18572 (prepare): Rename `final' as `final_state_number', `nnts' as
18573 `nterms_number', `nrules' as `rules_number', `nstates' as
18574 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
18575 unused.
18576 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
18577 * data/lalr1.cc (nsym_): Remove, unused.
18578
e68e0410
AD
185792002-07-03 Akim Demaille <akim@epita.fr>
18580
18581 * src/lalr.h, src/lalr.c (goto_number_t): New.
18582 * src/lalr.c (goto_list_t): New.
18583 Propagate them.
18584 * src/nullable.c (rule_list_t): New.
18585 Propagate.
18586 * src/types.h: Remove.
18587
e1a4f3a4
AD
185882002-07-03 Akim Demaille <akim@epita.fr>
18589
18590 * src/closure.c (print_fderives): Use rule_rhs_print.
18591 * src/derives.c (print_derives): Use rule_rhs_print.
18592 (rule_list_t): New, replaces `shorts'.
18593 (set_derives): Add comments.
18594 * tests/sets.at (Nullable, Firsts): Adjust.
18595
536545f3
AD
185962002-07-03 Akim Demaille <akim@epita.fr>
18597
18598 * src/output.c (prepare_actions): Free `tally' and `width'.
18599 (prepare_actions): Allocate and free `order'.
18600 * src/symtab.c (symbols_free): Free `symbols'.
18601 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
18602 * src/output.c (m4_invoke): Move to...
18603 * src/scan-skel.l: here.
18604 (<<EOF>>): Close yyout, and free its name.
18605
8b752b00
AD
186062002-07-03 Akim Demaille <akim@epita.fr>
18607
18608 Fix some memory leaks, and fix a bug: state 0 was examined twice.
18609
18610 * src/LR0.c (new_state): Merge into...
18611 (state_list_append): this.
18612 (new_states): Merge into...
18613 (generate_states): here.
18614 (set_states): Don't ensure a proper `errs' state member here, do it...
18615 * src/conflicts.c (conflicts_solve): here.
18616 * src/state.h, src/state.c: Comment changes.
18617 (state_t): Rename member `shifts' as `transitions'.
18618 Adjust all dependencies.
18619 (errs_new): For consistency, also take the values as argument.
18620 (errs_dup): Remove.
18621 (state_errs_set): New.
18622 (state_reductions_set, state_transitions_set): Assert that no
18623 previous value was assigned.
18624 (state_free): New.
18625 (states_free): Use it.
18626 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
18627 temporary storage: use `errs' and `nerrs' as elsewhere.
18628 (set_conflicts): Allocate and free this `errs'.
18629
613f5e1a
AD
186302002-07-02 Akim Demaille <akim@epita.fr>
18631
18632 * lib/libiberty.h: New.
18633 * lib: Update the bitset implementation from upstream.
18634 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
18635 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
18636 * src/main.c: Adjust bitset stats calls.
18637
26e0cadc
PE
186382002-07-01 Paul Eggert <eggert@twinsun.com>
18639
18640 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
18641 char, so that negative chars don't collide with $.
18642
1154cced
AD
186432002-06-30 Akim Demaille <akim@epita.fr>
18644
18645 Have the GLR tests be `warning' checked, and fix the warnings.
18646
18647 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
18648 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
18649 (yyremoveDeletes): `yyi' and `yyj' are size_t.
18650 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
18651 (yyaddDeferredAction): static.
18652 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
18653 (yyreportParseError): yyprefix is const.
18654 yytokenp is used only when verbose.
18655 (yy__GNUC__): Replace with __GNUC__.
18656 (yypdumpstack): yyi is size_t.
18657 (yypreference): Un-yy local variables and arguments, to avoid
18658 clashes with `yyr1'. Anyway, we are not in the user name space.
18659 (yytname_size): be an int, as is compared with ints.
18660 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
18661 Use them.
18662 * tests/cxx-gram.at: Use quotation to protect $1.
18663 Use AT_COMPILE to enable warnings hunts.
18664 Prototype yylex and yyerror.
18665 `Use' argc.
18666 Include `string.h', not `strings.h'.
18667 Produce and prototype stmtMerge only when used.
18668 yylex takes a location.
18669
97650f4e
AD
186702002-06-30 Akim Demaille <akim@epita.fr>
18671
18672 We spend a lot of time in quotearg, in particular when --verbose.
18673
18674 * src/symtab.c (symbol_get): Store a quoted version of the key.
18675 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
18676 Adjust all callers.
18677
d2576365
AD
186782002-06-30 Akim Demaille <akim@epita.fr>
18679
18680 * src/state.h (reductions_t): Rename member `nreds' as num.
18681 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
18682 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
18683
ccaf65bc
AD
186842002-06-30 Akim Demaille <akim@epita.fr>
18685
18686 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
18687 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
18688 (shifts_to): Rename as...
18689 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
18690 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
18691 (TRANSITION_IS_DISABLED, transitions_to): these.
18692
87675353
AD
186932002-06-30 Akim Demaille <akim@epita.fr>
18694
18695 * src/print.c (print_shifts, print_gotos): Merge into...
18696 (print_transitions): this.
18697 (print_transitions, print_errs, print_reductions): Align the
18698 lookaheads columns.
18699 (print_core, print_transitions, print_errs, print_state,
18700 print_grammar): Output empty lines separator before, not after.
18701 (state_default_rule_compute): Rename as...
18702 (state_default_rule): this.
18703 * tests/conflicts.at (Defaulted Conflicted Reduction),
18704 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
18705 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
18706
ce4ccb4b
AD
187072002-06-30 Akim Demaille <akim@epita.fr>
18708
18709 Display items as we display rules.
18710
18711 * src/gram.h, src/gram.c (rule_lhs_print): New.
18712 * src/gram.c (grammar_rules_partial_print): Use it.
18713 * src/print.c (print_core): Likewise.
18714 * tests/conflicts.at (Defaulted Conflicted Reduction),
18715 (Unresolved SR Conflicts): Adjust.
18716 (Unresolved SR Conflicts): Adjust and rename as...
18717 (Resolved SR Conflicts): this, as was meant.
18718 * tests/regression.at (Web2c Report): Adjust.
18719
bc933ef1
AD
187202002-06-30 Akim Demaille <akim@epita.fr>
18721
18722 * src/print.c (state_default_rule_compute): New, extracted from...
18723 (print_reductions): here.
18724 Pessimize, but clarify the code.
18725 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
18726
53d4308d
AD
187272002-06-30 Akim Demaille <akim@epita.fr>
18728
18729 * src/output.c (action_row): Let default_rule be always a rule
18730 number.
18731
574fb2d5
AD
187322002-06-30 Akim Demaille <akim@epita.fr>
18733
18734 * src/closure.c (print_firsts, print_fderives, closure):
18735 Use BITSET_EXECUTE.
18736 * src/lalr.c (lookaheads_print): Likewise.
18737 * src/state.c (state_rule_lookaheads_print): Likewise.
18738 * src/print_graph.c (print_core): Likewise.
18739 * src/print.c (print_reductions): Likewise.
18740 * src/output.c (action_row): Likewise.
18741 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
18742
05811fd7
AD
187432002-06-30 Akim Demaille <akim@epita.fr>
18744
18745 * src/print_graph.c: Use report_flag.
18746
0e4d5753
AD
187472002-06-30 Akim Demaille <akim@epita.fr>
18748
18749 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
18750 to...
18751 * src/relation.h, src/relation.c (traverse, relation_digraph)
18752 (relation_print, relation_transpose): New.
18753
24c7d800
AD
187542002-06-30 Akim Demaille <akim@epita.fr>
18755
18756 * src/state.h, src/state.c (shifts_to): New.
18757 * src/lalr.c (build_relations): Use it.
18758
9222837b
AD
187592002-06-30 Akim Demaille <akim@epita.fr>
18760
18761 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
18762 (item_number_of_rule_number, rule_number_of_item_number): New.
18763 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
18764 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
18765 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
18766 Propagate their use.
18767 Much remains to be done, in particular wrt `shorts' from types.h.
18768
260008e5
AD
187692002-06-30 Akim Demaille <akim@epita.fr>
18770
18771 * src/symtab.c (symbol_new): Initialize the `printer' member.
18772
8a731ca8
AD
187732002-06-30 Akim Demaille <akim@epita.fr>
18774
18775 * src/LR0.c (save_reductions): Remove, replaced by...
18776 * src/state.h, src/state.c (state_reductions_set): New.
18777 (reductions, errs): Rename as...
18778 (reductions_t, errs_t): these.
18779 Adjust all dependencies.
18780
32e1e0a4
AD
187812002-06-30 Akim Demaille <akim@epita.fr>
18782
18783 * src/LR0.c (state_list_t, state_list_append): New.
18784 (first_state, last_state): Now symbol_list_t.
18785 (this_state): Remove.
18786 (new_itemsets, append_states, save_reductions): Take a state_t as
18787 argument.
18788 (set_states, generate_states): Adjust.
18789 (save_shifts): Remove, replaced by...
18790 * src/state.h, src/state.c (state_shifts_set): New.
18791 (shifts): Rename as...
18792 (shifts_t): this.
18793 Adjust all dependencies.
18794 * src/state.h (state_t): Remove the `next' member.
18795
e5fb6710
AD
187962002-06-30 Akim Demaille <akim@epita.fr>
18797
18798 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
18799 escaped in slot 0.
18800
c7ca99d4
AD
188012002-06-30 Akim Demaille <akim@epita.fr>
18802
18803 Use hash.h for the state hash table.
18804
18805 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
18806 (allocate_storage): Use state_hash_new.
18807 (free_storage): Use state_hash_free.
18808 (new_state, get_state): Adjust.
18809 * src/lalr.h, src/lalr.c (states): Move to...
18810 * src/states.h (state_t): Remove the `link' member, no longer
18811 used.
18812 * src/states.h, src/states.c: here.
18813 (state_hash_new, state_hash_free, state_hash_lookup)
18814 (state_hash_insert, states_free): New.
18815 * src/states.c (state_table, state_compare, state_hash): New.
18816 * src/output.c (output_actions): Do not free states now, since we
18817 still need to know the final_state number in `prepare', called
18818 afterwards. Do it...
18819 * src/main.c (main): here: call states_free after `output'.
18820
df0e7316
AD
188212002-06-30 Akim Demaille <akim@epita.fr>
18822
18823 * src/state.h, src/state.c (state_new): New, extracted from...
18824 * src/LR0.c (new_state): here.
18825 * src/state.h (STATE_ALLOC): Move to...
18826 * src/state.c: here.
18827 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
18828 * src/state.h, src/state.c: here.
18829
39f41916
AD
188302002-06-30 Akim Demaille <akim@epita.fr>
18831
18832 * src/reader.c (gensym): Rename as...
18833 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
18834 (getsym): Rename as...
18835 (symbol_get): this.
18836
d57650a5
AD
188372002-06-30 Akim Demaille <akim@epita.fr>
18838
18839 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
18840 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
18841 * src/output.c, src/print.c, src/print_graph.c: Propagate.
18842 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
18843
5a08f1ce
AD
188442002-06-30 Akim Demaille <akim@epita.fr>
18845
18846 Make the test suite pass with warnings checked.
18847
18848 * tests/actions.at (Printers and Destructors): Improve.
18849 Avoid unsigned vs. signed issues.
18850 * tests/calc.at: Don't exercise the scanner here, do it...
18851 * tests/input.at (Torturing the Scanner): here.
18852
720623af
PH
188532002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18854
88e7e941 18855 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
18856 reorganize first lines parallel to yacc.c.
18857
fb8135fa
AD
188582002-06-28 Akim Demaille <akim@epita.fr>
18859
18860 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
18861 (b4_token_enum, b4_token_defines): New, factored from...
18862 * data/lalr1.cc, data/yacc.c, glr.c: here.
18863
41442480
AD
188642002-06-28 Akim Demaille <akim@epita.fr>
18865
18866 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
18867 unused variables.
18868 * src/output.c (merger_output): static.
18869
e0e5bf84
AD
188702002-06-28 Akim Demaille <akim@epita.fr>
18871
ba0fe3c7 18872 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
18873 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
18874 pacify GCC.
18875 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 18876
676385e2
PH
188772002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18878
18879 Accumulated changelog for new GLR parsing features.
18880
6a254321 18881 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
18882 conflicts_total_count.
18883 * src/conflicts.h: Ditto.
18884 * src/output.c (token_actions): Use the new name.
18885 (output_conflicts): Change conflp => conflict_list_heads, and
18886 confl => conflict_list for better readability.
18887 * data/glr.c: Use the new names.
18888 * NEWS: Add self to GLR announcement.
e0e5bf84 18889
676385e2
PH
18890 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
18891
18892 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
18893 Akim Demaille.
18894
18895 * data/bison.glr: Change name to glr.c
18896 * data/glr.c: Renamed from bison.glr.
18897 * data/Makefile.am: Add glr.c
e0e5bf84
AD
18898
18899 * src/getargs.c:
18900
676385e2 18901 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 18902 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 18903
676385e2
PH
18904 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18905
18906 * data/bison.glr: Be sure to restore the
18907 current #line when returning to the skeleton contents after having
18908 exposed the input file's #line.
18909
18910 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18911
18912 * data/bison.glr: Bring up to date with changes to bison.simple.
18913
18914 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18915
18916 * data/bison.glr: Correct definitions that use b4_prefix.
18917 Various reformatting.
18918 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
18919 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
18920 yytokenp argument; now part of stack.
18921 (yychar): Define to behave as documented.
18922 (yyclearin): Ditto.
e0e5bf84 18923
676385e2
PH
18924 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18925
18926 * src/reader.h: Add declaration for free_merger_functions.
18927
18928 * src/reader.c (merge_functions): New variable.
18929 (get_merge_function): New function.
18930 (free_merger_functions): New function.
18931 (readgram): Check for %prec that is not followed by a symbol.
18932 Handle %dprec and %merge declarations.
18933 (packgram): Initialize dprec and merger fields in rules array.
18934
18935 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
18936 conflict_list_cnt, conflict_list_free): New variables.
18937 (table_grow): Also grow conflict_table.
e0e5bf84 18938 (prepare_rules): Output dprec and merger tables.
676385e2 18939 (conflict_row): New function.
e0e5bf84 18940 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
18941 default reduction in conflicted states for GLR parser so that there
18942 are spaces for the conflict lists.
18943 (save_row): Also save conflict information.
18944 (token_actions): Allocate conflict list.
18945 (merger_output): New function.
18946 (pack_vector): Pack conflict table, too.
18947 (output_conflicts): New function to output yyconflp and yyconfl.
18948 (output_check): Allocate conflict_tos.
18949 (output_actions): Output conflict tables, also.
18950 (output_skeleton): Output b4_mergers definition.
18951 (prepare): Output b4_max_rhs_length definition.
18952 Use 'bison.glr' as default skeleton for GLR parsers.
18953
18954 * src/gram.c (glr_parser): New flag.
18955 (grammar_free): Call free_merger_functions.
18956
18957 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
18958 all pairs of conflicting reductions, rather than just all tokens
18959 causing conflicts. Needed to size conflict tables.
e0e5bf84 18960 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
18961 interface.
18962 (conflicts_print): Ditto.
18963 (count_total_conflicts): New function.
18964
18965 * src/reader.h (merger_list): New type.
18966 (merge_functions): New variable.
18967
18968 * src/lex.h (tok_dprec, tok_merge): New token types.
18969
18970 * src/gram.h (rule_s): Add dprec and merger fields.
18971 (glr_parser): New flag.
18972
18973 * src/conflicts.h (count_total_conflicts): New function.
18974
18975 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
18976
18977 * doc/bison.texinfo (Generalized LR Parsing): New section.
18978 (GLR Parsers): New section.
18979 (Language and Grammar): Mention GLR parsing.
18980 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
18981 Correct typo ("tge" -> "the").
18982
18983 * data/bison.glr: New skeleton for GLR parsing.
18984
18985 * tests/cxx-gram.at: New tests for GLR parsing.
18986
18987 * tests/testsuite.at: Include cxx-gram.at.
18988
18989 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 18990
676385e2
PH
18991 * src/parse-gram.y:
18992
18993 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
18994
18995 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 18996
b5480d74 189972002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
18998
18999 * src/options.h, src/options.c: Remove.
19000 * src/getargs.c (short_options, long_options): New.
19001
60491a94
AD
190022002-06-27 Akim Demaille <akim@epita.fr>
19003
19004 * data/bison.simple, data/bison.c++: Rename as...
19005 * data/yacc.c, data/lalr1.cc: these.
19006 * doc/bison.texinfo (Environment Variables): Remove.
19007
9be0c25b
AD
190082002-06-25 Raja R Harinath <harinath@cs.umn.edu>
19009
19010 * src/getargs.c (report_argmatch): Initialize strtok().
19011
1ae72863
AD
190122002-06-20 Akim Demaille <akim@epita.fr>
19013
19014 * data/bison.simple (b4_symbol_actions): New, replaces...
19015 (b4_symbol_destructor, b4_symbol_printer): these.
19016 (yysymprint): Be sure to call YYPRINT only for tokens, and using
19017 user token numbers.
19018
87542d29
AD
190192002-06-20 Akim Demaille <akim@epita.fr>
19020
19021 * data/bison.simple (yydestructor): Rename as...
19022 (yydestruct): this.
19023
1a31ed21
AD
190242002-06-20 Akim Demaille <akim@epita.fr>
19025
19026 * src/symtab.h, src/symtab.c (symbol_type_set)
19027 (symbol_destructor_set, symbol_precedence_set): The location is
19028 the last argument.
19029 Adjust all callers.
19030
e776192e
AD
190312002-06-20 Akim Demaille <akim@epita.fr>
19032
19033 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
19034 internals.
19035 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
19036 Takes a location.
19037 * src/symtab.h, src/symtab.c (symbol_class_set)
19038 (symbol_user_token_number_set): Likewise.
19039 Adjust all callers.
19040 Promote complain_at.
19041 * tests/input.at (Type Clashes): Adjust.
19042
5c1180b3
AD
190432002-06-20 Akim Demaille <akim@epita.fr>
19044
19045 * data/bison.simple (YYLEX): Fix the declaration when
19046 %pure-parser.
19047
e3170060
AD
190482002-06-20 Akim Demaille <akim@epita.fr>
19049
19050 * data/bison.simple (yysymprint): Don't print the token number,
19051 just its name.
19052 * tests/actions.at (Destructors): Rename as...
19053 (Printers and Destructors): this.
19054 Also exercise %printer.
19055
253862fd
AD
190562002-06-20 Akim Demaille <akim@epita.fr>
19057
19058 * data/bison.simple (YYDSYMPRINT): New.
19059 Use it to remove many of the #if YYDEBUG/if (yydebug).
19060
366eea36
AD
190612002-06-20 Akim Demaille <akim@epita.fr>
19062
19063 * src/symtab.h, src/symtab.c (symbol_t): printer and
19064 printer_location are new members.
19065 (symbol_printer_set): New.
19066 * src/parse-gram.y (PERCENT_PRINTER): New token.
19067 Handle its associated rule.
19068 * src/scan-gram.l: Adjust.
19069 (handle_destructor_at, handle_destructor_dollar): Rename as...
19070 (handle_symbol_code_at, handle_symbol_code_dollar): these.
19071 * src/output.c (symbol_printers_output): New.
19072 (output_skeleton): Call it.
19073 * data/bison.simple (yysymprint): New. Cannot be named yyprint
19074 since there are already many grammar files with a user `yyprint'.
19075 Replace the calls to YYPRINT to calls to yysymprint.
19076 * tests/calc.at: Adjust.
19077 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
19078 taking advantage of parser very internal details (stack size!).
19079
4f25ebb0
AD
190802002-06-20 Akim Demaille <akim@epita.fr>
19081
19082 * src/scan-gram.l: Complete the scanner with the missing patterns
19083 to pacify Flex.
19084 Use `quote' and `symbol_tag_get' where appropriate.
19085
93b68a0e
AD
190862002-06-19 Akim Demaille <akim@epita.fr>
19087
19088 * tests/actions.at (Destructors): Augment to test locations.
19089 * data/bison.simple (yydestructor): Pass it the current location
19090 if locations are enabled.
19091 Prototype only when __STDC__ or C++.
19092 Change the argument names to move into the yy name space: there is
19093 user code here.
19094
58612f1d
AD
190952002-06-19 Akim Demaille <akim@epita.fr>
19096
74310291
AD
19097 * data/bison.simple (b4_pure_if): New.
19098 Use it instead of #ifdef YYPURE.
19099
191002002-06-19 Akim Demaille <akim@epita.fr>
19101
19102 * data/bison.simple (b4_location_if): New.
58612f1d
AD
19103 Use it instead of #ifdef YYLSP_NEEDED.
19104
f25bfb75
AD
191052002-06-19 Akim Demaille <akim@epita.fr>
19106
19107 Prepare @$ in %destructor, but currently don't bind it in the
19108 skeleton, as %location use is not cleaned up yet.
19109
19110 * src/scan-gram.l (handle_dollar, handle_destructor_at)
19111 (handle_action_at): New.
19112 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
19113 a braced_code_t and a location as additional arguments.
19114 (handle_destructor_dollar): Instead of requiring `b4_eval', just
19115 unquote one when outputting `b4_dollar_dollar'.
19116 Adjust callers.
19117 * data/bison.simple (b4_eval): Remove.
19118 (b4_symbol_destructor): Adjust.
19119 * tests/input.at (Invalid @n): Adjust.
19120
c732d2c6
AD
191212002-06-19 Zack Weinberg <zack@codesourcery.com>
19122
19123 * doc/bison.texinfo: Document ability to have multiple
19124 prologue sections.
19125
8c165d89
AD
191262002-06-18 Akim Demaille <akim@epita.fr>
19127
19128 * src/files.c (compute_base_names): When computing the output file
19129 names from the input file name, strip the directory part.
19130
ca98bf57
AD
191312002-06-18 Akim Demaille <akim@epita.fr>
19132
19133 * data/bison.simple.new: Comment changes.
19134 Reported by Andreas Schwab.
19135
0bfb02ff
AD
191362002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
19137
19138 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
19139 there are no `label `yyoverflowlab' defined but not used' warnings
19140 when yyoverflow is defined.
19141
24c0aad7
AD
191422002-06-18 Akim Demaille <akim@epita.fr>
19143
19144 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
19145 new member.
19146 (symbol_destructor_set): Adjust.
19147 * src/output.c (symbol_destructors_output): Output the destructor
19148 locations.
19149 Output the symbol name.
19150 * data/bison.simple (b4_symbol_destructor): Adjust.
19151
5719c109
AD
191522002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
19153 and Akim Demaille <akim@epita.fr>
19154
19155 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
19156 what's left on the stack when the error recovery hits EOF.
19157 * tests/actions.at (Destructors): Complete to exercise this case.
19158
9280d3ef
AD
191592002-06-17 Akim Demaille <akim@epita.fr>
19160
19161 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
19162 arguments is really empty, not only equal to `[]'.
19163 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
19164 member.
19165 (symbol_destructor_set): New.
19166 * src/output.c (symbol_destructors_output): New.
19167 * src/reader.h (brace_code_t, current_braced_code): New.
19168 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
19169 (handle_dollar): Rename as...
19170 (handle_action_dollar): this.
19171 (handle_destructor_dollar): New.
19172 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
19173 (grammar_declaration): Use it.
19174 * data/bison.simple (yystos): Is always defined.
19175 (yydestructor): New.
19176 * tests/actions.at (Destructors): New.
19177 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
19178
dafdc66f
AD
191792002-06-17 Akim Demaille <akim@epita.fr>
19180
19181 * src/symlist.h, src/symlist.c (symbol_list_length): New.
19182 * src/scan-gram.l (handle_dollar, handle_at): Compute the
19183 rule_length only when needed.
19184 * src/output.c (actions_output, token_definitions_output): Output
19185 the full M4 block.
19186 * src/symtab.c: Don't access directly to the symbol tag, use
19187 symbol_tag_get.
19188 * src/parse-gram.y: Use symbol_list_free.
19189
56c47203
AD
191902002-06-17 Akim Demaille <akim@epita.fr>
19191
19192 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
19193 (symbol_list_prepend, get_type_name): Move to...
19194 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
19195 (symbol_list_prepend, symbol_list_n_type_name_get): here.
19196 Adjust all callers.
19197 (symbol_list_free): New.
19198 * src/scan-gram.l (handle_dollar): Takes a location.
19199 * tests/input.at (Invalid $n): Adjust.
19200
1e0bab92
AD
192012002-06-17 Akim Demaille <akim@epita.fr>
19202
19203 * src/reader.h, src/reader.c (symbol_list_new): Export it.
19204 (symbol_list_prepend): New.
19205 * src/parse-gram.y (%union): `list' is a new member.
19206 (symbols.1): New, replaces...
19207 (terms_to_prec.1, nterms_to_type.1): these.
19208 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
19209 Take a location as additional argument.
19210 Adjust all callers.
19211
04e60654
AD
192122002-06-15 Akim Demaille <akim@epita.fr>
19213
19214 * src/parse-gram.y: Move %token in the declaration section so that
19215 we don't depend upon CVS Bison.
19216
10e5b8bd
AD
192172002-06-15 Akim Demaille <akim@epita.fr>
19218
19219 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
19220 * src/print.c (print_core): Use it.
19221
9801d40c
AD
192222002-06-15 Akim Demaille <akim@epita.fr>
19223
19224 * src/conflicts.c (log_resolution): Accept the rule involved in
19225 the sr conflicts instead of the lookahead number that points to
19226 that rule.
19227 (flush_reduce): Accept the current lookahead vector as argument,
19228 instead of the index in LA.
19229 (resolve_sr_conflict): Accept the current number of lookahead
19230 bitset to consider for the STATE, instead of the index in LA.
19231 (set_conflicts): Adjust.
19232 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
19233
c0263492
AD
192342002-06-15 Akim Demaille <akim@epita.fr>
19235
19236 * src/state.h (state_t): Replace the `lookaheadsp' member, a
19237 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
19238 Adjust all dependencies.
19239 * src/lalr.c (initialize_lookaheads): Split into...
19240 (states_lookaheads_count, states_lookaheads_initialize): these.
19241 (lalr): Adjust.
19242
9757c359
AD
192432002-06-15 Akim Demaille <akim@epita.fr>
19244
19245 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
19246 out of...
19247 (grammar_rules_print): here.
19248 * src/reduce.c (reduce_output): Use it.
19249 * tests/reduce.at (Useless Rules, Reduced Automaton)
19250 (Underivable Rules): Adjust.
19251
6b98e4b5
AD
192522002-06-15 Akim Demaille <akim@epita.fr>
19253
19254 Copy BYacc's nice way to report the grammar.
19255
19256 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
19257 New.
19258 Don't print the rules' location, it is confusing and useless.
19259 (rule_print): Use grammar_rhs_print.
19260 * src/print.c (print_grammar): Use grammar_rules_print.
19261
6b98e4b5
AD
192622002-06-15 Akim Demaille <akim@epita.fr>
19263
19264 Complete and rationalize `useless thing' warnings.
19265
19266 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
19267 (symbol_tag_print): New.
19268 Use them everywhere in place of accessing directly the tag member.
19269 * src/gram.h, src/gram.c (rule_print): New.
19270 Use it where a rule used to be printed `by hand'.
19271 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
19272 (reduce_grammar_tables): Report the useless rules.
19273 (reduce_print): Useless things are a warning, not an error.
19274 Report it as such.
19275 * tests/reduce.at (Useless Nonterminals, Useless Rules):
19276 (Reduced Automaton, Underivable Rules): Adjust.
19277 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
19278 * tests/conflicts.at (Unresolved SR Conflicts)
19279 (Solved SR Conflicts): Adjust.
19280
ee000ba4
AD
192812002-06-15 Akim Demaille <akim@epita.fr>
19282
19283 Let symbols have a location.
19284
19285 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
19286 (getsym): Adjust.
19287 Adjust all callers.
19288 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
19289 Use location_t, not int.
19290 * src/symtab.c (symbol_check_defined): Take advantage of the
19291 location.
19292 * tests/regression.at (Invalid inputs): Adjust.
19293
8efe435c
AD
192942002-06-15 Akim Demaille <akim@epita.fr>
19295
19296 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
19297 (input): Don't try to initialize yylloc here, do it in the
19298 scanner.
19299 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
19300 * src/gram.h (rule_t): Change line and action_line into location
19301 and action_location, of location_t type.
19302 Adjust all dependencies.
19303 * src/location.h, src/location.c (empty_location): New.
19304 * src/reader.h, src/reader.c (grammar_start_symbol_set)
19305 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
19306 (grammar_current_rule_symbol_append)
19307 (grammar_current_rule_action_append): Expect a location as argument.
19308 * src/reader.c (grammar_midrule_action): Adjust to attach an
19309 action's location as dummy symbol location.
19310 * src/symtab.h, src/symtab.c (startsymbol_location): New.
19311 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
19312 the line numbers.
19313
1921f1d7
AD
193142002-06-14 Akim Demaille <akim@epita.fr>
19315
19316 Grammar declarations may be found in the grammar section.
19317
19318 * src/parse-gram.y (rules_or_grammar_declaration): New.
19319 (declarations): Each declaration may end with a semicolon, not
19320 just...
19321 (grammar_declaration): `"%union"'.
19322 (grammar): Branch to rules_or_grammar_declaration.
19323
4515534c
AD
193242002-06-14 Akim Demaille <akim@epita.fr>
19325
19326 * src/main.c (main): Invoke scanner_free.
19327
f958596b
AD
193282002-06-14 Akim Demaille <akim@epita.fr>
19329
19330 * src/output.c (m4_invoke): Extracted from...
19331 (output_skeleton): here.
19332 Free tempfile.
19333
2c569025
AD
193342002-06-14 Akim Demaille <akim@epita.fr>
19335
19336 * src/parse-gram.y (directives, directive, gram)
19337 (grammar_directives, precedence_directives, precedence_directive):
19338 Rename as...
19339 (declarations, declaration, grammar, grammar_declaration)
19340 (precedence_declaration, precedence_declarator): these.
19341 (symbol_declaration): New.
19342
592e8d4d
AD
193432002-06-14 Akim Demaille <akim@epita.fr>
19344
19345 * src/files.c (action_obstack): Remove, unused.
19346 (output_obstack): Remove it, and all its dependencies, as it is no
19347 longer needed.
19348 * src/reader.c (epilogue_set): Build the epilogue in the
19349 muscle_obstack.
19350 * src/output.h, src/output.c (muscle_obstack): Move to...
19351 * src/muscle_tab.h, src/muscle_tab.h: here.
19352 (muscle_init): Initialize muscle_obstack.
19353 (muscle_free): New.
19354 * src/main.c (main): Call it.
19355
0c15323d
AD
193562002-06-14 Akim Demaille <akim@epita.fr>
19357
19358 * src/location.h: New, extracted from...
19359 * src/reader.h: here.
19360 * src/Makefile.am (noinst_HEADERS): Merge into
19361 (bison_SOURCES): this.
19362 Add location.h.
19363 * src/parse-gram.y: Use location_t instead of Bison's.
19364 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
19365 Use location_t instead of ints.
19366
e96c9728
AD
193672002-06-14 Akim Demaille <akim@epita.fr>
19368
19369 * data/bison.simple, data/bison.c++: Be sure to restore the
19370 current #line when returning to the skeleton contents after having
19371 exposed the input file's #line.
19372
75d1fe16
AD
193732002-06-12 Akim Demaille <akim@epita.fr>
19374
19375 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
19376 eager.
19377 * tests/actions.at (Exotic Dollars): New.
19378
6c35d22c
AD
193792002-06-12 Akim Demaille <akim@epita.fr>
19380
19381 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
19382 ['"/] too eagerly.
19383 * tests/input.at (Torturing the Scanner): New.
19384
1d6412ad
AD
193852002-06-11 Akim Demaille <akim@epita.fr>
19386
19387 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
19388 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
19389 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
19390 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
19391 * src/reader.c (reader): Use it.
19392
4cdb01db
AD
193932002-06-11 Akim Demaille <akim@epita.fr>
19394
19395 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
19396 Adjust all callers.
19397 (scanner_last_string_free): New.
19398
44995b2e
AD
193992002-06-11 Akim Demaille <akim@epita.fr>
19400
19401 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
19402 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
19403 (last_string, YY_OBS_FREE): New.
19404 Use them when returning an ID.
19405
e9955c83
AD
194062002-06-11 Akim Demaille <akim@epita.fr>
19407
19408 Have Bison grammars parsed by a Bison grammar.
19409
19410 * src/reader.c, src/reader.h (prologue_augment): New.
19411 * src/reader.c (copy_definition): Remove.
19412
19413 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
19414 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
19415 (grammar_current_rule_prec_set, grammar_current_rule_check)
19416 (grammar_current_rule_symbol_append)
19417 (grammar_current_rule_action_append): Export.
19418 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
19419 (symbol_list_action_append): Remove.
19420 Hook the routines from reader.
19421 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
19422 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
19423
19424 * src/reader.c (read_declarations): Remove, unused.
19425
19426 * src/parse-gram.y: Handle the epilogue.
19427 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
19428 (grammar_start_symbol_set): this.
19429 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
19430 * src/reader.c (readgram): Remove, unused.
19431 (reader): Adjust to insert eoftoken and axiom where appropriate.
19432
19433 * src/reader.c (copy_dollar): Replace with...
19434 * src/scan-gram.h (handle_dollar): this.
19435 * src/parse-gram.y: Remove `%thong'.
19436
19437 * src/reader.c (copy_at): Replace with...
19438 * src/scan-gram.h (handle_at): this.
19439
19440 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
19441 New.
19442
19443 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
19444 time being.
19445
19446 * src/reader.h, src/reader.c (grammar_rule_end): New.
19447
19448 * src/parse.y (current_type, current_class): New.
19449 Implement `%nterm', `%token' support.
19450 Merge `%term' into `%token'.
19451 (string_as_id): New.
19452 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
19453 type name.
19454
19455 * src/parse-gram.y: Be sure to handle properly the beginning of
19456 rules.
19457
19458 * src/parse-gram.y: Handle %type.
19459 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
19460
19461 * src/parse-gram.y: More directives support.
19462 * src/options.c: No longer handle source directives.
19463
19464 * src/parse-gram.y: Fix %output.
19465
19466 * src/parse-gram.y: Handle %union.
19467 Use the prologue locations.
19468 * src/reader.c (parse_union_decl): Remove.
19469
19470 * src/reader.h, src/reader.c (epilogue_set): New.
19471 * src/parse-gram.y: Use it.
19472
19473 * data/bison.simple, data/bison.c++: b4_stype is now either not
19474 defined, then default to int, or to the contents of %union,
19475 without `union' itself.
19476 Adjust.
19477 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
19478
19479 * src/output.c (actions_output): Don't output braces, as they are
19480 already handled by the scanner.
19481
19482 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
19483 characters to themselves.
19484
19485 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
19486 that the epilogue has a proper #line.
19487
19488 * src/parse-gram.y: Handle precedence/associativity.
19489
19490 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
19491 a terminal.
19492 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
19493 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
19494 at all to define terminals that cannot be emitted.
19495
19496 * src/scan-gram.l: Escape M4 characters.
19497
19498 * src/scan-gram.l: Working properly with escapes in user
19499 strings/characters.
19500
19501 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
19502 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
19503 grammar.
19504 Use more modest sizes, as for the time being the parser does not
19505 release memory, and therefore the process swallows a huge amount
19506 of memory.
19507
19508 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
19509 stricter %token grammar.
19510
19511 * src/symtab.h (associativity): Add `undef_assoc'.
19512 (symbol_precedence_set): Do nothing when passed an undef_assoc.
19513 * src/symtab.c (symbol_check_alias_consistence): Adjust.
19514
19515 * tests/regression.at (Invalid %directive): Remove, as it is now
19516 meaningless.
19517 (Invalid inputs): Adjust to the new error messages.
19518 (Token definitions): The new grammar doesn't allow too many
19519 eccentricities.
19520
19521 * src/lex.h, src/lex.c: Remove.
19522 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
19523 (copy_character, copy_string2, copy_string, copy_identifier)
19524 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
19525 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
19526 (parse_action): Remove.
19527 * po/POTFILES.in: Adjust.
19528
2e047461
AD
195292002-06-11 Akim Demaille <akim@epita.fr>
19530
cd05d13c 19531 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
19532 rule's action member: return the action as a string.
19533 Don't require `rule_length' as an argument: compute it.
19534 (grammar_current_rule_symbol_append)
19535 (grammar_current_rule_action_append): New, eved out from
19536 (readgram): here.
19537 Remove `action_flag', `rulelength', unused now.
19538
9af3fbce
AD
195392002-06-11 Akim Demaille <akim@epita.fr>
19540
19541 * src/reader.c (grammar_current_rule_prec_set).
19542 (grammar_current_rule_check): New, eved out from...
19543 (readgram): here.
19544 Remove `xaction', `first_rhs': useless.
19545 * tests/input.at (Type clashes): New.
19546 * tests/existing.at (GNU Cim Grammar): Adjust.
19547
1485e106
AD
195482002-06-11 Akim Demaille <akim@epita.fr>
19549
19550 * src/reader.c (grammar_midrule_action): New, Eved out from
19551 (readgram): here.
19552
da4160c3
AD
195532002-06-11 Akim Demaille <akim@epita.fr>
19554
19555 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
19556 New.
19557 (readgram): Use them as replacement of inlined code, crule and
19558 crule1.
19559
f6d0f937
AD
195602002-06-11 Akim Demaille <akim@epita.fr>
19561
19562 * src/reader.c (grammar_end, grammar_symbol_append): New.
19563 (readgram): Use them.
19564 Make the use of `p' as local as possible.
19565
69078d4b
AD
195662002-06-10 Akim Demaille <akim@epita.fr>
19567
19568 GCJ's parser requires the tokens to be defined before the prologue.
19569
19570 * data/bison.simple: Output the token definition before the user's
19571 prologue.
19572 * tests/regression.at (Braces parsing, Duplicate string)
19573 (Mixing %token styles): Check the output from bison.
19574 (Early token definitions): New.
19575
5e424082
AD
195762002-06-10 Akim Demaille <akim@epita.fr>
19577
19578 * src/symtab.c (symbol_user_token_number_set): Don't complain when
19579 assigning twice the same user number to a token, so that we can
19580 use it in...
19581 * src/lex.c (lex): here.
19582 Also use `symbol_class_set' instead of hand written code.
19583 * src/reader.c (parse_assoc_decl): Likewise.
19584
44536b35
AD
195852002-06-10 Akim Demaille <akim@epita.fr>
19586
19587 * src/symtab.c, src/symtab.c (symbol_class_set)
19588 (symbol_user_token_number_set): New.
19589 * src/reader.c (parse_token_decl): Use them.
19590 Use a switch instead of ifs.
19591 Use a single argument.
19592
8b9f2372
AD
195932002-06-10 Akim Demaille <akim@epita.fr>
19594
19595 Remove `%thong' support as it is undocumented, unused, duplicates
19596 `%token's job, and creates useless e-mail traffic with people who
19597 want to know what it is, why it is undocumented, unused, and
19598 duplicates `%token's job.
19599
19600 * src/reader.c (parse_thong_decl): Remove.
19601 * src/options.c (option_table): Remove "thong".
19602 * src/lex.h (tok_thong): Remove.
19603
3ae2b51f
AD
196042002-06-10 Akim Demaille <akim@epita.fr>
19605
19606 * src/symtab.c, src/symtab.c (symbol_type_set)
19607 (symbol_precedence_set): New.
19608 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
19609 (value_components_used): Remove, unused.
19610
2f1afb73
AD
196112002-06-09 Akim Demaille <akim@epita.fr>
19612
19613 Move symbols handling code out of the reader.
19614
19615 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
19616 (axiom): Move to...
19617 * src/symtab.h, src/symtab.c: here.
19618
19619 * src/gram.c (start_symbol): Remove: use startsymbol->number.
19620 * src/reader.c (startval): Rename as...
19621 * src/symtab.h, src/symtab.c (startsymbol): this.
19622 * src/reader.c: Adjust.
19623
19624 * src/reader.c (symbol_check_defined, symbol_make_alias)
19625 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
19626 (token_translations_init)
19627 Move to...
19628 * src/symtab.c: here.
19629 * src/reader.c (packsymbols): Move to...
19630 * src/symtab.h, src/symtab.c (symbols_pack): here.
19631 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
19632 argument.
19633
e9bca3ad
AD
196342002-06-03 Akim Demaille <akim@epita.fr>
19635
19636 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
19637 then statements.
19638
86eff183
AD
196392002-06-03 Akim Demaille <akim@epita.fr>
19640
19641 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
19642 structs with non literals.
19643 * src/scan-skel.l: never-interactive.
19644 * src/conflicts.c (enum conflict_resolution_e): No trailing
19645 comma.
19646 * src/getargs.c (usage): Split long literal strings.
19647 Reported by Hans Aberg.
19648
717be197
AD
196492002-05-28 Akim Demaille <akim@epita.fr>
19650
19651 * data/bison.c++: Use C++ ostreams.
19652 (cdebug_): New member.
19653
670ddffd
AD
196542002-05-28 Akim Demaille <akim@epita.fr>
19655
19656 * src/output.c (output_skeleton): Be sure to allocate enough room
19657 for `/' _and_ for `\0' in full_skeleton.
19658
769b430f
AD
196592002-05-28 Akim Demaille <akim@epita.fr>
19660
19661 * data/bison.c++: Catch up with bison.simple:
19662 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19663 and Paul Eggert <eggert@twinsun.com>: `error' handing.
19664 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
19665 and popping traces.
19666
7067cb36
PH
196672002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19668
19669 * src/output.c (output_skeleton): Put an explicit path in front of
19670 the skeleton file name, rather than relying on the -I directory,
19671 to partially alleviate effects of having a skeleton file lying around
19672 in the current directory.
769b430f 19673
4a713ec2
PH
196742002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19675
769b430f 19676 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
19677 obstack_printf should be obstack_fgrow1.
19678
b408954b
AD
196792002-05-26 Akim Demaille <akim@epita.fr>
19680
19681 * src/state.h (state_t): `solved_conflicts' is a new member.
19682 * src/LR0.c (new_state): Set it to 0.
19683 * src/conflicts.h, src/conflicts.c (print_conflicts)
19684 (free_conflicts, solve_conflicts): Rename as...
19685 (conflicts_print, conflicts_free, conflicts_solve): these.
19686 Adjust callers.
19687 * src/conflicts.c (enum conflict_resolution_e)
19688 (solved_conflicts_obstack): New, used by...
19689 (log_resolution): this.
19690 Adjust to attach the conflict resolution to each state.
19691 Complete the description with the precedence/associativity
19692 information.
19693 (resolve_sr_conflict): Adjust.
19694 * src/print.c (print_state): Output its solved_conflicts.
19695 * tests/conflicts.at (Unresolved SR Conflicts)
19696 (Solved SR Conflicts): Exercise --report=all.
19697
a49aecd5
AD
196982002-05-26 Akim Demaille <akim@epita.fr>
19699
19700 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
19701 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
19702 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
19703 (token_number_t, item_number_as_token_number)
19704 (token_number_as_item_number, muscle_insert_token_number_table):
19705 Rename as...
19706 (symbol_number_t, item_number_as_symbol_number)
19707 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
19708 these, since it is more appropriate.
19709
5504898e
AD
197102002-05-26 Akim Demaille <akim@epita.fr>
19711
19712 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
19713 `Error:' lines.
19714 * data/bison.simple (yystos) [YYDEBUG]: New.
19715 (yyparse) [YYDEBUG]: Display the symbols which are popped during
19716 error recovery.
19717 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
19718
ec3bc396
AD
197192002-05-25 Akim Demaille <akim@epita.fr>
19720
19721 * doc/bison.texinfo (Debugging): Split into...
19722 (Tracing): this new section, its former contents, and...
19723 (Understanding): this new section.
19724 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
19725 by...
19726 (report_flag): this.
19727 Adjust all dependencies.
19728 (report_args, report_types, report_argmatch): New.
19729 (usage, getargs): Report/support -r, --report.
19730 * src/options.h
19731 (struct option_table_struct): Rename as..,
19732 (struct option_table_s): this.
19733 Rename the `set_flag' member to `flag' to match with getopt_long's
19734 struct.
19735 * src/options.c (option_table): Split verbose into an entry for
19736 %verbose, and another for --verbose.
19737 Support --report/-r, so remove -r from the obsolete --raw.
19738 * src/print.c: Attach full item sets and lookaheads reports to
19739 report_flag instead of trace_flag.
19740 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
19741
78df8250
PE
197422002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19743 and Paul Eggert <eggert@twinsun.com>
769b430f 19744
78df8250
PE
19745 * data/bison.simple (yyparse): Correct error handling to conform to
19746 POSIX and yacc. Specifically, after syntax error is discovered,
19747 do not reduce further before shifting the error token.
19748 Clean up the code a bit by removing the labels yyerrdefault,
19749 yyerrhandle, yyerrpop.
19750 * NEWS: Document the above.
19751
c0c9ea05
PH
197522002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19753
19754 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
19755 type; it isn't always big enough, since it doesn't necessarily
19756 include non-terminals.
769b430f 19757 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
19758 the latter can be removed.
19759 (yy_token_number_type): Remove, only one use.
19760 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
19761 don't use TokenNumberType as element type.
769b430f 19762
c0c9ea05
PH
19763 * tests/regression.at: Modify expected output to agree with change
19764 to yyr1 and yytranslate.
769b430f 19765
6390a83f
FK
197662002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
19767
19768 * src/reader.c (parse_action): Use copy_character instead of
19769 obstack_1grow.
19770
db7c8e9a
AD
197712002-05-13 Akim Demaille <akim@epita.fr>
19772
19773 * tests/regression.at (Token definitions): Prototype yylex and
19774 yyerror.
19775
fcc61800
PH
197762002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19777
158c687b 19778 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
19779 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
19780 32-bit arithmetic.
19781 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
19782
5683e9b2
AD
197832002-05-07 Akim Demaille <akim@epita.fr>
19784
19785 * tests/synclines.at: Be sure to prototype yylex and yyerror to
19786 avoid GCC warnings.
19787
0c2d3f4c
AD
197882002-05-07 Akim Demaille <akim@epita.fr>
19789
19790 Kill GCC warnings.
19791
19792 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
19793 over the RHS of each rule.
19794 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
19795 * src/state.h (state_t): Member `nitems' is unsigned short.
19796 * src/LR0.c (get_state): Adjust.
19797 * src/reader.c (packgram): Likewise.
19798 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
19799 `Type'.
19800 (muscle_insert_int_table): Remove, unused.
19801 (prepare_rules): Remove `max'.
19802
1565b720
AD
198032002-05-06 Akim Demaille <akim@epita.fr>
19804
19805 * src/closure.c (print_firsts): Display of the symbol tags.
19806 (bitmatrix_print): Move to...
19807 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
19808 here.
19809 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
19810
cfaee611
AD
198112002-05-06 Akim Demaille <akim@epita.fr>
19812
19813 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
19814 hash_do_for_each.
19815
458be8e0
AD
198162002-05-06 Akim Demaille <akim@epita.fr>
19817
19818 * src/LR0.c (new_state, get_state): Instead of using the global
19819 `kernel_size' and `kernel_base', have two new arguments:
19820 `core_size' and `core'.
19821 Adjust callers.
19822
a900a624
AD
198232002-05-06 Akim Demaille <akim@epita.fr>
19824
19825 * src/reader.c (packgram): No longer end `ritem' with a 0
19826 sentinel: it is not used.
19827
d4e7d3a1
AD
198282002-05-05 Akim Demaille <akim@epita.fr>
19829
19830 New experimental feature: display the lookaheads in the report and
19831 graph.
19832
19833 * src/print (print_core): When --trace-flag, display the rules
19834 lookaheads.
19835 * src/print_graph.c (print_core): Likewise.
19836 Swap the arguments.
19837 Adjust caller.
19838
39ceb25b
AD
198392002-05-05 Akim Demaille <akim@epita.fr>
19840
19841 * tests/torture.at (Many lookaheads): New test.
19842
5372019f
AD
198432002-05-05 Akim Demaille <akim@epita.fr>
19844
19845 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
19846 (GENERATE_MUSCLE_INSERT_TABLE): this.
19847 (output_int_table, output_unsigned_int_table, output_short_table)
19848 (output_token_number_table, output_item_number_table): Replace with...
19849 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
19850 (muscle_insert_short_table, muscle_insert_token_number_table)
19851 (muscle_insert_item_number_table): these.
19852 Adjust all callers.
19853 (prepare_tokens): Don't free `translations', since...
19854 * src/reader.h, src/reader.c (grammar_free): do it.
19855 Move to...
19856 * src/gram.h, src/gram.c (grammar_free): here.
19857 * data/bison.simple, data/bison.c++: b4_token_number_max is now
19858 b4_translate_max.
19859
5df5f6d5
AD
198602002-05-05 Akim Demaille <akim@epita.fr>
19861
19862 * src/output.c (output_unsigned_int_table): New.
19863 (prepare_rules): `i' is unsigned.
19864 `prhs', `rline', `r2' are unsigned int.
19865 Rename muscle `rhs_number_max' as `rhs_max'.
19866 Output muscles `prhs_max', `rline_max', and `r2_max'.
19867 Free rline and r1.
19868 * data/bison.simple, data/bison.c++: Adjust to use these muscles
19869 to compute types instead of constant types.
19870 * tests/regression.at (Web2c Actions): Adjust.
19871
b87f8b21
AD
198722002-05-04 Akim Demaille <akim@epita.fr>
19873
19874 * src/symtab.h (SALIAS, SUNDEF): Rename as...
19875 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
19876 Adjust dependencies.
19877 * src/output.c (token_definitions_output): Be sure not to output a
19878 `#define 'a'' when fed with `%token 'a' "a"'.
19879 * tests/regression.at (Token definitions): New.
19880
8bb936e4
PE
198812002-05-03 Paul Eggert <eggert@twinsun.com>
19882
19883 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
19884 for K&R C.
19885
198862002-05-03 gettextize <bug-gnu-gettext@gnu.org>
19887
19888 * Makefile.am (SUBDIRS): Remove intl.
19889 (EXTRA_DIST): Add config/config.rpath.
19890
53c71a12
AD
198912002-05-03 Akim Demaille <akim@epita.fr>
19892
19893 * data/bison.simple (m4_if): Don't output empty enums.
19894 And actually, output valid enum definitions :(.
19895
289dd0cf
AD
198962002-05-03 Akim Demaille <akim@epita.fr>
19897
19898 * configure.bat: Remove, completely obsolete.
19899 * Makefile.am (EXTRA_DIST): Adjust.
19900 Don't distribute config.rpath...
19901 * config/Makefile.am (EXTRA_DIST): Do it.
19902
db85e524
AD
199032002-05-03 Akim Demaille <akim@epita.fr>
19904
19905 * configure.in (GETTEXT_VERSION): New.
19906 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
19907
83ccf991
AD
199082002-05-03 Akim Demaille <akim@epita.fr>
19909
19910 * data/bison.simple (b4_token_enum): New.
19911 (b4_token_defines): Use it to output tokens both as #define and
19912 enums.
19913 Suggested by Paul Eggert.
19914 * src/output.c (token_definitions_output): Don't output spurious
19915 white spaces.
19916
1f418995
AD
199172002-05-03 Akim Demaille <akim@epita.fr>
19918
19919 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
19920
45119f04
RA
199212002-05-02 Robert Anisko <robert@lrde.epita.fr>
19922
19923 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
19924 Update the stack class, give a try to deque as the default container.
19925
b2d52318
AD
199262002-05-02 Akim Demaille <akim@epita.fr>
19927
19928 * data/bison.simple (yyparse): Do not implement @$ = @1.
19929 (YYLLOC_DEFAULT): Adjust to do it.
19930 * doc/bison.texinfo (Location Default Action): Fix.
19931
3a8b4109
AD
199322002-05-02 Akim Demaille <akim@epita.fr>
19933
19934 * src/reader.c (parse_braces): Merge into...
19935 (parse_action): this.
19936
84614e13
AD
199372002-05-02 Akim Demaille <akim@epita.fr>
19938
19939 * configure.in (ALL_LINGUAS): Remove.
19940 * po/LINGUAS, hr.po: New.
19941
fdbcd8e2
AD
199422002-05-02 Akim Demaille <akim@epita.fr>
19943
19944 Remove the so called hairy (semantic) parsers.
19945
19946 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
19947 * src/gram.h, src/gram.c (semantic_parser): Remove.
19948 (rule_t): Remove the guard and guard_line members.
19949 * src/lex.h (token_t): remove tok_guard.
19950 * src/options.c (option_table): Remove %guard and %semantic_parser
19951 support.
19952 * src/output.c, src/output.h (guards_output): Remove.
19953 (prepare): Adjust.
19954 (token_definitions_output): Don't output the `T'
19955 tokens (???).
19956 (output_skeleton): Don't output the guards.
19957 * src/files.c, src/files.c (attrsfile): Remove.
19958 * src/reader.c (symbol_list): Remove the guard and guard_line
19959 members.
19960 Adjust dependencies.
19961 (parse_guard): Remove.
19962 * data/bison.hairy: Remove.
19963 * doc/bison.texinfo (Environment Variables): Remove occurrences of
19964 BISON_HAIRY.
19965
82b6cb3f
AD
199662002-05-02 Akim Demaille <akim@epita.fr>
19967
19968 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
19969 (parse_guard): Rename the formal argument `stack_offset' as
19970 `rule_length', which is more readable.
19971 Adjust callers.
19972 (copy_at, copy_dollar): Instead of outputting the hard coded
19973 values of $$, $n and so forth, output invocation to b4_lhs_value,
19974 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
19975 Note: this patch partially drops `semantic-parser' support: it
19976 always does `rule_length - n', where semantic parsers ought to
19977 always use `-n'.
82b6cb3f
AD
19978 * data/bison.simple, data/bison.c++ (b4_lhs_value)
19979 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
19980
6cbfbcc5
AD
199812002-05-02 Akim Demaille <akim@epita.fr>
19982
19983 * configure.in (AC_INIT): Bump to 1.49b.
19984 (AM_INIT_AUTOMAKE): Short invocation.
19985
b8548114
AD
199862002-05-02 Akim Demaille <akim@epita.fr>
19987
19988 Version 1.49a.
19989
c20cd1fa
AD
199902002-05-01 Akim Demaille <akim@epita.fr>
19991
19992 * src/skeleton.h: Remove.
19993
8a9566d4
AD
199942002-05-01 Akim Demaille <akim@epita.fr>
19995
19996 * src/skeleton.h: Fix the #endif.
19997 Reported by Magnus Fromreide.
19998
8c6d399a
PE
199992002-04-26 Paul Eggert <eggert@twinsun.com>
20000
20001 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
20002 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 20003 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 20004
2b7ed18a
RA
200052002-04-25 Robert Anisko <robert@lrde.epita.fr>
20006
20007 * src/scan-skel.l: Postprocess quadrigraphs.
20008
20009 * src/reader.c (copy_character): New function, used to output
20010 single characters while replacing `[' and `]' with quadrigraphs, to
20011 avoid troubles with M4 quotes.
20012 (copy_comment): Output characters with copy_character.
20013 (read_additionnal_code): Likewise.
20014 (copy_string2): Likewise.
20015 (copy_definition): Likewise.
20016
20017 * tests/calc.at: Exercise M4 quoting.
20018
34a89c50
AD
200192002-04-25 Akim Demaille <akim@epita.fr>
20020
20021 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
20022 between `!' and the command.
20023 Reported by Paul Eggert.
20024
0dd1580a
RA
200252002-04-24 Robert Anisko <robert@lrde.epita.fr>
20026
20027 * tests/calc.at: Exercise prologue splitting.
20028
20029 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
20030 `b4_post_prologue' instead of `b4_prologue'.
20031
20032 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
20033 muscles.
20034 (output): Free pre_prologue_obstack and post_prologue_obstack.
20035 * src/files.h, src/files.c (attrs_obstack): Remove.
20036 (pre_prologue_obstack, post_prologue_obstack): New.
20037 * src/reader.c (copy_definition): Add a parameter to specify the
20038 obstack to fill, instead of using attrs_obstack unconditionally.
20039 (read_declarations): Pass pre_prologue_obstack to copy_definition if
20040 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
20041
83c1796f
PE
200422002-04-23 Paul Eggert <eggert@twinsun.com>
20043
20044 * data/bison.simple: Remove unnecessary commentary and white
20045 space differences from 1_29-branch.
20046 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
20047
20048 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
20049 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
20050 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
20051 constructors or destructors.
20052
20053 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
20054
1207eeac
AD
200552002-04-23 Akim Demaille <akim@epita.fr>
20056
20057 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
20058 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
20059 location with columns.
20060 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
20061 All reported by Paul Eggert.
20062
78ab8f67
AD
200632002-04-22 Akim Demaille <akim@epita.fr>
20064
20065 * src/reduce.c (dump_grammar): Move to...
20066 * src/gram.h, src/gram.c (grammar_dump): here.
20067 Be sure to separate long item numbers.
20068 Don't read the members of a rule's prec if its nil.
20069
133c20e2
AD
200702002-04-22 Akim Demaille <akim@epita.fr>
20071
20072 * src/output.c (table_size, table_grow): New.
20073 (MAXTABLE): Remove, replace uses with table_size.
20074 (pack_vector): Instead of dying when the table is too big, grow it.
20075
9515e8a7
AD
200762002-04-22 Akim Demaille <akim@epita.fr>
20077
20078 * data/bison.simple (yyr1): Its type is that of a token number.
20079 * data/bison.c++ (r1_): Likewise.
20080 * tests/regression.at (Web2c Actions): Adjust.
20081
23c5a174
AD
200822002-04-22 Akim Demaille <akim@epita.fr>
20083
20084 * src/reader.c (token_translations_init): 256 is now the default
20085 value for the error token, i.e., it will be assigned another
20086 number if the user assigned 256 to one of her tokens.
20087 (reader): Don't force 256 to error.
20088 * doc/bison.texinfo (Symbols): Adjust.
20089 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
20090 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
20091 etc. instead of 10, 20, 30 (which was used to `jump' over error
20092 (256) and undefined (2)).
20093
5fbb0954
AD
200942002-04-22 Akim Demaille <akim@epita.fr>
20095
20096 Propagate more token_number_t.
20097
20098 * src/gram.h (token_number_as_item_number)
20099 (item_number_as_token_number): New.
20100 * src/output.c (GENERATE_OUTPUT_TABLE): New.
20101 Use it to create output_item_number_table and
20102 output_token_number_table.
20103 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
20104 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
20105 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
20106 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
20107
4f940944
AD
201082002-04-22 Akim Demaille <akim@epita.fr>
20109
20110 * src/output.h, src/output.c (get_lines_number): Remove.
20111
3ded9a63
AD
201122002-04-19 Akim Demaille <akim@epita.fr>
20113
20114 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
20115 as Lex/Flex'.
20116 (Debugging): More details about enabling the debugging features.
20117 (Table of Symbols): Describe $$, $n, @$, and @n.
20118 Suggested by Tim Josling.
20119
e0c471a9
AD
201202002-04-19 Akim Demaille <akim@epita.fr>
20121
20122 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
20123
fecc10cd
AD
201242002-04-10 Akim Demaille <akim@epita.fr>
20125
20126 * src/system.h: Rely on HAVE_LIMITS_H.
20127 Suggested by Paul Eggert.
20128
51dec47b
AD
201292002-04-09 Akim Demaille <akim@epita.fr>
20130
20131 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
20132 full stderr, and strip it according to the bison options, instead
20133 of composing the error message from different bits.
20134 This makes it easier to check for several error messages.
20135 Adjust all the invocations.
20136 Add an invocation exercising the error token.
20137 Add an invocation demonstrating a stupid error message.
20138 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
20139 Adjust the tests.
20140 Error message are for stderr, not stdout.
20141
007a50a4
AD
201422002-04-09 Akim Demaille <akim@epita.fr>
20143
20144 * src/gram.h, src/gram.c (error_token_number): Remove, use
20145 errtoken->number.
20146 * src/reader.c (reader): Don't specify the user token number (2)
20147 for $undefined, as it uselessly prevents using it.
20148 * src/gram.h (token_number_t): Move to...
20149 * src/symtab.h: here.
20150 (state_t.number): Is a token_number_t.
20151 * src/print.c, src/reader.c: Use undeftoken->number instead of
20152 hard coded 2.
20153 (Even though this 2 is not the same as above: the number of the
20154 undeftoken remains being 2, it is its user token number which
20155 might not be 2).
20156 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
20157 `user_token_number_max'.
20158 Output `undef_token_number'.
20159 * data/bison.simple, data/bison.c++: Use them.
20160 Be sure to map invalid yylex return values to
20161 `undef_token_number'. This saves us from gratuitous SEGV.
20162
20163 * tests/conflicts.at (Solved SR Conflicts)
20164 (Unresolved SR Conflicts): Adjust.
20165 * tests/regression.at (Web2c Actions): Adjust.
20166
06446ccf
AD
201672002-04-08 Akim Demaille <akim@epita.fr>
20168
20169 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
20170 Adding #line.
20171 Remove the duplicate `typedefs'.
20172 (RhsNumberType): Fix the declaration and various other typos.
20173 Use __ofile__.
20174 * data/bison.simple: Use __ofile__.
20175 * src/scan-skel.l: Handle __ofile__.
20176
62a3e4f0
AD
201772002-04-08 Akim Demaille <akim@epita.fr>
20178
20179 * src/gram.h (item_number_t): New, the type of item numbers in
20180 RITEM. Note that it must be able to code symbol numbers as
20181 positive number, and the negation of rule numbers as negative
20182 numbers.
20183 Adjust all dependencies (pretty many).
20184 * src/reduce.c (rule): Remove this `short *' pointer: use
20185 item_number_t.
20186 * src/system.h (MINSHORT, MAXSHORT): Remove.
20187 Include `limits.h'.
20188 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
20189 (shortcpy): Remove.
20190 (MAXTABLE): Move to...
20191 * src/output.c (MAXTABLE): here.
20192 (prepare_rules): Use output_int_table to output rhs.
20193 * data/bison.simple, data/bison.c++: Adjust.
20194 * tests/torture.at (Big triangle): Move the limit from 254 to
20195 500.
20196 * tests/regression.at (Web2c Actions): Ajust.
20197
20198 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
20199 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
20200 passes, but produces negative #line number, once fixed, GCC is
20201 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
20202 C), it passes.
20203 * src/state.h (state_h): Code input lines on ints, not shorts.
20204
bb88b0fc
AD
202052002-04-08 Akim Demaille <akim@epita.fr>
20206
20207 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
20208 and then the grammar.
20209
9a636f47
AD
202102002-04-08 Akim Demaille <akim@epita.fr>
20211
20212 * src/system.h: No longer using strndup.
20213
680e8701
AD
202142002-04-07 Akim Demaille <akim@epita.fr>
20215
20216 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
20217 * src/output.c (output_table_data): Return the longest number.
20218 (prepare_tokens): Output `token_number_max').
20219 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
20220 New.
20221 Use them to define yy_token_number_type/TokenNumberType.
20222 Use this type for yytranslate.
20223 * tests/torture.at (Big triangle): Push the limit from 124 to
20224 253.
20225 * tests/regression.at (Web2c Actions): Adjust.
20226
817e9f41
AD
202272002-04-07 Akim Demaille <akim@epita.fr>
20228
20229 * tests/torture.at (Big triangle): New.
20230 (GNU AWK Grammar, GNU Cim Grammar): Move to...
20231 * tests/existing.at: here.
20232
5123689b
AD
202332002-04-07 Akim Demaille <akim@epita.fr>
20234
20235 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
20236 nritems.
20237 Adjust dependencies.
20238
f3849179
AD
202392002-04-07 Akim Demaille <akim@epita.fr>
20240
20241 * src/reader.c: Normalize increments to prefix form.
20242
bd02036a
AD
202432002-04-07 Akim Demaille <akim@epita.fr>
20244
20245 * src/reader.c, symtab.c: Remove debugging code.
20246
db8837cb
AD
202472002-04-07 Akim Demaille <akim@epita.fr>
20248
20249 Rename all the `bucket's as `symbol_t'.
20250
20251 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
20252 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
20253 * src/symtab.c, src/symtab.h (bucket): Rename as...
20254 (symbol_t): this.
20255 (symbol_list_new, bucket_check_defined, bucket_make_alias)
20256 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
20257 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
20258 (buckets_new, buckets_free, buckets_do): Rename as...
20259 (symbol_list_new, symbol_check_defined, symbol_make_alias)
20260 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
20261 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
20262 (symbols_new, symbols_free, symbols_do): these.
20263
72a23c97
AD
202642002-04-07 Akim Demaille <akim@epita.fr>
20265
20266 Use lib/hash for the symbol table.
20267
20268 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
20269 EOF.
20270 * src/lex.c (lex): Set the `number' member of new terminals.
20271 * src/reader.c (bucket_check_defined, bucket_make_alias)
20272 (bucket_check_alias_consistence, bucket_translation): New.
20273 (reader, grammar_free, readgram, token_translations_init)
20274 (packsymbols): Adjust.
20275 (reader): Number the predefined tokens.
20276 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
20277 for predefined tokens.
20278 * src/symtab.h (bucket): Remove all the hash table related
20279 members.
20280 * src/symtab.c (symtab): Replace by...
20281 (bucket_table): this.
20282 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
20283 (buckets_new, buckets_do): New.
20284
280a38c3
AD
202852002-04-07 Akim Demaille <akim@epita.fr>
20286
20287 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
20288 (start_symbol, max_user_token_number, semantic_parser)
20289 (error_token_number): Initialize.
20290 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
20291 Initialize.
20292 (reader): Don't.
20293 (errtoken, eoftoken, undeftoken, axiom): Extern.
20294
03b31c0c
AD
202952002-04-07 Akim Demaille <akim@epita.fr>
20296
20297 * src/gram.h (rule_s): prec and precsym are now pointers
20298 to the bucket giving the priority/associativity.
20299 Member `associativity' removed: useless.
20300 * src/reduce.c, src/conflicts.c: Adjust.
20301
8b3df748
AD
203022002-04-07 Akim Demaille <akim@epita.fr>
20303
20304 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
20305 Properly escape the symbols' TAG when outputting them.
20306
e601aa1d
AD
203072002-04-07 Akim Demaille <akim@epita.fr>
20308
20309 * src/lalr.h (LA): Is a bitsetv, not bitset*.
20310
b0299a2e
AD
203112002-04-07 Akim Demaille <akim@epita.fr>
20312
20313 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
20314 (LArule): this, which is an array to rule_t*.
20315 * src/print.c, src/conflicts.c: Adjust.
20316
d7e1f00c
AD
203172002-04-07 Akim Demaille <akim@epita.fr>
20318
20319 * src/gram.h (rule_t): Rename `number' as `user_number'.
20320 `number' is a new member.
20321 Adjust dependencies.
20322 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
20323
cc9305dd
AD
203242002-04-07 Akim Demaille <akim@epita.fr>
20325
20326 As a result of the previous patch, it is no longer needed
20327 to reorder ritem itself.
20328
20329 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
20330
b0940840
AD
203312002-04-07 Akim Demaille <akim@epita.fr>
20332
20333 Be sure never to walk through RITEMS, but use only data related to
20334 the rules themselves. RITEMS should be banished.
20335
20336 * src/output.c (output_token_translations): Rename as...
20337 (prepare_tokens): this.
20338 In addition to `translate', prepare the muscles `tname' and
20339 `toknum', which were handled by...
20340 (output_rule_data): this.
20341 Remove, and move the remainder of its outputs into...
20342 (prepare_rules): this new routines, which also merges content from
20343 (output_gram): this.
20344 (prepare_rules): Be sure never to walk through RITEMS.
20345 (output_stos): Rename as...
20346 (prepare_stos): this.
20347 (output): Always invoke prepare_states, after all, just don't use it
20348 in the output if you don't need it.
20349
643a5994
AD
203502002-04-07 Akim Demaille <akim@epita.fr>
20351
20352 * src/LR0.c (new_state): Display `nstates' as the name of the
20353 newly created state.
20354 Adjust to initialize first_state and last_state if needed.
20355 Be sure to distinguish the initial from the final state.
20356 (new_states): Create the itemset of the initial state, and use
20357 new_state.
20358 * src/closure.c (closure): Now that the initial state has its
20359 items properly set, there is no need for a special case when
20360 creating `ruleset'.
20361
20362 As a result, now the rule 0, reducing to $axiom, is visible in the
20363 outputs. Adjust the test suite.
20364
20365 * tests/conflicts.at (Solved SR Conflicts)
20366 (Unresolved SR Conflicts): Adjust.
20367 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
20368 * tests/conflicts.at (S/R in initial): New.
20369
b4c4ccc2
AD
203702002-04-07 Akim Demaille <akim@epita.fr>
20371
20372 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
20373 the RHS of the rules.
20374 * src/output.c (output_gram): Likewise.
20375
bba97eb2
AD
203762002-04-07 Akim Demaille <akim@epita.fr>
20377
20378 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
20379 bucket.
20380 Adjust all dependencies.
20381 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
20382 `number' of the buckets too.
20383 * src/gram.h: Include `symtab.h'.
20384 (associativity): Move to...
20385 * src/symtab.h: here.
20386 No longer include `gram.h'.
20387
c3b407f4
AD
203882002-04-07 Akim Demaille <akim@epita.fr>
20389
20390 * src/gram.h, src/gram.c (rules_rhs_length): New.
20391 (ritem_longest_rhs): Use it.
20392 * src/gram.h (rule_t): `number' is a new member.
20393 * src/reader.c (packgram): Set it.
20394 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
20395 the end of `rules', and count them out of `nrules'.
20396 (reduce_output, dump_grammar): Adjust.
20397 * src/print.c (print_grammar): It is no longer needed to check for
20398 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
20399 * tests/reduce.at (Reduced Automaton): New test.
20400
11652ab3
AD
204012002-04-07 Akim Demaille <akim@epita.fr>
20402
20403 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
20404 lacking `+ 1' to nrules, Bison reported as useless a token if it
20405 was used solely to set the precedence of the last rule...
20406
26b23c1a
AD
204072002-04-07 Akim Demaille <akim@epita.fr>
20408
20409 * data/bison.c++, data/bison.simple: Don't output the current file
20410 name in #line, to avoid useless diffs between two identical
20411 outputs under different names.
20412
18bcecb0
AD
204132002-04-07 Akim Demaille <akim@epita.fr>
20414
20415 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
20416 Normalize loops to using `< nrules + 1', not `<= nrules'.
20417
fa770c86
AD
204182002-04-07 Akim Demaille <akim@epita.fr>
20419
20420 * TODO: Update.
20421
d9b739c3
AD
204222002-04-07 Akim Demaille <akim@epita.fr>
20423
20424 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
20425 bucket.value as bucket.number.
20426
99013900
AD
204272002-04-07 Akim Demaille <akim@epita.fr>
20428
20429 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
20430 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
20431 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
20432 RHS, instead of being an index in RITEMS.
20433
e966383b
PE
204342002-04-04 Paul Eggert <eggert@twinsun.com>
20435
20436 * doc/bison.texinfo: Update copyright date.
20437 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
20438 (Symbols): Warn about running Bison in one character set,
20439 but compiling and/or running in an incompatible one.
20440 Warn about character code 256, too.
20441
204422002-04-03 Paul Eggert <eggert@twinsun.com>
20443
20444 * src/bison.data (YYSTACK_ALLOC): Depend on whether
20445 YYERROR_VERBOSE is nonzero, not whether it is defined.
20446
20447 Merge changes from bison-1_29-branch.
c307773e 20448
8d6c48b9
PE
204492002-03-20 Paul Eggert <eggert@twinsun.com>
20450
20451 Merge fixes from Debian bison_1.34-1.diff.
20452
20453 * configure.in (AC_PREREQ): 2.53.
20454
e53c6322
AD
204552002-03-20 Akim Demaille <akim@epita.fr>
20456
20457 * src/conflicts.c (log_resolution): Argument `resolution' is const.
20458
9ffbeca7
PE
204592002-03-19 Paul Eggert <eggert@twinsun.com>
20460
21db0b2a
PE
20461 * src/bison.simple (YYCOPY): New macro.
20462 (YYSTACK_RELOCATE): Use it.
20463 Remove Type arg; no longer needed. All callers changed.
20464 (yymemcpy): Remove; no longer needed.
20465
9ffbeca7
PE
20466 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
20467 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
20468
642cb8f8
AD
204692002-03-19 Akim Demaille <akim@epita.fr>
20470
20471 Test and fix the #line outputs.
20472
20473 * tests/atlocal.at (GCC): New.
20474 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 20475 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
20476 (Action synch line, Epilogue synch line): New tests.
20477 * src/reader.c (parse_union_decl): Define the muscle stype_line.
20478 * data/bison.simple, data/bison.c++: Use it.
20479
3c31a486
AD
204802002-03-19 Akim Demaille <akim@epita.fr>
20481
20482 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
20483 (Solved SR Conflicts, %expect not enough, %expect right)
20484 (%expect too much): Move to...
20485 * tests/conflicts.at: this new file.
20486
0d8bed56
AD
204872002-03-19 Akim Demaille <akim@epita.fr>
20488
20489 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
20490 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
20491 that we can move to enums for instance.
20492 * src/output.c (token_definitions_output): Output a list of
20493 `token-name, token-number' instead of the #define.
20494 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
20495
9208d17f
AD
204962002-03-14 Akim Demaille <akim@epita.fr>
20497
20498 Use Gettext 0.11.1.
20499
af27eacb
RA
205002002-03-09 Robert Anisko <robert@lrde.epita.fr>
20501
20502 * data/bison.c++: Make the user able to add members to the generated
20503 parser by subclassing.
20504
9101a310
RA
205052002-03-05 Robert Anisko <robert@lrde.epita.fr>
20506
20507 * src/reader.c (read_additionnal_code): `c' should be an integer, not
20508 a character.
20509 Reported by Nicolas Tisserand and Nicolas Burrus.
20510
fff9bf0b
RA
205112002-03-04 Robert Anisko <robert@lrde.epita.fr>
20512
20513 * src/reader.c: Warn about lacking semi-colons, do not complain.
20514
64dba31e
RA
205152002-03-04 Robert Anisko <robert@lrde.epita.fr>
20516
20517 * data/bison.c++: Remove a debug line.
20518
374f5a14
RA
205192002-03-04 Robert Anisko <robert@lrde.epita.fr>
20520
20521 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
20522 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
20523 provide a default implementation.
20524
bfcf1f3a
AD
205252002-03-04 Akim Demaille <akim@epita.fr>
20526
20527 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
20528 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
20529 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
20530 * tests/semantic.at (Parsing Guards): Similarly.
20531 * src/reader.at (readgram): Complain if the last rule is not ended
20532 with a semi-colon.
20533
65ccf9fc
AD
205342002-03-04 Akim Demaille <akim@epita.fr>
20535
20536 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
20537 * src/closure.c: here.
20538 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
20539 RTC.
20540 * src/warshall.h, src/warshall.c: Remove.
20541 * tests/sets.at (Broken Closure): Adjust.
20542
d0039cbc
AD
205432002-03-04 Akim Demaille <akim@epita.fr>
20544
20545 * src/output.c (output_skeleton): tempdir is const.
20546 bytes_read is unused.
20547
345cea78
AD
205482002-03-04 Akim Demaille <akim@epita.fr>
20549
20550 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
20551 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
20552 Update.
20553 From Michael Hayes.
20554
564801f7
AD
205552002-03-04 Akim Demaille <akim@epita.fr>
20556
20557 * src/closure.c (closure): `r' is unused.
20558
e5352bc7
AD
205592002-03-04 Akim Demaille <akim@epita.fr>
20560
20561 * tests/sets.at (Broken Closure): Add the ending `;'.
20562 * src/reader.at (readgram): Complain if a rule is not ended with a
20563 semi-colon.
20564
914feea9
AD
205652002-03-04 Akim Demaille <akim@epita.fr>
20566
20567 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
20568 (count_sr_conflicts): Use bitset_count.
20569 * src/reduce.c (inaccessable_symbols): Ditto.
20570 (bits_size): Remove.
20571 * src/warshall.h, src/warshall.c: Convert to bitsetv.
20572
f0250de6
AD
205732002-03-04 Akim Demaille <akim@epita.fr>
20574
20575 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
20576 * src/reduce.c: Remove the `bitset_zero's following the
20577 `bitset_create's, as now it is performed by the latter.
20578
ef017502
AD
205792002-03-04 Akim Demaille <akim@epita.fr>
20580
20581 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
20582 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
20583 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
20584 latest sources from Michael.
20585
76514394
AD
205862002-03-04 Akim Demaille <akim@epita.fr>
20587
20588 * src/output.c (output): Don't free the grammar.
20589 * src/reader.c (grammar_free): New.
20590 * src/main.c (main): Call it and don't free symtab here.
20591
55024580
AD
205922002-03-04 Akim Demaille <akim@epita.fr>
20593
20594 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
20595 before returning.
20596 Reported by Benoit Perrot.
20597
f9abaa2c
AD
205982002-03-04 Akim Demaille <akim@epita.fr>
20599
20600 Use bitset operations when possible, not loops over bits.
20601
20602 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
20603 bitset_or.
20604 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
20605 * src/reduce.c (useless_nonterminals): Formatting changes.
20606 * src/warshall.c (TC): Use bitset_or.
20607
0e721e75
AD
206082002-03-04 Akim Demaille <akim@epita.fr>
20609
20610 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
20611 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
20612 Ditto.
20613
0fb1ffb1
AD
206142002-03-04 Akim Demaille <akim@epita.fr>
20615
20616 * src/lalr.c (F): Now a bitset*.
20617 Adjust all dependencies.
20618
b86796bf
AD
206192002-03-04 Akim Demaille <akim@epita.fr>
20620
20621 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
20622 Adjust all dependencies.
20623
602bbf31
AD
206242002-03-04 Akim Demaille <akim@epita.fr>
20625
20626 * src/L0.c, src/LR0.h (nstates): Be size_t.
20627 Adjust comparisons (signed vs unsigned).
20628 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
20629 bitset*.
20630 Adjust all dependencies.
20631
d8a0245c
AD
206322002-03-04 Akim Demaille <akim@epita.fr>
20633
20634 * src/closure.c (firsts): Now, also a bitset.
20635 Adjust all dependencies.
20636 (varsetsize): Remove, now unused.
20637 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
20638
34ba9743
AD
206392002-03-04 Akim Demaille <akim@epita.fr>
20640
20641 * src/print.c: Convert to use bitset.h, not hand coded iterations
20642 over ints.
20643
ed86e78c
AD
206442002-03-04 Akim Demaille <akim@epita.fr>
20645
20646 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
20647
dfdb1797
AD
206482002-03-04 Akim Demaille <akim@epita.fr>
20649
20650 * src/closure.c (ruleset): Be a bitset.
20651 (rulesetsize): Remove.
20652
7086e707
AD
206532002-03-04 Akim Demaille <akim@epita.fr>
20654
20655 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
20656 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
20657 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
20658 * src/closure.c (fderives): Be an array of bitsets.
20659
98254360
RA
206602002-02-28 Robert Anisko <robert@lrde.epita.fr>
20661
20662 * data/bison.c++: Merge the two generated headers. Insert a copyright
20663 notice in each output file.
20664
a75c057f
AD
206652002-02-28 Akim Demaille <akim@epita.fr>
20666
20667 * data/bison.c++: Copy the prologue of bison.simple to fetch
20668 useful M4 definitions, such as b4_header_guard.
20669
06b00abc
AD
206702002-02-25 Akim Demaille <akim@epita.fr>
20671
20672 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
20673 translator friendly scheme for the bgr
20674 copyright notice.
06b00abc 20675
70e7d534
AD
206762002-02-25 Akim Demaille <akim@epita.fr>
20677
20678 * src/output.c (header_output): Remove, now handled completely via
20679 M4.
20680
abe017f6
AD
206812002-02-25 Akim Demaille <akim@epita.fr>
20682
20683 * m4/m4.m4: New, from CVS Autoconf.
20684 * configure.in: Invoke it.
20685 * src/output.c (output_skeleton): Use its result instead of the
20686 hard coded name.
20687
381fb12e
AD
206882002-02-25 Akim Demaille <akim@epita.fr>
20689
20690 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
20691 Fileutils 4.1.5.
20692 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
20693 * src/output.c (output_skeleton): Use mkstemp to create a real
20694 temporary file.
20695 Move the filling of `skeleton' and its muscle to...
20696 (prepare): here.
20697 (output): Move the definition of the prologue muscle to...
20698 (prepare): here.
20699 * src/system.h (DEFAULT_TMPDIR): New.
20700
6f38107f
PE
207012002-02-14 Paul Eggert <eggert@twinsun.com>
20702
20703 Remove the support for C++ namespace cleanliness; it was
20704 causing more problems than it was curing, since it didn't work
20705 properly on some nonstandard C++ compilers. This can wait
20706 for a proper C++ parser.
20707
20708 * NEWS: Document this.
20709 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
20710 of C++, as it's treated like C now.
20711 * src/bison.simple (YYSTD): Remove.
20712 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
20713 Treat C++ just like Standard C instead of trying to support
20714 namespace cleanliness.
20715
80cce3da
AD
207162002-02-14 Akim Demaille <akim@epita.fr>
20717
20718 * tests/regression.at (else): Adjust to Andreas' change.
20719
842e8679
AD
207202002-02-14 Akim Demaille <akim@epita.fr>
20721
20722 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
20723
4bda3f10
AD
207242002-02-13 Andreas Schwab <schwab@suse.de>
20725
20726 * src/output.c (output_rule_data): Don't output NULL, it might
20727 not be defined yet.
20728
4162fa07 207292002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 20730
4162fa07
RA
20731 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
20732 (Copyright notice): Update.
b418ecd8 20733
bd16a5dc
AD
207342002-02-11 Akim Demaille <akim@epita.fr>
20735
20736 * tests/regression.at (%nonassoc and eof): Don't include
20737 nonportable headers.
20738
8d69a1a3
RA
207392002-02-08 Robert Anisko <robert@lrde.epita.fr>
20740
20741 * data/bison.c++: Correct error recovery. Make the user able to
20742 initialize the starting location.
20743
9b2d0677
AD
207442002-02-07 Akim Demaille <akim@epita.fr>
20745
20746 * tests/input.at: New.
20747
69e2658b
RA
207482002-02-07 Robert Anisko <robert@lrde.epita.fr>
20749
20750 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 20751 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
20752 directives around tables only needed for debugging.
20753
4aacc3a7
RA
207542002-02-07 Robert Anisko <robert@lrde.epita.fr>
20755
20756 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
20757 C++ parsers.
20758 (yy::b4_name::parse): Use print_.
20759
762a801e
RA
207602002-02-07 Robert Anisko <robert@lrde.epita.fr>
20761
20762 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
20763
4bb2bc3f
RA
207642002-02-07 Robert Anisko <robert@lrde.epita.fr>
20765
20766 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
20767 C++ parsers.
20768 (yy::b4_name::parse): Build verbose error messages, and use error_.
20769
6b45a3ca
RA
207702002-02-06 Robert Anisko <robert@lrde.epita.fr>
20771
20772 * data/bison.c++: Fix m4 quoting in comments.
20773
50997c6e
RA
207742002-02-06 Robert Anisko <robert@lrde.epita.fr>
20775
20776 * data/bison.c++: Adjust the parser code. Fix some muscles that were
20777 not expanded by m4.
20778
3f3eed27
AD
207792002-02-05 Akim Demaille <akim@epita.fr>
20780
20781 * data/bison.c++: Adjust to the M4 back end.
20782 More is certainly needed.
20783
be2a1a68
AD
207842002-02-05 Akim Demaille <akim@epita.fr>
20785
20786 Give a try to M4 as a back end.
20787
20788 * lib/readpipe.c: New, from wdiff.
20789 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
20790 BISON_HAIRY.
20791 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
20792 specific values. Now it is m4 that performs the lookup.
20793 * src/parse-skel.y: Remove.
20794 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
20795 * src/output.c (actions_output, guards_output)
20796 (token_definitions_output): No longer keeps track of the output
20797 line number, hence remove the second argument.
20798 (guards_output): Check against the guard member of a rule, not the
20799 action member.
20800 Adjust callers.
20801 (output_skeleton): Don't look for the skeleton location, let m4 do
20802 that.
20803 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
20804 file will be used.
20805 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
20806 (prepare): Given that for the time being changesyntax is not
20807 usable in M4, rename the muscles using `-' to `_'.
20808 Define `defines_flag', `output_parser_name' and `output_header_name'.
20809 * src/output.h (actions_output, guards_output)
20810 (token_definitions_output): Adjust prototypes.
20811 * src/scan-skel.l: Instead of scanning the skeletons, it now
20812 processes the output of m4: `__oline__' and `#output'.
20813 * data/bison.simple: Adjust to be used by M4(sugar).
20814 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
20815 to date.
20816 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
20817 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
20818 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
20819 shamelessly stolen from CVS Autoconf.
20820
beda758b
AD
208212002-02-05 Akim Demaille <akim@epita.fr>
20822
20823 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
20824 * configure.in: Check for the declarations of free and malloc.
20825 * src/muscle_tab.c: Adjust.
20826
5ece6d43
AD
208272002-02-05 Akim Demaille <akim@epita.fr>
20828
20829 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
20830 which have no values.
20831
5bb18f9a
AD
208322002-02-05 Akim Demaille <akim@epita.fr>
20833
20834 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
20835 * data/: here.
20836
894dd62e
PE
208372002-01-29 Paul Eggert <eggert@twinsun.com>
20838
20839 * src/bison.simple (YYSIZE_T): Do not define merely because
20840 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
20841 On some platforms, <alloca.h> does not declare YYSTD (size_t).
20842
82841af7
AD
208432002-01-27 Akim Demaille <akim@epita.fr>
20844
20845 Fix `%nonassoc and eof'.
20846
20847 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
20848 which were not properly copied! Replace
20849 memcpy (res->errs, src->errs, src->nerrs);
20850 with
20851 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
20852 !!!
20853 * tests/regression.at (%nonassoc and eof): Adjust to newest
20854 Autotest: `.' is not in the PATH.
20855
318b76e9
AD
208562002-01-27 Akim Demaille <akim@epita.fr>
20857
20858 * tests/sets.at (AT_EXTRACT_SETS): New.
20859 (Nullable): Use it.
20860 (Firsts): New.
20861
30d2f3d5
AD
208622002-01-26 Akim Demaille <akim@epita.fr>
20863
20864 * tests/actions.at, tests/calc.at, tests/headers.at,
20865 * tests/torture.at: Adjust to the newest Autotest which no longer
20866 forces `.' in the PATH.
20867
30f8c395
AD
208682002-01-25 Akim Demaille <akim@epita.fr>
20869
20870 * tests/regression.at (%nonassoc and eof): New.
20871 Suggested by Robert Anisko.
20872
29ae55f1
AD
208732002-01-24 Akim Demaille <akim@epita.fr>
20874
20875 Bison dumps core when trying to complain about broken input files.
20876 Reported by Cris van Pelt.
20877
20878 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
20879 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
20880 into...
20881 (Invalid inputs): Strengthen: exercise parse_percent_token.
20882
2b548aa6
RA
208832002-01-24 Robert Anisko <robert.anisko@epita.fr>
20884
20885 * src/Makefile.am: Add bison.c++.
20886 * src/bison.c++: New skeleton.
20887
bb0146c2
AD
208882002-01-21 Paolo Bonzini <bonzini@gnu.org>
20889
20890 * po/it.po: New.
20891
bec30531
AD
208922002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
20893
20894 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
20895
fc6edc45
MA
208962002-01-20 Marc Autret <marc@gnu.org>
20897
20898 * src/files.c (compute_output_file_names): Fix
20899
5e5d5415
MA
209002002-01-20 Marc Autret <marc@gnu.org>
20901
20902 * tests/output.at: New test.
20903 * src/files.c (compute_base_names): Don't map extensions when
20904 the YACC flag is set, use defaults.
20905 Reported by Evgeny Stambulchik.
20906
44ea3fbd
MA
209072002-01-20 Marc Autret <marc@gnu.org>
20908
ba0fe3c7
PE
20909 * src/system.h: Need to define __attribute__ away for non-GCC
20910 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
20911 Suggested by Albert Chin-A-Young.
20912
338963d1
TVH
209132002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
20914
20915 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
20916 canonical definition.
20917 * src/system.h: Use the canonical definition for PARAMS (avoids
20918 a conflict with the macro from lib/hash.h).
20919
c57b2479
AD
209202002-01-11 Akim Demaille <akim@epita.fr>
20921
20922 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 20923 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 20924
b85810ae
AD
209252002-01-09 Akim Demaille <akim@epita.fr>
20926
20927 * src/files.c, src/files.h (output_infix): New.
20928 (tab_extension): Remove.
20929 (compute_base_names): Compute the former, drop the latter.
20930 * src/output.c (prepare): Insert the muscles `output-infix', and
20931 `output-suffix'.
20932 * src/parse-skel.y (string, string.1): New.
20933 (section.header): Use it.
20934 (section.yacc): Remove.
20935 (prefix): Remove too.
20936 * src/scan-skel.l: Adjust.
20937 * src/bison.simple, src/bison.hairy: Adjust.
20938
cae60122
AD
209392002-01-09 Akim Demaille <akim@epita.fr>
20940
20941 * configure.in (WERROR_CFLAGS): Compute it.
20942 * src/Makefile.am (CFLAGS): Pass it.
20943 * tests/atlocal.in (CFLAGS): Idem.
20944 * src/files.c: Fix a few warnings.
20945 (get_extension_index): Remove, unused.
20946
ae404801
AD
209472002-01-08 Akim Demaille <akim@epita.fr>
20948
20949 * src/getargs.c (AS_FILE_NAME): New.
20950 (getargs): Use it to convert DOSish file names.
20951 * src/files.c (base_name): Rename as full_base_name to avoid
20952 clashes with `base_name ()'.
20953 (filename_split): New.
20954 (compute_base_names): N-th rewrite, using filename_split.
20955
22312b71
AD
209562002-01-08 Akim Demaille <akim@epita.fr>
20957
20958 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
20959 New, stolen from the Fileutils 4.1.
20960 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
20961 * configure.in: Check for the presence of memrchr, and of its
20962 prototype.
20963
a67cef01
TVH
209642002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
20965
20966 * lib/hash.h (__P): Added definition for this macro.
20967 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
20968 BUILT_SOURCES, to ensure they are generated first.
20969 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
20970 %error-verbose to allow bootstrapping with bison 1.30x.
20971
2b25d624
AD
209722002-01-06 Akim Demaille <akim@epita.fr>
20973
20974 * src/reader.c (parse_braces): Don't fetch the next char, the
20975 convention is to fetch on entry.
20976 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
20977 'switch' without a following semicolon.
20978 * tests/regression.at (braces parsing): New.
20979
3460813b
AD
209802002-01-06 Akim Demaille <akim@epita.fr>
20981
20982 Bison is dead wrong in its RR conflict reports.
20983
20984 * tests/torture.at (GNU Cim Grammar): New.
20985 * src/conflicts.c (count_rr_conflicts): Fix.
20986
73784c64
AD
209872002-01-06 Akim Demaille <akim@epita.fr>
20988
20989 Creating package.m4 from configure.ac causes too many problems.
20990
20991 * tests/Makefile.am (package.m4): Create it by hand,
20992 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
20993
25d81090
AD
209942002-01-06 Akim Demaille <akim@epita.fr>
20995
20996 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
20997 skeleton.h.
20998
a9b8959e
PE
209992002-01-04 Paul Eggert <eggert@twinsun.com>
21000
21001 * doc/bison.texinfo (Debugging):
21002 Remove YYSTDERR; it's no longer defined or used.
21003 Also, s/cstdio.h/cstdio/.
21004
25d81090
AD
210052002-01-03 Akim Demaille <akim@epita.fr>
21006
21007 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
21008
1109455c
AD
210092002-01-03 Akim Demaille <akim@epita.fr>
21010
21011 * src/parse-skel.y (process_skeleton): Don't bind the parser's
21012 tracing code to --trace, wait for a better --trace option, with
21013 args.
21014
7ea5e977
AD
210152002-01-03 Akim Demaille <akim@epita.fr>
21016
21017 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
21018 The ISO C++ standard is extremely clear about it: stderr is
21019 considered a macro, not a regular symbol (see table 94 `Header
21020 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
21021 Therefore std:: does not apply to it. It still does with fprintf.
21022 Also, s/cstdio.h/cstdio/.
21023
fab5b110
AD
210242002-01-03 Akim Demaille <akim@epita.fr>
21025
21026 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
21027 for non system headers.
21028
aed7fd9b
AD
210292002-01-02 Akim Demaille <akim@epita.fr>
21030
21031 Equip the skeleton chain with location tracking, runtime trace,
21032 pure parser and scanner.
21033
21034 * src/parse-skel.y: Request a pure parser, locations, and prefix
21035 renaming.
21036 (%union): Having several members with the same type does not help
21037 type mismatches, simplify.
21038 (YYPRINT, yyprint): New.
21039 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
21040 (skel_error): this.
21041 Handle locations.
21042 * src/scan-skel.l: Adjust to these changes.
21043 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
21044 (LOCATION_PRINT, skel_control_t): New.
21045
24fad99e
AD
210462001-12-30 Akim Demaille <akim@epita.fr>
21047
21048 * src/parse-skel.y: Get rid of the shift/reduce conflict:
21049 replace `gb' with BLANKS.
21050 * src/scan-skel.l: Adjust.
21051
a4b36db4
AD
210522001-12-30 Akim Demaille <akim@epita.fr>
21053
21054 * src/system.h: We don't need nor want bcopy.
21055 Throw away MS-DOS crap: we don't need getpid.
21056 * configure.in: We don't need strndup. It was even causing
21057 problems: because Flex includes the headers *before* us,
21058 _GNU_SOURCE is not defined by config.h, and therefore strndup was
21059 not visible.
21060 * lib/xstrndup.c: New.
21061 * src/scan-skel.l: Use it.
21062 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
21063 * src/parse-skel.y: Use %directives instead of #defines.
21064
1239777d
AD
210652001-12-30 Akim Demaille <akim@epita.fr>
21066
21067 * src/skeleton.h: New.
21068 * src/output.c (output_parser, output_master_parser): Remove, dead
21069 code.
21070 * src/output.h (get_lines_number, actions_output, guards_output)
21071 (token_definitions_output): Prototype them.
21072 * src/parse-skel.y: Add the license notice.
21073 Include output.h and skeleton.h.
21074 (process_skeleton): Returns void, and takes a single parameter.
21075 * src/scan-skel.l: Add the license notice.
21076 Include skeleton.h.
21077 Don't use %option yylineno: it seems that then Flex imagines
21078 REJECT has been used, and therefore it won't reallocate its
21079 buffers (which makes no other sense to me than a bug). It results
21080 in warnings for `unused: yy_flex_realloc'.
21081
9b3add5b
RA
210822001-12-30 Robert Anisko <robert.anisko@epita.fr>
21083
21084 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
21085 (MUSCLE_INSERT_PREFIX): ...to there.
21086 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
21087 (MUSCLE_INSERT_PREFIX): Move from here...
21088
21089 * src/bison.hairy: Add a section directive. Put braces around muscle
21090 names. This parser skeleton is still broken, but Bison should not
21091 choke on a bad muscle 'syntax'.
21092 * src/bison.simple: Add a section directive. Put braces around muscle
21093 names.
21094
21095 * src/files.h (strsuffix, stringappend): Add declarations.
21096 (tab_extension): Add declaration.
21097 (short_base_name): Add declaration.
21098
21099 * src/files.c (strsuffix, stringappend): No longer static. These
21100 functions are used in the skeleton parser.
21101 (tab_extension): New.
21102 (compute_base_names): Use the computations done in this function
fab5b110 21103 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
21104 names.
21105 (short_base_name): No longer static.
21106
21107 * src/output.c (output_skeleton): New.
21108 (output): Disable call to output_master_parser, and give a try to
21109 a new skeleton handling system.
21110 (guards_output, actions_output): No longer static.
21111 (token_definitions_output, get_lines_number): No longer static.
21112
21113 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
21114
fab5b110 21115 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
21116 parse-skel.y.
21117
21118 * src/parse-skel.y: New file.
21119 * src/scan-skel.l: New file.
21120
b5b61c61
AD
211212001-12-29 Akim Demaille <akim@epita.fr>
21122
21123 %name-prefix is broken.
21124
21125 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
21126 Adjust all dependencies.
21127 * tests/headers.at (export YYLTYPE): Strengthen this test: use
21128 %name-prefix.
21129
21130 Renaming yylval but not yylloc is not consistent. Now we do.
21131
21132 * src/bison.simple: Prefix yylloc if used.
21133 * doc/bison.texinfo (Decl Summary): Document that.
21134
8c9a50be
AD
211352001-12-29 Akim Demaille <akim@epita.fr>
21136
21137 * doc/bison.texinfo: Promote `%long-directive' over
21138 `%long_directive'.
21139 Remove all references to fixed-output-files, yacc is enough.
21140
d99361e6
AD
211412001-12-29 Akim Demaille <akim@epita.fr>
21142
21143 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
21144 user prologue. These are defaults.
21145 * tests/actions.at (Mid-rule actions): Make sure the user can
21146 define YYDEBUG and YYERROR_VERBOSE.
21147
b9cecb91
AD
211482001-12-29 Akim Demaille <akim@epita.fr>
21149
21150 * src/output.c (header_output): Don't forget to export YYLTYPE and
21151 yylloc.
21152 * tests/headers.at (export YYLTYPE): New, make sure it does.
21153 * tests/regression.at (%union and --defines, Invalid CPP headers):
21154 Move to...
21155 * tests/headers.at: here.
21156
aea13e97
AD
211572001-12-29 Akim Demaille <akim@epita.fr>
21158
21159 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
21160
931394cb
AD
211612001-12-29 Akim Demaille <akim@epita.fr>
21162
21163 * tests/actions.at (Mid-rule actions): Output on a single line
21164 instead of several.
21165
704a47c4
AD
211662001-12-29 Akim Demaille <akim@epita.fr>
21167
21168 * doc/bison.texinfo: Formatting changes.
21169
091e20bb
AD
211702001-12-29 Akim Demaille <akim@epita.fr>
21171
21172 Don't store the token defs in a muscle, just be ready to output it
21173 on command. Now possible via `symbols'. Fixes a memory leak.
21174
21175 * src/output.c (token_definitions_output): New.
21176 (output_parser, header_output): Use it.
21177 * src/reader.c (symbols_save): Remove.
21178
cce71710
AD
211792001-12-29 Akim Demaille <akim@epita.fr>
21180
21181 * src/bison.simple: Do not provide a default for YYSTYPE and
21182 YYLTYPE before the user's prologue. Otherwise it's hardly... a
21183 default.
21184
82c035a8
AD
211852001-12-29 Akim Demaille <akim@epita.fr>
21186
21187 Mid-rule actions are simply... ignored!
21188
21189 * src/reader.c (readgram): Be sure to attach mid-rule actions to
21190 the empty-rule associated to the dummy symbol, not to the host
21191 rule.
21192 * tests/actions.at (Mid-rule actions): New.
21193
8419d367
AD
211942001-12-29 Akim Demaille <akim@epita.fr>
21195
21196 Memory leak.
21197
21198 * src/reader.c (reader): Free grammar.
21199
375d5806
AD
212002001-12-29 Akim Demaille <akim@epita.fr>
21201
21202 Memory leak.
21203
21204 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
21205 since it allocates it for each state, although only one is needed.
21206 (allocate_storage): Do it here.
21207
f51cb8ff
AD
212082001-12-29 Akim Demaille <akim@epita.fr>
21209
21210 * src/options.h, src/options.c (create_long_option_table): Rename
21211 as...
21212 (long_option_table_new): this, with a clearer prototype.
21213 (percent_table): Remove, unused,
21214 * src/getargs.c (getargs): Adjust.
21215
29e88316
AD
212162001-12-29 Akim Demaille <akim@epita.fr>
21217
21218 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
21219 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
21220 as states.
21221
b9f71f19
AD
212222001-12-29 Akim Demaille <akim@epita.fr>
21223
21224 * src/lalr.c (build_relations): Rename `states' as `states1'.
21225 Sorry, I don't understand exactly what it is, no better name...
21226
1a2b5d37
AD
212272001-12-29 Akim Demaille <akim@epita.fr>
21228
21229 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
21230 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
21231 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
21232 as rules.
21233
1cca533e
AD
212342001-12-29 Akim Demaille <akim@epita.fr>
21235
21236 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
21237 ago.
21238
c03ae966
AD
212392001-12-29 Akim Demaille <akim@epita.fr>
21240
21241 * src/reader.c, src/reader.h (user_toknums): Remove.
21242 Adjust all users to use symbols[i]->user_token_number.
21243
5a670b1e
AD
212442001-12-29 Akim Demaille <akim@epita.fr>
21245
21246 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
21247 Adjust all users to use symbols[i]->prec or ->assoc.
21248
ad949da9
AD
212492001-12-29 Akim Demaille <akim@epita.fr>
21250
21251 * src/reader.c, src/reader.h (tags): Remove.
21252 Adjust all users to use symbols[i]->tag.
21253
0e78e603
AD
212542001-12-29 Akim Demaille <akim@epita.fr>
21255
21256 * src/gram.h, src/gram.c (symbols): New, similar to state_table
21257 and rule_table.
21258 * src/reader.c (packsymbols): Fill this table.
21259 Drop sprec.
21260 * src/conflicts.c (resolve_sr_conflict): Adjust.
21261 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
21262 single table.
21263 Use symbols[i]->tag instead of tags[i].
21264
213e640e
AD
212652001-12-29 Akim Demaille <akim@epita.fr>
21266
21267 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
21268 In addition, put a comment in there, to replace...
21269 * tests/regression.at (%union and C comments): Remove.
21270
e7b8bef1
AD
212712001-12-29 Akim Demaille <akim@epita.fr>
21272
21273 * tests/regression.at (Web2c Actions): Blindly move the actual
21274 output as expected output. The contents *seem* right to me, but I
21275 can't pretend reading perfectly parser tables... Nonetheless, all
21276 the other tests pass correctly, the table look OK, even though the
21277 presence of `$axiom' is to be noted: AFAICS it is useless (but
21278 harmless).
21279
b68e7744
AD
212802001-12-29 Akim Demaille <akim@epita.fr>
21281
21282 * src/reader.c (readgram): Don't add the rule 0 if there were no
21283 rules read. In other words, add it _after_ having performed
21284 grammar sanity checks.
21285 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
21286
78d5bae9
AD
212872001-12-29 Akim Demaille <akim@epita.fr>
21288
21289 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
21290 visible, and some states have now a different number.
21291
ff442794
AD
212922001-12-29 Akim Demaille <akim@epita.fr>
21293
21294 * src/reader.c (readgram): Bind the initial rule's lineno to that
21295 of the first rule.
21296 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
21297 (Solved SR Conflicts): Adjust rule 0's line number.
21298
610ab194
AD
212992001-12-29 Akim Demaille <akim@epita.fr>
21300
21301 Fix the `GAWK Grammar' failure.
21302
21303 * src/LR0.c (final_state): Initialize to -1 so that we do compute
21304 the reductions of the first state which was mistakenly confused
21305 with the final state because precisely final_state was initialized
21306 to 0.
21307 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
21308 now noticed by Bison.
21309 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
21310 have a reduction on $default.
21311
29d29c8f
AD
213122001-12-29 Akim Demaille <akim@epita.fr>
21313
21314 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
21315 rule line numbers.
21316 * src/closure.c (print_closure): Likewise.
21317 * src/derives.c (print_derives): Likewise.
21318 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
21319 now.
21320
7c6b64d0
AD
213212001-12-29 Akim Demaille <akim@epita.fr>
21322
21323 * src/lalr.c (lookaheads_print): New.
21324 (lalr): Call it when --trace-flag.
21325 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
21326 are dumped.
21327
3d4daee3
AD
213282001-12-29 Akim Demaille <akim@epita.fr>
21329
21330 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
21331 when walking through ritem, even via rule->rhs.
21332 * src/reduce.c (dump_grammar, useful_production, reduce_output)
21333 (useful_production, useless_nonterminals): Likewise.
21334 (reduce_grammar_tables): Likewise, plus update nritems.
21335 * src/nullable.c (set_nullable): Likewise.
21336 * src/lalr.c (build_relations): Likewise.
21337 * tests/sets.at (Nullable): Adjust.
21338 Fortunately, now, the $axiom is no longer nullable.
21339
9e7f6bbd
AD
213402001-12-29 Akim Demaille <akim@epita.fr>
21341
21342 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
21343 the 0-sentinel.
21344 * src/gram.c (ritem_longest_rhs): Likewise.
21345 * src/reduce.c (nonterminals_reduce): Likewise.
21346 * src/print_graph.c (print_graph): Likewise.
21347 * src/output.c (output_rule_data): Likewise.
21348 * src/nullable.c (set_nullable): Likewise.
21349
255ef638
AD
213502001-12-29 Akim Demaille <akim@epita.fr>
21351
21352 * src/output.c: Comment changes.
21353
0d8a7363
AD
213542001-12-27 Paul Eggert <eggert@twinsun.com>
21355
21356 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
21357 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
21358 Sparc, as they were causing more porting problems than the
21359 (minor) performance improvement was worth.
21360
21361 Also, catch up with 1.31's YYSTD.
21362
3db472b9
AD
213632001-12-27 Akim Demaille <akim@epita.fr>
21364
21365 * src/output.c (output_gram): Rely on nritems, not the
21366 0-sentinel. See below.
21367 Use -1 as separator, not 0.
21368 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
21369 Rely on -1 as separator in yyrhs, instead of 0.
21370 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
21371 twice `Now at end of input', therefore there are two lines less to
21372 expect.
21373
b365aa05
AD
213742001-12-27 Akim Demaille <akim@epita.fr>
21375
21376 * tests/regression.at (Unresolved SR Conflicts):
21377 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
21378 below.
21379
30171f79
AD
213802001-12-27 Akim Demaille <akim@epita.fr>
21381
21382 * src/LR0.c (new_state): Recognize the final state by the fact it
21383 is reached by eoftoken.
21384 (insert_start_shifting_state, insert_eof_shifting_state)
21385 (insert_accepting_state, augment_automaton): Remove, since now
21386 these states are automatically computed from the initial state.
21387 (generate_states): Adjust.
21388 * src/print.c: When reporting a rule number to the user, substract
21389 1, so that the axiom rule is rule 0, and the first user rule is 1.
21390 * src/reduce.c: Likewise.
21391 * src/print_graph.c (print_core): For the time being, just as for
21392 the report, depend upon --trace-flags to dump the full set of
21393 items.
21394 * src/reader.c (readgram): Once the grammar read, insert the rule
21395 0: `$axiom: START-SYMBOL $'.
21396 * tests/set.at: Adjust: rule 0 is now displayed, and since the
21397 number of the states has changed (the final state is no longer
21398 necessarily the last), catch up.
21399
75142d45
AD
214002001-12-27 Akim Demaille <akim@epita.fr>
21401
21402 Try to make the use of the eoftoken valid. Given that its value
21403 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
21404 is used instead of > 0 where appropriate, (ii), depend upon nritems
21405 instead of the 0-sentinel.
21406
21407 * src/gram.h, src/gram.c (nritems): New.
21408 Expected to be duplication of nitems, but for the time being...
21409 * src/reader.c (packgram): Assert nritems and nitems are equal.
21410 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
21411 * src/closure.c (print_closure, print_fderives): Likewise.
21412 * src/gram.c (ritem_print): Likewise.
21413 * src/print.c (print_core, print_grammar): Likewise.
21414 * src/print_graph.c: Likewise.
21415
b7c49edf
AD
214162001-12-27 Akim Demaille <akim@epita.fr>
21417
21418 * src/main.c (main): If there are complains after grammar
21419 reductions, then output the report anyway if requested, then die.
21420 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
21421 * src/reader.c (eoftoken): New.
21422 (parse_token_decl): If the token being defined has value `0', it
21423 is the eoftoken.
21424 (packsymbols): No longer hack `tags' to insert `$' by hand.
21425 Be sure to preserve the value of the eoftoken.
21426 (reader): Make sure eoftoken is defined.
21427 Initialize nsyms to 0: now eoftoken is created just like the others.
21428 * src/print.c (print_grammar): Don't special case the eof token.
21429 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
21430 lie anyway, albeit pleasant.
21431 * tests/calc.at: Exercise error messages with eoftoken.
21432 Change the grammar so that empty input is invalid.
21433 Adjust expectations.
21434 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
21435
ec2da99f
AD
214362001-12-27 Akim Demaille <akim@epita.fr>
21437
21438 * configure.in: Check the protos of strchr ans strspn.
21439 Replace strchr if needed.
21440 * src/system.h: Provide the protos of strchr, strspn and memchr if
21441 missing.
21442 * lib/strchr.c: New.
21443 * src/reader.c (symbols_save): Use strchr.
21444
8adfa272
AD
214452001-12-27 Akim Demaille <akim@epita.fr>
21446
21447 * src/print.c, src/print_graph.c (escape): New.
21448 Use it to quote the TAGS outputs.
21449 * src/print_graph.c (print_state): Now errors are in red, and
21450 reductions in green.
21451 Prefer high to wide: output the state number on a line of its own.
21452
80dac38c
AD
214532001-12-27 Akim Demaille <akim@epita.fr>
21454
21455 * src/state.h, src/state.c (reductions_new): New.
21456 * src/LR0.c (set_state_table): Let all the states have a
21457 `reductions', even if reduced to 0.
21458 (save_reductions): Adjust.
21459 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
21460 * src/print.c (print_reductions, print_actions): Adjust.
21461 * src/output.c (action_row): Adjust.
21462
2cec70b9
AD
214632001-12-27 Akim Demaille <akim@epita.fr>
21464
21465 * src/state.h, src/state.c (errs_new, errs_dup): New.
21466 * src/LR0.c (set_state_table): Let all the states have an errs,
21467 even if reduced to 0.
21468 * src/print.c (print_errs, print_reductions): Adjust.
21469 * src/output.c (output_actions, action_row): Adjust.
21470 * src/conflicts.c (resolve_sr_conflict): Adjust.
21471
13ca549a
AD
214722001-12-27 Akim Demaille <akim@epita.fr>
21473
21474 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
21475
5092aba5
AD
214762001-12-27 Akim Demaille <akim@epita.fr>
21477
21478 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
21479 * src/print.c: here.
21480 (lookaheadset, shiftset): New, used as additional storage by
21481 print_reductions.
21482 (print_results): Adjust.
21483 (print_shifts, print_gotos, print_errs): New, extracted from...
21484 (print_actions): here.
21485 * src/print_graph.c (print_actions): Remove dead code.
21486
11e2beca
AD
214872001-12-27 Akim Demaille <akim@epita.fr>
21488
21489 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
21490 `$n' and `@n'.
21491
dac3c910
AD
214922001-12-27 Akim Demaille <akim@epita.fr>
21493
21494 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
21495 (build_relations): Adjust.
21496
d0b0fefa
AD
214972001-12-27 Akim Demaille <akim@epita.fr>
21498
21499 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
21500 duplication.
21501
adc8c848
AD
215022001-12-27 Akim Demaille <akim@epita.fr>
21503
21504 * src/reader.c (packgram): Catch nitems overflows.
21505
14d293ac
AD
215062001-12-27 Akim Demaille <akim@epita.fr>
21507
21508 * src/files.c, src/files.h (guard_obstack): Remove.
21509 * src/output.c (output): Adjust.
21510 * src/reader.c (parse_braces): New, factoring...
21511 (copy_action, copy_guard): these two which are renamed as...
21512 (parse_action, parse_guard): these.
21513 As a voluntary consequence, using braces around guards is now
21514 mandatory.
21515
f499b062
AD
215162001-12-27 Akim Demaille <akim@epita.fr>
21517
21518 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
21519 * src/reader.c (symbol_list): `guard' and `guard_line' are new
21520 members.
21521 (symbol_list_new): Adjust.
21522 (copy_action): action_line is the first line, not the last.
21523 (copy_guard): Just as for actions, store the `action' only, not
21524 the switch/case/break flesh.
21525 Don't parse the user action that might follow the guard, let...
21526 (readgram): do it, i.e., now, there can be an action after a
21527 guard.
21528 In other words the guard is just explicitly optional.
21529 (packgram): Adjust.
21530 * src/output.c (guards_output): New.
21531 (output_parser): Call it when needed.
21532 (output): Also free the guard and attrs obstacks.
21533 * src/files.c, src/files.h (obstack_save): Remove.
21534 (output_files): Remove.
21535 As a result, if one needs the former `.act' file, using an
21536 appropriate skeleton which requires actions and guards is now
21537 required.
21538 * src/main.c (main): Adjust.
21539 * tests/semantic.at: New.
21540 * tests/regression.at: Use `input.y' as input file name.
21541 Avoid 8+3 problems by requiring input.c when the test needs the
21542 parser.
21543
d945f5cd
AD
215442001-12-27 Akim Demaille <akim@epita.fr>
21545
21546 * src/reader.c (symbol_list_new): Be sure to initialize all the
21547 fields.
21548
d200e455
AD
215492001-12-27 Akim Demaille <akim@epita.fr>
21550
21551 All the hacks using a final pseudo state are now useless.
21552
21553 * src/LR0.c (set_state_table): state_table holds exactly nstates.
21554 * src/lalr.c (nLA): New.
21555 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
21556 instead of lookaheadsp from the pseudo state (nstate + 1).
21557
f9507c28
AD
215582001-12-27 Akim Demaille <akim@epita.fr>
21559
21560 * src/output.c (action_row, token_actions): Use a state_t instead
21561 of a integer, and nlookaheads instead of the following state's
21562 lookaheadsp.
21563
065fbd27
AD
215642001-12-27 Akim Demaille <akim@epita.fr>
21565
21566 * src/conflicts.c (log_resolution, flush_shift)
21567 (resolve_sr_conflict, set_conflicts, solve_conflicts)
21568 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
21569 (conflicts_print, print_reductions): Use a state_t instead of an
21570 integer when referring to a state.
21571 As much as possible, depend upon nlookaheads, instead of the
21572 `lookaheadsp' member of the following state (since lookaheads of
21573 successive states are successive, the difference between state n + 1
21574 and n served as the number of lookaheads for state n).
21575 * src/lalr.c (add_lookback_edge): Likewise.
21576 * src/print.c (print_core, print_actions, print_state)
21577 (print_results): Likewise.
21578 * src/print_graph.c (print_core, print_actions, print_state)
21579 (print_graph): Likewise.
21580 * src/conflicts.h: Adjust.
21581
1b177bd7
AD
215822001-12-27 Akim Demaille <akim@epita.fr>
21583
21584 * src/bison.hairy: Formatting/comment changes.
21585 ANSIfy.
21586 Remove `register' indications.
21587 Add plenty of `static'.
21588
7742ddeb
AD
215892001-12-27 Akim Demaille <akim@epita.fr>
21590
21591 * src/output.c (prepare): Drop the muscle `ntbase' which
21592 duplicates ntokens.
21593 * src/bison.simple: Formatting/comment changes.
21594 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
21595 is an undocumented synonym.
21596
1fa14068
AD
215972001-12-22 Akim Demaille <akim@epita.fr>
21598
21599 * src/output.c (output_table_data): Change the prototype to use
21600 `int' for array ranges: some invocations do pass an int, not a
21601 short.
21602 Reported by Wayne Green.
21603
b9752825
AD
216042001-12-22 Akim Demaille <akim@epita.fr>
21605
21606 Some actions of web2c.y are improperly triggered.
21607 Reported by Mike Castle.
21608
21609 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
21610 * tests/regression.at (Web2c): Rename as...
21611 (Web2c Report): this.
21612 (Web2c Actions): New.
21613
776209d6
AD
216142001-12-22 Akim Demaille <akim@epita.fr>
21615
21616 Reductions in web2c.y are improperly reported.
21617 Reported by Mike Castle.
21618
21619 * src/conflicts.c (print_reductions): Fix.
21620 * tests/regression.at (Web2c): New.
21621
275fc3ad
AD
216222001-12-18 Akim Demaille <akim@epita.fr>
21623
21624 Some host fail on `assert (!"foo")', which expands to
21625 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
21626 Reported by Nelson Beebee.
21627
21628 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
21629 `#define it_succeeded 0' and `assert (it_succeeded)'.
21630
897668ee
MA
216312001-12-17 Marc Autret <autret_m@epita.fr>
21632
21633 * src/bison.simple: Don't hard code the skeleton line and filename.
21634 * src/output.c (output_parser): Rename 'line' as 'output_line'.
21635 New line counter 'skeleton_line' (skeleton-line muscle).
21636
ab3399e0
PE
216372001-12-17 Paul Eggert <eggert@twinsun.com>
21638
21639 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
21640 YYDEBUG must be defined to a nonzero value.
21641
21642 * src/bison.simple (yytname): Do not assume that the user defines
21643 YYDEBUG to a properly parenthesized expression.
21644
3877f72b
AD
216452001-12-17 Akim Demaille <akim@epita.fr>
21646
21647 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
21648 nlookaheads is a new member.
21649 Adjust all users.
21650 * src/lalr.h (nlookaheads): Remove this orphan declaration.
21651 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
21652 state.
776209d6 21653
331dbc1b
AD
216542001-12-17 Akim Demaille <akim@epita.fr>
21655
21656 * src/files.h, src/files.c (open_files, close_files): Remove.
21657 * src/main.c (main): Don't open/close files, nor invoke lex_free,
21658 let...
21659 * src/reader.c (reader): Do it.
776209d6 21660
be750e4c
AD
216612001-12-17 Akim Demaille <akim@epita.fr>
21662
21663 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 21664
709ae8c6
AD
216652001-12-17 Akim Demaille <akim@epita.fr>
21666
21667 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
21668 (flush_reduce): New.
21669 (resolve_sr_conflict): Adjust.
776209d6 21670
f87685c3
AD
216712001-12-17 Akim Demaille <akim@epita.fr>
21672
21673 * src/output.c (output_obstack): Be static and rename as...
21674 (format_obstack): this, to avoid any confusion with files.c's
21675 output_obstack.
21676 * src/reader.h (muscle_obstack): Move to...
21677 * src/output.h: here, since it's defined in output.c.
21678
837491d8
AD
216792001-12-17 Akim Demaille <akim@epita.fr>
21680
21681 * src/output.c (action_row, save_column, default_goto)
21682 (sort_actions, matching_state, pack_vector): Better variable
21683 locality.
21684
796d61fb
AD
216852001-12-17 Akim Demaille <akim@epita.fr>
21686
21687 * src/output.c: Various formatting changes.
776209d6 21688
64d15509
AD
216892001-12-17 Akim Demaille <akim@epita.fr>
21690
21691 * src/files.c (output_files): Free the output_obstack.
21692 * src/main.c (main): Call print and print_graph conditionally.
21693 * src/print.c (print): Work unconditionally.
21694 * src/print_graph.c (print_graph): Work unconditionally.
21695 * src/conflicts.c (log_resolution): Output only if verbose_flag.
21696
fbc8ecb7
MA
216972001-12-16 Marc Autret <autret_m@epita.fr>
21698
21699 * src/output.c (actions_output): Fix. When we use %no-lines,
21700 there is one less line per action.
21701
f0440388
MA
217022001-12-16 Marc Autret <autret_m@epita.fr>
21703
21704 * src/bison.simple: Remove a useless #line directive.
21705 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
21706 * src/output.c (get_lines_number): New.
776209d6 21707 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
21708 output muscles.
21709 Fix line numbering.
21710 (actions_output): Computes the number of lines taken by actions.
21711 (output_master_parser): Insert new skeleton which is the name of
21712 the output parser file name.
21713
a79986b8
MA
217142001-12-15 Marc Autret <autret_m@epita.fr>
21715
21716 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
21717
4ec8e00f
MA
217182001-12-15 Marc Autret <autret_m@epita.fr>
21719
21720 * src/output.c (output_gram): Keep track of the hairy one.
21721
1a4648ff
AD
217222001-12-15 Akim Demaille <akim@epita.fr>
21723
21724 Make `make distcheck' work.
21725
21726 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
21727 system.h which uses libgettext.h.
21728
9c2c67e6
AD
217292001-12-15 Akim Demaille <akim@epita.fr>
21730
21731 * src/nullable.c (set_nullable): Useless rules must be skipped,
21732 otherwise, since we range over their symbols, we might look at a
21733 nonterminal which no longer ``exists'', i.e., it is not counted in
21734 `nvars', hence we overflow our arrays.
21735
93ede233
AD
217362001-12-15 Akim Demaille <akim@epita.fr>
21737
21738 The header can also be produced directly, without any obstack!
21739 Yahoo!
21740
21741 * src/files.c, src/files.h (defines_obstack): Remove.
21742 (compute_header_macro): Global.
21743 (defines_obstack_save): Remove.
21744 * src/reader.c (parse_union_decl): No longer output to
21745 defines_obstack: its content can be found in the `stype' muscle
21746 anyway.
21747 (output_token_translations): Merge into...
21748 (symbols_output): this.
21749 Rename as...
21750 (symbols_save): this.
21751 (reader): Adjust.
21752 * src/output.c (header_output): New.
21753 (output): Call it.
21754
2666f928
AD
217552001-12-15 Akim Demaille <akim@epita.fr>
21756
21757 * src/reader.c (parse_union_decl): Instead of handling two obstack
21758 simultaneously, use one to define the `stype' muscle, and use the
21759 value of the latter to fill defines_obstack.
21760 (copy_comment): Remove.
21761 (copy_comment2): Work for a single obstack.
21762 Rename as...
21763 (copy_comment): this.
21764
428046f8
AD
217652001-12-15 Akim Demaille <akim@epita.fr>
21766
21767 * src/lex.c, src/lex.h (xgetc): No longer static.
21768 * src/reader.c (parse_union_decl): Revamp.
21769
ea52d706
AD
217702001-12-15 Akim Demaille <akim@epita.fr>
21771
21772 Still making progress in separating Bison into (i) input, (ii)
21773 process, (iii) output: now we can directly output the parser file
21774 without using table_obstack at all.
21775
21776 * src/files.c, src/files.h (table_obstack): Bye bye.
21777 (parser_file_name): New.
21778 * src/files.c (compute_output_file_names): Compute it.
21779 * src/output.c (actions_output, output_parser)
21780 (output_master_parser): To a file instead of an obstack.
21781
3f96f4dc
AD
217822001-12-15 Akim Demaille <akim@epita.fr>
21783
21784 Attach actions to rules, instead of pre-outputting them to
21785 actions_obstack.
21786
21787 * src/gram.h (rule_t): action and action_line are new members.
21788 * src/reader.c (symbol_list): Likewise.
21789 (copy_action): Save the actions within the rule.
21790 (packgram): Save them in rule_table.
21791 * src/output.c (actions_output): New.
21792 (output_parser): Use it on `%%actions'.
21793 (output_rule_data): Don't free rule_table.
21794 (output): Do it.
21795 (prepare): Don't save the `action' muscle.
21796 * src/bison.simple: s/%%action/%%actions/.
21797
51576fb3
AD
217982001-12-15 Akim Demaille <akim@epita.fr>
21799
21800 * src/reader.c (copy_action): When --yacc, don't append a `;'
21801 to the user action: let it fail if lacking.
dee049eb 21802 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 21803
2648a72d
AD
218042001-12-14 Akim Demaille <akim@epita.fr>
21805
21806 * src/lex.c (literalchar): Simply return the char you decoded, non
21807 longer mess around with obstacks and int pointers.
21808 Adjust all callers.
21809
92790e5b
AD
218102001-12-14 Akim Demaille <akim@epita.fr>
21811
21812 * src/lex.c (literalchar): Don't escape the special characters,
21813 just decode them, and keep them as char (before, eol was output as
21814 the 2 char string `\n' etc.).
21815 * src/output.c (output_rule_data): Use quotearg to output the
21816 token strings.
21817
927c1557
PE
218182001-12-13 Paul Eggert <eggert@twinsun.com>
21819
21820 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
21821 Do not infringe on the global user namespace when using C++.
21822 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
21823 All uses of `fprintf' and `stderr' changed.
21824
21825 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
21826
ed8e1f68
AD
218272001-12-13 Akim Demaille <akim@epita.fr>
21828
21829 The computation of nullable is broken: it doesn't handle empty
21830 RHS's properly.
21831
21832 * tests/torture.at (GNU AWK Grammar): New.
21833 * tests/sets.at (Nullable): New.
21834 * src/nullable.c (set_nullable): Instead of blindly looping over
21835 `ritems', loop over the rules, and then over their rhs's.
21836
21837 Work around Autotest bugs.
21838
21839 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
21840 frame, because Autotest understand lines starting with a `+' as
21841 traces from the shell. Then, they are not processed properly.
21842 Admittedly an Autotest bug, but we don't have time to wait for
21843 Autotest to catch up.
21844 * tests/regression.at (Broken Closure): Adjust to the new table
21845 frames.
21846 Move to...
21847 * tests/sets.at: here.
21848
cb581495
AD
218492001-12-13 Akim Demaille <akim@epita.fr>
21850
21851 * src/closure.c (closure): Use nrules instead of playing tricks
21852 with BITS_PER_WORD.
21853
2e729273
AD
218542001-12-13 Akim Demaille <akim@epita.fr>
21855
21856 * src/print.c (print_actions): Output the handling of `$' as the
21857 traces do: shifting the token EOF. Before EOF was treated as a
21858 nonterminal.
21859 * tests/regression.at: Adjust some tests.
21860 * src/print_graph.c (print_core): Complete the set of items via
21861 closure. The next-to-final and final states are still unsatisfying,
21862 but that's to be addressed elsewhere.
21863 No longer output the rule numbers, but do output the state number.
21864 A single loop for the shifts + gotos is enough, but picked a
21865 distinct color for each.
21866 (print_graph): Initialize and finalize closure.
21867
107f7dfb
AD
218682001-12-13 Akim Demaille <akim@epita.fr>
21869
21870 * src/reader.c (readgram): Remove dead code, an strip useless
21871 braces.
21872 (get_type): Remove, unused.
21873
9b53a24f
AD
218742001-12-12 Akim Demaille <akim@epita.fr>
21875
21876 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
21877 on that of lib/error.c.
21878
dbfb6dcd
AD
218792001-12-12 Akim Demaille <akim@epita.fr>
21880
21881 Some hosts don't like `/' in includes.
21882
21883 * src/system.h: Include libgettext.h without qualifying the path.
21884 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
21885 $(top_srcdir).
21886
c25fb648
MA
218872001-12-11 Marc Autret <autret_m@epita.fr>
21888
21889 * src/output.c (output_parser): Remove useless muscle.
21890
710ddc4f
MA
218912001-12-11 Marc Autret <autret_m@epita.fr>
21892
21893 * src/bison.simple: Remove #line just before %%epilogue. It
21894 is now handled in ...
21895 * src/reader.c (read_additionnal_code): Add the output of a
21896 #line for the epilogue.
21897
e83d80b8
MA
218982001-12-10 Marc Autret <autret_m@epita.fr>
21899
927c1557 21900 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
21901 replace precedent remove.
21902 * src/bison.simple: Remove #line before %%prologue because
21903 %%input-line is wrong at this time.
21904
971d5158
MA
219052001-12-10 Marc Autret <autret_m@epita.fr>
21906
21907 * src/reader.c (symbols_output): Clean up.
927c1557 21908 * src/output.c (output_gram, output): Clean up.
971d5158 21909
5edafffd
AD
219102001-12-10 Akim Demaille <akim@epita.fr>
21911
21912 * src/lalr.c (initialize_lookaheads): New. Extracted from...
21913 * src/LR0.c (set_state_table): here.
21914 * src/lalr.c (lalr): Call it.
21915
0279f8e9
AD
219162001-12-10 Akim Demaille <akim@epita.fr>
21917
21918 * src/state.h (shifts): Remove the `number' member: shifts are
21919 attached to state, hence no longer need to be labelled with a
21920 state number.
21921
190c4f5f
AD
219222001-12-10 Akim Demaille <akim@epita.fr>
21923
21924 Now that states have a complete set of members, the linked list of
21925 shifts is useless: just fill directly the state's shifts member.
21926
21927 * src/state.h (shifts): Remove the `next' member.
21928 * src/LR0.c (first_state, last_state): Remove.
21929 Adjust the callers.
21930 (augment_automaton): Don't look for the shifts that must be added
21931 a shift on EOF: it is those of the state we looked for! But now,
21932 since shifts are attached, it is no longer needed to looking
21933 merely by its id: its number.
21934
2a73b93d
AD
219352001-12-10 Akim Demaille <akim@epita.fr>
21936
21937 * src/LR0.c (augment_automaton): Better variable locality.
21938 Remove an impossible branch: if there is a state corresponding to
21939 the start symbol being shifted, then there is shift for the start
21940 symbol from the initial state.
21941
74392f6a
AD
219422001-12-10 Akim Demaille <akim@epita.fr>
21943
21944 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
21945 only when appropriate: when insert_start_shifting_state' is not
21946 invoked.
21947 * tests/regression.at (Rule Line Numbers): Adjust.
21948
37c82725
AD
219492001-12-10 Akim Demaille <akim@epita.fr>
21950
21951 * src/LR0.c (augment_automaton): Now that all states have shifts,
21952 merge the two cases addition shifts to the initial state.
21953
6a164e0c
AD
219542001-12-10 Akim Demaille <akim@epita.fr>
21955
21956 * src/lalr.c (set_state_table): Move to...
21957 * src/LR0.c: here.
21958 * src/lalr.c (lalr): Don't call it...
21959 * src/LR0.c (generate_states): do it.
21960 * src/LR0.h (first_state): Remove, only the table is used.
21961
7215de24
AD
219622001-12-10 Akim Demaille <akim@epita.fr>
21963
21964 * src/LR0.h (first_shift, first_reduction): Remove.
21965 * src/lalr.c: Don't use first_shift: find shifts through the
21966 states.
21967
80e25d4d
AD
219682001-12-10 Akim Demaille <akim@epita.fr>
21969
21970 * src/LR0.c: Attach shifts to states as soon as they are
21971 computed.
21972 * src/lalr.c (set_state_table): Instead of assigning shifts to
21973 state, just assert that the mapping was properly done.
21974
0ab3728b
AD
219752001-12-10 Akim Demaille <akim@epita.fr>
21976
21977 * src/LR0.c (insert_start_shift): Rename as...
21978 (insert_start_shifting_state): this.
21979 (insert_eof_shifting_state, insert_accepting_state): New.
21980 (augment_automaton): Adjust.
21981 Better locality of the variables.
21982 When looking if the start_symbol is shifted from the initial
21983 state, using `while (... symbol != start_symbol ...)' sounds
21984 better than `while (... symbol < start_symbol ...)': If fail
21985 to see how the order between symbols could be relevant!
21986
78af9bbc
AD
219872001-12-10 Akim Demaille <akim@epita.fr>
21988
21989 * src/getargs.h: Don't declare `spec_name_prefix' and
21990 `spec_file_prefix', declared by src/files.h.
21991 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
21992 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
21993 * src/output.c (prepare): Adjust.
21994 * src/reader.c (symbols_output): Likewise.
21995 * src/vmsgetargs.c: Vaguely adjust, but who cares?
21996
bdef2a41
AD
219972001-12-10 Akim Demaille <akim@epita.fr>
21998
21999 * src/muscle_tab.c (muscle_init): NULL is a better default than
22000 `"0"'.
22001
3735969c
AD
220022001-12-10 Akim Demaille <akim@epita.fr>
22003
22004 * src/reader.c (reader): Calling symbols_output once is enough.
22005
49701457
AD
220062001-12-10 Akim Demaille <akim@epita.fr>
22007
22008 Now that states have a complete set of members, the linked list of
22009 reductions is useless: just fill directly the state's reductions
22010 member.
22011
22012 * src/state.h (struct reductions): Remove member `number' and
22013 `next'.
22014 * src/LR0.c (first_reduction, last_reduction): Remove.
22015 (save_reductions): Don't link the new reductions, store them in
22016 this_state.
22017 * src/lalr.c (set_state_table): No need to attach reductions to
22018 states, it's already done.
22019 * src/output.c (output_actions): No longer free the shifts, then
22020 the reductions, then the states: free all the states and their
22021 members.
22022
0edad749
AD
220232001-12-10 Akim Demaille <akim@epita.fr>
22024
22025 * src/options.c (OPTN, DRTV, BOTH): New.
22026 (option_table): Use them.
22027
0edad749
AD
22028 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
22029 the job of system.h.
22030 * src/options.c: Don't include stdio.h and xalloc.h for the same
22031 reasons.
22032
5449dd0f
AD
220332001-12-10 Akim Demaille <akim@epita.fr>
22034
22035 * src/output.c (output, prepare): Make sure the values of the
22036 muscles `action' and `prologue' are 0-terminated.
22037
a870c567
AD
220382001-12-10 Akim Demaille <akim@epita.fr>
22039
22040 Clean up GCC warnings.
22041
22042 * src/reader.c (copy_action): `buf' is not used.
22043 (parse_skel_decl): Be static.
22044 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
22045 * src/options.h (create_long_option_table): Have a real prototype.
22046 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
22047 (hash_delete_at): Return const void *.
22048 Adjust casts to preserve the const.
22049
80df8768
AD
220502001-12-10 Akim Demaille <akim@epita.fr>
22051
22052 * configure.in: Require 2.52g.
22053 M4 is not needed, but AUTOM4TE is.
22054 * m4/m4.m4: Remove.
22055 * tests/Makefile.am: Adjust.
22056
f693ad14
AD
220572001-12-10 Akim Demaille <akim@epita.fr>
22058
22059 One structure for states is enough, even though theoretically
22060 there are LR(0) states and LALR(1) states.
22061
22062 * src/lalr.h (state_t): Remove.
22063 (state_table): Be state_t **, not state_t *.
22064 * src/state.h (core, CORE_ALLOC): Rename as...
22065 (state_t, STATE_ALLOC): this.
22066 Add the LALR(1) members: shifts, reductions, errs.
22067 * src/LR0.c (state_table): Rename as...
22068 (state_hash): this, to avoid name clashes with the global
22069 `state_table'.
22070 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
22071 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
22072
74ffbcb6
AD
220732001-12-10 Akim Demaille <akim@epita.fr>
22074
22075 Bison dumps core on bash.y.
22076 Reported by Pascal Bart.
22077
22078 * src/warshall.c (bitmatrix_print): New.
22079 (TC): Use it.
ba0fe3c7 22080 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
22081 j must be the outer loop.
22082 * tests/regression.at (Broken Closure): New.
22083
07708e19
AD
220842001-12-05 Akim Demaille <akim@epita.fr>
22085
22086 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
22087 its argument.
ba1ecc07 22088 Reported by Peter Hamorsky.
07708e19 22089
92b16366
AD
220902001-12-05 Akim Demaille <akim@epita.fr>
22091
22092 * src/conflicts.c (err_table): Remove.
22093 (resolve_sr_conflict): Adjust.
22094 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
22095 Rename as...
22096 (state_t.reductions, state_t.shifts): this.
22097
076ab033
AD
220982001-12-05 Akim Demaille <akim@epita.fr>
22099
22100 * src/reduce.c (reduce_grammar_tables): No longer disable the
22101 removal of useless rules via CPP but via `if (0)', so that the
22102 compiler still check the code is valid.
22103 For instance, it should have noticed `rline' no longer exists: use
22104 the `line' member of rule_t.
22105 * src/gram.c (dummy, rline): Remove, unused.
22106
3843c413
AD
221072001-12-05 Akim Demaille <akim@epita.fr>
22108
22109 * src/output.c (pack_vector): Use assert, not berror.
22110 * src/main.c (berror): Remove, unused.
22111
43168960
AD
221122001-12-05 Akim Demaille <akim@epita.fr>
22113
22114 New experimental feature: if --verbose --trace output all the
22115 items of a state, not only its kernel.
22116
22117 * src/print.c (print_core): If `trace_flag', then invoke closure
22118 before outputting the items of the state (print_core is no longer
22119 a correct name them).
22120 (print_results): Invoke new_closure/free_closure if needed.
22121
b2872512
AD
221222001-12-05 Akim Demaille <akim@epita.fr>
22123
22124 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
22125 * src/closure.c, src/closure.h (itemsetsize): Rename as...
22126 (nitemset): for consistency with the rest of the project.
22127
23cbcc6c
AD
221282001-12-05 Akim Demaille <akim@epita.fr>
22129
22130 * src/closure.c (print_closure): Improve.
22131 (closure): Use it for printing input and output.
22132
03ec521c
AD
221332001-12-05 Akim Demaille <akim@epita.fr>
22134
22135 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
22136 indexed by nonterminals.
22137
3a7456dd
AD
221382001-12-05 Akim Demaille <akim@epita.fr>
22139
22140 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
22141 what it was!).
22142 * src/warshall.h: Remove accidental duplication of the content.
22143
1cbcf2e7
AD
221442001-12-05 Akim Demaille <akim@epita.fr>
22145
22146 * src/closure.c (set_fderives): De-obfuscate.
22147
84182270
AD
221482001-12-05 Akim Demaille <akim@epita.fr>
22149
22150 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
22151
3f6f053c
AD
221522001-12-05 Akim Demaille <akim@epita.fr>
22153
22154 * src/closure.c (set_firsts): De-obfuscate.
22155
7a5350ba
AD
221562001-12-05 Akim Demaille <akim@epita.fr>
22157
22158 * src/output.c (action_row): De-obfuscate
22159 using the good o' techniques: arrays not pointers, variable
22160 locality, BITISSET, RESETBIT etc.
22161
d954473d
AD
221622001-12-05 Akim Demaille <akim@epita.fr>
22163
22164 Pessimize the code to simplify it: from now on, all the states
22165 have a valid SHIFTS, which NSHIFTS is possibly 0.
22166
22167 * src/LR0.c (shifts_new): Be global and move to..
22168 * src/state.c, src/state.h: here.
22169 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
22170 * src/print_graph: Adjust.
22171
9839bbe5
AD
221722001-12-05 Akim Demaille <akim@epita.fr>
22173
22174 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
22175 * src/conflicts.c: Use it.
22176 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
22177 incorrectly ``simplified''.
22178
9f136c07
AD
221792001-12-05 Akim Demaille <akim@epita.fr>
22180
22181 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
22182 using the good o' techniques: arrays not pointers, variable
22183 locality, BITISSET, RESETBIT etc.
22184
b608206e
AD
221852001-12-05 Akim Demaille <akim@epita.fr>
22186
22187 * src/state.h (SHIFT_SYMBOL): New.
22188 * src/conflicts.c: Use it to deobfuscate.
22189
52afa962
AD
221902001-12-05 Akim Demaille <akim@epita.fr>
22191
22192 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
22193 (print_reductions): De-obfuscate using the good o' techniques:
22194 arrays not pointers, variable locality, BITISSET.
22195
e74dc321
AD
221962001-12-05 Akim Demaille <akim@epita.fr>
22197
22198 * src/conflicts.c (print_reductions): Arrays, not pointers.
22199 Use BITISSET.
22200
768fca83
AD
222012001-12-05 Akim Demaille <akim@epita.fr>
22202
22203 * src/conflicts.c (print_reductions): Pessimize, but clarify.
22204
a17e599f
AD
222052001-12-05 Akim Demaille <akim@epita.fr>
22206
22207 * src/conflicts.c (print_reductions): Improve variable locality.
22208
a04bc341
AD
222092001-12-05 Akim Demaille <akim@epita.fr>
22210
22211 * src/conflicts.c (print_reductions): Pessimize, but clarify.
22212
c8ea038e
AD
222132001-12-05 Akim Demaille <akim@epita.fr>
22214
22215 * src/conflicts.c (print_reductions): Improve variable locality.
22216
aa2aab3c
AD
222172001-12-05 Akim Demaille <akim@epita.fr>
22218
22219 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
22220 * src/lalr.c: Use them.
22221
b178c8cc
AD
222222001-12-05 Akim Demaille <akim@epita.fr>
22223
22224 * src/LR0.c (augment_automaton): Formatting changes.
22225 Better variable locality.
22226
f67d13aa
AD
222272001-12-05 Akim Demaille <akim@epita.fr>
22228
22229 * src/lalr.c (matrix_print): New.
22230 (transpose): Use it.
22231 Use arrays instead of pointers.
22232
c2713865
AD
222332001-12-05 Akim Demaille <akim@epita.fr>
22234
22235 * src/lalr.c (maxrhs): Move to...
22236 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
22237 * src/lalr.c (build_relations): Adjust.
22238
9887c18a
AD
222392001-12-05 Akim Demaille <akim@epita.fr>
22240
22241 * src/lalr.c (transpose): Free the memory allocated to the
22242 argument, as it is replaced by the results by the unique caller.
22243 (build_relations): Merely invoke transpose: it handles the memory
22244 deallocation.
22245 Improve variable locality.
22246 Avoid variables used as mere abbreviations.
22247 (compute_lookaheads): Use arrays instead of pointers.
22248
4d4f699c
AD
222492001-12-05 Akim Demaille <akim@epita.fr>
22250
22251 * src/lalr.c (initialize_F): Improve variable locality.
22252 Avoid variables used as mere abbreviations.
22253
80a69750
AD
222542001-12-05 Akim Demaille <akim@epita.fr>
22255
22256 * src/derives.c (print_derives): Display the ruleno.
22257 * src/lalr.c (initialize_F, transpose): Better variable locality
22258 to improve readability.
22259 Avoid variables used as mere abbreviations.
22260
fe961097
AD
222612001-12-05 Akim Demaille <akim@epita.fr>
22262
22263 * src/lalr.c (traverse): Use arrays instead of pointers.
22264
e3e4e814
AD
222652001-12-05 Akim Demaille <akim@epita.fr>
22266
22267 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
22268 the handling of squeue.
22269 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
22270
630e182b
AD
222712001-12-05 Akim Demaille <akim@epita.fr>
22272
22273 Because useless nonterminals are now kept alive (instead of being
22274 `destroyed'), we now sometimes examine them, and store information
22275 related to them. Hence we need to know their number, and adjust
22276 memory allocations.
22277
22278 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
22279 static.
22280 * src/LR0.c (allocate_itemsets): The memory allocated to
22281 `symbol_count' was used for two different purpose: once to count
22282 the number of occurrences of each symbol, and later reassigned to
22283 `shift_symbol', containing the symbol that can be shifted from a
22284 given state.
22285 Deobfuscate, i.e., allocate, use and free `symbol_count' here
22286 only, and...
22287 (new_itemsets): Allocate `shift_symbol' here.
22288 (allocate_itemsets): symbol_count includes useless nonterminals.
22289 Make room for them.
22290 (free_storage): Use `free', not `XFREE', for pointers that cannot
22291 be null.
22292
81b51460
AD
222932001-12-05 Akim Demaille <akim@epita.fr>
22294
22295 * src/nullable.c (set_nullable): Deobfuscate the handling of
22296 ritem.
22297 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
22298
3067fbef
AD
222992001-12-05 Akim Demaille <akim@epita.fr>
22300
22301 * src/gram.c, src/gram.h (ritem_print): New.
22302 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
22303 (This useless function was defined only to work around VMS linkers
22304 that can't handle compilation units with variables only).
22305 * src/reduce.c (dump_grammar): Use it to trace the construction of
22306 ritem.
22307
c2bea5f9
PE
223082001-12-04 Paul Eggert <eggert@twinsun.com>
22309
7d27c823
PE
22310 * src/bison.simple (union yyalloc): Change member names
22311 to be the same as the stack names.
22312 (yyparse): yyptr is now union yyalloc *, not char *.
22313 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
22314 and may generate better code on some machines.
c2bea5f9
PE
22315 (yystpcpy): Use prototype if __STDC__ is defined, not just
22316 if __cplusplus is defined.
35687a9d 22317
2c8a9dfa
AD
223182001-11-30 Akim Demaille <akim@epita.fr>
22319
22320 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
22321 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
22322 Gettext doesn't compile cleanly, and dies with -Werror.
22323 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
22324 Include WARNING_CFLAGS here.
22325 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
22326 before being defined.
22327
f4e421e6
AD
223282001-11-27 Paul Eggert <eggert@twinsun.com>
22329
22330 * lib/quotearg.h (quotearg_n, quotearg_n_style):
22331 First arg is int, not unsigned.
22332 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
22333 (SIZE_MAX, UINT_MAX): New macros.
22334 (quotearg_n_options): Abort if N is negative.
22335 Avoid overflow check on hosts where size_t is 64 bits and int
22336 is 32 bits, as overflow is impossible there.
22337 Fix off-by-one typo that caused unnecessary reallocation.
22338
7093d0f5
AD
223392001-11-29 Paul Eggert <eggert@twinsun.com>
22340
22341 Name space cleanup in generated parser.
22342
22343 * doc/bison.texinfo (Bison Parser): Discuss system headers
22344 and their effect on the user name space.
22345
22346 * src/bison.simple:
22347 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
22348 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
22349 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
22350
22351 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
22352 on user names when possible.
22353
22354 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
22355 Simplify test for whather <alloca.h> exists.
22356
22357 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
22358
22359 (<stdio.h>): Include if YYDEBUG.
22360
22361 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
22362 ! defined (yyoverflow) && ! defined (yymemcpy).
22363
22364 (yymemcpy, yyparse): Rename local variables as needed so that
22365 they all begin with 'yy'.
22366
22367 (yystrlen, yystpcpy): New functions.
22368
22369 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
22370 All uses changed.
22371
22372 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
22373 instead of relying on string.h functions. Use YYSTACK_ALLOC
22374 and YYSTACK_FREE instead of malloc and free.
22375
fd51e5ff
AD
223762001-11-30 Akim Demaille <akim@epita.fr>
22377
22378 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
22379 before their first uses.
22380 (YYBISON, YYPURE): Move to the top of the output.
22381
7d13ff5f
AD
223822001-11-30 Akim Demaille <akim@epita.fr>
22383
22384 * tests/reduce.at (Useless Nonterminals): Fix.
22385
892a3995
AD
223862001-11-30 Akim Demaille <akim@epita.fr>
22387
22388 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
22389 if body instead of `;' to pacify GCC's warnings.
22390
68f1e3ed
AD
223912001-11-30 Akim Demaille <akim@epita.fr>
22392
22393 Instead of mapping the LHS of unused rules to -1, keep the LHS
22394 valid, but flag the rules as invalid.
22395
22396 * src/gram.h (rule_t): `useful' is a new member.
22397 * src/print.c (print_grammar): Adjust.
22398 * src/derives.c (set_derives): Likewise.
22399 * src/reader.c (packgram, reduce_output): Likewise.
22400 * src/reduce.c (reduce_grammar_tables): Likewise.
22401 * tests/reduce.at (Underivable Rules, Useless Rules): New.
22402
d2d1b42b
AD
224032001-11-30 Akim Demaille <akim@epita.fr>
22404
22405 * src/reduce.c (reduce_output): Formatting changes.
22406 * src/print.c (print_results, print_grammar): Likewise.
22407 * tests/regression.at (Rule Line Numbers)
22408 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
22409
760b53a8
AD
224102001-11-30 Akim Demaille <akim@epita.fr>
22411
22412 * src/reduce.c (nonterminals_reduce): Instead of throwing away
22413 useless nonterminals, move them at the end of the symbol arrays.
22414 (reduce_output): Adjust.
22415 * tests/reduce.at (Useless Nonterminals): Adjust.
22416
00238958
AD
224172001-11-30 Akim Demaille <akim@epita.fr>
22418
22419 * src/reduce.c: Various comment/formatting changes.
22420 (nonterminals_reduce): New, extracted from...
22421 (reduce_grammar_tables): here.
22422 (reduce_grammar): Call nonterminals_reduce.
22423
396452de
PE
224242001-11-29 Paul Eggert <eggert@twinsun.com>
22425
22426 * src/bison.simple (YYSTACK_REALLOC): Remove.
22427 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
22428 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
22429 New macros.
22430 (union yyalloc): New type.
22431 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
22432 an arbitrary restriction on hosts where size_t is wider than int.
22433
22434 (yyparse): Don't dump core if alloca or malloc fails; instead, report
22435 a parser stack overflow. Allocate just one block of memory for all
22436 three stacks, instead of allocating three blocks; this typically is
22437 faster and reduces fragmentation.
22438
22439 Do not limit the number of items in the stack to a value that fits
22440 in 'int', as this is an arbitrary limit on hosts with 64-bit
22441 size_t and 32-bit int.
22442
147e184c
MA
224432001-11-29 Marc Autret <autret_m@epita.fr>
22444
22445 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
22446 of defining YYERROR_VERBOSE.
22447 [AT_DATA]: $4 is now out of C declarations in the prologue.
22448
426cf563
MA
224492001-11-28 Marc Autret <autret_m@epita.fr>
22450
22451 * src/reader.c (parse_dquoted_param): New.
22452 (parse_skel_decl): Use it.
22453 * src/lex.h: Add its prototype.
22454 * src/lex.c (literalchar): Become not static.
22455
c7925b99
MA
224562001-11-28 Marc Autret <autret_m@epita.fr>
22457
22458 * src/output.h: And put its extern declaration here.
22459 * src/output.c (error_verbose): Define here.
22460 (prepare): Echo name modification.
22461 * src/getargs.h: Clean its extern declaration.
22462 * src/getargs.c (error_verbose_flag): Remove.
22463 (getargs): Remove case 'e'.
22464 * src/options.c (option_table): 'error-verbose' is now seen as simple
22465 percent option.
22466 Include output.h.
22467
22468 * src/reader.c (read_declarations): Remove case tok_include.
22469 (parse_include_decl): Remove.
22470 * src/lex.h (token_t): Remove tok_include.
22471 * src/options.c (option_table): 'include' is now a simple command line
22472 option.
22473
5b5d1929
MA
224742001-11-28 Marc Autret <autret_m@epita.fr>
22475
22476 * src/bison.simple: Adjust muscle names.
22477 * src/muscle_tab.c (muscle_init): Also rename the muscles.
22478 * src/output.c (prepare): s/_/-/ for the muscles names.
22479 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
22480
8850be4b
MA
224812001-11-28 Marc Autret <autret_m@epita.fr>
22482
22483 * src/bison.simple: Fix debug.
22484 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
22485
4a38e613
AD
224862001-11-28 Akim Demaille <akim@epita.fr>
22487
22488 * src/LR0.c (shifts_new): New.
22489 (save_shifts, insert_start_shift, augment_automaton): Use it.
22490
4b35e1c1
AD
224912001-11-28 Akim Demaille <akim@epita.fr>
22492
22493 * src/closure.c (closure): `b' and `ruleno' denote the same value:
22494 keep ruleno only.
22495
d2b04478
AD
224962001-11-28 Akim Demaille <akim@epita.fr>
22497
22498 * src/closure.c (closure): Instead of looping over word in array
22499 then bits in words, loop over bits in array.
22500
2c4c30aa
AD
225012001-11-28 Akim Demaille <akim@epita.fr>
22502
22503 * src/closure.c (closure): No longer optimize the special case
22504 where all the bits of `ruleset[r]' are set to 0, to make the code
22505 clearer.
22506
576890b7
AD
225072001-11-28 Akim Demaille <akim@epita.fr>
22508
22509 * src/closure.c (closure): `r' and `c' are new variables, used to
22510 de-obfuscate accesses to RULESET and CORE.
22511
cb487d7d
AD
225122001-11-28 Akim Demaille <akim@epita.fr>
22513
22514 * src/reduce.c (reduce_print): Use ngettext.
22515 (dump_grammar): Improve the trace accuracy.
22516
6013d43f
AD
225172001-11-28 Akim Demaille <akim@epita.fr>
22518
22519 * src/reduce.c (dump_grammar): Don't translate trace messages.
22520
cb4956ee
AD
225212001-11-28 Akim Demaille <akim@epita.fr>
22522
22523 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
22524 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
22525 as all tags are free'ed afterwards.
22526 From Enrico Scholz.
22527
648185ab
PE
225282001-11-27 Paul Eggert <eggert@twinsun.com>
22529
22530 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
22531 use alloca when we didn't want to, and vice versa.
22532
68254a03
MA
225332001-11-27 Marc Autret <autret_m@epita.fr>
22534
9113b58f
AD
22535 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
22536 initialization.
68254a03
MA
22537 * src/output.c (prepare): Remove its update.
22538
04d843a2
MA
225392001-11-27 Marc Autret <autret_m@epita.fr>
22540
22541 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
22542 Use %error-verbose.
22543
d2079671 225442001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
22545
22546 * src/bison.simple: Remove YYERROR_VERBOSE using.
22547 Use %%error_verbose.
22548 (yyparse): Likewise.
22549 * src/output.c (prepare): Give its final value.
22550 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
22551 * src/getargs.h: Add its extern declaration.
22552 * src/getargs.c (error_verbose_flag): New int.
22553 (getargs): Update to catch new case.
22554 * src/options.c (option_table): 'error-verbose' is a new option.
22555 (shortopts): Update.
22556
e0327bc8
AD
225572001-11-27 Akim Demaille <akim@epita.fr>
22558
22559 * src/system.h: Use intl/libgettext.h.
22560 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
22561
000f1a3c
AD
225622001-11-27 Akim Demaille <akim@epita.fr>
22563
22564 * tests/torture.at (Exploding the Stack Size with Malloc):
22565 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
22566
26cfe0be
AD
225672001-11-27 Akim Demaille <akim@epita.fr>
22568
22569 * src/files.c: Include error.h.
22570 Reported by Hans Aberg.
22571
f6bd5427
MA
225722001-11-26 Marc Autret <autret_m@epita.fr>
22573
d2079671 22574 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
22575 (read_declarations): Add case tok_include.
22576 * src/getargs.h (include): Add its extern definition.
22577 * src/getargs.c (include): New const char *.
22578 (getargs): Add case '-I'.
22579 * src/options.c (option_table): Add include as command line and
22580 percent option.
22581 * src/lex.h (token_t): Add tok_include.
22582
2ca209c1
AD
225832001-11-26 Akim Demaille <akim@epita.fr>
22584
22585 * src/reader.c (readgram): Make sure rules for mid-rule actions
22586 have a lineno equal to that of their host rule.
22587 Reported by Hans Aberg.
22588 * tests/regression.at (Rule Line Numbers): New.
22589
0e41b407
AD
225902001-11-26 Akim Demaille <akim@epita.fr>
22591
22592 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
22593 size_ts.
22594
225952001-11-26 Akim Demaille <akim@epita.fr>
22596
22597 * src/complain.c, src/complain.h (error): Remove, provided by
22598 lib/error.[ch].
22599
e0c40012
AD
226002001-11-26 Akim Demaille <akim@epita.fr>
22601
22602 * src/reader.c (read_declarations): Don't abort on tok_illegal,
22603 issue an error message.
22604 * tests/regression.at (Invalid %directive): New.
22605 Reported by Hans Aberg.
22606
5e147124
AD
226072001-11-26 Akim Demaille <akim@epita.fr>
22608
22609 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
22610 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
22611
a034c8b8
AD
226122001-11-26 Akim Demaille <akim@epita.fr>
22613
22614 * src/conflicts.c (conflicts_print): Don't complain at all when
22615 there are no reduce/reduce conflicts, and as many shift/reduce
22616 conflicts as expected.
22617 * tests/regression.at (%expect right): Adjust.
22618
c64a20f3
AD
226192001-11-23 Akim Demaille <akim@epita.fr>
22620
22621 * lib/alloca.c: Update, from fileutils.
22622
5b0d29bb
AD
226232001-11-23 Akim Demaille <akim@epita.fr>
22624
22625 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
22626
722c4bfe
AD
226272001-11-23 Akim Demaille <akim@epita.fr>
22628
22629 * src/system.h: Include alloca.h.
22630 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
22631
6255b435
AD
226322001-11-23 Akim Demaille <akim@epita.fr>
22633
22634 * src/print_graph.c (print_actions): Remove `rule', unused.
22635 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
22636 pacify GCC's signed < unsigned warnings.
22637 * src/closure.c (itemsetsize): Likewise.
22638 * src/reader.c (symbol_list_new): Static.
22639
b29b2ed5
AD
226402001-11-23 Akim Demaille <akim@epita.fr>
22641
22642 Attaching lineno to buckets is stupid, since only one copy of each
22643 symbol is kept, only the line of the first occurrence is kept too.
22644
22645 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
22646 * src/reader.c (rline_allocated): Remove, unused.
22647 (symbol_list): Have a `line' member.
22648 (symbol_list_new): New.
22649 (readgram): Use it.
22650 * src/print.c (print_grammar): Output the rule line numbers.
22651 * tests/regression.at (Solved SR Conflicts)
22652 (Unresolved SR Conflicts): Adjust.
22653 Reported by Hans Aberg.
22654
a81b1d4a
MA
226552001-11-22 Marc Autret <autret_m@epita.fr>
22656
22657 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
22658
c1ecb3c1
MA
226592001-11-22 Marc Autret <autret_m@epita.fr>
22660
22661 * src/muscle_tab.c (muscle_init): Remove initialization of
22662 skeleton muscle.
22663 * src/output.c (output_master_parser): Do it here.
22664
fbe01355
AD
226652001-11-20 Akim Demaille <akim@epita.fr>
22666
22667 * po/sv.po: New.
22668 * configure.in (ALL_LINGUAS): Adjust.
22669 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
22670 longer contains strings to translate.
22671
81e895c0
AD
226722001-11-19 Akim Demaille <akim@epita.fr>
22673
22674 * src/conflicts.c (conflicts_print): Add a missing \n.
22675
6bb1878b
AD
226762001-11-19 Akim Demaille <akim@epita.fr>
22677
22678 * src/nullable.c (nullable_print): New.
22679 (set_nullable): Call it when tracing.
22680 Better locality of variables.
22681
d9ec2d07
AD
226822001-11-19 Akim Demaille <akim@epita.fr>
22683
22684 * src/print.c (print_actions): Better locality of variables.
22685
720e5c1b
AD
226862001-11-19 Akim Demaille <akim@epita.fr>
22687
22688 * src/derives.c (print_derives): Fix and enrich.
22689 * src/closure.c (print_fderives): Likewise.
22690
fb908786
AD
226912001-11-19 Akim Demaille <akim@epita.fr>
22692
22693 * src/closure.c (itemsetend): Remove, replaced with...
22694 (itemsetsize): new.
22695
125ecb56
AD
226962001-11-19 Akim Demaille <akim@epita.fr>
22697
22698 * src/LR0.c (kernel_end): Remove, replaced with...
22699 (kernel_size): new.
22700
d8cf039f
AD
227012001-11-19 Akim Demaille <akim@epita.fr>
22702
22703 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
22704 to clarify.
22705
7bec0760
AD
227062001-11-19 Akim Demaille <akim@epita.fr>
22707
22708 * src/closure.c (closure): Use arrays instead of pointers to clarify.
22709
c87d4863
AD
227102001-11-19 Akim Demaille <akim@epita.fr>
22711
22712 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
22713 trace messages.
22714 * src/LR0.c: Likewise.
22715 (allocate_itemsets): Use arrays instead of pointers to clarify.
22716
9bfe901c
AD
227172001-11-19 Akim Demaille <akim@epita.fr>
22718
22719 * src/getargs.c (statistics_flag): Replace with...
22720 (trace_flag): New.
22721 (longopts): Accept --trace instead of --statistics.
22722 * src/getargs.h, src/options.c: Adjust.
22723 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
22724 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
22725
97db7bd4
AD
227262001-11-19 Akim Demaille <akim@epita.fr>
22727
cc72668c 22728 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
22729 pointers to clarify the code.
22730 (save_reductions, save_shifts): Factor common parts of alternatives.
22731
2c5f66ed
AD
227322001-11-19 Akim Demaille <akim@epita.fr>
22733
22734 * src/LR0.c (new_state, get_state): Complete TRACE code.
22735 * src/closure.c: Include `reader.h' to get `tags', needed by the
22736 trace code.
22737 Rename the conditional DEBUG as TRACE.
22738 Output consistently TRACEs to stderr, not stdout.
22739 * src/derives.c: Likewise.
22740 * src/reduce.c: (inaccessable_symbols): Using if is better style
22741 than goto.
22742 Use `#if TRACE' instead of `#if 0' for tracing code.
22743
300f275f
AD
227442001-11-19 Akim Demaille <akim@epita.fr>
22745
22746 * src/system.h (LIST_FREE, shortcpy): New.
22747 * src/LR0.c: Use them.
22748 * src/output.c (free_itemsets, free_reductions, free_shifts):
22749 Remove, replaced by LIST_FREE.
22750
f59c437a
AD
227512001-11-19 Akim Demaille <akim@epita.fr>
22752
22753 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
22754 (REDUCTIONS_ALLOC): New.
22755 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
22756 allocation.
22757
6986fd9e
AD
227582001-11-19 Akim Demaille <akim@epita.fr>
22759
22760 * src/LR0.c (new_state): Complete trace code.
22761 * src/nullable.c (set_nullable): Don't translate traces.
22762
4bc30f78
AD
227632001-11-19 Akim Demaille <akim@epita.fr>
22764
22765 * src/print_graph.c (print_core): Better locality of variables.
22766 * src/print.c (print_core): Likewise.
22767
08a946e0
AD
227682001-11-19 Akim Demaille <akim@epita.fr>
22769
22770 * src/vcg.c: You do the output, so you are responsible of the
22771 handling of VCG syntax, in particular: use quotearg.
22772 * src/print_graph.c: Don't.
22773 (print_actions): Don't output the actions as part of the nodes,
22774 since that's the job of the edges.
22775 (print_state): Don't output by hand: fill the node description,
9bfe901c 22776 and ask for its output.
08a946e0 22777
f0473484
AD
227782001-11-19 Akim Demaille <akim@epita.fr>
22779
cc72668c
AD
22780 * src/bison.simple (yyparse): When verbosely reporting an error,
22781 no longer put additional quotes around token names.
f0473484
AD
22782 * tests/calc.at: Adjust.
22783
e41dc700
AD
227842001-11-19 Akim Demaille <akim@epita.fr>
22785
22786 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
22787 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
22788 * src/output.c: Adjust.
22789
652a871c
AD
227902001-11-19 Akim Demaille <akim@epita.fr>
22791
22792 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
22793 (rule_t): this.
22794 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
22795
b2ed6e58
AD
227962001-11-19 Akim Demaille <akim@epita.fr>
22797
22798 * src/gram.h (rule_t): New.
22799 (rule_table): New.
22800 (rrhs, rlhs): Remove, part of state_t.
22801 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
22802 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
22803 * src/reader.c, src/reduce.c: Adjust.
22804
edad7067
AD
228052001-11-19 Akim Demaille <akim@epita.fr>
22806
22807 * src/reader.c (symbols_output): New, extracted from...
22808 (packsymbols): Here.
22809 (reader): Call it.
22810
3feec034
AD
228112001-11-19 Akim Demaille <akim@epita.fr>
22812
22813 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
22814 (maxrhs): this new function.
22815
ddcd5fdf
AD
228162001-11-19 Akim Demaille <akim@epita.fr>
22817
cc72668c 22818 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
22819 Adjust.
22820
bb527fc2
AD
228212001-11-19 Akim Demaille <akim@epita.fr>
22822
cc72668c 22823 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
22824 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22825 * src/lalr.c: Adjust.
22826
a845a697
AD
228272001-11-19 Akim Demaille <akim@epita.fr>
22828
22829 * src/lalr.c (initialize_LA): Only initialize LA. Let...
22830 (set_state_table): handle the `lookaheads' members.
22831
f004bf6a
AD
228322001-11-19 Akim Demaille <akim@epita.fr>
22833
cc72668c
AD
22834 * src/lalr.h (lookaheads): Removed array, whose contents is now
22835 a member of...
f004bf6a
AD
22836 (state_t): this structure.
22837 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22838 Adjust.
22839
de326cc0
AD
228402001-11-19 Akim Demaille <akim@epita.fr>
22841
cc72668c
AD
22842 * src/lalr.h (consistent): Removed array, whose contents is now
22843 a member of...
de326cc0
AD
22844 (state_t): this structure.
22845 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22846 Adjust.
22847
90b4416b
AD
228482001-11-19 Akim Demaille <akim@epita.fr>
22849
cc72668c
AD
22850 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
22851 contents are now members of...
90b4416b
AD
22852 (state_t): this structure.
22853 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22854 Adjust.
22855
9703cc49
AD
228562001-11-19 Akim Demaille <akim@epita.fr>
22857
22858 * src/lalr.h (state_t): New.
22859 (state_table): Be a state_t * instead of a core **.
22860 (accessing_symbol): Remove, part of state_t.
22861 * src/lalr.c: Adjust.
22862 (set_accessing_symbol): Merge into...
22863 (set_state_table): this.
22864 * src/print_graph.c, src/conflicts.c: Adjust.
22865
d803322e
AD
228662001-11-14 Akim Demaille <akim@epita.fr>
22867
22868 * tests/calc.at, tests/output.at, tests/regression.at,
22869 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
22870 now the tests are run in private dirs, therefore AC_CLEANUP and
22871 family can be simplified to 0-ary.
22872 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
22873 use abs. path to find config.h.
22874 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
22875 stderr, there can be way too much random noise.
22876 Instead pass -Werror to GCC and rely on the exit status.
22877 Reported by Wolfram Wagner.
22878
3d76b07d
AD
228792001-11-14 Akim Demaille <akim@epita.fr>
22880
22881 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
22882 defined only if yyoverflow is defined, to avoid `warning: unused
22883 variable `yyvs1''.
22884 Reported by The Test Suite.
22885
09b503c8
AD
228862001-11-14 Akim Demaille <akim@epita.fr>
22887
22888 * src/print.c: Include reduce.h.
22889 Reported by Hans Aberg.
22890
228912001-11-14 Akim Demaille <akim@epita.fr>
22892
22893 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
22894 Revert a previous patch: these are really const.
22895 * src/conflicts.c (conflict_report): Additional useless pair of
22896 braces to pacify GCC's warnings for `if () if () {} else {}'.
22897 * src/lex.c (parse_percent_token): Replace equal_offset with
22898 arg_offset.
22899 arg is const.
22900 Be sure to strdup `arg' when used, since there is no reason for
22901 token_buffer not to change.
22902
0f37a994
AD
229032001-11-14 Akim Demaille <akim@epita.fr>
22904
22905 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
22906 definition.
22907 * src/main.c (main): Use them.
22908 Suggested by Hans Aberg.
22909
d39d93b8
AD
229102001-11-12 Akim Demaille <akim@epita.fr>
22911
22912 * src/system.h (ngettext): Now that we use ngettext, be sure to
22913 provide a default definition when NLS are not used.
22914
9edcd895
AD
229152001-11-12 Akim Demaille <akim@epita.fr>
22916
22917 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
22918 Use @kbd to denote user input.
22919 (Language and Grammar): ANSIfy the example.
22920 Adjust its layout for info/notinfo.
22921 (Location Tracking Calc): Output error messages to stderr.
22922 Output locations in a more GNUtically correct way.
22923 Fix a couple of Englishos.
22924 Adjust @group/@end group pairs.
22925
7da99ede
AD
229262001-11-12 Akim Demaille <akim@epita.fr>
22927
e3aa65c5 22928 %expect was not functioning at all.
7da99ede
AD
22929
22930 * src/conflicts.c (expected_conflicts): Set to -1.
22931 (conflict_report): Use ngettext.
22932 (conflicts_print): Check %expect and make its violation an error.
22933 * doc/bison.texinfo (Expect Decl): Adjust.
22934 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
22935 * tests/regression.at (%expect not enough, %expect right)
22936 (%expect too much): New.
22937
ba9dda1a
AD
229382001-11-12 Akim Demaille <akim@epita.fr>
22939
22940 * tests/regression.at (Conflicts): Rename as...
22941 (Unresolved SR Conflicts): this.
22942 (Solved SR Conflicts): New.
22943
337c5bd1
AD
229442001-11-12 Akim Demaille <akim@epita.fr>
22945
22946 * src/reduce.c (print_results): Rename as...
22947 (reduce_output): This.
22948 Output to OUT, passed as argument, instead of output_obstack.
22949 (dump_grammar): Likewise.
22950 (reduce_free): New.
22951 Also free V1.
22952 (reduce_grammar): No longer call reduce_output, since...
22953 * src/print.c (print_results): do it.
22954 * src/main.c (main): Call reduce_free;
22955
c73a41af
AD
229562001-11-12 Akim Demaille <akim@epita.fr>
22957
22958 * src/conflicts.c (print_reductions): Accept OUT as argument.
22959 Output to it, not to output_obstack.
22960 * src/print.c (print_actions): Adjust.
22961
0df87bb6
AD
229622001-11-12 Akim Demaille <akim@epita.fr>
22963
22964 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
22965 the result instead of using...
22966 (src_total, rrc_total, src_count, rrc_count): Remove.
22967 (any_conflicts): Remove.
22968 (print_conflicts): Split into...
22969 (conflicts_print, conflicts_output): New.
22970 * src/conflicts.h: Adjust.
22971 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 22972 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
22973 * tests/regression.at (Conflicts): New.
22974 Reported by Tom Lane.
22975
e4d3d4de
AD
229762001-11-12 Akim Demaille <akim@epita.fr>
22977
22978 * tests/regression.at (Invalid input): Remove, duplicate with
22979 ``Invalid input: 1''.
22980
6d7d248e
AD
229812001-11-12 Akim Demaille <akim@epita.fr>
22982
22983 * tests/torture.at (AT_DATA_STACK_TORTURE)
22984 (Exploding the Stack Size with Alloca)
22985 (Exploding the Stack Size with Malloc): New.
22986
e9e4c321
AD
229872001-11-12 Akim Demaille <akim@epita.fr>
22988
22989 * src/bison.simple (YYSTACK_REALLOC): New.
22990 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 22991 Reported by Per Allansson.
e9e4c321 22992
5f7e0832
AD
229932001-11-12 Pascal Bart <pascal.bart@epita.fr>
22994
22995 * src/bison.simple: Define type yystype instead of YYSTYPE, and
22996 define CPP macro, which substitute YYSTYPE by yystype.
22997 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
22998 with yyltype/YYLTYPE. This allows inclusion of the generated
22999 header within the parser if the compiler, such as GGC, accepts
23000 multiple equivalent #defines.
23001 From Akim.
23002
e3f1699f
AD
230032001-11-05 Akim Demaille <akim@epita.fr>
23004
23005 * src/reader.c (symbols_output): New, extracted from...
23006 (packsymbols): here.
23007 (reader): Adjust.
23008
65be0866
AD
230092001-11-05 Akim Demaille <akim@epita.fr>
23010
23011 * src/lex.c (parse_percent_token): s/quotearg/quote/.
23012
e4d910bf
AD
230132001-11-05 Akim Demaille <akim@epita.fr>
23014
23015 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
23016 pattern.
23017
951366c1
AD
230182001-11-05 Akim Demaille <akim@epita.fr>
23019
23020 * src/options.h (struct option_table_struct): set_flags is void*.
23021 * src/options.c (longopts): Support `--output' and `%output'.
23022 (usage): Adjust.
23023 * src/lex.h (tok_setopt): Remove, replaced with...
23024 (tok_intopt, tok_stropt): these new guys.
23025 * src/lex.c (getopt.h): Not needed.
23026 (token_buffer, unlexed_token_buffer): Not const.
23027 (percent_table): Promote `-' over `_' in directive names.
23028 Active `%name-prefix', `file-prefix', and `output'.
23029 (parse_percent_token): Accept possible arguments to directives.
23030 Promote `-' over `_' in directive names.
23031
d8988b2f
AD
230322001-11-04 Akim Demaille <akim@epita.fr>
23033
23034 * doc/bison.texinfo (Decl Summary): Split the list into
23035 `directives for grammars' and `directives for bison'.
23036 Sort'em.
23037 Add description of `%name-prefix', `file-prefix', and `output'.
23038 Promote `-' over `_' in directive names.
23039 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
23040 Simplify the description of `--name-prefix'.
23041 Promote `-' over `_' in directive names.
23042 Promote `--output' over `--output-file'.
23043 Fix the description of `--defines'.
23044 * tests/output.at: Exercise %file-prefix and %output.
23045
6468d18e
AD
230462001-11-02 Akim Demaille <akim@epita.fr>
23047
23048 * doc/refcard.tex: Update.
23049
6b7e85b9
AD
230502001-11-02 Akim Demaille <akim@epita.fr>
23051
23052 * src/symtab.h (SUNDEF): New.
23053 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
23054 stand for `uninitialized', instead of 0.
23055 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
23056 * src/lex.c (lex): Adjust.
23057
23058 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
23059 Number it 0.
23060 Let yylex return it instead of a plain 0.
23061 Reported by Dick Streefland.
23062
cd5aafcf
AD
230632001-11-02 Akim Demaille <akim@epita.fr>
23064
23065 * tests/regression.at (Mixing %token styles): New test.
23066
037ca2f1
AD
230672001-11-02 Akim Demaille <akim@epita.fr>
23068
23069 * src/reader.c (parse_thong_decl): Formatting changes.
23070 (token_translations_init): New, extracted from...
23071 (packsymbols): Here.
23072 Adjust.
23073
270a173c
AD
230742001-11-01 Akim Demaille <akim@epita.fr>
23075
23076 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
23077 Check that `9foo.y' produces correct cpp guards.
23078 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
23079 guards.
23080 Reported by Wwp.
23081
561f9a30
AD
230822001-11-01 Akim Demaille <akim@epita.fr>
23083
23084 * tests/regression.at (Invalid input: 2): New.
23085 * src/lex.c (unlexed_token_buffer): New.
23086 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
23087 too.
23088 Reported by Wwp.
23089
f987e9d2
AD
230902001-11-01 Akim Demaille <akim@epita.fr>
23091
23092 * tests/calc.at: Catch up with 1.30.
23093 * configure.in: Bump to 1.49a.
23094 Adjust to newer Autotest.
23095
0846f581
PB
230962001-10-19 Pascal Bart <pascal.bart@epita.fr>
23097
23098 * src/conflicts.c: Move global variables rrc_total and src_total ...
23099 (print_conflicts): here.
23100 * src/output.c (output): Free global variable user_toknums.
23101 * src/lex.c (token_obstack): Become static.
23102
3c1a79b3
AD
231032001-10-18 Akim Demaille <akim@epita.fr>
23104
23105 * tests/atlocal.in (GCC): Add.
23106 * tests/calc.at: s/m4_match/m4_bmatch/.
23107 s/m4_patsubst/m4_bpatsubst/.
23108 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
23109 * configure.in: AC_SUBST(GCC).
23110
5d52e7d0
MA
231112001-10-14 Marc Autret <autret_m@epita.fr>
23112
23113 * src/options.c (create_long_option_table): Fix.
23114
631aa1d3
AD
231152001-10-10 Akim Demaille <akim@epita.fr>
23116
23117 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
23118
f6ec6d13
AD
231192001-10-04 Akim Demaille <akim@epita.fr>
23120
23121 * src/reader.c (parse_union_decl): Push the caracters in
23122 union_obstack, not attrs_obstack.
23123
342b8b6e
AD
231242001-10-04 Akim Demaille <akim@epita.fr>
23125
23126 Merge in the branch 1.29.
23127
23128 * src/reader.c (packsymbols): Use a temporary obstack for
23129 `%%tokendef', since output_stack is already used elsewhere.
23130
23131 2001-10-02 Akim Demaille <akim@epita.fr>
23132
23133 Bump 1.29d.
23134
23135 2001-10-02 Akim Demaille <akim@epita.fr>
23136
23137 Version 1.29c.
23138
23139 2001-10-02 Akim Demaille <akim@epita.fr>
23140
23141 * tests/regression.at (Invalid CPP headers): New.
23142 From Alexander Belopolsky.
23143 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
23144
23145 2001-10-02 Akim Demaille <akim@epita.fr>
23146
23147 * tests/regression.at (Invalid input): New.
23148 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
23149 Reported by Shura.
23150
23151 2001-10-02 Akim Demaille <akim@epita.fr>
23152
23153 * tests/calc.at: Now that --debug works, the tests must be adjusted.
23154
23155 2001-10-02 Akim Demaille <akim@epita.fr>
23156
23157 * src/output.c (output_parser): Assert `skeleton'.
23158 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
23159 systems.
23160 From Shura.
23161
23162 2001-10-01 Marc Autret <autret_m@epita.fr>
23163
23164 * src/lex.h: Echo modifications.
23165 * src/lex.c (unlex): Parameter is now token_t.
23166 From Hans Aberg.
23167
23168 2001-10-01 Marc Autret <autret_m@epita.fr>
23169
23170 * src/main.c: Include lex.h.
23171 From Hans Aberg.
23172
23173 2001-09-29 Akim Demaille <akim@epita.fr>
23174
23175 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
23176
23177 2001-09-28 Akim Demaille <akim@epita.fr>
23178
23179 * tests/testsuite.at: Update to newer Autotest.
23180 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
23181
23182 2001-09-27 Akim Demaille <akim@epita.fr>
23183
23184 Position independent wrapper.
23185
23186 * tests/bison: Remove.
23187 * tests/bison.in: New.
23188 * configure.in: Adjust.
23189
23190 2001-09-27 Paul Eggert <eggert@twinsun.com>
23191
23192 Port quotearg fixes from tar 1.13.24.
23193
23194 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
23195 tm to be declared.
23196 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
23197 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
23198
23199 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
23200 * m4/mbrtowc.m4: New file.
23201 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
23202 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
23203
23204 2001-09-27 Akim Demaille <akim@epita.fr>
23205
23206 Bump to 1.29c.
23207
23208 2001-09-27 Akim Demaille <akim@epita.fr>
23209
23210 Version 1.29b.
23211
23212 2001-09-25 Akim Demaille <akim@epita.fr>
23213
23214 * src/system.h: Include `xalloc.h'.
23215 Remove it from the C files.
23216 * src/files.c (output_files): Free the obstacks.
23217 * src/lex.c (init_lex): Rename as...
23218 (lex_init): this.
23219 (lex_free): New.
23220 * src/main.c (main): Use it.
23221
23222 2001-09-24 Marc Autret <autret_m@epita.fr>
23223
23224 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
23225 to output informations in fout (FILE*).
23226 (open_graph, close_graph): Likewise.
23227 (output_graph, output_edge, output_node): Likewise.
23228 * src/vcg.h: Update function prototypes.
23229 * src/print_graph.c (print_graph): Open output graph file.
23230 (print_actions): Adjust.
23231 * src/files.h: Remove extern declaration.
23232 * src/files.c: Remove graph_obstack declaration.
23233 (open_files): Remove graph_obstack initialization.
23234 (output_files): Remove graph_obstack saving.
23235
23236 2001-09-24 Marc Autret <autret_m@epita.fr>
23237
23238 * src/files.c (compute_output_file_names): Fix.
23239
23240 2001-09-24 Marc Autret <autret_m@epita.fr>,
23241 Akim Demaille <akim@epita.fr>
23242
23243 * src/reader.c (reader): Remove call to free_symtab ().
23244 * src/main.c (main): Call it here.
23245 Include symtab.h.
23246 * src/conflicts.c (initialize_conflicts): Rename as...
23247 (solve_conflicts): this.
23248 * src/print.c (print_core, print_actions, print_state)
23249 (print_grammar): Dump to a file instead a `output_obstack'.
23250 (print_results): Dump `output_obstack', and then proceed with the
23251 FILE *.
23252 * src/files.c (compute_output_file_names, close_files): New.
23253 (output_files): Adjust.
23254 * src/main.c (main): Adjust.
23255
23256 2001-09-23 Marc Autret <autret_m@epita.fr>
23257
23258 * src/files.c (compute_header_macro): Computes header macro name
23259 from spec_defines_file when given.
23260
23261 2001-09-23 Marc Autret <autret_m@epita.fr>
23262
23263 * src/files.c (output_files): Add default extensions.
23264
23265 2001-09-22 Akim Demaille <akim@epita.fr>
23266
23267 * src/conflicts.c (finalize_conflicts): Rename as...
23268 (free_conflicts): this.
23269
23270 2001-09-22 Akim Demaille <akim@epita.fr>
23271
23272 * src/gram.c (gram_free): Rename back as...
23273 (dummy): this.
23274 (output_token_translations): Free `token_translations'.
23275 * src/symtab.c (free_symtab): Free the tag field.
23276
23277 2001-09-22 Akim Demaille <akim@epita.fr>
23278
23279 Remove `translations' as it is always set to true.
23280
23281 * src/gram.h: Adjust.
23282 * src/reader.c (packsymbols, parse_token_decl): Adjust
23283 * src/print.c (print_grammar): Adjust.
23284 * src/output.c (output_token_translations): Adjust.
23285 * src/lex.c (lex): Adjust.
23286 * src/gram.c: Be sure the set pointers to NULL.
23287 (dummy): Rename as...
23288 (gram_free): this.
23289
23290 2001-09-22 Akim Demaille <akim@epita.fr>
23291
23292 * configure.in: Invoke AM_LIB_DMALLOC.
23293 * src/system.h: Use dmalloc.
23294 * src/LR0.c: Be sure to have pointers initialized to NULL.
23295 (allocate_itemsets): Allocate kernel_items only if needed.
23296
23297 2001-09-22 Akim Demaille <akim@epita.fr>
23298
23299 * configure.in: Bump to 1.29b.
23300 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
23301 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
23302 need xmalloc.c in calc.y.
23303 From Pascal Bart.
23304
23305 2001-09-21 Akim Demaille <akim@epita.fr>
23306
23307 Version 1.29a.
23308 * Makefile.maint, config/config.guess, config/config.sub,
23309 * config/missing: Update from masters.
23310 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
23311 upon package.m4.
23312 * configure.in (ALL_LINGUAS): Add `tr'.
23313
23314 2001-09-21 Akim Demaille <akim@epita.fr>
23315
23316 * tests/Makefile.am (package.m4): Move to...
23317 ($(srcdir)/$(TESTSUITE)): here.
23318
23319 2001-09-20 Akim Demaille <akim@epita.fr>
23320
23321 * src/complain.c: No longer try to be standalone: use system.h.
23322 Don't assume __STDC__ is defined to 1. Just test if it is defined.
23323 * src/complain.h: Likewise.
23324 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
23325 Remove the unused variable `n'.
23326 From Albert Chin-A-Young.
23327
23328 2001-09-18 Marc Autret <autret_m@epita.fr>
23329
23330 * doc/bison.1: Update.
23331 * doc/bison.texinfo (Bison Options): Update --defines and --graph
23332 descriptions.
23333 (Option Cross Key): Update.
23334 Add --graph.
23335
23336 2001-09-18 Marc Autret <autret_m@epita.fr>
23337
23338 * tests/regression.at: New test (comment in %union).
23339
23340 2001-09-18 Marc Autret <autret_m@epita.fr>
23341
23342 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
23343 do that.
23344 Reported by Keith Browne.
23345
23346 2001-09-18 Marc Autret <autret_m@epita.fr>
23347
23348 * tests/output.at: Add tests for --defines and --graph.
23349
23350 2001-09-18 Marc Autret <autret_m@epita.fr>
23351
23352 * tests/output.at: Removes tests of %{header,src}_extension features.
23353
23354 2001-09-18 Akim Demaille <akim@epita.fr>
23355
23356 * tests/Makefile.am (package.m4): New.
23357 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
23358 (_AT_CHECK_CALC_ERROR): Likewise.
23359 Factor the `, ' part of verbose error messages.
23360
23361 2001-09-18 Marc Autret <autret_m@epita.fr>
23362
23363 * src/getargs.c (longopts): Declare --defines and --graph as options
23364 with optional arguments.
23365 * src/files.h: Add extern declarations.
23366 * src/files.c (spec_graph_file, spec_defines_file): New.
23367 (output_files): Update.
23368 Remove CPP-outed code.
23369
23370 2001-09-18 Marc Autret <autret_m@epita.fr>
23371
23372 Turn off %{source,header}_extension feature.
23373
23374 * src/files.c (compute_exts_from_gf): Update.
23375 (compute_exts_from_src): Update.
23376 (output_files): CPP-out useless code.
23377 * src/files.h: Remove {header,source}_extension extern declarations.
23378 * src/reader.c (parse_dquoted_param): CPP-out.
23379 (parse_header_extension_decl): Remove.
23380 (parse_source_extension_decl): Remove.
23381 (read_declarations): Remove cases tok_{hdrext,srcext}.
23382 * src/lex.c (percent_table): Remove {header,source}_extension entries.
23383 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
23384
23385 2001-09-10 Akim Demaille <akim@epita.fr>
23386
23387 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
23388 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
23389 (AT_CHECK_OUTPUT): this.
23390 Merely check ls' exit status, its output is useless.
23391
23392 2001-09-10 Akim Demaille <akim@epita.fr>
23393
23394 * tests/calc.at: Use m4_match.
23395 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
23396
23397 2001-09-10 Marc Autret <autret_m@epita.fr>,
23398 Akim Demaille <akim@epita.fr>
23399
23400 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
23401 enum color_e.
23402 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
23403 to `normal'.
23404 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
23405 * src/lex.h: Adjust prototype.
23406 (token_t): Add `tok_undef'.
23407 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
23408 (parse_percent_token): Now returns token_t.
23409 Add default statement in switch.
23410 (lex): Separate `c' as an input variable, from the token_t result
23411 part.
23412 (unlexed): Is a token_t.
23413
23414 2001-09-10 Akim Demaille <akim@epita.fr>
23415
23416 * configure.in: Bump to 1.29a.
23417
23418 2001-09-07 Akim Demaille <akim@epita.fr>
23419
23420 Version 1.29.
23421
23422 2001-08-30 Akim Demaille <akim@epita.fr>
23423
23424 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
23425 * m4/atconfig.m4: Remove.
23426 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
23427 * tests/bison: New.
23428 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
23429 m4_if, m4_patsubst, and m4_regexp.
23430 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
23431 `input' file instead of echo.
23432
23433 2001-08-29 Akim Demaille <akim@epita.fr>
23434
23435 Bump to 1.28e.
23436
23437 2001-08-29 Akim Demaille <akim@epita.fr>
23438
23439 Version 1.28d.
23440
23441 2001-08-29 Paul Eggert <eggert@twinsun.com>
23442
23443 * src/bison.simple (yyparse): Don't take the address of an
23444 item before the start of an array, as that doesn't conform to
23445 the C Standard.
23446
23447 2001-08-29 Robert Anisko <anisko_r@epita.fr>
23448
23449 * doc/bison.texinfo (Location Tracking Calc): New node.
23450
23451 2001-08-29 Paul Eggert <eggert@twinsun.com>
23452
23453 * src/output.c (output): Do not define const, as this now
23454 causes more problems than it cures.
23455
23456 2001-08-29 Akim Demaille <akim@epita.fr>
23457
23458 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
23459 the nodes.
23460 Be sure to tag the `detailmenu'.
23461
23462 2001-08-29 Akim Demaille <akim@epita.fr>
23463
23464 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
23465 download in a tmp dir.
23466
23467 2001-08-28 Marc Autret <autret_m@epita.fr>
23468
23469 * config/depcomp: New file.
23470
23471 2001-08-28 Marc Autret <autret_m@epita.fr>
23472
23473 * doc/bison.1 (mandoc): Adjust.
23474 From Juan Manuel Guerrero.
23475
23476 2001-08-28 Marc Autret <autret_m@epita.fr>
23477
23478 * src/print_graph.c (print_state): Fix.
23479
23480 2001-08-27 Marc Autret <autret_m@epita.fr>
23481
23482 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
23483 char * members.
23484 Echo modifications to the functions prototypes.
23485 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
23486
23487 2001-08-27 Marc Autret <autret_m@epita.fr>
23488
23489 * src/vcg.c: Include `xalloc.h'.
23490 (add_colorentry): New.
23491 (add_classname): New.
23492 (add_infoname): New.
23493 * src/vcg.h: Add new prototypes.
23494
23495 2001-08-27 Akim Demaille <akim@epita.fr>
23496
23497 * Makefile.maint: Sync. again with CVS Autoconf.
23498
23499 2001-08-27 Akim Demaille <akim@epita.fr>
23500
23501 * Makefile.maint: Formatting changes.
23502 (po-update, cvs-update, update): New targets.
23503 (AMTAR): Remove.
23504
23505 2001-08-27 Akim Demaille <akim@epita.fr>
23506
23507 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
23508 * Makefile.maint: Sync. with CVS Autoconf.
23509
23510 2001-08-27 Marc Autret <autret_m@epita.fr>
23511
23512 * src/vcg.h (struct infoname_s): New.
23513 (struct colorentry_s): New.
23514 (graph_s): New fields {vertical,horizontal}_order in structure.
23515 Add `infoname' field.
23516 Add `colorentry' field;
23517 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
23518 (G_HORIZONTAL_ORDER): New.
23519 (G_INFONAME): New.
23520 (G_COLORENTRY): New.
23521 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
23522 Add output of `infoname'.
23523 Add output of `colorentry'.
23524
23525 2001-08-27 Marc Autret <autret_m@epita.fr>
23526
23527 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
23528 This one shadowed a global parameter.
23529
23530 2001-08-24 Marc Autret <autret_m@epita.fr>
23531
23532 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
23533 instead of `unsigned'.
23534 (print_state): Do not call obstack_object_size () in obstack_grow ()
23535 to avoid macro variables shadowing.
23536
23537 2001-08-23 Marc Autret <autret_m@epita.fr>
23538
23539 * src/lex.c (percent_table): Typo: s/naem/name/.
23540 Add graph option.
23541 Normalize new options declarations.
23542
23543 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
23544
23545 * tests/suite.at: Exercise %header_extension and %source_extension.
23546
23547 2001-08-16 Marc Autret <autret_m@epita.fr>
23548
23549 * src/reader.c (parse_dquoted_param): New.
23550 (parse_header_extension_decl): Use it.
23551 (parse_source_extension_decl): Likewise.
23552
23553 2001-08-16 Marc Autret <autret_m@epita.fr>
23554
23555 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
23556 (get_xxxx_str): Use assert () instead of complain ().
23557 Remove return invokations in default cases.
23558 (get_decision_str): Modify default behaviour. Remove second argument.
23559 Echo modifications on calls.
23560 (output_graph): Fix.
23561
23562 2001-08-16 Marc Autret <autret_m@epita.fr>
23563
23564 * src/getargs.c (usage): Update with ``-g, --graph''.
23565
23566 2001-08-16 Marc Autret <autret_m@epita.fr>
23567
23568 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
23569 (Option Cross Key): Likewise.
23570 * doc/bison.1: Update.
23571
1c8c2190
PB
235722001-09-25 Pascal Bart <pascal.bart@epita.fr>
23573
23574 * src/output.c (output_master_parser): Don't finish action_obstack.
23575 (output_parser): Don't care about the muscle action, here.
23576 (prepare): Copy the action_obstack in the action muscle.
23577 (output): Free action_obstack.
23578
180d45ba
PB
235792001-09-23 Pascal Bart <pascal.bart@epita.fr>
23580
23581 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
23582 will contain `%union' declaration.
23583 (parse_union_decl): Delete #line directive output.
23584 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
23585 informations about %union.
23586 (parse_union_decl): Copy the union_obstack in the muscle stype.
23587 * src/bison.simple: Add new #line directive.
23588 Add typdef %%stype YYSTYPE.
23589
c51d1a19
PB
235902001-09-23 Pascal Bart <pascal.bart@epita.fr>
23591
23592 * src/bison.simple: Add new `#line' directive.
23593
6f9344da
PB
235942001-09-22 Pascal Bart <pascal.bart@epita.fr>
23595
23596 * src/bison.simple: New `#line' directive.
23597 * src/output.c (output_parser): Support new dynamic muscle input_line.
23598
652def80
MA
235992001-09-22 Marc Autret <autret_m@epita.fr>
23600
23601 * src/output.c (output_master_parser): New.
23602 (output_parser): Be more re-entrant.
23603
25b222fa
MA
236042001-09-21 Marc Autret <autret_m@epita.fr>
23605
23606 * src/reader.c (copy_definition, parse_union_decl): Update and use
23607 `linef' muscle.
23608 (copy_action): Likewise.
23609 Use obstack_1grow ().
23610 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
23611
6bc35ae5
MA
236122001-09-21 Marc Autret <autret_m@epita.fr>
23613
23614 * src/options.c (option_table): Adjust.
23615 * src/lex.c (parse_percent_token): Fix.
23616
c0629aa1
PB
236172001-09-20 Pascal Bart <pascal.bart@epita.fr>
23618
23619 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 23620
82b6d266
PB
236212001-09-20 Pascal Bart <pascal.bart@epita.fr>
23622
23623 * src/lex.c (parse_percent_token): Change type of variable `tx', which
23624 is now an option_table_struct*.
23625 (option_strcmp): New function option_strcmp.
23626 (parse_percent_token): Call option_strcmp.
23627 * src/getargs.c (xalloc.h, options.h): Include it.
23628 (getargs): Call create_long_option_table.
23629 (getargs): Free longopts at the end of the function.
23630 (shortopts): Move in options.c.
23631 * src/options.c (create_long_option_table): New function. Convert
23632 information from option_table to option structure.
23633 * src/reader.c (options.h): Include it.
23634
23635 * src/Makefile.am: Adjust.
23636 * src/options.c (option_table): Create from longopts and percent_table.
23637 * src/getargs.c (longopts): Delete.
23638 * src/lex.c (struct percent_table_struct): Delete.
23639 (percent_table): Delete.
23640 (options.h): Include it.
23641 * src/options.c: Create.
23642 * src/options.h: Create.
23643 Declare enum opt_access_e.
23644 Define struct option_table_struct.
23645
75f5aaea
MA
236462001-09-20 Marc Autret <autret_m@epita.fr>
23647
23648 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
23649 sections of Bison.
23650
f508cb0a
PB
236512001-09-19 Pascal Bart <pascal.bart@epita.fr>
23652
23653 * src/bison.simple: s/%%filename/%%skeleton.
23654 * src/muscle_tab.c (getargs.h): Include it.
23655 (muscle_init): Insert new muscle skeleton.
23656
13105fc1
PB
236572001-09-18 Pascal Bart <pascal.bart@epita.fr>
23658
23659 * src/output.c (output_parser): Delete unused variable actions_dumped.
23660
b0c4483e
PB
236612001-09-07 Pascal Bart <pascal.bart@epita.fr>
23662
23663 * src/output.c (output): Delete call to reader_output_yylsp.
23664 * src/reader.c (reader): Likewise.
ba0fe3c7 23665 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 23666
11d82f03
MA
236672001-09-02 Marc Autret <autret_m@epita.fr>
23668
23669 * src/reader.c: Include muscle_tab.h.
23670 (parse_union_decl): Update.
23671 (parse_macro_decl): Rename parse_muscle_decl.
23672 Update to use renamed functions and variable.
23673 (read_declarations, copy_action, read_additionnal_code, : Updated
23674 with correct variables and functions names.
23675 (packsymbols, reader): Likewise.
342b8b6e 23676
11d82f03 23677 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 23678
11d82f03
MA
23679 * src/output.c: Include muscle_tab.h
23680 In all functions using macro_insert, change by using muscle_insert ().
23681 (macro_obstack): Rename muscle_obstack.
23682 Echo modifications in the whole file.
23683 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
23684 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
23685 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
23686
23687 * src/muscle_tab.h: Update double inclusion macros.
23688 (macro_entry_s): Rename muscle_entry_s.
23689 Update prototypes.
342b8b6e 23690
11d82f03
MA
23691 * src/muscle_tab.c: Include muscle_tab.h.
23692 Rename macro_tabble to muscle_table.
23693 (mhash1, mhash2, mcmp): Use muscle_entry.
23694 (macro_init): Rename muscle_init. Update.
23695 (macro_insert): Rename muscle_insert. Update.
23696 (macro_find): Rename muscle_find. Update.
23697
23698 * src/main.c: Include muscle_tab.h.
23699 (main): Call muscle_init ().
23700 * src/Makefile.am (bison_SOURCES): Echo modifications.
23701
93a37297
MA
237022001-09-02 Marc Autret <autret_m@epita.fr>
23703
f753cd62 23704 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 23705
f753cd62
MA
23706 * src/muscle_tab.c, src/muscle_tab.h: Add files.
23707
237082001-09-02 Marc Autret <autret_m@epita.fr>
23709
23710 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 23711
682d48cd
PB
237122001-09-01 Pascal Bart <pascal.bart@epita.fr>
23713
342b8b6e 23714 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
23715 filename.
23716
087c8fda
MA
237172001-09-01 Marc Autret <autret_m@epita.fr>
23718
23719 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
23720 to an explicit value to activate the feature. We do it here.
23721
dda680cb
PB
237222001-08-31 Pascal Bart <pascal.bart@epita.fr>
23723
23724 * src/output.c (prepare): Delete the `filename' muscule insertion.
23725 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
23726 (parse_union_decl): Likewise.
23727 * src/macrotab.c (macro_init): Initialize filename by infile.
23728
9e644e64
MA
237292001-08-31 Marc Autret <autret_m@epita.fr>
23730
23731 * src/bison.simple (YYLSP_NEEDED): New definition.
23732 * src/output.c (prepare): Add macro insertion of `locations_flag'
23733
17da6427
PB
237342001-08-31 Pascal Bart <pascal.bart@epita.fr>
23735
23736 * src/output.c (prepare): Delete insertion of previous muscles,
23737 and insert the `prefix' muscles.
23738 * src/macrotab.c (macro_init): Likewise.
23739 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 23740 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
23741 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
23742 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 23743 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
23744 name_prefix.
23745
e8cb70b9
PB
237462001-08-31 Pascal Bart <pascal.bart@epita.fr>
23747
23748 * src/main.c (main): Standardize.
23749 * src/output.c (output_table_data, output_parser): Likewise.
23750 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
23751
63c2d5de
MA
237522001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
23753
342b8b6e 23754 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
23755 %%epilogue.
23756 * src/output.c (output): Rename %%declarations to %%prologue.
23757 * src/bison.simple: Echo modifications.
342b8b6e 23758
d8cb5183
MA
237592001-08-31 Marc Autret <autret_m@epita.fr>
23760
23761 * src/reader.c (readgram): CleanUp.
23762 (output_token_defines): Likewise.
23763 (packsymbols): Likewise.
23764 (reader): Likewise.
23765 * src/output.c (output): CPP-out useless code.
23766
6c686258
PB
237672001-08-31 Pascal Bart <pascal.bart@epita.fr>
23768
342b8b6e 23769 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
23770 output_trailers and output_headers.
23771 * src/output.h: Remove obsolete functions prototypes of output_headers
23772 and output_trailers.
23773
8f451ef7
PB
237742001-08-30 Pascal Bart <pascal.bart@epita.fr>
23775
23776 * src/main.c: Include macrotab.h.
342b8b6e 23777 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
23778 Adjust functions prototypes.
23779 * src/macrotab.c (macro_insert): Constify key and value.
23780 (macro_find): Constify key.
23781 (macro_insert): Include 'xalloc.h'
23782 (macro_insert): Use XMALLOC.
23783 (macro_find): Constify return value.
23784 * src/output.c (output_table_data): Rename table to table_data.
23785 (output_parser): Constify macro_key, macro_value.
23786
997b6fd0 237872001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
23788
23789 * src/reader.c (parse_skel_decl): New.
342b8b6e 23790 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
23791 * src/lex.h (token_t): New token `tok_skel'.
23792 * src/lex.c (percent_table): Add skeleton option entry.
23793 Standardize.
23794
ff48177d
MA
237952001-08-29 Marc Autret <autret_m@epita.fr>
23796
23797 * src/bison.simple: Add %%user_code directive at the end.
23798 * src/reader.c (read_additionnal_code): New.
23799 (reader): Use it.
23800 * src/output.c (output_program): Remove.
23801 (output): Update.
23802
b33160bf
MA
238032001-08-28 Marc Autret <autret_m@epita.fr>
23804
23805 * src/output.c (output_actions): Clean up.
4e5caae2 23806 (output_gram): CPP-out useless code.
b33160bf
MA
23807 * src/reader.c (reader): Clean up, CPP-out useless code.
23808
d1a2daf7
PB
238092001-08-28 Pascal Bart <pascal.bart@epita.fr>
23810
342b8b6e 23811 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 23812 directive.
d1a2daf7
PB
23813 * src/bison.simple: Add `%%definitions'.
23814
2b763dfe
MA
238152001-08-28 Marc Autret <autret_m@epita.fr>
23816
23817 * config/depcomp: New file.
23818
f1a87ef6
PE
238192001-08-27 Paul Eggert <eggert@twinsun.com>
23820
23821 * src/bison.simple (yyparse): Don't take the address of an
23822 item before the start of an array, as that doesn't conform to
23823 the C Standard.
23824
82e236e2
RA
238252001-08-27 Robert Anisko <robert.anisko@epita.fr>
23826
f1a87ef6 23827 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
23828 obstack. It was done too late here.
23829
23830 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
23831 completely wrong.
23832 (reader): Initialize the macro obstack here, since we need it to grow
23833 '%define' directives.
23834
23835 * src/reader.h: Declare the macro obstack as extern.
23836
b0cfa28a
RA
238372001-08-27 Robert Anisko <robert.anisko@epita.fr>
23838
23839 * src/output.c (output_parser): Fix. Store single '%' characters in
23840 the output obstack instead of throwing them away.
23841
6fc74234
AD
238422001-08-27 Akim Demaille <akim@epita.fr>
23843
23844 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
23845
9c76d118
RA
238462001-08-25 Robert Anisko <robert.anisko@epita.fr>
23847
23848 * lib/Makefile.am: Adjust.
23849
a8289c62
RA
238502001-08-25 Robert Anisko <robert.anisko@epita.fr>
23851
23852 * src/bison.simple: Update and add '%%' directives.
23853
b6610515
RA
238542001-08-25 Robert Anisko <robert.anisko@epita.fr>
23855
23856 * src/reader.c (reader): Remove calls to 'output_headers' and
23857 'output_trailers'. Remove some C output.
23858 (readgram): Disable a piece of code that was writing a default
23859 definition for 'YYSTYPE'.
23860 (reader_output_yylsp): Remove.
23861 (packsymbols): Output token defintions to a macro.
23862 (copy_definition): Disable C output.
6fc74234 23863
b6610515
RA
23864 * src/reader.c (parse_macro_decl): New function used to parse macro
23865 declarations.
23866 (copy_string2): Put the body of copy_string into this new function.
23867 Add a parameter to let the caller choose whether he wants to copy the
23868 string delimiters or not.
23869 (copy_string): Be a simple call to copy_string2 with the last argument
23870 bound to true.
23871 (read_declarations): Add case for macro definition.
23872 (copy_identifier): New.
6fc74234 23873 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
23874 rather than lex.
23875
26f609ff
RA
238762001-08-25 Robert Anisko <robert.anisko@epita.fr>
23877
23878 * src/output.c (prepare): Add prefixed names.
23879 (output_parser): Output semantic actions.
23880 (output_parser): Fix bug on '%%line' directives.
6fc74234 23881
26f609ff
RA
23882 * src/output.c (output_headers): Remove. The C code printed by this
23883 function should now be in the skeletons.
23884 (output_trailers): Remove.
23885 (output): Disable call to 'reader_output_yylsp'.
23886 (output_rule_data): Do not output tables to the table obstack.
23887
23888 * src/output.c: Remove some C dedicated output.
23889 Improve the use of macro and output obstacks.
23890 (output_defines): Remove.
6fc74234 23891
26f609ff
RA
23892 * src/output.c (output_token_translations): Associate 'translate'
23893 table with a macro. No output to the table obstack.
23894 (output_gram): Same for 'rhs' and 'prhs'.
23895 (output_stos): Same for 'stos'.
23896 (output_rule_data): Same for 'r1' and 'r2'.
23897 (token_actions): Same for 'defact'.
23898 (goto_actions): Same for 'defgoto'.
23899 (output_base): Same for 'pact' and 'pgoto'.
23900 (output_table): Same for 'table'.
23901 (output_check): Same for 'check'.
6fc74234 23902
26f609ff
RA
23903 * src/output.c (output_table_data): New function.
23904 (output_short_table): Remove.
23905 (output_short_or_char_table): Remove.
6fc74234 23906
26f609ff
RA
23907 * src/output.c (output_parser): Replace most of the skeleton copy code
23908 with something new. Skeletons are now processed character by character
23909 rather than line by line, and Bison looks for '%%' macros. This is the
23910 first step in making Bison's output process (a lot) more flexible.
23911 (output_parser): Use the macro table.
23912
6f43b113
RA
239132001-08-25 Robert Anisko <robert.anisko@epita.fr>
23914
23915 * src/main.c (main): Initialize the macro table.
23916
dd3127cf
RA
239172001-08-25 Robert Anisko <robert.anisko@epita.fr>
23918
23919 * src/lex.c (percent_table): Add tok_define.
23920 * src/lex.h: Add tok_define.
23921
aa321494
RA
239222001-08-25 Robert Anisko <robert.anisko@epita.fr>
23923
23924 * src/macrotab.c: New file.
23925 * src/macrotab.h: New file.
23926 * src/Makefile.am: Update.
23927
68bd3b6b
RA
239282001-08-25 Robert Anisko <robert.anisko@epita.fr>
23929
23930 * lib/hash.c: New file.
23931 * lib/hash.h: New file.
23932 * lib/Makefile.am: Update.
23933
45f8dd1e
AD
239342001-08-15 Akim Demaille <akim@epita.fr>
23935
23936 Version 1.28c.
23937
40a64a7a 239382001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
23939
23940 * src/reader.c (readgram): Indent output macro YYSTYPE.
23941 (packsymbols): Likewise.
23942 (output_token_defines): Likewise.
23943 * src/files.c: Standardize.
23944 (compute_header_macro): New.
23945 (defines_obstack_save): New. Use compute_header_macro.
23946 (output_files): Update. Use defines_obstack_save.
23947
f9a8293a
AD
239482001-08-15 Akim Demaille <akim@epita.fr>
23949
23950 * doc/bison.texinfo (Table of Symbols): Document
23951 YYSTACK_USE_ALLOCA.
23952
150ca7a7
AD
239532001-08-15 Akim Demaille <akim@epita.fr>
23954
23955 * missing: Update from CVS Automake.
23956 * config/config.guess, config/config.sub, config/texinfo.tex:
23957 Update from gnu.org.
23958
69b5cec4
AD
239592001-08-15 Akim Demaille <akim@epita.fr>
23960
23961 * Makefile.maint: Sync with CVS Autoconf.
23962
f2b5126e
PB
239632001-08-14 Pascal Bart <pascal.bart@epita.fr>
23964
69b5cec4 23965 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
23966 `fdl.texi'.
23967 * doc/fdl.texi: Add to package.
23968
4ecbf796
MA
239692001-08-14 Marc Autret <autret_m@epita.fr>
23970
23971 Turn on %{source,header}_extension features.
23972
69b5cec4 23973 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
23974 source_extension.
23975 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 23976 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
23977 between options.
23978
95fb5662
MA
239792001-08-14 Marc Autret <autret_m@epita.fr>
23980
23981 * src/files.c (compute_base_names): Add extensions computing when
23982 `--file-prefix' used.
23983 Standardize function calls.
23984
78d09da9
MA
239852001-08-13 Marc Autret <autret_m@epita.fr>
23986
69b5cec4 23987 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
23988 defining it (defined but null disables alloca).
23989
5a009f2c
MA
239902001-08-13 Marc Autret <autret_m@epita.fr>
23991
23992 * src/bison.simple (_yy_memcpy): CPP reformat.
23993
1e41465a
PB
239942001-08-13 Pascal Bart <pascal.bart@epita.fr>
23995
23996 * tests/atconfig.in (CPPFLAGS): Fix.
23997
c67a198d
PB
239982001-08-10 Pascal Bart <pascal.bart@epita.fr>
23999
79282c6c 24000 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
24001 `gpl.texi'.
24002 * doc/gpl.texi: Add to package.
24003
09a6de7e
MA
240042001-08-10 Marc Autret <autret_m@epita.fr>
24005
24006 * src/print_graph.h: Fix.
24007 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
24008
b77b9ee0
AD
240092001-08-10 Akim Demaille <akim@epita.fr>
24010
24011 * src/system.h: Provide default declarations for stpcpy, strndup,
24012 and strnlen.
24013
3e259915
MA
240142001-08-10 Robert Anisko <anisko_r@epita.fr>
24015
24016 * doc/bison.texinfo (Locations): Update @$ stuff.
24017
ca96bc2d
MA
240182001-08-09 Robert Anisko <anisko_r@epita.fr>
24019
24020 * src/bison.simple (YYLLOC_DEFAULT): Update.
24021 (yyparse): Adjust.
24022
fdc6758b
MA
240232001-08-08 Marc Autret <autret_m@epita.fr>
24024
b77b9ee0 24025 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
24026 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
24027 Reported by Fabrice Bauzac.
957d4dbf 24028
600cad3b
MA
240292001-08-08 Marc Autret <autret_m@epita.fr>
24030
24031 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
24032 * src/vcg.c (output_node): Fix.
24033 * src/vcg.h: Cleanup.
24034 * src/print_graph.c: Add comments.
b77b9ee0 24035 (node_output_size): New global variable. Simplify the formatting of
600cad3b 24036 the VCG graph output.
b77b9ee0 24037 (print_actions): Unused code is now used. It notifies the final state
600cad3b 24038 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 24039 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
24040 blue.
24041 Get the current node name and node_obstack by argument.
24042 (node_obstack): New variable.
24043 (print_state): Manage node_obstack.
24044 (print_core): Use node_obstack given by argument.
24045 A node is not only computed here but in print_actions also.
24046 (print_graph): CPP out useless code instead of commenting it.
24047
976e528f
AD
240482001-08-07 Pascal Bart <pascal.bart@epita.fr>
24049
24050 * tests/atconfig.in (CPPFLAGS): Fix.
24051
20e8e5ca
AD
240522001-08-07 Akim Demaille <akim@epita.fr>
24053
24054 * src/print_graph.c (quote): New.
24055 (print_core): Use it.
24056
957d4dbf 240572001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 24058
3e3da797
AD
24059 * src/vcg.c (complain.h): Include it.
24060 Unepitaize `return' invocations.
c4b66126 24061 [NDEBUG] (main): Remove.
79282c6c 24062 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
24063 * src/files.c (open_files): Initialize graph_obstack.
24064 * src/print_graph.c (print_actions): CPP out useless code.
24065 (print_core): Don't output the last `\n' in labels.
24066 Use `quote'.
24067 * src/files.c (output_files): Output the VCG file.
24068 * src/main.c (main): Invoke print_graph ();
3e3da797 24069
957d4dbf 240702001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
24071
24072 Automaton VCG graph output.
24073 Using option ``-g'' or long option ``--graph'', you can generate
24074 a gram_filename.vcg file containing a VCG description of the LALR (1)
24075 automaton of your grammar.
24076
24077 * src/main.c: Call to print_graph() function.
24078 * src/getargs.h: Update.
24079 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
24080 (graph_flag): New flag.
24081 (longopts): Update.
24082 (getargs): Add case `g'.
24083 * src/files.c (graph_obstack): New obstack struct.
24084 (open_files): Initialize new obstack.
24085 (output_files): Saves graph_obstack if required.
24086 * src/files.h (graph_obstack): New extern declaration.
24087 * src/Makefile.am: Add new source files.
24088
927c1557 240892001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
24090
24091 * src/print_graph.c, src/print_graph.h (graph): New.
24092 * src/vcg.h: New file.
24093 * src/vcg.c: New file, VCG graph handling.
24094
7333d403
AD
240952001-08-06 Marc Autret <autret_m@epita.fr>
24096
24097 Add of %source_extension and %header_extension which specify
24098 the source or/and the header output file extension.
24099
24100 * src/files.c (compute_base_names): Remove initialisation of
24101 src_extension and header_extension.
24102 (compute_exts_from_gf): Update.
24103 (compute_exts_from_src): Update.
24104 (output_files): Update.
24105 * src/reader.c (parse_header_extension_decl): New.
24106 (parse_source_extension_decl): New.
24107 (read_declarations): New case statements for the new tokens.
24108 * src/lex.c (percent_table): Add entries for %source_extension
24109 and %header_extension.
24110 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
24111
84163231
AD
241122001-08-06 Marc Autret <autret_m@epita.fr>
24113
24114 * configure.in: Bump to 1.28c.
24115 * doc/bison.texinfo: Texinfo thingies.
24116
8303fc42
AD
241172001-08-04 Pascal Bart <pascal.bart@epita.fr>
24118
24119 * tests/atconfig.in (CPPFLAGS): Add.
24120 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
24121
70a84437
AD
241222001-08-03 Akim Demaille <akim@epita.fr>
24123
24124 Version 1.28b.
24125
2ce10144
AD
241262001-08-03 Akim Demaille <akim@epita.fr>
24127
24128 * tests/Makefile.am (check-local): Ship testsuite.
24129 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
24130 Include `string.h'.
24131
1e3e4bc1
AD
241322001-08-03 Akim Demaille <akim@epita.fr>
24133
24134 * configure.in: Try using -Wformat when compiling.
24135
42b45b7f
AD
241362001-08-03 Akim Demaille <akim@epita.fr>
24137
24138 * configure.in: Bump to 1.28b.
24139
8f13fe33
AD
241402001-08-03 Akim Demaille <akim@epita.fr>
24141
24142 * src/complain.c: Adjust strerror_r portability issues.
24143
b37ba92c
AD
241442001-08-03 Akim Demaille <akim@epita.fr>
24145
24146 Version 1.28a.
24147
b0ce6046
AD
241482001-08-03 Akim Demaille <akim@epita.fr>
24149
24150 * src/getargs.c, src/getarg.h (skeleton)): Constify.
24151 * src/lex.c (literalchar): Avoid name clashes on `buf'.
24152 * src/getargs.c: Include complain.h.
24153 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
24154 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
24155
d01c415b
AD
241562001-08-03 Akim Demaille <akim@epita.fr>
24157
24158 * src/reader.c (readgram): Display hidden chars in error messages.
24159
459dd1a6
AD
241602001-08-03 Akim Demaille <akim@epita.fr>
24161
24162 Update to gettext 0.10.39.
24163
53b74c0c
AD
241642001-08-03 Akim Demaille <akim@epita.fr>
24165
24166 * lib/strspn.c: New.
24167
234a3be3
AD
241682001-08-01 Marc Autret <autret_m@epita.fr>
24169
24170 * doc/bison.texinfo: Update.
24171 * doc/bison.1 (mandoc): Update.
24172 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
24173 * src/files.c: Support output files extensions computing.
24174 (src_extension): New static variable.
24175 (header_extension): New static variable.
24176 (tr): New function.
24177 (get_extension_index): New function, gets the index of an extension
24178 filename in a string.
24179 (compute_exts_from_gf): New function, computes extensions from the
24180 grammar file extension.
24181 (compute_exts_from_src): New functions, computes extensions from the
24182 C source file extension, file given by ``-o'' option.
24183 (compute_base_names): Update.
24184 (output_files): Update.
24185
847bf1f5
AD
241862001-08-01 Robert Anisko <anisko_r@epita.fr>
24187
d995fee7 24188 * doc/bison.texi: Document @$.
847bf1f5
AD
24189 (Locations): New section.
24190
d074a105
AD
241912001-07-18 Akim Demaille <akim@epita.fr>
24192
24193 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
24194 * config/prev-version.txt, config/move-if-change: New.
24195 * Makefile.am: Adjust.
24196
3419715d
AD
241972001-07-08 Pascal Bart <pascal.bart@epita.fr>
24198
24199 * src/bison.simple (yyparse): Suppress warning `comparaison
24200 between signed and unsigned'.
24201
62ab6972
AD
242022001-07-05 Pascal Bart <pascal.bart@epita.fr>
24203
24204 * src/getargs.h (raw_flag): Remove.
24205 * src/getargs.c: Die on `-r'/`--raw'.
24206 * src/lex.c (parse_percent_token): Die on `%raw'.
24207 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
24208 * tests/calc.at: Suppress test with option `--raw'.
24209
1e24cc5b
AD
242102001-07-14 Akim Demaille <akim@epita.fr>
24211
24212 * config/: New.
24213 * configure.in: Require Autoconf 2.50.
24214 Update to gettext 0.10.38.
24215
32dfccf8
AD
242162001-03-16 Akim Demaille <akim@epita.fr>
24217
24218 * doc/bison.texinfo: ANSIfy the examples.
24219
cd5bd6ac
AD
242202001-03-16 Akim Demaille <akim@epita.fr>
24221
24222 * getargs.c (skeleton): New variable.
24223 (longopts): --skeleton is a new option.
24224 (shortopts, getargs): -S is a new option.
24225 * getargs.h: Declare skeleton.
24226 * output.c (output_parser): Use it.
24227
5141b016
AD
242282001-03-16 Akim Demaille <akim@epita.fr>
24229
24230 * m4/strerror_r.m4: New.
24231 * m4/error.m4: Run AC_FUNC_STRERROR_R.
24232 * lib/error.h, lib/error.c: Update.
24233
447992b9
AD
242342001-03-16 Akim Demaille <akim@epita.fr>
24235
24236 * src/getargs.c (longopts): Clean up.
24237
274d42ce
AD
242382001-02-21 Akim Demaille <akim@epita.fr>
24239
24240 * src/reader.c (gensym): `gensym_count' is your own.
24241 Use a static buf to create the symbol name, as token_buffer is no
24242 longer a buffer.
24243
22c821f3
AD
242442001-02-08 Akim Demaille <akim@epita.fr>
24245
24246 * src/conflicts.c (conflict_report): Be sure not to append to res
24247 between two calls, which could happen if both first sprintf were
24248 skipped, but not the first cp += strlen.
24249
18569462
AD
242502001-02-08 Akim Demaille <akim@epita.fr>
24251
24252 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
24253 New, from fileutils 4.0.37.
24254 * configure.in: Require Autoconf 2.49c. I took some time before
24255 making this decision. This is the only way out for portability
24256 issues in Bison, it would mean way too much duplicate effort to
24257 import in Bison features implemented in 2.49c since 2.13.
24258 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
24259
0d8f3c8a
AD
242602001-02-02 Akim Demaille <akim@epita.fr>
24261
24262 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 24263 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 24264
f17bcd1f
AD
242652001-01-19 Akim Demaille <akim@epita.fr>
24266
24267 Get rid of the ad hoc handling of token_buffer in the scanner: use
24268 the obstacks.
24269
24270 * src/lex.c (token_obstack): New.
24271 (init_lex): Initialize it. No longer call...
24272 (grow_token_buffer): this. Remove it.
24273 Adjust all the places which used it to use the obstack.
24274
511e79b3
AD
242752001-01-19 Akim Demaille <akim@epita.fr>
24276
24277 * src/lex.h: Rename all the tokens:
24278 s/\bENDFILE\b/tok_eof/g;
24279 s/\bIDENTIFIER\b/tok_identifier/g;
24280 etc.
24281 Let them be enums, not #define, to ease debugging.
24282 Adjust all the code.
24283
0d6508ef
AD
242842001-01-18 Akim Demaille <akim@epita.fr>
24285
24286 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
24287 * src/lex.c (maxtoken, grow_token_buffer): Static.
24288
6deb4447
AD
242892001-01-18 Akim Demaille <akim@epita.fr>
24290
24291 Since we now use obstacks, more % directives can be enabled.
24292
24293 * src/lex.c (percent_table): Also accept `%yacc',
24294 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
24295 `%debug'.
24296 Handle the actions for `%semantic_parser' and `%pure_parser' here,
24297 instead of returning a token.
24298 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
24299 * src/reader.c (read_declarations): Adjust.
24300 * src/files.c (open_files): Don't call `compute_base_names', don't
24301 compute `attrsfile' since they depend upon data which might be
24302 *in* the input file now.
24303 (output_files): Do it here.
24304 * src/output.c (output_headers): Document the fact that this patch
24305 introduces a guaranteed SEGV for semantic parsers.
24306 * doc/bison.texinfo: Document them.
24307 * tests/suite.at: Exercise these %options.
24308
ff4423cc
AD
243092000-12-20 Akim Demaille <akim@epita.fr>
24310
24311 Also handle the output file (--verbose) with obstacks.
24312
24313 * files.c (foutput): Remove.
24314 (output_obstack): New.
24315 Adjust all dependencies.
24316 * src/conflicts.c: Return a string.
24317 * src/system.h (obstack_grow_string): Rename as...
24318 (obstack_sgrow): this. Be ready to work with non literals.
24319 (obstack_fgrow4): New.
24320
956dba3a
AD
243212000-12-20 Akim Demaille <akim@epita.fr>
24322
24323 * src/files.c (open_files): Fix the computation of short_base_name
24324 in the case of `-o foo.tab.c'.
24325
337bab46
AD
243262000-12-20 Akim Demaille <akim@epita.fr>
24327
24328 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
24329 (copy_dollar): Now that everything uses obstacks, get rid of the
24330 FILE * parameters.
24331
5d3214b8
AD
243322000-12-20 Akim Demaille <akim@epita.fr>
24333
24334 * src/files.c (open_files): Actually the `.output' file is based
24335 on the short_base_name, not base_name.
24336 * tests/suite.at (Checking output file names): Adjust.
24337
29092a57
AD
243382000-12-20 Akim Demaille <akim@epita.fr>
24339
24340 * src/bison.s1: Remove, we now use directly...
24341 * src/bison.simple: this.
24342 * src/Makefile.am: Use pkgdata instead of data.
24343
ea5607fd
AD
243442000-12-20 Akim Demaille <akim@epita.fr>
24345
24346 * src/files.c (guard_obstack): New.
24347 (open_files): Initialize it.
24348 (output_files): Dump it...
24349 * src/files.h: Export it.
24350 * src/reader.c (copy_guard): Use it.
24351
27110317
AD
243522000-12-19 Akim Demaille <akim@epita.fr>
24353
24354 * src/files.c (outfile, defsfile, actfile): Removed as global
24355 vars.
24356 (open_files): Don't compute them.
24357 (output_files): Adjust.
24358 (base_name, short_base_name): Be global.
24359 Adjust dependencies.
24360
19c50364
AD
243612000-12-19 Akim Demaille <akim@epita.fr>
24362
24363 * src/files.c (strsuffix): New.
24364 (stringappend): Be just like strcat but allocate.
24365 (base_names): Eve out from open_files.
24366 Try to simplify the rather hairy computation of base_name and
24367 short_base_name.
24368 (open_files): Use it.
24369 * tests/suite.at (Checking output file names): New test.
24370
573c1d9f
AD
243712000-12-19 Akim Demaille <akim@epita.fr>
24372
24373 * src/system.h (obstack_grow_literal_string): Rename as...
24374 (obstack_grow_string): this.
24375 * src/output.c (output_parser): Recognize `%% actions' instead of
24376 `$'.
24377 * src/bison.s1: s/$/%% actions/.
24378 * src/bison.hairy: Likewise.
24379
ef7ddedd
AD
243802000-12-19 Akim Demaille <akim@epita.fr>
24381
24382 * src/output.c (output_parser): Compute the `#line' lines when
24383 there are.
24384 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
24385 Suggested by Hans Aberg.
24386
ff61dabd
AD
243872000-12-19 Akim Demaille <akim@epita.fr>
24388
24389 Let the handling of the skeleton files be local to the procedures
24390 that use it.
24391
24392 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
24393 longer static.
24394 (fparser, open_extra_files): Remove.
24395 (open_files, output_files): Don't take care of fparser.
24396 * src/files.h: Adjust.
24397 * src/output.c (output_parser): Open and close the file to the
24398 skeleton.
24399 * src/reader.c (read_declarations): When %semantic_parser, open
24400 fguard.
24401
55b96341
AD
244022000-12-19 Akim Demaille <akim@epita.fr>
24403
24404 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
24405 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
24406
358c15b7
AD
244072000-12-19 Akim Demaille <akim@epita.fr>
24408
24409 * src/files.c (open_files): Yipee! We no longer need all the code
24410 looking for `/tmp' since we have no tmp file.
24411
7de3329e
AD
244122000-12-19 Akim Demaille <akim@epita.fr>
24413
24414 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
24415 New macros.
24416 * src/files.c (open_files): Less dependency on MSDOS etc.
24417
3abcd459
AD
244182000-12-14 Akim Demaille <akim@epita.fr>
24419
24420 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
24421 Provide a default definition.
24422 Use it when executing the default @ action.
24423 * src/reader.c (reader_output_yylsp): No longer include
24424 `timestamp' and `text' in the default YYLTYPE.
24425
2a91a95e
AD
244262000-12-12 Akim Demaille <akim@epita.fr>
24427
24428 * src/reader.c (copy_definition, parse_union_decl, copy_action)
24429 (copy_guard): Quote the file names.
24430 Reported by Laurent Mascherpa.
24431
14d3eb9b
AD
244322000-12-12 Akim Demaille <akim@epita.fr>
24433
24434 * src/output.c (output_headers, output_program, output): Be sure
24435 to escape special characters when outputting filenames.
24436 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
24437 (output_headers): Don't depend on them, Use ACTSTR.
24438
d7045ec6
AD
244392000-11-17 Akim Demaille <akim@epita.fr>
24440
24441 * lib/obstack.h: Formatting changes.
24442 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
24443 prevents type checking.
24444 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
24445 cast the value to (void *): assigning a `foo *' to a `void *'
24446 variable is valid.
24447 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
24448 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
24449 append characters.
24450
6fd54b73
AD
244512000-11-17 Akim Demaille <akim@epita.fr>
24452
24453 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
24454 as...
24455 (suite.m4, regression.m4, calc.m4): these.
24456 * tests/atgeneral.m4: Update from CVS Autoconf.
24457
4c50eae6
AD
244582000-11-17 Akim Demaille <akim@epita.fr>
24459
24460 * tests/regression.m4 (%union and --defines): New test,
24461 demonstrating a current bug in the obstack implementation.
24462
a35f64ea
AD
244632000-11-17 Akim Demaille <akim@epita.fr>
24464
24465 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
24466 macros.
24467 Use them to declare the variables which are global or local to
24468 `yyparse'.
24469
7de23534
AD
244702000-11-17 Akim Demaille <akim@epita.fr>
24471
24472 * acconfig.h: Remove, no longer used.
24473
aa7815f5
AD
244742000-11-07 Akim Demaille <akim@epita.fr>
24475
24476 * src: s/Copyright (C)/Copyright/g.
24477
5af1f549
AD
244782000-11-07 Akim Demaille <akim@epita.fr>
24479
24480 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
24481 defining.
24482 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
24483
553e2b22
AD
244842000-11-07 Akim Demaille <akim@epita.fr>
24485
24486 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
24487 Merge in a single CPP if/else.
24488
8a4f41d6
AD
244892000-11-07 Akim Demaille <akim@epita.fr>
24490
24491 * src/output.c (output): Remove useless variables.
24492 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
24493 argument `data' for consistency with the prototypes.
24494 Qualify it `const'.
24495 (obstack_copy, obstack_copy0): Rename the second argument as
24496 `address' for consistency. Qualify it `const'.
24497 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
24498 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
24499 `const' their input argument (`data' or `address').
24500 Adjust the corresponding macros to include `const' in casts.
24501
095a3fb5
AD
245022000-11-03 Akim Demaille <akim@epita.fr>
24503
24504 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
24505 s/PFILE1/BISON_HAIRY/.
24506 Adjust dependencies.
24507
d1cdce7c
AD
245082000-11-03 Akim Demaille <akim@epita.fr>
24509
090c5ebf 24510 For some reason, this was not applied.
d1cdce7c
AD
24511
24512 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
24513 `unlink': it's no longer used.
24514
9311529b
AD
245152000-11-03 Akim Demaille <akim@epita.fr>
24516
24517 * src/files.c (skeleton_find): New function, eved out of...
24518 (open_files, open_extra_files): here.
24519
d8880f69
AD
245202000-11-03 Akim Demaille <akim@epita.fr>
24521
24522 Don't use `atexit'.
24523
24524 * src/files.c (obstack_save): New function.
24525 (done): Rename as...
24526 (output_files): this.
24527 Use `obstack_save'.
24528 * src/main.c (main): Don't use `atexit' to register `done', since
24529 it no longer has to remove tmp files, just call `output_files'
24530 when there are no errors.
24531
0dbb648e
AD
245322000-11-02 Akim Demaille <akim@epita.fr>
24533
24534 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
24535 `unlink': it's no longer used.
24536 * src/files.h: Formatting changes.
24537
896fe5c1
AD
245382000-11-02 Akim Demaille <akim@epita.fr>
24539
24540 Remove the last uses of mktemp and unlink/delete.
24541
24542 * src/files.c (fdefines, ftable): Removed.
24543 (defines_ostack, table_obstack): New.
24544 Adjust dependencies of the former into uses of the latter.
24545 * src/output.c (output_short_or_char_table, output_short_table):
24546 Convert to using obstacks.
24547 * src/reader.c (copy_comment2): Accept one FILE * and two
24548 obstacks.
24549 (output_token_defines, reader_output_yylsp): Use obstacks.
24550 * src/system.h (obstack_fgrow3): New.
1f65350a 24551 * po/POTFILES.in: Adjust.
896fe5c1 24552
dd60faec
AD
245532000-11-01 Akim Demaille <akim@epita.fr>
24554
24555 Change each use of `fattrs' into a use of `attrs_obstack'.
24556
24557 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
24558 * src/files.c (fattrs): Remove.
24559 (attrs_obstack): New.
24560 Adjust all dependencies.
24561 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
24562
8c7ebe49
AD
245632000-11-01 Akim Demaille <akim@epita.fr>
24564
24565 Introduce obstacks.
24566 Change each use of `faction' into a use of `action_obstack'.
24567
24568 * lib/obstack.h, lib/obstack.c: New files.
24569 * src/files.c (faction): Remove.
24570 (action_obstack): New.
24571 Adjust all dependencies.
24572
77aee789
AD
245732000-10-20 Akim Demaille <akim@epita.fr>
24574
24575 * lib/quote.h (PARAMS): New macro. Use it.
24576
43591cec
AD
245772000-10-16 Akim Demaille <akim@epita.fr>
24578
24579 * src/output.c (output_short_or_char_table): New function.
24580 (output_short_table, output_token_translations): Use it.
24581 (goto_actions): Use output_short_table.
24582
1e9798d5
AD
245832000-10-16 Akim Demaille <akim@epita.fr>
24584
24585 * src/symtab.c (bucket_new): New function.
24586 (getsym): Use it.
24587
24588 * src/output.c (output_short_table): New argument to display the
24589 comment associated with the table.
24590 Adjust dependencies.
24591 (output_gram): Use it.
24592 (output_rule_data): Nicer output layout for YYTNAME.
24593
f282676b
AD
245942000-10-16 Akim Demaille <akim@epita.fr>
24595
24596 * src/lex.c (read_typename): New function.
24597 (lex): Use it.
24598 * src/reader.c (copy_dollar): Likewise.
24599
550a72a3
AD
246002000-10-16 Akim Demaille <akim@epita.fr>
24601
24602 * src/reader.c (copy_comment2): Expect the input stream to be on
24603 the `/' which is suspected to open a comment, instead of being
24604 called after `//' or `/*' was read.
24605 (copy_comment, copy_definition, parse_union_decl, copy_action)
24606 (copy_guard): Adjust.
24607
131e2fef
AD
246082000-10-16 Akim Demaille <akim@epita.fr>
24609
24610 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
24611 `read_signed_integer'.
24612
79282c5a
AD
246132000-10-16 Akim Demaille <akim@epita.fr>
24614
24615 * src/reader.c (copy_dollar): New function.
24616 (copy_guard, copy_action): Use it.
24617
ff4a34be
AD
246182000-10-16 Akim Demaille <akim@epita.fr>
24619
24620 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
24621 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
24622 New files, from Fileutils 4.0.27.
24623 * src/main.c (printable_version): Remove.
24624 * src/lex.c, src/reader.c: Use `quote'.
24625
246262000-10-04 Akim Demaille <akim@epita.fr>
24627
24628 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
24629
14ded682
AD
246302000-10-04 Akim Demaille <akim@epita.fr>
24631
24632 * doc/bison.texinfo: Various typos spotted by Neil Booth.
24633
8e03724b
AD
246342000-10-04 Akim Demaille <akim@epita.fr>
24635
24636 When a literal string is used to define two different tokens,
24637 `bison -v' segfaults.
24638 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
24639
24640 * tests/regression.m4: New file.
24641 Include the core of the sample provided by Piotr Gackiewicz.
24642 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
24643 properly.
24644
a9e64249
AD
246452000-10-04 Akim Demaille <akim@epita.fr>
24646
24647 * src/reader.c (parse_expect_decl): Keep `count' within the size
24648 of `buffer'.
24649 From Neil Booth.
24650
da9abf43
AD
246512000-10-02 Paul Eggert <eggert@twinsun.com>
24652
24653 * bison.s1 (yyparse): Assign the default value
24654 unconditionally, to avoid a GCC warning and make the parser a
24655 tad smaller.
24656
c33638bb
AD
246572000-10-02 Akim Demaille <akim@epita.fr>
24658
24659 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
24660 options.
24661
444c570a
AD
246622000-10-02 Akim Demaille <akim@epita.fr>
24663
24664 * src/derives.c, src/print.c, src/reduce.c: To ease the
24665 translation, move some `\n' out of the translated strings.
24666
89cab50d
AD
246672000-10-02 Akim Demaille <akim@epita.fr>
24668
24669 The location tracking mechanism is precious for parse error
24670 messages. Nevertheless, it is enabled only when `@n' is used in
24671 the grammar, which is a different issue (you can use it in error
24672 message, but not in the grammar per se). Therefore, there should
24673 be another means to enable it.
24674
24675 * src/getargs.c (getargs): Support `--locations'.
24676 (usage): Report it.
24677 * src/getargs.h (locationsflag): Export it.
24678 * src/lex.c (percent_table): Support `%locations'.
24679 * src/reader.c (yylsp_needed): Remove this variable, now replaced
24680 with `locationsflag'.
24681 * doc/bison.texinfo: Document `--locations' and `%locations'.
24682 Sort the options.
24683 * tests/calc.m4: Test it.
24684
24685 For regularity of the names, replace each
24686 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
24687 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
24688 In addition replace each `flag' with `_flag'.
24689
d6c2cba0
AD
246902000-10-02 Akim Demaille <akim@epita.fr>
24691
24692 Also test parse error messages, including with YYERROR_VERBOSE.
24693
24694 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
24695 associative).
24696 Use it to check the computations.
24697 Use it to check `nonassoc' is honored.
24698 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
24699 `--yyerror-verbose'.
24700 (_AT_CHECK_CALC): Adjust to this option.
24701 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
24702
5a35a6cb
AD
247032000-10-02 Akim Demaille <akim@epita.fr>
24704
24705 Test also `--verbose', `--defines' and `--name-prefix'. Testing
24706 the latter demonstrates a flaw in the handling of non debugging
24707 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
24708 was used in order to simplify:
24709
24710 #if YYDEBUG
24711 if (yydebug)
24712 {
24713 ...
24714 }
24715 #endif
24716
24717 into
24718
24719 if (yydebug)
24720 {
24721 ...
24722 }
24723
24724 unfortunately this leads to a CPP conflict when
24725 `--name-prefix=foo' is used since it produces `#define yydebug
24726 foodebug'.
24727
24728 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
24729 (YYDPRINTF): New macro.
24730 Spread its use.
24731 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
24732 the bison options.
24733 Also test `--verbose', `--defines' and `--name-prefix'.
24734
71da9eea
AD
247352000-10-02 Akim Demaille <akim@epita.fr>
24736
24737 Improve the readability of the produced parsers.
24738
24739 * src/bison.s1: Formatting changes.
24740 Improve the comment related to the `$' mark.
24741 (yydefault): Don't fall through to `yyresume': `goto' there.
24742 * src/output.c (output_parser): When the `$' is met, skip the end
24743 of its line.
24744 New variable, `number_of_dollar_signs', to check there's exactly
24745 one `$' in the parser skeleton.
24746
95e36146
AD
247472000-10-02 Akim Demaille <akim@epita.fr>
24748
24749 * lib/xstrdup.c: New file, from the fileutils.
24750 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
24751 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
24752 instead of strlen + xmalloc + strcpy.
24753 * src/symtab.c (copys): Remove, use xstrdup instead.
24754
d7020c20
AD
247552000-10-02 Akim Demaille <akim@epita.fr>
24756
24757 * src/gram.h (associativity): New enum type which replaces the
24758 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
24759 `right_assoc', `left_assoc' and `non_assoc'.
24760 Adjust all dependencies.
24761 * src/reader.c: Formatting changes.
24762 (LTYPESTR): Don't define it, use it as a literal in
24763 `reader_output_yylsp'.
24764 * src/symtab.h (symbol_class): New enum type which replaces the
24765 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
24766 `sunknown', `stoken and `snterm'.
24767
1916f98e
AD
247682000-10-02 Akim Demaille <akim@epita.fr>
24769
24770 * src/getargs.c (fixed_outfiles): Rename as...
24771 (yaccflag): for consistency and accuracy.
24772 Adjust dependencies.
24773
d7913476
AD
247742000-10-02 Akim Demaille <akim@epita.fr>
24775
24776 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
24777 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
24778 difficult and introduced a lot of core dump. It turns out that
24779 Bison used an implementation of `xmalloc' based on `calloc', and
24780 at various places it does depend upon the initialization to 0. I
24781 have not tried to isolate the pertinent places, and all the former
24782 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
24783 someone should address this issue.
24784
24785 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
24786 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
24787 files.
24788 Adjust dependencies.
24789 * src/warshall.h: New file.
24790 Propagate.
24791
340ef489
AD
247922000-10-02 Akim Demaille <akim@epita.fr>
24793
24794 Various anti-`extern in *.c' changes.
24795
24796 * src/system.h: Include `assert.h'.
24797
b2ca4022
AD
247982000-10-02 Akim Demaille <akim@epita.fr>
24799
24800 * src/state.h (nstates, final_state, first_state, first_shift)
24801 (first_reduction): Move their exportation from here...
24802 * src/LR0.h: to here.
24803 Adjust dependencies.
24804 * src/getargs.c (statisticsflag): New variable.
24805 Add support for `--statistics'.
24806 Adjust dependencies.
24807
24808 Remove a lot of now useless `extern' statements in most files.
24809
403b315b
AD
248102000-10-02 Akim Demaille <akim@epita.fr>
24811
24812 * src/LR0.h: New file.
24813 Propagate its use.
24814
07a58c13
AD
248152000-10-02 Akim Demaille <akim@epita.fr>
24816
24817 * src/print.h: New file.
24818 Propagate its use.
24819 * src/print.c: Formatting and ordering changes.
24820 (verbose, terse): Replace with...
24821 (print_results): this new function.
24822 Adjust dependencies.
24823
0619caf0
AD
248242000-10-02 Akim Demaille <akim@epita.fr>
24825
24826 * src/conflicts.c (conflict_report): New function.
24827 (conflict_log, verbose_conflict_log): Replace with...
24828 (print_conflicts): this function.
24829 Adjust dependencies.
24830 * src/conflicts.h: New file.
24831 Propagate its inclusion.
24832
3519ec76
AD
248332000-10-02 Akim Demaille <akim@epita.fr>
24834
24835 * src/nullable.h: New file.
24836 Propagate its inclusion.
24837 * src/nullable.c: Formatting changes.
24838
015acc48
AD
248392000-10-02 Akim Demaille <akim@epita.fr>
24840
24841 * src/reduce.h: New file.
24842 Propagate its inclusion.
24843 * src/reduce.c: Topological sort and other formatting changes.
24844 (bool, TRUE, FALSE): Move their definition to...
24845 * src/system.h: here.
24846
8963a27b
AD
248472000-10-02 Akim Demaille <akim@epita.fr>
24848
24849 * src/files.c: Formatting changes.
24850 (tryopen, tryclose, openfiles): Rename as...
24851 (xfopen, xfclose, open_files): this.
24852 (stringappend): static.
24853 * src/files.h: Complete the list of exported symbols.
24854 Propagate its use.
24855
a70083a3
AD
248562000-10-02 Akim Demaille <akim@epita.fr>
24857
24858 * src/reader.h: New file.
24859 Propagate its use instead of tedious list of `extern' and
24860 prototypes.
24861 * src/reader.c: Formatting changes, topological sort,
24862 s/register//.
24863
abadc117
AD
248642000-10-02 Akim Demaille <akim@epita.fr>
24865
24866 * src/lex.h: Prototype `lex.c' exported functions.
24867 * src/reader.c: Adjust.
24868 * src/lex.c: Formatting changes.
24869 (safegetc): Rename as...
24870 (xgetc): this.
24871
720d742f
AD
248722000-10-02 Akim Demaille <akim@epita.fr>
24873
24874 * src/lalr.h: New file.
24875 Propagate its inclusion instead of prototypes and `extern'.
24876 * src/lalr.c: Formatting changes, topological sorting etc.
24877
f2acea59
AD
248782000-10-02 Akim Demaille <akim@epita.fr>
24879
24880 * src/output.c (token_actions): Introduce a temporary array,
24881 YYDEFACT, that makes it possible for this function to use
24882 output_short_table.
24883
d019d655
AD
248842000-10-02 Akim Demaille <akim@epita.fr>
24885
24886 `user_toknums' is output as a `short[]' in `output.c', while it is
24887 defined as a `int[]' in `reader.c'. For consistency with the
24888 other output tables, `user_toknums' is now defined as a table of
24889 shorts.
24890
24891 * src/reader.c (user_toknums): Be a short table instead of an int
24892 table.
24893 Adjust dependencies.
24894
24895 Factor the short table outputs.
24896
24897 * src/output.c (output_short_table): New function.
24898 * src/output.c (output_gram, output_stos, output_rule_data)
24899 (output_base, output_table, output_check): Use it.
24900
6c89f1c1
AD
249012000-10-02 Akim Demaille <akim@epita.fr>
24902
24903 * src/output.c (output): Topological sort of the functions, in
24904 order to get rid of the `static' prototypes.
24905 No longer use `register'.
24906 * src/output.h: New file.
24907 Propagate its inclusion in files explicitly prototyping functions
24908 from output.c.
24909
d9efd181
AD
249102000-09-21 Akim Demaille <akim@epita.fr>
24911
24912 * src/atgeneral.m4: Update from Autoconf.
24913
c29240e7 249142000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
24915
24916 * src/closure.h: New file.
24917 * src/closure.c: Formatting changes, topological sort over the
24918 functions, use of closure.h.
24919 (initialize_closure, finalize_closure): Rename as...
24920 (new_closure, free_closure): these. Adjust dependencies.
24921 * src/LR0.c: Formatting changes, topological sort, use of
24922 cloture.h.
24923 (initialize_states): Rename as...
24924 (new_states): this.
24925 * src/Makefile.am (noinst_HEADERS): Adjust.
24926
499daa50
AD
249272000-09-20 Akim Demaille <akim@epita.fr>
24928
24929 * src/acconfig.h: Don't protect config.h against multiple
24930 inclusion.
24931 Don't define PARAMS.
24932 * src/system.h: Define PARAMS.
24933 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
24934 purpose of config.h. system.h must not try to fix wrong
24935 definitions in config.h.
24936
cc84fd5d
AD
249372000-09-20 Akim Demaille <akim@epita.fr>
24938
24939 * src/derives.h: New file.
24940 * src/main.c, src/derives.h: Use it.
24941 Formatting changes.
24942 * src/Makefile.am (noinst_HEADERS): Adjust.
24943
db5b3a89
AD
249442000-09-20 Akim Demaille <akim@epita.fr>
24945
24946 * tests/atgeneral.m4: Update from Autoconf.
24947 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
24948 (AT_CHECK_CALC): New macros.
24949 Use these macros to test bison with options `', `--raw',
24950 `--debug', `--yacc', `--yacc --debug'.
24951
ceed8467
AD
249522000-09-19 Akim Demaille <akim@epita.fr>
24953
24954 * src/output.c: Formatting changes.
24955 * src/machine.h: Remove, leaving its contents in...
24956 * src/system.h: here.
24957 Include stdio.h.
24958 Adjust all dependencies on stdio.h and machine.h.
24959 * src/getargs.h: New file.
24960 Let all `extern' declarations about getargs.c be replaced with
24961 inclusion of `getargs.h'.
24962 * src/Makefile.am (noinst_HEADERS): Adjust.
24963
24964 * tests/calc.m4 (yyin): Be initialized in main, not on the global
24965 scope.
24966 (yyerror): Returns void, not int.
24967 * doc/bison.texinfo: Formatting changes.
24968
05a1d24b
AD
249692000-09-19 Akim Demaille <akim@epita.fr>
24970
24971 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
24972 portable.
24973
cbd25751
AD
249742000-09-18 Akim Demaille <akim@epita.fr>
24975
24976 * configure.in: Append WARNING_CFLAGS to CFLAGS.
24977 * src/Makefile.am (INCLUDES): Don't.
24978 Be ready to fetch headers in lib/.
24979
13863333
AD
249802000-09-18 Akim Demaille <akim@epita.fr>
24981
24982 * doc/bison.texinfo: Update the copyright.
24983 ANSIfy and GNUify the examples.
24984 Remove the old menu.
24985
0d533154
AD
249862000-09-18 Akim Demaille <akim@epita.fr>
24987
24988 First set of tests: use the `calc' example from the documentation.
24989
24990 * src/bison.s1 (yyparse): Condition the code using `yytname' which
24991 is defined only when YYDEBUG is.
24992 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
24993 * src/files.c (tryopen, tryclose): Formatting changes.
24994 Move to the top and be static.
24995 * src/reader.c (read_signed_integer): Likewise.
24996 * tests/calc.m4: New file.
24997 * Makefile.am, suite.m4: Adjust.
24998 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
24999
e79137ac
AD
250002000-09-18 Akim Demaille <akim@epita.fr>
25001
25002 Add support for an Autotest test suite for Bison.
25003
25004 * m4/m4.m4, m4/atconfig.m4: New files.
25005 * m4/Makefile.am (EXTRA_DIST): Adjust.
25006 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
25007 files.
25008 * src/getargs.c: Display a more standard --version message.
25009 * src/reader.c (reader): Formatting changes.
25010 No longer depend upon VERSION_STRING.
25011 * configure.in: No longer use `dnl'.
25012 Set up the test suite and the new directory `tests/.
25013 (VERSION_STRING): Remove.
25014
27821bff
AD
250152000-04-14 Akim Demaille <akim@epita.fr>
25016
25017 * src/reader.c (copy_comment2): New function, same as former
25018 `copy_comment', but outputs into two FILE *.
25019 (copy_comment): Use it.
25020 (parse_union_decl): Use it.
25021 (get_type, parse_start_decl): Use the same `invalid' message.
25022 (parse_start_decl, parse_union_decl): Use the same `multiple'
25023 message.
25024 (parse_union_decl, copy_guard, copy_action): Use the same
25025 `unmatched' message.
25026 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
25027
cfe5fbc0
AD
250282000-03-31 Akim Demaille <akim@epita.fr>
25029
25030 * src/files.c (tryopen, tryclose): Move to the top.
25031 Be static.
25032
cb7db13e
AD
250332000-03-31 Akim Demaille <akim@epita.fr>
25034
25035 * src/main.c (main): Don't call `done', exit does it.
25036
a0f6b076
AD
250372000-03-31 Akim Demaille <akim@epita.fr>
25038
36281465
AD
25039 * allocate.c: s/return (foo)/return foo/.
25040 * lalr.c: Likewise.
25041 * LR0.c: Likewise.
25042 * output.c: Likewise.
25043 * reader.c: Likewise.
25044 * symtab.c: Likewise.
25045 * vmsgetargs.c: Likewise.
25046
250472000-03-31 Akim Demaille <akim@epita.fr>
25048
25049 Clean up the error reporting functions.
a0f6b076
AD
25050
25051 * src/report.c: New file.
25052 * src/report.h: Likewise.
25053 * src/Makefile.am: Adjust.
25054 * m4/error.m4: New file.
25055 * m4/Makefile.am: Adjust.
25056 * configure.in (jm_PREREQ_ERROR): Call it.
25057 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
25058 Remove.
25059 (fatal, fatals): Remove. All callers use complain.c::fatal.
25060 (warn, warni, warns, warnss, warnss): Remove. All callers use
25061 complain.c::complain.
25062 (toomany): Remove, use fatal instead.
25063 * src/files.c (done): No argument, use complain_message_count.
25064 * src/main.c (main): Register `done' to `atexit'.
25065
25066 * src/getargs.c (usage): More `fputs', less `fprintf'.
25067
18539825
AD
250682000-03-28 Akim Demaille <akim@epita.fr>
25069
25070 * lib/: New directory.
25071 * Makefile.am (SUBDIRS): Adjust.
25072 * configure.in: Adjust.
25073 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
25074 useless.
25075 * src/alloca.c: Moved to lib/.
25076 * src/getopt.c: Likewise.
25077 * src/getopt1.c: Likewise.
25078 * src/getopt.h: Likewise.
25079 * src/ansi2knr.c: Likewise.
25080 * src/ansi2knr.1: Likewise.
25081 * src/Makefile.am: Adjust.
25082 * lib/Makefile.am: New file.
25083
9f306f2a
AD
250842000-03-28 Akim Demaille <akim@epita.fr>
25085
25086 * src/getargs.c (usage): Refresh the help message.
25087
0ba347b6
AD
250882000-03-17 Akim Demaille <akim@epita.fr>
25089
25090 * src/getopt1.c: Updated from textutils 2.0e
25091 * src/getopt.c: Likewise.
25092 * src/getopt.h: Likewise.
25093
dbe7f271
AD
250942000-03-17 Akim Demaille <akim@epita.fr>
25095
25096 * src/Makefile.am (bison.simple): Fix the awk program: quote only
25097 the file name, not the whole `#line LINE FILE'.
25098
75bbe78d
AD
250992000-03-17 Akim Demaille <akim@epita.fr>
25100
25101 On syntax errors, report the token on which we choked.
25102
aa5fd0ee
AD
25103 * src/bison.s1 (yyparse): In the label yyerrlab, when
25104 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 25105
7b306f52
AD
251062000-03-17 Akim Demaille <akim@epita.fr>
25107
aa5fd0ee 25108 * src/reader.c (copy_at): New function.
7b306f52
AD
25109 (copy_guard): Use it.
25110 (copy_action): Use it.
25111
e87b5700
AD
251122000-03-17 Akim Demaille <akim@epita.fr>
25113
25114 Be kind to translators, save some useless translations.
25115
aa5fd0ee 25116 * src/main.c (banner): New function.
e87b5700
AD
25117 (fatal_banner): Use it.
25118 (warn_banner): Use it.
25119
ae3c3164
AD
251202000-03-17 Akim Demaille <akim@epita.fr>
25121
aa5fd0ee
AD
25122 * src/reader.c (copy_definition): Use copy_string and
25123 copy_comment. Removed now unused `match', `ended',
25124 `cplus_comment'.
ae3c3164
AD
25125 (copy_comment, copy_string): Moved, to be visible from
25126 copy_definition.
25127
4dc58e7c
AD
251282000-03-17 Akim Demaille <akim@epita.fr>
25129
aa5fd0ee
AD
25130 * src/reader.c (copy_string): Declare `static inline'. No
25131 problems with inline, since it is checked by configure.
4dc58e7c
AD
25132 (copy_comment): Likewise.
25133
0a6384c4
AD
251342000-03-17 Akim Demaille <akim@epita.fr>
25135
aa5fd0ee 25136 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 25137
3cef001a
AD
251382000-03-17 Akim Demaille <akim@epita.fr>
25139
aa5fd0ee 25140 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
25141 (copy_action): Use it. Removed now unused `match', `ended',
25142 `cplus_comment'.
25143 (copy_guard): Likewise.
25144
ca36d2ef
AD
251452000-03-17 Akim Demaille <akim@epita.fr>
25146
aa5fd0ee 25147 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
25148 (copy_action): Use it.
25149 (copy_guard): Likewise.
25150
6666f98f
AD
251512000-03-17 Akim Demaille <akim@epita.fr>
25152
25153 Change the handling of @s so that they behave exactly like $s.
25154 There is now a pseudo variable @$ (readble and writable), location
25155 of the lhs of the rule (by default ranging from the location of
25156 the first symbol of the rhs, to the location of the last symbol,
25157 or, if the rhs is empty, YYLLOC).
25158
25159 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
25160 yyval.
25161 (yyparse): When providing a default semantic action, provide a
25162 default location action.
25163 (after the $): No longer change `*YYLSP', just stack YYLOC the
25164 same way you stack YYVAL.
25165 * src/reader.c (read_declarations): Use warns.
25166 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
25167 (copy_action, case '@'): Likewise.
25168 Use a standard error message, to save useless work from
25169 translators.
25170
41aca2e0
AD
251712000-03-17 Akim Demaille <akim@epita.fr>
25172
aa5fd0ee
AD
25173 * src/bison.s1: Formatting and cosmetics changes.
25174 * src/reader.c: Likewise.
41aca2e0
AD
25175 Update the Copyright notice.
25176
dc08c1d5
AD
251772000-03-17 Akim Demaille <akim@epita.fr>
25178
aa5fd0ee
AD
25179 * src/bison.s1 (#line): All set to `#line' only, since the
25180 Makefile now handles them.
dc08c1d5 25181
9ee3c97b
AD
251822000-03-16 Akim Demaille <akim@epita.fr>
25183
25184 * src/output.c (output_rule_data): Output the documentation of
25185 some of the tables.
25186 (Copyright notice): Update.
25187 Formatting changes.
25188
0de741ca
AD
251892000-03-16 Akim Demaille <akim@epita.fr>
25190
25191 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
25192 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
25193 One `#if YYDEBUG' remains, since it uses variables which are
25194 defined only if `YYDEBUG != 0'.
25195
bb10be54
AD
251962000-03-16 Akim Demaille <akim@epita.fr>
25197
25198 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
25199 and related variables so that the similarities are highlighted.
25200
b07b484a
AD
252012000-03-16 Akim Demaille <akim@epita.fr>
25202
25203 * src/bison.s1: Properly indent CPP directives.
25204
361f60b3
AD
252052000-03-16 Akim Demaille <akim@epita.fr>
25206
25207 * src/bison.s1: Properly indent the `alloca' CPP section.
25208
8c44d3ec
AD
252092000-03-16 Akim Demaille <akim@epita.fr>
25210
25211 Do not hard code values of directories in `configure.in'.
25212 Update the `configure' tool chain.
25213
25214 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
25215 src/makefile.am.
25216 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
25217 (AC_OUTPUT): Add m4/Makefile.
25218 Bump to bison 1.28a, 1.29 has never been released.
25219 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
25220 handled via src/Makefile.am.
25221 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
25222 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
25223 autoheader.
25224 * Makefile.am (SUBDIRS): Add m4.
25225 (ACLOCAL_AM_FLAGS): New variable.
25226 (AUTOMAKE_OPTIONS): Add check-news.
25227 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
25228 the proper line number and file name.
25229 (DEFS): Propagate the location of bison library files and of the
25230 locale files.
25231 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
25232 builddir.
25233 * acinclude.m4: Remove, replaced by the directory m4.
25234 * m4/Makefile.am (EXTRA_DIST): New variable.
25235 * m4/gettext.m4: New file, from the fileutils.
25236 * m4/lcmessage.m4: Likewise
25237 * m4/progtest.m4: Likewise.
25238 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
25239
f95997e7
AD
252402000-03-10 Akim Demaille <akim@epita.fr>
25241
25242 * src/closure.c:
25243 Formatting changes of various comments.
25244 Respect the GNU coding standards at various places.
25245 Don't use `_()' when no translation is needed.
25246
252471999-12-13 Jesse Thilo <jthilo@gnu.org>
25248
25249 * src/files.c:
25250 OS/2 honors TMPDIR environment variable.
25251
252521999-12-13 Jesse Thilo <jthilo@gnu.org>
25253
25254 * doc/bison.texinfo: Tweaked spelling and grammar.
25255 Updated ISBN.
25256 Removed reference to price of printed copy.
25257 Mention BISON_SIMPLE and BISON_HAIRY.
25258
252591999-12-13 Jesse Thilo <jthilo@gnu.org>
25260
25261 * configure.in, NEWS:
25262 Bison 1.29 released.
25263
252641999-10-27 Jesse Thilo <jthilo@gnu.org>
25265
25266 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
25267 Added reference card.
25268
252691999-07-26 Jesse Thilo <jthilo@gnu.org>
25270
25271 * po/ru.po: Added Russian translation.
25272
252731999-07-26 Jesse Thilo <jthilo@gnu.org>
25274
25275 * configure.in: Added Russian translation.
25276
252771999-07-06 Jesse Thilo <jthilo@gnu.org>
25278
25279 * configure.in, NEWS, README:
25280 Released version 1.28.
25281
252821999-06-14 Jesse Thilo <jthilo@gnu.org>
25283
25284 * src/system.h:
25285 Squashed redefinition warning on some systems.
25286
25287 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
25288 Have configure build version string instead of relying on ANSI string
25289 concatentation.
25290
252911999-06-14 Jesse Thilo <jthilo@gnu.org>
25292
25293 * po/POTFILES.in: Got rid of version.c.
25294
252951999-06-14 Jesse Thilo <jthilo@gnu.org>
25296
25297 * acconfig.h, configure.in:
25298 Have configure build version string instead of relying on ANSI string
25299 concatentation.
25300
253011999-06-08 Jesse Thilo <jthilo@gnu.org>
25302
25303 * doc/bison.1:
25304 Dropped mention of `+' for long-named options.
25305
253061999-05-30 Jesse Thilo <jthilo@gnu.org>
25307
25308 * src/files.c: Added <unistd.h> for unlink().
25309
25310 * src/Makefile.am, src/system.h:
25311 I18n fixes.
25312
253131999-05-30 Jesse Thilo <jthilo@gnu.org>
25314
25315 * README: Added a FAQ list.
25316
25317 * configure.in, acconfig.h:
25318 I18n fixes.
25319
253201999-05-30 Jesse Thilo <jthilo@gnu.org>
25321
25322 * doc/FAQ, doc/Makefile.am:
25323 Added a FAQ list.
25324
253251999-05-19 Jesse Thilo <jthilo@gnu.org>
25326
25327 * src/alloc.h, src/symtab.h, src/version.c:
25328 Protected inclusion of "config.h" with HAVE_CONFIG_H.
25329
253301999-04-18 Jesse Thilo <jthilo@gnu.org>
25331
25332 * src/.cvsignore, src/Makefile.am:
25333 Reorganized: sources in `src', documentation in `doc'.
25334
25335 * src/lex.c (literalchar):
25336 fixed the code for escaping double quotes (thanks
25337 Jonathan Czisny.)
25338
253391999-04-18 Jesse Thilo <jthilo@gnu.org>
25340
25341 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
25342 Adjusted paths to reflect directory reorganization.
25343
253441999-04-18 Jesse Thilo <jthilo@gnu.org>
25345
25346 * doc/.cvsignore, doc/Makefile.am:
25347 Reorganized: sources in `src', documentation in `doc'.
25348
253491999-04-18 Jesse Thilo <jthilo@gnu.org>
25350
25351 * configure.in:
25352 Updated AC_INIT file to reflect directory reorganization.
25353
25354 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
25355 Reorganized: sources in `src', documentation in `doc'.
25356
253571999-04-13 Jesse Thilo <jthilo@gnu.org>
25358
25359 * src/allocate.c:
25360 Don't declare calloc() and realloc() if not necessary.
25361
253621999-04-13 Jesse Thilo <jthilo@gnu.org>
25363
25364 * configure.in, acconfig.h, acinclude.m4:
25365 Don't declare calloc() and realloc() if not necessary.
25366
253671999-03-23 Jesse Thilo <jthilo@gnu.org>
25368
25369 * po/.cvsignore: Added i18n support.
25370
253711999-03-23 Jesse Thilo <jthilo@gnu.org>
25372
25373 * acconfig.h, configure.in, Makefile.am:
25374 Added i18n support.
25375
253761999-03-22 Jesse Thilo <jthilo@gnu.org>
25377
25378 * src/bison.s1: Fixed #line numbers.
25379
253801999-03-15 Jesse Thilo <jthilo@gnu.org>
25381
25382 * po/es.po, po/fr.po, po/nl.po, po/de.po:
25383 Added PO files from Translation Project.
25384
253851999-03-03 Jesse Thilo <jthilo@gnu.org>
25386
25387 * Makefile.am:
25388 Added support for non-ANSI compilers (ansi2knr).
25389
253901999-02-16 Jesse Thilo <jthilo@gnu.org>
25391
25392 * configure.in: Bumped version number to 1.27.
25393
25394 * Makefile.am:
25395 Added `bison.simple' to list of files removed by `make distclean'.
25396
253971999-02-12 Jesse Thilo <jthilo@gnu.org>
25398
25399 * src/files.c, src/files.h:
25400 Defined locations of parser files in config.h instead of Makefile.
25401
254021999-02-12 Jesse Thilo <jthilo@gnu.org>
25403
25404 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
25405 Defined locations of parser files in config.h instead of Makefile.
25406
254071999-02-09 Jesse Thilo <jthilo@gnu.org>
25408
25409 * Makefile.am:
25410 Removed inappropriate use of $< macro.
25411
254121999-02-05 Jesse Thilo <jthilo@gnu.org>
25413
25414 * po/Makefile.in.in, po/POTFILES.in:
25415 Add `po' directory skeleton.
25416
254171999-01-27 Jesse Thilo <jthilo@gnu.org>
25418
25419 * README: Document help-bison list.
25420
25421 * configure.in: Add check for mkstemp().
25422
254231999-01-20 Jesse Thilo <jthilo@gnu.org>
25424
25425 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
25426 Hush a few compiler warnings.
25427
25428 * src/files.c:
25429 Add tryclose(), which verifies that fclose was successful.
25430 Hush a couple of compiler warnings.
25431
254321999-01-20 Jesse Thilo <jthilo@gnu.org>
25433
25434 * Makefile.am, OChangeLog:
25435 ChangeLog is now automatically generated. Include the old version as
25436 OChangeLog.
25437
254381999-01-14 Jesse Thilo <jthilo@gnu.org>
25439
25440 * 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:
25441 Update FSF address.
25442
254431999-01-14 Jesse Thilo <jthilo@gnu.org>
25444
25445 * doc/bison.texinfo: Fix formatting glitch.
25446
25447 * doc/bison.texinfo: Update FSF address.
25448
254491999-01-14 Jesse Thilo <jthilo@gnu.org>
25450
25451 * acconfig.h: Update FSF address.
25452
254531999-01-08 Jesse Thilo <jthilo@gnu.org>
25454
25455 * src/system.h:
25456 Don't define PACKAGE here, since config.h defines it.
25457
254581998-12-30 Jesse Thilo <jthilo@gnu.org>
25459
25460 * src/reader.c: Update copyright date.
25461
25462 * src/main.c:
25463 Ditch sprintf to statically-sized buffers in fatal/warn functions in
25464 favor of output directly to stderr (avoids buffer overruns).
25465
25466 * src/reader.c: Some checks for premature EOF.
25467
25468 * 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:
25469 Use prototypes if the compiler understands them.
25470
25471 * src/files.c: Honor TMPDIR on Unix hosts.
25472 Use prototypes if the compiler understands them.
25473
25474 * src/reader.c:
25475 Fix a couple of buffer overrun bugs.
25476 Use prototypes if the compiler understands them.
25477
25478 * src/system.h: Include unistd.h and ctype.h.
25479 Use #ifdef instead of #if for NLS symbols.
25480
254811998-12-30 Jesse Thilo <jthilo@gnu.org>
25482
25483 * doc/bison.texinfo:
25484 Delete comment "consider using @set for edition number, etc..." since
25485 we now are doing so.
25486
254871998-12-30 Jesse Thilo <jthilo@gnu.org>
25488
25489 * configure.in:
25490 Use prototypes if the compiler understands them.
25491
25492 * NEWS: Document 1.26 highlights.
25493
25494 * Makefile.am: Require Automake 1.3 or later.
25495
25496 * acconfig.h:
25497 Use prototypes if the compiler understands them.
25498
254991998-12-29 Jesse Thilo <jthilo@gnu.org>
25500
25501 * src/version.c:
25502 Use VERSION symbol from automake for version number.
25503
255041998-12-29 Jesse Thilo <jthilo@gnu.org>
25505
25506 * acconfig.h, configure.in, version.cin:
25507 Use VERSION symbol from automake for version number.
25508
255091998-11-28 Jesse Thilo <jthilo@gnu.org>
25510
25511 * Makefile.am:
25512 Distribute original version of simple parser (bison.s1), not built
25513 version (bison.simple).
25514
255151998-11-28 Jesse Thilo <jthilo@gnu.org>
25516
25517 * doc/bison.texinfo: Add info dir entry.
25518
25519 * doc/bison.texinfo:
25520 Let automake put version number into documentation.
25521
255221998-11-26 Jesse Thilo <jthilo@gnu.org>
25523
25524 * src/bison.cld, src/build.com, src/vmshlp.mar:
25525 Add non-RCS files from /gd/gnu/bison.
25526
255271998-11-26 Jesse Thilo <jthilo@gnu.org>
25528
25529 * doc/bison.1:
25530 Document the BISON_HAIRY and BISON_SIMPLE variables.
25531
255321998-11-25 Jesse Thilo <jthilo@gnu.org>
25533
25534 * src/version.c: Build version.c automatically.
25535
25536 * src/reader.c:
25537 Fix token numbering (used to start at 258, not 257).
25538
25539 * src/system.h: Include config.h.
25540
25541 * src/getargs.c: Update bug report address.
25542
25543 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
25544 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
25545
255461998-11-25 Jesse Thilo <jthilo@gnu.org>
25547
25548 * Makefile.am:
25549 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
25550
25551 * configure.in, version.cin:
25552 Build version.c automatically.
25553
25554 * AUTHORS: Add AUTHORS file.
25555
25556 * README: Update bug report address.
25557
25558 * bison.simple:
25559 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
25560
25561 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
25562 Add automake stuff.
25563
255641998-11-25 Jesse Thilo <jthilo@gnu.org>
25565
25566 * doc/bison.texinfo: Clean up some formatting.
25567
255681998-05-05 Richard Stallman <rms@gnu.org>
25569
25570 * doc/bison.texinfo:
25571 Explain better why to make a pure parser.
25572
255731998-01-05 Richard Stallman <rms@gnu.org>
25574
25575 * src/files.c (openfiles):
25576 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
25577 find a temporary directory, if possible. Do not unlink files while
25578 they are open.
25579
255801997-08-25 Richard Stallman <rms@gnu.org>
25581
25582 * src/reader.c (stack_offset;):
25583 Change some warni to warns.
25584
25585 * src/lex.c (literalchar): Use warns, not warni.
25586
255871997-06-28 Richard Stallman <rms@gnu.org>
25588
25589 * src/bison.s1: Add a Bison version comment.
25590
25591 * src/main.c (fatal, warn, berror):
25592 Use program_name.
25593
255941997-06-28 Richard Stallman <rms@gnu.org>
25595
25596 * Makefile.in (bison_version): New variable.
25597 (dist): Use that variable.
25598 (bison.s1): Substitute the Bison version into bison.simple.
25599
25600 * bison.simple: Add a Bison version comment.
25601
256021997-06-18 Richard Stallman <rms@gnu.org>
25603
25604 * src/main.c (fatal, warn, berror):
25605 Make error messages standard.
25606 (toomany): Improve error message text.
25607
25608 * 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:
25609 new.h renamed to alloc.h.
25610
256111997-06-18 Richard Stallman <rms@gnu.org>
25612
25613 * Makefile.in: new.h renamed to alloc.h.
25614
256151997-05-24 Richard Stallman <rms@gnu.org>
25616
25617 * src/lex.c (literalchar):
25618 Fix the code for escaping \, " and '.
25619
25620 (lex): Avoid trouble when there are many chars
25621 to discard in a char literal with just several chars in it.
25622
256231997-05-17 Richard Stallman <rms@gnu.org>
25624
25625 * src/bison.s1:
25626 Use malloc, if using alloca is troublesome.
25627 (YYSTACK_USE_ALLOCA): New flag macro.
25628 Define it for some systems and compilers.
25629 (YYSTACK_ALLOC): New macro.
25630 (yyparse): Use YYSTACK_ALLOC to allocate stack.
25631 If it was malloc'd, free it.
25632
256331997-05-17 Richard Stallman <rms@gnu.org>
25634
25635 * bison.simple:
25636 Use malloc, if using alloca is troublesome.
25637 (YYSTACK_USE_ALLOCA): New flag macro.
25638 Define it for some systems and compilers.
25639 (YYSTACK_ALLOC): New macro.
25640 (yyparse): Use YYSTACK_ALLOC to allocate stack.
25641 If it was malloc'd, free it.
25642
256431997-04-23 Richard Stallman <rms@gnu.org>
25644
25645 * src/bison.s1:
25646 (alloca) [__hpux]: Always define as __builtin_alloca.
25647
256481997-04-23 Richard Stallman <rms@gnu.org>
25649
25650 * bison.simple:
25651 (alloca) [__hpux]: Always define as __builtin_alloca.
25652
256531997-04-22 Richard Stallman <rms@gnu.org>
25654
25655 * src/bison.s1:
25656 [__hpux]: Include alloca.h (right for HPUX 10)
25657 instead of declaring alloca (right for HPUX 9).
25658
25659 * src/bison.s1 (__yy_memcpy):
25660 Declare arg `count' as unsigned int.
25661 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
25662
256631997-04-22 Richard Stallman <rms@gnu.org>
25664
25665 * bison.simple:
25666 [__hpux]: Include alloca.h (right for HPUX 10)
25667 instead of declaring alloca (right for HPUX 9).
25668
25669 * bison.simple (__yy_memcpy):
25670 Declare arg `count' as unsigned int.
25671 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
25672
256731997-01-03 Richard Stallman <rms@gnu.org>
25674
25675 * src/allocate.c: [__STDC__ or _MSC_VER]:
25676 Declare calloc and realloc to return void *.
25677
256781997-01-02 Richard Stallman <rms@gnu.org>
25679
25680 * src/system.h:
25681 [_MSC_VER]: Include stdlib.h and process.h.
25682 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
25683
25684 * src/main.c (main): Return FAILURE as a value.
25685 (printable_version): Declare arg as int, not char.
25686
256871997-01-02 Richard Stallman <rms@gnu.org>
25688
25689 * Makefile.in (dist):
25690 Explicitly check for symlinks, and copy them.
25691
256921996-12-19 Richard Stallman <rms@gnu.org>
25693
25694 * src/files.c:
25695 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
25696
256971996-12-18 Paul Eggert <eggert@gnu.org>
25698
25699 * src/bison.s1 (yyparse):
25700 If __GNUC__ and YYPARSE_PARAM are both defined,
25701 declare yyparse to have a void * argument.
25702
257031996-12-18 Paul Eggert <eggert@gnu.org>
25704
25705 * bison.simple (yyparse):
25706 If __GNUC__ and YYPARSE_PARAM are both defined,
25707 declare yyparse to have a void * argument.
25708
257091996-12-17 Richard Stallman <rms@gnu.org>
25710
25711 * src/reduce.c (nbits): Add some casts.
25712
257131996-08-12 Richard Stallman <rms@gnu.org>
25714
25715 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
25716
257171996-08-12 Richard Stallman <rms@gnu.org>
25718
25719 * bison.simple: Test _MSDOS as well as _MSDOS_.
25720
257211996-07-31 Richard Stallman <rms@gnu.org>
25722
25723 * src/bison.s1:
25724 [__sun && __i386]: Include alloca.h.
25725
257261996-07-31 Richard Stallman <rms@gnu.org>
25727
25728 * bison.simple:
25729 [__sun && __i386]: Include alloca.h.
25730
257311996-07-30 Richard Stallman <rms@gnu.org>
25732
25733 * src/bison.s1: Comment change.
25734
25735 * src/bison.s1: Test _MSDOS_, not MSDOS.
25736
257371996-07-30 Richard Stallman <rms@gnu.org>
25738
25739 * bison.simple: Comment change.
25740
25741 * bison.simple: Test _MSDOS_, not MSDOS.
25742
257431996-06-01 Richard Stallman <rms@gnu.org>
25744
25745 * 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:
25746 Insert `_' macro around many string constants.
25747
25748 * src/main.c:
25749 Insert `_' macro around many string constants.
25750
25751 (main): Call setlocale, bindtextdomain and textdomain.
25752
25753 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
25754 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
25755 [ENABLE_NLS]: Include libintl.h.
25756 [ENABLE_NLS] (gettext): Define.
25757 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
25758 (N_, PACKAGE, LOCALEDIR): New macros.
25759
257601996-06-01 Richard Stallman <rms@gnu.org>
25761
25762 * POTFILES.in: New file.
25763
25764 * Makefile.in (allocate.o):
25765 Define target explicitly.
25766
25767 * Makefile.in (CFLAGS): Set to @CFLAGS@.
25768 (LDFLAGS): Set to @LDFLAGS@.
25769 (configure): Run autoconf only if preceding `cd' succeeds.
25770 (bison.s1): Redirect output to temporary file then move the
25771 temporary to the target, rather than redirecting directly to bison.s1.
25772 (clean): Remove config.status and config.log.
25773 (distclean): Don't remove config.status here.
25774
257751996-05-12 Richard Stallman <rms@gnu.org>
25776
25777 * src/bison.s1:
25778 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
25779
257801996-05-12 Richard Stallman <rms@gnu.org>
25781
25782 * bison.simple:
25783 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
25784
257851996-05-11 Richard Stallman <rms@gnu.org>
25786
25787 * src/bison.s1 (__yy_memcpy):
25788 Really reorder the args, as was supposedly done on Feb 14 1995.
25789 (yyparse): Calls changed accordingly.
25790
257911996-05-11 Richard Stallman <rms@gnu.org>
25792
25793 * Makefile.in (dist): Don't use $(srcdir).
25794
25795 * bison.simple (__yy_memcpy):
25796 Really reorder the args, as was supposedly done on Feb 14 1995.
25797 (yyparse): Calls changed accordingly.
25798
257991996-01-27 Richard Stallman <rms@gnu.org>
25800
25801 * src/output.c (output_rule_data):
25802 Test YYERROR_VERBOSE in the conditional
25803 around the definition of ttyname.
25804
258051995-12-29 Richard Stallman <rms@gnu.org>
25806
25807 * src/bison.s1:
25808 Fix line numbers in #line commands.
25809
258101995-12-29 Richard Stallman <rms@gnu.org>
25811
25812 * bison.simple:
25813 Fix line numbers in #line commands.
25814
258151995-12-27 Richard Stallman <rms@gnu.org>
25816
25817 * src/bison.s1 (YYPARSE_PARAM_DECL):
25818 In C++, make it always null.
25819 (YYPARSE_PARAM_ARG): New macro.
25820 (yyparse): Use YYPARSE_PARAM_ARG.
25821
258221995-12-27 Richard Stallman <rms@gnu.org>
25823
25824 * bison.simple (YYPARSE_PARAM_DECL):
25825 In C++, make it always null.
25826 (YYPARSE_PARAM_ARG): New macro.
25827 (yyparse): Use YYPARSE_PARAM_ARG.
25828
258291995-11-29 Richard Stallman <rms@gnu.org>
25830
25831 * doc/bison.texinfo:
25832 Describe literal string tokens, %raw, %no_lines, %token_table.
25833
258341995-11-29 Daniel Hagerty <hag@gnu.org>
25835
25836 * doc/bison.texinfo: Fixed update date
25837
258381995-10-16 Richard Stallman <rms@gnu.org>
25839
25840 * src/version.c: Version 1.25.
25841
258421995-10-16 Richard Stallman <rms@gnu.org>
25843
25844 * NEWS: *** empty log message ***
25845
258461995-10-16 Richard Stallman <rms@gnu.org>
25847
25848 * doc/bison.1, doc/bison.rnh:
25849 Add new options.
25850
258511995-10-15 Richard Stallman <rms@gnu.org>
25852
25853 * src/vmsgetargs.c, src/getargs.c:
25854 Added -n, -k, and -raw switches.
25855 (noparserflag, toknumflag, rawtoknumflag): New variables.
25856
25857 * src/symtab.h (SALIAS):
25858 New #define for adding aliases to %token.
25859 (struct bucket): Added `alias' field.
25860
25861 * src/reduce.c (reduce_grammar):
25862 Revise error message.
25863 (print_notices): Remove final `.' from error message.
25864
25865 * src/reader.c (reader_output_yylsp):
25866 New function.
25867 (readgram): Use `#if 0' around code that accepted %command
25868 inside grammar rules: The documentation doesn't allow it,
25869 and it will fail since the %command processors scan for the next %.
25870 (parse_token_decl): Extended the %token
25871 declaration to allow a multi-character symbol as an alias.
25872 (parse_thong_decl): New function.
25873 (read_declarations): Added %thong declarations.
25874 (read_declarations): Handle NOOP to deal with allowing
25875 % declarations as another means to specify the flags.
25876 (readgram): Allow %prec prior to semantics embedded in a rule.
25877 (skip_to_char, read_declarations, copy_definition)
25878 (parse_token_decl, parse_start_decl, parse_type_decl)
25879 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
25880 (get_type_name, copy_guard, copy_action, readgram)
25881 (get_type, packsymbols): Revised most error messages.
25882 Changed `fatal' to `warnxxx' to avoid aborting for error.
25883 Revised and use multiple warnxxx functions to avoid using VARARGS1.
25884 (read_declarations): Improve the error message for
25885 an invalid character. Do not abort.
25886 (read_declarations, copy_guard, copy_action): Use
25887 printable_version to avoid unprintable characters in printed output.
25888 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
25889 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
25890 Allow the type of a non-terminal can be given
25891 more than once, as long as all specifications give the same type.
25892
25893 * src/output.c:
25894 (output_headers, output_trailers, output, output_gram)
25895 (output_rule_data): Implement noparserflag variable.
25896 Implement toknumflag variable.
25897 (output): Call reader_output_yylsp to output LTYPESTR.
25898
25899 * src/main.c (main):
25900 If reader sees an error, don't process the grammar.
25901 (fatals): Updated to not use VARARGS1.
25902 (printable_version, int_to_string, warn, warni, warns, warnss)
25903 (warnsss): New error reporting functions. Avoid abort for error.
25904
25905 * src/lex.h:
25906 Added THONG and NOOP for alias processing.
25907 Added SETOPT for the new code that allows setting options with %flags.
25908
25909 * src/lex.c:
25910 Include getopt.h. Add some extern decls.
25911 (safegetc): New function to deal with EOF gracefully.
25912 (literalchar); new function to deal with reading \ escapes.
25913 (lex): Use literalchar.
25914 (lex): Implemented "..." tokens.
25915 (literalchar, lex, parse_percent_token): Made tokenbuffer
25916 always contain the token. This includes growing the token
25917 buffer while reading an integer.
25918 (parse_percent_token): Replaced if-else statement with percent_table.
25919 (parse_percent_token): Added % declarations as another
25920 way to specify the flags -n, -l, and -r. Also added hooks for
25921 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
25922 major changes to files.c.
25923 (lex) Retain in the incoming stream a character following
25924 an incorrect '/'.
25925 (skip_white_space, lex): Revised most error messages
25926 and changed fatal to warn to avoid aborting.
25927 (percent_table): Added %thong declarations.
25928
25929 * src/gram.h: Comment changes.
25930
25931 * src/files.c (openfiles, open_extra_files, done):
25932 Add faction flag
25933 and actfile file. Handle noparserflag. Both for -n switch.
25934
25935 * src/conflicts.c (resolve_sr_conflict):
25936 Remove use of alloca.
25937
259381995-06-01 Jim Meyering <meyering@gnu.org>
25939
25940 * doc/bison.texinfo: *** empty log message ***
25941
259421995-05-06 Richard Stallman <rms@gnu.org>
25943
25944 * src/bison.s1: Comment change.
25945
259461995-05-06 Richard Stallman <rms@gnu.org>
25947
25948 * bison.simple: Comment change.
25949
259501995-05-03 Richard Stallman <rms@gnu.org>
25951
25952 * src/version.c: Version now 1.24.
25953
25954 * src/bison.s1: Change distribution terms.
25955
25956 * src/version.c: Version now 1.23.
25957
259581995-05-03 Richard Stallman <rms@gnu.org>
25959
25960 * doc/bison.texinfo:
25961 Rewrite "Conditions for Using Bison".
25962 Update version to 1.24.
25963
259641995-05-03 Richard Stallman <rms@gnu.org>
25965
25966 * bison.simple: Change distribution terms.
25967
259681995-02-23 Richard Stallman <rms@gnu.org>
25969
25970 * src/files.c: Test __VMS_POSIX as well as VMS.
25971
259721995-02-14 Jim Meyering <meyering@gnu.org>
25973
25974 * src/bison.s1 (__yy_memcpy):
25975 Renamed from __yy_bcopy to avoid
25976 confusion. Reverse FROM and TO arguments to be consistent with
25977 those of memcpy.
25978
259791995-02-14 Jim Meyering <meyering@gnu.org>
25980
25981 * bison.simple (__yy_memcpy):
25982 Renamed from __yy_bcopy to avoid
25983 confusion. Reverse FROM and TO arguments to be consistent with
25984 those of memcpy.
25985
259861994-11-10 David J. MacKenzie <djm@gnu.org>
25987
25988 * NEWS: reformat
25989
25990 * NEWS: New file.
25991
25992 * Makefile.in (DISTFILES): Include NEWS.
25993
25994 * Makefile.in (DISTFILES):
25995 Include install-sh, not install.sh.
25996
25997 * configure.in: Update to Autoconf v2 macro names.
25998
259991994-10-05 David J. MacKenzie <djm@gnu.org>
26000
26001 * Makefile.in: fix typo
26002
26003 * Makefile.in (prefix, exec_prefix):
26004 Let configure set them.
26005
260061994-09-28 David J. MacKenzie <djm@gnu.org>
26007
26008 * Makefile.in: Set datadir to $(prefix)/share.
26009
260101994-09-15 Richard Stallman <rms@gnu.org>
26011
26012 * src/bison.s1:
26013 Update copyright notice and GPL version.
26014
260151994-09-15 Richard Stallman <rms@gnu.org>
26016
26017 * bison.simple:
26018 Update copyright notice and GPL version.
26019
260201994-07-12 Richard Stallman <rms@gnu.org>
26021
26022 * src/reduce.c, src/reader.c:
26023 entered into RCS
26024
260251994-05-05 David J. MacKenzie <djm@gnu.org>
26026
26027 * Makefile.in: entered into RCS
26028
260291994-03-26 Richard Stallman <rms@gnu.org>
26030
26031 * src/bison.s1: entered into RCS
26032
260331994-03-26 Richard Stallman <rms@gnu.org>
26034
26035 * bison.simple: entered into RCS
26036
260371994-03-25 Richard Stallman <rms@gnu.org>
26038
26039 * src/main.c: entered into RCS
26040
260411994-03-24 Richard Stallman <rms@gnu.org>
26042
26043 * src/conflicts.c: entered into RCS
26044
260451994-01-02 Richard Stallman <rms@gnu.org>
26046
26047 * Makefile.in: *** empty log message ***
26048
260491993-11-21 Richard Stallman <rms@gnu.org>
26050
26051 * src/bison.s1: *** empty log message ***
26052
260531993-11-21 Richard Stallman <rms@gnu.org>
26054
26055 * doc/bison.texinfo: entered into RCS
26056
26057 * doc/bison.texinfo: *** empty log message ***
26058
260591993-11-21 Richard Stallman <rms@gnu.org>
26060
26061 * bison.simple: *** empty log message ***
26062
260631993-10-25 David J. MacKenzie <djm@gnu.org>
26064
26065 * doc/bison.texinfo: *** empty log message ***
26066
260671993-10-19 Richard Stallman <rms@gnu.org>
26068
26069 * src/bison.s1: *** empty log message ***
26070
260711993-10-19 Richard Stallman <rms@gnu.org>
26072
26073 * bison.simple: *** empty log message ***
26074
260751993-10-14 Richard Stallman <rms@gnu.org>
26076
26077 * src/bison.s1: *** empty log message ***
26078
260791993-10-14 Richard Stallman <rms@gnu.org>
26080
26081 * bison.simple: *** empty log message ***
26082
260831993-09-14 David J. MacKenzie <djm@gnu.org>
26084
26085 * doc/bison.texinfo: *** empty log message ***
26086
260871993-09-13 Noah Friedman <friedman@gnu.org>
26088
26089 * Makefile.in: *** empty log message ***
26090
260911993-09-10 Richard Stallman <rms@gnu.org>
26092
26093 * src/conflicts.c: *** empty log message ***
26094
26095 * src/system.h: entered into RCS
26096
260971993-09-10 Richard Stallman <rms@gnu.org>
26098
26099 * doc/bison.1: entered into RCS
26100
261011993-09-06 Noah Friedman <friedman@gnu.org>
26102
26103 * src/version.c: entered into RCS
26104
261051993-09-06 Noah Friedman <friedman@gnu.org>
26106
26107 * Makefile.in: *** empty log message ***
26108
261091993-07-30 David J. MacKenzie <djm@gnu.org>
26110
26111 * Makefile.in: *** empty log message ***
26112
261131993-07-24 Richard Stallman <rms@gnu.org>
26114
26115 * src/bison.s1: *** empty log message ***
26116
261171993-07-24 Richard Stallman <rms@gnu.org>
26118
26119 * bison.simple: *** empty log message ***
26120
261211993-07-08 David J. MacKenzie <djm@gnu.org>
26122
26123 * Makefile.in: *** empty log message ***
26124
261251993-07-04 Richard Stallman <rms@gnu.org>
26126
26127 * src/bison.s1: *** empty log message ***
26128
261291993-07-04 Richard Stallman <rms@gnu.org>
26130
26131 * bison.simple: *** empty log message ***
26132
261331993-06-26 David J. MacKenzie <djm@gnu.org>
26134
26135 * src/getargs.c: entered into RCS
26136
261371993-06-26 David J. MacKenzie <djm@gnu.org>
26138
26139 * doc/bison.texinfo: *** empty log message ***
26140
26141 * doc/bison.1: New file.
26142
261431993-06-25 Richard Stallman <rms@gnu.org>
26144
26145 * src/getargs.c: New file.
26146
261471993-06-16 Richard Stallman <rms@gnu.org>
26148
26149 * src/bison.s1: *** empty log message ***
26150
261511993-06-16 Richard Stallman <rms@gnu.org>
26152
26153 * bison.simple: *** empty log message ***
26154
261551993-06-03 Richard Stallman <rms@gnu.org>
26156
26157 * src/bison.s1: New file.
26158
261591993-06-03 Richard Stallman <rms@gnu.org>
26160
26161 * doc/bison.texinfo: *** empty log message ***
26162
261631993-06-03 Richard Stallman <rms@gnu.org>
26164
26165 * bison.simple: New file.
26166
261671993-05-19 Richard Stallman <rms@gnu.org>
26168
26169 * doc/bison.texinfo: New file.
26170
261711993-05-07 Noah Friedman <friedman@gnu.org>
26172
26173 * Makefile.in: *** empty log message ***
26174
261751993-04-28 Noah Friedman <friedman@gnu.org>
26176
26177 * src/reader.c: *** empty log message ***
26178
261791993-04-23 Noah Friedman <friedman@gnu.org>
26180
26181 * src/alloc.h: entered into RCS
26182
261831993-04-20 David J. MacKenzie <djm@gnu.org>
26184
26185 * src/version.c: *** empty log message ***
26186
26187 * src/files.c, src/allocate.c:
26188 entered into RCS
26189
26190 * src/reader.c: *** empty log message ***
26191
26192 * src/lex.c: entered into RCS
26193
26194 * src/conflicts.c: New file.
26195
26196 * src/symtab.c: entered into RCS
26197
26198 * src/alloc.h: New file.
26199
26200 * src/LR0.c: entered into RCS
26201
262021993-04-18 Noah Friedman <friedman@gnu.org>
26203
26204 * src/reader.c: New file.
26205
26206 * src/version.c: *** empty log message ***
26207
262081993-04-18 Noah Friedman <friedman@gnu.org>
26209
26210 * Makefile.in: *** empty log message ***
26211
262121993-04-17 Noah Friedman <friedman@gnu.org>
26213
26214 * Makefile.in: *** empty log message ***
26215
262161993-04-15 Richard Stallman <rms@gnu.org>
26217
26218 * src/main.c, src/files.c:
26219 New file.
26220
262211993-04-15 Noah Friedman <friedman@gnu.org>
26222
26223 * configure.in: entered into RCS
26224
26225 * configure.in: *** empty log message ***
26226
26227 * configure.in: New file.
26228
262291993-04-14 Richard Stallman <rms@gnu.org>
26230
26231 * Makefile.in: New file.
26232
262331993-04-13 Richard Stallman <rms@gnu.org>
26234
26235 * src/version.c: New file.
26236
262371993-03-25 Richard Stallman <rms@gnu.org>
26238
26239 * src/output.c: entered into RCS
26240
262411992-09-25 Richard Stallman <rms@gnu.org>
26242
26243 * configure.bat: entered into RCS
26244
262451992-06-22 Richard Stallman <rms@gnu.org>
26246
26247 * src/vmsgetargs.c: entered into RCS
26248
262491992-06-22 Richard Stallman <rms@gnu.org>
26250
26251 * doc/bison.rnh: entered into RCS
26252
262531992-04-20 David J. MacKenzie <djm@gnu.org>
26254
26255 * README: entered into RCS
26256
262571992-01-22 Richard Stallman <rms@gnu.org>
26258
26259 * src/machine.h: entered into RCS
26260
262611991-12-21 Richard Stallman <rms@gnu.org>
26262
26263 * src/lalr.c, src/closure.c:
26264 entered into RCS
26265
262661991-12-20 Richard Stallman <rms@gnu.org>
26267
26268 * src/state.h: entered into RCS
26269
262701991-12-18 Richard Stallman <rms@gnu.org>
26271
26272 * src/print.c, src/nullable.c, src/derives.c:
26273 entered into RCS
26274
262751991-11-03 David J. MacKenzie <djm@gnu.org>
26276
26277 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
26278 entered into RCS
26279
262801988-09-09 Richard Stallman <rms@gnu.org>
26281
26282 * src/bison.hairy: entered into RCS
26283
262841987-12-16 Richard Stallman <rms@gnu.org>
26285
26286 * REFERENCES: entered into RCS
dc546b0f 26287
f294a2c2 26288
04098407 26289 -----
f294a2c2 26290
575619af
JD
26291 Copyright (C) 1987-1988, 1991-2011 Free Software Foundation,
26292 Inc.
f294a2c2 26293
04098407
PE
26294 Copying and distribution of this file, with or without
26295 modification, are permitted provided the copyright notice and this
26296 notice are preserved.