]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
lr.default-reductions: rename "full" value to "most".
[bison.git] / ChangeLog
... / ...
CommitLineData
12011-03-20 Joel E. Denny <joeldenny@joeldenny.org>
2
3 lr.default-reductions: rename "full" value to "most".
4 Unlike "consistent" and "accepting", "full" doesn't answer the
5 question of "which states".
6 * doc/bison.texinfo (%define Summary): Update.
7 (Default Reductions): Update.
8 * src/print.c (print_reductions): Update.
9 * src/reader.c (prepare_percent_define_front_end_variables):
10 Update.
11 * src/tables.c (action_row): Update.
12 * tests/input.at (%define enum variables): Update.
13 * tests/reduce.at (%define lr.default-reductions): Update.
14
152011-03-13 Joel E. Denny <joeldenny@joeldenny.org>
16
17 * src/parse-gram.c, src/parse-gram.h: Regenerate.
18
192011-03-09 Akim Demaille <akim@lrde.epita.fr>
20
21 named references: fix double free.
22 In `rhs[name]: "a" | "b"', do not free "name" twice.
23 Reported by Tys Lefering.
24 <http://lists.gnu.org/archive/html/bug-bison/2010-06/msg00002.html>
25 * src/named-ref.h, src/named-ref.c (named_ref_copy): New.
26 * src/parse-gram.y (current_lhs): Rename as...
27 (current_lhs_symbol): this.
28 (current_lhs): New function. Use it to free the current lhs
29 named reference.
30 * src/reader.c: Bind lhs to a copy of the current named reference.
31 * src/symlist.c: Rely on free (0) being valid.
32 * tests/named-refs.at: Test this.
33
342011-03-09 Akim Demaille <akim@lrde.epita.fr>
35
36 tests: style changes.
37 * tests/named-refs.at (Redundant words in LHS brackets)
38 (Unresolved references): here.
39
402011-03-06 Joel E. Denny <joeldenny@joeldenny.org>
41
42 java: fix parser tracing bug.
43 * NEWS (2.5): Document.
44 * data/lalr1.java (YYParser::YYStack::print): Don't skip top
45 element.
46
472011-03-06 Joel E. Denny <joeldenny@joeldenny.org>
48
49 java: finish fixing parser stack popping bug.
50 * NEWS (2.5): Document.
51 * data/lalr1.java (YYParser::YYStack::pop): Fix off-by-one error
52 in clearing the location stack. Also fix pop function that
53 accepts no arguments.
54
552011-03-06 Angelo Borsotti <angelo.borsotti@gmail.com> (tiny change)
56
57 java: fix parser stack popping bug.
58 Reported at
59 <http://lists.gnu.org/archive/html/bug-bison/2011-02/msg00005.html>.
60 * THANKS (Angelo Borsotti): Add.
61 * data/lalr1.java (YYParser::YYStack::pop): Fix off-by-one error
62 in clearing the value stack. Previously, the top element of the
63 stack wasn't cleared and so the value was not garbage collected.
64
652011-03-06 Joel E. Denny <joeldenny@joeldenny.org>
66
67 doc: cite publication for LAC.
68 * doc/bison.texinfo (LAC): Here.
69
702011-03-06 Joel E. Denny <joeldenny@joeldenny.org>
71
72 doc: clean up terminology for mysterious conflicts.
73 * doc/bison.texinfo (Mystery Conflicts): Rename node to...
74 (Mysterious Conflicts): ... this, which is already the section
75 title and the name used in the index. Update all cross-references
76 to this node. Also, don't imply that R/R conflicts are the only
77 kind of mysterious conflict.
78
792011-03-06 Joel E. Denny <joeldenny@joeldenny.org>
80
81 lr.default-reductions: rename "all" value to "full".
82 States that shift the error token do not have default reductions,
83 and GLR disables some default reductions, so "all" was a misnomer.
84 * doc/bison.texinfo (%define Summary): Update.
85 (Default Reductions): Update.
86 * src/print.c (print_reductions): Update.
87 * src/reader.c (prepare_percent_define_front_end_variables):
88 Update.
89 * src/tables.c (action_row): Update.
90 * tests/input.at (%define enum variables): Update.
91 * tests/reduce.at (%define lr.default-reductions): Update.
92
932011-03-06 Joel E. Denny <joeldenny@joeldenny.org>
94
95 doc: create a new Tuning LR section in the manual.
96 And clean up all other documentation of the features described
97 there.
98 * NEWS (2.5): Tweak wording of lr.type and parse.lac entries a
99 bit, update the cross-references to the manual, and point out that
100 LAC has caveats. Don't be so adamant that IELR+LAC=canonical LR.
101 That is, as the referenced section in the manual documents, LAC
102 does not fix infinite parsing loops on syntax errors.
103 * doc/bison.texinfo: Consistently drop the "(1)" suffix from LALR,
104 IELR, and LR in @cindex.
105 (%define Summary): Condense the entries for lr.default-reductions,
106 lr.keep-unreachable-states, lr.type, and parse.lac into brief
107 summaries, and cross-reference the appropriate subsections of
108 Tuning LR. For parse.lac, mention that it's only implemented for
109 deterministic parsers in C. In parse.error entry, mention LAC,
110 and add cross-reference to the LAC section.
111 (Error Reporting): When mentioning parse.error, mention LAC, and
112 add cross-reference to the LAC section.
113 (Tuning LR): New section with an extended version of the
114 documentation removed from %define Summary. Change all
115 cross-references in the manual to point here instead of there.
116 (Calc++ Parser): When mentioning parse.error, mention LAC, and add
117 cross-reference to the LAC section.
118 (Table of Symbols): In %error-verbose entry, add cross-reference
119 to Error Reporting.
120 (Glossary): Capitalize entry titles consistently. Add definitions
121 for "defaulted state" and "unreachable state". Expand IELR
122 acronym in IELR's entry.
123
1242011-02-20 Joel E. Denny <joeldenny@joeldenny.org>
125
126 doc: add bibliography to manual.
127 * doc/bison.texinfo (Mystery Conflicts): Cross-reference
128 bibliography instead of citing publications directly.
129 (Generalized LR Parsing): Likewise.
130 (Bibliography): New section. Not all entries are cross-referenced
131 yet, but that will come in future patches.
132
1332011-02-19 Joel E. Denny <joeldenny@joeldenny.org>
134
135 java: test and document previous bug fix.
136 * NEWS (2.5): Document it.
137 * tests/java.at (_AT_DATA_JAVA_CALC_Y): To one of the yyerror
138 invocations, pass a location that spans multiple tokens. Change
139 yyerror to report all of a location rather than just the begin
140 position. Extend yylex and Position to count tokens on a line.
141 Remove getHashCode as it's unused. Update all expected output.
142
1432011-02-19 Bernd Kiefer <kiefer@dfki.de> (tiny change)
144
145 java: fix location handling bug.
146 Reported at
147 <http://lists.gnu.org/archive/html/bison-patches/2011-02/msg00005.html>.
148 * data/lalr1.java (YYParser::yylloc): For non-empty RHS, fix
149 reversed access to location stack.
150 * THANKS (Bernd Kiefer): Add.
151
1522011-02-13 Joel E. Denny <joeldenny@joeldenny.org>
153
154 doc: fix some minor inconsistencies.
155 * doc/bison.texinfo (%define Summary): Fix mislabeled entry for
156 lex_symbol.
157 (%code Summary): For consistency with the variable list in the
158 %define Summary, enclose the list of %code qualifiers in a table
159 instead of an itemize.
160
1612011-02-06 Joel E. Denny <joeldenny@joeldenny.org>
162
163 doc: clean up new subsections in manual.
164 * doc/bison.texinfo (%define Summary): Reword so it reads well as
165 a separate section. For example, add an intro, and move most of
166 the text outside of the @deffn so it is not indented so far.
167 (%code Summary): Likewise.
168 (Table of Symbols): Reword %code entry to match the %code entry in
169 Decl Summary.
170
1712011-02-06 Joel E. Denny <joeldenny@joeldenny.org>
172
173 doc: finish splitting apart the manual's Decl Summary section.
174 Suggested by Akim Demaille at
175 <http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00013.html>.
176 * doc/bison.texinfo (Decl Summary): Extract most of the %define
177 entry into...
178 (%define Summary): ... this new subsection, and update all
179 cross-references. For readability of the patches, rewriting of
180 the text so it makes sense as a separate subsection will come in a
181 later patch. Moreover, the majority of the text describing the
182 various new LR features should likely move to another new section
183 somewhere.
184
1852011-02-06 Joel E. Denny <joeldenny@joeldenny.org>
186
187 doc: begin to split apart the manual's Decl Summary section.
188 Discussed in thread starting at
189 <http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00013.html>.
190 * doc/bison.texinfo (Decl Summary): Extract most of the %code
191 entry into...
192 (%code Summary): ... this new subsection, and update all
193 cross-references. For readability of the patches, rewriting of
194 the text so it makes sense as a separate subsection will come in a
195 later patch.
196
1972011-02-06 Joel E. Denny <joeldenny@joeldenny.org>
198
199 doc: clean up naming of various Bison files.
200 The Bison manual's names for various files associated with a Bison
201 parser has devolved into inconsistency. This patch makes the
202 naming consistent for the most important files. First, it chooses
203 "grammar file" over "input file". The former appears to be more
204 traditional in the Bison manual, and Bison has other input
205 files (skeletons). Second, it chooses "parser implementation
206 file" over names like "parser file", "parser source file", "parser
207 source code file", and "parser output file". The new name makes
208 it clearer where Bison generates the main parser implementation,
209 and it is easily distinguishable from "parser header file".
210 * doc/bison.texinfo: Implement throughout.
211
2122011-02-06 Joel E. Denny <joeldenny@joeldenny.org>
213
214 doc: give credit to more of Bison's developers.
215 * doc/bison.texinfo (Introduction): Don't imply that only Robert
216 Corbett, Richard Stallman, and Wilfred Hansen have contributed to
217 Bison. However, I don't have time to write a full history, so
218 just point readers to THANKS and ChangeLog.
219
2202011-02-06 Joel E. Denny <joeldenny@joeldenny.org>
221
222 doc: document experimental features better.
223 * doc/bison.texinfo (Introduction): Say that IELR(1) and canonical
224 LR(1) are experimental. Mention Java. Normally experimental
225 features probably shouldn't be mentioned in the introduction.
226 However, if Bison's limitations to LALR(1), C, and C++ are so
227 important that they should be mentioned here, then it's important
228 to point out that Bison is beginning to escape those limitations.
229 Moreover, these particular experimental features have very little
230 chance of being removed.
231 * src/getargs.c (usage): Say that IELR(1) and canonical LR(1) are
232 experimental.
233
2342011-01-29 Joel E. Denny <joeldenny@joeldenny.org>
235
236 Do not allow identifiers that start with a dash.
237 This cleans up our previous fixes for a bug whereby Bison
238 discarded `.field' in `$-1.field'. The previous fixes were less
239 restrictive about where a dash could appear in an identifier, but
240 the restrictions were hard to explain. That bug was reported and
241 this final fix was originally suggested by Paul Hilfinger. This
242 also fixes a remaining bug reported by Paul Eggert whereby Bison
243 parses `%token ID -123' as `%token ID - 123' and handles `-' as an
244 identifier. Now, `-' cannot be an identifier. Discussed in
245 threads beginning at
246 <http://lists.gnu.org/archive/html/bug-bison/2011-01/msg00000.html>,
247 <http://lists.gnu.org/archive/html/bug-bison/2011-01/msg00004.html>.
248 * NEWS (2.5): Update entry describing the dash extension to
249 grammar symbol names. Also, move that entry before the named
250 references entry because the latter mentions the former.
251 * doc/bison.texinfo (Symbol): Update documentation for symbol
252 names. As suggested by Paul Eggert, mention the effect of periods
253 and dashes on named references.
254 (Decl Summary): Update documentation for unquoted %define values,
255 which, as a side effect, can no longer start with dashes either.
256 * src/scan-code.l (id): Implement.
257 * src/scan-gram.l (id): Implement.
258 * tests/actions.at (Exotic Dollars): Extend test group to exercise
259 bug reported by Paul Hilfinger.
260 * tests/input.at (Symbols): Update test group, and extend to
261 exercise bug reported by Paul Eggert.
262 * tests/named-refs.at (Stray symbols in brackets): Update test
263 group.
264 ($ or @ followed by . or -): Likewise.
265 * tests/regression.at (Invalid inputs): Likewise.
266
2672011-01-24 Joel E. Denny <joeldenny@joeldenny.org>
268
269 * data/yacc.c: Fix last apostrophe warning from xgettext.
270
2712011-01-09 Paul Eggert <eggert@cs.ucla.edu>
272
273 Fix minor problems encountered by a fresh bootstrap.
274 * data/glr.c, data/yacc.c: Do not use apostrophes in '#' comments,
275 as they confuse xgettext, which tries to parse them as C character
276 constants in a preprocessor directive.
277 * data/yacc.c (yy_lac): Don't use printf %d format on *yyesp, as
278 that expression might not promote to int on some platforms.
279 * src/parse-gram.c, src/parse-gram.h: Regenerate.
280
2812011-01-09 Joel E. Denny <joeldenny@joeldenny.org>
282
283 Improve error messages for `$' or `@' followed by `.' or `-'.
284 Previously, for this special case of an invalid reference, the
285 usual "symbol not found in production:" was printed. However,
286 because the symbol name was parsed as the empty string, that
287 message was followed immediately by a newline instead of a symbol
288 name. In reality, this is a syntax error, so the reference is
289 invalid regardless of the symbols actually appearing in the
290 production. Discussed at
291 <http://lists.gnu.org/archive/html/bison-patches/2011-01/msg00012.html>.
292 * src/scan-code.l (parse_ref): Report the above case as a syntax
293 error. Other than that, continue to handle this case like any
294 other invalid reference that Bison manages to parse because
295 "possibly meant" messages can still be helpful to the user.
296 * tests/named-refs.at ($ or @ followed by . or -): New test group.
297
2982011-01-08 Joel E. Denny <joeldenny@joeldenny.org>
299
300 doc: don't use @acronym.
301 Lately, many GNU packages are dropping it. See
302 <http://lists.gnu.org/archive/html/bison-patches/2011-01/msg00003.html>.
303 * doc/bison.texinfo: Remove all uses.
304
3052011-01-05 Alex Rozenman <rozenman@gmail.com>
306
307 Do not allow identifiers that start with a negative number.
308 Reported by Paul Hilfinger as a side effect of named references
309 support at
310 <http://lists.gnu.org/archive/html/bug-bison/2011-01/msg00000.html>.
311 Suggested by Paul Eggert.
312 * src/scan-code.l ({letter}, {id}): Adjust lexical definitions.
313 * src/scan-gram.l ({letter}, {id}): Likewise.
314
3152011-01-03 Joel E. Denny <joeldenny@joeldenny.org>
316
317 * ChangeLog (2011-01-02): improve description.
318
3192011-01-03 Joel E. Denny <joeldenny@joeldenny.org>
320
321 maint: don't update copyright years in bootstrap.
322 * .x-update-copyright: Add entry for bootstrap.
323 * bootstrap: Remove 2011 from copyright years. The bootstrap
324 version we're currently using comes from an older version of
325 gnulib.
326 * bootstrap.conf (bootstrap_sync): Add comments explaining this
327 issue.
328
3292011-01-02 Joel E. Denny <joeldenny@joeldenny.org>
330
331 maint: run "make update-copyright".
332
3332011-01-02 Joel E. Denny <joeldenny@joeldenny.org>
334
335 maint: prepare to use year ranges in copyright notices.
336 * README (Copyright statements): New section explaining the range
337 notation. The GNU maintainers document requires this explanation:
338 <http://www.gnu.org/prep/maintain/maintain.html#Copyright-Notices>.
339 I copied our explanation from coreutils.
340 * build-aux/update-b4-copyright: Revert 2010-06-17 changes that
341 disabled Bison's automated use of ranges.
342 * cfg.mk (update-copyright-env): Likewise.
343
3442011-01-02 Joel E. Denny <joeldenny@joeldenny.org>
345
346 Correct my email address.
347 * ChangeLog: In all recent entries.
348 * THANKS (Joel E. Denny): Here.
349
3502010-12-19 Joel E. Denny <joeldenny@joeldenny.org>
351
352 doc: cleanup.
353 * NEWS (2.5): Try to sort entries according to how interesting
354 users might find them.
355
3562010-12-19 Joel E. Denny <joeldenny@joeldenny.org>
357
358 doc: cleanup.
359 * NEWS (2.5): Make some minor improvements to wording, and format
360 entries more consistently.
361 * doc/bison.texinfo (Language and Grammar): Point out that IELR
362 and canonical LR are experimental features.
363 (Decl Summary): In list of %define variables, make wording more
364 consistent. Improve discussion of using LALR for GLR.
365
3662010-12-19 Joel E. Denny <joeldenny@joeldenny.org>
367
368 parse.lac: document.
369 * NEWS (2.5): Add entry for LAC, and mention LAC in entry for
370 other corrections to verbose syntax error messages.
371 * doc/bison.texinfo (Decl Summary): Rewrite entries for
372 lr.default-reductions and lr.type to be clearer, to mention
373 %nonassoc's effect on canonical LR, and to mention LAC. Add entry
374 for parse.lac.
375 (Glossary): Add entry for LAC.
376
3772010-12-11 Joel E. Denny <joeldenny@joeldenny.org>
378
379 parse.lac: implement exploratory stack reallocations.
380 * data/yacc.c: Rename %define variable parse.lac.es-capacity to
381 parse.lac.es-capacity-initial. Accept parse.lac.memory-trace
382 with values of "failures" (default) or "full".
383 (b4_declare_parser_state_variables): Add yyesa, yyes, and
384 yyes_capacity variables.
385 (YYSTACK_USE_ALLOCA): Ignore it if LAC requested.
386 (YYSTACK_ALLOC, YYSTACK_FREE, YYSTACK_ALLOC_MAXIMUM): Define if
387 LAC requested.
388 (YYCOPY_NEEDED): New cpp macro.
389 (YYCOPY): Define if LAC requested.
390 (yy_lac_stack_realloc): New function implementing stack
391 reallocations. Use YYMAXDEPTH for maximum stack size given that
392 the stack should never need to grow larger than the main state
393 stack needs to grow without LAC.
394 (YY_LAC_ESTABLISH): Update yy_lac invocation.
395 (yy_lac): Add arguments for exploratory stack memory data
396 recorded in the main parser. Invoke yy_lac_stack_realloc when
397 reallocation is necessary.
398 (yysyntax_error): Add the same new arguments and pass them to
399 yy_lac.
400 (yypstate_delete): Free yyes if necessary.
401 (yyesa, yyes, yyes_capacity): #define these to yypstate members
402 in the case of push parsing.
403 (yyparse, yypush_parse): Initialize yyes and yyes_capacity.
404 Update yysyntax_error invocations. At yyreturn, free yyes if
405 necessary.
406 * src/parse-gram.y: %define parse.lac full.
407 * tests/input.at (LAC: errors for %define): Extend for
408 parse.lac-memory-trace.
409 * tests/regression.at (LAC: Exploratory stack): Extend to check
410 that stack reallocs happen when expected.
411 (LAC: Memory exhaustion): Update to use YYMAXDEPTH and
412 parse.lac.es-capacity-initial.
413
4142010-12-11 Joel E. Denny <joeldenny@joeldenny.org>
415
416 parse.lac: implement as %define variable.
417 LAC = lookahead correction. See discussion at
418 <http://lists.gnu.org/archive/html/bison-patches/2009-09/msg00034.html>.
419 However, one point there must be corrected: because of %nonassoc,
420 LAC is *not* always redundant for lr.type=canonical-lr.
421 * data/yacc.c: Accept values of "none" (default) or "full" for
422 parse.lac. Accept %define parse.lac.es-capacity to specify
423 capacity of LAC's temporary exploratory stack. It defaults to 20
424 and, for now, will not grow dynamically.
425 (b4_lac_flag, b4_lac_if): New m4 macros. Evaluate as true for
426 parse.lac!=none.
427 (YYBACKUP): Invoke YY_LAC_DISCARD.
428 (YY_LAC_ESTABLISH, YY_LAC_DISCARD): New cpp macros that invoke
429 yy_lac and track when it needs to be invoked
430 (yy_lac): New function that, given the current stack, determines
431 whether a token can eventually be shifted. Return status mimics
432 yyparse return status.
433 (yysyntax_error): Change yystate argument to yyssp so stack top
434 can be passed to yy_lac. If LAC is requested, build expected
435 token list by invoking yy_lac for every token instead of just
436 checking the current state for lookaheads. Return 2 if yy_lac
437 exhausts memory.
438 (yyparse, yypush_parse): Use local variable yy_lac_established and
439 cpp macros YY_LAC_ESTABLISH and YY_LAC_DISCARD to implement LAC.
440 Update yysyntax_error invocation. Add yyexhaustedlab code if LAC
441 is requested.
442 * tests/conflicts.at (%nonassoc and eof): Extend to check the
443 effect of each of -Dlr.type=canonical-lr and -Dparse.lac=full.
444 (parse.error=verbose and consistent errors): Likewise.
445 (LAC: %nonassoc requires splitting canonical LR states): New test
446 group demonstrating how LAC can fix canonical LR.
447 * tests/input.at (LAC: Errors for %define): New test group.
448 * tests/regression.at (LAC: Exploratory stack): New test group.
449 (LAC: Memory exhaustion): New test group.
450
4512010-11-21 Joel E. Denny <joeldenny@joeldenny.org>
452
453 build: use gnulib's new bootstrap_sync option.
454 Now, whenever we update bison's copy of gnulib, bootstrap will
455 update itself the next time it's run.
456 * bootstrap: Copy from latest gnulib for bootstrap_sync support.
457 * bootstrap.conf (bootstrap_sync): Set to true.
458 * gnulib: Update to latest so bootstrap is in sync now.
459
4602010-11-07 Joel E. Denny <joeldenny@joeldenny.org>
461
462 yysyntax_error: fix for consistent error with lookahead.
463 * NEWS (2.5): Document.
464 * data/yacc.c (yysyntax_error): In a verbose syntax error
465 message while in a consistent state with a default action (which
466 must be an error action given that yysyntax_error is being
467 invoked), continue to drop the expected token list, but don't
468 drop the unexpected token unless there actually is no lookahead.
469 Moreover, handle that internally instead of returning 1 to tell
470 the caller to do it. With that meaning of 1 gone, renumber
471 return codes more usefully.
472 (yyparse, yypush_parse): Update yysyntax_error usage. Most
473 importantly, set yytoken to YYEMPTY when there's no lookahead.
474 * data/glr.c (yyreportSyntaxError): As in yacc.c, don't drop the
475 unexpected token unless there actually is no lookahead.
476 * data/lalr1.cc (yy::parser::parse): If there's no lookahead,
477 pass yyempty_ not yyla.type to yysyntax_error_.
478 (yy::parser::yysyntax_error_): Again, don't drop the unexpected
479 token unless there actually is no lookahead.
480 * data/lalr1.java (YYParser::parse): If there's no lookahead,
481 set yytoken to yyempty_ before invoking yysyntax_error.
482 (YYParser::yysyntax_error): Again, don't drop the unexpected
483 token unless there actually is no lookahead.
484 * tests/conflicts.at (parse.error=verbose and consistent
485 errors): Extend test group to further reveal how the previous
486 use of the simple "syntax error" message was too general. Test
487 yacc.c, glr.c, lalr1.cc, and lalr1.java. No longer an expected
488 failure.
489 * tests/java.at (AT_JAVA_COMPILE, AT_JAVA_PARSER_CHECK): Move
490 to...
491 * tests/local.at: ... here.
492 (_AT_BISON_OPTION_PUSHDEFS): Push AT_SKEL_JAVA_IF definition.
493 (AT_BISON_OPTION_POPDEFS): Pop it.
494 (AT_FULL_COMPILE): Extend to handle Java.
495
4962010-11-07 Joel E. Denny <joeldenny@joeldenny.org>
497
498 yysyntax_error: more preparation for readability of next patch.
499 There are no behavioral changes here.
500 * data/glr.c (yyreportSyntaxError): Reorganize.
501 * data/lalr1.cc (yy::parser::yysyntax_error_): Reorganize.
502 * tests/conflicts.at (parse.error=verbose and consistent errors):
503 Reorganize.
504
5052010-11-07 Joel E. Denny <joeldenny@joeldenny.org>
506
507 yysyntax_error: prepare for readability of next patches.
508 These are purely whitespace changes that result in ugly code
509 but that make the next couple of patches much easier to read.
510 * data/glr.c (yyreportSyntaxError): Reindent.
511 * data/lalr1.cc (yy::parser::yysyntax_error_): Reindent.
512 * data/lalr1.java (YYParser::yysyntax_error): Reindent.
513 * data/yacc.c (yysyntax_error): Reindent.
514
5152010-10-31 Joel E. Denny <joeldenny@joeldenny.org>
516
517 Fix memory leak.
518 * src/output.c (prepare_rules): Free temporary array.
519
5202010-10-31 Joel E. Denny <joeldenny@joeldenny.org>
521
522 yysyntax_error: improve invocation readability.
523 * data/yacc.c (yyparse, yypush_parse): For yysyntax_error
524 invocation, get rid of the while loop, which is misleading
525 because there are really at most two iterations.
526
5272010-10-31 Joel E. Denny <joeldenny@joeldenny.org>
528
529 * ChangeLog: Correct some errors in previous entries.
530
5312010-10-17 Joel E. Denny <joeldenny@joeldenny.org>
532
533 maint: re-anchor all .gitignore entries.
534 * bootstrap: Copy from gnulib's latest for the fix to
535 automatically anchor entries it constructs.
536 * gnulib: Update to latest just so it has the same bootstrap.
537 * .gitignore, build-aux/.gitignore, doc/.gitignore:
538 * lib/.gitignore, m4/.gitignore, po/.gitignore:
539 * runtime-po/.gitignore: Re-anchor all entries.
540
5412010-10-08 Paul Eggert <eggert@cs.ucla.edu>
542
543 Fix portability problem on OpenBSD 4.7.
544
545 Jim Meyering reported this in
546 <http://lists.gnu.org/archive/html/bug-bison/2010-10/msg00007.html>.
547 * data/yacc.c: Use EXIT_SUCCESS as a witness for stdlib.h,
548 not _STDLIB_H. EXIT_SUCCESS has been defined by the standard
549 for quite some time.
550 * src/parse-gram.c, src/parse-gram.h: Regenerate.
551 * tests/regression.at: Tamper with the renamed witness.
552
553 Adjust to recent changes to gnulib bootstrap.
554
555 * .cvsignore, build-aux/.cvsignore, doc/.cvsignore, etc/.cvsignore:
556 * examples/calc++/.cvsignore, lib/.cvsignore, m4/.cvsignore:
557 * po/.cvsignore, runtime-po/.cvsignore, src/.cvsignore:
558 * tests/.cvsignore: Remove; I don't use CVS to maintain Bison
559 anymore and don't know of anybody else who does. If someone needs
560 these files, they can resurrect them.
561 * .gitignore, build-aux/.gitignore, doc/.gitignore, lib/.gitignore:
562 * m4/.gitignore, po/.gitignore, runtime-po/.gitignore:
563 Omit leading '/', since bootstrap omits it.
564 Adjust file names to match current contents better.
565 * bootstrap: Sync from gnulib: this contains the new gnulib_mk_hook
566 installed just for us.
567 * bootstrap.conf (excluded_files): Don't exclude codeset.m4,
568 glibc21.m4, inttypes_h.m4, size_max.m4, xsize.m4, as they are now
569 needed somehow. Don't have time to look into why.
570 (gnulib_modules): Change malloc to malloc-gnu. Do we really assume
571 the GNU malloc behavior, where malloc (0) != NULL unless we're
572 out of storage? If not, we can omit malloc-gnu; but for now I left
573 it in to be safe.
574 (vc_ignore): Remove.
575 (gnulib_mk_hook): New function.
576 * README-hacking: Renamed from HACKING, since gnulib bootstrap now
577 uses that convention.
578
5792010-09-09 Paul Hilfinger <hilfinger@cs.berkeley.edu>
580
581 * data/glr.c (yySymbol): Define as int to avoid compiler warnings about
582 possible change of value.
583
5842010-09-08 Paul Hilfinger <hilfinger@cs.berkeley.edu>
585
586 * data/glr.c (yy_reduce_print): Change yyrhsVals to yyvsp to remove
587 compiler errors when using %debug.
588 Add declaration of yylow when locations in use to avoid compilation
589 error.
590 (yyglrReduce): Conditionalize message "Parse ... rejected by rule..."
591 on whether we are in split mode, for consistency with behavior of
592 non-GLR parsing.
593
5942010-09-01 Akim Demaille <demaille@gostai.com>
595
596 Address GCC warnings about shadowed local variables (yyflag).
597 * data/glr.c (YYCHK): Rename yyflag as yychk_flag.
598 (yyprocessOneStack): Reduce the scope of yyaction, yyconflicts,
599 yyrule, and yyflag.
600
6012010-08-05 Joel E. Denny <joeldenny@joeldenny.org>
602
603 Version 2.4.3.
604 * NEWS (2.4.3): Set date.
605
6062010-08-04 Joel E. Denny <joeldenny@joeldenny.org>
607
608 maint: add gettext version to release announcements.
609 Suggested by Paul Hilfinger at
610 <http://lists.gnu.org/archive/html/bison-patches/2010-07/msg00019.html>
611 <http://lists.gnu.org/archive/html/bison-patches/2010-08/msg00002.html>.
612 * cfg.mk (bootstrap-tools): Add gettext.
613
6142010-08-04 Joel E. Denny <joeldenny@joeldenny.org>
615
616 doc: fix -W and %expect documentation some.
617 * NEWS (2.4.3): Mention that there are documentation fixes.
618 * doc/bison.texinfo (Expect Decl): Make it clear that %expect
619 turns conflicts into errors not warnings.
620 (Shift/Reduce): Likewise.
621 (Bison Options): Don't mention -Wsyntax. It doesn't exist.
622
6232010-08-01 Joel E. Denny <joeldenny@joeldenny.org>
624
625 -Werror: fix for rules useless in parser after conflicts.
626 * NEWS (2.4.3): Document fix.
627 * src/complain.c (error_message): Extend to handle incomplete
628 error messages so warn and warn_at can be used in more cases.
629 * src/gram.c (grammar_rules_useless_report): Use warn_at so that
630 -Werror is always obeyed.
631 * src/reduce.c (reduce_print): Use warn so that the "warnings
632 being treated as errors" message is printed consistently before
633 the first warning message. This makes testing easier.
634 * tests/local.at (AT_BISON_WERROR_MSG): New macro.
635 (AT_BISON_CHECK_NO_XML): Extend to check -Werror and
636 --warnings=error when warnings appear in bison's stderr.
637
6382010-07-29 Joel E. Denny <joeldenny@joeldenny.org>
639
640 maint: enable gnits only at stable releases.
641 * configure.ac (AM_INIT_AUTOMAKE): Underscore or dash in a
642 version string should disable gnits. Explain in comments.
643
6442010-07-28 Joel E. Denny <joeldenny@joeldenny.org>
645
646 i18n: update.
647 * po/POTFILES.in: Add src/graphviz.c.
648
6492010-07-28 Joel E. Denny <joeldenny@joeldenny.org>
650
651 i18n: fix for gnulib.
652 * po/POTFILES.in: Add remaining gnulib files that have
653 translatable strings.
654
6552010-07-25 Joel E. Denny <joeldenny@joeldenny.org>
656
657 build: fix our adjustments for gnulib files in lib.
658 * configure.ac: For prepending lib/ to the values of config
659 variables, fix detection of empty values. Also, due to recent
660 gnulib changes, add LIBUNISTRING_UNITYPES_H and
661 LIBUNISTRING_UNIWIDTH_H to the list of those variables.
662
6632010-07-25 Joel E. Denny <joeldenny@joeldenny.org>
664
665 maint: use announce-gen's new --mail-headers.
666 * HACKING (Announce): Update instructions.
667 * cfg.mk (announcement_Cc_): Define.
668 * configure.ac (AM_GNU_GETTEXT_VERSION): Update to 0.18 as
669 required by latest gnulib.
670 * gnulib: Update to latest.
671
6722010-07-24 Joel E. Denny <joeldenny@joeldenny.org>
673
674 tests: handle Valgrind that complains about >&-.
675 * tests/output.at (AT_CHECK_OUTPUT): Extend to accept pre-tests.
676 (Output files: -dv >&-): Skip test group if running
677 maintainer-check-valgrind.
678
6792010-07-23 Paul Hilfinger <hilfingr@EECS.Berkeley.EDU>
680
681 * NEWS: Describe new semantic-predicate feature.
682 * data/c.m4 (b4_predicate_case): New definition.
683 * data/java.m4 (b4_predicate_case): New definition.
684 * data/glr.c (yyimmediate): Add definition.
685 (yydoAction): Remove comment, now obsolete.
686 Do YY_REDUCE_PRINT here.
687 (yyglrReduce): Alter comment to indicate that semantic values
688 need not be deferred.
689 Remove YY_REDUCE_PRINT from here; done in yydoAction.
690 (yyprocessOneStack): Pass immediate flag.
691 Delete stacks rejected by predicates in newly split-off parsers.
692 Change handling of yyerr so that only current stack gets deleted
693 when semantic predicate fails.
694 (yyfillin): Don't crash if a semantic value is unresolved (as may
695 happen in predicate rules).
696 Copy lr state as well in debugging mode.
697 Update comment on setting of yysval to include yyloc as well.
698 (yy_reduce_print): Add yynormal argument. Perform fillin properly.
699 Report unresolved RHS values.
700 (yyimmediate): New table.
701 * src/gram.h (struct rule): Add is_predicate field.
702 * src/output.c (user_actions_output): Use b4_predicate_case for
703 predicates.
704 (prepare_symbols): Output yyimmediate.
705 * src/scan-gram.l: Add %? token, SC_PREDICATE state.
706 * src/scan-code.l (code_props_rule_action_init): Add is_predicate
707 argument.
708 * src/scan-code.h (struct code_props): Add is_predicate field.
709 (code_props_rule_action_init): New interface.
710 * src/parse-gram.y (%?{...}): New token.
711 (rhs): Add %?{...} rule.
712 * src/parse-gram.c: Regenerate.
713 * src/parse-gram.h: Regenerate.
714 * src/reader.c (grammar_current_rule_action_append): Add
715 immediate argument.
716 (grammar_midrule_action): Use new interface for
717 code_props_rule_action_init.
718 (grammar_current_rule_action_append): Ditto.
719 (packgram): Transfer is_predicate value.
720 * src/reader.h (grammar_current_rule_action_append): New interface.
721 * doc/bison.texinfo: Document semantic predicates (%?).
722
723 * data/glr.c (yylhsNonterm, yyisDefaultedState,yyDefaultAction)
724 (yygetLRActions,yynewGLRStackItem,yyaddDeferredAction,yyinitStateSet)
725 (yyinitGLRStack,yyexpandGLRStack,yyupdateSplit,yymarkStackDeleted)
726 (yyundeleteLastStack,yyglrShift,yyglrShiftDefer,yydoAction,yyglrReduce)
727 (yyidenticalOptions,yymergeOptionSets,yyresolveStates,yyresolveAction)
728 (yyresolveLocations,yyresolveValue,yyreducePrint): Update parameter
729 names in comments and mention all parameters.
730 (struct yyGLRState): Fix description of yyposn field.
731 (yyresolveLocations): Correct comment so as not to imply action when
732 yyn1==0.
733
7342010-06-17 Paul Eggert <eggert@cs.ucla.edu>
735
736 Update from GFDL GFDL 1.2 to 1.3.
737 * doc/bison.texinfo: Update GFDL version number.
738 * doc/fdl.texi: Update to version 1.3, taken from:
739 http://www.gnu.org/licenses/fdl.texi
740
741 Do not use date ranges in copyright notices.
742 See http://www.gnu.org/prep/maintain/maintain.html#Copyright-Notices
743
744 * HACKING, Makefile.am, NEWS, PACKAGING, README, README-alpha:
745 * TODO, bootstrap, bootstrap.conf:
746 * build-aux/update-b4-copyright, cfg.mk, configure.ac:
747 * data/README, data/bison.m4, data/c++-skel.m4, data/c++.m4:
748 * data/c-skel.m4, data/c.m4, data/glr.c, data/glr.cc:
749 * data/java-skel.m4, data/java.m4, data/lalr1.cc:
750 * data/lalr1.java, data/local.mk, data/location.cc:
751 * data/stack.hh, data/variant.hh, data/xslt/bison.xsl:
752 * data/xslt/xml2dot.xsl, data/xslt/xml2text.xsl:
753 * data/xslt/xml2xhtml.xsl, data/yacc.c, djgpp/Makefile.maint:
754 * djgpp/README.in, djgpp/config.bat, djgpp/config.sed:
755 * djgpp/config.site, djgpp/config_h.sed, djgpp/djunpack.bat:
756 * djgpp/local.mk, djgpp/subpipe.c, djgpp/subpipe.h:
757 * djgpp/testsuite.sed, doc/bison.texinfo, doc/local.mk:
758 * doc/refcard.tex, etc/README, etc/bench.pl.in, etc/local.mk:
759 * examples/calc++/Makefile.am, examples/extexi:
760 * examples/local.mk, lib/abitset.c, lib/abitset.h:
761 * lib/bbitset.h, lib/bitset.c, lib/bitset.h:
762 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
763 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
764 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
765 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
766 * lib/libiberty.h, lib/local.mk, lib/main.c, lib/timevar.c:
767 * lib/timevar.def, lib/timevar.h, lib/vbitset.c:
768 * lib/vbitset.h, lib/yyerror.c, m4/bison-i18n.m4:
769 * m4/c-working.m4, m4/cxx.m4, m4/subpipe.m4, m4/timevar.m4:
770 * src/AnnotationList.c, src/AnnotationList.h:
771 * src/InadequacyList.c, src/InadequacyList.h, src/LR0.c:
772 * src/LR0.h, src/Sbitset.c, src/Sbitset.h, src/assoc.c:
773 * src/assoc.h, src/closure.c, src/closure.h, src/complain.c:
774 * src/complain.h, src/conflicts.c, src/conflicts.h:
775 * src/derives.c, src/derives.h, src/files.c, src/files.h:
776 * src/flex-scanner.h, src/getargs.c, src/getargs.h:
777 * src/gram.c, src/gram.h, src/graphviz.c, src/ielr.c:
778 * src/ielr.h, src/lalr.c, src/lalr.h, src/local.mk:
779 * src/location.c, src/location.h, src/main.c:
780 * src/muscle-tab.c, src/muscle-tab.h, src/named-ref.c:
781 * src/named-ref.h, src/nullable.c, src/nullable.h:
782 * src/output.c, src/output.h, src/parse-gram.y:
783 * src/print-xml.c, src/print-xml.h, src/print.c, src/print.h:
784 * src/print_graph.c, src/print_graph.h, src/reader.c:
785 * src/reader.h, src/reduce.c, src/reduce.h, src/relation.c:
786 * src/relation.h, src/scan-code.h, src/scan-code.l:
787 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
788 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
789 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
790 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
791 * tests/actions.at, tests/atlocal.in, tests/c++.at:
792 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
793 * tests/existing.at, tests/glr-regression.at:
794 * tests/headers.at, tests/input.at, tests/java.at:
795 * tests/local.at, tests/local.mk, tests/named-refs.at:
796 * tests/output.at, tests/push.at, tests/reduce.at:
797 * tests/regression.at, tests/sets.at, tests/skeletons.at:
798 * tests/synclines.at, tests/testsuite.at, tests/torture.at:
799 Don't use date ranges in copyright notices.
800
8012010-05-11 Akim Demaille <demaille@gostai.com>
802
803 lalrl1.cc: give a chance to user defined YYLLOC_DEFAULT.
804 * data/lalr1.cc (YYLLOC_DEFAULT): Move its definition from the
805 header file to the implementation file, after the user %code
806 sections.
807 * NEWS (2.5): Document this.
808
8092010-05-11 Akim Demaille <demaille@gostai.com>
810
811 doc: please Emacs.
812 * doc/bison.texinfo (Local Variables): Move this after the
813 LocalWords, since the latter are looked for in the whole document,
814 while the former are looked for only at its end.
815 Require american spell checking.
816
8172010-05-10 Akim Demaille <demaille@gostai.com>
818
819 doc: fix lalr1.cc documentation.
820 * doc/bison.texinfo (C++ Scanner Interface): Fix yylex signature.
821 (C++ Bison Interface): Fix lalr1.cc skeleton name.
822 (C++ Parser Interface): Fix semantic_type and location_type names.
823 Document yy::parser::token.
824 Reported by Jerry Quinn.
825
8262010-05-10 Akim Demaille <demaille@gostai.com>
827
828 c++: use YYRHSLOC.
829 * data/lalr1.cc (YYRHSLOC): New.
830 (YYLLOC_DEFAULT): Use it.
831 * data/glr.cc: If location_type was user defined, do not include
832 location.hh, and do not produce location.hh and position.hh.
833 * tests/calc.at (YYLLOC_DEFAULT): Use YYRHSLOC.
834 Check that glr.cc supports user defined location_type.
835 * NEWS: Document this.
836
8372010-05-07 Akim Demaille <demaille@gostai.com>
838
839 doc: fix typo.
840 * tests/synclines.at: here.
841
8422010-05-04 Akim Demaille <demaille@gostai.com>
843
844 tests: enhance AT_SYNCLINES_COMPILE.
845 * tests/synclines.at (AT_SYNCLINES_COMPILE): More distcc patterns.
846 (AT_TEST_SYNCLINE): Remove GCC 4.5 protection which is already
847 taken care of in AT_SYNCLINES_COMPILE.
848
8492010-05-04 Akim Demaille <demaille@gostai.com>
850
851 lalr1.cc: don't generate location.hh when location_type is defined
852 * data/bison.m4 (b4_percent_define_get): Accept a default value.
853 * data/c++.m4: Do not provide a default value for the %define
854 variable location_type, rather, use b4_percent_define_get with a
855 default argument where its value is needed.
856 * data/lalr1.cc: Do not load location.cc (which outputs both
857 location.hh and position.hh) if the user defined location_type.
858 Do not include location.hh either.
859
8602010-05-04 Akim Demaille <demaille@gostai.com>
861
862 lalr1.cc: minor refactoring.
863 * data/lalr1.cc: Don't issue empty namespaces.
864
8652010-05-04 Akim Demaille <demaille@gostai.com>
866
867 tests: fix %printer.
868 Currently, there is no check that %printer ... <foo> (nor
869 %destructor) is about an existing <foo> type. This C++ test had
870 it wrong (<::std::string> vs. <std::string>).
871
872 * tests/c++.at (AT_CHECK_VARIANTS): In list.yy, redefine the
873 pretty-printing of lists into something better for parser traces.
874 Update the expected output.
875 Fix correspondance between %type/%token and %printer.
876
8772010-05-04 Akim Demaille <demaille@gostai.com>
878
879 lalr1.cc: location_type: make sure we don't depend on loc.(begin|end).
880 * tests/calc.at (Span): Instead of begin/end, as in the built-in
881 location class, use first and last.
882 Define YYLLOC_DEFAULT to adjust to these changes.
883 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Adjust to the
884 location_type changes.
885
8862010-05-01 Joel E. Denny <joeldenny@joeldenny.org>
887
888 tests: fix maintainer-xml-check.
889 * data/xslt/xml2dot.xsl (xsl:template match="bison-xml-report"):
890 Update output to include comments now produced by --graph.
891 (xsl:template match="automaton"): As for --graph, name the
892 digraph after the grammar file.
893 * src/print-xml.c (escape_bufs): Enlarge array.
894 (print_xml): Add bug-report and url attributes to
895 bison-xml-report element.
896
8972010-05-01 Joel E. Denny <joeldenny@joeldenny.org>
898
899 In DOT output, convert from "/*" comments to "//" comments.
900 This handles the possibility that a "*/" might appear in
901 variable portions of those comments at some point in the future.
902 * src/graphviz.c (start_graph): Implement.
903
9042010-04-30 Joel E. Denny <joeldenny@joeldenny.org>
905
906 Document that undefined %prec identifier warnings will remain.
907 * NEWS (2.4.3): Here.
908 (2.4.2): Here.
909
9102010-04-30 Joel E. Denny <joeldenny@joeldenny.org>
911
912 Revert 2009-12-30 change for undefined %prec token complaints.
913 That is, keep them as warnings because that should be sufficient
914 to satisfy POSIX without creating backward compatibility issues.
915 Suggested by Richard Stallman at
916 <http://lists.gnu.org/archive/html/bison-patches/2010-03/msg00033.html>.
917 * NEWS (2.5): Remove mention of complaint.
918 * src/reader.c (grammar_rule_check): Convert complaint back to
919 warning.
920 * tests/input.at (%prec's token must be defined): Update.
921
9222010-04-25 Joel E. Denny <joeldenny@joeldenny.org>
923
924 build: don't require src/bison during bootstrap.
925 Suggested by Eric Blake at
926 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00003.html>.
927 * bootstrap.conf (bootstrap_epilogue): New function to make sure
928 src/parse-gram.[ch] are stamped later than src/parse-gram.y.
929
9302010-04-25 Joel E. Denny <joeldenny@joeldenny.org>
931
932 i18n: fix untranslatable string.
933 Reported by Goran Uddeborg at
934 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00000.html>.
935 * src/muscle-tab.c (muscle_percent_define_insert): Here.
936
9372010-04-13 Akim Demaille <demaille@gostai.com>
938
939 tests: calc: minor refactoring.
940 * tests/calc.at (_AT_DATA_CALC_Y): Simplify yylex.
941
9422010-04-13 Akim Demaille <demaille@gostai.com>
943
944 tests: calc: simplify location management.
945 * tests/local.at (AT_LOC_PUSHDEF, AT_LOC_POPDEF): New.
946 (_AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS): Use them to
947 define the appropriate AT_LOC accessors.
948 * tests/calc.at: Use AT_LOC accessors.
949
9502010-04-13 Akim Demaille <demaille@gostai.com>
951
952 test location_type.
953 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS):
954 Define AT_LOCATION_TYPE_IF.
955 (_AT_BISON_OPTION_POPDEFS): Undefine AT_LOCATION_TYPE_IF.
956 * tests/calc.at (_AT_DATA_CALC_Y): When %define location_type is
957 used, provide a user location type and use it.
958 (Simple LALR1 C++ Calculator): Add a test case for location_type.
959
9602010-04-13 Akim Demaille <demaille@gostai.com>
961
962 tests: check fclose's return value.
963 * tests/calc.at (_AT_DATA_CALC_Y): Check fclose's return status.
964
9652010-04-13 Akim Demaille <demaille@gostai.com>
966
967 tests: don't depend on the actual location type.
968 * tests/calc.at: Use yy::parser::location_type rather than
969 yy::location, since the former is always right, and might point to
970 another type than the latter.
971
9722010-04-13 Akim Demaille <demaille@gostai.com>
973
974 formatting changes.
975 * tests/calc.at: Formatting changes.
976
9772010-04-13 Akim Demaille <demaille@gostai.com>
978
979 lalr1.cc: remove useless forward declaration.
980 * data/lalr1.cc: Include location.hh before stack.hh.
981 Remove the useless forward declarations of position and location.
982 Reported by Chris Morley.
983 * data/glr.cc: Likewise.
984
9852010-04-11 Joel E. Denny <joeldenny@joeldenny.org>
986
987 * NEWS (2.4.3): Mention fix for Sun Studio C++.
988
9892010-04-10 Joel E. Denny <joeldenny@joeldenny.org>
990
991 tests: fix for newer Sun Studio C++.
992 Reported by Dagobert Michelsen at
993 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00023.html>.
994 * THANKS (Dagobert Michelsen): Add.
995 * configure.ac (AC_PREREQ): Set to 2.64 so we get the latest
996 Autoconf macro for handling the restrict keyword.
997 * gnulib: Update to latest, which no longer overrides that macro
998 from Autoconf.
999
10002010-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1001
1002 portability: fix pointer arithmetic to conform to C standard.
1003 Reported by Tys Lefering at
1004 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00035.html>.
1005 This fix is already implemented in glr.c and does not apply to
1006 lalr1.java.
1007 * data/lalr1.cc (yy::parser::parse): Increase size of
1008 yyerror_range and adjust subscripting so you don't have to
1009 subtract one from the beginning of the array.
1010 * data/yacc.c (b4_declare_parser_state_variables,
1011 yyparse, yypush_parse): Likewise.
1012
10132010-04-05 Akim Demaille <demaille@gostai.com>
1014
1015 remove useless include.
1016 * src/graphviz.h: Don't include stdbool.h.
1017
10182010-04-05 Akim Demaille <demaille@gostai.com>
1019
1020 graph: sign the output file.
1021 * src/graphviz.c (start_graph): Issue comments about Bison.
1022 Suggested by Tys Lefering.
1023
10242010-03-31 Joel E. Denny <jdenny@ces.clemson.edu>
1025
1026 portability: fix test suite for GCC 4.5's new #error message.
1027 Reported by Tys Lefering at
1028 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00030.html>.
1029 * NEWS (2.4.3): Mention.
1030 * tests/synclines.at (AT_TEST_SYNCLINE): Implement.
1031
10322010-03-30 Akim Demaille <demaille@gostai.com>
1033
1034 fix comments.
1035 * src/graphviz.h: Add missing license notice.
1036 Document.
1037
10382010-03-25 Akim Demaille <demaille@gostai.com>
1039
1040 tests: fix 250: parse.error=verbose overflow.
1041 * tests/regression.at (parse.error=verbose overflow): Avoid the
1042 double inclusion of stdlib.h as it triggers hard errors.
1043
10442010-03-23 Joel E. Denny <jdenny@ces.clemson.edu>
1045
1046 portability: fix for BSD make.
1047 Reported by Johan van Selst at
1048 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00016.html>.
1049 * tests/local.mk ($(TESTSUITE)): Qualify package.m4 in
1050 this dependency list as in package.m4's target rule.
1051
10522010-03-23 Joel E. Denny <jdenny@ces.clemson.edu>
1053
1054 portability: fix spawning on at least FreeBSD 8 and FreeBSD 9.
1055 Reported by Johan van Selst at
1056 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00014.html>.
1057 * NEWS (2.4.3): New.
1058 * THANKS (Johan van Selst): Add.
1059 * etc/prefix-gnulib-mk (prefix): Adjust regex for makefile
1060 targets so that gnulib's new c++defs.h is matched.
1061 * gnulib: Update to latest.
1062
10632010-03-20 Joel E. Denny <jdenny@ces.clemson.edu>
1064
1065 maint: update for changes to gnulib's announce-gen.
1066 * HACKING (Announce): RELEASE_TYPE=major must now be written
1067 RELEASE_TYPE=stable.
1068
10692010-03-20 Joel E. Denny <jdenny@ces.clemson.edu>
1070
1071 Version 2.4.2.
1072 * NEWS (2.4.2): Set version and date. For the recent test suite
1073 portability fixes, don't be so optimistic about their success
1074 given the lack of feedback on the affected platforms.
1075
10762010-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
1077
1078 tests: fix maintainer-xml-check for recent changes.
1079 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Use
1080 AT_BISON_CHECK_NO_XML rather than AT_BISON_CHECK because an
1081 output file whose name conflicts with a previous output file
1082 is now never generated.
1083
10842010-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
1085
1086 portability: fix several issues with M4 subprocess.
1087
1088 M4's output pipe was not being drained upon fatal errors during
1089 scan_skel. As a result, broken-pipe messages from M4 were seen
1090 on at least AIX, HP-UX, Solaris, and RHEL4, and this caused a
1091 failure in the test suite. The problem was that, on platforms
1092 where the default disposition for SIGPIPE is ignore instead of
1093 terminate, M4 sometimes saw fwrite fail with errno=EPIPE and
1094 then reported it. However, there's some sort of race condition,
1095 because the new test group occasionally succeeded.
1096 Reported by Albert Chin at
1097 <http://lists.gnu.org/archive/html/bug-bison/2010-02/msg00004.html>.
1098
1099 There were also problems with the test suite livelocking on
1100 Tru64 5.1b. Reported by Didier Godefroy at
1101 <http://lists.gnu.org/archive/html/bug-bison/2009-05/msg00005.html>.
1102 Switching to create_pipe_bidi suggested by Akim Demaille.
1103
1104 To attempt to solve both of these problems, switch to gnulib's
1105 create_pipe_bidi and register M4 process as a slave. Along the
1106 way, clean up file name conflict handling, which was affected by
1107 the broken-pipe problem before the switch.
1108 * NEWS (2.4.2): Document.
1109 * THANKS (Didier Godefroy): Add.
1110 * bootstrap.conf (gnulib_modules): Add pipe.
1111 * gnulib: Update to latest to make sure we have all the latest
1112 fixes.
1113 * lib/local.mk (lib_libbison_a_SOURCES): Remove subpipe.h and
1114 subpipe.c.
1115 * po/POTFILES.in (lib/subpipe.c): Remove.
1116 * src/files.c (compute_output_file_names): Update invocations
1117 of output_file_name_check.
1118 (output_file_name_check): In the case that the grammar file
1119 would be overwritten, use complain instead of fatal, but replace
1120 the output file name with /dev/null. Use the /dev/null solution
1121 for the case of two conflicting output files as well because it
1122 seems safer in case Bison one day tries to open both files at
1123 the same time.
1124 * src/files.h (output_file_name_check): Update prototype.
1125 * src/output.c (output_skeleton): Use create_pipe_bidi and
1126 wait_subprocess. Assert that scan_skel completely drains the
1127 pipe.
1128 * src/scan-skel.l (at_directive_perform): Update
1129 output_file_name_check invocation.
1130 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Check that the
1131 grammar file actually isn't overwritten.
1132 (Conflicting output files: -o foo.y): Update expected output.
1133 * tests/skeletons.at (Fatal errors but M4 continues producing
1134 output): New test group.
1135
11362010-02-04 Joel E. Denny <jdenny@ces.clemson.edu>
1137
1138 Update POTFILES.
1139 * HACKING (Release Procedure): Add reminder about keeping
1140 POTFILES files up-to-date.
1141 * po/POTFILES.in (src/muscle-tab.c, src/scan-skel.l): Add.
1142
11432010-02-01 Joel E. Denny <jdenny@clemson.edu>
1144
1145 Code cleanup.
1146 * tests/atlocal.in (abs_top_srcdir): Remove shell variable,
1147 which is already defined in atconfig.
1148
11492010-01-22 Joel E. Denny <jdenny@clemson.edu>
1150
1151 tests: fix missing include caught by g++ 4.4.1.
1152 Reported by Tys Lefering.
1153 * HACKING (Release checks): Add note about trying a recent GCC.
1154 * tests/regression.at (_AT_DATA_DANCER_Y): For C++, include
1155 cstdlib for abort.
1156 (_AT_DATA_EXPECT2_Y): Likewise.
1157
11582010-01-21 Joel E. Denny <jdenny@clemson.edu>
1159
1160 * cfg.mk (gnulib_dir): Assume gnulib is a subdirectory.
1161
11622010-01-21 Joel E. Denny <jdenny@clemson.edu>
1163
1164 maint: automate PACKAGE_COPYRIGHT_YEAR update, and update it.
1165 * HACKING (Release Procedure): Update notes on copyright years.
1166 * Makefile.am (update-package-copyright-year): New target rule.
1167 * build-aux/update-package-copyright-year: New file.
1168 * cfg.mk (update-copyright): Add update-package-copyright-year
1169 as a dependency.
1170
11712010-01-19 Joel E. Denny <jdenny@clemson.edu>
1172
1173 * bootstrap: Import improvements from latest gnulib.
1174
11752010-01-19 Joel E. Denny <jdenny@clemson.edu>
1176
1177 build: require Automake 1.11.1 to avoid a security flaw.
1178 * HACKING (Release Procedure): Don't document Automake security
1179 flaw here.
1180 * configure.ac (AM_INIT_AUTOMAKE): Require 1.11.1, and explain
1181 why here.
1182
11832010-01-19 Joel E. Denny <jdenny@clemson.edu>
1184
1185 gnulib: update to latest.
1186
11872010-01-19 Joel E. Denny <jdenny@clemson.edu>
1188
1189 ChangeLog (2006-09-15): add Odd Arild Olsen's role for push.c.
1190
11912010-01-15 Joel E. Denny <jdenny@clemson.edu>
1192
1193 Thank the developer of the initial push parser implementation.
1194 This unfortunate oversight is several years old.
1195 * THANKS (Odd Arild Olsen): Add.
1196
11972010-01-04 Joel E. Denny <jdenny@clemson.edu>
1198
1199 Fix some comments concerning LR(0) versus LALR(1).
1200
1201 Stop equating LR(0) with nondeterminism and LALR(1) with
1202 determinism. That is, if all states are consistent, then LR(0)
1203 tables are deterministic. On the other hand, LALR(1) tables
1204 might be nondeterministic before conflict resolution, and GLR
1205 permits LALR(1) tables to remain nondeterministic.
1206 * src/LR0.c, src/LR0.h: Here.
1207 * src/lalr.c, src/lalr.h: Here.
1208 * src/main.c (main): Here.
1209 * src/state.c, src/state.h: Here.
1210
1211 * src/ielr.h (ielr): In preconditions, expect LR(0) not LALR(1)
1212 parser tables.
1213
12142010-01-04 Joel E. Denny <jdenny@clemson.edu>
1215
1216 maint: run "make update-copyright"
1217
12182009-12-30 Joel E. Denny <jdenny@clemson.edu>
1219
1220 POSIX: complain if %prec's token was not defined.
1221 * NEWS (2.5): Document.
1222 * src/reader.c (grammar_rule_check): Convert warning to
1223 complaint.
1224 * tests/input.at (%prec's token must be defined): Update.
1225
12262009-12-30 Joel E. Denny <jdenny@clemson.edu>
1227
1228 POSIX: warn if %prec's token was not defined.
1229 Reported by Florian Krohm at
1230 <http://lists.gnu.org/archive/html/bug-bison/2009-12/msg00005.html>.
1231 * NEWS (2.4.2): Document.
1232 * src/reader.c (grammar_rule_check): Implement.
1233 (grammar_current_rule_prec_set): Add comments explaining that we
1234 here assume a %prec identifier is a token, but we still manage
1235 to support POSIX.
1236 * tests/input.at (%prec's token must be defined): New test
1237 group.
1238
12392009-12-31 Joel E. Denny <jdenny@clemson.edu>
1240
1241 * HACKING (Release Procedure): Recommend a secure automake.
1242
12432009-12-29 Joel E. Denny <jdenny@clemson.edu>
1244
1245 portability: `<' and `>' are not always defined on addresses.
1246 Specifically, don't sort objects by their memory addresses when
1247 they're not allocated in the same array or other object. Though
1248 I haven't found a test case where that fails on my platform, C
1249 says the behavior is undefined.
1250 * src/AnnotationList.c (AnnotationList__insertInto): Remove
1251 FIXME. Use new id field of InadequacyList nodes rather than
1252 their memory addresses when sorting.
1253 (AnnotationList__compute_from_inadequacies): Add
1254 inadequacy_list_node_count argument to pass to
1255 InadequacyList__new_conflict.
1256 * src/AnnotationList.h
1257 (AnnotationList__compute_from_inadequacies): Update prototype
1258 and documentation for new argument.
1259 * src/InadequacyList.c (InadequacyList__new_conflict): Add
1260 node_count argument and use it to assign a unique ID.
1261 * src/InadequacyList.h (InadequacyListNodeCount): New typedef.
1262 (InadequacyList): Add id field.
1263 (InadequacyList__new_conflict): Update prototype and
1264 documentation for new argument.
1265 * src/ielr.c (ielr_compute_annotation_lists): Update
1266 AnnotationList__compute_from_inadequacies invocation.
1267
12682009-12-20 Joel E. Denny <jdenny@clemson.edu>
1269
1270 Fix handling of yychar manipulation in user semantic actions.
1271 The problem was that yacc.c didn't always update the yychar
1272 translation afterwards. However, other skeletons appear to be
1273 fine. glr.c appears to already translate yychar before every
1274 use. lalr1.cc does not define yychar and does not document its
1275 replacement, yyla, for users. It does provide yyclearin, but
1276 that does not manipulate yyla and thus requires no translation
1277 update. In lalr1.java, yychar is out of scope during semantic
1278 actions.
1279 * NEWS (2.5): Document.
1280 * data/yacc.c (YYBACKUP): Don't bother translating yychar into
1281 yytoken here.
1282 (yyparse, yypush_parse): Instead, translate before every use of
1283 yytoken, and add comments explaining this approach.
1284 * tests/actions.at (Destroying lookahead assigned by semantic
1285 action): New test group checking that translation happens before
1286 lookahead destructor calls at parser return. Previously,
1287 incorrect destructors were called.
1288 * tests/conflicts.at (parse.error=verbose and consistent
1289 errors): New test group checking that translation happens at
1290 syntax error detection before the associated verbose error
1291 message and the associated lookahead destructor calls. While
1292 the destructor call is fixed by this patch, the verbose error
1293 message is currently incorrect due to another bug (see
1294 comments in test group), so this is an expected failure for now.
1295
12962009-12-21 Joel E. Denny <jdenny@clemson.edu>
1297
1298 YYFAIL: warn about uses and remove from lalr1.java.
1299 * NEWS (2.5): Document.
1300 * data/lalr1.java (YYParser::YYFAIL): Rename to YYERRLAB,
1301 and make it private. Update all uses.
1302 * src/scan-code.l (SC_RULE_ACTION): Implement warning.
1303
13042009-12-21 Joel E. Denny <jdenny@clemson.edu>
1305
1306 YYFAIL: deprecate.
1307 * NEWS (2.4.2): Document deprecation and the phase-out plan.
1308 * data/lalr1.java (YYParser::YYFAIL): Add comment about
1309 deprecation.
1310 * data/yacc.c (YYFAIL): Likewise, and suppress warnings about
1311 YYFAIL from GCC cpp's -Wunused-macros.
1312 * doc/bison.texinfo (Java Action Features): Remove YYFAIL
1313 documentation.
1314 (LocalWords): Remove YYFAIL.
1315
13162009-12-20 Joel E. Denny <jdenny@clemson.edu>
1317
1318 tests: cleanup.
1319 * tests/c++.at (Syntax error discarding no lookahead): Don't
1320 ignore stderr. Instead, eliminate remaining warnings.
1321
13222009-12-18 Joel E. Denny <jdenny@clemson.edu>
1323
1324 lalr1.cc: don't discard non-existent lookahead on syntax error.
1325 * data/lalr1.cc (yy::parser::parse): Check yyempty first.
1326 * tests/c++.at (Syntax error discarding no lookahead): New test
1327 group.
1328
13292009-12-17 Joel E. Denny <jdenny@clemson.edu>
1330
1331 Code cleanup.
1332 * src/symtab.c, src/symtab.h (symbol_class_get_string): Remove
1333 function, which is no longer used.
1334
13352009-12-16 Joel E. Denny <jdenny@clemson.edu>
1336
1337 Add gcc's -Wundef to test suite and fix another warning from it.
1338 * NEWS (2.4.2): Update description of -Wundef fix.
1339 * configure.ac (WARN_CXXFLAGS_TEST): New substitution.
1340 (WARN_CFLAGS_TEST): New substitution.
1341 * data/glr.c: Avoid warning about __STRICT_ANSI__.
1342 * tests/atlocal.in (CFLAGS): Use WARN_CFLAGS_TEST instead of
1343 WARN_CFLAGS.
1344 (NO_WERROR_CFLAGS): Likewise.
1345 (CXXFLAGS): Use WARN_CXXFLAGS_TEST instead of WARN_CXXFLAGS.
1346
13472009-12-16 Joel E. Denny <jdenny@clemson.edu>
1348
1349 * data/yacc.c: Reformat m4 a little.
1350
13512009-12-16 Joel E. Denny <jdenny@clemson.edu>
1352
1353 Document gcc -Wundef fix.
1354 * NEWS (2.4.2): Here.
1355 * THANKS (Jonathan Nieder): Add.
1356
13572009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
1358
1359 Simplify y.tab.c when location tracking is disabled.
1360 * data/yacc.c: Do not check YYLTYPE_IS_TRIVIAL if location
1361 tracking is not enabled. Instead, unconditionally define
1362 YY_LOCATION_PRINT as a no-op for backward compatibility.
1363
13642009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
1365
1366 Avoid warnings from gcc -Wundef y.tab.c.
1367 * data/glr.c: Check if YYENABLE_NLS and YYLTYPE_IS_TRIVIAL are
1368 defined before using them.
1369 * data/lalr1.cc: Likewise.
1370 * data/yacc.c: Likewise.
1371
13722009-12-15 Joel E. Denny <jdenny@clemson.edu>
1373
1374 autoconf: update to latest for fix of M4 detection.
1375 Reported by Eric Blake.
1376 * submodules/autoconf: Update.
1377
13782009-12-15 Joel E. Denny <jdenny@clemson.edu>
1379
1380 portability: use -DGNULIB_POSIXCHECK.
1381 Reported by Eric Blake. See discussions at
1382 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00008.html>
1383 and
1384 <http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00108.html>.
1385 * HACKING (Release checks): Suggest -DGNULIB_POSIXCHECK.
1386 * bootstrap.conf (gnulib_modules): Add all the printf modules
1387 suggested by -DGNULIB_POSIXCHECK. Add realloc-posix as
1388 suggested by -DGNULIB_POSIXCHECK for gnulib's own vasnprintf.c.
1389 (excluded_files): Remove m4/printf-posix.m4.
1390 * tests/atlocal.in (LIBS): As for LDADD in src/local.mk, add
1391 lib/libbison.a so gnulib libraries can be linked.
1392
13932009-12-15 Joel E. Denny <jdenny@clemson.edu>
1394
1395 gnulib: update for fix of fprintf-posix, which we'll use soon.
1396 * etc/prefix-gnulib-mk (prefix): Adjust regex for make file
1397 targets so that gnulib's new arg-nonnull.h and link-warning.h
1398 are matched.
1399 * gnulib: Update.
1400
14012009-12-14 Joel E. Denny <jdenny@clemson.edu>
1402
1403 Enable assertion output and --disable-assert for configure.
1404 * bootstrap.conf (gnulib_modules): Add assert module.
1405 * src/system.h (aver): Define as assert, and summarize the
1406 discussion on this issue.
1407
14082009-12-14 Joel E. Denny <jdenny@clemson.edu>
1409
1410 Expand GLR acronym in summary of Bison.
1411 Based on discussion with Akim Demaille starting at
1412 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00087.html>.
1413 * doc/bison.texinfo (Introduction): Here.
1414 * src/getargs.c (usage): Here.
1415
14162009-10-03 Alex Rozenman <rozenman@gmail.com>
1417
1418 Document named references.
1419 * doc/bison.texinfo (Actions): Add new example and xref to
1420 Using Named References node.
1421 (Using Named References): New node.
1422
14232009-10-16 Joel E. Denny <jdenny@clemson.edu>
1424
1425 cleanup.
1426 * src/Sbitset.c (Sbitset__new_on_obstack): Use Sbitset instead
1427 of char*.
1428 (Sbitset__isEmpty): Use Sbitset instead of char*.
1429 * src/Sbitset.h (Sbitset): Make it a pointer to unsigned char
1430 instead of char. This helps to avoid casting errors.
1431 (Sbitset__or): Use Sbitset instead of char*.
1432
14332009-10-16 Joel E. Denny <jdenny@clemson.edu>
1434
1435 portability: don't assume 8-bit bytes.
1436 That is, use CHAR_BIT and UCHAR_MAX instead of 8 and 0xff.
1437 * src/Sbitset.h (Sbitset__nbytes): Here.
1438 (Sbitset__byteAddress): Here.
1439 (Sbitset__bit_mask): Here.
1440 (Sbitset__last_byte_mask): Here.
1441 (Sbitset__ones): Here.
1442 (SBITSET__FOR_EACH): Here.
1443
14442009-10-11 Joel E. Denny <jdenny@clemson.edu>
1445
1446 portability: use va_start and va_end in the same function.
1447 * src/complain.c (error_message): Move va_end from here...
1448 (ERROR_MESSAGE): ... to here.
1449
14502009-10-08 Joel E. Denny <jdenny@clemson.edu>
1451
1452 * data/bison.m4: Update comments for rename to muscle-tab.h.
1453
14542009-10-07 Joel E. Denny <jdenny@clemson.edu>
1455
1456 Minor code cleanup.
1457 * src/muscle-tab.c (MUSCLE_USER_NAME_CONVERT): Remove macro and
1458 replace all uses with UNIQSTR_CONCAT.
1459 * src/uniqstr.c (uniqstr_vsprintf): New function.
1460 * src/uniqstr.h (uniqstr_vsprintf): Add prototype.
1461 (UNIQSTR_CONCAT, UNIQSTR_GEN_FORMAT, UNIQSTR_GEN_FORMAT_): New
1462 macros.
1463
14642009-10-06 Joel E. Denny <jdenny@clemson.edu>
1465
1466 * TODO (Complaint submessage indentation): New.
1467
14682009-10-04 Joel E. Denny <jdenny@clemson.edu>
1469
1470 Minor code cleanup.
1471 * src/parse-gram.y: Clean up sorting of declarations.
1472 Use types to simplify %printer declarations where possible.
1473 Provide %printer for BRACKETED_ID and symbol.prec.
1474 * src/symtab.c: Whitespace change.
1475
14762009-10-04 Joel E. Denny <jdenny@clemson.edu>
1477
1478 tests: skip tests of file names that platform does not support.
1479 Reported by Michael Raskin at
1480 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00001.html>.
1481 * THANKS (Michael Raskin): Add.
1482 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Fix. Cygwin used
1483 to fail at least for file names containing ":" or "\".
1484
14852009-09-23 Joel E. Denny <jdenny@clemson.edu>
1486
1487 yysyntax_error: avoid duplicate lookahead collection.
1488 Except when memory reallocation is required, this change
1489 eliminates the need to invoke yysyntax_error twice and thus to
1490 repeat the collection of lookaheads. It also prepares for
1491 future extensions that will make those repetitions more
1492 expensive and that will require additional memory management in
1493 yysyntax_error. Finally, it fixes an obscure bug already
1494 exercised in the test suite.
1495 * data/yacc.c (yysyntax_error): Add arguments for message
1496 buffer variables stored in the parser. Instead of size, return
1497 status similar to yyparse status but indicating success of
1498 message creation. Other than the actual reallocation of the
1499 message buffer, import and clean up memory management code
1500 from...
1501 (yyparse, yypush_parse): ... here.
1502 * tests/regression.at (parse.error=verbose overflow): No longer
1503 an expected failure.
1504
15052009-09-23 Joel E. Denny <jdenny@clemson.edu>
1506
1507 yysyntax_error: test memory management more.
1508 * tests/atlocal.in (NO_WERROR_CFLAGS): New cpp macro.
1509 * tests/regression.at (parse.error=verbose and
1510 YYSTACK_USE_ALLOCA): New test group.
1511 (parse.error=verbose overflow): New test group that reveals an
1512 obscure bug. Expected fail for now.
1513
15142009-10-04 Joel E. Denny <jdenny@clemson.edu>
1515
1516 benchmarks: use %debug consistently among grammars.
1517 * etc/bench.pl.in (generate_grammar_triangular): Do not activate
1518 %debug by default. It can affect the timings even if yydebug=0.
1519 (generate_grammar_calc): For consistency with other grammars,
1520 use YYDEBUG environment variable to set yydebug.
1521
15222009-10-03 Joel E. Denny <jdenny@clemson.edu>
1523
1524 Remove dead code.
1525 * src/symtab.c (symbol_pack): Here because every symbol's number
1526 is always defined by this time.
1527
15282009-10-03 Alex Rozenman <rozenman@gmail.com>
1529
1530 Add additional space after periods in NEWS.
1531 * NEWS (2.5): here.
1532
15332009-09-29 Joel E. Denny <jdenny@clemson.edu>
1534
1535 Use the correct conversion specifier for size_t.
1536 Reported by Jim Meyering.
1537 * src/Sbitset.h (SBITSET__INDEX__CONVERSION_SPEC): New, "zu"
1538 because Sbitset__Index is size_t.
1539 * src/Sbitset.c (Sbitset__fprint): Use it instead of %d.
1540
15412009-09-27 Joel E. Denny <jdenny@clemson.edu>
1542
1543 tests: don't abuse AT_BISON_CHECK.
1544 * tests/regression.at (parse-gram.y: LALR = IELR): Move
1545 additional shell commands outside of AT_BISON_CHECK.
1546
15472009-09-26 Joel E. Denny <jdenny@clemson.edu>
1548
1549 tests: check that parse-gram.y's IELR and LALR are identical.
1550 * tests/atlocal.in (abs_top_srcdir): New shell variable.
1551 * tests/regression.at (parse-gram.y: LALR = IELR): New test
1552 group.
1553
15542009-09-19 Alex Rozenman <rozenman@gmail.com>
1555
1556 Keep sub-messages aligned. Fix strings for translation.
1557 * src/location.h (location_print): Add return value.
1558 * src/location.c (location_print): Return number of printed
1559 characters.
1560 * src/complain.h (complain_at_indent, warn_at_indent): Prototype
1561 new functions.
1562 * src/complain.cpp (indent_ptr): New static variable.
1563 (error_message, complain_at_indent, warn_at_indent): Implement
1564 the alignment mechanism.
1565 * src/scan-code.l (parse_ref, show_sub_messages): Fix strings
1566 for translations. Use new alignment mechanism.
1567 * tests/named-ref.at: Adjust test-cases.
1568 * NEWS (2.5): Add an announcement about named references.
1569
15702009-09-17 Akim Demaille <demaille@gostai.com>
1571
1572 doc: fixes.
1573 * doc/bison.texinfo: here.
1574 Reported by Alex Rozenman.
1575
15762009-09-16 Akim Demaille <demaille@gostai.com>
1577
1578 doc: lalr1.cc and variants.
1579 * doc/bison.texinfo (Decl Summary): Document the "lex_symbol" and
1580 "variant" %define variables.
1581 (C++ Semantic Values): Split into...
1582 (C++ Unions, C++ Variants): these.
1583 The latter is new.
1584 (C++ Parser Interface): Fix type names.
1585 Document parser::syntax_error.
1586 Document the fact that locations are not mandatory.
1587 (C++ Scanner Interface): Split into...
1588 (Split Symbols, Complete Symbols): these.
1589 The later is new.
1590 (Calc++ Parsing Driver): Use variants.
1591 Add more comments.
1592 Adjust style.
1593 (Calc++ Parser): Declare all the tokens, no
1594 longer accept raw characters.
1595 Remove %union.
1596 Adjust types and printers.
1597 Remove destructors.
1598 (Calc++ Scanner): Use make_<SYMBOL> functions.
1599 Use strerror in error message.
1600
16012009-09-16 Akim Demaille <demaille@gostai.com>
1602
1603 doc: spell checking.
1604 * doc/bison.texinfo: here.
1605
16062009-09-16 Akim Demaille <demaille@gostai.com>
1607
1608 doc: comment changes.
1609 * doc/bison.texinfo: Comment changes.
1610
16112009-09-16 Akim Demaille <demaille@gostai.com>
1612
1613 lalr1.cc: factor the yytranslate_ invocation in make_SYMBOLS.
1614 * data/c++.m4, data/lalr1.cc (parser::symbol_type): Change the
1615 constructor to take a token_type instead of the (internal) symbol
1616 number.
1617 Call yytranslate_.
1618 * data/variant.hh (b4_symbol_constructor_define_): Therefore,
1619 don't call yytranslate_ here.
1620
16212009-09-16 Akim Demaille <demaille@gostai.com>
1622
1623 TODO: statistics.
1624 * TODO (Figures): New.
1625
16262009-09-13 Joel E. Denny <jdenny@clemson.edu>
1627
1628 tests: clean up push.at test group titles.
1629 * tests/push.at: Remove "Push Parsing: " from test group titles
1630 because these are already under the banner "Push Parsing Tests".
1631
16322009-09-12 Alex Rozenman <rozenman@gmail.com>
1633
1634 Provide an additional sub-message for clarity.
1635 Add "symbol not found in production" error message when
1636 an "invalid reference" is detected in named references
1637 resolution.
1638 * src/scan-code.l: Update "invalid reference" case.
1639 * tests/named-ref.at: Adjust test-cases.
1640
16412009-09-10 Joel E. Denny <jdenny@clemson.edu>
1642
1643 Clean up yacc.c a little.
1644 * data/yacc.c: Clean up M4 for readability, and make output
1645 whitespace more consistent. For the main parse function
1646 comment, instead of saying "yyparse or yypush_parse", say either
1647 "yyparse" or "yypush_parse" depending on which it actually is.
1648
16492009-09-10 Joel E. Denny <jdenny@clemson.edu>
1650
1651 Fix --enable-gcc-warnings.
1652 * src/parse-gram.y (%printer <param>): Handle param_none.
1653
16542009-09-09 Akim Demaille <demaille@gostai.com>
1655
1656 lalr1.cc: syntax_error as exceptions.
1657 It is common to use sort of factories in the user actions. These
1658 factories may check some "syntactic" constraints that are not
1659 enforced by the grammar itself. This is possible using YYERROR
1660 within the action itself. Provide the user with a means to throw
1661 a syntax_error exception.
1662
1663 * data/c++.m4 (b4_public_types_declare, b4_public_types_define):
1664 Declare and define yy::parser::syntax_error.
1665 * data/lalr1.cc: Include stdexcept.
1666 (yy::parser::parse): Wrap the user action within a try/catch.
1667 * data/glr.cc: Include stdexcept.
1668
16692009-09-09 Akim Demaille <demaille@gostai.com>
1670
1671 lalr1.cc: add missing "inline".
1672 * data/c++.m4 (b4_public_types_define): Add missing inline to
1673 implementations provided in headers.
1674
16752009-09-09 Akim Demaille <demaille@gostai.com>
1676
1677 %param: documentation.
1678 * NEWS (2.6): Document %param, %lex-param, and %parse-param
1679 changes.
1680 * doc/bison.texinfo: Document that %lex-param and %parse-param
1681 are n-ary.
1682 Changes some examples to demonstrate it.
1683 (Calc++ Parser): Use %param.
1684
16852009-09-09 Akim Demaille <demaille@gostai.com>
1686
1687 Regen.
1688
16892009-09-09 Akim Demaille <demaille@gostai.com>
1690
1691 style changes.
1692 * src/parse-gram.y (add_param): Scope changes.
1693
16942009-09-09 Akim Demaille <demaille@gostai.com>
1695
1696 %parse: support several arguments.
1697 * src/parse-gram.y (current_param): New.
1698 (param_type): Add param_none.
1699 (params): New nonterminal.
1700 Use it.
1701
17022009-09-09 Akim Demaille <demaille@gostai.com>
1703
1704 Regen.
1705
17062009-09-09 Akim Demaille <demaille@gostai.com>
1707
1708 %param.
1709 Provide a means to factor lex-param and parse-param common
1710 declarations.
1711
1712 * src/parse-gram.y (param_type): New.
1713 Define a %printer for it.
1714 (add_param): Use it.
1715 (%parse-param, %lex-param): Merge into...
1716 (%parse): this new token.
1717 Adjust the grammar to use it.
1718 * src/scan-gram.l (RETURN_VALUE): New.
1719 (RETURN_PERCENT_FLAG): Use it.
1720 (RETURN_PERCENT_PARAM): New.
1721 Use it to support %parse-param, %lex-param and %param.
1722
17232009-09-03 Joel E. Denny <jdenny@clemson.edu>
1724
1725 Use aver not assert.
1726 * src/output.c: Don't include assert.h.
1727 (output_skeleton): Use aver not assert.
1728 * src/system.h (aver): In documentation of why, add links to
1729 Paul Eggert's explanations in the mailing lists.
1730
17312009-09-05 Alex Rozenman <rozenman@gmail.com>
1732
1733 Use "Unresolved reference" error message when no symbols were found
1734 in a symbolic reference resolution. Remove .expr and -expr from
1735 the shown reference when the reference is unresolved.
1736 * src/scan-code.l: Change the error message, adjust location columns,
1737 rename variable "exact_mode" to "explicit_bracketing".
1738 * tests/named-ref.at: Adjust existing tests and add a new one.
1739
17402009-09-04 Akim Demaille <demaille@gostai.com>
1741
1742 Adjust synclines in src/parse-gram.[ch].
1743 * tests/bison.in: Do some magic (including working around issues
1744 with ylwrap) when this wrapper is used to compile
1745 src/parse-gram.y.
1746
17472009-09-03 Joel E. Denny <jdenny@clemson.edu>
1748
1749 Complain about unused %define variables and %code qualifiers.
1750 * NEWS (2.5): Document.
1751 * data/bison.m4 (b4_check_user_names): Complain instead of warn.
1752 * doc/bison.texinfo (Decl Summary): Document complaint, and
1753 improve %define documentation a little otherwise.
1754 * tests/input.at (Reject unused %code qualifiers): Update.
1755 (%define errors): Update.
1756 (%define, --define, --force-define): Update.
1757 (%define backward compatibility): Update.
1758 (Unused %define api.pure): Update.
1759 * tests/push.at (Push Parsing: Unsupported Skeletons): Update.
1760
17612009-09-03 Joel E. Denny <jdenny@clemson.edu>
1762
1763 Don't suppress warnings about unused parse.error.
1764 * data/bison.m4 (b4_error_verbose_flag): Don't examine value of
1765 %define variable parse.error unless b4_error_verbose_flag is
1766 actually expanded in a skeleton.
1767
17682009-09-03 Akim Demaille <demaille@gostai.com>
1769
1770 * NEWS (2.4.2): Add "Internationalization" item.
1771
17722009-09-03 Akim Demaille <demaille@gostai.com>
1773
1774 bootstrap: fix/improve find_tool.
1775 * bootstrap (find_tool): Improve error messages.
1776 Fix typo about find_tool_names.
1777
17782009-08-29 Joel E. Denny <jdenny@clemson.edu>
1779
1780 Fix gcc 3.4.4 shadowing warning reported by Eric Blake.
1781 See
1782 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00093.html>.
1783 * src/scan-code.h (code_props_rule_action_init): Rename
1784 named_ref arg to name so it doesn't shadow named_ref type. This
1785 makes it consistent with the function definition in scan-code.l
1786 anyway.
1787
17882009-08-28 Joel E. Denny <jdenny@clemson.edu>
1789
1790 %define: accept unquoted values.
1791 * NEWS (2.5): Group all %define changes together, and document
1792 this one. Remove quotes in IELR and canonical LR entry.
1793 * doc/bison.texinfo: Remove quotes in most examples throughout.
1794 (Decl Summary): Update %define documentation.
1795 (Table of Symbols): Likewise.
1796 * src/ielr.c (LrType): Update documentation.
1797 * src/parse-gram.y (content.opt): Add production for ID.
1798 * tests/actions.at: Remove quotes in most tests.
1799 * tests/calc.at: Likewise.
1800 * tests/existing.at: Likewise.
1801 * tests/input.at: Likewise.
1802 * tests/local.at: Likewise.
1803 * tests/push.at: Likewise.
1804 * tests/reduce.at: Likewise.
1805 * tests/torture.at: Likewise.
1806
18072009-08-28 Joel E. Denny <jdenny@clemson.edu>
1808
1809 %define lr.type: make values lowercase IDs.
1810 That is, "LALR" => "lalr", "IELR" => "ielr", and
1811 "canonical LR" => "canonical-lr".
1812 * NEWS (2.5): Update documentation.
1813 * doc/bison.texinfo (Decl Summary): Likewise.
1814 * src/ielr.c (ielr): Use new values.
1815 * src/ielr.h (ielr): Update documentation.
1816 * src/reader.c (prepare_percent_define_front_end_variables): Use
1817 and validate new values.
1818 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): Update test
1819 grammars.
1820 * tests/reduce.at (AT_TEST_LR_TYPE): Likewise.
1821
18222009-08-27 Eric Blake <ebb9@byu.net>
1823
1824 scan-gram: avoid portability trap with ctype usage.
1825 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
1826 Avoid compiler warning.
1827
18282009-08-27 Joel E. Denny <jdenny@clemson.edu>
1829
1830 tests: use perl for printing special sequences to files.
1831 And skip tests if perl is not available. This is better than
1832 playing tricks with shell portability. Suggested by Akim
1833 Demaille.
1834 * tests/input.at (Bad character literals): Use it here for
1835 omitting final newlines.
1836 (Bad escapes in literals): Use it here for special characters.
1837
18382009-08-26 Joel E. Denny <jdenny@clemson.edu>
1839
1840 tests: show a use of %define lr.default-reductions "consistent"
1841 * tests/conflicts.at (%nonassoc and eof): Extend to test that it
1842 prevents the omission of expected tokens for %error-verbose.
1843
18442009-08-26 Akim Demaille <demaille@gostai.com>
1845
1846 tests: portability fix.
1847 * tests/input.at (Bad escapes in literals): Don't expect "echo
1848 '\0'" to output \ then 0.
1849
18502009-08-26 Joel E. Denny <jdenny@clemson.edu>
1851
1852 Actually handle the yytable zero value correctly this time.
1853 * data/bison.m4 (b4_integral_parser_tables_map): Don't mention
1854 zero values in the YYTABLE comments.
1855 * data/glr.c (yytable_value_is_error): Don't check for zero
1856 value.
1857 * data/lalr1.cc (yy_table_value_is_error_): Likewise.
1858 * data/yacc.c (yytable_value_is_error): Likewise.
1859 * data/lalr1.java (yy_table_value_is_error_): Likewise.
1860 (yysyntax_error): Fix typo in code: use yytable_ not yycheck_.
1861 * src/tables.h: In header comments, explain why it's useless to
1862 check for a zero value in yytable.
1863
18642009-08-25 Joel E. Denny <jdenny@clemson.edu>
1865
1866 More fixes related to last two patches.
1867 * data/bison.m4 (b4_integral_parser_tables_map): Fix YYTABLE
1868 comments: zero indicates syntax error not default action.
1869 * data/c.m4 (b4_table_value_equals): Comment that YYID must be
1870 defined.
1871 * data/glr.c (yyis_pact_ninf): Rename to...
1872 (yypact_value_is_default): ... this.
1873 (yyisDefaultedState): Update for rename.
1874 (yyis_table_ninf): Rename to...
1875 (yytable_value_is_error): ... this, and check for value zero
1876 besides just YYTABLE_NINF.
1877 (yygetLRActions): Check for default value from yypact. It
1878 appears that this check is always performed before this function
1879 is invoked, and so adding the check here is probably redundant.
1880 However, the code may evolve after this subtlety is forgotten.
1881 Also, update for rename to yytable_value_is_error. Because that
1882 macro now checks for zero, a different but equivalent branch of
1883 the if-then-else here is evaluated.
1884 (yyreportSyntaxError): Update for rename to
1885 yytable_value_is_error. The zero condition was mishandled
1886 before.
1887 (yyrecoverSyntaxError): Update for renames. No behavioral
1888 changes.
1889 * data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_):
1890 New function.
1891 (yy_table_value_is_error_): New function.
1892 (parse): Use new functions where possible. No behavioral
1893 changes.
1894 (yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_.
1895 The zero condition was mishandled before.
1896 * data/yacc.c (yyis_pact_ninf): Rename to...
1897 (yypact_value_is_default): ... this.
1898 (yyis_table_ninf): Rename to...
1899 (yytable_value_is_error): ... this, and check for value zero
1900 besides just YYTABLE_NINF.
1901 (yysyntax_error): Update for rename to yytable_value_is_error.
1902 The zero condition was mishandled before.
1903 (yyparse): Update for renames. No behavioral changes.
1904 * src/tables.h: Improve comments about yypact, yytable, etc.
1905 more. Most importantly, say yytable value of zero means syntax
1906 error not default action.
1907
19082009-08-25 Joel E. Denny <jdenny@clemson.edu>
1909
1910 Fix %error-verbose for conflicts resolved by %nonassoc.
1911 * NEWS (2.5): Document.
1912 * data/glr.c (yyreportSyntaxError): Fix this by checking
1913 yyis_table_ninf.
1914 * data/yacc.c (yysyntax_error): Likewise.
1915 * data/lalr1.cc (yysyntax_error_): Fix this by checking
1916 yytable_ninf_.
1917 * data/lalr1.java (yysyntax_error): Likewise.
1918 * tests/conflicts.at (%nonassoc and eof): Update expected output
1919 and remove FIXME.
1920
19212009-08-25 Joel E. Denny <jdenny@clemson.edu>
1922
1923 Some code and documentation improvements.
1924 * data/c.m4 (b4_table_value_equals): New macro to capture
1925 some repeated code.
1926 * data/glr.c (yyis_pact_ninf): Use it here.
1927 (yyis_table_ninf): Likewise.
1928 (yyreportSyntaxError): Improve internal comments.
1929 * data/yacc.c (yyis_pact_ninf): New macro copied from glr.c.
1930 Use it everywhere possible.
1931 (yyis_table_ninf): Likewise.
1932 (yysyntax_error): Improve internal comments.
1933 * data/lalr1.cc (yysyntax_error_): Likewise.
1934 * data/lalr1.java (yysyntax_error): Likewise.
1935 * src/tables.h: Improve comments about yypact, yytable, etc.
1936
19372009-08-21 Joel E. Denny <jdenny@clemson.edu>
1938
1939 Use locale when quoting.
1940 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
1941 quote rather than implementing quoting here.
1942
19432009-08-20 Eric Blake <ebb9@byu.net>
1944
1945 Make previous patch more robust.
1946 * src/output.c (ARRAY_CARDINALITY): New macro, copied from
1947 argmatch.h.
1948 (output_skeleton): Use it.
1949 Suggested by Akim Demaille.
1950
1951 Import latest m4/m4.m4.
1952 * submodules/autoconf: Update to autoconf 2.64.
1953 * configure.ac (M4_GNU_OPTION): New define.
1954 * src/output.c (output_skeleton): Use it to resolve FIXME.
1955 * NEWS: Mention this.
1956
19572009-08-19 Joel E. Denny <jdenny@clemson.edu>
1958
1959 Fix complaints about escape sequences.
1960 Discussed starting at
1961 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
1962 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
1963 For a \0 and similar escape sequences meaning the null
1964 character, report an invalid escape sequence instead of an
1965 invalid null character because the latter does not actually
1966 appear in the user's input.
1967 In all escape sequence complaints, don't escape the initial
1968 backslash, and don't quote when the sequence appears at the end
1969 of the complaint line unless there's whitespace that quotearg
1970 won't escape.
1971 Consistently say "invalid" not "unrecognized".
1972 Consistently prefer "empty character literal" over "extra
1973 characters in character literal" warning for invalid escape
1974 sequences; that is, consistently discard those sequences.
1975 * tests/input.at (Bad escapes in literals): New.
1976
19772009-08-19 Akim Demaille <demaille@gostai.com>
1978
1979 doc: fixes.
1980 * doc/bison.texinfo: Fix minor Texinfo errors.
1981
19822009-08-19 Akim Demaille <demaille@gostai.com>
1983
1984 tests: distcc compliance.
1985 * tests/synclines.at (AT_SYNCLINES_COMPILE): Discard distcc's
1986 error messages from the output.
1987
19882009-08-19 Akim Demaille <demaille@gostai.com>
1989
1990 variables: simplify the upgrade of namespace into api.namespace.
1991
1992 This patch simplifies "variables: rename namespace as
1993 api.namespace", commit 67501061076ba46355cfd9f9361c7eed861b389c.
1994 Suggested by Joel E. Denny in
1995 http://lists.gnu.org/archive/html/bison-patches/2009-07/msg00006.html
1996
1997 * src/muscle-tab.c (muscle_percent_variable_update): New.
1998 (muscle_percent_define_insert): Use it in replacement of the
1999 previous tr invocation.
2000 Remove variable_tr, no longer needed.
2001 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
2002 Remove.
2003 * data/c++.m4: No longer handle namespace -> api.namespace.
2004 * tests/input.at (%define backward compatibility): Check that
2005 namespace is treated as api.namespace.
2006
20072009-08-19 Akim Demaille <demaille@gostai.com>
2008
2009 doc: %initial-action to initialize yylloc.
2010 Reported by Bill Allombert.
2011 * doc/bison.texinfo: Set fill-column to 76.
2012 (Location Type): Document the use of %initial-action to initialize
2013 yylloc.
2014
20152009-08-19 Akim Demaille <demaille@gostai.com>
2016
2017 lalr1.cc: use state_type.
2018 * data/lalr1.cc (yysyntax_error_): Use state_type.
2019 Move argument names into yy*.
2020
20212009-08-19 Akim Demaille <demaille@gostai.com>
2022
2023 lalr1.cc: get rid of yyparse's yystate.
2024 yystate and yystack_[0].state are equal, keep only the latter.
2025 The former was also used as a temporary variable to compute the
2026 post-reduction state. Move this computation into an auxiliary
2027 function.
2028
2029 * data/glr.c (yyLRgotoState): Fuse variable definition and first
2030 assignment.
2031 * data/lalr1.cc (yy_lr_goto_state_): New.
2032 (yyparse): Use it.
2033 Replace remaining uses of yystate by yystate_[0].state.
2034 Remove the former.
2035
20362009-08-19 Akim Demaille <demaille@gostai.com>
2037
2038 lalr1.cc: destroy $$ when YYERROR is called.
2039 * data/lalr1.cc (yyreduce): Compute the resulting state before
2040 running the user action so that yylhs is a valid symbol.
2041 (yyerrorlab): Since yylhs is complete (it knows its type), we can
2042 simply call yy_destroy_ to destroy $$ on YYERROR invocations.
2043 * tests/c++.at (AT_CHECK_VARIANTS): Test YYERROR with variants.
2044
20452009-08-18 Joel E. Denny <jdenny@clemson.edu>
2046
2047 maint: update for gnulib's recent update-copyright changes
2048 * gnulib: Update.
2049 * .x-update-copyright (COPYING): Add as it's no longer implied
2050 when .x-update-copyright is present.
2051 * cfg.mk (update-copyright-local): Remove, now ignored.
2052 (update-copyright): Declare update-b4-copyright as a dependency.
2053
20542009-08-17 Akim Demaille <demaille@gostai.com>
2055
2056 build: require gettext 0.17.
2057
2058 Suggested by Bruno Haible.
2059 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
2060 * configure.ac: require gettext 0.17 to ensure compatibility with
2061 gnulib.
2062
20632009-08-17 Akim Demaille <demaille@gostai.com>
2064
2065 build: lower gettext requirements.
2066
2067 Bison was uselessly requiring the formatstring macros from
2068 gettext, which resulted in mo files not being installed on systems
2069 that perfectly supported Bison mo files. Lower the requirement.
2070 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
2071
2072 * configure.ac: Require need-ngettext instead of
2073 need-formatstring-macros.
2074 Reported by Martin Jabocs.
2075 Suggested by Bruno Haible.
2076 * INSTALL: Restructure.
2077 (Internationalization): New.
2078
20792009-08-14 Joel E. Denny <jdenny@clemson.edu>
2080
2081 maint: fix use of copyright year intervals.
2082 * gnulib: Update.
2083 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
2084 as now recommended in gnulib/NEWS.
2085 * build-aux/update-b4-copyright: Fix.
2086 * cfg.mk (update-copyright-env): Configure update-copyright.
2087
20882009-08-13 Joel E. Denny <jdenny@clemson.edu>
2089
2090 Make it easier to write deterministic tests.
2091 Continues Akim's work from his 2009-06-10 commits.
2092 * src/reader.c (check_and_convert_grammar): Don't add any
2093 symbols after the first symbols_do invocation.
2094 * src/symtab.c (symbols_sorted): New static global.
2095 (user_token_number_redeclaration): Update comments.
2096 (symbol_from_uniqstr): If a new symbol is being created, assert
2097 that symbols_sorted hasn't been allocated yet.
2098 (symbols_free): Free symbols_sorted.
2099 (symbols_cmp, symbols_cmp_qsort): New functions.
2100 (symbols_do): Sort symbol_table into symbols_sorted on first
2101 invocation.
2102 * tests/input.at (Numbered tokens): Recombine tests now that the
2103 output should be deterministic across multiple numbers.
2104
21052009-08-12 Akim Demaille <demaille@gostai.com>
2106
2107 tests: GCC 4.5 compliance.
2108 * tests/synclines.at (AT_SYNCLINES_COMPILE): Adjust to GCC 4.5's
2109 messages about #error.
2110
21112009-08-12 Akim Demaille <demaille@gostai.com>
2112
2113 build: fix the generation of the documentation.
2114 Some of our targets use "bison --help", but they can't depend on
2115 "bison" itself (to avoid additional requirements on the user), so
2116 they used to call "make src/bison" in the commands. Then
2117 concurrent builds may fail: one make might be aiming one of its
2118 jobs at compiling src/bison, and another job at generating the man
2119 page. If the latter is faster than the former, then we have two
2120 makes that concurrently try to compile src/bison.
2121
2122 This might also be a more convincing explanation for the failure
2123 described in the patch "build: fix paths".
2124
2125 * Makefile.am (SUFFIXES): Initialize.
2126 * build-aux/move-if-change: New, symlink to gnulib's.
2127 * build-aux/local.mk: Ship it.
2128 * doc/common.x: Remove, merged into...
2129 * doc/bison.x: here.
2130 * doc/local.mk (doc/bison.help): New.
2131 ($(CROSS_OPTIONS_TEXI)): Depend on it.
2132 Use src/bison.
2133 (.x.1): Replace with...
2134 (doc/bison.1): this explicit, simpler, target.
2135 (common_dep): Remove, inlined where appropriate.
2136 (SUFFIXES, PREPATH): Remove, unused.
2137
21382009-08-12 Akim Demaille <demaille@gostai.com>
2139
2140 gnulib: improve prefixing.
2141 * configure.ac (gl_PREFIXED_LIBOBJS): Don't rename it, rather,
2142 change the value of...
2143 (gl_LIBOBJS): this.
2144 Adjust more variables.
2145 * etc/prefix-gnulib-mk (prefix_assignment): Don't rename
2146 gl_LIBOBJS.
2147 (prefix): Also transform rules whose targets have slashes.
2148 Use $prefix liberally.
2149 Map @MKDIR_P@ to $(MKDIR_P).
2150 Prefix directories that are mkdir'd.
2151
21522009-08-12 Akim Demaille <demaille@gostai.com>
2153
2154 build: fix paths.
2155 When using $(top_builddir) inconsistently, Make (including GNU
2156 Make) is sometimes confused. As a result it may want to build
2157 lib/libbison.la and $(top_builddir)/lib/libbison.la (the same
2158 file, different names) concurrently, which, amusingly enough,
2159 might end with:
2160
2161 ranlib lib/libbison.a
2162 ranlib lib/libbison.a
2163 make[2]: *** [lib/libbison.a] Segmentation fault
2164
2165 on OS X.
2166
2167 * doc/local.mk, src/local.mk: Do not use $(top_builddir) when not
2168 needed.
2169
21702009-08-12 Akim Demaille <demaille@gostai.com>
2171
2172 distcheck: fix.
2173
2174 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
2175
21762009-08-10 Joel E. Denny <jdenny@clemson.edu>
2177
2178 * tests/local.mk (TESTSUITE_AT): Add named-refs.at.
2179
21802009-08-10 Joel E. Denny <jdenny@clemson.edu>
2181
2182 Miscellaneous code readability improvements.
2183
2184 * src/reader.c (reader): Move %define front-end variable
2185 defaults and checking into...
2186 (prepare_percent_define_front_end_variables): ... this new
2187 function.
2188
2189 * src/scan-gram.l (INITIAL): For consistency with string
2190 literals, don't store open quote on character literal. It's
2191 discarded before returning anyway.
2192 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
2193 Make length test more readable, and make the character stored
2194 for an empty literal more obvious while consistent with the
2195 previous behavior.
2196
2197 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
2198 USER_NUMBER_HAS_STRING_ALIAS throughout.
2199 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
2200 that is repeated in symtab.h. Improve argument names to make it
2201 clear which side of the symbol-string alias pair is which.
2202 (symbol_check_alias_consistency): Improve local variable names
2203 for the same purpose.
2204 * src/symtab.h (struct symbol): Make comments about aliases
2205 clearer.
2206 (symbol_make_alias): Improve comments and argument name.
2207 * src/output.c (token_definitions_output): Update for rename to
2208 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
2209
22102009-08-08 Alex Rozenman <rozenman@gmail.com>
2211
2212 Convert "misleading reference" messages to warnings.
2213 * src/scan-code.l: New function 'show_sub_messages', more
2214 factoring.
2215 * tests/named-ref.at: Adjust tests.
2216
22172009-08-06 Joel E. Denny <jdenny@clemson.edu>
2218
2219 maint: run "make update-copyright"
2220
22212009-08-06 Joel E. Denny <jdenny@clemson.edu>
2222
2223 maint: make update-b4-copyright easier to use
2224 * build-aux/update-b4-copyright: In warnings, report line
2225 numbers rather than character positions.
2226 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
2227 that update-copyright runs it.
2228 * gnulib: Update.
2229
22302009-08-05 Joel E. Denny <jdenny@clemson.edu>
2231
2232 maint: clean up update-b4-copyright code
2233 * build-aux/update-b4-copyright: Do not accept 2-digit
2234 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
2235 Don't accept a `[' in a b4_copyright argument.
2236 Format code more consistently.
2237 Don't assume b4*copyright never occurs.
2238
22392009-08-04 Joel E. Denny <jdenny@clemson.edu>
2240
2241 maint: automate b4_copyright updates.
2242 * Makefile.am (update-b4-copyright): New target rule.
2243 * build-aux/local.mk (EXTRA_DIST): Add update-b4-copyright.
2244 * build-aux/update-b4-copyright: New.
2245 * data/yacc.c: Remove stray characters around b4_copyright
2246 invocations.
2247
22482009-08-04 Joel E. Denny <jdenny@clemson.edu>
2249
2250 maint: automate annual package-wide copyright-year update.
2251 * .x-update-copyright: New.
2252 * Makefile.am (EXTRA_DIST): Remove maint.mk.
2253 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
2254 update-copyright. Remove gnumakefile, which is implied by
2255 maintainer-makefile.
2256 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
2257 * gnulib: Update.
2258 * maint.mk: Remove, now copied from gnulib.
2259 * examples/extexi: Add missing "(C)" in copyright statement so
2260 update-copyright can recognize it.
2261 * src/LR0.h: Likewise.
2262 * src/print.h: Likewise.
2263 * src/print_graph.h: Likewise.
2264 * src/gram.c: Add missing comma in copyright statement.
2265 * src/gram.h: Likewise.
2266
22672009-08-04 Joel E. Denny <jdenny@clemson.edu>
2268
2269 Fix "make distcheck".
2270 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
2271 of just calc.stamp.
2272
22732009-08-01 Joel E. Denny <jdenny@clemson.edu>
2274
2275 Pacify "gcc -Wunused" for the input function from Flex.
2276 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
2277 and later.
2278 * src/scan-code.l: Add "%option noinput", which I cannot find in
2279 the Flex manual, but which Flex has supported since at least as
2280 far back as 2.5.4. However, if any of our developers still use
2281 Flex 2.5.4, they'll need to stop configuring with
2282 --enable-gcc-warnings because "%option noinput" didn't work
2283 correctly until Flex 2.5.6.
2284 * src/scan-gram.l: Likewise.
2285 * src/scan-skel.l: Likewise.
2286
22872009-07-31 Alex Rozenman <rozenman@gmail.com>
2288
2289 Fix --enable-gcc-warnings problems.
2290 * src/reader.c: Adjust variable names.
2291 * src/scan-code.l: Fix prototypes and adjust names.
2292 * src/named-ref.c: Remove redundant "if".
2293
22942009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
2295
2296 Fix a --enable-gcc-warnings problem.
2297 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
2298 variable.
2299
23002009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
2301
2302 Warn about character literals not of length one.
2303 * NEWS (2.5): Document.
2304 * src/scan-gram.l (INITIAL): Remove comment that we don't check
2305 the length.
2306 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
2307 * tests/input.at (Bad character literals): New test group.
2308
23092009-07-24 Alex Rozenman <rozenman@gmail.com>
2310
2311 Fix some memory leaks.
2312 * src/named-ref.c: Add a pointer check (named_ref_free).
2313 * src/scan-code.l: New function (variant_table_free). Called in
2314 code_scanner_free.
2315 * src/symlist.c: Call to named_ref_free (symbol_list_free).
2316
23172009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
2318
2319 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
2320
23212009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
2322
2323 Some M4 cleanup in the testsuite.
2324 Suggested by Eric Blake at
2325 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
2326 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
2327 complicate the code by distinguishing between a missing value
2328 and an empty string value for an optional argument. This fix is
2329 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
2330 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
2331 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
2332 arguments are not needed because of the following changes.
2333 Fix stale comments.
2334 Bison developers should use GNU M4 and should not use
2335 POSIXLY_CORRECT when building the test suite, so do not
2336 complicate the code by avoiding $10 and above.
2337 Do not quote an empty string value for an optional argument, and
2338 do not distinguish between a missing value and an empty string
2339 value.
2340
23412009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
2342
2343 Revert unnecessary column realignment in --help output.
2344 Reported by Akim Demaille at
2345 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
2346 * src/getargs.c (usage): Here.
2347
23482009-07-04 Alex Rozenman <rozenman@gmail.com>
2349
2350 Alphabetical order in src/local.mk.
2351 * src/local.mk: Adjust.
2352
23532009-07-04 Alex Rozenman <rozenman@gmail.com>
2354
2355 Style changes and factoring.
2356 * src/named-ref.h: Add comments.
2357 * src/parse-gram.y: Readability and style changes.
2358 * src/reader.c: Factoring: assign_named_ref function.
2359 * src/scan-code.l: Factoring and style changes. Rename
2360 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
2361 Use "unsigned" type for variant index. Improve readablity.
2362 * src/scan-gram.l: Change error messages and add comments.
2363 * src/symlist.h: symbol_list_null: New function decl.
2364 * src/symlist.c: symbol_list_null: Implement here.
2365 * tests/named-refs.at: Adjust for new error messages.
2366
23672009-06-29 Eric Blake <ebb9@byu.net>
2368
2369 scan-code: avoid compiler warnings
2370 * src/scan-code.l (parse_named_ref): Use correct specifiers.
2371
23722009-06-29 Akim Demaille <demaille@gostai.com>
2373
2374 build: avoid concurrent extraction of calc++.
2375 * examples/calc++/Makefile.am (calc.stamp): New.
2376 Depend on it to create the sources of calc++ so that concurrent
2377 builds don't launch several "extexi" in parallel.
2378 Not only this is inefficient, this also builds incorrect sources
2379 with several extractions mixed together.
2380
23812009-06-29 Akim Demaille <demaille@gostai.com>
2382
2383 parse.error: fix.
2384 * data/bison.m4: Move code related to specific variables after the
2385 definition of the variable-maintaining macros so that we don't
2386 "invoke" b4_percent_define_check_values before it is defined.
2387
23882009-06-29 Akim Demaille <demaille@gostai.com>
2389
2390 variables: parse.error
2391
2392 Implement, document, and test the replacement of %error-verbose
2393 by %define parse.error "verbose".
2394 * data/bison.m4 (b4_error_verbose_if): Reimplement to track the
2395 values of the parse.error variable.
2396 Make "simple" its default value.
2397 Check the valid values.
2398 * src/parse-gram.y: Use %define parse.error.
2399 (PERCENT_ERROR_VERBOSE): New token.
2400 Support it.
2401 * src/scan-gram.l: Support %error-verbose.
2402
2403 * doc/bison.texinfo (Decl Summary): Replace the documentation of
2404 %define error-verbose by that of %define parse.error.
2405 * NEWS: Document it.
2406
2407 * tests/actions.at, tests/calc.at: Use parse.error instead of
2408 %error-verbose.
2409
24102009-06-27 Alex Rozenman <rozenman@gmail.com>
2411
2412 Implement support for named symbol references.
2413 * src/parse-gram.y: Add new syntax (named_ref.opt).
2414 * src/reader.c: Store named refs in symbol lists.
2415 * src/reader.h: New argument for symbol_append and
2416 action_append functions.
2417 * src/scan-code.h: Add new field (named_ref) into
2418 code_props data structure. Keeps named ref of midrule
2419 actions.
2420 * src/scan-code.l: Support for named refs in semantic
2421 action code. New function 'parse_named_ref'.
2422 * src/scan-gram.l: Support bracketed id.
2423 * src/symlist.c: Store named refs in symbol lists.
2424 * src/symlist.h: New field in symbol list: named_ref.
2425 * src/named-ref.h: New file, a struct for named_ref.
2426 * src/named-ref.cp: New file, named_ref_new function.
2427 * src/local.mk: Add two new files.
2428 * tests/testsuite.at: Include new test group:
2429 * tests/named-refs.at: this new file.
2430
24312009-06-25 Akim Demaille <demaille@gostai.com>
2432
2433 hash: check insertion for memory exhaustion.
2434 * src/uniqstr.c (uniqstr_new): New.
2435
24362009-06-24 Akim Demaille <demaille@gostai.com>
2437
2438 variables: rename namespace as api.namespace.
2439 Discussed in
2440 http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00033.html
2441
2442 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
2443 New.
2444 (b4_percent_define_use): New.
2445 Use it where applicable.
2446 * data/c++.m4: Replace uses of the variable "namespace" by
2447 "api.namespace".
2448 Default the latter to the former.
2449 * doc/bison.texinfo (Decl Summary): Document "namespace" as
2450 obsolete.
2451 Document api.namespace.
2452 Use @samp to document %define uses, keep @code for identifiers.
2453 * NEWS: Likewise.
2454 * tests/c++.at, tests/input.at: Test api.namespace instead of
2455 namespace. (The tests passed with namespace.)
2456
24572009-06-11 Akim Demaille <demaille@gostai.com>
2458
2459 style changes.
2460 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
2461 * src/print-xml.c: Style changes.
2462 * tests/conflicts.at: Comment changes.
2463
24642009-06-11 Akim Demaille <demaille@gostai.com>
2465
2466 xml: beware of user strings used to give a %prec to rules.
2467 * tests/conflicts.at (%prec with user strings): New.
2468 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
2469 XML output.
2470
24712009-06-11 Akim Demaille <demaille@gostai.com>
2472
2473 hash: check insertion for memory exhaustion.
2474 * src/muscle-tab.c (muscle_insert, muscle_grow)
2475 * src/state.c (state_hash_insert): Check the return value of
2476 hash_insert.
2477
24782009-06-11 Akim Demaille <demaille@gostai.com>
2479
2480 tests: honor TESTSUITEFLAGS in every check target.
2481 * tests/local.mk (RUN_TESTSUITE): New.
2482 (check-local, installcheck-local, maintainer-check-g++)
2483 (maintainer-check-posix, maintainer-check-valgrind): Use it.
2484
24852009-06-10 Akim Demaille <demaille@gostai.com>
2486
2487 deterministic test suite.
2488 Some consistency checks on symbols are performed after all the
2489 symbols were read, by an iteration over the symbol table. This
2490 traversal is nondeterministic, which can be a problem for test
2491 cases.
2492 Avoid this.
2493 Addresses another form of nondeterminism reported by Joel E. Denny.
2494 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
2495
2496 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
2497 test in two.
2498 Use different file names for the three tests to make the
2499 maintenance easier.
2500
25012009-06-10 Akim Demaille <demaille@gostai.com>
2502
2503 gnulib: update.
2504 * gnulib: Update to latest.
2505 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
2506 * m4/.gitignore: Regen.
2507 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
2508 Call xalloc_die on hash_insert failures.
2509 Requested by the new __warn_unused_result__ attribute of
2510 hash_insert.
2511
25122009-06-10 Akim Demaille <demaille@gostai.com>
2513
2514 deterministic user-token-number redeclaration errors.
2515 Address nondeterminism reported by Joel E. Denny.
2516 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
2517
2518 * src/uniqstr.h: Comment changes.
2519 * src/location.h (boundary_cmp, location_cmp): New.
2520 * src/symtab.c (user_token_number_redeclaration): New.
2521 (symbol_translation): Use it.
2522 * tests/input.at (Numbered tokens): Adjust the expected output.
2523
25242009-05-25 Akim Demaille <demaille@gostai.com>
2525
2526 build: avoid ignored errors.
2527 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Don't generate ignored
2528 errors, they pollute the output.
2529
25302009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
2531
2532 Convert multiple variable definition warnings to complaints.
2533 * NEWS (2.5): Add a new entry for that change.
2534 * doc/bison.texinfo (Decl Summary): Update %define entry.
2535 (Bison Options): Update -D/--define/-F/--force-define entry.
2536 * src/muscle-tab.c (muscle_percent_define_insert): Implement.
2537 * src/muscle-tab.h (muscle_percent_define_insert): Update
2538 comments.
2539 * tests/input.at (`%define errors'): Update.
2540 (`%define, --define, --force-define'): Update.
2541
25422009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
2543
2544 -F/--force-define and relative %define/-D/--define priorities.
2545 * NEWS (2.5): Add documentation to -D/--define entry.
2546 * build-aux/cross-options.pl: Hard-code association of
2547 --force-define with %define.
2548 * doc/bison.texinfo (Decl Summary): In %define entry,
2549 cross-reference command-line options.
2550 (Bison Options): Add documentation to -D/--define entry.
2551 (Option Cross Key): Widen column for --force-define row.
2552 * src/getargs.c (usage): Document -F/--force-define. Realign
2553 options in output.
2554 (short_options, long_options, getargs): Parse -F/--force-define,
2555 and update muscle_percent_define_insert invocations.
2556 * src/muscle-tab.h (muscle_percent_define_how): New enum type.
2557 (muscle_percent_define_insert): Add argument with that type.
2558 * src/muscle-tab.c (muscle_percent_define_insert): Implement
2559 -F/--force-define behavior and priorities.
2560 (muscle_percent_define_ensure): Update
2561 muscle_percent_define_insert invocation.
2562 * src/parse-gram.y (prologue_declaration): Update
2563 muscle_percent_define_insert invocations.
2564 * tests/input.at (`%define, --define'): Rename to...
2565 (`%define, --define, --force-define'): ... this and extend.
2566
25672009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
2568
2569 Update some comments to make sense for -D.
2570 * data/bison.m4 (b4_check_user_names): In header comments, say
2571 "user occurrence" instead of "grammar occurrence".
2572 * src/muscle-tab.h (muscle_percent_define_insert): Likewise.
2573 (muscle_percent_code_grow): Likewise just for consistency.
2574
25752009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
2576
2577 * data/c++.m4 (b4_namespace_close): Simplify slightly.
2578
25792009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
2580
2581 Handle a trailing `:' in a user-supplied C++ namespace better.
2582 * data/c++.m4 (b4_namespace_close): Don't let it be printed
2583 among the closing braces here. This fix might make the
2584 generated code easier to debug, but otherwise it should be
2585 insignificant because a trailing `:' is a C++ error already.
2586
25872009-05-19 Akim Demaille <demaille@gostai.com>
2588
2589 remove useless variable.
2590 * src/getargs.c (skeleton_arg): Remove now useless variable.
2591 Should help the compiler see that this printf-like call is sane.
2592
25932009-05-15 Akim Demaille <demaille@gostai.com>
2594
2595 Rename token.prefix as api.tokens.prefix.
2596 Discussed here.
2597 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00024.html.
2598
2599 * NEWS, data/bison.m4, data/c.m4, data/java.m4, doc/bison.texinfo,
2600 * tests/c++.at, tests/calc.at, tests/java.at, tests/local.at
2601 (token.prefix): Rename as...
2602 (api.tokens.prefix): this.
2603
26042009-05-11 Akim Demaille <demaille@gostai.com>
2605
2606 doc: use C++ headers.
2607 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
2608 headers.
2609
26102009-05-11 Akim Demaille <demaille@gostai.com>
2611
2612 doc: token.prefix
2613 * doc/bison.simple (Decl Summary): Document token.prefix.
2614 (Calc++ Parser): Various fixes.
2615 Formatting changes.
2616 Use token.prefix.
2617 Introduce a macro TOKEN to shorten the code and make it more
2618 readable.
2619 (Calc++ Scanner): Adjust.
2620 * NEWS (Variable token.prefix): New.
2621
26222009-05-04 Akim Demaille <demaille@gostai.com>
2623
2624 bison: catch bad symbol names.
2625 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
2626 * tests/input.at: Adjust.
2627
26282009-05-04 Akim Demaille <demaille@gostai.com>
2629
2630 identifiers: dashes are letters.
2631 Dashes can now start identifiers (symbols and directives).
2632
2633 * src/scan-gram.l ({letter}): Add dash.
2634 ({id}): Remove it.
2635 * tests/input.at (Symbols): Adjust.
2636 Remove stray comment.
2637 * tests/regression.at (Invalid inputs): Adjust error message.
2638 * doc/bison.texinfo (Symbols): Update.
2639
26402009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
2641
2642 Declare %code to be a permanent feature.
2643 * NEWS (2.4.2): Here.
2644 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
2645 experimental.
2646 (Decl Summary): Likewise.
2647
26482009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
2649
2650 Convert underscores to dashes in some %define variable names.
2651 For now, just api.push-pull and lr.keep-unreachable-states.
2652 Maintain old names for backward compatibility.
2653 * NEWS (2.5): Document.
2654 * data/c.m4 (b4_identification): Update comment.
2655 * data/yacc.c: Update access.
2656 * doc/bison.texinfo: Update.
2657 * etc/bench.pl.in (bench_push_parser): Update use.
2658 * src/files.c (tr): Move to...
2659 * src/getargs.c, src/getargs.h (tr): ... here because I can't
2660 think of a better place to expose it. My logic is that, for all
2661 uses of tr so far, command-line arguments can be involved, and
2662 getargs.h is already included.
2663 * src/main.c (main): Update access.
2664 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
2665 variable names to new variable names before assigning value.
2666 * src/reader.c (reader): Update setting default.
2667 * tests/calc.at: Update uses.
2668 * tests/conflicts.at (Unreachable States After Conflict
2669 Resolution): Update use.
2670 * tests/input.at (%define enum variables): Update use.
2671 (%define backward compatibility): New test group.
2672 * tests/push.at: Update uses.
2673 * tests/reduce.at: Update uses.
2674 * tests/torture.at: Update uses.
2675
26762009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
2677
2678 Set all front-end %define defaults in one place.
2679 * src/main.c (main): Move lr.keep_unreachable_states default...
2680 * src/reader.c (reader): ... to here.
2681
26822009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
2683
2684 Rename lr.default_reductions to lr.default-reductions.
2685 * NEWS (2.5): Here.
2686 * doc/bison.texinfo: Here.
2687 * src/lalr.c (initialize_LA): Here.
2688 * src/print.c (print_reductions): Here.
2689 * src/reader.c (reader): Here.
2690 * src/tables.c (action_row): Here.
2691 * tests/input.at (%define enum variables): Here.
2692 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
2693
26942009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
2695
2696 Pacify ./configure --enable-gcc-warnings.
2697 * tests/input.at (Symbols): Prototype yyerror and yylex.
2698
26992009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
2700
2701 Document how `%define "var" "value"' is not M4-friendly.
2702 * src/parse-gram.y (variable): In comments here.
2703
27042009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
2705
2706 Clean up recent patches a little.
2707 Reported by Akim Demaille.
2708 * doc/bison.texinfo (Understanding): Fix typos.
2709 * src/print.c (print_reductions): Don't use negated variable.
2710
27112009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
2712
2713 List accepted values for a %define enum variable with an invalid value.
2714 Suggested by Akim Demaille at
2715 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
2716 * data/bison.m4 (_b4_percent_define_check_values): Implement.
2717 * src/muscle-tab.c (muscle_percent_define_check_values): Implement.
2718 * tests/input.at (%define lr.default_reductions invalid values): Merge
2719 into...
2720 (%define enum variables): ... here, and update output.
2721
27222009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
2723
2724 Rename "default rule" to "default reduction".
2725 This includes changing variable names in code, changing
2726 comments, and renaming %define lr.default_rules to %define
2727 lr.default_reductions.
2728 * NEWS (2.5): Update IELR documentation.
2729 * data/bison.m4 (b4_integral_parser_tables_map): Adjust YYDEFACT
2730 documentation.
2731 * data/glr.c, data/lalr1.java: Sync copyright dates.
2732 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
2733 and lr.type documentation. Make some other wording
2734 improvements.
2735 (Glossary): Adjust cross-references and Default Reduction
2736 definition.
2737 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
2738 Remove a confusing comment pointed out by Akim Demaille.
2739 (initialize_LA): Adjust code.
2740 * src/print-xml.c (print_reductions): Adjust code.
2741 * src/print.c (print_reductions): Adjust code.
2742 * src/reader.c (reader): Adjust code.
2743 * src/tables.c (action_row): Adjust code.
2744 (token_actions): Adjust code.
2745 * src/tables.h: Adjust YYDEFACT documentation.
2746 * tests/input.at (%define lr.default_rules invalid values):
2747 Rename test group to...
2748 (%define lr.default_reductions invalid values): ... this, and
2749 update grammar file and expected output.
2750 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
2751 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
2752
27532009-04-21 Akim Demaille <demaille@gostai.com>
2754
2755 tests: check the use of dashes and periods in symbols.
2756 * tests/input.at (Symbol): New test group.
2757
27582009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2759
2760 Document %define lr.type and lr.default_rules.
2761 * NEWS (2.5): Add an entry.
2762 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
2763 besides just LALR(1) and GLR(1).
2764 * doc/bison.texinfo (Introduction): Likewise.
2765 (Language and Grammar): Bison is no longer limited to LALR(1)
2766 restrictions.
2767 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
2768 when trying to distinguish from GLR. Talk about LR(1) grammars
2769 rather than LALR(1) grammars.
2770 (Decl Summary): In %define api.push_pull entry, say it applies
2771 to deterministic parsers in C rather than LALR(1) parsers in C.
2772 Add lr.default_rules entry.
2773 Add lr.type entry.
2774 (Mystery Conflicts): Bison is no longer limited to LALR(1)
2775 restrictions.
2776 (Generalized LR Parsing): Same changes as for the previous GLR
2777 section.
2778 (Memory Management): Say deterministic rather than LALR(1).
2779 (Understanding): Correct some bison output.
2780 Index discussion of "accepting state".
2781 Say deterministic rather than LALR(1).
2782 (Bison Options): In --yacc entry, say deterministic rather than
2783 LALR(1).
2784 In --report, --graph, and --xml entries, just don't mention
2785 LALR(1).
2786 (C++ Parsers): Say deterministic rather than LALR(1).
2787 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
2788 (Glossary): Add Accepting State, Consistent State, Default Rule,
2789 and IELR(1) definitions.
2790 In Generalized LR (GLR) definition, make same changes as in
2791 previous GLR sections.
2792 In LALR(1) definition, say Bison uses LALR(1) by default rather
2793 than implying Bison is limited to LALR(1).
2794 (LocalWords): Add IELR.
2795
27962009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2797
2798 Finish implementing %define lr.type.
2799 Its value can be "LALR", "IELR", or "canonical LR".
2800 * lib/timevar.def (TV_IELR_PHASE1): New var.
2801 (TV_IELR_PHASE2): New var.
2802 (TV_IELR_PHASE3): New var.
2803 (TV_IELR_PHASE4): New var.
2804 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
2805 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
2806 Sbitset.h, ielr.h, and ielr.c.
2807 * src/getargs.h, src/getargs.c (enum trace, trace_args,
2808 trace_types): Add trace_ielr.
2809 * src/lalr.h, src/lalr.c (ngotos): Export it.
2810 (F): Rename to...
2811 (goto_follows): ... this, update all uses, and export it.
2812 (set_goto_map): Export it.
2813 (map_goto): Export it.
2814 (compute_lookahead_tokens): Don't free goto_follows yet. Now
2815 handled in ielr.
2816 (initialize_LA): Export it. Move lookback allocation to...
2817 (lalr): ... here because, for canonical LR, initialize_LA must
2818 be invoked but lookback and much of the rest of LALR isn't
2819 needed.
2820 * main.c (main): Instead of lalr, invoke ielr, which invokes
2821 lalr.
2822 * src/reader.c (reader): Default lr.type to "LALR".
2823 Default lr.default_rules to "accepting" if lr.type is "canonical
2824 LR". Leave the default as "all" otherwise.
2825 Check for a valid lr.type value.
2826 * src/state.h, src/state.c (struct state_list): Add state_list
2827 member.
2828 (state_new): Initialize state_list member to NULL.
2829 (state_new_isocore): New function, exported.
2830 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
2831 exercises all values of lr.type.
2832 (GNU AWK Grammar): Rename test group to...
2833 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
2834 AT_TEST_EXISTING_GRAMMAR.
2835 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
2836 (GNU pic Grammar): Rename test group to...
2837 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
2838 AT_TEST_EXISTING_GRAMMAR.
2839 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
2840 all values of lr.type.
2841 (Single State Split): New test groups using AT_TEST_LR_TYPE.
2842 (Lane Split): Likewise.
2843 (Complex Lane Split): Likewise.
2844 (Split During Added Lookahead Propagation): Likewise.
2845
28462009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2847
2848 Add new files for IELR and canonical LR implementation.
2849 * src/AnnotationList.c: New.
2850 * src/AnnotationList.h: New.
2851 * src/InadequacyList.c: New.
2852 * src/InadequacyList.h: New.
2853 * src/Sbitset.c: New.
2854 * src/Sbitset.h: New.
2855 * src/ielr.c: New.
2856 * src/ielr.h: New.
2857
28582009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
2859
2860 Implement %define lr.default_rules.
2861 Its value describes the states that are permitted to contain
2862 default rules: "all", "consistent", or "accepting".
2863 * src/reader.c (reader): Default lr.default_rules to "all".
2864 Check for a valid lr.default_rules value.
2865 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
2866 is "accepting", then only mark the accepting state as
2867 consistent.
2868 (initialize_LA): Tell state_lookahead_tokens_count whether
2869 lr.default_rules is "accepting".
2870 * src/tables.c (action_row): If lr.default_rules is not "all",
2871 then disable default rules in inconsistent states.
2872 * src/print.c (print_reductions): Use this opportunity to
2873 perform some assertions about whether lr.default_rules was
2874 obeyed correctly.
2875 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
2876 helps with checking the parser tables for a grammar.
2877 * tests/input.at (%define lr.default_rules invalid values): New
2878 test group.
2879 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
2880 AT_TEST_TABLES_AND_PARSE.
2881 (`no %define lr.default_rules'): New test group generated by
2882 AT_TEST_LR_DEFAULT_RULES.
2883 (`%define lr.default_rules "all"'): Likewise.
2884 (`%define lr.default_rules "consistent"'): Likewise.
2885 (`%define lr.default_rules "accepting"'): Likewise.
2886
28872009-04-20 Akim Demaille <demaille@gostai.com>
2888
2889 Formatting change.
2890
28912009-04-20 Akim Demaille <demaille@gostai.com>
2892
2893 bison: factoring.
2894 * src/output.c (token_definitions_output): Use symbol_id_get
2895 instead of duplicating its logic.
2896 * TODO (YYERRCODE): Extend.
2897
28982009-04-20 Akim Demaille <demaille@gostai.com>
2899
2900 variables: prefer error-verbose to error_verbose.
2901 * data/bison.m4 (b4_error_verbose_if): Based on error-verbose
2902 instead of error_verbose.
2903 * src/scan-gram.l (%error-verbose): Map to the error-verbose
2904 variable.
2905 * doc/bison.texinfo: Promote %define error-verbose instead of
2906 %error-verbose.
2907 * tests/actions.at: Prefer %define error-verbose to %error-verbose.
2908
29092009-04-15 Akim Demaille <demaille@gostai.com>
2910
2911 variables: accept dashes.
2912 * data/bison.m4 (b4_percent_define_if_define_): Also map dashes to
2913 underscores.
2914 * src/scan-gram.l ({id}): Also accept dashes after the initial
2915 letter.
2916 ({directive}): Use {id}.
2917 * src/parse-gram.y: Comment and formatting changes.
2918 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
2919 symbols.
2920 * src/complain.h, src/complain.c (yacc_at): New.
2921 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
2922 symbol names.
2923 * src/output.c (token_definitions_output): Do not #define token
2924 names with dashes.
2925
29262009-04-20 Akim Demaille <demaille@gostai.com>
2927
2928 Consistently refer to Yacc, not YACC.
2929 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
2930
29312009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
2932
2933 Pacify make maintainer-check-posix.
2934 * tests/input.at (%define, --define): Move bison command-line
2935 options before grammar file name.
2936
29372009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
2938
2939 Document semicolon warnings.
2940 * NEWS (2.5): Here.
2941
29422009-04-14 Akim Demaille <demaille@gostai.com>
2943
2944 variables: use `parse.assert' instead of `assert'.
2945 * TODO (assert): Remove.
2946 * data/bison.m4 (b4_assert_if): Replace with...
2947 (b4_parse_assert_if): this.
2948 * data/lalr1.cc, data/variant.hh, tests/c++.at: Adjust.
2949 * doc/bison.texinfo (Decl Summary): Document parse.assert.
2950
29512009-04-14 Akim Demaille <demaille@gostai.com>
2952
2953 variables: use `parse.trace' instead of `debug'.
2954 * src/getargs.c (getargs): Map -t to %define trace.parse.
2955 * src/scan-gram.l (%debug): Map to %define trace.parse.
2956 * data/bison.m4 (b4_percent_define_if_define): Map `.' in variable
2957 names to `_' in macro names.
2958 (b4_debug_if): Replace with...
2959 (b4_parse_trace_if): this.
2960 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
2961 * data/yacc.c: Adjust.
2962 * doc/bison.texinfo (Decl Summary): Document %debug as obsoleted.
2963 Use @code to label the variable list.
2964 Document the variable parse.trace.
2965 (Tracing): Promote the parse.trace variable.
2966 * TODO: %printer is not documented.
2967
29682009-04-14 Akim Demaille <demaille@gostai.com>
2969
2970 doc: minor fixes.
2971 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
2972 (Table of Symbols): Remove duplicate entry for %debug.
2973
29742009-04-10 Eric Blake <ebb9@byu.net>
2975
2976 submodules: update to latest
2977 * submodules/autoconf: Use latest upstream Autoconf.
2978
29792009-04-06 Eric Blake <ebb9@byu.net>
2980
2981 Work around autoconf 2.63b bug in testsuite.
2982 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
2983 autoconf bug related to # in test.
2984
29852009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2986
2987 * NEWS (2.5): New section. Describe new -D/--define feature.
2988
29892009-04-06 Akim Demaille <demaille@gostai.com>
2990
2991 Regen.
2992 * src/parse-gram.h, src/parse-gram.c: Regen.
2993
29942009-04-06 Akim Demaille <demaille@gostai.com>
2995
2996 rename muscle_tab.* as muscle-tab.* for consistency.
2997 * src/muscle_tab.h, src/muscle_tab.c: Rename as...
2998 * src/muscle-tab.h, src/muscle-tab.c: these.
2999 * src/getargs.c, src/local.mk, src/main.c, src/output.c,
3000 * src/parse-gram.y, src/reader.c, src/scan-code.l: Adjust.
3001
30022009-04-06 Akim Demaille <demaille@gostai.com>
3003
3004 Makefile: introduce $(BISON).
3005 * src/local.mk (BISON): New.
3006 (YACC): Use it.
3007
30082009-04-06 Akim Demaille <demaille@gostai.com>
3009
3010 parser: handle %locations as %define locations.
3011 * src/getargs.h, src/getargs.c (locations_flag): Remove.
3012 * src/getargs.c, src/scan-code.l: Use muscle_percent_define_ensure
3013 to set "locations" to true.
3014 * src/output.c (prepare): Don't output "locations".
3015 * src/scan-gram.l (%locations): Handle it as a %<flag>.
3016 * src/parse-gram.y: It's no longer a token.
3017 Don't handle it.
3018 * data/bison.m4 (b4_locations_if): Define it with
3019 b4_percent_define_if_define.
3020 * data/c.m4, data/glr.cc: Adjust.
3021
30222009-04-06 Akim Demaille <demaille@gostai.com>
3023
3024 Regen.
3025 * src/parse-gram.c: Regen.
3026
30272009-04-06 Akim Demaille <demaille@gostai.com>
3028
3029 muscle: factor the handling of obsolete of obsolete directives.
3030 Suggested by Joel E. Denny.
3031
3032 * src/muscle_tab.h, src/muscle_tab.c (muscle_percent_define_ensure):
3033 New, extracted from...
3034 * src/parse-gram.y (prologue_declaration: pure-parser): here.
3035 Remove it.
3036 (prologue_declaration: "%<flag>"): Use
3037 muscle_percent_define_ensure.
3038 (%error-verbose, %pure-parser): No longer tokens.
3039 * src/scan-gram.l (pure-parser): Return as a %<flag>.
3040
30412009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
3042
3043 Fix options documentation.
3044 * build-aux/cross-options.pl: As in --help output, write optional
3045 arguments as [=ARG] not =[ARG].
3046 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
3047
30482009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
3049
3050 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
3051 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
3052 requirements for a correct m4 are stricter.
3053 * m4/m4.m4: Make it a symbolic link to submodules/autoconf/m4/m4.m4.
3054 * configure.ac: Update to use AC_PROG_GNU_M4.
3055 Reported by Eric Blake.
3056
30572009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
3058
3059 Help with updating web manual.
3060 * HACKING: Incorporate instructions from gnulib/doc/README.
3061 * bootstrap.conf (gnulib_modules): Add gendocs.
3062
30632009-04-03 Akim Demaille <demaille@gostai.com>
3064
3065 Regen.
3066 * src/parse-gram.h, src/parse-gram.c: Regen.
3067
30682009-04-03 Akim Demaille <demaille@gostai.com>
3069
3070 Factor %FLAG at scan level.
3071 * src/parse-gram.y (PERCENT_DEBUG, PERCENT_ERROR_VERBOSE): Token
3072 definitions and associated rules, replaced by....
3073 (PERCENT_FLAG): this new token type, and rule.
3074 * src/scan-gram.l (RETURN_PERCENT_FLAG): New.
3075 Use it for %debug and %error-verbose.
3076
30772009-04-03 Akim Demaille <demaille@gostai.com>
3078
3079 Regen.
3080 * src/parse-gram.h, src/parse-gram.c: Regen.
3081
30822009-04-03 Akim Demaille <demaille@gostai.com>
3083
3084 Treat %debug as %define debug.
3085 * data/bison.m4 (b4_debug_if): New.
3086 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c,
3087 * data/lalr1.java: Use it instead of b4_debug_flag.
3088 * src/getargs.h, src/getargs.c (debug_flag): Remove.
3089 * src/output.c (prepare): Don't output it.
3090 * src/parse-gram.y: Treat %debug as %define debug.
3091
30922009-04-03 Akim Demaille <demaille@gostai.com>
3093
3094 Treat %error-verbose as %define error_verbose.
3095 This allows to pass -Derror_verbose on the command line. Better
3096 yet, it allows to pass -Derror_verbose=$(ERROR_VERBOSE), with
3097 ERROR_VERBOSE being defined as false or true.
3098 * data/bison.m4 (b4_percent_define_if_define): Instead of relying
3099 on b4_percent_define_ifdef, for does not check the defined value,
3100 but only whether the symbol is defined, rely on
3101 b4_percent_define_flag_if, so that a value of "false" is processed
3102 as a false.
3103 If not defined, define the flag to "false".
3104 (b4_error_verbose_if): New.
3105 * data/glr.c, data/lalr1.cc, data/yacc.c: Use it instead of
3106 b4_error_verbose_flag.
3107 * src/getargs.h, src/getargs.c (error_verbose_flag): Remove.
3108 * src/output.c (prepare): Don't output it.
3109 * src/parse-gram.y (%error-verbose): Treat as %define error_verbose.
3110
31112009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
3112
3113 Fix strange %define locations for default values.
3114 Reported by Akim Demaille at
3115 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
3116 and discussed again starting at
3117 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
3118 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
3119 because location information is bogus.
3120 Use angle brackets to delimit fake file name because square brackets
3121 look like underexpanded m4. Choose a better fake file name.
3122 Use negative line numbers.
3123 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
3124 * src/location.c (location_print): If line for a boundary is negative,
3125 only print that boundary's file name.
3126 * src/location.h: Document that.
3127 * tests/skeletons.at (%define Boolean variables: invalid skeleton
3128 defaults): Update output.
3129
31302009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
3131
3132 Pacify ./configure --enable-gcc-warnings.
3133 * Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS) because many files
3134 in lib won't compile with it.
3135 * src/local.mk (src_bison_CFLAGS): Use $(WERROR_CFLAGS) here only.
3136
31372009-03-31 Akim Demaille <demaille@gostai.com>
3138
3139 bootstrap: --help to stdout.
3140 * bootstrap (usage): Don't send --help to stderr.
3141 Use a here doc instead of a long string.
3142
31432009-03-31 Akim Demaille <demaille@gostai.com>
3144
3145 bootstrap: README-hacking no longer exists
3146 * bootstrap (checkout_only_file): Set to HACKING.
3147
31482009-03-26 Akim Demaille <demaille@gostai.com>
3149
3150 doc: merge HACKING and README-hacking.
3151 Two files is confusing.
3152 Reported by Alexandre Duret-Lutz.
3153
3154 * README-hacking: Merge into...
3155 * HACKING (Working from the repository): here.
3156
31572009-03-26 Akim Demaille <demaille@gostai.com>
3158
3159 doc: update README-hacking.
3160 * README-hacking: We now use git and git submodules.
3161 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
3162
31632009-03-26 Akim Demaille <demaille@gostai.com>
3164
3165 lalr1.cc: avoid GCC 4.3 warnings.
3166 GCC 4.3 now warns about "a || b && c" and asks for explicit
3167 parentheses.
3168 Reported by Alexandre Duret-Lutz.
3169 * data/location.cc: Update copyright years.
3170 (Position::operator==): Use parens to make precedence explicit.
3171 Compare lines and columns first, as they are more likely to be
3172 different, and they are faster to compare.
3173
31742009-03-26 Akim Demaille <demaille@gostai.com>
3175
3176 gnulib: update.
3177 * gnulib: Update to latest.
3178 * src/local.mk (AM_CFLAGS): Move to...
3179 * Makefile.am: here.
3180 * etc/prefix-gnulib-mk (prefix_assignment): Also transform
3181 AM_CFLAGS.
3182
31832009-03-02 Akim Demaille <demaille@gostai.com>
3184
3185 Comment changes.
3186
31872009-03-02 Akim Demaille <demaille@gostai.com>
3188
3189 Share b4_yytranslate_define.
3190 * data/lalr1.cc (b4_yytranslate_define): Move to...
3191 * data/c++.m4: here.
3192
31932009-03-02 Akim Demaille <demaille@gostai.com>
3194
3195 Use locations in the variant example.
3196 Yes, this obfuscates the point of this example, variants only.
3197 But glr.cc cannot work (yet?) without locations. This change
3198 makes it easier to use this example with glr.cc.
3199
3200 * examples/variant.yy (assert): %define it.
3201 (locations): Request them.
3202 (yylex): Bind the location to the stage.
3203
32042009-03-02 Akim Demaille <demaille@gostai.com>
3205
3206 Dub make_TOKEN as a public type interface.
3207 * data/c++.m4 (b4_symbol_constructor_declare)
3208 (b4_symbol_constructor_define): New empty stubs.
3209 (b4_public_types_declare, b4_public_types_define): Use them.
3210 * data/lalr1.cc (b4_symbol_constructor_declare)
3211 (b4_symbol_constructor_declare_)
3212 (b4_symbol_constructor_define_, b4_symbol_constructor_define):
3213 Move to...
3214 * data/variant.hh: here.
3215 Remove the "b4_variant_if" parts, as variant.hh is loaded only if
3216 needed.
3217 * data/lalr1.cc: No longer invoke b4_symbol_constructor_define and
3218 b4_symbol_constructor_declare, as it is now done by
3219 b4_public_types_define and b4_public_types_declare.
3220
32212009-03-02 Akim Demaille <demaille@gostai.com>
3222
3223 Coding style changes.
3224 * data/lalr1.cc (b4_symbol_constructor_declaration_)
3225 (b4_symbol_constructor_declarations)
3226 (b4_symbol_constructor_definition_)
3227 (b4_symbol_constructor_definitions)
3228 (b4_yytranslate_definition): Rename as...
3229 (b4_symbol_constructor_declare_)
3230 (b4_symbol_constructor_declare)
3231 (b4_symbol_constructor_define_)
3232 (b4_symbol_constructor_define)
3233 (b4_yytranslate_define): these.
3234 * data/variant.hh (b4_variant_definition): Rename as...
3235 (b4_variant_define): this.
3236
32372009-03-02 Akim Demaille <demaille@gostai.com>
3238
3239 Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if.
3240 * data/bison.m4 (b4_percent_define_if_define): New.
3241 * data/c++.m4 (b4_variant_if): Move to...
3242 * data/bison.m4: Here, using b4_percent_define_if_define.
3243 * data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to...
3244 * data/bison.m4: Here, using b4_percent_define_if_define.
3245
32462009-03-02 Akim Demaille <demaille@gostai.com>
3247
3248 Dub symbol_type_base as a public type.
3249 * data/c++.m4 (b4_public_types_declare): Now define
3250 symbol_type_base and symbol_type.
3251 (b4_public_types_define): New.
3252 In both cases, the definitions are taken verbatim from lalr1.cc.
3253 * data/lalr1.cc: Adjust.
3254
32552009-03-02 Akim Demaille <demaille@gostai.com>
3256
3257 b4_public_types_declare.
3258 * data/c++.m4 (b4_public_types_declare): New.
3259 * data/glr.cc, data/lalr1.cc: Use it.
3260
32612009-03-02 Akim Demaille <demaille@gostai.com>
3262
3263 b4_semantic_type_declare.
3264 * data/c++.m4 (b4_semantic_type_declare): New.
3265 Factors and generalizes what was in glr.cc and lalr1.cc.
3266 * data/variant.hh (b4_semantic_type_declare): Redefine it for
3267 variants.
3268 * data/lalr1.cc, data/glr.cc: Use it.
3269
32702009-02-26 Akim Demaille <demaille@gostai.com>
3271
3272 Upgrade gnulib.
3273 * gnulib: Upgrade from master.
3274 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore:
3275 Regen.
3276
32772009-02-25 Akim Demaille <demaille@gostai.com>
3278
3279 Remove useless arguments.
3280 * data/glr.c (yy_reduce_print): $$ and @$ are not used and not
3281 relevant.
3282
32832009-02-25 Akim Demaille <demaille@gostai.com>
3284
3285 Comment changes.
3286 * data/lalr1.cc: here.
3287
32882009-02-25 Akim Demaille <demaille@gostai.com>
3289
3290 Fix glr.cc's debug level handling.
3291 * data/glr.cc (yydebug_): Remove, as it is actually yydebug from
3292 glr.c which is used.
3293 (debug_level, set_debug_level): Adjust.
3294
32952009-02-25 Akim Demaille <demaille@gostai.com>
3296
3297 Copyright years.
3298 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
3299
33002009-02-25 Akim Demaille <demaille@gostai.com>
3301
3302 Style changes.
3303 * etc/bench.pl.in (generate_grammar_list): Consitently use
3304 location_type, not yy::location.
3305
33062009-02-25 Akim Demaille <demaille@gostai.com>
3307
3308 Comment change.
3309 * data/lalr1.cc: here.
3310
33112009-02-19 Akim Demaille <demaille@gostai.com>
3312
3313 Make yyparser::error public.
3314 * data/lalr1.cc: here.
3315 There is no good reason to keep it private (and it is convenient
3316 to use it from the scanner for instance). It is already public in
3317 glr.cc.
3318
33192009-02-19 Akim Demaille <demaille@gostai.com>
3320
3321 Comment changes.
3322 * data/glr.cc: here.
3323
33242009-02-19 Akim Demaille <demaille@gostai.com>
3325
3326 Remove trailing blanks.
3327 The epilogue has its own ending \n, no need to add another.
3328
3329 * data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the
3330 epilogue.
3331 * data/glr.cc: dnl when extending the epilogue.
3332 Remove stray "private:".
3333
33342009-02-19 Akim Demaille <demaille@gostai.com>
3335
3336 Use b4_c_modern.
3337 * data/c.m4 (b4_c_function_decl): Here.
3338
33392009-02-19 Akim Demaille <demaille@gostai.com>
3340
3341 Comment changes.
3342 * data/lalr1.cc: here.
3343
33442009-02-19 Akim Demaille <demaille@gostai.com>
3345
3346 Extract variant.hh
3347 * data/variant.hh: New, extracted from...
3348 * data/lalr1.cc: here.
3349 Adjust.
3350 * data/local.mk: Adjust.
3351
33522009-02-19 Akim Demaille <demaille@gostai.com>
3353
3354 Extract stack.hh from lalr1.cc.
3355 * data/stack.hh: New.
3356 * data/lalr1.cc: Extract from here.
3357 * data/local.mk: Adjust.
3358
33592009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
3360
3361 Add reminder about uploading public key to keys.gnupg.net.
3362 * HACKING (Release Procedure): Here.
3363
33642009-01-28 Akim Demaille <demaille@gostai.com>
3365
3366 * NEWS: Update information about 2.4.1 and 2.4.2.
3367
33682008-11-04 Akim Demaille <demaille@gostai.com>
3369
3370 Reformat NEWS.
3371 * NEWS: Use more outline-mode markup.
3372 Suggested by Jim Meyering.
3373
33742009-01-08 Akim Demaille <demaille@gostai.com>
3375
3376 Fix grep portability issues.
3377 Grep on Solaris does not support -q.
3378 Reported by Summum Bonum.
3379
3380 * NEWS: Add a stub for 2.4.2.
3381 * THANKS: Add Summum Bonum.
3382 * tests/atlocal.in (EGREP): New.
3383 (CC, CXX, XSLTPROC): Make it possible to override them via
3384 envvars.
3385 * tests/java.at: Use $EGREP instead of egrep.
3386 Use AT_CHECK's ignore instead of grep's -q.
3387
33882008-12-11 Akim Demaille <demaille@gostai.com>
3389
3390 Pass the token type to yysyntax_error.
3391 * data/yacc.c (yysyntax_error): Take the transated token instead
3392 of the raw number.
3393 Adjust callers.
3394 * TODO: Update.
3395
33962008-12-11 Akim Demaille <demaille@gostai.com>
3397
3398 Formatting changes.
3399 * data/glr.c: Formatting changes.
3400
34012008-12-11 Akim Demaille <demaille@gostai.com>
3402
3403 Propagate i18n changes into glr.c.
3404 * TODO: Update.
3405 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
3406 building the error message format dynamically.
3407 * data/lalr1.java: Formatting changes.
3408
34092008-12-11 Akim Demaille <demaille@gostai.com>
3410
3411 Use testsuite -C.
3412 * tests/local.mk: Replace "cd && testsuite" by "testsuite -C".
3413 Solves problems when top_srcdir is an absolute path.
3414 Suggested by Eric Blake.
3415 * configure.ac: Require Autoconf 2.62.
3416
34172008-12-11 Akim Demaille <demaille@gostai.com>
3418
3419 Simplify the i18n of the error messages.
3420 * data/lalr1.cc: Comment changes.
3421 * data/yacc.c (yysyntax_error): Rewrite, using a switch as in
3422 lalr1.cc instead of building dynamically the format string.
3423
34242008-12-08 Akim Demaille <demaille@gostai.com>
3425
3426 Fix portability issue in the test suite.
3427 * tests/local.at (AT_MATCHES_CHECK): New.
3428 Based on Perl instead of Sed. Sed has too many portability
3429 pitfalls, not ever Sed is GNU Sed.
3430 * tests/actions.at (Fix user actions without a trailing semicolon):
3431 Use it.
3432
34332008-12-08 Akim Demaille <demaille@gostai.com>
3434
3435 Update data/README.
3436 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
3437
34382008-12-08 Akim Demaille <demaille@gostai.com>
3439
3440 Install autoconf as a submodule to get m4sugar.
3441 * .gitmodules: Add submodules/autoconf.
3442 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
3443 submodules/autoconf.
3444
34452008-12-08 Akim Demaille <demaille@gostai.com>
3446
3447 Test token.prefix in all the skeletons.
3448 * data/java.m4 (b4_token_enum): Use the token.prefix.
3449 * tests/local.at (AT_BISON_OPTION_PUSHDEFS): Define AT_TOKEN_PREFIX.
3450 * tests/calc.at (_AT_DATA_CALC_Y): Use it.
3451 Add checks for yacc.c, glr.c, lalr1.cc and glr.cc.
3452 * tests/java.at: Comment changes.
3453 (AT_CHECK_JAVA_MINIMAL): Define the END token.
3454 (Java parser class and package names): Add token.prefix check.
3455
34562008-12-08 Akim Demaille <demaille@gostai.com>
3457
3458 Fix regeneration of atconfig.
3459 * tests/local.mk (tests/atconfig): The rule was incorrect, but
3460 remove it: now that there is no tests/Makefile.am, the top-level
3461 Makefile properly updates atconfig when needed.
3462
34632008-12-07 Di-an Jan <dianj@freeshell.org>
3464
3465 Implement the FIXME that ends an user action with a semicolon
3466 if it seems necessary.
3467 * src/scan-code.l (flex rules section): Flag cpp directive from
3468 any `#' to the first unescaped end-of-line. Semicolon is not
3469 needed after `;', `{', '}', or cpp directives and is needed after
3470 any other token (whitespaces and comments have no effect).
3471 * tests/actions.at (Fix user actions without a trailing semicolon):
3472 New test.
3473 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
3474 to make user actions complete statements.
3475 Adjust column numbers in error messages.
3476 * tests/regression.at (Fix user actions without a trailing semicolon):
3477 Remove. Covered by new test.
3478
34792008-12-07 Akim Demaille <demaille@gostai.com>
3480
3481 Update gnulib.
3482 * gnulib: Update from master.
3483
34842008-12-05 Eric Blake <ebb9@byu.net>
3485
3486 Avoid compiler warning.
3487 * src/output.c (muscle_insert_item_number_table): Delete unused
3488 function.
3489
34902008-12-02 Eric Blake <ebb9@byu.net>
3491
3492 Build testsuite with newer autoconf.
3493 * tests/output.at (m4_expand): Don't override in newer autoconf,
3494 where the underlying implementation changed.
3495 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
3496 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
3497 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
3498 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
3499 since some of them contain unbalanced ')'.
3500
35012008-12-01 Akim Demaille <demaille@gostai.com>
3502
3503 Use b4_symbol for printers and destructors everywhere.
3504 * data/bison.m4 (b4_symbol_action_location): New.
3505 * data/c.m4 (b4_symbol_actions): Remove.
3506 Adjust all callers to use by b4_symbol_foreach and the corresponding
3507 b4_symbol_printer/destructor macro.
3508 * data/glr.cc: Adjust.
3509 * data/lalr1.java: Adjust the %destructor sanity check.
3510 * src/output.c (symbol_code_props_output): Remove, we no longer
3511 need the b4_symbol_printers/destructors tables.
3512
35132008-12-01 Akim Demaille <demaille@gostai.com>
3514
3515 Use b4_symbol_case_.
3516 * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use
3517 b4_symbol_case_.
3518
35192008-12-01 Akim Demaille <demaille@gostai.com>
3520
3521 Move b4_symbol based macro to bison.m4.
3522 * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if)
3523 (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer)
3524 (b4_symbol_case_, b4_symbol_foreach, b4_type_action_)
3525 (b4_type_foreach): Move to...
3526 * data/bison.m4: Here.
3527 * data/lalr1.cc (b4_symbol_action): Specialize for C++: use
3528 b4_symbol_value_template instead of b4_symbol_value.
3529
35302008-12-01 Akim Demaille <demaille@gostai.com>
3531
3532 b4_symbol/type_foreach.
3533 * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New.
3534 Use them.
3535
35362008-12-01 Akim Demaille <demaille@gostai.com>
3537
3538 Use the symbol properties to output the printer/destructor for lalr1.cc.
3539 Instead of defining complex list of tuples to define various
3540 properties of the symbols, we now prefer to define symbols as
3541 "structs" in m4: using the symbol key (its number), and the
3542 property name, b4_symbol gives it value. Use this to handle
3543 destructors and printers.
3544
3545 * src/output.c (CODE_PROP): New.
3546 (prepare_symbol_definitions): Use it to define the printer and
3547 destructor related attributes of the symbols.
3548 * data/lalr1.cc (b4_symbol_actions): Rename as...
3549 (b4_symbol_action): this.
3550 Use b4_symbol instead of 6 arguments.
3551 (b4_symbol_printer, b4_symbol_destructor): New.
3552 Use them instead of b4_symbol_actions.
3553
35542008-12-01 Akim Demaille <demaille@gostai.com>
3555
3556 Avoid capturing variables too easily.
3557 * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use
3558 v__ and p__ instead of v and p.
3559
35602008-12-01 Akim Demaille <demaille@gostai.com>
3561
3562 Remove spurious empty line before syncline.
3563 * data/bison.m4 (b4_syncline): Don't output an empty line before
3564 the output.
3565
35662008-11-26 Akim Demaille <demaille@gostai.com>
3567
3568 Convert lib/Makefile.am into lib/local.mk.
3569 The real problem is rather gnulib.mk, which itself is extracted
3570 from a Makefile.am that gnulib expects to the "recursive". The
3571 tool prefix-gnulib-mk converts such a gnulib.mk to be
3572 non-recursive. Also, some AC_SUBST variables need to be adjusted.
3573
3574 * etc/prefix-gnulib-mk: New.
3575 * bootstrap (slurp): Use it to convert further gnulib.mk.
3576 No longer try to avoid re-creation of lib/gnulib.mk as the changes
3577 are deeper.
3578 * lib/Makefile.am: Rename as...
3579 * lib/local.mk: this.
3580 Adjust to be prefixed.
3581 * Makefile.am, configure.ac: Adjust.
3582 * src/local.mk (AM_CPPFLAGS): Extend it, don't define it.
3583
35842008-11-26 Akim Demaille <demaille@gostai.com>
3585
3586 s/_FLAGS/FLAGS/.
3587 * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as...
3588 (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS.
3589 Reported by Eric Blake.
3590
35912008-11-26 Akim Demaille <demaille@gostai.com>
3592
3593 Use b4_parser_tables_define in glr.cc.
3594 * data/glr.c: Use b4_parser_tables_define instead of defining the
3595 (deterministic integral) tables by hand.
3596
35972008-11-26 Akim Demaille <demaille@gostai.com>
3598
3599 Use b4_parser_tables_define in Java.
3600 * data/java.m4 (b4_typed_parser_table): Rename as...
3601 (b4_typed_parser_table_define): this, for consistency.
3602 Accept a comment as $4.
3603 Move $2 into yy*_.
3604 (b4_integral_parser_table): Rename as...
3605 (b4_integral_parser_table_define): this.
3606 * data/lalr1.java: Adjust all uses.
3607 Use b4_parser_tables_define instead of generation by hand.
3608
36092008-11-26 Akim Demaille <demaille@gostai.com>
3610
3611 Prepare the convergence bw C style and Java table generation.
3612 * data/bison.m4 (b4_tables_map, b4_tables_declare)
3613 (b4_tables_define): Rename as...
3614 (b4_integral_parser_tables_map, b4_parser_tables_declare)
3615 (b4_parser_tables_define): these.
3616 * data/c.m4 (b4_table_define): Rename as...
3617 (b4_integral_parser_table_define): this.
3618 * data/lalr1.cc: Adjust.
3619 (b4_table_define, b4_table_declare): Rename as...
3620 (b4_integral_parser_table_define)
3621 (b4_integral_parser_table_declare): these.
3622 (yyrline_): Move the comment where it is actually used.
3623 * data/yacc.c: Adjust.
3624 (yyrline): Use b4_integral_parser_table_define.
3625
36262008-11-26 Akim Demaille <demaille@gostai.com>
3627
3628 Regen.
3629 * src/parse-gram.h, src/parse-gram.c: Regen.
3630
36312008-11-26 Akim Demaille <demaille@gostai.com>
3632
3633 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
3634 * data/lalr1.cc (b4_tables_map): Move to...
3635 * data/bison.m4: here.
3636 Update the comment for yytable during the flight.
3637 (b4_tables_declare, b4_tables_define): New.
3638 * data/lalr1.cc: Use them.
3639 * data/c.m4 (b4_table_define): New.
3640 * data/yacc.c: Use b4_tables_define instead of output the tables
3641 by hand.
3642 * tests/regression.at (Web2c Actions): Adjust the expected output,
3643 the order of the tables changed.
3644
36452008-11-26 Akim Demaille <demaille@gostai.com>
3646
3647 Get rid of (yy)rhs and (yy)prhs.
3648 These tables are no longer needed in the parsers, and they don't seem to
3649 be useful. They are not documented either.
3650
3651 * src/output.c (prepare_rules): Get rid of rhs and prhs.
3652 Adjust the computation of (yy)r2.
3653
36542008-11-26 Akim Demaille <demaille@gostai.com>
3655
3656 Rule length is unsigned.
3657 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
3658
36592008-11-26 Akim Demaille <demaille@gostai.com>
3660
3661 Get rid of lalr1-split.cc.
3662 It was no longer maintainer.
3663
3664 * data/lalr1-split.cc: Remove.
3665 * etc/bench.pl.in (bench_fusion_parser): Remove.
3666 Adjust.
3667
36682008-11-26 Akim Demaille <demaille@gostai.com>
3669
3670 Use yy* consistently.
3671 * data/glr.c: Now that yyrhs no longer exists as a global
3672 variable, rename local "rhs" variables into "yyrhs" for
3673 consistency.
3674
36752008-11-25 Akim Demaille <demaille@gostai.com>
3676
3677 Get rid of yyrhs and yyprhs in glr.c.
3678 * data/glr.c (yyrhs, yyprhs): Remove.
3679 Instead, use the state stack and yystos.
3680
36812008-11-25 Akim Demaille <demaille@gostai.com>
3682
3683 Flag glr tests.
3684 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
3685 as an Autotest keyword.
3686
36872008-11-25 Akim Demaille <demaille@gostai.com>
3688
3689 Prefer TESTSUITE_FLAGS.
3690 TESTSUITEFLAGS is barely readable.
3691
3692 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
3693 for backward compatibility.
3694 Use the former instead of the latter.
3695
36962008-11-25 Akim Demaille <demaille@gostai.com>
3697
3698 Get rid of yyrhs and yyprhs in larl1.java.
3699 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
3700 (yy_reduce_print): Rather, use yystos_ and the state stack.
3701
37022008-11-25 Akim Demaille <demaille@gostai.com>
3703
3704 Formatting changes.
3705
37062008-11-25 Akim Demaille <demaille@gostai.com>
3707
3708 Get rid of yyrhs and yyprhs in yacc.c.
3709 They were used to get the symbol types, given a rule number, when
3710 displaying the top of the stack before a reduction. But the
3711 symbol type is available from the state stack. This has two be
3712 benefits: two tables less in the parser (making it smaller), and a
3713 more consistent use of the three stacks which will help to fuse
3714 them.
3715
3716 * data/yacc.c (yyprhs, yyrhs): Remove.
3717 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
3718 (yy_reduce_print): Take yyssp as argument.
3719 Use it, together with yystos, to get the symbol type.
3720 * tests/regression.at (Web2c Report): Remove these tables from the
3721 expected output.
3722
37232008-11-25 Akim Demaille <demaille@gostai.com>
3724
3725 b4_tables_map.
3726 The point is to factor the generation of the tables across skeletons.
3727 This is language dependant.
3728
3729 * data/c.m4 (b4_comment_): New.
3730 Should be usable to define how to generate tables independently of
3731 the language.
3732 (b4_c_comment): New.
3733 (b4_comment): Bounce to b4_c_comment.
3734 Now support $2 = [PREFIX] for indentation.
3735 * data/lalr1.cc (b4_table_declare): Don't output a comment if
3736 there is no comment.
3737 Indent it properly when there is one.
3738 Output the ending semicolon.
3739 (b4_table_define): Space changes.
3740 Output the ending semicolon.
3741 (b4_tables_map): New.
3742 Use it twice instead of declaring and defining the (integral)
3743 tables by hand.
3744
37452008-11-25 Akim Demaille <demaille@gostai.com>
3746
3747 b4_table_declare.
3748 * data/lalr1.cc (b4_table_declare): New.
3749 Use it to declare the tables defined with b4_table_define.
3750 (b4_table_define): Declare a third arg to match b4_table_declare
3751 signature.
3752 Move all the comments around invocations of b4_table_define into
3753 the invocations itselves.
3754 Move things around to have the order for declarations and
3755 definitions.
3756
37572008-11-25 Akim Demaille <demaille@gostai.com>
3758
3759 Formatting changes.
3760 * data/lalr1.java: here.
3761
37622008-11-25 Akim Demaille <demaille@gostai.com>
3763
3764 b4_args is more general than only C++.
3765 * data/lalr1.cc (b4_args, _b4_args): Move to...
3766 * data/bison.m4: here.
3767
37682008-11-21 Di-an Jan <dianj@freeshell.org>
3769
3770 Implement no-XXX arguments for --warnings, --report, --trace.
3771 * src/getargs.c (flags_argmatch): Handles no-XXX.
3772 Fix typo in doxygen comment.
3773
37742008-11-21 Akim Demaille <demaille@gostai.com>
3775
3776 Display the changes in cross-options.texi.
3777 * build-aux/cross-options.pl ($sep): New, to separate items.
3778 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
3779 changes.
3780
37812008-11-20 Di-an Jan <dianj@freeshell.org>
3782
3783 Improves options in the manual.
3784 * doc/bison.texinfo (-g, -x): Add space before argument.
3785 (Option Cross Key): Implement FIXME: listing directives also.
3786 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
3787 (Short Option): Special case -d. Put arguments inside @option.
3788 (Bison Directive): Add column, automatically extracted from
3789 src/scan-gram.l (actual name passed as the first argument)
3790 with special case for %define.
3791 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
3792 to build-aux/cross-options.pl.
3793 * src/getargs.c (usage): Document limitations of cross-options.pl.
3794 * src/scan-gram.l: Likewise.
3795
37962008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
3797
3798 Fix unexpanded macros in GLR defines file.
3799 Reported by Csaba Raduly at
3800 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
3801 * THANKS (Csaba Raduly): Add.
3802 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
3803 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
3804 lexer in a separate module that includes the defines file.
3805 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
3806 source.
3807 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
3808 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
3809 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
3810 (AT_DATA_SOURCE_PROLOGUE): New.
3811 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
3812 (AT_DATA_SOURCE): New.
3813 (AT_FULL_COMPILE): Extend to support an additional source file.
3814
38152008-11-18 Akim Demaille <demaille@gostai.com>
3816
3817 More TODO.
3818 * TODO: More short term issues.
3819
38202008-11-18 Akim Demaille <demaille@gostai.com>
3821
3822 Regen.
3823 * src/parse-gram.h, src/parse-gram.c: Regen.
3824
38252008-11-18 Akim Demaille <demaille@gostai.com>
3826
3827 Use b4_subtract where possible.
3828 * data/lalr1.cc (b4_subtract): Move to...
3829 * data/bison.m4: here.
3830 * data/glr.c (b4_rhs_data): Use it.
3831 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
3832
38332008-11-18 Akim Demaille <demaille@gostai.com>
3834
3835 Remove incorrect mode specification.
3836 * data/glr.cc: Don't pretend it's C code.
3837
38382008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
3839
3840 Simplify last patch slightly.
3841 * src/getargs.c (getargs): Here.
3842
38432008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
3844
3845 Fix last warning from --enable-gcc-warnings.
3846 * src/getargs.c (getargs): Don't assign const address to non-const
3847 pointer.
3848
38492008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
3850
3851 Don't let maintainer-*-check targets force a version update.
3852 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
3853 handled.
3854
38552008-11-17 Di-an Jan <dianj@freeshell.org>
3856
3857 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
3858 Align menus. Adjust word wrapping. Use node names for menu names.
3859 (Examples): Don't abbreviate node names.
3860 (LocalWords): Remove abbreviations.
3861 (Copying): Make description a sentence.
3862 (Java Action Features): Remove period to match the rest of menu.
3863
38642008-11-17 Di-an Jan <dianj@freeshell.org>
3865
3866 Handles several --enable-gcc-warnings.
3867 * src/getargs.c (command_line_location): Set parameters to void.
3868 * src/output.c (symbol_type_name_cmp): Make static.
3869 (symbols_by_type_name): Set parameters to void.
3870 (symbol_definitions_output): Remove unused parameter. Rename as...
3871 (prepare_symbol_definitions): this.
3872 (muscles_output): Move symbol_definitions_output to...
3873 (output): here as prepare_symbol_definitions.
3874 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
3875 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
3876
38772008-11-17 Di-an Jan <dianj@freeshell.org>
3878
3879 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
3880 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
3881
38822008-11-16 Akim Demaille <demaille@gostai.com>
3883
3884 Add missing $(EXEEXT).
3885 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
3886 "src/bison$(EXEEXT)".
3887 Reported by Di-an Jan.
3888
38892008-11-15 Akim Demaille <demaille@gostai.com>
3890
3891 * TODO: Update.
3892
38932008-11-15 Akim Demaille <demaille@gostai.com>
3894
3895 Formatting changes.
3896 * tests/input.at: here.
3897
38982008-11-15 Akim Demaille <demaille@gostai.com>
3899
3900 Remove duplicate header inclusion.
3901 * src/LR0.c: here.
3902
39032008-11-15 Akim Demaille <demaille@gostai.com>
3904
3905 * src/parse-gram.h, src/parse-gram.c: Regen.
3906
39072008-11-15 Akim Demaille <demaille@gostai.com>
3908
3909 Support parametric types.
3910
3911 There are two issues to handle: first scanning nested angle
3912 bracket pairs to support types such as std::pair< std::string,
3913 std::list<std::string> > >.
3914
3915 Another issue is to address idiosyncracies of C++: do not glue two
3916 closing angle brackets together (otherwise it's operator>>), and
3917 avoid sticking blindly a TYPE to the opening <, as it can result
3918 in '<:' which is a digraph for '['.
3919
3920 * src/scan-gram.l (brace_level): Rename as...
3921 (nesting): this.
3922 (SC_TAG): New.
3923 Implement support for complex tags.
3924 (tag): Accept
3925 , but not <.
3926 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
3927 (b4_symbol_variant): Leave space around types as parameters.
3928 * examples/variant.yy: Use nested template types and leading ::.
3929 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
3930 Rename as...
3931 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
3932 * tests/c++.at: Test parametric types.
3933
39342008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3935
3936 Test token.prefix.
3937 This is not sufficient, but we test at least that the make_SYMBOL
3938 interface is not affected by token.prefix. A more general test
3939 will be implemented when the support of token.prefix is generalized
3940 to more skeletons.
3941
3942 * tests/c++.at: One more variant test, using token.prefix.
3943
39442008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3945
3946 Test the make_TOKEN interface.
3947 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
3948 Factor the common code in yylex.
3949 Use it to test "%define lex_symbol".
3950
39512008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3952
3953 Formatting change.
3954
39552008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3956
3957 Simplify code for variants bench marks.
3958 * etc/bench.pl.in (&generate_grammar_list): Define and use
3959 location_type.
3960 Factor the common code in yylex.
3961
39622008-11-15 Akim Demaille <demaille@gostai.com>
3963
3964 Better error message.
3965 * bootstrap (find_tool): Fix the error message.
3966
39672008-11-15 Akim Demaille <demaille@gostai.com>
3968
3969 Update variant.yy to newest interface.
3970 * examples/variant.yy: Define lex_symbol.
3971 Adjust.
3972
39732008-11-15 Akim Demaille <demaille@gostai.com>
3974
3975 Don't use locations in variant.yy.
3976 * examples/variant.yy: Adjust to not using locations.
3977
39782008-11-15 Akim Demaille <demaille@gostai.com>
3979
3980 Comment changes.
3981 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
3982 comments for the license.
3983
39842008-11-15 Akim Demaille <demaille@gostai.com>
3985
3986 Remove tests/Makefile.am.
3987 * tests/Makefile.am: Rename as...
3988 * tests/local.mk: this.
3989 * Makefile.am, configure.ac: Adjust.
3990 * Makefile.am (DISTCLEANFILES): Define.
3991 (maintainer-check, maintainer-xml-check, maintainer-push-check):
3992 Remove, we no longer need to bounce to the real targets.
3993
39942008-11-15 Akim Demaille <demaille@gostai.com>
3995
3996 Comment changes.
3997
39982008-11-15 Akim Demaille <demaille@gostai.com>
3999
4000 djgpp/local.mk.
4001 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
4002 * djgpp/local.mk: this new file.
4003
40042008-11-15 Akim Demaille <demaille@gostai.com>
4005
4006 Remove doc/Makefile.am.
4007 * doc/Makefile.am: Rename as...
4008 * doc/local.mk: this.
4009 Adjust paths
4010 * Makefile.am, configure.ac: Adjust.
4011 * Makefile.am (MOSTLYCLEANFILES): New.
4012 * src/local.mk: Adjust.
4013
40142008-11-15 Akim Demaille <demaille@gostai.com>
4015
4016 Move sc_tight_scope into maint.mk.
4017 It does not work, and I don't know how it was supposed to work: it
4018 seems to be looking for sources in the build tree. I just moved
4019 it at a better place, fixing it is still required.
4020
4021 * src/local.mk (echo): Remove.
4022 (sc_tight_scope): Move to...
4023 * maint.mk: here.
4024
40252008-11-15 Akim Demaille <demaille@gostai.com>
4026
4027 Regen.
4028 * src/parse-gram.h, src/parse-gram.h: Regen.
4029
40302008-11-15 Akim Demaille <demaille@gostai.com>
4031
4032 Remove src/Makefile.am.
4033 * src/Makefile.am: Rename as...
4034 * src/local.mk: this.
4035 Prefix all the paths with src/.
4036 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
4037 (AM_CPPFLAGS): Find find in builddir/src.
4038 (YACC): Move the flags into...
4039 (AM_YFLAGS): here.
4040 * maint.mk (sc_tight_scope): Disable.
4041 It used to bounce to the version in src/Makefile.am which is now
4042 part of this very Makefile.
4043 * Makefile.am, configure.ac: Adjust.
4044 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
4045 include "..." to find files "here": we are no longer in src/, so
4046 qualify the includes with src/.
4047 * doc/Makefile.am (PREPATH): No longer include the top_builddir
4048 prefix.
4049 (.x.1): Adjust to be able to create src/foo from the top level
4050 Makefile, instead of going bounce to src/Makefile the creation of
4051 foo.
4052
40532008-11-15 Akim Demaille <demaille@gostai.com>
4054
4055 Remove useless variable.
4056 * doc/Makefile.am (srcsrcdir): Remove.
4057
40582008-11-15 Akim Demaille <demaille@gostai.com>
4059
4060 Remove data/Makefile.am.
4061 * data/Makefile.am: Rename as...
4062 * data/local.mk: this.
4063 Adjust paths.
4064 * Makefile.am, configure.ac: Adjust.
4065
40662008-11-15 Akim Demaille <demaille@gostai.com>
4067
4068 Remove etc/Makefile.am.
4069 * etc/Makefile.am: Rename as...
4070 * etc/local.mk: this.
4071 Adjust.
4072 * Makefile.am, configure.ac: Adjust.
4073
40742008-11-15 Akim Demaille <demaille@gostai.com>
4075
4076 Remove examples/local.mk.
4077 examples/calc++/Makefile.am might be interesting to keep as is, since
4078 it is an example in itself.
4079
4080 * examples/Makefile.am: Rename as...
4081 * examples/local.mk: this.
4082 Adjust.
4083 * Makefile.am, configure.ac: Adjust.
4084
40852008-11-15 Akim Demaille <demaille@gostai.com>
4086
4087 Remove build-aux/Makefile.am.
4088 Recursive Makefiles are really way too slow, let's get rid of some of
4089 them.
4090
4091 * build-aux/Makefile.am: Rename as...
4092 * build-aux/local.mk: this.
4093 Adjust paths.
4094 * Makefile.am, configure.ac: Adjust.
4095
40962008-11-15 Akim Demaille <demaille@gostai.com>
4097
4098 Provide convenience constructors for locations and positions.
4099 * data/location.cc (position::position): Accept file, line and
4100 column as arguments with default values.
4101 Always qualify initial line and column literals as unsigned.
4102 (location::location): Provide convenience constructors.
4103
41042008-11-15 Akim Demaille <demaille@gostai.com>
4105
4106 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
4107 token type.
4108 Using template buys us nothing, and makes it uselessly complex to
4109 construct a symbol. Besides, it could not be generalized to other
4110 languages, while make_FOO would work in C/Java etc.
4111
4112 * data/lalr1.cc (b4_symbol_): New.
4113 (b4_symbol): Use it.
4114 (b4_symbol_constructor_declaration_)
4115 (b4_symbol_constructor_definition_): Instead of generating
4116 specializations of an overloaded template function, just generate
4117 several functions whose names are forged from the token names
4118 without the token.prefix.
4119 (b4_symbol_constructor_declarations): Generate them for all the
4120 symbols, not just by class of symbol type, now that instead of
4121 specializing a function template by the token, we generate a
4122 function named after the token.
4123 (b4_symbol_constructor_specialization_)
4124 (b4_symbol_constructor_specializations): Remove.
4125 * etc/bench.pl.in: Adjust to this new API.
4126
41272008-11-13 Akim Demaille <demaille@gostai.com>
4128
4129 %define token.prefix.
4130 Provide a means to add a prefix to the name of the tokens as
4131 output in the generated files. Because of name clashes, it is
4132 good to have such a prefix such as TOK_ that protects from names
4133 such as EOF, FILE etc. But it clutters the grammar itself.
4134
4135 * data/bison.m4 (token.prefix): Empty by default.
4136 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
4137 * data/lalr1.cc (b4_symbol): Ditto.
4138
41392008-11-13 Akim Demaille <demaille@gostai.com>
4140
4141 Compute at M4 time some of the subtractions.
4142 * data/lalr1.cc (b4_subtract): New.
4143 (b4_rhs_data): Use it.
4144
41452008-11-13 Akim Demaille <demaille@gostai.com>
4146
4147 symbol::token.
4148 This allows the user to get the type of a token returned by yylex.
4149
4150 * data/lalr1.cc (symbol::token): New.
4151 (yytoknum_): Define when %define lex_symbol, independently of
4152 %debug.
4153 (yytoken_number_): Move into...
4154 (symbol::token): here, since that's the only use.
4155 The other one is YYPRINT which was not officially supported
4156 by lalr1.cc, and anyway it did not work since YYPRINT uses this
4157 array under a different name (yytoknum).
4158
41592008-11-13 Akim Demaille <demaille@gostai.com>
4160
4161 YYERRCODE.
4162 * TODO (YYERRCODE): Mention the case of $undef.
4163
41642008-11-13 Akim Demaille <demaille@gostai.com>
4165
4166 TODO: YYPRINT.
4167 * TODO (YYPRINT): New.
4168
41692008-11-13 Akim Demaille <demaille@gostai.com>
4170
4171 Comment changes.
4172 * data/lalr1.cc, data/yacc.c: Fix the description of the
4173 yytranslate and yytoknum tables.
4174
41752008-11-13 Akim Demaille <demaille@gostai.com>
4176
4177 Define make_symbol in the header.
4178 To reach good performances these functions should be inlined (yet
4179 this is to measure precisely). To this end they must be available
4180 to the caller.
4181
4182 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
4183 location_type with the class name.
4184 Since will now be output in the header, declare "inline".
4185 No longer use b4_symbol_constructor_specializations, but
4186 b4_symbol_constructor_definitions in the header.
4187 Don't call it in the *.cc file.
4188
41892008-11-13 Akim Demaille <demaille@gostai.com>
4190
4191 Define yytranslate in the header for lex_symbol.
4192 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
4193 into the header file when using %define lex_symbol.
4194 (yytranslate_): Declare inline.
4195
41962008-11-13 Akim Demaille <demaille@gostai.com>
4197
4198 Define the constructors of symbol_type in
4199 b4_symbol_constructor_definitions.
4200 The constructors are called by the make_symbol functions, which a
4201 forthcoming patch will move elsewhere. Hence the interest of
4202 putting them together.
4203
4204 The stack_symbol_type does not need to be moved, it is used only
4205 by the parser.
4206
4207 * data/lalr1.cc: Move symbol_type and symbol_base_type
4208 constructors into...
4209 (b4_symbol_constructor_definitions): here.
4210 Adjust.
4211
42122008-11-13 Akim Demaille <demaille@gostai.com>
4213
4214 Make it easier to move the definition of yytranslate_.
4215 Forthcoming changes will make it possible to use yytranslate_
4216 from outside the parser implementation file.
4217
4218 * data/lalr1.cc (b4_yytranslate_definition): New.
4219 Use it.
4220
42212008-11-13 Akim Demaille <demaille@gostai.com>
4222
4223 Remove useless class specification.
4224 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
4225 to refer to the class name to use a type defined by the class for
4226 arguments of member functions.
4227
42282008-11-13 Akim Demaille <demaille@gostai.com>
4229
4230 Finer input type for yytranslate.
4231 This patch is debatable: the tradition expects yylex to return an int
4232 which happens to correspond to token_number (which is an enum). This
4233 allows for instance to return characters (such as '*' etc.). But this
4234 goes against the stronger typing I am trying to have with the new
4235 lex interface which return a symbol_type. So in this case, feed
4236 yytranslate_ with a token_type.
4237
4238 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
4239 expect a token_type.
4240
42412008-11-13 Akim Demaille <demaille@gostai.com>
4242
4243 Honor lex-params in %define lex_symbol mode.
4244 * data/lalr1.cc: Use b4_lex_param.
4245
42462008-11-13 Akim Demaille <demaille@gostai.com>
4247
4248 Simplify names.
4249 * src/output.c (symbol_definitions_output): Rename symbol
4250 attributes type_name and has_type_name as type and has_type.
4251 * data/lalr1.cc: Adjust uses.
4252
42532008-11-13 Akim Demaille <demaille@gostai.com>
4254
4255 Use b4_type_names for the union type.
4256 The union used to compute the size of the variant used to iterate
4257 over the type of all the symbols, with a lot of redundancy. Now
4258 iterate over the lists of symbols having the same type-name.
4259
4260 * data/lalr1.cc (b4_char_sizeof_): New.
4261 (b4_char_sizeof): Use it.
4262 Adjust to be called with a list of numbers instead of a single
4263 number.
4264 Adjust its caller for new-line issues.
4265
42662008-11-13 Akim Demaille <demaille@gostai.com>
4267
4268 Define the "identifier" of a symbol.
4269 Symbols may have several string representations, for instance if
4270 they have an alias. What I call its "id" is a string that can be
4271 used as an identifier. May not exist.
4272
4273 Currently the symbols which have the "tag_is_id" flag set are
4274 those that don't have an alias. Look harder for the id.
4275
4276 * src/output.c (is_identifier): Move to...
4277 * src/symtab.c (is_identifier): here.
4278 * src/symtab.h, src/symtab.c (symbol_id_get): New.
4279 * src/output.c (symbol_definitions_output): Use it to define "id"
4280 and "has_id".
4281 Remove the definition of "tag_is_id".
4282 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
4283 "tag_is_id" were used to produce code.
4284 We still use "tag" for documentation.
4285
42862008-11-11 Akim Demaille <demaille@gostai.com>
4287
4288 Locations are no longer required by lalr1.cc.
4289 * data/lalr1.cc (_b4_args, b4_args): New.
4290 Adjust all uses of locations to make them optional.
4291 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
4292 (AT_CHECK_NAMESPACE): Check the use of locations.
4293 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
4294 without locations with lalr1.cc.
4295 Test these cases.
4296 * tests/output.at: Check lalr1.cc with and without location
4297 support.
4298 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
4299 Don't use locations.
4300
43012008-11-11 Akim Demaille <demaille@gostai.com>
4302
4303 AT_FULL_COMPILE.
4304 * tests/local.at (AT_FULL_COMPILE): New.
4305 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
4306
43072008-11-11 Akim Demaille <demaille@gostai.com>
4308
4309 Support parens in calc++.
4310 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
4311 * examples/calc++/test (run): Check the expected output.
4312 Adjust callers.
4313 Check parens too.
4314
43152008-11-11 Akim Demaille <demaille@gostai.com>
4316
4317 Simplify lalr1.cc since %defines is mandatory.
4318 * data/lalr1.cc: Remove useless calls to b4_defines_if.
4319
43202008-11-11 Akim Demaille <demaille@gostai.com>
4321
4322 TODO: yyfmt.
4323 * TODO (yysyntax_error): New item.
4324
43252008-11-11 Akim Demaille <demaille@gostai.com>
4326
4327 Prefer M4 to CPP.
4328 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
4329 YYERROR_VERBOSE.
4330
43312008-11-11 Akim Demaille <demaille@gostai.com>
4332
4333 Support i18n of the parse error messages.
4334 * TODO (lalr1.cc/I18n): Remove.
4335 * data/lalr1.cc (yysyntax_error_): Support the translation of the
4336 error messages, as done in yacc.c.
4337 Stay within the yy* pseudo namespace.
4338
43392008-11-11 Akim Demaille <demaille@gostai.com>
4340
4341 More TODO.
4342 * TODO (single stack, yysyntax_error): New.
4343
43442008-11-11 Akim Demaille <demaille@gostai.com>
4345
4346 Make it possible to return a symbol_type from yylex.
4347 * data/lalr1.cc (b4_lex_symbol_if): New.
4348 (parse): When lex_symbol is defined, expected yylex to return the
4349 complete lookahead.
4350 * etc/bench.pl.in (generate_grammar_list): Extend to support this
4351 yylex interface.
4352 (bench_variant_parser): Exercise it.
4353
43542008-11-11 Akim Demaille <demaille@gostai.com>
4355
4356 Remove useless bench case.
4357 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
4358 no longer used.
4359
43602008-11-11 Akim Demaille <demaille@gostai.com>
4361
4362 Improve display of directives.
4363 * etc/bench.pl.in (parse_term): Don't add useless eol.
4364
43652008-11-11 Akim Demaille <demaille@gostai.com>
4366
4367 Use string_cast in the bench.
4368 * etc/bench.pl.in (generate_grammar_list): Define and use
4369 string_cast.
4370
43712008-11-11 Akim Demaille <demaille@gostai.com>
4372
4373 Replace yychar with a Boolean.
4374 * data/lalr1.cc (parse::yychar): Replace by...
4375 (parse::yyempty): this.
4376
43772008-11-11 Akim Demaille <demaille@gostai.com>
4378
4379 Factor the tables.
4380 * TODO: New item.
4381
43822008-11-11 Akim Demaille <demaille@gostai.com>
4383
4384 Let yytranslate handle the eof case.
4385 * data/lalr1.cc (yytranslate_): Handle the EOF case.
4386 Adjust callers.
4387 No longer expect yychar to be equal to yyeof_, rather, test the
4388 lookahead's (translated) kind.
4389
43902008-11-11 Akim Demaille <demaille@gostai.com>
4391
4392 yychar cannot be empty in yyerrlab.
4393 * TODO (yychar == yyempty_): New.
4394 * data/lalr1.cc: Remove the handling of this case.
4395 This eases forthcoming changes related to yychar and yytranslate.
4396
43972008-11-11 Akim Demaille <demaille@gostai.com>
4398
4399 Bench: syntactic sugar for %define/#define.
4400 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
4401 (&bench_push_parser, bench_variant_parser): Use this feature.
4402 (&eat): New.
4403 Use it.
4404
44052008-11-11 Akim Demaille <demaille@gostai.com>
4406
4407 Less memory pressure on the "list" bench.
4408 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
4409 the values, to limit memory pressure.
4410
44112008-11-11 Akim Demaille <demaille@gostai.com>
4412
4413 Introduce make_symbol.
4414 make_symbol provides a means to construct a full symbol (kind,
4415 value, location) in a single shot. It is meant to be a Symbol
4416 constructor, parameterized by the symbol kind so that overloading
4417 would prevent incorrect kind/value pairs. Unfortunately
4418 parameterized constructors do not work well in C++ (unless the
4419 parameter also appears as an argument, which is not acceptable),
4420 hence the use of a function instead of a constructor.
4421
4422 * data/lalr1.cc (b4_symbol_constructor_declaration_)
4423 (b4_symbol_constructor_declarations)
4424 (b4_symbol_constructor_specialization_)
4425 (b4_symbol_constructor_specializations)
4426 (b4_symbol_constructor_definition_)
4427 (b4_symbol_constructor_definitions): New.
4428 Use them where appropriate to generate declaration, declaration of
4429 the specializations, and implementations of the templated
4430 overloaded function "make_symbol".
4431 (variant::variant): Always define a default ctor.
4432 Also provide a copy ctor.
4433 (symbol_base_type, symbol_type): New ctor overloads for value-less
4434 symbols.
4435 (symbol_type): Now public, so that functions such as yylex can use
4436 it.
4437
44382008-11-11 Akim Demaille <demaille@gostai.com>
4439
4440 Inform m4 whether a tag is a valid id.
4441 * src/output.c (is_identifier): New.
4442 (symbol_definitions_output): Use it to define tag_is_id.
4443 But maybe this should be done at m4 level?
4444
44452008-11-11 Akim Demaille <demaille@gostai.com>
4446
4447 Test 214 was failing: it greps with a pattern containing [ ]*
4448 which obviously meant to catch spaces and tabs, but contained only
4449 spaces. Tabulations in sources are a nuisance, so to simplify the
4450 matter, get rid of all the tabulations in the Java sources. The
4451 other skeletons will be treated equally later.
4452
4453 * data/java.m4, data/lalr1.java: Untabify.
4454 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
4455 tabulations are no longer generated.
4456
44572008-11-11 Paolo Bonzini <bonzini@gnu.org>
4458
4459 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
4460 * configure.ac: Adjust usage.
4461 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
4462 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
4463 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
4464
44652008-11-10 Di-an Jan <dianj@freeshell.org>
4466
4467 Workaround Java's ``code too large'' problem for parser tables
4468 in most cases, by using one function per initialization.
4469 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
4470 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
4471 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
4472 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
4473 (yytname_): Use b4_typed_parser_table.
4474 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
4475 ``code too large'' error.
4476
44772008-11-10 Di-an Jan <dianj@freeshell.org>
4478
4479 * NEWS: Document them.
4480
4481 General Java skeleton improvements.
4482 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
4483 using gcj < 4.3 in the testsuite, according to comments in
4484 gnulib/m4/javacomp.m4.
4485 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
4486 location_type, position_type): Remove extraneous brackets from
4487 b4_percent_define_default.
4488 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
4489 m4_define and m4_define_default.
4490 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
4491 which marks the end of user code with appropriate syncline, like all
4492 the other skeletons.
4493 (b4_user_post_prologue): Add. Don't silently drop.
4494 (yylex): Remove.
4495 (parse): Inline yylex.
4496 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
4497 (%{...%}): Fix typo of %code imports.
4498 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
4499
4500 Support annotations on parser class with %define annotations.
4501 * data/lalr1.java (annotations): Add to parser class modifier.
4502 * doc/bison.texinfo (Java Parser Interface): Document
4503 %define annotations.
4504 (Java Declarations Summary): Document %define annotations.
4505 * tests/java.at (Java parser class modifiers): Test annotations.
4506
4507 Do not generate code for %error-verbose unless requested.
4508 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
4509 Make private. Make conditional on %error-verbose.
4510 (getErrorVerbose, setErrorVerbose): New.
4511 (yytnamerr_): Make conditional on %error-verbose.
4512 (yysyntax_error): Make some code conditional on %error-verbose.
4513 * doc/bison.texinfo (Java Bison Interface): Remove the parts
4514 about %error-verbose having no effect.
4515 (getErrorVerbose, setErrorVerbose): Document.
4516
4517 Move constants for token names to Lexer interface.
4518 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
4519 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
4520 (parse): Qualify EOF to Lexer.EOF.
4521 * doc/bison.texinfo (Java Parser Interface): Move documentation of
4522 EOF and token names to Java Lexer Interface.
4523 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
4524
4525 Make yyerror public.
4526 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
4527 (yyerror): Change to public. Add Javadoc comments. Use longer
4528 parameter names. Make the body rather than the declarator
4529 conditional on %locations.
4530 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
4531
4532 Allow user to add code to the constructor with %code init.
4533 * data/java.m4 (b4_init_throws): New, for %define init_throws.
4534 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
4535 Add %code init to the front of the constructor body.
4536 * doc/bison.texinfo (YYParser.YYParser): Document %code init
4537 and %define init_throws.
4538 (Java Declarations Summary): Document %code init and
4539 %define init_throws.
4540 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
4541 (Java constructor init and init_throws): Add tests.
4542
45432008-11-10 Akim Demaille <demaille@gostai.com>
4544
4545 Update TODO.
4546 * TODO (-D): is implemented.
4547 (associativity): Same precedence must have the same associativity.
4548 For instance, how can a * b / c be parsed if * is %left and / is
4549 %right?
4550 (YYERRORCODE, YYFAIL, YYBACKUP): New.
4551
45522008-11-10 Akim Demaille <demaille@gostai.com>
4553
4554 Formatting changes.
4555
45562008-11-10 Akim Demaille <demaille@gostai.com>
4557
4558 More information about the symbols.
4559 * src/output.c (type_names_output): Document all the symbols,
4560 including those that don't have a type-name.
4561 (symbol_definitions_output): Define "is_token" and
4562 "has_type_name".
4563 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
4564 type-name, now that they are defined too in b4_type_names.
4565
45662008-11-10 Akim Demaille <demaille@gostai.com>
4567
4568 Regen.
4569
45702008-11-10 Akim Demaille <demaille@gostai.com>
4571
4572 Make parser::yytranslate static.
4573 Small speedup (1%) on the list grammar. And makes yytranslate_
4574 available in non member functions.
4575
4576 * data/lalr1.cc (yytranslate_): Does not need to be a instance
4577 function.
4578
45792008-11-10 Akim Demaille <demaille@gostai.com>
4580
4581 Avoid trailing spaces.
4582 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
4583 * data/lalr1.cc: Don't indent before rule and symbol actions, as
4584 they can be empty, and anyway this incorrectly indents the first
4585 action.
4586
45872008-11-10 Akim Demaille <demaille@gostai.com>
4588
4589 Comment changes.
4590
45912008-11-10 Akim Demaille <demaille@gostai.com>
4592
4593 Use "enum" for integral constants.
4594 This is just nicer to read, I observed no speedup.
4595
4596 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
4597 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
4598 (yyuser_token_number_max_, yyundef_token_): Move into...
4599 (yytranslate_): here.
4600
46012008-11-10 Akim Demaille <demaille@gostai.com>
4602
4603 Shortcuts in bench directives.
4604 * etc/bench.pl.in (parse_dirs): New.
4605 Use it.
4606 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
4607 Create the benches in "benches/".
4608
46092008-11-10 Akim Demaille <demaille@gostai.com>
4610
4611 Formatting changes.
4612 * data/lalr1.cc: here.
4613
46142008-11-10 Akim Demaille <demaille@gostai.com>
4615
4616 Adjust verbose message to using emacs.
4617 * etc/bench.pl.in: Inform compilation-mode when we change the
4618 directory.
4619 (generate_grammar_list): Recognize %define "variant" in addition
4620 to %define variant.
4621
46222008-11-10 Akim Demaille <demaille@gostai.com>
4623
4624 Classify symbols by type-name.
4625 * src/uniqstr.h (UNIQSTR_CMP): New.
4626 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
4627 (type_names_output): New.
4628 (muscles_output): Use it.
4629 * data/lalr1.cc (b4_symbol_action_): Remove.
4630 (b4_symbol_case_, b4_type_action_): New.
4631 Adjust uses of b4_symbol_action_ to use b4_type_action_.
4632
46332008-11-10 Akim Demaille <demaille@gostai.com>
4634
4635 Change the handling of the symbols in the skeletons.
4636 Before we were using tables which lines were the symbols and which
4637 columns were things like number, tag, type-name etc. It is was
4638 difficult to extend: each time a column was added, all the numbers had
4639 to be updated (you asked for colon $2, not for "tag"). Also, it was
4640 hard to filter these tables when only a subset of the symbols (say the
4641 tokens, or the nterms, or the tokens that have and external number
4642 *and* a type-name) was of interest.
4643
4644 Now instead of monolithic tables, we define one macro per cell. For
4645 instance "b4_symbol(0, tag)" is a macro name which contents is
4646 self-decriptive. The macro "b4_symbol" provides easier access to
4647 these cells.
4648
4649 * src/output.c (type_names_output): Remove.
4650 (symbol_numbers_output, symbol_definitions_output): New.
4651 (muscles_output): Call them.
4652 (prepare_symbols): Define b4_symbols_number.
4653
46542008-11-10 Akim Demaille <demaille@gostai.com>
4655
4656 --trace=muscles
4657 * src/getargs.h, src/getargs.c (trace_muscle): New.
4658 (trace_types, trace_args): Support it.
4659 * src/output.c (output_skeleton): Use it.
4660
46612008-11-10 Akim Demaille <demaille@gostai.com>
4662
4663 muscles_output.
4664 * src/output.c (muscles_output): New, extracted from...
4665 (output_skeleton): here.
4666 Adjust.
4667
46682008-11-10 Akim Demaille <demaille@gostai.com>
4669
4670 Formatting changes.
4671
46722008-11-10 Akim Demaille <demaille@gostai.com>
4673
4674 Update the variant example.
4675 * examples/variant.yy: Formatting changes.
4676 One stage build.
4677
46782008-11-10 Akim Demaille <demaille@gostai.com>
4679
4680 Support constructor with an argument.
4681 This improves the "list" bench by 2%.
4682
4683 * data/lalr1.cc (variant::build): Add an overloaded version with
4684 an argument.
4685 * tests/c++.at (AT_CHECK_VARIANT): Check it.
4686
46872008-11-10 Akim Demaille <demaille@gostai.com>
4688
4689 Test variants.
4690 * tests/c++.at (AT_CHECK_VARIANTS): New.
4691 Use it with and without %define assert.
4692
46932008-11-10 Akim Demaille <demaille@gostai.com>
4694
4695 Add %precedence support.
4696 Unfortunately it is not possible to reuse the %prec directive. This
4697 is because to please POSIX, we do not require to end the rules with a
4698 semicolon. As a result,
4699
4700 foo: bar %prec baz
4701
4702 is ambiguous: either a rule which precedence is that of baz, or a rule,
4703 and then a declaration of the precedence of the token baz.
4704
4705 * doc/bison.texinfo: Document %precedence.
4706 (Precedence Only): New.
4707 * src/assoc.h, src/assoc.c (precedence_assoc): New.
4708 * src/conflicts.c (resolve_sr_conflict): Support it.
4709 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
4710 Parse it.
4711 * tests/calc.at: Use %precedence for NEG.
4712 * tests/conflicts.at (%precedence does not suffice)
4713 (%precedence suffices): New tests.
4714
47152008-11-09 Akim Demaille <demaille@gostai.com>
4716
4717 Make benches in a sub dirs.
4718 * etc/bench.pl.in ($dir): New.
4719 Use it.
4720 Check the use of constructors with an argument.
4721 (bench_variant_parser): Fix.
4722
47232008-11-09 Akim Demaille <demaille@gostai.com>
4724
4725 fix eof condition
4726
47272008-11-09 Akim Demaille <demaille@gostai.com>
4728
4729 Fix --help.
4730
47312008-11-09 Akim Demaille <demaille@gostai.com>
4732
4733 Require the generation of parse-gram.output.
4734 * src/Makefile.am (YACC): Pass --report=all.
4735
47362008-11-09 Akim Demaille <demaille@gostai.com>
4737
4738 Formatting changes.
4739
47402008-11-09 Akim Demaille <demaille@gostai.com>
4741
4742 Update TODO.
4743 * TODO: Remove obsolete items.
4744 Update others.
4745
47462008-11-09 Akim Demaille <demaille@gostai.com>
4747
4748 Enhance bench.pl.
4749 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
4750 (@token, $grammar, $bench): New.
4751 (generate_grammar_variant): Rename as...
4752 (generate_grammar_list): this.
4753 (generate_grammar): Adjust.
4754 (bench_grammar): Rename as...
4755 (bench): this.
4756 Use it in the various bench-marking routines.
4757 (-b, -g): New options.
4758
47592008-11-09 Akim Demaille <demaille@gostai.com>
4760
4761 Use a static hierarchy for symbols in the C++ parser.
4762 * data/lalr1.cc (symbol_base_type, symbol_type)
4763 (stack_symbol_type): Make it a static hierarchy.
4764 Adjust dependencies.
4765
47662008-11-09 Akim Demaille <demaille@gostai.com>
4767
4768 bench.pl -d, --directive.
4769 * etc/bench.pl.in (@directive): New.
4770 (&bench_grammar): Use it.
4771 (&bench_list_grammar): New, to provide access to the "variant"
4772 grammar.
4773 Use it.
4774 (getopts): Support -d, --directive.
4775
47762008-11-09 Akim Demaille <demaille@gostai.com>
4777
4778 Use inline for small operations.
4779 * data/lalr1.cc (symbol_base_type, symbol_type)
4780 (stack_symbol_type): Declare constructor and other operations as
4781 inline.
4782 (yy_destroy_): Inline.
4783
47842008-11-09 Akim Demaille <demaille@gostai.com>
4785
4786 Introduce a hierarchy for symbols.
4787 * data/lalr1.cc (symbol_base_type, symbol_type): New.
4788 (data_type): Rename as...
4789 (stack_symbol_type): this.
4790 Derive from symbol_base_type.
4791 (yy_symbol_value_print_): Merge into...
4792 (yy_symbol_print_): this.
4793 Rename as...
4794 (yy_print_): this.
4795 (yydestruct_): Rename as...
4796 (yy_destroy_): this.
4797 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
4798 (parser::parse): yyla is now of symbol_type.
4799 Use its type member instead of yytoken.
4800
48012008-11-09 Akim Demaille <demaille@gostai.com>
4802
4803 Rename data_type and stack_symbol_type.
4804 * data/lalr1.cc (data_type): Rename as...
4805 (stack_symbol_type): this.
4806
48072008-11-09 Akim Demaille <demaille@gostai.com>
4808
4809 Handle semantic value and location together.
4810 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
4811 yydata.value and yydata.location.
4812 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
4813 (YY_SYMBOL_PRINT): Now take semantic value and location as a
4814 single arg.
4815 Adjust all callers.
4816 (yydestruct_): New overload for a stack symbol.
4817
48182008-11-09 Akim Demaille <demaille@gostai.com>
4819
4820 Push a complete symbol, not connected parts.
4821 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
4822 state, value and location.
4823 Adjust callers.
4824
48252008-11-09 Akim Demaille <demaille@gostai.com>
4826
4827 Agregate yylval and yylloc.
4828 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
4829 (parser::yyla): this.
4830
48312008-11-09 Akim Demaille <demaille@gostai.com>
4832
4833 Rely on the state stack to display reduction traces.
4834 To display rhs symbols before a reduction, we used information
4835 about the rule reduced, which required the tables yyrhs and
4836 yyprhs. Now use rely only on the state stack to get the same
4837 information.
4838
4839 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
4840 Use them.
4841 (parser::yyrhs_, parser::yyprhs_): Remove.
4842 (parser::yy_reduce_print_): Use the state stack.
4843
48442008-11-09 Akim Demaille <demaille@gostai.com>
4845
4846 Fuse yyval and yyloc into yylhs.
4847 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
4848 yylhs.
4849 (parse): Replace yyval and yyloc with yylhs.value and
4850 yylhs.location.
4851 After a user action, compute yylhs.state earlier.
4852 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
4853 fresh error_token.
4854
48552008-11-09 Di-an Jan <dianj@freeshell.org>
4856
4857 Remove unused variable.
4858 * src/output.c (type_names_output): Remove unused variable sep.
4859
48602008-11-09 Paolo Bonzini <bonzini@gnu.org>
4861
4862 Change tests/output.at quoting.
4863 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
4864 expanding arguments.
4865
48662008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
4867
4868 Don't add a semicolon to actions for %skeleton or %language.
4869 It breaks Java test cases as reported by Akim Demaille.
4870 * src/scan-code.l: Implement.
4871
48722008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
4873
4874 Clean up %skeleton and %language priority implementation.
4875 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
4876 remove static qualifier because others will soon need to see it.
4877 (language_prio): Likewise.
4878 (getargs): Use command_line_prio rather than 0.
4879 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
4880 enum fields.
4881 (skeleton_prio): Extern it.
4882 (language_prio): Extern it.
4883 * src/parse-gram.y: Use grammar_prio rather than 1.
4884
48852008-11-07 Akim Demaille <demaille@gostai.com>
4886
4887 Moving push traces into yypush_.
4888 * data/lalr1.cc (yypush_): Now takes a optional trace message.
4889 Adjust all uses.
4890
48912008-11-07 Akim Demaille <demaille@gostai.com>
4892
4893 The single-stack C++ parser is now the standard one.
4894 * data/lalr1.cc: Rename as...
4895 * data/lalr1-split.cc: this.
4896 * data/lalr1-fusion.cc: Rename as...
4897 * data/lalr1.cc: this.
4898 * etc/bench.pl.in: Adjust.
4899
49002008-11-07 Akim Demaille <demaille@gostai.com>
4901
4902 Avoid empty-if warnings.
4903 Reported by Quentin Hocquet.
4904
4905 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
4906 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
4907
49082008-11-07 Akim Demaille <demaille@gostai.com>
4909
4910 Pass command line location to skeleton_arg and language_argmatch.
4911 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
4912 The location argument is now mandatory.
4913 Adjust all dependencies.
4914 (getargs): Use command_line_location.
4915
49162008-11-07 Akim Demaille <demaille@gostai.com>
4917
4918 -D, --define.
4919 * src/getargs.c (usage): Document -D.
4920 Fix help string for --locations.
4921 (command_line_location): New.
4922 (short_options, long_options, getargs): Support -D, --define.
4923 (getargs): Move -d support at the right place.
4924 * doc/bison.texinfo (Bison Options): Update.
4925 * tests/input.at (%define, --define): New.
4926
49272008-11-07 Akim Demaille <demaille@gostai.com>
4928
4929 Initialize the muscle table before parsing the command line.
4930 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
4931 (getargs): Define file_name.
4932 * src/main.c (main): Initialize muscle_tab before calling
4933 getargs.
4934 * src/muscle_tab.c (muscle_init): No longer define file_name, as
4935 its value is not available yet.
4936
49372008-11-07 Akim Demaille <demaille@gostai.com>
4938
4939 Locations without columns for command line arguments.
4940 * src/location.c (location_print): Don't display negative columns.
4941 * src/location.h: Document this.
4942
49432008-11-07 Akim Demaille <demaille@gostai.com>
4944
4945 Fix --help.
4946 * src/getargs.c (usage): Fix help string for -W.
4947
49482008-11-07 Akim Demaille <demaille@gostai.com>
4949
4950 Handle more general types of option arguments.
4951 * build-aux/cross-options.pl: The argument ends at the first
4952 space, not the first non-symbol character.
4953 Use @var for each word appearing the argument description.
4954
49552008-11-07 Akim Demaille <demaille@gostai.com>
4956
4957 Destroy the variants that remain on the stack in case of error.
4958 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
4959 destructor.
4960 Display the value only if yymsg is nonnull.
4961 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
4962
49632008-11-07 Akim Demaille <demaille@gostai.com>
4964
4965 Add "%define assert" to variants.
4966 This is used to help the user catch cases where some value gets
4967 ovewritten by a new one. This should not happen, as this will
4968 probably leak.
4969
4970 Unfortunately this uncovered a bug in the C++ parser itself: the
4971 lookahead value was not destroyed between two calls to yylex. For
4972 instance if the previous lookahead was a std::string, and then an int,
4973 then the value of the std::string was correctly taken (i.e., the
4974 lookahead was now an empty string), but std::string structure itself
4975 was not reclaimed.
4976
4977 This is now done in variant::build(other&) (which is used to take the
4978 value of the lookahead): other is not only stolen from its value, it
4979 is also destroyed. This incurs a new performance penalty of a few
4980 percent, and union becomes faster again.
4981
4982 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
4983 (b4_variant_if): New.
4984 (variant::built): New.
4985 Use it whereever the status of the variant changes.
4986 * etc/bench.pl.in: Check the penalty of %define assert.
4987
49882008-11-07 Akim Demaille <demaille@gostai.com>
4989
4990 Use "%define variant" in bench.pl.
4991 * etc/bench.pl.in: No longer use the pseudo directive %variants,
4992 just use %define variants.
4993
49942008-11-07 Akim Demaille <demaille@gostai.com>
4995
4996 Regen.
4997 * src/parse-gram.h, src/parse-gram.c: Regen.
4998
49992008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
5000
5001 Fix user actions without a trailing semicolon.
5002 Reported by Sergei Steshenko at
5003 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
5004 * THANKS (Sergei Steshenko): Add.
5005 * src/scan-code.l (SC_RULE_ACTION): Fix it.
5006 * tests/regression.at (Fix user actions without a trailing semicolon):
5007 New test case.
5008
50092008-11-04 Akim Demaille <demaille@gostai.com>
5010
5011 Use b4_copyright_years.
5012 * data/yacc.c (b4_copyright_years): New.
5013 Fix its value according to the comments in the file.
5014 Use it and undefine it.
5015
50162008-11-04 Akim Demaille <demaille@gostai.com>
5017
5018 Formatting changes.
5019 * data/lalr1-fusion.cc, src/parse-gram.y: here.
5020
50212008-11-04 Akim Demaille <demaille@gostai.com>
5022
5023 Formatting changes.
5024 * data/lalr1-fusion.cc: here.
5025
50262008-11-04 Akim Demaille <demaille@gostai.com>
5027
5028 Use strict on bench.pl.
5029 * etc/bench.pl.in (&run, &generate_grammar): New.
5030 Rename the grammar generating functions for consistency.
5031 Change the interface so that the list of benches to run is passed
5032 as (optionless) arguments.
5033 (&compile): Use &run.
5034
50352008-11-04 Akim Demaille <demaille@gostai.com>
5036
5037 Remove spurious initial empty lines.
5038 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
5039 * data/yacc.c: End the @output lines with an @.
5040
50412008-11-04 Akim Demaille <demaille@gostai.com>
5042
5043 Improve the display of sizes.
5044 * etc/bench.p.in: Higher precision.
5045 Sort by decreasing size.
5046
50472008-11-04 Akim Demaille <demaille@gostai.com>
5048
5049 Don't memcpy C++ structures.
5050 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
5051 arguments.
5052 (variant::build): New overload for
5053 copy-construction-that-destroys.
5054 (variant::swap): New.
5055 (parser::yypush_): Use it in variant mode.
5056
50572008-11-04 Akim Demaille <demaille@gostai.com>
5058
5059 Better defaults for bench.pl.
5060 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
5061 default values.
5062 Adjust &verbose uses.
5063 (-q, --quiet): New.
5064
50652008-11-04 Akim Demaille <demaille@gostai.com>
5066
5067 Make variant.yy more complex.
5068 std::list cannot be copied via memcpy, they are more demanding than
5069 std::string. Use one std::list to strengthen the test.
5070
5071 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
5072 Adjust.
5073 Create a list of strings, instead of a single large string.
5074
50752008-11-04 Akim Demaille <demaille@gostai.com>
5076
5077 bench.pl --bench.
5078 * etc/bench.pl.in (--bench, $bench): New.
5079
50802008-11-04 Akim Demaille <demaille@gostai.com>
5081
5082 Sort methods.
5083 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
5084 Define it after as().
5085
50862008-11-04 Akim Demaille <demaille@gostai.com>
5087
5088 Useless parens.
5089 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
5090
50912008-11-04 Akim Demaille <demaille@gostai.com>
5092
5093 Issue missing synclines after user actions.
5094 * data/c.m4 (b4_case): Issue synclines on the output file.
5095
50962008-11-04 Akim Demaille <demaille@gostai.com>
5097
5098 Remove trailing empty line.
5099 * data/lalr1-fusion.cc: Don't add an empty line after the user's
5100 epilogue.
5101
51022008-11-04 Akim Demaille <demaille@gostai.com>
5103
5104 Fix output of copyright years.
5105 * data/bison.m4 (b4_copyright): Fix the indentation of the
5106 copyright year paragraph.
5107 Use b4_copyright_years when no years are given.
5108 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
5109 (b4_copyright_years): New.
5110 Use it.
5111
51122008-11-04 Akim Demaille <demaille@gostai.com>
5113
5114 Avoid the spurious initial empty line.
5115 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
5116 the end of @output request to suppress the empty line that
5117 results.
5118
51192008-11-04 Akim Demaille <demaille@gostai.com>
5120
5121 Remove parser::rhs_number_type.
5122 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
5123 (yyrhs_): Use b4_table_define.
5124
51252008-11-04 Akim Demaille <demaille@gostai.com>
5126
5127 Fix iteration type.
5128 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
5129
51302008-11-04 Akim Demaille <demaille@gostai.com>
5131
5132 Factor the declaration of the integer tables.
5133 * data/lalr1-fusion.cc (b4_table_define): New.
5134 Use it.
5135
51362008-11-03 Akim Demaille <demaille@gostai.com>
5137
5138 Fix indentation of tables in lalr1.cc
5139 * data/lalr1-fusion.cc: Fix the indentation.
5140
51412008-11-03 Akim Demaille <demaille@gostai.com>
5142
5143 Destroy the lhs symbols after reduction.
5144 * data/lalr1-fusion.cc (parse): After the user action, when in
5145 variant mode, destroy the lhs symbols.
5146
51472008-11-03 Akim Demaille <demaille@gostai.com>
5148
5149 Simplify yysyntax_error_ use.
5150 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
5151 type, but make it unnamed in the declaration when it is not used.
5152
51532008-11-03 Akim Demaille <demaille@gostai.com>
5154
5155 Let yy::variant::build return an lvalue.
5156 * data/lalr1-fusion.cc (variant::build): Return a reference to the
5157 object.
5158
51592008-11-03 Akim Demaille <demaille@gostai.com>
5160
5161 Define yy::variant only when needed.
5162 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
5163 used.
5164
51652008-11-03 Akim Demaille <demaille@gostai.com>
5166
5167 Bench the three-stack lalr1.cc.
5168 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
5169 one-stack one.
5170
51712008-11-03 Akim Demaille <demaille@gostai.com>
5172
5173 Fail on parse error in calc++.
5174 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
5175 status.
5176 * examples/calc++/test ($me, $number, $exit, run): New.
5177 Use them to propagate errors to the exit status.
5178
51792008-11-03 Akim Demaille <demaille@gostai.com>
5180
5181 Don't specify the skeleton twice in the example.
5182 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
5183 file does what is needed.
5184
51852008-11-03 Akim Demaille <demaille@gostai.com>
5186
5187 bench: Improve output.
5188 * etc/bench.pl.in (bench_grammar): Tune the printf format.
5189
51902008-11-03 Akim Demaille <demaille@gostai.com>
5191
5192 bench: check impact of %debug on variants.
5193 * etc/bench.pl.in (variant_grammar): Fix the computation of
5194 $variant.
5195 Generate a grammar file that can work with or without %debug.
5196 Do use the @directive.
5197 (bench_variant_parser): Check impact of %debug.
5198 (@directives): Rename all the occurrences to...
5199 (@directive): this, for consistency.
5200
52012008-11-03 Akim Demaille <demaille@gostai.com>
5202
5203 bench: report the size too.
5204 * etc/bench.pl.in ($iterations): Defaults to -3.
5205 (&bench_grammar): Require hireswallclock.
5206 Compute and display the size of the result.
5207 More comments.
5208
52092008-11-03 Akim Demaille <demaille@gostai.com>
5210
5211 bench: More use of the verbosity level.
5212 * etc/bench.pl.in ($verbose, &verbose): New.
5213 Use them.
5214 More POD documentation.
5215
52162008-11-03 Akim Demaille <demaille@gostai.com>
5217
5218 bench.pl: a command line interface
5219 * etc/bench.pl.in: More doc.
5220 Some fixes in the documentation.
5221 ($cflags, $iterations, &help, &getopt): New.
5222 Use them.
5223 (&variant_grammar): Let the number of stages be 10 times what is
5224 specified.
5225
52262008-11-03 Akim Demaille <demaille@gostai.com>
5227
5228 Bench the use of Boost.Variants.
5229 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
5230 New.
5231 (&compile): Be ready to compile C++ parsers.
5232 (&bench_push_parser): Move debug information to the outermost
5233 level.
5234 * THANKS: Add Michiel De Wilde.
5235
52362008-11-03 Akim Demaille <demaille@gostai.com>
5237
5238 bench.pl: Pass directives as a list instead of as a string.
5239 * etc/bench.pl.in (&directives): New.
5240 (&triangular_grammar, &calc_grammar): Use it to format the Bison
5241 directives.
5242 (&triangular_grammar): Do use the directives (were ignored).
5243 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
5244 directives.
5245
52462008-11-03 Akim Demaille <demaille@gostai.com>
5247
5248 Improve genericity of bench.pl.
5249 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
5250 argument.
5251 (&bench_push_parser): New.
5252 Call it.
5253
52542008-11-03 Akim Demaille <demaille@gostai.com>
5255
5256 Add documentation to bench.pl.
5257 * etc/bench.pl.in: Comment changes.
5258
52592008-11-03 Akim Demaille <demaille@gostai.com>
5260
5261 Fuse the three stacks into a single one.
5262
5263 In order to make it easy to perform benchmarks to ensure that
5264 there are no performance loss, lalr1.cc is forked into
5265 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
5266 lalr1.cc.
5267
5268 Meanwhile, to make sure that lalr1-fusion.cc is correctly
5269 exercized by the test suite, the user must install a symbolic link
5270 from lalr1.cc to it.
5271
5272 Instead of having three stacks (state, value, location), use a
5273 stack of triples. This considerably simplifies the code (and it
5274 will be easier not to require locations as currently does the C++
5275 parser), and also gives a 10% speedup according to
5276 etc/bench (probably mainly since memory allocation is done once
5277 instead of three times).
5278
5279 Another motivation is to make it easier to destruct properly
5280 semantic values: now that they are bound to their state (hence
5281 symbol type) it will be easier to call the appropriate destructor.
5282
5283 These changes should probably benefit the C parser too.
5284
5285 * data/lalr1.cc: Copy as...
5286 * data/lalr1-fusion.cc: this new file.
5287 (b4_rhs_value, b4_rhs_location): New definitions overriding those
5288 from c++.m4.
5289 (state_stack_type, semantic_stack_type, location_stack_type)
5290 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
5291 (data_type, stack_type, yystack_): New.
5292 (YYLLOC_DEFAULT, yypush_): Adjust.
5293 (yyerror_range): Now based on data_type, not location_type.
5294
52952008-11-03 Akim Demaille <demaille@gostai.com>
5296
5297 Push the state, value, and location at the same time.
5298 This is needed to prepare a forthcoming patch that fuses the three
5299 stacks into one.
5300
5301 * data/lalr1.cc (parser::yypush_): New.
5302 (parser::yynewstate): Change the semantics: instead of arriving to
5303 this label when value and location have been pushed, but yystate
5304 is to be pushed on the state stack, now the three of them must
5305 have been pushed before. yystate still must be the new state.
5306 This allows to use yypush_ everywhere instead of individual
5307 handling of the stacks.
5308
53092008-11-03 Akim Demaille <demaille@gostai.com>
5310
5311 Prefer references to pointers.
5312 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
5313 definition to use references instead of pointers.
5314 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
5315 Take the value and location as references.
5316 Adjust callers.
5317
53182008-11-03 Akim Demaille <demaille@gostai.com>
5319
5320 stack::size instead of stack::height.
5321 * data/lalr1.cc (stack::height): Rename as...
5322 (stack::size): this.
5323 Fix the output type.
5324 Comment changes.
5325
53262008-11-03 Akim Demaille <demaille@gostai.com>
5327
5328 Use variants to support objects as semantic values.
5329 This patch was inspired by work by Michiel De Wilde. But he used
5330 Boost variants which (i) requires Boost on the user side, (ii) is
5331 slow, and (iii) has useless overhead (the parser knows the type of
5332 the semantic value there is no reason to duplicate this
5333 information as Boost.Variants do).
5334
5335 This implementation reserves a buffer large enough to store the
5336 largest objects. yy::variant implements this buffer. It was
5337 implemented with Quentin Hocquet.
5338
5339 * src/output.c (type_names_output): New.
5340 (output_skeleton): Invoke it.
5341 * data/c++.m4 (b4_variant_if): New.
5342 (b4_symbol_value): If needed, provide a definition for variants.
5343 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
5344 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
5345 (b4_char_sizeof, yy::variant): New.
5346 (parser::parse): If variants are requested, define
5347 parser::union_type, parser::variant, change the definition of
5348 semantic_type, construct $$ before running the user action instead
5349 of performing a default $$ = $1.
5350 * examples/variant.yy: New.
5351 Based on an example by Michiel De Wilde.
5352
53532008-11-03 Akim Demaille <demaille@gostai.com>
5354
5355 Parameterize the extraction of semantic values.
5356 To make future changes easier, no longer rely on ".TYPE" being the
5357 way to get a semantic value.
5358
5359 * data/c.m4 (b4_symbol_value): New.
5360 Use it.
5361 * data/c++.m4, data/yacc.c: Use it.
5362 * data/glr.c: Use b4_symbol_value.
5363 (b4_rhs_data): New.
5364 Use it.
5365
53662008-11-03 Akim Demaille <demaille@gostai.com>
5367
5368 Prepare easier M4 changes.
5369 * data/lalr1.cc: Use escaped [] instead of literals to prepare
5370 future changes.
5371
53722008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
5373
5374 Initiate further development.
5375 * NEWS: Create an empty section for new entries.
5376 * gnulib: Update submodule to HEAD.
5377
53782008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
5379
5380 * NEWS: Version 2.4.
5381
53822008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
5383
5384 Prepare for next release.
5385 * NEWS: Briefly mention changes since 2.3b.
5386 * README: Say GNU m4 1.4.6, which we've been requiring in release
5387 announcements already, not 1.4.3, which breaks the build.
5388
53892008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
5390
5391 Say %language is experimental.
5392 We're thinking of extending it's effect on output file naming. See the
5393 thread at
5394 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
5395 * NEWS: Say it's experimental.
5396 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
5397 recommend it over %skeleton for now.
5398 (Bison Options): Likewise.
5399 (C++ Bison Interface): Use %skeleton not %language.
5400 (Calc++ Parser): Use %skeleton not %language.
5401 * src/getargs.c (usage): Say it's experimental.
5402
54032008-11-01 Di-an Jan <dianj@freeshell.org>
5404 Paolo Bonzini <bonzini@gnu.org>
5405
5406 Support all Java parser class modifiers.
5407 * data/java.m4 (b4_percent_define_get3): New.
5408 (b4_final_if, b4_strictfp_if): New.
5409 * data/lalr1.java (final, strictfp, extends, implements): Support.
5410 * doc/bison.texinfo (final, strictfp, extends, implements): Add
5411 documentation.
5412 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
5413 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
5414 (AT_CHECK_JAVA_GREP): New.
5415 (Java parser class modifiers): New test.
5416 (Java parser class extends and implements): New test.
5417
5418 Model exception propagation better with throws and lex_throws.
5419 * data/java.m4 (b4_list2): New.
5420 (throws): Change default.
5421 * data/lalr1.java (yyaction): Add throws.
5422 (parse): Add lex_throws in addition to throws.
5423 * doc/bison.texinfo (throws, lex_throws): Add documentation.
5424 * tests/java.at (Java throws specifications): New test.
5425
5426 Improve documentation for Java parsers.
5427 * doc/bison.texinfo (Java Parsers): Add subsections.
5428 Don't quote first argument of %define.
5429 (Java Bison Interface): Document output files. Move documentation
5430 of parser class and merge into Java Parser Interface. Document
5431 features that error out. Document directives with no effect.
5432 Move note about Javadoc higher.
5433 (Java Semantic Values): Explicitly mention stype.
5434 Document that generic types cannot be used.
5435 (Java Location Values): Use @deftypeivar. Document constructors.
5436 Correct return value for toString.
5437 (Java Parser Interface): List undocumented constants/fields.
5438 Move documentation of fields added by %parse-param closer to list
5439 of members. Document that token names are added as fields.
5440 Document constructors accurately. Remove error method.
5441 (Java Scanner Interface): Move note on %pure-parser to Java Bison
5442 Interface. Describe %code lexer and yylex accutately.
5443 Remove documentation that does not match the code.
5444 (Java Action Features): New.
5445 (Java Differences): Add reference. Add item on semantic values.
5446 Add note about @{ ... @}. Clarify %% epilogue placement.
5447 (Java Declarations Summary): New.
5448
5449 Fix Java skeleton.
5450 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
5451 (b4_remove_comma): Quote test argument.
5452 (b4_identification): Remove "bison" field.
5453 * tests/java.at (Java parser class and package names): New test.
5454 (Java %parse-param and %lex-param): New test.
5455 (Java stype, position_class and location_class): New test.
5456
54572008-10-31 Di-an Jan <dianj@freeshell.org>
5458
5459 * data/lalr1.jave: Update copyright years.
5460 (YYParser): Correct name of "generated from" file in Javadoc:
5461 use b4_file_name instead of @ofile@.
5462 (Location constructor): Correct Javadoc parameter name.
5463 (yylloc): Add missing opening m4 quote after b4_location_if.
5464 This removes a stray [ in the Javadoc of Lexer.getStartPos.
5465 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
5466 (YYParser constructor): Correct Javadoc parameter name.
5467
54682008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
5469
5470 Always put auxiliary code files in the same dir as other output files.
5471 * src/files.c (compute_file_name_parts): When the user specifies
5472 --output but not --file-prefix, extract the directory prefix from the
5473 file prefix not from the grammar file name. This affects the location
5474 of files like location.hh generated by the C++ skeleton. The includes
5475 in the other output files require this fix.
5476 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
5477 for expected output files.
5478 (Output files): Add a test for the above.
5479
54802008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
5481
5482 * gnulib: Update submodule to HEAD.
5483
54842008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
5485
5486 Update copyright year.
5487 * src/files.c: Here.
5488
54892008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
5490
5491 Don't overwrite the input file.
5492 * src/files.c (output_file_name_check): Fatal error if using input file
5493 for output.
5494 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
5495 argument.
5496 (Conflicting output files): Add test.
5497
54982008-10-28 Akim Demaille <demaille@gostai.com>
5499
5500 Space changes.
5501 * data/lalr1.cc: Formatting changes.
5502
55032008-10-28 Akim Demaille <demaille@gostai.com>
5504
5505 Don't define debugging functions when !YYDEBUG.
5506 * data/lalr1.cc (debug_stream, set_debug_stream)
5507 (debug_level_type, debug_level, set_debug_level): Don't
5508 declare them when YYDEBUG is not defined.
5509 The implementation are already YYDEBUG-aware.
5510
55112008-10-28 Akim Demaille <demaille@gostai.com>
5512
5513 Prefer "continue" for empty loop bodies.
5514 * etc/bench.pl.in: Use "continue" instead of {}.
5515
55162008-10-28 Akim Demaille <demaille@gostai.com>
5517
5518 Space and comments changes.
5519 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
5520 * data/c.m4, data/lalr1.cc: Space changes.
5521
55222008-10-28 Akim Demaille <demaille@gostai.com>
5523
5524 Make gnulib a submodule.
5525 * gnulib: New.
5526 * .gitmodules (gnulib): New.
5527
55282008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
5529
5530 Fix yyerror_range for user-defined location type in C++. Reported by
5531 Georg Sauthoff at
5532 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
5533 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
5534 * THANKS (Georg Sauthoff): Add.
5535
55362008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
5537
5538 Update several administrative files mainly to facilitate releasing.
5539 * HACKING (Administrivia): Make the git-merge-changelog notes more
5540 helpful.
5541 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
5542 (Release Procedure): Update for git and add numerous details that were
5543 previously missing.
5544 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
5545 * maint.mk (announcement): Don't list bison as a bootstrap tool so
5546 that announcements don't claim we bootstrapped with whatever bison
5547 happened to be in PATH. Add flex as a bootstrap tool.
5548 * Makefile.maint: Remove, previously replaced by maint.mk.
5549 * Makefile.cfg: Remove, and migrate settings to...
5550 * cfg.mk: ... here for the sake of `make announcement'.
5551 * bootstrap.conf (gnulib_modules): Add announce-gen.
5552 * README: Say GNU Bison instead of just Bison. Suggested by Karl
5553 Berry.
5554
55552008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
5556
5557 Small but important bugfixes for the Java skeleton.
5558 * data/lalr1.java (yyerror): Change Location to b4_location_type.
5559 (yy_symbol_print): Call toString on yyvaluep.
5560
55612008-08-29 Akim Demaille <demaille@gostai.com>
5562
5563 Clarify UPDATED use.
5564 * doc/bison.texinfo: It refers to the last edition of this file,
5565 not to the release date of Bison.
5566 Reported by Joel E. Denny.
5567
55682008-08-29 Akim Demaille <demaille@gostai.com>
5569
5570 * README: Update FAQ pointer.
5571 Reported by Joel E. Denny.
5572
55732008-08-27 Eric Blake <ebb9@byu.net>
5574
5575 Resync m4sugar from autoconf.
5576 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
5577 (m4_init): Adjust to latest m4.git changes.
5578 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
5579 effects.
5580 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
5581 (_m4_list_cmp): Reduce side effects.
5582
55832008-08-27 Akim Demaille <demaille@gostai.com>
5584
5585 Check yyerrok in calc.at.
5586 * tests/calc.at (calc.y): Use yyerrok on "( error )".
5587 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
5588 expected.
5589
55902008-08-27 Akim Demaille <demaille@gostai.com>
5591
5592 Support yyerrok in lalr1.cc.
5593 YYBACKUP is still to import back into lalr1.cc.
5594 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
5595
55962008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
5597
5598 For maintainer-check*, don't recompile for a $(VERSION) update.
5599 * cfg.mk: New file.
5600 (_is-dist-target): Override the one in GNUmakefile.
5601 * Makefile.am (EXTRA_DIST): Add cfg.mk.
5602
56032008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
5604
5605 Update for recent change to gnulib.
5606 * src/parse-gram.y: Don't include strverscmp.h. It comes from
5607 string.h now.
5608
56092008-08-15 Eric Blake <ebb9@byu.net>
5610
5611 Remaining m4sugar merge from autoconf.
5612 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
5613 * data/m4sugar/foreach.m4: New file, copied from autoconf.
5614 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
5615 * src/output.c (output_skeleton): Tell m4 how to find it.
5616
5617 Partial m4sugar merge from autoconf: m4_map.
5618 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
5619 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
5620 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
5621 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
5622 for empty list.
5623 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
5624 Likewise.
5625 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
5626 declares it.
5627
56282008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
5629
5630 Keep .version and PACKAGE_VERSION in sync.
5631 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
5632 dependency, and add comments justifying this in more detail. Discussed
5633 starting at
5634 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
5635
56362008-08-06 Eric Blake <ebb9@byu.net>
5637
5638 Partial m4sugar merge from autoconf: m4_shiftn.
5639 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
5640 (m4_shift2, m4_shift3): New macros.
5641 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
5642 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
5643 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
5644 * data/java.m4 (b4_remove_comma): Likewise.
5645
5646 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
5647 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
5648 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
5649 (m4_init): Consolidate wrapped text into single m4_wrap.
5650 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
5651 in wrapped text.
5652
56532008-08-05 Eric Blake <ebb9@byu.net>
5654
5655 Partial m4sugar merge from autoconf: builtins, version.m4.
5656 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
5657 (m4_prepend): Remove, as it is unused and inherently quadratic,
5658 whereas m4_append is linear in newer m4.
5659 (m4_mkstemp): New builtin.
5660 (m4_symbols): Make rename conditional.
5661 (m4_version_prereq): Ensure fatal error if used in bison, which
5662 intentionally lacks version.m4.
5663
5664 Fix comments in m4sugar.
5665 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
5666
56672008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
5668
5669 Update for recent .gitignore fix in Gnulib.
5670 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
5671 anchored .gitignore entries.
5672
56732008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
5674
5675 Set gnu or gnits strictness.
5676 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
5677 development and gnits strictness for releases. Based on Eric Blake's
5678 suggestion at
5679 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
5680
56812008-07-31 Paolo Bonzini <bonzini@gnu.org>
5682
5683 * NEWS: Clarify documentation of %language.
5684
56852008-07-31 Paolo Bonzini <bonzini@gnu.org>
5686
5687 Support usage of git-merge-changelog.
5688 * .gitattributes: New.
5689 * HACKING: Document usage of git-merge-changelog.
5690 * bootstrap: Install git-merge-changelog entries in .git/config
5691 if appropriate.
5692
56932008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
5694
5695 Remove remaining dependence on CVS Id keyword.
5696 * ChangeLog: For the sake of people still using CVS, don't use dollars
5697 when mentioning Id.
5698 * data/xslt/bison.xsl: Remove Id from header comments, where it was
5699 unusual anyway.
5700 * data/xslt/xml2dot.xsl: Likewise.
5701 * data/xslt/xml2text.xsl: Likewise.
5702 * data/xslt/xml2xhtml.xsl: Likewise.
5703 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
5704 * doc/Makefile.am (neutralize): Remove, no longer needed.
5705 (.x.1): Don't use neutralize.
5706 (edit): Don't substitute for ID.
5707 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
5708
57092008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
5710
5711 Fix dependence on computed configure variables.
5712 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
5713 $(top_srcdir)/configure.ac so that changes to computed variables, such
5714 as PACKAGE_VERSION, are seen.
5715 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
5716
57172008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
5718
5719 Update copyright dates for recent changes.
5720 * Makefile.am: Here.
5721 * src/Makefile.am: Here.
5722 * src/reduce.c: Here.
5723 * tests/reduce.at: Here.
5724
57252008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
5726
5727 Use git-version-gen for version names between releases.
5728 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
5729 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
5730 * .prev-version: New.
5731 * .version.in: Remove.
5732 * ChangeLog: Remove the Id previously used for capturing the CVS
5733 revision.
5734 * GNUmakefile: Remove, now copied from Gnulib.
5735 * Makefile.am: Add code suggested by comments in
5736 build-aux/git-version-gen.
5737 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
5738 .prev-version, and .version.
5739 * NEWS (2.3b+): Rename to...
5740 (?.?): ... this because we're dropping the "+" version naming scheme,
5741 but, in general, we still can't be sure of our next release name.
5742 * bootstrap: Add a quick hack to remove from .gitignore the
5743 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
5744 entry. This should really be fixed in gnulib instead.
5745 * bootstrap.conf (gnulib_modules): Add gnumakefile.
5746 * configure.ac (AC_INIT): Set version name by invoking
5747 build-aux/git-version-gen.
5748 (AC_CONFIG_FILES): Remove .version, now generated by
5749 build-aux/git-version-gen.
5750 * maint.mk: New, copied from coreutils.
5751 * doc/.cvsignore (bison.1): Add.
5752 * doc/.gitignore (/bison.1): Add.
5753 * doc/bison.1: Remove, generated.
5754 * src/.cvsignore (revision.c): Remove.
5755 * src/.gitignore (/revision.c): Remove.
5756 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
5757 (BUILT_SOURCES): Remove revision.c.
5758 (revision.c): Remove.
5759 * src/getargs.c (version): Don't print revision after the VERSION.
5760 * src/revision.h: Remove.
5761
57622008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
5763
5764 Fix untranslatable composition of sentences. Reported by Goran
5765 Uddeborg at
5766 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
5767 * THANKS (Goran Uddeborg): Add.
5768 * src/reduce.c (reduce_print): Report the number of nonterminals and
5769 rules useless in the grammar in separate sentences.
5770 * tests/reduce.at (Useless Rules): Update output.
5771 (Reduced Automaton): Likewise.
5772 (Underivable Rules): Likewise.
5773 (Empty Language): Likewise.
5774
57752008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
5776
5777 Fix some .gitignore and .cvsignore problems.
5778 * bootstrap (insert_sorted_if_absent): Replace all uses with...
5779 (insert_vc_ignore): ... this new function, which prepends `/' to all
5780 .gitignore entries before passing them to insert_sorted_if_absent.
5781 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
5782 .cvsignore files are maintained even though Bison developers run
5783 bootstrap while using Git.
5784 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
5785 unneeded by Bison.
5786 (gnulib): Add.
5787 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
5788 unneeded. Reported by Eric Blake.
5789 * lib/.gitignore (/*~): Add.
5790 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
5791 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
5792 Blake.
5793 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
5794
57952008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
5796
5797 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
5798 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
5799 * bootstrap.conf (gnulib_modules): Add unsetenv.
5800 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
5801 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
5802 (/setenv.m4): Add.
5803 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
5804 the first argument because it may become position-dependent, and unset
5805 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
5806 Add comments explaining these issues in more detail.
5807
58082008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
5809
5810 Add .gitignore everywhere based on .cvsignore.
5811 * .gitignore: New.
5812 * build-aux/.gitignore: New.
5813 * data/.gitignore: New.
5814 * doc/.gitignore: New.
5815 * etc/.gitignore: New.
5816 * examples/.gitignore: New.
5817 * examples/calc++/.gitignore: New.
5818 * lib/.gitignore: New.
5819 * m4/.gitignore: New.
5820 * po/.gitignore: New.
5821 * runtime-po/.gitignore: New.
5822 * src/.gitignore: New.
5823 * tests/.gitignore: New.
5824
58252008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
5826
5827 * NEWS (2.3b+): New section, empty for now.
5828 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
5829
58302008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
5831
5832 * NEWS (2.3b): Update release date since there has been a delay in
5833 getting the announcements and tarballs out.
5834
58352008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
5836
5837 * NEWS: Version 2.3b.
5838 * configure.ac (AC_INIT): Likewise.
5839 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
5840
58412008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
5842
5843 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
5844 been doing it for years.
5845 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
5846 (Release Procedure): Add FIXME about make alpha being unmaintained.
5847
58482008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
5849
5850 * data/yacc.c: Reformat m4 a little for readability.
5851 * src/lalr.c (build_relations): Correct comment.
5852
58532008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5854
5855 DJGPP specific issue.
5856 * djgpp/config.sed: Fixes required to run configure scripts generated
5857 by autoconf 2.62.
5858
58592008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
5860
5861 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
5862 coordinator@translationproject.org.
5863
58642008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
5865
5866 * THANKS: Add Eric Blake.
5867
58682008-04-23 Eric Blake <ebb9@byu.net>
5869
5870 Revert prior patch, by working around autoconf regression.
5871 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
5872 ("Output file name: ("): Uncomment test.
5873 ("Output file name: )"): Likewise.
5874 Based on an idea from Noah Misch.
5875
58762008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
5877
5878 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
5879 2.61. Reported by Juan Manuel Guerrero at
5880 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
5881 * tests/output.at ("Output file name: ("): Comment out test case for
5882 now.
5883 ("Output file name: )"): Likewise.
5884
58852008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
5886
5887 * GNUmakefile: Update git-version-gen invocation so make dist
5888 succeeds.
5889
58902008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
5891
5892 Update to the current gnulib CVS repository, and fix trigraph handling
5893 in Bison.
5894 * bootstrap: Update gnulib CVS repository URL.
5895 (symlink_to_dir): Encapsulate the code that guarantees the destination
5896 directory exists into...
5897 (check_dst_dir): ... this new function, and...
5898 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
5899 fail when copying files into lib/uniwidth/.
5900 * src/output.c (prepare_symbols): When writing yytname muscles, where
5901 symbol names will be encoded in C-string literals, tell quotearg to
5902 escape trigraphs. This used to be the default in gnulib.
5903 * tests/regression.at (Token definitions): Because of the change in
5904 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
5905 escapes trigraphs in symbol names. Thus, yytname no longer has
5906 trigraphs unnecessarily doubly escaped. Update test case output.
5907 Extend test case to be sure Bison's own error messages will no longer
5908 have trigraphs in symbol names unnecessarily escaped once.
5909
59102008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
5911
5912 Fix make dist infinite loop reported by Juan Manuel Guerrero at
5913 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
5914 * .cvsignore: Add .version.
5915 * .version.in: New.
5916 * bootstrap.conf (gnulib_modules): Add git-version-gen.
5917 * configure.ac (AC_CONFIG_FILES): Add .version.
5918 * build-aux/.cvsignore: Add git-version-gen.
5919
59202008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
5921
5922 * NEWS (2.3a+): Mention that -g now takes an argument.
5923 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
5924 consistency. Update the -g and -x entries now that they take
5925 arguments. Use brackets to indicate optional arguments.
5926 * src/getargs.c (usage): Explain the relationship between arguments of
5927 long and short options more completely. Document --defines and -d
5928 separately since the former takes an argument but, for POSIX Yacc, the
5929 latter does not.
5930 (short_options): Let -W take an optional argument like --warnings.
5931 (getargs): Sort cases.
5932
59332008-02-28 Akim Demaille <demaille@gostai.com>
5934
5935 * doc/bison.texinfo: Fix a few typos.
5936
59372008-02-28 Akim Demaille <akim@epita.fr>
5938
5939 * doc/bison.texinfo (Bison Options): Document -W.
5940 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
5941
59422008-02-28 Akim Demaille <akim@epita.fr>
5943
5944 * src/getargs.c (short_options): Split and sort for readability.
5945 -g and -x take optional arguments, just like their long options.
5946 * build-aux/cross-options.pl: Use /x to make the regexp easier to
5947 understand.
5948 Fix the handling of $opt which resulted in all the argument to be
5949 considered as optional.
5950
59512008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
5952
5953 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
5954 say its interface is experimental.
5955 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
5956 Java.
5957 (Bison Options): In the -L and --language entry, mention Java.
5958 (Java Bison Interface): Say the interface is experimental.
5959 * src/getargs.c (usage): Mention -L and --language.
5960
5961 * NEWS (2.3a+): Say the push parsing interface is experimental.
5962 * doc/bison.texinfo (Push Decl): Likewise.
5963 (Decl Summary): Likewise in the "%define api.push_pull" entry.
5964 (Push Parser Function): Likewise.
5965 (Pull Parser Function): Likewise.
5966 (Parser Create Function): Likewise.
5967 (Parser Delete Function): Likewise.
5968 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
5969 yypull_parse, and yypush_parse entries.
5970
5971 * NEWS (2.3a+): Mention XML support, and say the schema is
5972 experimental.
5973 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
5974 * src/getargs.c (usage): Say the XML schema is experimental.
5975
5976 * NEWS (2.3a+): Say option instead of flag.
5977
59782008-02-21 Wojciech Polak <polak@gnu.org>
5979
5980 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
5981 text.
5982
59832008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
5984
5985 Fix impure push parser compile error reported by Bob Rossi at
5986 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
5987 * data/yacc.c: Clean up whitespace in the output a little.
5988 (yypstate_allocated): Define for impure push parsers regardless of
5989 whether the pull interface is also requested.
5990 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
5991 check impure push parsers without the pull interface.
5992
5993 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
5994 yyerror takes arguments specified by %parse-param while yypstate_new
5995 does not.
5996 * doc/bison.texinfo (Parser Create Function): Document that
5997 yypstate_new returns 0 for multiple impure parser instances.
5998 * tests/push.at (Push Parsing: Multiple impure instances): Update
5999 expected stderr output.
6000
60012008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
6002
6003 * runtime-po/POTFILES.in (push.c): Remove.
6004
60052008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
6006
6007 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
6008 * data/push.c: Rename to...
6009 * data/yacc.c: ... this, overwriting it.
6010 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
6011 `%push-pull-parser' -> `%define api.push_pull "both"'.
6012 Remove old yacc.c tests, and update push.c tests to yacc.c.
6013
60142008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
6015
6016 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
6017 `"%code top" blocks' instead of `%code "top" blocks'.
6018 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
6019 Clean up whitespace in the output a little.
6020
60212008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
6022
6023 Fix documentation problems reported by Tim Josling at
6024 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
6025 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
6026 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
6027 integers. Explain the effect of literal string aliases on error
6028 messages. Copy token 0 documentation from the C++ skeleton
6029 documentation.
6030
60312008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
6032
6033 Accept a token number in a %left, %right, or %nonassoc for POSIX
6034 conformance. Reported by Tim Josling at
6035 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
6036 * NEWS (2.3a+): Mention.
6037 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
6038 and code numbers are treated by precedence declarations.
6039 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
6040 of symbols.1.
6041 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
6042 of symbol.
6043 (symbol.prec): New, just like symbol but allows INT.
6044 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
6045 longer holds.
6046 * tests/regression.at (Token number in precedence declaration): New
6047 test case.
6048
60492008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6050
6051 DJGPP specific issues.
6052 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
6053 be changed. Copyright timestamp adjusted.
6054 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
6055 be changed. Copyright timestamp adjusted.
6056 * djgpp/config.site: Copyright timestamp adjusted.
6057 * djgpp/config_h.sed: Copyright timestamp adjusted.
6058 * djgpp/djunpack.bat: Copyright timestamp adjusted.
6059 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
6060 filename translation list.
6061 * djgpp/subpipe.c (init_subpipe): Check the environment variables
6062 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
6063 files shall be created. Before trying to use the temp dir where the
6064 environment variable points to check that the dir really exists. If
6065 not default to the cwd as temp dir. Copyright timestamp adjusted.
6066 * djgpp/subpipe.h: Copyright timestamp adjusted.
6067 * djgpp/testsuite.sed: Copyright timestamp adjusted.
6068
60692008-01-30 Paul Eggert <eggert@cs.ucla.edu>
6070
6071 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
6072
60732008-01-09 Paul Eggert <eggert@cs.ucla.edu>
6074
6075 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
6076 Problem reported by Claudio Saavedra in
6077 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
6078
60792008-01-05 Wojciech Polak <polak@gnu.org>
6080
6081 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
6082 document's title with the input grammar file name.
6083
60842007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
6085
6086 Automate regression testing of the XML/XSLT implementation. Discussed
6087 starting at
6088 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
6089 * configure.ac (XSLTPROC): New substitution.
6090 * Makefile.am (maintainer-xml-check): New phony target invoking...
6091 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
6092 invoking make maintainer-check with BISON_TEST_XML=1.
6093 * tests/atlocal.in (XSLTPROC): New.
6094 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
6095 not to report reachable memory when Bison is expected to have a
6096 non-zero exit status and (2) to compare XML/XSLT output with --graph
6097 and --report=all output for every working grammar when
6098 BISON_TEST_XML=1.
6099 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
6100 (AT_BISON_CHECK_XML): New.
6101 (AT_QUELL_VALGRIND): New.
6102 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
6103 (AT_CHECK): ... don't redefine this since this was the old way to
6104 quell Valgrind.
6105 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
6106 AT_BISON_CHECK invocations.
6107 * tests/c++.at: Likewise.
6108 * tests/calc.at: Likewise.
6109 * tests/conflicts.at: Likewise.
6110 * tests/cxx-type.at: Likewise.
6111 * tests/existing.at: Likewise.
6112 * tests/glr-regression.at: Likewise.
6113 * tests/headers.at: Likewise.
6114 * tests/input.at: Likewise.
6115 * tests/java.at: Likewise.
6116 * tests/output.at: Likewise.
6117 * tests/push.at: Likewise.
6118 * tests/reduce.at: Likewise.
6119 * tests/regression.at: Likewise.
6120 * tests/sets.at: Likewise.
6121 * tests/skeletons.at: Likewise.
6122 * tests/synclines.at: Likewise.
6123 * tests/torture.at: Likewise.
6124 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
6125 tends to hang xsltproc.
6126 (Big horizontal): Likewise.
6127
61282007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
6129
6130 In XML output, remove redundant class attribute on symbol element.
6131 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
6132 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
6133 look up a symbol to determine whether it's a nonterminal or terminal.
6134 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
6135 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
6136
6137 Add prec/assoc information to XML output.
6138 * src/gram.c (grammar_rules_print_xml): For each rule that has a
6139 %prec, add a percent_prec attribute.
6140 * src/print-xml.c (print_grammar): For each terminal that has a
6141 precedence or associativity, add a prec or assoc attribute.
6142 (xml_indent): New.
6143 (xml_puts): Use xml_indent.
6144 (xml_printf): Use xml_indent.
6145 * src/print-xml.h (xml_indent): Prototype.
6146
6147 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
6148 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
6149
61502007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
6151
6152 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
6153 (bison:ruleByNumber): ... this for clarity.
6154 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
6155 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
6156 (xsl:template match="reduction"): Update.
6157 (xsl:template match="item"): Update.
6158 (xsl:template match="reduction"): Update.
6159
6160 In the XML output, don't print the list of rules where symbols appear.
6161 Compute it in XSLT instead. Discussed at
6162 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
6163 * data/xslt/bison.xsl (bison:ruleByLhs): New.
6164 (bison:ruleByRhs): New.
6165 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
6166 bison:ruleByRhs.
6167 (xsl:template match="terminal/rule"): Remove.
6168 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
6169 bison:ruleByRhs.
6170 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
6171 Remove.
6172 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
6173 bison:ruleByRhs and mode="number-link" for rule template.
6174 (xsl:template match="terminal/rule"): Remove.
6175 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
6176 bison:ruleByRhs and mode="number-link" for rule template.
6177 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
6178 Rewrite as...
6179 (xsl:template match="rule" mode="number-link"): ... this.
6180 * src/print-xml.c (print_grammar): Don't print the list of rules.
6181
61822007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
6183
6184 Don't let --report affect XML output; always print all information.
6185 Discussed at
6186 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
6187 * src/conflicts.c (log_resolution): Implement.
6188 * src/print-xml.c (print_core): Implement.
6189 (print_state): Implement.
6190 (print_xml): Implement.
6191
6192 * NEWS (2.3a+): Fix quotes.
6193 * src/parse-gram.y (prologue_declaration): For consistency with -v,
6194 don't let %verbose clear the list specified by --report.
6195
61962007-11-26 Akim Demaille <akim@epita.fr>
6197
6198 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
6199
62002007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
6201
6202 In the XML output, list useless and unused symbols and rules with the
6203 useful ones and add a "usefulness" attribute. Discussed starting at
6204 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
6205 * src/gram.c (grammar_rules_partial_print_xml): Remove.
6206 (grammar_rules_print_xml): Print all rules instead of just those
6207 useful in the grammar, and add a "usefulness" attribute.
6208 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
6209 * src/print-xml.c (print_rules_useless_in_parser): Remove.
6210 (print_grammar): Print all nonterminals instead of just useful ones,
6211 and add a "usefulness" attribute to nonterminals and terminals.
6212 (print_xml): Don't print a separate "reductions" or
6213 "rules-useless-in-parser" element.
6214 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
6215 (reduce_xml): Remove.
6216 (reduce_token_unused_in_grammar): New.
6217 (reduce_nonterminal_useless_in_grammar): New.
6218 * src/reduce.h (reduce_xml): Remove prototype.
6219 (reduce_token_unused_in_grammar): Add prototype.
6220 (reduce_nonterminal_useless_in_grammar): Add prototype.
6221 * data/xslt/xml2text.xsl: Update for XML changes.
6222 * data/xslt/xml2xhtml.xsl: Update for XML changes.
6223 * tests/reduce.at (Useless Terminals): Update output.
6224 (Useless Rules): Update output.
6225 (Reduced Automaton): Update output.
6226
6227 Say "Terminals unused in grammar" instead of "Unused terminals".
6228 * NEWS (2.3a+): Update.
6229 * doc/bison.texinfo (Understanding): Update example output.
6230 * src/reduce.c (reduce_output): Implement.
6231 * data/xslt/xml2text.xsl: Implement.
6232 * data/xslt/xml2xhtml.xsl: Implement.
6233
62342007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
6235
6236 Accept --report-file=FILE to override the default `.output' filename.
6237 * NEWS (2.3a+): Mention.
6238 * doc/bison.texinfo (Bison Options): Add an entry.
6239 * src/files.c (compute_output_file_names): Don't override
6240 spec_verbose_file if already set.
6241 * src/getargs.c (usage): Document --report-file.
6242 (REPORT_FILE_OPTION): New anonymous enum member.
6243 (long_options): Add entry for it.
6244 (getargs): Add case for it setting spec_verbose_file.
6245
6246 * build-aux/cross-options.pl: Don't record a short option just because
6247 there's an arg.
6248 * doc/.cvsignore: Add yacc.1.
6249
62502007-11-14 Akim Demaille <akim@epita.fr>
6251
6252 * doc/yacc.1.in: New.
6253 * configure.ac, doc/Makefile.am: Adjust.
6254 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
6255 config.h symbol.
6256 Use AC_SUBST for assignments too.
6257 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
6258
62592007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
6260
6261 * src/gram.c: Remove comments that duplicate comments in gram.h.
6262
6263 When reporting useless rules and nonterminals, say "useless in grammar"
6264 instead of "useless", and say "useless in parser" instead of "never
6265 reduced". Discussed starting at
6266 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
6267 * NEWS (2.3a+): Mention this change.
6268 * data/xslt/xml2text.xsl: Update output text and expected input XML
6269 element names to match changes below.
6270 * data/xslt/xml2xhtml.xsl: Likewise.
6271 (xsl:template match="bison-xml-report"): Add missing entry in Table of
6272 Contents: "Rules useless in parser due to conflicts".
6273 * doc/bison.texinfo (Decl Summary): Reword a little.
6274 (Understanding): Update example output for changes below.
6275 * src/gram.c: (rule_useful_p): Rename to...
6276 (rule_useful_in_grammar_p): ... this.
6277 (rule_useless_p): Rename to...
6278 (rule_useless_in_grammar_p): ... this.
6279 (rule_never_reduced_p): Rename to...
6280 (rule_useless_in_parser_p): ... this.
6281 (grammar_rules_print): Update for renames.
6282 (grammar_rules_print_xml): Update for renames.
6283 (grammar_rules_never_reduced_report): Rename to...
6284 (grammar_rules_useless_report): ... this since it is used for either
6285 kind of useless rule.
6286 * src/gram.h: Reword comments and update function names in prototypes.
6287 * src/main.c (main): Say "rule useless in parser due to conflicts".
6288 * src/print-xml.c (print_rules_never_reduced): Rename to...
6289 (print_rules_useless_in_parser): ... this, and rename output XML
6290 element "rules-never-reduced" to "rules-useless-in-parser".
6291 (print_xml): Update for rename.
6292 * src/print.c (print_results): Say "Rules useless in parser due to
6293 conflicts".
6294 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
6295 (nonterminals_reduce): Say "nonterminal useless in grammar".
6296 (reduce_output): Say "Nonterminals useless in grammar".
6297 Say "Rules useless in grammar".
6298 (reduce_xml): Rename output XML element "useless" to
6299 "useless-in-grammar".
6300 (reduce_print): Don't report the count of grammatically useless rules
6301 as "rules never reduced" just because %yacc is specified.
6302 In the correct report of this count, say nonterminal(s) and rule(s)
6303 "useless in grammar".
6304 * tests/conflicts.at (S/R in initial): Update expected output.
6305 (Defaulted Conflicted Reduction): Likewise.
6306 (Unreachable States After Conflict Resolution): Likewise.
6307 * tests/existing.at (GNU pic Grammar): Likewise.
6308 * tests/reduce.at (Useless Nonterminals): Likewise.
6309 (Useless Rules): Likewise.
6310 (Reduced Automaton): Likewise.
6311 (Underivable Rules): Likewise.
6312 (Empty Language): Likewise.
6313
63142007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
6315
6316 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
6317 here document and before the EOF so that BSD's implementation of Bourne
6318 shell doesn't parse the delimiter as part of the here document.
6319 * doc/.cvsignore: Add cross-options.texi.
6320 * src/getargs.c (usage): Add a blank line after the warning categories.
6321
63222007-11-08 Paolo Bonzini <bonzini@gnu.org>
6323
6324 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
6325
63262007-11-05 Akim Demaille <akim@epita.fr>
6327
6328 Remove Id: from bison.1.
6329 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
6330 (perl -0777 -pi -e 's/\.PP\nId): New.
6331 (.x.1): Use it to ignore the version control revision.
6332
63332007-11-05 Akim Demaille <demaille@gostai.com>
6334
6335 * build-aux/Makefile.am: Ship cross-options.pl.
6336 * doc/Makefile.am: Always refer to cross-options.texi with
6337 $(srcdir).
6338 (MAINTAINERCLEANFILES): Add it.
6339
63402007-11-04 Akim Demaille <demaille@gostai.com>
6341
6342 Generate the long/short option cross-table.
6343 * build-aux/cross-options.pl: New.
6344 * doc/Makefile.am (cross-options.texi): New.
6345 * doc/bison.texinfo: Use it.
6346
63472007-11-04 Akim Demaille <demaille@gostai.com>
6348
6349 Generate bison.1 using help2man.
6350 * doc/common.x, doc/bison.x: New.
6351 * doc/Makefile.am (bison.1, .x.1): New.
6352 The code is taken from autoconf-2.61/man/Makefile.am.
6353 * configure.ac: Look for help2man.
6354
63552007-11-04 Akim Demaille <demaille@gostai.com>
6356
6357 Complete --help.
6358 * src/getargs.c (usage): Document -W, make it clear that -d,
6359 -g and -x have optional arguments.
6360
63612007-11-04 Akim Demaille <demaille@gostai.com>
6362
6363 Find sha1sum when named gsha1sum.
6364 * bootstrap (find_tool): New.
6365 ($SHA1SUM): New.
6366
63672007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
6368
6369 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
6370 at
6371 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
6372 * NEWS (2.3a+): Mention.
6373 * data/bison.m4 (b4_pure_if): Don't define it here.
6374 * data/c.m4 (b4_identification): Depend on individual skeletons to
6375 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
6376 values of the %define variables api.pure or api.push_pull. Define
6377 YYPURE, YYPUSH, and YYPULL accordingly.
6378 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
6379 glr.cc has already defined b4_pure_flag.
6380 * data/push.c: Define b4_pure_if based on `%define api.pure'.
6381 Remove YYPUSH and YYPULL since they're back in b4_identification again.
6382 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
6383 * doc/bison.texinfo (Pure Decl): Update.
6384 (Push Decl): Update.
6385 (Decl Summary): Add api.pure to %define entry.
6386 In %pure-parser entry, say it's deprecated and reference %define.
6387 (Pure Calling): Update.
6388 (Error Reporting): Update.
6389 (C++ Scanner Interface): Update.
6390 (How Can I Reset the Parser): Update.
6391 (Table of Symbols): In %pure-parser entry, say it's deprecated and
6392 reference %define.
6393 * src/getargs.c (pure_parser): Remove global variable.
6394 * src/getargs.h (pure_parser): Remove extern.
6395 * src/output.c (prepare): Don't define pure_flag muscle.
6396 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
6397 wrapper around `%define api.pure'.
6398 * tests/calc.at (Simple LALR Calculator): Update.
6399 (Simple GLR Calculator): Update.
6400 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
6401 Update.
6402 (GLR: Resolve ambiguity, pure, locations): Update.
6403 (GLR: Merge conflicting parses, pure, no locations): Update.
6404 (GLR: Merge conflicting parses, pure, locations): Update.
6405 * tests/glr-regression.at (Uninitialized location when reporting
6406 ambiguity): Update
6407 * tests/input.at (Unused %define api.pure): New test case.
6408 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
6409 AT_PURE_IF and AT_PURE_AND_LOC_IF.
6410 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
6411
64122007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
6413
6414 %define push_pull -> %define api.push_pull. Discussed starting at
6415 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
6416 * data/push.c: Expect the new name.
6417 * data/yacc.c: Likewise.
6418 * doc/bison.texinfo (Push Decl): Update.
6419 (Decl Summary): Update %define entry.
6420 (Push Parser Function): Update.
6421 (Pull Parser Function): Update.
6422 (Parser Create Function): Update.
6423 (Parser Delete Function): Update.
6424 * tests/calc.at (Simple LALR Calculator): Update.
6425 * tests/input.at (%define enum variables): Update.
6426 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
6427 (Push Parsing: Multiple impure instances): Update.
6428 (Push Parsing: Unsupported Skeletons): Update.
6429 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
6430 (Exploding the Stack Size with Malloc): Update.
6431
6432 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
6433 other entries some.
6434
64352007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
6436
6437 For the XML output's terminal element, rename @number to @token-number,
6438 and add @symbol-number. In the nonterminal element, rename @number to
6439 @symbol-number. Discussed starting at
6440 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
6441 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
6442 renames.
6443 (xsl:template match="nonterminal"): Likewise.
6444 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
6445 (xsl:template match="nonterminal"): Likewise.
6446 * src/print-xml.c (print_grammar): Implement.
6447
64482007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6449
6450 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
6451 2007-10-11 change, the child elements here are items not rules.
6452 (xsl:template match="item"): New.
6453 (xsl:template match="rule"): Update for new reduced itemset.
6454 (xsl:template match="point"): Remove.
6455 (xsl:template match="empty"): For consistency with --graph, don't
6456 output "/* empty */".
6457 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
6458 line-wrap, don't pass a negative value as first-line-length since this
6459 won't work with the following changes.
6460 (xsl:template name="line-wrap"): Simplify slightly.
6461 (xsl:template name="ws-search"): Eliminate recursion.
6462 * src/print_graph.c (print_core): Don't print a reduction's lookahead
6463 set next to an item whose dot is not at the end of the RHS even if it
6464 happens to be associated with the same rule.
6465
64662007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
6467
6468 Add %define lr.keep_unreachable_states.
6469 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
6470 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
6471 * src/main.c (main): Implement it.
6472 * tests/conflicts.at (Unreachable States After Conflict Resolution):
6473 Extend to test it, and fix a typo.
6474
64752007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
6476
6477 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
6478 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
6479 the example .output text.
6480 * tests/regression.at (Extra lookahead sets in report): Improve wording
6481 of comments.
6482
64832007-10-17 Wojciech Polak <polak@gnu.org>
6484
6485 * src/print-xml.c (print_grammar): Renamed
6486 <terminal> and <nonterminal> attributes:
6487 "type" to "number" and "symbol" to "name".
6488 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
6489 Use new attribute names.
6490 (xsl:template match="nonterminal"): Likewise.
6491 * data/xslt/xml2xhtml.xsl: Likewise.
6492
64932007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
6494
6495 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
6496 (Option Cross Key): Likewise.
6497
6498 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
6499 next to an item whose dot is not at the end of the RHS even if it
6500 happens to be associated with the same rule.
6501 * src/print.c (print_core): Likewise.
6502 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
6503 (Resolved SR Conflicts): Update output.
6504 * tests/regression.at (Extra lookahead sets in report): New test case.
6505
65062007-10-11 Wojciech Polak <polak@gnu.org>
6507
6508 * src/print-xml.c (print_core): Remove item set
6509 redundancy.
6510 * data/xslt/bison.xsl (bison:ruleNumber): New key.
6511 Improve processing time. Suggested by Joel E. Denny.
6512 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
6513 Write xsl:param "required" attribute as comment.
6514 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
6515 (xsl:template match="rule"): Support new reduced itemset.
6516 (xsl:template match="point"): Remove.
6517 * data/xslt/xml2xhtml.xsl: Likewise.
6518
65192007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
6520
6521 * src/getargs.c (version): Update copyright year.
6522
65232007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
6524
6525 Make xml2dot.xsl and --graph produce the same output.
6526 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
6527 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
6528 escaped later.
6529 (xsl:template name="output-node"): Use the new escape template instead
6530 of the string-replace template directly.
6531 (xsl:template name="output-edge"): Likewise.
6532 (xsl:template name="escape"): New, escapes backslashes and newlines in
6533 addition to quotation marks.
6534 * src/graphviz.c (start_graph, output_node, output_edge): Add
6535 whitespace to output for legibility.
6536
6537 Make xml2text.xsl and --report produce the same output, and remove the
6538 XML "conflicts" element since a conflict summary is easily extracted
6539 from the automaton.
6540 * data/xslt/bison.xsl: New.
6541 (xsl:template match="state" mode="bison:count-conflicts): New.
6542 * data/xslt/xml2text.xsl: Import bison.xsl.
6543 (xsl:template match="bison-xml-report"): Instead of styling the
6544 "conflicts" element, style the "automaton" element with mode
6545 "conflicts". Unlike the former, the latter lists S/R and R/R
6546 conflicts for a state on the same line.
6547 (xsl:template match="conflicts"): Remove.
6548 (xsl:template match="conflict"): Remove.
6549 (xsl:template match="terminal"): Line-wrap the list of rules in which
6550 the terminal is used.
6551 (xsl:template match="nonterminal"): Likewise for nonterminals.
6552 (xsl:template match="automaton" mode="conflicts"): New.
6553 (xsl:template match="state" mode="conflicts"): New.
6554 (xsl:template name="line-wrap"): New.
6555 (xsl:template name="ws-search"): New.
6556 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
6557 (xsl:template match="bison-xml-report"): Instead of styling the
6558 "conflicts" element, style the "automaton" element with mode
6559 "conflicts."
6560 (xsl:template match="conflicts"): Remove.
6561 (xsl:template match="conflict"): Remove.
6562 (xsl:template match="automaton" mode="conflicts"): New.
6563 (xsl:template match="state" mode="conflicts): New.
6564 * src/conflicts.c (conflicts_output_xml): Remove.
6565 * src/conflicts.h (conflicts_output_xml): Remove prototype.
6566 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
6567 * src/print.c (print_grammar): Consistently wrap at the 66th column so
6568 the corresponding XSLT is easier. Also, never wrap between a word and
6569 the comma that follows it.
6570
65712007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
6572
6573 Improve C++ namespace support. Discussed starting at
6574 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
6575 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
6576 b4_namespace_close): New macros that interpret the %define variable
6577 "namespace" so its value can contain "::" to indicate nested
6578 namespaces.
6579 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
6580 the above macros.
6581 * data/lalr1.cc (b4_namespace): Likewise.
6582 * data/location.cc (b4_namespace): Likewise.
6583 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
6584 inside a new table in the general %define entry. Document `%define
6585 namespace' there as well. Point the %name-prefix entry to it since it
6586 explains it more completely in the case of C++.
6587 (C++ Bison Interface): Mention `%define namespace' instead of
6588 %name-prefix.
6589 (Table of Symbols): Remove the `%define push_pull' entry. The %define
6590 entry suffices.
6591 * tests/c++.at (Relative namespace references): New test case.
6592 (Absolute namespace references): New test case.
6593 (Syntactically invalid namespace references): New test case.
6594 * tests/input.at (C++ namespace reference errors): New test case.
6595
65962007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
6597
6598 Add syncline support and location accessor to internal %define
6599 interfaces.
6600 * data/bison.m4 (b4_percent_define_get_loc): New.
6601 (b4_percent_define_get_syncline): New.
6602 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
6603 (b4_percent_define_default): Record defining location as line 1 rather
6604 than 0 for the sake of synchronizing #line's, and define
6605 b4_percent_define_syncline(VARIABLE).
6606 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
6607 * src/muscle_tab.c (muscle_syncline_grow): New.
6608 (muscle_code_grow): Use muscle_syncline_grow.
6609 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
6610 define b4_percent_define_syncline(VARIABLE).
6611 (muscle_percent_define_get_loc): New.
6612 (muscle_percent_define_get_syncline): New.
6613 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
6614 remove some unused variables.
6615 (muscle_percent_define_default): Record defining location as line 1
6616 rather than 0 for the sake of synchronizing #line's, and define
6617 b4_percent_define_syncline(VARIABLE).
6618 (muscle_percent_define_check_values): Use
6619 muscle_percent_define_get_loc.
6620 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
6621 (muscle_percent_define_get_syncline): Prototype.
6622 * tests/skeletons.at (%define Boolean variables: invalid skeleton
6623 defaults): Update output for location change.
6624 (Complaining during macro argument expansion): Extend to test
6625 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
6626
66272007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
6628
6629 Fix some error-reporting macro bugs.
6630 * data/bison.m4 (b4_cat): New.
6631 (b4_error, b4_error_at): Use b4_cat to send error directives directly
6632 to stdout so they don't become arguments to other macros. Update
6633 comments and add examples.
6634 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
6635 add examples.
6636 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
6637 after printing the error directive so that M4 doesn't report subsequent
6638 problems that are induced by this problem.
6639 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
6640 instead of just in them. Recognize @\n in both places. Both expand to
6641 the empty string. Needed by b4_cat.
6642 * tests/skeletons.at (Complaining during macro argument expansion):
6643 New test case.
6644 (Fatal errors make M4 exit immediately): New test case.
6645
66462007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
6647
6648 Implement --print-datadir.
6649 * src/getargs.c (usage): Mention.
6650 (PRINT_DATADIR_OPTION): New anonymous enum member.
6651 (long_options): Add entry for it.
6652 (getargs): Add case for it calling compute_pkgdatadir.
6653 * src/output.c (output_skeleton): Encapsulate data directory
6654 computation from here...
6655 (prepare): ... and from here...
6656 (compute_pkgdatadir): ... into this new function.
6657 * src/output.h (compute_pkgdatadir): Prototype.
6658
66592007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
6660
6661 * src/print-xml.c (escape_bufs): New static global variable
6662 replacing...
6663 (xml_escape_n): ... the static local variable buf here.
6664 (print_xml): Free memory for escape_bufs.
6665 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
6666
66672007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
6668
6669 Replace `%push-parser' and `%push-pull-parser' with
6670 `%define push_pull "push"' and `%define push_pull "both"'.
6671 `%define push_pull "pull"' is the default.
6672 * doc/bison.texinfo (Push Decl, Push Parser Function,
6673 Pull Parser Function, Parser Create Function, Parser Delete Function):
6674 Update declarations.
6675 (Decl Summary, Table of Symbols): Replace %push-parser and
6676 %push-pull-parser entries with a %define push_pull entry.
6677 * data/bison.m4 (b4_percent_define_check_values): New macro.
6678 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
6679 definitions...
6680 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
6681 definitions...
6682 * data/push.c: ... to here and compute them from the value of the
6683 %define variable push_pull.
6684 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
6685 parsing requests here...
6686 * data/yacc.c: ... hack this to switch to push.c any time
6687 b4_use_push_pull_flag or the %define variable push_pull is set. This
6688 will go away when we mv push.c yacc.c.
6689 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
6690 push parsing is not supported since unused %define variables are
6691 reported anyway.
6692 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
6693 * src/muscle_tab.h (muscle_percent_define_check_values): Update
6694 comments for consistency with b4_percent_define_check_values.
6695 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
6696 muscles.
6697 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
6698 Remove.
6699 (prologue_declaration): Remove %push-parser and %push-pull-parser
6700 rules.
6701 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
6702 * tests/calc.at: Update declarations.
6703 * tests/input.at (%define enum variables): New test case.
6704 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
6705 declaration.
6706 (Push Parsing: Multiple impure instances): Update declaration.
6707 (Push Parsing: Unsupported Skeletons): New test case.
6708 * tests/torture.at (Exploding the Stack Size with Alloca): Update
6709 declaration.
6710 (Exploding the Stack Size with Malloc): Update declaration.
6711
67122007-09-24 Wojciech Polak <polak@gnu.org>
6713
6714 Add XSLT transformations.
6715
6716 * data/xslt/xml2dot.xsl: Transform XML into DOT.
6717 * data/xslt/xml2text.xsl: Transform XML into plain text.
6718 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
6719 * data/Makefile.am (xsltdir): New variable.
6720 (dist_xslt_DATA): Add xslt/*.xsl files.
6721
67222007-09-23 Paul Eggert <eggert@cs.ucla.edu>
6723
6724 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
6725 Problem reported by Wojciech Polak.
6726 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
6727 (xml_printf): Undo change I made on 21 September; that is,
6728 indent 2 spaces, not 1.
6729
67302007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
6731
6732 Pacify ./configure --enable-gcc-warnings.
6733 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
6734 `char const *' instead of `char *'.
6735 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
6736 local variable `sep'.
6737
67382007-09-21 Paul Eggert <eggert@cs.ucla.edu>
6739
6740 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
6741 elsewhere.
6742 * src/print-xml.c: Prefer "const" after types; that's more consistent.
6743 (xml_printf): Indent just 1 space for level.
6744 (e_char, xlate_char): Remove.
6745 (xml_escape_string): Rewrite to avoid undefined behavior (used
6746 storage that was freed from the stack).
6747 (xml_escape_n): Don't bother checking for subscript error.
6748
67492007-09-21 Wojciech Polak <polak@gnu.org>
6750
6751 Add Bison XML Automaton Report.
6752
6753 Add support for an -x option to generate an XML report.
6754 It is not documented yet.
6755 * src/print-xml.c: New file.
6756 * src/print-xml.h: Likewise.
6757 * lib/timevar.def (TV_XML): New var.
6758 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
6759 * src/conflicts.c: Include print-xml.h.
6760 (solved_conflicts_xml_obstack): New var.
6761 (log_resolution, conflicts_solve, conflicts_free):
6762 Add support for XML report.
6763 (conflicts_output_val): New function.
6764 * src/conflicts.h (conflicts_output_val): New decl.
6765 * src/files.c (spec_xml_file): New var.
6766 (compute_output_file_names, output_file_names_free): Add XML support.
6767 * src/files.h (spec_xml_file): New decl.
6768 * src/getargs.c (xml_flag): New var.
6769 (usage, short_options, long_options, getargs): Add XML support.
6770 * src/getargs.h (xml_flag): New decl.
6771 * src/gram.c: Include print-xml.h.
6772 (rule_lhs_print_xml, rule_rhs_print_xml):
6773 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
6774 New functions.
6775 * src/gram.h: Declare external ones.
6776 * src/main.c: Include print-xml.h.
6777 (main): Add XML support.
6778 * src/reduce.c: Include print-xml.h.
6779 (reduce_xml): New function.
6780 * src/reduce.h: Declare it.
6781 * src/state.c: Include print-xml.h.
6782 (state_new): Add XML support.
6783 (state_rule_lookahead_tokens_print_xml): New function.
6784 * src/state.h: Declare it.
6785 (struct state): New member solved_conflicts_xml.
6786 * src/symtab.c (symbol_class_get_string): New function.
6787 * src/symtab.h: Declare it.
6788
67892007-09-21 Paul Eggert <eggert@cs.ucla.edu>
6790
6791 * GNUmakefile: Switch to coreutils's version.
6792 * bootstrap: Likewise.
6793 * Makefile.cfg: Adjust to new GNUmakefile.
6794 * README-hacking: Likewise.
6795
6796 Import from gnulib:
6797
6798 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
6799 Bruno Haible <bruno@clisp.org>
6800
6801 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
6802 and is a script that invokes bison. Tighten the code. Add comments.
6803
68042007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
6805
6806 Spell "boolean" as "Boolean". Reported by Akim Demaille.
6807 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
6808 * doc/bison.texinfo (Decl Summary): Fix.
6809 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
6810 * tests/input.at (Boolean %define variables): Update output.
6811 * tests/skeletons.at (%define boolean variables: invalid skeleton
6812 defaults): Rename to...
6813 (%define Boolean variables: invalid skeleton defaults): ... this and
6814 update output.
6815
68162007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
6817
6818 In impure push mode, don't allow more than one yypstate to be allocated
6819 since multiple impure parsers would corrupt yynerrs.
6820 * data/push.c (yypstate_allocated): New static global variable
6821 initialized to 0.
6822 (yypull_parse): If yypstate_new returns 0, don't report it as memory
6823 exhaustion if yypstate_allocated is 1, but still return 2.
6824 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
6825 already 1. Otherwise, set it to 1.
6826 (yypstate_delete): Set it to 0.
6827 * tests/push.at (Push Parsing: Multiple impure instances): New test
6828 case.
6829
68302007-08-17 Bob Rossi <bob@brasko.net>
6831
6832 * doc/bison.texinfo (Push Decl): Document the push parser.
6833 (Table of Symbols): Ditto.
6834 (Pure Decl): Ditto.
6835 (Decl Summary): Ditto.
6836 (Multiple Parsers, Push Parser Function, Pull Parser Function,
6837 Parser Create Function, Parser Delete Function):
6838 Add new push parser symbols.
6839 (Table of Symbols): Document push-parser, push-pull-parser,
6840 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
6841
68422007-08-15 Paul Eggert <eggert@cs.ucla.edu>
6843
6844 Update to GPLv3.
6845 * doc/gpl-3.0.texi: New file.
6846 * doc/gpl.texi: Remove.
6847 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
6848 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
6849 * README-hacking, TODO, bootstrap, bootstrap.conf:
6850 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
6851 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
6852 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
6853 * data/lalr1.cc, data/lalr1.java, data/location.cc:
6854 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
6855 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
6856 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
6857 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
6858 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
6859 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
6860 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
6861 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
6862 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
6863 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
6864 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
6865 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
6866 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
6867 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
6868 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
6869 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
6870 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
6871 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
6872 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
6873 * src/complain.c, src/complain.h, src/conflicts.c:
6874 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
6875 * src/files.h, src/flex-scanner.h, src/getargs.c:
6876 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
6877 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
6878 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
6879 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
6880 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
6881 * src/print.c, src/print.h, src/print_graph.c:
6882 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
6883 * src/reduce.h, src/relation.c, src/relation.h:
6884 * src/revision.h, src/scan-code.h, src/scan-code.l:
6885 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
6886 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
6887 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
6888 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
6889 * tests/Makefile.am, tests/actions.at, tests/c++.at:
6890 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
6891 * tests/existing.at, tests/glr-regression.at:
6892 * tests/headers.at, tests/input.at, tests/java.at:
6893 * tests/local.at, tests/output.at, tests/push.at:
6894 * tests/reduce.at, tests/regression.at, tests/sets.at:
6895 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
6896 * tests/torture.at:
6897 Update to GPLv3.
6898
68992007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
6900
6901 Get rid of broken %no-parser, -n, and --no-parser implementation and
6902 documentation.
6903 * TODO: Don't mention them.
6904 * doc/bison.1: Likewise.
6905 * doc/bison.texinfo (Decl Summary): Likewise.
6906 (Bison Options): Likewise.
6907 (Option Cross Key): Likewise.
6908 * src/getargs.c (no_parser_flag): Remove global variable.
6909 (usage): Don't print description of -n and --no-parser.
6910 (long_options): Remove --no-parser entry here.
6911 (getargs): Remove -n case in the switch here.
6912 * src/getargs.h (no_parser_flag): Remove extern.
6913 * tests/regression.at (Web2c Actions): Remove comment that mentions
6914 --no-parser.
6915
69162007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
6917
6918 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
6919 name user variables starting with `yy'. Just pass NULL instead of a
6920 dummy local &yylval to yypush_parse.
6921 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
6922 starting with `yy'.
6923
69242007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
6925
6926 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
6927 true since it's then always used regardless of whether yyoverflow is
6928 defined. Reported by Christian Burger at
6929 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
6930 * THANKS: Add Christian Burger.
6931
6932 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
6933 node names: say "Decl Summary" not "Bison Declaration Summary".
6934
69352007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
6936
6937 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
6938 determine whether this function has already complained about an invalid
6939 value for a %define boolean variable, don't check whether Bison has
6940 ever examined the value. As written, the check was a tautology.
6941 Instead, record and check for this complaint using a separate muscle.
6942
69432007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
6944
6945 Fix push parsing memory leak reported by Brandon Lucia at
6946 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
6947 * THANKS: Add Brandon Lucia.
6948 * data/push.c (yypstate_delete): Free the stack if it was reallocated
6949 but the parse never completed and thus freed it.
6950 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
6951 * tests/testsuite.at: Include push.at.
6952 * test/push.at: New.
6953 (Push Parsing: Memory Leak for Early Deletion): New test case.
6954
69552007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
6956
6957 Improve handling of multiple S/R conflicts in the same state and of S/R
6958 conflicts involving multiple reductions.
6959 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
6960 set for a state here or Bison will abort if it is reassigned on a
6961 later conflicted reduction in the same state.
6962 Similarly, don't finalize and assign the solved conflicts report here
6963 or it will be lost if it is reassigned on a later conflicted reduction
6964 in the same state.
6965 (set_conflicts): Instead, assign them both here after all S/R conflicts
6966 in the state have been fully examined.
6967 * src/print.c (shift_set): Rename to...
6968 (no_reduce_set): ... this.
6969 (print_reductions): Update for rename, and add %nonassoc error action
6970 tokens to no_reduce_set so that, when printing the first remaining
6971 reduction on an error action token, the reduction is enclosed in
6972 brackets.
6973 (print_results): Update for rename.
6974 * tests/conflicts.at (Solved conflicts report for multiple reductions
6975 in a state): New test case.
6976 (%nonassoc error actions for multiple reductions in a state): New test
6977 case.
6978
6979 * src/main.c (main): Don't depend on C99 features.
6980
69812007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
6982
6983 * build-aux/.cvsignore: Add compile.
6984 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
6985 uniwidth.
6986
69872007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
6988
6989 * bootstrap (slurp): Create target directories that don't exist.
6990 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
6991
69922007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
6993
6994 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
6995 than item number.
6996 * closure.c (closure): Likewise.
6997 * state.h (reductions): Comment sorting of rules.
6998 (state): Comment sorting of items.
6999
70002007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
7001
7002 Fix C++ test cases after recent Gnulib changes. Discussed starting at
7003 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
7004 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
7005 definition in order to avoid Gnulib headers since we don't use config.h
7006 here.
7007 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
7008 rather than AT_DATA so that config.h is included.
7009
70102007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
7011
7012 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
7013 instead of fprintf. Guard these functions with #if YYDEBUG instead of
7014 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
7015 and so that YYFPRINTF is guaranteed to be defined here.
7016
70172007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
7018
7019 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
7020 with...
7021 (muscle_percent_define_check_values): ... this more helpful function.
7022 Again, it's not used yet, but it will be.
7023 * src/muscle_tab.h: Likewise.
7024
7025 Improve some comments in parser table construction.
7026 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
7027 (generate_states): Don't mention ruleset, which is internal to closure.
7028 * src/closure.c (closure): Explain sorting of core and itemset, which
7029 is required for this function to behave correctly.
7030 * src/closure.h (closure): Mention sorting.
7031
70322007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
7033
7034 * src/lalr.c (state_lookahead_tokens_count): For code readability,
7035 move the check for disabled transitions to an aver since conflict
7036 resolution hasn't happened yet.
7037
7038 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
7039 labels a state as inconsistent just because it has error transitions.
7040 The original form of this check appeared in revision 1.1 of lalr.c,
7041 which was committed on 1991-12-21. Now (at least), changing the
7042 consistency label on such a state appears to have no useful effect in
7043 any of the places it is examined, which I enumerate below. The key
7044 point to understanding each item in this enumeration is that a state
7045 with an error transition is labelled consistent in the first place only
7046 if it has no rules, so the check cannot matter for states that have
7047 rules. (1) Labelling a state as inconsistent will cause set_conflicts
7048 to try to identify its conflicts, and a state must have *rules* to have
7049 conflicts. (2) Labelling a state as inconsistent will affect how
7050 action_row sets the default *rule* for the state. (3) Labelling a
7051 state as inconsistent will cause build_relations to add lookback edges
7052 to *rules* in that state.
7053 * src/state.h (struct state): Word the comment for member consistent
7054 more carefully.
7055
70562007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
7057
7058 Don't depend on C99 features.
7059 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
7060 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
7061 * src/reader.c (check_and_convert_grammar): Fix for-loop.
7062 * src/state.c (state_mark_reachable_states): Fix for-loop.
7063 (state_remove_unreachable_states): Fix for-loop.
7064
7065 Don't widen struct state with member reachable just to temporarily
7066 record reachability. Instead, use a local bitset.
7067 * src/state.h (struct state): Remove member.
7068 * src/state.c (state_new): Don't initialize it.
7069 (state_mark_reachable_states): Rename to...
7070 (state_record_reachable_states): ... this, and use bitset.
7071 (state_remove_unreachable_states): Use bitset.
7072
70732007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
7074
7075 * src/Makefile.am (yacc): Quote target action commands properly so
7076 that the yacc script isn't corrupt. Reported by Hans Aberg at
7077 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
7078
7079 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
7080 the case of pure parsers. Reported by Frans Englich at
7081 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
7082 * THANKS: Add Frans Englich.
7083
7084 * NEWS (2.3a+): In the %code entry, reference section `Bison
7085 Declaration Summary' from the manual now since the %code summary has
7086 moved there.
7087 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
7088 in the rules section must be terminated by semicolons.
7089
70902007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
7091
7092 Extend the front-end API for %define variables to more completely
7093 mirror the back-end. This will be useful in the future.
7094 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
7095 Update comments to mention the new front-end counterparts of these
7096 macros.
7097 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
7098 for muscle_string_decode and muscle_location_decode.
7099 (muscle_string_decode): New static function.
7100 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
7101 (muscle_percent_define_get, muscle_percent_define_ifdef): New
7102 functions.
7103 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
7104 muscle_percent_define_get to mimic the b4_percent_define_flag_if
7105 implementation more closely.
7106 (muscle_percent_define_invalid_value): New function.
7107 * src/muscle_tab.h (muscle_percent_define_get,
7108 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
7109 Prototype.
7110
71112007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
7112
7113 * NEWS (2.3a+): Mention yesterday's state-removal change.
7114 (2.3a): Remove the %language entry, which was added after 2.3a.
7115 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
7116 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
7117 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
7118 tests/existing.at: Update copyright date.
7119
71202007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
7121
7122 If conflict resolution makes states unreachable, remove those states,
7123 report rules that are then unused, and don't report conflicts in those
7124 states.
7125 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
7126 New global function.
7127 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
7128 function.
7129 * src/main.c (main): After conflict resolution, remove the unreachable
7130 states and update all data structures that reference states by number.
7131 * src/state.c (state_new): Initialize each state's reachable member to
7132 false.
7133 (state_mark_reachable_states): New static function.
7134 (state_remove_unreachable_states): New global function.
7135 * src/state.h (struct state): Add member bool reachable.
7136 (state_remove_unreachable_states): Prototype.
7137 * tests/conflicts.at (Unreachable States After Conflict Resolution):
7138 New test case.
7139 * tests/existing.at (GNU pic Grammar): Update test case output now that
7140 an unused rule is discovered.
7141
71422007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
7143
7144 Minor code cleanup in parser table construction.
7145 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
7146 (new_itemsets, save_reductions): Update for rename to nitemset.
7147 * src/closure.c (nritemset): Rename to...
7148 (nitemset): ... this since the "r" appears to meaningless and isn't
7149 used in the comments.
7150 (closure): Update for rename.
7151 * src/closure.h (nritemset): Update extern to...
7152 (nitemset): ... this.
7153 * src/lalr.c (LA): Fix a typo in comments.
7154 * src/print.c (print_core): Update for rename to nitemset.
7155 * src/print_graph.c (print_graph): Likewise.
7156 * src/state.h: Fix some typos in header comments.
7157
71582007-04-04 Paul Eggert <eggert@cs.ucla.edu>
7159
7160 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
7161 still sticks to ASCII. Sorry!
7162
7163 * README-hacking: New file, taken mostly from coreutils, with changes
7164 for Bison. Contains much of the contents of:
7165 * README-cvs: Remove.
7166 * bootstrap: Sync from gnulib.
7167 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
7168 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
7169
71702007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
7171
7172 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
7173 Setzer.
7174 (Java Differences): Fix some typos.
7175 * THANKS: Add Sebastian Setzer.
7176
71772007-03-07 Paolo Bonzini <bonzini@gnu.org>
7178
7179 * data/java.m4 (b4_single_class_if): Remove.
7180 (b4_abstract_if): Look at "%define abstract".
7181 (b4_lexer_if): New.
7182 (b4_union_name): Rename...
7183 (b4_yystype): ... to this. Map to "%define stype".
7184 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
7185 b4_maybe_throws): Fix quoting.
7186 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
7187 * data/lalr1.java (Lexer interface): Always define.
7188 (Lexer interface within parser class): Remove.
7189 (YYLexer class): New, used when "%code lexer" is present.
7190 (constructor): When "%code lexer" is used, pass %lex-param
7191 to the lexer constructor.
7192 (yylex, yyparse): Remove %lex-param from method invocations
7193 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
7194
7195 * doc/bison.texinfo (Java Bison Interface): Mention "%define
7196 abstract". Rename "%define union_name" to "%define stype".
7197 Rename method names according to previous patch.
7198 (Java Scanner Interface): Describe "%code lexer" instead of
7199 "%pure-parser" and "%define single_class".
7200 (Java Differences): Mention "%code lexer".
7201
7202 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
7203 Include scanner here, using macros from tests/local.at.
7204 (AT_DATA_CALC_Y): Remove final argument.
7205 (_AT_CHECK_JAVA_CALC): Likewise.
7206 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
7207 of %locations and %error-verbose.
7208 (main): Test with and without %lex-param.
7209 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
7210 (AT_BISON_OPTION_POPDEFS): Pop it.
7211
72122007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7213
7214 DJGPP spefic issue. Inhibit the use of disallowed characters for
7215 file name genertion on Win98, WinXP, etc. These are |<>":?*\
7216 and concern testsuite case 46.
7217 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
7218 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
7219 * djgpp/config.bat: Inhibit the use of disallowed characters.
7220
72212007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
7222
7223 Miscellaneous %define and %code cleanup.
7224 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
7225 values are interpreted.
7226 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
7227 documentation a little more.
7228 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
7229 muscle_percent_define_insert, muscle_percent_code_grow): New
7230 functions/macros.
7231 * src/muscle_tab.h (muscle_percent_define_insert,
7232 muscle_percent_code_grow): Prototype.
7233 * src/parse-gram.y (prologue_declaration): Use
7234 muscle_percent_define_insert and muscle_percent_code_grow when parsing
7235 %define and %code directives.
7236
7237 Make it easy to share %define boolean variables between the front-end
7238 and back-end. Though not used yet, this will be useful in the future.
7239 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
7240 Bison uses of names rather than just skeleton uses of names.
7241 (b4_percent_define_get, b4_percent_define_ifdef): Rename
7242 b4_percent_define_skeleton_variables(VARIABLE) to
7243 b4_percent_define_bison_variables(VARIABLE).
7244 (b4_percent_code_get, b4_percent_code_ifdef): Rename
7245 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
7246 b4_percent_code_bison_qualifiers(QUALIFIER).
7247 (b4_check_user_names_wrap): Update for renames.
7248 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
7249 muscle_percent_define_default): New functions mimicking
7250 b4_percent_define_flag_if and b4_percent_define_default.
7251
7252 For %define variables, report locations for invalid values and
7253 redefinitions.
7254 * data/bison.m4 (b4_percent_define_flag_if): Read
7255 b4_percent_define_loc(VARIABLE) to report the location of an invalid
7256 value for VARIABLE.
7257 (b4_percent_define_default): Save a special location in
7258 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
7259 must later be reported as invalid.
7260 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
7261 functions.
7262 (muscle_percent_define_insert): Record the location of VARIABLE in
7263 muscle percent_define_loc(VARIABLE), and use it to report the previous
7264 location for a redefinition.
7265 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
7266 (muscle_percent_define_default): Update like b4_percent_define_default.
7267 (muscle_grow_user_name_list): Rename to...
7268 (muscle_user_name_list_grow): ... this for consistency and use
7269 muscle_location_grow.
7270 * src/muscle_tab.h (muscle_location_grow): Prototype.
7271 * tests/input.at (%define errors): Update expected output.
7272 * tests/skeletons.at (%define boolean variables: invalid skeleton
7273 defaults): New test case.
7274
72752007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
7276
7277 * src/print.c (lookahead_set, state_default_rule): Remove.
7278 (print_reductions): Replace state_default_rule invocation with
7279 equivalent use of yydefact, which was computed in token_actions in
7280 tables.c.
7281 (print_results): Don't allocate lookahead_set.
7282
72832007-02-27 Paolo Bonzini <bonzini@gnu.org>
7284
7285 * data/lalr1.java: Prefix all private members with yy.
7286
72872007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
7288
7289 Use YYFPRINTF instead of fprintf where appropriate. Reported by
7290 Sebastien Fricker at
7291 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
7292 * THANKS: Add Sebastien Fricker.
7293 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
7294 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
7295 accept a variable number of arguments.
7296
72972007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
7298
7299 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
7300
73012007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7302
7303 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
7304 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
7305 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
7306
73072007-02-11 Paul Eggert <eggert@cs.ucla.edu>
7308
7309 Undo my 2007-02-07 change, switching back to the c-strcase module
7310 introduced in the 2007-02-03 change. Bruno Haible reported that
7311 the 2007-02-07 change would be dangerous in Turkish if we add a
7312 language whose name contains "i", since "i" is not lowercase "I"
7313 in Turkish.
7314 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
7315 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
7316 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
7317 * m4/.cvsignore: Remove strcase.m4.
7318 * src/getargs.c: Revert 2007-02-07 change, as follows.
7319 Include c-strcase.h.
7320 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
7321
73222007-02-11 Bruno Haible <bruno@clisp.org>
7323
7324 Enable the Java related testsuite tests when the only Java compiler
7325 found is a gcj < 4.3. Discussed at
7326 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
7327 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
7328
73292007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
7330
7331 * data/Makefile.am: Update copyright date.
7332 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
7333 yypstate_new returns NULL.
7334 (yypstate_new): Return NULL if malloc does.
7335 * src/reader.c (packgram): Move translation of rule actions from the
7336 beginning of packgram to...
7337 (check_and_convert_grammar): ... here right before packgram is invoked
7338 so it's easier to write more complete comments, and remove redundant
7339 code.
7340
73412007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
7342
7343 As in semantic actions, make @$ in %initial-action, %destructor, and
7344 %printer imply %locations.
7345 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
7346 scanning @$.
7347 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
7348 (@$ in %initial-action implies %locations,
7349 @$ in %destructor implies %locations,
7350 @$ in %printer implies %locations): ... these new test cases.
7351
73522007-02-07 Paul Eggert <eggert@cs.ucla.edu>
7353
7354 Undo most of the 2007-02-03 change, switching to the strcase module
7355 now that gnulib strcase has been fixed.
7356 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
7357 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
7358 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
7359 * m4/.cvsignore: Add strcase.m4.
7360 * src/getargs.c: Revert 2007-02-03 change, as follows.
7361 Don't include c-strcase.h.
7362 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
7363 strcasecmp has "unspecified behavior" outside the POSIX locale,
7364 but it works fine in practice if at least one argument is ASCII,
7365 as is the case in Bison.
7366
73672007-02-07 Paolo Bonzini <bonzini@gnu.org>
7368
7369 * tests/java.at: Skip tests if only one of javac/java is present.
7370 Reported by Joel E. Denny.
7371 * tests/atlocal.in: Adjust copyright years.
7372
73732007-02-05 Paolo Bonzini <bonzini@gnu.org>
7374
7375 * data/lalr1.java (Stack): Work around old verifiers that disallow
7376 access to the private fields of an inner class, from the outer class.
7377 We can make Stack's fields public because user code doesn't have access
7378 to the instance of Stack used by parse(). Reported by Paul Eggert.
7379
73802007-02-03 Paul Eggert <eggert@cs.ucla.edu>
7381
7382 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
7383 the right spot for these files?
7384 * bootstrap.conf (gnulib_modules): Add c-strcase.
7385 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
7386 c-strncasecmp.c.
7387 * src/getargs.c: Include c-strcase.h.
7388 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
7389 to avoid unspecified behavior.
7390
73912007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
7392
7393 * doc/bison.texinfo (Decl Summary): Correct typo.
7394
73952007-01-30 Paolo Bonzini <bonzini@gnu.org>
7396
7397 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
7398 Complain if the value does not match empty, "true" or "false".
7399 * data/c++.m4: Adjust default definitions of %define variables.
7400 * data/java.m4: Adjust default definitions of %define variables.
7401 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
7402 to above behavior.
7403 * tests/input.at (Boolean %define variables): Test new behavior.
7404
74052007-01-29 Paolo Bonzini <bonzini@gnu.org>
7406
7407 * NEWS: Mention java.
7408 * TODO: Remove things that are done.
7409 * bootstrap.conf: Add javacomp-script and javaexec-script.
7410 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
7411
7412 * data/Makefile.am: Add new files.
7413 * data/java-skel.m4: New.
7414 * data/java.m4: New.
7415 * data/lalr1.java: New.
7416
7417 * doc/bison.texinfo: Put "A Complete C++ Example" under
7418 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
7419 under Other Languages.
7420
7421 * src/getargs.c (valid_languages): Add Java.
7422 * src/getargs.h (struct bison_language): Update size of string fields.
7423
7424 * tests/Makefile.am: Add java.at.
7425 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
7426 * tests/java.at: New.
7427 * tests/testsuite.at: Include it.
7428
74292007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
7430
7431 Clean up.
7432 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
7433 at_directive_argv arguments so these no longer have to be global
7434 variables. Also, update the implementation for the following changes.
7435 (fail_for_at_directive_too_many_args,
7436 fail_for_at_directive_too_few_args): Add at_directive_name argument.
7437 (at_directive_name): Remove as at_directive_argv[0] will be used for
7438 this now.
7439 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
7440 for the directive name.
7441 (at_directive_argc, at_directive_argv): Make these local within
7442 skel_lex instead of global.
7443 (INITIAL): Update directive start action for above changes.
7444 (SC_AT_DIRECTIVE_ARG): Rename to...
7445 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
7446 (SC_AT_DIRECTIVE_SKIP_WS): Update.
7447 (scan_skel): Move yylex_destroy to...
7448 (skel_scanner_free): ... here.
7449 * tests/skeletons.at (installed skeleton file name): Rename to...
7450 (installed skeleton file names): ... this.
7451
74522007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
7453
7454 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
7455 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
7456 Summary" not "Directives".
7457 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
7458 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
7459 since the former is now the more complete one.
7460 (Prologue Alternatives): Likewise and do the same for %defines.
7461 (Table of Symbols): Add summary of %code, add summary of %define, and
7462 move full %code documentation to...
7463 (Decl Summary): ... here for consistency with other entries in these
7464 sections.
7465 Move %define entry in order to keep this list alphabetized.
7466 Reword %define entry a little to put less emphasis on the skeleton
7467 concept, which most users shouldn't have to think about.
7468
74692007-01-26 Paul Eggert <eggert@cs.ucla.edu>
7470
7471 Adjust to recent gnulib changes.
7472 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
7473 Add string.h, string_.h, unistd_.h, wchar_.h.
7474 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
7475 * src/system.h: Don't include <stpcpy.h>; this is now done by
7476 <string.h>.
7477
74782007-01-23 Paolo Bonzini <bonzini@gnu.org>
7479
7480 Simplify implementation of unqualified %code, implement macros for
7481 uniform treatment of boolean %define flags. Document %define.
7482 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
7483 b4_percent_code_ifdef): New.
7484 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
7485 * data/c++.m4: Define default value for global_tokens_and_yystype.
7486 * data/glr.cc: Likewise.
7487 * data/location.cc: Use b4_percent_define_flag_if.
7488
7489 * doc/bison.texinfo (Decl Summary): Document %define.
7490
7491 * src/parse-gram.y (Unqualified %code): Change muscle name to
7492 b4_percent_code().
7493 (content.opt): Default to empty.
7494
74952007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
7496
7497 Implement support for relative and absolute skeleton file names.
7498 Discussed starting at
7499 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
7500 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
7501 (Bison Options): Document in --skeleton entry.
7502 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
7503 full_skeleton can't necessarily hold all of pkgdatadir.
7504 If the specified skeleton file name contains a `/', don't prepend
7505 pkgdatadir.
7506 * src/parse-gram.y (prologue_declaration): If the specified skeleton
7507 file name contains a `/', prepend the grammar file directory.
7508 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
7509 * skeletons.at: New file.
7510 (relative skeleton file names): New test case.
7511 (installed skeleton file names): New test case.
7512 * tests/testsuite.at: Include skeletons.at.
7513
7514 * bootstrap: Update copyright to 2007.
7515
75162007-01-17 Paolo Bonzini <bonzini@gnu.org>
7517
7518 * bootstrap: Remove occurrences of .#bootmp from the files.
7519
75202007-01-17 Akim Demaille <akim@epita.fr>
7521
7522 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
7523 nonterminals.
7524 Use per-type %printer.
7525
75262007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
7527
7528 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
7529 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
7530 djgpp/config.site, src/files.c, src/files.h, src/main.c,
7531 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
7532 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
7533 tests/glr-regression.at, tests/input.at, tests/local.at,
7534 tests/output.at, tests/torture.at: Update copyright to 2007.
7535
75362007-01-16 Akim Demaille <akim@epita.fr>
7537
7538 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
7539 error code.
7540 (Calc++ Scanner): Exit with failure if we can't open the input
7541 file.
7542 Accept "-" standing for stdin.
7543 (Calc++ Top Level): Print the result only if the parsing was
7544 successful.
7545
75462007-01-16 Akim Demaille <akim@epita.fr>
7547
7548 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
7549
75502007-01-15 Paolo Bonzini <bonzini@gnu.org>
7551 and Joel E. Denny <jdenny@ces.clemson.edu>
7552
7553 Clean up %define and %code implementation in M4 some. Most
7554 importantly, rename all related macros to be in the b4_percent_define
7555 and b4_percent_code namespaces. Also, complete support for `.' in
7556 %define variable names and %code qualifiers.
7557 * data/bison.m4 (b4_check_user_names): Check for special
7558 "SKELETON-NAMESPACE(name)" macros instead of using two nested
7559 m4_foreach loops.
7560 (b4_get_percent_define, b4_get_percent_code): Rename to...
7561 (b4_percent_define_get, b4_percent_code_get): ... these.
7562 Extend documentation with examples.
7563 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
7564 b4_percent_define_skeleton_variables and
7565 b4_percent_code_skeleton_qualifiers.
7566 Expect any value for the %define variable `foo' to be stored in the
7567 macro named `b4_percent_define(foo)'; expect any %code blocks for the
7568 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
7569 expect any unqualified %code blocks to be stored in a macro named
7570 `b4_percent_code_unqualified'.
7571 Use m4_indir so that %define variable names and %code qualifiers can
7572 contain `.', which is allowed by the grammar parser.
7573 (b4_percent_define_default): New macro to set a default value for a
7574 %define variable.
7575 (m4_wrap): Update wrapped code, and fix some underquoting.
7576 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
7577 Expect grammar uses of %define variables and %code qualifiers to be
7578 defined in b4_percent_define_user_variables and
7579 b4_percent_code_user_qualifiers.
7580 * data/c++.m4: Use b4_percent_define_default rather than
7581 m4_define_default. Fix some underquoting. Skeleton usage of %define
7582 variable define_location_comparison now implies skeleton usage of
7583 %define variable filename_type.
7584 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
7585 data/push.c, data/yacc.c: Update macro names.
7586 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
7587 muscle names.
7588
75892007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7590
7591 DJGPP specific issues.
7592
7593 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
7594 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
7595
75962007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
7597
7598 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
7599 run parsers in all tests so that Valgrind is invoked during
7600 maintainer-check-valgrind.
7601 (Duplicate representation of merged trees): Free all semantic values.
7602 (Duplicated user destructor for lookahead): Likewise.
7603
76042007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
7605
7606 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
7607 command-line prefix.
7608 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
7609 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
7610 miss Valgrind messages.
7611 (Exploding the Stack Size with Malloc): Likewise.
7612
76132007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
7614
7615 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
7616 locals. Reported by Juan Manuel Guerrero at
7617 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
7618 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
7619 Fix some indentation also.
7620 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
7621 explaining this issue.
7622
76232007-01-09 Paolo Bonzini <bonzini@gnu.org>
7624 and Joel E. Denny <jdenny@ces.clemson.edu>
7625
7626 Simplify union and prologue handling, and escape union and lex/parse
7627 params with digraphs.
7628 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
7629 values to the empty string since these are no longer guaranteed
7630 initialized by the front-end.
7631 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
7632 braces around b4_user_stype since this is no longer done by the
7633 front-end.
7634 * src/files.c, src/files.h (pre_prologue_obstack,
7635 post_prologue_obstack): Remove.
7636 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
7637 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
7638 with digraphs. This fixes lex params and parse params.
7639 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
7640 * src/output.c (prepare): Remove muscle insertion of the prologues.
7641 (output): Remove freeing of pre_prologue_obstack and
7642 post_prologue_obstack.
7643 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
7644 than prologue_augment for prologue parsing so you don't need prologue
7645 obstacks.
7646 (grammar_declaration): For %union RHS, use `braceless' instead of
7647 "{...}" so that braces are already stripped and code is escaped with
7648 digraphs.
7649 * src/reader.c (prologue_augment): Remove.
7650 (reader): Remove initialization of pre_prologue_obstack and
7651 post_prologue_obstack.
7652 * src/reader.h (prologue_augment): Remove.
7653
7654 * data/c.m4: Remove stray parenthesis.
7655
76562007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
7657
7658 Remove quotes from variables names in %define directives and from
7659 qualifiers in %code directives, and restrict the characters that are
7660 allowed in them to M4-friendly ones. For %define, continue to support
7661 the quoted form as a deprecated feature. Discussed starting at
7662 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
7663 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
7664 %code.
7665 * doc/bison.texinfo (Prologue Alternatives): Update.
7666 (Decl Summary): In %defines entry, update mention of `%code requires'
7667 and `%code provides'.
7668 (C++ Location Values): Update %define uses.
7669 (Calc++ Parser Interface): Likewise.
7670 (Calc++ Parser): Likewise, and update `%code requires' uses.
7671 (Table of Symbols): Update %code documentation.
7672 * src/parse-gram.y (prologue_declaration): For %define variables, use
7673 `variable' instead of `STRING'.
7674 (grammar_declaration): For %code qualifiers, use `ID' instead of
7675 `STRING'.
7676 (variable): New nonterminal that takes an `ID' or a `STRING'.
7677 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
7678 and %define uses.
7679 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
7680 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
7681 (%define errors): Update %define uses.
7682
76832007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
7684
7685 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
7686 instead of muscle_insert for %define values so that M4-special
7687 characters are replaced with digraphs.
7688 * tests/input.at (%define errors): Extend to check weird values.
7689
76902007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
7691
7692 Instead of having skeletons declare all valid %define variables and
7693 %code qualifiers, provide macros that retrieve the associated values
7694 and build these lists automatically. Thus Bison will now warn when a
7695 variable or qualifier is not used by the skeleton in the current
7696 invocation regardless of whether it might sometimes be used by that
7697 skeleton in other invocations. Also, move all %define value macros to
7698 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
7699 form, which is replaced by %code.
7700 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
7701 (b4_check_user_names): ... this, and change the series of valid name
7702 arguments to a single list argument for names used in the skeleton
7703 similar to the existing list argument for names used in the grammar.
7704 Warn instead of complaining.
7705 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
7706 values and %code code, to format %code code properly, and to build
7707 lists of all %define variables and %code qualifiers used in the
7708 skeleton: b4_skeleton_percent_define_variables and
7709 b4_skeleton_percent_code_qualifiers.
7710 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
7711 Remove, and...
7712 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
7713 the skeleton names lists can finish building first. In place of
7714 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
7715 expect the lists b4_user_percent_define_variables and
7716 b4_user_percent_code_qualifiers.
7717 * data/c++.m4: Where setting default values for b4_parser_class_name,
7718 b4_location_type, b4_filename_type, b4_namespace, and
7719 b4_define_location_comparison, update their names to the
7720 b4_percent_define_ namespace.
7721 * data/glr.c: Don't use b4_check_percent_define_variables and
7722 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
7723 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
7724 (b4_parser_class_name, b4_namespace): Define these using
7725 b4_get_percent_define for parser_class_name and namespace.
7726 * data/location.cc: Use b4_get_percent_define.
7727 * data/push.c: Don't use b4_check_percent_define_variables and
7728 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
7729 * data/yacc.c: Likewise, and don't call m4_exit in
7730 b4_use_push_for_pull_if or m4_wrap code will never execute.
7731 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
7732 Rename to...
7733 (muscle_grow_user_name_list): ... this for consistency with the
7734 terminology used in bison.m4.
7735 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
7736 %define variable names, and rename muscle used_percent_define_variables
7737 to user_percent_define_variables.
7738 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
7739 user_percent_code_qualifiers.
7740 (content): Remove.
7741 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
7742 {CODE} form is no longer accepted.
7743 * tests/input.at (Reject bad %code qualifiers): Rename to...
7744 (Reject unused %code qualifiers): ... this, and update test output.
7745 (%define error): Update test output.
7746
77472007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
7748
7749 Check for unrecognized %define variables similar to checking for
7750 unrecognized %code qualifiers. Check for redefined %define variables.
7751 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
7752 generalizes...
7753 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
7754 (b4_check_percent_define_variables): New, also wraps it.
7755 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
7756 variables using b4_check_percent_define_variables.
7757 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
7758 all those exercised in the test suite and all those listed in the
7759 `Default values' section of c++.m4. Are there others?
7760 * data/push.c, data/yacc.c: Declare no valid %define variables.
7761 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
7762 similar to muscle_find, but it works even when the muscle stores a
7763 const value.
7764 (muscle_grow_used_name_list): New function for constructing the used
7765 name list muscles that b4_check_for_unrecognized_names requires.
7766 * src/parse-gram.y (prologue_declaration): Warn if a variable is
7767 %define'd more than once. Define the b4_used_percent_define_variables
7768 muscle with muscle_grow_used_name_list.
7769 (grammar_declaration): Abbreviate %code code with
7770 muscle_grow_used_name_list.
7771 * tests/input.at (%define errors): New.
7772
77732007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7774
7775 Provide warn_at, complain_at, and fatal_at function callbacks to the
7776 skeletons, and use this for %code qualifier complaints.
7777 * data/bison.m4 (b4_error_at): New, invoked by...
7778 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
7779 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
7780 @fatal_at(...@) directives.
7781 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
7782 qualifiers in b4_used_percent_code_qualifiers and to use
7783 b4_complain_at.
7784 * src/location.c, src/location.h (boundary_set_from_string): New global
7785 function.
7786 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
7787 function.
7788 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
7789 to b4_used_percent_code_qualifiers.
7790 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
7791 function.
7792 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
7793 (lineno): Rename to...
7794 (out_lineno): ... this so I don't misunderstand it again.
7795 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
7796 here; these newlines are in the input but not the output file.
7797 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
7798 (at_directive_perform): ... this new static function, and add handling
7799 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
7800 directives.
7801 * tests/input.at (Reject bad %code qualifiers): Update test output with
7802 locations and extend.
7803
7804 * tests/output.at (Output file name: [, Output file name: ]): Remove
7805 bogus comment about these tests failing.
7806
78072007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7808
7809 Clean up b4_check_percent_code_qualifiers a little.
7810 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
7811 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
7812 documentation and add examples.
7813 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
7814 qualifiers here.
7815
78162007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
7817
7818 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
7819 unreliable -- especially when they're hidden inside another macro.
7820 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
7821 data/c.m4: Remove m4_divert(-1).
7822 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
7823 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
7824 m4_divert_push(0) and m4_divert_pop(0).
7825 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
7826 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
7827 pushed and popped by m4sugar, should be first on the stack.
7828
7829 Provide warn, complain, and fatal function callbacks to the skeletons.
7830 This provides more flexibility than m4_fatal, improves the error
7831 message format, and captures messages for translation. Discussed
7832 starting at
7833 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
7834 * data/bison.m4 (b4_error): New, invoked by...
7835 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
7836 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
7837 directives. Because these M4 macros might be called when the current
7838 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
7839 the previous removal of uses of m4_divert, which caused trouble.
7840 (b4_check_percent_code_qualifiers): Use b4_complain instead of
7841 m4_fatal to report unrecognized %code qualifiers.
7842 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
7843 push parser requests.
7844 * data/glr.c: Use b4_complain instead of m4_fatal to report
7845 non-deterministic push parser requests.
7846 Update @output usage to @output(...@) form.
7847 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
7848 report missing %defines. Update @output usage to @output(...@) form.
7849 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
7850 @output(...@) form.
7851 * src/main.c (main): Invoke skel_scanner_free.
7852 * src/scan-skel.h (skel_scanner_free): Prototype new function.
7853 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
7854 obstack_for_string from flex-scanner.h.
7855 (YY_DECL): Use to declare skel_lex static.
7856 (decode_at_digraphs): Remove; now handled in the new
7857 SC_AT_DIRECTIVE_ARG start condition.
7858 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
7859 functions.
7860 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
7861 at_directive_argv): New static globals.
7862 (INITIAL): Use fail_for_invalid_at.
7863 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
7864 recognize the start of a generalized `@directive(...@)' form and
7865 start...
7866 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
7867 directive args (using the new obstack_for_string), to decode the
7868 contained @ diagraphs, and to perform the directive. It recognizes
7869 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
7870 @output(...@).
7871 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
7872 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
7873 `@,'.
7874 (scan_skel): Initialize obstack_for_string on the first call.
7875 (skel_scanner_free): New function to free obstack_for_string.
7876 * tests/input.at (Reject bad %code qualifiers): Update test output.
7877
78782007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
7879
7880 Consolidate the 4 prologue alternative directives (%code, %requires,
7881 %provides, and %code-top) into a single %code directive with an
7882 optional qualifier field. Discussed at
7883 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
7884 * NEWS (2.3a+): Rewrite the existing entry for the prologue
7885 alternatives.
7886 * doc/bison.texinfo (Prologue Alternatives): Update.
7887 (Decl Summary): Update to %code "requires" and %code "provides".
7888 (Calc++ Parser): Update to %code "requires".
7889 (Table of Symbols): Remove entries for %requires, %provides, and
7890 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
7891 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
7892 are replaced by b4_percent_code_provides and b4_percent_code_requires,
7893 which are skeleton-specific.
7894 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
7895 declare what %code qualifiers it supports and to complain if any other
7896 qualifiers were used in the grammar.
7897 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
7898 and b4_user_code([b4_percent_code_provides]) in place of
7899 b4_user_requires and b4_user_provides.
7900 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
7901 Add b4_user_code([b4_percent_code_top]) and
7902 b4_user_code([b4_percent_code]).
7903 Invoke b4_check_percent_code_qualifiers.
7904 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
7905 PERCENT_REQUIRES): Remove.
7906 (grammar_declaration): Remove RHS's for %code-top, %provides, and
7907 %requires. Rewrite the %code RHS as the unqualified form defining the
7908 muscle b4_percent_code. Add another RHS for the qualified %code form,
7909 which defines muscles of the form b4_percent_code_QUALIFIER and the
7910 b4_used_percent_code_qualifiers muscle.
7911 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
7912 PERCENT_REQUIRES): Remove.
7913 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
7914 %code "requires" and %code "provides".
7915 * tests/input.at (Reject bad %code qualifiers): New.
7916
79172007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
7918
7919 Use the new code_props interface for destructors and printers.
7920 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
7921 printer_location members, and change the type of the destructor and
7922 printer members to code_props.
7923 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
7924 symbol_printer_get, semantic_type_destructor_set,
7925 semantic_type_printer_set, default_tagged_destructor_set,
7926 default_tagless_destructor_set, default_tagged_printer_set,
7927 default_tagless_printer_set): Use code_props in arguments and return
7928 types in place of char const * and location.
7929 (symbol_destructor_location_get, symbol_printer_location_get): Remove
7930 since the locations are now contained in the return of
7931 symbol_destructor_get and symbol_printer_get.
7932 * src/output.c (symbol_destructors_output, symbol_printers_output):
7933 Replace with...
7934 (symbol_code_props_output): ... this to eliminate duplicate code.
7935 (output_skeleton): Update to use symbol_code_props_output.
7936 * src/reader.c (symbol_should_be_used): Update use of
7937 symbol_destructor_get.
7938 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
7939 Update uses of the various _destructor_set and _printer_set functions.
7940 * src/symtab.c: (default_tagged_destructor_location,
7941 default_tagless_destructor_location, default_tagged_printer_location,
7942 default_tagless_printer_location): Remove since we...
7943 (default_tagged_destructor, default_tagless_destructor,
7944 default_tagged_printer, default_tagless_printer): ... change the type
7945 of these to code_props.
7946 (symbol_new, semantic_type_new, symbol_destructor_set,
7947 semantic_type_destructor_set, symbol_destructor_get,
7948 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
7949 symbol_check_alias_consistency, default_tagged_destructor_set,
7950 default_tagless_destructor_set, default_tagged_printer_set,
7951 default_tagless_printer_set): Update.
7952 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
7953 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
7954 code_props members.
7955 (symbol_print): Use SYMBOL_CODE_PRINT.
7956
79572007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
7958
7959 Use the new code_props interface for rule actions.
7960 * src/symlist.h (symbol_list): Replace action, action_location, and
7961 used members with a code_props action_props member.
7962 * src/reader.c (symbol_should_be_used, grammar_rule_check,
7963 grammar_midrule_action, grammar_current_rule_merge_set,
7964 grammar_current_rule_symbol_append, packgram): Update.
7965 * src/scan-code.h (translate_rule_action): Remove, no longer used.
7966 * src/scan-code.l (handle_action_dollar): Update.
7967 (translate_rule_action): Remove, no longer used.
7968 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
7969
79702007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7971
7972 Use the new code_props interface in parse-gram.y.
7973 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
7974 Update all uses of translate_* functions to use the new code_props
7975 interface and to use gram_scanner_last_string_free and
7976 code_scanner_last_string_free where possible.
7977 (grammar_declaration): symbol_list_destructor_set and
7978 symbol_list_printer_set now perform the translation, so don't do it
7979 here. Use gram_scanner_last_string_free where possible.
7980 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
7981 translate_code): Remove, no longer used.
7982 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
7983 symbol_list_printer_set): Perform code translation here rather than
7984 depending on the caller to do so.
7985
7986 * src/symlist.h (struct symbol_list): Correct some documentation typos.
7987 * src/scan-gram.h (gram_last_string): Remove declaration.
7988 * src/scan-gram.l (last_string): Declare it static.
7989
79902007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7991
7992 Encapsulate code properties and related functionality for the various
7993 destructors, printers, and actions into a code_props structure and
7994 interface. This patch merely implements code_props in scan-code.h and
7995 scan-code.l. Future patches will rewrite other modules to use it.
7996 Discussed starting at
7997 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
7998 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
7999 consistently initialize const structs that have an empty location
8000 field.
8001 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
8002 to ensure consistency.
8003 * src/scan-code.h (code_props): New structure.
8004 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
8005 function, macro, and const global variable for initializing a
8006 code_props with no code.
8007 (code_props_plain_init, code_props_symbol_action_init,
8008 code_props_rule_action_init, code_props_translate_code): The rest of
8009 the new code_props functional interface. Among other things, the init
8010 functions set the code_props kind field so that
8011 code_props_translate_code will know whether to behave like
8012 translate_symbol_action, translate_rule_action, or translate_code.
8013 These old translate functions must remain until all other modules are
8014 updated to use the new code_props interface.
8015 (code_scanner_last_string_free): New function similar to
8016 gram_scanner_last_string_free.
8017 (code_scanner_free): Add documentation.
8018 * src/scan-code.l: Implement the new interface.
8019 (code_lex): Make it static, add a code_props* argument, and remove the
8020 rule argument.
8021 (last_string): New static global similar to the one in scan-gram.l.
8022 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
8023 instead of rule.
8024 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
8025 code_props since Bison may one day use this information for destructors
8026 and printers.
8027 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
8028 (handle_action_dollar): Use symbol_list_n_get and set used flag
8029 directly since symbol_list_n_used_set is removed.
8030 (translate_action): Add a code_props* argument and remove the rule,
8031 action, and location arguments. Pass the code_props* on to code_lex.
8032 (translate_rule_action, translate_symbol_action, translate_code):
8033 Rewrite as wrappers around the new code_props interface.
8034 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
8035 it would eventually need to break the encapsulation of code_props.
8036
80372007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
8038
8039 * etc/.cvsignore: New.
8040
80412007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
8042
8043 Add maintainer-push-check to run maintainer-check using push parsing in
8044 place of pull parsing where available.
8045 * Makefile.am (maintainer-push-check): New.
8046 * data/bison.m4 (b4_use_push_for_pull_if): New.
8047 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
8048 appropriately based on their existing values.
8049 (yypush_parse): Don't print push-parser-specific diagnostics if push
8050 parsing is being used in place of pull parsing.
8051 * data/yacc.c: If push parsing should replace pull parsing, redirect to
8052 push.c.
8053 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
8054 variable, and insert b4_use_push_for_pull_flag into muscles.
8055 * tests/Makefile.am (maintainer-push-check): New.
8056
80572006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
8058
8059 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
8060 (whether successful or failed) so that yypush_parse can be invoked
8061 again to start a new parse using the same yypstate.
8062 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
8063 check multiple yypull_parse invocations on the same yypstate. For pull
8064 mode, extend to check multiple yyparse invocations.
8065 (Exploding the Stack Size with Alloca): Extend to try with
8066 %push-pull-parser.
8067 (Exploding the Stack Size with Malloc): Likewise.
8068
8069 * tests/calc.at (Simple LALR Calculator): Don't specify
8070 %skeleton "push.c" since %push-pull-parser implies that now.
8071 * tests/headers.at (export YYLTYPE): Don't check for the push
8072 declarations. Otherwise, this test case can't be used to see if push
8073 mode can truly emulate pull mode.
8074 * tests/input.at (Torturing the Scanner): Likewise.
8075 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
8076 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
8077 AT_YACC_IF, which now includes the case of push mode since %skeleton
8078 need not be used for push mode. This will be more intuitive once
8079 push.c is renamed to yacc.c.
8080
80812006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
8082
8083 For push mode, convert yyparse from a macro to a function, invoke yylex
8084 instead of passing a yylexp argument to yypull_parse, and don't
8085 generate yypull_parse or yyparse unless %push-pull-parser is declared.
8086 Discussed starting at
8087 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
8088 * data/bison.m4 (b4_pull_if): New.
8089 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
8090 * data/push.c: Improve M4 quoting a little.
8091 (b4_generate_macro_args, b4_parenthesize): Remove.
8092 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
8093 any time a pull parser is requested.
8094 Don't #define this as a wrapper around yypull_parse. Instead, when
8095 both push and pull are requested, make it a function that does that
8096 same thing.
8097 (yypull_parse): If there's a b4_prefix, #define this to
8098 b4_prefix[pull_parse] when both push and pull are requested.
8099 Don't define this as a function unless both push and pull are
8100 requested.
8101 Remove the yylexp argument and hard-code yylex invocation instead.
8102 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
8103 %push-parser.
8104 * src/getargs.c (pull_parser): New global initialized to true.
8105 * getargs.h (pull_parser): extern it.
8106 * src/output.c (prepare): Insert pull_flag muscle.
8107 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
8108 (prologue_declaration): Set both push_parser and pull_parser = true for
8109 %push-pull-parser. Set push_parser = true and pull_parser = false for
8110 %push-parser.
8111 * src/scan-gram.l: Don't accept %push_parser as an alternative to
8112 %push-parser since there's no backward-compatibility concern here.
8113 Scan %push-pull-parser.
8114 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
8115 instead of %push-parser.
8116 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
8117 prototype it in the module that calls yyparse.
8118 * tests/input.at (Torturing the Scanner): Likewise.
8119 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
8120
81212006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
8122
8123 Update etc/bench.pl. Optimize push mode a little (the yyn change
8124 deserves most of the credit).
8125 * Makefile.am (SUBDIRS): Add etc subdirectory.
8126 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
8127 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
8128 yytoken, yyval, and yyloc declarations to...
8129 (yyparse or yypush_parse): ... here to improve performance. For
8130 yypush_parse invocations after the first, be sure to assign yyn its old
8131 value again.
8132 (yypstate_new): Don't bother initializing the yyresult field since the
8133 initial value isn't used.
8134 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
8135 remove the #define that, in push mode, set it to yyps->NAME.
8136 * etc/Makefile.am: New.
8137 * etc/bench.pl: Remove and build it instead from...
8138 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
8139 "tests/bison" from the build directory by default rather than just
8140 invoking "bison" from $PATH.
8141 (calc_grammar): Update push parser code: don't declare yylval globally,
8142 don't define yyparse_wrapper, and don't #define yyparse.
8143 (bench_grammar): Update to check all working combinations of yacc.c,
8144 push.c, impure, pure, pull, and push.
8145
81462006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
8147
8148 For push mode, add pull wrappers around yypush_parse.
8149 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
8150 (yypull_parse): New function wrapping yypush_parse.
8151 (yyparse): New #define wrapping yypull_parse.
8152 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
8153 is declared.
8154 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
8155 prototype yylex in the module that calls yyparse, and don't prototype
8156 yyparse there. Otherwise, the yyparse expansion won't compile.
8157 * tests/input.at (Torturing the Scanner): Likewise.
8158
81592006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
8160
8161 Enable push parsers to operate in impure mode. Thus, %push-parser no
8162 longer implies %pure-parser. The point of this change is to move
8163 towards being able to test the push parser code by running the entire
8164 test suite as if %push-parser had been declared.
8165 * data/push.c (yypush_parse): For impure mode, remove the
8166 yypushed_char, yypushed_val, and yypushed_loc arguments.
8167 Instead, declare these as local variables initialized to the global
8168 yychar, yylval, and yylloc.
8169 For the first yypush_parse invocation only, restore the initial values
8170 of these global variables when it's time to read a token since they
8171 have been overwritten.
8172 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
8173 %push-parser.
8174 * tests/calc.at (Simple LALR(1) Calculator): Always declare
8175 %pure-parser along with %push-parser since this test case was designed
8176 for pure push parsers.
8177 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
8178 (AT_YACC_OR_PUSH_IF): New.
8179 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
8180 add a note that it's still wrong for some cases (as it has been for a
8181 while).
8182 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
8183 %push-parser no longer implies %pure-parser.
8184
81852006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
8186
8187 Remove some unnecessary differences between the pull parser code and
8188 the push parser code. This patch enables yynerrs in push mode.
8189 * data/push.c: Reformat M4 a little.
8190 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
8191 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
8192 because push mode is on. Instead, if pure mode is on, move yynerrs
8193 to...
8194 (b4_declare_parser_state_variables): ... here.
8195 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
8196 to yyps->NAME so it can be used in yypush_parse.
8197 (yypush_parse): Don't omit uses of yynerrs in push mode.
8198
81992006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
8200
8201 Fix bug such that the first pushed token's value and location are
8202 sometimes overwritten (sometimes by %initial-action) before being used.
8203 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
8204 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
8205 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
8206 more closely mimic the pull parser logic.
8207 Don't copy the pushed token to yychar, yylval, and yylloc until it's
8208 time to read a token, which is after any initialization of yylval and
8209 yylloc.
8210 (gottoken): Rename label to...
8211 (yyread_pushed_token): ... for clarity and to avoid infringing on the
8212 user namespace.
8213
82142006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
8215
8216 Rearrange initialization of the parser state variables so that the
8217 skeleton doesn't have to have a copy for pull mode and another for push
8218 mode. This patch also fixes at least a bug such that yylloc was not
8219 initialized (with b4_location_initial_line and
8220 b4_location_initial_column) upon calling yypush_parse. However, that
8221 initialization now overwrites the first token's location;
8222 %initial-action assigning @$ already did the same thing, and both bugs
8223 will be fixed in a later patch.
8224 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
8225 (b4_declare_parser_state_variables): Remove initialization of yytoken,
8226 yyss, yyvs, yyls, and yystacksize.
8227 (yypstate_new): Remove initialization of some yypstate fields: yystate,
8228 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
8229 yylsp.
8230 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
8231 yyps->NAME so it can be used in yypush_parse.
8232 (yyparse or yypush_parse): For yypush_parse, don't print the
8233 "Starting parse" diagnostic for invocations after the first.
8234 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
8235 yypush_parse, only do it for the first invocation.
8236 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
8237 initialization to occur in yypush_parse but only on the first
8238 invocation.
8239
82402006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
8241
8242 * data/push.c: Add CPP guards around push parser declarations in both
8243 the header and the code file.
8244 In the code file, move the push parser declarations to the same place
8245 they appear in the header file.
8246 Clean up the M4 some, especially the inconsistent underquoting in
8247 some b4_c_function_def and b4_c_function_decl uses.
8248
82492006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
8250
8251 Encapsulate the push parser state variables into an M4 macro so the
8252 push skeleton doesn't have to list them again for pull mode's yyparse.
8253 For push mode, remove yypush_parse's local equivalents of these
8254 variables to eliminate unnecessary copying between the two sets at
8255 run-time. This patch also fixes at least a bug related to multiple
8256 %initial-action invocations in push mode.
8257 * data/push.c (b4_declare_parser_variables): Rename to...
8258 (b4_declare_scanner_communication_variables): ... this for clarity and
8259 update both uses.
8260 (b4_declare_yyparse_variables): Remove and move its contents to the one
8261 spot where it was invoked.
8262 (b4_declare_parser_state_variables): New macro containing the parser
8263 state variables required by push mode.
8264 (struct yypstate): Replace all fields but yynew with
8265 b4_declare_parser_state_variables.
8266 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
8267 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
8268 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
8269 (yyparse or yypush_parse): For yyparse in pull mode, replace local
8270 parser state variable declarations with
8271 b4_declare_parser_state_variables.
8272 Don't initialize parser state variables when calling yypush_parse since
8273 yypstate_new already does that.
8274 Invoke the user's initial action only upon the first yypush_parse
8275 invocation.
8276 Remove all code that copies between the local parser state variables
8277 and the yypstate.
8278
82792006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
8280
8281 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
8282 prevent a name collision in a future patch where these names will
8283 sometimes be #define'd.
8284 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
8285 since it no longer has the same name as the existing argument.
8286 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
8287
82882006-12-19 Paolo Bonzini <bonzini@gnu.org>
8289 and Joel E. Denny <jdenny@ces.clemson.edu>
8290
8291 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
8292 that the argument is case-insensitive, and there's no `=' here.
8293 For the %skeleton entry, mention that %language is better.
8294 (Bison Options): Likewise for --language and --skeleton. Move the
8295 --skeleton entry so that the `Tuning the parser' section is sorted
8296 alphabetically on long options.
8297 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
8298 %language directive in detail here; cross-reference the %language
8299 documentation instead.
8300 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
8301 `%require "2.3b"' so that the example is always up-to-date.
8302 (Table of Symbols): Add entries for %language and %skeleton.
8303 * examples/extexi (normalize): Instead of replacing every %require
8304 argument with the current Bison version, just substitute for
8305 `@value{VERSION}'. This guarantees that we're testing what actually
8306 appears in the documentation.
8307 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
8308 rather than `@VERSION@'.
8309
83102006-12-18 Paul Eggert <eggert@cs.ucla.edu>
8311
8312 * NEWS: Reword the %language news a bit, and put it earlier.
8313
8314 * src/getargs.c (skeleton_arg): Last arg is now location const *.
8315 Rewrite to simplify the logic.
8316 (language_argmatch): Likewise.
8317 (program_name): We now own this var.
8318 * src/getargs.h (struct bison_language): Use char[] rather than
8319 const char *.
8320
8321 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
8322 Java is supported.
8323 * src/complain.c (program_name): Remove decl; no longer needed.
8324 * src/main.c (program_name): Remove; now belongs to getargs.
8325
83262006-12-18 Paolo Bonzini <bonzini@gnu.org>
8327
8328 * NEWS: Document %language.
8329
8330 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
8331
8332 * data/c-skel.m4, data/c++-skel.m4: New files.
8333 * data/glr.c: Complain on push parsers.
8334
8335 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
8336 over %skeleton.
8337 (Decl Summary): Document %language and %skeleton.
8338 (Command line): Document -L.
8339
8340 * examples/extexi: Rewrite %require directive.
8341 * examples/calc++/Makefile.am: Pass VERSION to extexi.
8342
8343 * src/files.c (compute_exts_from_gc): Look in language structure
8344 for .y extension.
8345 (compute_file_name_parts): Check whether .tab should be added.
8346 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
8347 (language, skeleton_arg, language_argmatch): New.
8348 (long_options): Add --language.
8349 (getargs): Use skeleton_arg, add -L/--language.
8350 * src/getargs.h: Include location.h.
8351 (struct bison_language, language, skeleton_arg, language_argmatch): New.
8352 * src/output.c (prepare): Pick default skeleton from struct language.
8353 Don't dispatch C skeletons here.
8354 * src/parse-gram.y (PERCENT_LANGUAGE): New.
8355 (prologue_declaration): Add "%language" rule, use skeleton_arg.
8356 * src/scan-gram.l ("%language"): New rule.
8357
8358 * tests/calc.at: Test %skeleton and %language.
8359 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
8360 (AT_GLR_IF): Look for %skeleton "glr.cc".
8361 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
8362 (AT_YACC_IF): Reject %language.
8363
83642006-12-18 Paul Eggert <eggert@cs.ucla.edu>
8365
8366 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
8367 since it wasn't used; only the typedef name 'semantic_type' is needed.
8368 Also, omit trailing white space.
8369
8370 * bootstrap: Sync from coreutils.
8371 (gnulib_extra_files): Add build-aux/announce.gen.
8372 (slurp): Adjust .gitignore files like .cvsignore files.
8373 * build-aux/announce-gen: Remove from CVS, since bootstrap
8374 now creates this.
8375
83762006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
8377
8378 Make %push-parser imply %pure-parser. This fixes several bugs; see
8379 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
8380 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
8381 pure_parser = true.
8382 * data/push.c: Don't bother testing b4_push_if when deciding whether
8383 to expand b4_declare_parser_variables globally.
8384 (yypush_parse): Likewise in here.
8385
8386 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
8387 (yy_reduce_print): Reformat M4 for readability.
8388
83892006-12-15 Bob Rossi <bob@brasko.net>
8390 and Joel Denny <jdenny@ces.clemson.edu>
8391
8392 * data/push.c (yypstate): Add typedef, and update all uses of
8393 struct yypstate to just yypstate.
8394 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
8395
83962006-12-14 Bob Rossi <bob@brasko.net>
8397
8398 * data/push.c (yypush_parse): Declare prototype regardless of
8399 %locations option.
8400
84012006-12-14 Bob Rossi <bob@brasko.net>
8402
8403 * data/push.c (yyparse): Remove the prototype and the #define when in
8404 push-parser mode.
8405
84062006-12-13 Bob Rossi <bob@brasko.net>
8407
8408 * data/push.c (yypstate_init): Rename to...
8409 (yypstate_new): ... this and use b4_c_function_def.
8410 (yypstate_delete): New.
8411 (yypush_parse): Change parameters yynval and yynlloc to be const.
8412 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
8413 yypstate_delete functions.
8414
84152006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
8416
8417 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
8418 strange test case titles. Reported by Bob Rossi.
8419
84202006-12-13 Paul Eggert <eggert@cs.ucla.edu>
8421
8422 * TODO: Add pointer to Sylvain Schmitz's work on static detection
8423 of potential ambiguities in GLR grammers.
8424
84252006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
8426
8427 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
8428 `bison ', use m4_index instead of m4_substr since chopping up a string
8429 containing M4-special characters causes problems here.
8430
8431 Fix a couple of bugs related to special characters in user-specified
8432 file names, and make it easier for skeletons to compute output file
8433 names with the same file name prefix as Bison-computed output file
8434 names.
8435 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
8436 b4_parser_file_name and b4_spec_defines_file instead of
8437 @output_parser_name@ and @output_header_name@, which are now redundant.
8438 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
8439 b4_parser_file_name, b4_spec_defines_file, and the new
8440 @basename(FILENAME@) instead of @output_parser_name@ and
8441 @output_header_name@, which inappropriately escaped the file names as
8442 C string literals.
8443 * src/files.c (all_but_ext): Remove static qualifier.
8444 (compute_output_file_names): Move `free (all_but_ext)' to...
8445 (output_file_names_free): ... here since all_but_ext is needed later.
8446 * src/files.h (all_but_ext): Extern.
8447 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
8448 exactly what MUSCLE_INSERT_STRING used to do.
8449 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
8450 characters are escaped properly.
8451 * src/output.c (prepare): Define muscle file_name_all_but_ext as
8452 all_but_ext.
8453 For pkgdatadir muscle, maintain previous functionality by using
8454 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
8455 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
8456 digraphs would never be expanded. Hopefully no one has M4-special
8457 characters in his Bison installation path.
8458 * src/scan-skel.l: Don't parse @output_header_name@ and
8459 @output_parser_name@ anymore since they're now redundant.
8460 In @output, use decode_at_digraphs.
8461 Parse a new @basename command that invokes last_component.
8462 (decode_at_digraphs): New.
8463 (BASE_QPUTS): Remove unused.
8464 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
8465 (Output file name): New tests.
8466
84672006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
8468
8469 Warn about output files that are generated by the skeletons and that
8470 conflict with other output files.
8471 * data/glr.c: Don't generate the header file here when glr.cc does.
8472 * src/files.c (file_names, file_names_count): New static globals.
8473 (compute_output_file_names): Invoke output_file_name_check for files
8474 not generated by the skeletons and remove existing checks.
8475 (output_file_name_check): New function that warns about conflicting
8476 output file names.
8477 (output_file_names_free): Free file_names.
8478 * src/files.h (output_file_name_check): Declare.
8479 * src/scan-skel.l: Invoke output_file_name_check for files generated by
8480 the skeletons.
8481 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
8482 (Conflicting output files): New tests.
8483
84842006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8485
8486 * doc/bison.texinfo: Fix a couple of typos.
8487
84882006-12-08 Bob Rossi <bob@brasko.net>
8489
8490 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
8491 Rename to...
8492 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
8493 update all uses.
8494 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
8495 (yypush_parse): Rename yypvars argument to yyps and remove redundant
8496 local pv.
8497 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
8498 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
8499
85002006-12-07 Bob Rossi <bob@brasko.net>
8501 and Joel Denny <jdenny@ces.clemson.edu>
8502
8503 * data/push.c (yypvarsinit): Change return type from void* to struct
8504 yypvars*. No longer cast to void* on return.
8505 (struct yypvars): Remove yylen since it need not be remembered between
8506 yypushparse invocations.
8507 (yypushparse): Don't copy between yylen and pv->yylen.
8508
85092006-12-05 Bob Rossi <bob@brasko.net>
8510
8511 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
8512 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
8513 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
8514 (struct yypvars): Remove b4_declare_parser_variables.
8515 (yypvarsinit): Remove init code for removed variables.
8516 (global scope): Do not declare b4_declare_parser_variables if
8517 push or pure mode.
8518 (yypushparse): Add b4_declare_parser_variables.
8519 Init new local variables, and remove init code for removed
8520 yypvars variables.
8521 (yyparse): Delete.
8522 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
8523 and yyparse for other modes.
8524 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
8525 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
8526 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
8527 (AT_PURE_LEX_IF): True if pure or push parser.
8528
85292006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
8530
8531 Document Yacc prologue alternatives and default %destructor's and
8532 %printer's as experimental. Don't mention Java yet. Discussed at
8533 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
8534 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
8535 (2.3a): Annotate this entry to say the old forms of these features were
8536 also experimental.
8537 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
8538 Table of Symbols): Say they're experimental. Comment out any mention
8539 of Java (we'll want this back eventually).
8540
85412006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
8542
8543 Support a file name argument to %defines. Deprecate `=' in
8544 %file-prefix, %name-prefix, and %output. Discussed at
8545 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
8546 * NEWS (2.3a+): Mention.
8547 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
8548 form of %defines, and remove `=' from entries for %file-prefix,
8549 %name-prefix, and %output.
8550 * src/parse-gram.y (prologue_declaration): Implement.
8551 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
8552 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
8553 all but one occurrence of %name-prefix.
8554 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
8555 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
8556 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
8557 occurrence of each of %file-prefix and %output. Add check for %defines
8558 with argument.
8559 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
8560 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
8561 Remove the `=' from %output.
8562
85632006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
8564
8565 Don't escape $ in test case titles since Autoconf 2.61 now does that
8566 correctly.
8567 * tests/actions.at (Default %printer and %destructor are not for error
8568 or $undefined): Here.
8569 (Default %printer and %destructor are not for $accept): Here.
8570 * tests/input.at (Invalid $n and @n): Here.
8571
85722006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
8573
8574 Rename <!> to <>. Discussed starting at
8575 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
8576 * NEWS (2.3a+): Update.
8577 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
8578 Update.
8579 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
8580 * src/scan-gram.l (INITIAL): Implement.
8581 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
8582 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
8583 comment.
8584 * tests/actions.at (Default tagless %printer and %destructor,
8585 Default tagged and per-type %printer and %destructor,
8586 Default %printer and %destructor are not for error or $undefined,
8587 Default %printer and %destructor are not for $accept,
8588 Default %printer and %destructor for mid-rule values): Update.
8589 * tests/input.at (Default %printer and %destructor redeclared,
8590 Unused values with default %destructor): Update.
8591
85922006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
8593
8594 Don't let %prec take a nonterminal.
8595 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
8596 token.
8597 * tests/input.at (%prec takes a token): New test checking that %prec
8598 won't take a nonterminal.
8599
86002006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
8601
8602 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
8603 it was double-quoted.
8604 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
8605 grammar is maintained with Bison's highest standards.
8606 * src/getargs.c: Fix some typos in Doxygen comments.
8607
86082006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
8609
8610 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
8611 later. Reported by Paul Eggert in
8612 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
8613 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
8614 * src/scan-code.l (translate_action): Don't bother invoking
8615 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
8616 (code_scanner_free): Instead of invoking
8617 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
8618 which frees more.
8619 * src/scan-gram.l (gram_scanner_free): Likewise.
8620 * src/scan-skel.l (scan_skel): Likewise.
8621
86222006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
8623
8624 * src/files.c (tr): Change return type to void.
8625 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
8626 has been called previously for the same key.
8627 (muscle_find): Return storage instead of value so that
8628 --enable-gcc-warnings doesn't produce warnings that the return discards
8629 const. aver that the value and storage are the same since storage
8630 could potentially be NULL when value is not.
8631 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
8632 same as 0.
8633
86342006-11-08 Paul Eggert <eggert@cs.ucla.edu>
8635
8636 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
8637 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
8638 us a slightly cleaner distribution, and also works.
8639 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
8640 gnulib changes.
8641
86422006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
8643 and Paul Eggert <eggert@cs.ucla.edu>
8644
8645 Don't let Bison leak memory except when it complains.
8646 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
8647 (spec_defines_file, dir_prefix): Now char *, not const char *,
8648 since they are freed.
8649 * src/files.c: Likewise.
8650 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
8651 Likewise.
8652 (tr): Now operates in-place. All uses changed.
8653 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
8654 values.
8655 (compute_file_name_parts, compute_output_file_names): Don't store
8656 read-only data in variables that will be freed.
8657 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
8658 src_extension, and header_extension.
8659 (output_file_names_free): New public function to free
8660 spec_verbose_file, spec_graph_file, spec_defines_file,
8661 parser_file_name, and dir_prefix.
8662 * src/getargs.c (getargs): Don't store read-only data in variables that
8663 will be freed.
8664 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
8665 (which previously existed but was unused), and quotearg_free.
8666 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
8667 * src/muscle_tab.c: Likewise.
8668 (muscle_entry): Make the value char const *,
8669 and add a new storage member that is char * and can be freed.
8670 (muscle_entry_free): New private function.
8671 (muscle_init): Use it instead of free.
8672 (muscle_insert, muscle_grow): Update and use new storage member.
8673 (muscle_code_grow): Free the string passed to muscle_grow
8674 since it's not needed anymore.
8675 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
8676 add a new `char *code' member.
8677 ("{...}"): Declare semantic type as code.
8678 * src/scan-code.h (translate_rule_action):
8679 (translate_symbol_action, translate_code, translate_action): Return
8680 `char const *' rather than `char *' since external code should not free
8681 these strings.
8682 * src/scan-code.l: Likewise.
8683 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
8684 which is "{...}" in the parser.
8685 * tests/Makefile.am (maintainer-check-valgrind): Set
8686 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
8687 Valgrind.
8688 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
8689 complain.
8690 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
8691 expecting a non-zero exit status sets --leak-check=summary and
8692 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
8693 this case, and we don't want to hear about it.
8694
86952006-11-08 Paul Eggert <eggert@cs.ucla.edu>
8696
8697 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
8698 instead of from the template, to simplify configuration a bit.
8699 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
8700 and m4/wint_t.m4, as they are needed with the latest gnulib.
8701
87022006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
8703
8704 Disable unset/unused mid-rule value warnings by default, and recognize
8705 --warnings=midrule-values to enable them. Discussed starting at
8706 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
8707 * NEWS (2.3a+): Mention.
8708 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
8709 warnings): Add entry for midrule-values subargument.
8710 * src/reader.c (symbol_should_be_used): Don't return true just because
8711 the value is a set/used mid-rule value unless
8712 --warnings=midrule-values was specified.
8713 * tests/input.at (Unused values, Unused values before symbol
8714 declarations): Run tests with and without --warnings=midrule-values.
8715
8716 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
8717 than LIST_FREE directly.
8718
87192006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
8720
8721 Finish implementing --warnings=error, which should not be implied by
8722 --warnings=all (or by its synonyms -W and --warnings without
8723 subarguments).
8724 * src/complain.c (set_warning_issued): New function to report that
8725 warnings are being treated as errors and to record an error if so.
8726 Invoke...
8727 (warn_at, warn): ... here.
8728 * src/getargs.c (warnings_args, warnings_types): Reorder so that
8729 "error - warnings are errors" does not appear above "all - all of the
8730 above".
8731 (getargs): For -W and --warnings without subarguments, don't let
8732 FLAGS_ARGMATCH set warnings_error in warnings_flag.
8733 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
8734
87352006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
8736
8737 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
8738 empty subargument list. For example: `bison --warnings= parser.y'.
8739
87402006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
8741
8742 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
8743 the parser header file so that gcc doesn't warn.
8744
87452006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
8746
8747 Split the default %destructor/%printer into two kinds: <*> and <!>.
8748 Discussed starting at
8749 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
8750 * NEWS (2.3a+): Mention.
8751 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
8752 previous change today related to mid-rules.
8753 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
8754 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
8755 (TYPE_TAG_ANY): Add as <*>.
8756 (TYPE_TAG_NONE): Add as <!>.
8757 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
8758 for <*> and <!>.
8759 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
8760 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
8761 * src/symlist.c (symbol_list_default_new): Split into tagged and
8762 tagless versions.
8763 (symbol_list_destructor_set, symbol_list_printer_set): Split
8764 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
8765 SYMLIST_DEFAULT_TAGLESS.
8766 * src/symlist.h: Update symbol_list_default*_new prototypes.
8767 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
8768 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
8769 * src/symtab.c (default_destructor, default_destructor_location,
8770 default_printer, default_printer_location): Split each into tagged and
8771 tagless versions.
8772 (symbol_destructor_get, symbol_destructor_location_get,
8773 symbol_printer_get, symbol_printer_location_get): Implement tagged
8774 default and tagless default cases.
8775 (default_destructor_set, default_printer_set): Split each into tagged
8776 and tagless versions.
8777 * src/symtab.h: Update prototypes.
8778 * tests/actions.at (Default %printer and %destructor): Rename to...
8779 (Default tagless %printer and %destructor): ... this, and extend.
8780 (Per-type %printer and %destructor): Rename to...
8781 (Default tagged and per-type %printer and %destructor): ... this, and
8782 extend.
8783 (Default %printer and %destructor for user-defined end token): Extend.
8784 (Default %printer and %destructor are not for error or $undefined):
8785 Update.
8786 (Default %printer and %destructor are not for $accept): Update.
8787 (Default %printer and %destructor for mid-rule values): Extend.
8788 * tests/input.at (Default %printer and %destructor redeclared): Extend.
8789 (Unused values with default %destructor): Extend.
8790
87912006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
8792
8793 Don't apply the default %destructor/%printer to an unreferenced midrule
8794 value. Mentioned at
8795 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
8796 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
8797 like $@n instead of just @n so that the default %destructor/%printer
8798 logic doesn't see them as user-defined symbols.
8799 (symbol_is_dummy): Check for both forms of the name.
8800 * src/reader.c (packgram): Remove the `$' from each midrule symbol
8801 name for which the midrule value is referenced in any action.
8802 * tests/actions.at (Default %printer and %destructor for mid-rule
8803 values): New test.
8804 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
8805 for change to dummy symbol names.
8806
88072006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
8808
8809 Warn about unset midrule $$ if the corresponding $n is used.
8810 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
8811 $n usage.
8812 (packgram): Before invoking grammar_rule_check on any rule, make sure
8813 all actions have already been scanned in order to set `used' flags.
8814 Otherwise, checking that a midrule's $$ is set will not always work
8815 properly because the midrule check must forward-reference the midrule's
8816 parent rule.
8817 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
8818 warning.
8819
88202006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
8821
8822 More improvements to the documentation of the prologue alternatives:
8823 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
8824 Bison manual.
8825 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
8826 some text to clarify the relative importance of the new directives and
8827 to show how these directives may be viewed as code labels.
8828
88292006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
8830
8831 Similar to the recently removed %before-header, add %code-top as the
8832 alternative to the pre-prologue. Mentioned at
8833 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
8834 Also, let the prologue alternatives appear in the grammar section.
8835 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
8836 (prologue_declaration): Move the existing prologue alternatives to...
8837 (grammar_declaration): ... here and add %code-top.
8838 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
8839
8840 Clean up and extend documentation for the prologue alternatives.
8841 * NEWS (2.3a+): Describe prologue alternatives.
8842 * doc/bison.texinfo (Prologue): Move discussion of prologue
8843 alternatives to...
8844 (Prologue Alternatives): ... this new section, and extend it to discuss
8845 all 4 directives in detail.
8846 (Table of Symbols): Clean up discussion of prologue alternatives and
8847 add %code-top.
8848
88492006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8850
8851 DJGPP specific issues.
8852
8853 * djgpp/config.bat: config.hin has been moved to lib. Adjust
8854 config.bat accordingly.
8855 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
8856 * djgpp/config.site: Likewise.
8857
88582006-10-16 Paolo Bonzini <bonzini@gnu.org>
8859
8860 Replace %*-header with %provides, %requires, %code. See discussion at
8861 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
8862
8863 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
8864 (b4_user_start_header): Remove.
8865 * data/glr.c: Use new macros instead of b4_*start_header
8866 and b4_*end_header.
8867 * data/glr.cc: Likewise.
8868 * data/lalr1.cc: Likewise.
8869 * data/push.c: Likewise.
8870 * data/yacc.c: Likewise.
8871
8872 * doc/bison.texinfo: Remove %before-header, rename
8873 %{start,end,after}-header to %requires, %provides, %code.
8874
8875 * src/parse-gram.y: Likewise (also rename token names accordingly).
8876 * src/scan-gram.l: Likewise.
8877 * tests/actions.at: Likewise.
8878
88792006-10-14 Paul Eggert <eggert@cs.ucla.edu>
8880
8881 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
8882 Problem reported by Joel E. Denny.
8883
88842006-10-14 Jim Meyering <jim@meyering.net>
8885
8886 (Sync from coreutils.)
8887 Work also when the working directory (with e.g. coreutils sources)
8888 is version controlled with git, rather than CVS.
8889 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
8890 rather than CVS.
8891 In messages and comments, say e.g., "checked-out sources",
8892 rather than "CVS sources".
8893 (version_controlled_file): New function. Work for git as well as
8894 for CVS. Don't use grep's -q option.
8895 (slurp): Call it here, in place of CVS-specific code.
8896
88972006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
8898
8899 Fix testsuite for ./configure --enable-gcc-warnings:
8900 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
8901 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
8902 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
8903 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
8904 * test/regression.at (Diagnostic that expects two alternatives):
8905 Likewise.
8906
89072006-10-12 Paul Eggert <eggert@cs.ucla.edu>
8908
8909 * bootstrap.conf (gnulib_modules): Add config-h.
8910 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
8911 worry about HAVE_CONFIG_H.
8912 * lib/abitset.c: Likewise.
8913 * lib/bitset.c: Likewise.
8914 * lib/bitset_stats.c: Likewise.
8915 * lib/bitsetv-print.c: Likewise.
8916 * lib/bitsetv.c: Likewise.
8917 * lib/ebitset.c: Likewise.
8918 * lib/get-errno.c: Likewise.
8919 * lib/lbitset.c: Likewise.
8920 * lib/subpipe.c: Likewise.
8921 * lib/timevar.c: Likewise.
8922 * lib/vbitset.c: Likewise.
8923 * lib/bitset.c: Include "bitset.h" first, to test interface.
8924 * lib/bitset_stats.c: Include "bitset_stats.h" first.
8925 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
8926 * lib/bitsetv.c: Include "bitsetv.h" first.
8927 * lib/get-errno.c: Include "get-errno.h" first.
8928 * m4/.cvsignore: Add config-h.m4.
8929 * tests/actions.at (Default %printer and %destructor for ...):
8930 Adjust expected line numbers in output to reflect removal of #if
8931 HAVE_CONFIG_H lines.
8932 * tests/glr-regression.at (Missed %merge type warnings when ...):
8933 Likewise.
8934 * tests/regression.at (Braced code in declaration in rules section):
8935 Likewise.
8936 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
8937 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
8938 Include <config.h> unconditionally.
8939
8940 * bootstrap: Sync from coreutils, as follows:
8941
8942 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
8943
8944 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
8945 variable was sometimes used without being initialized. This
8946 messed up the installation of the INSTALL file in some cases.
8947
8948 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
8949
8950 * bootstrap (usage, main program, symlink_to_gnulib): Add option
8951 --copy. Inspired by a suggestion from Bruno Haible.
8952
8953 2006-10-03 Jim Meyering <jim@meyering.net>
8954
8955 * bootstrap: Undo last change to this file, since now gnulib-tool
8956 sticks with the automake default in generating dependencies.
8957
89582006-10-12 Paul Eggert <eggert@cs.ucla.edu>
8959
8960 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
8961 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
8962
8963 * doc/bison.1: Add copyright notice.
8964
8965 * data/glr.c: Don't include <stdarg.h>; not used.
8966
8967 * NEWS: The -g and --graph options now output graphs in Graphviz
8968 DOT format, not VCG format.
8969 * doc/bison.1: Likewise.
8970 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
8971 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
8972 of this change in
8973 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
8974 * TODO: Remove Graphviz entry.
8975 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
8976 remove vcg.c, vcg.h, vcg_defaults.h.
8977 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
8978 * src/graphviz.c, src/graphviz.h: New files.
8979 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
8980 * src/files.h: Make comment more generic.
8981 * src/main.c (main): Likewise.
8982 * src/print_graph.h: Likewise.
8983 * src/getargs.c (usage): Make usage description more generic.
8984 * src/print_graph.c: Include graphviz.h rather than vcg.h.
8985 (static_graph, fgraph): Remove. All uses changed to pass
8986 arguments instead of sharing a static var.
8987 (print_core, print_actions, print_state, print_graph):
8988 Output graphviz format rather than VCG format.
8989 * tests/.cvsignore: Remove *.vcg; add *.dot.
8990 * tests/output.at: Expect *.dot files, not *.vcg files.
8991
8992 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
8993 accommodates the 2006-10-08 change.
8994
89952006-10-11 Bob Rossi <bob@brasko.net>
8996
8997 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
8998 (b4_yyssa, b4_yyerror_range): New macros.
8999 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
9000 (yypvarsinit): Remove init of removed fields.
9001 (yypushparse): Remove use of removed fields; use new macros instead.
9002
90032006-10-11 Paul Eggert <eggert@cs.ucla.edu>
9004
9005 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
9006 in a push parser. Reindent slightly to match yacc.c better.
9007
90082006-10-11 Bob Rossi <bob@brasko.net>
9009
9010 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
9011 yymsg_alloc fields.
9012 (yypvarsinit, yypushparse): Remove init of removed fields.
9013 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
9014
90152006-10-09 Paul Eggert <eggert@cs.ucla.edu>
9016
9017 * THANKS: Add Paolo Bonzini and Bob Rossi.
9018
90192006-10-08 Paolo Bonzini <bonzini@gnu.org>
9020
9021 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
9022 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
9023 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
9024 b4_define_user_cde and uses): Remove.
9025 (b4_comment, b4_prefix, b4_sync_start): New.
9026 * data/bison.m4: New file, with most of the content removed from c.m4.
9027 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
9028 * src/output.c (output_skeleton): Pass bison.m4.
9029 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
9030 only if specified.
9031
90322006-10-05 Paul Eggert <eggert@cs.ucla.edu>
9033
9034 Fix test failure reported by Tom Lane in
9035 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
9036 and try to make such failures easier to catch in the future.
9037 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
9038 that's now the caller's responsibility.
9039 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
9040 Set yychar = YYEOF if it's negative.
9041 * tests/actions.at (yylex): Abort if asked to read past EOF.
9042 * tests/conflicts.at (yylex): Likewise.
9043 * tests/cxx-type.at (yylex): Likewise.
9044 * tests/glr-regression.at (yylex): Likewise.
9045 * tests/input.at (yylex): Likewise.
9046 * tests/regression.at (yylex): Likewise.
9047 * tests/torture.at (yylex): Likewise.
9048
90492006-10-01 Paul Eggert <eggert@cs.ucla.edu>
9050
9051 Fix problems with translating English-language diagnostics.
9052 * bootstrap: Fix bug introduced in recent bootstrap changes, with
9053 respect to bison-runtime pot generation. The YY_ stuff
9054 wasn't being captured.
9055 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
9056 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
9057 * runtime-po/POTFILES.in: Add data/push.c.
9058
90592006-09-29 Paul Eggert <eggert@cs.ucla.edu>
9060
9061 Merge bootstrap changes from coreutils.
9062
9063 2006-09-28 Jim Meyering <jim@meyering.net>
9064
9065 Automatically generated dependencies are important even
9066 when all of the sources in a directory come from gnulib.
9067 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
9068 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
9069
9070 2006-09-23 Jim Meyering <jim@meyering.net>
9071
9072 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
9073
9074 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
9075
9076 * bootstrap: Add support for --force.
9077 (usage): New function. Describe usage less tersely.
9078 (CVS_only_file): New var.
9079
90802006-09-21 Paul Eggert <eggert@cs.ucla.edu>
9081
9082 * data/push.c (YYPUSH_MORE): Make it an enum instead.
9083 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
9084 Adjust white space and comments to match GNU style better.
9085
90862006-09-20 Bob Rossi <bob@brasko.net>
9087
9088 * data/push.c (yyresult_get): Remove function.
9089 (YYPUSH_MORE): Add #define.
9090 (yypushparse): Modify return value.
9091
90922006-09-20 Paul Eggert <eggert@cs.ucla.edu>
9093
9094 * stamp-h.in: Remove; no longer needed.
9095 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
9096 Remove config.h, config.hin, intl (no longer created).
9097 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
9098 stamp-h1.
9099
9100 Sync bootstrap from coreutils, as follows:
9101
9102 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
9103
9104 * bootstrap (symlink_to_gnulib): New function.
9105 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
9106 to copies-of-gnulib.
9107 (cp_mark_as_generated, slurp, gnulib_files):
9108 Avoid making a copy if it's the same as the old version.
9109 (gnulib_files): Add support for this variable (used by Bison).
9110
91112006-09-20 Paul Eggert <eggert@cs.ucla.edu>
9112
9113 * src/getargs.c (usage): Rework to use conventions similar to
9114 coreutils, to make translation a bit easier and the code a bit
9115 smaller. Problem reported by Tim Van Holder.
9116
91172006-09-15 Paul Eggert <eggert@cs.ucla.edu>
9118
9119 Use some of gnulib's new modules, taken from coreutils.
9120
9121 * bootstrap: Sync from coreutils, except add support for gnulib_files.
9122 * bootstrap.conf: New file.
9123 (gnulib_modules): Add configmake, inttypes, unistd.
9124 (XGETTEXT_OPTIONS): Add complain, complain_at,
9125 fatal, fatal_at, warn, warn_at, unexpected_end.
9126 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
9127 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
9128 (gl_EARLY): Add.
9129 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
9130 (gl_INIT): Add
9131 (GNULIB_AUTOCONF_SNIPPET): Remove.
9132 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
9133 the pickiest.
9134 * lib/.cvsignore: Add inttypes_.h.
9135 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
9136 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
9137 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
9138 no-longer-necessary initializations.
9139 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
9140 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
9141 use the unistd module.
9142 * src/system.h: Likewise.
9143 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
9144 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
9145 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
9146 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
9147 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
9148 * src/system.h: Include inttypes.h unconditionally, now that we
9149 use the inttypes module. Don't bother to include stdint.h, since
9150 inttypes.h now does that for us.
9151 (LOCALEDIR): Remove, now that we use the configmake module.
9152 * src/getargs.c: Include configmake.h.
9153 * src/main.c: Likewise.
9154 * src/output.c: Likewise.
9155 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
9156 not from $abs_top_builddir, since config.h moved.
9157
9158
9159 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
9160 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
9161
9162 * src/parse-gram.y (symbol_declaration): Don't put statements
9163 before declarations; it's not portable to C89.
9164 * src/scan-code.l (handle_action_at): Likewise.
9165
9166 * src/scan-code.l: Always initialize braces_level; the old code
9167 left it uninitialized and therefore had undefined behavior.
9168
9169 Don't attempt to redefine 'assert', since it runs afoul of
9170 systems where standard headers (mistakenly) include <assert.h>.
9171 Instead, define and use our own alternative, called 'aver'.
9172 * src/reader.c: Don't include assert.h, since we no longer
9173 use assert.
9174 * src/scan-code.l: Likewise.
9175 * src/system.h (assert): Remove, replacing with....
9176 (aver): New function, taking a bool arg. All uses changed.
9177 * src/tables.c (pack_vector): Ensure that aver arg is bool,
9178 not merely an integer.
9179
91802006-09-15 Bob Rossi <bob@brasko.net>
9181
9182 Add support for push parsing. Based on the original work of
9183 Odd Arild Olsen <oao@fibula.no>.
9184 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
9185 * data/c.m4 (YYPUSH): New.
9186 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
9187 * data/push.c: New file.
9188 * src/getargs.c (push_parser): New var.
9189 * src/getargs.h (push_parser): New declaration.
9190 * src/output.c (prepare): Add macro insertion of `push_flag'.
9191 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
9192 (prologue_declaration): Parse %push-parser.
9193 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
9194 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
9195 list of removed lines from the traces observed.
9196 (AT_CHECK_CALC_LALR): Added push parser tests.
9197
91982006-09-13 Paul Eggert <eggert@cs.ucla.edu>
9199
9200 * NEWS: Version 2.3a.
9201 * configure.ac (AC_INIT): Likewise.
9202
9203 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
9204 "#define YYSTYPE int" that caused "make maintainer-check" to fail
9205 due to header ordering dependencies. I don't know why the #define
9206 was there.
9207
9208 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
9209 runtime cost when YYDEBUG is not defined, and so that some tests
9210 that used to fail now work. Problem and initial suggestion by
9211 Paolo Bonzini.
9212 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
9213 * data/glr.cc (b4_parser_class_name):
9214 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
9215 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
9216 (yydebug_) [YYDEBUG]: New member.
9217 (yycdebug_): Now defined only if YYDEBUG.
9218 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
9219 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
9220 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
9221 if YYYDEBUG.
9222 (debug_stream, set_debug_stream, debug_level, set_debug_level):
9223 Define only if YYDEBUG.
9224 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
9225 set_debug_level.
9226 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
9227 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
9228 AT_CHECK_CALC_GLR_CC that are working now.
9229
92302006-09-12 Paul Eggert <eggert@cs.ucla.edu>
9231
9232 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
9233 We don't need them in glr.cc, and glr.c defines them.
9234 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
9235 assumes that defining it to anything is the same as defining
9236 it to 1. Problem reported by Paolo Bonzini.
9237
92382006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
9239
9240 * data/c.m4 (b4_null, b4_case): Define.
9241 * src/output.c (prepare_symbols): Use b4_null.
9242 (user_actions_output): Use b4_case.
9243
92442006-09-11 Paul Eggert <eggert@cs.ucla.edu>
9245
9246 * data/glr.c (b4_shared_declarations): Put start-header first,
9247 before any #includes that we generate, so that feature-test
9248 macros work. Problem reported by Michael Deutschmann in
9249 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
9250 * data/lalr1.cc: Likewise.
9251 * doc/bison.texinfo (Prologue): Document that feature-test macros
9252 should be defined before any Bison declarations.
9253 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
9254 that depend on location.hh after, not before, Bison decls, since
9255 we now include location.hh after the first user prologue.
9256
9257 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
9258 Sander Brandenburg in
9259 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
9260 Also, fix minor white space and comment issues.
9261 (Prologue): Mention that it's better to define feature-test macros
9262 before Bison declarations. Problem reported by Michael Deutschmann.
9263
9264 * README-cvs: Fix typo: "&" should be "&&". Problem reported
9265 by Jim Meyering.
9266 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
9267 This adjusts to recent gnulib changes.
9268
92692006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
9270
9271 Finish implementation of per-type %destructor/%printer. Discussed
9272 starting at
9273 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
9274 and
9275 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
9276 * NEWS (2.3+): Add a description of this feature to the default
9277 %destructor/%printer description.
9278 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
9279 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
9280 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
9281 list node contains a semantic type.
9282 * src/symtab.c, src/symtab.h: Extend with a table that associates
9283 semantic types with their %destructor's and %printer's.
9284 (semantic_type_from_uniqstr, semantic_type_get,
9285 semantic_type_destructor_set, semantic_type_printer_set): New functions
9286 composing the public interface of that table.
9287 (symbol_destructor_get, symbol_destructor_location_get,
9288 symbol_printer_get, symbol_printer_location_get): If there's no
9289 per-symbol %destructor/%printer, look up the per-type before trying
9290 the default.
9291 * tests/actions.at (Per-type %printer and %destructor): New test case.
9292 * tests/input.at (Default %printer and %destructor redeclared):
9293 Extend to check that multiple occurrences of %symbol-default in a
9294 single %destructor/%printer declaration is an error.
9295 (Per-type %printer and %destructor redeclared, Unused values with
9296 per-type %destructor): New test cases.
9297
92982006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
9299
9300 Require default %destructor/%printer to be declared using
9301 %symbol-default instead of an empty symbol list, and start working on
9302 new per-type %destructor/%printer. Discussed at
9303 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
9304 * NEWS (2.3+): Add %symbol-default to example.
9305 * bison.texinfo (Freeing Discarded Symbols): Likewise.
9306 (Table of Symbols): Add entry for %symbol-default.
9307 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
9308 (generic_symlist, generic_symlist_item): New nonterminals for creating
9309 a list in which each item is a symbol, semantic type, or
9310 %symbol-default.
9311 (grammar_declaration): Use generic_symlist in %destructor and %printer
9312 declarations instead of symbols.1 or an empty list.
9313 (symbol_declaration, precedence_declaration, symbols.1): Update actions
9314 for changes to symbol_list.
9315 * src/reader.c: Update for changes to symbol_list.
9316 * src/scan-code.l: Likewise.
9317 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
9318 * src/symlist.c, src/symlist.h: Extend such that a list node may
9319 represent a semantic type or a %symbol-default in addition to just an
9320 ordinary symbol. Add switched functions for setting %destructor's and
9321 %printer's.
9322 * tests/actions.at, tests/input.at: Add %symbol-default to all default
9323 %destructor/%printer declarations.
9324
93252006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
9326
9327 Whether the default %destructor/%printer applies to a particular symbol
9328 isn't a question of whether the user *declares* that symbol (in %token,
9329 for example). It's a question of whether the user by any means
9330 *defines* the symbol at all (by simply using a char token, for
9331 example). $end is defined by Bison whereas any other token with token
9332 number 0 is defined by the user. The error token is always defined by
9333 Bison regardless of whether the user declares it with %token, but we
9334 may one day let the user define error as a nonterminal instead.
9335 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
9336 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
9337 the meaning of "user-defined".
9338 * tests/actions.at (Default %printer and %destructor for user-declared
9339 end token): Rename to...
9340 (Default %printer and %destructor for user-defined end token): ...
9341 this.
9342
9343 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
9344 computation of whether to apply the default, don't maintain a list of
9345 every Bison-defined symbol. Instead, just check for a first character
9346 of '$', which a user symbol cannot have, and check for the error token.
9347
93482006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
9349
9350 Don't apply the default %destructor or %printer to the error token,
9351 $undefined, or $accept. This change fits the general rule that the
9352 default %destructor and %printer are only for user-declared symbols,
9353 and it solves several difficulties that are described in the new test
9354 cases listed below.
9355 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
9356 * tests/actions.at (Default %printer and %destructor are not for error
9357 or $undefined, Default %printer and %destructor are not for $accept):
9358 New test cases.
9359
93602006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
9361
9362 Allow %start after the first rule.
9363 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
9364 when parsing the first rule.
9365 (check_and_convert_grammar): Search for it here after all grammar
9366 declarations have been parsed. Skip midrules, which have dummy LHS
9367 nonterminals.
9368 * src/symtab.c (symbol_is_dummy): New function.
9369 * src/symtab.h (symbol_is_dummy): Declare it.
9370 * tests/input.at (%start after first rule): New test.
9371
93722006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
9373
9374 Redo some of the previous commit: add back the ability to use
9375 non-aliased/undeclared string literals since it might be useful to
9376 those declaring %token-table.
9377 * src/reader.c (check_and_convert_grammar): Undo changes in previous
9378 commit: don't worry about complaints from symbols_pack.
9379 * src/symtab.c (symbol_new, symbol_class_set,
9380 symbol_check_alias_consistency): Undo changes in previous commit: count
9381 each string literal as a new symbol and token, assign it a symbol
9382 number, and don't complain about non-aliased string literals.
9383 (symbols_pack): Since symbol_make_alias still does not decrement symbol
9384 and token counts but does still set aliased tokens to the same number,
9385 symbol_pack_processor now leaves empty slots in the symbols array.
9386 Remove those slots.
9387 * tests/regression.at (Undeclared string literal): Remove test case
9388 added in previous commit since non-aliased string literals are allowed
9389 again.
9390 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
9391 remove unnecessary string literal declarations.
9392 * tests/sets.at (Firsts): Likewise.
9393
93942006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
9395
9396 Don't allow an undeclared string literal, but allow a string literal to
9397 be used before its declaration.
9398 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
9399 symbols_pack complained.
9400 * src/symtab.c (symbol_new): Don't count a string literal as a new
9401 symbol.
9402 (symbol_class_set): Don't count a string literal as a new token, and
9403 don't assign it a symbol number since symbol_make_alias does that.
9404 (symbol_make_alias): It's not necessary to decrement the symbol and
9405 token counts anymore. Don't assume that an alias declaration occurs
9406 before any uses of the identifier or string, and thus don't assert that
9407 one of them has the highest symbol number so far.
9408 (symbol_check_alias_consistency): Complain if there's a string literal
9409 that wasn't declared as an alias.
9410 (symbols_pack): Bail if symbol_check_alias_consistency failed since
9411 symbol_pack asserts that every token has been assigned a symbol number
9412 although undeclared string literals have not.
9413 * tests/regression.at (String alias declared after use, Undeclared
9414 string literal): New test cases.
9415 (Characters Escapes, Web2c Actions): Declare string literals as
9416 aliases.
9417 * tests/sets.at (Firsts): Likewise.
9418
94192006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
9420
9421 In the grammar scanner, STRING_FINISH unclosed constructs and return
9422 them to the parser in order to improve error messages.
9423 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
9424 SC_BRACED_CODE, SC_PROLOGUE): Implement.
9425 * tests/input.at (Unclosed constructs): New test case.
9426 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
9427 seen.
9428
9429 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
9430 unused global.
9431
94322006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
9433
9434 Handle string aliases for character tokens correctly.
9435 * src/symtab.c (symbol_user_token_number_set): If the token has an
9436 alias, check and set its alias's user token number instead of its own,
9437 which is set to indicate the alias. Previously, every occurrence of
9438 the character token in the grammar overwrote that alias indicator with
9439 the character code.
9440 * tests/input.at (String aliases for character tokens): New test.
9441
94422006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
9443
9444 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
9445
94462006-08-11 Paul Eggert <eggert@cs.ucla.edu>
9447
9448 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
9449 to prevent failures when building on older platforms.
9450 Check for autopoint failure.
9451 Set XGETTEXT_OPTIONS to values that check for C format strings,
9452 so that translators are warned about them (this also helps
9453 prevent core dumps).
9454
9455 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
9456 function, since it simplifies our code a bit.
9457
9458 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
9459 rather than -W, so we don't get bogus warnings about sign comparisons.
9460 Add -Wpointer-arith, since that warning is useful (it reports code
9461 that does not conform to C89 and that some compilers reject).
9462 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
9463 since it's no longer needed.
9464
94652006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
9466
9467 Clean up scanners a bit.
9468 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
9469 definitions so gcc won't warn when obstack_for_string is unused.
9470 * src/scan-code.l: config.h and system.h are already #include'd by
9471 scan-code-c.c, so get rid of them here.
9472 * src/scan-gram.l: Likewise.
9473 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
9474 definitions rather than duplicating the rest of it.
9475 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
9476
94772006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
9478
9479 Suppress signed/unsigned comparison warnings for yycheck.
9480 * data/c.m4 (b4_safest_int_type): New macro.
9481 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
9482 a signed int type, cast it to b4_safest_int_type first.
9483 * data/yacc.c: Likewise.
9484 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
9485 also overwritten.
9486
94872006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
9488
9489 * doc/bison.texinfo: Fix some typos.
9490
94912006-08-02 Paul Eggert <eggert@cs.ucla.edu>
9492
9493 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
9494 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
9495
9496 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
9497 the latest gnulib does this a different way.
9498 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
9499 translation was patched, so stop omitting it.
9500
95012006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
9502
9503 Enable declaration of default %printer/%destructor. Make the parser
9504 use these for all user-declared grammar symbols for which the user does
9505 not declare a specific %printer/%destructor. Thus, the parser uses it
9506 for token 0 if the user declares it but not if Bison generates it as
9507 $end. Discussed starting at
9508 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
9509 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
9510 and
9511 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
9512 * NEWS (2.3+): Mention.
9513 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
9514 declare a %destructor for a mid-rule's semantic value. It's just
9515 impossible to declare one specific to it.
9516 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
9517 code. Describe default %destructor form.
9518 * src/parse-gram.y (grammar_declaration): Parse default
9519 %printer/%destructor declarations.
9520 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
9521 and symbol_destructor_location_get rather than accessing the destructor
9522 and destructor_location members of struct symbol.
9523 (symbol_printers_output): Likewise but for %printer's.
9524 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
9525 again.
9526 * src/symtab.c (default_destructor, default_destructor_location,
9527 default_printer, default_printer_location): New static global
9528 variables to record the default %destructor and %printer.
9529 (symbol_destructor_get, symbol_destructor_location_get,
9530 symbol_printer_get, symbol_printer_location_get): New functions to
9531 compute the appropriate %destructor and %printer for a symbol.
9532 (default_destructor_set, default_printer_set): New functions to set the
9533 default %destructor and %printer.
9534 * src/symtab.h: Prototype all those new functions.
9535 * tests/actions.at (Default %printer and %destructor): New test to
9536 check that the right %printer and %destructor are called, that they're
9537 not called for $end, and that $$ and @$ work correctly.
9538 (Default %printer and %destructor for user-declared end token): New
9539 test to check that the default %printer and %destructor are called for
9540 a user-declared end token.
9541 * tests/input.at (Default %printer and %destructor redeclared, Unused
9542 values with default %destructor): New tests to check related grammar
9543 warnings and errors.
9544
95452006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
9546
9547 Clean up handling of %destructor for the end token (token 0).
9548 Discussed starting at
9549 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
9550 and
9551 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
9552
9553 Make the skeletons consistent in how they pop the end token and invoke
9554 its %destructor.
9555 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
9556 state, which has token number 0, since this would invoke the
9557 %destructor for the end token.
9558 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
9559 until after shifting the end token, or else it won't be popped.
9560 * data/yacc.c (yyparse): Likewise.
9561
9562 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
9563 it's the end token. Upon termination, destroy an unshifted lookahead
9564 even when it's the end token.
9565 * data/lalr1.cc (yy::parser::parse): Likewise.
9566 * data/yacc.c (yyparse): Likewise.
9567
9568 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
9569 value warnings for the end token when the user gives the end token a
9570 %destructor.
9571
9572 * tests/actions.at (Printers and Destructors): Test all the above.
9573
95742006-07-24 Paul Eggert <eggert@cs.ucla.edu>
9575
9576 Update to latest gnulib and gettext versions.
9577 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
9578 Add fopen-safer.
9579 (gnulib_files): Add m4/warning.m4. Don't worry about files
9580 overwritten by autopoint.
9581 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
9582 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
9583 rejects them.
9584 Don't use autoreconf; instead, invoke autopoint etc. by hand,
9585 so that we can remove the intl files at a better time.
9586 (intl_files_to_remove): Remove aclocal.m4, since it gets
9587 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
9588 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
9589 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
9590 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
9591 Remove datarootdir hack; no longer needed.
9592 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
9593 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
9594 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
9595 strdup.h.
9596 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
9597 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
9598
95992006-07-20 Paul Eggert <eggert@cs.ucla.edu>
9600
9601 * bootstrap: Adjust to today's change to gnulib-tool by invoking
9602 it with --assume-autoconf='latest-stable'.
9603
96042006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
9605
9606 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
9607 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
9608 YYSTYPE' and `{'.
9609 * src/muscle_tab.h (muscle_grow): Replace the header comments with
9610 those from muscle_tab.c since the old ones are misleading.
9611
96122006-07-13 Akim Demaille <akim@epita.fr>
9613
9614 Support %define "KEY" {VALUE}.
9615 * src/scan-code.h, src/scan-code.l (translate_action)
9616 (translate_rule_action, translate_symbol_action, translate_code):
9617 Return char *, not const char *.
9618 * src/parse-gram.y (declaration): Rename as...
9619 (prologue_declaration): this.
9620 (string_content): Remove this nonterminal, use STRING.
9621 (braceless, content, content.opt): New nonterminal.
9622 Use them.
9623 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
9624 as value.
9625 * src/scan-gram.l (getargs.h): Don't include it.
9626
96272006-07-12 Paul Eggert <eggert@cs.ucla.edu>
9628
9629 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
9630 rather than a for-loop that declares a local bool variable. This
9631 should work around a compatibility problem with a Cray x1e C++
9632 compiler reported by Hung Nguyen in
9633 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
9634 The for-loop was introduced in the 2004-11-17 change but I don't
9635 know why it was needed.
9636
96372006-07-12 Akim Demaille <akim@epita.fr>
9638
9639 * data/c.m4: Comment changes.
9640
96412006-07-10 Akim Demaille <akim@lrde.epita.fr>
9642
9643 * src/complain.c (error_message, ERROR_MESSAGE): New.
9644 To factor...
9645 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
9646 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
9647
96482006-07-09 Paul Eggert <eggert@cs.ucla.edu>
9649
9650 * NEWS: Instead of %union, you can define and use your own union type
9651 YYSTYPE if your grammar contains at least one <type> tag.
9652 Your YYSTYPE need not be a macro; it can be a typedef.
9653 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
9654 (Union Decl, Decl Summary): Document this.
9655 * data/glr.c (YYSTYPE): Implement this.
9656 * data/glr.cc (YYSTYPE): Likewise.
9657 * data/lalr1.cc (YYSTYPE): Likewise.
9658 * data/yacc.c (YYSTYPE): Likewise.
9659 * src/output.c (prepare): Output tag_seen_flag.
9660 * src/parse-gram.y (declaration, grammar_declaration):
9661 Use 'union_seen' rather than 'typed' to determine whether
9662 %union has been seen, since grammars can now be typed without
9663 %union.
9664 (symbol_declaration, type.opt, symbol_def):
9665 Keep track of whether a tag has been seen.
9666 * src/reader.c (union_seen, tag_seen): New vars.
9667 (typed): remove.
9668 * src/reader.h (union_seen, tag_seen, typed): Likewise.
9669 * src/scan-code.l (untyped_var_seen): New variable.
9670 (handle_action_dollar): Adjust to above changes.
9671 (handle_action_dollar, handle_action_at):
9672 Improve overflow checking for outlandish numbers.
9673 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
9674 avoid new diagnostics generated by above changes.
9675 * tests/regression.at (YYSTYPE typedef): Add test to check
9676 for type tags without %union.
9677
9678 * src/symlist.c (symbol_list_length): Return int, not unsigned
9679 int, since callers expect int. This may need to get revisited
9680 once we have proper integer overflow checking.
9681
9682 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
9683 object is now static.
9684
9685 * src/getargs.c (flags_argmatch): Return void, not int,
9686 to pacify ./configure --enable-gcc-warnings.
9687
9688 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
9689 since last_string is already defined to FLEX_PREFIX (last_string).
9690
96912006-07-09 Akim Demaille <akim@lrde.epita.fr>
9692
9693 Implement --warnings/-W.
9694 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
9695 replaced by...
9696 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
9697 Adjust callers.
9698 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
9699 (warnings_args, warnings_types): New.
9700 (getargs, short_options, long_options): Accept -W/--warnings.
9701 Sort the options by alphabetical order, upper case letter right
9702 before its lower case.
9703
97042006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
9705
9706 Change %merge result type clash warnings to errors. Discussed at
9707 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
9708 * src/reader.c (record_merge_function_type): Use complain_at.
9709 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
9710 declared later): Update test case results.
9711
97122006-07-09 Akim Demaille <akim@lrde.epita.fr>
9713
9714 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
9715 to be in alphabetical order.
9716 (trace_args): Spelling fixes.
9717
97182006-07-09 Paul Eggert <eggert@cs.ucla.edu>
9719
9720 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
9721 so they don't collide with user-defined macros.
9722 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
9723 this was never guaranteed, and now that we're using gnulib stdint,
9724 which defines int_fast16_t to long int, the problem is exposed.
9725
97262006-07-08 Paul Eggert <eggert@cs.ucla.edu>
9727
9728 * data/c.m4 (b4_basename): Simplify a bit, since we don't
9729 need the full POSIX semantics (and weren't implementing them
9730 anyway).
9731
9732 Adjust to Autoconf 2.60 and today's gnulib.
9733 * bootstrap (gnulib_modules): Add stdint.
9734 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
9735 no longer copies it.
9736 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
9737 since stdint needs the former and wcwidth (which is now required
9738 by mbswidth) needs the latter.
9739 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
9740 work around a compatibility glitch between gettext 0.14.6 and
9741 Autoconf 2.60.
9742 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
9743 Do not check for uintptr_t, since new stdint module does the right
9744 thing.
9745 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
9746 Add stdint.h, stdint_.h, wcwidth.h.
9747 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
9748 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
9749 stdint.m4, wchar_t.m4, wcwidth.m4.
9750 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
9751 usual order for ../lib/*.h files.
9752 (file_name_split): Use last_component, not base_name, to adjust
9753 to gnulib changes.
9754 * src/parse-gram.h: Include <strverscmp.h> in the usual order
9755 for ../lib/*.h files.
9756 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
9757 Define unconditionally, since we now assume the stdint module.
9758 * src/scan-skel.l: Include <dirname.h>.
9759 (BASE_QPUTS): Use last_component, not base_name.
9760 * src/system.h: Include <unlocked-io.h> in the usual order
9761 for ../lib/*.h files. Include <stdint.h> unconditionally,
9762 since we now use the stdint module.
9763 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
9764 HAVE_UINTPTR_T, since we now use the stdint module.
9765 (base_name): Remove decl, since files now include <dirname.h>
9766 to get the decl.
9767
97682006-07-08 Akim Demaille <akim@lrde.epita.fr>
9769
9770 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
9771 New, default to 1.
9772 * data/yacc.c, data/glr.c, data/location.cc: Use them.
9773 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
9774 default.
9775 * tests/calc.at: Adjust.
9776
97772006-07-08 Akim Demaille <akim@lrde.epita.fr>
9778
9779 * data/c.m4 (b4_basename): New.
9780 (b4_syncline): Also output the location of its invocation (from
9781 the skeleton).
9782 (b4_user_action, b4_define_user_action, b4_user_actions)
9783 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
9784 (b4_user_stype): New.
9785 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
9786
97872006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
9788
9789 In the grammar file, the first column is 1 not 0 on the first line as
9790 on every other line.
9791 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
9792 * tests/input.at (Torturing the Scanner): Update output.
9793
9794 * src/scan-gram.l (scanner_cursor): Declare it static.
9795
97962006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
9797
9798 In warnings, say "previous declaration" rather than "first
9799 declaration".
9800 * src/symtab.c (redeclaration): Do that here.
9801 * src/reader.c (record_merge_function_type): In the case of a result
9802 type clash, report the previous declaration rather than the very first
9803 one in the grammar file.
9804 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
9805 declared later): Add a third declaration to check this behavior.
9806 * tests/input.at (Incompatible Aliases): Update output.
9807
98082006-06-27 Akim Demaille <akim@epita.fr>
9809
9810 * doc/Doxyfile.in: New.
9811 * doc/Makefile.am: Use it.
9812 * src/lalr.h, src/symtab.h: Initial doxygenation.
9813
98142006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
9815
9816 Don't miss %merge result type warnings just because the LHS types are
9817 declared after the %merge. This continues the effort of the previous
9818 patch.
9819 * src/reader.c (get_merge_function): Don't set the merger type yet.
9820 (record_merge_function_type): New function for setting the merger type
9821 and checking for clashes.
9822 (grammar_current_rule_merge_set): Set the location of the %merge for
9823 the current rule.
9824 (packgram): Invoke record_merge_function_type for each rule now that
9825 all symbol type declarations have been parsed.
9826 * src/reader.h (merger_list.type_declaration_location): New member
9827 storing the location of the first %merge from which the type for this
9828 merging function was derived.
9829 * src/symlist.h (symbol_list.merger_declaration_location): New member
9830 storing the location of a rule's %merge, if any.
9831 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
9832 declared later): New test to catch the error fixed by the above patch.
9833
98342006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
9835
9836 Get action warnings (grammar_rule_check) right even when symbol
9837 declarations appear after the rules. Discussed at
9838 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
9839 and
9840 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
9841 Don't mistake the type of $$ in a midrule to be that of its parent
9842 rule's $$.
9843 * src/reader.c (grammar_current_rule_end): Don't invoke
9844 grammar_rule_check yet since not all symbol declarations may have been
9845 parsed yet.
9846 (grammar_midrule_action): Likewise.
9847 Don't record whether the midrule's $$ has been used yet since actions
9848 haven't been translated yet.
9849 Record the midrule's parent rule and its RHS index within the parent
9850 rule.
9851 (grammar_current_rule_action_append): Don't translate the action yet
9852 since not all symbol declarations may have been parsed yet and, thus,
9853 warnings about types for $$, $n, @$, and @n can't be reported yet.
9854 (packgram): Translate the action and invoke grammar_rule_check now that
9855 all symbol declarations have been parsed.
9856 * src/scan-code.l (handle_action_dollar): Now that this is invoked
9857 after parsing the entire grammar file, the symbol list here in the case
9858 of a midrule is actually the midrule's empty RHS, so reference its
9859 parent rule's RHS where necessary.
9860 On the other hand, now that you can already know it's a midrule, you
9861 aren't forced to think $$ has the same type as its parent rule's $$.
9862 (handle_action_at): In the case of a midrule, reference the parent rule
9863 where necessary.
9864 * src/symlist.c (symbol_list_new): Initialize new midrule-related
9865 members.
9866 (symbol_list_length): Now that this is invoked after all rules have
9867 been parsed, a NULL symbol (rather than a NULL symbol list node)
9868 terminates a rule. symbol_list_print already does this correctly.
9869 * src/symlist.h (symbol_list.midrule_parent_rule,
9870 symbol_list.midrule_parent_rhs_index): New members so that midrules can
9871 remember their relationships with their parents.
9872 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
9873 fixed by the above patch.
9874 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
9875 implementing...
9876 (Unused values): ... this old test case and...
9877 (Unused values before symbol declarations): ... this new test case.
9878 This one is the same as `Unused values' except that all symbol
9879 declarations appear after the rules in order to catch the rest of the
9880 errors fixed by the above patch.
9881
98822006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
9883
9884 More cleanup.
9885 * src/reader.c (current_rule): Declare it static since it's no longer
9886 used outside this file.
9887 (grammar_current_rule_action_append): Remove redundant arguments from
9888 translate_rule_action invocation.
9889 * src/reader.h (current_rule): Remove this unused extern.
9890 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
9891 * src/scan-code.l (translate_rule_action): Likewise.
9892
98932006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
9894
9895 Clean up yesterday's patch.
9896 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
9897 to...
9898 * src/reader.c (grammar_current_rule_action_append): ... here for
9899 consistency with grammar_current_rule_symbol_append.
9900 * tests/regression.at (Braced code in declaration in rules section):
9901 Make yyerror and yylex static as usual.
9902
99032006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
9904
9905 Fix bug that mistakes braced code in a declaration in the rules section
9906 to be a rule action. Mentioned at
9907 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
9908 * src/scan-gram.l: Move midrule action detection from the start of the
9909 scanning of any braced code to...
9910 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
9911 action. For readability, use $2 and @2 rather than the equivalent
9912 global variables.
9913 * tests/regression.at (Braced code in declaration in rules section):
9914 New test to catch the error fixed by the above patch.
9915
9916 Work on code readability some.
9917 * src/scan-code.l (current_rule): Get rid of this misleading and
9918 redundant declaration: it's actually extern'ed in reader.h.
9919 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
9920 translate_action): Add a rule argument and use it instead of the global
9921 current_rule.
9922 (translate_rule_action): This already receives current_rule through an
9923 argument, so pass it on to translate_action instead of assigning
9924 current_rule to current_rule.
9925 (translate_symbol_action, translate_code): Pass rule = NULL to
9926 translate_action.
9927
99282006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
9929
9930 Rename %before-definitions to %start-header and %after-definitions to
9931 %end-header. Don't use these declarations to separate pre-prologue
9932 blocks from post-prologue blocks. Add new order-independent
9933 declarations %before-header and %after-header as alternatives to the
9934 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
9935 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
9936 * NEWS (2.3+): Update for these changes.
9937 * data/glr.c (b4_before_definitions): Update to...
9938 (b4_start_header): ... this.
9939 (b4_after_definitions): Update to...
9940 (b4_end_header): ... this.
9941 * data/glr.cc: Likewise.
9942 * data/lalr1.cc: Likewise.
9943 * data/yacc.c: Likewise.
9944 * doc/bison.texinfo (The prologue): Update names, and replace remaining
9945 prologue blocks with %*-header declarations.
9946 (Calc++ Parser): Likewise.
9947 (Decl Summary): Update names.
9948 (Table of Symbols): Update description.
9949 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
9950 (PERCENT_END_HEADER): ... this.
9951 (PERCENT_BEFORE_DEFINITIONS): Update to...
9952 (PERCENT_START_HEADER): ... this.
9953 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
9954 (declaration): Update token names and m4 macro names.
9955 When parsing %end-header and %start-header, invoke translate_code
9956 before muscle_code_grow, and no longer set global booleans to remember
9957 whether these declarations have been seen.
9958 Parse new %after-header and %before-header.
9959 * src/reader.c (before_definitions, after_definitions): Remove.
9960 (prologue_augment): Accept a new bool argument to specify whether to
9961 augment the pre-prologue or post-prologue.
9962 * src/reader.h (before_definitions, after_definitions): Remove these
9963 extern's.
9964 (prologue_augment): Add new bool argument.
9965 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
9966 (PERCENT_END_HEADER): ... this.
9967 (PERCENT_BEFORE_DEFINITIONS): Update to...
9968 (PERCENT_START_HEADER): ... this.
9969 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
9970 * tests/actions.at (Printers and Destructors): Update names.
9971
99722006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
9973
9974 Add comparison operators for C++ location classes. Discussed at
9975 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
9976 * data/c++.m4 (b4_define_location_comparison): New boolean %define
9977 declaration indicating whether filename_type has an operator==. If
9978 filename_type is `std::string', it defaults to `1', `0' otherwise.
9979 * data/location.cc: Iff b4_define_location_comparison is `1', add
9980 operator== and operator!= for class position and for class location.
9981
9982 Some minor fixes.
9983 * src/scan-action.l: Remove unused file.
9984 * src/symtab.c (symbol_printer_set): Use printer_location not
9985 destructor_location.
9986 * src/symtab.h (struct symbol): Replace incorrect source comment for
9987 printer members.
9988 * tests/input.at (Incompatible Aliases): Update output with correct
9989 printer location.
9990
99912006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
9992
9993 Don't put the pre-prologue in the header file. For the yacc.c code
9994 file and the glr.c header and code files, move the pre-prologue before
9995 the token definitions. Add new %before-definitions and
9996 %after-definitions to declare code that will go in both the header file
9997 and code file. Discussed at
9998 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
9999 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
10000 and
10001 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
10002 * NEWS (2.3+): Describe these changes.
10003 * data/glr.c (b4_pre_prologue): Move from within to before...
10004 (b4_shared_declarations): ... this.
10005 Add new b4_before_definitions before b4_token_enums.
10006 Add new b4_after_definitions at the end.
10007 * data/glr.cc (b4_pre_prologue): Replace with...
10008 (b4_before_definitions): ... this in the header file.
10009 (b4_after_definitions): New near the end of the header file.
10010 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
10011 code file right before including the header file.
10012 (b4_before_definitions): New in the previous position of
10013 b4_pre_prologue in the header file.
10014 (b4_after_definitions): New near the end of the header file.
10015 * data/yacc.c: Clean up some m4 quoting especially in the header file.
10016 (b4_token_enums_defines): In the code file, move to right before
10017 YYSTYPE for consistency with the header file.
10018 (b4_before_definitions): New right before b4_token_enums_defines in
10019 both the header and code file.
10020 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
10021 header and code file.
10022 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
10023 of prologues for %union dependencies.
10024 (Decl Summary): In %defines description, mention the effect of
10025 %before-definitions and %after-definitions on the header file.
10026 (Calc++ Parser): Forward declare driver in a %before-definitions rather
10027 than in the pre-prologue so that make check succeeds.
10028 (Table of Symbols): Add entries for %before-definitions and
10029 %after-definitions.
10030 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
10031 %before-definitions.
10032 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
10033 (declaration): Parse those declarations and append to
10034 b4_before_definitions and b4_after_definitions, respectively.
10035 * src/reader.c (before_definitions, after_definitions): New bools to
10036 track whether those declarations have been seen.
10037 (prologue_augment): Add to the post-prologue if %union,
10038 %before-definitions, or %after-definitions has been seen.
10039 * src/reader.h (before_definitions, after_definitions): New extern's.
10040 * src/scan-gram.l: Scan the new declarations.
10041 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
10042 prologue block in a %before-definitions or a %after-definitions based
10043 on whether the %union is declared.
10044 * tests/regression.at (Early token definitions with --yacc, Early token
10045 definitions without --yacc): Move tests for token definitions into the
10046 post-prologue since token names are no longer defined in the
10047 pre-prologue.
10048
100492006-06-20 Akim Demaille <akim@epita.fr>
10050
10051 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
10052 (symbol_get): Use it.
10053 * src/parse-gram.y: Use it.
10054
100552006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
10056
10057 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
10058 build succeeds when configured with --enable-gcc-warnings.
10059
100602006-06-19 Paul Eggert <eggert@cs.ucla.edu>
10061
10062 * src/parse-gram.y (char_name): New function.
10063 (CHAR, STRING, string_content): For %printer, properly escape.
10064 (ID): Prefer fputs to fprintf.
10065 (id): Reindent to be consistent with other rules.
10066 Properly quote char.
10067
10068 The Translation Project changed its way of publishing translations
10069 to maintainers. I haven't received any responses to my request
10070 for supporting the old way, or for documenting the new way. I
10071 have modified 'bootstrap' to use screen scraping
10072 (in this case, HTML scraping). This is unreliable and inelegant,
10073 but I don't see any better way. Yuck.
10074 * bootstrap (TP_URL, WGET_COMMAND): New vars.
10075 (get_translations): New function, which uses HTML scraping to
10076 deduce locations of latest translations.
10077 Use this function to grab both bison and bison-runtime .po files.
10078 Don't bother priming the pump for the runtime-po domain any more,
10079 as it's now translated better than bison is.
10080
100812006-06-19 Akim Demaille <akim@epita.fr>
10082
10083 * src/scan-gram.l: No longer "parse" things after `%union' until
10084 `{'. Rather, return a single "%union" token.
10085 No longer make symbols: return strings, and leave the conversion
10086 to symbols to the parser.
10087 (SC_PRE_CODE, token_type): Remove.
10088 * src/parse-gram.y (%union): New field `character'.
10089 Sort tokens.
10090 (CHAR): New token.
10091 (ID, ID_COLON): Now that the scanner no longer makes them
10092 identifiers, adjust all uses to invoke symbol_get.
10093 (id_colon): New, wraps the conversion from string to symbol.
10094 (%union): Accept a possible union_name.
10095 (symbol): Now can be a char.
10096 * data/c.m4 (b4_union_name): Leave a default value.
10097 * data/glr.c, data/yacc.c: Use it.
10098
100992006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
10100
10101 For associating token numbers with token names for "yacc.c", don't use
10102 #define statements unless `--yacc' is specified; always use enum
10103 yytokentype. Most important discussions start at:
10104 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
10105 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
10106 and
10107 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
10108 * NEWS (2.3+): Mention.
10109 * data/c.m4 (b4_yacc_if): New.
10110 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
10111 token #define's.
10112 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
10113 on token name definitions.
10114 * src/getargs.c (usage): Capitalize `Yacc' in English.
10115 * src/output.c (prepare): Define b4_yacc_flag.
10116 * tests/regression.at (Early token definitions): Test that tokens names
10117 are defined before the pre-prologue not just before the post-prologue.
10118 Remove this test case and copy to...
10119 (Early token definitions with --yacc): ... this to test #define's.
10120 (Early token definitions without --yacc): ... and this to test enums.
10121
101222006-06-11 Paul Eggert <eggert@cs.ucla.edu>
10123
10124 * NEWS: Reword the post-2.3 change to not be so optimistic about
10125 removing the old "look-ahead" spelling.
10126 Update previous look-ahead/lookahead change reports.
10127 * REFERENCES: look-ahead -> lookahead (since that's
10128 what he actually wrote).
10129 * doc/refcard.tex: look ahead -> lookahead,
10130 look-ahead -> lookahead
10131
101322006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
10133
10134 For consistency, use `lookahead' instead of `look-ahead' or
10135 `look_ahead'. Discussed starting at
10136 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
10137 and then at
10138 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
10139 * NEWS: For the next release, note the change to `--report'.
10140 * TODO, doc/bison.1: Update English.
10141 * doc/bison.texinfo: Update English.
10142 (Understanding Your Parser, Bison Options): Document as
10143 `--report=lookahead' rather than `--report=look-ahead'.
10144 * src/conflicts.c: Update English in comments.
10145 (lookahead_set): Rename from look_ahead_set.
10146 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
10147 (resolve_sr_conflict): Rename local look_ahead_tokens to
10148 lookahead_tokens, and update other uses.
10149 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
10150 count_rr_conflicts, conflicts_free): Update uses.
10151 * src/getargs.c (report_args): Move "lookahead" before alternate
10152 spellings.
10153 (report_types): Update uses.
10154 (usage): For `--report' usage description, state `lookahead' spelling
10155 rather than `look-ahead'.
10156 * src/getargs.h (report.report_lookahead_tokens): Rename from
10157 report_look_ahead_tokens.
10158 * src/lalr.c: Update English in comments.
10159 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
10160 (state_lookahead_tokens_count): Rename from
10161 state_look_ahead_tokens_count.
10162 Rename local n_look_ahead_tokens to n_lookahead_tokens.
10163 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
10164 Rename local n_look_ahead_tokens to n_lookahead_tokens.
10165 Update other uses.
10166 Update English in output.
10167 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
10168 * src/print.c: Update English in comments.
10169 (lookahead_set): Rename from look_ahead_set.
10170 (print_reduction): Rename argument lookahead_token from
10171 look_ahead_token.
10172 (print_core, state_default_rule, print_reductions, print_results):
10173 Update uses.
10174 * src/print_graph.c: Update English in comments.
10175 (print_core): Update uses.
10176 * src/state.c: Update English in comments.
10177 (reductions_new): Update uses.
10178 (state_rule_lookahead_tokens_print): Rename from
10179 state_rule_look_ahead_tokens_print, and update other uses.
10180 * src/state.h: Update English in comments.
10181 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
10182 (state_rule_lookahead_tokens_print): Rename from
10183 state_rule_look_ahead_tokens_print.
10184 * src/tables.c: Update English in comments.
10185 (conflict_row, action_row): Update uses.
10186 * tests/glr-regression.at
10187 (Incorrect lookahead during deterministic GLR,
10188 Incorrect lookahead during nondeterministic GLR): Rename
10189 print_look_ahead to print_lookahead.
10190 * tests/torture.at: Update English in comments.
10191 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
10192 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
10193 (Many lookahead tokens): Update uses.
10194 * data/glr.c: Update English in comments.
10195 * lalr1.cc: Likewise.
10196 * yacc.c: Likewise.
10197 * src/conflicts.h: Likewise.
10198 * src/lalr.h: Likewise.
10199 * src/main.c: Likewise.
10200 * src/output.c: Likewise.
10201 * src/parse-gram.c: Likewise.
10202 * src/tables.h: Likewise.
10203 * tests/calc.at: Likewise.
10204
102052006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
10206
10207 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
10208
102092006-06-07 Paul Eggert <eggert@cs.ucla.edu>
10210
10211 * TODO: Add request from Nelson H. F. Beebe to be able to install
10212 Bison without installing the yacc script.
10213
102142006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
10215
10216 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
10217 and yytext if they're already #define'd.
10218 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
10219 * src/scan-code-c.c: ... here.
10220 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
10221 <config.h>.
10222
102232006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
10224
10225 Get Bison to build again when configured with --enable-gcc-warnings.
10226 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
10227 missing #include's.
10228 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
10229 loc argument as it shadows a global.
10230 * src/scan-gram.l: Remove stray comma that prevents boundary_set
10231 invocation.
10232
10233 * src/.cvsignore: Add scan-code.c.
10234
102352006-06-07 Akim Demaille <akim@epita.fr>
10236
10237 * src/scan-gram.l: Move the "add a trailing ; to actions" code
10238 to...
10239 * src/scan-code.l: here.
10240 * tests/input.at (Torturing the Scanner): Fix another location
10241 error.
10242
102432006-06-07 Akim Demaille <akim@epita.fr>
10244
10245 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
10246
102472006-06-06 Akim Demaille <akim@epita.fr>
10248
10249 Extract the parsing of user actions from the grammar scanner.
10250 As a consequence, the relation between the grammar scanner and
10251 parser is much simpler. We can also split "composite tokens" back
10252 into simple tokens.
10253 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
10254 * src/scan-gram.l (add_column_width, adjust_location): Move to and
10255 rename as...
10256 * src/location.h, src/location.c (add_column_width)
10257 (location_compute): these.
10258 Fix the column count: the initial column is 0.
10259 (location_print): Be robust to ending column being 0.
10260 * src/location.h (boundary_set): New.
10261 * src/main.c: Adjust to scanner_free being renamed as
10262 gram_scanner_free.
10263 * src/output.c: Include scan-code.h.
10264 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
10265 Use boundary_set.
10266 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
10267 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
10268 which is now, again, a separate token.
10269 Adjust all dependencies.
10270 Whereever actions with $ and @ are used, use translate_code.
10271 (action): Remove this nonterminal which is now useless.
10272 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
10273 (grammar_current_rule_action_append): Use translate_code.
10274 (packgram): Bound check ruleno, itemno, and rule_length.
10275 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
10276 (last_string, last_braced_code_loc, max_left_semantic_context)
10277 (scanner_initialize, scanner_free, scanner_last_string_free)
10278 (gram_out, gram_lineno, YY_DECL_): Move to...
10279 * src/scan-gram.h: this new file.
10280 (YY_DECL): Rename as...
10281 (GRAM_DECL): this.
10282 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
10283 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
10284 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
10285 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
10286 Move these declarations, and...
10287 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
10288 these to...
10289 * src/flex-scanner.h: this new file.
10290 * src/scan-gram.l (rule_length, rule_length_overflow)
10291 (increment_rule_length): Remove.
10292 (last_braced_code_loc): Rename as...
10293 (gram_last_braced_code_loc): this.
10294 Adjust to the changes of the parser.
10295 Move all the handling of $ and @ into...
10296 * src/scan-code.l: here.
10297 * src/scan-gram.l (handle_dollar, handle_at): Remove.
10298 (handle_action_dollar, handle_action_at): Move to...
10299 * src/scan-code.l: here.
10300 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
10301 scan-code.h, scan-code-c.c, scan-gram.h.
10302 (EXTRA_bison_SOURCES): Add scan-code.l.
10303 (BUILT_SOURCES): Add scan-code.c.
10304 (yacc): Be robust to white spaces.
10305
10306 * tests/conflicts.at, tests/input.at, tests/reduce.at,
10307 * tests/regression.at: Adjust the column numbers.
10308 * tests/regression.at: Adjust the error message.
10309
103102006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
10311
10312 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
10313 Use Akim's wording from
10314 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
10315
103162006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
10317
10318 Between Bison releases, manually append `+' to the previous Bison
10319 release number, and use that as a signal to automatically print the
10320 ChangeLog's CVS Id keyword from --version. Discussed starting at
10321 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
10322 * ChangeLog: Add Id header.
10323 * configure.ac (AC_INIT): Append `+' to `2.3'.
10324 * src/.cvsignore: Add revision.c.
10325 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
10326 (BUILT_SOURCES): Add revision.c.
10327 (revision.c): New target rule. This file defines a new global variable
10328 named revision. It initializes it with either the Id from ChangeLog
10329 or, if VERSION doesn't contain `+', with the empty string.
10330 * src/getargs.c (version): Print the value of revision.
10331 * src/revision.h: Extern revision.
10332
103332006-06-05 Paul Eggert <eggert@cs.ucla.edu>
10334
10335 * NEWS: Version 2.3.
10336 * configure.ac (AC_INIT): Likewise.
10337
103382006-05-30 Paul Eggert <eggert@cs.ucla.edu>
10339
10340 * data/glr.c (YYRECOVERING): Define to be a function-like macro
10341 with no arguments, not as an object-like macro. This is for
10342 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
10343 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
10344 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
10345 Document this.
10346
103472006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
10348
10349 * src/getargs.c (usage): Back out yesterday's modification of the
10350 --help output so that we don't have to wait for translation before
10351 releasing 2.3.
10352
103532006-05-29 Paul Eggert <eggert@cs.ucla.edu>
10354
10355 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
10356 Problem reported by Akim Demaille.
10357
103582006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
10359
10360 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
10361
103622006-05-26 Paul Eggert <eggert@cs.ucla.edu>
10363
10364 * data/yacc.c (yy_reduce_print): Omit trailing white space in
10365 generated source code. Problem reported by Frans Englich in
10366 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
10367
103682006-05-22 Paul Eggert <eggert@cs.ucla.edu>
10369
10370 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
10371 shell, not within 'make', so that 'make' by an ordinary builder
10372 (using GNU make) does not worry about configuring gzip. This also
10373 works around a bug reported independently by Keith Thompson and by
10374 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
10375 stderr rather than stdout, messing up the build logs.
10376
103772006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
10378
10379 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
10380 to make sure that YYID will never be unused. This fixes a 'make
10381 maintainer-check' failure caused by the recent changes to the 'Trivial
10382 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
10383 not used.
10384 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
10385
103862006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
10387
10388 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
10389 state before an empty RHS is always resolved here. Only the location
10390 of that state is guaranteed to be resolved, and that's enough. This
10391 fixes the remaining bug reported by Derek M. Jones in
10392 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
10393 * tests/glr-regression.at (Uninitialized location when reporting
10394 ambiguity): Test the above case.
10395 Also, the embedded comments in this test case claim it checks the case
10396 of an empty RHS that has inherited the initial location. However, the
10397 corresponding LHS was already resolved, so yyresolveLocations didn't
10398 actually have reason to modify it. Fix this by forcing
10399 nondeterministic operation at the beginning of the parse.
10400
104012006-05-20 Paul Eggert <eggert@cs.ucla.edu>
10402
10403 * data/c.m4 (b4_yy_symbol_print_generate):
10404 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
10405 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
10406 of the bugs reported today by Derek M Jones in
10407 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
10408 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
10409 defined to be a type name without parens or brackets.
10410 (Location Type): Similarly for YYLTYPE.
10411 * tests/regression.at (Trivial grammars): Put in a test for this
10412 bug that will be caught by 'make maintainer-check' (though not,
10413 alas, by 'make check' unless your compiler is picky).
10414
104152006-05-19 Paul Eggert <eggert@cs.ucla.edu>
10416
10417 * NEWS: Version 2.2.
10418 * configure.ac (AC_INIT): Likewise.
10419
104202006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
10421
10422 * data/glr.c (yyreportTree): Make room in yystates for the state
10423 preceding the RHS. This fixes the segmentation fault reported by Derek
10424 M. Jones in
10425 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
10426 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
10427 to the user. Reported for yyreportTree by Derek M. Jones later in the
10428 same thread.
10429 * THANKS: Add Derek M. Jones.
10430 Update my email address.
10431 Fix typo in Steve Murphy's name.
10432
104332006-05-14 Paul Eggert <eggert@cs.ucla.edu>
10434
10435 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
10436 checking against YYLAST that caused the parser to miss a potential
10437 alternative in its diagnostic.
10438 Problem reported by Maria Jose Moron Fernandez in
10439 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
10440 * data/lalr1.cc (yysyntax_error_): Likewise.
10441 * data/yacc.c (yysyntax_error): Likewise.
10442 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
10443 tokens, in case we run into an older C compiler.
10444 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
10445 Use them to check for the off-by-one error fixed above.
10446
10447 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
10448 YYSIZE_T, not size_t.
10449 * tests/regression.at (Trivial grammars): New test, to catch
10450 the error fixed by the above patch.
10451
104522006-05-14 Akim Demaille <akim@lrde.epita.fr>
10453
10454 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
10455 scheme.
10456 Reported by Steve Murphy.
10457
104582006-05-14 Akim Demaille <akim@lrde.epita.fr>
10459
10460 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
10461 * data/glr.cc: b4_location_flag is now b4_locations_flag.
10462
104632006-05-14 Akim Demaille <akim@lrde.epita.fr>
10464
10465 Implement --trace=m4.
10466 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
10467 * src/output.c (output_skeleton): When set, pass -dV to m4.
10468
10469 Factor the handling of flags in m4.
10470 * src/output.c (prepare): Rename the muscle names debug, defines,
10471 error_verbose to debug_flag, defines_flag, error_verbose_flag.
10472 * data/c.m4: Adjust.
10473 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
10474 Use b4_define_flag_if to define other b4_FLAG_if macros.
10475 (b4_location_if): As a consequence, rename as...
10476 (b4_locations_if): this, for consistency.
10477 Adjust all the skeletons.
10478
104792006-05-14 Akim Demaille <akim@lrde.epita.fr>
10480
10481 * etc/bench.pm: Shorten bench names.
10482
104832006-05-14 Akim Demaille <akim@lrde.epita.fr>
10484
10485 * src/output.h, src/output.c (error_verbose): Move to...
10486 * src/getargs.h, src/getargs.c: here.
10487 Sort the flags.
10488 Adjust dependencies.
10489
104902006-05-13 Paul Eggert <eggert@cs.ucla.edu>
10491
10492 * data/c.m4 (b4_copyright): Put the special exception for Bison
10493 skeletons here, so we don't have to put it in each skeleton. All
10494 uses changed. Suggested by Akim Demaille. Also, wrap the
10495 copyright notice, in case it is longer than 80 columns. Replace
10496 comma by newline after title.
10497
104982006-05-11 Paul Eggert <eggert@cs.ucla.edu>
10499
10500 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
10501 incompatibility, not a bug. Mention that it wasn't fixed as of
10502 flex 2.5.33.
10503
105042006-05-11 Akim Demaille <akim@lrde.epita.fr>
10505
10506 * examples/extexi: Enforce the precedence of concatenation over
10507 >>.
10508 Reported by Tommy Nordgren.
10509
105102006-05-11 Akim Demaille <akim@lrde.epita.fr>
10511
10512 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
10513 with the member "token".
10514 Reported by Martin Nylin.
10515
105162006-05-08 Paul Eggert <eggert@cs.ucla.edu>
10517
10518 * data/glr.c: Switch to Bison 2.2 special-exception language in
10519 the copyright notice. Use more-regular format for titles and
10520 copyright notices.
10521 * data/glr.cc: Likewise.
10522 * data/location.cc: Likewise.
10523 * data/yacc.cc: Likewise.
10524 * doc/bison.texinfo (Conditions): Document this.
10525 * NEWS: likewise. Upgrade version to 2.2.
10526
105272006-04-27 Akim Demaille <akim@lrde.epita.fr>
10528
10529 * data/glr.cc: Remove dead code.
10530
105312006-04-25 Paul Eggert <eggert@cs.ucla.edu>
10532
10533 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
10534 that variable and the line breaks the bootstrap. Problem reported
10535 by Juan M. Guerrero.
10536
105372006-04-24 Akim Demaille <akim@lrde.epita.fr>
10538
10539 * doc/bison.texinfo (Multiple start-symbols): New.
10540
105412006-04-24 Akim Demaille <akim@lrde.epita.fr>
10542
10543 * etc/README, etc/bench.pl: New.
10544
105452006-04-03 Akim Demaille <akim@lrde.epita.fr>
10546
10547 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
10548 rule.
10549 Reported by Mickael Labau.
10550 * tests/input.at (Torturing the Scanner): Test it.
10551
105522006-03-16 Paul Eggert <eggert@cs.ucla.edu>
10553
10554 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
10555 Problem reported by Bob Rossi.
10556
105572006-03-13 Paul Eggert <eggert@cs.ucla.edu>
10558
10559 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
10560 and didn't really work.
10561 For the index, use @ifnotinfo, not @iftex.
10562 Minor cleanups of spacing and terminology.
10563
105642006-03-12 Akim Demaille <akim@lrde.epita.fr>
10565
10566 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
10567 of AT_NAME_PREFIX when %name-prefix is not used.
10568
105692006-03-12 Akim Demaille <akim@lrde.epita.fr>
10570
10571 Apply --prefix to C++ skeletons too: they change the namespace.
10572 The test suite already exercize these cases.
10573 * data/c++.m4 (b4_namespace): New.
10574 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
10575 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
10576 * data/yacc.c, data/glr.c: Remove a useless `[]'.
10577 * doc/bison.texinfo: Document it.
10578 (Option Cross Key): Use @multitable in all formats. It looks
10579 nicer, even in TeX outputs.
10580 (Rules): Use the same code whatever the output type is.
10581 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
10582 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
10583 * tests/calc.at: Use it, instead of hard coding `yy'.
10584
105852006-03-10 Akim Demaille <akim@lrde.epita.fr>
10586
10587 * TODO: Remove dead items.
10588
105892006-03-10 Akim Demaille <akim@lrde.epita.fr>
10590
10591 * doc/FAQ: Remove, merged into...
10592 * doc/bison.texinfo (FAQ): this.
10593 * doc/Makefile.am (EXTRA_DIST): Adjust.
10594
105952006-03-10 Akim Demaille <akim@lrde.epita.fr>
10596
10597 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
10598 even if empty.
10599 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
10600 * doc/bison.texinfo (Calc++ Scanner): Use it.
10601
106022006-03-09 Paul Eggert <eggert@cs.ucla.edu>
10603
10604 Fix two nits reported by twlevo, plus one more that I discovered.
10605
10606 * src/assoc.h (assoc_to_string): Give a name to the arg, as
10607 this is the usual Bison style.
10608 * src/location.h (location_print): Likewise.
10609
10610 * src/reader.h (token_name): Likewise.
10611
106122006-03-08 Paul Eggert <eggert@cs.ucla.edu>
10613
10614 Fix some nits reported by twlevo.
10615 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
10616 and "POSIX". Use more-modern syntax for URLs. Mention C++
10617 and ask for Java. Don't hardwire OS version numbers. Add
10618 copyright notice.
10619 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
10620 * src/conflicts.c (solved_conflicts_obstack): Now static.
10621
106222006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
10623
10624 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
10625 page. Say "you can use it" not "you may use it" as on the web page;
10626 we're describing capabilities not granting permission.
10627
106282006-03-06 Paul Eggert <eggert@cs.ucla.edu>
10629
10630 * data/glr.c (yyresolveLocations): Rename local variables to avoid
10631 shadowing warnings. Use usual patter for iterating through RHS.
10632 * tests/glr-regression.at
10633 (Uninitialized location when reporting ambiguity):
10634 Modify yylex so that it uses its argument, rather than trying
10635 to rely on ARGSUSED (which doesn't work for gcc with warnings).
10636 const char -> char const.
10637
10638 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
10639 Don't use tabs inside commands; it messes up 'ps'.
10640 Problem reported by twlevo.
10641
106422006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
10643
10644 * tests/glr-regression.at (Uninitialized location when reporting
10645 ambiguity): New test case.
10646 * data/glr.c (yyresolveLocations): New function, which uses
10647 YYLLOC_DEFAULT.
10648 (yyresolveValue): Invoke yyresolveLocations before reporting an
10649 ambiguity.
10650 * doc/bison.texinfo (Default Action for Locations): Note
10651 YYLLOC_DEFAULT's usage for ambiguity locations.
10652 (GLR Semantic Actions): Cross-reference those notes.
10653
106542006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
10655
10656 * tests/glr-regression.at (Leaked semantic values when reporting
10657 ambiguity): Remove unnecessary union and type declarations.
10658 (Leaked lookahead after nondeterministic parse syntax error): New test
10659 case.
10660 * data/glr.c (yyparse): Check for zero stacks remaining before
10661 attempting to shift the lookahead so that you don't lose it.
10662
106632006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
10664
10665 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
10666 * tests/glr-regression.at (Leaked semantic values when reporting
10667 ambiguity): New test case.
10668 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
10669 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
10670 now unnecessary yystackp parameter.
10671 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
10672 destructors can be called.
10673
10674 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
10675 in existing testcases.
10676
106772006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
10678
10679 Don't leak semantic values for parent RHS when a user action cuts the
10680 parser, and clean up related code a bit.
10681 * tests/glr-regression.at (Leaked merged semantic value if user action
10682 cuts parse): Rename to...
10683 (Leaked semantic values if user action cuts parse): ... this. Add check
10684 for leaked parent RHS values.
10685 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
10686 between an unresolved state (non-empty chain of semantic options) and
10687 an incomplete one (signaled by an empty chain).
10688 (yyresolveStates): Document the interface. Move all manipulation of a
10689 successfully or unsuccessfully resolved yyGLRState to...
10690 (yyresolveValue): ... here so that yyresolveValue always leaves a
10691 yyGLRState with consistent data and thus is easier to understand.
10692 Remove the yyvalp and yylocp parameters since they are always just
10693 taken from the yys parameter. When reporting a discarded merged value
10694 in debugging output, note that it is incompletely merged. Document the
10695 interface.
10696 (yyresolveAction): If resolving any of the RHS states fails, destroy
10697 them all rather than leaking them. Thus, as long as user actions are
10698 written to clean up the RHS correctly, yyresolveAction always cleans up
10699 the RHS of a semantic option. Document the interface.
10700
107012006-02-27 Paul Eggert <eggert@cs.ucla.edu>
10702
10703 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
10704 led to a segmentation fault in GNU Pascal. Problem reported
10705 by Waldek Hebisch.
10706
107072006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
10708
10709 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
10710 mid-rule action inside a nonterminal symbol in order to declare a
10711 destructor for its semantic value.
10712
107132006-02-16 Paul Eggert <eggert@cs.ucla.edu>
10714
10715 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
10716 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
10717 __cplusplus && ! defined _STDLIB_H && !
10718 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
10719 defined free))]: Include <stdlib.h> rather than rolling our own
10720 declarations of malloc and free, to avoid problems with
10721 incompatible declarations (using 'throw') C++'s stdlib.h. This
10722 should fix Debian bug 340012
10723 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
10724 reported by Guillaume Melquiond.
10725
107262006-02-13 Paul Eggert <eggert@cs.ucla.edu>
10727
10728 * NEWS: Clarify symbols versus types in unused-value warnings.
10729
10730 * configure.ac (AC_INIT): Bump version number.
10731
107322006-02-13 Paul Eggert <eggert@cs.ucla.edu>
10733
10734 * NEWS: Version 2.1a.
10735 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
10736 since C99 requires this.
10737
107382006-02-11 Paul Eggert <eggert@cs.ucla.edu>
10739
10740 * m4/c-working.m4: New file.
10741 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
10742
107432006-02-10 Paul Eggert <eggert@cs.ucla.edu>
10744
10745 * Makefile.maint: Merge from coreutils.
10746
107472006-02-09 Paul Eggert <eggert@cs.ucla.edu>
10748
10749 More portability fixes for problems summarized by Nelson H. F. Beebe.
10750
10751 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
10752 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
10753 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
10754 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
10755 messes up because C++ code is compiled in 32-bit mode but linked
10756 in 64-bit mode.
10757
107582006-02-08 Paul Eggert <eggert@cs.ucla.edu>
10759
10760 More portability fixes for problems summarized by Nelson H. F. Beebe.
10761
10762 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
10763 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
10764
10765 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
10766 nodist_PROGRAMS, since we don't need to actually compile the
10767 example if we're just doing a plain 'make'. This avoids bothering
10768 the installer unnecessarily about problems due to weird C++
10769 compilers.
10770
107712006-02-06 Paul Eggert <eggert@cs.ucla.edu>
10772
10773 More portability fixes for problems summarized by Nelson H. F. Beebe.
10774
10775 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
10776 than #include "...", and compile with -I'.'. The old method was
10777 not portable, according to Posix and the C standard, and it does
10778 not work with Sun C 5.7, where previous #line directives affect
10779 the working directory used in later #include "..." directives.
10780
107812006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10782
10783 Various DJGGP specific issues in /djgpp
10784
107852006-02-02 Paul Eggert <eggert@cs.ucla.edu>
10786
10787 More portability fixes for problems summarized by Nelson H. F. Beebe.
10788
10789 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
10790 '#include <map>' works and that you can apply ++ to iterators.
10791
107922006-02-01 Paul Eggert <eggert@cs.ucla.edu>
10793
10794 Work around portability problems summarized by Nelson H. F. Beebe in
10795 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
10796
10797 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
10798 that '#include <string>' works.
10799
10800 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
10801 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
10802 "warning: sorry: semantics of inline function static data `const
10803 unsigned char translate_table[262]' are wrong (you'll wind up with
10804 multiple copies)".
10805
10806 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
10807 or, xor to not_, and_, or_, and xor_, respectively. This works
10808 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
10809 random system header somewhere that includes the equivalent of
10810 <iso646.h>.
10811
10812 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
10813 -E" works; it apparently doesn't work with PathScale EKO Compiler
10814 Suite Version 2.0.
10815
108162006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
10817
10818 During deterministic GLR operation, user actions should be able to
10819 influence the parse by changing yychar. To make this easier to fix and
10820 to make glr.c easier to evolve in general, don't maintain yytoken in
10821 parallel with yychar; just compute yytoken when needed.
10822 * tests/glr-regression.at (Incorrect lookahead during deterministic
10823 GLR): Check that setting yychar in a user action has the intended
10824 effect.
10825 * data/glr.c (yyGLRStack): Remove yytokenp member.
10826 (yyclearin): Don't set *yytokenp.
10827 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
10828 yychar rather than *yytokenp to determine the current lookahead.
10829 Compute yytoken locally when needed.
10830 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
10831 point to.
10832
10833 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
10834 after `--report' documentation.
10835
108362006-01-30 Paul Eggert <eggert@cs.ucla.edu>
10837
10838 * src/parse-gram.y (grammar_declaration): Location of printer
10839 symbol is @1, not list->location. Bug reported by twlevo.
10840 * tests/input.at (Incompatible Aliases): Adjust to above change.
10841
108422006-01-29 Paul Eggert <eggert@cs.ucla.edu>
10843
10844 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
10845 all the test at once. This makes the output easier to read in the
10846 normal case.
10847
10848 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
10849 got from <http://bro-ids.org/download.html>. The bug is that
10850 when two actions appeared in succession, the second one was
10851 scanned before the first one was added to the grammar rule
10852 as a midrule action. Bison then output the incorrect warning
10853 "parse.y:905.17-906.36: warning: unused value: $3".
10854 * src/parse-gram.y (BRACED_CODE, action): These are no longer
10855 associated with a value.
10856 (rhs): Don't invoke grammar_current_rule_action_append.
10857 (action): Invoke it here instead.
10858 * src/reader.c (grammar_midrule_action): Now extern.
10859 (grammar_current_rule_action_append): Don't invoke
10860 grammar_midrule_action; that is now the scanner's job.
10861 * src/reader.h (last_string, last_braced_code_loc):
10862 (grammar_midrule_action): New decls.
10863 * src/scan-gram.l (last_string): Now extern, sigh.
10864 (last_braced_code_loc): New extern variable.
10865 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
10866 rule already has an action.
10867 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
10868 * tests/input.at (AT_CHECK_UNUSED_VALUES):
10869 Add some tests to check that the above changes fixed the bug.
10870
108712006-01-27 Paul Eggert <eggert@cs.ucla.edu>
10872
10873 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
10874 All used changed. Check whether the symbol has a destructor,
10875 not whether it is typed.
10876 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
10877 that the values are still reported as unused. All line numbers
10878 adjusted.
10879
108802006-01-23 Paul Eggert <eggert@cs.ucla.edu>
10881
10882 Work around a bug in bro 0.8, which underparenthesizes its
10883 definition of YYLLOC_DEFAULT.
10884 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
10885 their arguments.
10886 * data/lalr1.cc: Likewise.
10887 * data/yacc.cc: Likewise.
10888
108892006-01-22 Paul Eggert <eggert@cs.ucla.edu>
10890
10891 Work around a bug in Pike 7.0, and give the Pike folks a
10892 better way to override the usual int widths.
10893 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
10894 user can override the types.
10895 (short): #undef, to work around a bug in Pike 7.0.
10896 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
10897 (union yyalloc.yyss): Use yytype_int16 rather than short.
10898 All uses changed.
10899 (yysigned_char): Remove.
10900 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
10901 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
10902 * tests/regression.at (Web2c Actions): Adjust to above changes.
10903
10904 * src/reader.c (check_and_convert_grammar): New function.
10905 (reader): Close the input file even if something went wrong during
10906 parsing. Minor file descriptor leak reported by twlevo.
10907
10908 * src/assoc.c (assoc_to_string): Use a default: abort (); case
10909 to pacify gcc -Wswitch-default.
10910 * src/scan-gram.l (adjust_location): Use a default: break; case
10911 to pacify gcc -Wswitch-default.
10912 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
10913 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
10914 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
10915 Move these decls to scan-skel.l, since they don't need to be
10916 visible elsewhere.
10917 * src/scan-skel.l: Accept the above decls.
10918 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
10919 is used.
10920
109212006-01-21 Paul Eggert <eggert@cs.ucla.edu>
10922
10923 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
10924 since we don't want to insist on a version number at the start
10925 of the changelog every time.
10926 * Makefile.maint: Sync from coreutils a bit better.
10927 (sc_trailing_blank): Renamed from sc_trailing_space.
10928 All uses changed.
10929 (sc_no_if_have_config_h, sc_require_config_h):
10930 (sc_prohibit_assert_without_use): New rules.
10931 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
10932 (sc_dd_max_sym_length): Fix leading spaces in rule.
10933 (sc_system_h_headers): Prefix with @.
10934 (sc_useless_cpp_parens, m4-check): Output line numbers.
10935 (changelog-check): Allow version only in head.
10936 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
10937 satisfy new Makefile.maint rule.
10938 * data/glr.c: Likewise.
10939 * data/glr.cc: Likewise.
10940 * data/lalr1.cc: Likewise.
10941 * data/yacc.c: Likewise.
10942 * lib/ebitsetv.c: Likewise.
10943 * lib/lbitset.c: Likewise.
10944 * lib/subpipe.c: Likewise.
10945 * lib/timevar.c: Likewise.
10946 * src/system.h: Likewise.
10947 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
10948 * djgpp/Makefile.maint: Add copyright notice.
10949 * djgpp/README.in: Likewise.
10950 * djgpp/config.bat: Likewise.
10951 * djgpp/config.site: Likewise.
10952 * djgpp/config_h.sed: Likewise.
10953 * djgpp/djunpack.bat: Likewise.
10954 * djgpp/config.sed: Fix copyright notice to match standard format.
10955 * djgpp/subpipe.h: Likewise.
10956 * lib/bitsetv-print.c: Likewise.
10957 * lib/bitsetv.c: Likewise.
10958 * lib/subpipe.h: Likewise.
10959 * lib/timevar.c: Likewise.
10960 * lib/timevar.h: Likewise.
10961 * djgpp/subpipe.c: Use standard recipe for config.h.
10962 * lib/abitset.c: Likewise.
10963 * lib/bitset.c: Likewise.
10964 * lib/bitset_stats.c: Likewise.
10965 * lib/bitsetv-print.c: Likewise.
10966 * lib/bitsetv.c: Likewise.
10967 * lib/ebitsetv.c: Likewise.
10968 * lib/get-errno.c: Likewise.
10969 * lib/lbitset.c: Likewise.
10970 * lib/subpipe.c: Likewise.
10971 * lib/timevar.c: Likewise.
10972 * lib/vbitset.c: Likewise.
10973 * tests/local.at: Likewise.
10974 * src/scan-gram.l: Don't include verify.h, since system.h does
10975 that for us.
10976 * .x-sc_require_config_h: New file.
10977 * .x-sc_unmarked_diagnostics: New file.
10978
109792006-01-20 Paul Eggert <eggert@cs.ucla.edu>
10980
10981 Be a bit more systematic about using 'abort'.
10982 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
10983 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
10984 Put 'default: abort ();' before some other case, to satisfy older
10985 pedantic compilers.
10986 * lib/bitset_stats.c (bitset_stats_init): Likewise.
10987 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
10988 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
10989 * src/conflicts.c (resolve_sr_conflict): Likewise.
10990 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
10991 (get_decision_str, get_orientation_str, get_node_alignment_str):
10992 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
10993 (get_linestyle_str, get_arrowstyle_str): Likewise.
10994 * src/conflicts.c (resolve_sr_conflict):
10995 Use a default case rather than one for the one remaining enum
10996 value, to catch invalid enum values as well.
10997 * src/lalr.c (set_goto_map, map_goto):
10998 Prefer "assert (FOO);" to "if (!FOO) abort ();".
10999 * src/nullable.c (nullable_compute, token_definitions_output):
11000 Likewise.
11001 * src/reader.c (packgram, reader): Likewise.
11002 * src/state.c (transitions_to, state_new, state_reduction_find):
11003 Likewise.
11004 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
11005 (symbol_pack): Likewise.
11006 * src/tables.c (conflict_row, pack_vector): Likewise.
11007 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
11008 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
11009 * src/system.h: Don't include <assert.h>.
11010 (assert): New macro.
11011
11012 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
11013 (Destructor Decl, Parser Function, Pure Calling):
11014 Describe rules for braces inside C code more carefully.
11015
110162006-01-19 Paul Eggert <eggert@cs.ucla.edu>
11017
11018 Fix some porting glitches found by Nelson H. F. Beebe.
11019 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
11020 compilers that don't understand that abort () does not return.
11021 * src/state.c (transitions_to): Likewise.
11022 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
11023 that '#include <cstdlib>' works.
11024 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
11025 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
11026 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
11027 for the benefit of some pre-C99 compilers.
11028
11029 * bootstrap: Undo changes to gnulib files that autoreconf made.
11030
11031 Minor fixups to get 'make maintainer-check' to work.
11032 * configure.ac: Don't use -Wnested-externs, as it's incompatible
11033 with the new verify.h implementation.
11034 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
11035 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
11036 * data/yacc.c (YYUSE): Likewise.
11037 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
11038 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
11039 * src/parse-gram.y (declaration): Don't pass a string constant
11040 to a function that expects char *, since GCC might complain
11041 about the constant value.
11042 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
11043 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
11044 before #defining them.
11045 * tests/glr-regression.at
11046 (Incorrectly initialized location for empty right-hand side in GLR):
11047 In yyerror, use the msg arg.
11048 (Corrupted semantic options if user action cuts parse):
11049 (Incorrect lookahead during deterministic GLR):
11050 (Incorrect lookahead during nondeterministic GLR):
11051 Don't name a local var 'index'; it shadows string.h's 'index'.
11052
110532006-01-19 Akim Demaille <akim@epita.fr>
11054
11055 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
11056 location, not just parts of it.
11057
110582006-01-18 Paul Eggert <eggert@cs.ucla.edu>
11059
11060 * NEWS: Document the fact that multiple %unions are now allowed.
11061 * doc/bison.texinfo (Union Decl): Likewise.
11062 * TODO: This feature is now implemented, so remove it from
11063 the wishlist.
11064
11065 * Makefile.maint: Merge with coreutils Makefile.maint.
11066 (CVS_LIST): Use build-aux version if available.
11067 (VERSION_REGEXP): New macro.
11068 (syntax-check-rules): Add sc_no_if_have_config_h,
11069 sc_prohibit_assert_without_use, sc_require_config_h,
11070 sc_useless_cpp_parens.
11071 (sc_obsolete_symbols): Check for O_NDELAY.
11072 (sc_dd_max_sym_length): Track coreutils.
11073 (sc_unmarked_diagnostics): Look in all files, not just *.c.
11074 (sc_useless_cpp_parens): New rule.
11075 (news-date-check): Look for version or today's date.
11076 (changelog-check): Don't require version number near head.
11077 (copyright-check): Use current year instead of hardwiring 2005.
11078 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
11079 (announcement): Add --gpg-key-ID.
11080
11081 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
11082 with "file system".
11083
11084 Avoid undefined behavior that addressed just before the start of an
11085 array. Problem reported by twlevo.
11086 * src/reader.c (packgram): Prepend a new sentinel before ritem.
11087 * src/lalr.c (build_relations): Rely on new sentinel.
11088 * src/gram.c (gram_free): Adjust to new sentinel.
11089
110902006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
11091
11092 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
11093 yylookaheadNeeds. All uses updated.
11094 (yysplitStack): Rename local yynewLookaheadStatuses to
11095 yynewLookaheadNeeds.
11096 * data/glr-regression.at (Incorrect lookahead during nondeterministic
11097 GLR): In comments, change `lookahead status' to `lookahead need'.
11098
110992006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
11100
11101 * data/glr.c (yysplitStack): A little stylistic rewrite.
11102
111032006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
11104
11105 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
11106
111072006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
11108
11109 * doc/bison.texinfo: Fix some typos.
11110 (GLR Semantic Actions): New subsection discussing special
11111 considerations because GLR semantic actions might be deferred.
11112 (Actions): Mention look-ahead usage of yylval.
11113 (Actions and Locations): Mention look-ahead usage of yylloc.
11114 (Special Features for Use in Actions): Add YYEOF entry and mention it
11115 in the yychar entry.
11116 In the yychar entry, remove mention of the local yychar case (pure
11117 parser) since this is irrelevant information when writing semantic
11118 actions and since it's already discussed in `Table of Symbols' where
11119 yychar is otherwise described as an external variable.
11120 In the yychar entry, don't call it the `current' look-ahead since it
11121 isn't when semantic actions are deferred.
11122 In the yychar and yyclearin entries, add note about deferred semantic
11123 actions.
11124 Add yylloc and yylval entries discussing look-ahead usage.
11125 (Look-Ahead Tokens): When discussing yychar, don't call it the
11126 `current' look-ahead, and do mention yylval and yylloc.
11127 (Error Recovery): Cross-reference `Action Features' when mentioning
11128 yyclearin.
11129 (Table of Symbols): In the yychar entry, don't call it the `current'
11130 look-ahead.
11131 In the yylloc and yylval entries, mention look-ahead usage.
11132
111332006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
11134
11135 * tests/glr-regression.at: Update copyright year to 2006.
11136
111372006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
11138
11139 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
11140 use during nondeterministic operation to track which stacks have
11141 actually needed the current lookahead.
11142 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
11143 Allocate, deallocate, resize, and otherwise shuffle space for
11144 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
11145 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
11146 appropriately during nondeterministic operation.
11147 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
11148 members to store the current lookahead to be used by the deferred
11149 user action.
11150 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
11151 from which the RHS is taken. Set the lookahead members of the new
11152 yySemanticOption according to the lookahead status for stack yyk.
11153 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
11154 yyaddDeferredAction.
11155 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
11156 members of yySemanticOption before invoking yyuserAction, and then set
11157 them back to their current values afterward.
11158 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
11159 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
11160 * tests/glr-regression.at: Remove `.' from the ends of recent test case
11161 titles for consistency.
11162 (Leaked merged semantic value if user action cuts parse): In order to
11163 suppress lint warnings, use arguments in merge function, and assign
11164 char value < 128 in main.
11165 (Incorrect lookahead during deterministic GLR): New test case.
11166 (Incorrect lookahead during nondeterministic GLR): New test case.
11167
111682006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
11169
11170 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
11171 !yyvaluep as signal that no semantic value is available to print.
11172 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
11173 to print a semantic value.
11174
111752006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
11176
11177 * tests/glr-regression.at: For consistency with my newer test cases,
11178 don't thank myself.
11179
111802006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
11181
11182 * data/glr.c (yyresolveValue): When merging semantic options, if at
11183 least one user action succeeds but a later one cuts the parse, then
11184 destroy the semantic value before returning rather than leaking it.
11185 (yyresolveStates): If a user action cuts the parse and thus
11186 yyresolveValue fails, ignore the (unset) semantic value rather than
11187 corrupting the yyGLRState, and empty the semantic options list since
11188 the user actions should have called all necessary destructors.
11189 Simplify code with YYCHK.
11190 * tests/glr-regression.at (Corrupted semantic options if user action
11191 cuts parse): New test case.
11192 (Undesirable destructors if user action cuts parse): New test case.
11193 Before applying any of this patch, this test case never actually failed
11194 for me... but only because the corrupted semantic options usually
11195 masked this bug.
11196 (Leaked merged semantic value if user action cuts parse): New test
11197 case.
11198
111992006-01-05 Akim Demaille <akim@epita.fr>
11200
11201 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
11202
112032006-01-04 Paul Eggert <eggert@cs.ucla.edu>
11204
11205 * data/c.m4 (b4_c_modern): New macro, with a new provision for
11206 _MSC_VER. Problem reported by Cenzato Marco.
11207 (b4_c_function_def): Use it.
11208 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
11209 b4_c_modern.
11210 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
11211 than rolling our own.
11212
112132006-01-04 Akim Demaille <akim@epita.fr>
11214
11215 Also warn about non-used mid-rule values.
11216 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
11217 member.
11218 (symbol_list_new): Adjust.
11219 * src/reader.c (symbol_typed_p): New.
11220 (grammar_rule_check): Use it.
11221 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
11222 Check its rule.
11223 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
11224 Use it.
11225 * tests/actions.at (Exotic Dollars): Adjust.
11226
112272006-01-04 Akim Demaille <akim@epita.fr>
11228
11229 * src/reader.c (grammar_midrule_action): If $$ is set in a
11230 mid-rule, move the `used' bit to its lhs.
11231 * tests/input.at (Unused values): New.
11232 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
11233
112342006-01-03 Paul Eggert <eggert@cs.ucla.edu>
11235
11236 * doc/bison.texinfo (Bison Options): Say more accurately what
11237 --yacc does.
11238 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
11239 about declarations in the grammar when in Yacc mode, as POSIX does
11240 not require a diagnostic when the grammar uses extensions.
11241
11242 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
11243
11244 Warn about dubious constructions like "%token T T".
11245 Reported by twlevo.
11246 * src/symtab.h (struct symbol.declared): New member.
11247 * src/symtab.c (symbol_new): Initialize it to false.
11248 (symbol_class_set): New arg DECLARING, specifying whether
11249 this is a declaration that we want to warn about, if there
11250 is more than one of them. All uses changed.
11251
11252 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
11253 Allow multiple %union directives, whose contents concatenate.
11254 * src/parse-gram.y (grammar_declaration): Likewise.
11255 Use muscle_code_grow, so that we don't need stype_line any more.
11256 All uses changed.
11257
11258 * src/muscle_tab.c (muscle_grow): Fix comment.
11259
11260 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
11261 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
11262 Update copyright year to 2006.
11263
112642006-01-03 Akim Demaille <akim@epita.fr>
11265
11266 Have glr.cc pass (some of) the calc.at tests.
11267 * data/glr.cc (b4_parse_param_orig): New.
11268 (b4_parse_param): Improve its definition, and bound it more
11269 clearly in the skeleton.
11270 (b4_epilogue): Append, instead of prepending, in order to keep
11271 #line consistency.
11272 Simplify the generation of auxiliary functions: locations and
11273 purity are mandated.
11274 (b4_global_tokens_and_yystype): Honor it.
11275 * data/location.cc (c++.m4): Don't include it.
11276 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
11277 and AT_SKEL_CC_IF.
11278 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
11279 AT_LALR1_CC_IF.
11280 Be sure to initialize the first position's filename.
11281 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
11282 mandated anyway.
11283 (AT_CHECK_CALC_GLR_CC): New.
11284 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
11285
112862006-01-02 Akim Demaille <akim@epita.fr>
11287
11288 * src/output.c (output_skeleton): Don't hard wire the inclusion of
11289 c.m4.
11290 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
11291 * data/glr.cc: Do not include stack.hh.
11292
112932006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
11294
11295 * data/glr.c: Reformat whitespace with tabs.
11296 (b4_lpure_formals): Remove this unused m4 macro.
11297 * tests/cxx-type.at: Reformat whitespace with tabs.
11298 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
11299 since it's a member. Rename type to isNterm for clarity.
11300
113012005-12-29 Akim <akim@sulaco.local>
11302
11303 Let glr.cc catch up with symbol_value_print.
11304 * data/glr.cc (b4_yysymprint_generate): Replace by...
11305 (b4_yy_symbol_print_generate): this.
11306 (yy_symbol_print, yy_symbol_value_print): Declare them.
11307
113082005-12-28 Paul Eggert <eggert@cs.ucla.edu>
11309
11310 * src/location.h (boundary): Note that a line or column equal
11311 to INT_MAX indicates an overflow.
11312 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
11313 (rule_length_overflow, increment_rule_length, add_column_width):
11314 New functions.
11315 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
11316 (<SC_BRACED_CODE>"}"):
11317 Use increment_rule_length rather than incrementing it by hand.
11318 (adjust_location, handle_syncline): Diagnose overflow.
11319 (handle_action_dollar, handle_action_at):
11320 Fix bug with monstrosities like $-2147483648.
11321 Remove now-unnecessary checks.
11322 (scan_integer): Verify assumptions and remove now-unnecessary checks.
11323 (convert_ucn_to_byte): Verify assumptions.
11324 (handle_syncline): New arg LOC. All callers changed.
11325 Don't store through a value derived from char const * pointer.
11326
11327 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
11328 GCC warnings.
11329
113302005-12-27 Paul Eggert <eggert@cs.ucla.edu>
11331
11332 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
11333 Remove unnecessary forward static decls.
11334
113352005-12-27 Akim Demaille <akim@epita.fr>
11336
11337 * src/reader.c (grammar_current_rule_check): Also check that $$
11338 is used.
11339 Take the rule to check as argument, hence rename as...
11340 (grammar_rule_check): this.
11341 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
11342 Rename as...
11343 (grammar_rule_begin, grammar_rule_end): these, for consistency.
11344 (grammar_midrule_action, grammar_symbol_append): Now static.
11345 * tests/torture.at (input): Don't rely on the default action
11346 being always performed.
11347 * tests/calc.at: "Set" $$ even when the action is "cut" with
11348 YYERROR or other.
11349 * tests/actions.at (Exotic Dollars): Instead of using unused
11350 values, check that the warning is issued.
11351
113522005-12-22 Paul Eggert <eggert@cs.ucla.edu>
11353
11354 * NEWS: Improve wording for unused-value warnings.
11355
113562005-12-22 Akim Demaille <akim@epita.fr>
11357
11358 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
11359 (b4_yysymprint_generate): Rename as...
11360 (b4_yy_symbol_print_generate): this.
11361 Generate yy_symbol_print instead of yysymprint.
11362 Generate also yy_symbol_value_print, and use it.
11363
113642005-12-22 Akim Demaille <akim@epita.fr>
11365
11366 * NEWS: Warn about unused values.
11367 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
11368 a `used' member.
11369 (symbol_list_n_get, symbol_list_n_used_set): New.
11370 (symbol_list_n_type_name_get): Use symbol_list_n_get.
11371 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
11372 * src/reader.c (grammar_current_rule_check): Check that values are
11373 used.
11374 * src/symtab.c (symbol_print): Accept 0.
11375 * tests/existing.at: Remove the type information.
11376 Empty the actions.
11377 Remove useless actions (beware of mid-rule actions: perl -000
11378 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
11379 * tests/actions.at (Exotic Dollars): Use unused values.
11380 * tests/calc.at: Likewise.
11381 * tests/glr-regression.at (No users destructors if stack 0 deleted):
11382 Likewise.
11383
11384 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
11385 rule_useful_p.
11386
113872005-12-21 Paul Eggert <eggert@cs.ucla.edu>
11388
11389 Undo 2005-12-01 tentative license wording change. The wording is
11390 still being reviewed by the lawyers, and we don't want to wait for
11391 them before publishing a test release. For now, revert to the
11392 previous wording.
11393 * NEWS: Undo 2005-12-01 change.
11394 * data/glr.c: Revert to previous license wording.
11395 * data/glr.cc: Likewise.
11396 * data/lalr1.cc: Likewise.
11397 * data/location.cc: Likewise.
11398 * data/yacc.c: Likewise.
11399
11400 * NEWS: Reword %destructor vs YYABORT etc.
11401 * data/glr.c: Use American spacing, for consistency.
11402 * data/glr.cc: Likewise.
11403 * data/lalr1.cc: Likewise.
11404 * data/yacc.c: Likewise.
11405 * data/yacc.c: Reformat comments slightly.
11406 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
11407 for consistency. Fix some spelling errors and reword recently-included
11408 text slightly.
11409 * tests/cxx-type.at: Cast results of malloc, for C++.
11410
114112005-12-21 Joel E. Denny <address@hidden>
11412
11413 * tests/cxx-type.at: Construct a tree, count the parents of shared
11414 nodes, and free each node once and only once. Previously, the memory
11415 for semantic values was leaked instead.
11416
114172005-12-21 Joel E. Denny <address@hidden>
11418
11419 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
11420 (yylval, yylloc): If pure, #define to yystackp->yyval and
11421 yystackp->yyloc similar to yychar and yynerrs.
11422 (yyparse): If pure, remove local yylval and yylloc. Add local
11423 yystackp to accommodate pure definitions of yylval and yylloc.
11424 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
11425 yylvalp and yyllocp to &yylval and &yylloc.
11426 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
11427 namespace. Previously, nerrs and char were missing, but lval and lloc
11428 weren't necessary.
11429 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
11430 yylvalp and yyllocp parameters since, if pure, these are now always
11431 accessible through yystackp. If not pure, they are still accessible
11432 globally.
11433 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
11434 `if (YYID (N))' to pacify lint.
11435
114362005-12-21 Akim Demaille <akim@epita.fr>
11437
11438 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
11439 destroy the RHS symbols of a rule.
11440 * data/yacc.c (yylen): Initialize to 0.
11441 Keep its value to the number of items to possibly shift.
11442 In particular, a regular successful parse that ends on YYFINAL by
11443 a (internal) YYACCEPT must not have yylen != 0.
11444 (yyerrorlab, yyreturn): Pop the RHS.
11445 Reorder a bit to emphasize the `shifting' bits of code.
11446 (YYPOPSTACK): Now accept a number of items to pop.
11447 * data/lalr1.cc: Likewise.
11448 * data/glr.c: Formatting changes.
11449 Use goto instead of fall through.
11450 * doc/bison.texinfo (Destructor Decl): Complete.
11451
114522005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
11453
11454 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
11455 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
11456 * djgpp/config.bat: Replace every occurence of the file name
11457 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
11458 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
11459 * djgpp/config.sed: Replace every occurence of the file name
11460 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
11461 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
11462 * djgpp/djunpack.bat: DJGPP specific file.
11463 * djgpp/fnchange.lst: DJGPP specific file.
11464 * djgpp/README.in: Add new information about how to unpack the bison
11465 source on MSDOS and other systems which have 8.3 file name restrictions
11466 using djunpack.bat and fnchange.lst.
11467
114682005-12-12 Paul Eggert <eggert@cs.ucla.edu>
11469
11470 * bootstrap (build_cvs_prefix): Remove; unused.
11471 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
11472 when getting gnulib.
11473
114742005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
11475
11476 * data/glr.c: Reorder typedef declarations for structs to match order
11477 of struct declarations.
11478 Rename yystack everywhere to yystackp except in yyparse where it's not
11479 a pointer.
11480 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
11481 consistency.
11482 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
11483 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
11484 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
11485 lint.
11486
114872005-12-09 Paul Eggert <eggert@cs.ucla.edu>
11488
11489 * tests/sets.at (Accept): Fix typos in regular expression used to
11490 sed out the final state number.
11491
11492 Work around portability problem on Solaris 10: flex-generated
11493 files include <stdio.h> before <config.h>, which messes up
11494 because the latter defines __EXTENSIONS__. Address the problem
11495 by creating two new little files that include <config.h> first,
11496 then include the flex-generated files. Rewrite everyone else
11497 to include <config.h> first, as well.
11498 * lib/timevar.c: Always include "config.h".
11499 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
11500 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
11501 (EXTRA_bison_SOURCES): New macro.
11502 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
11503 * src/system.h: Don't include config.h.
11504 * src/LR0.c: Include <config.h> first.
11505 * src/assoc.c: Likewise.
11506 * src/closure.c: Likewise.
11507 * src/complain.c: Likewise.
11508 * src/conflicts.c: Likewise.
11509 * src/derives.c: Likewise.
11510 * src/files.c: Likewise.
11511 * src/getargs.c: Likewise.
11512 * src/gram.c: Likewise.
11513 * src/lalr.c: Likewise.
11514 * src/location.c: Likewise.
11515 * src/main.c: Likewise.
11516 * src/muscle_tab.c: Likewise.
11517 * src/nullable.c: Likewise.
11518 * src/output.c: Likewise.
11519 * src/parse-gram.y: Likewise.
11520 * src/print.c: Likewise.
11521 * src/print_graph.c: Likewise.
11522 * src/reader.c: Likewise.
11523 * src/reduce.c: Likewise.
11524 * src/relation.c: Likewise.
11525 * src/state.c: Likewise.
11526 * src/symlist.c: Likewise.
11527 * src/symtab.c: Likewise.
11528 * src/tables.c: Likewise.
11529 * src/uniqstr.c: Likewise.
11530 * src/vcg.c: Likewise.
11531
11532 * src/parse-gram.y: Fix minor problems uncovered by lint.
11533 (current_lhs, current_lhs_location): Now static.
11534 (current_assoc): Remove unused variable.
11535
11536 Cleanups so that Bison-generated parsers have less lint.
11537 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
11538 Prepend /*ARGSUSED*/, for lint's sake.
11539 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
11540 definition if 'lint' is defined.
11541 (YYID): New macro (or function, if lint).
11542 All uses of /*CONSTCOND*/0 replaced by YYID(0).
11543 * data/yacc.c: Likewise.
11544 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
11545 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
11546 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
11547 is C++ only.
11548 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
11549 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
11550 Use YYID(0) rather than 0, for lint.
11551 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
11552 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
11553
115542005-12-07 Paul Eggert <eggert@cs.ucla.edu>
11555
11556 * tests/glr-regression.at
11557 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
11558 Close memory leak reported by twlevo.
11559
115602005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
11561
11562 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
11563 all stacks.
11564 (yyparse): Iterate another stack in order to call user destructors.
11565 * tests/glr-regression.at (No users destructors if stack 0 deleted):
11566 New test case.
11567 (Duplicated user destructor for lookahead): This test now is expected
11568 to succeed.
11569
115702005-12-01 Paul Eggert <eggert@cs.ucla.edu>
11571
11572 * NEWS: Document the following change.
11573 * data/yacc.c: Say "parser skeleton" rather than "file", since
11574 it's no longer just a file.
11575 * data/glr.c: Grant a special exception for C GLR parsers, that
11576 reads like the already-existing exception for C LALR(1) parsers.
11577 * data/glr.cc: Likewise.
11578 * data/lalr1.cc: Likewise.
11579 * data/location.cc: Likewise.
11580 * data/yacc.c: Reword the "written by" statement to clarify that
11581 it was the parser skeleton, not the entire output file.
11582 * data/glr.c: Written by Paul Hilfinger.
11583 * data/glr.cc: Written by Akim Demaille.
11584 * data/lalr1.cc: Likewise.
11585
115862005-11-18 Paul Eggert <eggert@cs.ucla.edu>
11587
11588 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
11589 Fix typos in previous change that broke 'make check'.
11590 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
11591 supported in C.
11592 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
11593 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
11594 We can revert this once things settle down.
11595
11596 * src/conflicts.c (conflicts_print): Don't print file name twice
11597 when %expect fails because there were no conflicts.
11598 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
11599 change.
11600 * tests/conflicts.at (%expect not enough, %expect too much):
11601 (%expect with reduce conflicts): Adjust to new behavior.
11602
116032005-11-18 Akim Demaille <akim@epita.fr>
11604
11605 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
11606 errors.
11607 * NEWS: Document this.
11608 * doc/bison.texinfo (Expect Decl): Likewise.
11609
116102005-11-16 Akim Demaille <akim@epita.fr>
11611
11612 Generalize the display of semantic values and locations in traces.
11613 * data/glr.c (yy_reduce_print): Fix indices (again).
11614 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
11615 literal integers.
11616 * data/lalr1.cc (yyreduce_print): Rename as...
11617 (yy_reduce_print): this.
11618 Display values and locations.
11619 * data/yacc.c (yy_reduce_print): Likewise.
11620 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
11621 (yysymprint): Move higher to be visible from yy_reduce_print).
11622 (yyparse): Adjust.
11623 * tests/calc.at: Adjust the expected length of the traces.
11624
116252005-11-14 Akim Demaille <akim@epita.fr>
11626
11627 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
11628 from 1 to N, while values and location start at 0.
11629 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
11630
116312005-11-14 Akim Demaille <akim@epita.fr>
11632
11633 * data/glr.c (yy_reduce_print): Fix the $ number.
11634
116352005-11-14 Akim Demaille <akim@epita.fr>
11636
11637 "Use" parse parameters.
11638 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
11639 * data/glr.c, data/glr.cc: Use them.
11640 * data/glr.c (YYUSE): Have a C++ definition that supports
11641 non-pointer types.
11642
116432005-11-14 Akim Demaille <akim@epita.fr>
11644
11645 * data/glr.c (yyexpandGLRStack): Declare only if defined.
11646
116472005-11-14 Akim Demaille <akim@epita.fr>
11648
11649 * data/glr.cc: New.
11650 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
11651
116522005-11-12 Akim Demaille <akim@epita.fr>
11653
11654 Let position and location be PODs.
11655 * data/location.cc (position::initialize, location::initialize): New.
11656 (position::position, location::location): Define only if
11657 b4_location_constructors is defined.
11658 * data/lalr1.cc (b4_location_constructors): Define it for backward
11659 compatibility.
11660 * doc/bison.texinfo (Initial Action Decl): Use initialize.
11661
116622005-11-12 Akim Demaille <akim@epita.fr>
11663
11664 * data/lalr1.cc: Move the body of the ctor and dtor into the
11665 parser file (instead of the header).
11666 Wrap the implementations in a "namespace yy".
11667
116682005-11-12 Akim Demaille <akim@epita.fr>
11669
11670 Have glr.c include its header file when created.
11671 * data/glr.c (b4_shared_declarations): New.
11672 Output them verbatim in the parser if !%defines, otherwise
11673 output then in the header file, and include it instead.
11674
116752005-11-11 Akim Demaille <akim@epita.fr>
11676
11677 * data/glr.c: Comment changes.
11678
116792005-11-11 Akim Demaille <akim@epita.fr>
11680
11681 When yydebug, report semantic and location values for reductions.
11682 * data/glr.c (yy_reduce_print): Report the semantic values and the
11683 locations.
11684 (YY_REDUCE_PRINT): Adjust.
11685 (yyglrReduce): Use them.
11686 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
11687 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
11688 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
11689 traces.
11690
116912005-11-10 Akim Demaille <akim@epita.fr>
11692
11693 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
11694 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
11695 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
11696
116972005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
11698
11699 * m4/cxx.m4, examples/Makefile.am: Don't build
11700 examples/calc++ if no C++ compiler is available. (trivial change)
11701
117022005-11-09 Akim Demaille <akim@epita.fr>
11703
11704 * src/scan-skel.l: Use a couple of asserts.
11705
117062005-11-03 Akim Demaille <akim@epita.fr>
11707
11708 In some (weird) cases, the final state number is incorrect.
11709 Reported by Alexandre Duret-Lutz.
11710 * src/LR0.c (state_list_append): Remove the computation of
11711 final_state.
11712 (save_reductions): Do it here.
11713 (get_state): Alpha conversion.
11714 (generate_states): Use a for loop.
11715 * src/gram.h (item_number_is_rule_number)
11716 (item_number_is_symbol_number): New.
11717 * src/state.c: Use assert.
11718 * src/system.h: Include assert.h.
11719 * tests/sets.at (Accept): New.
11720
117212005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
11722
11723 * data/glr.c (yyfill): Adjust comment.
11724 (yyresolveAction): Initialize default location properly
11725 for empty right-hand sides.
11726 (yydoAction): Ditto.
11727 Add comment explaining apparently dead code.
11728 * tests/glr-regression.at
11729 (Incorrectly initialized location for empty right-hand side in GLR):
11730 New test.
11731
117322005-10-30 Paul Eggert <eggert@cs.ucla.edu>
11733
11734 * bootstrap (cleanup_gnulib): New function. Use it to clean up
11735 gnulib when interrupted. This fixes some race conditions and
11736 works around some portability problems (one noted by Paul
11737 Hilfinger).
11738
117392005-10-22 Akim <akim@epita.fr>
11740
11741 * Makefile.cfg: Adjust to config -> build-aux.
11742 Reported by twledo.
11743
117442005-10-21 Akim Demaille <akim@epita.fr>
11745
11746 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
11747 the %parse-params.
11748 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
11749 * data/yacc.c (b4_Pure_if): Rename as...
11750 (b4_yacc_pure_if): this.
11751 (YY_SYMBOL_PRINT, yyparse): Adjust.
11752 * doc/bison.texinfo: Formatting changes.
11753
117542005-10-21 Akim Demaille <akim@epita.fr>
11755
11756 Finish the transition config -> build-aux.
11757 * configure.ac, Makefile.am: Use build-aux.
11758 * config/prev-version, config/announce-gen, config/Makefile.am:
11759 Move to...
11760 * build-aux/prev-version, build-aux/announce-gen,
11761 * build-aux/Makefile.am: here.
11762
117632005-10-14 Akim Demaille <akim@epita.fr>
11764
11765 * examples/calc++/test: Use set -x only when VERBOSE.
11766
117672005-10-13 Paul Eggert <eggert@cs.ucla.edu>
11768
11769 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
11770 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
11771
117722005-10-13 Akim Demaille <akim@epita.fr>
11773
11774 * src/scan-skel.l: Output the base name parts of the parser and
11775 header file names.
11776 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
11777 additional checks.
11778 Use this to exercise C++ outputs in subdirs.
11779 Reported by Oleg Smolsky.
11780
117812005-10-12 Paul Eggert <eggert@cs.ucla.edu>
11782
11783 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
11784 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
11785 Problem reported by John P. Hartmann.
11786 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
11787 already defined it.
11788
117892005-10-12 Akim Demaille <akim@epita.fr>
11790
11791 * src/parse-gram.y (version_check): Exit 63 to please missing
11792 (stands for "version mismatch).
11793 * tests/input.at, doc/bison.texinfo: Adjust.
11794
117952005-10-10 Paul Eggert <eggert@cs.ucla.edu>
11796
11797 Work around portability problems with Visual Age C compiler
11798 (xlc and xlC_r) reported by John P. Hartmann.
11799 * data/location.cc (initial_column, initial_line): Remove.
11800 All uses replaced by 0 and 1.
11801 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
11802 that xlc complains about.
11803 * src/scan-skel.l (skel_wrap): Likewise.
11804 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
11805 as __STDC__.
11806 * data/yacc.c (YYMODERN_C): New macro, which also looks at
11807 __STDC_VERSION__. Use it everywhere instead of looking at
11808 __STDC__ and __cplusplus.
11809
118102005-10-10 Akim Demaille <akim@epita.fr>
11811
11812 * examples/calc++/test: Be quiet unless VERBOSE.
11813
118142005-10-05 Paul Eggert <eggert@cs.ucla.edu>
11815
11816 * data/c.m4 (yydestruct, yysymprint):
11817 Use YYUSE instead of casting to void.
11818 * data/glr.c (YYUSE): New macro.
11819 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
11820 Use it instead of rolling our own.
11821 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
11822 (YYCHK1):
11823 Use /*CONSTCOND*/ to suppress lint warnings.
11824 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
11825 (YY_STACK_PRINT): Use 'false' not '0'.
11826 (YYUSE): New macro.
11827 (yysymprint_, yydestruct_): Use it instead of rolling our own.
11828 * data/yacc.c (YYUSE): New macro.
11829 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
11830 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
11831 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
11832
11833
11834 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
11835 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
11836
118372005-10-04 Paul Eggert <eggert@cs.ucla.edu>
11838
11839 Undo the parts of the unlocked-I/O change that substituted
11840 putc or puts for printf. This might hurt performance a bit,
11841 but some people prefer the printf style.
11842 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
11843 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
11844 All uses replaced by YYFPRINTF and YYDPRINTF.
11845 * data/yacc.c: Likewise.
11846 * lib/bitset.c (bitset_print): Likewise.
11847 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
11848 putc and puts.
11849 * lib/lbitset.c (debug_lbitset): Likewise.
11850 * src/closure.c (print_firsts, print_fderives): Likewise.
11851 * src/gram.c (grammar_dump): Likewise.
11852 * src/lalr.c (look_ahead_tokens_print): Likewise.
11853 * src/output.c (escaped_output): Likewise.
11854 (user_actions_output): Break apart two printfs.
11855 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
11856 * src/reduce.c (reduce_print): Likewise.
11857 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
11858 * src/system.h: Include unlocked-io.h rathe than stdio.h.
11859
11860 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
11861 Use assignments rather than casts-to-void to suppress
11862 unused-variable warnings. This pacifies 'lint'.
11863 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
11864 unused-variable warnings.
11865
118662005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
11867
11868 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
11869
118702005-10-02 Paul Eggert <eggert@cs.ucla.edu>
11871
11872 Use unlocked I/O for a minor performance improvement on hosts like
11873 GNU/Linux and Solaris that support unlocked I/O. The basic idea
11874 is to use the gnlib unlocked-io module, and to prefer putc and
11875 puts to printf when either will work (since the latter doesn't
11876 come in an unlocked flavor).
11877 * bootstrap (gnulib_modules): Add unlocked-io.
11878 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
11879 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
11880 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
11881 and similarly for puts and putc and printf.
11882 * data/yacc.c: Likewise.
11883 * lib/bitset.c (bitset_print): Likewise.
11884 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
11885 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
11886 to printf.
11887 * lib/lbitset.c (debug_lbitset): Likewise.
11888 * src/closure.c (print_firsts, print_fderives): Likewise.
11889 * src/gram.c (grammar_dump): Likewise.
11890 * src/lalr.c (look_ahead_tokens_print): Likewise.
11891 * src/output.c (escaped_output): Likewise.
11892 (user_actions_output): Coalesce two printfs.
11893 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
11894 * src/reduce.c (reduce_print): Likewise.
11895 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
11896 * src/system.h: Include unlocked-io.h rather than stdio.h.
11897
11898 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
11899 this confuses xgettext.
11900
119012005-10-02 Akim Demaille <akim@epita.fr>
11902
11903 * bootstrap (gnulib_modules): Add strverscmp.
11904 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
11905 * m4/.cvsignore: Add strverscmp.m4.
11906 * src/parse-gram.y (%require): New token, new rule.
11907 (version_check): New.
11908 * src/scan-gram.l (%require): Adjust.
11909 * tests/input.at (AT_REQUIRE): New.
11910 Use it.
11911 * doc/bison.texinfo (Require Decl): New.
11912 (Calc++ Parser): Use %require.
11913
119142005-10-02 Akim Demaille <akim@epita.fr>
11915
11916 * data/location.cc: New.
11917
119182005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
11919 Akim Demaille <akim@epita.fr>
11920
11921 Make sure -odir/foo.cc creates dir/location.hh etc.
11922 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
11923 (spec_file_prefix, spec_verbose_file, spec_graph_file)
11924 (spec_defines_file): Now const.
11925 (dir_prefix): New.
11926 (short_base_name): Remove.
11927 * src/files.c: Adjust.
11928 (dirname.h): Include.
11929 (base_name): Don't prototype it.
11930 (finput): Remove, duplicates gram_in.
11931 (full_base_name, short_base_name): Replace by...
11932 (all_but_ext, all_but_tab_ext): these.
11933 (compute_base_names): Rename as...
11934 (compute_file_name_parts): this.
11935 Update to compute the new variables, including dir_prefix.
11936 Adjust dependencies.
11937 * src/output.c (prepare): Output them.
11938 * src/reader.c: Adjust to use gram_in, not finput.
11939 * src/scan-skel.l (@dir_prefix@): New.
11940
119412005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
11942
11943 * lib/subpipe.c: New function end_of_output_subpipe() added
11944 to allow support for non-posix systems. This is a no-op function
11945 for posix systems.
11946
11947 * lib/subpipe.h: New function end_of_output_subpipe() added
11948 to allow support for non-posix systems. This is a no-op function
11949 for posix systems.
11950
11951 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
11952 handle the lack of pipe/fork functionality on non-posix systems.
11953
11954 * djgpp/Makefile.maint: DJGPP specific file.
11955
11956 * djgpp/README.in: DJGPP specific file.
11957
11958 * djgpp/config.bat: DJGPP specific configuration file.
11959
11960 * djgpp/config.sed: DJGPP specific configuration file.
11961
11962 * djgpp/config.site: DJGPP specific configuration file.
11963
11964 * djgpp/config_h.sed: DJGPP specific configuration file.
11965
11966 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
11967
11968 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
11969
119702005-10-02 Akim Demaille <akim@epita.fr>
11971
11972 * data/location.cc: New, extract from...
11973 * data/lalr1.cc: here.
11974 (location.hh): Include it after the user prologue, in case the
11975 filename type is defined by the user.
11976 Forward declation location and position before the pre-prologue.
11977 (yyresult_): Rename as...
11978 (yyresult): this, it's a local variable, not an attribute.
11979 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
11980
119812005-10-01 Akim Demaille <akim@epita.fr>
11982
11983 * examples/extexi: Restore the #line generation.
11984
119852005-09-30 Akim Demaille <akim@epita.fr>,
11986 Alexandre Duret-Lutz <adl@gnu.org>
11987
11988 Move the token type and YYSTYPE in the parser class.
11989 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
11990 (parser::token): New, from the moved free definition of tokens.
11991 (parser::semantic_value): Now a full definition instead of an
11992 indirection to YYSTYPE.
11993 (b4_post_prologue): No longer included in the header file, but
11994 in the implementation file.
11995 * doc/bison.texi (C+ Language Interface): Update.
11996 * src/parse-gram.y: Support unary %define.
11997 * tests/actions.at: Define global_tokens_and_yystype for backward
11998 compatibility until we update the tests.
11999 * tests/calc.at: Idem.
12000 (first_line, first_column, last_line, last_column): Define for lalr1.cc
12001 to simplify the code.
12002
120032005-09-29 Paul Eggert <eggert@cs.ucla.edu>
12004
12005 Port to SunOS 4.1.4, which lacks strtoul and strerror.
12006 Ah, the good old days! Problem reported by Peter Klein.
12007 * bootstrap (gnulib_modules): Add strerror, strtoul.
12008 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
12009 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
12010
120112005-09-29 Akim Demaille <akim@epita.fr>
12012
12013 * data/c.m4 (b4_error_verbose_if): New.
12014 * data/lalr1.cc: Use it.
12015 (YYERROR_VERBOSE_IF): Remove.
12016 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
12017 parser members, replaced by...
12018 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
12019 local variables.
12020 (yysyntax_error_): Takes the state number as argument.
12021 (yyreduce_print_): Use the argument yyrule, not the former
12022 attribute yyn_.
12023
120242005-09-26 Paul Eggert <eggert@cs.ucla.edu>
12025
12026 * bootstrap (gnulib_modules): Add verify.
12027 * lib/.cvsignore: Add verify.h.
12028 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
12029 * src/system.h (verify): Remove.
12030 Include verify.h instead.
12031 * src/tables.c (tables_generate): Use new API for 'verify'.
12032
120332005-09-21 Paul Eggert <eggert@cs.ucla.edu>
12034
12035 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
12036 local variables whose names begin with 'yy'.
12037 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
12038 Trivial changes from Joel E. Denny.
12039
12040 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
12041 it itself.
12042 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
12043 don't use alloca any more.
12044
12045 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
12046 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
12047 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
12048 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
12049 to match yacc.c, to test more hosts.
12050
120512005-09-20 Paul Eggert <eggert@cs.ucla.edu>
12052
12053 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
12054 doesn't affect behavior.
12055 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
12056 Solaris, AIX, MSC.
12057 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
12058 This works a bit better with glibc, if user code has already included
12059 stdlib.h.
12060 * doc/bison.texinfo (Bison Parser): Document that users can't
12061 arbitrarily use malloc and free for other purposes. Document
12062 that <alloca.h> and <malloc.h> might be included.
12063 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
12064 user must declare alloca.
12065
12066 * HACKING (release): Forwarn the Translation Project about
12067 stable releses.
12068
120692005-09-20 Akim Demaille <akim@epita.fr>
12070
12071 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
12072
120732005-09-19 Paul Eggert <eggert@cs.ucla.edu>
12074
12075 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
12076 (YYSTACK_ALLOC_MAXIMUM): Use it.
12077 (yysyntax_error): New function.
12078 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
12079 multiple syntax errors are reported, and alloca is being used.
12080 Instead, reallocate buffers twice as big each time, so that
12081 we waste at most half the allocated memory. Start with a small
12082 (128-byte) buffer that will suffice in most cases anyway.
12083 Use yysyntax_error to do most of the work.
12084
12085 * doc/bison.texinfo (Error Reporting, Table of Symbols):
12086 yynerrs is the number of errors reported, not the number of
12087 errors encountered.
12088
12089 * tests/glr-regression.at (Duplicated user destructor for lookahead):
12090 Mark it as expected to fail.
12091 Cast result of malloc; problem reported by twlevo@xs4all.nl.
12092 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
12093 Don't start user-code symbols with "yy", to avoid name space problems.
12094
120952005-09-19 Akim Demaille <akim@epita.fr>
12096
12097 Remove the traits, failed experiment.
12098 It never proved useful, and anyway because of the current
12099 definition, it was not possible to have several specialization of
12100 this traits, making it useless.
12101 * data/lalr1.cc (yy:traits): Remove.
12102 Inline its definitions in the parser class.
12103
121042005-09-19 Akim Demaille <akim@epita.fr>
12105
12106 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
12107 least Mac OSX with a /usr/local install of gettext.
12108
121092005-09-19 Akim Demaille <akim@epita.fr>
12110
12111 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
12112 and yytoken for similarity with the other skeletons.
12113
121142005-09-19 Akim Demaille <akim@epita.fr>
12115
12116 * NEWS, configure.ac: update version number to 2.1a.
12117
121182005-09-16 Paul Eggert <eggert@cs.ucla.edu>
12119
12120 * NEWS: Version 2.1.
12121
12122 * NEWS: Remove notice of yytname change, since it was never in an
12123 official release.
12124 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
12125 diagnostic.
12126 * src/output.c (prepare): Likewise.
12127 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
12128 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
12129 is not defined. This is an awful hack, but it's enough for now.
12130 All callers changed.
12131 * tests/glr-regression-at (make_value): Args are const pointers now,
12132 to avoid GCC warning.
12133 (Duplicated user destructor for lookahead): New test. Currently
12134 skipped. It fails on my host but I'm not sure it'll always fail.
12135
121362005-09-16 Akim Demaille <akim@epita.fr>
12137
12138 * src/symtab.h (struct symbol): Declare the printer and destructor
12139 as const, to avoid accidental calls to free.
12140 (symbol_destructor_set, symbol_printer_set): Adjust.
12141 * src/symtab.c: Adjust.
12142
121432005-09-16 Akim Demaille <akim@epita.fr>
12144
12145 * data/c.m4 (b4_token_enums): New.
12146 (b4_token_defines): Rename as...
12147 (b4_token_enums_defines): this.
12148 (b4_token_defines): New, output only the #defines.
12149 * data/yacc.c, data/glr.c: Adjust.
12150 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
12151 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
12152 as default values.
12153
121542005-09-16 Akim Demaille <akim@epita.fr>
12155
12156 * data/lalr1.cc (yylex_): Remove, inline its code.
12157 (yyreport_syntax_error_): Remove, replaced by...
12158 (yysyntax_error_): this which returns a string and leaves to the
12159 caller the call to the users' error function.
12160 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
12161 Move from members of the parser object...
12162 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
12163 to local variables of the parse function.
12164
121652005-09-16 Akim Demaille <akim@epita.fr>
12166
12167 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
12168 since it's in Bison's name space.
12169
121702005-09-15 Paul Eggert <eggert@cs.ucla.edu>
12171
12172 * data/glr.c (yyresolveValue): Add default case to pacify
12173 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
12174
12175 * NEWS: Document when yyparse started to return 2.
12176 * doc/bison.texinfo (Parser Function): Document when yyparse
12177 returns 2.
12178
12179 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
12180 (b4_filename_type): Renamed back from b4_file_name_type. All uses
12181 changed.
12182 (class position): file_name -> filename (reverting). All uses changed.
12183
121842005-09-14 Paul Eggert <eggert@cs.ucla.edu>
12185
12186 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
12187 do anything if $@ exists. This reverts part of the 2005-07-07
12188 patch.
12189
121902005-09-11 Paul Eggert <eggert@cs.ucla.edu>
12191
12192 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
12193 contains obsolete information and isn't worth distributing as a
12194 separate file anyway.
12195 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
12196 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
12197 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
12198 (yyparse): Abort if user code uses longjmp to throw an unexpected
12199 value.
12200
122012005-09-09 Paul Eggert <eggert@cs.ucla.edu>
12202
12203 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
12204 Suggested by twlevo@xs4all.nl.
12205
12206 * data/glr.c (YYCHK1): Do not assume YYE is in range.
12207 This avoids a diagnostic from gcc -Wswitch-enum.
12208 Problem reported by twlevo@xs4all.nl.
12209
12210 * doc/bison.texinfo: Don't use "filename", as per GNU coding
12211 standards. Use "file name" or "file" or "name", depending on
12212 the context.
12213 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
12214 not to hack/foo.tab.c.
12215 (Calc++ Top Level): 2nd arg of main is not const.
12216 * data/glr.c: b4_filename -> b4_file_name.
12217 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
12218 All uses changed.
12219 (class position): filename -> file_name. All uses changed.
12220 * data/yacc.c: b4_filename -> b4_file_name.
12221 * lib/bitset.h: filename -> file_name in local vars.
12222 * lib/bitset_stats.c: Likewise.
12223 * src/files.c: Likewise.
12224 * src/scan-skel.l ("@output ".*\n): Likewise.
12225 * src/files.c (file_name_split): Renamed from filename_split.
12226 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
12227
122282005-09-08 Paul Eggert <eggert@cs.ucla.edu>
12229
12230 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
12231 to accommodate latest gnulib.
12232
12233 * tests/glr-regression.at (Duplicate representation of merged trees):
12234 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
12235
12236 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
12237 needed.
12238
122392005-08-26 Paul Eggert <eggert@cs.ucla.edu>
12240
12241 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
12242 All uses changed. Invoke user destructor after an error during a
12243 split parse (trivial change from Joel E. Denny).
12244
12245 * tests/glr-regression.at
12246 (User destructor after an error during a split parse): New test case.
12247 Problem reported by Joel E. Denny in:
12248 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
12249
122502005-08-25 Paul Eggert <eggert@cs.ucla.edu>
12251
12252 * README-cvs: Give URLs for recommended tools.
12253 Mention Gzip version problem, and bootstrapping issues.
12254 Remove troubleshooting section, as it's somewhat obsolete.
12255
12256 * bootstrap (no_cache): New var, to accommodate different wget
12257 variants. Use it instead of '-C off'. Problem reported by
12258 twlevo@xs4all.nl.
12259
12260 * data/glr.c (yydestroyStackItem): New function.
12261 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
12262 debugging information. Problem reported by Joel E. Denny.
12263
122642005-08-25 Akim Demaille <akim@epita.fr>
12265
12266 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
12267
122682005-08-24 Paul Eggert <eggert@cs.ucla.edu>
12269
12270 * data/glr.c (yyrecoverSyntaxError, yyreturn):
12271 Don't invoke destructor on unresolved entries.
12272 * tests/glr-regression.at
12273 (User destructor for unresolved GLR semantic value): New test case.
12274 Problem reported by Joel E. Denny in:
12275 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
12276
122772005-08-21 Paul Eggert <eggert@cs.ucla.edu>
12278
12279 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
12280 Add strnlen.c.
12281 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
12282 lib-prefix.m4, po.m4.
12283
12284 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
12285 in yydestruct diagnostic, since it might not be an error.
12286 Problem reported by Joel Denny near end of
12287 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
12288 * data/lalr1.cc (yyerturn): Likewise.
12289 * data/yacc.c (yyreturn): Likewise.
12290 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
12291
12292 * src/files.c: Remove obsolete FIXME comment.
12293
12294 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
12295 with the other templates, and to fix bogus run-on messages such
12296 as the one reported at the end of
12297 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
12298 All callers changed to avoid the newline.
12299 (yyprocessOneStack): Output two lines rather than one, to accommodate
12300 the above change. This changes the debug output format slightly.
12301
12302 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
12303 reported by Joel E. Denny in
12304 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
12305 (trivial change).
12306 * tests/glr-regression.at (Duplicate representation of merged trees):
12307 New test, from Joel E. Denny in:
12308 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
12309 * THANKS: Add Joel E. Denny.
12310
12311 * configure.ac (AC_INIT): Bump to 2.0c.
12312
123132005-07-24 Paul Eggert <eggert@cs.ucla.edu>
12314
12315 * NEWS: Version 2.0b.
12316
12317 * Makefile.am (SUBDIRS): Put examples before tests, so that
12318 "make check" doesn't finish with "All 1 tests passed".
12319
12320 * tests/regression.at (Token definitions): Don't rely on
12321 AT_PARSER_CHECK for data that contains backslashes. It currently
12322 uses 'echo', and 'echo' isn't portable if its argument contains
12323 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
12324 that the byte '\0xff' is not printable in the C locale; it is,
12325 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
12326 not printable, so use '\0x81' to test.
12327
12328 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
12329 version of GCC, since the macro is used with non-GCC compilers.
12330
12331 Fix core dump reported by Pablo De Napoli in
12332 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
12333 * tests/regression.at (Invalid inputs with {}): New test.
12334 * src/parse-gram.y (token_name): Translate type before using
12335 it as an index.
12336
12337 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
12338 the user's name space. All uses changed to __attribute__
12339 ((__unused__)).
12340 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
12341 Add __attribute__ ((__noreturn__)).
12342
12343 * etc/clcommit: Remove. We weren't using it, and it failed
12344 "make maintainer-distcheck".
12345 * Makefile.maint: Merge from coreutils.
12346 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
12347 (syntax-check-rules): Change list of rules as described below.
12348 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
12349 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
12350 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
12351 (sc_trailing_space): New rules.
12352 (sc_xalloc_h_in_src): Remove.
12353 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
12354 (sc_space_tab, sc_error_exit_success, sc_changelog):
12355 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
12356 (makefile-check, po-check, author_mark_check):
12357 (makefile_path_separator_check, copyright-check):
12358 Use grep -n, to make it easier to find violations.
12359 Use CVS_LIST and CVS_LIST_EXCEPT.
12360 (header_regexp, h_re): Remove.
12361 (dd_c): New macro.
12362 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
12363 (my-distcheck): Use more-modern GCC flags.
12364 (signatures, %.asc): Remove.
12365 (rel-files, announcement): Remove signatures.
12366 Restore old updating code, even though we don't use it, so
12367 that we're the same as coreutils.
12368 (alpha, beta, major): Depend on news-date-check.
12369 Make the upload commands.
12370
12371 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
12372 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
12373 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
12374 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
12375 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
12376 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
12377 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
12378 * tests/sets.at: Likewise.
12379
12380 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
12381 we comment out the Autoconf version number.
12382 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
12383 it's error-prone and "make maintainer-distcheck" rejects it.
12384
12385 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
12386 Indent calls to "error" to pacify "make maintainer-distcheck",
12387 when the calls are not intended to be translated.
12388 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
12389
12390 * src/Makefile.am (DEFS): Use +=, to pacify
12391 "make maintainer-distcheck".
12392 (bison_SOURCES): Add scan-skel.h.
12393 (sc_tight_scope): New rule, from coreutils.
12394
12395 * src/files.c (src_extension, header_extension):
12396 Now static, not extern.
12397 * src/getargs.c (short_options): Likewise.
12398 * src/muscle_tab.c (muscle_table): Likewise.
12399 * src/parse-gram.y (current_class, current_type, current_prec):
12400 Likewise.
12401 * src/reader.c (grammar_end, previous_rule_end): Likewise.
12402 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
12403 * src/main.c (main): Cast bindtextdomain and textdomain calls to
12404 void, to avoid warning when NLS is disabled.
12405 * src/output.c: Include scan-skel.h.
12406 (scan_skel): Remove decl, since scan-skel.h does this.
12407 (output_skeleton):
12408 Indent calls to "error" to pacify "make maintainer-distcheck".
12409 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
12410 * src/reader.h (gram_end, gram_lineno): New decls to pacify
12411 "make maintainer-distcheck".
12412 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
12413 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
12414 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
12415 (skel_lex_destroy, scan_skel): Move these decls to...
12416 * src/scan-skel.h: New file.
12417 * src/uniqstr.c (uniqstr_assert):
12418 Indent calls to "error" to pacify "make maintainer-distcheck".
12419
12420 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
12421 not @VAR@.
12422
12423 * tests/torture.at: Revamp to avoid misuse of atoi that
12424 "make maintainer-distcheck" complained about.
12425
12426 * examples/extexi (message): Don't print a message more than once,
12427 and omit line-number decoration that makes Emacs compile think
12428 that informative messages are worth worrying about.
12429
124302005-07-22 Paul Eggert <eggert@cs.ucla.edu>
12431
12432 * configure.ac: Update version number.
12433
12434 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
12435 accidentally.
12436 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
12437 autogenerated by the maintainer.
12438 * examples/calc++/.cvsignore: Add *.yy.
12439
12440 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
12441 * lib/bitset_stats.c (bitset_stats_init): Likewise.
12442 * lib/bitsetv.c (bitsetv_alloc): Likewise.
12443
12444 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
12445
12446 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
12447 from maintainer-distcheck about casting the argument of 'free'.
12448
12449 * NEWS: Mention recent yytname changes.
12450 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
12451
12452 * bootstrap: For translations that have not yet been upgraded to
12453 the new runtime-po domain, prime the pump by extracting the
12454 relevant strings from the obsolete translations. This code can be
12455 removed once the bison-runtime domain has been translated by each
12456 team.
12457
12458 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
12459 now that token names are already quoted.
12460
12461 Fix problem reported by Anthony Heading.
12462 * data/glr.c (YYTOKEN_TABLE): New macro.
12463 (yytname): Define if YYTOKEN_TABLE.
12464 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
12465 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
12466 (YYERROR_VERBOSE): Define the same way the other skeletons do.
12467 * src/output.c (prepare_symbols): Output token_table_flag.
12468
124692005-07-21 Paul Eggert <eggert@cs.ucla.edu>
12470
12471 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
12472 again if the first call fails.
12473
12474 * data/glr.c (yytnamerr): New function.
12475 (yyreportSyntaxError): Use it to dequote most string literals.
12476 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
12477 with other skeletons. All uses changed.
12478 (yytnameerr_): New function.
12479 (yyreport_syntax_error): Use it to dequote most string literals.
12480 * data/yacc.c (yytnamerr): New function.
12481 (yyerrlab): Use it to decode most string literals.
12482 * doc/bison.texinfo (Decl Summary, Calling Convention):
12483 Clarify quoting convention of yytname.
12484 * src/output.c (prepare_symbols): Quote all names. This undoes
12485 the 2005-04-17 change, which is now accomplished (mostly) via
12486 changes in the parsers as described above.
12487 * tests/regression.at (Token definitions, Web2c Actions):
12488 Undo most 2005-04-17 change here, too.
12489
124902005-07-20 Paul Eggert <eggert@cs.ucla.edu>
12491
12492 Fix more problems reported by twlevo@xs4all.nl.
12493 * tests/cxx-type.at: Don't pipe output of ./types through sed to
12494 remove trailing spaces. This loses the exit status of ./types,
12495 and isn't needed since ./types shouldn't be emitting trailing
12496 spaces.
12497 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
12498 as the stack isn't valid in that case.
12499
12500 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
12501 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
12502 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
12503 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
12504 is used.
12505 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
12506 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
12507 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
12508 Likewise.
12509
12510 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
12511 overly-picky compilers that reject 'char *foo = "bar";'.
12512
12513 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
12514 to FILE * parameter, not to stderr. This fixes a typo introduced
12515 in the 2005-07-12 change.
12516
12517 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
12518 warnings from GCC 4.
12519
12520 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
12521 (yyglrShiftDefer, yysplitStack):
12522 Remove unused parameters b4_pure_formals. All uses changed.
12523 (yyglrShift): Remove unused parameters b4_user_formals.
12524 All uses changed.
12525 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
12526
125272005-07-18 Paul Eggert <eggert@cs.ucla.edu>
12528
12529 Destructor cleanups and regularization among the three skeletons.
12530 * NEWS: Document the behavior changes.
12531 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
12532 stack before failing, as the cleanup code will do it for us now.
12533 * data/lalr1.cc (yyerrlab): Likewise.
12534 * data/glr.c (yyparse): Pop everything off the stack before
12535 freeing it, so that destructors get called properly.
12536 * data/lalr1.cc (yyreturn): Likewise.
12537 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
12538 This is more consistent.
12539 * doc/bison.texinfo (Destructor Decl): Mention more reasons
12540 why destructors might be called. 1.875 -> 2.1.
12541 (Destructor Decl, Decl Summary, Table of Symbols):
12542 Some English-language cleanups for %destructor.
12543 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
12544 Add output line for destructor of start symbol.
12545 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
12546 because of that same extra output line.
12547
12548 * NEWS: Document minor wording changes in diagnostics of
12549 Bison-generated parsers.
12550 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
12551 Remove unused formals. All uses changed.
12552 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
12553 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
12554 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
12555 Rename yyoverflowab to yyexhaustedlab.
12556 When memory exhaustion occurs during syntax-error reporting,
12557 report it separately rather than in a single diagnostic; this
12558 eases translation.
12559 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
12560 (Memory Exhausted): Renamed from Parser Stack Overflow.
12561 Revamp wording slightly to prefer "memory exhaustion".
12562 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
12563
12564 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
12565
12566 Add i18n support to the GLR skeleton. Partially fix the C++
12567 skeleton; a C++ expert needs to finish this. Remove debugging
12568 msgids; there's little point to having them translated, since they
12569 can be understood only by someone who can read the
12570 (English-language) source code.
12571
12572 Generate runtime-po/bison-runtime.pot automatically, so that we
12573 don't have to worry about garbage getting in that file. We'll
12574 make sure after the next official release that old msgids don't
12575 get lost. See
12576 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
12577
12578 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
12579 Now auto-generated.
12580 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
12581 Fix typos in explanations of the runtime file.
12582 * bootstrap: Change gettext keyword from YYI18N to YY_.
12583 Use standard Makefile.in.in in runtime-po, since we'll arrange
12584 for backward-compatible bison-runtime.po files in a different way.
12585 * data/glr.c (YY_): New macro, from yacc.c.
12586 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
12587 Translate messages intended for users.
12588 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
12589 the wording in the other skeletons. We don't know that the memory
12590 is virtual.
12591 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
12592 Use same method that yacc.c uses.
12593 Don't translate debugging messages.
12594 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
12595 it doesn't work (yet), and requires C++ expertise to fix.
12596 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
12597 Move defn to a more logical place, to be consistent with other
12598 skeletons.
12599 Don't translate debugging messages.
12600 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
12601 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
12602 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
12603 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
12604
12605 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
12606 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
12607 void, not int.
12608 * tests/glr-regression.at (Badly Collapsed GLR States):
12609 Likewise.
12610 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
12611 yylex should return 0 at EOF rather than aborting.
12612
12613 Improve tests for stack overflow in GLR parser.
12614 Problem reported by twlevo@xs4all.nl.
12615 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
12616 All uses removed.
12617 (yyStackOverflow): Just longjmp, but with value 2 so that caller
12618 can handle the problem.
12619 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
12620 (yyparse): New local variable yyresult to record the result.
12621 Use result of setjmp to set it, rather than storing itinto
12622 struct.
12623 (yyDone): Remove label.
12624 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
12625 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
12626 if YYABORT is used).
12627 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
12628 yyparse status; put status > 1 into diagnostic.
12629 Check that status==2 works.
12630 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
12631 Use exit status 3 for failure to open (which shouldn't happen).
12632
126332005-07-17 Paul Eggert <eggert@cs.ucla.edu>
12634
12635 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
12636 1 on syntax error; just let yyparse do its thing.
12637 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
12638 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
12639 (Exploding the Stack Size with Alloca):
12640 (Exploding the Stack Size with Malloc):
12641 Expect exit status 2, not 1, since the parser is supposed to blow
12642 its stack. Problem reported by twlevo@xs4all.nl.
12643
12644 * data/glr.c (yyparse): Don't assume that the initial calls
12645 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
12646 Print a stack-overflow message and fail instead.
12647 Initialize the line-number information before creating the stack,
12648 so that the stack-overflow message can report line zero safely.
12649
126502005-07-14 Paul Eggert <eggert@cs.ucla.edu>
12651
12652 Fix problems reported by twlevo@xs4all.nl.
12653 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
12654 (yyuserMerge): Provide a default case if b4_mergers is empty.
12655 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
12656 * tests/glr-regression.at
12657 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
12658 Add casts to pacify C++ compilers.
12659 * tests/glr-regression.at (Improper merging of GLR delayed action
12660 sets): Declare yylex before using it.
12661 * tests/Makefile.am (maintainer-check-g++): Fix a stray
12662 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
12663 test for valgrind; valgrind is independent of g++.
12664 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
12665 for compatibility with POSIX 1003.1-2001 (if running coreutils).
12666 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
12667 Use a destructor, so that we can expand the stack. Change
12668 YYSTYPE to char * so that we can free it. Cast result of malloc.
12669
126702005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12671
12672 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
12673 a valgrind failure. Problem reported by twlevo@xs4all.nl.
12674
126752005-07-13 Paul Eggert <eggert@cs.ucla.edu>
12676
12677 * PACKAGING: New file, suggested by Bruno Haible and taken from
12678 similar wording in gettext's PACKAGING file.
12679 * NEWS: Mention PACKAGING.
12680 * Makefile.am (EXTRA_DIST): Add PACKAGING.
12681
126822005-07-12 Paul Eggert <eggert@cs.ucla.edu>
12683
12684 * NEWS: Document recent i18n improvements.
12685 * bootstrap: Get runtime translations into runtime-po.
12686 Create runtime-po files automatically, if possible.
12687 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
12688 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
12689 does not infringe on the user's name space.
12690 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
12691 * doc/bison.texinfo (Internationalization): Revamp the English
12692 and Texinfo syntax a bit, to try to make it clearer.
12693 (Bison Options, Option Cross Key): Mention --print-localedir.
12694 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
12695 YYENABLE_NLS. Quote a bit more.
12696 * runtime-po/.cvsignore: New file.
12697 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
12698 * runtime-po/Rules-quot: Remove; now created by bootstrap.
12699 * runtime-po/quot.sed: Likewise.
12700 * runtime-po/boldquot.sed: Likewise.
12701 * runtime-po/en@quot.header: Likewise.
12702 * runtime-po/en@boldquot.header: Likewise.
12703 * runtime-po/insert-header.sin: Likewise.
12704 * runtime-po/remove-potcdate.sin: Likewise.
12705 * runtime-po/Makevars: Likewise.
12706 * runtime-po/LINGUAS: Likewise.
12707 * runtime-po/de.po: Likewise; we will rely on the translation project
12708 to maintain this, so "bootstrap" should get it.
12709 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
12710 its value.
12711 * src/main.c (main): Bind the bison-runtime domain, too.
12712
127132005-07-12 Bruno Haible <bruno@clisp.org>
12714
12715 * data/yacc.c: Include <libintl.h> when NLS is enabled.
12716 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
12717 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
12718 * runtime-po: New directory.
12719 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
12720 $(DOMAIN).pot-update rule, so that old messages are never dropped.
12721 * runtime-po/Rules-quot: New file, copied from po/.
12722 * runtime-po/quot.sed: Likewise.
12723 * runtime-po/boldquot.sed: Likewise.
12724 * runtime-po/en@quot.header: Likewise.
12725 * runtime-po/en@boldquot.header: Likewise.
12726 * runtime-po/insert-header.sin: Likewise.
12727 * runtime-po/remove-potcdate.sin: Likewise.
12728 * runtime-po/Makevars: New file.
12729 * runtime-po/POTFILES.in: New file.
12730 * runtime-po/LINGUAS: New file.
12731 * runtime-po/bison-runtime.pot: New file.
12732 * runtime-po/de.po: New file.
12733 * m4/bison.m4: New file.
12734 * Makefile.am (SUBDIRS): Add runtime-po.
12735 (aclocaldir, aclocal_DATA): New variables.
12736 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
12737 Define aclocaldir.
12738 * src/getargs.c (usage): Document --print-localedir option.
12739 (PRINT_LOCALEDIR_OPTION): New enum item.
12740 (long_options): Add --print-localedir option.
12741 (getargs): Handle --print-localedir option.
12742 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
12743 (Internationalization): New section.
12744
127452005-07-12 Akim Demaille <akim@epita.fr>
12746
12747 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
12748 for consistency with the rest of the code.
12749 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
12750 Add separators.
12751
127522005-07-12 Akim Demaille <akim@epita.fr>
12753
12754 * src/parse-gram.y: Use %printer instead of YYPRINT.
12755
127562005-07-12 Akim Demaille <akim@epita.fr>
12757
12758 * src/symtab.h, src/symtab.c (symbol_print): New.
12759 * src/symlist.h, src/symlist.c (symbol_list_print): New.
12760 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
12761
127622005-07-12 Akim Demaille <akim@epita.fr>
12763
12764 * data/glr.c (b4_syncline): Fix (swap) the definitions of
12765 b4_at_dollar and b4_dollar_dollar.
12766
127672005-07-11 Paul Eggert <eggert@cs.ucla.edu>
12768
12769 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
12770 and Pennello's paper.
12771
127722005-07-09 Paul Eggert <eggert@cs.ucla.edu>
12773
12774 * data/yacc.c (yyparse): Undo previous patch. Instead,
12775 set yylsp[0] and yyvsp[0] only if the initial action
12776 sets yylloc and yylval, respectively.
12777
12778 * data/yacc.c (yyparse): In the initial action, set
12779 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
12780 This avoids the use of undefined variables if the initial
12781 action does not set yylloc and/or yylval.
12782
127832005-07-07 Paul Eggert <eggert@cs.ucla.edu>
12784
12785 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
12786 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
12787 Remove from CVS. These files are automatically generated.
12788 * examples/extexi: Clarify that this file is now part of Bison,
12789 not GNU M4, and that it works with any POSIX-compatible Awk.
12790 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
12791 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
12792 so that we also get calc++-parser.yy. Geneate it.
12793 Use $(AWK), not gawk, since any conforming Awk will do.
12794 Put comment before action, since older 'make' can't handle comment
12795 in action.
12796 $(BUILT_SOURCES): List all built sources, not just some of them.
12797 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
12798 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
12799 $($(calc_sources_generated)): Remove unnecessary test for existence
12800 of target. (This had a shell syntax error anyway; a stray "x".)
12801 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
12802 calc++-parser.yy.
12803 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
12804
12805 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
12806 implied by the other modules.
12807
128082005-07-06 Akim Demaille <akim@epita.fr>
12809
12810 Bind examples/calc++ to the package.
12811 * examples/calc++/Makefile: Remove, replaced by...
12812 * examples/calc++/Makefile.am: ... this new file.
12813 * examples/calc++/test: Remove input.
12814 * examples/calc++/compile: Remove.
12815 * examples/Makefile.am: New.
12816 * configure.ac, Makefile.am: Adjust.
12817 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
12818
128192005-07-05 Paul Eggert <eggert@cs.ucla.edu>
12820
12821 * data/glr.c (yyFail): Drastically simplify; since the format argument
12822 never had any % directives, we can simply pass it to yyerror.
12823 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
12824 be modified later, as that is the usual style in glr.c.
12825 Problems reported by Paul Hilfinger.
12826
12827 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
12828 and size overflow errors.
12829 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
12830 in case the user prolog sets feature-test macros like _GNU_SOURCE.
12831 (YYSIZEMAX): New macro.
12832 (yystpcpy): New function, taken from yacc.c.
12833 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
12834 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
12835 so that we don't have to maintain their signatures.
12836 (yyFail): Check for buffer overflow, by using vsnprintf rather
12837 than vsprintf. Allocate a bigger buffer if possible.
12838 Report an error if buffer allocation fails.
12839 (yyStackOverflow): New function.
12840 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
12841 the initialization was successful. It might fail if storage was
12842 exhausted.
12843 (yyexpandGLRStack): Add more checks for storage allocation failure.
12844 Use yyStackOverflow to report failures.
12845 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
12846 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
12847 Don't assume stack number fits in int.
12848 (yysplitStack): Check for storage allocation failure.
12849 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
12850 can print diagnostics on storage allocation failure. All callers
12851 changed.
12852 (yyresolveValue): Use yybool for boolean.
12853 (yyreportSyntaxError): Check for size-calculation overflow.
12854 This code is taken from yacc.c.
12855 (yyparse): Check for storage allocation errors when allocating
12856 the initial stack.
12857
128582005-07-05 Akim Demaille <akim@epita.fr>
12859
12860 Extract calc++ from the documentation.
12861 * doc/bison.texinfo (Calc++): Add the extraction marks.
12862 * examples/extexi: New, from the aborted GNU Programming 2E.
12863 Separate the different paragraph of a file with empty lines.
12864 * examples/Makefile: Use it to extract the whole calc++ example.
12865
128662005-06-24 Akim Demaille <akim@epita.fr>
12867
12868 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
12869 class typedefs.
12870
128712005-06-22 Akim Demaille <akim@epita.fr>
12872
12873 * doc/bison.texinfo (C++ Language Interface): First stab.
12874 (C++ Parsers): Remove.
12875
128762005-06-22 Akim Demaille <akim@epita.fr>
12877
12878 * data/lalr1.cc (yylex_): Honor %lex-param.
12879
128802005-06-22 Akim Demaille <akim@epita.fr>
12881
12882 Start a set of simple examples.
12883 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
12884 * examples/calc++/calc++-driver.hh,
12885 * examples/calc++/calc++-parser.yy,
12886 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
12887 * examples/calc++/compile, examples/calc++/test: New.
12888
128892005-06-09 Paul Eggert <eggert@cs.ucla.edu>
12890
12891 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
12892 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
12893 which stems from the 2005-05-27 patch.
12894
128952005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
12896
12897 * data/glr.c: Modify treatment of unused parameters to permit use
12898 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
12899
129002005-05-30 Paul Eggert <eggert@cs.ucla.edu>
12901
12902 Fix infringement on user name space reported by Janos Zoltan Szabo.
12903 * data/yacc.c (yyparse): strlen -> yystrlen.
12904
129052005-05-30 Akim Demaille <akim@epita.fr>
12906
12907 * data/lalr1.cc (_): New.
12908 Translate the various messages.
12909
129102005-05-27 Paul Eggert <eggert@cs.ucla.edu>
12911
12912 Fix infringement on user name space reported by Bruno Haible.
12913 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
12914 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
12915 the user's name space.
12916 (alloca): Include <stdlib.h> to get it, if it's not built in.
12917 (YYMALLOC, YYFREE): Define only if needed.
12918 (malloc, free): Declare, but only if needed, as this infringes on
12919 the user name space.
12920
129212005-05-25 Paul Eggert <eggert@cs.ucla.edu>
12922
12923 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
12924 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
12925 with %d format.
12926 * lib/ebitset.c (min, max): Undef before defining.
12927 * lib/vbitset.c (min, max): Likewise.
12928 * lib/subpipe.c (create_subpipe): Save local variables in case
12929 vfork clobbers them.
12930
129312005-05-24 Bruno Haible <bruno@clisp.org>
12932
12933 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
12934 error message syntax used by gcc-4.0.
12935
129362005-05-23 Paul Eggert <eggert@cs.ucla.edu>
12937
12938 * README: Mention m4 1.4.3. Remove obsolete advice about
12939 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
12940
12941 * bootstrap: Remove workaround for problem I encountered with
12942 gettext 0.14.1; it seems to be fixed now.
12943
129442005-05-22 Paul Eggert <eggert@cs.ucla.edu>
12945
12946 * NEWS: Version 2.0a.
12947
12948 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
12949 the previous change.
12950
12951 Various maintainer cleanups.
12952 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
12953 conftest*, for benefit of CVS commands run at the same time as
12954 "configure". Add build-aux, since "bootstrap" now creates it and
12955 its subfiles.
12956 * Makefile.cfg (move_if_change): Remove.
12957 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
12958 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
12959 (po_repo, do-po-update, po-update, wget_files, get-targets):
12960 (config.guess-url_prefix, config.sub-url_prefix):
12961 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
12962 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
12963 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
12964 Remove.
12965 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
12966 this is now the recommended name.
12967 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
12968 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
12969 ylwrap. These files now go into build-aux.
12970 * config/move-if-change: Remove.
12971 * config/prev-version.txt: Bump from 1.75 to 2.0.
12972
12973 * bootstrap: Add stdio-safer, unistd-safer modules.
12974 Remove m4/glibc2.m4 (introduced by latest gnulib, but
12975 we don't need it).
12976 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
12977 fopen-safer.c, stdio-safer.h, unistd-safer.h.
12978 * lib/subpipe.c: Include "unistd-safer.h".
12979 (create_subpipe): Make sure all the newly-created
12980 file descriptors are > 2, so that diagnostics don't
12981 get sent down them (which might cause Bison to hang, in theory).
12982 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
12983 * src/files.c (xfopen): Use fopen_safer, not fopen.
12984
12985 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
12986 yesterday's yacc.c fix.
12987
129882005-05-21 Paul Eggert <eggert@cs.ucla.edu>
12989
12990 * data/glr.c, data/lalr1.cc: Update copyright date.
12991
12992 Fix a destructor bug reported by Wolfgang Spraul in
12993 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
12994 * data/yacc.c (yyabortlab): Don't call destructor, and
12995 don't set yychar to EMPTY.
12996 (yyoverflowlab): Don't call destructor.
12997 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
12998 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
12999 since we no longer output the message "discarding lookahead token
13000 end of input ()".
13001
130022005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
13003
13004 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
13005 fix a small glitch in debugging output.
13006 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
13007 after YY_SYMBOL_PRINT where needed.
13008
13009 (struct yyGLRState): Add some comments.
13010 (struct yySemanticOption): Add some comments.
13011 (union yyGLRStackItem): Add comment.
13012
13013 (yymergeOptionSets): Correct this to properly perform the union,
13014 avoiding infinite reported by Michael Rosien.
13015 Update comment.
13016
13017 * tests/glr-regression.at: Add test for GLR merging error reported
13018 by M. Rosien.
13019
130202005-05-13 Paul Eggert <eggert@cs.ucla.edu>
13021
13022 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
13023 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
13024 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
13025 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
13026 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
13027 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
13028 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
13029 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
13030 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
13031 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
13032 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
13033 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
13034 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
13035 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
13036 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
13037 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
13038 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
13039 src/derives.h, src/files.c, src/files.h, src/getargs.c,
13040 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
13041 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
13042 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
13043 src/output.h, src/parse-gram.c, src/parse-gram.h,
13044 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
13045 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
13046 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
13047 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
13048 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
13049 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
13050 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
13051 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
13052 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
13053 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
13054 tests/reduce.at, tests/regression.at, tests/sets.at,
13055 tests/synclines.at, tests/testsuite.at, tests/torture.at:
13056 Update FSF postal mail address.
13057
130582005-05-11 Paul Eggert <eggert@cs.ucla.edu>
13059
13060 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
13061 Problem reported by Ralf Menzel.
13062
130632005-05-01 Paul Eggert <eggert@cs.ucla.edu>
13064
13065 * tests/actions.at: Test that stack overflow invokes destructors.
13066 From Marcus Holland-Moritz.
13067 * data/yacc.c (yyerrlab): Move the code that destroys the stack
13068 from here....
13069 (yyreturn): to here. That way, destructors are called properly
13070 even if the stack overflows, or the user calls YYACCEPT or
13071 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
13072 (yyoverflowlab): Destroy the lookahead.
13073
130742005-04-24 Paul Eggert <eggert@cs.ucla.edu>
13075
13076 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
13077
130782005-04-17 Paul Eggert <eggert@cs.ucla.edu>
13079
13080 * NEWS: Bison-generated C parsers no longer quote literal strings
13081 associated with tokens.
13082 * src/output.c (prepare_symbols): Don't escape strings,
13083 since users don't want to see C escapes.
13084 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
13085 in diagnostics.
13086 * tests/input.at (Torturing the Scanner): Likewise.
13087 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
13088
130892005-04-16 Paul Eggert <eggert@cs.ucla.edu>
13090
13091 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
13092 the data size is known to be too small and we can't increase it.
13093 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
13094
130952005-04-15 Paul Eggert <eggert@cs.ucla.edu>
13096
13097 * src/parse-gram.y: Include quotearg.h.
13098 (string_as_id): Quote $1 before using it as a key, since the
13099 lexer no longer quotes it for us.
13100 (string_content): Don't strip quotes, since lexer no longer
13101 quotes it for us.
13102 * src/scan-gram.l: Include quotearg.h.
13103 ("\""): Omit quote.
13104 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
13105 a key, since the rest of the lexer doesn't quote it.
13106 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
13107 * tests/regression.at (Token definitions): Check for backslashes
13108 in token strings.
13109
13110 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
13111 (YYSIZE_T): Define to unsigned long int when using an older compiler.
13112 (yyparse): Revamp code to generate long syntax error message, to
13113 make it easier to translate, and to avoid problems with arithmetic
13114 overflow. Change "virtual memory" to "memory" in diagnostic, since
13115 we don't know whether the memory is virtual.
13116
131172005-04-13 Paul Eggert <eggert@cs.ucla.edu>
13118
13119 * NEWS: Bison-generated C parsers now use the _ macro to
13120 translate strings.
13121 * data/yacc.c (_) [!defined _]: New macro.
13122 All English strings wrapped inside this macro.
13123 * doc/bison.texinfo (Bison Parser): Document _.
13124 * po/POTFILES.in: Include src/parse-gram.c, since it now
13125 includes translateable strings that parse-gram.y doesn't.
13126
131272005-04-12 Paul Eggert <eggert@cs.ucla.edu>
13128
13129 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
13130 reverting the 2004-10-11 change to this function.
13131 (symbol_check_alias_consistency): Don't call symbol_type_set
13132 if the type name is already correct.
13133 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
13134
131352005-03-25 Paul Eggert <eggert@cs.ucla.edu>
13136
13137 * tests/regression.at (Token definitions): Don't use a token named
13138 c, as that generates a "#define c ..." that runs afoul of buggy
13139 stdlib.h that uses the identifier c as a member of struct
13140 drand48_data. Problem reported by Horst Wente.
13141
131422005-03-21 Paul Eggert <eggert@cs.ucla.edu>
13143
13144 * bootstrap: Change translation URL from
13145 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
13146 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
13147 redirection glitches. Problem reported by twlevo@xs4all.nl.
13148
131492005-03-20 Paul Eggert <eggert@cs.ucla.edu>
13150
13151 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
13152 after operands; POSIX says this isn't portable for the c99 command.
13153
131542005-03-18 Paul Eggert <eggert@cs.ucla.edu>
13155
13156 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
13157 immediately if a data overrun has occurred; this may help us track
13158 down what may be a spurious failure on MacOS.
13159
131602005-03-17 Paul Eggert <eggert@cs.ucla.edu>
13161
13162 Respond to problems reported by twlevo@xs4all.nl.
13163
13164 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
13165
13166 * src/vcg.h: Comment fix.
13167 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
13168 (G_CMAX): Change to -1 instead of INT_MAX.
13169
13170 * data/yacc.c (yyparse): Omit spaces before #line.
13171
131722005-03-15 Paul Eggert <eggert@cs.ucla.edu>
13173
13174 * src/tables.c (state_number_to_vector_number): Put it inside an
13175 "#if 0", since it's not currently used. Problem reported by
13176 Roland McGrath.
13177
131782005-03-06 Paul Eggert <eggert@cs.ucla.edu>
13179
13180 * src/output.c (escaped_output): Renamed from
13181 escaped_file_name_output, since we now use it for symbol tags as
13182 well. All uses changed.
13183 (symbol_destructors_output, symbol_printers_output):
13184 Escape symbol tags too.
13185 Problem reported by Matyas Forstner in
13186 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
13187
13188 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
13189 not needed.
13190 * src/output.c (user_actions_output, token_definitions_output,
13191 symbol_destructors_output, symbol_printers_output): Likewise.
13192 * src/reader.c (prologue_augment): Likewise.
13193 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
13194
13195 * src/vcg.c (output_edge): Don't quote linestyle arg.
13196 Problem reported by twlevo@xs4all.nl.
13197
131982005-02-28 Paul Eggert <eggert@cs.ucla.edu>
13199
13200 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
13201 example, reported by Derek M Jones. Also, make the example even
13202 more outrageous, to better illustrate how bad the problem is.
13203
132042005-02-24 Paul Eggert <eggert@cs.ucla.edu>
13205
13206 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
13207 putsym. Typo reported by Sebastian Piping.
13208
132092005-02-23 Paul Eggert <eggert@cs.ucla.edu>
13210
13211 * doc/bison.texinfo (Language and Grammar): some -> same
13212 (Epilogue): int he -> in the
13213 Typos reported by Sebastian Piping via Justin Pence.
13214
132152005-02-07 Paul Eggert <eggert@cs.ucla.edu>
13216
13217 * tests/glr-regression.at (Improper handling of embedded actions
13218 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
13219 embedded actions and $-N in GLR parsers", work around an Autoconf bug
13220 with dollar signs in test names.
13221 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
13222 for a similar reason.
13223
132242005-01-28 Paul Eggert <eggert@cs.ucla.edu>
13225
13226 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
13227 wants to redefine G_VIEW.
13228
132292005-01-27 Paul Eggert <eggert@cs.ucla.edu>
13230
13231 * src/vcg.c (get_view_str): Remove case for normal_view.
13232 Problem reported by twlevo@xs4all.nl.
13233
132342005-01-24 Paul Eggert <eggert@cs.ucla.edu>
13235
13236 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
13237 Problem reported by twlevo@xs4all.nl.
13238
13239 * doc/bison.texinfo: Change @dircategory from "GNU programming
13240 tools" to "Software development". Requested by Richard Stallman
13241 via Karl Berry.
13242
132432005-01-23 Paul Eggert <eggert@cs.ucla.edu>
13244
13245 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
13246 Problem reported by twlevo@xs4all.nl.
13247
132482005-01-21 Paul Eggert <eggert@cs.ucla.edu>
13249
13250 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
13251 keyword; it's not needed with modern compilers, and it doesn't
13252 affect correctness with older compilers. Suggested by
13253 twlevo@xs4all.nl.
13254
132552005-01-17 Paul Eggert <eggert@cs.ucla.edu>
13256
13257 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
13258 gcc -Wswitch-default.
13259 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
13260 * data/yacc.c (yyparse): Likewise.
13261
132622005-01-12 Paul Eggert <eggert@cs.ucla.edu>
13263
13264 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
13265 already. Let config.h define any nonstandard values.
13266
132672005-01-10 Paul Eggert <eggert@cs.ucla.edu>
13268
13269 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
13270 for the benefit of slower hosts. Problem reported by
13271 Nelson H. F. Beebe.
13272
132732005-01-07 Paul Eggert <eggert@cs.ucla.edu>
13274
13275 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
13276 being defined and not used.
13277 * data/lalr1.cc (yyparse): Likewise.
13278 Use "if (false)" rather than "if (0)".
13279
132802005-01-05 Paul Eggert <eggert@cs.ucla.edu>
13281
13282 * TODO: Mention that we should allow NUL bytes in tokens.
13283
132842005-01-02 Paul Eggert <eggert@cs.ucla.edu>
13285
13286 * src/scan-skel.l (<<EOF>>): Don't close standard output.
13287 Problem reported by Hans Aberg.
13288
132892005-01-01 Paul Eggert <eggert@cs.ucla.edu>
13290
13291 * src/getargs.c (version): Happy new year; update overall
13292 program copyright date from 2004 to 2005.
13293
13294 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
13295 Problem reported by Hans Aberg.
13296 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
13297 (Output file names.): Add a test for the case when standard output
13298 is closed.
13299
133002004-12-26 Paul Eggert <eggert@cs.ucla.edu>
13301
13302 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
13303 to fix an oversight in the Bison 2.0 manual.
13304
133052004-12-25 Paul Eggert <eggert@cs.ucla.edu>
13306
13307 * NEWS: Version 2.0. Reformat the existing news items since
13308 1.875, so that related items are grouped together.
13309 * configure.ac (AC_INIT): Bump version to 2.0.
13310 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
13311
13312 * tests/torture.at (Exploding the Stack Size with Alloca): Set
13313 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
13314 otherwise, we're not testing alloca. Unfortunately there's no
13315 simple way to consult HAVE_ALLOCA here.
13316
13317 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
13318 for yymsg, too.
13319
13320 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
13321 hand. This avoids a warning about comparing int to size_t when
13322 GCC warnings are enabled.
13323
133242004-12-22 Paul Eggert <eggert@cs.ucla.edu>
13325
13326 * NEWS: Bison-generated parsers no longer default to using the
13327 alloca function (when available) to extend the parser stack, due
13328 to widespread problems in unchecked stack-overflow detection.
13329 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
13330 responsibility to set it to a positive value. This lets the user
13331 specify a value that is not a preprocessor constant.
13332 * data/yacc.c (YYMAXDEPTH): Likewise.
13333 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
13334 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
13335 to be a compile-time constant. However, explain the constraints on it.
13336 Also, explain the constraints on YYINITDEPTH.
13337 (Table of Symbols): Explain that alloca is no longer the default.
13338 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
13339 to 1.
13340
13341 * doc/bison.texinfo (Location Default Action): Mention that n must
13342 be zero when k is zero. Suggested by Frank Heckenbach.
13343
133442004-12-22 Akim Demaille <akim@epita.fr>
13345
13346 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
13347 (parser::state_type, parser::semantic_type, parser::location_type):
13348 Private, not public.
13349 (parser::parse): Return ints, not bool.
13350 Returning a bool introduces a problem: 0 corresponds to false, and
13351 it seems weird to return false on success. Returning true changes
13352 the conventions for yyparse.
13353 Alternatively we could return void and send an exception.
13354 There is no clear consensus (yet?).
13355 (state_stack, semantic_stack, location_stack): Rename as...
13356 (state_stack_type, semantic_stack_type, location_stack_type): these.
13357 Private, not public.
13358 * tests/c++.at: New.
13359 * tests/testsuite.at, tests/Makefile.am: Adjust.
13360
133612004-12-21 Akim Demaille <akim@epita.fr>
13362
13363 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
13364
133652004-12-21 Akim Demaille <akim@epita.fr>
13366
13367 Don't impose std::string for filenames.
13368
13369 * data/lalr1.cc (b4_filename_type): New.
13370 (position::filename): Use it.
13371 (parser.hh): Move the inclusion of stack.hh and location.hh below
13372 the user code, so that needed headers for the filename type can be
13373 included first.
13374 Forward declare them before the user code.
13375 * tests/Makefile.am (check-local, installcheck-local): Pass
13376 TESTSUITEFLAGS to the TESTSUITE.
13377
133782004-12-20 Akim Demaille <akim@epita.fr>
13379
13380 Use more STL like names: my_class instead of MyClass.
13381
13382 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
13383 (SemanticStack, SemanticType, StateStack, StateType)
13384 (TokenNumberType, Stack, Slice, Traits, Parser::location)
13385 (Parser::value): Rename as...
13386 (location_stack, location_type, rhs_number_type, semantic_stack)
13387 (semantic_type, state_stack, state_type, token_number_type, stack)
13388 (slice, traits, parser::yylloc, parser::yylval): these.
13389
13390 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
13391
133922004-12-19 Paul Eggert <eggert@cs.ucla.edu>
13393
13394 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
13395 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
13396
133972004-12-17 Paul Eggert <eggert@cs.ucla.edu>
13398
13399 Remove uses of 'short int' and 'unsigned short int'. This raises
13400 some arbitrary limits. It uses more memory but nowadays that's
13401 not much of an issue.
13402
13403 This change does not affect the generated parsers; that's a different
13404 task, as some users will want to conserve memory there.
13405
13406 Ideally we should use size_t to represent all object counts, and
13407 something like ptrdiff_t to represent signed differences of object
13408 counts; but that will require more code-cleanup than I have the
13409 time to do right now.
13410
13411 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
13412 Use size_t, not int or short int, to count objects.
13413 * src/closure.c (nritemset, closure): Likewise.
13414 * src/closure.h (nritemset, closure): Likewise.
13415 * src/nullable.c (nullable_compute): Likewise.
13416 * src/print.c (print_core): Likewise.
13417 * src/print_graph.c (print_core): Likewise.
13418 * src/state.c (state_compare, state_hash): Likewise.
13419 * src/state.h (struct state): Likewise.
13420 * src/tables.c (default_goto, goto_actions): Likewise.
13421
13422 * src/gram.h (rule_number, rule): Use int, not short int.
13423 * src/output.c (prepare_rules): Likewise.
13424 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
13425 errs, reductions): Likewise.
13426 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
13427 Likewise.
13428 * src/tables.c (vector_number, tally, action_number,
13429 ACTION_NUMBER_MINIMUM): Likewise.
13430 * src/output.c (muscle_insert_short_int_table): Remove.
13431
134322004-12-17 Akim Demaille <akim@epita.fr>
13433
13434 * data/lalr1.cc: Extensive Doxygenation.
13435 (error_): Rename as...
13436 (error): this, since it is visible to the user.
13437 Adjust callers.
13438 (Parser::message): Now an automatic variable from...
13439 (Parser::yyreport_syntax_error_): here.
13440 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
13441 Parser::error.
13442 * tests/input.at: Escape $.
13443
134442004-12-16 Paul Eggert <eggert@cs.ucla.edu>
13445
13446 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
13447 Parenthesize rhs to avoid obscure problems with mistakes like
13448 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
13449 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
13450 b4_rhs_location): Likewise.
13451 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
13452 b4_rhs_location): Likewise.
13453
134542004-12-16 Akim Demaille <akim@epita.fr>
13455
13456 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
13457 yacc.c: be sure to stay within yycheck_.
13458 * tests/actions.at: Re-enable C++ tests.
13459
134602004-12-16 Akim Demaille <akim@epita.fr>
13461
13462 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
13463 real.
13464
134652004-12-16 Akim Demaille <akim@epita.fr>
13466
13467 Use #define to handle the %name-prefix.
13468
13469 * data/glr.c, data/yacc.c: Comment changes.
13470 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
13471 so that one can refer to yylex in the parser file, and have it
13472 renamed, as is the case with other skeletons.
13473
134742004-12-16 Akim Demaille <akim@epita.fr>
13475
13476 Move lalr1.cc internals into yy*.
13477
13478 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
13479 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
13480 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
13481 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
13482 (empty_, final_, terror_, errcode_, ntokens_)
13483 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
13484 (looka_, ilooka_, error_range_, nerrs_):
13485 Rename as...
13486 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
13487 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
13488 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
13489 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
13490 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
13491 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
13492 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
13493 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
13494 these.
13495
134962004-12-15 Paul Eggert <eggert@cs.ucla.edu>
13497
13498 Fix some problems reported by twlevo at xs4all.
13499 * src/symtab.c (symbol_new): Report an error if the input grammar
13500 contains too many symbols. This is better than calling abort() later.
13501 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
13502 (struct node, struct graph):
13503 Rename member expand to stretch. All uses changed.
13504 (struct graph): Remove member layoutalgorithm. All uses removed.
13505 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
13506 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
13507 All uses changed.
13508 (N_STRETCH): Rename from N_EXPAND. All uses changed.
13509
135102004-12-15 Akim Demaille <akim@epita.fr>
13511
13512 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
13513 Add more Doxygen comments.
13514 (symprint_, stack_print_, reduce_print_, destruct_, pop)
13515 (report_syntax_error_, translate_): Rename as...
13516 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
13517 (yypop_, yyreport_syntax_error_, yytranslate_): this.
13518
135192004-12-15 Akim Demaille <akim@epita.fr>
13520
13521 * data/lalr1.cc (lex_): Rename as...
13522 (yylex_): this.
13523 Move the trace here.
13524 Take the %name-prefix into account.
13525 Reported by Alexandre Duret-Lutz.
13526
135272004-12-15 Akim Demaille <akim@epita.fr>
13528
13529 Simplify the C++ parser constructor.
13530
13531 * data/lalr1.cc (debug_): Rename as...
13532 (yydebug_): so that the parser's internals are always in the yy*
13533 pseudo namespace.
13534 Adjust uses.
13535 (b4_parse_param_decl): Remove the leading comma as it is now only
13536 called as unique argument list.
13537 (Parser::Parser): Remove the constructor accepting a location and
13538 an initial debugging level.
13539 Remove from the other ctor the argument for the debugging level.
13540 (debug_level_type, debug_level, set_debug_level): New.
13541
13542 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
13543 constructor calls.
13544
135452004-12-15 Akim Demaille <akim@epita.fr>
13546
13547 Remove b4_root related material: failure experiment
13548 (which goal was to allow to derive from a class).
13549
13550 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
13551 definitions and uses.
13552
135532004-12-14 Paul Eggert <eggert@cs.ucla.edu>
13554
13555 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
13556 not 2, since it's not portable to subtract 1 from the start of an
13557 array. The new item 0 is never set or used. All uses changed.
13558
13559 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
13560 the default definition of YYLLOC_DEFAULT. Problem reported
13561 by Frank Heckenbach.
13562
135632004-12-12 Paul Eggert <eggert@cs.ucla.edu>
13564
13565 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
13566 the normal case and one for the error case. Just use the
13567 first one uniformly. Problem reported by Frank Heckenbach.
13568 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
13569 use exactly the same macro in both places.
13570 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
13571 so that the normal-case YYRHSLOC works for the error case too.
13572 All uses changed.
13573 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
13574 (YYLLOC_DEFAULT): Use the same macro as glr.c.
13575 * doc/bison.texinfo (Location Default Action): Don't claim that
13576 we have an array of locations. Use the same macro for both glr
13577 and lalr parsers. Mention YYRHSLOC. Mention what happens when
13578 the index is 0.
13579
135802004-12-10 Paul Eggert <eggert@cs.ucla.edu>
13581
13582 * HACKING: Update email addresses to send announcements to.
13583
13584 * configure.ac (AC_INIT): Bump version to 1.875f.
13585
135862004-12-10 Paul Eggert <eggert@cs.ucla.edu>
13587
13588 * NEWS: Version 1.875e.
13589 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
13590
13591 * src/scan-skel.l: Include "complain.h", for "fatal".
13592
13593 * src/relation.h (relation_print, relation_digraph):
13594 Relation sizes are of type relation_node, not size_t (this is
13595 merely a doc fix, since the two types are equivalent).
13596 (relation_transpose): Relation sizes are of type relation_node,
13597 not int.
13598 * src/relation.c: Likewise.
13599 (top, infinity): Now of type relation_node, not int.
13600 (traverse, relation_transpose): Use relation_node, not int.
13601
13602 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
13603 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
13604 (yyparse): Remove unused local introduced in 2004-10-25 patch.
13605
13606 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
13607 specifying whether the test should be skipped. Use it tp
13608 specify that the [%defines %skeleton "lalr1.cc"] tests currently
13609 fail on some hosts, and should be skipped.
13610
136112004-12-08 Paul Eggert <eggert@cs.ucla.edu>
13612
13613 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
13614 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
13615 unless otherwise specified below.
13616
13617 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
13618 to allocate kernel_base, kernel_items, kernel_size, since
13619 they needn't be initialized to 0.
13620 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
13621 * src/closure.c (new_closure): Likewise, for itemset.
13622 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
13623 * src/lalr.c (set_goto_map): Likewise, for temp_map.
13624 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
13625 (build_relations): Likewise for edge, states1, includes.
13626 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
13627 * src/reader.c (packgram): Likewise, for ritem, rules.
13628 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
13629 * src/relation.c (relation_digraph): Likewise for VERTICES.
13630 (relation_transpose): Likewise for new_R, end_R.
13631 * src/symtab.c (symbols_token_translations_init): Likewise for
13632 token_translations.
13633 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
13634 (token_actions): Likewise for yydefact, actrow, conflrow,
13635 conflict_list.
13636 (save_column): Likewise for froms[symno], tos[symno].
13637 (goto_actions): Likewise for state_count.
13638 (pack_table): Likewise for base, pos, check.
13639 (tables_generate): Likewise for width.
13640
13641 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
13642 for initial core. Just have a separate core, so we needn't worry
13643 about whether kernel_size and kernel_base are initialized.
13644
13645 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
13646 kernel_size, kernel_items): Remove unnecessary initialization.
13647 * src/conflicts.c (conflicts): Likewise.
13648 * src/derives.c (derives): Likewise.
13649 * src/muscle_tablc (muscle_insert): Likewise.
13650 * src/relation.c (relation_digraph): Likewise.
13651 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
13652 conflrow, conflict_table, conflict_list, table, check):
13653 Likewise.
13654
13655 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
13656 This is because all callers pass unsigned int.
13657 * src/closure.h (new_closure): Likewise.
13658
13659 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
13660 (build_relations): Initialize includes[i] in all cases.
13661 * src/reader.c (packgram): Always initialize rules[ruleno].prec
13662 and rules[ruleno].precsym. Initialize members in order.
13663 * src/relation.c (relation_transpose): Always initialize new_R[i]
13664 and end_R[i].
13665 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
13666
13667 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
13668 conflict_list[0] was always 0, but now it isn't initialized.
13669
13670 * src/table.c (table_grow): When conflict_table grew, the grown
13671 area wasn't cleared. Fix this.
13672
13673 * lib/.cvsignore: Add strdup.c, strdup.h.
13674 * m4/.cvsignore: Add strdup.m4.
13675
136762004-12-07 Paul Eggert <eggert@cs.ucla.edu>
13677
13678 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
13679 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
13680 GOTO_NUMBER_MAXIMUM, since we occasionally compute
13681 ngotos + 1 without checking for overflow.
13682 (build_relations): Use END_NODE, not -1, to denote end of edges.
13683 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
13684 build_relations): Use goto_number, not int, for goto numbers.
13685 * src/tables.c (save_column, default_goto): Likewise.
13686
136872004-11-23 Akim Demaille <akim@epita.fr>
13688
13689 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
13690 of #defining from yystype.
13691 Don't typedef yystype, C++ does not need it.
13692 This lets it possible to forward declare it as union.
13693
136942004-11-23 Paul Eggert <eggert@cs.ucla.edu>
13695
13696 * bootstrap (gnulib_modules): Add extensions.
13697 Problem reported by Jim Meyering.
13698
136992004-11-22 Paul Eggert <eggert@cs.ucla.edu>
13700
13701 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
13702 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
13703 src/system.h, src/tables.c: XFREE -> free, to accommodate
13704 recent change to gnulib xalloc.h.
13705 Problem reported by Jim Meyering.
13706
137072004-11-17 Akim Demaille <akim@epita.fr>
13708
13709 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
13710
137112004-11-17 Akim Demaille <akim@epita.fr>,
13712 Alexandre Duret-Lutz <adl@gnu.org>
13713
13714 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
13715 changes.
13716 (YYCDEBUG): Adjust.
13717 Use it instead of cdebug_.
13718 (Parser::debug_stream, Parser::set_debug_stream): New.
13719 (Parser::symprint_): Define cdebug_ for temporary backward
13720 compatibility.
13721 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
13722 debug_stream ().
13723
137242004-11-17 Akim Demaille <akim@epita.fr>
13725
13726 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
13727 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
13728 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
13729 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
13730
137312004-10-27 Paul Eggert <eggert@cs.ucla.edu>
13732
13733 * data/glr.c (yyloc_default): Remove; not used.
13734 Problem reported by Frank Heckenbach.
13735
137362004-10-25 Akim Demaille <akim@epita.fr>
13737
13738 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
13739 Introduce another definition to address simple location arrays.
13740 (yyGLRStack): New member: yyerror_range.
13741 (yyrecoverSyntaxError, yyparse): Update it.
13742 (yyrecoverSyntaxError): Use it when shifting the error token to
13743 have an accurate range, equivalent to the one computed by both
13744 yacc.c and lalr1.cc.
13745 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
13746 that column numbers start at column 0, as per GNU Coding
13747 Standards, the others tests, and the doc.
13748 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
13749 Adjust to the above change (first column is 0).
13750 And adjust the location of the "<error>", now covering the whole
13751 line.
13752
137532004-10-22 Akim Demaille <akim@epita.fr>
13754 and Paul Eggert <eggert@cs.ucla.edu>
13755
13756 Remove some arbitrary limits on goto numbers and relations.
13757 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
13758 initial values, since they're never used.
13759 (set_goto_map): ngotos is now unsigned, so test for overflow
13760 by seeing whether it wraps around to zero.
13761 * src/lalr.h (goto_number): Now size_t, not short int.
13762 (GOTO_NUMBER_MAXIMUM): Remove.
13763 * src/relation.c (relation_print, traverse, relation_transpose):
13764 Check for END_NODE rather than looking at sign.
13765 * src/relation.h (END_NODE): New macro.
13766 (relation_node): Now size_t, not short int.
13767
137682004-10-22 Paul Eggert <eggert@cs.ucla.edu>
13769
13770 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
13771 keyword, not an identifier. Problem reported by Baron Schwartz in
13772 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
13773
137742004-10-11 Akim Demaille <akim@epita.fr>
13775
13776 * src/symtab.c (symbol_check_alias_consistency): Also check
13777 type names, destructors, and printers.
13778 Reported by Alexandre Duret-Lutz.
13779 Recode the handling of associativity and precedence in terms
13780 of symbol_precedence_set.
13781 Accept no redeclaration at all, not even equal to the previous
13782 value.
13783 (redeclaration): New.
13784 Use it to factor redeclaration complaints.
13785 (symbol_make_alias): Don't set the type of the alias, let
13786 symbol_check_alias_consistency do it as for other features.
13787 * src/symtab.h (symbol): Add new member prec_location, and
13788 type_location.
13789 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
13790 * tests/input.at (Incompatible Aliases): New.
13791
137922004-10-09 Paul Eggert <eggert@cs.ucla.edu>
13793
13794 .cvsignore fixes to accommodate gnulib changes,
13795 and the practice of naming build directories "_build".
13796 * .cvsignore: Add "_*". Sort.
13797 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
13798 * m4/.cvsignore: Add "*_gl.m4".
13799
138002004-10-06 Akim Demaille <akim@epita.fr>
13801
13802 * src/parse-gram.y (add_param): Fix the truncation of trailing
13803 spaces.
13804
138052004-10-05 Akim Demaille <akim@epita.fr>
13806
13807 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
13808 whether the reducion was empty or not. This leaves room to
13809 improve the use of YYLLOC_DEFAULT in such a case.
13810 lalr1.cc is still experimental, so changing this is acceptable.
13811 And finally, there are probably not many users who changed the
13812 handling of locations in GLR, so changing is admissible too.
13813
13814 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
13815 empty reduction, set @$ to an empty location ending the previously
13816 stacked symbol.
13817 Adjust uses to make sure the code is triggered on empty
13818 reductions.
13819 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
13820 expected output: empty reductions have empty locations.
13821
138222004-09-29 Akim Demaille <akim@epita.fr>
13823
13824 * data/lalr1.cc: Move towards a more standard C++ coding style
13825 for templates: Class < T > -> Class<T>.
13826
138272004-09-29 Akim Demaille <akim@epita.fr>
13828
13829 * data/lalr1.cc: Reinstall the former ctor, for sake of
13830 compatibility, but warn it will be removed.
13831 Move towards a more standard C++ coding style (i.e., type *var ->
13832 type* var).
13833
138342004-09-27 Paul Eggert <eggert@cs.ucla.edu>
13835
13836 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
13837 since it's less likely to work if NULs are involved in the future.
13838
138392004-09-27 Akim Demaille <akim@epita.fr>
13840
13841 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
13842
138432004-09-27 Akim Demaille <akim@epita.fr>
13844
13845 * data/lalr1.cc (b4_parse_param_decl_1): New.
13846 (b4_parse_param_decl): Use it to have different names between attribute
13847 and argument names.
13848 (b4_cc_constructor_call): Likewise.
13849
138502004-09-24 Akim Demaille <akim@epita.fr>
13851
13852 * src/parse-gram.y (add_param): Strip the leading and trailing
13853 blanks from a formal argument declaration.
13854 (YY_LOCATION_PRINT): New.
13855
138562004-09-24 Akim Demaille <akim@epita.fr>
13857
13858 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
13859 after the location.
13860
138612004-09-24 Akim Demaille <akim@epita.fr>
13862
13863 * doc/bison.texinfo (Table of Symbols): Sort.
13864
138652004-09-21 Akim Demaille <akim@epita.fr>
13866
13867 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
13868 the useless parentheses.
13869 Suggested by Paul Eggert.
13870
138712004-09-20 Akim Demaille <akim@epita.fr>
13872
13873 Let the initial-action act on the look-ahead, and use it for the
13874 "initial push" (corresponding to an hypothetical beginning-of-file).
13875 And let lalr1.cc honor %initial-action.
13876
13877 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
13878 example.
13879 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
13880 (Parser::Parser): Remove the ctor that used to initialize it.
13881 (Parser::parse): Like in the other skeletons, issue the "starting
13882 parse" message before any action.
13883 Honor %initial-action.
13884 Initialize the stacks with the lookahead.
13885 * data/yacc.c: Let $$ and @$ in %initial-action designate the
13886 look-ahead.
13887 Push them in the stacks.
13888 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
13889
138902004-09-20 Akim Demaille <akim@epita.fr>
13891
13892 * doc/bison.texinfo (Initial Action Decl): New.
13893
138942004-09-20 Akim Demaille <akim@epita.fr>
13895
13896 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
13897 clearer criterion to define it.
13898 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
13899 When reducing on an empty RHS, use the latest stacked location as
13900 location.
13901 yylloc is not always available.
13902 * data/glr.c: Likewise.
13903 Also, honor initial-actions.
13904
139052004-09-20 Akim Demaille <akim@epita.fr>
13906
13907 * data/yacc.c (YY_LOCATION_PRINT): New.
13908 Define when we know YYLTYPE's structure, i.e., when the default
13909 YYLLOC_DEFAULT is used.
13910 * data/c.m4 (b4_yysymprint_generate): Use it.
13911 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
13912 value of the result.
13913 (error_start_): Replace with...
13914 (error_range_): this location array.
13915 This allows to replace code relying on the implementation of
13916 locations by portable code.
13917 * data/yacc.c (yylerrsp): Replace with...
13918 (yyerror_range): this.
13919 Every time a token is popped, update yyerror_range[0], to have an
13920 accurate location for the error token.
13921 * data/glr.c (YY_LOCATION_PRINT): New.
13922 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
13923 deference a pointer.
13924 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
13925 report the location in %printers.
13926
13927 * src/scan-skel.l: Instead of abort, report error messages to ease
13928 understanding skeleton scanning failures.
13929
139302004-09-16 Akim Demaille <akim@epita.fr>
13931
13932 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
13933 (iterator, const_iterator): these, to be more in the C++ spirit.
13934 Also, return reverse iterators so that when displaying the stack
13935 we display its bottom first.
13936 (Parser::stack_print_, Parser::reduce_print_): Match the messages
13937 from yacc.c.
13938 We should probably use vector here though.
13939
139402004-09-16 Akim Demaille <akim@epita.fr>
13941
13942 Have more complete shift traces.
13943
13944 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
13945 to report Shifts instead of ad hoc YYDPRINTF invocations,
13946 including for the error token.
13947 * data/lalr1.cc (symprint_): Output the location.
13948 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
13949 output the location within the %printer.
13950 Activate GLR tests, at least to make sure they compile properly.
13951 They still don't pass though.
13952 * tests/calc.at: Adjust expect verbose output, since now "Entering
13953 state..." is on a different line than the "Shifting" message.
13954
139552004-09-08 Akim Demaille <akim@epita.fr>
13956
13957 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
13958 Bison directive from the Bison file to the invocation of this
13959 macro, so that these directives are passed to
13960 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
13961 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
13962 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
13963 the extra Bison directives instead of the whole series.
13964 Change the grammar so that there are recoverable errors, and
13965 unrecoverable errors. Now we can have the parser give up before
13966 consuming the whole input. As a result we now can observe that
13967 the lookahead is freed when needed.
13968 Change the parser source to parse argv[1] instead of a hard coded
13969 string.
13970 Simplify yylex, and give a value and location to EOF.
13971 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
13972 passed directives already coded in the file.
13973 Add some tests to check the location of "error".
13974 For some tests, the C++ parser is correct, and not yacc.c.
13975 For other tests, they provide different, but unsatisfying, values,
13976 so keep the C++ value so that at least one parser is "correct"
13977 according to the test suite.
13978 (Actions after errors): Remove, this is subsumed by the
13979 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
13980
139812004-09-06 Akim Demaille <akim@epita.fr>
13982
13983 * data/lalr1.cc: Adjust the indentation of the labels.
13984 (Parser::pop): New.
13985 Use it.
13986
139872004-09-06 Akim Demaille <akim@epita.fr>
13988
13989 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
13990 argument, an informative message.
13991 Call YY_SYMBOL_PRINT.
13992 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
13993 * data/lalr1.cc (destruct_): Likewise.
13994 In addition, no longer depend on b4_yysymprint_generate and
13995 b4_yydestruct_generate to generate these functions, do it "by
13996 hand".
13997
139982004-09-03 Akim Demaille <akim@epita.fr>
13999
14000 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
14001 invoked, yydestruct the lookahead.
14002 * tests/calc.at (Calculator $1): Update the expected lengths of
14003 traces: there is an added line for the discarded lookahead.
14004 * doc/bison.texinfo (Destructor Decl): Some rewording.
14005 Define "discarded" symbols.
14006
140072004-09-02 Akim Demaille <akim@epita.fr>
14008
14009 * data/lalr1.cc (translate_, destruct_): No reason to be static.
14010
140112004-09-02 Akim Demaille <akim@epita.fr>
14012
14013 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
14014 (YYDSYMPRINTF): Rename as...
14015 (YY_SYMBOL_PRINT): this.
14016 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
14017 two.
14018 Use it instead of direct symprint_ calls.
14019 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
14020 one.
14021
140222004-09-02 Akim Demaille <akim@epita.fr>
14023
14024 * data/lalr1.cc (b4_yysymprint_generate): New.
14025 (symprint_): New member function, defined when YYDEBUG.
14026 Use it consistently instead of token/nterm debugging output by
14027 hand.
14028 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
14029 %printer calls to use cdebug_ when using lalr1.cc.
14030
140312004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
14032
14033 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
14034 with #ifdef YYDEBUG.
14035
140362004-08-26 Akim Demaille <akim@epita.fr>
14037
14038 * doc/bison.texinfo (Implementing Loops): Rename as...
14039 (Implementing Gotos/Loops): this.
14040
140412004-08-13 Paul Eggert <eggert@cs.ucla.edu>
14042
14043 Adjust to latest gnulib.
14044 * bootstrap (gnulib_modules): Add xalloc-die.
14045 Set LC_ALL=C so that file names sort consistently.
14046 Prefer the gnulib copies of gettext.m4, glibc21.m4,
14047 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
14048 uintmax_t.m4, ulonglong.m4.
14049 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
14050 po.m4 since we are now using _gl.m4 instead.
14051
140522004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
14053
14054 * src/scan-action.l: Remove. Scanning of semantic actions is
14055 handled in scan-gram.l.
14056
140572004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
14058
14059 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
14060
14061 * src/location.h (struct): The file member is a uniqstr.
14062 (equal_boundaries): Use UNIQSTR_EQ for comparison.
14063
140642004-07-22 Paul Eggert <eggert@cs.ucla.edu>
14065
14066 Fix bug with non-%union parsers that have printers or destructors,
14067 which led to a Bison core dump. Reported by Peter Fales in
14068 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
14069
14070 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
14071 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
14072 not to our own type.
14073 * src/output.c (symbol_destructors_output, symbol_printers_output):
14074 Don't assume %union.
14075 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
14076 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
14077 UNION-FLAG. All callers changed.
14078 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
14079 Use type char, not unsigned int, when declaring an array of char;
14080 this lets us remove a cast.
14081 (Printers and Destructors): Add non-%union test cases.
14082
140832004-06-21 Paul Eggert <eggert@cs.ucla.edu>
14084
14085 * doc/bison.texinfo: Minor editorial changes, mostly to the new
14086 GLR writeups. E.g., avoid frenchspacing and the future tense,
14087 change "lookahead" to "look-ahead", and change "wrt" to "with
14088 respect to".
14089
140902004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
14091
14092 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
14093 New sections, split off from the GLR Parsers section. Put the new
14094 Simple GLR Parser near the start of the GLR section, for clarity.
14095 Rewrite connective text.
14096
140972004-06-21 Frank Heckenbach <frank@g-n-u.de>
14098
14099 * doc/bison.texinfo (Simple GLR Parsers): New section.
14100
141012004-06-21 Paul Eggert <eggert@cs.ucla.edu>
14102
14103 * NEWS, TODO, doc/bison.texinfo:
14104 Use "look-ahead" instead of "lookahead", to be consistent.
14105 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
14106 while we're fixing "look-ahead".
14107 * src/conflicts.c (shift_set): Renamed from shiftset.
14108 (look_ahead_set): Renamed from lookaheadset.
14109 * src/print.c: Likewise.
14110 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
14111 name for "lookahead".
14112 (report_types, usage): Likewise.
14113 * src/getargs.h (report_look_ahead_tokens): Renamed from
14114 report_lookaheads.
14115 * src/lalr.c (compute_look_ahead_tokens): Renamed from
14116 compute_lookaheads.
14117 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
14118 (look_ahead_tokens_print): Renamed from lookaheads_print.
14119 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
14120 state_rule_lookaheads_print.
14121 * src/state.h: Likewise.
14122 (reductions.look_ahead_tokens): Renamed from lookaheads.
14123 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
14124 AT_DATA_LOOKAHEADS_GRAMMAR.
14125
141262004-06-03 Paul Eggert <eggert@cs.ucla.edu>
14127
14128 * README: Update location of patched M4 distribution.
14129
141302004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
14131
14132 Don't assume the C++ compiler takes the same arguments as the C compiler
14133 (trivial change).
14134 * configure.ac (O0CXXFLAGS): New var.
14135 * tests/atlocal.in (CXXFLAGS): Use it.
14136
141372004-05-29 Paul Eggert <eggert@cs.ucla.edu>
14138
14139 Fix some "make check" problems with C++ reported by
14140 Albert Chin-A-Young for Tru64 C++ in this thread:
14141 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
14142
14143 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
14144 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
14145 Output to a .cc file for C++, not to a .c file.
14146 * tests/calc.at (AT_CHECK_CALC): Likewise.
14147 * tests/regression.at (AT_CHECK_DANCER): Likewise.
14148 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
14149
141502004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
14151
14152 * tests/calc.at, tests/actions.at: Workaround for SGI
14153 C++ compiler. (trivial change)
14154
141552004-05-27 Paul Eggert <eggert@cs.ucla.edu>
14156
14157 Spent a few hours checking out which prerequisite versions the
14158 current sources actually require. I went all the way back to
14159 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
14160 a seemingly endless set of combinations of versions more recent
14161 than that. The bottom line is that the current sources require
14162 fairly recent versions of the build tools, and it'll be some work
14163 to change this.
14164 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
14165 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
14166 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
14167 Add comments explaining why those particular versions are
14168 currently needed.
14169
14170 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
14171 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
14172 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
14173
14174 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
14175 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
14176
141772004-05-26 Paul Eggert <eggert@cs.ucla.edu>
14178
14179 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
14180 0.11.5. Suggested by Bruno Haible.
14181 * bootstrap: Remove gettext version checking.
14182
14183 * doc/bison.texinfo (Decl Summary): Also mention that %union
14184 can depend on prerequisite types. Problem reported by Tim
14185 Van Holder.
14186
141872004-05-25 Paul Eggert <eggert@cs.ucla.edu>
14188
14189 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
14190 * README-alpha: Don't tell people not to package this.
14191
14192 * bootstrap: Don't assume $(...) works; use `...` instead.
14193 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
14194 gettext better.
14195
14196 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
14197 put into the -d output file, and mention what to do if YYSTYPE is
14198 defined as a macro.
14199
142002004-05-24 Paul Eggert <eggert@cs.ucla.edu>
14201
14202 Undo change made earlier today: it caused autopoint to not bring
14203 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
14204 autopoint's.
14205
14206 * bootstrap: Check that gettext version matches what's in
14207 configure.ac. Warn users to ignore robots.txt ERROR 404.
14208 * bootstrap: Undo today's earlier change (logged below).
14209 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
14210
14211 The gettext version checking is causing more trouble than it's
14212 curing; remove it. Problem reported by Paul Hilfinger.
14213
14214 * bootstrap: Issue a warning that one can expect a message
14215 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
14216 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
14217
142182004-05-23 Paul Eggert <eggert@cs.ucla.edu>
14219
14220 Ensure that the C++ compiler used for testing actually works on a
14221 simple test program; if not, skip the C++-related tests. Problem
14222 reported by Vin Shelton in:
14223 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
14224
14225 * m4/cxx.m4: New file.
14226 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
14227 * tests/atlocal.in (BISON_CXX_WORKS): Add.
14228 * tests/local.at (AT_COMPILE_CXX): Use it.
14229
142302004-05-21 Paul Eggert <eggert@cs.ucla.edu>
14231
14232 * data/glr.c (yylloc): Output this macro even if locations are not
14233 being generated, as the GLR parser needs it even in that case.
14234 Problem reported by Troy A. Johnson
14235 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
14236
14237 * configure.ac (AC_INIT): Update to 1.875e.
14238
142392004-05-21 Paul Eggert <eggert@cs.ucla.edu>
14240
14241 * NEWS: Version 1.875d.
14242 * configure.ac (AC_INIT): Likewise.
14243 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
14244
14245 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
14246 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
14247 lalr1.cc runs afoul of the first, and the last two are no longer
14248 supported by GCC 3.4.0.
14249 * README: Mention GNU m4 1.4 or later; mention m4 patches.
14250 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
14251
142522004-05-06 Paul Eggert <eggert@cs.ucla.edu>
14253
14254 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
14255 unsigned int, for compatibility with latest gnulib hash module.
14256 * src/state.c (state_hash, state_hasher): Likewise.
14257 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
14258 * src/uniqstr.c (hash_uniqstr): Likewise.
14259
142602004-05-03 Paul Eggert <eggert@cs.ucla.edu>
14261
14262 * NEWS: Unescaped newlines are no longer allowed in char & strings.
14263
14264 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
14265 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
14266 character and string literals.
14267 (unexpected_end): New function.
14268 (unexpected_eof): Use it.
14269 (unexpected_newline): New function.
14270 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
14271 actions.
14272
14273 * NEWS: Document %expect-rr.
14274
14275 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
14276 Fix typo by replacing $1 with $option.
14277 Remove more 'intl'-related files.
14278 Don't DEFUN AM_INTL_SUBDIR twice.
14279
14280 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
14281 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
14282 strtoul.c.
14283 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
14284 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
14285 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
14286 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
14287 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
14288 * src/.cvsignore: Add *.output.
14289
14290 * src/parse-gram.y: Put copyright notice inside %{ %} so it
14291 gets copied to the output file.
14292
142932004-04-28 Paul Eggert <eggert@twinsun.com>
14294
14295 Get files from the gnulib and po repositories, instead of relying
14296 on them being in our CVS. Upgrade to latest versions of gnulib
14297 and Automake.
14298
14299 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
14300 * bootstrap: Bootstrap from gnulib and po repositories.
14301 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
14302 * README-cvs: Document these changes. Remove version numbers from
14303 mentions of build tools, since they change so often. Mention Flex.
14304
14305 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
14306 (gl_USE_SYSTEM_EXTENSIONS): Add.
14307 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
14308 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
14309 does this for us.
14310 (AC_ISC_POSIX): Remove; we no longer support this
14311 ancient OS, as it gets in the way of latest Autoconf & gnulib.
14312 (AC_HEADER_STDC): Remove: we now assume C89 or better.
14313 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
14314 Do not check for C89 headers, except for locale.h which is used
14315 by the Yacc library and must port to K&R hosts.
14316 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
14317 Do not check for C89 functions, except for setlocale which is
14318 used by the Yacc library.
14319 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
14320 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
14321 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
14322 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
14323 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
14324 AM_GNU_GETTEXT): Remove; now done by:
14325 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
14326 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
14327 for us.
14328
14329 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
14330 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
14331 Define to empty, as gnulib.mk will do the rest for us.
14332 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
14333 for us.
14334 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
14335 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
14336
14337 * src/files.c: Include gnulib's xstrndup.h.
14338
14339 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
14340 (REALLOC): Use xnrealloc, for likewise.
14341 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
14342 (strnlen, memrchr): Remove decls; functions no longer used.
14343 Include <stpcpy.h>.
14344
14345 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
14346 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
14347 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
14348 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
14349 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
14350 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
14351 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
14352 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
14353 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
14354 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
14355 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
14356 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
14357 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
14358 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
14359 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
14360 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
14361 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
14362 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
14363 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
14364 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
14365 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
14366 Remove, as these files are now generated automatically
14367 by bootstrap or automake.
14368
14369 * po/ChangeLog: Remove: all but one entry was a duplicate
14370 of this file, and I moved that 2000-11-02 entry here.
14371
14372 * config/.cvsignore: Add Makefile, depcomp, install-sh.
14373 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
14374 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
14375 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
14376 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
14377 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
14378 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
14379 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
14380 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
14381 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
14382 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
14383 xstrndup.h.
14384 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
14385 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
14386 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
14387 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
14388 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
14389 * src/.cvsignore: Remove *_.c.
14390
14391
14392 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
14393 support it. (The latest stable gzip doesn't.)
14394
143952004-04-27 Paul Eggert <eggert@twinsun.com>
14396
14397 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
14398 case, as stos_ is now used by destructors due to the 2004-02-09
14399 change.
14400
14401 Remove more K&R C support.
14402 * lib/libiberty.y (PARAMS): Remove. All uses removed.
14403 * lib/subpipe.c (errno): Remove decl.
14404 Include <stdlib.h> unconditionally.
14405 (EXIT_FAILURE): Remove macro.
14406 * src/complain.c (vfprintf, strerror): Remove.
14407 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
14408 unconditionally.
14409 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
14410 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
14411 (strchr, strspn, memchr): Remove decls.
14412 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
14413 unconditionally. Do not declare perror.
14414 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
14415 unconditionally.
14416
14417 * src/complain.c (_): Remove useless defn, as system.h defines this.
14418
14419 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
14420 with latest obstack.h.
14421 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
14422 to procedure types, as obstack.h now does that for us.
14423 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
14424
14425 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
14426 so that this include file can stand alone.
14427 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
14428 does this now. Include subpipe.h first after config.h, to
14429 test whether it can stand alone.
14430
14431 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
14432 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
14433 unused declaration.
14434
14435 * tests/synclines.at (%union synch line): Put a dummy member in
14436 the union, because empty unions aren't allowed in C. Caught
14437 by GCC 3.4.0.
14438
144392004-04-13 Jim Meyering <jim@meyering.net>
14440
14441 * src/conflicts.c (conflicts_print): Correct format string typo:
14442 use `%%' to produce literal `%'. (trivial change)
14443
144442004-03-30 Paul Eggert <eggert@twinsun.com>
14445
14446 * src/getargs.c (version): Update copyright year to 2004.
14447
14448 * data/c.m4 (b4_int_type): Use 'short int' rather than
14449 'short', and similarly for 'long', 'unsigned', etc.
14450 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
14451 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
14452 yy_yypstack, yydumpstack): Likewise.
14453 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
14454 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
14455 Likewise.
14456 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
14457 yy_stack_print, yyparse): Likewise.
14458 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
14459 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
14460 * lib/bitset.c (bitset_print): Likewise.
14461 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
14462 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
14463 * lib/bitsetv.c (bitsetv_dump): Likewise.
14464 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
14465 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
14466 Likewise.
14467 * src/LR0.c (allocate_itemsets): Likewise.
14468 * src/gram.h (rule_number, rule): Likewise.
14469 * src/lalr.h (goto_number): Likewise.
14470 * src/nullable.c (nullable_compute): Likewise.
14471 * src/output.c (prepare_rules): Likewise.
14472 * src/relation.c (relation_print, relation_digraph): Likewise.
14473 * src/relation.h (relation_node): Likewise.
14474 * src/state.h (state_number, transitions, errs, reductions,
14475 struct state): Likewise.
14476 * src/symtab.h (symbol_number, struct symbol): Likewise.
14477 * src/tables.c (vector_number, tally, action_number,
14478 default_goto, goto_actions): Likewise.
14479 * tests/existing.at (GNU Cim Grammar): Likewise.
14480 * tests/regression.at (Web2c Actions): Likewise.
14481
14482 * src/output.c (muscle_insert_short_int_table): Renamed from
14483 muscle_insert_short_table. All uses changed.
14484
144852004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
14486
14487 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
14488 (declaration): Replace expected_conflicts with expected_sr_conflicts.
14489 Add %expect-rr rule.
14490
14491 * src/scan-gram.l: Recognize %expect-rr.
14492
14493 * src/conflicts.h (expected_sr_conflicts): Rename from
14494 expected_conflicts.
14495 (expected_rr_conflicts): Declare.
14496
14497 * src/conflicts.c (expected_sr_conflicts): Rename from
14498 expected_conflicts.
14499 (expected_rr_conflicts): Define.
14500 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
14501 for GLR parsers.
14502 Use expected_sr_conflicts in place of expected_conflicts.
14503 Warn if expected_rr_conflicts used in non-GLR parser.
14504
14505 * doc/bison.texinfo: Add documentation for %expect-rr.
14506
145072004-03-08 Paul Eggert <eggert@gnu.org>
14508
14509 Add support for hex token numbers. Suggested by Odd Arild Olsen in
14510 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
14511
14512 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
14513 in lalr1.cc.
14514 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
14515 * src/scan-gram.l (scan_integer): New function.
14516 ({int}): Use it.
14517 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
14518 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
14519 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
14520 Say "long int", not "long", for uniformity with GNU style.
14521
145222004-02-25 Paul Eggert <eggert@twinsun.com>
14523
14524 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
14525 compilers. This fixes a problem with Intel's C++ compiler being
14526 chatty, reported by Guido Trentalancia in
14527 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
14528
145292004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
14530
14531 Support %destructor and merge error locations in lalr1.cc.
14532
14533 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
14534 (Parser::stos_): Define unconditionally.
14535 (Parser::destruct_): New method. Generate its body with
14536 b4_yydestruct_generate.
14537 (Parser::error_start_): New attribute.
14538 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
14539 token which are discarded.
14540 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
14541 error_start_ when erroneous token are discarded.
14542 (Parser::parse) <yyerrlab1>: Compute the location of the error
14543 token so that it covers all the discarded tokens.
14544 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
14545 it can be called with `%skeleton "lalr1.cc"', and do that.
14546
145472004-02-02 Paul Eggert <eggert@twinsun.com>
14548
14549 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
14550 $(top_srcdir)/lib and ../lib. This fixes a bug reported
14551 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
14552 There's no need to mention top_builddir since Automake does that
14553 for us.
14554 (INCLUDES): Remove, as Automake says it's obsolescent.
14555 Contents migrated into AM_CPPFLAGS as described above.
14556 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
14557
145582004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
14559
14560 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
14561 (yyreportSyntaxError): Handle case where lookahead token is
14562 YYEMPTY.
14563
145642004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14565
14566 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
14567 resulting parsers are compilable with C++.
14568
145692003-12-23 Paul Eggert <eggert@twinsun.com>
14570
14571 * config/depcomp, config/install-sh: Sync with Automake 1.8.
14572 * src/output.c (output_skeleton): Rename local var.
14573 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
14574 Bison tokens, as this runs afoul of the 2003-10-07 change that
14575 disallowed NUL bytes in character constants or string literals.
14576
14577 * tests/local.at: Require Autoconf 2.59's Autotest.
14578 * tests/testsuite.at: Don't include local.at, since we now assume
14579 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
14580 including it.
14581 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
14582 multiple inclusion warnings.
14583
145842003-12-02 Akim Demaille <akim@epita.fr>
14585
14586 * doc/bison.texinfo (How Can I Reset the Parser): More about start
14587 conditions.
14588 From Bruno Haible.
14589
145902003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
14591
14592 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
14593
145942003-10-07 Paul Eggert <eggert@twinsun.com>
14595
14596 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
14597 if testsuite doesn't exist.
14598
14599 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
14600 literals, unfortunately.
14601 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
14602 Complain about NUL bytes in character constants or string literals.
14603
146042003-10-05 Paul Eggert <eggert@twinsun.com>
14605
14606 * NEWS: Don't document %no-default-prec, as it's still
14607 too experimental.
14608 * doc/bison.texinfo: Document %no-default-prec only if
14609 the defaultprec flag is set. Normally it's not.
14610
146112003-10-04 Paul Eggert <eggert@twinsun.com>
14612
14613 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
14614 non-modifiable lvalue, instead of a modifiable one.
14615 * doc/bison.texinfo (Actions): Document that $$ can
14616 be assigned to. Do not claim that $$ and $N are
14617 array element references: user code should not rely on this.
14618
146192003-10-01 Paul Eggert <eggert@twinsun.com>
14620
14621 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
14622 (grammar_declaration): Use it.
14623 * src/scan-gram.l: New token %no-default-prec.
14624 * tests/conflicts.at: Revamp tests to use %no-default-prec.
14625 * NEWS, doc/bison.texinfo: Document the above.
14626
146272003-10-01 Akim Demaille <akim@epita.fr>
14628
14629 VCG no longer supports long_straight_phase.
14630
14631 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
14632 * src/print_graph.c (print_graph): Adjust.
14633
146342003-09-30 Frank Heckenbach <frank@g-n-u.de>
14635 and Paul Eggert <eggert@twinsun.com>
14636
14637 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
14638 Table of Symbols): Document %default-prec.
14639 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
14640 (grammar_declaration): Set default_prec on %default-prec.
14641 * src/scan-gram.l (%default-prec): New token.
14642 * src/reader.h (default_prec): New flag.
14643 * src/reader.c: Likewise.
14644 (packgram): Handle it.
14645 * tests/conflicts.at (%default-prec without %prec,
14646 %default-prec with %prec, %default-prec 1): New tests.
14647
146482003-09-30 Paul Eggert <eggert@twinsun.com>
14649
14650 * tests/testsuite.at: Include local.at, not input.at, fixing
14651 a typo in the 2003-08-25 patch.
14652
146532003-08-27 Akim Demaille <akim@epita.fr>
14654
14655 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
14656 GCC warnings.
14657
146582003-08-26 Akim Demaille <akim@epita.fr>
14659
14660 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
14661 "<\#" to avoid magic from Gnus when posting parts of this script.
14662
146632003-08-26 Akim Demaille <akim@epita.fr>
14664
14665 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
14666 (Parser::parse): here.
14667 Adjust: nerrs and errstatus is now replaced by...
14668 (Parser::nerrs_, Parser::errstatus_): New.
14669
146702003-08-25 Akim Demaille <akim@epita.fr>
14671
14672 * config/announce-gen, Makefile.cfg: New.
14673 * Makefile.am: Adjust.
14674 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
14675 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
14676
146772003-08-25 Akim Demaille <akim@epita.fr>
14678
14679 When reducing initial empty rules, Bison parser read an initial
14680 location that is not defined. This results in garbage, and that
14681 affects Bison's own parser. Therefore we need (i) to extend Bison
14682 to support a means to initialize this location, and (ii) to use
14683 this CVS Bison to fix CVS Bison's parser.
14684
14685 * src/reader.h, reader.c (epilogue_augment): Remove, replace
14686 with...
14687 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
14688 * src/parse-gram.y: Adjust.
14689 (%initial-action): New.
14690 (%error-verbose): Since we require CVS Bison, there is no reason
14691 not to use it.
14692 * src/scan-gram.l: Adjust.
14693 * src/Makefile.am (YACC): New, to make sure we use our own parser.
14694 * data/yacc.c (yyparse): Use b4_initial_action.
14695
146962003-08-25 Akim Demaille <akim@epita.fr>
14697
14698 * doc/bison.texinfo: Don't promote stdout for error messages.
14699
147002003-08-25 Akim Demaille <akim@epita.fr>
14701
14702 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
14703 From Alexandre Duret-Lutz.
14704
147052003-08-25 Akim Demaille <akim@epita.fr>
14706
14707 Version 1.875c.
14708
147092003-08-25 Akim Demaille <akim@epita.fr>
14710
14711 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
14712 Use them.
14713
147142003-08-25 Akim Demaille <akim@epita.fr>
14715
14716 * data/lalr1.cc (Parser::reduce_print_): New.
14717 Use it.
14718
147192003-08-25 Akim Demaille <akim@epita.fr>
14720
14721 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
14722 error recovery loops. This patch is based on
14723 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
14724 Also, augment the similarity between lalr1.cc and yacc.c.
14725 Note: the locations of error recovery rules are not correct yet.
14726
14727 * data/lalr1.cc: Comment changes to augment the similarity between
14728 lalr1.cc and yacc.c.
14729 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
14730 (yyerrlab1): Remove, but where it used to be (now the bottom part of
14731 yyerrlab), when hitting EOF, pop the whole stack here instead of
14732 merely falling thru the default error handling mechanism.
14733 (yyerrorlab): New label, with the old contents of YYERROR,
14734 plus the following change: pop the stack of rhs corresponding
14735 to the production that invoked YYERROR. That is how Yacc
14736 behaves (required by POSIX).
14737 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
14738 fail.
14739
147402003-08-25 Akim Demaille <akim@epita.fr>
14741
14742 Tune local.at so that people can "autom4te -l autotest calc.at -o
14743 calc" for instance, to extract a sub test suite.
14744
14745 * tests/testsuite.at: Move the initialization, Autotest version
14746 requirement, and AT_TESTED invocation into...
14747 * tests/local.at: here.
14748 * tests/testsuite.at: Include it for compatibility with Autoconf
14749 2.57.
14750 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
14751 be ignore.
14752
147532003-08-04 Paul Eggert <eggert@twinsun.com>
14754
14755 Rework code slightly to avoid gcc -Wtraditional warnings.
14756 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
14757 The returned value is now stored in *YY0. All callers changed.
14758 * src/output.c (merge_output): Adjust to the above change.
14759
147602003-07-26 Paul Eggert <eggert@twinsun.com>
14761
14762 * data/glr.c (YYASSERT): New macro.
14763 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
14764 yyresolveStates, yyprocessOneStack):
14765 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
14766 Derived from a suggestion by Frank Heckenbach.
14767
147682003-07-25 Paul Eggert <eggert@twinsun.com>
14769
14770 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
14771 for portability to K&R C (after ansi2knr, presumably). See
14772 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
14773 by Frank Heckenbach, though I have omitted the structure-initialization
14774 part of his glr-knr.diff patch since I recall that the Portable
14775 C Compiler didn't require that change.
14776
14777 Let the user specify how to allocate and free memory.
14778 Derived from a suggestion by Frank Heckenbach in
14779 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
14780 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
14781 All uses of free, malloc, realloc changed to use these macros,
14782 and unnecessary casts removed.
14783 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
14784
147852003-07-06 Matthias Mann <MatthiasMann@gmx.de>
14786
14787 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
14788 use s.empty() rather than s == "" to test for empty string; see
14789 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
14790 (trivial change)
14791
147922003-06-25 Akim Demaille <akim@epita.fr>
14793
14794 * config/depcomp, config/install-sh: Update from masters.
14795
147962003-06-20 Paul Eggert <eggert@twinsun.com>
14797
14798 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
14799 and return properly parenthesized result.
14800 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
14801 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
14802 Remove unnecessary parentheses from uses.
14803 * doc/bison.texinfo (Location Default Action): Describe the
14804 conventions for parentheses.
14805
148062003-06-19 Paul Eggert <eggert@twinsun.com>
14807
14808 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
14809 yyreportTree): Do not assume that size_t is the same width as int,
14810 when printing sizes. Print sizes using an unsigned format.
14811 Problem reported by Frank Heckenbach in
14812 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
14813
14814 Port to Forte Developer 7 C compiler.
14815 * data/glr.c (struct YYLTYPE): If locations are not being used,
14816 declare a single dummy member, as empty structs do not conform
14817 to the C standard.
14818 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
14819 the Forte Developer 7 C compiler complains that end-of-loop
14820 code is not reached.
14821
148222003-06-17 Paul Eggert <eggert@twinsun.com>
14823
14824 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
14825 avoid warnings from picky compilers about redefinition of PARAMS.
14826
148272003-06-17 Paul Eggert <eggert@twinsun.com>
14828
14829 Version 1.875b.
14830
14831 * NEWS: Document 1.875b.
14832
14833 * lib/bbitset.h: Do not include config.h; that's the includer's job.
14834 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
14835 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
14836 Don't use 'index' in comments, as it's a builtin fn on some hosts.
14837 * lib/bitset_stats.c: Include gettext.h unconditionally, as
14838 per recent gettext manual's suggestion.
14839 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
14840 Use prototypes, not old-style definitions.
14841 * lib/lbitset.c (lbitset_unused_clear): Likewise.
14842 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
14843 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
14844 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
14845 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
14846 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
14847 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
14848 vbitset_or_and_cmp, vbitset_copy): Likewise.
14849
14850 * lib/libiberty.h: Do not include config.h; that's the includer's job.
14851 Do not include <stdlib.h>.
14852 (PARAMS): Define unconditionally for C89.
14853 (ATTRIBUTE_NORETURN): Remove.
14854 (ATTRIBUTE_UNUSED): Define unconditionally.
14855
14856 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
14857 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
14858 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
14859 * lib/vbitset.c, lib/vbitset.h: New files.
14860 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
14861 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
14862 from libbitset.
14863
14864 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
14865 `How Can I Reset @code{yyparse}', since texinfo does not allow
14866 arbitrary @ in node names.
14867
14868 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
14869 shouldn't be needed according to the gettext 0.12.1 documentation
14870 but which seem to be needed anyway: codeset.m4 glibc21.m4
14871 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
14872 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
14873 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
14874
14875 * lib/.cvsignore: Add stdbool.h.
14876 * m4/.cvsignore: Add nls.m4, po.m4.
14877
14878 Upgrade to CVS gnulib.
14879 * stdbool_.h: File renamed from stdbool.h.in.
14880 * configure.ac (AM_STDBOOL_H): Invoke this instead of
14881 AC_HEADER_STDBOOL.
14882 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
14883 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
14884 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
14885 (MOSTLYCLEANFILES): New var.
14886 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
14887 (stdbool.h): New rule.
14888 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
14889 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
14890 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
14891 m4/quote.m4: Upgrade to today's gnulib.
14892
14893 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
14894 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
14895 the tests right now.
14896 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
14897 yyerror are declared before use; C99 requires this.
14898
148992003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14900
14901 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
14902 first.
14903 (yyrecoverSyntaxError): Correct the logic for setting and testing
14904 yyerrState.
14905 Correct comment on handling EOF.
14906 Allow states with only a default reduction, rather than failing
14907 (I can't quite reconstruct why these were not allowed before).
14908
14909 Fixes to avoid problem that $-N rules in GLR parsers can cause
14910 buffer overruns, corrupting state.
14911
14912 * src/output.c (prepare_rules): Output max_left_semantic_context
14913 definition.
14914 * src/reader.h (max_left_semantic_context): New variable declaration.
14915 * src/scan-gram.l (max_left_semantic_context): Define.
14916 (handle_action_dollar): Update max_left_semantic_context.
14917 * data/glr.c (YYMAXLEFT): New definition.
14918 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
14919 (yyresolveAction): Ditto.
14920
14921 Fixes to problems with location handling in GLR parsers reported by
14922 Frank Heckenbach (2003/06/05).
14923
14924 * data/glr.c (YYLTYPE): Make trivial if locations not used.
14925 (YYRHSLOC): Add parentheses, and define only if locations used.
14926 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
14927 locations not used.
14928 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
14929 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
14930
14931 * tests/cxx-type.at: Exercise location information; update tests
14932 to differentiate output with and without locations.
14933 Remove forward declarations of yylex and yyerror---caused errors
14934 because default YYLTYPE not yet defined.
14935 Change semantic actions to compute strings, rather than printing
14936 them directly (to test proper passing of semantics values). Change
14937 output to prefix notation and update test data and expected results.
14938 (yylex): Track locations.
14939 (stmtMerge): Return value rather than printing, and include arguments
14940 in value.
14941
149422003-06-03 Paul Eggert <eggert@twinsun.com>
14943
14944 Avoid warnings generated by GCC 2.95.4 when Bison is
14945 configured with --enable-gcc-warnings.
14946 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
14947 yy::]b4_parser_class_name[::translate_,
14948 yy::Stack::operator[] (unsigned),
14949 yy::Stack::operator[] (unsigned) const,
14950 yy::Slice::operator[] (unsigned),
14951 yy::Slice::operator[] (unsigned) const):
14952 Rename local vars to avoid warnings.
14953 * tests/glr-regression.at (Improper handling of embedded actions
14954 and $-N in GLR parsers): Remove unused local variable from yylex.
14955 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
14956 (void) as arg when not pure, since we now assume C89 when building
14957 Bison. Pacify GCC by using parameter.
14958
149592003-06-02 Paul Eggert <eggert@twinsun.com>
14960
14961 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
14962 yy::Location::lines, yy::Location::columns): Rename arguments
14963 to avoid shadowing; this removes a warning generated by GCC 3.3.
14964
149652003-06-01 Paul Eggert <eggert@twinsun.com>
14966
14967 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
14968 to g++, as GCC 3.3 complains if you do it.
14969 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
14970 everything that WARNING_CFLAGS has, except omit warnings
14971 not suitable for C++.
14972 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
14973 * tests/atlocal.in (CXXFLAGS): New var.
14974 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
14975
14976 Fix a GLR parser bug I reported in February; see
14977 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
14978 The problem was that GLR parsers did not conform to the C standard,
14979 because actions like { $1 = $2 + $3; } expanded to expressions
14980 that invoked YYFILL in separate subexpressions, and YYFILL assigned
14981 to a local variable. The C standard says that expressions
14982 like (var = f ()) + (var = f ()) have undefined behavior.
14983 Another problem was that GCC sometimes issues warnings that
14984 yyfill and its parameters are unused.
14985
14986 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
14987 as possibly unused.
14988 (yyfill): New function.
14989 (YYFILL): Use it.
14990 (yyuserAction): Change type of yynormal to bool, so that it matches
14991 the new yyfill signature. Mark it as possibly unused.
14992
14993
14994 Follow up on a bug I reported in February, where a Bison-generated
14995 parser can loop. Provide a test case and a fix for yacc.c. I
14996 don't have a fix for lalr1.cc or for glr.c, unfortunately.
14997 The original bug report is in:
14998 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
14999
15000 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
15001 macro's size was becoming unwieldy.
15002 (yyerrlab): Do not discard an empty lookahead symbol, as this
15003 might destroy garbage.
15004 (yyerrorlab): New label, with the old contents of YYERROR,
15005 plus the following change: pop the stack of rhs corresponding
15006 to the production that invoked YYERROR. That is how Yacc
15007 behaves, and POSIX requires this behavior.
15008 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
15009 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
15010 Define 'alarm' to do nothing if unistd.h is not available.
15011 Add a new rule "exp: '-' error;" to test the above change to
15012 data/yacc.c. Use 'alarm' to abort any test taking longer than
15013 10 seconds, as it's probably looping.
15014 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
15015 Also, the new yacc.c generates two fewer diagnostics for an
15016 existing test.
15017
150182003-05-24 Paul Eggert <eggert@twinsun.com>
15019
15020 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
15021 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
15022 This fixes a problem reported by John Bowman when the Compaq/HP
15023 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
15024 -ansi -Wall -gall).
15025 * data/yacc.c (union yyalloc): Likewise.
15026 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
15027
15028 Switch from 'int' to 'bool' where that makes sense.
15029
15030 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
15031 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
15032 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
15033 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
15034 Return or accept bool, not int. All callers changed.
15035 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
15036 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
15037 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
15038 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
15039 bitset_or_and_cmp_): Likewise.
15040 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
15041 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
15042 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
15043 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
15044 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
15045 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
15046 bitset_stats_or_and_cmp): Likewise.
15047 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
15048 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
15049 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
15050 ebitset_xor_cmp): Likewise.
15051 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
15052 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
15053 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
15054 lbitset_xor_cmp): Likewise.
15055 * lib/bbitset.h: Include <stdbool.h>.
15056 (struct bitset_vtable): The following members now return bool, not
15057 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
15058 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
15059 or_and_cmp).
15060 * src/conflicts.c (count_rr_conflicts): Likewise.
15061 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
15062 All uses changed.
15063 * lib/ebitset.c (ebitset_obstack_init): Likewise.
15064 * lib/lbitset.c (lbitset_obstack_init): Likewise.
15065 * src/getargs.c (debug_flag, defines_flag, locations_flag,
15066 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
15067 graph_flag): Likewise.
15068 * src/getargs.h (debug_flag, defines_flag, locations_flag,
15069 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
15070 graph_flag): Likewise.
15071 * src/output.c (error_verbose): Likewise.
15072 * src/output.h (error_verbose): Likewise.
15073 * src/reader.c (start_flag, typed): Likewise.
15074 * src/reader.h (typed): Likewise.
15075 * src/getargs.c (LOCATIONS_OPTION): New constant.
15076 (long_options, getargs): Use it.
15077 * src/lalr.c (build_relations): Use bool, not int.
15078 * src/nullable.c (nullable_compute): Likewise.
15079 * src/print.c (print_reductions): Likewise.
15080 * src/tables.c (action_row, pack_vector): Likewise.
15081 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
15082 * src/output.c (prepare): Use it.
15083 * src/output.c (token_definitions_output,
15084 symbol_destructors_output, symbol_destructors_output): Use string,
15085 not boolean integer, to keep track of whether to output separator.
15086 * src/print_graph.c (print_core): Likewise.
15087 * src/state.c (state_rule_lookaheads_print): Likewise.
15088
15089 * config/install-sh: Sync from automake 1.7.5.
15090
150912003-05-14 Paul Eggert <eggert@twinsun.com>
15092
15093 * src/parse-gram.y (rules_or_grammar_declaration): Require a
15094 semicolon after a grammar declaration, in the interest of possible
15095 future changes to the Bison input language.
15096 Do not allow a stray semicolon at the start of the grammar.
15097 (rhses.1): Allow one or more semicolons after any rule, including
15098 just before "|" as required by POSIX.
15099 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
15100 grammar.
15101
151022003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
15103
15104 %parse-param support for lalr1.cc.
15105
15106 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
15107 b4_cc_constructor_calls, b4_cc_constructor_call,
15108 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
15109 definitions.
15110 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
15111 parse-param arguments.
15112 (yy::b4_parser_class_name): Declare instance variables to
15113 hold parse-param arguments.
15114 * tests/calc.at: s/value/semantic_value/ because value clashes
15115 with a member of yy::b4_parser_class_name. Adjust C++ code
15116 to handle %parse-param. Enable %parse-param test in C++.
15117
151182003-05-12 Paul Eggert <eggert@twinsun.com>
15119
15120 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
15121 English a bit. Fix fclose typo. Change "const char" to "char
15122 const", and use ANSI C rather than K&R for "main". Suggest
15123 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
15124 and suggest yy_switch_to_buffer.
15125
151262003-05-05 Paul Eggert <eggert@twinsun.com>
15127
15128 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
15129 C89. This avoids a diagnostic on compilers that define __STDC__
15130 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
15131 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
15132
151332003-05-03 Paul Eggert <eggert@twinsun.com>
15134
15135 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
15136 Do not overrun array bounds.
15137 This should fix a bug reported today by Olatunji Oluwabukunmi in
15138 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
15139
151402003-04-29 Akim Demaille <akim@epita.fr>
15141
15142 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
15143 * src/getargs.c, src/getargs.h: here, as bool, not int.
15144 (nondeterministic_parser): New.
15145 * src/parse-gram.y, src/scan-gram.l: Support
15146 %nondeterministic-parser.
15147 * src/output.c (prepare): Use nondeterministic_parser instead
15148 of glr_parser where appropriate.
15149 * src/tables.c (conflict_row, action_row, save_row)
15150 (token_actions, token_actions, pack_vector): Ditto.
15151
151522003-04-29 Akim Demaille <akim@epita.fr>
15153
15154 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
15155
151562003-04-29 Akim Demaille <akim@epita.fr>
15157
15158 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
15159 with %pure-parser and %locations to exercise the patch from Yakov
15160 Markovitch below.
15161
151622003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
15163
15164 * data/yacc.c: (b4_lex_param): Corrected for the case where
15165 %lex-param is provided and %pure-parser isn't.
15166
151672003-04-27 Paul Eggert <eggert@twinsun.com>
15168
15169 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
15170 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
15171 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
15172 if it is not defined.
15173 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
15174
151752003-04-26 Paul Eggert <eggert@twinsun.com>
15176
15177 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
15178 Declare to be of type suitable for the ninf value itself, not of
15179 type suitable for the corresponding table, since the latter might
15180 be unsigned but the ninf value might be negative. This fixes a
15181 bug reported by Alexandre Duret-Lutz in
15182 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
15183
15184 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
15185 invokes it. We shouldn't invoke it twice because it will attempt
15186 to put error.o in the archive twice. This fixes a glitch reported
15187 by Martin Mokrejs in
15188 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
15189
151902003-04-21 Paul Eggert <eggert@twinsun.com>
15191
15192 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
15193 to gnulib.
15194
151952003-04-21 Yakov Markovitch <Markovitch@iso.ru>
15196
15197 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
15198 Fix obvious typo that results in uncompilable GLR parsers
15199 when both %pure-parser and %locations are used. (trivial change)
15200
152012003-04-17 Paul Eggert <eggert@twinsun.com>
15202
15203 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
15204 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
15205 Do not insert the expected token via unput, as this runs afoul
15206 of a POSIX-compatibility bug in flex 2.5.31.
15207 All uses changed to BEGIN the parent state,
15208 since we no longer insert the expected token via unput.
15209 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
15210 that is no longer emitted after the above change.
15211
15212 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
15213 the first one. This change is from Paul Hilfinger, and it fixes
15214 regression reported by Werner Lemberg in
15215 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
15216
15217 (resolve_sr_conflict): Don't invoke state_errs_set
15218 unless one or more tokens have been explicitly made errors.
15219 Otherwise, the above change causes Bison to abort.
15220
15221 * tests/existing.at (GNU pic Grammar): New test case, taken from
15222 Lemberg's email.
15223
152242003-03-31 Akim Demaille <akim@epita.fr>
15225
15226 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
15227
152282003-03-31 Akim Demaille <akim@epita.fr>
15229
15230 * src/output.c (prepare_symbols): Avoid trailing spaces in the
15231 output.
15232
152332003-03-31 Akim Demaille <akim@epita.fr>
15234
15235 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
15236 From Paul Hilfinger.
15237
152382003-03-29 Akim Demaille <akim@epita.fr>
15239
15240 * m4/error.m4: Do not put under dynamic conditions some code which
15241 expansion is under static control.
15242
152432003-03-29 Akim Demaille <akim@epita.fr>
15244
15245 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
15246
152472003-03-29 Akim Demaille <akim@epita.fr>
15248
15249 * doc/bison.texinfo (Strings are Destroyed): New.
15250
152512003-03-13 Paul Eggert <eggert@twinsun.com>
15252
15253 * .cvsignore: Add configure.lineno.
15254 * src/.cvsignore: Add yacc.
15255 * tests/.cvsignore: Add testsuite.log.
15256 * doc/fdl.texi: Sync with latest FSF version.
15257
152582003-03-12 Paul Eggert <eggert@twinsun.com>
15259
15260 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
15261 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
15262 cursor, instead of leaving it undefined. This fixes a bug
15263 reported by Tim Van Holder in
15264 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
15265 * tests/input.at (Torturing the Scanner): Test the scanner on
15266 an empty input file, which was Tim Van Holder's test case.
15267
15268 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
15269 <sys/resource.h> can be included, include sys/time.h and
15270 sys/times.h first, if available. This works around the SunOS
15271 4.1.4 porting bug reported by Bruce Becker in
15272 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
15273
15274 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
15275 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
15276 AC_HEADER_SYS_WAIT.
15277
15278 Merge changes from gnulib. This was prompted because the CVS
15279 snapshot didn't build on Solaris 7 due to strnlen problems.
15280
15281 These changes need to be merged back into gnulib:
15282 * lib/hash.c: Include <stdbool.h> unconditionally.
15283 * m4/onceonly.m4 (m4_quote): New macro.
15284 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
15285 Quote AC_FOREACH variable-expansions properly.
15286 The 2003-01-03 obstack.h change also needs merging.
15287 {end of changes requiring merging}
15288
15289 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
15290 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
15291 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
15292 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
15293 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
15294 New files, imported from gnulib.
15295 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
15296 above.
15297
15298 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
15299 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
15300 gnulib sources.
15301
15302 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
15303 Add.
15304 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
15305 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
15306 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
15307 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
15308 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
15309 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
15310 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
15311 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
15312 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
15313 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
15314 (jm_PREREQ_ARGMATCH): Remove.
15315 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
15316 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
15317
15318 * src/system.h: Include <stdbool.h> unconditionally.
15319
15320 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
15321 assuming at least C89 in the bitset code for some time now.
15322
153232003-03-03 Akim Demaille <akim@epita.fr>
15324
15325 * ro.po: New.
15326
153272003-03-02 Akim Demaille <akim@epita.fr>
15328
15329 * doc/bison.texinfo (Table of Symbols): Reactivate the
15330 documentation for %lex-param, and %parse-param.
15331
153322003-03-02 Akim Demaille <akim@epita.fr>
15333
15334 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
15335 generate verbose error messages.
15336 Use the number of tokens as an upper bound in yytname, as it
15337 cannot be a non terminal.
15338
153392003-03-02 Akim Demaille <akim@epita.fr>
15340
15341 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
15342 message.
15343
153442003-03-02 Akim Demaille <akim@epita.fr>
15345
15346 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
15347 Use them to exercise yycheck overrun.
15348 Based on Andrew Suffield's grammar.
15349
153502003-03-02 Akim Demaille <akim@epita.fr>
15351
15352 Create tests/local.at for Bison generic testing macros.
15353
15354 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
15355 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
15356 This new file.
15357 * tests/calc.at (AT_CHECK_CALC): Adjust.
15358 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
15359 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
15360 * tests/local.at: here.
15361 (AT_COMPILE_CXX): Tags the tests using it as c++.
15362 Ignore the test if CXX is not functional.
15363
153642003-03-01 Paul Eggert <eggert@twinsun.com>
15365
15366 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
15367 not loc->end, since loc->end might contain garbage and this leads
15368 to undefined behavior on some platforms.
15369 (id_loc, token_start): Use (IF_LINTed) initial values that do not
15370 depend on *loc, so that the reader doesn't give the the false
15371 impression that *loc is initialized.
15372 (<INITIAL>"%%"): Do not bother setting code_start, since its value
15373 does not survive the return.
15374
153752003-03-01 Akim Demaille <akim@epita.fr>
15376
15377 * src/scan-gram.l (code_start): Always initialize it when entering
15378 into yylex, as SC_EPILOGUE is activated *before* the corresponding
15379 yylex invocation. An alternative would be making it static, but
15380 then it starts with the second %%'s beginning, instead of its end.
15381
153822003-02-28 Paul Eggert <eggert@twinsun.com>
15383
15384 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
15385 around a UnixWare 7.1.1 porting bug reported by John Hughes in
15386 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
15387
153882003-02-26 Paul Eggert <eggert@twinsun.com>
15389
15390 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
15391 Remove Sequent/Pyramid discussion (nobody uses them any more).
15392 Merge VMS and MS-DOS discussion; these ports may well be dead
15393 but let's keep mentioning them for now. Put <> around email
15394 addresses. Add copyright notice.
15395
153962003-02-24 Paul Eggert <eggert@twinsun.com>
15397
15398 * data/glr.c (yy_reduce_print): yylineno -> yylno,
15399 to avoid collision with flex use of yylineno.
15400 Problem reported by Bruce Lilly in
15401 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
15402 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
15403 * data/yacc.c (yy_reduce_print): Likewise.
15404
15405 * config/depcomp: Sync with Automake 1.7.3.
15406
154072003-02-21 Akim Demaille <akim@epita.fr>
15408
15409 * data/lalr1.cc: Use temporary variables instead of casts to
15410 change integer types.
15411 Suggested by Paul Eggert.
15412
154132003-02-21 Akim Demaille <akim@epita.fr>
15414
15415 * doc/bison.texinfo: Use "location" consistently to refer to @n,
15416 to avoid confusions with lalr1.cc's notion of Position.
15417 Suggested by Paul Eggert.
15418
154192003-02-20 Akim Demaille <akim@epita.fr>
15420
15421 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
15422 before initial_columns.
15423 (location.hh): Use consistent variable names when defining the
15424 operator<<.
15425 Use "last" so that we subtract from Positions, not from unsigned.
15426
154272003-02-20 Akim Demaille <akim@epita.fr>
15428
15429 * data/lalr1.cc (position.hh): New subfile, including the extended
15430 and Doxygen'ed documentation of class Position.
15431 (location.hh): Use it.
15432 Document a` la Doxygen.
15433 With the help of Benoit Perrot.
15434
154352003-02-20 Akim Demaille <akim@epita.fr>
15436
15437 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
15438 AT_YACC_IF.
15439 Redefine AT_YYERROR_SEES_LOC_IF using it.
15440 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
15441 not defined.
15442 Don't use the location in yy::Parser::error_ and
15443 yy::Parser::print_ when not %locations.
15444 Activate more lalr1.cc tests.
15445
154462003-02-19 Akim Demaille <akim@epita.fr>
15447
15448 * data/lalr1.cc: When displaying a line number, be sure to make it
15449 an int.
15450
154512003-02-19 Akim Demaille <akim@epita.fr>
15452
15453 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
15454 Remove, useless.
15455 (YYABORT, YYACCEPT, YYERROR): New.
15456 * tests/calc.at: Renable the lalr1.cc test.
15457
154582003-02-19 Akim Demaille <akim@epita.fr>
15459
15460 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
15461 error recovery, mixing with/without pops and discarding of the
15462 lookahead.
15463 Exercise YYERROR.
15464 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
15465
154662003-02-17 Paul Eggert <eggert@twinsun.com>
15467
15468 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
15469 * tests/testsuite.at (AT_COMPILE): Use them.
15470 This fixes the testsuite problem reported by Robert Lentz in
15471 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
15472
154732003-02-12 Paul Eggert <eggert@twinsun.com>
15474
15475 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
15476 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
15477 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
15478 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
15479 Check for malloc failure, for consistency with yacc.c.
15480 (yytname_size): Remove, for consistency with yacc.c.
15481
15482 The bug still remains in data/lalr1.cc, as I didn't have time
15483 to fix it there.
15484
154852003-02-06 Akim Demaille <akim@epita.fr>
15486
15487 * configure.ac (GXX): Rename as...
15488 (CXX): this, to keep the original Autoconf semantics.
15489 Require 2.57.
15490 * data/lalr1.cc: Fix b4_copyright invocations.
15491 If YYDEBUG is not defined, don't depend upon name_ being defined.
15492 (location.hh): Include string and iostream.
15493 (Position::filename): New member.
15494 (Position::Position ()): New.
15495 (operator<< (Position)): New.
15496 (operator- (Position, int)): New.
15497 (Location::first, Location::last): Rename as...
15498 (Location::begin, Location::end): these, to mock the conventional
15499 iterator names.
15500 (operator<< (Location)): New.
15501 * tests/atlocal.in (CXX): New.
15502 * tests/testsuite.at (AT_COMPILE_CXX): New.
15503 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
15504 locations in a more synthetic way.
15505 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
15506 lalr1.cc is used.
15507 Adjust the C locations to match those from Emacs: first column is
15508 column 0.
15509 Change all the expected results.
15510 Conform to the GCS: simplify the locations when applicable.
15511 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
15512 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
15513 these CPP macros with the m4 macros new defined by...
15514 (AT_CHECK_PUSHDEFS): this, i.e.:
15515 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
15516 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
15517 New macros.
15518 (AT_CHECK_POPDEFS): Undefine them.
15519 (AT_CHECK_CALC_LALR1_CC): New.
15520 Use it for the first lalr1.cc test.
15521
155222003-02-04 Akim Demaille <akim@epita.fr>
15523
15524 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
15525 Location as is defined.
15526
155272003-02-04 Akim Demaille <akim@epita.fr>
15528
15529 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
15530 name_ being defined.
15531
155322003-02-03 Paul Eggert <eggert@twinsun.com>
15533
15534 * src/gram.h (start_symbol): Remove unused decl.
15535
15536 Use more-consistent naming conventions for local vars.
15537
15538 * src/derives.c (derives_compute): Change type of local var from
15539 int to rule_number.
15540 * src/gram.c (grammar_rules_partial_print): Likewise.
15541 * src/print.c (print_core): Likewise.
15542 * src/reduce.c (reduce_grammar_tables): Likewise.
15543
15544 * src/gram.c (grammar_dump): Change name of item_number *
15545 local var from r to rp.
15546 * src/nullable.c (nullable_compute): Likewise.
15547
15548 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
15549
15550 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
15551 for symbol or symbol_number var.
15552 * src/reader.c (grammar_start_symbol_set): Likewise.
15553 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
15554 Likewise.
15555 * src/state.c (transitions_to): Likewise.
15556 * src/state.h: Likewise.
15557 * src/tables.c (symbol_number_to_vector_number): Likewise.
15558
15559 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
15560 char * var.
15561
15562 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
15563 var.
15564
15565 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
15566 var.
15567
15568 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
15569 Use str, not s, for char * var. Use ch, not c, for character var.
15570 Use size for size var.
15571
15572 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
15573 char * var.
15574 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
15575 uniqstr var.
15576 * src/uniqstr.h: Likewise.
15577
15578 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
15579 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
15580 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
15581 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
15582 param to have same name as that of enum, so that we don't use
15583 "s" to stand for a non-state.
15584
155852003-02-02 Akim Demaille <akim@epita.fr>
15586
15587 * src/scan-skel.l: Scan more than one inert character per yylex
15588 invocation.
15589
155902003-02-01 Paul Eggert <eggert@twinsun.com>
15591
15592 Version 1.875a.
15593
15594 * po/LINGUAS: Add ms.
15595
155962003-01-30 Akim Demaille <akim@epita.fr>
15597
15598 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
15599
156002003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15601
15602 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
15603 of $1.
15604
15605 Changes in response to error report by S. Eken: GLR mode does not
15606 handle negative $ indices or $ indices in embedded rules correctly.
15607 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
15608
15609 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
15610 (b4_rhs_location): Ditto.
15611 (yyfill): New function to copy from stack tree into array
15612 incrementally.
15613 (yyuserAction): Modify to allow incremental move of semantic values
15614 to rhs array when in GLR mode.
15615 Define YYFILL to use in user-defined actions to fill semantic array
15616 as needed.
15617 Remove dummy use of yystack, as there is now a guaranteed use.
15618 (yydoAction): Modify to allow incremental move of semantic values
15619 to rhs array when in GLR mode.
15620 (yyresolveAction): Ditto.
15621 (yyglrShiftDefer): Update comment.
15622 (yyresolveStates): Use X == NULL for pointers, not !X.
15623 (yyglrReduce): Ditto.
15624 (yydoAction): Ditto
15625
15626 * tests/glr-regr1.at: Rename to ...
15627 * tests/glr-regression.at: Add new regression test for the problems
15628 described above (adapted from S. Eken).
15629 Update copyright notice.
15630 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
15631 * tests/Makefile.am: Ditto.
15632
156332003-01-28 Paul Eggert <eggert@twinsun.com>
15634
15635 * data/lalr1.cc: Do not use @output_header_name@ unless
15636 b4_defines_flag is set. This fixes two bugs reported by
15637 Tim Van Holder in
15638 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
15639 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
15640
156412003-01-21 Paul Eggert <eggert@twinsun.com>
15642
15643 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
15644 we don't need to worry about yyerrlab1 being reported as an
15645 "unused label" by non-GCC C compilers. The downside is that if
15646 locations are used then a couple of statements are duplicated each
15647 time YYERROR is invoked, but the upside is that the warnings
15648 should vanish.
15649 (yyerrlab1): Move code to YERROR.
15650 (yyerrlab2): Remove. Change uses back to yyerrlab1.
15651 This reverts some of the 2002-12-27 change.
15652
156532003-01-17 Paul Eggert <eggert@twinsun.com>
15654
15655 * src/output.c (symbol_printers_output): Fix typo that led
15656 to core dump. Problem reported by Antonio Rus in
15657 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
15658
156592003-01-13 Akim Demaille <akim@epita.fr>,
15660 Quoc Peyrot <chojin@lrde.epita.fr>,
15661 Robert Anisko <anisko_r@lrde.epita.fr>
15662
15663 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
15664 when the stacks contain one element, as the loop would otherwise
15665 free the last state, and then use the top state (the one we just
15666 popped). This means that the initial elements will not be freed
15667 explicitly, as is the case in yacc.c; it is not a problem, as
15668 these elements have fake values.
15669
156702003-01-11 Paul Eggert <eggert@twinsun.com>
15671
15672 * NEWS: %expect-violations are now just warnings, reverting
15673 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
15674 bootstrapping problem reported by Matthias Klose; see
15675 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
15676 * src/conflicts.c (conflicts_print): Likewise.
15677 * tests/conflicts.at (%expect not enough, %expect too much,
15678 %expect with reduce conflicts): Likewise.
15679 * doc/bison.texinfo (Expect Decl): Document this. Also mention
15680 that the warning is enabled if the number of conflicts changes
15681 (not necessarily increases).
15682
15683 * src/getargs.c (version): Update copyright year.
15684
156852003-01-09 Akim Demaille <akim@epita.fr>
15686
15687 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
15688
156892003-01-08 Paul Eggert <eggert@twinsun.com>
15690
15691 * Makefile.maint (WGETFLAGS):
15692 New macro, containing "-C off" to disable proxy caches.
15693 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
15694 (rel-check): Use $(WGET) instead of wget.
15695
156962003-01-06 Paul Eggert <eggert@twinsun.com>
15697
15698 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
15699 the GLR paper of Scott, Johnstone and Hussain.
15700
157012003-01-04 Paul Eggert <eggert@twinsun.com>
15702
15703 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
15704 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
15705 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
15706 (EXTRA_LIBRARIES): New var, for liby.a.
15707 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
15708 (EXTRA_SCRIPTS): New var, for yacc.
15709
15710 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
15711 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
15712 Problem reported by Nelson H. F. Beebe.
15713
157142003-01-03 Paul Eggert <eggert@twinsun.com>
15715
15716 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
15717 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
15718 when compiling Bison 1.875's `bitset bset = obstack_alloc
15719 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
15720
15721 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
15722 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
15723 grow to a huge size with typical invocation.
15724
15725 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
15726 Use the pattern recommended by Autoconf 2.57, except also protect
15727 against double-definition.
15728 * src/system.h: Likewise.
15729 Portability issues reported by Nelson H. F. Beebe.
15730
15731 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
15732 All uses changed. Provide a definition in both C and C++.
15733 (yytrue, yyfalse): Define even if defined (__cplusplus).
15734
15735 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
15736 Reported by Nelson H. F. Beebe.
15737
15738 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
15739
157402003-01-02 Paul Eggert <eggert@twinsun.com>
15741
15742 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
15743 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
15744 Bug reported by Nelson H. F. Beebe.
15745
157462003-01-01 Paul Eggert <eggert@twinsun.com>
15747
15748 * Version 1.875.
15749
157502002-12-30 Paul Eggert <eggert@twinsun.com>
15751
15752 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
15753 Moved here from...
15754 (<INITIAL>","): Here. This causes stray "," to be treated
15755 more uniformly.
15756
15757 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
15758 last brace in braced code when not in Yacc mode, for compatibility
15759 with Bison 1.35. This resurrects the 2001-12-15 patch to
15760 src/reader.c.
15761
15762 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
15763 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
15764
157652002-12-28 Paul Eggert <eggert@twinsun.com>
15766
15767 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
15768 that of SYM's type. This fixes Debian bug 168069, reported by
15769 Thomas Olsson.
15770
157712002-12-28 Paul Eggert <eggert@twinsun.com>
15772
15773 Version 1.75f.
15774
15775 Switch back to the Yacc style of conflict reports, undoing some
15776 of the 2002-07-30 change.
15777 * doc/bison.texinfo (Understanding): Use Yacc style for
15778 conflict reports. Also, use new way of locating rules.
15779 * src/conflicts.c (conflict_report):
15780 Renamed from conflict_report_yacc, removing the old
15781 'conflict_report'. Translate the entire conflict report at once,
15782 so that we don't assume that "," has the same interpretation in
15783 all languages.
15784 (conflicts_output): Use Yacc-style conflict report for each state,
15785 instead of our more-complicated style.
15786 (conflicts_print): Use Yacc-style conflict report, except print
15787 the input file name when not emulating Yacc.
15788 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
15789 Conflicted Reduction, %expect not enough, %expect too much,
15790 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
15791 * tests/existing.at (GNU Cim Grammar): Likewise.
15792 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
15793
15794 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
15795 fatal): Don't invoke fflush; it's not needed and it might even be
15796 harmful for stdout, as stdout might not be open.
15797 * src/reduce.c (reduce_print): Likewise.
15798
157992002-12-27 Paul Eggert <eggert@twinsun.com>
15800
15801 Fix a bug where error locations were not being recorded correctly.
15802 This problem was originally reported by Paul Hilfinger in
15803 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
15804
15805 * data/yacc.c (yyparse): New local var yylerrsp, to record the
15806 top of the location stack's error locations.
15807 (yyerrlab): Set it. When discarding a token, push its location
15808 onto yylerrsp so that we don't lose track of the error's end.
15809 (yyerrlab1): Now is only the target of YYERROR, so that we can
15810 properly record the location of the action that failed. For GCC
15811 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
15812 GCC warning about yyerrlab1 being unused if YYERROR is unused.
15813 (yyerrlab2): New label, which yyerrlab now falls through to.
15814 Compute the error's location by applying YYLLOC_DEFAULT to
15815 the locations of all the symbols that went into the error.
15816 * doc/bison.texinfo (Location Default Action): Mention that
15817 YYLLOC_DEFAULT is also invoked for syntax errors.
15818 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
15819 Error locations include the locations of all the tokens that were
15820 discarded, not just the last token.
15821
158222002-12-26 Paul Eggert <eggert@twinsun.com>
15823
15824 * src/files.c: Include quote.h.
15825 (compute_output_file_names): Warn if we detect conflicting
15826 outputs to the same file. This should catch the misunderstanding
15827 exemplified by Debian Bug 165349, reported by Bruce Stephens..
15828
15829 * src/conflicts.c (conflicts_print): If the user specifies
15830 "%expect N", report an error if there are any reduce/reduce
15831 conflicts. This is what the manual says should happen.
15832 This fixes Debian bug 130890, reported by Anthony DeRobertis.
15833 * tests/conflicts.at (%expect with reduce conflicts): New test.
15834
15835 Don't use m4_include on relative file names, as it doesn't work as
15836 desired if there happens to be a file with that name under ".".
15837
15838 * m4sugar/version.m4: Remove; it was included but it wasn't used.
15839 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
15840 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
15841 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
15842 * src/output.c (output_skeleton): Use full path names when
15843 specifying a file to include; don't rely on include path, as
15844 it's unreliable when the working file contains a file with
15845 that name.
15846
158472002-12-25 Paul Eggert <eggert@twinsun.com>
15848
15849 Remove obsolete references to bison.simple and bison.hairy.
15850 Problem mentioned by Aubin Mahe in
15851 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
15852 * data/glr.c: Comment fix.
15853 * doc/bison.1: Remove references. Also, mention "yacc".
15854
15855 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
15856 with -g option.
15857
15858 * src/parse-gram.y (declaration): Use enum "report_states" rather
15859 than its numeric value 1.
15860
15861 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
15862 opening a new one. This fixes Debian bug 165349, reported by
15863 Bruce Stephens.
15864
158652002-12-24 Paul Eggert <eggert@twinsun.com>
15866
15867 Version 1.75e.
15868
15869 * Makefile.maint (cvs-update): Don't assume that the shell
15870 supports $(...), as Solaris sh doesn't.
15871
15872 * src/parse-gram.y (lloc_default): Remove test for empty
15873 nonterminals at the end, since it didn't change the result.
15874
158752002-12-24 Paul Eggert <eggert@twinsun.com>
15876
15877 If the user does not define YYSTYPE as a macro, Bison now declares it
15878 using typedef instead of defining it as a macro. POSIX requires this.
15879 For consistency, YYLTYPE is also declared instead of defined.
15880
15881 %union directives can now have a tag before the `{', e.g., the
15882 directive `%union foo {...}' now generates the C code
15883 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
15884 The default union tag is `YYSTYPE', for compatibility with Solaris 9
15885 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
15886 instead of `yyltype'.
15887
15888 `yystype' and `yyltype' are now obsolescent macros instead of being
15889 typedefs or tags; they are no longer documented and will be
15890 withdrawn in a future release.
15891
15892 * data/glr.c (b4_location_type): Remove.
15893 (YYSTYPE): Renamed from yystype.
15894 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
15895 (struct YYLTYPE): Renamed from struct yyltype.
15896 (YYLTYPE): Renamed from yyltype.
15897 (yyltype, yystype): New (and obsolescent) macros,
15898 for backward compatibility.
15899 * data/yacc.c: Likewise.
15900
15901 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
15902 does not specify a union tag. This is for compatibility with
15903 Solaris 9 yacc.
15904
15905 * src/parse-gram.y (add_param): 2nd arg is now char * not char
15906 const *, since it is now modified by stripping surrounding { }.
15907 (current_braced_code): Remove.
15908 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
15909 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
15910 trailing " {...}". Now of type <chars>.
15911 (grammar_declaration): Adjust to bundled tokens.
15912 (code_content): Remove; stripping is now done by add_param.
15913 (print_token_value): Print contents of bundled tokens.
15914 (token_name): New function.
15915
15916 * src/reader.h (braced_code, current_braced_code): Remove.
15917 (token_name): New decl.
15918
15919 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
15920 token_type, not braced_code code_kind. All uses changed.
15921 (SC_PRE_CODE): New state, for scanning after a keyword that
15922 has (or usually has) an immediately-following braced code.
15923 (token_type): New local var, to keep track of which token type
15924 to return when scanning braced code.
15925 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
15926 <INITIAL>"%parse-param", <INITIAL>"%printer",
15927 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
15928 instead of returning a token type immediately.
15929 (<INITIAL>"{"): Set token type.
15930 (<SC_BRACED_CODE>"}"): Use it.
15931 (handle_action_dollar, handle_action_at): Now returns bool
15932 indicating success. Fail if ! current_rule; this prevents a core dump.
15933 (handle_symbol_code_dollar, handle_symbol_code_at):
15934 Remove; merge body into caller.
15935 (handle_dollar, handle_at): Complain in invalid contexts.
15936
15937 * NEWS, doc/bison.texinfo: Document the above.
15938 * NEWS: Fix years and program names in copyright notice.
15939
159402002-12-17 Paul Eggert <eggert@twinsun.com>
15941
15942 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
15943 Reporting, Table of Symbols): Omit mentions of %lex-param and
15944 %parse-param from the documentation for now.
15945
159462002-12-15 Paul Eggert <eggert@twinsun.com>
15947
15948 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
15949 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
15950 lookahead symbol, and which sets yychar in parser actions) and it
15951 disagreed with the Bison documentation. Bug
15952 reported by Andrew Walrond.
15953
15954 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
15955 as the caller now does that.
15956 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
15957 (YYEMPTY): Parenthesize right hand side, since others use it.
15958 (yyparse): Don't assume that our generated code is the only code
15959 that sets yychar.
15960
159612002-12-13 Paul Eggert <eggert@twinsun.com>
15962
15963 Version 1.75d.
15964
15965 POSIX requires a "yacc" command.
15966 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
15967 (MOSTLYCLEANFILES): Add yacc.
15968 (yacc): New rule.
15969 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
15970 as an alias for bison y.
15971
15972 * po/LINGUAS: Add da.
15973
15974 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
15975 problem with latest <getopt.h>.
15976 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
15977
15978 * doc/fdl.texi: Upgrade to 1.2.
15979 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
15980 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
15981 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
15982 gnulib.
15983 * config/install-sh: Sync with autotools.
15984
15985 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
15986 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
15987 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
15988 locations are requested.
15989 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
15990 locations are requested.
15991
159922002-12-12 Paul Eggert <eggert@twinsun.com>
15993
15994 Remove unportable casts and storage allocation tricks.
15995 While we're at it, remove almost all casts, since they
15996 usually aren't needed and are a sign of trouble.
15997
15998 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
15999
16000 * src/derives.c (derives_compute): Do not subtract NTOKENS from
16001 the pointer DSET returned by malloc; this isn't portable.
16002 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
16003 Similarly for DERIVES.
16004 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
16005 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
16006 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
16007
16008 * src/derives.c (derives_compute): Do not bother invoking
16009 int_of_rule_number, since rule numbers are integers.
16010
16011 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
16012 rather than XMALLOC (char, N).
16013
16014 * src/files.c (filename_split): Rewrite to avoid cast.
16015
16016 * src/gram.h (symbol_number_as_item_number,
16017 item_number_as_symbol_number, rule_number_as_item_number,
16018 item_number_as_rule_number):
16019 Now inline functions rather than macros, to avoid casts.
16020 * src/state.h (state_number_as_int): Likewise.
16021 * src/tables.c (state_number_to_vector_number,
16022 symbol_number_to_vector_number): Likewise.
16023
16024 * src/gram.h (int_of_rule_number): Remove; no longer used.
16025
16026 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
16027 since the resulting storage is always stored into.
16028
16029 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
16030 where it's needed.
16031
16032 * src/muscle_tab.c (muscle_m4_output):
16033 Now inline. Return bool, not int.
16034 * src/state.c (state_compare): Likewise.
16035 * src/symtab.c (symbol_check_defined,
16036 symbol_check_alias_consistency, symbol_pack, symbol_translation,
16037 hash_compare_symbol, hash_symbol):
16038 Likewise.
16039 * src/uniqstr.c (uniqstr_print): Likewise.
16040 * src/muscle_tab.c (muscle_m4_output_processor):
16041 New function, to avoid casts.
16042 * src/state.c (state_comparator, stage_hasher): Likewise.
16043 * src/symtab.c (symbol_check_defined_processor,
16044 symbol_check_alias_consistency_processor, symbol_pack_processor,
16045 symbol_translation_processor, hash_symbol_comparator,
16046 hash_symbol_hasher): Likewise.
16047 * src/uniqstr.c (uniqstr_print_processor): Likewise.
16048 * src/muscle_tab.c (muscles_m4_output):
16049 Use new functions instead of casting old functions unportably.
16050 * src/state.c (state_hash_new): Likewise.
16051 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
16052 symbols_token_translations_init):
16053 Likewise.
16054 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
16055
16056 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
16057 var instead of casting to long, to avoid casts.
16058 (prepare_states): Use MALLOC rather than alloca, so that we don't
16059 have to worry about alloca.
16060 * src/state.c (state_hash_lookup): Likewise.
16061
16062 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
16063 local var instead of casting to unsigned char, to avoid casts.
16064
16065 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
16066 STATE_ALLOC): Remove.
16067 (transitions_new, errs_new, reductions_new, state_new): Use malloc
16068 rather than calloc, and use offsetof to avoid allocating slightly
16069 too much storage.
16070 (state_new): Initialize all members.
16071
16072 * src/state.c (state_hash): Use unsigned accumulator, not signed.
16073
16074 * src/symtab.c (symbol_free): Remove; unused.
16075 (symbol_get): Remove cast in lhs of assignment.
16076 (symbols_do): Now static. Accept generic arguments, not
16077 hashing-related ones.
16078
16079 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
16080 (symbol_processor): Remove.
16081 (symbols_do): Remove decl; now static.
16082
16083 * src/system.h (alloca): Remove; decl no longer needed.
16084 (<stddef.h>): Include, for offsetof.
16085 (<inttypes.>, <stdint.h>): Include if available.
16086 (uintptr_t): New type, if system lacks it.
16087 (CALLOC, MALLOC, REALLOC): New macros.
16088 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
16089 new macros.
16090
16091 * src/tables.c (table_size): Now int, to pacify GCC.
16092 (table_grow, table_ninf_remap): Use signed table size.
16093 (save_row): Don't bother initializing locals when not needed.
16094 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
16095 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
16096
16097 * src/vcg.h: Correct misspellings.
16098
16099 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
16100
16101
16102 * src/getargs.c (getargs): Don't assume EOF == -1.
16103
161042002-12-09 Paul Eggert <eggert@twinsun.com>
16105
16106 Change identifier spellings to avoid collisions with names
16107 that are reserved by POSIX.
16108
16109 Don't use names ending in _t, since POSIX reserves them.
16110 For consistency, remove _e and _s endings -- they're weren't
16111 needed to remove ambiguity. All uses changed.
16112 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
16113 turn was just renamed from struniq_t.
16114 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
16115 which in turn was just renamed from struniq_processor_t.
16116 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
16117 in turn was renamed from hash_compare_struniq_t.
16118 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
16119 (state_list): Renamed from state_list_t.
16120 * src/assoc.h (assoc): Renamed from assoc_t.
16121 * src/conflicts.c (enum conflict_resolution): Renamed from
16122 enum conflict_resolution_e.
16123 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
16124 (rule_list): Renamed from rule_list_t.
16125 * src/getargs.h (enum trace): Renamed from enum trace_e.
16126 (enum report): Renamed from enum report_e.
16127 * src/gram.h (item_number): Renamed from item_number_t.
16128 (rule_number): Renamed from rule_number_t.
16129 (struct rule_s): Remove the "rule_s" part; not used.
16130 (rule): Renamed from rule_t.
16131 (rule_filter): Renamed from rule_filter_t.
16132 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
16133 (goto_list): Renamed from goto_list_t.
16134 * src/lalr.h (goto_number): Renamed from goto_number_t.
16135 * src/location.h (location): Renamed from location_t.
16136 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
16137 and moved here from:
16138 * src/muscle_tab.h (muscle_entry_t): here.
16139 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
16140 (rule_list): Renamed from rule_list_t.
16141 * src/print_graph.c (static_graph): Renamed from graph.
16142 * src/reader.h (braced_code): Renamed from braced_code_t.
16143 Remove brace_code_e tag.
16144 * src/relation.h (relation_node): Renamed from relation_node_t.
16145 (relation_nodes): Renamed from relation_nodes_t.
16146 (relation): Renamed from relation_t.
16147 * src/state.h (state_number): Renamed from state_number_t.
16148 (struct state): Renamed from struct state_s.
16149 (state): Renamed from state_t.
16150 (transitions): Renamed from transitions_t. Unused (and
16151 misspelled) transtion_s tag removed.
16152 (errs): Renamed from errs_t. Unused errs_s tag removed.
16153 (reductions): Renamed from reductions_t. Unused tag
16154 reductions_s removed.
16155 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
16156 (struct symbol_list): Renamed from struct symbol_list_s.
16157 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
16158 (struct symbol): Renamed from struct symbol_s.
16159 (symbol): Renamed from symbol_t.
16160 * src/tables.c (vector_number): Renamed from vector_number_t.
16161 (action_number): Renamed from action_t.
16162 * src/tables.h (base_number): Renamed from base_t.
16163 * src/vcg.h (enum color): Renamed from enum color_e.
16164 (enum textmode): Renamed from enum textmode_e.
16165 (enum shape): Renamed from enum shape_e.
16166 (struct colorentry): Renamed from struct colorentry_s.
16167 (struct classname): Renamed from struct classname_s.
16168 (struct infoname): Renamed from struct infoname_s.
16169 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
16170 (enum decision): Renamed from enum decision_e.
16171 (enum orientation): Renamed from enum orientation_e.
16172 (enum alignment): Renamed from enum alignment_e.
16173 (enum arrow_mode): Renamed from enum arrow_mode_e.
16174 (enum crossing_type): Renamed from enum crossing_type_e.
16175 (enum view): Renamed from enum view_e.
16176 (struct node): Renamed from struct node_s.
16177 (node): Renamed from node_t.
16178 (enum linestyle): Renamed from enum linestyle_e.
16179 (enum arrowstyle): Renamed from enum arrowstyle_e.
16180 (struct edge): Renamed from struct edge.
16181 (edge): Renamed from edge_t.
16182 (struct graph): Renamed from struct graph_s.
16183 (graph): Renamed from graph_t.
16184 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
16185 Rename value_t -> value.
16186 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
16187 value_t_as_yystype -> value_as_yystype.
16188
16189 Don't include <errno.h> in the mainstream code, since it
16190 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
16191 * lib/get-errno.c, lib/get-errno.h: New files.
16192 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
16193 get-errno.c.
16194 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
16195 * src/output.c (output_skeleton): Likewise.
16196 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
16197 instead of errno.
16198 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
16199 Likewise.
16200 (handle_action_dollar, handle_action_at): Likewise.
16201 * src/system.h: Do not include <errno.h>.
16202 (TAB_EXT): Renamed from EXT_TAB.
16203 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
16204
16205 Avoid str[a-z]*, since <string.h> reserves that name space.
16206 Change all instances of "struniq" in names to "uniqstr", and
16207 likewise for "STRUNIQ" and "UNIQSTR".
16208 * src/uniqstr.c: Renamed from src/struniq.c.
16209 * src/uniqstr.h: Renamed from src/struniq.h.
16210 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
16211 * src/files.c (strsuffix): Remove; unused.
16212 (concat2): Renamed from stringappend. Now static.
16213 * src/files.h (strsuffix, stringappend): Remove; unused.
16214 * src/parse-gram.y (<chars>): Renamed from <string>.
16215 (<uniqstr>): Renamed from <struniq>.
16216 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
16217 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
16218 (struct graph_s.expand): Renamed from struct graph_s.stretch.
16219 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
16220 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
16221 (N_EXPAND): Renamed from N_STRETCH.
16222
16223 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
16224 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
16225 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
16226 Remove; unused.
16227 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
16228 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
16229 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
16230 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
16231 (BASE_MAXIMUM): Renamed from BASE_MAX.
16232 (BASE_MINIMUM): Renamed from BASE_MIN.
16233 (ACTION_MAX): Remove; unused.
16234 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
16235 Unnecessary casts removed from above defines.
16236
16237
16238 Fix misspelling in names.
16239 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
16240 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
16241 G_NODE_ALIGNEMENT.
16242
16243
16244 * lib/timevar.c (timevar_report): Renamed from time_report,
16245 for consistency with other names.
16246 * lib/timevar.h (timevar_report): New decl.
16247 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
16248
16249
16250 Sort include-file uses.
16251
16252 Reorder all include files under src to be in the order "system.h".
16253 then the ../lib include files in angle brackets (alphabetized),
16254 then the . include files in double-quotes (alphabetized). Fix
16255 dependency breakages encountered in this process, as follows:
16256 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
16257 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
16258 * src/state.h: Include "symtab.h".
16259
162602002-12-08 Paul Eggert <eggert@twinsun.com>
16261
16262 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
16263 since this causes problems when __file__ contains character
16264 sequences like "@" that are treated specially by src/scan-skel.l.
16265 Instead, just use the file's basename. This fixes the bug
16266 reported by Martin Mokrejs in
16267 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
16268
162692002-12-06 Paul Eggert <eggert@twinsun.com>
16270
16271 Add support for rules that do not have trailing semicolons, as
16272 POSIX requires. Improve the quality of locations in Bison
16273 diagnostics.
16274
16275 * src/location.c: Include <quotearg.h>.
16276 (empty_location): Now const.
16277 (location_print): New function. Follow the recommendation of the
16278 GNU Coding Standards for locations that span file boundaries.
16279 * src/location.h: Do not include <quotearg.h>; no longer needed.
16280 (boundary): New type.
16281 (location_t): Use it. This allows locations to span file boundaries.
16282 All member uses changed: file -> start.file or end.file (as needed),
16283 first_line -> start.line, first_column -> start.column,
16284 last_line -> end.line, last_column -> end.column.
16285 (equal_boundaries): New function.
16286 (LOCATION_RESET, LOCATION_STEP): Remove.
16287 (LOCATION_PRINT): Remove. All callers changed to use location_print.
16288 (empty_location): Now const.
16289 (location_print): New decl.
16290 * src/parse-gram.y (lloc_default): New function, which handles
16291 empty locations more accurately.
16292 (YYLLOC_DEFAULT): Use it.
16293 (%token COLON): Remove.
16294 (%token ID_COLON): New token.
16295 (rules): Use it.
16296 (declarations, rules): Remove trailing semicolon.
16297 (declaration, rules_or_grammar_declaration):
16298 Allow empty (";") declaration.
16299 (symbol_def): Remove empty actions; no longer needed.
16300 (rules_or_grammar_declaration): Remove trailing semicolon.
16301 (semi_colon.opt): Remove.
16302 * src/reader.h: Include location.h.
16303 (scanner_cursor): New decl.
16304 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
16305 rolling our own.
16306 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
16307 of *loc.
16308 (STEP): Remove. No longer needed, now that adjust_location does
16309 the work. All uses removed.
16310 (scanner_cursor): New var.
16311 (adjust_location): Renamed from extend_location. It now sets
16312 *loc and adjusts the scanner cursor. All uses changed.
16313 Don't bother testing for CR.
16314 (handle_syncline): Remove location arg; now updates scanner cursor.
16315 All callers changed.
16316 (unexpected_end_of_file): Now accepts start boundary of token or
16317 comment, not location. All callers changed. Update scanner cursor,
16318 not the location.
16319 (SC_AFTER_IDENTIFIER): New state.
16320 (context_state): Renamed from c_context. All uses changed.
16321 (id_loc, code_start, token_start): New local vars.
16322 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
16323 processing of Yacc white space and equivalents here.
16324 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
16325 instead of returning ID immediately, since we need to search for
16326 a subsequent colon.
16327 (<INITIAL>"'", "\""): Save token_start.
16328 (<INITIAL>"%{", "{", "%%"): Save code_start.
16329 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
16330 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
16331 BEGIN context_state at end, not INITIAL.
16332 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
16333 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
16334 Return correct token start.
16335 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
16336 the start of a character, string or multiline comment is found.
16337 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
16338 Reduction): Adjust reported locations to match the more-precise
16339 results now expected.
16340 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
16341 * tests/reduce.at (Useless Rules, Reduced Automaton,
16342 Underivable Rules): Likewise.
16343 * tests/regression.at (Invalid inputs): No longer `expecting ";"
16344 or "|"' now that so many other tokens are allowed by the new grammar.
16345
16346 * src/complain.h (current_file): Remove duplicate decl;
16347 current_file is now owned by files.h.
16348 * src/complain.c, src/scan-gram.l: Include files.h.
16349
163502002-12-06 Paul Eggert <eggert@twinsun.com>
16351
16352 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
16353 promotes to int; it might be unsigned int.
16354 * data/yacc.c (yy_reduce_print): Likewise.
16355
16356 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
16357 be #defined in the prologue, not in the Bison declarations.
16358 This fixes Debian Bug 102878, reported by Shaul Karl.
16359
163602002-12-02 Paul Eggert <eggert@twinsun.com>
16361
16362 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
16363 * lib/strtoul.c: New file, from gnulib.
16364 This fixes a porting bug reported by Peter Klein in
16365 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
16366
163672002-11-30 Paul Eggert <eggert@twinsun.com>
16368
16369 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
16370 and put only a forward declaration in the prologue. This is for
16371 consistency with the other scanner helper functions.
16372
16373 Type clashes now generate warnings, not errors, since it
16374 appears that POSIX may allow some grammars with type clashes.
16375 * src/reader.c (grammar_current_rule_check): Warn about
16376 type clashes instead of complaining.
16377 * tests/input.at (Type Clashes): Expect warnings, not complaints.
16378
16379 Add Yacc library, since POSIX requires it.
16380 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
16381 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
16382 * lib/main.c, lib/yyerror.c: New files.
16383
16384 gram_error can be static; it need not be extern.
16385 * src/reader.h (gram_error): Remove decl.
16386 * src/parse-gram.y (gram_error): Now static. Add static decl.
16387 (print_token_value): Omit parameter names from forward decl,
16388 for consistency.
16389
163902002-11-29 Paul Eggert <eggert@twinsun.com>
16391
16392 * doc/bison.texinfo: Emphasize that yylex and yyerror must
16393 be declared before being used. E.g., one should typically
16394 declare them in the prologue. Use GNU coding style in examples.
16395 Put "const" consistently after the type it modifies. Mention
16396 that C99 supports "inline". Mention that yyerror traditionally
16397 returns "int".
16398
16399 %parse-param and %lex-param now take just one argument, the
16400 declaration; the argument name is deduced from the declaration.
16401
16402 * doc/bison.texinfo (Parser Function, Pure Calling, Error
16403 Reporting, Table of Symbols): Document this.
16404 * src/parse-gram.y (add_param): New function.
16405 (COMMA): Remove.
16406 (declaration): Implement new rule for %parse-param and %lex-param.
16407 * src/scan-gram.l: "," now elicits a warning, rather than being
16408 a token; this is more compatible with byacc.
16409 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
16410
164112002-11-27 Paul Eggert <eggert@twinsun.com>
16412
16413 Rename identifiers to avoid real and potential collisions.
16414
16415 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
16416 to avoid collision with lex macro described by Bruce Lilly in
16417 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
16418 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
16419 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
16420 * src/parse-gram.y (print_token_value): Renamed from yyprint.
16421 All uses changed.
16422 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
16423 The name "yycontrol" violates the name space rules, and this stuff
16424 wasn't being used anyway.
16425 (input): Remove action; this stuff wasn't being used.
16426 (gram_error): Rename local variable yylloc -> loc.
16427 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
16428 (YY_DECL): Don't use "yy" at start of local variables.
16429 All uses changed, e.g., yylloc -> loc.
16430 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
16431 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
16432 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
16433 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
16434
16435 * src/parse-gram.y (gram_error): loc is now const *.
16436 * src/reader.h (gram_error): Likewise.
16437
164382002-11-24 Paul Eggert <eggert@twinsun.com>
16439
16440 Version 1.75c.
16441
16442 * tests/actions.at (Actions after errors): Use an output format
16443 more similar to that of the Printers and Destructors test.
16444 Test the position of the ';' token too.
16445 (Printers and Destructors): Likewise.
16446 (Printers and Destructors: %glr-parser): Remove for now, to avoid
16447 unnecessarily alarming people when the test fails.
16448
16449 * data/yacc.c (yyerrlab1): Move this label down, so that the
16450 parser does not discard the lookahead token if the user code
16451 invokes YYERROR. This change is required for POSIX conformance.
16452
16453 * lib/error.c: Sync with gnulib.
16454
164552002-11-22 Paul Eggert <eggert@twinsun.com>
16456
16457 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
16458 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
16459 * lib/xmalloc.c: Likewise.
16460
164612002-11-20 Paul Eggert <eggert@twinsun.com>
16462
16463 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
16464
164652002-11-20 Paul Eggert <eggert@twinsun.com>
16466
16467 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
16468 should use `if (! x) abort ();' rather than `assert (x);', and
16469 anyway it's one less thing to worry about configuring.
16470
16471 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
16472 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
16473 and replace all instances of assert with abort.
16474 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
16475 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
16476
16477 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
16478 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
16479 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
16480 hash_find_entry, hash_rehash, hash_insert): Likewise.
16481 * src/conflicts.c (resolve_sr_conflict): Likewise.
16482 * src/lalr.c (set_goto_map, map_goto): Likewise.
16483 * src/nullable.c (nullable_compute): Likewise.
16484 * src/output.c (prepare_rules, token_definitions_output): Likewise.
16485 * src/reader.c (packgram, reader): Likewise.
16486 * src/state.c (state_new, state_free, state_transitions_set,
16487 state_reduction_find): Likewise.
16488 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
16489 symbol_pack): Likewise.
16490 * src/tables.c (conflict_row, pack_vector): Likewise.
16491 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
16492 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
16493 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
16494 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
16495
16496 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
16497 (ARGMATCH_CONSTRAINT): New macro.
16498 (ARGMATCH_ASSERT): Use it.
16499
16500 * src/system.h (verify): New macro.
16501 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
16502 rather than assert.
16503 * src/tables.c (tables_generate): Likewise.
16504
16505 * src/struniq.c (struniq_assert): Now returns void, and aborts
16506 if the assertion is false.
16507 (struniq_assert_p): Remove.
16508 * src/struniq.h: Likewise.
16509
165102002-11-18 Paul Eggert <eggert@twinsun.com>
16511
16512 * data/glr.c (yygetLRActions): Replace `yyindex' with
16513 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
16514 This fixes the regression with Sun ONE Studio 7 cc that I reported in
16515 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
16516
165172002-11-18 Akim Demaille <akim@epita.fr>
16518
16519 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
16520 space.
16521 From Tim Van Holder.
16522
165232002-11-17 Paul Eggert <eggert@twinsun.com>
16524
16525 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
16526 to "SyntaxError" for consistency with my 2002-11-15 change.
16527
16528 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
16529 not define to {}, since this breaks the common use of `YYDPRINTF
16530 ((...));' if a single statement is desired (e.g. before `else').
16531 Work around GCC warnings by surrounding corresponding calls with
16532 {} if needed.
16533 (yyhasResolvedValue): Remove unused function.
16534 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
16535 loop body.
16536 (yyreportSyntaxError): Renamed from yyreportParseError.
16537 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
16538 All uses changed.
16539 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
16540 extern when possible. Remove unused initializations.
16541
165422002-11-16 Akim Demaille <akim@epita.fr>
16543
16544 Augment the similarity between GLR and LALR traces.
16545
16546 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
16547 (YY_REDUCE_PRINT): New.
16548 (yyparse): Use them.
16549 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
16550 YYDPRINT here.
16551 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
16552 state reached after the reduction/recovery, since...
16553 (yyparse, yyprocessOneStack): Report the state we are entering in.
16554
165552002-11-16 Akim Demaille <akim@epita.fr>
16556
16557 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
16558 Add support for --trace=skeleton.
16559 * src/scan-skel.l: %option debug.
16560 Scan strings of non-@ or \n instead of character by character.
16561 (scan_skel): Handle trace_skeleton.
16562 (QPUTS): New.
16563 (@output_parser_name@, @output_header_name@): ``Restore'' their
16564 support (used to be M4 macros).
16565 * data/yacc.c: Quote larger chunks, a la glr.c.
16566 * data/lalr1.cc: Likewise.
16567 The header guards are no longer available, so use some other
16568 string than `YYLSP_NEEDED'.
16569
165702002-11-16 Akim Demaille <akim@epita.fr>
16571
16572 Make the ``Printers and Destructors'' test more verbose, taking
16573 `yacc.c''s behavior as (possibly wrong) reference.
16574
16575 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
16576 instead of fprint on stdout.
16577 Set and report the last_line of the symbols.
16578 Consistently display values and locations.
16579
165802002-11-16 Paul Eggert <eggert@twinsun.com>
16581
16582 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
16583
165842002-11-15 Paul Eggert <eggert@twinsun.com>
16585
16586 * tests/actions.at (Actions after errors): New test case.
16587
16588 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
16589 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
16590 tests/action.at, tests/calc.at, tests/conflicts.at,
16591 tests/cxx-type.at, tests/regression.at:
16592 "parse error" -> "syntax error" for POSIX compatibility.
16593 "parsing stack overflow..." -> "parser stack overflow" so
16594 that code matches Bison documentation.
16595
165962002-11-15 Akim Demaille <akim@epita.fr>
16597
16598 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
16599 take two BRACED_CODE, not two string_content.
16600 Free the scanner's obstack when we are done.
16601 (code_content): New.
16602 * tests/calc.at: Adjust.
16603 * doc/bison.texinfo: Adjust.
16604 Also, make sure to include the `,' for these declarations.
16605
166062002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
16607
16608 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
16609 definition; avoids potential autoreconf problems.
16610
166112002-11-15 Akim Demaille <akim@epita.fr>
16612
16613 Always check the value returned by yyparse.
16614
16615 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
16616 returned by yyparse.
16617 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
16618 Adjust calls.
16619 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
16620 returned by yyparse.
16621
166222002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16623
16624 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
16625 on input.at test.
16626
166272002-11-14 Paul Eggert <eggert@twinsun.com>
16628
16629 * src/output.c (output_skeleton): Call xfopen instead of
16630 duplicating xfopen's body.
16631
16632 Fix bugs reported by Nelson H. F. Beebe in
16633 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
16634
16635 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
16636 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
16637 Group compiler. Instead, use "$CC -E bar.c". Include the .h
16638 file twice in the grammar, as an extra check.
16639
16640 * tests/input.at (Torturing the Scanner): Surround the
16641 backslash-newline tests with "#if 0", to make it less likely that
16642 we'll run into compiler bugs. Bring back solitary \ inside
16643 comment, but add a closing comment to work around HP C bug. Don't
16644 test backslash-newline in C character constant.
16645
166462002-11-14 Akim Demaille <akim@epita.fr>
16647
16648 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
16649 status of the compiler.
16650 Calling `exit 1' is no longer needed.
16651 Reported by Nelson H. F. Beebe.
16652
166532002-11-14 Akim Demaille <akim@epita.fr>
16654
16655 * tests/atlocal.in (CPPFLAGS): We have config.h.
16656 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
16657 New.
16658 * tests/actions.at, tests/calc.at, tests/conflicts.at,
16659 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
16660 * tests/regression.at, tests/torture.at: Use them for all the
16661 grammars that are to be compiled.
16662 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
16663 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
16664 * doc/bison.texinfo (GLR Parsers): Document `inline'.
16665
166662002-11-14 Akim Demaille <akim@epita.fr>
16667
16668 * doc/bison.texinfo: Various formatting changes (alignments in
16669 samples, additional @group/@end group, GCS in samples.
16670 Use @deffn instead of simple @table to define the directives,
16671 macros, variables etc.
16672
166732002-11-13 Paul Eggert <eggert@twinsun.com>
16674
16675 Fix some bugs reported by Albert Chin-A-Young in
16676 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
16677
16678 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
16679 -o c"; the HP C compiler chatters during compilation.
16680 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
16681 * tests/headers.at (export YYLTYPE): Likewise.
16682
16683 * tests/input.at (Torturing the Scanner): Remove lines containing
16684 solitary backslashes, as they tickle a bug in the HP C compiler.
16685
16686 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
16687 comments, since they're not portable. Use GNU coding style.
16688
166892002-11-13 Akim Demaille <akim@epita.fr>
16690
16691 * data/yacc.c: Leave bigger chunks of quoted text.
16692 (YYDSYMPRINTF): New.
16693 Use it to report symbol activities.
16694 * data/glr.c (YYDSYMPRINTF): New.
16695 Use it.
16696
166972002-11-12 Paul Eggert <eggert@twinsun.com>
16698
16699 Version 1.75b.
16700
16701 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
16702 (yyglrReduce): Return yyok, not 0.
16703 This should avoid the enumerated-type warnings reported
16704 by Nelson H. F. Beebe in
16705 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
16706
16707 * lib/bbitset.h (BITSET_INLINE): Remove.
16708 * lib/bitset.h [! BITSET_INLINE]: Remove.
16709 (bitset_set, bitset_reset, bitset_test): Rename local vars
16710 to avoid shadowing warnings by GCC.
16711
16712 * data/glr.c (inline): Remove #define. It's the user's
16713 responsibility to #define it away, just like 'const'.
16714 This fixes one of the bugs reported by Nelson H. F. Beebe in
16715 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
16716
16717 * Makefile.maint (po-check): Scan .l and .y files instead of the
16718 .c and the .h files that they generate. This fixes the bug
16719 reported by Tim Van Holder in:
16720 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
16721 Look for N_ as well as for _. Try to avoid matching #define for
16722 N_ and _.
16723 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
16724 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
16725 * src/scan-gram.l: Revamp regular expressions so that " and '
16726 do not confuse xgettext.
16727
16728 * src/struniq.h (struniq_new): Do not declare the return type
16729 to be 'const'; this violates the C standard.
16730 * src/struniq.c (struniq_new): Likewise.
16731
167322002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
16733
16734 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
16735 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
16736 linker.
16737
167382002-11-12 Akim Demaille <akim@epita.fr>
16739
16740 * Makefile.maint: Sync with Autoconf:
16741 (local_updates): New.
16742
167432002-11-12 Akim Demaille <akim@epita.fr>
16744
16745 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
16746
167472002-11-12 Akim Demaille <akim@epita.fr>
16748
16749 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
16750 locations.
16751
167522002-11-12 Akim Demaille <akim@epita.fr>
16753
16754 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
16755 not yyvalue.
16756
167572002-11-12 Akim Demaille <akim@epita.fr>
16758
16759 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
16760 Use it to test the GLR parser.
16761
167622002-11-12 Akim Demaille <akim@epita.fr>
16763
16764 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
16765 defines it.
16766 * data/glr.c (yystos): New.
16767 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
16768 (YYDSYMPRINT): New.
16769 (yyval): Don't define it, it is handled via M4.
16770 (yyrecoverParseError): Free verbosely the discarded symbols.
16771 * data/yacc.c (yysymprint): Remove, rather...
16772 (b4_yysymprint_generate): invoke.
16773 * data/c.m4 (b4_yysymprint_generate): New.
16774 Accept pointers as arguments, as opposed to the version from
16775 yacc.c.
16776 (b4_yydestruct_generate): Likewise.
16777 * tests/cations.at (Printers and Destructors): Use Bison directives
16778 instead of CPP macros.
16779 Don't rely on internal details.
16780
167812002-11-12 Akim Demaille <akim@epita.fr>
16782
16783 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
16784 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
16785 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
16786 it against YYEMPTY and so forth), work on yytoken (i.e., set
16787 it to YYEMPTY etc.).
16788 (yydestruct): Replace with a b4_yydestruct_generate invocation.
16789 (b4_symbol_actions): Remove.
16790 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
16791 for 0, end-of-input.
16792
167932002-11-12 Akim Demaille <akim@epita.fr>
16794
16795 * doc/bison.texinfo (Destructor Decl): New.
16796
167972002-11-12 Akim Demaille <akim@epita.fr>
16798
16799 * src/tables.c (tables_generate): Use free for pointers that
16800 cannot be NULL, not XFREE.
16801 (pack_vector): Use assert, not fatal, for bound violations.
16802 * src/state.c (state_new): Likewise.
16803 * src/reader.c (reader): Likewise.
16804 * src/lalr.c (set_goto_map): Likewise.
16805 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
16806 the file name.
16807
168082002-11-12 Akim Demaille <akim@epita.fr>
16809
16810 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
16811 Restore.
16812 * src/scan-gram.l (last_string): Is global to the file, not to
16813 yylex.
16814 * src/parse-gram.y (input): Don't append the epilogue here,
16815 (epilogue.opt): do it here, and free the scanner's obstack.
16816 * src/reader.c (epilogue_set): Rename as...
16817 (epilogue_augment): this.
16818 * data/c.m4 (b4_epilogue): Defaults to empty.
16819
168202002-11-12 Akim Demaille <akim@epita.fr>
16821
16822 * src/getargs.c (long_options): Remove duplicates.
16823 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
16824 Remove.
16825 * doc/bison.rnh: Remove.
16826 * doc/bison.texinfo (VMS Invocation): Remove.
16827
168282002-11-12 Akim Demaille <akim@epita.fr>
16829
16830 * src/struniq.h, src/struniq.c (struniq_t): Is const.
16831 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
16832
16833 Use struniq for symbols.
16834
16835 * src/symtab.h (symbol_t): The tag member is a struniq.
16836 (symbol_type_set): Adjust.
16837 * src/symtab.c (symbol_new): Takes a struniq.
16838 (symbol_free): Don't free the tag member.
16839 (hash_compare_symbol_t, hash_symbol_t): Rename as...
16840 (hash_compare_symbol, hash_symbol): these.
16841 Use the fact that tags as struniqs.
16842 (symbol_get): Use struniq_new.
16843 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
16844 Returns a strniq.
16845 * src/reader.h (merger_list, grammar_currentmerge_set): The name
16846 and type members are struniqs.
16847 * src/reader.c (get_merge_function)
16848 (grammar_current_rule_merge_set): Adjust.
16849 (TYPE, current_type): Are struniq.
16850
16851 Use struniq for file names.
16852
16853 * src/files.h, src/files.c (infile): Split into...
16854 (grammar_file, current_file): these.
16855 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
16856 * src/reduce.c (reduce_print): Likewise.
16857 * src/getargs.c (getargs): Likewise.
16858 * src/complain.h, src/complain.c: Likewise.
16859 * src/main.c (main): Call struniqs_new early enough to use it for
16860 file names.
16861 Don't free the input file name.
16862
168632002-11-12 Akim Demaille <akim@epita.fr>
16864
16865 * src/symtab.c (symbol_free): Remove dead deactivated code:
16866 type_name are properly removed.
16867 Don't use XFREE to free items that cannot be NULL.
16868 * src/struniq.h, src/struniq.c: New.
16869 * src/main.c (main): Initialize/free struniqs.
16870 * src/parse-gram.y (%union): Add astruniq member.
16871 (yyprint): Adjust.
16872 * src/scan-gram.l (<{tag}>): Return a struniq.
16873 Free the obstack bit that used to store it.
16874 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
16875
168762002-11-11 Paul Eggert <eggert@twinsun.com>
16877
16878 Revamp to fix many (but not all) of the C- and M4-related quoting
16879 problems. Among other things, this fixes the Bison bug reported
16880 by Jan Hubicka when processing the Bash grammar; see:
16881 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
16882
16883 Use new @ escapes consistently. Represent brackets with @{ and @}
16884 rather than @<:@ and @:>@, since this works a bit better with dumb
16885 editors like vi. Represent @ with @@, since @ is now consistently
16886 an escape. Use @oline@ and @ofile@ rather than __oline__ and
16887 __ofile__, to avoid unexpected expansions. Similarly, use @output
16888 rather than #output.
16889
16890 * data/c.m4 (b4_copyright): Omit file name from comment, since
16891 the file name could contain "*/".
16892 (b4_synclines_flag): Don't quote the 2nd argument; it should already
16893 be quoted. All uses changed.
16894
16895 * data/glr.c: Use new @ escapes consistently.
16896 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
16897 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
16898 Remove, since they couldn't handle arbitrary characters in file
16899 names.
16900 * data/lalr1.cc: Likewise.
16901 * data/yacc.c: Likewise.
16902
16903 * src/files.c (output_infix): Remove; all uses removed.
16904 * src/files.h: Likewise.
16905
16906 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
16907 mishandled funny characters in file names, and anyway it isn't
16908 needed any more.
16909 * data/yacc.c: Likewise.
16910 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
16911
16912 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
16913 * data/yacc.c: Likewise.
16914
16915 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
16916 strings now.
16917 (muscle_init): Quote filename as a C string.
16918 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
16919 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
16920 * src/output.c (escaped_file_name_output): New function.
16921 (prepare_symbols): Quote tokens for M4.
16922 (prepare): Don't insert output_infix, output_prefix,
16923 output_parser_name, output_header_name; this is now down by scan-skel.
16924 Insert skeleton as a C string.
16925
16926 * src/output.c (user_actions_output, symbol_destructors_output,
16927 symbol_printers_output): Quote filenames for C and M4.
16928 * src/reader.c (prologue_augment, epilogue_set): Likewise.
16929
16930 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
16931 escapes other than \\ and \'; this simplifies the code.
16932 (<SC_STRING>): Likewise, for \\ and \".
16933 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
16934 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
16935 Use new escapes @{ and @} for [ and ].
16936
16937 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
16938 them with auto vars.
16939 Switch to new escape scheme, where @ is the escape character uniformly.
16940 Abort if a stray escape character is found. Avoid unbounded input
16941 buffer when parsing non-escaped text.
16942
16943 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
16944 __oline__, #output, $@, and @{ do not have unintended meanings.
16945
169462002-11-09 Paul Eggert <eggert@twinsun.com>
16947
16948 Fix the test failure due to GCC warnings described in
16949 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
16950 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
16951 evaluate to 0 if it's impossible for NINF to be in the respective
16952 table.
16953 (yygetLRActions, yyrecoverParseError): Use them.
16954
16955 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
16956 counted in the token inserted at end of file. Now takes
16957 location_t *, not location_t, so that the location can be
16958 adjusted. All uses changed.
16959
16960 * tests/regression.at (Invalid inputs): Adjust wording in
16961 diagnostic to match the new behavior.
16962
16963 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
16964 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
16965 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
16966 abort ();'. This reduces the runtime of the "Many lookaheads"
16967 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
16968 GCC 3.2.
16969
169702002-11-07 Paul Eggert <eggert@twinsun.com>
16971
16972 * src/parse-gram.y (CHARACTER): Remove unused token.
16973 All uses removed.
16974
16975 * src/scan-gram.l: Remove stack option. We no longer use the
16976 stack, since the stack was never deeper than 1; instead, use the
16977 new auto var c_context to record the stacked value.
16978
16979 Remove nounput option. At an unexpected end of file, we now unput
16980 the minimal input necessary to end cleanly; this simplifies the
16981 code.
16982
16983 Avoid unbounded token sizes where this is easy.
16984
16985 (unexpected_end_of_file): New function.
16986 Use it to systematize the error message on unexpected EOF.
16987 (last-string): Now auto, not static.
16988 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
16989 (scanner_last_string_free): Remove; not used.
16990 (percent_percent_count): Move decl to just before use.
16991 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
16992 not the (never otherwised-used) CHARACTER.
16993
169942002-11-07 Akim Demaille <akim@epita.fr>
16995
16996 Let yyerror always receive the msg as last argument, so that
16997 yyerror can be variadic.
16998
16999 * data/yacc.c (b4_yyerror_args): New.
17000 Use it when calling yyerror.
17001 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
17002 Use it when calling yyerror.
17003 * doc/bison.texinfo (Error Reporting): Adjust.
17004 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
17005 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
17006
170072002-11-06 Akim Demaille <akim@epita.fr>
17008
17009 #line should have quoted strings.
17010 Ideally, this should be done by m4_quotearg.
17011
17012 * src/scan-skel.l: Include quotearg.h.
17013 Quote __ofile__.
17014 * src/output.c (symbol_printers_output)
17015 (symbol_destructors_output): Quote the file name.
17016
170172002-11-06 Akim Demaille <akim@epita.fr>
17018
17019 * tests/regression.at (Invalid inputs): Adjust to the recent
17020 messages.
17021
170222002-11-06 Akim Demaille <akim@epita.fr>
17023
17024 Restore --no-lines.
17025 Reported by Jim Kent.
17026
17027 * data/c.m4 (b4_syncline): New.
17028 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
17029 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
17030 * src/output.c (user_actions_output): Likewise.
17031 (prepare): Define 'b4_synclines_flag'.
17032 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
17033
170342002-11-06 Akim Demaille <akim@epita.fr>
17035
17036 * src/main.c (main): Free `infile'.
17037 * src/scan-gram.l (handle_syncline): New.
17038 Recognize `#line'.
17039 * src/output.c (user_actions_output, symbol_destructors_output)
17040 (symbol_printers_output): Use the location's file name, not
17041 infile.
17042 * src/reader.c (prologue_augment, epilogue_set): Likewise.
17043
170442002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17045
17046 * src/tables.c (matching_state): Don't allow states to match if
17047 either has GLR conflict entries.
17048
170492002-11-05 Paul Eggert <eggert@twinsun.com>
17050
17051 * src/scan-gram.l: Use more accurate diagnostics, e.g.
17052 "integer out of range" rather than "invalid value".
17053 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
17054 accordingly.
17055
17056 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
17057 Also, remove one static variable in the scanner.
17058
17059 * src/scan-gram.l (braces_level): Now auto, not static.
17060 Initialize to zero if the compiler is being picky.
17061 (INITIAL): Clear braces_level instead of incrementing it.
17062 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
17063 as POSIX 1003.1-2001 requires.
17064 * src/system.h (IF_LINT): New macro, taken from coreutils.
17065 * configure.ac: Define "lint" if --enable-gcc-warnings.
17066
170672002-11-05 Akim Demaille <akim@epita.fr>
17068
17069 * src/scan-gram.l: When it starts with `%', complain about the
17070 whole directive, not just that `invalid character: %'.
17071
170722002-11-04 Akim Demaille <akim@epita.fr>
17073
17074 * Makefile.maint: Update from Autoconf.
17075 (update, cvs-update, po-update, do-po-update): New.
17076
170772002-11-04 Akim Demaille <akim@epita.fr>
17078
17079 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
17080 and yyerror.
17081 Have yyerror `use' its arguments.
17082 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
17083 returns true when location & yacc & pure & parse-param.
17084 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
17085
170862002-11-04 Akim Demaille <akim@epita.fr>
17087
17088 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
17089 clashes.
17090 * src/scan-gram.l: Use [\'] instead of ['] to pacify
17091 font-lock-mode.
17092 Use complain_at.
17093 Use quote, not quote_n since LOCATION_PRINT no longer uses the
17094 slot 0.
17095
170962002-11-03 Paul Eggert <eggert@twinsun.com>
17097
17098 * src/reader.c (get_merge_function, grammar_current_rule_check):
17099 Use consistent diagnostics for reporting type name clashes.
17100 Quote the types with <>, for consistency with Yacc.
17101 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
17102
171032002-11-03 Akim Demaille <akim@epita.fr>
17104
17105 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
17106 New.
17107 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
17108 (b4_parse_param): Remove.
17109 Use b4_identification.
17110 Propagate b4_pure_args where needed to pass them to yyerror.
17111 * data/glr.m4 (b4_parse_param): Remove.
17112 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
17113 (b4_lpure_formals): New.
17114 Use b4_identification.
17115 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
17116 b4_user_formals and b4_user_args.
17117 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
17118 (yyreportAmbiguity): When using a pure parser, also need
17119 the location, and the parse-params.
17120 Adjust callers.
17121 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
17122 When using a pure parser, also need the parse-params.
17123 Adjust callers.
17124 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
17125 (%pure-parser + %parse-param) LALR and GLR parsers.
17126 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
17127 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
17128 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
17129 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
17130 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
17131 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
17132 * doc/bison.texinfo: Untabify the whole file.
17133 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
17134 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
17135 (Error Reporting): Adjust to these new directives.
17136 Document %error-verbose, deprecate YYERROR_VERBOSE.
17137
171382002-11-03 Akim Demaille <akim@epita.fr>
17139
17140 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
17141 AT_CHECK_CALC_GLR invocations to use % directives, instead of
17142 command line options.
17143 * tests/cxx-type.at: Formatting changes.
17144
171452002-11-03 Paul Eggert <eggert@twinsun.com>
17146
17147 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
17148 to count columns correctly, and to check for invalid inputs.
17149
17150 Use mbsnwidth to count columns correctly. Account for tabs, too.
17151 Include mbswidth.h.
17152 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
17153 (extend_location): New function.
17154 (YY_LINES): Remove.
17155
17156 Handle CRLF in C code rather than in Lex code.
17157 (YY_INPUT): New macro.
17158 (no_cr_read): New function.
17159
17160 Scan UCNs, even though we don't fully handle them yet.
17161 (convert_ucn_to_byte): New function.
17162
17163 Handle backslash-newline correctly in C code.
17164 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
17165 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
17166 all uses changed.
17167 (tag, splice): New EREs. Do not allow NUL or newline in tags.
17168 Use {splice} wherever C allows backslash-newline.
17169 YY_STEP after space, newline, vertical-tab.
17170 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
17171
17172 (letter, id): Don't assume ASCII; e.g., spell out a-z.
17173
17174 ({int}, handle_action_dollar, handle_action_at): Check for integer
17175 overflow.
17176
17177 (YY_STEP): Omit trailing semicolon, so that it's more like C.
17178
17179 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
17180 as well as \000. Check for UCHAR_MAX, not 255.
17181 Allow \x with an arbitrary positive number of digits, as in C.
17182 Check for overflow here.
17183 Allow \? and UCNs, for compatibility with C.
17184
17185 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
17186 with quote slot used by complain_at.
17187
17188 * tests/input.at: Add tests for backslash-newline, m4 quotes
17189 in symbols, long literals, and funny escapes in strings.
17190
17191 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
17192 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
17193 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
17194 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
17195 * m4/mbswidth.m4: New file, from GNU coreutils.
17196
17197 * doc/bison.texinfo (Grammar Outline): Document // comments.
17198 (Symbols): Document that trigraphs have no special meaning in Bison,
17199 nor is backslash-newline allowed.
17200 (Actions): Document that trigraphs have no special meaning.
17201
17202 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
17203 no longer used.
17204
172052002-11-02 Paul Eggert <eggert@twinsun.com>
17206
17207 * src/reader.c: Don't include quote.h; not needed.
17208 (get_merge_function): Reword warning to be consistent with
17209 type clash diagnostic in grammar_current_rule_check.
17210
17211 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
17212 bug in trigraph handling.
17213
17214 * src/output.c (prepare_symbols): When printing token names,
17215 escape "[" as "@<:@" and likewise for "]".
17216
17217 * src/system.h (errno): Remove declaration, as we are now
17218 assuming C89 or better, and C89 guarantees errno.
17219
172202002-10-30 Paul Eggert <eggert@twinsun.com>
17221
17222 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
17223 Check for close failures.
17224 * src/files.h (xfclose): Return void, not int, since it always
17225 returned zero.
17226 * src/files.c (xfclose): Likewise. Report I/O error if ferror
17227 indicates one.
17228 * src/output.c (output_skeleton): Use xfclose rather than fclose
17229 and ferror. xfclose now checks ferror.
17230
17231 * data/glr.c (YYLEFTMOST_STATE): Remove.
17232 (yyreportTree): Use a stack-based leftmost state. This avoids
17233 our continuing battles with bogus warnings about initializers.
17234
172352002-10-30 Akim Demaille <akim@epita.fr>
17236
17237 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
17238 #if.
17239
172402002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17241
17242 * tests/glr-regr1.at: New test for reported regressions.
17243 * tests/testsuite.at: Add glr-regr1.at test.
17244 * tests/Makefile.am: Add glr-regr1.at test.
17245
172462002-10-24 Paul Eggert <eggert@twinsun.com>
17247
17248 Version 1.75a.
17249
17250 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
17251 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
17252 we use malloc. Don't assume 'A' through 'Z' are contiguous.
17253 Don't assume strdup exists; POSIX says its an XSI extension.
17254 Check for buffer overflow on input.
17255
172562002-10-24 Akim Demaille <akim@epita.fr>
17257
17258 * src/output.c (output_skeleton): Don't disable M4sugar comments
17259 too soon: it results in comments being expanded.
17260 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
17261 first output.
17262
172632002-10-24 Akim Demaille <akim@epita.fr>
17264
17265 * data/yacc.c (m4_int_type): New.
17266 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
17267 char' as only yacc.c wants K&R portability.
17268 * data/glr.c (yysigned_char): Remove.
17269 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
17270 Reported by Quoc Peyrot.
17271
172722002-10-23 Paul Eggert <eggert@twinsun.com>
17273
17274 * src/main.c (main): With --trace=time, report times even if a
17275 non-fatal error occurs. Formerly, the times were reported in some
17276 such cases but not in others.
17277 * src/reader.c (reader): Just return if a complaint has been issued,
17278 instead of exiting, so that 'main' can report times.
17279
172802002-10-22 Akim Demaille <akim@epita.fr>
17281
17282 * src/system.h: Include sys/types.
17283 Reported by Bert Deknuydt.
17284
172852002-10-23 Paul Eggert <eggert@twinsun.com>
17286
17287 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
17288 Suggested by Art Haas.
17289
172902002-10-22 Paul Eggert <eggert@twinsun.com>
17291
17292 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
17293 decl; not needed any more.
17294 * src/main.c (main): Use return to exit, undoing yesterday's change.
17295 The last OS that we could find where this wouldn't work is
17296 SunOS 3.5, and that's too old to worry about now.
17297
17298 * data/glr.c (struct yyltype): Define members even when not
17299 doing locations. This is more consistent with yacc.c, and it
17300 works around the following bug reports:
17301 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
17302 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
17303
17304 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
17305 @acronym consistently. Standardize on "Yacc" instead of "YACC",
17306 "Algol" instead of "ALGOL". Give a bit more history about BNF.
17307
173082002-10-22 Akim Demaille <akim@epita.fr>
17309
17310 * data/README: New.
17311
173122002-10-21 Paul Eggert <eggert@twinsun.com>
17313
17314 Be consistent about 'bool'; the old code used an enum in one
17315 module and an int in another, and this violates the C standard.
17316 * m4/stdbool.m4: New file, from coreutils 4.5.3.
17317 * configure.ac (AC_HEADER_STDBOOL): Add.
17318 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
17319 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
17320 * src/symtab.c (hash_compare_symbol_t): Likewise.
17321 * src/system.h (bool, false, true): Use a definition consistent
17322 with ../lib/hash.c. All uses changed.
17323
17324 * src/complain.c (warning_issued): Renamed from warn_message_count,
17325 so that we needn't worry about integer overflow (!).
17326 Now of type bool. All uses changed.
17327 (complaint_issued): Renamed from complain_message_count; likewise.
17328
17329 * src/main.c (main): Use exit to exit with failure.
17330
17331 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
17332 rather than 1 and 0.
17333 * src/main.c (main): Likewise.
17334 * src/getargs.c (getargs): Likewise.
17335 * src/reader.c (reader): Likewise.
17336
17337 * src/getarg.c (getargs): Remove duplicate code for
17338 "Try `bison --help'".
17339
17340 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
17341 What was that "2" for?
17342
17343 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
17344 * src/getargs.c (usage): Likewise.
17345
17346 * src/getargs.c (getargs): When there are too few operands, report
17347 the last one. When there are too many, report the first extra
17348 one. This is how diffutils does it.
17349
173502002-10-20 Paul Eggert <eggert@twinsun.com>
17351
17352 Remove K&R vestiges.
17353 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
17354 * src/complain.c (VA_START): Remove. Assume prototypes.
17355 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
17356 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
17357 fatal): Assume prototypes.
17358 * src/complain.h: Assume prototypes.
17359 * src/system.h (PARAMS): Remove.
17360 Include <limits.h> unconditionally, since it's guaranteeed even
17361 for a freestanding C89 compiler.
17362 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
17363 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
17364
173652002-10-20 Akim Demaille <akim@epita.fr>
17366
17367 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
17368 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
17369 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
17370 (yyresolveStates, yyresolveAction, yyresolveStack)
17371 (yyprocessOneStack): Use them.
17372 (yy_reduce_print): New.
17373 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
17374
173752002-10-20 Akim Demaille <akim@epita.fr>
17376
17377 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
17378 arguments and output `void'.
17379 (b4_c_function): Rename as...
17380 (b4_c_function_def): this.
17381 (b4_c_function_decl, b4_c_ansi_function_def)
17382 (b4_c_ansi_function_decl): New.
17383 Change the interpretation of the arguments: before `int, foo', now
17384 `int foo, foo'.
17385 * data/yacc.c (yyparse): Prototype and define thanks to these.
17386 Adjust b4_c_function_def uses.
17387 * data/glr.c (yyparse): Likewise, but ANSI only.
17388
173892002-10-20 Akim Demaille <akim@epita.fr>
17390
17391 * src/output.c (prepare): Move the definition of `tokens_number',
17392 `nterms_number', `undef_token_number', `user_token_number_max'
17393 to...
17394 (prepare_tokens): Here.
17395 (prepare_tokens): Rename as...
17396 (prepare_symbols): this.
17397 (prepare): Move the definition of `rules_number' to...
17398 (prepare_rules): here.
17399 (prepare): Move the definition of `last', `final_state_number',
17400 `states_number' to...
17401 (prepare_states): here.
17402 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
17403
174042002-10-20 Akim Demaille <akim@epita.fr>
17405
17406 * src/tables.h, src/tables.c, src/output.c: Comment changes.
17407
174082002-10-20 Akim Demaille <akim@epita.fr>
17409
17410 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
17411 * data/c.m4: here.
17412
174132002-10-20 Akim Demaille <akim@epita.fr>
17414
17415 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
17416 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
17417 `pair'.
17418 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
17419 `name' to...
17420 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
17421 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
17422 These.
17423
174242002-10-19 Paul Eggert <eggert@twinsun.com>
17425
17426 Do not create a temporary file, as that involves security and
17427 cleanup headaches. Instead, use a pair of pipes.
17428 Derived from a suggestion by Florian Krohm.
17429 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
17430 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
17431 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
17432 (BISON_PREREQ_SUBPIPE): Add.
17433 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
17434 Add subpipe.h, subpipe.c.
17435 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
17436 * po/POTFILES.in: Add lib/subpipe.c.
17437 * src/output.c: Include "subpipe.h".
17438 (m4_invoke): Remove decl.
17439 (scan_skel): New decl.
17440 (output_skeleton): Use pipe rather than temporary file for m4 input.
17441 Check that m4sugar.m4 is readable, to avoid deadlock.
17442 Check for pipe I/O error.
17443 * src/scan-skel.l (readpipe): Remove decl.
17444 (scan_skel): New function, to be used in place of m4_invoke.
17445 Read from stream rather than file.
17446
17447 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
17448 float, as this generates a warning on Solaris 8 + GCC 3.2 with
17449 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
17450 this generates a more-accurate value anyway.
17451
17452 * lib/timevar.c (timervar_accumulate): Rename locals to
17453 avoid confusion with similarly-named more-global.
17454 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
17455
17456 * src/output.c (prepare): Use xstrdup to convert char const *
17457 to char *, to avoid GCC warning.
17458
174592002-10-19 Akim Demaille <akim@epita.fr>
17460
17461 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
17462 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
17463 Use them to have `calc.y' ready for %pure-parser.
17464 * data/yacc.c (YYLEX): Pass a yylex return type to
17465 b4_c_function_call.
17466
174672002-10-19 Akim Demaille <akim@epita.fr>
17468
17469 Prototype support of %lex-param and %parse-param.
17470
17471 * src/parse-gram.y: Add the definition of the %lex-param and
17472 %parse-param tokens, plus their rules.
17473 Drop the `_' version of %glr-parser.
17474 Add the "," token.
17475 * src/scan-gram.l (INITIAL): Scan them.
17476 * src/muscle_tab.c: Comment changes.
17477 (muscle_insert, muscle_find): Rename `pair' as `probe'.
17478 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
17479 (muscle_entry_s): The `value' member is no longer const.
17480 Adjust all dependencies.
17481 * src/muscle_tab.c (muscle_init): Adjust: use
17482 MUSCLE_INSERT_STRING.
17483 Initialize the obstack earlier.
17484 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
17485 (muscle_pair_list_grow): New.
17486 * data/c.m4 (b4_c_function_call, b4_c_args): New.
17487 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
17488 * tests/calc.at: Use %locations, not --locations.
17489 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
17490
174912002-10-19 Akim Demaille <akim@epita.fr>
17492
17493 * src/getargs.c (usage): Take status as argument and exit
17494 accordingly.
17495 Report the traditional `Try ... --help' message when status != 0.
17496 (usage, version): Don't take a FILE * as arg, it is pointless.
17497 (getargs): When there is an incorrect number of arguments, make it
17498 an error, and report it GNUlically thanks to `usage ()'.
17499
175002002-10-18 Paul Eggert <eggert@twinsun.com>
17501
17502 * data/glr.c (yyreportParseError): Don't assume that sprintf
17503 yields the length of the printed string, as this is not true
17504 on SunOS 4.1.4. Reported by Peter Klein.
17505
17506 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
17507 * tests/conflicts.at (%nonassoc and eof): Likewise.
17508 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
17509
175102002-10-17 Akim Demaille <akim@epita.fr>
17511
17512 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
17513 * src/getargs.c (trace_types, trace_args): Adjust.
17514 * src/reader.c (grammar_current_rule_prec_set)
17515 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
17516 Standardize error messages.
17517 And s/@prec/%prec/!
17518 (reader): Use trace_flag to enable scanner/parser debugging,
17519 instead of an adhoc scheme.
17520 * src/scan-gram.l: Remove trailing debugging code.
17521
175222002-10-16 Paul Eggert <eggert@twinsun.com>
17523
17524 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
17525 MUSCLE_TAB_H.
17526
17527 * NEWS: Officially drop support for building Bison with K&R C,
17528 since it didn't work anyway and it's not worth worrying about.
17529 * Makefile.maint (wget_files): Remove ansi2knr.c.
17530 (ansi2knr.c-url_prefix): Remove.
17531 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
17532 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
17533 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
17534
175352002-10-15 Paul Eggert <eggert@twinsun.com>
17536
17537 Stop using the "enum_" trick for K&R-style function definitions;
17538 it confused me, and I was the author! Instead, assume that people
17539 who want to use K&R C compilers (when using these modules in GCC,
17540 perhaps?) will run ansi2knr.
17541
17542 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
17543 All uses of "enum_" changed to "enum ".
17544 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
17545 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
17546
17547 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
17548 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
17549 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
17550 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
17551 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
17552 abitset_not, abitset_ones, abitset_or, abitset_or_and,
17553 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
17554 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
17555 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
17556 Use function prototypes; this removes the need for declaring
17557 static functions simply to provide their prototypes.
17558 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
17559 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
17560 bitset_count_, bitset_create, bitset_dump, bitset_first,
17561 bitset_free, bitset_init, bitset_last, bitset_next,
17562 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
17563 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
17564 bitset_print, bitset_release_memory, bitset_toggle_,
17565 bitset_type_choose, bitset_type_get, bitset_type_name_get,
17566 debug_bitset): Likewise.
17567 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
17568 * lib/bitset_stats.c (bitset_log_histogram_print,
17569 bitset_percent_histogram_print, bitset_stats_and,
17570 bitset_stats_and_cmp, bitset_stats_and_or,
17571 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
17572 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
17573 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
17574 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
17575 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
17576 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
17577 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
17578 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
17579 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
17580 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
17581 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
17582 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
17583 bitset_stats_zero): Likewise.
17584 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
17585 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
17586 bitsetv_dump, debug_bitsetv): Likewise.
17587 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
17588 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
17589 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
17590 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
17591 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
17592 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
17593 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
17594 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
17595 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
17596 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
17597 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
17598 Likewise.
17599 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
17600 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
17601 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
17602 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
17603 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
17604 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
17605 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
17606 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
17607 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
17608 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
17609 lbitset_xor_cmp, lbitset_zero): Likewise.
17610
176112002-10-14 Akim Demaille <akim@epita.fr>
17612
17613 Version 1.75.
17614
176152002-10-14 Akim Demaille <akim@epita.fr>
17616
17617 * tests/Makefile.am (maintainer-check-posix): New.
17618
176192002-10-14 Akim Demaille <akim@epita.fr>
17620
17621 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
17622 member.
17623
176242002-10-14 Akim Demaille <akim@epita.fr>
17625
17626 * src/tables.c (table_ninf_remap): base -> tab.
17627 Reported by Matt Rosing.
17628
176292002-10-14 Paul Eggert <eggert@twinsun.com>
17630
17631 * tests/action.at, tests/calc.at, tests/conflicts.at,
17632 tests/cxx-type.at, tests/headers.at, tests/input.at,
17633 tests/regression.at, tests/synclines.at, tests/torture.at:
17634 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
17635 so that the tests still work even if POSIXLY_CORRECT is set.
17636 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
17637
17638 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
17639 for portability to K&R hosts. Fix typo: signed char is guaranteed
17640 only to 127, not to 128.
17641 * data/glr.c (yysigned_char): New type.
17642 * data/yacc.c (yysigned_char): Likewise.
17643 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
17644
176452002-10-13 Paul Eggert <eggert@twinsun.com>
17646
17647 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
17648 true due to limited range of data type" warning from GCC.
17649
17650 * data/c.m4 (b4_token_defines): Protect against double-inclusion
17651 by wrapping enum yytokentype's definition inside #ifndef
17652 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
17653
176542002-10-13 Akim Demaille <akim@epita.fr>
17655
17656 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
17657 Un yy- yyrhs to avoid the name clash with the global YYRHS.
17658
176592002-10-13 Akim Demaille <akim@epita.fr>
17660
17661 * Makefile.maint: Update from Autoconf 2.54.
17662 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
17663
176642002-10-13 Akim Demaille <akim@epita.fr>
17665
17666 * src/print.c (print_state): Separate the list of solved conflicts
17667 from the other items.
17668 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
17669
176702002-10-13 Akim Demaille <akim@epita.fr>
17671
17672 Let nondeterministic skeletons be usable with deterministic
17673 tables.
17674
17675 With the patch, GAWK compiled by GCC without -O2 passes its test
17676 suite using a GLR parser driven by LALR tables. It fails with -O2
17677 because `struct stat' gives two different answers on my machine:
17678 88 (definition of an auto var) and later 96 (memset on this var).
17679 Hence the stack is badly corrumpted. The headers inclusion is to
17680 blame: if I move the awk.h inclusion before GLR's system header
17681 inclusion, the two struct stat have the same size.
17682
17683 * src/tables.c (pack_table): Always create conflict_table.
17684 (token_actions): Always create conflict_list.
17685 * data/glr.c (YYFLAG): Remove, unused.
17686
176872002-10-13 Akim Demaille <akim@epita.fr>
17688
17689 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
17690 (O0FLAGS): New.
17691 (VALGRIND, GXX): New.
17692 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
17693 * tests/bison.in: Run $PREBISON a pre-command.
17694 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
17695 (maintainer-check-g++): New.
17696 * Makefile.am (maintainer-check): New.
17697
176982002-10-13 Akim Demaille <akim@epita.fr>
17699
17700 * data/glr.c: Formatting changes.
17701 Tweak some trace messages to match yacc.c's.
17702
177032002-10-13 Akim Demaille <akim@epita.fr>
17704
17705 GLR parsers sometimes raise parse errors instead of performing the
17706 default reduction.
17707 Reported by Charles-Henry de Boysson.
17708
17709 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
17710 check the length of the traces when %glr.
17711 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
17712 GLR's traces.
17713 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
17714 Test GLR parsers.
17715 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
17716 (yyltype): Remove the yy prefix from the member names.
17717 (yytable): Complete its comment.
17718 (yygetLRActions): Map error action number from YYTABLE from
17719 YYTABLE_NINF to 0.
17720 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
17721 (which was a bug: it should have been YYTABEL_NINF, and yet it was
17722 not satisfying as we could compare an YYACTION computed from
17723 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
17724 only value for error actions.
17725 (yyreportParseError): In verbose parse error messages, don't issue
17726 `error' in the list of expected tokens.
17727 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
17728 next action to perform to match glr.c's decoding.
17729 (yytable): Complete its comment.
17730
177312002-10-13 Paul Eggert <eggert@twinsun.com>
17732
17733 Fix problem reported by Henrik Grubbstroem in
17734 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
17735 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
17736 because the Bison parser reads the second action before reducing
17737 the first one.
17738 * src/scan-gram.l (rule_length): New static var.
17739 Use it to keep track of the rule length in the scanner, since
17740 we can't expect the parser to be in lock-step sync with the scanner.
17741 (handle_action_dollar, handle_action_at): Use this var.
17742 * tests/actions.at (Exotic Dollars): Test for the problem.
17743
177442002-10-12 Paul Eggert <eggert@twinsun.com>
17745
17746 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
17747 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
17748 Include <sys/time.h> when checking for clock_t and struct tms.
17749 Use same include order as source.
17750 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
17751 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
17752
17753 * lib/timevar.c: Update copyright date and clarify comments.
17754 (get_time) [IN_GCC]: Keep the GCC version for reference.
17755
17756 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
17757 GCC version as of today, then merge Bison's changes.
17758 Change "GCC" to "Bison" in copyright notice. timevar.def's
17759 author is Akim, so change that too.
17760
17761 * src/reader.c (grammar_current_rule_check):
17762 Don't worry about the default action if $$ is untyped.
17763 Prevents bogus warnings reported by Jim Gifford in
17764 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
17765
17766 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
17767 * data/glr.c, data/lalr1.cc, data/yacc.c:
17768 Output token definitions before the first part of user declarations.
17769 Fixes compatibility problem reported by Jim Gifford for kbd in
17770 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
17771
177722002-10-11 Paul Eggert <eggert@twinsun.com>
17773
17774 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
17775 (yyparse): here. This undoes some of the 2002-07-25 change.
17776 Compatibility problem reported by Ralf S. Engelschall with
17777 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
17778
177792002-10-11 Akim Demaille <akim@epita.fr>
17780
17781 * tests/regression.at Characters Escapes): New.
17782 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
17783 characters.
17784 Reported by Jan Nieuwenhuizen.
17785
177862002-10-11 Akim Demaille <akim@epita.fr>
17787
17788 * po/id.po: New.
17789
177902002-10-10 Paul Eggert <eggert@twinsun.com>
17791
17792 Portability fixes for bitsets; this also avoids several GCC
17793 warnings.
17794
17795 * lib/abitset.c: Include <stddef.h>, for offsetof.
17796 * lib/lbitset.c: Likewise.
17797
17798 * lib/abitset.c (abitset_bytes): Return a size that is aligned
17799 properly for vectors of objects. Do not assume that adding a
17800 header size to a multiple of a word size yields a value that is
17801 properly aligned for the whole union.
17802 * lib/bitsetv.c (bitsetv_alloc): Likewise.
17803
17804 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
17805 unique names for structures.
17806 * lib/ebitset.c (ebitset_bytes): Likewise.
17807 * lib/lbitset.c (lbitset_bytes): Likewise.
17808
17809 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
17810 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
17811 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
17812 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
17813 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
17814 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
17815 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
17816 to improve the type-checking that GCC can do.
17817 * lib/bitset.c (bitset_op4_cmp): Likewise.
17818 * lib/bitset_stats.c (bitset_stats_count,
17819 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
17820 bitset_stats_copy, bitset_stats_disjoint_p,
17821 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
17822 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
17823 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
17824 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
17825 bitset_stats_and_or_cmp, bitset_stats_andn_or,
17826 bitset_stats_andn_or_cmp, bitset_stats_or_and,
17827 bitset_stats_or_and_cmp): Likewise.
17828 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
17829 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
17830 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
17831 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
17832
17833 * lib/abitset.h: Include bitset.h, not bbitset.h.
17834 * lib/ebitset.h: Likewise.
17835 * lib/lbitset.h: Likewise.
17836
17837 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
17838 All instances of parameters of type enum bitset_opts are now of
17839 type enum_bitset_opts, to conform to the C Standard, and similarly
17840 for enum_bitset_type.
17841 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
17842 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
17843
17844 Do not use "struct bitset_struct" to mean different things in
17845 different modules. Not only is this confusing, it violates
17846 the C Standard, which requires that structure types in different
17847 modules must be compatible if one is to be passed to the other.
17848 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
17849 All instances of "struct bitset_struct *" replaced with "bitset".
17850 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
17851 (union bitset_union, struct abitset_struct, struct ebitset_struct,
17852 struct lbitset_struct, struct bitset_stats_struct): New types.
17853 All uses of struct bitset_struct changed to union bitset_union,
17854 etc.
17855 * lib/abitset.c (struct abitset_struct, abitset,
17856 struct bitset_struct): Remove.
17857 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
17858 struct bitset_struct): Remove.
17859 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
17860 bitset_struct): Remove.
17861 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
17862 Likewise.
17863
17864 Do not call a function of type T using a call that assumes the
17865 function is of a different type U. Standard C requires that a
17866 function must be called with a type that is compatible with its
17867 definition.
17868 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
17869 New decls.
17870 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
17871 New functions.
17872 * lib/ebitset.c (PFV): Remove.
17873 * lib/lbitset.c (PFV): Likewise.
17874 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
17875 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
17876 decls.
17877 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
17878 (ebitset_vtable): Use them.
17879 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
17880 lbitset_xor): New functions.
17881 (lbitset_vtable): Use them.
17882
17883 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
17884 Declare.
17885
17886 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
17887 GCC warning.
17888 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
17889 Use offsetof, for simplicity.
17890
178912002-10-06 Paul Eggert <eggert@twinsun.com>
17892
17893 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
17894 the same width as int. This reapplies a hunk of the 2002-08-12 patch
17895 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
17896 which was inadvertently undone by the 2002-09-30 patch.
17897 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
17898 the same width as int.
17899
179002002-10-04 Paul Eggert <eggert@twinsun.com>
17901
17902 Version 1.50.
17903
17904 * configure.ac (AC_INIT), NEWS: Increment version number.
17905
17906 * doc/bison.texinfo: Minor spelling, grammar, and white space
17907 fixes.
17908 (Symbols): Mention that any negative value returned from yylex
17909 signifies end-of-input. Warn about negative chars. Mention
17910 the portable Standard C character set.
17911
17912 The GNU coding standard says CFLAGS and YFLAGS are reserved
17913 for the installer to set.
17914 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
17915 * src/Makefile.am (AM_CFLAGS): Likewise.
17916 (AM_YFLAGS): Renamed from YFLAGS.
17917
17918 Fix some MAX and MIN problems.
17919 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
17920 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
17921 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
17922 * src/reader.c (reader): Use it.
17923
17924 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
17925 POSIX 1003.1-2001 has removed fgrep.
17926
179272002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
17928
17929 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
17930 interpreted as signed.
17931 * lib/ebitset.c (ebitset_list): Fix bug.
17932
179332002-10-01 Paul Eggert <eggert@twinsun.com>
17934
17935 More fixes for 64-bit hosts and large bitsets.
17936
17937 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
17938 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
17939 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
17940 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
17941 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
17942 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
17943 bitset_count_): Likewise.
17944 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
17945 bitset_first, bitset_last): Likewise.
17946 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
17947 bitset_stats_list_reverse, bitset_stats_size,
17948 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
17949 Likewise.
17950 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
17951 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
17952 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
17953 bitsetv_reflexive_transitive_closure): Likewise.
17954 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
17955 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
17956 Likewise.
17957 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
17958 Likewise.
17959
17960 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
17961 Use size_t, not unsigned int, to count bytes.
17962 * lib/abitset.h (abitset_bytes): Likewise.
17963 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
17964 Likewise.
17965 * lib/bitset.h (bitset_bytes): Likewise.
17966 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
17967 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
17968 * lib/bitsetv.c (bitsetv_alloc): Likewise.
17969 * lib/ebitset.c (ebitset_bytes): Likewise.
17970 * lib/ebitset.h (ebitset_bytes): Likewise.
17971 * lib/lbitset.c (lbitset_bytes): Likewise.
17972 * lib/lbitset.h (lbitset_bytes): Likewise.
17973
17974 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
17975 abitset_subset_p, abitset_disjoint_p, abitset_and,
17976 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
17977 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
17978 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
17979 abitset_or_and, abitset_or_and_cmp):
17980 Use bitset_windex instead of unsigned int.
17981 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
17982 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
17983 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
17984 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
17985 Likewise.
17986 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
17987
17988 * lib/bitset.c (bitset_print):
17989 Use proper printf formats for widths of integer types.
17990 * lib/bitset_stats.c (bitset_percent_histogram_print,
17991 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
17992 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
17993 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
17994 * lib/lbitset.c (lbitset_bytes): Likewise.
17995
17996 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
17997 BITSET_SIZE_MAX): New macros.
17998 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
17999 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
18000 to BITSET_WINDEX_MAX.
18001
18002 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
18003 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
18004 since we now return the bitset_bindex type (not int).
18005
18006 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
18007 when computing sizes.
18008 * lib/ebitset.c (ebitset_elts_grow): Likewise.
18009
18010 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
18011 and avoid cast to unsigned.
18012
180132002-09-30 Akim Demaille <akim@epita.fr>
18014
18015 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
18016 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
18017 Updates from Michael Hayes.
18018
180192002-09-30 Art Haas <ahaas@neosoft.com>
18020
18021 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
18022 invocations.
18023 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
18024 defined.
18025
180262002-09-27 Akim Demaille <akim@epita.fr>
18027
18028 Version 1.49c.
18029
180302002-09-27 Akim Demaille <akim@epita.fr>
18031
18032 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
18033 (Because of AC_LIBSOURCE).
18034
180352002-09-27 Akim Demaille <akim@epita.fr>
18036
18037 Playing with Autoscan.
18038
18039 * configure.ac: Remove the old LIBOBJ tweaks.
18040 (AC_REPLACE_FUNCS): Add strrchr and strtol.
18041 * lib/strrchr.c: New.
18042 * lib/strtol.c: New, from the Coreutils 4.5.1.
18043
180442002-09-27 Akim Demaille <akim@epita.fr>
18045
18046 Playing with Autoscan.
18047
18048 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
18049 * lib/Makefile.am (libbison_a_SOURCES): No longer include
18050 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
18051 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
18052 Coreutils 4.5.1.
18053
180542002-09-24 Akim Demaille <akim@epita.fr>
18055
18056 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
18057 (Frequently Asked Questions, Parser Stack Overflow): New.
18058
180592002-09-13 Akim Demaille <akim@epita.fr>
18060
18061 Playing with autoscan.
18062
18063 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
18064 * src/files.c (skeleton_find): Remove, unused.
18065 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
18066 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
18067
180682002-09-13 Akim Demaille <akim@epita.fr>
18069
18070 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
18071 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
18072
180732002-09-13 Akim Demaille <akim@epita.fr>
18074
18075 * configure.ac: Require 2.54.
18076 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
18077 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
18078 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
18079 Remove, provided by Autoconf macros.
18080
180812002-09-12 Akim Demaille <akim@epita.fr>
18082
18083 * m4/prereq.m4: Update, from Coreutils 4.5.1.
18084
180852002-09-12 Akim Demaille <akim@epita.fr>
18086
18087 * m4/prereq.m4: Update, from Fileutils 4.1.5.
18088 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
18089 Reported by Martin Mokrejs.
18090
180912002-09-10 Akim Demaille <akim@epita.fr>
18092
18093 * src/parse-gram.y: Associate a human readable string to each
18094 token type.
18095 * tests/regression.at (Invalid inputs): Adjust.
18096
180972002-09-10 Gary V. Vaughan <gary@gnu.org>
18098
18099 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
18100 with an Autoconf-2.5x style configure.ac.
18101
181022002-09-06 Paul Eggert <eggert@twinsun.com>
18103
18104 * doc/bison.texinfo (Conditions): Make explicit that the GPL
18105 exception applies only to yacc.c. This is a modification of a
18106 patch originally suggested by Akim Demaille.
18107
181082002-09-06 Akim Demaille <akim@epita.fr>
18109
18110 * data/c.m4 (b4_copyright): Move the GPL exception comment from
18111 here to...
18112 * data/yacc.c: here.
18113
18114 * data/lalr1.cc (struct yyltype): Don't define it, since we use
18115 LocationType.
18116 (b4_ltype): Default to yy::Location from location.hh.
18117
181182002-09-04 Jim Meyering <jim@meyering.net>
18119
18120 * data/yacc.c: Guard the declaration of yytoknum also with
18121 `#ifdef YYPRINT', so it is declared only when used.
18122
181232002-09-04 Akim Demaille <akim@epita.fr>
18124
18125 * configure.in: Rename as...
18126 * configure.ac: this.
18127 Bump to 1.49c.
18128
181292002-09-04 Akim Demaille <akim@epita.fr>
18130
18131 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
18132 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
18133 translate maintainer only messages.
18134
181352002-08-12 Paul Eggert <eggert@twinsun.com>
18136
18137 Version 1.49b.
18138
18139 * Makefile.am (SUBDIRS): Remove intl.
18140 (DISTCLEANFILES): Remove.
18141 * NEWS: Mention that GNU M4 is now required. Clarify what is
18142 meant by "larger grammars". Mention the pt_BR translation.
18143 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
18144 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
18145 Bump version from 0.11.2 to 0.11.5.
18146 (BISON_PREREQ_STAGE): Remove.
18147 (AM_GNU_GETTEXT): Use external gettext.
18148 (AC_OUTPUT): Remove intl/Makefile.
18149
18150 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
18151
18152 * data/glr.c: Include string.h, for strlen.
18153 (yyreportParseError): Use size_t for yysize.
18154 (yy_yypstack): No longer nested inside yypstates, as nested
18155 functions are not portable. Do not assume size_t is the
18156 same width as int.
18157 (yypstates): Do not assume that ptrdiff_t is the same width
18158 as int, and similarly for yyposn and YYINDEX.
18159
18160 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
18161
18162 * lib/Makefile.am (INCLUDES): Do not include from the intl
18163 directory, which has been removed.
18164 * src/Makefile.am (INCLUDES): Likewise.
18165
18166 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
18167 (bitsets_sources, additional_bitsets_sources, timevars_sources):
18168 New vars.
18169
18170 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
18171 * tests/Makefile.am (EXTRA_DIST): Likewise.
18172
18173 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
18174 Do not assume that bitset_windex is the same width as unsigned.
18175
18176 * lib/abitset.c (abitset_unused_clear): Do not assume that
18177 bitset_word is the same width as int.
18178 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
18179 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
18180 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
18181 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
18182 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
18183
18184 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
18185 portability to one's complement hosts!).
18186 * lib/ebitset.c (ebitset_op1): Likewise.
18187 * lib/lbitset.c (lbitset_op1): Likewise.
18188
18189 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
18190 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
18191 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
18192 Sync with fileutils.
18193 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
18194 lib/gettext.h: Sync with diffutils.
18195
18196 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
18197 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
18198
18199 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
18200 PROTOTYPES to check for prototypes, and "defined __STDC__" to
18201 check for void *.
18202
18203 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
18204 size_t; the old version tried to do this but casted improperly.
18205 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
18206 (bitset_test): Now returns int, not unsigned long.
18207
18208 * lib/bitset_stats.c: Include "gettext.h".
18209 (_): New macro.
18210 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
18211 name locals "index", as it generates unnecessary warnings on some
18212 hosts that have an "index" function.
18213
18214 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
18215 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
18216 they need translation.
18217 * src/LR0.c (state_list_append, new_itemsets, get_state,
18218 append_states, generate_states): Likewise.
18219 * src/assoc.c (assoc_to_string): Likewise.
18220 * src/closure.c (print_closure, set_firsts, closure): Likewise.
18221 * src/gram.c (grammar_dump): Likewise.
18222 * src/injections.c (injections_compute): Likewise.
18223 * src/lalr.c (lookaheads_print): Likewise.
18224 * src/relation.c (relation_transpose): Likewise.
18225 * src/scan-gram.l: Likewise.
18226 * src/tables.c (table_grow, pack_vector): Likewise.
18227
18228 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
18229 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
18230 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
18231 * m4/mbstate_t.m4: Sync with fileutils.
18232 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
18233
18234 * po/LINGUAS: Add pt_BR.
18235 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
18236 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
18237 lib/timevar.c.
18238 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
18239 manual recommends.
18240 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
18241
18242 * src/complain.c (strerror_r): Remove decl; not needed.
18243 (strerror): Use same pattern as ../lib/error.c.
18244
18245 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
18246
18247 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
18248
18249 * src/main.c (main): Cast result of bindtextdomain and textdomain
18250 to void, to avoid a GCC warning when --disable-nls is in effect.
18251
18252 * src/scan-gram.l: Use strings rather than escapes when possible,
18253 to minimize the number of warnings from xgettext.
18254 (handle_action_dollar, handle_action_at): Don't use isdigit,
18255 as it mishandles negative chars and it may not work as expected
18256 outside the C locale.
18257
18258 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
18259 this is a GCC extension and is not portable to other compilers.
18260
18261 * src/system.h (alloca): Use same pattern as ../lib/error.c.
18262 Do not include <ctype.h>; no longer needed.
18263 Do not include <malloc.h>; no longer needed (and generates
18264 warnings on OpenBSD 3.0).
18265
18266 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
18267 it's not portable.
18268
18269 * tests/regression.at: Do not use 'cc -c input.c -o input';
18270 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
18271
18272 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
18273 exit status as failure, not just exit status 1. Sun C exits
18274 with status 2 sometimes.
18275
18276 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
18277 Use it for the two large tests.
18278
182792002-08-02 Akim Demaille <akim@epita.fr>
18280
18281 * src/conflicts.c (conflicts_output): Don't output rules never
18282 reduced here, since anyway that computation doesn't work.
18283 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
18284 (rule_useless_p, rule_never_reduced_p): New.
18285 (grammar_rules_partial_print): Use a filter instead of a range.
18286 Display the title only if needed.
18287 (grammar_rules_print): Adjust.
18288 (grammar_rules_never_reduced_report): New.
18289 * src/tables.c (action_row): Move the computation of rules never
18290 reduced to...
18291 (token_actions): here.
18292 * src/main.c (main): Make the parser before making the report, so
18293 that rules never reduced are computed.
18294 Call grammar_rules_never_reduced_report.
18295 * src/print.c (print_results): Report rules never reduced.
18296 * tests/conflicts.at, tests/reduce.at: Adjust.
18297
182982002-08-01 Akim Demaille <akim@epita.fr>
18299
18300 Instead of attaching lookaheads and duplicating the rules being
18301 reduced by a state, attach the lookaheads to the reductions.
18302
18303 * src/state.h (state_t): Remove the `lookaheads',
18304 `lookaheads_rule' member.
18305 (reductions_t): Add a `lookaheads' member.
18306 Use a regular array for the `rules'.
18307 * src/state.c (reductions_new): Initialize the lookaheads member
18308 to 0.
18309 (state_rule_lookaheads_print): Adjust.
18310 * src/state.h, src/state.c (state_reductions_find): New.
18311 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
18312 (count_rr_conflicts): Adjust.
18313 * src/lalr.c (LArule): Remove.
18314 (add_lookback_edge): Adjust.
18315 (state_lookaheads_count): New.
18316 (states_lookaheads_initialize): Merge into...
18317 (initialize_LA): this.
18318 (lalr_free): Adjust.
18319 * src/main.c (main): Don't free nullable and derives too early: it
18320 is used by --verbose.
18321 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
18322
183232002-08-01 Akim Demaille <akim@epita.fr>
18324
18325 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
18326 `rule_number_t**'.
18327 (set_derives, free_derives): Rename as...
18328 (derives_compute, derives_free): this.
18329 Adjust all dependencies.
18330 * src/nullable.c (set_nullable, free_nullable): Rename as...
18331 (nullable_compute, nullable_free): these.
18332 (rule_list_t): Store rule_t *, not rule_number_t.
18333 * src/state.c (state_rule_lookaheads_print): Directly compare rule
18334 pointers, instead of their numbers.
18335 * src/main.c (main): Call nullable_free, and derives_free earlier,
18336 as they were lo longer used.
18337
183382002-08-01 Akim Demaille <akim@epita.fr>
18339
18340 * lib/timevar.c (get_time): Include children time.
18341 * src/lalr.h (LA, LArule): Don't export them: used with the
18342 state_t.
18343 * src/lalr.c (LA, LArule): Static.
18344 * src/lalr.h, src/lalr.c (lalr_free): New.
18345 * src/main.c (main): Call it.
18346 * src/tables.c (pack_vector): Check whether loc is >= to the
18347 table_size, not >.
18348 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
18349 (tables_generate): do it, since that's also it which allocates
18350 them.
18351 Don't free LA and LArule, main does.
18352
183532002-07-31 Akim Demaille <akim@epita.fr>
18354
18355 Separate parser tables computation and output.
18356
18357 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
18358 (conflict_list, conflict_list_cnt, table, check, table_ninf)
18359 (yydefgoto, yydefact, high): Move to...
18360 * src/tables.h, src/tables.c: here.
18361 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
18362 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
18363 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
18364 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
18365 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
18366 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
18367 (action_row, save_row, token_actions, save_column, default_goto)
18368 (goto_actions, sort_actions, matching_state, pack_vector)
18369 (table_ninf_remap, pack_table, prepare_actions): Move to...
18370 * src/tables.c: here.
18371 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
18372 * src/output.c (token_actions, output_base, output_conflicts)
18373 (output_check): Merge into...
18374 (prepare_actions): this.
18375 (actions_output): Rename as...
18376 (user_actions_output): this.
18377 * src/main.c (main): Call tables_generate and tables_free.
18378
183792002-07-31 Akim Demaille <akim@epita.fr>
18380
18381 Steal GCC's --time-report support.
18382
18383 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
18384 stolen/adjusted from GCC.
18385 * m4/stage.m4: Remove time related checks.
18386 * m4/timevar.m4: New.
18387 * configure.in: Adjust.
18388 * src/system.h: Adjust to using timevar.h.
18389 * src/getargs.h, src/getargs.c: Support trace_time for
18390 --trace=time.
18391 * src/main.c (stage): Remove.
18392 (main): Replace `stage' invocations with timevar calls.
18393 * src/output.c: Insert pertinent timevar calls.
18394
183952002-07-31 Akim Demaille <akim@epita.fr>
18396
18397 Let --trace have arguments.
18398
18399 * src/getargs.h (enum trace_e): New.
18400 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
18401 (long_options, short_options): --trace/-T takes an optional
18402 argument.
18403 Change all the uses of trace_flag to reflect the new flags.
18404 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
18405
18406 Strengthen `stage' portability.
18407
18408 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
18409 * configure.in: Use it.
18410 Don't check for malloc.h and sys/times.h.
18411 * src/system.h: Include them when appropriate.
18412 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
18413 times and struct tms are available.
18414
184152002-07-30 Akim Demaille <akim@epita.fr>
18416
18417 In verbose parse error message, don't report `error' as an
18418 expected token.
18419 * tests/actions.at (Printers and Destructors): Adjust.
18420 * tests/calc.at (Calculator $1): Adjust.
18421 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
18422 error message, do not report the parser accepts the error token in
18423 that state.
18424
184252002-07-30 Akim Demaille <akim@epita.fr>
18426
18427 Normalize conflict related messages.
18428
18429 * src/complain.h, src/complain.c (warn, complain): New.
18430 * src/conflicts.c (conflicts_print): Use them.
18431 (conflict_report_yacc): New, extracted from...
18432 (conflicts_print): here.
18433 * tests/conflicts.at, tests/existing.at: Adjust.
18434
184352002-07-30 Akim Demaille <akim@epita.fr>
18436
18437 Report rules which are never reduced by the parser: those hidden
18438 by conflicts.
18439
18440 * src/LR0.c (save_reductions): Don't make the final state too
18441 different: save its reduction (accept) instead of having a state
18442 without any action (no shift or goto, no reduce).
18443 Note: the final state is now a ``regular'' state, i.e., the
18444 parsers now contain `reduce 0' as default reduction.
18445 Nevertheless, since they decide to `accept' when yystate =
18446 final_state, they still will not reduce rule 0.
18447 * src/print.c (print_actions, print_reduction): Adjust.
18448 * src/output.c (action_row): Track reduced rules.
18449 (token_actions): Report rules never reduced.
18450 * tests/conflicts.at, tests/regression.at: Adjust.
18451
184522002-07-30 Akim Demaille <akim@epita.fr>
18453
18454 `stage' was accidently included in a previous patch.
18455 Initiate its autoconfiscation.
18456
18457 * configure.in: Look for malloc.h and sys/times.h.
18458 * src/main.c (stage): Adjust.
18459 Report only when trace_flag.
18460
184612002-07-29 Akim Demaille <akim@epita.fr>
18462
18463 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
18464 state_number_t.
18465 (errs_t): symbol_t*, not symbol_number_t.
18466 (reductions_t): rule_t*, not rule_number_t.
18467 (FOR_EACH_SHIFT): New.
18468 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
18469 * src/print.c, src/print_graph.c: Adjust.
18470
184712002-07-29 Akim Demaille <akim@epita.fr>
18472
18473 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
18474
18475 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
18476 (endtoken, accept): these.
18477 * src/reader.c (reader): Set endtoken's default tag to "$end".
18478 Set undeftoken's tag to "$undefined" instead of "$undefined.".
18479 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
18480 Adjust.
18481
184822002-07-29 Akim Demaille <akim@epita.fr>
18483
18484 * src/reduce.c (reduce_grammar): When the language is empty,
18485 complain about the start symbol, not the axiom.
18486 Use its location.
18487 * tests/reduce.at (Empty Language): New.
18488
184892002-07-26 Akim Demaille <akim@epita.fr>
18490
18491 * src/reader.h, src/reader.c (gram_error): ... can't get
18492 yycontrol without making too strong assumptions on the parser
18493 itself.
18494 * src/output.c (prepare_tokens): Use the real 0th value of
18495 token_translations instead of `0'.
18496 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
18497 visible here.
18498 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
18499 for the time being: %locations ought to provide it to yyerror.
18500
185012002-07-25 Akim Demaille <akim@epita.fr>
18502
18503 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
18504 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
18505 * tests/regression.at (Web2c Actions): Adjust.
18506
185072002-07-25 Akim Demaille <akim@epita.fr>
18508
18509 Stop storing rules from 1 to nrules + 1.
18510
18511 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
18512 * src/nullable.c, src/output.c, src/print.c, src/reader.c
18513 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
18514 Iterate from 0 to nrules.
18515 Use rule_number_as_item_number and item_number_as_rule_number.
18516 Adjust to `derive' now containing possibly 0.
18517 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
18518 Handle the `- 1' part in rule numbers from/to item numbers.
18519 * src/conflicts.c (log_resolution): Fix the message which reversed
18520 shift and reduce.
18521 * src/output.c (action_row): Initialize default_rule to -1.
18522 (token_actions): Adjust.
18523 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
18524 expected output.
18525 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
18526
185272002-07-25 Akim Demaille <akim@epita.fr>
18528
18529 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
18530 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
18531 (b4_c_knr_arg_decl): New.
18532 * data/yacc.c: Use it to define yysymprint, yydestruct, and
18533 yyreport_parse_error.
18534
185352002-07-25 Akim Demaille <akim@epita.fr>
18536
18537 * data/yacc.c (yyreport_parse_error): New, extracted from...
18538 (yyparse): here.
18539 (yydestruct, yysymprint): Move above yyparse.
18540 Be K&R compliant.
18541
185422002-07-25 Akim Demaille <akim@epita.fr>
18543
18544 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
18545 replace...
18546 (b4_sint_type, b4_uint_type): these.
18547 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
18548 * tests/regression.at (Web2c Actions): Adjust.
18549
185502002-07-25 Akim Demaille <akim@epita.fr>
18551
18552 * src/gram.h (TIEM_NUMBER_MAX): New.
18553 (item_number_of_rule_number, rule_number_of_item_number): Rename
18554 as...
18555 (rule_number_as_item_number, item_number_as_rule_number): these.
18556 Adjust dependencies.
18557 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
18558 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
18559 (symbol_number_to_vector_number): New.
18560 (order): Of vector_number_t* type.
18561 (base_t, BASE_MAX, BASE_MIN): New.
18562 (froms, tos, width, pos, check): Of base_t type.
18563 (action_number_t, ACTION_MIN, ACTION_MAX): New.
18564 (actrow): Of action_number_t type.
18565 (conflrow): Of unsigned int type.
18566 (table_ninf, base_ninf): New.
18567 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
18568 (muscle_insert_int_table, muscle_insert_base_table)
18569 (muscle_insert_rule_number_table): New.
18570 (prepare_tokens): Output `toknum' as int_table.
18571 (action_row): Returns a rule_number_t.
18572 Use ACTION_MIN, not SHRT_MIN.
18573 (token_actions): yydefact is rule_number_t*.
18574 (table_ninf_remap): New.
18575 (pack_table): Use it for `base' and `table'.
18576 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
18577 replaced with...
18578 (YYPACT_NINF, YYTABLE_NINF): these.
18579 (yypact, yytable): Compute their types instead of hard-coded
18580 `short'.
18581 * tests/regression.at (Web2c Actions): Adjust.
18582
185832002-07-19 Akim Demaille <akim@epita.fr>
18584
18585 * src/scan-gram.l (id): Can start with an underscore.
18586
185872002-07-16 Akim Demaille <akim@epita.fr>
18588
18589 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
18590 Adjust all former `associativity' dependencies.
18591 * src/symtab.c (symbol_new): Default associativity is `undef', not
18592 `right'.
18593 (symbol_check_alias_consistence): Adjust.
18594
185952002-07-09 Akim Demaille <akim@epita.fr>
18596
18597 * doc/bison.texinfo: Properly set the ``header'' part.
18598 Use @dircategory ``GNU programming tools'' as per Texinfo's
18599 documentation.
18600 Use @copying.
18601
186022002-07-09 Akim Demaille <akim@epita.fr>
18603
18604 * lib/quotearg.h: Protect against multiple inclusions.
18605 * src/location.h (location_t): Add a `file' member.
18606 (LOCATION_RESET, LOCATION_PRINT): Adjust.
18607 * src/complain.c (warn_at, complain_at, fatal_at): Drop
18608 `error_one_per_line' support.
18609
186102002-07-09 Akim Demaille <akim@epita.fr>
18611
18612 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
18613 * src/reader.c (lineno): Remove.
18614 Adjust all dependencies.
18615 (get_merge_function): Take a location and use complain_at.
18616 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
18617 * tests/regression.at (Invalid inputs, Mixing %token styles):
18618 Adjust.
18619
186202002-07-09 Akim Demaille <akim@epita.fr>
18621
18622 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
18623 recovery rule, and forbid extensions when --yacc.
18624 (gram_error): Use complain_at.
18625 * src/reader.c (reader): Exit if there were parse errors.
18626
186272002-07-09 Akim Demaille <akim@epita.fr>
18628
18629 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
18630 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
18631 Reported by R Blake <blakers@mac.com>.
18632
186332002-07-09 Akim Demaille <akim@epita.fr>
18634
18635 * data/yacc.c: Output the copyright notive in the header.
18636
186372002-07-03 Akim Demaille <akim@epita.fr>
18638
18639 * src/output.c (froms, tos): Are state_number_t.
18640 (save_column): sp, sp1, and sp2 are state_number_t.
18641 (prepare): Rename `final' as `final_state_number', `nnts' as
18642 `nterms_number', `nrules' as `rules_number', `nstates' as
18643 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
18644 unused.
18645 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
18646 * data/lalr1.cc (nsym_): Remove, unused.
18647
186482002-07-03 Akim Demaille <akim@epita.fr>
18649
18650 * src/lalr.h, src/lalr.c (goto_number_t): New.
18651 * src/lalr.c (goto_list_t): New.
18652 Propagate them.
18653 * src/nullable.c (rule_list_t): New.
18654 Propagate.
18655 * src/types.h: Remove.
18656
186572002-07-03 Akim Demaille <akim@epita.fr>
18658
18659 * src/closure.c (print_fderives): Use rule_rhs_print.
18660 * src/derives.c (print_derives): Use rule_rhs_print.
18661 (rule_list_t): New, replaces `shorts'.
18662 (set_derives): Add comments.
18663 * tests/sets.at (Nullable, Firsts): Adjust.
18664
186652002-07-03 Akim Demaille <akim@epita.fr>
18666
18667 * src/output.c (prepare_actions): Free `tally' and `width'.
18668 (prepare_actions): Allocate and free `order'.
18669 * src/symtab.c (symbols_free): Free `symbols'.
18670 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
18671 * src/output.c (m4_invoke): Move to...
18672 * src/scan-skel.l: here.
18673 (<<EOF>>): Close yyout, and free its name.
18674
186752002-07-03 Akim Demaille <akim@epita.fr>
18676
18677 Fix some memory leaks, and fix a bug: state 0 was examined twice.
18678
18679 * src/LR0.c (new_state): Merge into...
18680 (state_list_append): this.
18681 (new_states): Merge into...
18682 (generate_states): here.
18683 (set_states): Don't ensure a proper `errs' state member here, do it...
18684 * src/conflicts.c (conflicts_solve): here.
18685 * src/state.h, src/state.c: Comment changes.
18686 (state_t): Rename member `shifts' as `transitions'.
18687 Adjust all dependencies.
18688 (errs_new): For consistency, also take the values as argument.
18689 (errs_dup): Remove.
18690 (state_errs_set): New.
18691 (state_reductions_set, state_transitions_set): Assert that no
18692 previous value was assigned.
18693 (state_free): New.
18694 (states_free): Use it.
18695 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
18696 temporary storage: use `errs' and `nerrs' as elsewhere.
18697 (set_conflicts): Allocate and free this `errs'.
18698
186992002-07-02 Akim Demaille <akim@epita.fr>
18700
18701 * lib/libiberty.h: New.
18702 * lib: Update the bitset implementation from upstream.
18703 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
18704 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
18705 * src/main.c: Adjust bitset stats calls.
18706
187072002-07-01 Paul Eggert <eggert@twinsun.com>
18708
18709 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
18710 char, so that negative chars don't collide with $.
18711
187122002-06-30 Akim Demaille <akim@epita.fr>
18713
18714 Have the GLR tests be `warning' checked, and fix the warnings.
18715
18716 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
18717 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
18718 (yyremoveDeletes): `yyi' and `yyj' are size_t.
18719 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
18720 (yyaddDeferredAction): static.
18721 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
18722 (yyreportParseError): yyprefix is const.
18723 yytokenp is used only when verbose.
18724 (yy__GNUC__): Replace with __GNUC__.
18725 (yypdumpstack): yyi is size_t.
18726 (yypreference): Un-yy local variables and arguments, to avoid
18727 clashes with `yyr1'. Anyway, we are not in the user name space.
18728 (yytname_size): be an int, as is compared with ints.
18729 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
18730 Use them.
18731 * tests/cxx-gram.at: Use quotation to protect $1.
18732 Use AT_COMPILE to enable warnings hunts.
18733 Prototype yylex and yyerror.
18734 `Use' argc.
18735 Include `string.h', not `strings.h'.
18736 Produce and prototype stmtMerge only when used.
18737 yylex takes a location.
18738
187392002-06-30 Akim Demaille <akim@epita.fr>
18740
18741 We spend a lot of time in quotearg, in particular when --verbose.
18742
18743 * src/symtab.c (symbol_get): Store a quoted version of the key.
18744 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
18745 Adjust all callers.
18746
187472002-06-30 Akim Demaille <akim@epita.fr>
18748
18749 * src/state.h (reductions_t): Rename member `nreds' as num.
18750 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
18751 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
18752
187532002-06-30 Akim Demaille <akim@epita.fr>
18754
18755 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
18756 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
18757 (shifts_to): Rename as...
18758 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
18759 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
18760 (TRANSITION_IS_DISABLED, transitions_to): these.
18761
187622002-06-30 Akim Demaille <akim@epita.fr>
18763
18764 * src/print.c (print_shifts, print_gotos): Merge into...
18765 (print_transitions): this.
18766 (print_transitions, print_errs, print_reductions): Align the
18767 lookaheads columns.
18768 (print_core, print_transitions, print_errs, print_state,
18769 print_grammar): Output empty lines separator before, not after.
18770 (state_default_rule_compute): Rename as...
18771 (state_default_rule): this.
18772 * tests/conflicts.at (Defaulted Conflicted Reduction),
18773 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
18774 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
18775
187762002-06-30 Akim Demaille <akim@epita.fr>
18777
18778 Display items as we display rules.
18779
18780 * src/gram.h, src/gram.c (rule_lhs_print): New.
18781 * src/gram.c (grammar_rules_partial_print): Use it.
18782 * src/print.c (print_core): Likewise.
18783 * tests/conflicts.at (Defaulted Conflicted Reduction),
18784 (Unresolved SR Conflicts): Adjust.
18785 (Unresolved SR Conflicts): Adjust and rename as...
18786 (Resolved SR Conflicts): this, as was meant.
18787 * tests/regression.at (Web2c Report): Adjust.
18788
187892002-06-30 Akim Demaille <akim@epita.fr>
18790
18791 * src/print.c (state_default_rule_compute): New, extracted from...
18792 (print_reductions): here.
18793 Pessimize, but clarify the code.
18794 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
18795
187962002-06-30 Akim Demaille <akim@epita.fr>
18797
18798 * src/output.c (action_row): Let default_rule be always a rule
18799 number.
18800
188012002-06-30 Akim Demaille <akim@epita.fr>
18802
18803 * src/closure.c (print_firsts, print_fderives, closure):
18804 Use BITSET_EXECUTE.
18805 * src/lalr.c (lookaheads_print): Likewise.
18806 * src/state.c (state_rule_lookaheads_print): Likewise.
18807 * src/print_graph.c (print_core): Likewise.
18808 * src/print.c (print_reductions): Likewise.
18809 * src/output.c (action_row): Likewise.
18810 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
18811
188122002-06-30 Akim Demaille <akim@epita.fr>
18813
18814 * src/print_graph.c: Use report_flag.
18815
188162002-06-30 Akim Demaille <akim@epita.fr>
18817
18818 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
18819 to...
18820 * src/relation.h, src/relation.c (traverse, relation_digraph)
18821 (relation_print, relation_transpose): New.
18822
188232002-06-30 Akim Demaille <akim@epita.fr>
18824
18825 * src/state.h, src/state.c (shifts_to): New.
18826 * src/lalr.c (build_relations): Use it.
18827
188282002-06-30 Akim Demaille <akim@epita.fr>
18829
18830 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
18831 (item_number_of_rule_number, rule_number_of_item_number): New.
18832 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
18833 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
18834 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
18835 Propagate their use.
18836 Much remains to be done, in particular wrt `shorts' from types.h.
18837
188382002-06-30 Akim Demaille <akim@epita.fr>
18839
18840 * src/symtab.c (symbol_new): Initialize the `printer' member.
18841
188422002-06-30 Akim Demaille <akim@epita.fr>
18843
18844 * src/LR0.c (save_reductions): Remove, replaced by...
18845 * src/state.h, src/state.c (state_reductions_set): New.
18846 (reductions, errs): Rename as...
18847 (reductions_t, errs_t): these.
18848 Adjust all dependencies.
18849
188502002-06-30 Akim Demaille <akim@epita.fr>
18851
18852 * src/LR0.c (state_list_t, state_list_append): New.
18853 (first_state, last_state): Now symbol_list_t.
18854 (this_state): Remove.
18855 (new_itemsets, append_states, save_reductions): Take a state_t as
18856 argument.
18857 (set_states, generate_states): Adjust.
18858 (save_shifts): Remove, replaced by...
18859 * src/state.h, src/state.c (state_shifts_set): New.
18860 (shifts): Rename as...
18861 (shifts_t): this.
18862 Adjust all dependencies.
18863 * src/state.h (state_t): Remove the `next' member.
18864
188652002-06-30 Akim Demaille <akim@epita.fr>
18866
18867 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
18868 escaped in slot 0.
18869
188702002-06-30 Akim Demaille <akim@epita.fr>
18871
18872 Use hash.h for the state hash table.
18873
18874 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
18875 (allocate_storage): Use state_hash_new.
18876 (free_storage): Use state_hash_free.
18877 (new_state, get_state): Adjust.
18878 * src/lalr.h, src/lalr.c (states): Move to...
18879 * src/states.h (state_t): Remove the `link' member, no longer
18880 used.
18881 * src/states.h, src/states.c: here.
18882 (state_hash_new, state_hash_free, state_hash_lookup)
18883 (state_hash_insert, states_free): New.
18884 * src/states.c (state_table, state_compare, state_hash): New.
18885 * src/output.c (output_actions): Do not free states now, since we
18886 still need to know the final_state number in `prepare', called
18887 afterwards. Do it...
18888 * src/main.c (main): here: call states_free after `output'.
18889
188902002-06-30 Akim Demaille <akim@epita.fr>
18891
18892 * src/state.h, src/state.c (state_new): New, extracted from...
18893 * src/LR0.c (new_state): here.
18894 * src/state.h (STATE_ALLOC): Move to...
18895 * src/state.c: here.
18896 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
18897 * src/state.h, src/state.c: here.
18898
188992002-06-30 Akim Demaille <akim@epita.fr>
18900
18901 * src/reader.c (gensym): Rename as...
18902 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
18903 (getsym): Rename as...
18904 (symbol_get): this.
18905
189062002-06-30 Akim Demaille <akim@epita.fr>
18907
18908 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
18909 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
18910 * src/output.c, src/print.c, src/print_graph.c: Propagate.
18911 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
18912
189132002-06-30 Akim Demaille <akim@epita.fr>
18914
18915 Make the test suite pass with warnings checked.
18916
18917 * tests/actions.at (Printers and Destructors): Improve.
18918 Avoid unsigned vs. signed issues.
18919 * tests/calc.at: Don't exercise the scanner here, do it...
18920 * tests/input.at (Torturing the Scanner): here.
18921
189222002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18923
18924 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
18925 reorganize first lines parallel to yacc.c.
18926
189272002-06-28 Akim Demaille <akim@epita.fr>
18928
18929 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
18930 (b4_token_enum, b4_token_defines): New, factored from...
18931 * data/lalr1.cc, data/yacc.c, glr.c: here.
18932
189332002-06-28 Akim Demaille <akim@epita.fr>
18934
18935 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
18936 unused variables.
18937 * src/output.c (merger_output): static.
18938
189392002-06-28 Akim Demaille <akim@epita.fr>
18940
18941 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
18942 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
18943 pacify GCC.
18944 * src/output.c (save_row): Initialize all the variables to pacify GCC.
18945
189462002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18947
18948 Accumulated changelog for new GLR parsing features.
18949
18950 * src/conflicts.c (count_total_conflicts): Change name to
18951 conflicts_total_count.
18952 * src/conflicts.h: Ditto.
18953 * src/output.c (token_actions): Use the new name.
18954 (output_conflicts): Change conflp => conflict_list_heads, and
18955 confl => conflict_list for better readability.
18956 * data/glr.c: Use the new names.
18957 * NEWS: Add self to GLR announcement.
18958
18959 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
18960
18961 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
18962 Akim Demaille.
18963
18964 * data/bison.glr: Change name to glr.c
18965 * data/glr.c: Renamed from bison.glr.
18966 * data/Makefile.am: Add glr.c
18967
18968 * src/getargs.c:
18969
18970 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
18971 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
18972
18973 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18974
18975 * data/bison.glr: Be sure to restore the
18976 current #line when returning to the skeleton contents after having
18977 exposed the input file's #line.
18978
18979 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18980
18981 * data/bison.glr: Bring up to date with changes to bison.simple.
18982
18983 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18984
18985 * data/bison.glr: Correct definitions that use b4_prefix.
18986 Various reformatting.
18987 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
18988 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
18989 yytokenp argument; now part of stack.
18990 (yychar): Define to behave as documented.
18991 (yyclearin): Ditto.
18992
18993 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18994
18995 * src/reader.h: Add declaration for free_merger_functions.
18996
18997 * src/reader.c (merge_functions): New variable.
18998 (get_merge_function): New function.
18999 (free_merger_functions): New function.
19000 (readgram): Check for %prec that is not followed by a symbol.
19001 Handle %dprec and %merge declarations.
19002 (packgram): Initialize dprec and merger fields in rules array.
19003
19004 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
19005 conflict_list_cnt, conflict_list_free): New variables.
19006 (table_grow): Also grow conflict_table.
19007 (prepare_rules): Output dprec and merger tables.
19008 (conflict_row): New function.
19009 (action_row): Output conflict lists for GLR parser. Don't use
19010 default reduction in conflicted states for GLR parser so that there
19011 are spaces for the conflict lists.
19012 (save_row): Also save conflict information.
19013 (token_actions): Allocate conflict list.
19014 (merger_output): New function.
19015 (pack_vector): Pack conflict table, too.
19016 (output_conflicts): New function to output yyconflp and yyconfl.
19017 (output_check): Allocate conflict_tos.
19018 (output_actions): Output conflict tables, also.
19019 (output_skeleton): Output b4_mergers definition.
19020 (prepare): Output b4_max_rhs_length definition.
19021 Use 'bison.glr' as default skeleton for GLR parsers.
19022
19023 * src/gram.c (glr_parser): New flag.
19024 (grammar_free): Call free_merger_functions.
19025
19026 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
19027 all pairs of conflicting reductions, rather than just all tokens
19028 causing conflicts. Needed to size conflict tables.
19029 (conflicts_output): Modify call to count_rr_conflicts for new
19030 interface.
19031 (conflicts_print): Ditto.
19032 (count_total_conflicts): New function.
19033
19034 * src/reader.h (merger_list): New type.
19035 (merge_functions): New variable.
19036
19037 * src/lex.h (tok_dprec, tok_merge): New token types.
19038
19039 * src/gram.h (rule_s): Add dprec and merger fields.
19040 (glr_parser): New flag.
19041
19042 * src/conflicts.h (count_total_conflicts): New function.
19043
19044 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
19045
19046 * doc/bison.texinfo (Generalized LR Parsing): New section.
19047 (GLR Parsers): New section.
19048 (Language and Grammar): Mention GLR parsing.
19049 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
19050 Correct typo ("tge" -> "the").
19051
19052 * data/bison.glr: New skeleton for GLR parsing.
19053
19054 * tests/cxx-gram.at: New tests for GLR parsing.
19055
19056 * tests/testsuite.at: Include cxx-gram.at.
19057
19058 * tests/Makefile.am: Add cxx-gram.at.
19059
19060 * src/parse-gram.y:
19061
19062 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
19063
19064 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
19065
190662002-06-27 Akim Demaille <akim@epita.fr>
19067
19068 * src/options.h, src/options.c: Remove.
19069 * src/getargs.c (short_options, long_options): New.
19070
190712002-06-27 Akim Demaille <akim@epita.fr>
19072
19073 * data/bison.simple, data/bison.c++: Rename as...
19074 * data/yacc.c, data/lalr1.cc: these.
19075 * doc/bison.texinfo (Environment Variables): Remove.
19076
190772002-06-25 Raja R Harinath <harinath@cs.umn.edu>
19078
19079 * src/getargs.c (report_argmatch): Initialize strtok().
19080
190812002-06-20 Akim Demaille <akim@epita.fr>
19082
19083 * data/bison.simple (b4_symbol_actions): New, replaces...
19084 (b4_symbol_destructor, b4_symbol_printer): these.
19085 (yysymprint): Be sure to call YYPRINT only for tokens, and using
19086 user token numbers.
19087
190882002-06-20 Akim Demaille <akim@epita.fr>
19089
19090 * data/bison.simple (yydestructor): Rename as...
19091 (yydestruct): this.
19092
190932002-06-20 Akim Demaille <akim@epita.fr>
19094
19095 * src/symtab.h, src/symtab.c (symbol_type_set)
19096 (symbol_destructor_set, symbol_precedence_set): The location is
19097 the last argument.
19098 Adjust all callers.
19099
191002002-06-20 Akim Demaille <akim@epita.fr>
19101
19102 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
19103 internals.
19104 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
19105 Takes a location.
19106 * src/symtab.h, src/symtab.c (symbol_class_set)
19107 (symbol_user_token_number_set): Likewise.
19108 Adjust all callers.
19109 Promote complain_at.
19110 * tests/input.at (Type Clashes): Adjust.
19111
191122002-06-20 Akim Demaille <akim@epita.fr>
19113
19114 * data/bison.simple (YYLEX): Fix the declaration when
19115 %pure-parser.
19116
191172002-06-20 Akim Demaille <akim@epita.fr>
19118
19119 * data/bison.simple (yysymprint): Don't print the token number,
19120 just its name.
19121 * tests/actions.at (Destructors): Rename as...
19122 (Printers and Destructors): this.
19123 Also exercise %printer.
19124
191252002-06-20 Akim Demaille <akim@epita.fr>
19126
19127 * data/bison.simple (YYDSYMPRINT): New.
19128 Use it to remove many of the #if YYDEBUG/if (yydebug).
19129
191302002-06-20 Akim Demaille <akim@epita.fr>
19131
19132 * src/symtab.h, src/symtab.c (symbol_t): printer and
19133 printer_location are new members.
19134 (symbol_printer_set): New.
19135 * src/parse-gram.y (PERCENT_PRINTER): New token.
19136 Handle its associated rule.
19137 * src/scan-gram.l: Adjust.
19138 (handle_destructor_at, handle_destructor_dollar): Rename as...
19139 (handle_symbol_code_at, handle_symbol_code_dollar): these.
19140 * src/output.c (symbol_printers_output): New.
19141 (output_skeleton): Call it.
19142 * data/bison.simple (yysymprint): New. Cannot be named yyprint
19143 since there are already many grammar files with a user `yyprint'.
19144 Replace the calls to YYPRINT to calls to yysymprint.
19145 * tests/calc.at: Adjust.
19146 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
19147 taking advantage of parser very internal details (stack size!).
19148
191492002-06-20 Akim Demaille <akim@epita.fr>
19150
19151 * src/scan-gram.l: Complete the scanner with the missing patterns
19152 to pacify Flex.
19153 Use `quote' and `symbol_tag_get' where appropriate.
19154
191552002-06-19 Akim Demaille <akim@epita.fr>
19156
19157 * tests/actions.at (Destructors): Augment to test locations.
19158 * data/bison.simple (yydestructor): Pass it the current location
19159 if locations are enabled.
19160 Prototype only when __STDC__ or C++.
19161 Change the argument names to move into the yy name space: there is
19162 user code here.
19163
191642002-06-19 Akim Demaille <akim@epita.fr>
19165
19166 * data/bison.simple (b4_pure_if): New.
19167 Use it instead of #ifdef YYPURE.
19168
191692002-06-19 Akim Demaille <akim@epita.fr>
19170
19171 * data/bison.simple (b4_location_if): New.
19172 Use it instead of #ifdef YYLSP_NEEDED.
19173
191742002-06-19 Akim Demaille <akim@epita.fr>
19175
19176 Prepare @$ in %destructor, but currently don't bind it in the
19177 skeleton, as %location use is not cleaned up yet.
19178
19179 * src/scan-gram.l (handle_dollar, handle_destructor_at)
19180 (handle_action_at): New.
19181 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
19182 a braced_code_t and a location as additional arguments.
19183 (handle_destructor_dollar): Instead of requiring `b4_eval', just
19184 unquote one when outputting `b4_dollar_dollar'.
19185 Adjust callers.
19186 * data/bison.simple (b4_eval): Remove.
19187 (b4_symbol_destructor): Adjust.
19188 * tests/input.at (Invalid @n): Adjust.
19189
191902002-06-19 Zack Weinberg <zack@codesourcery.com>
19191
19192 * doc/bison.texinfo: Document ability to have multiple
19193 prologue sections.
19194
191952002-06-18 Akim Demaille <akim@epita.fr>
19196
19197 * src/files.c (compute_base_names): When computing the output file
19198 names from the input file name, strip the directory part.
19199
192002002-06-18 Akim Demaille <akim@epita.fr>
19201
19202 * data/bison.simple.new: Comment changes.
19203 Reported by Andreas Schwab.
19204
192052002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
19206
19207 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
19208 there are no `label `yyoverflowlab' defined but not used' warnings
19209 when yyoverflow is defined.
19210
192112002-06-18 Akim Demaille <akim@epita.fr>
19212
19213 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
19214 new member.
19215 (symbol_destructor_set): Adjust.
19216 * src/output.c (symbol_destructors_output): Output the destructor
19217 locations.
19218 Output the symbol name.
19219 * data/bison.simple (b4_symbol_destructor): Adjust.
19220
192212002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
19222 and Akim Demaille <akim@epita.fr>
19223
19224 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
19225 what's left on the stack when the error recovery hits EOF.
19226 * tests/actions.at (Destructors): Complete to exercise this case.
19227
192282002-06-17 Akim Demaille <akim@epita.fr>
19229
19230 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
19231 arguments is really empty, not only equal to `[]'.
19232 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
19233 member.
19234 (symbol_destructor_set): New.
19235 * src/output.c (symbol_destructors_output): New.
19236 * src/reader.h (brace_code_t, current_braced_code): New.
19237 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
19238 (handle_dollar): Rename as...
19239 (handle_action_dollar): this.
19240 (handle_destructor_dollar): New.
19241 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
19242 (grammar_declaration): Use it.
19243 * data/bison.simple (yystos): Is always defined.
19244 (yydestructor): New.
19245 * tests/actions.at (Destructors): New.
19246 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
19247
192482002-06-17 Akim Demaille <akim@epita.fr>
19249
19250 * src/symlist.h, src/symlist.c (symbol_list_length): New.
19251 * src/scan-gram.l (handle_dollar, handle_at): Compute the
19252 rule_length only when needed.
19253 * src/output.c (actions_output, token_definitions_output): Output
19254 the full M4 block.
19255 * src/symtab.c: Don't access directly to the symbol tag, use
19256 symbol_tag_get.
19257 * src/parse-gram.y: Use symbol_list_free.
19258
192592002-06-17 Akim Demaille <akim@epita.fr>
19260
19261 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
19262 (symbol_list_prepend, get_type_name): Move to...
19263 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
19264 (symbol_list_prepend, symbol_list_n_type_name_get): here.
19265 Adjust all callers.
19266 (symbol_list_free): New.
19267 * src/scan-gram.l (handle_dollar): Takes a location.
19268 * tests/input.at (Invalid $n): Adjust.
19269
192702002-06-17 Akim Demaille <akim@epita.fr>
19271
19272 * src/reader.h, src/reader.c (symbol_list_new): Export it.
19273 (symbol_list_prepend): New.
19274 * src/parse-gram.y (%union): `list' is a new member.
19275 (symbols.1): New, replaces...
19276 (terms_to_prec.1, nterms_to_type.1): these.
19277 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
19278 Take a location as additional argument.
19279 Adjust all callers.
19280
192812002-06-15 Akim Demaille <akim@epita.fr>
19282
19283 * src/parse-gram.y: Move %token in the declaration section so that
19284 we don't depend upon CVS Bison.
19285
192862002-06-15 Akim Demaille <akim@epita.fr>
19287
19288 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
19289 * src/print.c (print_core): Use it.
19290
192912002-06-15 Akim Demaille <akim@epita.fr>
19292
19293 * src/conflicts.c (log_resolution): Accept the rule involved in
19294 the sr conflicts instead of the lookahead number that points to
19295 that rule.
19296 (flush_reduce): Accept the current lookahead vector as argument,
19297 instead of the index in LA.
19298 (resolve_sr_conflict): Accept the current number of lookahead
19299 bitset to consider for the STATE, instead of the index in LA.
19300 (set_conflicts): Adjust.
19301 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
19302
193032002-06-15 Akim Demaille <akim@epita.fr>
19304
19305 * src/state.h (state_t): Replace the `lookaheadsp' member, a
19306 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
19307 Adjust all dependencies.
19308 * src/lalr.c (initialize_lookaheads): Split into...
19309 (states_lookaheads_count, states_lookaheads_initialize): these.
19310 (lalr): Adjust.
19311
193122002-06-15 Akim Demaille <akim@epita.fr>
19313
19314 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
19315 out of...
19316 (grammar_rules_print): here.
19317 * src/reduce.c (reduce_output): Use it.
19318 * tests/reduce.at (Useless Rules, Reduced Automaton)
19319 (Underivable Rules): Adjust.
19320
193212002-06-15 Akim Demaille <akim@epita.fr>
19322
19323 Copy BYacc's nice way to report the grammar.
19324
19325 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
19326 New.
19327 Don't print the rules' location, it is confusing and useless.
19328 (rule_print): Use grammar_rhs_print.
19329 * src/print.c (print_grammar): Use grammar_rules_print.
19330
193312002-06-15 Akim Demaille <akim@epita.fr>
19332
19333 Complete and rationalize `useless thing' warnings.
19334
19335 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
19336 (symbol_tag_print): New.
19337 Use them everywhere in place of accessing directly the tag member.
19338 * src/gram.h, src/gram.c (rule_print): New.
19339 Use it where a rule used to be printed `by hand'.
19340 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
19341 (reduce_grammar_tables): Report the useless rules.
19342 (reduce_print): Useless things are a warning, not an error.
19343 Report it as such.
19344 * tests/reduce.at (Useless Nonterminals, Useless Rules):
19345 (Reduced Automaton, Underivable Rules): Adjust.
19346 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
19347 * tests/conflicts.at (Unresolved SR Conflicts)
19348 (Solved SR Conflicts): Adjust.
19349
193502002-06-15 Akim Demaille <akim@epita.fr>
19351
19352 Let symbols have a location.
19353
19354 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
19355 (getsym): Adjust.
19356 Adjust all callers.
19357 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
19358 Use location_t, not int.
19359 * src/symtab.c (symbol_check_defined): Take advantage of the
19360 location.
19361 * tests/regression.at (Invalid inputs): Adjust.
19362
193632002-06-15 Akim Demaille <akim@epita.fr>
19364
19365 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
19366 (input): Don't try to initialize yylloc here, do it in the
19367 scanner.
19368 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
19369 * src/gram.h (rule_t): Change line and action_line into location
19370 and action_location, of location_t type.
19371 Adjust all dependencies.
19372 * src/location.h, src/location.c (empty_location): New.
19373 * src/reader.h, src/reader.c (grammar_start_symbol_set)
19374 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
19375 (grammar_current_rule_symbol_append)
19376 (grammar_current_rule_action_append): Expect a location as argument.
19377 * src/reader.c (grammar_midrule_action): Adjust to attach an
19378 action's location as dummy symbol location.
19379 * src/symtab.h, src/symtab.c (startsymbol_location): New.
19380 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
19381 the line numbers.
19382
193832002-06-14 Akim Demaille <akim@epita.fr>
19384
19385 Grammar declarations may be found in the grammar section.
19386
19387 * src/parse-gram.y (rules_or_grammar_declaration): New.
19388 (declarations): Each declaration may end with a semicolon, not
19389 just...
19390 (grammar_declaration): `"%union"'.
19391 (grammar): Branch to rules_or_grammar_declaration.
19392
193932002-06-14 Akim Demaille <akim@epita.fr>
19394
19395 * src/main.c (main): Invoke scanner_free.
19396
193972002-06-14 Akim Demaille <akim@epita.fr>
19398
19399 * src/output.c (m4_invoke): Extracted from...
19400 (output_skeleton): here.
19401 Free tempfile.
19402
194032002-06-14 Akim Demaille <akim@epita.fr>
19404
19405 * src/parse-gram.y (directives, directive, gram)
19406 (grammar_directives, precedence_directives, precedence_directive):
19407 Rename as...
19408 (declarations, declaration, grammar, grammar_declaration)
19409 (precedence_declaration, precedence_declarator): these.
19410 (symbol_declaration): New.
19411
194122002-06-14 Akim Demaille <akim@epita.fr>
19413
19414 * src/files.c (action_obstack): Remove, unused.
19415 (output_obstack): Remove it, and all its dependencies, as it is no
19416 longer needed.
19417 * src/reader.c (epilogue_set): Build the epilogue in the
19418 muscle_obstack.
19419 * src/output.h, src/output.c (muscle_obstack): Move to...
19420 * src/muscle_tab.h, src/muscle_tab.h: here.
19421 (muscle_init): Initialize muscle_obstack.
19422 (muscle_free): New.
19423 * src/main.c (main): Call it.
19424
194252002-06-14 Akim Demaille <akim@epita.fr>
19426
19427 * src/location.h: New, extracted from...
19428 * src/reader.h: here.
19429 * src/Makefile.am (noinst_HEADERS): Merge into
19430 (bison_SOURCES): this.
19431 Add location.h.
19432 * src/parse-gram.y: Use location_t instead of Bison's.
19433 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
19434 Use location_t instead of ints.
19435
194362002-06-14 Akim Demaille <akim@epita.fr>
19437
19438 * data/bison.simple, data/bison.c++: Be sure to restore the
19439 current #line when returning to the skeleton contents after having
19440 exposed the input file's #line.
19441
194422002-06-12 Akim Demaille <akim@epita.fr>
19443
19444 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
19445 eager.
19446 * tests/actions.at (Exotic Dollars): New.
19447
194482002-06-12 Akim Demaille <akim@epita.fr>
19449
19450 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
19451 ['"/] too eagerly.
19452 * tests/input.at (Torturing the Scanner): New.
19453
194542002-06-11 Akim Demaille <akim@epita.fr>
19455
19456 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
19457 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
19458 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
19459 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
19460 * src/reader.c (reader): Use it.
19461
194622002-06-11 Akim Demaille <akim@epita.fr>
19463
19464 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
19465 Adjust all callers.
19466 (scanner_last_string_free): New.
19467
194682002-06-11 Akim Demaille <akim@epita.fr>
19469
19470 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
19471 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
19472 (last_string, YY_OBS_FREE): New.
19473 Use them when returning an ID.
19474
194752002-06-11 Akim Demaille <akim@epita.fr>
19476
19477 Have Bison grammars parsed by a Bison grammar.
19478
19479 * src/reader.c, src/reader.h (prologue_augment): New.
19480 * src/reader.c (copy_definition): Remove.
19481
19482 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
19483 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
19484 (grammar_current_rule_prec_set, grammar_current_rule_check)
19485 (grammar_current_rule_symbol_append)
19486 (grammar_current_rule_action_append): Export.
19487 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
19488 (symbol_list_action_append): Remove.
19489 Hook the routines from reader.
19490 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
19491 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
19492
19493 * src/reader.c (read_declarations): Remove, unused.
19494
19495 * src/parse-gram.y: Handle the epilogue.
19496 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
19497 (grammar_start_symbol_set): this.
19498 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
19499 * src/reader.c (readgram): Remove, unused.
19500 (reader): Adjust to insert eoftoken and axiom where appropriate.
19501
19502 * src/reader.c (copy_dollar): Replace with...
19503 * src/scan-gram.h (handle_dollar): this.
19504 * src/parse-gram.y: Remove `%thong'.
19505
19506 * src/reader.c (copy_at): Replace with...
19507 * src/scan-gram.h (handle_at): this.
19508
19509 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
19510 New.
19511
19512 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
19513 time being.
19514
19515 * src/reader.h, src/reader.c (grammar_rule_end): New.
19516
19517 * src/parse.y (current_type, current_class): New.
19518 Implement `%nterm', `%token' support.
19519 Merge `%term' into `%token'.
19520 (string_as_id): New.
19521 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
19522 type name.
19523
19524 * src/parse-gram.y: Be sure to handle properly the beginning of
19525 rules.
19526
19527 * src/parse-gram.y: Handle %type.
19528 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
19529
19530 * src/parse-gram.y: More directives support.
19531 * src/options.c: No longer handle source directives.
19532
19533 * src/parse-gram.y: Fix %output.
19534
19535 * src/parse-gram.y: Handle %union.
19536 Use the prologue locations.
19537 * src/reader.c (parse_union_decl): Remove.
19538
19539 * src/reader.h, src/reader.c (epilogue_set): New.
19540 * src/parse-gram.y: Use it.
19541
19542 * data/bison.simple, data/bison.c++: b4_stype is now either not
19543 defined, then default to int, or to the contents of %union,
19544 without `union' itself.
19545 Adjust.
19546 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
19547
19548 * src/output.c (actions_output): Don't output braces, as they are
19549 already handled by the scanner.
19550
19551 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
19552 characters to themselves.
19553
19554 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
19555 that the epilogue has a proper #line.
19556
19557 * src/parse-gram.y: Handle precedence/associativity.
19558
19559 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
19560 a terminal.
19561 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
19562 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
19563 at all to define terminals that cannot be emitted.
19564
19565 * src/scan-gram.l: Escape M4 characters.
19566
19567 * src/scan-gram.l: Working properly with escapes in user
19568 strings/characters.
19569
19570 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
19571 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
19572 grammar.
19573 Use more modest sizes, as for the time being the parser does not
19574 release memory, and therefore the process swallows a huge amount
19575 of memory.
19576
19577 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
19578 stricter %token grammar.
19579
19580 * src/symtab.h (associativity): Add `undef_assoc'.
19581 (symbol_precedence_set): Do nothing when passed an undef_assoc.
19582 * src/symtab.c (symbol_check_alias_consistence): Adjust.
19583
19584 * tests/regression.at (Invalid %directive): Remove, as it is now
19585 meaningless.
19586 (Invalid inputs): Adjust to the new error messages.
19587 (Token definitions): The new grammar doesn't allow too many
19588 eccentricities.
19589
19590 * src/lex.h, src/lex.c: Remove.
19591 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
19592 (copy_character, copy_string2, copy_string, copy_identifier)
19593 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
19594 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
19595 (parse_action): Remove.
19596 * po/POTFILES.in: Adjust.
19597
195982002-06-11 Akim Demaille <akim@epita.fr>
19599
19600 * src/reader.c (parse_action): Don't store directly into the
19601 rule's action member: return the action as a string.
19602 Don't require `rule_length' as an argument: compute it.
19603 (grammar_current_rule_symbol_append)
19604 (grammar_current_rule_action_append): New, eved out from
19605 (readgram): here.
19606 Remove `action_flag', `rulelength', unused now.
19607
196082002-06-11 Akim Demaille <akim@epita.fr>
19609
19610 * src/reader.c (grammar_current_rule_prec_set).
19611 (grammar_current_rule_check): New, eved out from...
19612 (readgram): here.
19613 Remove `xaction', `first_rhs': useless.
19614 * tests/input.at (Type clashes): New.
19615 * tests/existing.at (GNU Cim Grammar): Adjust.
19616
196172002-06-11 Akim Demaille <akim@epita.fr>
19618
19619 * src/reader.c (grammar_midrule_action): New, Eved out from
19620 (readgram): here.
19621
196222002-06-11 Akim Demaille <akim@epita.fr>
19623
19624 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
19625 New.
19626 (readgram): Use them as replacement of inlined code, crule and
19627 crule1.
19628
196292002-06-11 Akim Demaille <akim@epita.fr>
19630
19631 * src/reader.c (grammar_end, grammar_symbol_append): New.
19632 (readgram): Use them.
19633 Make the use of `p' as local as possible.
19634
196352002-06-10 Akim Demaille <akim@epita.fr>
19636
19637 GCJ's parser requires the tokens to be defined before the prologue.
19638
19639 * data/bison.simple: Output the token definition before the user's
19640 prologue.
19641 * tests/regression.at (Braces parsing, Duplicate string)
19642 (Mixing %token styles): Check the output from bison.
19643 (Early token definitions): New.
19644
196452002-06-10 Akim Demaille <akim@epita.fr>
19646
19647 * src/symtab.c (symbol_user_token_number_set): Don't complain when
19648 assigning twice the same user number to a token, so that we can
19649 use it in...
19650 * src/lex.c (lex): here.
19651 Also use `symbol_class_set' instead of hand written code.
19652 * src/reader.c (parse_assoc_decl): Likewise.
19653
196542002-06-10 Akim Demaille <akim@epita.fr>
19655
19656 * src/symtab.c, src/symtab.c (symbol_class_set)
19657 (symbol_user_token_number_set): New.
19658 * src/reader.c (parse_token_decl): Use them.
19659 Use a switch instead of ifs.
19660 Use a single argument.
19661
196622002-06-10 Akim Demaille <akim@epita.fr>
19663
19664 Remove `%thong' support as it is undocumented, unused, duplicates
19665 `%token's job, and creates useless e-mail traffic with people who
19666 want to know what it is, why it is undocumented, unused, and
19667 duplicates `%token's job.
19668
19669 * src/reader.c (parse_thong_decl): Remove.
19670 * src/options.c (option_table): Remove "thong".
19671 * src/lex.h (tok_thong): Remove.
19672
196732002-06-10 Akim Demaille <akim@epita.fr>
19674
19675 * src/symtab.c, src/symtab.c (symbol_type_set)
19676 (symbol_precedence_set): New.
19677 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
19678 (value_components_used): Remove, unused.
19679
196802002-06-09 Akim Demaille <akim@epita.fr>
19681
19682 Move symbols handling code out of the reader.
19683
19684 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
19685 (axiom): Move to...
19686 * src/symtab.h, src/symtab.c: here.
19687
19688 * src/gram.c (start_symbol): Remove: use startsymbol->number.
19689 * src/reader.c (startval): Rename as...
19690 * src/symtab.h, src/symtab.c (startsymbol): this.
19691 * src/reader.c: Adjust.
19692
19693 * src/reader.c (symbol_check_defined, symbol_make_alias)
19694 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
19695 (token_translations_init)
19696 Move to...
19697 * src/symtab.c: here.
19698 * src/reader.c (packsymbols): Move to...
19699 * src/symtab.h, src/symtab.c (symbols_pack): here.
19700 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
19701 argument.
19702
197032002-06-03 Akim Demaille <akim@epita.fr>
19704
19705 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
19706 then statements.
19707
197082002-06-03 Akim Demaille <akim@epita.fr>
19709
19710 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
19711 structs with non literals.
19712 * src/scan-skel.l: never-interactive.
19713 * src/conflicts.c (enum conflict_resolution_e): No trailing
19714 comma.
19715 * src/getargs.c (usage): Split long literal strings.
19716 Reported by Hans Aberg.
19717
197182002-05-28 Akim Demaille <akim@epita.fr>
19719
19720 * data/bison.c++: Use C++ ostreams.
19721 (cdebug_): New member.
19722
197232002-05-28 Akim Demaille <akim@epita.fr>
19724
19725 * src/output.c (output_skeleton): Be sure to allocate enough room
19726 for `/' _and_ for `\0' in full_skeleton.
19727
197282002-05-28 Akim Demaille <akim@epita.fr>
19729
19730 * data/bison.c++: Catch up with bison.simple:
19731 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19732 and Paul Eggert <eggert@twinsun.com>: `error' handing.
19733 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
19734 and popping traces.
19735
197362002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19737
19738 * src/output.c (output_skeleton): Put an explicit path in front of
19739 the skeleton file name, rather than relying on the -I directory,
19740 to partially alleviate effects of having a skeleton file lying around
19741 in the current directory.
19742
197432002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19744
19745 * src/conflicts.c (log_resolution): Correct typo:
19746 obstack_printf should be obstack_fgrow1.
19747
197482002-05-26 Akim Demaille <akim@epita.fr>
19749
19750 * src/state.h (state_t): `solved_conflicts' is a new member.
19751 * src/LR0.c (new_state): Set it to 0.
19752 * src/conflicts.h, src/conflicts.c (print_conflicts)
19753 (free_conflicts, solve_conflicts): Rename as...
19754 (conflicts_print, conflicts_free, conflicts_solve): these.
19755 Adjust callers.
19756 * src/conflicts.c (enum conflict_resolution_e)
19757 (solved_conflicts_obstack): New, used by...
19758 (log_resolution): this.
19759 Adjust to attach the conflict resolution to each state.
19760 Complete the description with the precedence/associativity
19761 information.
19762 (resolve_sr_conflict): Adjust.
19763 * src/print.c (print_state): Output its solved_conflicts.
19764 * tests/conflicts.at (Unresolved SR Conflicts)
19765 (Solved SR Conflicts): Exercise --report=all.
19766
197672002-05-26 Akim Demaille <akim@epita.fr>
19768
19769 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
19770 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
19771 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
19772 (token_number_t, item_number_as_token_number)
19773 (token_number_as_item_number, muscle_insert_token_number_table):
19774 Rename as...
19775 (symbol_number_t, item_number_as_symbol_number)
19776 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
19777 these, since it is more appropriate.
19778
197792002-05-26 Akim Demaille <akim@epita.fr>
19780
19781 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
19782 `Error:' lines.
19783 * data/bison.simple (yystos) [YYDEBUG]: New.
19784 (yyparse) [YYDEBUG]: Display the symbols which are popped during
19785 error recovery.
19786 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
19787
197882002-05-25 Akim Demaille <akim@epita.fr>
19789
19790 * doc/bison.texinfo (Debugging): Split into...
19791 (Tracing): this new section, its former contents, and...
19792 (Understanding): this new section.
19793 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
19794 by...
19795 (report_flag): this.
19796 Adjust all dependencies.
19797 (report_args, report_types, report_argmatch): New.
19798 (usage, getargs): Report/support -r, --report.
19799 * src/options.h
19800 (struct option_table_struct): Rename as..,
19801 (struct option_table_s): this.
19802 Rename the `set_flag' member to `flag' to match with getopt_long's
19803 struct.
19804 * src/options.c (option_table): Split verbose into an entry for
19805 %verbose, and another for --verbose.
19806 Support --report/-r, so remove -r from the obsolete --raw.
19807 * src/print.c: Attach full item sets and lookaheads reports to
19808 report_flag instead of trace_flag.
19809 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
19810
198112002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19812 and Paul Eggert <eggert@twinsun.com>
19813
19814 * data/bison.simple (yyparse): Correct error handling to conform to
19815 POSIX and yacc. Specifically, after syntax error is discovered,
19816 do not reduce further before shifting the error token.
19817 Clean up the code a bit by removing the labels yyerrdefault,
19818 yyerrhandle, yyerrpop.
19819 * NEWS: Document the above.
19820
198212002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19822
19823 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
19824 type; it isn't always big enough, since it doesn't necessarily
19825 include non-terminals.
19826 (yytranslate): Expand definition of yy_token_number_type, so that
19827 the latter can be removed.
19828 (yy_token_number_type): Remove, only one use.
19829 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
19830 don't use TokenNumberType as element type.
19831
19832 * tests/regression.at: Modify expected output to agree with change
19833 to yyr1 and yytranslate.
19834
198352002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
19836
19837 * src/reader.c (parse_action): Use copy_character instead of
19838 obstack_1grow.
19839
198402002-05-13 Akim Demaille <akim@epita.fr>
19841
19842 * tests/regression.at (Token definitions): Prototype yylex and
19843 yyerror.
19844
198452002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19846
19847 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
19848 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
19849 32-bit arithmetic.
19850 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
19851
198522002-05-07 Akim Demaille <akim@epita.fr>
19853
19854 * tests/synclines.at: Be sure to prototype yylex and yyerror to
19855 avoid GCC warnings.
19856
198572002-05-07 Akim Demaille <akim@epita.fr>
19858
19859 Kill GCC warnings.
19860
19861 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
19862 over the RHS of each rule.
19863 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
19864 * src/state.h (state_t): Member `nitems' is unsigned short.
19865 * src/LR0.c (get_state): Adjust.
19866 * src/reader.c (packgram): Likewise.
19867 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
19868 `Type'.
19869 (muscle_insert_int_table): Remove, unused.
19870 (prepare_rules): Remove `max'.
19871
198722002-05-06 Akim Demaille <akim@epita.fr>
19873
19874 * src/closure.c (print_firsts): Display of the symbol tags.
19875 (bitmatrix_print): Move to...
19876 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
19877 here.
19878 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
19879
198802002-05-06 Akim Demaille <akim@epita.fr>
19881
19882 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
19883 hash_do_for_each.
19884
198852002-05-06 Akim Demaille <akim@epita.fr>
19886
19887 * src/LR0.c (new_state, get_state): Instead of using the global
19888 `kernel_size' and `kernel_base', have two new arguments:
19889 `core_size' and `core'.
19890 Adjust callers.
19891
198922002-05-06 Akim Demaille <akim@epita.fr>
19893
19894 * src/reader.c (packgram): No longer end `ritem' with a 0
19895 sentinel: it is not used.
19896
198972002-05-05 Akim Demaille <akim@epita.fr>
19898
19899 New experimental feature: display the lookaheads in the report and
19900 graph.
19901
19902 * src/print (print_core): When --trace-flag, display the rules
19903 lookaheads.
19904 * src/print_graph.c (print_core): Likewise.
19905 Swap the arguments.
19906 Adjust caller.
19907
199082002-05-05 Akim Demaille <akim@epita.fr>
19909
19910 * tests/torture.at (Many lookaheads): New test.
19911
199122002-05-05 Akim Demaille <akim@epita.fr>
19913
19914 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
19915 (GENERATE_MUSCLE_INSERT_TABLE): this.
19916 (output_int_table, output_unsigned_int_table, output_short_table)
19917 (output_token_number_table, output_item_number_table): Replace with...
19918 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
19919 (muscle_insert_short_table, muscle_insert_token_number_table)
19920 (muscle_insert_item_number_table): these.
19921 Adjust all callers.
19922 (prepare_tokens): Don't free `translations', since...
19923 * src/reader.h, src/reader.c (grammar_free): do it.
19924 Move to...
19925 * src/gram.h, src/gram.c (grammar_free): here.
19926 * data/bison.simple, data/bison.c++: b4_token_number_max is now
19927 b4_translate_max.
19928
199292002-05-05 Akim Demaille <akim@epita.fr>
19930
19931 * src/output.c (output_unsigned_int_table): New.
19932 (prepare_rules): `i' is unsigned.
19933 `prhs', `rline', `r2' are unsigned int.
19934 Rename muscle `rhs_number_max' as `rhs_max'.
19935 Output muscles `prhs_max', `rline_max', and `r2_max'.
19936 Free rline and r1.
19937 * data/bison.simple, data/bison.c++: Adjust to use these muscles
19938 to compute types instead of constant types.
19939 * tests/regression.at (Web2c Actions): Adjust.
19940
199412002-05-04 Akim Demaille <akim@epita.fr>
19942
19943 * src/symtab.h (SALIAS, SUNDEF): Rename as...
19944 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
19945 Adjust dependencies.
19946 * src/output.c (token_definitions_output): Be sure not to output a
19947 `#define 'a'' when fed with `%token 'a' "a"'.
19948 * tests/regression.at (Token definitions): New.
19949
199502002-05-03 Paul Eggert <eggert@twinsun.com>
19951
19952 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
19953 for K&R C.
19954
199552002-05-03 gettextize <bug-gnu-gettext@gnu.org>
19956
19957 * Makefile.am (SUBDIRS): Remove intl.
19958 (EXTRA_DIST): Add config/config.rpath.
19959
199602002-05-03 Akim Demaille <akim@epita.fr>
19961
19962 * data/bison.simple (m4_if): Don't output empty enums.
19963 And actually, output valid enum definitions :(.
19964
199652002-05-03 Akim Demaille <akim@epita.fr>
19966
19967 * configure.bat: Remove, completely obsolete.
19968 * Makefile.am (EXTRA_DIST): Adjust.
19969 Don't distribute config.rpath...
19970 * config/Makefile.am (EXTRA_DIST): Do it.
19971
199722002-05-03 Akim Demaille <akim@epita.fr>
19973
19974 * configure.in (GETTEXT_VERSION): New.
19975 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
19976
199772002-05-03 Akim Demaille <akim@epita.fr>
19978
19979 * data/bison.simple (b4_token_enum): New.
19980 (b4_token_defines): Use it to output tokens both as #define and
19981 enums.
19982 Suggested by Paul Eggert.
19983 * src/output.c (token_definitions_output): Don't output spurious
19984 white spaces.
19985
199862002-05-03 Akim Demaille <akim@epita.fr>
19987
19988 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
19989
199902002-05-02 Robert Anisko <robert@lrde.epita.fr>
19991
19992 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
19993 Update the stack class, give a try to deque as the default container.
19994
199952002-05-02 Akim Demaille <akim@epita.fr>
19996
19997 * data/bison.simple (yyparse): Do not implement @$ = @1.
19998 (YYLLOC_DEFAULT): Adjust to do it.
19999 * doc/bison.texinfo (Location Default Action): Fix.
20000
200012002-05-02 Akim Demaille <akim@epita.fr>
20002
20003 * src/reader.c (parse_braces): Merge into...
20004 (parse_action): this.
20005
200062002-05-02 Akim Demaille <akim@epita.fr>
20007
20008 * configure.in (ALL_LINGUAS): Remove.
20009 * po/LINGUAS, hr.po: New.
20010
200112002-05-02 Akim Demaille <akim@epita.fr>
20012
20013 Remove the so called hairy (semantic) parsers.
20014
20015 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
20016 * src/gram.h, src/gram.c (semantic_parser): Remove.
20017 (rule_t): Remove the guard and guard_line members.
20018 * src/lex.h (token_t): remove tok_guard.
20019 * src/options.c (option_table): Remove %guard and %semantic_parser
20020 support.
20021 * src/output.c, src/output.h (guards_output): Remove.
20022 (prepare): Adjust.
20023 (token_definitions_output): Don't output the `T'
20024 tokens (???).
20025 (output_skeleton): Don't output the guards.
20026 * src/files.c, src/files.c (attrsfile): Remove.
20027 * src/reader.c (symbol_list): Remove the guard and guard_line
20028 members.
20029 Adjust dependencies.
20030 (parse_guard): Remove.
20031 * data/bison.hairy: Remove.
20032 * doc/bison.texinfo (Environment Variables): Remove occurrences of
20033 BISON_HAIRY.
20034
200352002-05-02 Akim Demaille <akim@epita.fr>
20036
20037 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
20038 (parse_guard): Rename the formal argument `stack_offset' as
20039 `rule_length', which is more readable.
20040 Adjust callers.
20041 (copy_at, copy_dollar): Instead of outputting the hard coded
20042 values of $$, $n and so forth, output invocation to b4_lhs_value,
20043 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
20044 Note: this patch partially drops `semantic-parser' support: it
20045 always does `rule_length - n', where semantic parsers ought to
20046 always use `-n'.
20047 * data/bison.simple, data/bison.c++ (b4_lhs_value)
20048 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
20049
200502002-05-02 Akim Demaille <akim@epita.fr>
20051
20052 * configure.in (AC_INIT): Bump to 1.49b.
20053 (AM_INIT_AUTOMAKE): Short invocation.
20054
200552002-05-02 Akim Demaille <akim@epita.fr>
20056
20057 Version 1.49a.
20058
200592002-05-01 Akim Demaille <akim@epita.fr>
20060
20061 * src/skeleton.h: Remove.
20062
200632002-05-01 Akim Demaille <akim@epita.fr>
20064
20065 * src/skeleton.h: Fix the #endif.
20066 Reported by Magnus Fromreide.
20067
200682002-04-26 Paul Eggert <eggert@twinsun.com>
20069
20070 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
20071 Define if we define YYSTYPE and YYLTYPE, respectively.
20072 (YYCOPY): Fix [] quoting problem in the non-GCC case.
20073
200742002-04-25 Robert Anisko <robert@lrde.epita.fr>
20075
20076 * src/scan-skel.l: Postprocess quadrigraphs.
20077
20078 * src/reader.c (copy_character): New function, used to output
20079 single characters while replacing `[' and `]' with quadrigraphs, to
20080 avoid troubles with M4 quotes.
20081 (copy_comment): Output characters with copy_character.
20082 (read_additionnal_code): Likewise.
20083 (copy_string2): Likewise.
20084 (copy_definition): Likewise.
20085
20086 * tests/calc.at: Exercise M4 quoting.
20087
200882002-04-25 Akim Demaille <akim@epita.fr>
20089
20090 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
20091 between `!' and the command.
20092 Reported by Paul Eggert.
20093
200942002-04-24 Robert Anisko <robert@lrde.epita.fr>
20095
20096 * tests/calc.at: Exercise prologue splitting.
20097
20098 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
20099 `b4_post_prologue' instead of `b4_prologue'.
20100
20101 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
20102 muscles.
20103 (output): Free pre_prologue_obstack and post_prologue_obstack.
20104 * src/files.h, src/files.c (attrs_obstack): Remove.
20105 (pre_prologue_obstack, post_prologue_obstack): New.
20106 * src/reader.c (copy_definition): Add a parameter to specify the
20107 obstack to fill, instead of using attrs_obstack unconditionally.
20108 (read_declarations): Pass pre_prologue_obstack to copy_definition if
20109 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
20110
201112002-04-23 Paul Eggert <eggert@twinsun.com>
20112
20113 * data/bison.simple: Remove unnecessary commentary and white
20114 space differences from 1_29-branch.
20115 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
20116
20117 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
20118 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
20119 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
20120 constructors or destructors.
20121
20122 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
20123
201242002-04-23 Akim Demaille <akim@epita.fr>
20125
20126 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
20127 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
20128 location with columns.
20129 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
20130 All reported by Paul Eggert.
20131
201322002-04-22 Akim Demaille <akim@epita.fr>
20133
20134 * src/reduce.c (dump_grammar): Move to...
20135 * src/gram.h, src/gram.c (grammar_dump): here.
20136 Be sure to separate long item numbers.
20137 Don't read the members of a rule's prec if its nil.
20138
201392002-04-22 Akim Demaille <akim@epita.fr>
20140
20141 * src/output.c (table_size, table_grow): New.
20142 (MAXTABLE): Remove, replace uses with table_size.
20143 (pack_vector): Instead of dying when the table is too big, grow it.
20144
201452002-04-22 Akim Demaille <akim@epita.fr>
20146
20147 * data/bison.simple (yyr1): Its type is that of a token number.
20148 * data/bison.c++ (r1_): Likewise.
20149 * tests/regression.at (Web2c Actions): Adjust.
20150
201512002-04-22 Akim Demaille <akim@epita.fr>
20152
20153 * src/reader.c (token_translations_init): 256 is now the default
20154 value for the error token, i.e., it will be assigned another
20155 number if the user assigned 256 to one of her tokens.
20156 (reader): Don't force 256 to error.
20157 * doc/bison.texinfo (Symbols): Adjust.
20158 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
20159 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
20160 etc. instead of 10, 20, 30 (which was used to `jump' over error
20161 (256) and undefined (2)).
20162
201632002-04-22 Akim Demaille <akim@epita.fr>
20164
20165 Propagate more token_number_t.
20166
20167 * src/gram.h (token_number_as_item_number)
20168 (item_number_as_token_number): New.
20169 * src/output.c (GENERATE_OUTPUT_TABLE): New.
20170 Use it to create output_item_number_table and
20171 output_token_number_table.
20172 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
20173 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
20174 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
20175 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
20176
201772002-04-22 Akim Demaille <akim@epita.fr>
20178
20179 * src/output.h, src/output.c (get_lines_number): Remove.
20180
201812002-04-19 Akim Demaille <akim@epita.fr>
20182
20183 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
20184 as Lex/Flex'.
20185 (Debugging): More details about enabling the debugging features.
20186 (Table of Symbols): Describe $$, $n, @$, and @n.
20187 Suggested by Tim Josling.
20188
201892002-04-19 Akim Demaille <akim@epita.fr>
20190
20191 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
20192
201932002-04-10 Akim Demaille <akim@epita.fr>
20194
20195 * src/system.h: Rely on HAVE_LIMITS_H.
20196 Suggested by Paul Eggert.
20197
201982002-04-09 Akim Demaille <akim@epita.fr>
20199
20200 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
20201 full stderr, and strip it according to the bison options, instead
20202 of composing the error message from different bits.
20203 This makes it easier to check for several error messages.
20204 Adjust all the invocations.
20205 Add an invocation exercising the error token.
20206 Add an invocation demonstrating a stupid error message.
20207 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
20208 Adjust the tests.
20209 Error message are for stderr, not stdout.
20210
202112002-04-09 Akim Demaille <akim@epita.fr>
20212
20213 * src/gram.h, src/gram.c (error_token_number): Remove, use
20214 errtoken->number.
20215 * src/reader.c (reader): Don't specify the user token number (2)
20216 for $undefined, as it uselessly prevents using it.
20217 * src/gram.h (token_number_t): Move to...
20218 * src/symtab.h: here.
20219 (state_t.number): Is a token_number_t.
20220 * src/print.c, src/reader.c: Use undeftoken->number instead of
20221 hard coded 2.
20222 (Even though this 2 is not the same as above: the number of the
20223 undeftoken remains being 2, it is its user token number which
20224 might not be 2).
20225 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
20226 `user_token_number_max'.
20227 Output `undef_token_number'.
20228 * data/bison.simple, data/bison.c++: Use them.
20229 Be sure to map invalid yylex return values to
20230 `undef_token_number'. This saves us from gratuitous SEGV.
20231
20232 * tests/conflicts.at (Solved SR Conflicts)
20233 (Unresolved SR Conflicts): Adjust.
20234 * tests/regression.at (Web2c Actions): Adjust.
20235
202362002-04-08 Akim Demaille <akim@epita.fr>
20237
20238 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
20239 Adding #line.
20240 Remove the duplicate `typedefs'.
20241 (RhsNumberType): Fix the declaration and various other typos.
20242 Use __ofile__.
20243 * data/bison.simple: Use __ofile__.
20244 * src/scan-skel.l: Handle __ofile__.
20245
202462002-04-08 Akim Demaille <akim@epita.fr>
20247
20248 * src/gram.h (item_number_t): New, the type of item numbers in
20249 RITEM. Note that it must be able to code symbol numbers as
20250 positive number, and the negation of rule numbers as negative
20251 numbers.
20252 Adjust all dependencies (pretty many).
20253 * src/reduce.c (rule): Remove this `short *' pointer: use
20254 item_number_t.
20255 * src/system.h (MINSHORT, MAXSHORT): Remove.
20256 Include `limits.h'.
20257 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
20258 (shortcpy): Remove.
20259 (MAXTABLE): Move to...
20260 * src/output.c (MAXTABLE): here.
20261 (prepare_rules): Use output_int_table to output rhs.
20262 * data/bison.simple, data/bison.c++: Adjust.
20263 * tests/torture.at (Big triangle): Move the limit from 254 to
20264 500.
20265 * tests/regression.at (Web2c Actions): Ajust.
20266
20267 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
20268 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
20269 passes, but produces negative #line number, once fixed, GCC is
20270 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
20271 C), it passes.
20272 * src/state.h (state_h): Code input lines on ints, not shorts.
20273
202742002-04-08 Akim Demaille <akim@epita.fr>
20275
20276 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
20277 and then the grammar.
20278
202792002-04-08 Akim Demaille <akim@epita.fr>
20280
20281 * src/system.h: No longer using strndup.
20282
202832002-04-07 Akim Demaille <akim@epita.fr>
20284
20285 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
20286 * src/output.c (output_table_data): Return the longest number.
20287 (prepare_tokens): Output `token_number_max').
20288 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
20289 New.
20290 Use them to define yy_token_number_type/TokenNumberType.
20291 Use this type for yytranslate.
20292 * tests/torture.at (Big triangle): Push the limit from 124 to
20293 253.
20294 * tests/regression.at (Web2c Actions): Adjust.
20295
202962002-04-07 Akim Demaille <akim@epita.fr>
20297
20298 * tests/torture.at (Big triangle): New.
20299 (GNU AWK Grammar, GNU Cim Grammar): Move to...
20300 * tests/existing.at: here.
20301
203022002-04-07 Akim Demaille <akim@epita.fr>
20303
20304 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
20305 nritems.
20306 Adjust dependencies.
20307
203082002-04-07 Akim Demaille <akim@epita.fr>
20309
20310 * src/reader.c: Normalize increments to prefix form.
20311
203122002-04-07 Akim Demaille <akim@epita.fr>
20313
20314 * src/reader.c, symtab.c: Remove debugging code.
20315
203162002-04-07 Akim Demaille <akim@epita.fr>
20317
20318 Rename all the `bucket's as `symbol_t'.
20319
20320 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
20321 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
20322 * src/symtab.c, src/symtab.h (bucket): Rename as...
20323 (symbol_t): this.
20324 (symbol_list_new, bucket_check_defined, bucket_make_alias)
20325 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
20326 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
20327 (buckets_new, buckets_free, buckets_do): Rename as...
20328 (symbol_list_new, symbol_check_defined, symbol_make_alias)
20329 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
20330 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
20331 (symbols_new, symbols_free, symbols_do): these.
20332
203332002-04-07 Akim Demaille <akim@epita.fr>
20334
20335 Use lib/hash for the symbol table.
20336
20337 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
20338 EOF.
20339 * src/lex.c (lex): Set the `number' member of new terminals.
20340 * src/reader.c (bucket_check_defined, bucket_make_alias)
20341 (bucket_check_alias_consistence, bucket_translation): New.
20342 (reader, grammar_free, readgram, token_translations_init)
20343 (packsymbols): Adjust.
20344 (reader): Number the predefined tokens.
20345 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
20346 for predefined tokens.
20347 * src/symtab.h (bucket): Remove all the hash table related
20348 members.
20349 * src/symtab.c (symtab): Replace by...
20350 (bucket_table): this.
20351 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
20352 (buckets_new, buckets_do): New.
20353
203542002-04-07 Akim Demaille <akim@epita.fr>
20355
20356 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
20357 (start_symbol, max_user_token_number, semantic_parser)
20358 (error_token_number): Initialize.
20359 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
20360 Initialize.
20361 (reader): Don't.
20362 (errtoken, eoftoken, undeftoken, axiom): Extern.
20363
203642002-04-07 Akim Demaille <akim@epita.fr>
20365
20366 * src/gram.h (rule_s): prec and precsym are now pointers
20367 to the bucket giving the priority/associativity.
20368 Member `associativity' removed: useless.
20369 * src/reduce.c, src/conflicts.c: Adjust.
20370
203712002-04-07 Akim Demaille <akim@epita.fr>
20372
20373 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
20374 Properly escape the symbols' TAG when outputting them.
20375
203762002-04-07 Akim Demaille <akim@epita.fr>
20377
20378 * src/lalr.h (LA): Is a bitsetv, not bitset*.
20379
203802002-04-07 Akim Demaille <akim@epita.fr>
20381
20382 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
20383 (LArule): this, which is an array to rule_t*.
20384 * src/print.c, src/conflicts.c: Adjust.
20385
203862002-04-07 Akim Demaille <akim@epita.fr>
20387
20388 * src/gram.h (rule_t): Rename `number' as `user_number'.
20389 `number' is a new member.
20390 Adjust dependencies.
20391 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
20392
203932002-04-07 Akim Demaille <akim@epita.fr>
20394
20395 As a result of the previous patch, it is no longer needed
20396 to reorder ritem itself.
20397
20398 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
20399
204002002-04-07 Akim Demaille <akim@epita.fr>
20401
20402 Be sure never to walk through RITEMS, but use only data related to
20403 the rules themselves. RITEMS should be banished.
20404
20405 * src/output.c (output_token_translations): Rename as...
20406 (prepare_tokens): this.
20407 In addition to `translate', prepare the muscles `tname' and
20408 `toknum', which were handled by...
20409 (output_rule_data): this.
20410 Remove, and move the remainder of its outputs into...
20411 (prepare_rules): this new routines, which also merges content from
20412 (output_gram): this.
20413 (prepare_rules): Be sure never to walk through RITEMS.
20414 (output_stos): Rename as...
20415 (prepare_stos): this.
20416 (output): Always invoke prepare_states, after all, just don't use it
20417 in the output if you don't need it.
20418
204192002-04-07 Akim Demaille <akim@epita.fr>
20420
20421 * src/LR0.c (new_state): Display `nstates' as the name of the
20422 newly created state.
20423 Adjust to initialize first_state and last_state if needed.
20424 Be sure to distinguish the initial from the final state.
20425 (new_states): Create the itemset of the initial state, and use
20426 new_state.
20427 * src/closure.c (closure): Now that the initial state has its
20428 items properly set, there is no need for a special case when
20429 creating `ruleset'.
20430
20431 As a result, now the rule 0, reducing to $axiom, is visible in the
20432 outputs. Adjust the test suite.
20433
20434 * tests/conflicts.at (Solved SR Conflicts)
20435 (Unresolved SR Conflicts): Adjust.
20436 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
20437 * tests/conflicts.at (S/R in initial): New.
20438
204392002-04-07 Akim Demaille <akim@epita.fr>
20440
20441 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
20442 the RHS of the rules.
20443 * src/output.c (output_gram): Likewise.
20444
204452002-04-07 Akim Demaille <akim@epita.fr>
20446
20447 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
20448 bucket.
20449 Adjust all dependencies.
20450 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
20451 `number' of the buckets too.
20452 * src/gram.h: Include `symtab.h'.
20453 (associativity): Move to...
20454 * src/symtab.h: here.
20455 No longer include `gram.h'.
20456
204572002-04-07 Akim Demaille <akim@epita.fr>
20458
20459 * src/gram.h, src/gram.c (rules_rhs_length): New.
20460 (ritem_longest_rhs): Use it.
20461 * src/gram.h (rule_t): `number' is a new member.
20462 * src/reader.c (packgram): Set it.
20463 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
20464 the end of `rules', and count them out of `nrules'.
20465 (reduce_output, dump_grammar): Adjust.
20466 * src/print.c (print_grammar): It is no longer needed to check for
20467 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
20468 * tests/reduce.at (Reduced Automaton): New test.
20469
204702002-04-07 Akim Demaille <akim@epita.fr>
20471
20472 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
20473 lacking `+ 1' to nrules, Bison reported as useless a token if it
20474 was used solely to set the precedence of the last rule...
20475
204762002-04-07 Akim Demaille <akim@epita.fr>
20477
20478 * data/bison.c++, data/bison.simple: Don't output the current file
20479 name in #line, to avoid useless diffs between two identical
20480 outputs under different names.
20481
204822002-04-07 Akim Demaille <akim@epita.fr>
20483
20484 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
20485 Normalize loops to using `< nrules + 1', not `<= nrules'.
20486
204872002-04-07 Akim Demaille <akim@epita.fr>
20488
20489 * TODO: Update.
20490
204912002-04-07 Akim Demaille <akim@epita.fr>
20492
20493 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
20494 bucket.value as bucket.number.
20495
204962002-04-07 Akim Demaille <akim@epita.fr>
20497
20498 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
20499 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
20500 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
20501 RHS, instead of being an index in RITEMS.
20502
205032002-04-04 Paul Eggert <eggert@twinsun.com>
20504
20505 * doc/bison.texinfo: Update copyright date.
20506 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
20507 (Symbols): Warn about running Bison in one character set,
20508 but compiling and/or running in an incompatible one.
20509 Warn about character code 256, too.
20510
205112002-04-03 Paul Eggert <eggert@twinsun.com>
20512
20513 * src/bison.data (YYSTACK_ALLOC): Depend on whether
20514 YYERROR_VERBOSE is nonzero, not whether it is defined.
20515
20516 Merge changes from bison-1_29-branch.
20517
205182002-03-20 Paul Eggert <eggert@twinsun.com>
20519
20520 Merge fixes from Debian bison_1.34-1.diff.
20521
20522 * configure.in (AC_PREREQ): 2.53.
20523
205242002-03-20 Akim Demaille <akim@epita.fr>
20525
20526 * src/conflicts.c (log_resolution): Argument `resolution' is const.
20527
205282002-03-19 Paul Eggert <eggert@twinsun.com>
20529
20530 * src/bison.simple (YYCOPY): New macro.
20531 (YYSTACK_RELOCATE): Use it.
20532 Remove Type arg; no longer needed. All callers changed.
20533 (yymemcpy): Remove; no longer needed.
20534
20535 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
20536 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
20537
205382002-03-19 Akim Demaille <akim@epita.fr>
20539
20540 Test and fix the #line outputs.
20541
20542 * tests/atlocal.at (GCC): New.
20543 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
20544 (Prologue synch line, %union synch line, Postprologue synch line)
20545 (Action synch line, Epilogue synch line): New tests.
20546 * src/reader.c (parse_union_decl): Define the muscle stype_line.
20547 * data/bison.simple, data/bison.c++: Use it.
20548
205492002-03-19 Akim Demaille <akim@epita.fr>
20550
20551 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
20552 (Solved SR Conflicts, %expect not enough, %expect right)
20553 (%expect too much): Move to...
20554 * tests/conflicts.at: this new file.
20555
205562002-03-19 Akim Demaille <akim@epita.fr>
20557
20558 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
20559 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
20560 that we can move to enums for instance.
20561 * src/output.c (token_definitions_output): Output a list of
20562 `token-name, token-number' instead of the #define.
20563 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
20564
205652002-03-14 Akim Demaille <akim@epita.fr>
20566
20567 Use Gettext 0.11.1.
20568
205692002-03-09 Robert Anisko <robert@lrde.epita.fr>
20570
20571 * data/bison.c++: Make the user able to add members to the generated
20572 parser by subclassing.
20573
205742002-03-05 Robert Anisko <robert@lrde.epita.fr>
20575
20576 * src/reader.c (read_additionnal_code): `c' should be an integer, not
20577 a character.
20578 Reported by Nicolas Tisserand and Nicolas Burrus.
20579
205802002-03-04 Robert Anisko <robert@lrde.epita.fr>
20581
20582 * src/reader.c: Warn about lacking semi-colons, do not complain.
20583
205842002-03-04 Robert Anisko <robert@lrde.epita.fr>
20585
20586 * data/bison.c++: Remove a debug line.
20587
205882002-03-04 Robert Anisko <robert@lrde.epita.fr>
20589
20590 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
20591 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
20592 provide a default implementation.
20593
205942002-03-04 Akim Demaille <akim@epita.fr>
20595
20596 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
20597 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
20598 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
20599 * tests/semantic.at (Parsing Guards): Similarly.
20600 * src/reader.at (readgram): Complain if the last rule is not ended
20601 with a semi-colon.
20602
206032002-03-04 Akim Demaille <akim@epita.fr>
20604
20605 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
20606 * src/closure.c: here.
20607 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
20608 RTC.
20609 * src/warshall.h, src/warshall.c: Remove.
20610 * tests/sets.at (Broken Closure): Adjust.
20611
206122002-03-04 Akim Demaille <akim@epita.fr>
20613
20614 * src/output.c (output_skeleton): tempdir is const.
20615 bytes_read is unused.
20616
206172002-03-04 Akim Demaille <akim@epita.fr>
20618
20619 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
20620 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
20621 Update.
20622 From Michael Hayes.
20623
206242002-03-04 Akim Demaille <akim@epita.fr>
20625
20626 * src/closure.c (closure): `r' is unused.
20627
206282002-03-04 Akim Demaille <akim@epita.fr>
20629
20630 * tests/sets.at (Broken Closure): Add the ending `;'.
20631 * src/reader.at (readgram): Complain if a rule is not ended with a
20632 semi-colon.
20633
206342002-03-04 Akim Demaille <akim@epita.fr>
20635
20636 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
20637 (count_sr_conflicts): Use bitset_count.
20638 * src/reduce.c (inaccessable_symbols): Ditto.
20639 (bits_size): Remove.
20640 * src/warshall.h, src/warshall.c: Convert to bitsetv.
20641
206422002-03-04 Akim Demaille <akim@epita.fr>
20643
20644 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
20645 * src/reduce.c: Remove the `bitset_zero's following the
20646 `bitset_create's, as now it is performed by the latter.
20647
206482002-03-04 Akim Demaille <akim@epita.fr>
20649
20650 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
20651 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
20652 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
20653 latest sources from Michael.
20654
206552002-03-04 Akim Demaille <akim@epita.fr>
20656
20657 * src/output.c (output): Don't free the grammar.
20658 * src/reader.c (grammar_free): New.
20659 * src/main.c (main): Call it and don't free symtab here.
20660
206612002-03-04 Akim Demaille <akim@epita.fr>
20662
20663 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
20664 before returning.
20665 Reported by Benoit Perrot.
20666
206672002-03-04 Akim Demaille <akim@epita.fr>
20668
20669 Use bitset operations when possible, not loops over bits.
20670
20671 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
20672 bitset_or.
20673 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
20674 * src/reduce.c (useless_nonterminals): Formatting changes.
20675 * src/warshall.c (TC): Use bitset_or.
20676
206772002-03-04 Akim Demaille <akim@epita.fr>
20678
20679 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
20680 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
20681 Ditto.
20682
206832002-03-04 Akim Demaille <akim@epita.fr>
20684
20685 * src/lalr.c (F): Now a bitset*.
20686 Adjust all dependencies.
20687
206882002-03-04 Akim Demaille <akim@epita.fr>
20689
20690 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
20691 Adjust all dependencies.
20692
206932002-03-04 Akim Demaille <akim@epita.fr>
20694
20695 * src/L0.c, src/LR0.h (nstates): Be size_t.
20696 Adjust comparisons (signed vs unsigned).
20697 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
20698 bitset*.
20699 Adjust all dependencies.
20700
207012002-03-04 Akim Demaille <akim@epita.fr>
20702
20703 * src/closure.c (firsts): Now, also a bitset.
20704 Adjust all dependencies.
20705 (varsetsize): Remove, now unused.
20706 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
20707
207082002-03-04 Akim Demaille <akim@epita.fr>
20709
20710 * src/print.c: Convert to use bitset.h, not hand coded iterations
20711 over ints.
20712
207132002-03-04 Akim Demaille <akim@epita.fr>
20714
20715 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
20716
207172002-03-04 Akim Demaille <akim@epita.fr>
20718
20719 * src/closure.c (ruleset): Be a bitset.
20720 (rulesetsize): Remove.
20721
207222002-03-04 Akim Demaille <akim@epita.fr>
20723
20724 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
20725 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
20726 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
20727 * src/closure.c (fderives): Be an array of bitsets.
20728
207292002-02-28 Robert Anisko <robert@lrde.epita.fr>
20730
20731 * data/bison.c++: Merge the two generated headers. Insert a copyright
20732 notice in each output file.
20733
207342002-02-28 Akim Demaille <akim@epita.fr>
20735
20736 * data/bison.c++: Copy the prologue of bison.simple to fetch
20737 useful M4 definitions, such as b4_header_guard.
20738
207392002-02-25 Akim Demaille <akim@epita.fr>
20740
20741 * src/getargs.c (version): Give the name of the authors, and use a
20742 translator friendly scheme for the bgr
20743 copyright notice.
20744
207452002-02-25 Akim Demaille <akim@epita.fr>
20746
20747 * src/output.c (header_output): Remove, now handled completely via
20748 M4.
20749
207502002-02-25 Akim Demaille <akim@epita.fr>
20751
20752 * m4/m4.m4: New, from CVS Autoconf.
20753 * configure.in: Invoke it.
20754 * src/output.c (output_skeleton): Use its result instead of the
20755 hard coded name.
20756
207572002-02-25 Akim Demaille <akim@epita.fr>
20758
20759 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
20760 Fileutils 4.1.5.
20761 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
20762 * src/output.c (output_skeleton): Use mkstemp to create a real
20763 temporary file.
20764 Move the filling of `skeleton' and its muscle to...
20765 (prepare): here.
20766 (output): Move the definition of the prologue muscle to...
20767 (prepare): here.
20768 * src/system.h (DEFAULT_TMPDIR): New.
20769
207702002-02-14 Paul Eggert <eggert@twinsun.com>
20771
20772 Remove the support for C++ namespace cleanliness; it was
20773 causing more problems than it was curing, since it didn't work
20774 properly on some nonstandard C++ compilers. This can wait
20775 for a proper C++ parser.
20776
20777 * NEWS: Document this.
20778 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
20779 of C++, as it's treated like C now.
20780 * src/bison.simple (YYSTD): Remove.
20781 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
20782 Treat C++ just like Standard C instead of trying to support
20783 namespace cleanliness.
20784
207852002-02-14 Akim Demaille <akim@epita.fr>
20786
20787 * tests/regression.at (else): Adjust to Andreas' change.
20788
207892002-02-14 Akim Demaille <akim@epita.fr>
20790
20791 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
20792
207932002-02-13 Andreas Schwab <schwab@suse.de>
20794
20795 * src/output.c (output_rule_data): Don't output NULL, it might
20796 not be defined yet.
20797
207982002-02-11 Robert Anisko <robert@lrde.epita.fr>
20799
20800 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
20801 (Copyright notice): Update.
20802
208032002-02-11 Akim Demaille <akim@epita.fr>
20804
20805 * tests/regression.at (%nonassoc and eof): Don't include
20806 nonportable headers.
20807
208082002-02-08 Robert Anisko <robert@lrde.epita.fr>
20809
20810 * data/bison.c++: Correct error recovery. Make the user able to
20811 initialize the starting location.
20812
208132002-02-07 Akim Demaille <akim@epita.fr>
20814
20815 * tests/input.at: New.
20816
208172002-02-07 Robert Anisko <robert@lrde.epita.fr>
20818
20819 * data/bison.c++: Replace some direct m4 expansions by constants. Be
20820 more consistent when naming methods and variables. Put preprocessor
20821 directives around tables only needed for debugging.
20822
208232002-02-07 Robert Anisko <robert@lrde.epita.fr>
20824
20825 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
20826 C++ parsers.
20827 (yy::b4_name::parse): Use print_.
20828
208292002-02-07 Robert Anisko <robert@lrde.epita.fr>
20830
20831 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
20832
208332002-02-07 Robert Anisko <robert@lrde.epita.fr>
20834
20835 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
20836 C++ parsers.
20837 (yy::b4_name::parse): Build verbose error messages, and use error_.
20838
208392002-02-06 Robert Anisko <robert@lrde.epita.fr>
20840
20841 * data/bison.c++: Fix m4 quoting in comments.
20842
208432002-02-06 Robert Anisko <robert@lrde.epita.fr>
20844
20845 * data/bison.c++: Adjust the parser code. Fix some muscles that were
20846 not expanded by m4.
20847
208482002-02-05 Akim Demaille <akim@epita.fr>
20849
20850 * data/bison.c++: Adjust to the M4 back end.
20851 More is certainly needed.
20852
208532002-02-05 Akim Demaille <akim@epita.fr>
20854
20855 Give a try to M4 as a back end.
20856
20857 * lib/readpipe.c: New, from wdiff.
20858 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
20859 BISON_HAIRY.
20860 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
20861 specific values. Now it is m4 that performs the lookup.
20862 * src/parse-skel.y: Remove.
20863 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
20864 * src/output.c (actions_output, guards_output)
20865 (token_definitions_output): No longer keeps track of the output
20866 line number, hence remove the second argument.
20867 (guards_output): Check against the guard member of a rule, not the
20868 action member.
20869 Adjust callers.
20870 (output_skeleton): Don't look for the skeleton location, let m4 do
20871 that.
20872 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
20873 file will be used.
20874 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
20875 (prepare): Given that for the time being changesyntax is not
20876 usable in M4, rename the muscles using `-' to `_'.
20877 Define `defines_flag', `output_parser_name' and `output_header_name'.
20878 * src/output.h (actions_output, guards_output)
20879 (token_definitions_output): Adjust prototypes.
20880 * src/scan-skel.l: Instead of scanning the skeletons, it now
20881 processes the output of m4: `__oline__' and `#output'.
20882 * data/bison.simple: Adjust to be used by M4(sugar).
20883 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
20884 to date.
20885 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
20886 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
20887 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
20888 shamelessly stolen from CVS Autoconf.
20889
208902002-02-05 Akim Demaille <akim@epita.fr>
20891
20892 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
20893 * configure.in: Check for the declarations of free and malloc.
20894 * src/muscle_tab.c: Adjust.
20895
208962002-02-05 Akim Demaille <akim@epita.fr>
20897
20898 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
20899 which have no values.
20900
209012002-02-05 Akim Demaille <akim@epita.fr>
20902
20903 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
20904 * data/: here.
20905
209062002-01-29 Paul Eggert <eggert@twinsun.com>
20907
20908 * src/bison.simple (YYSIZE_T): Do not define merely because
20909 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
20910 On some platforms, <alloca.h> does not declare YYSTD (size_t).
20911
209122002-01-27 Akim Demaille <akim@epita.fr>
20913
20914 Fix `%nonassoc and eof'.
20915
20916 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
20917 which were not properly copied! Replace
20918 memcpy (res->errs, src->errs, src->nerrs);
20919 with
20920 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
20921 !!!
20922 * tests/regression.at (%nonassoc and eof): Adjust to newest
20923 Autotest: `.' is not in the PATH.
20924
209252002-01-27 Akim Demaille <akim@epita.fr>
20926
20927 * tests/sets.at (AT_EXTRACT_SETS): New.
20928 (Nullable): Use it.
20929 (Firsts): New.
20930
209312002-01-26 Akim Demaille <akim@epita.fr>
20932
20933 * tests/actions.at, tests/calc.at, tests/headers.at,
20934 * tests/torture.at: Adjust to the newest Autotest which no longer
20935 forces `.' in the PATH.
20936
209372002-01-25 Akim Demaille <akim@epita.fr>
20938
20939 * tests/regression.at (%nonassoc and eof): New.
20940 Suggested by Robert Anisko.
20941
209422002-01-24 Akim Demaille <akim@epita.fr>
20943
20944 Bison dumps core when trying to complain about broken input files.
20945 Reported by Cris van Pelt.
20946
20947 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
20948 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
20949 into...
20950 (Invalid inputs): Strengthen: exercise parse_percent_token.
20951
209522002-01-24 Robert Anisko <robert.anisko@epita.fr>
20953
20954 * src/Makefile.am: Add bison.c++.
20955 * src/bison.c++: New skeleton.
20956
209572002-01-21 Paolo Bonzini <bonzini@gnu.org>
20958
20959 * po/it.po: New.
20960
209612002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
20962
20963 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
20964
209652002-01-20 Marc Autret <marc@gnu.org>
20966
20967 * src/files.c (compute_output_file_names): Fix
20968
209692002-01-20 Marc Autret <marc@gnu.org>
20970
20971 * tests/output.at: New test.
20972 * src/files.c (compute_base_names): Don't map extensions when
20973 the YACC flag is set, use defaults.
20974 Reported by Evgeny Stambulchik.
20975
209762002-01-20 Marc Autret <marc@gnu.org>
20977
20978 * src/system.h: Need to define __attribute__ away for non-GCC
20979 compilers as well (i.e., the vendor C compiler).
20980 Suggested by Albert Chin-A-Young.
20981
209822002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
20983
20984 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
20985 canonical definition.
20986 * src/system.h: Use the canonical definition for PARAMS (avoids
20987 a conflict with the macro from lib/hash.h).
20988
209892002-01-11 Akim Demaille <akim@epita.fr>
20990
20991 * configure.in: Use AC_FUNC_STRNLEN.
20992 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
20993
209942002-01-09 Akim Demaille <akim@epita.fr>
20995
20996 * src/files.c, src/files.h (output_infix): New.
20997 (tab_extension): Remove.
20998 (compute_base_names): Compute the former, drop the latter.
20999 * src/output.c (prepare): Insert the muscles `output-infix', and
21000 `output-suffix'.
21001 * src/parse-skel.y (string, string.1): New.
21002 (section.header): Use it.
21003 (section.yacc): Remove.
21004 (prefix): Remove too.
21005 * src/scan-skel.l: Adjust.
21006 * src/bison.simple, src/bison.hairy: Adjust.
21007
210082002-01-09 Akim Demaille <akim@epita.fr>
21009
21010 * configure.in (WERROR_CFLAGS): Compute it.
21011 * src/Makefile.am (CFLAGS): Pass it.
21012 * tests/atlocal.in (CFLAGS): Idem.
21013 * src/files.c: Fix a few warnings.
21014 (get_extension_index): Remove, unused.
21015
210162002-01-08 Akim Demaille <akim@epita.fr>
21017
21018 * src/getargs.c (AS_FILE_NAME): New.
21019 (getargs): Use it to convert DOSish file names.
21020 * src/files.c (base_name): Rename as full_base_name to avoid
21021 clashes with `base_name ()'.
21022 (filename_split): New.
21023 (compute_base_names): N-th rewrite, using filename_split.
21024
210252002-01-08 Akim Demaille <akim@epita.fr>
21026
21027 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
21028 New, stolen from the Fileutils 4.1.
21029 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
21030 * configure.in: Check for the presence of memrchr, and of its
21031 prototype.
21032
210332002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
21034
21035 * lib/hash.h (__P): Added definition for this macro.
21036 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
21037 BUILT_SOURCES, to ensure they are generated first.
21038 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
21039 %error-verbose to allow bootstrapping with bison 1.30x.
21040
210412002-01-06 Akim Demaille <akim@epita.fr>
21042
21043 * src/reader.c (parse_braces): Don't fetch the next char, the
21044 convention is to fetch on entry.
21045 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
21046 'switch' without a following semicolon.
21047 * tests/regression.at (braces parsing): New.
21048
210492002-01-06 Akim Demaille <akim@epita.fr>
21050
21051 Bison is dead wrong in its RR conflict reports.
21052
21053 * tests/torture.at (GNU Cim Grammar): New.
21054 * src/conflicts.c (count_rr_conflicts): Fix.
21055
210562002-01-06 Akim Demaille <akim@epita.fr>
21057
21058 Creating package.m4 from configure.ac causes too many problems.
21059
21060 * tests/Makefile.am (package.m4): Create it by hand,
21061 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
21062
210632002-01-06 Akim Demaille <akim@epita.fr>
21064
21065 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
21066 skeleton.h.
21067
210682002-01-04 Paul Eggert <eggert@twinsun.com>
21069
21070 * doc/bison.texinfo (Debugging):
21071 Remove YYSTDERR; it's no longer defined or used.
21072 Also, s/cstdio.h/cstdio/.
21073
210742002-01-03 Akim Demaille <akim@epita.fr>
21075
21076 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
21077
210782002-01-03 Akim Demaille <akim@epita.fr>
21079
21080 * src/parse-skel.y (process_skeleton): Don't bind the parser's
21081 tracing code to --trace, wait for a better --trace option, with
21082 args.
21083
210842002-01-03 Akim Demaille <akim@epita.fr>
21085
21086 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
21087 The ISO C++ standard is extremely clear about it: stderr is
21088 considered a macro, not a regular symbol (see table 94 `Header
21089 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
21090 Therefore std:: does not apply to it. It still does with fprintf.
21091 Also, s/cstdio.h/cstdio/.
21092
210932002-01-03 Akim Demaille <akim@epita.fr>
21094
21095 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
21096 for non system headers.
21097
210982002-01-02 Akim Demaille <akim@epita.fr>
21099
21100 Equip the skeleton chain with location tracking, runtime trace,
21101 pure parser and scanner.
21102
21103 * src/parse-skel.y: Request a pure parser, locations, and prefix
21104 renaming.
21105 (%union): Having several members with the same type does not help
21106 type mismatches, simplify.
21107 (YYPRINT, yyprint): New.
21108 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
21109 (skel_error): this.
21110 Handle locations.
21111 * src/scan-skel.l: Adjust to these changes.
21112 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
21113 (LOCATION_PRINT, skel_control_t): New.
21114
211152001-12-30 Akim Demaille <akim@epita.fr>
21116
21117 * src/parse-skel.y: Get rid of the shift/reduce conflict:
21118 replace `gb' with BLANKS.
21119 * src/scan-skel.l: Adjust.
21120
211212001-12-30 Akim Demaille <akim@epita.fr>
21122
21123 * src/system.h: We don't need nor want bcopy.
21124 Throw away MS-DOS crap: we don't need getpid.
21125 * configure.in: We don't need strndup. It was even causing
21126 problems: because Flex includes the headers *before* us,
21127 _GNU_SOURCE is not defined by config.h, and therefore strndup was
21128 not visible.
21129 * lib/xstrndup.c: New.
21130 * src/scan-skel.l: Use it.
21131 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
21132 * src/parse-skel.y: Use %directives instead of #defines.
21133
211342001-12-30 Akim Demaille <akim@epita.fr>
21135
21136 * src/skeleton.h: New.
21137 * src/output.c (output_parser, output_master_parser): Remove, dead
21138 code.
21139 * src/output.h (get_lines_number, actions_output, guards_output)
21140 (token_definitions_output): Prototype them.
21141 * src/parse-skel.y: Add the license notice.
21142 Include output.h and skeleton.h.
21143 (process_skeleton): Returns void, and takes a single parameter.
21144 * src/scan-skel.l: Add the license notice.
21145 Include skeleton.h.
21146 Don't use %option yylineno: it seems that then Flex imagines
21147 REJECT has been used, and therefore it won't reallocate its
21148 buffers (which makes no other sense to me than a bug). It results
21149 in warnings for `unused: yy_flex_realloc'.
21150
211512001-12-30 Robert Anisko <robert.anisko@epita.fr>
21152
21153 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
21154 (MUSCLE_INSERT_PREFIX): ...to there.
21155 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
21156 (MUSCLE_INSERT_PREFIX): Move from here...
21157
21158 * src/bison.hairy: Add a section directive. Put braces around muscle
21159 names. This parser skeleton is still broken, but Bison should not
21160 choke on a bad muscle 'syntax'.
21161 * src/bison.simple: Add a section directive. Put braces around muscle
21162 names.
21163
21164 * src/files.h (strsuffix, stringappend): Add declarations.
21165 (tab_extension): Add declaration.
21166 (short_base_name): Add declaration.
21167
21168 * src/files.c (strsuffix, stringappend): No longer static. These
21169 functions are used in the skeleton parser.
21170 (tab_extension): New.
21171 (compute_base_names): Use the computations done in this function
21172 to guess if the generated parsers should have '.tab' in their
21173 names.
21174 (short_base_name): No longer static.
21175
21176 * src/output.c (output_skeleton): New.
21177 (output): Disable call to output_master_parser, and give a try to
21178 a new skeleton handling system.
21179 (guards_output, actions_output): No longer static.
21180 (token_definitions_output, get_lines_number): No longer static.
21181
21182 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
21183
21184 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
21185 parse-skel.y.
21186
21187 * src/parse-skel.y: New file.
21188 * src/scan-skel.l: New file.
21189
211902001-12-29 Akim Demaille <akim@epita.fr>
21191
21192 %name-prefix is broken.
21193
21194 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
21195 Adjust all dependencies.
21196 * tests/headers.at (export YYLTYPE): Strengthen this test: use
21197 %name-prefix.
21198
21199 Renaming yylval but not yylloc is not consistent. Now we do.
21200
21201 * src/bison.simple: Prefix yylloc if used.
21202 * doc/bison.texinfo (Decl Summary): Document that.
21203
212042001-12-29 Akim Demaille <akim@epita.fr>
21205
21206 * doc/bison.texinfo: Promote `%long-directive' over
21207 `%long_directive'.
21208 Remove all references to fixed-output-files, yacc is enough.
21209
212102001-12-29 Akim Demaille <akim@epita.fr>
21211
21212 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
21213 user prologue. These are defaults.
21214 * tests/actions.at (Mid-rule actions): Make sure the user can
21215 define YYDEBUG and YYERROR_VERBOSE.
21216
212172001-12-29 Akim Demaille <akim@epita.fr>
21218
21219 * src/output.c (header_output): Don't forget to export YYLTYPE and
21220 yylloc.
21221 * tests/headers.at (export YYLTYPE): New, make sure it does.
21222 * tests/regression.at (%union and --defines, Invalid CPP headers):
21223 Move to...
21224 * tests/headers.at: here.
21225
212262001-12-29 Akim Demaille <akim@epita.fr>
21227
21228 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
21229
212302001-12-29 Akim Demaille <akim@epita.fr>
21231
21232 * tests/actions.at (Mid-rule actions): Output on a single line
21233 instead of several.
21234
212352001-12-29 Akim Demaille <akim@epita.fr>
21236
21237 * doc/bison.texinfo: Formatting changes.
21238
212392001-12-29 Akim Demaille <akim@epita.fr>
21240
21241 Don't store the token defs in a muscle, just be ready to output it
21242 on command. Now possible via `symbols'. Fixes a memory leak.
21243
21244 * src/output.c (token_definitions_output): New.
21245 (output_parser, header_output): Use it.
21246 * src/reader.c (symbols_save): Remove.
21247
212482001-12-29 Akim Demaille <akim@epita.fr>
21249
21250 * src/bison.simple: Do not provide a default for YYSTYPE and
21251 YYLTYPE before the user's prologue. Otherwise it's hardly... a
21252 default.
21253
212542001-12-29 Akim Demaille <akim@epita.fr>
21255
21256 Mid-rule actions are simply... ignored!
21257
21258 * src/reader.c (readgram): Be sure to attach mid-rule actions to
21259 the empty-rule associated to the dummy symbol, not to the host
21260 rule.
21261 * tests/actions.at (Mid-rule actions): New.
21262
212632001-12-29 Akim Demaille <akim@epita.fr>
21264
21265 Memory leak.
21266
21267 * src/reader.c (reader): Free grammar.
21268
212692001-12-29 Akim Demaille <akim@epita.fr>
21270
21271 Memory leak.
21272
21273 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
21274 since it allocates it for each state, although only one is needed.
21275 (allocate_storage): Do it here.
21276
212772001-12-29 Akim Demaille <akim@epita.fr>
21278
21279 * src/options.h, src/options.c (create_long_option_table): Rename
21280 as...
21281 (long_option_table_new): this, with a clearer prototype.
21282 (percent_table): Remove, unused,
21283 * src/getargs.c (getargs): Adjust.
21284
212852001-12-29 Akim Demaille <akim@epita.fr>
21286
21287 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
21288 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
21289 as states.
21290
212912001-12-29 Akim Demaille <akim@epita.fr>
21292
21293 * src/lalr.c (build_relations): Rename `states' as `states1'.
21294 Sorry, I don't understand exactly what it is, no better name...
21295
212962001-12-29 Akim Demaille <akim@epita.fr>
21297
21298 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
21299 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
21300 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
21301 as rules.
21302
213032001-12-29 Akim Demaille <akim@epita.fr>
21304
21305 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
21306 ago.
21307
213082001-12-29 Akim Demaille <akim@epita.fr>
21309
21310 * src/reader.c, src/reader.h (user_toknums): Remove.
21311 Adjust all users to use symbols[i]->user_token_number.
21312
213132001-12-29 Akim Demaille <akim@epita.fr>
21314
21315 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
21316 Adjust all users to use symbols[i]->prec or ->assoc.
21317
213182001-12-29 Akim Demaille <akim@epita.fr>
21319
21320 * src/reader.c, src/reader.h (tags): Remove.
21321 Adjust all users to use symbols[i]->tag.
21322
213232001-12-29 Akim Demaille <akim@epita.fr>
21324
21325 * src/gram.h, src/gram.c (symbols): New, similar to state_table
21326 and rule_table.
21327 * src/reader.c (packsymbols): Fill this table.
21328 Drop sprec.
21329 * src/conflicts.c (resolve_sr_conflict): Adjust.
21330 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
21331 single table.
21332 Use symbols[i]->tag instead of tags[i].
21333
213342001-12-29 Akim Demaille <akim@epita.fr>
21335
21336 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
21337 In addition, put a comment in there, to replace...
21338 * tests/regression.at (%union and C comments): Remove.
21339
213402001-12-29 Akim Demaille <akim@epita.fr>
21341
21342 * tests/regression.at (Web2c Actions): Blindly move the actual
21343 output as expected output. The contents *seem* right to me, but I
21344 can't pretend reading perfectly parser tables... Nonetheless, all
21345 the other tests pass correctly, the table look OK, even though the
21346 presence of `$axiom' is to be noted: AFAICS it is useless (but
21347 harmless).
21348
213492001-12-29 Akim Demaille <akim@epita.fr>
21350
21351 * src/reader.c (readgram): Don't add the rule 0 if there were no
21352 rules read. In other words, add it _after_ having performed
21353 grammar sanity checks.
21354 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
21355
213562001-12-29 Akim Demaille <akim@epita.fr>
21357
21358 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
21359 visible, and some states have now a different number.
21360
213612001-12-29 Akim Demaille <akim@epita.fr>
21362
21363 * src/reader.c (readgram): Bind the initial rule's lineno to that
21364 of the first rule.
21365 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
21366 (Solved SR Conflicts): Adjust rule 0's line number.
21367
213682001-12-29 Akim Demaille <akim@epita.fr>
21369
21370 Fix the `GAWK Grammar' failure.
21371
21372 * src/LR0.c (final_state): Initialize to -1 so that we do compute
21373 the reductions of the first state which was mistakenly confused
21374 with the final state because precisely final_state was initialized
21375 to 0.
21376 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
21377 now noticed by Bison.
21378 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
21379 have a reduction on $default.
21380
213812001-12-29 Akim Demaille <akim@epita.fr>
21382
21383 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
21384 rule line numbers.
21385 * src/closure.c (print_closure): Likewise.
21386 * src/derives.c (print_derives): Likewise.
21387 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
21388 now.
21389
213902001-12-29 Akim Demaille <akim@epita.fr>
21391
21392 * src/lalr.c (lookaheads_print): New.
21393 (lalr): Call it when --trace-flag.
21394 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
21395 are dumped.
21396
213972001-12-29 Akim Demaille <akim@epita.fr>
21398
21399 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
21400 when walking through ritem, even via rule->rhs.
21401 * src/reduce.c (dump_grammar, useful_production, reduce_output)
21402 (useful_production, useless_nonterminals): Likewise.
21403 (reduce_grammar_tables): Likewise, plus update nritems.
21404 * src/nullable.c (set_nullable): Likewise.
21405 * src/lalr.c (build_relations): Likewise.
21406 * tests/sets.at (Nullable): Adjust.
21407 Fortunately, now, the $axiom is no longer nullable.
21408
214092001-12-29 Akim Demaille <akim@epita.fr>
21410
21411 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
21412 the 0-sentinel.
21413 * src/gram.c (ritem_longest_rhs): Likewise.
21414 * src/reduce.c (nonterminals_reduce): Likewise.
21415 * src/print_graph.c (print_graph): Likewise.
21416 * src/output.c (output_rule_data): Likewise.
21417 * src/nullable.c (set_nullable): Likewise.
21418
214192001-12-29 Akim Demaille <akim@epita.fr>
21420
21421 * src/output.c: Comment changes.
21422
214232001-12-27 Paul Eggert <eggert@twinsun.com>
21424
21425 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
21426 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
21427 Sparc, as they were causing more porting problems than the
21428 (minor) performance improvement was worth.
21429
21430 Also, catch up with 1.31's YYSTD.
21431
214322001-12-27 Akim Demaille <akim@epita.fr>
21433
21434 * src/output.c (output_gram): Rely on nritems, not the
21435 0-sentinel. See below.
21436 Use -1 as separator, not 0.
21437 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
21438 Rely on -1 as separator in yyrhs, instead of 0.
21439 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
21440 twice `Now at end of input', therefore there are two lines less to
21441 expect.
21442
214432001-12-27 Akim Demaille <akim@epita.fr>
21444
21445 * tests/regression.at (Unresolved SR Conflicts):
21446 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
21447 below.
21448
214492001-12-27 Akim Demaille <akim@epita.fr>
21450
21451 * src/LR0.c (new_state): Recognize the final state by the fact it
21452 is reached by eoftoken.
21453 (insert_start_shifting_state, insert_eof_shifting_state)
21454 (insert_accepting_state, augment_automaton): Remove, since now
21455 these states are automatically computed from the initial state.
21456 (generate_states): Adjust.
21457 * src/print.c: When reporting a rule number to the user, substract
21458 1, so that the axiom rule is rule 0, and the first user rule is 1.
21459 * src/reduce.c: Likewise.
21460 * src/print_graph.c (print_core): For the time being, just as for
21461 the report, depend upon --trace-flags to dump the full set of
21462 items.
21463 * src/reader.c (readgram): Once the grammar read, insert the rule
21464 0: `$axiom: START-SYMBOL $'.
21465 * tests/set.at: Adjust: rule 0 is now displayed, and since the
21466 number of the states has changed (the final state is no longer
21467 necessarily the last), catch up.
21468
214692001-12-27 Akim Demaille <akim@epita.fr>
21470
21471 Try to make the use of the eoftoken valid. Given that its value
21472 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
21473 is used instead of > 0 where appropriate, (ii), depend upon nritems
21474 instead of the 0-sentinel.
21475
21476 * src/gram.h, src/gram.c (nritems): New.
21477 Expected to be duplication of nitems, but for the time being...
21478 * src/reader.c (packgram): Assert nritems and nitems are equal.
21479 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
21480 * src/closure.c (print_closure, print_fderives): Likewise.
21481 * src/gram.c (ritem_print): Likewise.
21482 * src/print.c (print_core, print_grammar): Likewise.
21483 * src/print_graph.c: Likewise.
21484
214852001-12-27 Akim Demaille <akim@epita.fr>
21486
21487 * src/main.c (main): If there are complains after grammar
21488 reductions, then output the report anyway if requested, then die.
21489 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
21490 * src/reader.c (eoftoken): New.
21491 (parse_token_decl): If the token being defined has value `0', it
21492 is the eoftoken.
21493 (packsymbols): No longer hack `tags' to insert `$' by hand.
21494 Be sure to preserve the value of the eoftoken.
21495 (reader): Make sure eoftoken is defined.
21496 Initialize nsyms to 0: now eoftoken is created just like the others.
21497 * src/print.c (print_grammar): Don't special case the eof token.
21498 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
21499 lie anyway, albeit pleasant.
21500 * tests/calc.at: Exercise error messages with eoftoken.
21501 Change the grammar so that empty input is invalid.
21502 Adjust expectations.
21503 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
21504
215052001-12-27 Akim Demaille <akim@epita.fr>
21506
21507 * configure.in: Check the protos of strchr ans strspn.
21508 Replace strchr if needed.
21509 * src/system.h: Provide the protos of strchr, strspn and memchr if
21510 missing.
21511 * lib/strchr.c: New.
21512 * src/reader.c (symbols_save): Use strchr.
21513
215142001-12-27 Akim Demaille <akim@epita.fr>
21515
21516 * src/print.c, src/print_graph.c (escape): New.
21517 Use it to quote the TAGS outputs.
21518 * src/print_graph.c (print_state): Now errors are in red, and
21519 reductions in green.
21520 Prefer high to wide: output the state number on a line of its own.
21521
215222001-12-27 Akim Demaille <akim@epita.fr>
21523
21524 * src/state.h, src/state.c (reductions_new): New.
21525 * src/LR0.c (set_state_table): Let all the states have a
21526 `reductions', even if reduced to 0.
21527 (save_reductions): Adjust.
21528 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
21529 * src/print.c (print_reductions, print_actions): Adjust.
21530 * src/output.c (action_row): Adjust.
21531
215322001-12-27 Akim Demaille <akim@epita.fr>
21533
21534 * src/state.h, src/state.c (errs_new, errs_dup): New.
21535 * src/LR0.c (set_state_table): Let all the states have an errs,
21536 even if reduced to 0.
21537 * src/print.c (print_errs, print_reductions): Adjust.
21538 * src/output.c (output_actions, action_row): Adjust.
21539 * src/conflicts.c (resolve_sr_conflict): Adjust.
21540
215412001-12-27 Akim Demaille <akim@epita.fr>
21542
21543 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
21544
215452001-12-27 Akim Demaille <akim@epita.fr>
21546
21547 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
21548 * src/print.c: here.
21549 (lookaheadset, shiftset): New, used as additional storage by
21550 print_reductions.
21551 (print_results): Adjust.
21552 (print_shifts, print_gotos, print_errs): New, extracted from...
21553 (print_actions): here.
21554 * src/print_graph.c (print_actions): Remove dead code.
21555
215562001-12-27 Akim Demaille <akim@epita.fr>
21557
21558 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
21559 `$n' and `@n'.
21560
215612001-12-27 Akim Demaille <akim@epita.fr>
21562
21563 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
21564 (build_relations): Adjust.
21565
215662001-12-27 Akim Demaille <akim@epita.fr>
21567
21568 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
21569 duplication.
21570
215712001-12-27 Akim Demaille <akim@epita.fr>
21572
21573 * src/reader.c (packgram): Catch nitems overflows.
21574
215752001-12-27 Akim Demaille <akim@epita.fr>
21576
21577 * src/files.c, src/files.h (guard_obstack): Remove.
21578 * src/output.c (output): Adjust.
21579 * src/reader.c (parse_braces): New, factoring...
21580 (copy_action, copy_guard): these two which are renamed as...
21581 (parse_action, parse_guard): these.
21582 As a voluntary consequence, using braces around guards is now
21583 mandatory.
21584
215852001-12-27 Akim Demaille <akim@epita.fr>
21586
21587 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
21588 * src/reader.c (symbol_list): `guard' and `guard_line' are new
21589 members.
21590 (symbol_list_new): Adjust.
21591 (copy_action): action_line is the first line, not the last.
21592 (copy_guard): Just as for actions, store the `action' only, not
21593 the switch/case/break flesh.
21594 Don't parse the user action that might follow the guard, let...
21595 (readgram): do it, i.e., now, there can be an action after a
21596 guard.
21597 In other words the guard is just explicitly optional.
21598 (packgram): Adjust.
21599 * src/output.c (guards_output): New.
21600 (output_parser): Call it when needed.
21601 (output): Also free the guard and attrs obstacks.
21602 * src/files.c, src/files.h (obstack_save): Remove.
21603 (output_files): Remove.
21604 As a result, if one needs the former `.act' file, using an
21605 appropriate skeleton which requires actions and guards is now
21606 required.
21607 * src/main.c (main): Adjust.
21608 * tests/semantic.at: New.
21609 * tests/regression.at: Use `input.y' as input file name.
21610 Avoid 8+3 problems by requiring input.c when the test needs the
21611 parser.
21612
216132001-12-27 Akim Demaille <akim@epita.fr>
21614
21615 * src/reader.c (symbol_list_new): Be sure to initialize all the
21616 fields.
21617
216182001-12-27 Akim Demaille <akim@epita.fr>
21619
21620 All the hacks using a final pseudo state are now useless.
21621
21622 * src/LR0.c (set_state_table): state_table holds exactly nstates.
21623 * src/lalr.c (nLA): New.
21624 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
21625 instead of lookaheadsp from the pseudo state (nstate + 1).
21626
216272001-12-27 Akim Demaille <akim@epita.fr>
21628
21629 * src/output.c (action_row, token_actions): Use a state_t instead
21630 of a integer, and nlookaheads instead of the following state's
21631 lookaheadsp.
21632
216332001-12-27 Akim Demaille <akim@epita.fr>
21634
21635 * src/conflicts.c (log_resolution, flush_shift)
21636 (resolve_sr_conflict, set_conflicts, solve_conflicts)
21637 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
21638 (conflicts_print, print_reductions): Use a state_t instead of an
21639 integer when referring to a state.
21640 As much as possible, depend upon nlookaheads, instead of the
21641 `lookaheadsp' member of the following state (since lookaheads of
21642 successive states are successive, the difference between state n + 1
21643 and n served as the number of lookaheads for state n).
21644 * src/lalr.c (add_lookback_edge): Likewise.
21645 * src/print.c (print_core, print_actions, print_state)
21646 (print_results): Likewise.
21647 * src/print_graph.c (print_core, print_actions, print_state)
21648 (print_graph): Likewise.
21649 * src/conflicts.h: Adjust.
21650
216512001-12-27 Akim Demaille <akim@epita.fr>
21652
21653 * src/bison.hairy: Formatting/comment changes.
21654 ANSIfy.
21655 Remove `register' indications.
21656 Add plenty of `static'.
21657
216582001-12-27 Akim Demaille <akim@epita.fr>
21659
21660 * src/output.c (prepare): Drop the muscle `ntbase' which
21661 duplicates ntokens.
21662 * src/bison.simple: Formatting/comment changes.
21663 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
21664 is an undocumented synonym.
21665
216662001-12-22 Akim Demaille <akim@epita.fr>
21667
21668 * src/output.c (output_table_data): Change the prototype to use
21669 `int' for array ranges: some invocations do pass an int, not a
21670 short.
21671 Reported by Wayne Green.
21672
216732001-12-22 Akim Demaille <akim@epita.fr>
21674
21675 Some actions of web2c.y are improperly triggered.
21676 Reported by Mike Castle.
21677
21678 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
21679 * tests/regression.at (Web2c): Rename as...
21680 (Web2c Report): this.
21681 (Web2c Actions): New.
21682
216832001-12-22 Akim Demaille <akim@epita.fr>
21684
21685 Reductions in web2c.y are improperly reported.
21686 Reported by Mike Castle.
21687
21688 * src/conflicts.c (print_reductions): Fix.
21689 * tests/regression.at (Web2c): New.
21690
216912001-12-18 Akim Demaille <akim@epita.fr>
21692
21693 Some host fail on `assert (!"foo")', which expands to
21694 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
21695 Reported by Nelson Beebee.
21696
21697 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
21698 `#define it_succeeded 0' and `assert (it_succeeded)'.
21699
217002001-12-17 Marc Autret <autret_m@epita.fr>
21701
21702 * src/bison.simple: Don't hard code the skeleton line and filename.
21703 * src/output.c (output_parser): Rename 'line' as 'output_line'.
21704 New line counter 'skeleton_line' (skeleton-line muscle).
21705
217062001-12-17 Paul Eggert <eggert@twinsun.com>
21707
21708 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
21709 YYDEBUG must be defined to a nonzero value.
21710
21711 * src/bison.simple (yytname): Do not assume that the user defines
21712 YYDEBUG to a properly parenthesized expression.
21713
217142001-12-17 Akim Demaille <akim@epita.fr>
21715
21716 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
21717 nlookaheads is a new member.
21718 Adjust all users.
21719 * src/lalr.h (nlookaheads): Remove this orphan declaration.
21720 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
21721 state.
21722
217232001-12-17 Akim Demaille <akim@epita.fr>
21724
21725 * src/files.h, src/files.c (open_files, close_files): Remove.
21726 * src/main.c (main): Don't open/close files, nor invoke lex_free,
21727 let...
21728 * src/reader.c (reader): Do it.
21729
217302001-12-17 Akim Demaille <akim@epita.fr>
21731
21732 * src/conflicts.c (print_reductions): Formatting changes.
21733
217342001-12-17 Akim Demaille <akim@epita.fr>
21735
21736 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
21737 (flush_reduce): New.
21738 (resolve_sr_conflict): Adjust.
21739
217402001-12-17 Akim Demaille <akim@epita.fr>
21741
21742 * src/output.c (output_obstack): Be static and rename as...
21743 (format_obstack): this, to avoid any confusion with files.c's
21744 output_obstack.
21745 * src/reader.h (muscle_obstack): Move to...
21746 * src/output.h: here, since it's defined in output.c.
21747
217482001-12-17 Akim Demaille <akim@epita.fr>
21749
21750 * src/output.c (action_row, save_column, default_goto)
21751 (sort_actions, matching_state, pack_vector): Better variable
21752 locality.
21753
217542001-12-17 Akim Demaille <akim@epita.fr>
21755
21756 * src/output.c: Various formatting changes.
21757
217582001-12-17 Akim Demaille <akim@epita.fr>
21759
21760 * src/files.c (output_files): Free the output_obstack.
21761 * src/main.c (main): Call print and print_graph conditionally.
21762 * src/print.c (print): Work unconditionally.
21763 * src/print_graph.c (print_graph): Work unconditionally.
21764 * src/conflicts.c (log_resolution): Output only if verbose_flag.
21765
217662001-12-16 Marc Autret <autret_m@epita.fr>
21767
21768 * src/output.c (actions_output): Fix. When we use %no-lines,
21769 there is one less line per action.
21770
217712001-12-16 Marc Autret <autret_m@epita.fr>
21772
21773 * src/bison.simple: Remove a useless #line directive.
21774 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
21775 * src/output.c (get_lines_number): New.
21776 (output_parser): Adjust, now takes care about the lines of a
21777 output muscles.
21778 Fix line numbering.
21779 (actions_output): Computes the number of lines taken by actions.
21780 (output_master_parser): Insert new skeleton which is the name of
21781 the output parser file name.
21782
217832001-12-15 Marc Autret <autret_m@epita.fr>
21784
21785 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
21786
217872001-12-15 Marc Autret <autret_m@epita.fr>
21788
21789 * src/output.c (output_gram): Keep track of the hairy one.
21790
217912001-12-15 Akim Demaille <akim@epita.fr>
21792
21793 Make `make distcheck' work.
21794
21795 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
21796 system.h which uses libgettext.h.
21797
217982001-12-15 Akim Demaille <akim@epita.fr>
21799
21800 * src/nullable.c (set_nullable): Useless rules must be skipped,
21801 otherwise, since we range over their symbols, we might look at a
21802 nonterminal which no longer ``exists'', i.e., it is not counted in
21803 `nvars', hence we overflow our arrays.
21804
218052001-12-15 Akim Demaille <akim@epita.fr>
21806
21807 The header can also be produced directly, without any obstack!
21808 Yahoo!
21809
21810 * src/files.c, src/files.h (defines_obstack): Remove.
21811 (compute_header_macro): Global.
21812 (defines_obstack_save): Remove.
21813 * src/reader.c (parse_union_decl): No longer output to
21814 defines_obstack: its content can be found in the `stype' muscle
21815 anyway.
21816 (output_token_translations): Merge into...
21817 (symbols_output): this.
21818 Rename as...
21819 (symbols_save): this.
21820 (reader): Adjust.
21821 * src/output.c (header_output): New.
21822 (output): Call it.
21823
218242001-12-15 Akim Demaille <akim@epita.fr>
21825
21826 * src/reader.c (parse_union_decl): Instead of handling two obstack
21827 simultaneously, use one to define the `stype' muscle, and use the
21828 value of the latter to fill defines_obstack.
21829 (copy_comment): Remove.
21830 (copy_comment2): Work for a single obstack.
21831 Rename as...
21832 (copy_comment): this.
21833
218342001-12-15 Akim Demaille <akim@epita.fr>
21835
21836 * src/lex.c, src/lex.h (xgetc): No longer static.
21837 * src/reader.c (parse_union_decl): Revamp.
21838
218392001-12-15 Akim Demaille <akim@epita.fr>
21840
21841 Still making progress in separating Bison into (i) input, (ii)
21842 process, (iii) output: now we can directly output the parser file
21843 without using table_obstack at all.
21844
21845 * src/files.c, src/files.h (table_obstack): Bye bye.
21846 (parser_file_name): New.
21847 * src/files.c (compute_output_file_names): Compute it.
21848 * src/output.c (actions_output, output_parser)
21849 (output_master_parser): To a file instead of an obstack.
21850
218512001-12-15 Akim Demaille <akim@epita.fr>
21852
21853 Attach actions to rules, instead of pre-outputting them to
21854 actions_obstack.
21855
21856 * src/gram.h (rule_t): action and action_line are new members.
21857 * src/reader.c (symbol_list): Likewise.
21858 (copy_action): Save the actions within the rule.
21859 (packgram): Save them in rule_table.
21860 * src/output.c (actions_output): New.
21861 (output_parser): Use it on `%%actions'.
21862 (output_rule_data): Don't free rule_table.
21863 (output): Do it.
21864 (prepare): Don't save the `action' muscle.
21865 * src/bison.simple: s/%%action/%%actions/.
21866
218672001-12-15 Akim Demaille <akim@epita.fr>
21868
21869 * src/reader.c (copy_action): When --yacc, don't append a `;'
21870 to the user action: let it fail if lacking.
21871 Suggested by Arnold Robbins and Tom Tromey.
21872
218732001-12-14 Akim Demaille <akim@epita.fr>
21874
21875 * src/lex.c (literalchar): Simply return the char you decoded, non
21876 longer mess around with obstacks and int pointers.
21877 Adjust all callers.
21878
218792001-12-14 Akim Demaille <akim@epita.fr>
21880
21881 * src/lex.c (literalchar): Don't escape the special characters,
21882 just decode them, and keep them as char (before, eol was output as
21883 the 2 char string `\n' etc.).
21884 * src/output.c (output_rule_data): Use quotearg to output the
21885 token strings.
21886
218872001-12-13 Paul Eggert <eggert@twinsun.com>
21888
21889 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
21890 Do not infringe on the global user namespace when using C++.
21891 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
21892 All uses of `fprintf' and `stderr' changed.
21893
21894 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
21895
218962001-12-13 Akim Demaille <akim@epita.fr>
21897
21898 The computation of nullable is broken: it doesn't handle empty
21899 RHS's properly.
21900
21901 * tests/torture.at (GNU AWK Grammar): New.
21902 * tests/sets.at (Nullable): New.
21903 * src/nullable.c (set_nullable): Instead of blindly looping over
21904 `ritems', loop over the rules, and then over their rhs's.
21905
21906 Work around Autotest bugs.
21907
21908 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
21909 frame, because Autotest understand lines starting with a `+' as
21910 traces from the shell. Then, they are not processed properly.
21911 Admittedly an Autotest bug, but we don't have time to wait for
21912 Autotest to catch up.
21913 * tests/regression.at (Broken Closure): Adjust to the new table
21914 frames.
21915 Move to...
21916 * tests/sets.at: here.
21917
219182001-12-13 Akim Demaille <akim@epita.fr>
21919
21920 * src/closure.c (closure): Use nrules instead of playing tricks
21921 with BITS_PER_WORD.
21922
219232001-12-13 Akim Demaille <akim@epita.fr>
21924
21925 * src/print.c (print_actions): Output the handling of `$' as the
21926 traces do: shifting the token EOF. Before EOF was treated as a
21927 nonterminal.
21928 * tests/regression.at: Adjust some tests.
21929 * src/print_graph.c (print_core): Complete the set of items via
21930 closure. The next-to-final and final states are still unsatisfying,
21931 but that's to be addressed elsewhere.
21932 No longer output the rule numbers, but do output the state number.
21933 A single loop for the shifts + gotos is enough, but picked a
21934 distinct color for each.
21935 (print_graph): Initialize and finalize closure.
21936
219372001-12-13 Akim Demaille <akim@epita.fr>
21938
21939 * src/reader.c (readgram): Remove dead code, an strip useless
21940 braces.
21941 (get_type): Remove, unused.
21942
219432001-12-12 Akim Demaille <akim@epita.fr>
21944
21945 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
21946 on that of lib/error.c.
21947
219482001-12-12 Akim Demaille <akim@epita.fr>
21949
21950 Some hosts don't like `/' in includes.
21951
21952 * src/system.h: Include libgettext.h without qualifying the path.
21953 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
21954 $(top_srcdir).
21955
219562001-12-11 Marc Autret <autret_m@epita.fr>
21957
21958 * src/output.c (output_parser): Remove useless muscle.
21959
219602001-12-11 Marc Autret <autret_m@epita.fr>
21961
21962 * src/bison.simple: Remove #line just before %%epilogue. It
21963 is now handled in ...
21964 * src/reader.c (read_additionnal_code): Add the output of a
21965 #line for the epilogue.
21966
219672001-12-10 Marc Autret <autret_m@epita.fr>
21968
21969 * src/reader.c (copy_definition): Re-use CPP-outed code which
21970 replace precedent remove.
21971 * src/bison.simple: Remove #line before %%prologue because
21972 %%input-line is wrong at this time.
21973
219742001-12-10 Marc Autret <autret_m@epita.fr>
21975
21976 * src/reader.c (symbols_output): Clean up.
21977 * src/output.c (output_gram, output): Clean up.
21978
219792001-12-10 Akim Demaille <akim@epita.fr>
21980
21981 * src/lalr.c (initialize_lookaheads): New. Extracted from...
21982 * src/LR0.c (set_state_table): here.
21983 * src/lalr.c (lalr): Call it.
21984
219852001-12-10 Akim Demaille <akim@epita.fr>
21986
21987 * src/state.h (shifts): Remove the `number' member: shifts are
21988 attached to state, hence no longer need to be labelled with a
21989 state number.
21990
219912001-12-10 Akim Demaille <akim@epita.fr>
21992
21993 Now that states have a complete set of members, the linked list of
21994 shifts is useless: just fill directly the state's shifts member.
21995
21996 * src/state.h (shifts): Remove the `next' member.
21997 * src/LR0.c (first_state, last_state): Remove.
21998 Adjust the callers.
21999 (augment_automaton): Don't look for the shifts that must be added
22000 a shift on EOF: it is those of the state we looked for! But now,
22001 since shifts are attached, it is no longer needed to looking
22002 merely by its id: its number.
22003
220042001-12-10 Akim Demaille <akim@epita.fr>
22005
22006 * src/LR0.c (augment_automaton): Better variable locality.
22007 Remove an impossible branch: if there is a state corresponding to
22008 the start symbol being shifted, then there is shift for the start
22009 symbol from the initial state.
22010
220112001-12-10 Akim Demaille <akim@epita.fr>
22012
22013 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
22014 only when appropriate: when insert_start_shifting_state' is not
22015 invoked.
22016 * tests/regression.at (Rule Line Numbers): Adjust.
22017
220182001-12-10 Akim Demaille <akim@epita.fr>
22019
22020 * src/LR0.c (augment_automaton): Now that all states have shifts,
22021 merge the two cases addition shifts to the initial state.
22022
220232001-12-10 Akim Demaille <akim@epita.fr>
22024
22025 * src/lalr.c (set_state_table): Move to...
22026 * src/LR0.c: here.
22027 * src/lalr.c (lalr): Don't call it...
22028 * src/LR0.c (generate_states): do it.
22029 * src/LR0.h (first_state): Remove, only the table is used.
22030
220312001-12-10 Akim Demaille <akim@epita.fr>
22032
22033 * src/LR0.h (first_shift, first_reduction): Remove.
22034 * src/lalr.c: Don't use first_shift: find shifts through the
22035 states.
22036
220372001-12-10 Akim Demaille <akim@epita.fr>
22038
22039 * src/LR0.c: Attach shifts to states as soon as they are
22040 computed.
22041 * src/lalr.c (set_state_table): Instead of assigning shifts to
22042 state, just assert that the mapping was properly done.
22043
220442001-12-10 Akim Demaille <akim@epita.fr>
22045
22046 * src/LR0.c (insert_start_shift): Rename as...
22047 (insert_start_shifting_state): this.
22048 (insert_eof_shifting_state, insert_accepting_state): New.
22049 (augment_automaton): Adjust.
22050 Better locality of the variables.
22051 When looking if the start_symbol is shifted from the initial
22052 state, using `while (... symbol != start_symbol ...)' sounds
22053 better than `while (... symbol < start_symbol ...)': If fail
22054 to see how the order between symbols could be relevant!
22055
220562001-12-10 Akim Demaille <akim@epita.fr>
22057
22058 * src/getargs.h: Don't declare `spec_name_prefix' and
22059 `spec_file_prefix', declared by src/files.h.
22060 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
22061 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
22062 * src/output.c (prepare): Adjust.
22063 * src/reader.c (symbols_output): Likewise.
22064 * src/vmsgetargs.c: Vaguely adjust, but who cares?
22065
220662001-12-10 Akim Demaille <akim@epita.fr>
22067
22068 * src/muscle_tab.c (muscle_init): NULL is a better default than
22069 `"0"'.
22070
220712001-12-10 Akim Demaille <akim@epita.fr>
22072
22073 * src/reader.c (reader): Calling symbols_output once is enough.
22074
220752001-12-10 Akim Demaille <akim@epita.fr>
22076
22077 Now that states have a complete set of members, the linked list of
22078 reductions is useless: just fill directly the state's reductions
22079 member.
22080
22081 * src/state.h (struct reductions): Remove member `number' and
22082 `next'.
22083 * src/LR0.c (first_reduction, last_reduction): Remove.
22084 (save_reductions): Don't link the new reductions, store them in
22085 this_state.
22086 * src/lalr.c (set_state_table): No need to attach reductions to
22087 states, it's already done.
22088 * src/output.c (output_actions): No longer free the shifts, then
22089 the reductions, then the states: free all the states and their
22090 members.
22091
220922001-12-10 Akim Demaille <akim@epita.fr>
22093
22094 * src/options.c (OPTN, DRTV, BOTH): New.
22095 (option_table): Use them.
22096
22097 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
22098 the job of system.h.
22099 * src/options.c: Don't include stdio.h and xalloc.h for the same
22100 reasons.
22101
221022001-12-10 Akim Demaille <akim@epita.fr>
22103
22104 * src/output.c (output, prepare): Make sure the values of the
22105 muscles `action' and `prologue' are 0-terminated.
22106
221072001-12-10 Akim Demaille <akim@epita.fr>
22108
22109 Clean up GCC warnings.
22110
22111 * src/reader.c (copy_action): `buf' is not used.
22112 (parse_skel_decl): Be static.
22113 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
22114 * src/options.h (create_long_option_table): Have a real prototype.
22115 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
22116 (hash_delete_at): Return const void *.
22117 Adjust casts to preserve the const.
22118
221192001-12-10 Akim Demaille <akim@epita.fr>
22120
22121 * configure.in: Require 2.52g.
22122 M4 is not needed, but AUTOM4TE is.
22123 * m4/m4.m4: Remove.
22124 * tests/Makefile.am: Adjust.
22125
221262001-12-10 Akim Demaille <akim@epita.fr>
22127
22128 One structure for states is enough, even though theoretically
22129 there are LR(0) states and LALR(1) states.
22130
22131 * src/lalr.h (state_t): Remove.
22132 (state_table): Be state_t **, not state_t *.
22133 * src/state.h (core, CORE_ALLOC): Rename as...
22134 (state_t, STATE_ALLOC): this.
22135 Add the LALR(1) members: shifts, reductions, errs.
22136 * src/LR0.c (state_table): Rename as...
22137 (state_hash): this, to avoid name clashes with the global
22138 `state_table'.
22139 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
22140 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
22141
221422001-12-10 Akim Demaille <akim@epita.fr>
22143
22144 Bison dumps core on bash.y.
22145 Reported by Pascal Bart.
22146
22147 * src/warshall.c (bitmatrix_print): New.
22148 (TC): Use it.
22149 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
22150 j must be the outer loop.
22151 * tests/regression.at (Broken Closure): New.
22152
221532001-12-05 Akim Demaille <akim@epita.fr>
22154
22155 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
22156 its argument.
22157 Reported by Peter Hamorsky.
22158
221592001-12-05 Akim Demaille <akim@epita.fr>
22160
22161 * src/conflicts.c (err_table): Remove.
22162 (resolve_sr_conflict): Adjust.
22163 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
22164 Rename as...
22165 (state_t.reductions, state_t.shifts): this.
22166
221672001-12-05 Akim Demaille <akim@epita.fr>
22168
22169 * src/reduce.c (reduce_grammar_tables): No longer disable the
22170 removal of useless rules via CPP but via `if (0)', so that the
22171 compiler still check the code is valid.
22172 For instance, it should have noticed `rline' no longer exists: use
22173 the `line' member of rule_t.
22174 * src/gram.c (dummy, rline): Remove, unused.
22175
221762001-12-05 Akim Demaille <akim@epita.fr>
22177
22178 * src/output.c (pack_vector): Use assert, not berror.
22179 * src/main.c (berror): Remove, unused.
22180
221812001-12-05 Akim Demaille <akim@epita.fr>
22182
22183 New experimental feature: if --verbose --trace output all the
22184 items of a state, not only its kernel.
22185
22186 * src/print.c (print_core): If `trace_flag', then invoke closure
22187 before outputting the items of the state (print_core is no longer
22188 a correct name them).
22189 (print_results): Invoke new_closure/free_closure if needed.
22190
221912001-12-05 Akim Demaille <akim@epita.fr>
22192
22193 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
22194 * src/closure.c, src/closure.h (itemsetsize): Rename as...
22195 (nitemset): for consistency with the rest of the project.
22196
221972001-12-05 Akim Demaille <akim@epita.fr>
22198
22199 * src/closure.c (print_closure): Improve.
22200 (closure): Use it for printing input and output.
22201
222022001-12-05 Akim Demaille <akim@epita.fr>
22203
22204 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
22205 indexed by nonterminals.
22206
222072001-12-05 Akim Demaille <akim@epita.fr>
22208
22209 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
22210 what it was!).
22211 * src/warshall.h: Remove accidental duplication of the content.
22212
222132001-12-05 Akim Demaille <akim@epita.fr>
22214
22215 * src/closure.c (set_fderives): De-obfuscate.
22216
222172001-12-05 Akim Demaille <akim@epita.fr>
22218
22219 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
22220
222212001-12-05 Akim Demaille <akim@epita.fr>
22222
22223 * src/closure.c (set_firsts): De-obfuscate.
22224
222252001-12-05 Akim Demaille <akim@epita.fr>
22226
22227 * src/output.c (action_row): De-obfuscate
22228 using the good o' techniques: arrays not pointers, variable
22229 locality, BITISSET, RESETBIT etc.
22230
222312001-12-05 Akim Demaille <akim@epita.fr>
22232
22233 Pessimize the code to simplify it: from now on, all the states
22234 have a valid SHIFTS, which NSHIFTS is possibly 0.
22235
22236 * src/LR0.c (shifts_new): Be global and move to..
22237 * src/state.c, src/state.h: here.
22238 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
22239 * src/print_graph: Adjust.
22240
222412001-12-05 Akim Demaille <akim@epita.fr>
22242
22243 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
22244 * src/conflicts.c: Use it.
22245 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
22246 incorrectly ``simplified''.
22247
222482001-12-05 Akim Demaille <akim@epita.fr>
22249
22250 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
22251 using the good o' techniques: arrays not pointers, variable
22252 locality, BITISSET, RESETBIT etc.
22253
222542001-12-05 Akim Demaille <akim@epita.fr>
22255
22256 * src/state.h (SHIFT_SYMBOL): New.
22257 * src/conflicts.c: Use it to deobfuscate.
22258
222592001-12-05 Akim Demaille <akim@epita.fr>
22260
22261 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
22262 (print_reductions): De-obfuscate using the good o' techniques:
22263 arrays not pointers, variable locality, BITISSET.
22264
222652001-12-05 Akim Demaille <akim@epita.fr>
22266
22267 * src/conflicts.c (print_reductions): Arrays, not pointers.
22268 Use BITISSET.
22269
222702001-12-05 Akim Demaille <akim@epita.fr>
22271
22272 * src/conflicts.c (print_reductions): Pessimize, but clarify.
22273
222742001-12-05 Akim Demaille <akim@epita.fr>
22275
22276 * src/conflicts.c (print_reductions): Improve variable locality.
22277
222782001-12-05 Akim Demaille <akim@epita.fr>
22279
22280 * src/conflicts.c (print_reductions): Pessimize, but clarify.
22281
222822001-12-05 Akim Demaille <akim@epita.fr>
22283
22284 * src/conflicts.c (print_reductions): Improve variable locality.
22285
222862001-12-05 Akim Demaille <akim@epita.fr>
22287
22288 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
22289 * src/lalr.c: Use them.
22290
222912001-12-05 Akim Demaille <akim@epita.fr>
22292
22293 * src/LR0.c (augment_automaton): Formatting changes.
22294 Better variable locality.
22295
222962001-12-05 Akim Demaille <akim@epita.fr>
22297
22298 * src/lalr.c (matrix_print): New.
22299 (transpose): Use it.
22300 Use arrays instead of pointers.
22301
223022001-12-05 Akim Demaille <akim@epita.fr>
22303
22304 * src/lalr.c (maxrhs): Move to...
22305 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
22306 * src/lalr.c (build_relations): Adjust.
22307
223082001-12-05 Akim Demaille <akim@epita.fr>
22309
22310 * src/lalr.c (transpose): Free the memory allocated to the
22311 argument, as it is replaced by the results by the unique caller.
22312 (build_relations): Merely invoke transpose: it handles the memory
22313 deallocation.
22314 Improve variable locality.
22315 Avoid variables used as mere abbreviations.
22316 (compute_lookaheads): Use arrays instead of pointers.
22317
223182001-12-05 Akim Demaille <akim@epita.fr>
22319
22320 * src/lalr.c (initialize_F): Improve variable locality.
22321 Avoid variables used as mere abbreviations.
22322
223232001-12-05 Akim Demaille <akim@epita.fr>
22324
22325 * src/derives.c (print_derives): Display the ruleno.
22326 * src/lalr.c (initialize_F, transpose): Better variable locality
22327 to improve readability.
22328 Avoid variables used as mere abbreviations.
22329
223302001-12-05 Akim Demaille <akim@epita.fr>
22331
22332 * src/lalr.c (traverse): Use arrays instead of pointers.
22333
223342001-12-05 Akim Demaille <akim@epita.fr>
22335
22336 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
22337 the handling of squeue.
22338 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
22339
223402001-12-05 Akim Demaille <akim@epita.fr>
22341
22342 Because useless nonterminals are now kept alive (instead of being
22343 `destroyed'), we now sometimes examine them, and store information
22344 related to them. Hence we need to know their number, and adjust
22345 memory allocations.
22346
22347 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
22348 static.
22349 * src/LR0.c (allocate_itemsets): The memory allocated to
22350 `symbol_count' was used for two different purpose: once to count
22351 the number of occurrences of each symbol, and later reassigned to
22352 `shift_symbol', containing the symbol that can be shifted from a
22353 given state.
22354 Deobfuscate, i.e., allocate, use and free `symbol_count' here
22355 only, and...
22356 (new_itemsets): Allocate `shift_symbol' here.
22357 (allocate_itemsets): symbol_count includes useless nonterminals.
22358 Make room for them.
22359 (free_storage): Use `free', not `XFREE', for pointers that cannot
22360 be null.
22361
223622001-12-05 Akim Demaille <akim@epita.fr>
22363
22364 * src/nullable.c (set_nullable): Deobfuscate the handling of
22365 ritem.
22366 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
22367
223682001-12-05 Akim Demaille <akim@epita.fr>
22369
22370 * src/gram.c, src/gram.h (ritem_print): New.
22371 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
22372 (This useless function was defined only to work around VMS linkers
22373 that can't handle compilation units with variables only).
22374 * src/reduce.c (dump_grammar): Use it to trace the construction of
22375 ritem.
22376
223772001-12-04 Paul Eggert <eggert@twinsun.com>
22378
22379 * src/bison.simple (union yyalloc): Change member names
22380 to be the same as the stack names.
22381 (yyparse): yyptr is now union yyalloc *, not char *.
22382 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
22383 and may generate better code on some machines.
22384 (yystpcpy): Use prototype if __STDC__ is defined, not just
22385 if __cplusplus is defined.
22386
223872001-11-30 Akim Demaille <akim@epita.fr>
22388
22389 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
22390 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
22391 Gettext doesn't compile cleanly, and dies with -Werror.
22392 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
22393 Include WARNING_CFLAGS here.
22394 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
22395 before being defined.
22396
223972001-11-27 Paul Eggert <eggert@twinsun.com>
22398
22399 * lib/quotearg.h (quotearg_n, quotearg_n_style):
22400 First arg is int, not unsigned.
22401 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
22402 (SIZE_MAX, UINT_MAX): New macros.
22403 (quotearg_n_options): Abort if N is negative.
22404 Avoid overflow check on hosts where size_t is 64 bits and int
22405 is 32 bits, as overflow is impossible there.
22406 Fix off-by-one typo that caused unnecessary reallocation.
22407
224082001-11-29 Paul Eggert <eggert@twinsun.com>
22409
22410 Name space cleanup in generated parser.
22411
22412 * doc/bison.texinfo (Bison Parser): Discuss system headers
22413 and their effect on the user name space.
22414
22415 * src/bison.simple:
22416 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
22417 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
22418 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
22419
22420 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
22421 on user names when possible.
22422
22423 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
22424 Simplify test for whather <alloca.h> exists.
22425
22426 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
22427
22428 (<stdio.h>): Include if YYDEBUG.
22429
22430 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
22431 ! defined (yyoverflow) && ! defined (yymemcpy).
22432
22433 (yymemcpy, yyparse): Rename local variables as needed so that
22434 they all begin with 'yy'.
22435
22436 (yystrlen, yystpcpy): New functions.
22437
22438 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
22439 All uses changed.
22440
22441 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
22442 instead of relying on string.h functions. Use YYSTACK_ALLOC
22443 and YYSTACK_FREE instead of malloc and free.
22444
224452001-11-30 Akim Demaille <akim@epita.fr>
22446
22447 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
22448 before their first uses.
22449 (YYBISON, YYPURE): Move to the top of the output.
22450
224512001-11-30 Akim Demaille <akim@epita.fr>
22452
22453 * tests/reduce.at (Useless Nonterminals): Fix.
22454
224552001-11-30 Akim Demaille <akim@epita.fr>
22456
22457 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
22458 if body instead of `;' to pacify GCC's warnings.
22459
224602001-11-30 Akim Demaille <akim@epita.fr>
22461
22462 Instead of mapping the LHS of unused rules to -1, keep the LHS
22463 valid, but flag the rules as invalid.
22464
22465 * src/gram.h (rule_t): `useful' is a new member.
22466 * src/print.c (print_grammar): Adjust.
22467 * src/derives.c (set_derives): Likewise.
22468 * src/reader.c (packgram, reduce_output): Likewise.
22469 * src/reduce.c (reduce_grammar_tables): Likewise.
22470 * tests/reduce.at (Underivable Rules, Useless Rules): New.
22471
224722001-11-30 Akim Demaille <akim@epita.fr>
22473
22474 * src/reduce.c (reduce_output): Formatting changes.
22475 * src/print.c (print_results, print_grammar): Likewise.
22476 * tests/regression.at (Rule Line Numbers)
22477 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
22478
224792001-11-30 Akim Demaille <akim@epita.fr>
22480
22481 * src/reduce.c (nonterminals_reduce): Instead of throwing away
22482 useless nonterminals, move them at the end of the symbol arrays.
22483 (reduce_output): Adjust.
22484 * tests/reduce.at (Useless Nonterminals): Adjust.
22485
224862001-11-30 Akim Demaille <akim@epita.fr>
22487
22488 * src/reduce.c: Various comment/formatting changes.
22489 (nonterminals_reduce): New, extracted from...
22490 (reduce_grammar_tables): here.
22491 (reduce_grammar): Call nonterminals_reduce.
22492
224932001-11-29 Paul Eggert <eggert@twinsun.com>
22494
22495 * src/bison.simple (YYSTACK_REALLOC): Remove.
22496 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
22497 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
22498 New macros.
22499 (union yyalloc): New type.
22500 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
22501 an arbitrary restriction on hosts where size_t is wider than int.
22502
22503 (yyparse): Don't dump core if alloca or malloc fails; instead, report
22504 a parser stack overflow. Allocate just one block of memory for all
22505 three stacks, instead of allocating three blocks; this typically is
22506 faster and reduces fragmentation.
22507
22508 Do not limit the number of items in the stack to a value that fits
22509 in 'int', as this is an arbitrary limit on hosts with 64-bit
22510 size_t and 32-bit int.
22511
225122001-11-29 Marc Autret <autret_m@epita.fr>
22513
22514 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
22515 of defining YYERROR_VERBOSE.
22516 [AT_DATA]: $4 is now out of C declarations in the prologue.
22517
225182001-11-28 Marc Autret <autret_m@epita.fr>
22519
22520 * src/reader.c (parse_dquoted_param): New.
22521 (parse_skel_decl): Use it.
22522 * src/lex.h: Add its prototype.
22523 * src/lex.c (literalchar): Become not static.
22524
225252001-11-28 Marc Autret <autret_m@epita.fr>
22526
22527 * src/output.h: And put its extern declaration here.
22528 * src/output.c (error_verbose): Define here.
22529 (prepare): Echo name modification.
22530 * src/getargs.h: Clean its extern declaration.
22531 * src/getargs.c (error_verbose_flag): Remove.
22532 (getargs): Remove case 'e'.
22533 * src/options.c (option_table): 'error-verbose' is now seen as simple
22534 percent option.
22535 Include output.h.
22536
22537 * src/reader.c (read_declarations): Remove case tok_include.
22538 (parse_include_decl): Remove.
22539 * src/lex.h (token_t): Remove tok_include.
22540 * src/options.c (option_table): 'include' is now a simple command line
22541 option.
22542
225432001-11-28 Marc Autret <autret_m@epita.fr>
22544
22545 * src/bison.simple: Adjust muscle names.
22546 * src/muscle_tab.c (muscle_init): Also rename the muscles.
22547 * src/output.c (prepare): s/_/-/ for the muscles names.
22548 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
22549
225502001-11-28 Marc Autret <autret_m@epita.fr>
22551
22552 * src/bison.simple: Fix debug.
22553 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
22554
225552001-11-28 Akim Demaille <akim@epita.fr>
22556
22557 * src/LR0.c (shifts_new): New.
22558 (save_shifts, insert_start_shift, augment_automaton): Use it.
22559
225602001-11-28 Akim Demaille <akim@epita.fr>
22561
22562 * src/closure.c (closure): `b' and `ruleno' denote the same value:
22563 keep ruleno only.
22564
225652001-11-28 Akim Demaille <akim@epita.fr>
22566
22567 * src/closure.c (closure): Instead of looping over word in array
22568 then bits in words, loop over bits in array.
22569
225702001-11-28 Akim Demaille <akim@epita.fr>
22571
22572 * src/closure.c (closure): No longer optimize the special case
22573 where all the bits of `ruleset[r]' are set to 0, to make the code
22574 clearer.
22575
225762001-11-28 Akim Demaille <akim@epita.fr>
22577
22578 * src/closure.c (closure): `r' and `c' are new variables, used to
22579 de-obfuscate accesses to RULESET and CORE.
22580
225812001-11-28 Akim Demaille <akim@epita.fr>
22582
22583 * src/reduce.c (reduce_print): Use ngettext.
22584 (dump_grammar): Improve the trace accuracy.
22585
225862001-11-28 Akim Demaille <akim@epita.fr>
22587
22588 * src/reduce.c (dump_grammar): Don't translate trace messages.
22589
225902001-11-28 Akim Demaille <akim@epita.fr>
22591
22592 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
22593 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
22594 as all tags are free'ed afterwards.
22595 From Enrico Scholz.
22596
225972001-11-27 Paul Eggert <eggert@twinsun.com>
22598
22599 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
22600 use alloca when we didn't want to, and vice versa.
22601
226022001-11-27 Marc Autret <autret_m@epita.fr>
22603
22604 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
22605 initialization.
22606 * src/output.c (prepare): Remove its update.
22607
226082001-11-27 Marc Autret <autret_m@epita.fr>
22609
22610 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
22611 Use %error-verbose.
22612
226132001-11-27 Marc Autret <autret_m@epita.fr>
22614
22615 * src/bison.simple: Remove YYERROR_VERBOSE using.
22616 Use %%error_verbose.
22617 (yyparse): Likewise.
22618 * src/output.c (prepare): Give its final value.
22619 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
22620 * src/getargs.h: Add its extern declaration.
22621 * src/getargs.c (error_verbose_flag): New int.
22622 (getargs): Update to catch new case.
22623 * src/options.c (option_table): 'error-verbose' is a new option.
22624 (shortopts): Update.
22625
226262001-11-27 Akim Demaille <akim@epita.fr>
22627
22628 * src/system.h: Use intl/libgettext.h.
22629 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
22630
226312001-11-27 Akim Demaille <akim@epita.fr>
22632
22633 * tests/torture.at (Exploding the Stack Size with Malloc):
22634 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
22635
226362001-11-27 Akim Demaille <akim@epita.fr>
22637
22638 * src/files.c: Include error.h.
22639 Reported by Hans Aberg.
22640
226412001-11-26 Marc Autret <autret_m@epita.fr>
22642
22643 * src/reader.c (parse_include_decl): New, not yet implemented.
22644 (read_declarations): Add case tok_include.
22645 * src/getargs.h (include): Add its extern definition.
22646 * src/getargs.c (include): New const char *.
22647 (getargs): Add case '-I'.
22648 * src/options.c (option_table): Add include as command line and
22649 percent option.
22650 * src/lex.h (token_t): Add tok_include.
22651
226522001-11-26 Akim Demaille <akim@epita.fr>
22653
22654 * src/reader.c (readgram): Make sure rules for mid-rule actions
22655 have a lineno equal to that of their host rule.
22656 Reported by Hans Aberg.
22657 * tests/regression.at (Rule Line Numbers): New.
22658
226592001-11-26 Akim Demaille <akim@epita.fr>
22660
22661 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
22662 size_ts.
22663
226642001-11-26 Akim Demaille <akim@epita.fr>
22665
22666 * src/complain.c, src/complain.h (error): Remove, provided by
22667 lib/error.[ch].
22668
226692001-11-26 Akim Demaille <akim@epita.fr>
22670
22671 * src/reader.c (read_declarations): Don't abort on tok_illegal,
22672 issue an error message.
22673 * tests/regression.at (Invalid %directive): New.
22674 Reported by Hans Aberg.
22675
226762001-11-26 Akim Demaille <akim@epita.fr>
22677
22678 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
22679 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
22680
226812001-11-26 Akim Demaille <akim@epita.fr>
22682
22683 * src/conflicts.c (conflicts_print): Don't complain at all when
22684 there are no reduce/reduce conflicts, and as many shift/reduce
22685 conflicts as expected.
22686 * tests/regression.at (%expect right): Adjust.
22687
226882001-11-23 Akim Demaille <akim@epita.fr>
22689
22690 * lib/alloca.c: Update, from fileutils.
22691
226922001-11-23 Akim Demaille <akim@epita.fr>
22693
22694 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
22695
226962001-11-23 Akim Demaille <akim@epita.fr>
22697
22698 * src/system.h: Include alloca.h.
22699 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
22700
227012001-11-23 Akim Demaille <akim@epita.fr>
22702
22703 * src/print_graph.c (print_actions): Remove `rule', unused.
22704 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
22705 pacify GCC's signed < unsigned warnings.
22706 * src/closure.c (itemsetsize): Likewise.
22707 * src/reader.c (symbol_list_new): Static.
22708
227092001-11-23 Akim Demaille <akim@epita.fr>
22710
22711 Attaching lineno to buckets is stupid, since only one copy of each
22712 symbol is kept, only the line of the first occurrence is kept too.
22713
22714 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
22715 * src/reader.c (rline_allocated): Remove, unused.
22716 (symbol_list): Have a `line' member.
22717 (symbol_list_new): New.
22718 (readgram): Use it.
22719 * src/print.c (print_grammar): Output the rule line numbers.
22720 * tests/regression.at (Solved SR Conflicts)
22721 (Unresolved SR Conflicts): Adjust.
22722 Reported by Hans Aberg.
22723
227242001-11-22 Marc Autret <autret_m@epita.fr>
22725
22726 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
22727
227282001-11-22 Marc Autret <autret_m@epita.fr>
22729
22730 * src/muscle_tab.c (muscle_init): Remove initialization of
22731 skeleton muscle.
22732 * src/output.c (output_master_parser): Do it here.
22733
227342001-11-20 Akim Demaille <akim@epita.fr>
22735
22736 * po/sv.po: New.
22737 * configure.in (ALL_LINGUAS): Adjust.
22738 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
22739 longer contains strings to translate.
22740
227412001-11-19 Akim Demaille <akim@epita.fr>
22742
22743 * src/conflicts.c (conflicts_print): Add a missing \n.
22744
227452001-11-19 Akim Demaille <akim@epita.fr>
22746
22747 * src/nullable.c (nullable_print): New.
22748 (set_nullable): Call it when tracing.
22749 Better locality of variables.
22750
227512001-11-19 Akim Demaille <akim@epita.fr>
22752
22753 * src/print.c (print_actions): Better locality of variables.
22754
227552001-11-19 Akim Demaille <akim@epita.fr>
22756
22757 * src/derives.c (print_derives): Fix and enrich.
22758 * src/closure.c (print_fderives): Likewise.
22759
227602001-11-19 Akim Demaille <akim@epita.fr>
22761
22762 * src/closure.c (itemsetend): Remove, replaced with...
22763 (itemsetsize): new.
22764
227652001-11-19 Akim Demaille <akim@epita.fr>
22766
22767 * src/LR0.c (kernel_end): Remove, replaced with...
22768 (kernel_size): new.
22769
227702001-11-19 Akim Demaille <akim@epita.fr>
22771
22772 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
22773 to clarify.
22774
227752001-11-19 Akim Demaille <akim@epita.fr>
22776
22777 * src/closure.c (closure): Use arrays instead of pointers to clarify.
22778
227792001-11-19 Akim Demaille <akim@epita.fr>
22780
22781 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
22782 trace messages.
22783 * src/LR0.c: Likewise.
22784 (allocate_itemsets): Use arrays instead of pointers to clarify.
22785
227862001-11-19 Akim Demaille <akim@epita.fr>
22787
22788 * src/getargs.c (statistics_flag): Replace with...
22789 (trace_flag): New.
22790 (longopts): Accept --trace instead of --statistics.
22791 * src/getargs.h, src/options.c: Adjust.
22792 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
22793 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
22794
227952001-11-19 Akim Demaille <akim@epita.fr>
22796
22797 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
22798 pointers to clarify the code.
22799 (save_reductions, save_shifts): Factor common parts of alternatives.
22800
228012001-11-19 Akim Demaille <akim@epita.fr>
22802
22803 * src/LR0.c (new_state, get_state): Complete TRACE code.
22804 * src/closure.c: Include `reader.h' to get `tags', needed by the
22805 trace code.
22806 Rename the conditional DEBUG as TRACE.
22807 Output consistently TRACEs to stderr, not stdout.
22808 * src/derives.c: Likewise.
22809 * src/reduce.c: (inaccessable_symbols): Using if is better style
22810 than goto.
22811 Use `#if TRACE' instead of `#if 0' for tracing code.
22812
228132001-11-19 Akim Demaille <akim@epita.fr>
22814
22815 * src/system.h (LIST_FREE, shortcpy): New.
22816 * src/LR0.c: Use them.
22817 * src/output.c (free_itemsets, free_reductions, free_shifts):
22818 Remove, replaced by LIST_FREE.
22819
228202001-11-19 Akim Demaille <akim@epita.fr>
22821
22822 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
22823 (REDUCTIONS_ALLOC): New.
22824 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
22825 allocation.
22826
228272001-11-19 Akim Demaille <akim@epita.fr>
22828
22829 * src/LR0.c (new_state): Complete trace code.
22830 * src/nullable.c (set_nullable): Don't translate traces.
22831
228322001-11-19 Akim Demaille <akim@epita.fr>
22833
22834 * src/print_graph.c (print_core): Better locality of variables.
22835 * src/print.c (print_core): Likewise.
22836
228372001-11-19 Akim Demaille <akim@epita.fr>
22838
22839 * src/vcg.c: You do the output, so you are responsible of the
22840 handling of VCG syntax, in particular: use quotearg.
22841 * src/print_graph.c: Don't.
22842 (print_actions): Don't output the actions as part of the nodes,
22843 since that's the job of the edges.
22844 (print_state): Don't output by hand: fill the node description,
22845 and ask for its output.
22846
228472001-11-19 Akim Demaille <akim@epita.fr>
22848
22849 * src/bison.simple (yyparse): When verbosely reporting an error,
22850 no longer put additional quotes around token names.
22851 * tests/calc.at: Adjust.
22852
228532001-11-19 Akim Demaille <akim@epita.fr>
22854
22855 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
22856 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
22857 * src/output.c: Adjust.
22858
228592001-11-19 Akim Demaille <akim@epita.fr>
22860
22861 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
22862 (rule_t): this.
22863 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
22864
228652001-11-19 Akim Demaille <akim@epita.fr>
22866
22867 * src/gram.h (rule_t): New.
22868 (rule_table): New.
22869 (rrhs, rlhs): Remove, part of state_t.
22870 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
22871 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
22872 * src/reader.c, src/reduce.c: Adjust.
22873
228742001-11-19 Akim Demaille <akim@epita.fr>
22875
22876 * src/reader.c (symbols_output): New, extracted from...
22877 (packsymbols): Here.
22878 (reader): Call it.
22879
228802001-11-19 Akim Demaille <akim@epita.fr>
22881
22882 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
22883 (maxrhs): this new function.
22884
228852001-11-19 Akim Demaille <akim@epita.fr>
22886
22887 * src/lalr.c (F): New macro to access the variable F.
22888 Adjust.
22889
228902001-11-19 Akim Demaille <akim@epita.fr>
22891
22892 * src/lalr.h (LA): New macro to access the variable LA.
22893 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22894 * src/lalr.c: Adjust.
22895
228962001-11-19 Akim Demaille <akim@epita.fr>
22897
22898 * src/lalr.c (initialize_LA): Only initialize LA. Let...
22899 (set_state_table): handle the `lookaheads' members.
22900
229012001-11-19 Akim Demaille <akim@epita.fr>
22902
22903 * src/lalr.h (lookaheads): Removed array, whose contents is now
22904 a member of...
22905 (state_t): this structure.
22906 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22907 Adjust.
22908
229092001-11-19 Akim Demaille <akim@epita.fr>
22910
22911 * src/lalr.h (consistent): Removed array, whose contents is now
22912 a member of...
22913 (state_t): this structure.
22914 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22915 Adjust.
22916
229172001-11-19 Akim Demaille <akim@epita.fr>
22918
22919 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
22920 contents are now members of...
22921 (state_t): this structure.
22922 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22923 Adjust.
22924
229252001-11-19 Akim Demaille <akim@epita.fr>
22926
22927 * src/lalr.h (state_t): New.
22928 (state_table): Be a state_t * instead of a core **.
22929 (accessing_symbol): Remove, part of state_t.
22930 * src/lalr.c: Adjust.
22931 (set_accessing_symbol): Merge into...
22932 (set_state_table): this.
22933 * src/print_graph.c, src/conflicts.c: Adjust.
22934
229352001-11-14 Akim Demaille <akim@epita.fr>
22936
22937 * tests/calc.at, tests/output.at, tests/regression.at,
22938 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
22939 now the tests are run in private dirs, therefore AC_CLEANUP and
22940 family can be simplified to 0-ary.
22941 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
22942 use abs. path to find config.h.
22943 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
22944 stderr, there can be way too much random noise.
22945 Instead pass -Werror to GCC and rely on the exit status.
22946 Reported by Wolfram Wagner.
22947
229482001-11-14 Akim Demaille <akim@epita.fr>
22949
22950 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
22951 defined only if yyoverflow is defined, to avoid `warning: unused
22952 variable `yyvs1''.
22953 Reported by The Test Suite.
22954
229552001-11-14 Akim Demaille <akim@epita.fr>
22956
22957 * src/print.c: Include reduce.h.
22958 Reported by Hans Aberg.
22959
229602001-11-14 Akim Demaille <akim@epita.fr>
22961
22962 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
22963 Revert a previous patch: these are really const.
22964 * src/conflicts.c (conflict_report): Additional useless pair of
22965 braces to pacify GCC's warnings for `if () if () {} else {}'.
22966 * src/lex.c (parse_percent_token): Replace equal_offset with
22967 arg_offset.
22968 arg is const.
22969 Be sure to strdup `arg' when used, since there is no reason for
22970 token_buffer not to change.
22971
229722001-11-14 Akim Demaille <akim@epita.fr>
22973
22974 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
22975 definition.
22976 * src/main.c (main): Use them.
22977 Suggested by Hans Aberg.
22978
229792001-11-12 Akim Demaille <akim@epita.fr>
22980
22981 * src/system.h (ngettext): Now that we use ngettext, be sure to
22982 provide a default definition when NLS are not used.
22983
229842001-11-12 Akim Demaille <akim@epita.fr>
22985
22986 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
22987 Use @kbd to denote user input.
22988 (Language and Grammar): ANSIfy the example.
22989 Adjust its layout for info/notinfo.
22990 (Location Tracking Calc): Output error messages to stderr.
22991 Output locations in a more GNUtically correct way.
22992 Fix a couple of Englishos.
22993 Adjust @group/@end group pairs.
22994
229952001-11-12 Akim Demaille <akim@epita.fr>
22996
22997 %expect was not functioning at all.
22998
22999 * src/conflicts.c (expected_conflicts): Set to -1.
23000 (conflict_report): Use ngettext.
23001 (conflicts_print): Check %expect and make its violation an error.
23002 * doc/bison.texinfo (Expect Decl): Adjust.
23003 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
23004 * tests/regression.at (%expect not enough, %expect right)
23005 (%expect too much): New.
23006
230072001-11-12 Akim Demaille <akim@epita.fr>
23008
23009 * tests/regression.at (Conflicts): Rename as...
23010 (Unresolved SR Conflicts): this.
23011 (Solved SR Conflicts): New.
23012
230132001-11-12 Akim Demaille <akim@epita.fr>
23014
23015 * src/reduce.c (print_results): Rename as...
23016 (reduce_output): This.
23017 Output to OUT, passed as argument, instead of output_obstack.
23018 (dump_grammar): Likewise.
23019 (reduce_free): New.
23020 Also free V1.
23021 (reduce_grammar): No longer call reduce_output, since...
23022 * src/print.c (print_results): do it.
23023 * src/main.c (main): Call reduce_free;
23024
230252001-11-12 Akim Demaille <akim@epita.fr>
23026
23027 * src/conflicts.c (print_reductions): Accept OUT as argument.
23028 Output to it, not to output_obstack.
23029 * src/print.c (print_actions): Adjust.
23030
230312001-11-12 Akim Demaille <akim@epita.fr>
23032
23033 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
23034 the result instead of using...
23035 (src_total, rrc_total, src_count, rrc_count): Remove.
23036 (any_conflicts): Remove.
23037 (print_conflicts): Split into...
23038 (conflicts_print, conflicts_output): New.
23039 * src/conflicts.h: Adjust.
23040 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
23041 * src/print.c (print_grammar): Issue `\n' between two rules.
23042 * tests/regression.at (Conflicts): New.
23043 Reported by Tom Lane.
23044
230452001-11-12 Akim Demaille <akim@epita.fr>
23046
23047 * tests/regression.at (Invalid input): Remove, duplicate with
23048 ``Invalid input: 1''.
23049
230502001-11-12 Akim Demaille <akim@epita.fr>
23051
23052 * tests/torture.at (AT_DATA_STACK_TORTURE)
23053 (Exploding the Stack Size with Alloca)
23054 (Exploding the Stack Size with Malloc): New.
23055
230562001-11-12 Akim Demaille <akim@epita.fr>
23057
23058 * src/bison.simple (YYSTACK_REALLOC): New.
23059 (yyparse) [!yyoverflow]: Use it and free the old stack.
23060 Reported by Per Allansson.
23061
230622001-11-12 Pascal Bart <pascal.bart@epita.fr>
23063
23064 * src/bison.simple: Define type yystype instead of YYSTYPE, and
23065 define CPP macro, which substitute YYSTYPE by yystype.
23066 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
23067 with yyltype/YYLTYPE. This allows inclusion of the generated
23068 header within the parser if the compiler, such as GGC, accepts
23069 multiple equivalent #defines.
23070 From Akim.
23071
230722001-11-05 Akim Demaille <akim@epita.fr>
23073
23074 * src/reader.c (symbols_output): New, extracted from...
23075 (packsymbols): here.
23076 (reader): Adjust.
23077
230782001-11-05 Akim Demaille <akim@epita.fr>
23079
23080 * src/lex.c (parse_percent_token): s/quotearg/quote/.
23081
230822001-11-05 Akim Demaille <akim@epita.fr>
23083
23084 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
23085 pattern.
23086
230872001-11-05 Akim Demaille <akim@epita.fr>
23088
23089 * src/options.h (struct option_table_struct): set_flags is void*.
23090 * src/options.c (longopts): Support `--output' and `%output'.
23091 (usage): Adjust.
23092 * src/lex.h (tok_setopt): Remove, replaced with...
23093 (tok_intopt, tok_stropt): these new guys.
23094 * src/lex.c (getopt.h): Not needed.
23095 (token_buffer, unlexed_token_buffer): Not const.
23096 (percent_table): Promote `-' over `_' in directive names.
23097 Active `%name-prefix', `file-prefix', and `output'.
23098 (parse_percent_token): Accept possible arguments to directives.
23099 Promote `-' over `_' in directive names.
23100
231012001-11-04 Akim Demaille <akim@epita.fr>
23102
23103 * doc/bison.texinfo (Decl Summary): Split the list into
23104 `directives for grammars' and `directives for bison'.
23105 Sort'em.
23106 Add description of `%name-prefix', `file-prefix', and `output'.
23107 Promote `-' over `_' in directive names.
23108 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
23109 Simplify the description of `--name-prefix'.
23110 Promote `-' over `_' in directive names.
23111 Promote `--output' over `--output-file'.
23112 Fix the description of `--defines'.
23113 * tests/output.at: Exercise %file-prefix and %output.
23114
231152001-11-02 Akim Demaille <akim@epita.fr>
23116
23117 * doc/refcard.tex: Update.
23118
231192001-11-02 Akim Demaille <akim@epita.fr>
23120
23121 * src/symtab.h (SUNDEF): New.
23122 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
23123 stand for `uninitialized', instead of 0.
23124 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
23125 * src/lex.c (lex): Adjust.
23126
23127 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
23128 Number it 0.
23129 Let yylex return it instead of a plain 0.
23130 Reported by Dick Streefland.
23131
231322001-11-02 Akim Demaille <akim@epita.fr>
23133
23134 * tests/regression.at (Mixing %token styles): New test.
23135
231362001-11-02 Akim Demaille <akim@epita.fr>
23137
23138 * src/reader.c (parse_thong_decl): Formatting changes.
23139 (token_translations_init): New, extracted from...
23140 (packsymbols): Here.
23141 Adjust.
23142
231432001-11-01 Akim Demaille <akim@epita.fr>
23144
23145 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
23146 Check that `9foo.y' produces correct cpp guards.
23147 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
23148 guards.
23149 Reported by Wwp.
23150
231512001-11-01 Akim Demaille <akim@epita.fr>
23152
23153 * tests/regression.at (Invalid input: 2): New.
23154 * src/lex.c (unlexed_token_buffer): New.
23155 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
23156 too.
23157 Reported by Wwp.
23158
231592001-11-01 Akim Demaille <akim@epita.fr>
23160
23161 * tests/calc.at: Catch up with 1.30.
23162 * configure.in: Bump to 1.49a.
23163 Adjust to newer Autotest.
23164
231652001-10-19 Pascal Bart <pascal.bart@epita.fr>
23166
23167 * src/conflicts.c: Move global variables rrc_total and src_total ...
23168 (print_conflicts): here.
23169 * src/output.c (output): Free global variable user_toknums.
23170 * src/lex.c (token_obstack): Become static.
23171
231722001-10-18 Akim Demaille <akim@epita.fr>
23173
23174 * tests/atlocal.in (GCC): Add.
23175 * tests/calc.at: s/m4_match/m4_bmatch/.
23176 s/m4_patsubst/m4_bpatsubst/.
23177 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
23178 * configure.in: AC_SUBST(GCC).
23179
231802001-10-14 Marc Autret <autret_m@epita.fr>
23181
23182 * src/options.c (create_long_option_table): Fix.
23183
231842001-10-10 Akim Demaille <akim@epita.fr>
23185
23186 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
23187
231882001-10-04 Akim Demaille <akim@epita.fr>
23189
23190 * src/reader.c (parse_union_decl): Push the caracters in
23191 union_obstack, not attrs_obstack.
23192
231932001-10-04 Akim Demaille <akim@epita.fr>
23194
23195 Merge in the branch 1.29.
23196
23197 * src/reader.c (packsymbols): Use a temporary obstack for
23198 `%%tokendef', since output_stack is already used elsewhere.
23199
23200 2001-10-02 Akim Demaille <akim@epita.fr>
23201
23202 Bump 1.29d.
23203
23204 2001-10-02 Akim Demaille <akim@epita.fr>
23205
23206 Version 1.29c.
23207
23208 2001-10-02 Akim Demaille <akim@epita.fr>
23209
23210 * tests/regression.at (Invalid CPP headers): New.
23211 From Alexander Belopolsky.
23212 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
23213
23214 2001-10-02 Akim Demaille <akim@epita.fr>
23215
23216 * tests/regression.at (Invalid input): New.
23217 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
23218 Reported by Shura.
23219
23220 2001-10-02 Akim Demaille <akim@epita.fr>
23221
23222 * tests/calc.at: Now that --debug works, the tests must be adjusted.
23223
23224 2001-10-02 Akim Demaille <akim@epita.fr>
23225
23226 * src/output.c (output_parser): Assert `skeleton'.
23227 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
23228 systems.
23229 From Shura.
23230
23231 2001-10-01 Marc Autret <autret_m@epita.fr>
23232
23233 * src/lex.h: Echo modifications.
23234 * src/lex.c (unlex): Parameter is now token_t.
23235 From Hans Aberg.
23236
23237 2001-10-01 Marc Autret <autret_m@epita.fr>
23238
23239 * src/main.c: Include lex.h.
23240 From Hans Aberg.
23241
23242 2001-09-29 Akim Demaille <akim@epita.fr>
23243
23244 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
23245
23246 2001-09-28 Akim Demaille <akim@epita.fr>
23247
23248 * tests/testsuite.at: Update to newer Autotest.
23249 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
23250
23251 2001-09-27 Akim Demaille <akim@epita.fr>
23252
23253 Position independent wrapper.
23254
23255 * tests/bison: Remove.
23256 * tests/bison.in: New.
23257 * configure.in: Adjust.
23258
23259 2001-09-27 Paul Eggert <eggert@twinsun.com>
23260
23261 Port quotearg fixes from tar 1.13.24.
23262
23263 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
23264 tm to be declared.
23265 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
23266 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
23267
23268 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
23269 * m4/mbrtowc.m4: New file.
23270 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
23271 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
23272
23273 2001-09-27 Akim Demaille <akim@epita.fr>
23274
23275 Bump to 1.29c.
23276
23277 2001-09-27 Akim Demaille <akim@epita.fr>
23278
23279 Version 1.29b.
23280
23281 2001-09-25 Akim Demaille <akim@epita.fr>
23282
23283 * src/system.h: Include `xalloc.h'.
23284 Remove it from the C files.
23285 * src/files.c (output_files): Free the obstacks.
23286 * src/lex.c (init_lex): Rename as...
23287 (lex_init): this.
23288 (lex_free): New.
23289 * src/main.c (main): Use it.
23290
23291 2001-09-24 Marc Autret <autret_m@epita.fr>
23292
23293 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
23294 to output informations in fout (FILE*).
23295 (open_graph, close_graph): Likewise.
23296 (output_graph, output_edge, output_node): Likewise.
23297 * src/vcg.h: Update function prototypes.
23298 * src/print_graph.c (print_graph): Open output graph file.
23299 (print_actions): Adjust.
23300 * src/files.h: Remove extern declaration.
23301 * src/files.c: Remove graph_obstack declaration.
23302 (open_files): Remove graph_obstack initialization.
23303 (output_files): Remove graph_obstack saving.
23304
23305 2001-09-24 Marc Autret <autret_m@epita.fr>
23306
23307 * src/files.c (compute_output_file_names): Fix.
23308
23309 2001-09-24 Marc Autret <autret_m@epita.fr>,
23310 Akim Demaille <akim@epita.fr>
23311
23312 * src/reader.c (reader): Remove call to free_symtab ().
23313 * src/main.c (main): Call it here.
23314 Include symtab.h.
23315 * src/conflicts.c (initialize_conflicts): Rename as...
23316 (solve_conflicts): this.
23317 * src/print.c (print_core, print_actions, print_state)
23318 (print_grammar): Dump to a file instead a `output_obstack'.
23319 (print_results): Dump `output_obstack', and then proceed with the
23320 FILE *.
23321 * src/files.c (compute_output_file_names, close_files): New.
23322 (output_files): Adjust.
23323 * src/main.c (main): Adjust.
23324
23325 2001-09-23 Marc Autret <autret_m@epita.fr>
23326
23327 * src/files.c (compute_header_macro): Computes header macro name
23328 from spec_defines_file when given.
23329
23330 2001-09-23 Marc Autret <autret_m@epita.fr>
23331
23332 * src/files.c (output_files): Add default extensions.
23333
23334 2001-09-22 Akim Demaille <akim@epita.fr>
23335
23336 * src/conflicts.c (finalize_conflicts): Rename as...
23337 (free_conflicts): this.
23338
23339 2001-09-22 Akim Demaille <akim@epita.fr>
23340
23341 * src/gram.c (gram_free): Rename back as...
23342 (dummy): this.
23343 (output_token_translations): Free `token_translations'.
23344 * src/symtab.c (free_symtab): Free the tag field.
23345
23346 2001-09-22 Akim Demaille <akim@epita.fr>
23347
23348 Remove `translations' as it is always set to true.
23349
23350 * src/gram.h: Adjust.
23351 * src/reader.c (packsymbols, parse_token_decl): Adjust
23352 * src/print.c (print_grammar): Adjust.
23353 * src/output.c (output_token_translations): Adjust.
23354 * src/lex.c (lex): Adjust.
23355 * src/gram.c: Be sure the set pointers to NULL.
23356 (dummy): Rename as...
23357 (gram_free): this.
23358
23359 2001-09-22 Akim Demaille <akim@epita.fr>
23360
23361 * configure.in: Invoke AM_LIB_DMALLOC.
23362 * src/system.h: Use dmalloc.
23363 * src/LR0.c: Be sure to have pointers initialized to NULL.
23364 (allocate_itemsets): Allocate kernel_items only if needed.
23365
23366 2001-09-22 Akim Demaille <akim@epita.fr>
23367
23368 * configure.in: Bump to 1.29b.
23369 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
23370 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
23371 need xmalloc.c in calc.y.
23372 From Pascal Bart.
23373
23374 2001-09-21 Akim Demaille <akim@epita.fr>
23375
23376 Version 1.29a.
23377 * Makefile.maint, config/config.guess, config/config.sub,
23378 * config/missing: Update from masters.
23379 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
23380 upon package.m4.
23381 * configure.in (ALL_LINGUAS): Add `tr'.
23382
23383 2001-09-21 Akim Demaille <akim@epita.fr>
23384
23385 * tests/Makefile.am (package.m4): Move to...
23386 ($(srcdir)/$(TESTSUITE)): here.
23387
23388 2001-09-20 Akim Demaille <akim@epita.fr>
23389
23390 * src/complain.c: No longer try to be standalone: use system.h.
23391 Don't assume __STDC__ is defined to 1. Just test if it is defined.
23392 * src/complain.h: Likewise.
23393 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
23394 Remove the unused variable `n'.
23395 From Albert Chin-A-Young.
23396
23397 2001-09-18 Marc Autret <autret_m@epita.fr>
23398
23399 * doc/bison.1: Update.
23400 * doc/bison.texinfo (Bison Options): Update --defines and --graph
23401 descriptions.
23402 (Option Cross Key): Update.
23403 Add --graph.
23404
23405 2001-09-18 Marc Autret <autret_m@epita.fr>
23406
23407 * tests/regression.at: New test (comment in %union).
23408
23409 2001-09-18 Marc Autret <autret_m@epita.fr>
23410
23411 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
23412 do that.
23413 Reported by Keith Browne.
23414
23415 2001-09-18 Marc Autret <autret_m@epita.fr>
23416
23417 * tests/output.at: Add tests for --defines and --graph.
23418
23419 2001-09-18 Marc Autret <autret_m@epita.fr>
23420
23421 * tests/output.at: Removes tests of %{header,src}_extension features.
23422
23423 2001-09-18 Akim Demaille <akim@epita.fr>
23424
23425 * tests/Makefile.am (package.m4): New.
23426 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
23427 (_AT_CHECK_CALC_ERROR): Likewise.
23428 Factor the `, ' part of verbose error messages.
23429
23430 2001-09-18 Marc Autret <autret_m@epita.fr>
23431
23432 * src/getargs.c (longopts): Declare --defines and --graph as options
23433 with optional arguments.
23434 * src/files.h: Add extern declarations.
23435 * src/files.c (spec_graph_file, spec_defines_file): New.
23436 (output_files): Update.
23437 Remove CPP-outed code.
23438
23439 2001-09-18 Marc Autret <autret_m@epita.fr>
23440
23441 Turn off %{source,header}_extension feature.
23442
23443 * src/files.c (compute_exts_from_gf): Update.
23444 (compute_exts_from_src): Update.
23445 (output_files): CPP-out useless code.
23446 * src/files.h: Remove {header,source}_extension extern declarations.
23447 * src/reader.c (parse_dquoted_param): CPP-out.
23448 (parse_header_extension_decl): Remove.
23449 (parse_source_extension_decl): Remove.
23450 (read_declarations): Remove cases tok_{hdrext,srcext}.
23451 * src/lex.c (percent_table): Remove {header,source}_extension entries.
23452 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
23453
23454 2001-09-10 Akim Demaille <akim@epita.fr>
23455
23456 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
23457 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
23458 (AT_CHECK_OUTPUT): this.
23459 Merely check ls' exit status, its output is useless.
23460
23461 2001-09-10 Akim Demaille <akim@epita.fr>
23462
23463 * tests/calc.at: Use m4_match.
23464 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
23465
23466 2001-09-10 Marc Autret <autret_m@epita.fr>,
23467 Akim Demaille <akim@epita.fr>
23468
23469 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
23470 enum color_e.
23471 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
23472 to `normal'.
23473 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
23474 * src/lex.h: Adjust prototype.
23475 (token_t): Add `tok_undef'.
23476 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
23477 (parse_percent_token): Now returns token_t.
23478 Add default statement in switch.
23479 (lex): Separate `c' as an input variable, from the token_t result
23480 part.
23481 (unlexed): Is a token_t.
23482
23483 2001-09-10 Akim Demaille <akim@epita.fr>
23484
23485 * configure.in: Bump to 1.29a.
23486
23487 2001-09-07 Akim Demaille <akim@epita.fr>
23488
23489 Version 1.29.
23490
23491 2001-08-30 Akim Demaille <akim@epita.fr>
23492
23493 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
23494 * m4/atconfig.m4: Remove.
23495 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
23496 * tests/bison: New.
23497 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
23498 m4_if, m4_patsubst, and m4_regexp.
23499 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
23500 `input' file instead of echo.
23501
23502 2001-08-29 Akim Demaille <akim@epita.fr>
23503
23504 Bump to 1.28e.
23505
23506 2001-08-29 Akim Demaille <akim@epita.fr>
23507
23508 Version 1.28d.
23509
23510 2001-08-29 Paul Eggert <eggert@twinsun.com>
23511
23512 * src/bison.simple (yyparse): Don't take the address of an
23513 item before the start of an array, as that doesn't conform to
23514 the C Standard.
23515
23516 2001-08-29 Robert Anisko <anisko_r@epita.fr>
23517
23518 * doc/bison.texinfo (Location Tracking Calc): New node.
23519
23520 2001-08-29 Paul Eggert <eggert@twinsun.com>
23521
23522 * src/output.c (output): Do not define const, as this now
23523 causes more problems than it cures.
23524
23525 2001-08-29 Akim Demaille <akim@epita.fr>
23526
23527 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
23528 the nodes.
23529 Be sure to tag the `detailmenu'.
23530
23531 2001-08-29 Akim Demaille <akim@epita.fr>
23532
23533 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
23534 download in a tmp dir.
23535
23536 2001-08-28 Marc Autret <autret_m@epita.fr>
23537
23538 * config/depcomp: New file.
23539
23540 2001-08-28 Marc Autret <autret_m@epita.fr>
23541
23542 * doc/bison.1 (mandoc): Adjust.
23543 From Juan Manuel Guerrero.
23544
23545 2001-08-28 Marc Autret <autret_m@epita.fr>
23546
23547 * src/print_graph.c (print_state): Fix.
23548
23549 2001-08-27 Marc Autret <autret_m@epita.fr>
23550
23551 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
23552 char * members.
23553 Echo modifications to the functions prototypes.
23554 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
23555
23556 2001-08-27 Marc Autret <autret_m@epita.fr>
23557
23558 * src/vcg.c: Include `xalloc.h'.
23559 (add_colorentry): New.
23560 (add_classname): New.
23561 (add_infoname): New.
23562 * src/vcg.h: Add new prototypes.
23563
23564 2001-08-27 Akim Demaille <akim@epita.fr>
23565
23566 * Makefile.maint: Sync. again with CVS Autoconf.
23567
23568 2001-08-27 Akim Demaille <akim@epita.fr>
23569
23570 * Makefile.maint: Formatting changes.
23571 (po-update, cvs-update, update): New targets.
23572 (AMTAR): Remove.
23573
23574 2001-08-27 Akim Demaille <akim@epita.fr>
23575
23576 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
23577 * Makefile.maint: Sync. with CVS Autoconf.
23578
23579 2001-08-27 Marc Autret <autret_m@epita.fr>
23580
23581 * src/vcg.h (struct infoname_s): New.
23582 (struct colorentry_s): New.
23583 (graph_s): New fields {vertical,horizontal}_order in structure.
23584 Add `infoname' field.
23585 Add `colorentry' field;
23586 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
23587 (G_HORIZONTAL_ORDER): New.
23588 (G_INFONAME): New.
23589 (G_COLORENTRY): New.
23590 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
23591 Add output of `infoname'.
23592 Add output of `colorentry'.
23593
23594 2001-08-27 Marc Autret <autret_m@epita.fr>
23595
23596 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
23597 This one shadowed a global parameter.
23598
23599 2001-08-24 Marc Autret <autret_m@epita.fr>
23600
23601 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
23602 instead of `unsigned'.
23603 (print_state): Do not call obstack_object_size () in obstack_grow ()
23604 to avoid macro variables shadowing.
23605
23606 2001-08-23 Marc Autret <autret_m@epita.fr>
23607
23608 * src/lex.c (percent_table): Typo: s/naem/name/.
23609 Add graph option.
23610 Normalize new options declarations.
23611
23612 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
23613
23614 * tests/suite.at: Exercise %header_extension and %source_extension.
23615
23616 2001-08-16 Marc Autret <autret_m@epita.fr>
23617
23618 * src/reader.c (parse_dquoted_param): New.
23619 (parse_header_extension_decl): Use it.
23620 (parse_source_extension_decl): Likewise.
23621
23622 2001-08-16 Marc Autret <autret_m@epita.fr>
23623
23624 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
23625 (get_xxxx_str): Use assert () instead of complain ().
23626 Remove return invokations in default cases.
23627 (get_decision_str): Modify default behaviour. Remove second argument.
23628 Echo modifications on calls.
23629 (output_graph): Fix.
23630
23631 2001-08-16 Marc Autret <autret_m@epita.fr>
23632
23633 * src/getargs.c (usage): Update with ``-g, --graph''.
23634
23635 2001-08-16 Marc Autret <autret_m@epita.fr>
23636
23637 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
23638 (Option Cross Key): Likewise.
23639 * doc/bison.1: Update.
23640
236412001-09-25 Pascal Bart <pascal.bart@epita.fr>
23642
23643 * src/output.c (output_master_parser): Don't finish action_obstack.
23644 (output_parser): Don't care about the muscle action, here.
23645 (prepare): Copy the action_obstack in the action muscle.
23646 (output): Free action_obstack.
23647
236482001-09-23 Pascal Bart <pascal.bart@epita.fr>
23649
23650 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
23651 will contain `%union' declaration.
23652 (parse_union_decl): Delete #line directive output.
23653 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
23654 informations about %union.
23655 (parse_union_decl): Copy the union_obstack in the muscle stype.
23656 * src/bison.simple: Add new #line directive.
23657 Add typdef %%stype YYSTYPE.
23658
236592001-09-23 Pascal Bart <pascal.bart@epita.fr>
23660
23661 * src/bison.simple: Add new `#line' directive.
23662
236632001-09-22 Pascal Bart <pascal.bart@epita.fr>
23664
23665 * src/bison.simple: New `#line' directive.
23666 * src/output.c (output_parser): Support new dynamic muscle input_line.
23667
236682001-09-22 Marc Autret <autret_m@epita.fr>
23669
23670 * src/output.c (output_master_parser): New.
23671 (output_parser): Be more re-entrant.
23672
236732001-09-21 Marc Autret <autret_m@epita.fr>
23674
23675 * src/reader.c (copy_definition, parse_union_decl): Update and use
23676 `linef' muscle.
23677 (copy_action): Likewise.
23678 Use obstack_1grow ().
23679 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
23680
236812001-09-21 Marc Autret <autret_m@epita.fr>
23682
23683 * src/options.c (option_table): Adjust.
23684 * src/lex.c (parse_percent_token): Fix.
23685
236862001-09-20 Pascal Bart <pascal.bart@epita.fr>
23687
23688 * src/options.c (symtab.h): Include it, need by lex.h.
23689
236902001-09-20 Pascal Bart <pascal.bart@epita.fr>
23691
23692 * src/lex.c (parse_percent_token): Change type of variable `tx', which
23693 is now an option_table_struct*.
23694 (option_strcmp): New function option_strcmp.
23695 (parse_percent_token): Call option_strcmp.
23696 * src/getargs.c (xalloc.h, options.h): Include it.
23697 (getargs): Call create_long_option_table.
23698 (getargs): Free longopts at the end of the function.
23699 (shortopts): Move in options.c.
23700 * src/options.c (create_long_option_table): New function. Convert
23701 information from option_table to option structure.
23702 * src/reader.c (options.h): Include it.
23703
23704 * src/Makefile.am: Adjust.
23705 * src/options.c (option_table): Create from longopts and percent_table.
23706 * src/getargs.c (longopts): Delete.
23707 * src/lex.c (struct percent_table_struct): Delete.
23708 (percent_table): Delete.
23709 (options.h): Include it.
23710 * src/options.c: Create.
23711 * src/options.h: Create.
23712 Declare enum opt_access_e.
23713 Define struct option_table_struct.
23714
237152001-09-20 Marc Autret <autret_m@epita.fr>
23716
23717 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
23718 sections of Bison.
23719
237202001-09-19 Pascal Bart <pascal.bart@epita.fr>
23721
23722 * src/bison.simple: s/%%filename/%%skeleton.
23723 * src/muscle_tab.c (getargs.h): Include it.
23724 (muscle_init): Insert new muscle skeleton.
23725
237262001-09-18 Pascal Bart <pascal.bart@epita.fr>
23727
23728 * src/output.c (output_parser): Delete unused variable actions_dumped.
23729
237302001-09-07 Pascal Bart <pascal.bart@epita.fr>
23731
23732 * src/output.c (output): Delete call to reader_output_yylsp.
23733 * src/reader.c (reader): Likewise.
23734 * src/reader.h: Delete declaration of reader_output_yylsp.
23735
237362001-09-02 Marc Autret <autret_m@epita.fr>
23737
23738 * src/reader.c: Include muscle_tab.h.
23739 (parse_union_decl): Update.
23740 (parse_macro_decl): Rename parse_muscle_decl.
23741 Update to use renamed functions and variable.
23742 (read_declarations, copy_action, read_additionnal_code, : Updated
23743 with correct variables and functions names.
23744 (packsymbols, reader): Likewise.
23745
23746 * src/reader.h (muscle_obstack): Extern declaration update.
23747
23748 * src/output.c: Include muscle_tab.h
23749 In all functions using macro_insert, change by using muscle_insert ().
23750 (macro_obstack): Rename muscle_obstack.
23751 Echo modifications in the whole file.
23752 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
23753 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
23754 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
23755
23756 * src/muscle_tab.h: Update double inclusion macros.
23757 (macro_entry_s): Rename muscle_entry_s.
23758 Update prototypes.
23759
23760 * src/muscle_tab.c: Include muscle_tab.h.
23761 Rename macro_tabble to muscle_table.
23762 (mhash1, mhash2, mcmp): Use muscle_entry.
23763 (macro_init): Rename muscle_init. Update.
23764 (macro_insert): Rename muscle_insert. Update.
23765 (macro_find): Rename muscle_find. Update.
23766
23767 * src/main.c: Include muscle_tab.h.
23768 (main): Call muscle_init ().
23769 * src/Makefile.am (bison_SOURCES): Echo modifications.
23770
237712001-09-02 Marc Autret <autret_m@epita.fr>
23772
23773 Now the files macro_tab.[ch] are named muscle_tab.[ch].
23774
23775 * src/muscle_tab.c, src/muscle_tab.h: Add files.
23776
237772001-09-02 Marc Autret <autret_m@epita.fr>
23778
23779 * src/macrotab.c, src/macrotab.h: Remove.
23780
237812001-09-01 Pascal Bart <pascal.bart@epita.fr>
23782
23783 * src/reader.c (copy_guard): Use muscle to specify the `#line'
23784 filename.
23785
237862001-09-01 Marc Autret <autret_m@epita.fr>
23787
23788 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
23789 to an explicit value to activate the feature. We do it here.
23790
237912001-08-31 Pascal Bart <pascal.bart@epita.fr>
23792
23793 * src/output.c (prepare): Delete the `filename' muscule insertion.
23794 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
23795 (parse_union_decl): Likewise.
23796 * src/macrotab.c (macro_init): Initialize filename by infile.
23797
237982001-08-31 Marc Autret <autret_m@epita.fr>
23799
23800 * src/bison.simple (YYLSP_NEEDED): New definition.
23801 * src/output.c (prepare): Add macro insertion of `locations_flag'
23802
238032001-08-31 Pascal Bart <pascal.bart@epita.fr>
23804
23805 * src/output.c (prepare): Delete insertion of previous muscles,
23806 and insert the `prefix' muscles.
23807 * src/macrotab.c (macro_init): Likewise.
23808 (macro_init): Initialization prefix directive by `yy'.
23809 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
23810 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
23811 yylval, yydebug, yyerror, yynerrs and yyparse.
23812 New directive `#define' to substitute yydebug, ... with option
23813 name_prefix.
23814
238152001-08-31 Pascal Bart <pascal.bart@epita.fr>
23816
23817 * src/main.c (main): Standardize.
23818 * src/output.c (output_table_data, output_parser): Likewise.
23819 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
23820
238212001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
23822
23823 * src/reader.c (read_additionnal_code): Rename %%user_code to
23824 %%epilogue.
23825 * src/output.c (output): Rename %%declarations to %%prologue.
23826 * src/bison.simple: Echo modifications.
23827
238282001-08-31 Marc Autret <autret_m@epita.fr>
23829
23830 * src/reader.c (readgram): CleanUp.
23831 (output_token_defines): Likewise.
23832 (packsymbols): Likewise.
23833 (reader): Likewise.
23834 * src/output.c (output): CPP-out useless code.
23835
238362001-08-31 Pascal Bart <pascal.bart@epita.fr>
23837
23838 * src/reader.c (reader): Delete obsolete call to function
23839 output_trailers and output_headers.
23840 * src/output.h: Remove obsolete functions prototypes of output_headers
23841 and output_trailers.
23842
238432001-08-30 Pascal Bart <pascal.bart@epita.fr>
23844
23845 * src/main.c: Include macrotab.h.
23846 * src/macrotab.h (macro_entry_s): Constify fields.
23847 Adjust functions prototypes.
23848 * src/macrotab.c (macro_insert): Constify key and value.
23849 (macro_find): Constify key.
23850 (macro_insert): Include 'xalloc.h'
23851 (macro_insert): Use XMALLOC.
23852 (macro_find): Constify return value.
23853 * src/output.c (output_table_data): Rename table to table_data.
23854 (output_parser): Constify macro_key, macro_value.
23855
238562001-08-30 Marc Autret <autret_m@epita.fr>
23857
23858 * src/reader.c (parse_skel_decl): New.
23859 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
23860 * src/lex.h (token_t): New token `tok_skel'.
23861 * src/lex.c (percent_table): Add skeleton option entry.
23862 Standardize.
23863
238642001-08-29 Marc Autret <autret_m@epita.fr>
23865
23866 * src/bison.simple: Add %%user_code directive at the end.
23867 * src/reader.c (read_additionnal_code): New.
23868 (reader): Use it.
23869 * src/output.c (output_program): Remove.
23870 (output): Update.
23871
238722001-08-28 Marc Autret <autret_m@epita.fr>
23873
23874 * src/output.c (output_actions): Clean up.
23875 (output_gram): CPP-out useless code.
23876 * src/reader.c (reader): Clean up, CPP-out useless code.
23877
238782001-08-28 Pascal Bart <pascal.bart@epita.fr>
23879
23880 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
23881 directive.
23882 * src/bison.simple: Add `%%definitions'.
23883
238842001-08-28 Marc Autret <autret_m@epita.fr>
23885
23886 * config/depcomp: New file.
23887
238882001-08-27 Paul Eggert <eggert@twinsun.com>
23889
23890 * src/bison.simple (yyparse): Don't take the address of an
23891 item before the start of an array, as that doesn't conform to
23892 the C Standard.
23893
238942001-08-27 Robert Anisko <robert.anisko@epita.fr>
23895
23896 * src/output.c (output): Remove the initialization of the macro
23897 obstack. It was done too late here.
23898
23899 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
23900 completely wrong.
23901 (reader): Initialize the macro obstack here, since we need it to grow
23902 '%define' directives.
23903
23904 * src/reader.h: Declare the macro obstack as extern.
23905
239062001-08-27 Robert Anisko <robert.anisko@epita.fr>
23907
23908 * src/output.c (output_parser): Fix. Store single '%' characters in
23909 the output obstack instead of throwing them away.
23910
239112001-08-27 Akim Demaille <akim@epita.fr>
23912
23913 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
23914
239152001-08-25 Robert Anisko <robert.anisko@epita.fr>
23916
23917 * lib/Makefile.am: Adjust.
23918
239192001-08-25 Robert Anisko <robert.anisko@epita.fr>
23920
23921 * src/bison.simple: Update and add '%%' directives.
23922
239232001-08-25 Robert Anisko <robert.anisko@epita.fr>
23924
23925 * src/reader.c (reader): Remove calls to 'output_headers' and
23926 'output_trailers'. Remove some C output.
23927 (readgram): Disable a piece of code that was writing a default
23928 definition for 'YYSTYPE'.
23929 (reader_output_yylsp): Remove.
23930 (packsymbols): Output token defintions to a macro.
23931 (copy_definition): Disable C output.
23932
23933 * src/reader.c (parse_macro_decl): New function used to parse macro
23934 declarations.
23935 (copy_string2): Put the body of copy_string into this new function.
23936 Add a parameter to let the caller choose whether he wants to copy the
23937 string delimiters or not.
23938 (copy_string): Be a simple call to copy_string2 with the last argument
23939 bound to true.
23940 (read_declarations): Add case for macro definition.
23941 (copy_identifier): New.
23942 (parse_macro_decl): Read macro identifiers using copy_identifier
23943 rather than lex.
23944
239452001-08-25 Robert Anisko <robert.anisko@epita.fr>
23946
23947 * src/output.c (prepare): Add prefixed names.
23948 (output_parser): Output semantic actions.
23949 (output_parser): Fix bug on '%%line' directives.
23950
23951 * src/output.c (output_headers): Remove. The C code printed by this
23952 function should now be in the skeletons.
23953 (output_trailers): Remove.
23954 (output): Disable call to 'reader_output_yylsp'.
23955 (output_rule_data): Do not output tables to the table obstack.
23956
23957 * src/output.c: Remove some C dedicated output.
23958 Improve the use of macro and output obstacks.
23959 (output_defines): Remove.
23960
23961 * src/output.c (output_token_translations): Associate 'translate'
23962 table with a macro. No output to the table obstack.
23963 (output_gram): Same for 'rhs' and 'prhs'.
23964 (output_stos): Same for 'stos'.
23965 (output_rule_data): Same for 'r1' and 'r2'.
23966 (token_actions): Same for 'defact'.
23967 (goto_actions): Same for 'defgoto'.
23968 (output_base): Same for 'pact' and 'pgoto'.
23969 (output_table): Same for 'table'.
23970 (output_check): Same for 'check'.
23971
23972 * src/output.c (output_table_data): New function.
23973 (output_short_table): Remove.
23974 (output_short_or_char_table): Remove.
23975
23976 * src/output.c (output_parser): Replace most of the skeleton copy code
23977 with something new. Skeletons are now processed character by character
23978 rather than line by line, and Bison looks for '%%' macros. This is the
23979 first step in making Bison's output process (a lot) more flexible.
23980 (output_parser): Use the macro table.
23981
239822001-08-25 Robert Anisko <robert.anisko@epita.fr>
23983
23984 * src/main.c (main): Initialize the macro table.
23985
239862001-08-25 Robert Anisko <robert.anisko@epita.fr>
23987
23988 * src/lex.c (percent_table): Add tok_define.
23989 * src/lex.h: Add tok_define.
23990
239912001-08-25 Robert Anisko <robert.anisko@epita.fr>
23992
23993 * src/macrotab.c: New file.
23994 * src/macrotab.h: New file.
23995 * src/Makefile.am: Update.
23996
239972001-08-25 Robert Anisko <robert.anisko@epita.fr>
23998
23999 * lib/hash.c: New file.
24000 * lib/hash.h: New file.
24001 * lib/Makefile.am: Update.
24002
240032001-08-15 Akim Demaille <akim@epita.fr>
24004
24005 Version 1.28c.
24006
240072001-08-15 Marc Autret <autret_m@epita.fr>
24008
24009 * src/reader.c (readgram): Indent output macro YYSTYPE.
24010 (packsymbols): Likewise.
24011 (output_token_defines): Likewise.
24012 * src/files.c: Standardize.
24013 (compute_header_macro): New.
24014 (defines_obstack_save): New. Use compute_header_macro.
24015 (output_files): Update. Use defines_obstack_save.
24016
240172001-08-15 Akim Demaille <akim@epita.fr>
24018
24019 * doc/bison.texinfo (Table of Symbols): Document
24020 YYSTACK_USE_ALLOCA.
24021
240222001-08-15 Akim Demaille <akim@epita.fr>
24023
24024 * missing: Update from CVS Automake.
24025 * config/config.guess, config/config.sub, config/texinfo.tex:
24026 Update from gnu.org.
24027
240282001-08-15 Akim Demaille <akim@epita.fr>
24029
24030 * Makefile.maint: Sync with CVS Autoconf.
24031
240322001-08-14 Pascal Bart <pascal.bart@epita.fr>
24033
24034 * doc/bison.texinfo: Include GNU Free Documentation License from
24035 `fdl.texi'.
24036 * doc/fdl.texi: Add to package.
24037
240382001-08-14 Marc Autret <autret_m@epita.fr>
24039
24040 Turn on %{source,header}_extension features.
24041
24042 * src/lex.c (percent_table): Un-CPP out header_extension and
24043 source_extension.
24044 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
24045 (compute_exts_from_src): Remove conditions. It restores priorities
24046 between options.
24047
240482001-08-14 Marc Autret <autret_m@epita.fr>
24049
24050 * src/files.c (compute_base_names): Add extensions computing when
24051 `--file-prefix' used.
24052 Standardize function calls.
24053
240542001-08-13 Marc Autret <autret_m@epita.fr>
24055
24056 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
24057 defining it (defined but null disables alloca).
24058
240592001-08-13 Marc Autret <autret_m@epita.fr>
24060
24061 * src/bison.simple (_yy_memcpy): CPP reformat.
24062
240632001-08-13 Pascal Bart <pascal.bart@epita.fr>
24064
24065 * tests/atconfig.in (CPPFLAGS): Fix.
24066
240672001-08-10 Pascal Bart <pascal.bart@epita.fr>
24068
24069 * doc/bison.texinfo: Include GNU General Public License from
24070 `gpl.texi'.
24071 * doc/gpl.texi: Add to package.
24072
240732001-08-10 Marc Autret <autret_m@epita.fr>
24074
24075 * src/print_graph.h: Fix.
24076 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
24077
240782001-08-10 Akim Demaille <akim@epita.fr>
24079
24080 * src/system.h: Provide default declarations for stpcpy, strndup,
24081 and strnlen.
24082
240832001-08-10 Robert Anisko <anisko_r@epita.fr>
24084
24085 * doc/bison.texinfo (Locations): Update @$ stuff.
24086
240872001-08-09 Robert Anisko <anisko_r@epita.fr>
24088
24089 * src/bison.simple (YYLLOC_DEFAULT): Update.
24090 (yyparse): Adjust.
24091
240922001-08-08 Marc Autret <autret_m@epita.fr>
24093
24094 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
24095 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
24096 Reported by Fabrice Bauzac.
24097
240982001-08-08 Marc Autret <autret_m@epita.fr>
24099
24100 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
24101 * src/vcg.c (output_node): Fix.
24102 * src/vcg.h: Cleanup.
24103 * src/print_graph.c: Add comments.
24104 (node_output_size): New global variable. Simplify the formatting of
24105 the VCG graph output.
24106 (print_actions): Unused code is now used. It notifies the final state
24107 and no action states in the VCG graph. It also give the reduce actions.
24108 The `shift and goto' edges are red and the `go to state' edges are
24109 blue.
24110 Get the current node name and node_obstack by argument.
24111 (node_obstack): New variable.
24112 (print_state): Manage node_obstack.
24113 (print_core): Use node_obstack given by argument.
24114 A node is not only computed here but in print_actions also.
24115 (print_graph): CPP out useless code instead of commenting it.
24116
241172001-08-07 Pascal Bart <pascal.bart@epita.fr>
24118
24119 * tests/atconfig.in (CPPFLAGS): Fix.
24120
241212001-08-07 Akim Demaille <akim@epita.fr>
24122
24123 * src/print_graph.c (quote): New.
24124 (print_core): Use it.
24125
241262001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
24127
24128 * src/vcg.c (complain.h): Include it.
24129 Unepitaize `return' invocations.
24130 [NDEBUG] (main): Remove.
24131 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
24132 * src/files.c (open_files): Initialize graph_obstack.
24133 * src/print_graph.c (print_actions): CPP out useless code.
24134 (print_core): Don't output the last `\n' in labels.
24135 Use `quote'.
24136 * src/files.c (output_files): Output the VCG file.
24137 * src/main.c (main): Invoke print_graph ();
24138
241392001-08-06 Marc Autret <autret_m@epita.fr>
24140
24141 Automaton VCG graph output.
24142 Using option ``-g'' or long option ``--graph'', you can generate
24143 a gram_filename.vcg file containing a VCG description of the LALR (1)
24144 automaton of your grammar.
24145
24146 * src/main.c: Call to print_graph() function.
24147 * src/getargs.h: Update.
24148 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
24149 (graph_flag): New flag.
24150 (longopts): Update.
24151 (getargs): Add case `g'.
24152 * src/files.c (graph_obstack): New obstack struct.
24153 (open_files): Initialize new obstack.
24154 (output_files): Saves graph_obstack if required.
24155 * src/files.h (graph_obstack): New extern declaration.
24156 * src/Makefile.am: Add new source files.
24157
241582001-08-06 Marc Autret <autret_m@epita.fr>
24159
24160 * src/print_graph.c, src/print_graph.h (graph): New.
24161 * src/vcg.h: New file.
24162 * src/vcg.c: New file, VCG graph handling.
24163
241642001-08-06 Marc Autret <autret_m@epita.fr>
24165
24166 Add of %source_extension and %header_extension which specify
24167 the source or/and the header output file extension.
24168
24169 * src/files.c (compute_base_names): Remove initialisation of
24170 src_extension and header_extension.
24171 (compute_exts_from_gf): Update.
24172 (compute_exts_from_src): Update.
24173 (output_files): Update.
24174 * src/reader.c (parse_header_extension_decl): New.
24175 (parse_source_extension_decl): New.
24176 (read_declarations): New case statements for the new tokens.
24177 * src/lex.c (percent_table): Add entries for %source_extension
24178 and %header_extension.
24179 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
24180
241812001-08-06 Marc Autret <autret_m@epita.fr>
24182
24183 * configure.in: Bump to 1.28c.
24184 * doc/bison.texinfo: Texinfo thingies.
24185
241862001-08-04 Pascal Bart <pascal.bart@epita.fr>
24187
24188 * tests/atconfig.in (CPPFLAGS): Add.
24189 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
24190
241912001-08-03 Akim Demaille <akim@epita.fr>
24192
24193 Version 1.28b.
24194
241952001-08-03 Akim Demaille <akim@epita.fr>
24196
24197 * tests/Makefile.am (check-local): Ship testsuite.
24198 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
24199 Include `string.h'.
24200
242012001-08-03 Akim Demaille <akim@epita.fr>
24202
24203 * configure.in: Try using -Wformat when compiling.
24204
242052001-08-03 Akim Demaille <akim@epita.fr>
24206
24207 * configure.in: Bump to 1.28b.
24208
242092001-08-03 Akim Demaille <akim@epita.fr>
24210
24211 * src/complain.c: Adjust strerror_r portability issues.
24212
242132001-08-03 Akim Demaille <akim@epita.fr>
24214
24215 Version 1.28a.
24216
242172001-08-03 Akim Demaille <akim@epita.fr>
24218
24219 * src/getargs.c, src/getarg.h (skeleton)): Constify.
24220 * src/lex.c (literalchar): Avoid name clashes on `buf'.
24221 * src/getargs.c: Include complain.h.
24222 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
24223 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
24224
242252001-08-03 Akim Demaille <akim@epita.fr>
24226
24227 * src/reader.c (readgram): Display hidden chars in error messages.
24228
242292001-08-03 Akim Demaille <akim@epita.fr>
24230
24231 Update to gettext 0.10.39.
24232
242332001-08-03 Akim Demaille <akim@epita.fr>
24234
24235 * lib/strspn.c: New.
24236
242372001-08-01 Marc Autret <autret_m@epita.fr>
24238
24239 * doc/bison.texinfo: Update.
24240 * doc/bison.1 (mandoc): Update.
24241 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
24242 * src/files.c: Support output files extensions computing.
24243 (src_extension): New static variable.
24244 (header_extension): New static variable.
24245 (tr): New function.
24246 (get_extension_index): New function, gets the index of an extension
24247 filename in a string.
24248 (compute_exts_from_gf): New function, computes extensions from the
24249 grammar file extension.
24250 (compute_exts_from_src): New functions, computes extensions from the
24251 C source file extension, file given by ``-o'' option.
24252 (compute_base_names): Update.
24253 (output_files): Update.
24254
242552001-08-01 Robert Anisko <anisko_r@epita.fr>
24256
24257 * doc/bison.texi: Document @$.
24258 (Locations): New section.
24259
242602001-07-18 Akim Demaille <akim@epita.fr>
24261
24262 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
24263 * config/prev-version.txt, config/move-if-change: New.
24264 * Makefile.am: Adjust.
24265
242662001-07-08 Pascal Bart <pascal.bart@epita.fr>
24267
24268 * src/bison.simple (yyparse): Suppress warning `comparaison
24269 between signed and unsigned'.
24270
242712001-07-05 Pascal Bart <pascal.bart@epita.fr>
24272
24273 * src/getargs.h (raw_flag): Remove.
24274 * src/getargs.c: Die on `-r'/`--raw'.
24275 * src/lex.c (parse_percent_token): Die on `%raw'.
24276 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
24277 * tests/calc.at: Suppress test with option `--raw'.
24278
242792001-07-14 Akim Demaille <akim@epita.fr>
24280
24281 * config/: New.
24282 * configure.in: Require Autoconf 2.50.
24283 Update to gettext 0.10.38.
24284
242852001-03-16 Akim Demaille <akim@epita.fr>
24286
24287 * doc/bison.texinfo: ANSIfy the examples.
24288
242892001-03-16 Akim Demaille <akim@epita.fr>
24290
24291 * getargs.c (skeleton): New variable.
24292 (longopts): --skeleton is a new option.
24293 (shortopts, getargs): -S is a new option.
24294 * getargs.h: Declare skeleton.
24295 * output.c (output_parser): Use it.
24296
242972001-03-16 Akim Demaille <akim@epita.fr>
24298
24299 * m4/strerror_r.m4: New.
24300 * m4/error.m4: Run AC_FUNC_STRERROR_R.
24301 * lib/error.h, lib/error.c: Update.
24302
243032001-03-16 Akim Demaille <akim@epita.fr>
24304
24305 * src/getargs.c (longopts): Clean up.
24306
243072001-02-21 Akim Demaille <akim@epita.fr>
24308
24309 * src/reader.c (gensym): `gensym_count' is your own.
24310 Use a static buf to create the symbol name, as token_buffer is no
24311 longer a buffer.
24312
243132001-02-08 Akim Demaille <akim@epita.fr>
24314
24315 * src/conflicts.c (conflict_report): Be sure not to append to res
24316 between two calls, which could happen if both first sprintf were
24317 skipped, but not the first cp += strlen.
24318
243192001-02-08 Akim Demaille <akim@epita.fr>
24320
24321 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
24322 New, from fileutils 4.0.37.
24323 * configure.in: Require Autoconf 2.49c. I took some time before
24324 making this decision. This is the only way out for portability
24325 issues in Bison, it would mean way too much duplicate effort to
24326 import in Bison features implemented in 2.49c since 2.13.
24327 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
24328
243292001-02-02 Akim Demaille <akim@epita.fr>
24330
24331 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
24332 * lib/xalloc.h, lib/xmalloc.c: Update.
24333
243342001-01-19 Akim Demaille <akim@epita.fr>
24335
24336 Get rid of the ad hoc handling of token_buffer in the scanner: use
24337 the obstacks.
24338
24339 * src/lex.c (token_obstack): New.
24340 (init_lex): Initialize it. No longer call...
24341 (grow_token_buffer): this. Remove it.
24342 Adjust all the places which used it to use the obstack.
24343
243442001-01-19 Akim Demaille <akim@epita.fr>
24345
24346 * src/lex.h: Rename all the tokens:
24347 s/\bENDFILE\b/tok_eof/g;
24348 s/\bIDENTIFIER\b/tok_identifier/g;
24349 etc.
24350 Let them be enums, not #define, to ease debugging.
24351 Adjust all the code.
24352
243532001-01-18 Akim Demaille <akim@epita.fr>
24354
24355 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
24356 * src/lex.c (maxtoken, grow_token_buffer): Static.
24357
243582001-01-18 Akim Demaille <akim@epita.fr>
24359
24360 Since we now use obstacks, more % directives can be enabled.
24361
24362 * src/lex.c (percent_table): Also accept `%yacc',
24363 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
24364 `%debug'.
24365 Handle the actions for `%semantic_parser' and `%pure_parser' here,
24366 instead of returning a token.
24367 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
24368 * src/reader.c (read_declarations): Adjust.
24369 * src/files.c (open_files): Don't call `compute_base_names', don't
24370 compute `attrsfile' since they depend upon data which might be
24371 *in* the input file now.
24372 (output_files): Do it here.
24373 * src/output.c (output_headers): Document the fact that this patch
24374 introduces a guaranteed SEGV for semantic parsers.
24375 * doc/bison.texinfo: Document them.
24376 * tests/suite.at: Exercise these %options.
24377
243782000-12-20 Akim Demaille <akim@epita.fr>
24379
24380 Also handle the output file (--verbose) with obstacks.
24381
24382 * files.c (foutput): Remove.
24383 (output_obstack): New.
24384 Adjust all dependencies.
24385 * src/conflicts.c: Return a string.
24386 * src/system.h (obstack_grow_string): Rename as...
24387 (obstack_sgrow): this. Be ready to work with non literals.
24388 (obstack_fgrow4): New.
24389
243902000-12-20 Akim Demaille <akim@epita.fr>
24391
24392 * src/files.c (open_files): Fix the computation of short_base_name
24393 in the case of `-o foo.tab.c'.
24394
243952000-12-20 Akim Demaille <akim@epita.fr>
24396
24397 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
24398 (copy_dollar): Now that everything uses obstacks, get rid of the
24399 FILE * parameters.
24400
244012000-12-20 Akim Demaille <akim@epita.fr>
24402
24403 * src/files.c (open_files): Actually the `.output' file is based
24404 on the short_base_name, not base_name.
24405 * tests/suite.at (Checking output file names): Adjust.
24406
244072000-12-20 Akim Demaille <akim@epita.fr>
24408
24409 * src/bison.s1: Remove, we now use directly...
24410 * src/bison.simple: this.
24411 * src/Makefile.am: Use pkgdata instead of data.
24412
244132000-12-20 Akim Demaille <akim@epita.fr>
24414
24415 * src/files.c (guard_obstack): New.
24416 (open_files): Initialize it.
24417 (output_files): Dump it...
24418 * src/files.h: Export it.
24419 * src/reader.c (copy_guard): Use it.
24420
244212000-12-19 Akim Demaille <akim@epita.fr>
24422
24423 * src/files.c (outfile, defsfile, actfile): Removed as global
24424 vars.
24425 (open_files): Don't compute them.
24426 (output_files): Adjust.
24427 (base_name, short_base_name): Be global.
24428 Adjust dependencies.
24429
244302000-12-19 Akim Demaille <akim@epita.fr>
24431
24432 * src/files.c (strsuffix): New.
24433 (stringappend): Be just like strcat but allocate.
24434 (base_names): Eve out from open_files.
24435 Try to simplify the rather hairy computation of base_name and
24436 short_base_name.
24437 (open_files): Use it.
24438 * tests/suite.at (Checking output file names): New test.
24439
244402000-12-19 Akim Demaille <akim@epita.fr>
24441
24442 * src/system.h (obstack_grow_literal_string): Rename as...
24443 (obstack_grow_string): this.
24444 * src/output.c (output_parser): Recognize `%% actions' instead of
24445 `$'.
24446 * src/bison.s1: s/$/%% actions/.
24447 * src/bison.hairy: Likewise.
24448
244492000-12-19 Akim Demaille <akim@epita.fr>
24450
24451 * src/output.c (output_parser): Compute the `#line' lines when
24452 there are.
24453 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
24454 Suggested by Hans Aberg.
24455
244562000-12-19 Akim Demaille <akim@epita.fr>
24457
24458 Let the handling of the skeleton files be local to the procedures
24459 that use it.
24460
24461 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
24462 longer static.
24463 (fparser, open_extra_files): Remove.
24464 (open_files, output_files): Don't take care of fparser.
24465 * src/files.h: Adjust.
24466 * src/output.c (output_parser): Open and close the file to the
24467 skeleton.
24468 * src/reader.c (read_declarations): When %semantic_parser, open
24469 fguard.
24470
244712000-12-19 Akim Demaille <akim@epita.fr>
24472
24473 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
24474 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
24475
244762000-12-19 Akim Demaille <akim@epita.fr>
24477
24478 * src/files.c (open_files): Yipee! We no longer need all the code
24479 looking for `/tmp' since we have no tmp file.
24480
244812000-12-19 Akim Demaille <akim@epita.fr>
24482
24483 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
24484 New macros.
24485 * src/files.c (open_files): Less dependency on MSDOS etc.
24486
244872000-12-14 Akim Demaille <akim@epita.fr>
24488
24489 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
24490 Provide a default definition.
24491 Use it when executing the default @ action.
24492 * src/reader.c (reader_output_yylsp): No longer include
24493 `timestamp' and `text' in the default YYLTYPE.
24494
244952000-12-12 Akim Demaille <akim@epita.fr>
24496
24497 * src/reader.c (copy_definition, parse_union_decl, copy_action)
24498 (copy_guard): Quote the file names.
24499 Reported by Laurent Mascherpa.
24500
245012000-12-12 Akim Demaille <akim@epita.fr>
24502
24503 * src/output.c (output_headers, output_program, output): Be sure
24504 to escape special characters when outputting filenames.
24505 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
24506 (output_headers): Don't depend on them, Use ACTSTR.
24507
245082000-11-17 Akim Demaille <akim@epita.fr>
24509
24510 * lib/obstack.h: Formatting changes.
24511 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
24512 prevents type checking.
24513 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
24514 cast the value to (void *): assigning a `foo *' to a `void *'
24515 variable is valid.
24516 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
24517 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
24518 append characters.
24519
245202000-11-17 Akim Demaille <akim@epita.fr>
24521
24522 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
24523 as...
24524 (suite.m4, regression.m4, calc.m4): these.
24525 * tests/atgeneral.m4: Update from CVS Autoconf.
24526
245272000-11-17 Akim Demaille <akim@epita.fr>
24528
24529 * tests/regression.m4 (%union and --defines): New test,
24530 demonstrating a current bug in the obstack implementation.
24531
245322000-11-17 Akim Demaille <akim@epita.fr>
24533
24534 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
24535 macros.
24536 Use them to declare the variables which are global or local to
24537 `yyparse'.
24538
245392000-11-17 Akim Demaille <akim@epita.fr>
24540
24541 * acconfig.h: Remove, no longer used.
24542
245432000-11-07 Akim Demaille <akim@epita.fr>
24544
24545 * src: s/Copyright (C)/Copyright/g.
24546
245472000-11-07 Akim Demaille <akim@epita.fr>
24548
24549 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
24550 defining.
24551 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
24552
245532000-11-07 Akim Demaille <akim@epita.fr>
24554
24555 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
24556 Merge in a single CPP if/else.
24557
245582000-11-07 Akim Demaille <akim@epita.fr>
24559
24560 * src/output.c (output): Remove useless variables.
24561 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
24562 argument `data' for consistency with the prototypes.
24563 Qualify it `const'.
24564 (obstack_copy, obstack_copy0): Rename the second argument as
24565 `address' for consistency. Qualify it `const'.
24566 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
24567 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
24568 `const' their input argument (`data' or `address').
24569 Adjust the corresponding macros to include `const' in casts.
24570
245712000-11-03 Akim Demaille <akim@epita.fr>
24572
24573 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
24574 s/PFILE1/BISON_HAIRY/.
24575 Adjust dependencies.
24576
245772000-11-03 Akim Demaille <akim@epita.fr>
24578
24579 For some reason, this was not applied.
24580
24581 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
24582 `unlink': it's no longer used.
24583
245842000-11-03 Akim Demaille <akim@epita.fr>
24585
24586 * src/files.c (skeleton_find): New function, eved out of...
24587 (open_files, open_extra_files): here.
24588
245892000-11-03 Akim Demaille <akim@epita.fr>
24590
24591 Don't use `atexit'.
24592
24593 * src/files.c (obstack_save): New function.
24594 (done): Rename as...
24595 (output_files): this.
24596 Use `obstack_save'.
24597 * src/main.c (main): Don't use `atexit' to register `done', since
24598 it no longer has to remove tmp files, just call `output_files'
24599 when there are no errors.
24600
246012000-11-02 Akim Demaille <akim@epita.fr>
24602
24603 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
24604 `unlink': it's no longer used.
24605 * src/files.h: Formatting changes.
24606
246072000-11-02 Akim Demaille <akim@epita.fr>
24608
24609 Remove the last uses of mktemp and unlink/delete.
24610
24611 * src/files.c (fdefines, ftable): Removed.
24612 (defines_ostack, table_obstack): New.
24613 Adjust dependencies of the former into uses of the latter.
24614 * src/output.c (output_short_or_char_table, output_short_table):
24615 Convert to using obstacks.
24616 * src/reader.c (copy_comment2): Accept one FILE * and two
24617 obstacks.
24618 (output_token_defines, reader_output_yylsp): Use obstacks.
24619 * src/system.h (obstack_fgrow3): New.
24620 * po/POTFILES.in: Adjust.
24621
246222000-11-01 Akim Demaille <akim@epita.fr>
24623
24624 Change each use of `fattrs' into a use of `attrs_obstack'.
24625
24626 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
24627 * src/files.c (fattrs): Remove.
24628 (attrs_obstack): New.
24629 Adjust all dependencies.
24630 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
24631
246322000-11-01 Akim Demaille <akim@epita.fr>
24633
24634 Introduce obstacks.
24635 Change each use of `faction' into a use of `action_obstack'.
24636
24637 * lib/obstack.h, lib/obstack.c: New files.
24638 * src/files.c (faction): Remove.
24639 (action_obstack): New.
24640 Adjust all dependencies.
24641
246422000-10-20 Akim Demaille <akim@epita.fr>
24643
24644 * lib/quote.h (PARAMS): New macro. Use it.
24645
246462000-10-16 Akim Demaille <akim@epita.fr>
24647
24648 * src/output.c (output_short_or_char_table): New function.
24649 (output_short_table, output_token_translations): Use it.
24650 (goto_actions): Use output_short_table.
24651
246522000-10-16 Akim Demaille <akim@epita.fr>
24653
24654 * src/symtab.c (bucket_new): New function.
24655 (getsym): Use it.
24656
24657 * src/output.c (output_short_table): New argument to display the
24658 comment associated with the table.
24659 Adjust dependencies.
24660 (output_gram): Use it.
24661 (output_rule_data): Nicer output layout for YYTNAME.
24662
246632000-10-16 Akim Demaille <akim@epita.fr>
24664
24665 * src/lex.c (read_typename): New function.
24666 (lex): Use it.
24667 * src/reader.c (copy_dollar): Likewise.
24668
246692000-10-16 Akim Demaille <akim@epita.fr>
24670
24671 * src/reader.c (copy_comment2): Expect the input stream to be on
24672 the `/' which is suspected to open a comment, instead of being
24673 called after `//' or `/*' was read.
24674 (copy_comment, copy_definition, parse_union_decl, copy_action)
24675 (copy_guard): Adjust.
24676
246772000-10-16 Akim Demaille <akim@epita.fr>
24678
24679 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
24680 `read_signed_integer'.
24681
246822000-10-16 Akim Demaille <akim@epita.fr>
24683
24684 * src/reader.c (copy_dollar): New function.
24685 (copy_guard, copy_action): Use it.
24686
246872000-10-16 Akim Demaille <akim@epita.fr>
24688
24689 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
24690 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
24691 New files, from Fileutils 4.0.27.
24692 * src/main.c (printable_version): Remove.
24693 * src/lex.c, src/reader.c: Use `quote'.
24694
246952000-10-04 Akim Demaille <akim@epita.fr>
24696
24697 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
24698
246992000-10-04 Akim Demaille <akim@epita.fr>
24700
24701 * doc/bison.texinfo: Various typos spotted by Neil Booth.
24702
247032000-10-04 Akim Demaille <akim@epita.fr>
24704
24705 When a literal string is used to define two different tokens,
24706 `bison -v' segfaults.
24707 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
24708
24709 * tests/regression.m4: New file.
24710 Include the core of the sample provided by Piotr Gackiewicz.
24711 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
24712 properly.
24713
247142000-10-04 Akim Demaille <akim@epita.fr>
24715
24716 * src/reader.c (parse_expect_decl): Keep `count' within the size
24717 of `buffer'.
24718 From Neil Booth.
24719
247202000-10-02 Paul Eggert <eggert@twinsun.com>
24721
24722 * bison.s1 (yyparse): Assign the default value
24723 unconditionally, to avoid a GCC warning and make the parser a
24724 tad smaller.
24725
247262000-10-02 Akim Demaille <akim@epita.fr>
24727
24728 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
24729 options.
24730
247312000-10-02 Akim Demaille <akim@epita.fr>
24732
24733 * src/derives.c, src/print.c, src/reduce.c: To ease the
24734 translation, move some `\n' out of the translated strings.
24735
247362000-10-02 Akim Demaille <akim@epita.fr>
24737
24738 The location tracking mechanism is precious for parse error
24739 messages. Nevertheless, it is enabled only when `@n' is used in
24740 the grammar, which is a different issue (you can use it in error
24741 message, but not in the grammar per se). Therefore, there should
24742 be another means to enable it.
24743
24744 * src/getargs.c (getargs): Support `--locations'.
24745 (usage): Report it.
24746 * src/getargs.h (locationsflag): Export it.
24747 * src/lex.c (percent_table): Support `%locations'.
24748 * src/reader.c (yylsp_needed): Remove this variable, now replaced
24749 with `locationsflag'.
24750 * doc/bison.texinfo: Document `--locations' and `%locations'.
24751 Sort the options.
24752 * tests/calc.m4: Test it.
24753
24754 For regularity of the names, replace each
24755 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
24756 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
24757 In addition replace each `flag' with `_flag'.
24758
247592000-10-02 Akim Demaille <akim@epita.fr>
24760
24761 Also test parse error messages, including with YYERROR_VERBOSE.
24762
24763 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
24764 associative).
24765 Use it to check the computations.
24766 Use it to check `nonassoc' is honored.
24767 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
24768 `--yyerror-verbose'.
24769 (_AT_CHECK_CALC): Adjust to this option.
24770 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
24771
247722000-10-02 Akim Demaille <akim@epita.fr>
24773
24774 Test also `--verbose', `--defines' and `--name-prefix'. Testing
24775 the latter demonstrates a flaw in the handling of non debugging
24776 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
24777 was used in order to simplify:
24778
24779 #if YYDEBUG
24780 if (yydebug)
24781 {
24782 ...
24783 }
24784 #endif
24785
24786 into
24787
24788 if (yydebug)
24789 {
24790 ...
24791 }
24792
24793 unfortunately this leads to a CPP conflict when
24794 `--name-prefix=foo' is used since it produces `#define yydebug
24795 foodebug'.
24796
24797 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
24798 (YYDPRINTF): New macro.
24799 Spread its use.
24800 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
24801 the bison options.
24802 Also test `--verbose', `--defines' and `--name-prefix'.
24803
248042000-10-02 Akim Demaille <akim@epita.fr>
24805
24806 Improve the readability of the produced parsers.
24807
24808 * src/bison.s1: Formatting changes.
24809 Improve the comment related to the `$' mark.
24810 (yydefault): Don't fall through to `yyresume': `goto' there.
24811 * src/output.c (output_parser): When the `$' is met, skip the end
24812 of its line.
24813 New variable, `number_of_dollar_signs', to check there's exactly
24814 one `$' in the parser skeleton.
24815
248162000-10-02 Akim Demaille <akim@epita.fr>
24817
24818 * lib/xstrdup.c: New file, from the fileutils.
24819 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
24820 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
24821 instead of strlen + xmalloc + strcpy.
24822 * src/symtab.c (copys): Remove, use xstrdup instead.
24823
248242000-10-02 Akim Demaille <akim@epita.fr>
24825
24826 * src/gram.h (associativity): New enum type which replaces the
24827 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
24828 `right_assoc', `left_assoc' and `non_assoc'.
24829 Adjust all dependencies.
24830 * src/reader.c: Formatting changes.
24831 (LTYPESTR): Don't define it, use it as a literal in
24832 `reader_output_yylsp'.
24833 * src/symtab.h (symbol_class): New enum type which replaces the
24834 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
24835 `sunknown', `stoken and `snterm'.
24836
248372000-10-02 Akim Demaille <akim@epita.fr>
24838
24839 * src/getargs.c (fixed_outfiles): Rename as...
24840 (yaccflag): for consistency and accuracy.
24841 Adjust dependencies.
24842
248432000-10-02 Akim Demaille <akim@epita.fr>
24844
24845 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
24846 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
24847 difficult and introduced a lot of core dump. It turns out that
24848 Bison used an implementation of `xmalloc' based on `calloc', and
24849 at various places it does depend upon the initialization to 0. I
24850 have not tried to isolate the pertinent places, and all the former
24851 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
24852 someone should address this issue.
24853
24854 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
24855 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
24856 files.
24857 Adjust dependencies.
24858 * src/warshall.h: New file.
24859 Propagate.
24860
248612000-10-02 Akim Demaille <akim@epita.fr>
24862
24863 Various anti-`extern in *.c' changes.
24864
24865 * src/system.h: Include `assert.h'.
24866
248672000-10-02 Akim Demaille <akim@epita.fr>
24868
24869 * src/state.h (nstates, final_state, first_state, first_shift)
24870 (first_reduction): Move their exportation from here...
24871 * src/LR0.h: to here.
24872 Adjust dependencies.
24873 * src/getargs.c (statisticsflag): New variable.
24874 Add support for `--statistics'.
24875 Adjust dependencies.
24876
24877 Remove a lot of now useless `extern' statements in most files.
24878
248792000-10-02 Akim Demaille <akim@epita.fr>
24880
24881 * src/LR0.h: New file.
24882 Propagate its use.
24883
248842000-10-02 Akim Demaille <akim@epita.fr>
24885
24886 * src/print.h: New file.
24887 Propagate its use.
24888 * src/print.c: Formatting and ordering changes.
24889 (verbose, terse): Replace with...
24890 (print_results): this new function.
24891 Adjust dependencies.
24892
248932000-10-02 Akim Demaille <akim@epita.fr>
24894
24895 * src/conflicts.c (conflict_report): New function.
24896 (conflict_log, verbose_conflict_log): Replace with...
24897 (print_conflicts): this function.
24898 Adjust dependencies.
24899 * src/conflicts.h: New file.
24900 Propagate its inclusion.
24901
249022000-10-02 Akim Demaille <akim@epita.fr>
24903
24904 * src/nullable.h: New file.
24905 Propagate its inclusion.
24906 * src/nullable.c: Formatting changes.
24907
249082000-10-02 Akim Demaille <akim@epita.fr>
24909
24910 * src/reduce.h: New file.
24911 Propagate its inclusion.
24912 * src/reduce.c: Topological sort and other formatting changes.
24913 (bool, TRUE, FALSE): Move their definition to...
24914 * src/system.h: here.
24915
249162000-10-02 Akim Demaille <akim@epita.fr>
24917
24918 * src/files.c: Formatting changes.
24919 (tryopen, tryclose, openfiles): Rename as...
24920 (xfopen, xfclose, open_files): this.
24921 (stringappend): static.
24922 * src/files.h: Complete the list of exported symbols.
24923 Propagate its use.
24924
249252000-10-02 Akim Demaille <akim@epita.fr>
24926
24927 * src/reader.h: New file.
24928 Propagate its use instead of tedious list of `extern' and
24929 prototypes.
24930 * src/reader.c: Formatting changes, topological sort,
24931 s/register//.
24932
249332000-10-02 Akim Demaille <akim@epita.fr>
24934
24935 * src/lex.h: Prototype `lex.c' exported functions.
24936 * src/reader.c: Adjust.
24937 * src/lex.c: Formatting changes.
24938 (safegetc): Rename as...
24939 (xgetc): this.
24940
249412000-10-02 Akim Demaille <akim@epita.fr>
24942
24943 * src/lalr.h: New file.
24944 Propagate its inclusion instead of prototypes and `extern'.
24945 * src/lalr.c: Formatting changes, topological sorting etc.
24946
249472000-10-02 Akim Demaille <akim@epita.fr>
24948
24949 * src/output.c (token_actions): Introduce a temporary array,
24950 YYDEFACT, that makes it possible for this function to use
24951 output_short_table.
24952
249532000-10-02 Akim Demaille <akim@epita.fr>
24954
24955 `user_toknums' is output as a `short[]' in `output.c', while it is
24956 defined as a `int[]' in `reader.c'. For consistency with the
24957 other output tables, `user_toknums' is now defined as a table of
24958 shorts.
24959
24960 * src/reader.c (user_toknums): Be a short table instead of an int
24961 table.
24962 Adjust dependencies.
24963
24964 Factor the short table outputs.
24965
24966 * src/output.c (output_short_table): New function.
24967 * src/output.c (output_gram, output_stos, output_rule_data)
24968 (output_base, output_table, output_check): Use it.
24969
249702000-10-02 Akim Demaille <akim@epita.fr>
24971
24972 * src/output.c (output): Topological sort of the functions, in
24973 order to get rid of the `static' prototypes.
24974 No longer use `register'.
24975 * src/output.h: New file.
24976 Propagate its inclusion in files explicitly prototyping functions
24977 from output.c.
24978
249792000-09-21 Akim Demaille <akim@epita.fr>
24980
24981 * src/atgeneral.m4: Update from Autoconf.
24982
249832000-09-21 Akim Demaille <akim@epita.fr>
24984
24985 * src/closure.h: New file.
24986 * src/closure.c: Formatting changes, topological sort over the
24987 functions, use of closure.h.
24988 (initialize_closure, finalize_closure): Rename as...
24989 (new_closure, free_closure): these. Adjust dependencies.
24990 * src/LR0.c: Formatting changes, topological sort, use of
24991 cloture.h.
24992 (initialize_states): Rename as...
24993 (new_states): this.
24994 * src/Makefile.am (noinst_HEADERS): Adjust.
24995
249962000-09-20 Akim Demaille <akim@epita.fr>
24997
24998 * src/acconfig.h: Don't protect config.h against multiple
24999 inclusion.
25000 Don't define PARAMS.
25001 * src/system.h: Define PARAMS.
25002 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
25003 purpose of config.h. system.h must not try to fix wrong
25004 definitions in config.h.
25005
250062000-09-20 Akim Demaille <akim@epita.fr>
25007
25008 * src/derives.h: New file.
25009 * src/main.c, src/derives.h: Use it.
25010 Formatting changes.
25011 * src/Makefile.am (noinst_HEADERS): Adjust.
25012
250132000-09-20 Akim Demaille <akim@epita.fr>
25014
25015 * tests/atgeneral.m4: Update from Autoconf.
25016 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
25017 (AT_CHECK_CALC): New macros.
25018 Use these macros to test bison with options `', `--raw',
25019 `--debug', `--yacc', `--yacc --debug'.
25020
250212000-09-19 Akim Demaille <akim@epita.fr>
25022
25023 * src/output.c: Formatting changes.
25024 * src/machine.h: Remove, leaving its contents in...
25025 * src/system.h: here.
25026 Include stdio.h.
25027 Adjust all dependencies on stdio.h and machine.h.
25028 * src/getargs.h: New file.
25029 Let all `extern' declarations about getargs.c be replaced with
25030 inclusion of `getargs.h'.
25031 * src/Makefile.am (noinst_HEADERS): Adjust.
25032
25033 * tests/calc.m4 (yyin): Be initialized in main, not on the global
25034 scope.
25035 (yyerror): Returns void, not int.
25036 * doc/bison.texinfo: Formatting changes.
25037
250382000-09-19 Akim Demaille <akim@epita.fr>
25039
25040 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
25041 portable.
25042
250432000-09-18 Akim Demaille <akim@epita.fr>
25044
25045 * configure.in: Append WARNING_CFLAGS to CFLAGS.
25046 * src/Makefile.am (INCLUDES): Don't.
25047 Be ready to fetch headers in lib/.
25048
250492000-09-18 Akim Demaille <akim@epita.fr>
25050
25051 * doc/bison.texinfo: Update the copyright.
25052 ANSIfy and GNUify the examples.
25053 Remove the old menu.
25054
250552000-09-18 Akim Demaille <akim@epita.fr>
25056
25057 First set of tests: use the `calc' example from the documentation.
25058
25059 * src/bison.s1 (yyparse): Condition the code using `yytname' which
25060 is defined only when YYDEBUG is.
25061 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
25062 * src/files.c (tryopen, tryclose): Formatting changes.
25063 Move to the top and be static.
25064 * src/reader.c (read_signed_integer): Likewise.
25065 * tests/calc.m4: New file.
25066 * Makefile.am, suite.m4: Adjust.
25067 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
25068
250692000-09-18 Akim Demaille <akim@epita.fr>
25070
25071 Add support for an Autotest test suite for Bison.
25072
25073 * m4/m4.m4, m4/atconfig.m4: New files.
25074 * m4/Makefile.am (EXTRA_DIST): Adjust.
25075 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
25076 files.
25077 * src/getargs.c: Display a more standard --version message.
25078 * src/reader.c (reader): Formatting changes.
25079 No longer depend upon VERSION_STRING.
25080 * configure.in: No longer use `dnl'.
25081 Set up the test suite and the new directory `tests/.
25082 (VERSION_STRING): Remove.
25083
250842000-04-14 Akim Demaille <akim@epita.fr>
25085
25086 * src/reader.c (copy_comment2): New function, same as former
25087 `copy_comment', but outputs into two FILE *.
25088 (copy_comment): Use it.
25089 (parse_union_decl): Use it.
25090 (get_type, parse_start_decl): Use the same `invalid' message.
25091 (parse_start_decl, parse_union_decl): Use the same `multiple'
25092 message.
25093 (parse_union_decl, copy_guard, copy_action): Use the same
25094 `unmatched' message.
25095 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
25096
250972000-03-31 Akim Demaille <akim@epita.fr>
25098
25099 * src/files.c (tryopen, tryclose): Move to the top.
25100 Be static.
25101
251022000-03-31 Akim Demaille <akim@epita.fr>
25103
25104 * src/main.c (main): Don't call `done', exit does it.
25105
251062000-03-31 Akim Demaille <akim@epita.fr>
25107
25108 * allocate.c: s/return (foo)/return foo/.
25109 * lalr.c: Likewise.
25110 * LR0.c: Likewise.
25111 * output.c: Likewise.
25112 * reader.c: Likewise.
25113 * symtab.c: Likewise.
25114 * vmsgetargs.c: Likewise.
25115
251162000-03-31 Akim Demaille <akim@epita.fr>
25117
25118 Clean up the error reporting functions.
25119
25120 * src/report.c: New file.
25121 * src/report.h: Likewise.
25122 * src/Makefile.am: Adjust.
25123 * m4/error.m4: New file.
25124 * m4/Makefile.am: Adjust.
25125 * configure.in (jm_PREREQ_ERROR): Call it.
25126 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
25127 Remove.
25128 (fatal, fatals): Remove. All callers use complain.c::fatal.
25129 (warn, warni, warns, warnss, warnss): Remove. All callers use
25130 complain.c::complain.
25131 (toomany): Remove, use fatal instead.
25132 * src/files.c (done): No argument, use complain_message_count.
25133 * src/main.c (main): Register `done' to `atexit'.
25134
25135 * src/getargs.c (usage): More `fputs', less `fprintf'.
25136
251372000-03-28 Akim Demaille <akim@epita.fr>
25138
25139 * lib/: New directory.
25140 * Makefile.am (SUBDIRS): Adjust.
25141 * configure.in: Adjust.
25142 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
25143 useless.
25144 * src/alloca.c: Moved to lib/.
25145 * src/getopt.c: Likewise.
25146 * src/getopt1.c: Likewise.
25147 * src/getopt.h: Likewise.
25148 * src/ansi2knr.c: Likewise.
25149 * src/ansi2knr.1: Likewise.
25150 * src/Makefile.am: Adjust.
25151 * lib/Makefile.am: New file.
25152
251532000-03-28 Akim Demaille <akim@epita.fr>
25154
25155 * src/getargs.c (usage): Refresh the help message.
25156
251572000-03-17 Akim Demaille <akim@epita.fr>
25158
25159 * src/getopt1.c: Updated from textutils 2.0e
25160 * src/getopt.c: Likewise.
25161 * src/getopt.h: Likewise.
25162
251632000-03-17 Akim Demaille <akim@epita.fr>
25164
25165 * src/Makefile.am (bison.simple): Fix the awk program: quote only
25166 the file name, not the whole `#line LINE FILE'.
25167
251682000-03-17 Akim Demaille <akim@epita.fr>
25169
25170 On syntax errors, report the token on which we choked.
25171
25172 * src/bison.s1 (yyparse): In the label yyerrlab, when
25173 YYERROR_VERBOSE, add yychar in msg.
25174
251752000-03-17 Akim Demaille <akim@epita.fr>
25176
25177 * src/reader.c (copy_at): New function.
25178 (copy_guard): Use it.
25179 (copy_action): Use it.
25180
251812000-03-17 Akim Demaille <akim@epita.fr>
25182
25183 Be kind to translators, save some useless translations.
25184
25185 * src/main.c (banner): New function.
25186 (fatal_banner): Use it.
25187 (warn_banner): Use it.
25188
251892000-03-17 Akim Demaille <akim@epita.fr>
25190
25191 * src/reader.c (copy_definition): Use copy_string and
25192 copy_comment. Removed now unused `match', `ended',
25193 `cplus_comment'.
25194 (copy_comment, copy_string): Moved, to be visible from
25195 copy_definition.
25196
251972000-03-17 Akim Demaille <akim@epita.fr>
25198
25199 * src/reader.c (copy_string): Declare `static inline'. No
25200 problems with inline, since it is checked by configure.
25201 (copy_comment): Likewise.
25202
252032000-03-17 Akim Demaille <akim@epita.fr>
25204
25205 * src/reader.c (packsymbols): Formatting changes.
25206
252072000-03-17 Akim Demaille <akim@epita.fr>
25208
25209 * src/reader.c (copy_comment): New function, factored out from:
25210 (copy_action): Use it. Removed now unused `match', `ended',
25211 `cplus_comment'.
25212 (copy_guard): Likewise.
25213
252142000-03-17 Akim Demaille <akim@epita.fr>
25215
25216 * src/reader.c (copy_string): New function, factored out from:
25217 (copy_action): Use it.
25218 (copy_guard): Likewise.
25219
252202000-03-17 Akim Demaille <akim@epita.fr>
25221
25222 Change the handling of @s so that they behave exactly like $s.
25223 There is now a pseudo variable @$ (readble and writable), location
25224 of the lhs of the rule (by default ranging from the location of
25225 the first symbol of the rhs, to the location of the last symbol,
25226 or, if the rhs is empty, YYLLOC).
25227
25228 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
25229 yyval.
25230 (yyparse): When providing a default semantic action, provide a
25231 default location action.
25232 (after the $): No longer change `*YYLSP', just stack YYLOC the
25233 same way you stack YYVAL.
25234 * src/reader.c (read_declarations): Use warns.
25235 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
25236 (copy_action, case '@'): Likewise.
25237 Use a standard error message, to save useless work from
25238 translators.
25239
252402000-03-17 Akim Demaille <akim@epita.fr>
25241
25242 * src/bison.s1: Formatting and cosmetics changes.
25243 * src/reader.c: Likewise.
25244 Update the Copyright notice.
25245
252462000-03-17 Akim Demaille <akim@epita.fr>
25247
25248 * src/bison.s1 (#line): All set to `#line' only, since the
25249 Makefile now handles them.
25250
252512000-03-16 Akim Demaille <akim@epita.fr>
25252
25253 * src/output.c (output_rule_data): Output the documentation of
25254 some of the tables.
25255 (Copyright notice): Update.
25256 Formatting changes.
25257
252582000-03-16 Akim Demaille <akim@epita.fr>
25259
25260 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
25261 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
25262 One `#if YYDEBUG' remains, since it uses variables which are
25263 defined only if `YYDEBUG != 0'.
25264
252652000-03-16 Akim Demaille <akim@epita.fr>
25266
25267 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
25268 and related variables so that the similarities are highlighted.
25269
252702000-03-16 Akim Demaille <akim@epita.fr>
25271
25272 * src/bison.s1: Properly indent CPP directives.
25273
252742000-03-16 Akim Demaille <akim@epita.fr>
25275
25276 * src/bison.s1: Properly indent the `alloca' CPP section.
25277
252782000-03-16 Akim Demaille <akim@epita.fr>
25279
25280 Do not hard code values of directories in `configure.in'.
25281 Update the `configure' tool chain.
25282
25283 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
25284 src/makefile.am.
25285 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
25286 (AC_OUTPUT): Add m4/Makefile.
25287 Bump to bison 1.28a, 1.29 has never been released.
25288 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
25289 handled via src/Makefile.am.
25290 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
25291 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
25292 autoheader.
25293 * Makefile.am (SUBDIRS): Add m4.
25294 (ACLOCAL_AM_FLAGS): New variable.
25295 (AUTOMAKE_OPTIONS): Add check-news.
25296 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
25297 the proper line number and file name.
25298 (DEFS): Propagate the location of bison library files and of the
25299 locale files.
25300 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
25301 builddir.
25302 * acinclude.m4: Remove, replaced by the directory m4.
25303 * m4/Makefile.am (EXTRA_DIST): New variable.
25304 * m4/gettext.m4: New file, from the fileutils.
25305 * m4/lcmessage.m4: Likewise
25306 * m4/progtest.m4: Likewise.
25307 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
25308
253092000-03-10 Akim Demaille <akim@epita.fr>
25310
25311 * src/closure.c:
25312 Formatting changes of various comments.
25313 Respect the GNU coding standards at various places.
25314 Don't use `_()' when no translation is needed.
25315
253161999-12-13 Jesse Thilo <jthilo@gnu.org>
25317
25318 * src/files.c:
25319 OS/2 honors TMPDIR environment variable.
25320
253211999-12-13 Jesse Thilo <jthilo@gnu.org>
25322
25323 * doc/bison.texinfo: Tweaked spelling and grammar.
25324 Updated ISBN.
25325 Removed reference to price of printed copy.
25326 Mention BISON_SIMPLE and BISON_HAIRY.
25327
253281999-12-13 Jesse Thilo <jthilo@gnu.org>
25329
25330 * configure.in, NEWS:
25331 Bison 1.29 released.
25332
253331999-10-27 Jesse Thilo <jthilo@gnu.org>
25334
25335 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
25336 Added reference card.
25337
253381999-07-26 Jesse Thilo <jthilo@gnu.org>
25339
25340 * po/ru.po: Added Russian translation.
25341
253421999-07-26 Jesse Thilo <jthilo@gnu.org>
25343
25344 * configure.in: Added Russian translation.
25345
253461999-07-06 Jesse Thilo <jthilo@gnu.org>
25347
25348 * configure.in, NEWS, README:
25349 Released version 1.28.
25350
253511999-06-14 Jesse Thilo <jthilo@gnu.org>
25352
25353 * src/system.h:
25354 Squashed redefinition warning on some systems.
25355
25356 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
25357 Have configure build version string instead of relying on ANSI string
25358 concatentation.
25359
253601999-06-14 Jesse Thilo <jthilo@gnu.org>
25361
25362 * po/POTFILES.in: Got rid of version.c.
25363
253641999-06-14 Jesse Thilo <jthilo@gnu.org>
25365
25366 * acconfig.h, configure.in:
25367 Have configure build version string instead of relying on ANSI string
25368 concatentation.
25369
253701999-06-08 Jesse Thilo <jthilo@gnu.org>
25371
25372 * doc/bison.1:
25373 Dropped mention of `+' for long-named options.
25374
253751999-05-30 Jesse Thilo <jthilo@gnu.org>
25376
25377 * src/files.c: Added <unistd.h> for unlink().
25378
25379 * src/Makefile.am, src/system.h:
25380 I18n fixes.
25381
253821999-05-30 Jesse Thilo <jthilo@gnu.org>
25383
25384 * README: Added a FAQ list.
25385
25386 * configure.in, acconfig.h:
25387 I18n fixes.
25388
253891999-05-30 Jesse Thilo <jthilo@gnu.org>
25390
25391 * doc/FAQ, doc/Makefile.am:
25392 Added a FAQ list.
25393
253941999-05-19 Jesse Thilo <jthilo@gnu.org>
25395
25396 * src/alloc.h, src/symtab.h, src/version.c:
25397 Protected inclusion of "config.h" with HAVE_CONFIG_H.
25398
253991999-04-18 Jesse Thilo <jthilo@gnu.org>
25400
25401 * src/.cvsignore, src/Makefile.am:
25402 Reorganized: sources in `src', documentation in `doc'.
25403
25404 * src/lex.c (literalchar):
25405 fixed the code for escaping double quotes (thanks
25406 Jonathan Czisny.)
25407
254081999-04-18 Jesse Thilo <jthilo@gnu.org>
25409
25410 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
25411 Adjusted paths to reflect directory reorganization.
25412
254131999-04-18 Jesse Thilo <jthilo@gnu.org>
25414
25415 * doc/.cvsignore, doc/Makefile.am:
25416 Reorganized: sources in `src', documentation in `doc'.
25417
254181999-04-18 Jesse Thilo <jthilo@gnu.org>
25419
25420 * configure.in:
25421 Updated AC_INIT file to reflect directory reorganization.
25422
25423 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
25424 Reorganized: sources in `src', documentation in `doc'.
25425
254261999-04-13 Jesse Thilo <jthilo@gnu.org>
25427
25428 * src/allocate.c:
25429 Don't declare calloc() and realloc() if not necessary.
25430
254311999-04-13 Jesse Thilo <jthilo@gnu.org>
25432
25433 * configure.in, acconfig.h, acinclude.m4:
25434 Don't declare calloc() and realloc() if not necessary.
25435
254361999-03-23 Jesse Thilo <jthilo@gnu.org>
25437
25438 * po/.cvsignore: Added i18n support.
25439
254401999-03-23 Jesse Thilo <jthilo@gnu.org>
25441
25442 * acconfig.h, configure.in, Makefile.am:
25443 Added i18n support.
25444
254451999-03-22 Jesse Thilo <jthilo@gnu.org>
25446
25447 * src/bison.s1: Fixed #line numbers.
25448
254491999-03-15 Jesse Thilo <jthilo@gnu.org>
25450
25451 * po/es.po, po/fr.po, po/nl.po, po/de.po:
25452 Added PO files from Translation Project.
25453
254541999-03-03 Jesse Thilo <jthilo@gnu.org>
25455
25456 * Makefile.am:
25457 Added support for non-ANSI compilers (ansi2knr).
25458
254591999-02-16 Jesse Thilo <jthilo@gnu.org>
25460
25461 * configure.in: Bumped version number to 1.27.
25462
25463 * Makefile.am:
25464 Added `bison.simple' to list of files removed by `make distclean'.
25465
254661999-02-12 Jesse Thilo <jthilo@gnu.org>
25467
25468 * src/files.c, src/files.h:
25469 Defined locations of parser files in config.h instead of Makefile.
25470
254711999-02-12 Jesse Thilo <jthilo@gnu.org>
25472
25473 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
25474 Defined locations of parser files in config.h instead of Makefile.
25475
254761999-02-09 Jesse Thilo <jthilo@gnu.org>
25477
25478 * Makefile.am:
25479 Removed inappropriate use of $< macro.
25480
254811999-02-05 Jesse Thilo <jthilo@gnu.org>
25482
25483 * po/Makefile.in.in, po/POTFILES.in:
25484 Add `po' directory skeleton.
25485
254861999-01-27 Jesse Thilo <jthilo@gnu.org>
25487
25488 * README: Document help-bison list.
25489
25490 * configure.in: Add check for mkstemp().
25491
254921999-01-20 Jesse Thilo <jthilo@gnu.org>
25493
25494 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
25495 Hush a few compiler warnings.
25496
25497 * src/files.c:
25498 Add tryclose(), which verifies that fclose was successful.
25499 Hush a couple of compiler warnings.
25500
255011999-01-20 Jesse Thilo <jthilo@gnu.org>
25502
25503 * Makefile.am, OChangeLog:
25504 ChangeLog is now automatically generated. Include the old version as
25505 OChangeLog.
25506
255071999-01-14 Jesse Thilo <jthilo@gnu.org>
25508
25509 * 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:
25510 Update FSF address.
25511
255121999-01-14 Jesse Thilo <jthilo@gnu.org>
25513
25514 * doc/bison.texinfo: Fix formatting glitch.
25515
25516 * doc/bison.texinfo: Update FSF address.
25517
255181999-01-14 Jesse Thilo <jthilo@gnu.org>
25519
25520 * acconfig.h: Update FSF address.
25521
255221999-01-08 Jesse Thilo <jthilo@gnu.org>
25523
25524 * src/system.h:
25525 Don't define PACKAGE here, since config.h defines it.
25526
255271998-12-30 Jesse Thilo <jthilo@gnu.org>
25528
25529 * src/reader.c: Update copyright date.
25530
25531 * src/main.c:
25532 Ditch sprintf to statically-sized buffers in fatal/warn functions in
25533 favor of output directly to stderr (avoids buffer overruns).
25534
25535 * src/reader.c: Some checks for premature EOF.
25536
25537 * 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:
25538 Use prototypes if the compiler understands them.
25539
25540 * src/files.c: Honor TMPDIR on Unix hosts.
25541 Use prototypes if the compiler understands them.
25542
25543 * src/reader.c:
25544 Fix a couple of buffer overrun bugs.
25545 Use prototypes if the compiler understands them.
25546
25547 * src/system.h: Include unistd.h and ctype.h.
25548 Use #ifdef instead of #if for NLS symbols.
25549
255501998-12-30 Jesse Thilo <jthilo@gnu.org>
25551
25552 * doc/bison.texinfo:
25553 Delete comment "consider using @set for edition number, etc..." since
25554 we now are doing so.
25555
255561998-12-30 Jesse Thilo <jthilo@gnu.org>
25557
25558 * configure.in:
25559 Use prototypes if the compiler understands them.
25560
25561 * NEWS: Document 1.26 highlights.
25562
25563 * Makefile.am: Require Automake 1.3 or later.
25564
25565 * acconfig.h:
25566 Use prototypes if the compiler understands them.
25567
255681998-12-29 Jesse Thilo <jthilo@gnu.org>
25569
25570 * src/version.c:
25571 Use VERSION symbol from automake for version number.
25572
255731998-12-29 Jesse Thilo <jthilo@gnu.org>
25574
25575 * acconfig.h, configure.in, version.cin:
25576 Use VERSION symbol from automake for version number.
25577
255781998-11-28 Jesse Thilo <jthilo@gnu.org>
25579
25580 * Makefile.am:
25581 Distribute original version of simple parser (bison.s1), not built
25582 version (bison.simple).
25583
255841998-11-28 Jesse Thilo <jthilo@gnu.org>
25585
25586 * doc/bison.texinfo: Add info dir entry.
25587
25588 * doc/bison.texinfo:
25589 Let automake put version number into documentation.
25590
255911998-11-26 Jesse Thilo <jthilo@gnu.org>
25592
25593 * src/bison.cld, src/build.com, src/vmshlp.mar:
25594 Add non-RCS files from /gd/gnu/bison.
25595
255961998-11-26 Jesse Thilo <jthilo@gnu.org>
25597
25598 * doc/bison.1:
25599 Document the BISON_HAIRY and BISON_SIMPLE variables.
25600
256011998-11-25 Jesse Thilo <jthilo@gnu.org>
25602
25603 * src/version.c: Build version.c automatically.
25604
25605 * src/reader.c:
25606 Fix token numbering (used to start at 258, not 257).
25607
25608 * src/system.h: Include config.h.
25609
25610 * src/getargs.c: Update bug report address.
25611
25612 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
25613 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
25614
256151998-11-25 Jesse Thilo <jthilo@gnu.org>
25616
25617 * Makefile.am:
25618 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
25619
25620 * configure.in, version.cin:
25621 Build version.c automatically.
25622
25623 * AUTHORS: Add AUTHORS file.
25624
25625 * README: Update bug report address.
25626
25627 * bison.simple:
25628 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
25629
25630 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
25631 Add automake stuff.
25632
256331998-11-25 Jesse Thilo <jthilo@gnu.org>
25634
25635 * doc/bison.texinfo: Clean up some formatting.
25636
256371998-05-05 Richard Stallman <rms@gnu.org>
25638
25639 * doc/bison.texinfo:
25640 Explain better why to make a pure parser.
25641
256421998-01-05 Richard Stallman <rms@gnu.org>
25643
25644 * src/files.c (openfiles):
25645 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
25646 find a temporary directory, if possible. Do not unlink files while
25647 they are open.
25648
256491997-08-25 Richard Stallman <rms@gnu.org>
25650
25651 * src/reader.c (stack_offset;):
25652 Change some warni to warns.
25653
25654 * src/lex.c (literalchar): Use warns, not warni.
25655
256561997-06-28 Richard Stallman <rms@gnu.org>
25657
25658 * src/bison.s1: Add a Bison version comment.
25659
25660 * src/main.c (fatal, warn, berror):
25661 Use program_name.
25662
256631997-06-28 Richard Stallman <rms@gnu.org>
25664
25665 * Makefile.in (bison_version): New variable.
25666 (dist): Use that variable.
25667 (bison.s1): Substitute the Bison version into bison.simple.
25668
25669 * bison.simple: Add a Bison version comment.
25670
256711997-06-18 Richard Stallman <rms@gnu.org>
25672
25673 * src/main.c (fatal, warn, berror):
25674 Make error messages standard.
25675 (toomany): Improve error message text.
25676
25677 * 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:
25678 new.h renamed to alloc.h.
25679
256801997-06-18 Richard Stallman <rms@gnu.org>
25681
25682 * Makefile.in: new.h renamed to alloc.h.
25683
256841997-05-24 Richard Stallman <rms@gnu.org>
25685
25686 * src/lex.c (literalchar):
25687 Fix the code for escaping \, " and '.
25688
25689 (lex): Avoid trouble when there are many chars
25690 to discard in a char literal with just several chars in it.
25691
256921997-05-17 Richard Stallman <rms@gnu.org>
25693
25694 * src/bison.s1:
25695 Use malloc, if using alloca is troublesome.
25696 (YYSTACK_USE_ALLOCA): New flag macro.
25697 Define it for some systems and compilers.
25698 (YYSTACK_ALLOC): New macro.
25699 (yyparse): Use YYSTACK_ALLOC to allocate stack.
25700 If it was malloc'd, free it.
25701
257021997-05-17 Richard Stallman <rms@gnu.org>
25703
25704 * bison.simple:
25705 Use malloc, if using alloca is troublesome.
25706 (YYSTACK_USE_ALLOCA): New flag macro.
25707 Define it for some systems and compilers.
25708 (YYSTACK_ALLOC): New macro.
25709 (yyparse): Use YYSTACK_ALLOC to allocate stack.
25710 If it was malloc'd, free it.
25711
257121997-04-23 Richard Stallman <rms@gnu.org>
25713
25714 * src/bison.s1:
25715 (alloca) [__hpux]: Always define as __builtin_alloca.
25716
257171997-04-23 Richard Stallman <rms@gnu.org>
25718
25719 * bison.simple:
25720 (alloca) [__hpux]: Always define as __builtin_alloca.
25721
257221997-04-22 Richard Stallman <rms@gnu.org>
25723
25724 * src/bison.s1:
25725 [__hpux]: Include alloca.h (right for HPUX 10)
25726 instead of declaring alloca (right for HPUX 9).
25727
25728 * src/bison.s1 (__yy_memcpy):
25729 Declare arg `count' as unsigned int.
25730 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
25731
257321997-04-22 Richard Stallman <rms@gnu.org>
25733
25734 * bison.simple:
25735 [__hpux]: Include alloca.h (right for HPUX 10)
25736 instead of declaring alloca (right for HPUX 9).
25737
25738 * bison.simple (__yy_memcpy):
25739 Declare arg `count' as unsigned int.
25740 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
25741
257421997-01-03 Richard Stallman <rms@gnu.org>
25743
25744 * src/allocate.c: [__STDC__ or _MSC_VER]:
25745 Declare calloc and realloc to return void *.
25746
257471997-01-02 Richard Stallman <rms@gnu.org>
25748
25749 * src/system.h:
25750 [_MSC_VER]: Include stdlib.h and process.h.
25751 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
25752
25753 * src/main.c (main): Return FAILURE as a value.
25754 (printable_version): Declare arg as int, not char.
25755
257561997-01-02 Richard Stallman <rms@gnu.org>
25757
25758 * Makefile.in (dist):
25759 Explicitly check for symlinks, and copy them.
25760
257611996-12-19 Richard Stallman <rms@gnu.org>
25762
25763 * src/files.c:
25764 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
25765
257661996-12-18 Paul Eggert <eggert@gnu.org>
25767
25768 * src/bison.s1 (yyparse):
25769 If __GNUC__ and YYPARSE_PARAM are both defined,
25770 declare yyparse to have a void * argument.
25771
257721996-12-18 Paul Eggert <eggert@gnu.org>
25773
25774 * bison.simple (yyparse):
25775 If __GNUC__ and YYPARSE_PARAM are both defined,
25776 declare yyparse to have a void * argument.
25777
257781996-12-17 Richard Stallman <rms@gnu.org>
25779
25780 * src/reduce.c (nbits): Add some casts.
25781
257821996-08-12 Richard Stallman <rms@gnu.org>
25783
25784 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
25785
257861996-08-12 Richard Stallman <rms@gnu.org>
25787
25788 * bison.simple: Test _MSDOS as well as _MSDOS_.
25789
257901996-07-31 Richard Stallman <rms@gnu.org>
25791
25792 * src/bison.s1:
25793 [__sun && __i386]: Include alloca.h.
25794
257951996-07-31 Richard Stallman <rms@gnu.org>
25796
25797 * bison.simple:
25798 [__sun && __i386]: Include alloca.h.
25799
258001996-07-30 Richard Stallman <rms@gnu.org>
25801
25802 * src/bison.s1: Comment change.
25803
25804 * src/bison.s1: Test _MSDOS_, not MSDOS.
25805
258061996-07-30 Richard Stallman <rms@gnu.org>
25807
25808 * bison.simple: Comment change.
25809
25810 * bison.simple: Test _MSDOS_, not MSDOS.
25811
258121996-06-01 Richard Stallman <rms@gnu.org>
25813
25814 * 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:
25815 Insert `_' macro around many string constants.
25816
25817 * src/main.c:
25818 Insert `_' macro around many string constants.
25819
25820 (main): Call setlocale, bindtextdomain and textdomain.
25821
25822 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
25823 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
25824 [ENABLE_NLS]: Include libintl.h.
25825 [ENABLE_NLS] (gettext): Define.
25826 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
25827 (N_, PACKAGE, LOCALEDIR): New macros.
25828
258291996-06-01 Richard Stallman <rms@gnu.org>
25830
25831 * POTFILES.in: New file.
25832
25833 * Makefile.in (allocate.o):
25834 Define target explicitly.
25835
25836 * Makefile.in (CFLAGS): Set to @CFLAGS@.
25837 (LDFLAGS): Set to @LDFLAGS@.
25838 (configure): Run autoconf only if preceding `cd' succeeds.
25839 (bison.s1): Redirect output to temporary file then move the
25840 temporary to the target, rather than redirecting directly to bison.s1.
25841 (clean): Remove config.status and config.log.
25842 (distclean): Don't remove config.status here.
25843
258441996-05-12 Richard Stallman <rms@gnu.org>
25845
25846 * src/bison.s1:
25847 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
25848
258491996-05-12 Richard Stallman <rms@gnu.org>
25850
25851 * bison.simple:
25852 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
25853
258541996-05-11 Richard Stallman <rms@gnu.org>
25855
25856 * src/bison.s1 (__yy_memcpy):
25857 Really reorder the args, as was supposedly done on Feb 14 1995.
25858 (yyparse): Calls changed accordingly.
25859
258601996-05-11 Richard Stallman <rms@gnu.org>
25861
25862 * Makefile.in (dist): Don't use $(srcdir).
25863
25864 * bison.simple (__yy_memcpy):
25865 Really reorder the args, as was supposedly done on Feb 14 1995.
25866 (yyparse): Calls changed accordingly.
25867
258681996-01-27 Richard Stallman <rms@gnu.org>
25869
25870 * src/output.c (output_rule_data):
25871 Test YYERROR_VERBOSE in the conditional
25872 around the definition of ttyname.
25873
258741995-12-29 Richard Stallman <rms@gnu.org>
25875
25876 * src/bison.s1:
25877 Fix line numbers in #line commands.
25878
258791995-12-29 Richard Stallman <rms@gnu.org>
25880
25881 * bison.simple:
25882 Fix line numbers in #line commands.
25883
258841995-12-27 Richard Stallman <rms@gnu.org>
25885
25886 * src/bison.s1 (YYPARSE_PARAM_DECL):
25887 In C++, make it always null.
25888 (YYPARSE_PARAM_ARG): New macro.
25889 (yyparse): Use YYPARSE_PARAM_ARG.
25890
258911995-12-27 Richard Stallman <rms@gnu.org>
25892
25893 * bison.simple (YYPARSE_PARAM_DECL):
25894 In C++, make it always null.
25895 (YYPARSE_PARAM_ARG): New macro.
25896 (yyparse): Use YYPARSE_PARAM_ARG.
25897
258981995-11-29 Richard Stallman <rms@gnu.org>
25899
25900 * doc/bison.texinfo:
25901 Describe literal string tokens, %raw, %no_lines, %token_table.
25902
259031995-11-29 Daniel Hagerty <hag@gnu.org>
25904
25905 * doc/bison.texinfo: Fixed update date
25906
259071995-10-16 Richard Stallman <rms@gnu.org>
25908
25909 * src/version.c: Version 1.25.
25910
259111995-10-16 Richard Stallman <rms@gnu.org>
25912
25913 * NEWS: *** empty log message ***
25914
259151995-10-16 Richard Stallman <rms@gnu.org>
25916
25917 * doc/bison.1, doc/bison.rnh:
25918 Add new options.
25919
259201995-10-15 Richard Stallman <rms@gnu.org>
25921
25922 * src/vmsgetargs.c, src/getargs.c:
25923 Added -n, -k, and -raw switches.
25924 (noparserflag, toknumflag, rawtoknumflag): New variables.
25925
25926 * src/symtab.h (SALIAS):
25927 New #define for adding aliases to %token.
25928 (struct bucket): Added `alias' field.
25929
25930 * src/reduce.c (reduce_grammar):
25931 Revise error message.
25932 (print_notices): Remove final `.' from error message.
25933
25934 * src/reader.c (reader_output_yylsp):
25935 New function.
25936 (readgram): Use `#if 0' around code that accepted %command
25937 inside grammar rules: The documentation doesn't allow it,
25938 and it will fail since the %command processors scan for the next %.
25939 (parse_token_decl): Extended the %token
25940 declaration to allow a multi-character symbol as an alias.
25941 (parse_thong_decl): New function.
25942 (read_declarations): Added %thong declarations.
25943 (read_declarations): Handle NOOP to deal with allowing
25944 % declarations as another means to specify the flags.
25945 (readgram): Allow %prec prior to semantics embedded in a rule.
25946 (skip_to_char, read_declarations, copy_definition)
25947 (parse_token_decl, parse_start_decl, parse_type_decl)
25948 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
25949 (get_type_name, copy_guard, copy_action, readgram)
25950 (get_type, packsymbols): Revised most error messages.
25951 Changed `fatal' to `warnxxx' to avoid aborting for error.
25952 Revised and use multiple warnxxx functions to avoid using VARARGS1.
25953 (read_declarations): Improve the error message for
25954 an invalid character. Do not abort.
25955 (read_declarations, copy_guard, copy_action): Use
25956 printable_version to avoid unprintable characters in printed output.
25957 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
25958 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
25959 Allow the type of a non-terminal can be given
25960 more than once, as long as all specifications give the same type.
25961
25962 * src/output.c:
25963 (output_headers, output_trailers, output, output_gram)
25964 (output_rule_data): Implement noparserflag variable.
25965 Implement toknumflag variable.
25966 (output): Call reader_output_yylsp to output LTYPESTR.
25967
25968 * src/main.c (main):
25969 If reader sees an error, don't process the grammar.
25970 (fatals): Updated to not use VARARGS1.
25971 (printable_version, int_to_string, warn, warni, warns, warnss)
25972 (warnsss): New error reporting functions. Avoid abort for error.
25973
25974 * src/lex.h:
25975 Added THONG and NOOP for alias processing.
25976 Added SETOPT for the new code that allows setting options with %flags.
25977
25978 * src/lex.c:
25979 Include getopt.h. Add some extern decls.
25980 (safegetc): New function to deal with EOF gracefully.
25981 (literalchar); new function to deal with reading \ escapes.
25982 (lex): Use literalchar.
25983 (lex): Implemented "..." tokens.
25984 (literalchar, lex, parse_percent_token): Made tokenbuffer
25985 always contain the token. This includes growing the token
25986 buffer while reading an integer.
25987 (parse_percent_token): Replaced if-else statement with percent_table.
25988 (parse_percent_token): Added % declarations as another
25989 way to specify the flags -n, -l, and -r. Also added hooks for
25990 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
25991 major changes to files.c.
25992 (lex) Retain in the incoming stream a character following
25993 an incorrect '/'.
25994 (skip_white_space, lex): Revised most error messages
25995 and changed fatal to warn to avoid aborting.
25996 (percent_table): Added %thong declarations.
25997
25998 * src/gram.h: Comment changes.
25999
26000 * src/files.c (openfiles, open_extra_files, done):
26001 Add faction flag
26002 and actfile file. Handle noparserflag. Both for -n switch.
26003
26004 * src/conflicts.c (resolve_sr_conflict):
26005 Remove use of alloca.
26006
260071995-06-01 Jim Meyering <meyering@gnu.org>
26008
26009 * doc/bison.texinfo: *** empty log message ***
26010
260111995-05-06 Richard Stallman <rms@gnu.org>
26012
26013 * src/bison.s1: Comment change.
26014
260151995-05-06 Richard Stallman <rms@gnu.org>
26016
26017 * bison.simple: Comment change.
26018
260191995-05-03 Richard Stallman <rms@gnu.org>
26020
26021 * src/version.c: Version now 1.24.
26022
26023 * src/bison.s1: Change distribution terms.
26024
26025 * src/version.c: Version now 1.23.
26026
260271995-05-03 Richard Stallman <rms@gnu.org>
26028
26029 * doc/bison.texinfo:
26030 Rewrite "Conditions for Using Bison".
26031 Update version to 1.24.
26032
260331995-05-03 Richard Stallman <rms@gnu.org>
26034
26035 * bison.simple: Change distribution terms.
26036
260371995-02-23 Richard Stallman <rms@gnu.org>
26038
26039 * src/files.c: Test __VMS_POSIX as well as VMS.
26040
260411995-02-14 Jim Meyering <meyering@gnu.org>
26042
26043 * src/bison.s1 (__yy_memcpy):
26044 Renamed from __yy_bcopy to avoid
26045 confusion. Reverse FROM and TO arguments to be consistent with
26046 those of memcpy.
26047
260481995-02-14 Jim Meyering <meyering@gnu.org>
26049
26050 * bison.simple (__yy_memcpy):
26051 Renamed from __yy_bcopy to avoid
26052 confusion. Reverse FROM and TO arguments to be consistent with
26053 those of memcpy.
26054
260551994-11-10 David J. MacKenzie <djm@gnu.org>
26056
26057 * NEWS: reformat
26058
26059 * NEWS: New file.
26060
26061 * Makefile.in (DISTFILES): Include NEWS.
26062
26063 * Makefile.in (DISTFILES):
26064 Include install-sh, not install.sh.
26065
26066 * configure.in: Update to Autoconf v2 macro names.
26067
260681994-10-05 David J. MacKenzie <djm@gnu.org>
26069
26070 * Makefile.in: fix typo
26071
26072 * Makefile.in (prefix, exec_prefix):
26073 Let configure set them.
26074
260751994-09-28 David J. MacKenzie <djm@gnu.org>
26076
26077 * Makefile.in: Set datadir to $(prefix)/share.
26078
260791994-09-15 Richard Stallman <rms@gnu.org>
26080
26081 * src/bison.s1:
26082 Update copyright notice and GPL version.
26083
260841994-09-15 Richard Stallman <rms@gnu.org>
26085
26086 * bison.simple:
26087 Update copyright notice and GPL version.
26088
260891994-07-12 Richard Stallman <rms@gnu.org>
26090
26091 * src/reduce.c, src/reader.c:
26092 entered into RCS
26093
260941994-05-05 David J. MacKenzie <djm@gnu.org>
26095
26096 * Makefile.in: entered into RCS
26097
260981994-03-26 Richard Stallman <rms@gnu.org>
26099
26100 * src/bison.s1: entered into RCS
26101
261021994-03-26 Richard Stallman <rms@gnu.org>
26103
26104 * bison.simple: entered into RCS
26105
261061994-03-25 Richard Stallman <rms@gnu.org>
26107
26108 * src/main.c: entered into RCS
26109
261101994-03-24 Richard Stallman <rms@gnu.org>
26111
26112 * src/conflicts.c: entered into RCS
26113
261141994-01-02 Richard Stallman <rms@gnu.org>
26115
26116 * Makefile.in: *** empty log message ***
26117
261181993-11-21 Richard Stallman <rms@gnu.org>
26119
26120 * src/bison.s1: *** empty log message ***
26121
261221993-11-21 Richard Stallman <rms@gnu.org>
26123
26124 * doc/bison.texinfo: entered into RCS
26125
26126 * doc/bison.texinfo: *** empty log message ***
26127
261281993-11-21 Richard Stallman <rms@gnu.org>
26129
26130 * bison.simple: *** empty log message ***
26131
261321993-10-25 David J. MacKenzie <djm@gnu.org>
26133
26134 * doc/bison.texinfo: *** empty log message ***
26135
261361993-10-19 Richard Stallman <rms@gnu.org>
26137
26138 * src/bison.s1: *** empty log message ***
26139
261401993-10-19 Richard Stallman <rms@gnu.org>
26141
26142 * bison.simple: *** empty log message ***
26143
261441993-10-14 Richard Stallman <rms@gnu.org>
26145
26146 * src/bison.s1: *** empty log message ***
26147
261481993-10-14 Richard Stallman <rms@gnu.org>
26149
26150 * bison.simple: *** empty log message ***
26151
261521993-09-14 David J. MacKenzie <djm@gnu.org>
26153
26154 * doc/bison.texinfo: *** empty log message ***
26155
261561993-09-13 Noah Friedman <friedman@gnu.org>
26157
26158 * Makefile.in: *** empty log message ***
26159
261601993-09-10 Richard Stallman <rms@gnu.org>
26161
26162 * src/conflicts.c: *** empty log message ***
26163
26164 * src/system.h: entered into RCS
26165
261661993-09-10 Richard Stallman <rms@gnu.org>
26167
26168 * doc/bison.1: entered into RCS
26169
261701993-09-06 Noah Friedman <friedman@gnu.org>
26171
26172 * src/version.c: entered into RCS
26173
261741993-09-06 Noah Friedman <friedman@gnu.org>
26175
26176 * Makefile.in: *** empty log message ***
26177
261781993-07-30 David J. MacKenzie <djm@gnu.org>
26179
26180 * Makefile.in: *** empty log message ***
26181
261821993-07-24 Richard Stallman <rms@gnu.org>
26183
26184 * src/bison.s1: *** empty log message ***
26185
261861993-07-24 Richard Stallman <rms@gnu.org>
26187
26188 * bison.simple: *** empty log message ***
26189
261901993-07-08 David J. MacKenzie <djm@gnu.org>
26191
26192 * Makefile.in: *** empty log message ***
26193
261941993-07-04 Richard Stallman <rms@gnu.org>
26195
26196 * src/bison.s1: *** empty log message ***
26197
261981993-07-04 Richard Stallman <rms@gnu.org>
26199
26200 * bison.simple: *** empty log message ***
26201
262021993-06-26 David J. MacKenzie <djm@gnu.org>
26203
26204 * src/getargs.c: entered into RCS
26205
262061993-06-26 David J. MacKenzie <djm@gnu.org>
26207
26208 * doc/bison.texinfo: *** empty log message ***
26209
26210 * doc/bison.1: New file.
26211
262121993-06-25 Richard Stallman <rms@gnu.org>
26213
26214 * src/getargs.c: New file.
26215
262161993-06-16 Richard Stallman <rms@gnu.org>
26217
26218 * src/bison.s1: *** empty log message ***
26219
262201993-06-16 Richard Stallman <rms@gnu.org>
26221
26222 * bison.simple: *** empty log message ***
26223
262241993-06-03 Richard Stallman <rms@gnu.org>
26225
26226 * src/bison.s1: New file.
26227
262281993-06-03 Richard Stallman <rms@gnu.org>
26229
26230 * doc/bison.texinfo: *** empty log message ***
26231
262321993-06-03 Richard Stallman <rms@gnu.org>
26233
26234 * bison.simple: New file.
26235
262361993-05-19 Richard Stallman <rms@gnu.org>
26237
26238 * doc/bison.texinfo: New file.
26239
262401993-05-07 Noah Friedman <friedman@gnu.org>
26241
26242 * Makefile.in: *** empty log message ***
26243
262441993-04-28 Noah Friedman <friedman@gnu.org>
26245
26246 * src/reader.c: *** empty log message ***
26247
262481993-04-23 Noah Friedman <friedman@gnu.org>
26249
26250 * src/alloc.h: entered into RCS
26251
262521993-04-20 David J. MacKenzie <djm@gnu.org>
26253
26254 * src/version.c: *** empty log message ***
26255
26256 * src/files.c, src/allocate.c:
26257 entered into RCS
26258
26259 * src/reader.c: *** empty log message ***
26260
26261 * src/lex.c: entered into RCS
26262
26263 * src/conflicts.c: New file.
26264
26265 * src/symtab.c: entered into RCS
26266
26267 * src/alloc.h: New file.
26268
26269 * src/LR0.c: entered into RCS
26270
262711993-04-18 Noah Friedman <friedman@gnu.org>
26272
26273 * src/reader.c: New file.
26274
26275 * src/version.c: *** empty log message ***
26276
262771993-04-18 Noah Friedman <friedman@gnu.org>
26278
26279 * Makefile.in: *** empty log message ***
26280
262811993-04-17 Noah Friedman <friedman@gnu.org>
26282
26283 * Makefile.in: *** empty log message ***
26284
262851993-04-15 Richard Stallman <rms@gnu.org>
26286
26287 * src/main.c, src/files.c:
26288 New file.
26289
262901993-04-15 Noah Friedman <friedman@gnu.org>
26291
26292 * configure.in: entered into RCS
26293
26294 * configure.in: *** empty log message ***
26295
26296 * configure.in: New file.
26297
262981993-04-14 Richard Stallman <rms@gnu.org>
26299
26300 * Makefile.in: New file.
26301
263021993-04-13 Richard Stallman <rms@gnu.org>
26303
26304 * src/version.c: New file.
26305
263061993-03-25 Richard Stallman <rms@gnu.org>
26307
26308 * src/output.c: entered into RCS
26309
263101992-09-25 Richard Stallman <rms@gnu.org>
26311
26312 * configure.bat: entered into RCS
26313
263141992-06-22 Richard Stallman <rms@gnu.org>
26315
26316 * src/vmsgetargs.c: entered into RCS
26317
263181992-06-22 Richard Stallman <rms@gnu.org>
26319
26320 * doc/bison.rnh: entered into RCS
26321
263221992-04-20 David J. MacKenzie <djm@gnu.org>
26323
26324 * README: entered into RCS
26325
263261992-01-22 Richard Stallman <rms@gnu.org>
26327
26328 * src/machine.h: entered into RCS
26329
263301991-12-21 Richard Stallman <rms@gnu.org>
26331
26332 * src/lalr.c, src/closure.c:
26333 entered into RCS
26334
263351991-12-20 Richard Stallman <rms@gnu.org>
26336
26337 * src/state.h: entered into RCS
26338
263391991-12-18 Richard Stallman <rms@gnu.org>
26340
26341 * src/print.c, src/nullable.c, src/derives.c:
26342 entered into RCS
26343
263441991-11-03 David J. MacKenzie <djm@gnu.org>
26345
26346 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
26347 entered into RCS
26348
263491988-09-09 Richard Stallman <rms@gnu.org>
26350
26351 * src/bison.hairy: entered into RCS
26352
263531987-12-16 Richard Stallman <rms@gnu.org>
26354
26355 * REFERENCES: entered into RCS
26356
26357
26358 -----
26359
26360 Copyright (C) 1987-1988, 1991-2011 Free Software Foundation,
26361 Inc.
26362
26363 Copying and distribution of this file, with or without
26364 modification, are permitted provided the copyright notice and this
26365 notice are preserved.