]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
doc: cite publication for LAC.
[bison.git] / ChangeLog
... / ...
CommitLineData
12011-03-06 Joel E. Denny <joeldenny@joeldenny.org>
2
3 doc: cite publication for LAC.
4 * doc/bison.texinfo (LAC): Here.
5
62011-03-06 Joel E. Denny <joeldenny@joeldenny.org>
7
8 doc: clean up terminology for mysterious conflicts.
9 * doc/bison.texinfo (Mystery Conflicts): Rename node to...
10 (Mysterious Conflicts): ... this, which is already the section
11 title and the name used in the index. Update all cross-references
12 to this node. Also, don't imply that R/R conflicts are the only
13 kind of mysterious conflict.
14
152011-03-06 Joel E. Denny <joeldenny@joeldenny.org>
16
17 lr.default-reductions: rename "all" value to "full".
18 States that shift the error token do not have default reductions,
19 and GLR disables some default reductions, so "all" was a misnomer.
20 * doc/bison.texinfo (%define Summary): Update.
21 (Default Reductions): Update.
22 * src/print.c (print_reductions): Update.
23 * src/reader.c (prepare_percent_define_front_end_variables):
24 Update.
25 * src/tables.c (action_row): Update.
26 * tests/input.at (%define enum variables): Update.
27 * tests/reduce.at (%define lr.default-reductions): Update.
28
292011-03-06 Joel E. Denny <joeldenny@joeldenny.org>
30
31 doc: create a new Tuning LR section in the manual.
32 And clean up all other documentation of the features described
33 there.
34 * NEWS (2.5): Tweak wording of lr.type and parse.lac entries a
35 bit, update the cross-references to the manual, and point out that
36 LAC has caveats. Don't be so adamant that IELR+LAC=canonical LR.
37 That is, as the referenced section in the manual documents, LAC
38 does not fix infinite parsing loops on syntax errors.
39 * doc/bison.texinfo: Consistently drop the "(1)" suffix from LALR,
40 IELR, and LR in @cindex.
41 (%define Summary): Condense the entries for lr.default-reductions,
42 lr.keep-unreachable-states, lr.type, and parse.lac into brief
43 summaries, and cross-reference the appropriate subsections of
44 Tuning LR. For parse.lac, mention that it's only implemented for
45 deterministic parsers in C. In parse.error entry, mention LAC,
46 and add cross-reference to the LAC section.
47 (Error Reporting): When mentioning parse.error, mention LAC, and
48 add cross-reference to the LAC section.
49 (Tuning LR): New section with an extended version of the
50 documentation removed from %define Summary. Change all
51 cross-references in the manual to point here instead of there.
52 (Calc++ Parser): When mentioning parse.error, mention LAC, and add
53 cross-reference to the LAC section.
54 (Table of Symbols): In %error-verbose entry, add cross-reference
55 to Error Reporting.
56 (Glossary): Capitalize entry titles consistently. Add definitions
57 for "defaulted state" and "unreachable state". Expand IELR
58 acronym in IELR's entry.
59
602011-02-20 Joel E. Denny <joeldenny@joeldenny.org>
61
62 doc: add bibliography to manual.
63 * doc/bison.texinfo (Mystery Conflicts): Cross-reference
64 bibliography instead of citing publications directly.
65 (Generalized LR Parsing): Likewise.
66 (Bibliography): New section. Not all entries are cross-referenced
67 yet, but that will come in future patches.
68
692011-02-19 Joel E. Denny <joeldenny@joeldenny.org>
70
71 java: test and document previous bug fix.
72 * NEWS (2.5): Document it.
73 * tests/java.at (_AT_DATA_JAVA_CALC_Y): To one of the yyerror
74 invocations, pass a location that spans multiple tokens. Change
75 yyerror to report all of a location rather than just the begin
76 position. Extend yylex and Position to count tokens on a line.
77 Remove getHashCode as it's unused. Update all expected output.
78
792011-02-19 Bernd Kiefer <kiefer@dfki.de> (tiny change)
80
81 java: fix location handling bug.
82 Reported at
83 <http://lists.gnu.org/archive/html/bison-patches/2011-02/msg00005.html>.
84 * data/lalr1.java (YYParser::yylloc): For non-empty RHS, fix
85 reversed access to location stack.
86 * THANKS (Bernd Kiefer): Add.
87
882011-02-13 Joel E. Denny <joeldenny@joeldenny.org>
89
90 doc: fix some minor inconsistencies.
91 * doc/bison.texinfo (%define Summary): Fix mislabeled entry for
92 lex_symbol.
93 (%code Summary): For consistency with the variable list in the
94 %define Summary, enclose the list of %code qualifiers in a table
95 instead of an itemize.
96
972011-02-06 Joel E. Denny <joeldenny@joeldenny.org>
98
99 doc: clean up new subsections in manual.
100 * doc/bison.texinfo (%define Summary): Reword so it reads well as
101 a separate section. For example, add an intro, and move most of
102 the text outside of the @deffn so it is not indented so far.
103 (%code Summary): Likewise.
104 (Table of Symbols): Reword %code entry to match the %code entry in
105 Decl Summary.
106
1072011-02-06 Joel E. Denny <joeldenny@joeldenny.org>
108
109 doc: finish splitting apart the manual's Decl Summary section.
110 Suggested by Akim Demaille at
111 <http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00013.html>.
112 * doc/bison.texinfo (Decl Summary): Extract most of the %define
113 entry into...
114 (%define Summary): ... this new subsection, and update all
115 cross-references. For readability of the patches, rewriting of
116 the text so it makes sense as a separate subsection will come in a
117 later patch. Moreover, the majority of the text describing the
118 various new LR features should likely move to another new section
119 somewhere.
120
1212011-02-06 Joel E. Denny <joeldenny@joeldenny.org>
122
123 doc: begin to split apart the manual's Decl Summary section.
124 Discussed in thread starting at
125 <http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00013.html>.
126 * doc/bison.texinfo (Decl Summary): Extract most of the %code
127 entry into...
128 (%code Summary): ... this new subsection, and update all
129 cross-references. For readability of the patches, rewriting of
130 the text so it makes sense as a separate subsection will come in a
131 later patch.
132
1332011-02-06 Joel E. Denny <joeldenny@joeldenny.org>
134
135 doc: clean up naming of various Bison files.
136 The Bison manual's names for various files associated with a Bison
137 parser has devolved into inconsistency. This patch makes the
138 naming consistent for the most important files. First, it chooses
139 "grammar file" over "input file". The former appears to be more
140 traditional in the Bison manual, and Bison has other input
141 files (skeletons). Second, it chooses "parser implementation
142 file" over names like "parser file", "parser source file", "parser
143 source code file", and "parser output file". The new name makes
144 it clearer where Bison generates the main parser implementation,
145 and it is easily distinguishable from "parser header file".
146 * doc/bison.texinfo: Implement throughout.
147
1482011-02-06 Joel E. Denny <joeldenny@joeldenny.org>
149
150 doc: give credit to more of Bison's developers.
151 * doc/bison.texinfo (Introduction): Don't imply that only Robert
152 Corbett, Richard Stallman, and Wilfred Hansen have contributed to
153 Bison. However, I don't have time to write a full history, so
154 just point readers to THANKS and ChangeLog.
155
1562011-02-06 Joel E. Denny <joeldenny@joeldenny.org>
157
158 doc: document experimental features better.
159 * doc/bison.texinfo (Introduction): Say that IELR(1) and canonical
160 LR(1) are experimental. Mention Java. Normally experimental
161 features probably shouldn't be mentioned in the introduction.
162 However, if Bison's limitations to LALR(1), C, and C++ are so
163 important that they should be mentioned here, then it's important
164 to point out that Bison is beginning to escape those limitations.
165 Moreover, these particular experimental features have very little
166 chance of being removed.
167 * src/getargs.c (usage): Say that IELR(1) and canonical LR(1) are
168 experimental.
169
1702011-01-29 Joel E. Denny <joeldenny@joeldenny.org>
171
172 Do not allow identifiers that start with a dash.
173 This cleans up our previous fixes for a bug whereby Bison
174 discarded `.field' in `$-1.field'. The previous fixes were less
175 restrictive about where a dash could appear in an identifier, but
176 the restrictions were hard to explain. That bug was reported and
177 this final fix was originally suggested by Paul Hilfinger. This
178 also fixes a remaining bug reported by Paul Eggert whereby Bison
179 parses `%token ID -123' as `%token ID - 123' and handles `-' as an
180 identifier. Now, `-' cannot be an identifier. Discussed in
181 threads beginning at
182 <http://lists.gnu.org/archive/html/bug-bison/2011-01/msg00000.html>,
183 <http://lists.gnu.org/archive/html/bug-bison/2011-01/msg00004.html>.
184 * NEWS (2.5): Update entry describing the dash extension to
185 grammar symbol names. Also, move that entry before the named
186 references entry because the latter mentions the former.
187 * doc/bison.texinfo (Symbol): Update documentation for symbol
188 names. As suggested by Paul Eggert, mention the effect of periods
189 and dashes on named references.
190 (Decl Summary): Update documentation for unquoted %define values,
191 which, as a side effect, can no longer start with dashes either.
192 * src/scan-code.l (id): Implement.
193 * src/scan-gram.l (id): Implement.
194 * tests/actions.at (Exotic Dollars): Extend test group to exercise
195 bug reported by Paul Hilfinger.
196 * tests/input.at (Symbols): Update test group, and extend to
197 exercise bug reported by Paul Eggert.
198 * tests/named-refs.at (Stray symbols in brackets): Update test
199 group.
200 ($ or @ followed by . or -): Likewise.
201 * tests/regression.at (Invalid inputs): Likewise.
202
2032011-01-24 Joel E. Denny <joeldenny@joeldenny.org>
204
205 * data/yacc.c: Fix last apostrophe warning from xgettext.
206
2072011-01-09 Paul Eggert <eggert@cs.ucla.edu>
208
209 Fix minor problems encountered by a fresh bootstrap.
210 * data/glr.c, data/yacc.c: Do not use apostrophes in '#' comments,
211 as they confuse xgettext, which tries to parse them as C character
212 constants in a preprocessor directive.
213 * data/yacc.c (yy_lac): Don't use printf %d format on *yyesp, as
214 that expression might not promote to int on some platforms.
215 * src/parse-gram.c, src/parse-gram.h: Regenerate.
216
2172011-01-09 Joel E. Denny <joeldenny@joeldenny.org>
218
219 Improve error messages for `$' or `@' followed by `.' or `-'.
220 Previously, for this special case of an invalid reference, the
221 usual "symbol not found in production:" was printed. However,
222 because the symbol name was parsed as the empty string, that
223 message was followed immediately by a newline instead of a symbol
224 name. In reality, this is a syntax error, so the reference is
225 invalid regardless of the symbols actually appearing in the
226 production. Discussed at
227 <http://lists.gnu.org/archive/html/bison-patches/2011-01/msg00012.html>.
228 * src/scan-code.l (parse_ref): Report the above case as a syntax
229 error. Other than that, continue to handle this case like any
230 other invalid reference that Bison manages to parse because
231 "possibly meant" messages can still be helpful to the user.
232 * tests/named-refs.at ($ or @ followed by . or -): New test group.
233
2342011-01-08 Joel E. Denny <joeldenny@joeldenny.org>
235
236 doc: don't use @acronym.
237 Lately, many GNU packages are dropping it. See
238 <http://lists.gnu.org/archive/html/bison-patches/2011-01/msg00003.html>.
239 * doc/bison.texinfo: Remove all uses.
240
2412011-01-05 Alex Rozenman <rozenman@gmail.com>
242
243 Do not allow identifiers that start with a negative number.
244 Reported by Paul Hilfinger as a side effect of named references
245 support at
246 <http://lists.gnu.org/archive/html/bug-bison/2011-01/msg00000.html>.
247 Suggested by Paul Eggert.
248 * src/scan-code.l ({letter}, {id}): Adjust lexical definitions.
249 * src/scan-gram.l ({letter}, {id}): Likewise.
250
2512011-01-03 Joel E. Denny <joeldenny@joeldenny.org>
252
253 * ChangeLog (2011-01-02): improve description.
254
2552011-01-03 Joel E. Denny <joeldenny@joeldenny.org>
256
257 maint: don't update copyright years in bootstrap.
258 * .x-update-copyright: Add entry for bootstrap.
259 * bootstrap: Remove 2011 from copyright years. The bootstrap
260 version we're currently using comes from an older version of
261 gnulib.
262 * bootstrap.conf (bootstrap_sync): Add comments explaining this
263 issue.
264
2652011-01-02 Joel E. Denny <joeldenny@joeldenny.org>
266
267 maint: run "make update-copyright".
268
2692011-01-02 Joel E. Denny <joeldenny@joeldenny.org>
270
271 maint: prepare to use year ranges in copyright notices.
272 * README (Copyright statements): New section explaining the range
273 notation. The GNU maintainers document requires this explanation:
274 <http://www.gnu.org/prep/maintain/maintain.html#Copyright-Notices>.
275 I copied our explanation from coreutils.
276 * build-aux/update-b4-copyright: Revert 2010-06-17 changes that
277 disabled Bison's automated use of ranges.
278 * cfg.mk (update-copyright-env): Likewise.
279
2802011-01-02 Joel E. Denny <joeldenny@joeldenny.org>
281
282 Correct my email address.
283 * ChangeLog: In all recent entries.
284 * THANKS (Joel E. Denny): Here.
285
2862010-12-19 Joel E. Denny <joeldenny@joeldenny.org>
287
288 doc: cleanup.
289 * NEWS (2.5): Try to sort entries according to how interesting
290 users might find them.
291
2922010-12-19 Joel E. Denny <joeldenny@joeldenny.org>
293
294 doc: cleanup.
295 * NEWS (2.5): Make some minor improvements to wording, and format
296 entries more consistently.
297 * doc/bison.texinfo (Language and Grammar): Point out that IELR
298 and canonical LR are experimental features.
299 (Decl Summary): In list of %define variables, make wording more
300 consistent. Improve discussion of using LALR for GLR.
301
3022010-12-19 Joel E. Denny <joeldenny@joeldenny.org>
303
304 parse.lac: document.
305 * NEWS (2.5): Add entry for LAC, and mention LAC in entry for
306 other corrections to verbose syntax error messages.
307 * doc/bison.texinfo (Decl Summary): Rewrite entries for
308 lr.default-reductions and lr.type to be clearer, to mention
309 %nonassoc's effect on canonical LR, and to mention LAC. Add entry
310 for parse.lac.
311 (Glossary): Add entry for LAC.
312
3132010-12-11 Joel E. Denny <joeldenny@joeldenny.org>
314
315 parse.lac: implement exploratory stack reallocations.
316 * data/yacc.c: Rename %define variable parse.lac.es-capacity to
317 parse.lac.es-capacity-initial. Accept parse.lac.memory-trace
318 with values of "failures" (default) or "full".
319 (b4_declare_parser_state_variables): Add yyesa, yyes, and
320 yyes_capacity variables.
321 (YYSTACK_USE_ALLOCA): Ignore it if LAC requested.
322 (YYSTACK_ALLOC, YYSTACK_FREE, YYSTACK_ALLOC_MAXIMUM): Define if
323 LAC requested.
324 (YYCOPY_NEEDED): New cpp macro.
325 (YYCOPY): Define if LAC requested.
326 (yy_lac_stack_realloc): New function implementing stack
327 reallocations. Use YYMAXDEPTH for maximum stack size given that
328 the stack should never need to grow larger than the main state
329 stack needs to grow without LAC.
330 (YY_LAC_ESTABLISH): Update yy_lac invocation.
331 (yy_lac): Add arguments for exploratory stack memory data
332 recorded in the main parser. Invoke yy_lac_stack_realloc when
333 reallocation is necessary.
334 (yysyntax_error): Add the same new arguments and pass them to
335 yy_lac.
336 (yypstate_delete): Free yyes if necessary.
337 (yyesa, yyes, yyes_capacity): #define these to yypstate members
338 in the case of push parsing.
339 (yyparse, yypush_parse): Initialize yyes and yyes_capacity.
340 Update yysyntax_error invocations. At yyreturn, free yyes if
341 necessary.
342 * src/parse-gram.y: %define parse.lac full.
343 * tests/input.at (LAC: errors for %define): Extend for
344 parse.lac-memory-trace.
345 * tests/regression.at (LAC: Exploratory stack): Extend to check
346 that stack reallocs happen when expected.
347 (LAC: Memory exhaustion): Update to use YYMAXDEPTH and
348 parse.lac.es-capacity-initial.
349
3502010-12-11 Joel E. Denny <joeldenny@joeldenny.org>
351
352 parse.lac: implement as %define variable.
353 LAC = lookahead correction. See discussion at
354 <http://lists.gnu.org/archive/html/bison-patches/2009-09/msg00034.html>.
355 However, one point there must be corrected: because of %nonassoc,
356 LAC is *not* always redundant for lr.type=canonical-lr.
357 * data/yacc.c: Accept values of "none" (default) or "full" for
358 parse.lac. Accept %define parse.lac.es-capacity to specify
359 capacity of LAC's temporary exploratory stack. It defaults to 20
360 and, for now, will not grow dynamically.
361 (b4_lac_flag, b4_lac_if): New m4 macros. Evaluate as true for
362 parse.lac!=none.
363 (YYBACKUP): Invoke YY_LAC_DISCARD.
364 (YY_LAC_ESTABLISH, YY_LAC_DISCARD): New cpp macros that invoke
365 yy_lac and track when it needs to be invoked
366 (yy_lac): New function that, given the current stack, determines
367 whether a token can eventually be shifted. Return status mimics
368 yyparse return status.
369 (yysyntax_error): Change yystate argument to yyssp so stack top
370 can be passed to yy_lac. If LAC is requested, build expected
371 token list by invoking yy_lac for every token instead of just
372 checking the current state for lookaheads. Return 2 if yy_lac
373 exhausts memory.
374 (yyparse, yypush_parse): Use local variable yy_lac_established and
375 cpp macros YY_LAC_ESTABLISH and YY_LAC_DISCARD to implement LAC.
376 Update yysyntax_error invocation. Add yyexhaustedlab code if LAC
377 is requested.
378 * tests/conflicts.at (%nonassoc and eof): Extend to check the
379 effect of each of -Dlr.type=canonical-lr and -Dparse.lac=full.
380 (parse.error=verbose and consistent errors): Likewise.
381 (LAC: %nonassoc requires splitting canonical LR states): New test
382 group demonstrating how LAC can fix canonical LR.
383 * tests/input.at (LAC: Errors for %define): New test group.
384 * tests/regression.at (LAC: Exploratory stack): New test group.
385 (LAC: Memory exhaustion): New test group.
386
3872010-11-21 Joel E. Denny <joeldenny@joeldenny.org>
388
389 build: use gnulib's new bootstrap_sync option.
390 Now, whenever we update bison's copy of gnulib, bootstrap will
391 update itself the next time it's run.
392 * bootstrap: Copy from latest gnulib for bootstrap_sync support.
393 * bootstrap.conf (bootstrap_sync): Set to true.
394 * gnulib: Update to latest so bootstrap is in sync now.
395
3962010-11-07 Joel E. Denny <joeldenny@joeldenny.org>
397
398 yysyntax_error: fix for consistent error with lookahead.
399 * NEWS (2.5): Document.
400 * data/yacc.c (yysyntax_error): In a verbose syntax error
401 message while in a consistent state with a default action (which
402 must be an error action given that yysyntax_error is being
403 invoked), continue to drop the expected token list, but don't
404 drop the unexpected token unless there actually is no lookahead.
405 Moreover, handle that internally instead of returning 1 to tell
406 the caller to do it. With that meaning of 1 gone, renumber
407 return codes more usefully.
408 (yyparse, yypush_parse): Update yysyntax_error usage. Most
409 importantly, set yytoken to YYEMPTY when there's no lookahead.
410 * data/glr.c (yyreportSyntaxError): As in yacc.c, don't drop the
411 unexpected token unless there actually is no lookahead.
412 * data/lalr1.cc (yy::parser::parse): If there's no lookahead,
413 pass yyempty_ not yyla.type to yysyntax_error_.
414 (yy::parser::yysyntax_error_): Again, don't drop the unexpected
415 token unless there actually is no lookahead.
416 * data/lalr1.java (YYParser::parse): If there's no lookahead,
417 set yytoken to yyempty_ before invoking yysyntax_error.
418 (YYParser::yysyntax_error): Again, don't drop the unexpected
419 token unless there actually is no lookahead.
420 * tests/conflicts.at (parse.error=verbose and consistent
421 errors): Extend test group to further reveal how the previous
422 use of the simple "syntax error" message was too general. Test
423 yacc.c, glr.c, lalr1.cc, and lalr1.java. No longer an expected
424 failure.
425 * tests/java.at (AT_JAVA_COMPILE, AT_JAVA_PARSER_CHECK): Move
426 to...
427 * tests/local.at: ... here.
428 (_AT_BISON_OPTION_PUSHDEFS): Push AT_SKEL_JAVA_IF definition.
429 (AT_BISON_OPTION_POPDEFS): Pop it.
430 (AT_FULL_COMPILE): Extend to handle Java.
431
4322010-11-07 Joel E. Denny <joeldenny@joeldenny.org>
433
434 yysyntax_error: more preparation for readability of next patch.
435 There are no behavioral changes here.
436 * data/glr.c (yyreportSyntaxError): Reorganize.
437 * data/lalr1.cc (yy::parser::yysyntax_error_): Reorganize.
438 * tests/conflicts.at (parse.error=verbose and consistent errors):
439 Reorganize.
440
4412010-11-07 Joel E. Denny <joeldenny@joeldenny.org>
442
443 yysyntax_error: prepare for readability of next patches.
444 These are purely whitespace changes that result in ugly code
445 but that make the next couple of patches much easier to read.
446 * data/glr.c (yyreportSyntaxError): Reindent.
447 * data/lalr1.cc (yy::parser::yysyntax_error_): Reindent.
448 * data/lalr1.java (YYParser::yysyntax_error): Reindent.
449 * data/yacc.c (yysyntax_error): Reindent.
450
4512010-10-31 Joel E. Denny <joeldenny@joeldenny.org>
452
453 Fix memory leak.
454 * src/output.c (prepare_rules): Free temporary array.
455
4562010-10-31 Joel E. Denny <joeldenny@joeldenny.org>
457
458 yysyntax_error: improve invocation readability.
459 * data/yacc.c (yyparse, yypush_parse): For yysyntax_error
460 invocation, get rid of the while loop, which is misleading
461 because there are really at most two iterations.
462
4632010-10-31 Joel E. Denny <joeldenny@joeldenny.org>
464
465 * ChangeLog: Correct some errors in previous entries.
466
4672010-10-17 Joel E. Denny <joeldenny@joeldenny.org>
468
469 maint: re-anchor all .gitignore entries.
470 * bootstrap: Copy from gnulib's latest for the fix to
471 automatically anchor entries it constructs.
472 * gnulib: Update to latest just so it has the same bootstrap.
473 * .gitignore, build-aux/.gitignore, doc/.gitignore:
474 * lib/.gitignore, m4/.gitignore, po/.gitignore:
475 * runtime-po/.gitignore: Re-anchor all entries.
476
4772010-10-08 Paul Eggert <eggert@cs.ucla.edu>
478
479 Fix portability problem on OpenBSD 4.7.
480
481 Jim Meyering reported this in
482 <http://lists.gnu.org/archive/html/bug-bison/2010-10/msg00007.html>.
483 * data/yacc.c: Use EXIT_SUCCESS as a witness for stdlib.h,
484 not _STDLIB_H. EXIT_SUCCESS has been defined by the standard
485 for quite some time.
486 * src/parse-gram.c, src/parse-gram.h: Regenerate.
487 * tests/regression.at: Tamper with the renamed witness.
488
489 Adjust to recent changes to gnulib bootstrap.
490
491 * .cvsignore, build-aux/.cvsignore, doc/.cvsignore, etc/.cvsignore:
492 * examples/calc++/.cvsignore, lib/.cvsignore, m4/.cvsignore:
493 * po/.cvsignore, runtime-po/.cvsignore, src/.cvsignore:
494 * tests/.cvsignore: Remove; I don't use CVS to maintain Bison
495 anymore and don't know of anybody else who does. If someone needs
496 these files, they can resurrect them.
497 * .gitignore, build-aux/.gitignore, doc/.gitignore, lib/.gitignore:
498 * m4/.gitignore, po/.gitignore, runtime-po/.gitignore:
499 Omit leading '/', since bootstrap omits it.
500 Adjust file names to match current contents better.
501 * bootstrap: Sync from gnulib: this contains the new gnulib_mk_hook
502 installed just for us.
503 * bootstrap.conf (excluded_files): Don't exclude codeset.m4,
504 glibc21.m4, inttypes_h.m4, size_max.m4, xsize.m4, as they are now
505 needed somehow. Don't have time to look into why.
506 (gnulib_modules): Change malloc to malloc-gnu. Do we really assume
507 the GNU malloc behavior, where malloc (0) != NULL unless we're
508 out of storage? If not, we can omit malloc-gnu; but for now I left
509 it in to be safe.
510 (vc_ignore): Remove.
511 (gnulib_mk_hook): New function.
512 * README-hacking: Renamed from HACKING, since gnulib bootstrap now
513 uses that convention.
514
5152010-09-09 Paul Hilfinger <hilfinger@cs.berkeley.edu>
516
517 * data/glr.c (yySymbol): Define as int to avoid compiler warnings about
518 possible change of value.
519
5202010-09-08 Paul Hilfinger <hilfinger@cs.berkeley.edu>
521
522 * data/glr.c (yy_reduce_print): Change yyrhsVals to yyvsp to remove
523 compiler errors when using %debug.
524 Add declaration of yylow when locations in use to avoid compilation
525 error.
526 (yyglrReduce): Conditionalize message "Parse ... rejected by rule..."
527 on whether we are in split mode, for consistency with behavior of
528 non-GLR parsing.
529
5302010-09-01 Akim Demaille <demaille@gostai.com>
531
532 Address GCC warnings about shadowed local variables (yyflag).
533 * data/glr.c (YYCHK): Rename yyflag as yychk_flag.
534 (yyprocessOneStack): Reduce the scope of yyaction, yyconflicts,
535 yyrule, and yyflag.
536
5372010-08-05 Joel E. Denny <joeldenny@joeldenny.org>
538
539 Version 2.4.3.
540 * NEWS (2.4.3): Set date.
541
5422010-08-04 Joel E. Denny <joeldenny@joeldenny.org>
543
544 maint: add gettext version to release announcements.
545 Suggested by Paul Hilfinger at
546 <http://lists.gnu.org/archive/html/bison-patches/2010-07/msg00019.html>
547 <http://lists.gnu.org/archive/html/bison-patches/2010-08/msg00002.html>.
548 * cfg.mk (bootstrap-tools): Add gettext.
549
5502010-08-04 Joel E. Denny <joeldenny@joeldenny.org>
551
552 doc: fix -W and %expect documentation some.
553 * NEWS (2.4.3): Mention that there are documentation fixes.
554 * doc/bison.texinfo (Expect Decl): Make it clear that %expect
555 turns conflicts into errors not warnings.
556 (Shift/Reduce): Likewise.
557 (Bison Options): Don't mention -Wsyntax. It doesn't exist.
558
5592010-08-01 Joel E. Denny <joeldenny@joeldenny.org>
560
561 -Werror: fix for rules useless in parser after conflicts.
562 * NEWS (2.4.3): Document fix.
563 * src/complain.c (error_message): Extend to handle incomplete
564 error messages so warn and warn_at can be used in more cases.
565 * src/gram.c (grammar_rules_useless_report): Use warn_at so that
566 -Werror is always obeyed.
567 * src/reduce.c (reduce_print): Use warn so that the "warnings
568 being treated as errors" message is printed consistently before
569 the first warning message. This makes testing easier.
570 * tests/local.at (AT_BISON_WERROR_MSG): New macro.
571 (AT_BISON_CHECK_NO_XML): Extend to check -Werror and
572 --warnings=error when warnings appear in bison's stderr.
573
5742010-07-29 Joel E. Denny <joeldenny@joeldenny.org>
575
576 maint: enable gnits only at stable releases.
577 * configure.ac (AM_INIT_AUTOMAKE): Underscore or dash in a
578 version string should disable gnits. Explain in comments.
579
5802010-07-28 Joel E. Denny <joeldenny@joeldenny.org>
581
582 i18n: update.
583 * po/POTFILES.in: Add src/graphviz.c.
584
5852010-07-28 Joel E. Denny <joeldenny@joeldenny.org>
586
587 i18n: fix for gnulib.
588 * po/POTFILES.in: Add remaining gnulib files that have
589 translatable strings.
590
5912010-07-25 Joel E. Denny <joeldenny@joeldenny.org>
592
593 build: fix our adjustments for gnulib files in lib.
594 * configure.ac: For prepending lib/ to the values of config
595 variables, fix detection of empty values. Also, due to recent
596 gnulib changes, add LIBUNISTRING_UNITYPES_H and
597 LIBUNISTRING_UNIWIDTH_H to the list of those variables.
598
5992010-07-25 Joel E. Denny <joeldenny@joeldenny.org>
600
601 maint: use announce-gen's new --mail-headers.
602 * HACKING (Announce): Update instructions.
603 * cfg.mk (announcement_Cc_): Define.
604 * configure.ac (AM_GNU_GETTEXT_VERSION): Update to 0.18 as
605 required by latest gnulib.
606 * gnulib: Update to latest.
607
6082010-07-24 Joel E. Denny <joeldenny@joeldenny.org>
609
610 tests: handle Valgrind that complains about >&-.
611 * tests/output.at (AT_CHECK_OUTPUT): Extend to accept pre-tests.
612 (Output files: -dv >&-): Skip test group if running
613 maintainer-check-valgrind.
614
6152010-07-23 Paul Hilfinger <hilfingr@EECS.Berkeley.EDU>
616
617 * NEWS: Describe new semantic-predicate feature.
618 * data/c.m4 (b4_predicate_case): New definition.
619 * data/java.m4 (b4_predicate_case): New definition.
620 * data/glr.c (yyimmediate): Add definition.
621 (yydoAction): Remove comment, now obsolete.
622 Do YY_REDUCE_PRINT here.
623 (yyglrReduce): Alter comment to indicate that semantic values
624 need not be deferred.
625 Remove YY_REDUCE_PRINT from here; done in yydoAction.
626 (yyprocessOneStack): Pass immediate flag.
627 Delete stacks rejected by predicates in newly split-off parsers.
628 Change handling of yyerr so that only current stack gets deleted
629 when semantic predicate fails.
630 (yyfillin): Don't crash if a semantic value is unresolved (as may
631 happen in predicate rules).
632 Copy lr state as well in debugging mode.
633 Update comment on setting of yysval to include yyloc as well.
634 (yy_reduce_print): Add yynormal argument. Perform fillin properly.
635 Report unresolved RHS values.
636 (yyimmediate): New table.
637 * src/gram.h (struct rule): Add is_predicate field.
638 * src/output.c (user_actions_output): Use b4_predicate_case for
639 predicates.
640 (prepare_symbols): Output yyimmediate.
641 * src/scan-gram.l: Add %? token, SC_PREDICATE state.
642 * src/scan-code.l (code_props_rule_action_init): Add is_predicate
643 argument.
644 * src/scan-code.h (struct code_props): Add is_predicate field.
645 (code_props_rule_action_init): New interface.
646 * src/parse-gram.y (%?{...}): New token.
647 (rhs): Add %?{...} rule.
648 * src/parse-gram.c: Regenerate.
649 * src/parse-gram.h: Regenerate.
650 * src/reader.c (grammar_current_rule_action_append): Add
651 immediate argument.
652 (grammar_midrule_action): Use new interface for
653 code_props_rule_action_init.
654 (grammar_current_rule_action_append): Ditto.
655 (packgram): Transfer is_predicate value.
656 * src/reader.h (grammar_current_rule_action_append): New interface.
657 * doc/bison.texinfo: Document semantic predicates (%?).
658
659 * data/glr.c (yylhsNonterm, yyisDefaultedState,yyDefaultAction)
660 (yygetLRActions,yynewGLRStackItem,yyaddDeferredAction,yyinitStateSet)
661 (yyinitGLRStack,yyexpandGLRStack,yyupdateSplit,yymarkStackDeleted)
662 (yyundeleteLastStack,yyglrShift,yyglrShiftDefer,yydoAction,yyglrReduce)
663 (yyidenticalOptions,yymergeOptionSets,yyresolveStates,yyresolveAction)
664 (yyresolveLocations,yyresolveValue,yyreducePrint): Update parameter
665 names in comments and mention all parameters.
666 (struct yyGLRState): Fix description of yyposn field.
667 (yyresolveLocations): Correct comment so as not to imply action when
668 yyn1==0.
669
6702010-06-17 Paul Eggert <eggert@cs.ucla.edu>
671
672 Update from GFDL GFDL 1.2 to 1.3.
673 * doc/bison.texinfo: Update GFDL version number.
674 * doc/fdl.texi: Update to version 1.3, taken from:
675 http://www.gnu.org/licenses/fdl.texi
676
677 Do not use date ranges in copyright notices.
678 See http://www.gnu.org/prep/maintain/maintain.html#Copyright-Notices
679
680 * HACKING, Makefile.am, NEWS, PACKAGING, README, README-alpha:
681 * TODO, bootstrap, bootstrap.conf:
682 * build-aux/update-b4-copyright, cfg.mk, configure.ac:
683 * data/README, data/bison.m4, data/c++-skel.m4, data/c++.m4:
684 * data/c-skel.m4, data/c.m4, data/glr.c, data/glr.cc:
685 * data/java-skel.m4, data/java.m4, data/lalr1.cc:
686 * data/lalr1.java, data/local.mk, data/location.cc:
687 * data/stack.hh, data/variant.hh, data/xslt/bison.xsl:
688 * data/xslt/xml2dot.xsl, data/xslt/xml2text.xsl:
689 * data/xslt/xml2xhtml.xsl, data/yacc.c, djgpp/Makefile.maint:
690 * djgpp/README.in, djgpp/config.bat, djgpp/config.sed:
691 * djgpp/config.site, djgpp/config_h.sed, djgpp/djunpack.bat:
692 * djgpp/local.mk, djgpp/subpipe.c, djgpp/subpipe.h:
693 * djgpp/testsuite.sed, doc/bison.texinfo, doc/local.mk:
694 * doc/refcard.tex, etc/README, etc/bench.pl.in, etc/local.mk:
695 * examples/calc++/Makefile.am, examples/extexi:
696 * examples/local.mk, lib/abitset.c, lib/abitset.h:
697 * lib/bbitset.h, lib/bitset.c, lib/bitset.h:
698 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
699 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
700 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
701 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
702 * lib/libiberty.h, lib/local.mk, lib/main.c, lib/timevar.c:
703 * lib/timevar.def, lib/timevar.h, lib/vbitset.c:
704 * lib/vbitset.h, lib/yyerror.c, m4/bison-i18n.m4:
705 * m4/c-working.m4, m4/cxx.m4, m4/subpipe.m4, m4/timevar.m4:
706 * src/AnnotationList.c, src/AnnotationList.h:
707 * src/InadequacyList.c, src/InadequacyList.h, src/LR0.c:
708 * src/LR0.h, src/Sbitset.c, src/Sbitset.h, src/assoc.c:
709 * src/assoc.h, src/closure.c, src/closure.h, src/complain.c:
710 * src/complain.h, src/conflicts.c, src/conflicts.h:
711 * src/derives.c, src/derives.h, src/files.c, src/files.h:
712 * src/flex-scanner.h, src/getargs.c, src/getargs.h:
713 * src/gram.c, src/gram.h, src/graphviz.c, src/ielr.c:
714 * src/ielr.h, src/lalr.c, src/lalr.h, src/local.mk:
715 * src/location.c, src/location.h, src/main.c:
716 * src/muscle-tab.c, src/muscle-tab.h, src/named-ref.c:
717 * src/named-ref.h, src/nullable.c, src/nullable.h:
718 * src/output.c, src/output.h, src/parse-gram.y:
719 * src/print-xml.c, src/print-xml.h, src/print.c, src/print.h:
720 * src/print_graph.c, src/print_graph.h, src/reader.c:
721 * src/reader.h, src/reduce.c, src/reduce.h, src/relation.c:
722 * src/relation.h, src/scan-code.h, src/scan-code.l:
723 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
724 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
725 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
726 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
727 * tests/actions.at, tests/atlocal.in, tests/c++.at:
728 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
729 * tests/existing.at, tests/glr-regression.at:
730 * tests/headers.at, tests/input.at, tests/java.at:
731 * tests/local.at, tests/local.mk, tests/named-refs.at:
732 * tests/output.at, tests/push.at, tests/reduce.at:
733 * tests/regression.at, tests/sets.at, tests/skeletons.at:
734 * tests/synclines.at, tests/testsuite.at, tests/torture.at:
735 Don't use date ranges in copyright notices.
736
7372010-05-11 Akim Demaille <demaille@gostai.com>
738
739 lalrl1.cc: give a chance to user defined YYLLOC_DEFAULT.
740 * data/lalr1.cc (YYLLOC_DEFAULT): Move its definition from the
741 header file to the implementation file, after the user %code
742 sections.
743 * NEWS (2.5): Document this.
744
7452010-05-11 Akim Demaille <demaille@gostai.com>
746
747 doc: please Emacs.
748 * doc/bison.texinfo (Local Variables): Move this after the
749 LocalWords, since the latter are looked for in the whole document,
750 while the former are looked for only at its end.
751 Require american spell checking.
752
7532010-05-10 Akim Demaille <demaille@gostai.com>
754
755 doc: fix lalr1.cc documentation.
756 * doc/bison.texinfo (C++ Scanner Interface): Fix yylex signature.
757 (C++ Bison Interface): Fix lalr1.cc skeleton name.
758 (C++ Parser Interface): Fix semantic_type and location_type names.
759 Document yy::parser::token.
760 Reported by Jerry Quinn.
761
7622010-05-10 Akim Demaille <demaille@gostai.com>
763
764 c++: use YYRHSLOC.
765 * data/lalr1.cc (YYRHSLOC): New.
766 (YYLLOC_DEFAULT): Use it.
767 * data/glr.cc: If location_type was user defined, do not include
768 location.hh, and do not produce location.hh and position.hh.
769 * tests/calc.at (YYLLOC_DEFAULT): Use YYRHSLOC.
770 Check that glr.cc supports user defined location_type.
771 * NEWS: Document this.
772
7732010-05-07 Akim Demaille <demaille@gostai.com>
774
775 doc: fix typo.
776 * tests/synclines.at: here.
777
7782010-05-04 Akim Demaille <demaille@gostai.com>
779
780 tests: enhance AT_SYNCLINES_COMPILE.
781 * tests/synclines.at (AT_SYNCLINES_COMPILE): More distcc patterns.
782 (AT_TEST_SYNCLINE): Remove GCC 4.5 protection which is already
783 taken care of in AT_SYNCLINES_COMPILE.
784
7852010-05-04 Akim Demaille <demaille@gostai.com>
786
787 lalr1.cc: don't generate location.hh when location_type is defined
788 * data/bison.m4 (b4_percent_define_get): Accept a default value.
789 * data/c++.m4: Do not provide a default value for the %define
790 variable location_type, rather, use b4_percent_define_get with a
791 default argument where its value is needed.
792 * data/lalr1.cc: Do not load location.cc (which outputs both
793 location.hh and position.hh) if the user defined location_type.
794 Do not include location.hh either.
795
7962010-05-04 Akim Demaille <demaille@gostai.com>
797
798 lalr1.cc: minor refactoring.
799 * data/lalr1.cc: Don't issue empty namespaces.
800
8012010-05-04 Akim Demaille <demaille@gostai.com>
802
803 tests: fix %printer.
804 Currently, there is no check that %printer ... <foo> (nor
805 %destructor) is about an existing <foo> type. This C++ test had
806 it wrong (<::std::string> vs. <std::string>).
807
808 * tests/c++.at (AT_CHECK_VARIANTS): In list.yy, redefine the
809 pretty-printing of lists into something better for parser traces.
810 Update the expected output.
811 Fix correspondance between %type/%token and %printer.
812
8132010-05-04 Akim Demaille <demaille@gostai.com>
814
815 lalr1.cc: location_type: make sure we don't depend on loc.(begin|end).
816 * tests/calc.at (Span): Instead of begin/end, as in the built-in
817 location class, use first and last.
818 Define YYLLOC_DEFAULT to adjust to these changes.
819 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Adjust to the
820 location_type changes.
821
8222010-05-01 Joel E. Denny <joeldenny@joeldenny.org>
823
824 tests: fix maintainer-xml-check.
825 * data/xslt/xml2dot.xsl (xsl:template match="bison-xml-report"):
826 Update output to include comments now produced by --graph.
827 (xsl:template match="automaton"): As for --graph, name the
828 digraph after the grammar file.
829 * src/print-xml.c (escape_bufs): Enlarge array.
830 (print_xml): Add bug-report and url attributes to
831 bison-xml-report element.
832
8332010-05-01 Joel E. Denny <joeldenny@joeldenny.org>
834
835 In DOT output, convert from "/*" comments to "//" comments.
836 This handles the possibility that a "*/" might appear in
837 variable portions of those comments at some point in the future.
838 * src/graphviz.c (start_graph): Implement.
839
8402010-04-30 Joel E. Denny <joeldenny@joeldenny.org>
841
842 Document that undefined %prec identifier warnings will remain.
843 * NEWS (2.4.3): Here.
844 (2.4.2): Here.
845
8462010-04-30 Joel E. Denny <joeldenny@joeldenny.org>
847
848 Revert 2009-12-30 change for undefined %prec token complaints.
849 That is, keep them as warnings because that should be sufficient
850 to satisfy POSIX without creating backward compatibility issues.
851 Suggested by Richard Stallman at
852 <http://lists.gnu.org/archive/html/bison-patches/2010-03/msg00033.html>.
853 * NEWS (2.5): Remove mention of complaint.
854 * src/reader.c (grammar_rule_check): Convert complaint back to
855 warning.
856 * tests/input.at (%prec's token must be defined): Update.
857
8582010-04-25 Joel E. Denny <joeldenny@joeldenny.org>
859
860 build: don't require src/bison during bootstrap.
861 Suggested by Eric Blake at
862 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00003.html>.
863 * bootstrap.conf (bootstrap_epilogue): New function to make sure
864 src/parse-gram.[ch] are stamped later than src/parse-gram.y.
865
8662010-04-25 Joel E. Denny <joeldenny@joeldenny.org>
867
868 i18n: fix untranslatable string.
869 Reported by Goran Uddeborg at
870 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00000.html>.
871 * src/muscle-tab.c (muscle_percent_define_insert): Here.
872
8732010-04-13 Akim Demaille <demaille@gostai.com>
874
875 tests: calc: minor refactoring.
876 * tests/calc.at (_AT_DATA_CALC_Y): Simplify yylex.
877
8782010-04-13 Akim Demaille <demaille@gostai.com>
879
880 tests: calc: simplify location management.
881 * tests/local.at (AT_LOC_PUSHDEF, AT_LOC_POPDEF): New.
882 (_AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS): Use them to
883 define the appropriate AT_LOC accessors.
884 * tests/calc.at: Use AT_LOC accessors.
885
8862010-04-13 Akim Demaille <demaille@gostai.com>
887
888 test location_type.
889 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS):
890 Define AT_LOCATION_TYPE_IF.
891 (_AT_BISON_OPTION_POPDEFS): Undefine AT_LOCATION_TYPE_IF.
892 * tests/calc.at (_AT_DATA_CALC_Y): When %define location_type is
893 used, provide a user location type and use it.
894 (Simple LALR1 C++ Calculator): Add a test case for location_type.
895
8962010-04-13 Akim Demaille <demaille@gostai.com>
897
898 tests: check fclose's return value.
899 * tests/calc.at (_AT_DATA_CALC_Y): Check fclose's return status.
900
9012010-04-13 Akim Demaille <demaille@gostai.com>
902
903 tests: don't depend on the actual location type.
904 * tests/calc.at: Use yy::parser::location_type rather than
905 yy::location, since the former is always right, and might point to
906 another type than the latter.
907
9082010-04-13 Akim Demaille <demaille@gostai.com>
909
910 formatting changes.
911 * tests/calc.at: Formatting changes.
912
9132010-04-13 Akim Demaille <demaille@gostai.com>
914
915 lalr1.cc: remove useless forward declaration.
916 * data/lalr1.cc: Include location.hh before stack.hh.
917 Remove the useless forward declarations of position and location.
918 Reported by Chris Morley.
919 * data/glr.cc: Likewise.
920
9212010-04-11 Joel E. Denny <joeldenny@joeldenny.org>
922
923 * NEWS (2.4.3): Mention fix for Sun Studio C++.
924
9252010-04-10 Joel E. Denny <joeldenny@joeldenny.org>
926
927 tests: fix for newer Sun Studio C++.
928 Reported by Dagobert Michelsen at
929 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00023.html>.
930 * THANKS (Dagobert Michelsen): Add.
931 * configure.ac (AC_PREREQ): Set to 2.64 so we get the latest
932 Autoconf macro for handling the restrict keyword.
933 * gnulib: Update to latest, which no longer overrides that macro
934 from Autoconf.
935
9362010-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
937
938 portability: fix pointer arithmetic to conform to C standard.
939 Reported by Tys Lefering at
940 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00035.html>.
941 This fix is already implemented in glr.c and does not apply to
942 lalr1.java.
943 * data/lalr1.cc (yy::parser::parse): Increase size of
944 yyerror_range and adjust subscripting so you don't have to
945 subtract one from the beginning of the array.
946 * data/yacc.c (b4_declare_parser_state_variables,
947 yyparse, yypush_parse): Likewise.
948
9492010-04-05 Akim Demaille <demaille@gostai.com>
950
951 remove useless include.
952 * src/graphviz.h: Don't include stdbool.h.
953
9542010-04-05 Akim Demaille <demaille@gostai.com>
955
956 graph: sign the output file.
957 * src/graphviz.c (start_graph): Issue comments about Bison.
958 Suggested by Tys Lefering.
959
9602010-03-31 Joel E. Denny <jdenny@ces.clemson.edu>
961
962 portability: fix test suite for GCC 4.5's new #error message.
963 Reported by Tys Lefering at
964 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00030.html>.
965 * NEWS (2.4.3): Mention.
966 * tests/synclines.at (AT_TEST_SYNCLINE): Implement.
967
9682010-03-30 Akim Demaille <demaille@gostai.com>
969
970 fix comments.
971 * src/graphviz.h: Add missing license notice.
972 Document.
973
9742010-03-25 Akim Demaille <demaille@gostai.com>
975
976 tests: fix 250: parse.error=verbose overflow.
977 * tests/regression.at (parse.error=verbose overflow): Avoid the
978 double inclusion of stdlib.h as it triggers hard errors.
979
9802010-03-23 Joel E. Denny <jdenny@ces.clemson.edu>
981
982 portability: fix for BSD make.
983 Reported by Johan van Selst at
984 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00016.html>.
985 * tests/local.mk ($(TESTSUITE)): Qualify package.m4 in
986 this dependency list as in package.m4's target rule.
987
9882010-03-23 Joel E. Denny <jdenny@ces.clemson.edu>
989
990 portability: fix spawning on at least FreeBSD 8 and FreeBSD 9.
991 Reported by Johan van Selst at
992 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00014.html>.
993 * NEWS (2.4.3): New.
994 * THANKS (Johan van Selst): Add.
995 * etc/prefix-gnulib-mk (prefix): Adjust regex for makefile
996 targets so that gnulib's new c++defs.h is matched.
997 * gnulib: Update to latest.
998
9992010-03-20 Joel E. Denny <jdenny@ces.clemson.edu>
1000
1001 maint: update for changes to gnulib's announce-gen.
1002 * HACKING (Announce): RELEASE_TYPE=major must now be written
1003 RELEASE_TYPE=stable.
1004
10052010-03-20 Joel E. Denny <jdenny@ces.clemson.edu>
1006
1007 Version 2.4.2.
1008 * NEWS (2.4.2): Set version and date. For the recent test suite
1009 portability fixes, don't be so optimistic about their success
1010 given the lack of feedback on the affected platforms.
1011
10122010-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
1013
1014 tests: fix maintainer-xml-check for recent changes.
1015 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Use
1016 AT_BISON_CHECK_NO_XML rather than AT_BISON_CHECK because an
1017 output file whose name conflicts with a previous output file
1018 is now never generated.
1019
10202010-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
1021
1022 portability: fix several issues with M4 subprocess.
1023
1024 M4's output pipe was not being drained upon fatal errors during
1025 scan_skel. As a result, broken-pipe messages from M4 were seen
1026 on at least AIX, HP-UX, Solaris, and RHEL4, and this caused a
1027 failure in the test suite. The problem was that, on platforms
1028 where the default disposition for SIGPIPE is ignore instead of
1029 terminate, M4 sometimes saw fwrite fail with errno=EPIPE and
1030 then reported it. However, there's some sort of race condition,
1031 because the new test group occasionally succeeded.
1032 Reported by Albert Chin at
1033 <http://lists.gnu.org/archive/html/bug-bison/2010-02/msg00004.html>.
1034
1035 There were also problems with the test suite livelocking on
1036 Tru64 5.1b. Reported by Didier Godefroy at
1037 <http://lists.gnu.org/archive/html/bug-bison/2009-05/msg00005.html>.
1038 Switching to create_pipe_bidi suggested by Akim Demaille.
1039
1040 To attempt to solve both of these problems, switch to gnulib's
1041 create_pipe_bidi and register M4 process as a slave. Along the
1042 way, clean up file name conflict handling, which was affected by
1043 the broken-pipe problem before the switch.
1044 * NEWS (2.4.2): Document.
1045 * THANKS (Didier Godefroy): Add.
1046 * bootstrap.conf (gnulib_modules): Add pipe.
1047 * gnulib: Update to latest to make sure we have all the latest
1048 fixes.
1049 * lib/local.mk (lib_libbison_a_SOURCES): Remove subpipe.h and
1050 subpipe.c.
1051 * po/POTFILES.in (lib/subpipe.c): Remove.
1052 * src/files.c (compute_output_file_names): Update invocations
1053 of output_file_name_check.
1054 (output_file_name_check): In the case that the grammar file
1055 would be overwritten, use complain instead of fatal, but replace
1056 the output file name with /dev/null. Use the /dev/null solution
1057 for the case of two conflicting output files as well because it
1058 seems safer in case Bison one day tries to open both files at
1059 the same time.
1060 * src/files.h (output_file_name_check): Update prototype.
1061 * src/output.c (output_skeleton): Use create_pipe_bidi and
1062 wait_subprocess. Assert that scan_skel completely drains the
1063 pipe.
1064 * src/scan-skel.l (at_directive_perform): Update
1065 output_file_name_check invocation.
1066 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Check that the
1067 grammar file actually isn't overwritten.
1068 (Conflicting output files: -o foo.y): Update expected output.
1069 * tests/skeletons.at (Fatal errors but M4 continues producing
1070 output): New test group.
1071
10722010-02-04 Joel E. Denny <jdenny@ces.clemson.edu>
1073
1074 Update POTFILES.
1075 * HACKING (Release Procedure): Add reminder about keeping
1076 POTFILES files up-to-date.
1077 * po/POTFILES.in (src/muscle-tab.c, src/scan-skel.l): Add.
1078
10792010-02-01 Joel E. Denny <jdenny@clemson.edu>
1080
1081 Code cleanup.
1082 * tests/atlocal.in (abs_top_srcdir): Remove shell variable,
1083 which is already defined in atconfig.
1084
10852010-01-22 Joel E. Denny <jdenny@clemson.edu>
1086
1087 tests: fix missing include caught by g++ 4.4.1.
1088 Reported by Tys Lefering.
1089 * HACKING (Release checks): Add note about trying a recent GCC.
1090 * tests/regression.at (_AT_DATA_DANCER_Y): For C++, include
1091 cstdlib for abort.
1092 (_AT_DATA_EXPECT2_Y): Likewise.
1093
10942010-01-21 Joel E. Denny <jdenny@clemson.edu>
1095
1096 * cfg.mk (gnulib_dir): Assume gnulib is a subdirectory.
1097
10982010-01-21 Joel E. Denny <jdenny@clemson.edu>
1099
1100 maint: automate PACKAGE_COPYRIGHT_YEAR update, and update it.
1101 * HACKING (Release Procedure): Update notes on copyright years.
1102 * Makefile.am (update-package-copyright-year): New target rule.
1103 * build-aux/update-package-copyright-year: New file.
1104 * cfg.mk (update-copyright): Add update-package-copyright-year
1105 as a dependency.
1106
11072010-01-19 Joel E. Denny <jdenny@clemson.edu>
1108
1109 * bootstrap: Import improvements from latest gnulib.
1110
11112010-01-19 Joel E. Denny <jdenny@clemson.edu>
1112
1113 build: require Automake 1.11.1 to avoid a security flaw.
1114 * HACKING (Release Procedure): Don't document Automake security
1115 flaw here.
1116 * configure.ac (AM_INIT_AUTOMAKE): Require 1.11.1, and explain
1117 why here.
1118
11192010-01-19 Joel E. Denny <jdenny@clemson.edu>
1120
1121 gnulib: update to latest.
1122
11232010-01-19 Joel E. Denny <jdenny@clemson.edu>
1124
1125 ChangeLog (2006-09-15): add Odd Arild Olsen's role for push.c.
1126
11272010-01-15 Joel E. Denny <jdenny@clemson.edu>
1128
1129 Thank the developer of the initial push parser implementation.
1130 This unfortunate oversight is several years old.
1131 * THANKS (Odd Arild Olsen): Add.
1132
11332010-01-04 Joel E. Denny <jdenny@clemson.edu>
1134
1135 Fix some comments concerning LR(0) versus LALR(1).
1136
1137 Stop equating LR(0) with nondeterminism and LALR(1) with
1138 determinism. That is, if all states are consistent, then LR(0)
1139 tables are deterministic. On the other hand, LALR(1) tables
1140 might be nondeterministic before conflict resolution, and GLR
1141 permits LALR(1) tables to remain nondeterministic.
1142 * src/LR0.c, src/LR0.h: Here.
1143 * src/lalr.c, src/lalr.h: Here.
1144 * src/main.c (main): Here.
1145 * src/state.c, src/state.h: Here.
1146
1147 * src/ielr.h (ielr): In preconditions, expect LR(0) not LALR(1)
1148 parser tables.
1149
11502010-01-04 Joel E. Denny <jdenny@clemson.edu>
1151
1152 maint: run "make update-copyright"
1153
11542009-12-30 Joel E. Denny <jdenny@clemson.edu>
1155
1156 POSIX: complain if %prec's token was not defined.
1157 * NEWS (2.5): Document.
1158 * src/reader.c (grammar_rule_check): Convert warning to
1159 complaint.
1160 * tests/input.at (%prec's token must be defined): Update.
1161
11622009-12-30 Joel E. Denny <jdenny@clemson.edu>
1163
1164 POSIX: warn if %prec's token was not defined.
1165 Reported by Florian Krohm at
1166 <http://lists.gnu.org/archive/html/bug-bison/2009-12/msg00005.html>.
1167 * NEWS (2.4.2): Document.
1168 * src/reader.c (grammar_rule_check): Implement.
1169 (grammar_current_rule_prec_set): Add comments explaining that we
1170 here assume a %prec identifier is a token, but we still manage
1171 to support POSIX.
1172 * tests/input.at (%prec's token must be defined): New test
1173 group.
1174
11752009-12-31 Joel E. Denny <jdenny@clemson.edu>
1176
1177 * HACKING (Release Procedure): Recommend a secure automake.
1178
11792009-12-29 Joel E. Denny <jdenny@clemson.edu>
1180
1181 portability: `<' and `>' are not always defined on addresses.
1182 Specifically, don't sort objects by their memory addresses when
1183 they're not allocated in the same array or other object. Though
1184 I haven't found a test case where that fails on my platform, C
1185 says the behavior is undefined.
1186 * src/AnnotationList.c (AnnotationList__insertInto): Remove
1187 FIXME. Use new id field of InadequacyList nodes rather than
1188 their memory addresses when sorting.
1189 (AnnotationList__compute_from_inadequacies): Add
1190 inadequacy_list_node_count argument to pass to
1191 InadequacyList__new_conflict.
1192 * src/AnnotationList.h
1193 (AnnotationList__compute_from_inadequacies): Update prototype
1194 and documentation for new argument.
1195 * src/InadequacyList.c (InadequacyList__new_conflict): Add
1196 node_count argument and use it to assign a unique ID.
1197 * src/InadequacyList.h (InadequacyListNodeCount): New typedef.
1198 (InadequacyList): Add id field.
1199 (InadequacyList__new_conflict): Update prototype and
1200 documentation for new argument.
1201 * src/ielr.c (ielr_compute_annotation_lists): Update
1202 AnnotationList__compute_from_inadequacies invocation.
1203
12042009-12-20 Joel E. Denny <jdenny@clemson.edu>
1205
1206 Fix handling of yychar manipulation in user semantic actions.
1207 The problem was that yacc.c didn't always update the yychar
1208 translation afterwards. However, other skeletons appear to be
1209 fine. glr.c appears to already translate yychar before every
1210 use. lalr1.cc does not define yychar and does not document its
1211 replacement, yyla, for users. It does provide yyclearin, but
1212 that does not manipulate yyla and thus requires no translation
1213 update. In lalr1.java, yychar is out of scope during semantic
1214 actions.
1215 * NEWS (2.5): Document.
1216 * data/yacc.c (YYBACKUP): Don't bother translating yychar into
1217 yytoken here.
1218 (yyparse, yypush_parse): Instead, translate before every use of
1219 yytoken, and add comments explaining this approach.
1220 * tests/actions.at (Destroying lookahead assigned by semantic
1221 action): New test group checking that translation happens before
1222 lookahead destructor calls at parser return. Previously,
1223 incorrect destructors were called.
1224 * tests/conflicts.at (parse.error=verbose and consistent
1225 errors): New test group checking that translation happens at
1226 syntax error detection before the associated verbose error
1227 message and the associated lookahead destructor calls. While
1228 the destructor call is fixed by this patch, the verbose error
1229 message is currently incorrect due to another bug (see
1230 comments in test group), so this is an expected failure for now.
1231
12322009-12-21 Joel E. Denny <jdenny@clemson.edu>
1233
1234 YYFAIL: warn about uses and remove from lalr1.java.
1235 * NEWS (2.5): Document.
1236 * data/lalr1.java (YYParser::YYFAIL): Rename to YYERRLAB,
1237 and make it private. Update all uses.
1238 * src/scan-code.l (SC_RULE_ACTION): Implement warning.
1239
12402009-12-21 Joel E. Denny <jdenny@clemson.edu>
1241
1242 YYFAIL: deprecate.
1243 * NEWS (2.4.2): Document deprecation and the phase-out plan.
1244 * data/lalr1.java (YYParser::YYFAIL): Add comment about
1245 deprecation.
1246 * data/yacc.c (YYFAIL): Likewise, and suppress warnings about
1247 YYFAIL from GCC cpp's -Wunused-macros.
1248 * doc/bison.texinfo (Java Action Features): Remove YYFAIL
1249 documentation.
1250 (LocalWords): Remove YYFAIL.
1251
12522009-12-20 Joel E. Denny <jdenny@clemson.edu>
1253
1254 tests: cleanup.
1255 * tests/c++.at (Syntax error discarding no lookahead): Don't
1256 ignore stderr. Instead, eliminate remaining warnings.
1257
12582009-12-18 Joel E. Denny <jdenny@clemson.edu>
1259
1260 lalr1.cc: don't discard non-existent lookahead on syntax error.
1261 * data/lalr1.cc (yy::parser::parse): Check yyempty first.
1262 * tests/c++.at (Syntax error discarding no lookahead): New test
1263 group.
1264
12652009-12-17 Joel E. Denny <jdenny@clemson.edu>
1266
1267 Code cleanup.
1268 * src/symtab.c, src/symtab.h (symbol_class_get_string): Remove
1269 function, which is no longer used.
1270
12712009-12-16 Joel E. Denny <jdenny@clemson.edu>
1272
1273 Add gcc's -Wundef to test suite and fix another warning from it.
1274 * NEWS (2.4.2): Update description of -Wundef fix.
1275 * configure.ac (WARN_CXXFLAGS_TEST): New substitution.
1276 (WARN_CFLAGS_TEST): New substitution.
1277 * data/glr.c: Avoid warning about __STRICT_ANSI__.
1278 * tests/atlocal.in (CFLAGS): Use WARN_CFLAGS_TEST instead of
1279 WARN_CFLAGS.
1280 (NO_WERROR_CFLAGS): Likewise.
1281 (CXXFLAGS): Use WARN_CXXFLAGS_TEST instead of WARN_CXXFLAGS.
1282
12832009-12-16 Joel E. Denny <jdenny@clemson.edu>
1284
1285 * data/yacc.c: Reformat m4 a little.
1286
12872009-12-16 Joel E. Denny <jdenny@clemson.edu>
1288
1289 Document gcc -Wundef fix.
1290 * NEWS (2.4.2): Here.
1291 * THANKS (Jonathan Nieder): Add.
1292
12932009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
1294
1295 Simplify y.tab.c when location tracking is disabled.
1296 * data/yacc.c: Do not check YYLTYPE_IS_TRIVIAL if location
1297 tracking is not enabled. Instead, unconditionally define
1298 YY_LOCATION_PRINT as a no-op for backward compatibility.
1299
13002009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
1301
1302 Avoid warnings from gcc -Wundef y.tab.c.
1303 * data/glr.c: Check if YYENABLE_NLS and YYLTYPE_IS_TRIVIAL are
1304 defined before using them.
1305 * data/lalr1.cc: Likewise.
1306 * data/yacc.c: Likewise.
1307
13082009-12-15 Joel E. Denny <jdenny@clemson.edu>
1309
1310 autoconf: update to latest for fix of M4 detection.
1311 Reported by Eric Blake.
1312 * submodules/autoconf: Update.
1313
13142009-12-15 Joel E. Denny <jdenny@clemson.edu>
1315
1316 portability: use -DGNULIB_POSIXCHECK.
1317 Reported by Eric Blake. See discussions at
1318 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00008.html>
1319 and
1320 <http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00108.html>.
1321 * HACKING (Release checks): Suggest -DGNULIB_POSIXCHECK.
1322 * bootstrap.conf (gnulib_modules): Add all the printf modules
1323 suggested by -DGNULIB_POSIXCHECK. Add realloc-posix as
1324 suggested by -DGNULIB_POSIXCHECK for gnulib's own vasnprintf.c.
1325 (excluded_files): Remove m4/printf-posix.m4.
1326 * tests/atlocal.in (LIBS): As for LDADD in src/local.mk, add
1327 lib/libbison.a so gnulib libraries can be linked.
1328
13292009-12-15 Joel E. Denny <jdenny@clemson.edu>
1330
1331 gnulib: update for fix of fprintf-posix, which we'll use soon.
1332 * etc/prefix-gnulib-mk (prefix): Adjust regex for make file
1333 targets so that gnulib's new arg-nonnull.h and link-warning.h
1334 are matched.
1335 * gnulib: Update.
1336
13372009-12-14 Joel E. Denny <jdenny@clemson.edu>
1338
1339 Enable assertion output and --disable-assert for configure.
1340 * bootstrap.conf (gnulib_modules): Add assert module.
1341 * src/system.h (aver): Define as assert, and summarize the
1342 discussion on this issue.
1343
13442009-12-14 Joel E. Denny <jdenny@clemson.edu>
1345
1346 Expand GLR acronym in summary of Bison.
1347 Based on discussion with Akim Demaille starting at
1348 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00087.html>.
1349 * doc/bison.texinfo (Introduction): Here.
1350 * src/getargs.c (usage): Here.
1351
13522009-10-03 Alex Rozenman <rozenman@gmail.com>
1353
1354 Document named references.
1355 * doc/bison.texinfo (Actions): Add new example and xref to
1356 Using Named References node.
1357 (Using Named References): New node.
1358
13592009-10-16 Joel E. Denny <jdenny@clemson.edu>
1360
1361 cleanup.
1362 * src/Sbitset.c (Sbitset__new_on_obstack): Use Sbitset instead
1363 of char*.
1364 (Sbitset__isEmpty): Use Sbitset instead of char*.
1365 * src/Sbitset.h (Sbitset): Make it a pointer to unsigned char
1366 instead of char. This helps to avoid casting errors.
1367 (Sbitset__or): Use Sbitset instead of char*.
1368
13692009-10-16 Joel E. Denny <jdenny@clemson.edu>
1370
1371 portability: don't assume 8-bit bytes.
1372 That is, use CHAR_BIT and UCHAR_MAX instead of 8 and 0xff.
1373 * src/Sbitset.h (Sbitset__nbytes): Here.
1374 (Sbitset__byteAddress): Here.
1375 (Sbitset__bit_mask): Here.
1376 (Sbitset__last_byte_mask): Here.
1377 (Sbitset__ones): Here.
1378 (SBITSET__FOR_EACH): Here.
1379
13802009-10-11 Joel E. Denny <jdenny@clemson.edu>
1381
1382 portability: use va_start and va_end in the same function.
1383 * src/complain.c (error_message): Move va_end from here...
1384 (ERROR_MESSAGE): ... to here.
1385
13862009-10-08 Joel E. Denny <jdenny@clemson.edu>
1387
1388 * data/bison.m4: Update comments for rename to muscle-tab.h.
1389
13902009-10-07 Joel E. Denny <jdenny@clemson.edu>
1391
1392 Minor code cleanup.
1393 * src/muscle-tab.c (MUSCLE_USER_NAME_CONVERT): Remove macro and
1394 replace all uses with UNIQSTR_CONCAT.
1395 * src/uniqstr.c (uniqstr_vsprintf): New function.
1396 * src/uniqstr.h (uniqstr_vsprintf): Add prototype.
1397 (UNIQSTR_CONCAT, UNIQSTR_GEN_FORMAT, UNIQSTR_GEN_FORMAT_): New
1398 macros.
1399
14002009-10-06 Joel E. Denny <jdenny@clemson.edu>
1401
1402 * TODO (Complaint submessage indentation): New.
1403
14042009-10-04 Joel E. Denny <jdenny@clemson.edu>
1405
1406 Minor code cleanup.
1407 * src/parse-gram.y: Clean up sorting of declarations.
1408 Use types to simplify %printer declarations where possible.
1409 Provide %printer for BRACKETED_ID and symbol.prec.
1410 * src/symtab.c: Whitespace change.
1411
14122009-10-04 Joel E. Denny <jdenny@clemson.edu>
1413
1414 tests: skip tests of file names that platform does not support.
1415 Reported by Michael Raskin at
1416 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00001.html>.
1417 * THANKS (Michael Raskin): Add.
1418 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Fix. Cygwin used
1419 to fail at least for file names containing ":" or "\".
1420
14212009-09-23 Joel E. Denny <jdenny@clemson.edu>
1422
1423 yysyntax_error: avoid duplicate lookahead collection.
1424 Except when memory reallocation is required, this change
1425 eliminates the need to invoke yysyntax_error twice and thus to
1426 repeat the collection of lookaheads. It also prepares for
1427 future extensions that will make those repetitions more
1428 expensive and that will require additional memory management in
1429 yysyntax_error. Finally, it fixes an obscure bug already
1430 exercised in the test suite.
1431 * data/yacc.c (yysyntax_error): Add arguments for message
1432 buffer variables stored in the parser. Instead of size, return
1433 status similar to yyparse status but indicating success of
1434 message creation. Other than the actual reallocation of the
1435 message buffer, import and clean up memory management code
1436 from...
1437 (yyparse, yypush_parse): ... here.
1438 * tests/regression.at (parse.error=verbose overflow): No longer
1439 an expected failure.
1440
14412009-09-23 Joel E. Denny <jdenny@clemson.edu>
1442
1443 yysyntax_error: test memory management more.
1444 * tests/atlocal.in (NO_WERROR_CFLAGS): New cpp macro.
1445 * tests/regression.at (parse.error=verbose and
1446 YYSTACK_USE_ALLOCA): New test group.
1447 (parse.error=verbose overflow): New test group that reveals an
1448 obscure bug. Expected fail for now.
1449
14502009-10-04 Joel E. Denny <jdenny@clemson.edu>
1451
1452 benchmarks: use %debug consistently among grammars.
1453 * etc/bench.pl.in (generate_grammar_triangular): Do not activate
1454 %debug by default. It can affect the timings even if yydebug=0.
1455 (generate_grammar_calc): For consistency with other grammars,
1456 use YYDEBUG environment variable to set yydebug.
1457
14582009-10-03 Joel E. Denny <jdenny@clemson.edu>
1459
1460 Remove dead code.
1461 * src/symtab.c (symbol_pack): Here because every symbol's number
1462 is always defined by this time.
1463
14642009-10-03 Alex Rozenman <rozenman@gmail.com>
1465
1466 Add additional space after periods in NEWS.
1467 * NEWS (2.5): here.
1468
14692009-09-29 Joel E. Denny <jdenny@clemson.edu>
1470
1471 Use the correct conversion specifier for size_t.
1472 Reported by Jim Meyering.
1473 * src/Sbitset.h (SBITSET__INDEX__CONVERSION_SPEC): New, "zu"
1474 because Sbitset__Index is size_t.
1475 * src/Sbitset.c (Sbitset__fprint): Use it instead of %d.
1476
14772009-09-27 Joel E. Denny <jdenny@clemson.edu>
1478
1479 tests: don't abuse AT_BISON_CHECK.
1480 * tests/regression.at (parse-gram.y: LALR = IELR): Move
1481 additional shell commands outside of AT_BISON_CHECK.
1482
14832009-09-26 Joel E. Denny <jdenny@clemson.edu>
1484
1485 tests: check that parse-gram.y's IELR and LALR are identical.
1486 * tests/atlocal.in (abs_top_srcdir): New shell variable.
1487 * tests/regression.at (parse-gram.y: LALR = IELR): New test
1488 group.
1489
14902009-09-19 Alex Rozenman <rozenman@gmail.com>
1491
1492 Keep sub-messages aligned. Fix strings for translation.
1493 * src/location.h (location_print): Add return value.
1494 * src/location.c (location_print): Return number of printed
1495 characters.
1496 * src/complain.h (complain_at_indent, warn_at_indent): Prototype
1497 new functions.
1498 * src/complain.cpp (indent_ptr): New static variable.
1499 (error_message, complain_at_indent, warn_at_indent): Implement
1500 the alignment mechanism.
1501 * src/scan-code.l (parse_ref, show_sub_messages): Fix strings
1502 for translations. Use new alignment mechanism.
1503 * tests/named-ref.at: Adjust test-cases.
1504 * NEWS (2.5): Add an announcement about named references.
1505
15062009-09-17 Akim Demaille <demaille@gostai.com>
1507
1508 doc: fixes.
1509 * doc/bison.texinfo: here.
1510 Reported by Alex Rozenman.
1511
15122009-09-16 Akim Demaille <demaille@gostai.com>
1513
1514 doc: lalr1.cc and variants.
1515 * doc/bison.texinfo (Decl Summary): Document the "lex_symbol" and
1516 "variant" %define variables.
1517 (C++ Semantic Values): Split into...
1518 (C++ Unions, C++ Variants): these.
1519 The latter is new.
1520 (C++ Parser Interface): Fix type names.
1521 Document parser::syntax_error.
1522 Document the fact that locations are not mandatory.
1523 (C++ Scanner Interface): Split into...
1524 (Split Symbols, Complete Symbols): these.
1525 The later is new.
1526 (Calc++ Parsing Driver): Use variants.
1527 Add more comments.
1528 Adjust style.
1529 (Calc++ Parser): Declare all the tokens, no
1530 longer accept raw characters.
1531 Remove %union.
1532 Adjust types and printers.
1533 Remove destructors.
1534 (Calc++ Scanner): Use make_<SYMBOL> functions.
1535 Use strerror in error message.
1536
15372009-09-16 Akim Demaille <demaille@gostai.com>
1538
1539 doc: spell checking.
1540 * doc/bison.texinfo: here.
1541
15422009-09-16 Akim Demaille <demaille@gostai.com>
1543
1544 doc: comment changes.
1545 * doc/bison.texinfo: Comment changes.
1546
15472009-09-16 Akim Demaille <demaille@gostai.com>
1548
1549 lalr1.cc: factor the yytranslate_ invocation in make_SYMBOLS.
1550 * data/c++.m4, data/lalr1.cc (parser::symbol_type): Change the
1551 constructor to take a token_type instead of the (internal) symbol
1552 number.
1553 Call yytranslate_.
1554 * data/variant.hh (b4_symbol_constructor_define_): Therefore,
1555 don't call yytranslate_ here.
1556
15572009-09-16 Akim Demaille <demaille@gostai.com>
1558
1559 TODO: statistics.
1560 * TODO (Figures): New.
1561
15622009-09-13 Joel E. Denny <jdenny@clemson.edu>
1563
1564 tests: clean up push.at test group titles.
1565 * tests/push.at: Remove "Push Parsing: " from test group titles
1566 because these are already under the banner "Push Parsing Tests".
1567
15682009-09-12 Alex Rozenman <rozenman@gmail.com>
1569
1570 Provide an additional sub-message for clarity.
1571 Add "symbol not found in production" error message when
1572 an "invalid reference" is detected in named references
1573 resolution.
1574 * src/scan-code.l: Update "invalid reference" case.
1575 * tests/named-ref.at: Adjust test-cases.
1576
15772009-09-10 Joel E. Denny <jdenny@clemson.edu>
1578
1579 Clean up yacc.c a little.
1580 * data/yacc.c: Clean up M4 for readability, and make output
1581 whitespace more consistent. For the main parse function
1582 comment, instead of saying "yyparse or yypush_parse", say either
1583 "yyparse" or "yypush_parse" depending on which it actually is.
1584
15852009-09-10 Joel E. Denny <jdenny@clemson.edu>
1586
1587 Fix --enable-gcc-warnings.
1588 * src/parse-gram.y (%printer <param>): Handle param_none.
1589
15902009-09-09 Akim Demaille <demaille@gostai.com>
1591
1592 lalr1.cc: syntax_error as exceptions.
1593 It is common to use sort of factories in the user actions. These
1594 factories may check some "syntactic" constraints that are not
1595 enforced by the grammar itself. This is possible using YYERROR
1596 within the action itself. Provide the user with a means to throw
1597 a syntax_error exception.
1598
1599 * data/c++.m4 (b4_public_types_declare, b4_public_types_define):
1600 Declare and define yy::parser::syntax_error.
1601 * data/lalr1.cc: Include stdexcept.
1602 (yy::parser::parse): Wrap the user action within a try/catch.
1603 * data/glr.cc: Include stdexcept.
1604
16052009-09-09 Akim Demaille <demaille@gostai.com>
1606
1607 lalr1.cc: add missing "inline".
1608 * data/c++.m4 (b4_public_types_define): Add missing inline to
1609 implementations provided in headers.
1610
16112009-09-09 Akim Demaille <demaille@gostai.com>
1612
1613 %param: documentation.
1614 * NEWS (2.6): Document %param, %lex-param, and %parse-param
1615 changes.
1616 * doc/bison.texinfo: Document that %lex-param and %parse-param
1617 are n-ary.
1618 Changes some examples to demonstrate it.
1619 (Calc++ Parser): Use %param.
1620
16212009-09-09 Akim Demaille <demaille@gostai.com>
1622
1623 Regen.
1624
16252009-09-09 Akim Demaille <demaille@gostai.com>
1626
1627 style changes.
1628 * src/parse-gram.y (add_param): Scope changes.
1629
16302009-09-09 Akim Demaille <demaille@gostai.com>
1631
1632 %parse: support several arguments.
1633 * src/parse-gram.y (current_param): New.
1634 (param_type): Add param_none.
1635 (params): New nonterminal.
1636 Use it.
1637
16382009-09-09 Akim Demaille <demaille@gostai.com>
1639
1640 Regen.
1641
16422009-09-09 Akim Demaille <demaille@gostai.com>
1643
1644 %param.
1645 Provide a means to factor lex-param and parse-param common
1646 declarations.
1647
1648 * src/parse-gram.y (param_type): New.
1649 Define a %printer for it.
1650 (add_param): Use it.
1651 (%parse-param, %lex-param): Merge into...
1652 (%parse): this new token.
1653 Adjust the grammar to use it.
1654 * src/scan-gram.l (RETURN_VALUE): New.
1655 (RETURN_PERCENT_FLAG): Use it.
1656 (RETURN_PERCENT_PARAM): New.
1657 Use it to support %parse-param, %lex-param and %param.
1658
16592009-09-03 Joel E. Denny <jdenny@clemson.edu>
1660
1661 Use aver not assert.
1662 * src/output.c: Don't include assert.h.
1663 (output_skeleton): Use aver not assert.
1664 * src/system.h (aver): In documentation of why, add links to
1665 Paul Eggert's explanations in the mailing lists.
1666
16672009-09-05 Alex Rozenman <rozenman@gmail.com>
1668
1669 Use "Unresolved reference" error message when no symbols were found
1670 in a symbolic reference resolution. Remove .expr and -expr from
1671 the shown reference when the reference is unresolved.
1672 * src/scan-code.l: Change the error message, adjust location columns,
1673 rename variable "exact_mode" to "explicit_bracketing".
1674 * tests/named-ref.at: Adjust existing tests and add a new one.
1675
16762009-09-04 Akim Demaille <demaille@gostai.com>
1677
1678 Adjust synclines in src/parse-gram.[ch].
1679 * tests/bison.in: Do some magic (including working around issues
1680 with ylwrap) when this wrapper is used to compile
1681 src/parse-gram.y.
1682
16832009-09-03 Joel E. Denny <jdenny@clemson.edu>
1684
1685 Complain about unused %define variables and %code qualifiers.
1686 * NEWS (2.5): Document.
1687 * data/bison.m4 (b4_check_user_names): Complain instead of warn.
1688 * doc/bison.texinfo (Decl Summary): Document complaint, and
1689 improve %define documentation a little otherwise.
1690 * tests/input.at (Reject unused %code qualifiers): Update.
1691 (%define errors): Update.
1692 (%define, --define, --force-define): Update.
1693 (%define backward compatibility): Update.
1694 (Unused %define api.pure): Update.
1695 * tests/push.at (Push Parsing: Unsupported Skeletons): Update.
1696
16972009-09-03 Joel E. Denny <jdenny@clemson.edu>
1698
1699 Don't suppress warnings about unused parse.error.
1700 * data/bison.m4 (b4_error_verbose_flag): Don't examine value of
1701 %define variable parse.error unless b4_error_verbose_flag is
1702 actually expanded in a skeleton.
1703
17042009-09-03 Akim Demaille <demaille@gostai.com>
1705
1706 * NEWS (2.4.2): Add "Internationalization" item.
1707
17082009-09-03 Akim Demaille <demaille@gostai.com>
1709
1710 bootstrap: fix/improve find_tool.
1711 * bootstrap (find_tool): Improve error messages.
1712 Fix typo about find_tool_names.
1713
17142009-08-29 Joel E. Denny <jdenny@clemson.edu>
1715
1716 Fix gcc 3.4.4 shadowing warning reported by Eric Blake.
1717 See
1718 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00093.html>.
1719 * src/scan-code.h (code_props_rule_action_init): Rename
1720 named_ref arg to name so it doesn't shadow named_ref type. This
1721 makes it consistent with the function definition in scan-code.l
1722 anyway.
1723
17242009-08-28 Joel E. Denny <jdenny@clemson.edu>
1725
1726 %define: accept unquoted values.
1727 * NEWS (2.5): Group all %define changes together, and document
1728 this one. Remove quotes in IELR and canonical LR entry.
1729 * doc/bison.texinfo: Remove quotes in most examples throughout.
1730 (Decl Summary): Update %define documentation.
1731 (Table of Symbols): Likewise.
1732 * src/ielr.c (LrType): Update documentation.
1733 * src/parse-gram.y (content.opt): Add production for ID.
1734 * tests/actions.at: Remove quotes in most tests.
1735 * tests/calc.at: Likewise.
1736 * tests/existing.at: Likewise.
1737 * tests/input.at: Likewise.
1738 * tests/local.at: Likewise.
1739 * tests/push.at: Likewise.
1740 * tests/reduce.at: Likewise.
1741 * tests/torture.at: Likewise.
1742
17432009-08-28 Joel E. Denny <jdenny@clemson.edu>
1744
1745 %define lr.type: make values lowercase IDs.
1746 That is, "LALR" => "lalr", "IELR" => "ielr", and
1747 "canonical LR" => "canonical-lr".
1748 * NEWS (2.5): Update documentation.
1749 * doc/bison.texinfo (Decl Summary): Likewise.
1750 * src/ielr.c (ielr): Use new values.
1751 * src/ielr.h (ielr): Update documentation.
1752 * src/reader.c (prepare_percent_define_front_end_variables): Use
1753 and validate new values.
1754 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): Update test
1755 grammars.
1756 * tests/reduce.at (AT_TEST_LR_TYPE): Likewise.
1757
17582009-08-27 Eric Blake <ebb9@byu.net>
1759
1760 scan-gram: avoid portability trap with ctype usage.
1761 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
1762 Avoid compiler warning.
1763
17642009-08-27 Joel E. Denny <jdenny@clemson.edu>
1765
1766 tests: use perl for printing special sequences to files.
1767 And skip tests if perl is not available. This is better than
1768 playing tricks with shell portability. Suggested by Akim
1769 Demaille.
1770 * tests/input.at (Bad character literals): Use it here for
1771 omitting final newlines.
1772 (Bad escapes in literals): Use it here for special characters.
1773
17742009-08-26 Joel E. Denny <jdenny@clemson.edu>
1775
1776 tests: show a use of %define lr.default-reductions "consistent"
1777 * tests/conflicts.at (%nonassoc and eof): Extend to test that it
1778 prevents the omission of expected tokens for %error-verbose.
1779
17802009-08-26 Akim Demaille <demaille@gostai.com>
1781
1782 tests: portability fix.
1783 * tests/input.at (Bad escapes in literals): Don't expect "echo
1784 '\0'" to output \ then 0.
1785
17862009-08-26 Joel E. Denny <jdenny@clemson.edu>
1787
1788 Actually handle the yytable zero value correctly this time.
1789 * data/bison.m4 (b4_integral_parser_tables_map): Don't mention
1790 zero values in the YYTABLE comments.
1791 * data/glr.c (yytable_value_is_error): Don't check for zero
1792 value.
1793 * data/lalr1.cc (yy_table_value_is_error_): Likewise.
1794 * data/yacc.c (yytable_value_is_error): Likewise.
1795 * data/lalr1.java (yy_table_value_is_error_): Likewise.
1796 (yysyntax_error): Fix typo in code: use yytable_ not yycheck_.
1797 * src/tables.h: In header comments, explain why it's useless to
1798 check for a zero value in yytable.
1799
18002009-08-25 Joel E. Denny <jdenny@clemson.edu>
1801
1802 More fixes related to last two patches.
1803 * data/bison.m4 (b4_integral_parser_tables_map): Fix YYTABLE
1804 comments: zero indicates syntax error not default action.
1805 * data/c.m4 (b4_table_value_equals): Comment that YYID must be
1806 defined.
1807 * data/glr.c (yyis_pact_ninf): Rename to...
1808 (yypact_value_is_default): ... this.
1809 (yyisDefaultedState): Update for rename.
1810 (yyis_table_ninf): Rename to...
1811 (yytable_value_is_error): ... this, and check for value zero
1812 besides just YYTABLE_NINF.
1813 (yygetLRActions): Check for default value from yypact. It
1814 appears that this check is always performed before this function
1815 is invoked, and so adding the check here is probably redundant.
1816 However, the code may evolve after this subtlety is forgotten.
1817 Also, update for rename to yytable_value_is_error. Because that
1818 macro now checks for zero, a different but equivalent branch of
1819 the if-then-else here is evaluated.
1820 (yyreportSyntaxError): Update for rename to
1821 yytable_value_is_error. The zero condition was mishandled
1822 before.
1823 (yyrecoverSyntaxError): Update for renames. No behavioral
1824 changes.
1825 * data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_):
1826 New function.
1827 (yy_table_value_is_error_): New function.
1828 (parse): Use new functions where possible. No behavioral
1829 changes.
1830 (yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_.
1831 The zero condition was mishandled before.
1832 * data/yacc.c (yyis_pact_ninf): Rename to...
1833 (yypact_value_is_default): ... this.
1834 (yyis_table_ninf): Rename to...
1835 (yytable_value_is_error): ... this, and check for value zero
1836 besides just YYTABLE_NINF.
1837 (yysyntax_error): Update for rename to yytable_value_is_error.
1838 The zero condition was mishandled before.
1839 (yyparse): Update for renames. No behavioral changes.
1840 * src/tables.h: Improve comments about yypact, yytable, etc.
1841 more. Most importantly, say yytable value of zero means syntax
1842 error not default action.
1843
18442009-08-25 Joel E. Denny <jdenny@clemson.edu>
1845
1846 Fix %error-verbose for conflicts resolved by %nonassoc.
1847 * NEWS (2.5): Document.
1848 * data/glr.c (yyreportSyntaxError): Fix this by checking
1849 yyis_table_ninf.
1850 * data/yacc.c (yysyntax_error): Likewise.
1851 * data/lalr1.cc (yysyntax_error_): Fix this by checking
1852 yytable_ninf_.
1853 * data/lalr1.java (yysyntax_error): Likewise.
1854 * tests/conflicts.at (%nonassoc and eof): Update expected output
1855 and remove FIXME.
1856
18572009-08-25 Joel E. Denny <jdenny@clemson.edu>
1858
1859 Some code and documentation improvements.
1860 * data/c.m4 (b4_table_value_equals): New macro to capture
1861 some repeated code.
1862 * data/glr.c (yyis_pact_ninf): Use it here.
1863 (yyis_table_ninf): Likewise.
1864 (yyreportSyntaxError): Improve internal comments.
1865 * data/yacc.c (yyis_pact_ninf): New macro copied from glr.c.
1866 Use it everywhere possible.
1867 (yyis_table_ninf): Likewise.
1868 (yysyntax_error): Improve internal comments.
1869 * data/lalr1.cc (yysyntax_error_): Likewise.
1870 * data/lalr1.java (yysyntax_error): Likewise.
1871 * src/tables.h: Improve comments about yypact, yytable, etc.
1872
18732009-08-21 Joel E. Denny <jdenny@clemson.edu>
1874
1875 Use locale when quoting.
1876 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
1877 quote rather than implementing quoting here.
1878
18792009-08-20 Eric Blake <ebb9@byu.net>
1880
1881 Make previous patch more robust.
1882 * src/output.c (ARRAY_CARDINALITY): New macro, copied from
1883 argmatch.h.
1884 (output_skeleton): Use it.
1885 Suggested by Akim Demaille.
1886
1887 Import latest m4/m4.m4.
1888 * submodules/autoconf: Update to autoconf 2.64.
1889 * configure.ac (M4_GNU_OPTION): New define.
1890 * src/output.c (output_skeleton): Use it to resolve FIXME.
1891 * NEWS: Mention this.
1892
18932009-08-19 Joel E. Denny <jdenny@clemson.edu>
1894
1895 Fix complaints about escape sequences.
1896 Discussed starting at
1897 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
1898 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
1899 For a \0 and similar escape sequences meaning the null
1900 character, report an invalid escape sequence instead of an
1901 invalid null character because the latter does not actually
1902 appear in the user's input.
1903 In all escape sequence complaints, don't escape the initial
1904 backslash, and don't quote when the sequence appears at the end
1905 of the complaint line unless there's whitespace that quotearg
1906 won't escape.
1907 Consistently say "invalid" not "unrecognized".
1908 Consistently prefer "empty character literal" over "extra
1909 characters in character literal" warning for invalid escape
1910 sequences; that is, consistently discard those sequences.
1911 * tests/input.at (Bad escapes in literals): New.
1912
19132009-08-19 Akim Demaille <demaille@gostai.com>
1914
1915 doc: fixes.
1916 * doc/bison.texinfo: Fix minor Texinfo errors.
1917
19182009-08-19 Akim Demaille <demaille@gostai.com>
1919
1920 tests: distcc compliance.
1921 * tests/synclines.at (AT_SYNCLINES_COMPILE): Discard distcc's
1922 error messages from the output.
1923
19242009-08-19 Akim Demaille <demaille@gostai.com>
1925
1926 variables: simplify the upgrade of namespace into api.namespace.
1927
1928 This patch simplifies "variables: rename namespace as
1929 api.namespace", commit 67501061076ba46355cfd9f9361c7eed861b389c.
1930 Suggested by Joel E. Denny in
1931 http://lists.gnu.org/archive/html/bison-patches/2009-07/msg00006.html
1932
1933 * src/muscle-tab.c (muscle_percent_variable_update): New.
1934 (muscle_percent_define_insert): Use it in replacement of the
1935 previous tr invocation.
1936 Remove variable_tr, no longer needed.
1937 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
1938 Remove.
1939 * data/c++.m4: No longer handle namespace -> api.namespace.
1940 * tests/input.at (%define backward compatibility): Check that
1941 namespace is treated as api.namespace.
1942
19432009-08-19 Akim Demaille <demaille@gostai.com>
1944
1945 doc: %initial-action to initialize yylloc.
1946 Reported by Bill Allombert.
1947 * doc/bison.texinfo: Set fill-column to 76.
1948 (Location Type): Document the use of %initial-action to initialize
1949 yylloc.
1950
19512009-08-19 Akim Demaille <demaille@gostai.com>
1952
1953 lalr1.cc: use state_type.
1954 * data/lalr1.cc (yysyntax_error_): Use state_type.
1955 Move argument names into yy*.
1956
19572009-08-19 Akim Demaille <demaille@gostai.com>
1958
1959 lalr1.cc: get rid of yyparse's yystate.
1960 yystate and yystack_[0].state are equal, keep only the latter.
1961 The former was also used as a temporary variable to compute the
1962 post-reduction state. Move this computation into an auxiliary
1963 function.
1964
1965 * data/glr.c (yyLRgotoState): Fuse variable definition and first
1966 assignment.
1967 * data/lalr1.cc (yy_lr_goto_state_): New.
1968 (yyparse): Use it.
1969 Replace remaining uses of yystate by yystate_[0].state.
1970 Remove the former.
1971
19722009-08-19 Akim Demaille <demaille@gostai.com>
1973
1974 lalr1.cc: destroy $$ when YYERROR is called.
1975 * data/lalr1.cc (yyreduce): Compute the resulting state before
1976 running the user action so that yylhs is a valid symbol.
1977 (yyerrorlab): Since yylhs is complete (it knows its type), we can
1978 simply call yy_destroy_ to destroy $$ on YYERROR invocations.
1979 * tests/c++.at (AT_CHECK_VARIANTS): Test YYERROR with variants.
1980
19812009-08-18 Joel E. Denny <jdenny@clemson.edu>
1982
1983 maint: update for gnulib's recent update-copyright changes
1984 * gnulib: Update.
1985 * .x-update-copyright (COPYING): Add as it's no longer implied
1986 when .x-update-copyright is present.
1987 * cfg.mk (update-copyright-local): Remove, now ignored.
1988 (update-copyright): Declare update-b4-copyright as a dependency.
1989
19902009-08-17 Akim Demaille <demaille@gostai.com>
1991
1992 build: require gettext 0.17.
1993
1994 Suggested by Bruno Haible.
1995 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
1996 * configure.ac: require gettext 0.17 to ensure compatibility with
1997 gnulib.
1998
19992009-08-17 Akim Demaille <demaille@gostai.com>
2000
2001 build: lower gettext requirements.
2002
2003 Bison was uselessly requiring the formatstring macros from
2004 gettext, which resulted in mo files not being installed on systems
2005 that perfectly supported Bison mo files. Lower the requirement.
2006 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
2007
2008 * configure.ac: Require need-ngettext instead of
2009 need-formatstring-macros.
2010 Reported by Martin Jabocs.
2011 Suggested by Bruno Haible.
2012 * INSTALL: Restructure.
2013 (Internationalization): New.
2014
20152009-08-14 Joel E. Denny <jdenny@clemson.edu>
2016
2017 maint: fix use of copyright year intervals.
2018 * gnulib: Update.
2019 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
2020 as now recommended in gnulib/NEWS.
2021 * build-aux/update-b4-copyright: Fix.
2022 * cfg.mk (update-copyright-env): Configure update-copyright.
2023
20242009-08-13 Joel E. Denny <jdenny@clemson.edu>
2025
2026 Make it easier to write deterministic tests.
2027 Continues Akim's work from his 2009-06-10 commits.
2028 * src/reader.c (check_and_convert_grammar): Don't add any
2029 symbols after the first symbols_do invocation.
2030 * src/symtab.c (symbols_sorted): New static global.
2031 (user_token_number_redeclaration): Update comments.
2032 (symbol_from_uniqstr): If a new symbol is being created, assert
2033 that symbols_sorted hasn't been allocated yet.
2034 (symbols_free): Free symbols_sorted.
2035 (symbols_cmp, symbols_cmp_qsort): New functions.
2036 (symbols_do): Sort symbol_table into symbols_sorted on first
2037 invocation.
2038 * tests/input.at (Numbered tokens): Recombine tests now that the
2039 output should be deterministic across multiple numbers.
2040
20412009-08-12 Akim Demaille <demaille@gostai.com>
2042
2043 tests: GCC 4.5 compliance.
2044 * tests/synclines.at (AT_SYNCLINES_COMPILE): Adjust to GCC 4.5's
2045 messages about #error.
2046
20472009-08-12 Akim Demaille <demaille@gostai.com>
2048
2049 build: fix the generation of the documentation.
2050 Some of our targets use "bison --help", but they can't depend on
2051 "bison" itself (to avoid additional requirements on the user), so
2052 they used to call "make src/bison" in the commands. Then
2053 concurrent builds may fail: one make might be aiming one of its
2054 jobs at compiling src/bison, and another job at generating the man
2055 page. If the latter is faster than the former, then we have two
2056 makes that concurrently try to compile src/bison.
2057
2058 This might also be a more convincing explanation for the failure
2059 described in the patch "build: fix paths".
2060
2061 * Makefile.am (SUFFIXES): Initialize.
2062 * build-aux/move-if-change: New, symlink to gnulib's.
2063 * build-aux/local.mk: Ship it.
2064 * doc/common.x: Remove, merged into...
2065 * doc/bison.x: here.
2066 * doc/local.mk (doc/bison.help): New.
2067 ($(CROSS_OPTIONS_TEXI)): Depend on it.
2068 Use src/bison.
2069 (.x.1): Replace with...
2070 (doc/bison.1): this explicit, simpler, target.
2071 (common_dep): Remove, inlined where appropriate.
2072 (SUFFIXES, PREPATH): Remove, unused.
2073
20742009-08-12 Akim Demaille <demaille@gostai.com>
2075
2076 gnulib: improve prefixing.
2077 * configure.ac (gl_PREFIXED_LIBOBJS): Don't rename it, rather,
2078 change the value of...
2079 (gl_LIBOBJS): this.
2080 Adjust more variables.
2081 * etc/prefix-gnulib-mk (prefix_assignment): Don't rename
2082 gl_LIBOBJS.
2083 (prefix): Also transform rules whose targets have slashes.
2084 Use $prefix liberally.
2085 Map @MKDIR_P@ to $(MKDIR_P).
2086 Prefix directories that are mkdir'd.
2087
20882009-08-12 Akim Demaille <demaille@gostai.com>
2089
2090 build: fix paths.
2091 When using $(top_builddir) inconsistently, Make (including GNU
2092 Make) is sometimes confused. As a result it may want to build
2093 lib/libbison.la and $(top_builddir)/lib/libbison.la (the same
2094 file, different names) concurrently, which, amusingly enough,
2095 might end with:
2096
2097 ranlib lib/libbison.a
2098 ranlib lib/libbison.a
2099 make[2]: *** [lib/libbison.a] Segmentation fault
2100
2101 on OS X.
2102
2103 * doc/local.mk, src/local.mk: Do not use $(top_builddir) when not
2104 needed.
2105
21062009-08-12 Akim Demaille <demaille@gostai.com>
2107
2108 distcheck: fix.
2109
2110 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
2111
21122009-08-10 Joel E. Denny <jdenny@clemson.edu>
2113
2114 * tests/local.mk (TESTSUITE_AT): Add named-refs.at.
2115
21162009-08-10 Joel E. Denny <jdenny@clemson.edu>
2117
2118 Miscellaneous code readability improvements.
2119
2120 * src/reader.c (reader): Move %define front-end variable
2121 defaults and checking into...
2122 (prepare_percent_define_front_end_variables): ... this new
2123 function.
2124
2125 * src/scan-gram.l (INITIAL): For consistency with string
2126 literals, don't store open quote on character literal. It's
2127 discarded before returning anyway.
2128 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
2129 Make length test more readable, and make the character stored
2130 for an empty literal more obvious while consistent with the
2131 previous behavior.
2132
2133 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
2134 USER_NUMBER_HAS_STRING_ALIAS throughout.
2135 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
2136 that is repeated in symtab.h. Improve argument names to make it
2137 clear which side of the symbol-string alias pair is which.
2138 (symbol_check_alias_consistency): Improve local variable names
2139 for the same purpose.
2140 * src/symtab.h (struct symbol): Make comments about aliases
2141 clearer.
2142 (symbol_make_alias): Improve comments and argument name.
2143 * src/output.c (token_definitions_output): Update for rename to
2144 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
2145
21462009-08-08 Alex Rozenman <rozenman@gmail.com>
2147
2148 Convert "misleading reference" messages to warnings.
2149 * src/scan-code.l: New function 'show_sub_messages', more
2150 factoring.
2151 * tests/named-ref.at: Adjust tests.
2152
21532009-08-06 Joel E. Denny <jdenny@clemson.edu>
2154
2155 maint: run "make update-copyright"
2156
21572009-08-06 Joel E. Denny <jdenny@clemson.edu>
2158
2159 maint: make update-b4-copyright easier to use
2160 * build-aux/update-b4-copyright: In warnings, report line
2161 numbers rather than character positions.
2162 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
2163 that update-copyright runs it.
2164 * gnulib: Update.
2165
21662009-08-05 Joel E. Denny <jdenny@clemson.edu>
2167
2168 maint: clean up update-b4-copyright code
2169 * build-aux/update-b4-copyright: Do not accept 2-digit
2170 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
2171 Don't accept a `[' in a b4_copyright argument.
2172 Format code more consistently.
2173 Don't assume b4*copyright never occurs.
2174
21752009-08-04 Joel E. Denny <jdenny@clemson.edu>
2176
2177 maint: automate b4_copyright updates.
2178 * Makefile.am (update-b4-copyright): New target rule.
2179 * build-aux/local.mk (EXTRA_DIST): Add update-b4-copyright.
2180 * build-aux/update-b4-copyright: New.
2181 * data/yacc.c: Remove stray characters around b4_copyright
2182 invocations.
2183
21842009-08-04 Joel E. Denny <jdenny@clemson.edu>
2185
2186 maint: automate annual package-wide copyright-year update.
2187 * .x-update-copyright: New.
2188 * Makefile.am (EXTRA_DIST): Remove maint.mk.
2189 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
2190 update-copyright. Remove gnumakefile, which is implied by
2191 maintainer-makefile.
2192 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
2193 * gnulib: Update.
2194 * maint.mk: Remove, now copied from gnulib.
2195 * examples/extexi: Add missing "(C)" in copyright statement so
2196 update-copyright can recognize it.
2197 * src/LR0.h: Likewise.
2198 * src/print.h: Likewise.
2199 * src/print_graph.h: Likewise.
2200 * src/gram.c: Add missing comma in copyright statement.
2201 * src/gram.h: Likewise.
2202
22032009-08-04 Joel E. Denny <jdenny@clemson.edu>
2204
2205 Fix "make distcheck".
2206 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
2207 of just calc.stamp.
2208
22092009-08-01 Joel E. Denny <jdenny@clemson.edu>
2210
2211 Pacify "gcc -Wunused" for the input function from Flex.
2212 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
2213 and later.
2214 * src/scan-code.l: Add "%option noinput", which I cannot find in
2215 the Flex manual, but which Flex has supported since at least as
2216 far back as 2.5.4. However, if any of our developers still use
2217 Flex 2.5.4, they'll need to stop configuring with
2218 --enable-gcc-warnings because "%option noinput" didn't work
2219 correctly until Flex 2.5.6.
2220 * src/scan-gram.l: Likewise.
2221 * src/scan-skel.l: Likewise.
2222
22232009-07-31 Alex Rozenman <rozenman@gmail.com>
2224
2225 Fix --enable-gcc-warnings problems.
2226 * src/reader.c: Adjust variable names.
2227 * src/scan-code.l: Fix prototypes and adjust names.
2228 * src/named-ref.c: Remove redundant "if".
2229
22302009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
2231
2232 Fix a --enable-gcc-warnings problem.
2233 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
2234 variable.
2235
22362009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
2237
2238 Warn about character literals not of length one.
2239 * NEWS (2.5): Document.
2240 * src/scan-gram.l (INITIAL): Remove comment that we don't check
2241 the length.
2242 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
2243 * tests/input.at (Bad character literals): New test group.
2244
22452009-07-24 Alex Rozenman <rozenman@gmail.com>
2246
2247 Fix some memory leaks.
2248 * src/named-ref.c: Add a pointer check (named_ref_free).
2249 * src/scan-code.l: New function (variant_table_free). Called in
2250 code_scanner_free.
2251 * src/symlist.c: Call to named_ref_free (symbol_list_free).
2252
22532009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
2254
2255 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
2256
22572009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
2258
2259 Some M4 cleanup in the testsuite.
2260 Suggested by Eric Blake at
2261 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
2262 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
2263 complicate the code by distinguishing between a missing value
2264 and an empty string value for an optional argument. This fix is
2265 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
2266 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
2267 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
2268 arguments are not needed because of the following changes.
2269 Fix stale comments.
2270 Bison developers should use GNU M4 and should not use
2271 POSIXLY_CORRECT when building the test suite, so do not
2272 complicate the code by avoiding $10 and above.
2273 Do not quote an empty string value for an optional argument, and
2274 do not distinguish between a missing value and an empty string
2275 value.
2276
22772009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
2278
2279 Revert unnecessary column realignment in --help output.
2280 Reported by Akim Demaille at
2281 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
2282 * src/getargs.c (usage): Here.
2283
22842009-07-04 Alex Rozenman <rozenman@gmail.com>
2285
2286 Alphabetical order in src/local.mk.
2287 * src/local.mk: Adjust.
2288
22892009-07-04 Alex Rozenman <rozenman@gmail.com>
2290
2291 Style changes and factoring.
2292 * src/named-ref.h: Add comments.
2293 * src/parse-gram.y: Readability and style changes.
2294 * src/reader.c: Factoring: assign_named_ref function.
2295 * src/scan-code.l: Factoring and style changes. Rename
2296 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
2297 Use "unsigned" type for variant index. Improve readablity.
2298 * src/scan-gram.l: Change error messages and add comments.
2299 * src/symlist.h: symbol_list_null: New function decl.
2300 * src/symlist.c: symbol_list_null: Implement here.
2301 * tests/named-refs.at: Adjust for new error messages.
2302
23032009-06-29 Eric Blake <ebb9@byu.net>
2304
2305 scan-code: avoid compiler warnings
2306 * src/scan-code.l (parse_named_ref): Use correct specifiers.
2307
23082009-06-29 Akim Demaille <demaille@gostai.com>
2309
2310 build: avoid concurrent extraction of calc++.
2311 * examples/calc++/Makefile.am (calc.stamp): New.
2312 Depend on it to create the sources of calc++ so that concurrent
2313 builds don't launch several "extexi" in parallel.
2314 Not only this is inefficient, this also builds incorrect sources
2315 with several extractions mixed together.
2316
23172009-06-29 Akim Demaille <demaille@gostai.com>
2318
2319 parse.error: fix.
2320 * data/bison.m4: Move code related to specific variables after the
2321 definition of the variable-maintaining macros so that we don't
2322 "invoke" b4_percent_define_check_values before it is defined.
2323
23242009-06-29 Akim Demaille <demaille@gostai.com>
2325
2326 variables: parse.error
2327
2328 Implement, document, and test the replacement of %error-verbose
2329 by %define parse.error "verbose".
2330 * data/bison.m4 (b4_error_verbose_if): Reimplement to track the
2331 values of the parse.error variable.
2332 Make "simple" its default value.
2333 Check the valid values.
2334 * src/parse-gram.y: Use %define parse.error.
2335 (PERCENT_ERROR_VERBOSE): New token.
2336 Support it.
2337 * src/scan-gram.l: Support %error-verbose.
2338
2339 * doc/bison.texinfo (Decl Summary): Replace the documentation of
2340 %define error-verbose by that of %define parse.error.
2341 * NEWS: Document it.
2342
2343 * tests/actions.at, tests/calc.at: Use parse.error instead of
2344 %error-verbose.
2345
23462009-06-27 Alex Rozenman <rozenman@gmail.com>
2347
2348 Implement support for named symbol references.
2349 * src/parse-gram.y: Add new syntax (named_ref.opt).
2350 * src/reader.c: Store named refs in symbol lists.
2351 * src/reader.h: New argument for symbol_append and
2352 action_append functions.
2353 * src/scan-code.h: Add new field (named_ref) into
2354 code_props data structure. Keeps named ref of midrule
2355 actions.
2356 * src/scan-code.l: Support for named refs in semantic
2357 action code. New function 'parse_named_ref'.
2358 * src/scan-gram.l: Support bracketed id.
2359 * src/symlist.c: Store named refs in symbol lists.
2360 * src/symlist.h: New field in symbol list: named_ref.
2361 * src/named-ref.h: New file, a struct for named_ref.
2362 * src/named-ref.cp: New file, named_ref_new function.
2363 * src/local.mk: Add two new files.
2364 * tests/testsuite.at: Include new test group:
2365 * tests/named-refs.at: this new file.
2366
23672009-06-25 Akim Demaille <demaille@gostai.com>
2368
2369 hash: check insertion for memory exhaustion.
2370 * src/uniqstr.c (uniqstr_new): New.
2371
23722009-06-24 Akim Demaille <demaille@gostai.com>
2373
2374 variables: rename namespace as api.namespace.
2375 Discussed in
2376 http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00033.html
2377
2378 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
2379 New.
2380 (b4_percent_define_use): New.
2381 Use it where applicable.
2382 * data/c++.m4: Replace uses of the variable "namespace" by
2383 "api.namespace".
2384 Default the latter to the former.
2385 * doc/bison.texinfo (Decl Summary): Document "namespace" as
2386 obsolete.
2387 Document api.namespace.
2388 Use @samp to document %define uses, keep @code for identifiers.
2389 * NEWS: Likewise.
2390 * tests/c++.at, tests/input.at: Test api.namespace instead of
2391 namespace. (The tests passed with namespace.)
2392
23932009-06-11 Akim Demaille <demaille@gostai.com>
2394
2395 style changes.
2396 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
2397 * src/print-xml.c: Style changes.
2398 * tests/conflicts.at: Comment changes.
2399
24002009-06-11 Akim Demaille <demaille@gostai.com>
2401
2402 xml: beware of user strings used to give a %prec to rules.
2403 * tests/conflicts.at (%prec with user strings): New.
2404 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
2405 XML output.
2406
24072009-06-11 Akim Demaille <demaille@gostai.com>
2408
2409 hash: check insertion for memory exhaustion.
2410 * src/muscle-tab.c (muscle_insert, muscle_grow)
2411 * src/state.c (state_hash_insert): Check the return value of
2412 hash_insert.
2413
24142009-06-11 Akim Demaille <demaille@gostai.com>
2415
2416 tests: honor TESTSUITEFLAGS in every check target.
2417 * tests/local.mk (RUN_TESTSUITE): New.
2418 (check-local, installcheck-local, maintainer-check-g++)
2419 (maintainer-check-posix, maintainer-check-valgrind): Use it.
2420
24212009-06-10 Akim Demaille <demaille@gostai.com>
2422
2423 deterministic test suite.
2424 Some consistency checks on symbols are performed after all the
2425 symbols were read, by an iteration over the symbol table. This
2426 traversal is nondeterministic, which can be a problem for test
2427 cases.
2428 Avoid this.
2429 Addresses another form of nondeterminism reported by Joel E. Denny.
2430 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
2431
2432 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
2433 test in two.
2434 Use different file names for the three tests to make the
2435 maintenance easier.
2436
24372009-06-10 Akim Demaille <demaille@gostai.com>
2438
2439 gnulib: update.
2440 * gnulib: Update to latest.
2441 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
2442 * m4/.gitignore: Regen.
2443 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
2444 Call xalloc_die on hash_insert failures.
2445 Requested by the new __warn_unused_result__ attribute of
2446 hash_insert.
2447
24482009-06-10 Akim Demaille <demaille@gostai.com>
2449
2450 deterministic user-token-number redeclaration errors.
2451 Address nondeterminism reported by Joel E. Denny.
2452 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
2453
2454 * src/uniqstr.h: Comment changes.
2455 * src/location.h (boundary_cmp, location_cmp): New.
2456 * src/symtab.c (user_token_number_redeclaration): New.
2457 (symbol_translation): Use it.
2458 * tests/input.at (Numbered tokens): Adjust the expected output.
2459
24602009-05-25 Akim Demaille <demaille@gostai.com>
2461
2462 build: avoid ignored errors.
2463 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Don't generate ignored
2464 errors, they pollute the output.
2465
24662009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
2467
2468 Convert multiple variable definition warnings to complaints.
2469 * NEWS (2.5): Add a new entry for that change.
2470 * doc/bison.texinfo (Decl Summary): Update %define entry.
2471 (Bison Options): Update -D/--define/-F/--force-define entry.
2472 * src/muscle-tab.c (muscle_percent_define_insert): Implement.
2473 * src/muscle-tab.h (muscle_percent_define_insert): Update
2474 comments.
2475 * tests/input.at (`%define errors'): Update.
2476 (`%define, --define, --force-define'): Update.
2477
24782009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
2479
2480 -F/--force-define and relative %define/-D/--define priorities.
2481 * NEWS (2.5): Add documentation to -D/--define entry.
2482 * build-aux/cross-options.pl: Hard-code association of
2483 --force-define with %define.
2484 * doc/bison.texinfo (Decl Summary): In %define entry,
2485 cross-reference command-line options.
2486 (Bison Options): Add documentation to -D/--define entry.
2487 (Option Cross Key): Widen column for --force-define row.
2488 * src/getargs.c (usage): Document -F/--force-define. Realign
2489 options in output.
2490 (short_options, long_options, getargs): Parse -F/--force-define,
2491 and update muscle_percent_define_insert invocations.
2492 * src/muscle-tab.h (muscle_percent_define_how): New enum type.
2493 (muscle_percent_define_insert): Add argument with that type.
2494 * src/muscle-tab.c (muscle_percent_define_insert): Implement
2495 -F/--force-define behavior and priorities.
2496 (muscle_percent_define_ensure): Update
2497 muscle_percent_define_insert invocation.
2498 * src/parse-gram.y (prologue_declaration): Update
2499 muscle_percent_define_insert invocations.
2500 * tests/input.at (`%define, --define'): Rename to...
2501 (`%define, --define, --force-define'): ... this and extend.
2502
25032009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
2504
2505 Update some comments to make sense for -D.
2506 * data/bison.m4 (b4_check_user_names): In header comments, say
2507 "user occurrence" instead of "grammar occurrence".
2508 * src/muscle-tab.h (muscle_percent_define_insert): Likewise.
2509 (muscle_percent_code_grow): Likewise just for consistency.
2510
25112009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
2512
2513 * data/c++.m4 (b4_namespace_close): Simplify slightly.
2514
25152009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
2516
2517 Handle a trailing `:' in a user-supplied C++ namespace better.
2518 * data/c++.m4 (b4_namespace_close): Don't let it be printed
2519 among the closing braces here. This fix might make the
2520 generated code easier to debug, but otherwise it should be
2521 insignificant because a trailing `:' is a C++ error already.
2522
25232009-05-19 Akim Demaille <demaille@gostai.com>
2524
2525 remove useless variable.
2526 * src/getargs.c (skeleton_arg): Remove now useless variable.
2527 Should help the compiler see that this printf-like call is sane.
2528
25292009-05-15 Akim Demaille <demaille@gostai.com>
2530
2531 Rename token.prefix as api.tokens.prefix.
2532 Discussed here.
2533 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00024.html.
2534
2535 * NEWS, data/bison.m4, data/c.m4, data/java.m4, doc/bison.texinfo,
2536 * tests/c++.at, tests/calc.at, tests/java.at, tests/local.at
2537 (token.prefix): Rename as...
2538 (api.tokens.prefix): this.
2539
25402009-05-11 Akim Demaille <demaille@gostai.com>
2541
2542 doc: use C++ headers.
2543 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
2544 headers.
2545
25462009-05-11 Akim Demaille <demaille@gostai.com>
2547
2548 doc: token.prefix
2549 * doc/bison.simple (Decl Summary): Document token.prefix.
2550 (Calc++ Parser): Various fixes.
2551 Formatting changes.
2552 Use token.prefix.
2553 Introduce a macro TOKEN to shorten the code and make it more
2554 readable.
2555 (Calc++ Scanner): Adjust.
2556 * NEWS (Variable token.prefix): New.
2557
25582009-05-04 Akim Demaille <demaille@gostai.com>
2559
2560 bison: catch bad symbol names.
2561 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
2562 * tests/input.at: Adjust.
2563
25642009-05-04 Akim Demaille <demaille@gostai.com>
2565
2566 identifiers: dashes are letters.
2567 Dashes can now start identifiers (symbols and directives).
2568
2569 * src/scan-gram.l ({letter}): Add dash.
2570 ({id}): Remove it.
2571 * tests/input.at (Symbols): Adjust.
2572 Remove stray comment.
2573 * tests/regression.at (Invalid inputs): Adjust error message.
2574 * doc/bison.texinfo (Symbols): Update.
2575
25762009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
2577
2578 Declare %code to be a permanent feature.
2579 * NEWS (2.4.2): Here.
2580 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
2581 experimental.
2582 (Decl Summary): Likewise.
2583
25842009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
2585
2586 Convert underscores to dashes in some %define variable names.
2587 For now, just api.push-pull and lr.keep-unreachable-states.
2588 Maintain old names for backward compatibility.
2589 * NEWS (2.5): Document.
2590 * data/c.m4 (b4_identification): Update comment.
2591 * data/yacc.c: Update access.
2592 * doc/bison.texinfo: Update.
2593 * etc/bench.pl.in (bench_push_parser): Update use.
2594 * src/files.c (tr): Move to...
2595 * src/getargs.c, src/getargs.h (tr): ... here because I can't
2596 think of a better place to expose it. My logic is that, for all
2597 uses of tr so far, command-line arguments can be involved, and
2598 getargs.h is already included.
2599 * src/main.c (main): Update access.
2600 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
2601 variable names to new variable names before assigning value.
2602 * src/reader.c (reader): Update setting default.
2603 * tests/calc.at: Update uses.
2604 * tests/conflicts.at (Unreachable States After Conflict
2605 Resolution): Update use.
2606 * tests/input.at (%define enum variables): Update use.
2607 (%define backward compatibility): New test group.
2608 * tests/push.at: Update uses.
2609 * tests/reduce.at: Update uses.
2610 * tests/torture.at: Update uses.
2611
26122009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
2613
2614 Set all front-end %define defaults in one place.
2615 * src/main.c (main): Move lr.keep_unreachable_states default...
2616 * src/reader.c (reader): ... to here.
2617
26182009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
2619
2620 Rename lr.default_reductions to lr.default-reductions.
2621 * NEWS (2.5): Here.
2622 * doc/bison.texinfo: Here.
2623 * src/lalr.c (initialize_LA): Here.
2624 * src/print.c (print_reductions): Here.
2625 * src/reader.c (reader): Here.
2626 * src/tables.c (action_row): Here.
2627 * tests/input.at (%define enum variables): Here.
2628 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
2629
26302009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
2631
2632 Pacify ./configure --enable-gcc-warnings.
2633 * tests/input.at (Symbols): Prototype yyerror and yylex.
2634
26352009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
2636
2637 Document how `%define "var" "value"' is not M4-friendly.
2638 * src/parse-gram.y (variable): In comments here.
2639
26402009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
2641
2642 Clean up recent patches a little.
2643 Reported by Akim Demaille.
2644 * doc/bison.texinfo (Understanding): Fix typos.
2645 * src/print.c (print_reductions): Don't use negated variable.
2646
26472009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
2648
2649 List accepted values for a %define enum variable with an invalid value.
2650 Suggested by Akim Demaille at
2651 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
2652 * data/bison.m4 (_b4_percent_define_check_values): Implement.
2653 * src/muscle-tab.c (muscle_percent_define_check_values): Implement.
2654 * tests/input.at (%define lr.default_reductions invalid values): Merge
2655 into...
2656 (%define enum variables): ... here, and update output.
2657
26582009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
2659
2660 Rename "default rule" to "default reduction".
2661 This includes changing variable names in code, changing
2662 comments, and renaming %define lr.default_rules to %define
2663 lr.default_reductions.
2664 * NEWS (2.5): Update IELR documentation.
2665 * data/bison.m4 (b4_integral_parser_tables_map): Adjust YYDEFACT
2666 documentation.
2667 * data/glr.c, data/lalr1.java: Sync copyright dates.
2668 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
2669 and lr.type documentation. Make some other wording
2670 improvements.
2671 (Glossary): Adjust cross-references and Default Reduction
2672 definition.
2673 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
2674 Remove a confusing comment pointed out by Akim Demaille.
2675 (initialize_LA): Adjust code.
2676 * src/print-xml.c (print_reductions): Adjust code.
2677 * src/print.c (print_reductions): Adjust code.
2678 * src/reader.c (reader): Adjust code.
2679 * src/tables.c (action_row): Adjust code.
2680 (token_actions): Adjust code.
2681 * src/tables.h: Adjust YYDEFACT documentation.
2682 * tests/input.at (%define lr.default_rules invalid values):
2683 Rename test group to...
2684 (%define lr.default_reductions invalid values): ... this, and
2685 update grammar file and expected output.
2686 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
2687 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
2688
26892009-04-21 Akim Demaille <demaille@gostai.com>
2690
2691 tests: check the use of dashes and periods in symbols.
2692 * tests/input.at (Symbol): New test group.
2693
26942009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2695
2696 Document %define lr.type and lr.default_rules.
2697 * NEWS (2.5): Add an entry.
2698 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
2699 besides just LALR(1) and GLR(1).
2700 * doc/bison.texinfo (Introduction): Likewise.
2701 (Language and Grammar): Bison is no longer limited to LALR(1)
2702 restrictions.
2703 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
2704 when trying to distinguish from GLR. Talk about LR(1) grammars
2705 rather than LALR(1) grammars.
2706 (Decl Summary): In %define api.push_pull entry, say it applies
2707 to deterministic parsers in C rather than LALR(1) parsers in C.
2708 Add lr.default_rules entry.
2709 Add lr.type entry.
2710 (Mystery Conflicts): Bison is no longer limited to LALR(1)
2711 restrictions.
2712 (Generalized LR Parsing): Same changes as for the previous GLR
2713 section.
2714 (Memory Management): Say deterministic rather than LALR(1).
2715 (Understanding): Correct some bison output.
2716 Index discussion of "accepting state".
2717 Say deterministic rather than LALR(1).
2718 (Bison Options): In --yacc entry, say deterministic rather than
2719 LALR(1).
2720 In --report, --graph, and --xml entries, just don't mention
2721 LALR(1).
2722 (C++ Parsers): Say deterministic rather than LALR(1).
2723 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
2724 (Glossary): Add Accepting State, Consistent State, Default Rule,
2725 and IELR(1) definitions.
2726 In Generalized LR (GLR) definition, make same changes as in
2727 previous GLR sections.
2728 In LALR(1) definition, say Bison uses LALR(1) by default rather
2729 than implying Bison is limited to LALR(1).
2730 (LocalWords): Add IELR.
2731
27322009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2733
2734 Finish implementing %define lr.type.
2735 Its value can be "LALR", "IELR", or "canonical LR".
2736 * lib/timevar.def (TV_IELR_PHASE1): New var.
2737 (TV_IELR_PHASE2): New var.
2738 (TV_IELR_PHASE3): New var.
2739 (TV_IELR_PHASE4): New var.
2740 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
2741 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
2742 Sbitset.h, ielr.h, and ielr.c.
2743 * src/getargs.h, src/getargs.c (enum trace, trace_args,
2744 trace_types): Add trace_ielr.
2745 * src/lalr.h, src/lalr.c (ngotos): Export it.
2746 (F): Rename to...
2747 (goto_follows): ... this, update all uses, and export it.
2748 (set_goto_map): Export it.
2749 (map_goto): Export it.
2750 (compute_lookahead_tokens): Don't free goto_follows yet. Now
2751 handled in ielr.
2752 (initialize_LA): Export it. Move lookback allocation to...
2753 (lalr): ... here because, for canonical LR, initialize_LA must
2754 be invoked but lookback and much of the rest of LALR isn't
2755 needed.
2756 * main.c (main): Instead of lalr, invoke ielr, which invokes
2757 lalr.
2758 * src/reader.c (reader): Default lr.type to "LALR".
2759 Default lr.default_rules to "accepting" if lr.type is "canonical
2760 LR". Leave the default as "all" otherwise.
2761 Check for a valid lr.type value.
2762 * src/state.h, src/state.c (struct state_list): Add state_list
2763 member.
2764 (state_new): Initialize state_list member to NULL.
2765 (state_new_isocore): New function, exported.
2766 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
2767 exercises all values of lr.type.
2768 (GNU AWK Grammar): Rename test group to...
2769 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
2770 AT_TEST_EXISTING_GRAMMAR.
2771 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
2772 (GNU pic Grammar): Rename test group to...
2773 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
2774 AT_TEST_EXISTING_GRAMMAR.
2775 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
2776 all values of lr.type.
2777 (Single State Split): New test groups using AT_TEST_LR_TYPE.
2778 (Lane Split): Likewise.
2779 (Complex Lane Split): Likewise.
2780 (Split During Added Lookahead Propagation): Likewise.
2781
27822009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2783
2784 Add new files for IELR and canonical LR implementation.
2785 * src/AnnotationList.c: New.
2786 * src/AnnotationList.h: New.
2787 * src/InadequacyList.c: New.
2788 * src/InadequacyList.h: New.
2789 * src/Sbitset.c: New.
2790 * src/Sbitset.h: New.
2791 * src/ielr.c: New.
2792 * src/ielr.h: New.
2793
27942009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
2795
2796 Implement %define lr.default_rules.
2797 Its value describes the states that are permitted to contain
2798 default rules: "all", "consistent", or "accepting".
2799 * src/reader.c (reader): Default lr.default_rules to "all".
2800 Check for a valid lr.default_rules value.
2801 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
2802 is "accepting", then only mark the accepting state as
2803 consistent.
2804 (initialize_LA): Tell state_lookahead_tokens_count whether
2805 lr.default_rules is "accepting".
2806 * src/tables.c (action_row): If lr.default_rules is not "all",
2807 then disable default rules in inconsistent states.
2808 * src/print.c (print_reductions): Use this opportunity to
2809 perform some assertions about whether lr.default_rules was
2810 obeyed correctly.
2811 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
2812 helps with checking the parser tables for a grammar.
2813 * tests/input.at (%define lr.default_rules invalid values): New
2814 test group.
2815 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
2816 AT_TEST_TABLES_AND_PARSE.
2817 (`no %define lr.default_rules'): New test group generated by
2818 AT_TEST_LR_DEFAULT_RULES.
2819 (`%define lr.default_rules "all"'): Likewise.
2820 (`%define lr.default_rules "consistent"'): Likewise.
2821 (`%define lr.default_rules "accepting"'): Likewise.
2822
28232009-04-20 Akim Demaille <demaille@gostai.com>
2824
2825 Formatting change.
2826
28272009-04-20 Akim Demaille <demaille@gostai.com>
2828
2829 bison: factoring.
2830 * src/output.c (token_definitions_output): Use symbol_id_get
2831 instead of duplicating its logic.
2832 * TODO (YYERRCODE): Extend.
2833
28342009-04-20 Akim Demaille <demaille@gostai.com>
2835
2836 variables: prefer error-verbose to error_verbose.
2837 * data/bison.m4 (b4_error_verbose_if): Based on error-verbose
2838 instead of error_verbose.
2839 * src/scan-gram.l (%error-verbose): Map to the error-verbose
2840 variable.
2841 * doc/bison.texinfo: Promote %define error-verbose instead of
2842 %error-verbose.
2843 * tests/actions.at: Prefer %define error-verbose to %error-verbose.
2844
28452009-04-15 Akim Demaille <demaille@gostai.com>
2846
2847 variables: accept dashes.
2848 * data/bison.m4 (b4_percent_define_if_define_): Also map dashes to
2849 underscores.
2850 * src/scan-gram.l ({id}): Also accept dashes after the initial
2851 letter.
2852 ({directive}): Use {id}.
2853 * src/parse-gram.y: Comment and formatting changes.
2854 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
2855 symbols.
2856 * src/complain.h, src/complain.c (yacc_at): New.
2857 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
2858 symbol names.
2859 * src/output.c (token_definitions_output): Do not #define token
2860 names with dashes.
2861
28622009-04-20 Akim Demaille <demaille@gostai.com>
2863
2864 Consistently refer to Yacc, not YACC.
2865 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
2866
28672009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
2868
2869 Pacify make maintainer-check-posix.
2870 * tests/input.at (%define, --define): Move bison command-line
2871 options before grammar file name.
2872
28732009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
2874
2875 Document semicolon warnings.
2876 * NEWS (2.5): Here.
2877
28782009-04-14 Akim Demaille <demaille@gostai.com>
2879
2880 variables: use `parse.assert' instead of `assert'.
2881 * TODO (assert): Remove.
2882 * data/bison.m4 (b4_assert_if): Replace with...
2883 (b4_parse_assert_if): this.
2884 * data/lalr1.cc, data/variant.hh, tests/c++.at: Adjust.
2885 * doc/bison.texinfo (Decl Summary): Document parse.assert.
2886
28872009-04-14 Akim Demaille <demaille@gostai.com>
2888
2889 variables: use `parse.trace' instead of `debug'.
2890 * src/getargs.c (getargs): Map -t to %define trace.parse.
2891 * src/scan-gram.l (%debug): Map to %define trace.parse.
2892 * data/bison.m4 (b4_percent_define_if_define): Map `.' in variable
2893 names to `_' in macro names.
2894 (b4_debug_if): Replace with...
2895 (b4_parse_trace_if): this.
2896 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
2897 * data/yacc.c: Adjust.
2898 * doc/bison.texinfo (Decl Summary): Document %debug as obsoleted.
2899 Use @code to label the variable list.
2900 Document the variable parse.trace.
2901 (Tracing): Promote the parse.trace variable.
2902 * TODO: %printer is not documented.
2903
29042009-04-14 Akim Demaille <demaille@gostai.com>
2905
2906 doc: minor fixes.
2907 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
2908 (Table of Symbols): Remove duplicate entry for %debug.
2909
29102009-04-10 Eric Blake <ebb9@byu.net>
2911
2912 submodules: update to latest
2913 * submodules/autoconf: Use latest upstream Autoconf.
2914
29152009-04-06 Eric Blake <ebb9@byu.net>
2916
2917 Work around autoconf 2.63b bug in testsuite.
2918 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
2919 autoconf bug related to # in test.
2920
29212009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2922
2923 * NEWS (2.5): New section. Describe new -D/--define feature.
2924
29252009-04-06 Akim Demaille <demaille@gostai.com>
2926
2927 Regen.
2928 * src/parse-gram.h, src/parse-gram.c: Regen.
2929
29302009-04-06 Akim Demaille <demaille@gostai.com>
2931
2932 rename muscle_tab.* as muscle-tab.* for consistency.
2933 * src/muscle_tab.h, src/muscle_tab.c: Rename as...
2934 * src/muscle-tab.h, src/muscle-tab.c: these.
2935 * src/getargs.c, src/local.mk, src/main.c, src/output.c,
2936 * src/parse-gram.y, src/reader.c, src/scan-code.l: Adjust.
2937
29382009-04-06 Akim Demaille <demaille@gostai.com>
2939
2940 Makefile: introduce $(BISON).
2941 * src/local.mk (BISON): New.
2942 (YACC): Use it.
2943
29442009-04-06 Akim Demaille <demaille@gostai.com>
2945
2946 parser: handle %locations as %define locations.
2947 * src/getargs.h, src/getargs.c (locations_flag): Remove.
2948 * src/getargs.c, src/scan-code.l: Use muscle_percent_define_ensure
2949 to set "locations" to true.
2950 * src/output.c (prepare): Don't output "locations".
2951 * src/scan-gram.l (%locations): Handle it as a %<flag>.
2952 * src/parse-gram.y: It's no longer a token.
2953 Don't handle it.
2954 * data/bison.m4 (b4_locations_if): Define it with
2955 b4_percent_define_if_define.
2956 * data/c.m4, data/glr.cc: Adjust.
2957
29582009-04-06 Akim Demaille <demaille@gostai.com>
2959
2960 Regen.
2961 * src/parse-gram.c: Regen.
2962
29632009-04-06 Akim Demaille <demaille@gostai.com>
2964
2965 muscle: factor the handling of obsolete of obsolete directives.
2966 Suggested by Joel E. Denny.
2967
2968 * src/muscle_tab.h, src/muscle_tab.c (muscle_percent_define_ensure):
2969 New, extracted from...
2970 * src/parse-gram.y (prologue_declaration: pure-parser): here.
2971 Remove it.
2972 (prologue_declaration: "%<flag>"): Use
2973 muscle_percent_define_ensure.
2974 (%error-verbose, %pure-parser): No longer tokens.
2975 * src/scan-gram.l (pure-parser): Return as a %<flag>.
2976
29772009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2978
2979 Fix options documentation.
2980 * build-aux/cross-options.pl: As in --help output, write optional
2981 arguments as [=ARG] not =[ARG].
2982 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
2983
29842009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
2985
2986 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
2987 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
2988 requirements for a correct m4 are stricter.
2989 * m4/m4.m4: Make it a symbolic link to submodules/autoconf/m4/m4.m4.
2990 * configure.ac: Update to use AC_PROG_GNU_M4.
2991 Reported by Eric Blake.
2992
29932009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2994
2995 Help with updating web manual.
2996 * HACKING: Incorporate instructions from gnulib/doc/README.
2997 * bootstrap.conf (gnulib_modules): Add gendocs.
2998
29992009-04-03 Akim Demaille <demaille@gostai.com>
3000
3001 Regen.
3002 * src/parse-gram.h, src/parse-gram.c: Regen.
3003
30042009-04-03 Akim Demaille <demaille@gostai.com>
3005
3006 Factor %FLAG at scan level.
3007 * src/parse-gram.y (PERCENT_DEBUG, PERCENT_ERROR_VERBOSE): Token
3008 definitions and associated rules, replaced by....
3009 (PERCENT_FLAG): this new token type, and rule.
3010 * src/scan-gram.l (RETURN_PERCENT_FLAG): New.
3011 Use it for %debug and %error-verbose.
3012
30132009-04-03 Akim Demaille <demaille@gostai.com>
3014
3015 Regen.
3016 * src/parse-gram.h, src/parse-gram.c: Regen.
3017
30182009-04-03 Akim Demaille <demaille@gostai.com>
3019
3020 Treat %debug as %define debug.
3021 * data/bison.m4 (b4_debug_if): New.
3022 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c,
3023 * data/lalr1.java: Use it instead of b4_debug_flag.
3024 * src/getargs.h, src/getargs.c (debug_flag): Remove.
3025 * src/output.c (prepare): Don't output it.
3026 * src/parse-gram.y: Treat %debug as %define debug.
3027
30282009-04-03 Akim Demaille <demaille@gostai.com>
3029
3030 Treat %error-verbose as %define error_verbose.
3031 This allows to pass -Derror_verbose on the command line. Better
3032 yet, it allows to pass -Derror_verbose=$(ERROR_VERBOSE), with
3033 ERROR_VERBOSE being defined as false or true.
3034 * data/bison.m4 (b4_percent_define_if_define): Instead of relying
3035 on b4_percent_define_ifdef, for does not check the defined value,
3036 but only whether the symbol is defined, rely on
3037 b4_percent_define_flag_if, so that a value of "false" is processed
3038 as a false.
3039 If not defined, define the flag to "false".
3040 (b4_error_verbose_if): New.
3041 * data/glr.c, data/lalr1.cc, data/yacc.c: Use it instead of
3042 b4_error_verbose_flag.
3043 * src/getargs.h, src/getargs.c (error_verbose_flag): Remove.
3044 * src/output.c (prepare): Don't output it.
3045 * src/parse-gram.y (%error-verbose): Treat as %define error_verbose.
3046
30472009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
3048
3049 Fix strange %define locations for default values.
3050 Reported by Akim Demaille at
3051 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
3052 and discussed again starting at
3053 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
3054 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
3055 because location information is bogus.
3056 Use angle brackets to delimit fake file name because square brackets
3057 look like underexpanded m4. Choose a better fake file name.
3058 Use negative line numbers.
3059 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
3060 * src/location.c (location_print): If line for a boundary is negative,
3061 only print that boundary's file name.
3062 * src/location.h: Document that.
3063 * tests/skeletons.at (%define Boolean variables: invalid skeleton
3064 defaults): Update output.
3065
30662009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
3067
3068 Pacify ./configure --enable-gcc-warnings.
3069 * Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS) because many files
3070 in lib won't compile with it.
3071 * src/local.mk (src_bison_CFLAGS): Use $(WERROR_CFLAGS) here only.
3072
30732009-03-31 Akim Demaille <demaille@gostai.com>
3074
3075 bootstrap: --help to stdout.
3076 * bootstrap (usage): Don't send --help to stderr.
3077 Use a here doc instead of a long string.
3078
30792009-03-31 Akim Demaille <demaille@gostai.com>
3080
3081 bootstrap: README-hacking no longer exists
3082 * bootstrap (checkout_only_file): Set to HACKING.
3083
30842009-03-26 Akim Demaille <demaille@gostai.com>
3085
3086 doc: merge HACKING and README-hacking.
3087 Two files is confusing.
3088 Reported by Alexandre Duret-Lutz.
3089
3090 * README-hacking: Merge into...
3091 * HACKING (Working from the repository): here.
3092
30932009-03-26 Akim Demaille <demaille@gostai.com>
3094
3095 doc: update README-hacking.
3096 * README-hacking: We now use git and git submodules.
3097 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
3098
30992009-03-26 Akim Demaille <demaille@gostai.com>
3100
3101 lalr1.cc: avoid GCC 4.3 warnings.
3102 GCC 4.3 now warns about "a || b && c" and asks for explicit
3103 parentheses.
3104 Reported by Alexandre Duret-Lutz.
3105 * data/location.cc: Update copyright years.
3106 (Position::operator==): Use parens to make precedence explicit.
3107 Compare lines and columns first, as they are more likely to be
3108 different, and they are faster to compare.
3109
31102009-03-26 Akim Demaille <demaille@gostai.com>
3111
3112 gnulib: update.
3113 * gnulib: Update to latest.
3114 * src/local.mk (AM_CFLAGS): Move to...
3115 * Makefile.am: here.
3116 * etc/prefix-gnulib-mk (prefix_assignment): Also transform
3117 AM_CFLAGS.
3118
31192009-03-02 Akim Demaille <demaille@gostai.com>
3120
3121 Comment changes.
3122
31232009-03-02 Akim Demaille <demaille@gostai.com>
3124
3125 Share b4_yytranslate_define.
3126 * data/lalr1.cc (b4_yytranslate_define): Move to...
3127 * data/c++.m4: here.
3128
31292009-03-02 Akim Demaille <demaille@gostai.com>
3130
3131 Use locations in the variant example.
3132 Yes, this obfuscates the point of this example, variants only.
3133 But glr.cc cannot work (yet?) without locations. This change
3134 makes it easier to use this example with glr.cc.
3135
3136 * examples/variant.yy (assert): %define it.
3137 (locations): Request them.
3138 (yylex): Bind the location to the stage.
3139
31402009-03-02 Akim Demaille <demaille@gostai.com>
3141
3142 Dub make_TOKEN as a public type interface.
3143 * data/c++.m4 (b4_symbol_constructor_declare)
3144 (b4_symbol_constructor_define): New empty stubs.
3145 (b4_public_types_declare, b4_public_types_define): Use them.
3146 * data/lalr1.cc (b4_symbol_constructor_declare)
3147 (b4_symbol_constructor_declare_)
3148 (b4_symbol_constructor_define_, b4_symbol_constructor_define):
3149 Move to...
3150 * data/variant.hh: here.
3151 Remove the "b4_variant_if" parts, as variant.hh is loaded only if
3152 needed.
3153 * data/lalr1.cc: No longer invoke b4_symbol_constructor_define and
3154 b4_symbol_constructor_declare, as it is now done by
3155 b4_public_types_define and b4_public_types_declare.
3156
31572009-03-02 Akim Demaille <demaille@gostai.com>
3158
3159 Coding style changes.
3160 * data/lalr1.cc (b4_symbol_constructor_declaration_)
3161 (b4_symbol_constructor_declarations)
3162 (b4_symbol_constructor_definition_)
3163 (b4_symbol_constructor_definitions)
3164 (b4_yytranslate_definition): Rename as...
3165 (b4_symbol_constructor_declare_)
3166 (b4_symbol_constructor_declare)
3167 (b4_symbol_constructor_define_)
3168 (b4_symbol_constructor_define)
3169 (b4_yytranslate_define): these.
3170 * data/variant.hh (b4_variant_definition): Rename as...
3171 (b4_variant_define): this.
3172
31732009-03-02 Akim Demaille <demaille@gostai.com>
3174
3175 Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if.
3176 * data/bison.m4 (b4_percent_define_if_define): New.
3177 * data/c++.m4 (b4_variant_if): Move to...
3178 * data/bison.m4: Here, using b4_percent_define_if_define.
3179 * data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to...
3180 * data/bison.m4: Here, using b4_percent_define_if_define.
3181
31822009-03-02 Akim Demaille <demaille@gostai.com>
3183
3184 Dub symbol_type_base as a public type.
3185 * data/c++.m4 (b4_public_types_declare): Now define
3186 symbol_type_base and symbol_type.
3187 (b4_public_types_define): New.
3188 In both cases, the definitions are taken verbatim from lalr1.cc.
3189 * data/lalr1.cc: Adjust.
3190
31912009-03-02 Akim Demaille <demaille@gostai.com>
3192
3193 b4_public_types_declare.
3194 * data/c++.m4 (b4_public_types_declare): New.
3195 * data/glr.cc, data/lalr1.cc: Use it.
3196
31972009-03-02 Akim Demaille <demaille@gostai.com>
3198
3199 b4_semantic_type_declare.
3200 * data/c++.m4 (b4_semantic_type_declare): New.
3201 Factors and generalizes what was in glr.cc and lalr1.cc.
3202 * data/variant.hh (b4_semantic_type_declare): Redefine it for
3203 variants.
3204 * data/lalr1.cc, data/glr.cc: Use it.
3205
32062009-02-26 Akim Demaille <demaille@gostai.com>
3207
3208 Upgrade gnulib.
3209 * gnulib: Upgrade from master.
3210 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore:
3211 Regen.
3212
32132009-02-25 Akim Demaille <demaille@gostai.com>
3214
3215 Remove useless arguments.
3216 * data/glr.c (yy_reduce_print): $$ and @$ are not used and not
3217 relevant.
3218
32192009-02-25 Akim Demaille <demaille@gostai.com>
3220
3221 Comment changes.
3222 * data/lalr1.cc: here.
3223
32242009-02-25 Akim Demaille <demaille@gostai.com>
3225
3226 Fix glr.cc's debug level handling.
3227 * data/glr.cc (yydebug_): Remove, as it is actually yydebug from
3228 glr.c which is used.
3229 (debug_level, set_debug_level): Adjust.
3230
32312009-02-25 Akim Demaille <demaille@gostai.com>
3232
3233 Copyright years.
3234 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
3235
32362009-02-25 Akim Demaille <demaille@gostai.com>
3237
3238 Style changes.
3239 * etc/bench.pl.in (generate_grammar_list): Consitently use
3240 location_type, not yy::location.
3241
32422009-02-25 Akim Demaille <demaille@gostai.com>
3243
3244 Comment change.
3245 * data/lalr1.cc: here.
3246
32472009-02-19 Akim Demaille <demaille@gostai.com>
3248
3249 Make yyparser::error public.
3250 * data/lalr1.cc: here.
3251 There is no good reason to keep it private (and it is convenient
3252 to use it from the scanner for instance). It is already public in
3253 glr.cc.
3254
32552009-02-19 Akim Demaille <demaille@gostai.com>
3256
3257 Comment changes.
3258 * data/glr.cc: here.
3259
32602009-02-19 Akim Demaille <demaille@gostai.com>
3261
3262 Remove trailing blanks.
3263 The epilogue has its own ending \n, no need to add another.
3264
3265 * data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the
3266 epilogue.
3267 * data/glr.cc: dnl when extending the epilogue.
3268 Remove stray "private:".
3269
32702009-02-19 Akim Demaille <demaille@gostai.com>
3271
3272 Use b4_c_modern.
3273 * data/c.m4 (b4_c_function_decl): Here.
3274
32752009-02-19 Akim Demaille <demaille@gostai.com>
3276
3277 Comment changes.
3278 * data/lalr1.cc: here.
3279
32802009-02-19 Akim Demaille <demaille@gostai.com>
3281
3282 Extract variant.hh
3283 * data/variant.hh: New, extracted from...
3284 * data/lalr1.cc: here.
3285 Adjust.
3286 * data/local.mk: Adjust.
3287
32882009-02-19 Akim Demaille <demaille@gostai.com>
3289
3290 Extract stack.hh from lalr1.cc.
3291 * data/stack.hh: New.
3292 * data/lalr1.cc: Extract from here.
3293 * data/local.mk: Adjust.
3294
32952009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
3296
3297 Add reminder about uploading public key to keys.gnupg.net.
3298 * HACKING (Release Procedure): Here.
3299
33002009-01-28 Akim Demaille <demaille@gostai.com>
3301
3302 * NEWS: Update information about 2.4.1 and 2.4.2.
3303
33042008-11-04 Akim Demaille <demaille@gostai.com>
3305
3306 Reformat NEWS.
3307 * NEWS: Use more outline-mode markup.
3308 Suggested by Jim Meyering.
3309
33102009-01-08 Akim Demaille <demaille@gostai.com>
3311
3312 Fix grep portability issues.
3313 Grep on Solaris does not support -q.
3314 Reported by Summum Bonum.
3315
3316 * NEWS: Add a stub for 2.4.2.
3317 * THANKS: Add Summum Bonum.
3318 * tests/atlocal.in (EGREP): New.
3319 (CC, CXX, XSLTPROC): Make it possible to override them via
3320 envvars.
3321 * tests/java.at: Use $EGREP instead of egrep.
3322 Use AT_CHECK's ignore instead of grep's -q.
3323
33242008-12-11 Akim Demaille <demaille@gostai.com>
3325
3326 Pass the token type to yysyntax_error.
3327 * data/yacc.c (yysyntax_error): Take the transated token instead
3328 of the raw number.
3329 Adjust callers.
3330 * TODO: Update.
3331
33322008-12-11 Akim Demaille <demaille@gostai.com>
3333
3334 Formatting changes.
3335 * data/glr.c: Formatting changes.
3336
33372008-12-11 Akim Demaille <demaille@gostai.com>
3338
3339 Propagate i18n changes into glr.c.
3340 * TODO: Update.
3341 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
3342 building the error message format dynamically.
3343 * data/lalr1.java: Formatting changes.
3344
33452008-12-11 Akim Demaille <demaille@gostai.com>
3346
3347 Use testsuite -C.
3348 * tests/local.mk: Replace "cd && testsuite" by "testsuite -C".
3349 Solves problems when top_srcdir is an absolute path.
3350 Suggested by Eric Blake.
3351 * configure.ac: Require Autoconf 2.62.
3352
33532008-12-11 Akim Demaille <demaille@gostai.com>
3354
3355 Simplify the i18n of the error messages.
3356 * data/lalr1.cc: Comment changes.
3357 * data/yacc.c (yysyntax_error): Rewrite, using a switch as in
3358 lalr1.cc instead of building dynamically the format string.
3359
33602008-12-08 Akim Demaille <demaille@gostai.com>
3361
3362 Fix portability issue in the test suite.
3363 * tests/local.at (AT_MATCHES_CHECK): New.
3364 Based on Perl instead of Sed. Sed has too many portability
3365 pitfalls, not ever Sed is GNU Sed.
3366 * tests/actions.at (Fix user actions without a trailing semicolon):
3367 Use it.
3368
33692008-12-08 Akim Demaille <demaille@gostai.com>
3370
3371 Update data/README.
3372 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
3373
33742008-12-08 Akim Demaille <demaille@gostai.com>
3375
3376 Install autoconf as a submodule to get m4sugar.
3377 * .gitmodules: Add submodules/autoconf.
3378 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
3379 submodules/autoconf.
3380
33812008-12-08 Akim Demaille <demaille@gostai.com>
3382
3383 Test token.prefix in all the skeletons.
3384 * data/java.m4 (b4_token_enum): Use the token.prefix.
3385 * tests/local.at (AT_BISON_OPTION_PUSHDEFS): Define AT_TOKEN_PREFIX.
3386 * tests/calc.at (_AT_DATA_CALC_Y): Use it.
3387 Add checks for yacc.c, glr.c, lalr1.cc and glr.cc.
3388 * tests/java.at: Comment changes.
3389 (AT_CHECK_JAVA_MINIMAL): Define the END token.
3390 (Java parser class and package names): Add token.prefix check.
3391
33922008-12-08 Akim Demaille <demaille@gostai.com>
3393
3394 Fix regeneration of atconfig.
3395 * tests/local.mk (tests/atconfig): The rule was incorrect, but
3396 remove it: now that there is no tests/Makefile.am, the top-level
3397 Makefile properly updates atconfig when needed.
3398
33992008-12-07 Di-an Jan <dianj@freeshell.org>
3400
3401 Implement the FIXME that ends an user action with a semicolon
3402 if it seems necessary.
3403 * src/scan-code.l (flex rules section): Flag cpp directive from
3404 any `#' to the first unescaped end-of-line. Semicolon is not
3405 needed after `;', `{', '}', or cpp directives and is needed after
3406 any other token (whitespaces and comments have no effect).
3407 * tests/actions.at (Fix user actions without a trailing semicolon):
3408 New test.
3409 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
3410 to make user actions complete statements.
3411 Adjust column numbers in error messages.
3412 * tests/regression.at (Fix user actions without a trailing semicolon):
3413 Remove. Covered by new test.
3414
34152008-12-07 Akim Demaille <demaille@gostai.com>
3416
3417 Update gnulib.
3418 * gnulib: Update from master.
3419
34202008-12-05 Eric Blake <ebb9@byu.net>
3421
3422 Avoid compiler warning.
3423 * src/output.c (muscle_insert_item_number_table): Delete unused
3424 function.
3425
34262008-12-02 Eric Blake <ebb9@byu.net>
3427
3428 Build testsuite with newer autoconf.
3429 * tests/output.at (m4_expand): Don't override in newer autoconf,
3430 where the underlying implementation changed.
3431 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
3432 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
3433 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
3434 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
3435 since some of them contain unbalanced ')'.
3436
34372008-12-01 Akim Demaille <demaille@gostai.com>
3438
3439 Use b4_symbol for printers and destructors everywhere.
3440 * data/bison.m4 (b4_symbol_action_location): New.
3441 * data/c.m4 (b4_symbol_actions): Remove.
3442 Adjust all callers to use by b4_symbol_foreach and the corresponding
3443 b4_symbol_printer/destructor macro.
3444 * data/glr.cc: Adjust.
3445 * data/lalr1.java: Adjust the %destructor sanity check.
3446 * src/output.c (symbol_code_props_output): Remove, we no longer
3447 need the b4_symbol_printers/destructors tables.
3448
34492008-12-01 Akim Demaille <demaille@gostai.com>
3450
3451 Use b4_symbol_case_.
3452 * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use
3453 b4_symbol_case_.
3454
34552008-12-01 Akim Demaille <demaille@gostai.com>
3456
3457 Move b4_symbol based macro to bison.m4.
3458 * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if)
3459 (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer)
3460 (b4_symbol_case_, b4_symbol_foreach, b4_type_action_)
3461 (b4_type_foreach): Move to...
3462 * data/bison.m4: Here.
3463 * data/lalr1.cc (b4_symbol_action): Specialize for C++: use
3464 b4_symbol_value_template instead of b4_symbol_value.
3465
34662008-12-01 Akim Demaille <demaille@gostai.com>
3467
3468 b4_symbol/type_foreach.
3469 * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New.
3470 Use them.
3471
34722008-12-01 Akim Demaille <demaille@gostai.com>
3473
3474 Use the symbol properties to output the printer/destructor for lalr1.cc.
3475 Instead of defining complex list of tuples to define various
3476 properties of the symbols, we now prefer to define symbols as
3477 "structs" in m4: using the symbol key (its number), and the
3478 property name, b4_symbol gives it value. Use this to handle
3479 destructors and printers.
3480
3481 * src/output.c (CODE_PROP): New.
3482 (prepare_symbol_definitions): Use it to define the printer and
3483 destructor related attributes of the symbols.
3484 * data/lalr1.cc (b4_symbol_actions): Rename as...
3485 (b4_symbol_action): this.
3486 Use b4_symbol instead of 6 arguments.
3487 (b4_symbol_printer, b4_symbol_destructor): New.
3488 Use them instead of b4_symbol_actions.
3489
34902008-12-01 Akim Demaille <demaille@gostai.com>
3491
3492 Avoid capturing variables too easily.
3493 * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use
3494 v__ and p__ instead of v and p.
3495
34962008-12-01 Akim Demaille <demaille@gostai.com>
3497
3498 Remove spurious empty line before syncline.
3499 * data/bison.m4 (b4_syncline): Don't output an empty line before
3500 the output.
3501
35022008-11-26 Akim Demaille <demaille@gostai.com>
3503
3504 Convert lib/Makefile.am into lib/local.mk.
3505 The real problem is rather gnulib.mk, which itself is extracted
3506 from a Makefile.am that gnulib expects to the "recursive". The
3507 tool prefix-gnulib-mk converts such a gnulib.mk to be
3508 non-recursive. Also, some AC_SUBST variables need to be adjusted.
3509
3510 * etc/prefix-gnulib-mk: New.
3511 * bootstrap (slurp): Use it to convert further gnulib.mk.
3512 No longer try to avoid re-creation of lib/gnulib.mk as the changes
3513 are deeper.
3514 * lib/Makefile.am: Rename as...
3515 * lib/local.mk: this.
3516 Adjust to be prefixed.
3517 * Makefile.am, configure.ac: Adjust.
3518 * src/local.mk (AM_CPPFLAGS): Extend it, don't define it.
3519
35202008-11-26 Akim Demaille <demaille@gostai.com>
3521
3522 s/_FLAGS/FLAGS/.
3523 * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as...
3524 (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS.
3525 Reported by Eric Blake.
3526
35272008-11-26 Akim Demaille <demaille@gostai.com>
3528
3529 Use b4_parser_tables_define in glr.cc.
3530 * data/glr.c: Use b4_parser_tables_define instead of defining the
3531 (deterministic integral) tables by hand.
3532
35332008-11-26 Akim Demaille <demaille@gostai.com>
3534
3535 Use b4_parser_tables_define in Java.
3536 * data/java.m4 (b4_typed_parser_table): Rename as...
3537 (b4_typed_parser_table_define): this, for consistency.
3538 Accept a comment as $4.
3539 Move $2 into yy*_.
3540 (b4_integral_parser_table): Rename as...
3541 (b4_integral_parser_table_define): this.
3542 * data/lalr1.java: Adjust all uses.
3543 Use b4_parser_tables_define instead of generation by hand.
3544
35452008-11-26 Akim Demaille <demaille@gostai.com>
3546
3547 Prepare the convergence bw C style and Java table generation.
3548 * data/bison.m4 (b4_tables_map, b4_tables_declare)
3549 (b4_tables_define): Rename as...
3550 (b4_integral_parser_tables_map, b4_parser_tables_declare)
3551 (b4_parser_tables_define): these.
3552 * data/c.m4 (b4_table_define): Rename as...
3553 (b4_integral_parser_table_define): this.
3554 * data/lalr1.cc: Adjust.
3555 (b4_table_define, b4_table_declare): Rename as...
3556 (b4_integral_parser_table_define)
3557 (b4_integral_parser_table_declare): these.
3558 (yyrline_): Move the comment where it is actually used.
3559 * data/yacc.c: Adjust.
3560 (yyrline): Use b4_integral_parser_table_define.
3561
35622008-11-26 Akim Demaille <demaille@gostai.com>
3563
3564 Regen.
3565 * src/parse-gram.h, src/parse-gram.c: Regen.
3566
35672008-11-26 Akim Demaille <demaille@gostai.com>
3568
3569 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
3570 * data/lalr1.cc (b4_tables_map): Move to...
3571 * data/bison.m4: here.
3572 Update the comment for yytable during the flight.
3573 (b4_tables_declare, b4_tables_define): New.
3574 * data/lalr1.cc: Use them.
3575 * data/c.m4 (b4_table_define): New.
3576 * data/yacc.c: Use b4_tables_define instead of output the tables
3577 by hand.
3578 * tests/regression.at (Web2c Actions): Adjust the expected output,
3579 the order of the tables changed.
3580
35812008-11-26 Akim Demaille <demaille@gostai.com>
3582
3583 Get rid of (yy)rhs and (yy)prhs.
3584 These tables are no longer needed in the parsers, and they don't seem to
3585 be useful. They are not documented either.
3586
3587 * src/output.c (prepare_rules): Get rid of rhs and prhs.
3588 Adjust the computation of (yy)r2.
3589
35902008-11-26 Akim Demaille <demaille@gostai.com>
3591
3592 Rule length is unsigned.
3593 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
3594
35952008-11-26 Akim Demaille <demaille@gostai.com>
3596
3597 Get rid of lalr1-split.cc.
3598 It was no longer maintainer.
3599
3600 * data/lalr1-split.cc: Remove.
3601 * etc/bench.pl.in (bench_fusion_parser): Remove.
3602 Adjust.
3603
36042008-11-26 Akim Demaille <demaille@gostai.com>
3605
3606 Use yy* consistently.
3607 * data/glr.c: Now that yyrhs no longer exists as a global
3608 variable, rename local "rhs" variables into "yyrhs" for
3609 consistency.
3610
36112008-11-25 Akim Demaille <demaille@gostai.com>
3612
3613 Get rid of yyrhs and yyprhs in glr.c.
3614 * data/glr.c (yyrhs, yyprhs): Remove.
3615 Instead, use the state stack and yystos.
3616
36172008-11-25 Akim Demaille <demaille@gostai.com>
3618
3619 Flag glr tests.
3620 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
3621 as an Autotest keyword.
3622
36232008-11-25 Akim Demaille <demaille@gostai.com>
3624
3625 Prefer TESTSUITE_FLAGS.
3626 TESTSUITEFLAGS is barely readable.
3627
3628 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
3629 for backward compatibility.
3630 Use the former instead of the latter.
3631
36322008-11-25 Akim Demaille <demaille@gostai.com>
3633
3634 Get rid of yyrhs and yyprhs in larl1.java.
3635 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
3636 (yy_reduce_print): Rather, use yystos_ and the state stack.
3637
36382008-11-25 Akim Demaille <demaille@gostai.com>
3639
3640 Formatting changes.
3641
36422008-11-25 Akim Demaille <demaille@gostai.com>
3643
3644 Get rid of yyrhs and yyprhs in yacc.c.
3645 They were used to get the symbol types, given a rule number, when
3646 displaying the top of the stack before a reduction. But the
3647 symbol type is available from the state stack. This has two be
3648 benefits: two tables less in the parser (making it smaller), and a
3649 more consistent use of the three stacks which will help to fuse
3650 them.
3651
3652 * data/yacc.c (yyprhs, yyrhs): Remove.
3653 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
3654 (yy_reduce_print): Take yyssp as argument.
3655 Use it, together with yystos, to get the symbol type.
3656 * tests/regression.at (Web2c Report): Remove these tables from the
3657 expected output.
3658
36592008-11-25 Akim Demaille <demaille@gostai.com>
3660
3661 b4_tables_map.
3662 The point is to factor the generation of the tables across skeletons.
3663 This is language dependant.
3664
3665 * data/c.m4 (b4_comment_): New.
3666 Should be usable to define how to generate tables independently of
3667 the language.
3668 (b4_c_comment): New.
3669 (b4_comment): Bounce to b4_c_comment.
3670 Now support $2 = [PREFIX] for indentation.
3671 * data/lalr1.cc (b4_table_declare): Don't output a comment if
3672 there is no comment.
3673 Indent it properly when there is one.
3674 Output the ending semicolon.
3675 (b4_table_define): Space changes.
3676 Output the ending semicolon.
3677 (b4_tables_map): New.
3678 Use it twice instead of declaring and defining the (integral)
3679 tables by hand.
3680
36812008-11-25 Akim Demaille <demaille@gostai.com>
3682
3683 b4_table_declare.
3684 * data/lalr1.cc (b4_table_declare): New.
3685 Use it to declare the tables defined with b4_table_define.
3686 (b4_table_define): Declare a third arg to match b4_table_declare
3687 signature.
3688 Move all the comments around invocations of b4_table_define into
3689 the invocations itselves.
3690 Move things around to have the order for declarations and
3691 definitions.
3692
36932008-11-25 Akim Demaille <demaille@gostai.com>
3694
3695 Formatting changes.
3696 * data/lalr1.java: here.
3697
36982008-11-25 Akim Demaille <demaille@gostai.com>
3699
3700 b4_args is more general than only C++.
3701 * data/lalr1.cc (b4_args, _b4_args): Move to...
3702 * data/bison.m4: here.
3703
37042008-11-21 Di-an Jan <dianj@freeshell.org>
3705
3706 Implement no-XXX arguments for --warnings, --report, --trace.
3707 * src/getargs.c (flags_argmatch): Handles no-XXX.
3708 Fix typo in doxygen comment.
3709
37102008-11-21 Akim Demaille <demaille@gostai.com>
3711
3712 Display the changes in cross-options.texi.
3713 * build-aux/cross-options.pl ($sep): New, to separate items.
3714 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
3715 changes.
3716
37172008-11-20 Di-an Jan <dianj@freeshell.org>
3718
3719 Improves options in the manual.
3720 * doc/bison.texinfo (-g, -x): Add space before argument.
3721 (Option Cross Key): Implement FIXME: listing directives also.
3722 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
3723 (Short Option): Special case -d. Put arguments inside @option.
3724 (Bison Directive): Add column, automatically extracted from
3725 src/scan-gram.l (actual name passed as the first argument)
3726 with special case for %define.
3727 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
3728 to build-aux/cross-options.pl.
3729 * src/getargs.c (usage): Document limitations of cross-options.pl.
3730 * src/scan-gram.l: Likewise.
3731
37322008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
3733
3734 Fix unexpanded macros in GLR defines file.
3735 Reported by Csaba Raduly at
3736 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
3737 * THANKS (Csaba Raduly): Add.
3738 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
3739 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
3740 lexer in a separate module that includes the defines file.
3741 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
3742 source.
3743 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
3744 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
3745 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
3746 (AT_DATA_SOURCE_PROLOGUE): New.
3747 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
3748 (AT_DATA_SOURCE): New.
3749 (AT_FULL_COMPILE): Extend to support an additional source file.
3750
37512008-11-18 Akim Demaille <demaille@gostai.com>
3752
3753 More TODO.
3754 * TODO: More short term issues.
3755
37562008-11-18 Akim Demaille <demaille@gostai.com>
3757
3758 Regen.
3759 * src/parse-gram.h, src/parse-gram.c: Regen.
3760
37612008-11-18 Akim Demaille <demaille@gostai.com>
3762
3763 Use b4_subtract where possible.
3764 * data/lalr1.cc (b4_subtract): Move to...
3765 * data/bison.m4: here.
3766 * data/glr.c (b4_rhs_data): Use it.
3767 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
3768
37692008-11-18 Akim Demaille <demaille@gostai.com>
3770
3771 Remove incorrect mode specification.
3772 * data/glr.cc: Don't pretend it's C code.
3773
37742008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
3775
3776 Simplify last patch slightly.
3777 * src/getargs.c (getargs): Here.
3778
37792008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
3780
3781 Fix last warning from --enable-gcc-warnings.
3782 * src/getargs.c (getargs): Don't assign const address to non-const
3783 pointer.
3784
37852008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
3786
3787 Don't let maintainer-*-check targets force a version update.
3788 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
3789 handled.
3790
37912008-11-17 Di-an Jan <dianj@freeshell.org>
3792
3793 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
3794 Align menus. Adjust word wrapping. Use node names for menu names.
3795 (Examples): Don't abbreviate node names.
3796 (LocalWords): Remove abbreviations.
3797 (Copying): Make description a sentence.
3798 (Java Action Features): Remove period to match the rest of menu.
3799
38002008-11-17 Di-an Jan <dianj@freeshell.org>
3801
3802 Handles several --enable-gcc-warnings.
3803 * src/getargs.c (command_line_location): Set parameters to void.
3804 * src/output.c (symbol_type_name_cmp): Make static.
3805 (symbols_by_type_name): Set parameters to void.
3806 (symbol_definitions_output): Remove unused parameter. Rename as...
3807 (prepare_symbol_definitions): this.
3808 (muscles_output): Move symbol_definitions_output to...
3809 (output): here as prepare_symbol_definitions.
3810 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
3811 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
3812
38132008-11-17 Di-an Jan <dianj@freeshell.org>
3814
3815 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
3816 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
3817
38182008-11-16 Akim Demaille <demaille@gostai.com>
3819
3820 Add missing $(EXEEXT).
3821 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
3822 "src/bison$(EXEEXT)".
3823 Reported by Di-an Jan.
3824
38252008-11-15 Akim Demaille <demaille@gostai.com>
3826
3827 * TODO: Update.
3828
38292008-11-15 Akim Demaille <demaille@gostai.com>
3830
3831 Formatting changes.
3832 * tests/input.at: here.
3833
38342008-11-15 Akim Demaille <demaille@gostai.com>
3835
3836 Remove duplicate header inclusion.
3837 * src/LR0.c: here.
3838
38392008-11-15 Akim Demaille <demaille@gostai.com>
3840
3841 * src/parse-gram.h, src/parse-gram.c: Regen.
3842
38432008-11-15 Akim Demaille <demaille@gostai.com>
3844
3845 Support parametric types.
3846
3847 There are two issues to handle: first scanning nested angle
3848 bracket pairs to support types such as std::pair< std::string,
3849 std::list<std::string> > >.
3850
3851 Another issue is to address idiosyncracies of C++: do not glue two
3852 closing angle brackets together (otherwise it's operator>>), and
3853 avoid sticking blindly a TYPE to the opening <, as it can result
3854 in '<:' which is a digraph for '['.
3855
3856 * src/scan-gram.l (brace_level): Rename as...
3857 (nesting): this.
3858 (SC_TAG): New.
3859 Implement support for complex tags.
3860 (tag): Accept
3861 , but not <.
3862 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
3863 (b4_symbol_variant): Leave space around types as parameters.
3864 * examples/variant.yy: Use nested template types and leading ::.
3865 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
3866 Rename as...
3867 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
3868 * tests/c++.at: Test parametric types.
3869
38702008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3871
3872 Test token.prefix.
3873 This is not sufficient, but we test at least that the make_SYMBOL
3874 interface is not affected by token.prefix. A more general test
3875 will be implemented when the support of token.prefix is generalized
3876 to more skeletons.
3877
3878 * tests/c++.at: One more variant test, using token.prefix.
3879
38802008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3881
3882 Test the make_TOKEN interface.
3883 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
3884 Factor the common code in yylex.
3885 Use it to test "%define lex_symbol".
3886
38872008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3888
3889 Formatting change.
3890
38912008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3892
3893 Simplify code for variants bench marks.
3894 * etc/bench.pl.in (&generate_grammar_list): Define and use
3895 location_type.
3896 Factor the common code in yylex.
3897
38982008-11-15 Akim Demaille <demaille@gostai.com>
3899
3900 Better error message.
3901 * bootstrap (find_tool): Fix the error message.
3902
39032008-11-15 Akim Demaille <demaille@gostai.com>
3904
3905 Update variant.yy to newest interface.
3906 * examples/variant.yy: Define lex_symbol.
3907 Adjust.
3908
39092008-11-15 Akim Demaille <demaille@gostai.com>
3910
3911 Don't use locations in variant.yy.
3912 * examples/variant.yy: Adjust to not using locations.
3913
39142008-11-15 Akim Demaille <demaille@gostai.com>
3915
3916 Comment changes.
3917 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
3918 comments for the license.
3919
39202008-11-15 Akim Demaille <demaille@gostai.com>
3921
3922 Remove tests/Makefile.am.
3923 * tests/Makefile.am: Rename as...
3924 * tests/local.mk: this.
3925 * Makefile.am, configure.ac: Adjust.
3926 * Makefile.am (DISTCLEANFILES): Define.
3927 (maintainer-check, maintainer-xml-check, maintainer-push-check):
3928 Remove, we no longer need to bounce to the real targets.
3929
39302008-11-15 Akim Demaille <demaille@gostai.com>
3931
3932 Comment changes.
3933
39342008-11-15 Akim Demaille <demaille@gostai.com>
3935
3936 djgpp/local.mk.
3937 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
3938 * djgpp/local.mk: this new file.
3939
39402008-11-15 Akim Demaille <demaille@gostai.com>
3941
3942 Remove doc/Makefile.am.
3943 * doc/Makefile.am: Rename as...
3944 * doc/local.mk: this.
3945 Adjust paths
3946 * Makefile.am, configure.ac: Adjust.
3947 * Makefile.am (MOSTLYCLEANFILES): New.
3948 * src/local.mk: Adjust.
3949
39502008-11-15 Akim Demaille <demaille@gostai.com>
3951
3952 Move sc_tight_scope into maint.mk.
3953 It does not work, and I don't know how it was supposed to work: it
3954 seems to be looking for sources in the build tree. I just moved
3955 it at a better place, fixing it is still required.
3956
3957 * src/local.mk (echo): Remove.
3958 (sc_tight_scope): Move to...
3959 * maint.mk: here.
3960
39612008-11-15 Akim Demaille <demaille@gostai.com>
3962
3963 Regen.
3964 * src/parse-gram.h, src/parse-gram.h: Regen.
3965
39662008-11-15 Akim Demaille <demaille@gostai.com>
3967
3968 Remove src/Makefile.am.
3969 * src/Makefile.am: Rename as...
3970 * src/local.mk: this.
3971 Prefix all the paths with src/.
3972 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
3973 (AM_CPPFLAGS): Find find in builddir/src.
3974 (YACC): Move the flags into...
3975 (AM_YFLAGS): here.
3976 * maint.mk (sc_tight_scope): Disable.
3977 It used to bounce to the version in src/Makefile.am which is now
3978 part of this very Makefile.
3979 * Makefile.am, configure.ac: Adjust.
3980 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
3981 include "..." to find files "here": we are no longer in src/, so
3982 qualify the includes with src/.
3983 * doc/Makefile.am (PREPATH): No longer include the top_builddir
3984 prefix.
3985 (.x.1): Adjust to be able to create src/foo from the top level
3986 Makefile, instead of going bounce to src/Makefile the creation of
3987 foo.
3988
39892008-11-15 Akim Demaille <demaille@gostai.com>
3990
3991 Remove useless variable.
3992 * doc/Makefile.am (srcsrcdir): Remove.
3993
39942008-11-15 Akim Demaille <demaille@gostai.com>
3995
3996 Remove data/Makefile.am.
3997 * data/Makefile.am: Rename as...
3998 * data/local.mk: this.
3999 Adjust paths.
4000 * Makefile.am, configure.ac: Adjust.
4001
40022008-11-15 Akim Demaille <demaille@gostai.com>
4003
4004 Remove etc/Makefile.am.
4005 * etc/Makefile.am: Rename as...
4006 * etc/local.mk: this.
4007 Adjust.
4008 * Makefile.am, configure.ac: Adjust.
4009
40102008-11-15 Akim Demaille <demaille@gostai.com>
4011
4012 Remove examples/local.mk.
4013 examples/calc++/Makefile.am might be interesting to keep as is, since
4014 it is an example in itself.
4015
4016 * examples/Makefile.am: Rename as...
4017 * examples/local.mk: this.
4018 Adjust.
4019 * Makefile.am, configure.ac: Adjust.
4020
40212008-11-15 Akim Demaille <demaille@gostai.com>
4022
4023 Remove build-aux/Makefile.am.
4024 Recursive Makefiles are really way too slow, let's get rid of some of
4025 them.
4026
4027 * build-aux/Makefile.am: Rename as...
4028 * build-aux/local.mk: this.
4029 Adjust paths.
4030 * Makefile.am, configure.ac: Adjust.
4031
40322008-11-15 Akim Demaille <demaille@gostai.com>
4033
4034 Provide convenience constructors for locations and positions.
4035 * data/location.cc (position::position): Accept file, line and
4036 column as arguments with default values.
4037 Always qualify initial line and column literals as unsigned.
4038 (location::location): Provide convenience constructors.
4039
40402008-11-15 Akim Demaille <demaille@gostai.com>
4041
4042 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
4043 token type.
4044 Using template buys us nothing, and makes it uselessly complex to
4045 construct a symbol. Besides, it could not be generalized to other
4046 languages, while make_FOO would work in C/Java etc.
4047
4048 * data/lalr1.cc (b4_symbol_): New.
4049 (b4_symbol): Use it.
4050 (b4_symbol_constructor_declaration_)
4051 (b4_symbol_constructor_definition_): Instead of generating
4052 specializations of an overloaded template function, just generate
4053 several functions whose names are forged from the token names
4054 without the token.prefix.
4055 (b4_symbol_constructor_declarations): Generate them for all the
4056 symbols, not just by class of symbol type, now that instead of
4057 specializing a function template by the token, we generate a
4058 function named after the token.
4059 (b4_symbol_constructor_specialization_)
4060 (b4_symbol_constructor_specializations): Remove.
4061 * etc/bench.pl.in: Adjust to this new API.
4062
40632008-11-13 Akim Demaille <demaille@gostai.com>
4064
4065 %define token.prefix.
4066 Provide a means to add a prefix to the name of the tokens as
4067 output in the generated files. Because of name clashes, it is
4068 good to have such a prefix such as TOK_ that protects from names
4069 such as EOF, FILE etc. But it clutters the grammar itself.
4070
4071 * data/bison.m4 (token.prefix): Empty by default.
4072 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
4073 * data/lalr1.cc (b4_symbol): Ditto.
4074
40752008-11-13 Akim Demaille <demaille@gostai.com>
4076
4077 Compute at M4 time some of the subtractions.
4078 * data/lalr1.cc (b4_subtract): New.
4079 (b4_rhs_data): Use it.
4080
40812008-11-13 Akim Demaille <demaille@gostai.com>
4082
4083 symbol::token.
4084 This allows the user to get the type of a token returned by yylex.
4085
4086 * data/lalr1.cc (symbol::token): New.
4087 (yytoknum_): Define when %define lex_symbol, independently of
4088 %debug.
4089 (yytoken_number_): Move into...
4090 (symbol::token): here, since that's the only use.
4091 The other one is YYPRINT which was not officially supported
4092 by lalr1.cc, and anyway it did not work since YYPRINT uses this
4093 array under a different name (yytoknum).
4094
40952008-11-13 Akim Demaille <demaille@gostai.com>
4096
4097 YYERRCODE.
4098 * TODO (YYERRCODE): Mention the case of $undef.
4099
41002008-11-13 Akim Demaille <demaille@gostai.com>
4101
4102 TODO: YYPRINT.
4103 * TODO (YYPRINT): New.
4104
41052008-11-13 Akim Demaille <demaille@gostai.com>
4106
4107 Comment changes.
4108 * data/lalr1.cc, data/yacc.c: Fix the description of the
4109 yytranslate and yytoknum tables.
4110
41112008-11-13 Akim Demaille <demaille@gostai.com>
4112
4113 Define make_symbol in the header.
4114 To reach good performances these functions should be inlined (yet
4115 this is to measure precisely). To this end they must be available
4116 to the caller.
4117
4118 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
4119 location_type with the class name.
4120 Since will now be output in the header, declare "inline".
4121 No longer use b4_symbol_constructor_specializations, but
4122 b4_symbol_constructor_definitions in the header.
4123 Don't call it in the *.cc file.
4124
41252008-11-13 Akim Demaille <demaille@gostai.com>
4126
4127 Define yytranslate in the header for lex_symbol.
4128 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
4129 into the header file when using %define lex_symbol.
4130 (yytranslate_): Declare inline.
4131
41322008-11-13 Akim Demaille <demaille@gostai.com>
4133
4134 Define the constructors of symbol_type in
4135 b4_symbol_constructor_definitions.
4136 The constructors are called by the make_symbol functions, which a
4137 forthcoming patch will move elsewhere. Hence the interest of
4138 putting them together.
4139
4140 The stack_symbol_type does not need to be moved, it is used only
4141 by the parser.
4142
4143 * data/lalr1.cc: Move symbol_type and symbol_base_type
4144 constructors into...
4145 (b4_symbol_constructor_definitions): here.
4146 Adjust.
4147
41482008-11-13 Akim Demaille <demaille@gostai.com>
4149
4150 Make it easier to move the definition of yytranslate_.
4151 Forthcoming changes will make it possible to use yytranslate_
4152 from outside the parser implementation file.
4153
4154 * data/lalr1.cc (b4_yytranslate_definition): New.
4155 Use it.
4156
41572008-11-13 Akim Demaille <demaille@gostai.com>
4158
4159 Remove useless class specification.
4160 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
4161 to refer to the class name to use a type defined by the class for
4162 arguments of member functions.
4163
41642008-11-13 Akim Demaille <demaille@gostai.com>
4165
4166 Finer input type for yytranslate.
4167 This patch is debatable: the tradition expects yylex to return an int
4168 which happens to correspond to token_number (which is an enum). This
4169 allows for instance to return characters (such as '*' etc.). But this
4170 goes against the stronger typing I am trying to have with the new
4171 lex interface which return a symbol_type. So in this case, feed
4172 yytranslate_ with a token_type.
4173
4174 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
4175 expect a token_type.
4176
41772008-11-13 Akim Demaille <demaille@gostai.com>
4178
4179 Honor lex-params in %define lex_symbol mode.
4180 * data/lalr1.cc: Use b4_lex_param.
4181
41822008-11-13 Akim Demaille <demaille@gostai.com>
4183
4184 Simplify names.
4185 * src/output.c (symbol_definitions_output): Rename symbol
4186 attributes type_name and has_type_name as type and has_type.
4187 * data/lalr1.cc: Adjust uses.
4188
41892008-11-13 Akim Demaille <demaille@gostai.com>
4190
4191 Use b4_type_names for the union type.
4192 The union used to compute the size of the variant used to iterate
4193 over the type of all the symbols, with a lot of redundancy. Now
4194 iterate over the lists of symbols having the same type-name.
4195
4196 * data/lalr1.cc (b4_char_sizeof_): New.
4197 (b4_char_sizeof): Use it.
4198 Adjust to be called with a list of numbers instead of a single
4199 number.
4200 Adjust its caller for new-line issues.
4201
42022008-11-13 Akim Demaille <demaille@gostai.com>
4203
4204 Define the "identifier" of a symbol.
4205 Symbols may have several string representations, for instance if
4206 they have an alias. What I call its "id" is a string that can be
4207 used as an identifier. May not exist.
4208
4209 Currently the symbols which have the "tag_is_id" flag set are
4210 those that don't have an alias. Look harder for the id.
4211
4212 * src/output.c (is_identifier): Move to...
4213 * src/symtab.c (is_identifier): here.
4214 * src/symtab.h, src/symtab.c (symbol_id_get): New.
4215 * src/output.c (symbol_definitions_output): Use it to define "id"
4216 and "has_id".
4217 Remove the definition of "tag_is_id".
4218 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
4219 "tag_is_id" were used to produce code.
4220 We still use "tag" for documentation.
4221
42222008-11-11 Akim Demaille <demaille@gostai.com>
4223
4224 Locations are no longer required by lalr1.cc.
4225 * data/lalr1.cc (_b4_args, b4_args): New.
4226 Adjust all uses of locations to make them optional.
4227 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
4228 (AT_CHECK_NAMESPACE): Check the use of locations.
4229 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
4230 without locations with lalr1.cc.
4231 Test these cases.
4232 * tests/output.at: Check lalr1.cc with and without location
4233 support.
4234 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
4235 Don't use locations.
4236
42372008-11-11 Akim Demaille <demaille@gostai.com>
4238
4239 AT_FULL_COMPILE.
4240 * tests/local.at (AT_FULL_COMPILE): New.
4241 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
4242
42432008-11-11 Akim Demaille <demaille@gostai.com>
4244
4245 Support parens in calc++.
4246 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
4247 * examples/calc++/test (run): Check the expected output.
4248 Adjust callers.
4249 Check parens too.
4250
42512008-11-11 Akim Demaille <demaille@gostai.com>
4252
4253 Simplify lalr1.cc since %defines is mandatory.
4254 * data/lalr1.cc: Remove useless calls to b4_defines_if.
4255
42562008-11-11 Akim Demaille <demaille@gostai.com>
4257
4258 TODO: yyfmt.
4259 * TODO (yysyntax_error): New item.
4260
42612008-11-11 Akim Demaille <demaille@gostai.com>
4262
4263 Prefer M4 to CPP.
4264 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
4265 YYERROR_VERBOSE.
4266
42672008-11-11 Akim Demaille <demaille@gostai.com>
4268
4269 Support i18n of the parse error messages.
4270 * TODO (lalr1.cc/I18n): Remove.
4271 * data/lalr1.cc (yysyntax_error_): Support the translation of the
4272 error messages, as done in yacc.c.
4273 Stay within the yy* pseudo namespace.
4274
42752008-11-11 Akim Demaille <demaille@gostai.com>
4276
4277 More TODO.
4278 * TODO (single stack, yysyntax_error): New.
4279
42802008-11-11 Akim Demaille <demaille@gostai.com>
4281
4282 Make it possible to return a symbol_type from yylex.
4283 * data/lalr1.cc (b4_lex_symbol_if): New.
4284 (parse): When lex_symbol is defined, expected yylex to return the
4285 complete lookahead.
4286 * etc/bench.pl.in (generate_grammar_list): Extend to support this
4287 yylex interface.
4288 (bench_variant_parser): Exercise it.
4289
42902008-11-11 Akim Demaille <demaille@gostai.com>
4291
4292 Remove useless bench case.
4293 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
4294 no longer used.
4295
42962008-11-11 Akim Demaille <demaille@gostai.com>
4297
4298 Improve display of directives.
4299 * etc/bench.pl.in (parse_term): Don't add useless eol.
4300
43012008-11-11 Akim Demaille <demaille@gostai.com>
4302
4303 Use string_cast in the bench.
4304 * etc/bench.pl.in (generate_grammar_list): Define and use
4305 string_cast.
4306
43072008-11-11 Akim Demaille <demaille@gostai.com>
4308
4309 Replace yychar with a Boolean.
4310 * data/lalr1.cc (parse::yychar): Replace by...
4311 (parse::yyempty): this.
4312
43132008-11-11 Akim Demaille <demaille@gostai.com>
4314
4315 Factor the tables.
4316 * TODO: New item.
4317
43182008-11-11 Akim Demaille <demaille@gostai.com>
4319
4320 Let yytranslate handle the eof case.
4321 * data/lalr1.cc (yytranslate_): Handle the EOF case.
4322 Adjust callers.
4323 No longer expect yychar to be equal to yyeof_, rather, test the
4324 lookahead's (translated) kind.
4325
43262008-11-11 Akim Demaille <demaille@gostai.com>
4327
4328 yychar cannot be empty in yyerrlab.
4329 * TODO (yychar == yyempty_): New.
4330 * data/lalr1.cc: Remove the handling of this case.
4331 This eases forthcoming changes related to yychar and yytranslate.
4332
43332008-11-11 Akim Demaille <demaille@gostai.com>
4334
4335 Bench: syntactic sugar for %define/#define.
4336 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
4337 (&bench_push_parser, bench_variant_parser): Use this feature.
4338 (&eat): New.
4339 Use it.
4340
43412008-11-11 Akim Demaille <demaille@gostai.com>
4342
4343 Less memory pressure on the "list" bench.
4344 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
4345 the values, to limit memory pressure.
4346
43472008-11-11 Akim Demaille <demaille@gostai.com>
4348
4349 Introduce make_symbol.
4350 make_symbol provides a means to construct a full symbol (kind,
4351 value, location) in a single shot. It is meant to be a Symbol
4352 constructor, parameterized by the symbol kind so that overloading
4353 would prevent incorrect kind/value pairs. Unfortunately
4354 parameterized constructors do not work well in C++ (unless the
4355 parameter also appears as an argument, which is not acceptable),
4356 hence the use of a function instead of a constructor.
4357
4358 * data/lalr1.cc (b4_symbol_constructor_declaration_)
4359 (b4_symbol_constructor_declarations)
4360 (b4_symbol_constructor_specialization_)
4361 (b4_symbol_constructor_specializations)
4362 (b4_symbol_constructor_definition_)
4363 (b4_symbol_constructor_definitions): New.
4364 Use them where appropriate to generate declaration, declaration of
4365 the specializations, and implementations of the templated
4366 overloaded function "make_symbol".
4367 (variant::variant): Always define a default ctor.
4368 Also provide a copy ctor.
4369 (symbol_base_type, symbol_type): New ctor overloads for value-less
4370 symbols.
4371 (symbol_type): Now public, so that functions such as yylex can use
4372 it.
4373
43742008-11-11 Akim Demaille <demaille@gostai.com>
4375
4376 Inform m4 whether a tag is a valid id.
4377 * src/output.c (is_identifier): New.
4378 (symbol_definitions_output): Use it to define tag_is_id.
4379 But maybe this should be done at m4 level?
4380
43812008-11-11 Akim Demaille <demaille@gostai.com>
4382
4383 Test 214 was failing: it greps with a pattern containing [ ]*
4384 which obviously meant to catch spaces and tabs, but contained only
4385 spaces. Tabulations in sources are a nuisance, so to simplify the
4386 matter, get rid of all the tabulations in the Java sources. The
4387 other skeletons will be treated equally later.
4388
4389 * data/java.m4, data/lalr1.java: Untabify.
4390 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
4391 tabulations are no longer generated.
4392
43932008-11-11 Paolo Bonzini <bonzini@gnu.org>
4394
4395 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
4396 * configure.ac: Adjust usage.
4397 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
4398 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
4399 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
4400
44012008-11-10 Di-an Jan <dianj@freeshell.org>
4402
4403 Workaround Java's ``code too large'' problem for parser tables
4404 in most cases, by using one function per initialization.
4405 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
4406 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
4407 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
4408 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
4409 (yytname_): Use b4_typed_parser_table.
4410 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
4411 ``code too large'' error.
4412
44132008-11-10 Di-an Jan <dianj@freeshell.org>
4414
4415 * NEWS: Document them.
4416
4417 General Java skeleton improvements.
4418 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
4419 using gcj < 4.3 in the testsuite, according to comments in
4420 gnulib/m4/javacomp.m4.
4421 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
4422 location_type, position_type): Remove extraneous brackets from
4423 b4_percent_define_default.
4424 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
4425 m4_define and m4_define_default.
4426 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
4427 which marks the end of user code with appropriate syncline, like all
4428 the other skeletons.
4429 (b4_user_post_prologue): Add. Don't silently drop.
4430 (yylex): Remove.
4431 (parse): Inline yylex.
4432 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
4433 (%{...%}): Fix typo of %code imports.
4434 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
4435
4436 Support annotations on parser class with %define annotations.
4437 * data/lalr1.java (annotations): Add to parser class modifier.
4438 * doc/bison.texinfo (Java Parser Interface): Document
4439 %define annotations.
4440 (Java Declarations Summary): Document %define annotations.
4441 * tests/java.at (Java parser class modifiers): Test annotations.
4442
4443 Do not generate code for %error-verbose unless requested.
4444 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
4445 Make private. Make conditional on %error-verbose.
4446 (getErrorVerbose, setErrorVerbose): New.
4447 (yytnamerr_): Make conditional on %error-verbose.
4448 (yysyntax_error): Make some code conditional on %error-verbose.
4449 * doc/bison.texinfo (Java Bison Interface): Remove the parts
4450 about %error-verbose having no effect.
4451 (getErrorVerbose, setErrorVerbose): Document.
4452
4453 Move constants for token names to Lexer interface.
4454 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
4455 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
4456 (parse): Qualify EOF to Lexer.EOF.
4457 * doc/bison.texinfo (Java Parser Interface): Move documentation of
4458 EOF and token names to Java Lexer Interface.
4459 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
4460
4461 Make yyerror public.
4462 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
4463 (yyerror): Change to public. Add Javadoc comments. Use longer
4464 parameter names. Make the body rather than the declarator
4465 conditional on %locations.
4466 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
4467
4468 Allow user to add code to the constructor with %code init.
4469 * data/java.m4 (b4_init_throws): New, for %define init_throws.
4470 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
4471 Add %code init to the front of the constructor body.
4472 * doc/bison.texinfo (YYParser.YYParser): Document %code init
4473 and %define init_throws.
4474 (Java Declarations Summary): Document %code init and
4475 %define init_throws.
4476 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
4477 (Java constructor init and init_throws): Add tests.
4478
44792008-11-10 Akim Demaille <demaille@gostai.com>
4480
4481 Update TODO.
4482 * TODO (-D): is implemented.
4483 (associativity): Same precedence must have the same associativity.
4484 For instance, how can a * b / c be parsed if * is %left and / is
4485 %right?
4486 (YYERRORCODE, YYFAIL, YYBACKUP): New.
4487
44882008-11-10 Akim Demaille <demaille@gostai.com>
4489
4490 Formatting changes.
4491
44922008-11-10 Akim Demaille <demaille@gostai.com>
4493
4494 More information about the symbols.
4495 * src/output.c (type_names_output): Document all the symbols,
4496 including those that don't have a type-name.
4497 (symbol_definitions_output): Define "is_token" and
4498 "has_type_name".
4499 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
4500 type-name, now that they are defined too in b4_type_names.
4501
45022008-11-10 Akim Demaille <demaille@gostai.com>
4503
4504 Regen.
4505
45062008-11-10 Akim Demaille <demaille@gostai.com>
4507
4508 Make parser::yytranslate static.
4509 Small speedup (1%) on the list grammar. And makes yytranslate_
4510 available in non member functions.
4511
4512 * data/lalr1.cc (yytranslate_): Does not need to be a instance
4513 function.
4514
45152008-11-10 Akim Demaille <demaille@gostai.com>
4516
4517 Avoid trailing spaces.
4518 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
4519 * data/lalr1.cc: Don't indent before rule and symbol actions, as
4520 they can be empty, and anyway this incorrectly indents the first
4521 action.
4522
45232008-11-10 Akim Demaille <demaille@gostai.com>
4524
4525 Comment changes.
4526
45272008-11-10 Akim Demaille <demaille@gostai.com>
4528
4529 Use "enum" for integral constants.
4530 This is just nicer to read, I observed no speedup.
4531
4532 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
4533 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
4534 (yyuser_token_number_max_, yyundef_token_): Move into...
4535 (yytranslate_): here.
4536
45372008-11-10 Akim Demaille <demaille@gostai.com>
4538
4539 Shortcuts in bench directives.
4540 * etc/bench.pl.in (parse_dirs): New.
4541 Use it.
4542 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
4543 Create the benches in "benches/".
4544
45452008-11-10 Akim Demaille <demaille@gostai.com>
4546
4547 Formatting changes.
4548 * data/lalr1.cc: here.
4549
45502008-11-10 Akim Demaille <demaille@gostai.com>
4551
4552 Adjust verbose message to using emacs.
4553 * etc/bench.pl.in: Inform compilation-mode when we change the
4554 directory.
4555 (generate_grammar_list): Recognize %define "variant" in addition
4556 to %define variant.
4557
45582008-11-10 Akim Demaille <demaille@gostai.com>
4559
4560 Classify symbols by type-name.
4561 * src/uniqstr.h (UNIQSTR_CMP): New.
4562 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
4563 (type_names_output): New.
4564 (muscles_output): Use it.
4565 * data/lalr1.cc (b4_symbol_action_): Remove.
4566 (b4_symbol_case_, b4_type_action_): New.
4567 Adjust uses of b4_symbol_action_ to use b4_type_action_.
4568
45692008-11-10 Akim Demaille <demaille@gostai.com>
4570
4571 Change the handling of the symbols in the skeletons.
4572 Before we were using tables which lines were the symbols and which
4573 columns were things like number, tag, type-name etc. It is was
4574 difficult to extend: each time a column was added, all the numbers had
4575 to be updated (you asked for colon $2, not for "tag"). Also, it was
4576 hard to filter these tables when only a subset of the symbols (say the
4577 tokens, or the nterms, or the tokens that have and external number
4578 *and* a type-name) was of interest.
4579
4580 Now instead of monolithic tables, we define one macro per cell. For
4581 instance "b4_symbol(0, tag)" is a macro name which contents is
4582 self-decriptive. The macro "b4_symbol" provides easier access to
4583 these cells.
4584
4585 * src/output.c (type_names_output): Remove.
4586 (symbol_numbers_output, symbol_definitions_output): New.
4587 (muscles_output): Call them.
4588 (prepare_symbols): Define b4_symbols_number.
4589
45902008-11-10 Akim Demaille <demaille@gostai.com>
4591
4592 --trace=muscles
4593 * src/getargs.h, src/getargs.c (trace_muscle): New.
4594 (trace_types, trace_args): Support it.
4595 * src/output.c (output_skeleton): Use it.
4596
45972008-11-10 Akim Demaille <demaille@gostai.com>
4598
4599 muscles_output.
4600 * src/output.c (muscles_output): New, extracted from...
4601 (output_skeleton): here.
4602 Adjust.
4603
46042008-11-10 Akim Demaille <demaille@gostai.com>
4605
4606 Formatting changes.
4607
46082008-11-10 Akim Demaille <demaille@gostai.com>
4609
4610 Update the variant example.
4611 * examples/variant.yy: Formatting changes.
4612 One stage build.
4613
46142008-11-10 Akim Demaille <demaille@gostai.com>
4615
4616 Support constructor with an argument.
4617 This improves the "list" bench by 2%.
4618
4619 * data/lalr1.cc (variant::build): Add an overloaded version with
4620 an argument.
4621 * tests/c++.at (AT_CHECK_VARIANT): Check it.
4622
46232008-11-10 Akim Demaille <demaille@gostai.com>
4624
4625 Test variants.
4626 * tests/c++.at (AT_CHECK_VARIANTS): New.
4627 Use it with and without %define assert.
4628
46292008-11-10 Akim Demaille <demaille@gostai.com>
4630
4631 Add %precedence support.
4632 Unfortunately it is not possible to reuse the %prec directive. This
4633 is because to please POSIX, we do not require to end the rules with a
4634 semicolon. As a result,
4635
4636 foo: bar %prec baz
4637
4638 is ambiguous: either a rule which precedence is that of baz, or a rule,
4639 and then a declaration of the precedence of the token baz.
4640
4641 * doc/bison.texinfo: Document %precedence.
4642 (Precedence Only): New.
4643 * src/assoc.h, src/assoc.c (precedence_assoc): New.
4644 * src/conflicts.c (resolve_sr_conflict): Support it.
4645 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
4646 Parse it.
4647 * tests/calc.at: Use %precedence for NEG.
4648 * tests/conflicts.at (%precedence does not suffice)
4649 (%precedence suffices): New tests.
4650
46512008-11-09 Akim Demaille <demaille@gostai.com>
4652
4653 Make benches in a sub dirs.
4654 * etc/bench.pl.in ($dir): New.
4655 Use it.
4656 Check the use of constructors with an argument.
4657 (bench_variant_parser): Fix.
4658
46592008-11-09 Akim Demaille <demaille@gostai.com>
4660
4661 fix eof condition
4662
46632008-11-09 Akim Demaille <demaille@gostai.com>
4664
4665 Fix --help.
4666
46672008-11-09 Akim Demaille <demaille@gostai.com>
4668
4669 Require the generation of parse-gram.output.
4670 * src/Makefile.am (YACC): Pass --report=all.
4671
46722008-11-09 Akim Demaille <demaille@gostai.com>
4673
4674 Formatting changes.
4675
46762008-11-09 Akim Demaille <demaille@gostai.com>
4677
4678 Update TODO.
4679 * TODO: Remove obsolete items.
4680 Update others.
4681
46822008-11-09 Akim Demaille <demaille@gostai.com>
4683
4684 Enhance bench.pl.
4685 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
4686 (@token, $grammar, $bench): New.
4687 (generate_grammar_variant): Rename as...
4688 (generate_grammar_list): this.
4689 (generate_grammar): Adjust.
4690 (bench_grammar): Rename as...
4691 (bench): this.
4692 Use it in the various bench-marking routines.
4693 (-b, -g): New options.
4694
46952008-11-09 Akim Demaille <demaille@gostai.com>
4696
4697 Use a static hierarchy for symbols in the C++ parser.
4698 * data/lalr1.cc (symbol_base_type, symbol_type)
4699 (stack_symbol_type): Make it a static hierarchy.
4700 Adjust dependencies.
4701
47022008-11-09 Akim Demaille <demaille@gostai.com>
4703
4704 bench.pl -d, --directive.
4705 * etc/bench.pl.in (@directive): New.
4706 (&bench_grammar): Use it.
4707 (&bench_list_grammar): New, to provide access to the "variant"
4708 grammar.
4709 Use it.
4710 (getopts): Support -d, --directive.
4711
47122008-11-09 Akim Demaille <demaille@gostai.com>
4713
4714 Use inline for small operations.
4715 * data/lalr1.cc (symbol_base_type, symbol_type)
4716 (stack_symbol_type): Declare constructor and other operations as
4717 inline.
4718 (yy_destroy_): Inline.
4719
47202008-11-09 Akim Demaille <demaille@gostai.com>
4721
4722 Introduce a hierarchy for symbols.
4723 * data/lalr1.cc (symbol_base_type, symbol_type): New.
4724 (data_type): Rename as...
4725 (stack_symbol_type): this.
4726 Derive from symbol_base_type.
4727 (yy_symbol_value_print_): Merge into...
4728 (yy_symbol_print_): this.
4729 Rename as...
4730 (yy_print_): this.
4731 (yydestruct_): Rename as...
4732 (yy_destroy_): this.
4733 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
4734 (parser::parse): yyla is now of symbol_type.
4735 Use its type member instead of yytoken.
4736
47372008-11-09 Akim Demaille <demaille@gostai.com>
4738
4739 Rename data_type and stack_symbol_type.
4740 * data/lalr1.cc (data_type): Rename as...
4741 (stack_symbol_type): this.
4742
47432008-11-09 Akim Demaille <demaille@gostai.com>
4744
4745 Handle semantic value and location together.
4746 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
4747 yydata.value and yydata.location.
4748 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
4749 (YY_SYMBOL_PRINT): Now take semantic value and location as a
4750 single arg.
4751 Adjust all callers.
4752 (yydestruct_): New overload for a stack symbol.
4753
47542008-11-09 Akim Demaille <demaille@gostai.com>
4755
4756 Push a complete symbol, not connected parts.
4757 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
4758 state, value and location.
4759 Adjust callers.
4760
47612008-11-09 Akim Demaille <demaille@gostai.com>
4762
4763 Agregate yylval and yylloc.
4764 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
4765 (parser::yyla): this.
4766
47672008-11-09 Akim Demaille <demaille@gostai.com>
4768
4769 Rely on the state stack to display reduction traces.
4770 To display rhs symbols before a reduction, we used information
4771 about the rule reduced, which required the tables yyrhs and
4772 yyprhs. Now use rely only on the state stack to get the same
4773 information.
4774
4775 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
4776 Use them.
4777 (parser::yyrhs_, parser::yyprhs_): Remove.
4778 (parser::yy_reduce_print_): Use the state stack.
4779
47802008-11-09 Akim Demaille <demaille@gostai.com>
4781
4782 Fuse yyval and yyloc into yylhs.
4783 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
4784 yylhs.
4785 (parse): Replace yyval and yyloc with yylhs.value and
4786 yylhs.location.
4787 After a user action, compute yylhs.state earlier.
4788 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
4789 fresh error_token.
4790
47912008-11-09 Di-an Jan <dianj@freeshell.org>
4792
4793 Remove unused variable.
4794 * src/output.c (type_names_output): Remove unused variable sep.
4795
47962008-11-09 Paolo Bonzini <bonzini@gnu.org>
4797
4798 Change tests/output.at quoting.
4799 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
4800 expanding arguments.
4801
48022008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
4803
4804 Don't add a semicolon to actions for %skeleton or %language.
4805 It breaks Java test cases as reported by Akim Demaille.
4806 * src/scan-code.l: Implement.
4807
48082008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
4809
4810 Clean up %skeleton and %language priority implementation.
4811 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
4812 remove static qualifier because others will soon need to see it.
4813 (language_prio): Likewise.
4814 (getargs): Use command_line_prio rather than 0.
4815 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
4816 enum fields.
4817 (skeleton_prio): Extern it.
4818 (language_prio): Extern it.
4819 * src/parse-gram.y: Use grammar_prio rather than 1.
4820
48212008-11-07 Akim Demaille <demaille@gostai.com>
4822
4823 Moving push traces into yypush_.
4824 * data/lalr1.cc (yypush_): Now takes a optional trace message.
4825 Adjust all uses.
4826
48272008-11-07 Akim Demaille <demaille@gostai.com>
4828
4829 The single-stack C++ parser is now the standard one.
4830 * data/lalr1.cc: Rename as...
4831 * data/lalr1-split.cc: this.
4832 * data/lalr1-fusion.cc: Rename as...
4833 * data/lalr1.cc: this.
4834 * etc/bench.pl.in: Adjust.
4835
48362008-11-07 Akim Demaille <demaille@gostai.com>
4837
4838 Avoid empty-if warnings.
4839 Reported by Quentin Hocquet.
4840
4841 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
4842 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
4843
48442008-11-07 Akim Demaille <demaille@gostai.com>
4845
4846 Pass command line location to skeleton_arg and language_argmatch.
4847 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
4848 The location argument is now mandatory.
4849 Adjust all dependencies.
4850 (getargs): Use command_line_location.
4851
48522008-11-07 Akim Demaille <demaille@gostai.com>
4853
4854 -D, --define.
4855 * src/getargs.c (usage): Document -D.
4856 Fix help string for --locations.
4857 (command_line_location): New.
4858 (short_options, long_options, getargs): Support -D, --define.
4859 (getargs): Move -d support at the right place.
4860 * doc/bison.texinfo (Bison Options): Update.
4861 * tests/input.at (%define, --define): New.
4862
48632008-11-07 Akim Demaille <demaille@gostai.com>
4864
4865 Initialize the muscle table before parsing the command line.
4866 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
4867 (getargs): Define file_name.
4868 * src/main.c (main): Initialize muscle_tab before calling
4869 getargs.
4870 * src/muscle_tab.c (muscle_init): No longer define file_name, as
4871 its value is not available yet.
4872
48732008-11-07 Akim Demaille <demaille@gostai.com>
4874
4875 Locations without columns for command line arguments.
4876 * src/location.c (location_print): Don't display negative columns.
4877 * src/location.h: Document this.
4878
48792008-11-07 Akim Demaille <demaille@gostai.com>
4880
4881 Fix --help.
4882 * src/getargs.c (usage): Fix help string for -W.
4883
48842008-11-07 Akim Demaille <demaille@gostai.com>
4885
4886 Handle more general types of option arguments.
4887 * build-aux/cross-options.pl: The argument ends at the first
4888 space, not the first non-symbol character.
4889 Use @var for each word appearing the argument description.
4890
48912008-11-07 Akim Demaille <demaille@gostai.com>
4892
4893 Destroy the variants that remain on the stack in case of error.
4894 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
4895 destructor.
4896 Display the value only if yymsg is nonnull.
4897 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
4898
48992008-11-07 Akim Demaille <demaille@gostai.com>
4900
4901 Add "%define assert" to variants.
4902 This is used to help the user catch cases where some value gets
4903 ovewritten by a new one. This should not happen, as this will
4904 probably leak.
4905
4906 Unfortunately this uncovered a bug in the C++ parser itself: the
4907 lookahead value was not destroyed between two calls to yylex. For
4908 instance if the previous lookahead was a std::string, and then an int,
4909 then the value of the std::string was correctly taken (i.e., the
4910 lookahead was now an empty string), but std::string structure itself
4911 was not reclaimed.
4912
4913 This is now done in variant::build(other&) (which is used to take the
4914 value of the lookahead): other is not only stolen from its value, it
4915 is also destroyed. This incurs a new performance penalty of a few
4916 percent, and union becomes faster again.
4917
4918 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
4919 (b4_variant_if): New.
4920 (variant::built): New.
4921 Use it whereever the status of the variant changes.
4922 * etc/bench.pl.in: Check the penalty of %define assert.
4923
49242008-11-07 Akim Demaille <demaille@gostai.com>
4925
4926 Use "%define variant" in bench.pl.
4927 * etc/bench.pl.in: No longer use the pseudo directive %variants,
4928 just use %define variants.
4929
49302008-11-07 Akim Demaille <demaille@gostai.com>
4931
4932 Regen.
4933 * src/parse-gram.h, src/parse-gram.c: Regen.
4934
49352008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
4936
4937 Fix user actions without a trailing semicolon.
4938 Reported by Sergei Steshenko at
4939 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
4940 * THANKS (Sergei Steshenko): Add.
4941 * src/scan-code.l (SC_RULE_ACTION): Fix it.
4942 * tests/regression.at (Fix user actions without a trailing semicolon):
4943 New test case.
4944
49452008-11-04 Akim Demaille <demaille@gostai.com>
4946
4947 Use b4_copyright_years.
4948 * data/yacc.c (b4_copyright_years): New.
4949 Fix its value according to the comments in the file.
4950 Use it and undefine it.
4951
49522008-11-04 Akim Demaille <demaille@gostai.com>
4953
4954 Formatting changes.
4955 * data/lalr1-fusion.cc, src/parse-gram.y: here.
4956
49572008-11-04 Akim Demaille <demaille@gostai.com>
4958
4959 Formatting changes.
4960 * data/lalr1-fusion.cc: here.
4961
49622008-11-04 Akim Demaille <demaille@gostai.com>
4963
4964 Use strict on bench.pl.
4965 * etc/bench.pl.in (&run, &generate_grammar): New.
4966 Rename the grammar generating functions for consistency.
4967 Change the interface so that the list of benches to run is passed
4968 as (optionless) arguments.
4969 (&compile): Use &run.
4970
49712008-11-04 Akim Demaille <demaille@gostai.com>
4972
4973 Remove spurious initial empty lines.
4974 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
4975 * data/yacc.c: End the @output lines with an @.
4976
49772008-11-04 Akim Demaille <demaille@gostai.com>
4978
4979 Improve the display of sizes.
4980 * etc/bench.p.in: Higher precision.
4981 Sort by decreasing size.
4982
49832008-11-04 Akim Demaille <demaille@gostai.com>
4984
4985 Don't memcpy C++ structures.
4986 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
4987 arguments.
4988 (variant::build): New overload for
4989 copy-construction-that-destroys.
4990 (variant::swap): New.
4991 (parser::yypush_): Use it in variant mode.
4992
49932008-11-04 Akim Demaille <demaille@gostai.com>
4994
4995 Better defaults for bench.pl.
4996 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
4997 default values.
4998 Adjust &verbose uses.
4999 (-q, --quiet): New.
5000
50012008-11-04 Akim Demaille <demaille@gostai.com>
5002
5003 Make variant.yy more complex.
5004 std::list cannot be copied via memcpy, they are more demanding than
5005 std::string. Use one std::list to strengthen the test.
5006
5007 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
5008 Adjust.
5009 Create a list of strings, instead of a single large string.
5010
50112008-11-04 Akim Demaille <demaille@gostai.com>
5012
5013 bench.pl --bench.
5014 * etc/bench.pl.in (--bench, $bench): New.
5015
50162008-11-04 Akim Demaille <demaille@gostai.com>
5017
5018 Sort methods.
5019 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
5020 Define it after as().
5021
50222008-11-04 Akim Demaille <demaille@gostai.com>
5023
5024 Useless parens.
5025 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
5026
50272008-11-04 Akim Demaille <demaille@gostai.com>
5028
5029 Issue missing synclines after user actions.
5030 * data/c.m4 (b4_case): Issue synclines on the output file.
5031
50322008-11-04 Akim Demaille <demaille@gostai.com>
5033
5034 Remove trailing empty line.
5035 * data/lalr1-fusion.cc: Don't add an empty line after the user's
5036 epilogue.
5037
50382008-11-04 Akim Demaille <demaille@gostai.com>
5039
5040 Fix output of copyright years.
5041 * data/bison.m4 (b4_copyright): Fix the indentation of the
5042 copyright year paragraph.
5043 Use b4_copyright_years when no years are given.
5044 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
5045 (b4_copyright_years): New.
5046 Use it.
5047
50482008-11-04 Akim Demaille <demaille@gostai.com>
5049
5050 Avoid the spurious initial empty line.
5051 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
5052 the end of @output request to suppress the empty line that
5053 results.
5054
50552008-11-04 Akim Demaille <demaille@gostai.com>
5056
5057 Remove parser::rhs_number_type.
5058 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
5059 (yyrhs_): Use b4_table_define.
5060
50612008-11-04 Akim Demaille <demaille@gostai.com>
5062
5063 Fix iteration type.
5064 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
5065
50662008-11-04 Akim Demaille <demaille@gostai.com>
5067
5068 Factor the declaration of the integer tables.
5069 * data/lalr1-fusion.cc (b4_table_define): New.
5070 Use it.
5071
50722008-11-03 Akim Demaille <demaille@gostai.com>
5073
5074 Fix indentation of tables in lalr1.cc
5075 * data/lalr1-fusion.cc: Fix the indentation.
5076
50772008-11-03 Akim Demaille <demaille@gostai.com>
5078
5079 Destroy the lhs symbols after reduction.
5080 * data/lalr1-fusion.cc (parse): After the user action, when in
5081 variant mode, destroy the lhs symbols.
5082
50832008-11-03 Akim Demaille <demaille@gostai.com>
5084
5085 Simplify yysyntax_error_ use.
5086 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
5087 type, but make it unnamed in the declaration when it is not used.
5088
50892008-11-03 Akim Demaille <demaille@gostai.com>
5090
5091 Let yy::variant::build return an lvalue.
5092 * data/lalr1-fusion.cc (variant::build): Return a reference to the
5093 object.
5094
50952008-11-03 Akim Demaille <demaille@gostai.com>
5096
5097 Define yy::variant only when needed.
5098 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
5099 used.
5100
51012008-11-03 Akim Demaille <demaille@gostai.com>
5102
5103 Bench the three-stack lalr1.cc.
5104 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
5105 one-stack one.
5106
51072008-11-03 Akim Demaille <demaille@gostai.com>
5108
5109 Fail on parse error in calc++.
5110 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
5111 status.
5112 * examples/calc++/test ($me, $number, $exit, run): New.
5113 Use them to propagate errors to the exit status.
5114
51152008-11-03 Akim Demaille <demaille@gostai.com>
5116
5117 Don't specify the skeleton twice in the example.
5118 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
5119 file does what is needed.
5120
51212008-11-03 Akim Demaille <demaille@gostai.com>
5122
5123 bench: Improve output.
5124 * etc/bench.pl.in (bench_grammar): Tune the printf format.
5125
51262008-11-03 Akim Demaille <demaille@gostai.com>
5127
5128 bench: check impact of %debug on variants.
5129 * etc/bench.pl.in (variant_grammar): Fix the computation of
5130 $variant.
5131 Generate a grammar file that can work with or without %debug.
5132 Do use the @directive.
5133 (bench_variant_parser): Check impact of %debug.
5134 (@directives): Rename all the occurrences to...
5135 (@directive): this, for consistency.
5136
51372008-11-03 Akim Demaille <demaille@gostai.com>
5138
5139 bench: report the size too.
5140 * etc/bench.pl.in ($iterations): Defaults to -3.
5141 (&bench_grammar): Require hireswallclock.
5142 Compute and display the size of the result.
5143 More comments.
5144
51452008-11-03 Akim Demaille <demaille@gostai.com>
5146
5147 bench: More use of the verbosity level.
5148 * etc/bench.pl.in ($verbose, &verbose): New.
5149 Use them.
5150 More POD documentation.
5151
51522008-11-03 Akim Demaille <demaille@gostai.com>
5153
5154 bench.pl: a command line interface
5155 * etc/bench.pl.in: More doc.
5156 Some fixes in the documentation.
5157 ($cflags, $iterations, &help, &getopt): New.
5158 Use them.
5159 (&variant_grammar): Let the number of stages be 10 times what is
5160 specified.
5161
51622008-11-03 Akim Demaille <demaille@gostai.com>
5163
5164 Bench the use of Boost.Variants.
5165 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
5166 New.
5167 (&compile): Be ready to compile C++ parsers.
5168 (&bench_push_parser): Move debug information to the outermost
5169 level.
5170 * THANKS: Add Michiel De Wilde.
5171
51722008-11-03 Akim Demaille <demaille@gostai.com>
5173
5174 bench.pl: Pass directives as a list instead of as a string.
5175 * etc/bench.pl.in (&directives): New.
5176 (&triangular_grammar, &calc_grammar): Use it to format the Bison
5177 directives.
5178 (&triangular_grammar): Do use the directives (were ignored).
5179 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
5180 directives.
5181
51822008-11-03 Akim Demaille <demaille@gostai.com>
5183
5184 Improve genericity of bench.pl.
5185 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
5186 argument.
5187 (&bench_push_parser): New.
5188 Call it.
5189
51902008-11-03 Akim Demaille <demaille@gostai.com>
5191
5192 Add documentation to bench.pl.
5193 * etc/bench.pl.in: Comment changes.
5194
51952008-11-03 Akim Demaille <demaille@gostai.com>
5196
5197 Fuse the three stacks into a single one.
5198
5199 In order to make it easy to perform benchmarks to ensure that
5200 there are no performance loss, lalr1.cc is forked into
5201 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
5202 lalr1.cc.
5203
5204 Meanwhile, to make sure that lalr1-fusion.cc is correctly
5205 exercized by the test suite, the user must install a symbolic link
5206 from lalr1.cc to it.
5207
5208 Instead of having three stacks (state, value, location), use a
5209 stack of triples. This considerably simplifies the code (and it
5210 will be easier not to require locations as currently does the C++
5211 parser), and also gives a 10% speedup according to
5212 etc/bench (probably mainly since memory allocation is done once
5213 instead of three times).
5214
5215 Another motivation is to make it easier to destruct properly
5216 semantic values: now that they are bound to their state (hence
5217 symbol type) it will be easier to call the appropriate destructor.
5218
5219 These changes should probably benefit the C parser too.
5220
5221 * data/lalr1.cc: Copy as...
5222 * data/lalr1-fusion.cc: this new file.
5223 (b4_rhs_value, b4_rhs_location): New definitions overriding those
5224 from c++.m4.
5225 (state_stack_type, semantic_stack_type, location_stack_type)
5226 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
5227 (data_type, stack_type, yystack_): New.
5228 (YYLLOC_DEFAULT, yypush_): Adjust.
5229 (yyerror_range): Now based on data_type, not location_type.
5230
52312008-11-03 Akim Demaille <demaille@gostai.com>
5232
5233 Push the state, value, and location at the same time.
5234 This is needed to prepare a forthcoming patch that fuses the three
5235 stacks into one.
5236
5237 * data/lalr1.cc (parser::yypush_): New.
5238 (parser::yynewstate): Change the semantics: instead of arriving to
5239 this label when value and location have been pushed, but yystate
5240 is to be pushed on the state stack, now the three of them must
5241 have been pushed before. yystate still must be the new state.
5242 This allows to use yypush_ everywhere instead of individual
5243 handling of the stacks.
5244
52452008-11-03 Akim Demaille <demaille@gostai.com>
5246
5247 Prefer references to pointers.
5248 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
5249 definition to use references instead of pointers.
5250 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
5251 Take the value and location as references.
5252 Adjust callers.
5253
52542008-11-03 Akim Demaille <demaille@gostai.com>
5255
5256 stack::size instead of stack::height.
5257 * data/lalr1.cc (stack::height): Rename as...
5258 (stack::size): this.
5259 Fix the output type.
5260 Comment changes.
5261
52622008-11-03 Akim Demaille <demaille@gostai.com>
5263
5264 Use variants to support objects as semantic values.
5265 This patch was inspired by work by Michiel De Wilde. But he used
5266 Boost variants which (i) requires Boost on the user side, (ii) is
5267 slow, and (iii) has useless overhead (the parser knows the type of
5268 the semantic value there is no reason to duplicate this
5269 information as Boost.Variants do).
5270
5271 This implementation reserves a buffer large enough to store the
5272 largest objects. yy::variant implements this buffer. It was
5273 implemented with Quentin Hocquet.
5274
5275 * src/output.c (type_names_output): New.
5276 (output_skeleton): Invoke it.
5277 * data/c++.m4 (b4_variant_if): New.
5278 (b4_symbol_value): If needed, provide a definition for variants.
5279 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
5280 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
5281 (b4_char_sizeof, yy::variant): New.
5282 (parser::parse): If variants are requested, define
5283 parser::union_type, parser::variant, change the definition of
5284 semantic_type, construct $$ before running the user action instead
5285 of performing a default $$ = $1.
5286 * examples/variant.yy: New.
5287 Based on an example by Michiel De Wilde.
5288
52892008-11-03 Akim Demaille <demaille@gostai.com>
5290
5291 Parameterize the extraction of semantic values.
5292 To make future changes easier, no longer rely on ".TYPE" being the
5293 way to get a semantic value.
5294
5295 * data/c.m4 (b4_symbol_value): New.
5296 Use it.
5297 * data/c++.m4, data/yacc.c: Use it.
5298 * data/glr.c: Use b4_symbol_value.
5299 (b4_rhs_data): New.
5300 Use it.
5301
53022008-11-03 Akim Demaille <demaille@gostai.com>
5303
5304 Prepare easier M4 changes.
5305 * data/lalr1.cc: Use escaped [] instead of literals to prepare
5306 future changes.
5307
53082008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
5309
5310 Initiate further development.
5311 * NEWS: Create an empty section for new entries.
5312 * gnulib: Update submodule to HEAD.
5313
53142008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
5315
5316 * NEWS: Version 2.4.
5317
53182008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
5319
5320 Prepare for next release.
5321 * NEWS: Briefly mention changes since 2.3b.
5322 * README: Say GNU m4 1.4.6, which we've been requiring in release
5323 announcements already, not 1.4.3, which breaks the build.
5324
53252008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
5326
5327 Say %language is experimental.
5328 We're thinking of extending it's effect on output file naming. See the
5329 thread at
5330 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
5331 * NEWS: Say it's experimental.
5332 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
5333 recommend it over %skeleton for now.
5334 (Bison Options): Likewise.
5335 (C++ Bison Interface): Use %skeleton not %language.
5336 (Calc++ Parser): Use %skeleton not %language.
5337 * src/getargs.c (usage): Say it's experimental.
5338
53392008-11-01 Di-an Jan <dianj@freeshell.org>
5340 Paolo Bonzini <bonzini@gnu.org>
5341
5342 Support all Java parser class modifiers.
5343 * data/java.m4 (b4_percent_define_get3): New.
5344 (b4_final_if, b4_strictfp_if): New.
5345 * data/lalr1.java (final, strictfp, extends, implements): Support.
5346 * doc/bison.texinfo (final, strictfp, extends, implements): Add
5347 documentation.
5348 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
5349 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
5350 (AT_CHECK_JAVA_GREP): New.
5351 (Java parser class modifiers): New test.
5352 (Java parser class extends and implements): New test.
5353
5354 Model exception propagation better with throws and lex_throws.
5355 * data/java.m4 (b4_list2): New.
5356 (throws): Change default.
5357 * data/lalr1.java (yyaction): Add throws.
5358 (parse): Add lex_throws in addition to throws.
5359 * doc/bison.texinfo (throws, lex_throws): Add documentation.
5360 * tests/java.at (Java throws specifications): New test.
5361
5362 Improve documentation for Java parsers.
5363 * doc/bison.texinfo (Java Parsers): Add subsections.
5364 Don't quote first argument of %define.
5365 (Java Bison Interface): Document output files. Move documentation
5366 of parser class and merge into Java Parser Interface. Document
5367 features that error out. Document directives with no effect.
5368 Move note about Javadoc higher.
5369 (Java Semantic Values): Explicitly mention stype.
5370 Document that generic types cannot be used.
5371 (Java Location Values): Use @deftypeivar. Document constructors.
5372 Correct return value for toString.
5373 (Java Parser Interface): List undocumented constants/fields.
5374 Move documentation of fields added by %parse-param closer to list
5375 of members. Document that token names are added as fields.
5376 Document constructors accurately. Remove error method.
5377 (Java Scanner Interface): Move note on %pure-parser to Java Bison
5378 Interface. Describe %code lexer and yylex accutately.
5379 Remove documentation that does not match the code.
5380 (Java Action Features): New.
5381 (Java Differences): Add reference. Add item on semantic values.
5382 Add note about @{ ... @}. Clarify %% epilogue placement.
5383 (Java Declarations Summary): New.
5384
5385 Fix Java skeleton.
5386 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
5387 (b4_remove_comma): Quote test argument.
5388 (b4_identification): Remove "bison" field.
5389 * tests/java.at (Java parser class and package names): New test.
5390 (Java %parse-param and %lex-param): New test.
5391 (Java stype, position_class and location_class): New test.
5392
53932008-10-31 Di-an Jan <dianj@freeshell.org>
5394
5395 * data/lalr1.jave: Update copyright years.
5396 (YYParser): Correct name of "generated from" file in Javadoc:
5397 use b4_file_name instead of @ofile@.
5398 (Location constructor): Correct Javadoc parameter name.
5399 (yylloc): Add missing opening m4 quote after b4_location_if.
5400 This removes a stray [ in the Javadoc of Lexer.getStartPos.
5401 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
5402 (YYParser constructor): Correct Javadoc parameter name.
5403
54042008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
5405
5406 Always put auxiliary code files in the same dir as other output files.
5407 * src/files.c (compute_file_name_parts): When the user specifies
5408 --output but not --file-prefix, extract the directory prefix from the
5409 file prefix not from the grammar file name. This affects the location
5410 of files like location.hh generated by the C++ skeleton. The includes
5411 in the other output files require this fix.
5412 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
5413 for expected output files.
5414 (Output files): Add a test for the above.
5415
54162008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
5417
5418 * gnulib: Update submodule to HEAD.
5419
54202008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
5421
5422 Update copyright year.
5423 * src/files.c: Here.
5424
54252008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
5426
5427 Don't overwrite the input file.
5428 * src/files.c (output_file_name_check): Fatal error if using input file
5429 for output.
5430 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
5431 argument.
5432 (Conflicting output files): Add test.
5433
54342008-10-28 Akim Demaille <demaille@gostai.com>
5435
5436 Space changes.
5437 * data/lalr1.cc: Formatting changes.
5438
54392008-10-28 Akim Demaille <demaille@gostai.com>
5440
5441 Don't define debugging functions when !YYDEBUG.
5442 * data/lalr1.cc (debug_stream, set_debug_stream)
5443 (debug_level_type, debug_level, set_debug_level): Don't
5444 declare them when YYDEBUG is not defined.
5445 The implementation are already YYDEBUG-aware.
5446
54472008-10-28 Akim Demaille <demaille@gostai.com>
5448
5449 Prefer "continue" for empty loop bodies.
5450 * etc/bench.pl.in: Use "continue" instead of {}.
5451
54522008-10-28 Akim Demaille <demaille@gostai.com>
5453
5454 Space and comments changes.
5455 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
5456 * data/c.m4, data/lalr1.cc: Space changes.
5457
54582008-10-28 Akim Demaille <demaille@gostai.com>
5459
5460 Make gnulib a submodule.
5461 * gnulib: New.
5462 * .gitmodules (gnulib): New.
5463
54642008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
5465
5466 Fix yyerror_range for user-defined location type in C++. Reported by
5467 Georg Sauthoff at
5468 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
5469 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
5470 * THANKS (Georg Sauthoff): Add.
5471
54722008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
5473
5474 Update several administrative files mainly to facilitate releasing.
5475 * HACKING (Administrivia): Make the git-merge-changelog notes more
5476 helpful.
5477 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
5478 (Release Procedure): Update for git and add numerous details that were
5479 previously missing.
5480 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
5481 * maint.mk (announcement): Don't list bison as a bootstrap tool so
5482 that announcements don't claim we bootstrapped with whatever bison
5483 happened to be in PATH. Add flex as a bootstrap tool.
5484 * Makefile.maint: Remove, previously replaced by maint.mk.
5485 * Makefile.cfg: Remove, and migrate settings to...
5486 * cfg.mk: ... here for the sake of `make announcement'.
5487 * bootstrap.conf (gnulib_modules): Add announce-gen.
5488 * README: Say GNU Bison instead of just Bison. Suggested by Karl
5489 Berry.
5490
54912008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
5492
5493 Small but important bugfixes for the Java skeleton.
5494 * data/lalr1.java (yyerror): Change Location to b4_location_type.
5495 (yy_symbol_print): Call toString on yyvaluep.
5496
54972008-08-29 Akim Demaille <demaille@gostai.com>
5498
5499 Clarify UPDATED use.
5500 * doc/bison.texinfo: It refers to the last edition of this file,
5501 not to the release date of Bison.
5502 Reported by Joel E. Denny.
5503
55042008-08-29 Akim Demaille <demaille@gostai.com>
5505
5506 * README: Update FAQ pointer.
5507 Reported by Joel E. Denny.
5508
55092008-08-27 Eric Blake <ebb9@byu.net>
5510
5511 Resync m4sugar from autoconf.
5512 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
5513 (m4_init): Adjust to latest m4.git changes.
5514 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
5515 effects.
5516 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
5517 (_m4_list_cmp): Reduce side effects.
5518
55192008-08-27 Akim Demaille <demaille@gostai.com>
5520
5521 Check yyerrok in calc.at.
5522 * tests/calc.at (calc.y): Use yyerrok on "( error )".
5523 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
5524 expected.
5525
55262008-08-27 Akim Demaille <demaille@gostai.com>
5527
5528 Support yyerrok in lalr1.cc.
5529 YYBACKUP is still to import back into lalr1.cc.
5530 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
5531
55322008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
5533
5534 For maintainer-check*, don't recompile for a $(VERSION) update.
5535 * cfg.mk: New file.
5536 (_is-dist-target): Override the one in GNUmakefile.
5537 * Makefile.am (EXTRA_DIST): Add cfg.mk.
5538
55392008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
5540
5541 Update for recent change to gnulib.
5542 * src/parse-gram.y: Don't include strverscmp.h. It comes from
5543 string.h now.
5544
55452008-08-15 Eric Blake <ebb9@byu.net>
5546
5547 Remaining m4sugar merge from autoconf.
5548 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
5549 * data/m4sugar/foreach.m4: New file, copied from autoconf.
5550 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
5551 * src/output.c (output_skeleton): Tell m4 how to find it.
5552
5553 Partial m4sugar merge from autoconf: m4_map.
5554 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
5555 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
5556 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
5557 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
5558 for empty list.
5559 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
5560 Likewise.
5561 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
5562 declares it.
5563
55642008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
5565
5566 Keep .version and PACKAGE_VERSION in sync.
5567 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
5568 dependency, and add comments justifying this in more detail. Discussed
5569 starting at
5570 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
5571
55722008-08-06 Eric Blake <ebb9@byu.net>
5573
5574 Partial m4sugar merge from autoconf: m4_shiftn.
5575 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
5576 (m4_shift2, m4_shift3): New macros.
5577 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
5578 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
5579 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
5580 * data/java.m4 (b4_remove_comma): Likewise.
5581
5582 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
5583 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
5584 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
5585 (m4_init): Consolidate wrapped text into single m4_wrap.
5586 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
5587 in wrapped text.
5588
55892008-08-05 Eric Blake <ebb9@byu.net>
5590
5591 Partial m4sugar merge from autoconf: builtins, version.m4.
5592 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
5593 (m4_prepend): Remove, as it is unused and inherently quadratic,
5594 whereas m4_append is linear in newer m4.
5595 (m4_mkstemp): New builtin.
5596 (m4_symbols): Make rename conditional.
5597 (m4_version_prereq): Ensure fatal error if used in bison, which
5598 intentionally lacks version.m4.
5599
5600 Fix comments in m4sugar.
5601 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
5602
56032008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
5604
5605 Update for recent .gitignore fix in Gnulib.
5606 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
5607 anchored .gitignore entries.
5608
56092008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
5610
5611 Set gnu or gnits strictness.
5612 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
5613 development and gnits strictness for releases. Based on Eric Blake's
5614 suggestion at
5615 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
5616
56172008-07-31 Paolo Bonzini <bonzini@gnu.org>
5618
5619 * NEWS: Clarify documentation of %language.
5620
56212008-07-31 Paolo Bonzini <bonzini@gnu.org>
5622
5623 Support usage of git-merge-changelog.
5624 * .gitattributes: New.
5625 * HACKING: Document usage of git-merge-changelog.
5626 * bootstrap: Install git-merge-changelog entries in .git/config
5627 if appropriate.
5628
56292008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
5630
5631 Remove remaining dependence on CVS Id keyword.
5632 * ChangeLog: For the sake of people still using CVS, don't use dollars
5633 when mentioning Id.
5634 * data/xslt/bison.xsl: Remove Id from header comments, where it was
5635 unusual anyway.
5636 * data/xslt/xml2dot.xsl: Likewise.
5637 * data/xslt/xml2text.xsl: Likewise.
5638 * data/xslt/xml2xhtml.xsl: Likewise.
5639 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
5640 * doc/Makefile.am (neutralize): Remove, no longer needed.
5641 (.x.1): Don't use neutralize.
5642 (edit): Don't substitute for ID.
5643 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
5644
56452008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
5646
5647 Fix dependence on computed configure variables.
5648 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
5649 $(top_srcdir)/configure.ac so that changes to computed variables, such
5650 as PACKAGE_VERSION, are seen.
5651 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
5652
56532008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
5654
5655 Update copyright dates for recent changes.
5656 * Makefile.am: Here.
5657 * src/Makefile.am: Here.
5658 * src/reduce.c: Here.
5659 * tests/reduce.at: Here.
5660
56612008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
5662
5663 Use git-version-gen for version names between releases.
5664 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
5665 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
5666 * .prev-version: New.
5667 * .version.in: Remove.
5668 * ChangeLog: Remove the Id previously used for capturing the CVS
5669 revision.
5670 * GNUmakefile: Remove, now copied from Gnulib.
5671 * Makefile.am: Add code suggested by comments in
5672 build-aux/git-version-gen.
5673 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
5674 .prev-version, and .version.
5675 * NEWS (2.3b+): Rename to...
5676 (?.?): ... this because we're dropping the "+" version naming scheme,
5677 but, in general, we still can't be sure of our next release name.
5678 * bootstrap: Add a quick hack to remove from .gitignore the
5679 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
5680 entry. This should really be fixed in gnulib instead.
5681 * bootstrap.conf (gnulib_modules): Add gnumakefile.
5682 * configure.ac (AC_INIT): Set version name by invoking
5683 build-aux/git-version-gen.
5684 (AC_CONFIG_FILES): Remove .version, now generated by
5685 build-aux/git-version-gen.
5686 * maint.mk: New, copied from coreutils.
5687 * doc/.cvsignore (bison.1): Add.
5688 * doc/.gitignore (/bison.1): Add.
5689 * doc/bison.1: Remove, generated.
5690 * src/.cvsignore (revision.c): Remove.
5691 * src/.gitignore (/revision.c): Remove.
5692 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
5693 (BUILT_SOURCES): Remove revision.c.
5694 (revision.c): Remove.
5695 * src/getargs.c (version): Don't print revision after the VERSION.
5696 * src/revision.h: Remove.
5697
56982008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
5699
5700 Fix untranslatable composition of sentences. Reported by Goran
5701 Uddeborg at
5702 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
5703 * THANKS (Goran Uddeborg): Add.
5704 * src/reduce.c (reduce_print): Report the number of nonterminals and
5705 rules useless in the grammar in separate sentences.
5706 * tests/reduce.at (Useless Rules): Update output.
5707 (Reduced Automaton): Likewise.
5708 (Underivable Rules): Likewise.
5709 (Empty Language): Likewise.
5710
57112008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
5712
5713 Fix some .gitignore and .cvsignore problems.
5714 * bootstrap (insert_sorted_if_absent): Replace all uses with...
5715 (insert_vc_ignore): ... this new function, which prepends `/' to all
5716 .gitignore entries before passing them to insert_sorted_if_absent.
5717 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
5718 .cvsignore files are maintained even though Bison developers run
5719 bootstrap while using Git.
5720 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
5721 unneeded by Bison.
5722 (gnulib): Add.
5723 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
5724 unneeded. Reported by Eric Blake.
5725 * lib/.gitignore (/*~): Add.
5726 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
5727 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
5728 Blake.
5729 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
5730
57312008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
5732
5733 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
5734 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
5735 * bootstrap.conf (gnulib_modules): Add unsetenv.
5736 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
5737 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
5738 (/setenv.m4): Add.
5739 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
5740 the first argument because it may become position-dependent, and unset
5741 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
5742 Add comments explaining these issues in more detail.
5743
57442008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
5745
5746 Add .gitignore everywhere based on .cvsignore.
5747 * .gitignore: New.
5748 * build-aux/.gitignore: New.
5749 * data/.gitignore: New.
5750 * doc/.gitignore: New.
5751 * etc/.gitignore: New.
5752 * examples/.gitignore: New.
5753 * examples/calc++/.gitignore: New.
5754 * lib/.gitignore: New.
5755 * m4/.gitignore: New.
5756 * po/.gitignore: New.
5757 * runtime-po/.gitignore: New.
5758 * src/.gitignore: New.
5759 * tests/.gitignore: New.
5760
57612008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
5762
5763 * NEWS (2.3b+): New section, empty for now.
5764 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
5765
57662008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
5767
5768 * NEWS (2.3b): Update release date since there has been a delay in
5769 getting the announcements and tarballs out.
5770
57712008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
5772
5773 * NEWS: Version 2.3b.
5774 * configure.ac (AC_INIT): Likewise.
5775 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
5776
57772008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
5778
5779 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
5780 been doing it for years.
5781 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
5782 (Release Procedure): Add FIXME about make alpha being unmaintained.
5783
57842008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
5785
5786 * data/yacc.c: Reformat m4 a little for readability.
5787 * src/lalr.c (build_relations): Correct comment.
5788
57892008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5790
5791 DJGPP specific issue.
5792 * djgpp/config.sed: Fixes required to run configure scripts generated
5793 by autoconf 2.62.
5794
57952008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
5796
5797 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
5798 coordinator@translationproject.org.
5799
58002008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
5801
5802 * THANKS: Add Eric Blake.
5803
58042008-04-23 Eric Blake <ebb9@byu.net>
5805
5806 Revert prior patch, by working around autoconf regression.
5807 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
5808 ("Output file name: ("): Uncomment test.
5809 ("Output file name: )"): Likewise.
5810 Based on an idea from Noah Misch.
5811
58122008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
5813
5814 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
5815 2.61. Reported by Juan Manuel Guerrero at
5816 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
5817 * tests/output.at ("Output file name: ("): Comment out test case for
5818 now.
5819 ("Output file name: )"): Likewise.
5820
58212008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
5822
5823 * GNUmakefile: Update git-version-gen invocation so make dist
5824 succeeds.
5825
58262008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
5827
5828 Update to the current gnulib CVS repository, and fix trigraph handling
5829 in Bison.
5830 * bootstrap: Update gnulib CVS repository URL.
5831 (symlink_to_dir): Encapsulate the code that guarantees the destination
5832 directory exists into...
5833 (check_dst_dir): ... this new function, and...
5834 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
5835 fail when copying files into lib/uniwidth/.
5836 * src/output.c (prepare_symbols): When writing yytname muscles, where
5837 symbol names will be encoded in C-string literals, tell quotearg to
5838 escape trigraphs. This used to be the default in gnulib.
5839 * tests/regression.at (Token definitions): Because of the change in
5840 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
5841 escapes trigraphs in symbol names. Thus, yytname no longer has
5842 trigraphs unnecessarily doubly escaped. Update test case output.
5843 Extend test case to be sure Bison's own error messages will no longer
5844 have trigraphs in symbol names unnecessarily escaped once.
5845
58462008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
5847
5848 Fix make dist infinite loop reported by Juan Manuel Guerrero at
5849 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
5850 * .cvsignore: Add .version.
5851 * .version.in: New.
5852 * bootstrap.conf (gnulib_modules): Add git-version-gen.
5853 * configure.ac (AC_CONFIG_FILES): Add .version.
5854 * build-aux/.cvsignore: Add git-version-gen.
5855
58562008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
5857
5858 * NEWS (2.3a+): Mention that -g now takes an argument.
5859 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
5860 consistency. Update the -g and -x entries now that they take
5861 arguments. Use brackets to indicate optional arguments.
5862 * src/getargs.c (usage): Explain the relationship between arguments of
5863 long and short options more completely. Document --defines and -d
5864 separately since the former takes an argument but, for POSIX Yacc, the
5865 latter does not.
5866 (short_options): Let -W take an optional argument like --warnings.
5867 (getargs): Sort cases.
5868
58692008-02-28 Akim Demaille <demaille@gostai.com>
5870
5871 * doc/bison.texinfo: Fix a few typos.
5872
58732008-02-28 Akim Demaille <akim@epita.fr>
5874
5875 * doc/bison.texinfo (Bison Options): Document -W.
5876 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
5877
58782008-02-28 Akim Demaille <akim@epita.fr>
5879
5880 * src/getargs.c (short_options): Split and sort for readability.
5881 -g and -x take optional arguments, just like their long options.
5882 * build-aux/cross-options.pl: Use /x to make the regexp easier to
5883 understand.
5884 Fix the handling of $opt which resulted in all the argument to be
5885 considered as optional.
5886
58872008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
5888
5889 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
5890 say its interface is experimental.
5891 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
5892 Java.
5893 (Bison Options): In the -L and --language entry, mention Java.
5894 (Java Bison Interface): Say the interface is experimental.
5895 * src/getargs.c (usage): Mention -L and --language.
5896
5897 * NEWS (2.3a+): Say the push parsing interface is experimental.
5898 * doc/bison.texinfo (Push Decl): Likewise.
5899 (Decl Summary): Likewise in the "%define api.push_pull" entry.
5900 (Push Parser Function): Likewise.
5901 (Pull Parser Function): Likewise.
5902 (Parser Create Function): Likewise.
5903 (Parser Delete Function): Likewise.
5904 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
5905 yypull_parse, and yypush_parse entries.
5906
5907 * NEWS (2.3a+): Mention XML support, and say the schema is
5908 experimental.
5909 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
5910 * src/getargs.c (usage): Say the XML schema is experimental.
5911
5912 * NEWS (2.3a+): Say option instead of flag.
5913
59142008-02-21 Wojciech Polak <polak@gnu.org>
5915
5916 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
5917 text.
5918
59192008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
5920
5921 Fix impure push parser compile error reported by Bob Rossi at
5922 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
5923 * data/yacc.c: Clean up whitespace in the output a little.
5924 (yypstate_allocated): Define for impure push parsers regardless of
5925 whether the pull interface is also requested.
5926 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
5927 check impure push parsers without the pull interface.
5928
5929 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
5930 yyerror takes arguments specified by %parse-param while yypstate_new
5931 does not.
5932 * doc/bison.texinfo (Parser Create Function): Document that
5933 yypstate_new returns 0 for multiple impure parser instances.
5934 * tests/push.at (Push Parsing: Multiple impure instances): Update
5935 expected stderr output.
5936
59372008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
5938
5939 * runtime-po/POTFILES.in (push.c): Remove.
5940
59412008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
5942
5943 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
5944 * data/push.c: Rename to...
5945 * data/yacc.c: ... this, overwriting it.
5946 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
5947 `%push-pull-parser' -> `%define api.push_pull "both"'.
5948 Remove old yacc.c tests, and update push.c tests to yacc.c.
5949
59502008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
5951
5952 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
5953 `"%code top" blocks' instead of `%code "top" blocks'.
5954 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
5955 Clean up whitespace in the output a little.
5956
59572008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
5958
5959 Fix documentation problems reported by Tim Josling at
5960 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
5961 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
5962 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
5963 integers. Explain the effect of literal string aliases on error
5964 messages. Copy token 0 documentation from the C++ skeleton
5965 documentation.
5966
59672008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
5968
5969 Accept a token number in a %left, %right, or %nonassoc for POSIX
5970 conformance. Reported by Tim Josling at
5971 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
5972 * NEWS (2.3a+): Mention.
5973 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
5974 and code numbers are treated by precedence declarations.
5975 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
5976 of symbols.1.
5977 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
5978 of symbol.
5979 (symbol.prec): New, just like symbol but allows INT.
5980 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
5981 longer holds.
5982 * tests/regression.at (Token number in precedence declaration): New
5983 test case.
5984
59852008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5986
5987 DJGPP specific issues.
5988 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
5989 be changed. Copyright timestamp adjusted.
5990 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
5991 be changed. Copyright timestamp adjusted.
5992 * djgpp/config.site: Copyright timestamp adjusted.
5993 * djgpp/config_h.sed: Copyright timestamp adjusted.
5994 * djgpp/djunpack.bat: Copyright timestamp adjusted.
5995 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
5996 filename translation list.
5997 * djgpp/subpipe.c (init_subpipe): Check the environment variables
5998 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
5999 files shall be created. Before trying to use the temp dir where the
6000 environment variable points to check that the dir really exists. If
6001 not default to the cwd as temp dir. Copyright timestamp adjusted.
6002 * djgpp/subpipe.h: Copyright timestamp adjusted.
6003 * djgpp/testsuite.sed: Copyright timestamp adjusted.
6004
60052008-01-30 Paul Eggert <eggert@cs.ucla.edu>
6006
6007 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
6008
60092008-01-09 Paul Eggert <eggert@cs.ucla.edu>
6010
6011 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
6012 Problem reported by Claudio Saavedra in
6013 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
6014
60152008-01-05 Wojciech Polak <polak@gnu.org>
6016
6017 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
6018 document's title with the input grammar file name.
6019
60202007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
6021
6022 Automate regression testing of the XML/XSLT implementation. Discussed
6023 starting at
6024 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
6025 * configure.ac (XSLTPROC): New substitution.
6026 * Makefile.am (maintainer-xml-check): New phony target invoking...
6027 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
6028 invoking make maintainer-check with BISON_TEST_XML=1.
6029 * tests/atlocal.in (XSLTPROC): New.
6030 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
6031 not to report reachable memory when Bison is expected to have a
6032 non-zero exit status and (2) to compare XML/XSLT output with --graph
6033 and --report=all output for every working grammar when
6034 BISON_TEST_XML=1.
6035 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
6036 (AT_BISON_CHECK_XML): New.
6037 (AT_QUELL_VALGRIND): New.
6038 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
6039 (AT_CHECK): ... don't redefine this since this was the old way to
6040 quell Valgrind.
6041 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
6042 AT_BISON_CHECK invocations.
6043 * tests/c++.at: Likewise.
6044 * tests/calc.at: Likewise.
6045 * tests/conflicts.at: Likewise.
6046 * tests/cxx-type.at: Likewise.
6047 * tests/existing.at: Likewise.
6048 * tests/glr-regression.at: Likewise.
6049 * tests/headers.at: Likewise.
6050 * tests/input.at: Likewise.
6051 * tests/java.at: Likewise.
6052 * tests/output.at: Likewise.
6053 * tests/push.at: Likewise.
6054 * tests/reduce.at: Likewise.
6055 * tests/regression.at: Likewise.
6056 * tests/sets.at: Likewise.
6057 * tests/skeletons.at: Likewise.
6058 * tests/synclines.at: Likewise.
6059 * tests/torture.at: Likewise.
6060 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
6061 tends to hang xsltproc.
6062 (Big horizontal): Likewise.
6063
60642007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
6065
6066 In XML output, remove redundant class attribute on symbol element.
6067 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
6068 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
6069 look up a symbol to determine whether it's a nonterminal or terminal.
6070 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
6071 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
6072
6073 Add prec/assoc information to XML output.
6074 * src/gram.c (grammar_rules_print_xml): For each rule that has a
6075 %prec, add a percent_prec attribute.
6076 * src/print-xml.c (print_grammar): For each terminal that has a
6077 precedence or associativity, add a prec or assoc attribute.
6078 (xml_indent): New.
6079 (xml_puts): Use xml_indent.
6080 (xml_printf): Use xml_indent.
6081 * src/print-xml.h (xml_indent): Prototype.
6082
6083 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
6084 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
6085
60862007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
6087
6088 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
6089 (bison:ruleByNumber): ... this for clarity.
6090 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
6091 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
6092 (xsl:template match="reduction"): Update.
6093 (xsl:template match="item"): Update.
6094 (xsl:template match="reduction"): Update.
6095
6096 In the XML output, don't print the list of rules where symbols appear.
6097 Compute it in XSLT instead. Discussed at
6098 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
6099 * data/xslt/bison.xsl (bison:ruleByLhs): New.
6100 (bison:ruleByRhs): New.
6101 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
6102 bison:ruleByRhs.
6103 (xsl:template match="terminal/rule"): Remove.
6104 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
6105 bison:ruleByRhs.
6106 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
6107 Remove.
6108 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
6109 bison:ruleByRhs and mode="number-link" for rule template.
6110 (xsl:template match="terminal/rule"): Remove.
6111 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
6112 bison:ruleByRhs and mode="number-link" for rule template.
6113 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
6114 Rewrite as...
6115 (xsl:template match="rule" mode="number-link"): ... this.
6116 * src/print-xml.c (print_grammar): Don't print the list of rules.
6117
61182007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
6119
6120 Don't let --report affect XML output; always print all information.
6121 Discussed at
6122 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
6123 * src/conflicts.c (log_resolution): Implement.
6124 * src/print-xml.c (print_core): Implement.
6125 (print_state): Implement.
6126 (print_xml): Implement.
6127
6128 * NEWS (2.3a+): Fix quotes.
6129 * src/parse-gram.y (prologue_declaration): For consistency with -v,
6130 don't let %verbose clear the list specified by --report.
6131
61322007-11-26 Akim Demaille <akim@epita.fr>
6133
6134 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
6135
61362007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
6137
6138 In the XML output, list useless and unused symbols and rules with the
6139 useful ones and add a "usefulness" attribute. Discussed starting at
6140 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
6141 * src/gram.c (grammar_rules_partial_print_xml): Remove.
6142 (grammar_rules_print_xml): Print all rules instead of just those
6143 useful in the grammar, and add a "usefulness" attribute.
6144 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
6145 * src/print-xml.c (print_rules_useless_in_parser): Remove.
6146 (print_grammar): Print all nonterminals instead of just useful ones,
6147 and add a "usefulness" attribute to nonterminals and terminals.
6148 (print_xml): Don't print a separate "reductions" or
6149 "rules-useless-in-parser" element.
6150 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
6151 (reduce_xml): Remove.
6152 (reduce_token_unused_in_grammar): New.
6153 (reduce_nonterminal_useless_in_grammar): New.
6154 * src/reduce.h (reduce_xml): Remove prototype.
6155 (reduce_token_unused_in_grammar): Add prototype.
6156 (reduce_nonterminal_useless_in_grammar): Add prototype.
6157 * data/xslt/xml2text.xsl: Update for XML changes.
6158 * data/xslt/xml2xhtml.xsl: Update for XML changes.
6159 * tests/reduce.at (Useless Terminals): Update output.
6160 (Useless Rules): Update output.
6161 (Reduced Automaton): Update output.
6162
6163 Say "Terminals unused in grammar" instead of "Unused terminals".
6164 * NEWS (2.3a+): Update.
6165 * doc/bison.texinfo (Understanding): Update example output.
6166 * src/reduce.c (reduce_output): Implement.
6167 * data/xslt/xml2text.xsl: Implement.
6168 * data/xslt/xml2xhtml.xsl: Implement.
6169
61702007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
6171
6172 Accept --report-file=FILE to override the default `.output' filename.
6173 * NEWS (2.3a+): Mention.
6174 * doc/bison.texinfo (Bison Options): Add an entry.
6175 * src/files.c (compute_output_file_names): Don't override
6176 spec_verbose_file if already set.
6177 * src/getargs.c (usage): Document --report-file.
6178 (REPORT_FILE_OPTION): New anonymous enum member.
6179 (long_options): Add entry for it.
6180 (getargs): Add case for it setting spec_verbose_file.
6181
6182 * build-aux/cross-options.pl: Don't record a short option just because
6183 there's an arg.
6184 * doc/.cvsignore: Add yacc.1.
6185
61862007-11-14 Akim Demaille <akim@epita.fr>
6187
6188 * doc/yacc.1.in: New.
6189 * configure.ac, doc/Makefile.am: Adjust.
6190 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
6191 config.h symbol.
6192 Use AC_SUBST for assignments too.
6193 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
6194
61952007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
6196
6197 * src/gram.c: Remove comments that duplicate comments in gram.h.
6198
6199 When reporting useless rules and nonterminals, say "useless in grammar"
6200 instead of "useless", and say "useless in parser" instead of "never
6201 reduced". Discussed starting at
6202 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
6203 * NEWS (2.3a+): Mention this change.
6204 * data/xslt/xml2text.xsl: Update output text and expected input XML
6205 element names to match changes below.
6206 * data/xslt/xml2xhtml.xsl: Likewise.
6207 (xsl:template match="bison-xml-report"): Add missing entry in Table of
6208 Contents: "Rules useless in parser due to conflicts".
6209 * doc/bison.texinfo (Decl Summary): Reword a little.
6210 (Understanding): Update example output for changes below.
6211 * src/gram.c: (rule_useful_p): Rename to...
6212 (rule_useful_in_grammar_p): ... this.
6213 (rule_useless_p): Rename to...
6214 (rule_useless_in_grammar_p): ... this.
6215 (rule_never_reduced_p): Rename to...
6216 (rule_useless_in_parser_p): ... this.
6217 (grammar_rules_print): Update for renames.
6218 (grammar_rules_print_xml): Update for renames.
6219 (grammar_rules_never_reduced_report): Rename to...
6220 (grammar_rules_useless_report): ... this since it is used for either
6221 kind of useless rule.
6222 * src/gram.h: Reword comments and update function names in prototypes.
6223 * src/main.c (main): Say "rule useless in parser due to conflicts".
6224 * src/print-xml.c (print_rules_never_reduced): Rename to...
6225 (print_rules_useless_in_parser): ... this, and rename output XML
6226 element "rules-never-reduced" to "rules-useless-in-parser".
6227 (print_xml): Update for rename.
6228 * src/print.c (print_results): Say "Rules useless in parser due to
6229 conflicts".
6230 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
6231 (nonterminals_reduce): Say "nonterminal useless in grammar".
6232 (reduce_output): Say "Nonterminals useless in grammar".
6233 Say "Rules useless in grammar".
6234 (reduce_xml): Rename output XML element "useless" to
6235 "useless-in-grammar".
6236 (reduce_print): Don't report the count of grammatically useless rules
6237 as "rules never reduced" just because %yacc is specified.
6238 In the correct report of this count, say nonterminal(s) and rule(s)
6239 "useless in grammar".
6240 * tests/conflicts.at (S/R in initial): Update expected output.
6241 (Defaulted Conflicted Reduction): Likewise.
6242 (Unreachable States After Conflict Resolution): Likewise.
6243 * tests/existing.at (GNU pic Grammar): Likewise.
6244 * tests/reduce.at (Useless Nonterminals): Likewise.
6245 (Useless Rules): Likewise.
6246 (Reduced Automaton): Likewise.
6247 (Underivable Rules): Likewise.
6248 (Empty Language): Likewise.
6249
62502007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
6251
6252 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
6253 here document and before the EOF so that BSD's implementation of Bourne
6254 shell doesn't parse the delimiter as part of the here document.
6255 * doc/.cvsignore: Add cross-options.texi.
6256 * src/getargs.c (usage): Add a blank line after the warning categories.
6257
62582007-11-08 Paolo Bonzini <bonzini@gnu.org>
6259
6260 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
6261
62622007-11-05 Akim Demaille <akim@epita.fr>
6263
6264 Remove Id: from bison.1.
6265 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
6266 (perl -0777 -pi -e 's/\.PP\nId): New.
6267 (.x.1): Use it to ignore the version control revision.
6268
62692007-11-05 Akim Demaille <demaille@gostai.com>
6270
6271 * build-aux/Makefile.am: Ship cross-options.pl.
6272 * doc/Makefile.am: Always refer to cross-options.texi with
6273 $(srcdir).
6274 (MAINTAINERCLEANFILES): Add it.
6275
62762007-11-04 Akim Demaille <demaille@gostai.com>
6277
6278 Generate the long/short option cross-table.
6279 * build-aux/cross-options.pl: New.
6280 * doc/Makefile.am (cross-options.texi): New.
6281 * doc/bison.texinfo: Use it.
6282
62832007-11-04 Akim Demaille <demaille@gostai.com>
6284
6285 Generate bison.1 using help2man.
6286 * doc/common.x, doc/bison.x: New.
6287 * doc/Makefile.am (bison.1, .x.1): New.
6288 The code is taken from autoconf-2.61/man/Makefile.am.
6289 * configure.ac: Look for help2man.
6290
62912007-11-04 Akim Demaille <demaille@gostai.com>
6292
6293 Complete --help.
6294 * src/getargs.c (usage): Document -W, make it clear that -d,
6295 -g and -x have optional arguments.
6296
62972007-11-04 Akim Demaille <demaille@gostai.com>
6298
6299 Find sha1sum when named gsha1sum.
6300 * bootstrap (find_tool): New.
6301 ($SHA1SUM): New.
6302
63032007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
6304
6305 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
6306 at
6307 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
6308 * NEWS (2.3a+): Mention.
6309 * data/bison.m4 (b4_pure_if): Don't define it here.
6310 * data/c.m4 (b4_identification): Depend on individual skeletons to
6311 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
6312 values of the %define variables api.pure or api.push_pull. Define
6313 YYPURE, YYPUSH, and YYPULL accordingly.
6314 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
6315 glr.cc has already defined b4_pure_flag.
6316 * data/push.c: Define b4_pure_if based on `%define api.pure'.
6317 Remove YYPUSH and YYPULL since they're back in b4_identification again.
6318 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
6319 * doc/bison.texinfo (Pure Decl): Update.
6320 (Push Decl): Update.
6321 (Decl Summary): Add api.pure to %define entry.
6322 In %pure-parser entry, say it's deprecated and reference %define.
6323 (Pure Calling): Update.
6324 (Error Reporting): Update.
6325 (C++ Scanner Interface): Update.
6326 (How Can I Reset the Parser): Update.
6327 (Table of Symbols): In %pure-parser entry, say it's deprecated and
6328 reference %define.
6329 * src/getargs.c (pure_parser): Remove global variable.
6330 * src/getargs.h (pure_parser): Remove extern.
6331 * src/output.c (prepare): Don't define pure_flag muscle.
6332 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
6333 wrapper around `%define api.pure'.
6334 * tests/calc.at (Simple LALR Calculator): Update.
6335 (Simple GLR Calculator): Update.
6336 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
6337 Update.
6338 (GLR: Resolve ambiguity, pure, locations): Update.
6339 (GLR: Merge conflicting parses, pure, no locations): Update.
6340 (GLR: Merge conflicting parses, pure, locations): Update.
6341 * tests/glr-regression.at (Uninitialized location when reporting
6342 ambiguity): Update
6343 * tests/input.at (Unused %define api.pure): New test case.
6344 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
6345 AT_PURE_IF and AT_PURE_AND_LOC_IF.
6346 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
6347
63482007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
6349
6350 %define push_pull -> %define api.push_pull. Discussed starting at
6351 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
6352 * data/push.c: Expect the new name.
6353 * data/yacc.c: Likewise.
6354 * doc/bison.texinfo (Push Decl): Update.
6355 (Decl Summary): Update %define entry.
6356 (Push Parser Function): Update.
6357 (Pull Parser Function): Update.
6358 (Parser Create Function): Update.
6359 (Parser Delete Function): Update.
6360 * tests/calc.at (Simple LALR Calculator): Update.
6361 * tests/input.at (%define enum variables): Update.
6362 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
6363 (Push Parsing: Multiple impure instances): Update.
6364 (Push Parsing: Unsupported Skeletons): Update.
6365 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
6366 (Exploding the Stack Size with Malloc): Update.
6367
6368 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
6369 other entries some.
6370
63712007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
6372
6373 For the XML output's terminal element, rename @number to @token-number,
6374 and add @symbol-number. In the nonterminal element, rename @number to
6375 @symbol-number. Discussed starting at
6376 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
6377 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
6378 renames.
6379 (xsl:template match="nonterminal"): Likewise.
6380 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
6381 (xsl:template match="nonterminal"): Likewise.
6382 * src/print-xml.c (print_grammar): Implement.
6383
63842007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6385
6386 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
6387 2007-10-11 change, the child elements here are items not rules.
6388 (xsl:template match="item"): New.
6389 (xsl:template match="rule"): Update for new reduced itemset.
6390 (xsl:template match="point"): Remove.
6391 (xsl:template match="empty"): For consistency with --graph, don't
6392 output "/* empty */".
6393 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
6394 line-wrap, don't pass a negative value as first-line-length since this
6395 won't work with the following changes.
6396 (xsl:template name="line-wrap"): Simplify slightly.
6397 (xsl:template name="ws-search"): Eliminate recursion.
6398 * src/print_graph.c (print_core): Don't print a reduction's lookahead
6399 set next to an item whose dot is not at the end of the RHS even if it
6400 happens to be associated with the same rule.
6401
64022007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
6403
6404 Add %define lr.keep_unreachable_states.
6405 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
6406 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
6407 * src/main.c (main): Implement it.
6408 * tests/conflicts.at (Unreachable States After Conflict Resolution):
6409 Extend to test it, and fix a typo.
6410
64112007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
6412
6413 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
6414 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
6415 the example .output text.
6416 * tests/regression.at (Extra lookahead sets in report): Improve wording
6417 of comments.
6418
64192007-10-17 Wojciech Polak <polak@gnu.org>
6420
6421 * src/print-xml.c (print_grammar): Renamed
6422 <terminal> and <nonterminal> attributes:
6423 "type" to "number" and "symbol" to "name".
6424 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
6425 Use new attribute names.
6426 (xsl:template match="nonterminal"): Likewise.
6427 * data/xslt/xml2xhtml.xsl: Likewise.
6428
64292007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
6430
6431 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
6432 (Option Cross Key): Likewise.
6433
6434 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
6435 next to an item whose dot is not at the end of the RHS even if it
6436 happens to be associated with the same rule.
6437 * src/print.c (print_core): Likewise.
6438 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
6439 (Resolved SR Conflicts): Update output.
6440 * tests/regression.at (Extra lookahead sets in report): New test case.
6441
64422007-10-11 Wojciech Polak <polak@gnu.org>
6443
6444 * src/print-xml.c (print_core): Remove item set
6445 redundancy.
6446 * data/xslt/bison.xsl (bison:ruleNumber): New key.
6447 Improve processing time. Suggested by Joel E. Denny.
6448 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
6449 Write xsl:param "required" attribute as comment.
6450 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
6451 (xsl:template match="rule"): Support new reduced itemset.
6452 (xsl:template match="point"): Remove.
6453 * data/xslt/xml2xhtml.xsl: Likewise.
6454
64552007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
6456
6457 * src/getargs.c (version): Update copyright year.
6458
64592007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
6460
6461 Make xml2dot.xsl and --graph produce the same output.
6462 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
6463 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
6464 escaped later.
6465 (xsl:template name="output-node"): Use the new escape template instead
6466 of the string-replace template directly.
6467 (xsl:template name="output-edge"): Likewise.
6468 (xsl:template name="escape"): New, escapes backslashes and newlines in
6469 addition to quotation marks.
6470 * src/graphviz.c (start_graph, output_node, output_edge): Add
6471 whitespace to output for legibility.
6472
6473 Make xml2text.xsl and --report produce the same output, and remove the
6474 XML "conflicts" element since a conflict summary is easily extracted
6475 from the automaton.
6476 * data/xslt/bison.xsl: New.
6477 (xsl:template match="state" mode="bison:count-conflicts): New.
6478 * data/xslt/xml2text.xsl: Import bison.xsl.
6479 (xsl:template match="bison-xml-report"): Instead of styling the
6480 "conflicts" element, style the "automaton" element with mode
6481 "conflicts". Unlike the former, the latter lists S/R and R/R
6482 conflicts for a state on the same line.
6483 (xsl:template match="conflicts"): Remove.
6484 (xsl:template match="conflict"): Remove.
6485 (xsl:template match="terminal"): Line-wrap the list of rules in which
6486 the terminal is used.
6487 (xsl:template match="nonterminal"): Likewise for nonterminals.
6488 (xsl:template match="automaton" mode="conflicts"): New.
6489 (xsl:template match="state" mode="conflicts"): New.
6490 (xsl:template name="line-wrap"): New.
6491 (xsl:template name="ws-search"): New.
6492 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
6493 (xsl:template match="bison-xml-report"): Instead of styling the
6494 "conflicts" element, style the "automaton" element with mode
6495 "conflicts."
6496 (xsl:template match="conflicts"): Remove.
6497 (xsl:template match="conflict"): Remove.
6498 (xsl:template match="automaton" mode="conflicts"): New.
6499 (xsl:template match="state" mode="conflicts): New.
6500 * src/conflicts.c (conflicts_output_xml): Remove.
6501 * src/conflicts.h (conflicts_output_xml): Remove prototype.
6502 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
6503 * src/print.c (print_grammar): Consistently wrap at the 66th column so
6504 the corresponding XSLT is easier. Also, never wrap between a word and
6505 the comma that follows it.
6506
65072007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
6508
6509 Improve C++ namespace support. Discussed starting at
6510 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
6511 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
6512 b4_namespace_close): New macros that interpret the %define variable
6513 "namespace" so its value can contain "::" to indicate nested
6514 namespaces.
6515 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
6516 the above macros.
6517 * data/lalr1.cc (b4_namespace): Likewise.
6518 * data/location.cc (b4_namespace): Likewise.
6519 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
6520 inside a new table in the general %define entry. Document `%define
6521 namespace' there as well. Point the %name-prefix entry to it since it
6522 explains it more completely in the case of C++.
6523 (C++ Bison Interface): Mention `%define namespace' instead of
6524 %name-prefix.
6525 (Table of Symbols): Remove the `%define push_pull' entry. The %define
6526 entry suffices.
6527 * tests/c++.at (Relative namespace references): New test case.
6528 (Absolute namespace references): New test case.
6529 (Syntactically invalid namespace references): New test case.
6530 * tests/input.at (C++ namespace reference errors): New test case.
6531
65322007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
6533
6534 Add syncline support and location accessor to internal %define
6535 interfaces.
6536 * data/bison.m4 (b4_percent_define_get_loc): New.
6537 (b4_percent_define_get_syncline): New.
6538 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
6539 (b4_percent_define_default): Record defining location as line 1 rather
6540 than 0 for the sake of synchronizing #line's, and define
6541 b4_percent_define_syncline(VARIABLE).
6542 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
6543 * src/muscle_tab.c (muscle_syncline_grow): New.
6544 (muscle_code_grow): Use muscle_syncline_grow.
6545 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
6546 define b4_percent_define_syncline(VARIABLE).
6547 (muscle_percent_define_get_loc): New.
6548 (muscle_percent_define_get_syncline): New.
6549 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
6550 remove some unused variables.
6551 (muscle_percent_define_default): Record defining location as line 1
6552 rather than 0 for the sake of synchronizing #line's, and define
6553 b4_percent_define_syncline(VARIABLE).
6554 (muscle_percent_define_check_values): Use
6555 muscle_percent_define_get_loc.
6556 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
6557 (muscle_percent_define_get_syncline): Prototype.
6558 * tests/skeletons.at (%define Boolean variables: invalid skeleton
6559 defaults): Update output for location change.
6560 (Complaining during macro argument expansion): Extend to test
6561 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
6562
65632007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
6564
6565 Fix some error-reporting macro bugs.
6566 * data/bison.m4 (b4_cat): New.
6567 (b4_error, b4_error_at): Use b4_cat to send error directives directly
6568 to stdout so they don't become arguments to other macros. Update
6569 comments and add examples.
6570 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
6571 add examples.
6572 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
6573 after printing the error directive so that M4 doesn't report subsequent
6574 problems that are induced by this problem.
6575 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
6576 instead of just in them. Recognize @\n in both places. Both expand to
6577 the empty string. Needed by b4_cat.
6578 * tests/skeletons.at (Complaining during macro argument expansion):
6579 New test case.
6580 (Fatal errors make M4 exit immediately): New test case.
6581
65822007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
6583
6584 Implement --print-datadir.
6585 * src/getargs.c (usage): Mention.
6586 (PRINT_DATADIR_OPTION): New anonymous enum member.
6587 (long_options): Add entry for it.
6588 (getargs): Add case for it calling compute_pkgdatadir.
6589 * src/output.c (output_skeleton): Encapsulate data directory
6590 computation from here...
6591 (prepare): ... and from here...
6592 (compute_pkgdatadir): ... into this new function.
6593 * src/output.h (compute_pkgdatadir): Prototype.
6594
65952007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
6596
6597 * src/print-xml.c (escape_bufs): New static global variable
6598 replacing...
6599 (xml_escape_n): ... the static local variable buf here.
6600 (print_xml): Free memory for escape_bufs.
6601 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
6602
66032007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
6604
6605 Replace `%push-parser' and `%push-pull-parser' with
6606 `%define push_pull "push"' and `%define push_pull "both"'.
6607 `%define push_pull "pull"' is the default.
6608 * doc/bison.texinfo (Push Decl, Push Parser Function,
6609 Pull Parser Function, Parser Create Function, Parser Delete Function):
6610 Update declarations.
6611 (Decl Summary, Table of Symbols): Replace %push-parser and
6612 %push-pull-parser entries with a %define push_pull entry.
6613 * data/bison.m4 (b4_percent_define_check_values): New macro.
6614 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
6615 definitions...
6616 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
6617 definitions...
6618 * data/push.c: ... to here and compute them from the value of the
6619 %define variable push_pull.
6620 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
6621 parsing requests here...
6622 * data/yacc.c: ... hack this to switch to push.c any time
6623 b4_use_push_pull_flag or the %define variable push_pull is set. This
6624 will go away when we mv push.c yacc.c.
6625 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
6626 push parsing is not supported since unused %define variables are
6627 reported anyway.
6628 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
6629 * src/muscle_tab.h (muscle_percent_define_check_values): Update
6630 comments for consistency with b4_percent_define_check_values.
6631 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
6632 muscles.
6633 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
6634 Remove.
6635 (prologue_declaration): Remove %push-parser and %push-pull-parser
6636 rules.
6637 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
6638 * tests/calc.at: Update declarations.
6639 * tests/input.at (%define enum variables): New test case.
6640 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
6641 declaration.
6642 (Push Parsing: Multiple impure instances): Update declaration.
6643 (Push Parsing: Unsupported Skeletons): New test case.
6644 * tests/torture.at (Exploding the Stack Size with Alloca): Update
6645 declaration.
6646 (Exploding the Stack Size with Malloc): Update declaration.
6647
66482007-09-24 Wojciech Polak <polak@gnu.org>
6649
6650 Add XSLT transformations.
6651
6652 * data/xslt/xml2dot.xsl: Transform XML into DOT.
6653 * data/xslt/xml2text.xsl: Transform XML into plain text.
6654 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
6655 * data/Makefile.am (xsltdir): New variable.
6656 (dist_xslt_DATA): Add xslt/*.xsl files.
6657
66582007-09-23 Paul Eggert <eggert@cs.ucla.edu>
6659
6660 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
6661 Problem reported by Wojciech Polak.
6662 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
6663 (xml_printf): Undo change I made on 21 September; that is,
6664 indent 2 spaces, not 1.
6665
66662007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
6667
6668 Pacify ./configure --enable-gcc-warnings.
6669 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
6670 `char const *' instead of `char *'.
6671 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
6672 local variable `sep'.
6673
66742007-09-21 Paul Eggert <eggert@cs.ucla.edu>
6675
6676 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
6677 elsewhere.
6678 * src/print-xml.c: Prefer "const" after types; that's more consistent.
6679 (xml_printf): Indent just 1 space for level.
6680 (e_char, xlate_char): Remove.
6681 (xml_escape_string): Rewrite to avoid undefined behavior (used
6682 storage that was freed from the stack).
6683 (xml_escape_n): Don't bother checking for subscript error.
6684
66852007-09-21 Wojciech Polak <polak@gnu.org>
6686
6687 Add Bison XML Automaton Report.
6688
6689 Add support for an -x option to generate an XML report.
6690 It is not documented yet.
6691 * src/print-xml.c: New file.
6692 * src/print-xml.h: Likewise.
6693 * lib/timevar.def (TV_XML): New var.
6694 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
6695 * src/conflicts.c: Include print-xml.h.
6696 (solved_conflicts_xml_obstack): New var.
6697 (log_resolution, conflicts_solve, conflicts_free):
6698 Add support for XML report.
6699 (conflicts_output_val): New function.
6700 * src/conflicts.h (conflicts_output_val): New decl.
6701 * src/files.c (spec_xml_file): New var.
6702 (compute_output_file_names, output_file_names_free): Add XML support.
6703 * src/files.h (spec_xml_file): New decl.
6704 * src/getargs.c (xml_flag): New var.
6705 (usage, short_options, long_options, getargs): Add XML support.
6706 * src/getargs.h (xml_flag): New decl.
6707 * src/gram.c: Include print-xml.h.
6708 (rule_lhs_print_xml, rule_rhs_print_xml):
6709 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
6710 New functions.
6711 * src/gram.h: Declare external ones.
6712 * src/main.c: Include print-xml.h.
6713 (main): Add XML support.
6714 * src/reduce.c: Include print-xml.h.
6715 (reduce_xml): New function.
6716 * src/reduce.h: Declare it.
6717 * src/state.c: Include print-xml.h.
6718 (state_new): Add XML support.
6719 (state_rule_lookahead_tokens_print_xml): New function.
6720 * src/state.h: Declare it.
6721 (struct state): New member solved_conflicts_xml.
6722 * src/symtab.c (symbol_class_get_string): New function.
6723 * src/symtab.h: Declare it.
6724
67252007-09-21 Paul Eggert <eggert@cs.ucla.edu>
6726
6727 * GNUmakefile: Switch to coreutils's version.
6728 * bootstrap: Likewise.
6729 * Makefile.cfg: Adjust to new GNUmakefile.
6730 * README-hacking: Likewise.
6731
6732 Import from gnulib:
6733
6734 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
6735 Bruno Haible <bruno@clisp.org>
6736
6737 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
6738 and is a script that invokes bison. Tighten the code. Add comments.
6739
67402007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
6741
6742 Spell "boolean" as "Boolean". Reported by Akim Demaille.
6743 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
6744 * doc/bison.texinfo (Decl Summary): Fix.
6745 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
6746 * tests/input.at (Boolean %define variables): Update output.
6747 * tests/skeletons.at (%define boolean variables: invalid skeleton
6748 defaults): Rename to...
6749 (%define Boolean variables: invalid skeleton defaults): ... this and
6750 update output.
6751
67522007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
6753
6754 In impure push mode, don't allow more than one yypstate to be allocated
6755 since multiple impure parsers would corrupt yynerrs.
6756 * data/push.c (yypstate_allocated): New static global variable
6757 initialized to 0.
6758 (yypull_parse): If yypstate_new returns 0, don't report it as memory
6759 exhaustion if yypstate_allocated is 1, but still return 2.
6760 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
6761 already 1. Otherwise, set it to 1.
6762 (yypstate_delete): Set it to 0.
6763 * tests/push.at (Push Parsing: Multiple impure instances): New test
6764 case.
6765
67662007-08-17 Bob Rossi <bob@brasko.net>
6767
6768 * doc/bison.texinfo (Push Decl): Document the push parser.
6769 (Table of Symbols): Ditto.
6770 (Pure Decl): Ditto.
6771 (Decl Summary): Ditto.
6772 (Multiple Parsers, Push Parser Function, Pull Parser Function,
6773 Parser Create Function, Parser Delete Function):
6774 Add new push parser symbols.
6775 (Table of Symbols): Document push-parser, push-pull-parser,
6776 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
6777
67782007-08-15 Paul Eggert <eggert@cs.ucla.edu>
6779
6780 Update to GPLv3.
6781 * doc/gpl-3.0.texi: New file.
6782 * doc/gpl.texi: Remove.
6783 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
6784 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
6785 * README-hacking, TODO, bootstrap, bootstrap.conf:
6786 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
6787 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
6788 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
6789 * data/lalr1.cc, data/lalr1.java, data/location.cc:
6790 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
6791 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
6792 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
6793 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
6794 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
6795 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
6796 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
6797 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
6798 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
6799 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
6800 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
6801 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
6802 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
6803 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
6804 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
6805 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
6806 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
6807 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
6808 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
6809 * src/complain.c, src/complain.h, src/conflicts.c:
6810 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
6811 * src/files.h, src/flex-scanner.h, src/getargs.c:
6812 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
6813 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
6814 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
6815 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
6816 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
6817 * src/print.c, src/print.h, src/print_graph.c:
6818 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
6819 * src/reduce.h, src/relation.c, src/relation.h:
6820 * src/revision.h, src/scan-code.h, src/scan-code.l:
6821 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
6822 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
6823 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
6824 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
6825 * tests/Makefile.am, tests/actions.at, tests/c++.at:
6826 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
6827 * tests/existing.at, tests/glr-regression.at:
6828 * tests/headers.at, tests/input.at, tests/java.at:
6829 * tests/local.at, tests/output.at, tests/push.at:
6830 * tests/reduce.at, tests/regression.at, tests/sets.at:
6831 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
6832 * tests/torture.at:
6833 Update to GPLv3.
6834
68352007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
6836
6837 Get rid of broken %no-parser, -n, and --no-parser implementation and
6838 documentation.
6839 * TODO: Don't mention them.
6840 * doc/bison.1: Likewise.
6841 * doc/bison.texinfo (Decl Summary): Likewise.
6842 (Bison Options): Likewise.
6843 (Option Cross Key): Likewise.
6844 * src/getargs.c (no_parser_flag): Remove global variable.
6845 (usage): Don't print description of -n and --no-parser.
6846 (long_options): Remove --no-parser entry here.
6847 (getargs): Remove -n case in the switch here.
6848 * src/getargs.h (no_parser_flag): Remove extern.
6849 * tests/regression.at (Web2c Actions): Remove comment that mentions
6850 --no-parser.
6851
68522007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
6853
6854 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
6855 name user variables starting with `yy'. Just pass NULL instead of a
6856 dummy local &yylval to yypush_parse.
6857 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
6858 starting with `yy'.
6859
68602007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
6861
6862 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
6863 true since it's then always used regardless of whether yyoverflow is
6864 defined. Reported by Christian Burger at
6865 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
6866 * THANKS: Add Christian Burger.
6867
6868 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
6869 node names: say "Decl Summary" not "Bison Declaration Summary".
6870
68712007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
6872
6873 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
6874 determine whether this function has already complained about an invalid
6875 value for a %define boolean variable, don't check whether Bison has
6876 ever examined the value. As written, the check was a tautology.
6877 Instead, record and check for this complaint using a separate muscle.
6878
68792007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
6880
6881 Fix push parsing memory leak reported by Brandon Lucia at
6882 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
6883 * THANKS: Add Brandon Lucia.
6884 * data/push.c (yypstate_delete): Free the stack if it was reallocated
6885 but the parse never completed and thus freed it.
6886 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
6887 * tests/testsuite.at: Include push.at.
6888 * test/push.at: New.
6889 (Push Parsing: Memory Leak for Early Deletion): New test case.
6890
68912007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
6892
6893 Improve handling of multiple S/R conflicts in the same state and of S/R
6894 conflicts involving multiple reductions.
6895 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
6896 set for a state here or Bison will abort if it is reassigned on a
6897 later conflicted reduction in the same state.
6898 Similarly, don't finalize and assign the solved conflicts report here
6899 or it will be lost if it is reassigned on a later conflicted reduction
6900 in the same state.
6901 (set_conflicts): Instead, assign them both here after all S/R conflicts
6902 in the state have been fully examined.
6903 * src/print.c (shift_set): Rename to...
6904 (no_reduce_set): ... this.
6905 (print_reductions): Update for rename, and add %nonassoc error action
6906 tokens to no_reduce_set so that, when printing the first remaining
6907 reduction on an error action token, the reduction is enclosed in
6908 brackets.
6909 (print_results): Update for rename.
6910 * tests/conflicts.at (Solved conflicts report for multiple reductions
6911 in a state): New test case.
6912 (%nonassoc error actions for multiple reductions in a state): New test
6913 case.
6914
6915 * src/main.c (main): Don't depend on C99 features.
6916
69172007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
6918
6919 * build-aux/.cvsignore: Add compile.
6920 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
6921 uniwidth.
6922
69232007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
6924
6925 * bootstrap (slurp): Create target directories that don't exist.
6926 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
6927
69282007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
6929
6930 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
6931 than item number.
6932 * closure.c (closure): Likewise.
6933 * state.h (reductions): Comment sorting of rules.
6934 (state): Comment sorting of items.
6935
69362007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
6937
6938 Fix C++ test cases after recent Gnulib changes. Discussed starting at
6939 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
6940 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
6941 definition in order to avoid Gnulib headers since we don't use config.h
6942 here.
6943 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
6944 rather than AT_DATA so that config.h is included.
6945
69462007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
6947
6948 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
6949 instead of fprintf. Guard these functions with #if YYDEBUG instead of
6950 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
6951 and so that YYFPRINTF is guaranteed to be defined here.
6952
69532007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
6954
6955 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
6956 with...
6957 (muscle_percent_define_check_values): ... this more helpful function.
6958 Again, it's not used yet, but it will be.
6959 * src/muscle_tab.h: Likewise.
6960
6961 Improve some comments in parser table construction.
6962 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
6963 (generate_states): Don't mention ruleset, which is internal to closure.
6964 * src/closure.c (closure): Explain sorting of core and itemset, which
6965 is required for this function to behave correctly.
6966 * src/closure.h (closure): Mention sorting.
6967
69682007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
6969
6970 * src/lalr.c (state_lookahead_tokens_count): For code readability,
6971 move the check for disabled transitions to an aver since conflict
6972 resolution hasn't happened yet.
6973
6974 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
6975 labels a state as inconsistent just because it has error transitions.
6976 The original form of this check appeared in revision 1.1 of lalr.c,
6977 which was committed on 1991-12-21. Now (at least), changing the
6978 consistency label on such a state appears to have no useful effect in
6979 any of the places it is examined, which I enumerate below. The key
6980 point to understanding each item in this enumeration is that a state
6981 with an error transition is labelled consistent in the first place only
6982 if it has no rules, so the check cannot matter for states that have
6983 rules. (1) Labelling a state as inconsistent will cause set_conflicts
6984 to try to identify its conflicts, and a state must have *rules* to have
6985 conflicts. (2) Labelling a state as inconsistent will affect how
6986 action_row sets the default *rule* for the state. (3) Labelling a
6987 state as inconsistent will cause build_relations to add lookback edges
6988 to *rules* in that state.
6989 * src/state.h (struct state): Word the comment for member consistent
6990 more carefully.
6991
69922007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
6993
6994 Don't depend on C99 features.
6995 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
6996 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
6997 * src/reader.c (check_and_convert_grammar): Fix for-loop.
6998 * src/state.c (state_mark_reachable_states): Fix for-loop.
6999 (state_remove_unreachable_states): Fix for-loop.
7000
7001 Don't widen struct state with member reachable just to temporarily
7002 record reachability. Instead, use a local bitset.
7003 * src/state.h (struct state): Remove member.
7004 * src/state.c (state_new): Don't initialize it.
7005 (state_mark_reachable_states): Rename to...
7006 (state_record_reachable_states): ... this, and use bitset.
7007 (state_remove_unreachable_states): Use bitset.
7008
70092007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
7010
7011 * src/Makefile.am (yacc): Quote target action commands properly so
7012 that the yacc script isn't corrupt. Reported by Hans Aberg at
7013 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
7014
7015 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
7016 the case of pure parsers. Reported by Frans Englich at
7017 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
7018 * THANKS: Add Frans Englich.
7019
7020 * NEWS (2.3a+): In the %code entry, reference section `Bison
7021 Declaration Summary' from the manual now since the %code summary has
7022 moved there.
7023 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
7024 in the rules section must be terminated by semicolons.
7025
70262007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
7027
7028 Extend the front-end API for %define variables to more completely
7029 mirror the back-end. This will be useful in the future.
7030 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
7031 Update comments to mention the new front-end counterparts of these
7032 macros.
7033 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
7034 for muscle_string_decode and muscle_location_decode.
7035 (muscle_string_decode): New static function.
7036 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
7037 (muscle_percent_define_get, muscle_percent_define_ifdef): New
7038 functions.
7039 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
7040 muscle_percent_define_get to mimic the b4_percent_define_flag_if
7041 implementation more closely.
7042 (muscle_percent_define_invalid_value): New function.
7043 * src/muscle_tab.h (muscle_percent_define_get,
7044 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
7045 Prototype.
7046
70472007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
7048
7049 * NEWS (2.3a+): Mention yesterday's state-removal change.
7050 (2.3a): Remove the %language entry, which was added after 2.3a.
7051 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
7052 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
7053 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
7054 tests/existing.at: Update copyright date.
7055
70562007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
7057
7058 If conflict resolution makes states unreachable, remove those states,
7059 report rules that are then unused, and don't report conflicts in those
7060 states.
7061 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
7062 New global function.
7063 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
7064 function.
7065 * src/main.c (main): After conflict resolution, remove the unreachable
7066 states and update all data structures that reference states by number.
7067 * src/state.c (state_new): Initialize each state's reachable member to
7068 false.
7069 (state_mark_reachable_states): New static function.
7070 (state_remove_unreachable_states): New global function.
7071 * src/state.h (struct state): Add member bool reachable.
7072 (state_remove_unreachable_states): Prototype.
7073 * tests/conflicts.at (Unreachable States After Conflict Resolution):
7074 New test case.
7075 * tests/existing.at (GNU pic Grammar): Update test case output now that
7076 an unused rule is discovered.
7077
70782007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
7079
7080 Minor code cleanup in parser table construction.
7081 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
7082 (new_itemsets, save_reductions): Update for rename to nitemset.
7083 * src/closure.c (nritemset): Rename to...
7084 (nitemset): ... this since the "r" appears to meaningless and isn't
7085 used in the comments.
7086 (closure): Update for rename.
7087 * src/closure.h (nritemset): Update extern to...
7088 (nitemset): ... this.
7089 * src/lalr.c (LA): Fix a typo in comments.
7090 * src/print.c (print_core): Update for rename to nitemset.
7091 * src/print_graph.c (print_graph): Likewise.
7092 * src/state.h: Fix some typos in header comments.
7093
70942007-04-04 Paul Eggert <eggert@cs.ucla.edu>
7095
7096 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
7097 still sticks to ASCII. Sorry!
7098
7099 * README-hacking: New file, taken mostly from coreutils, with changes
7100 for Bison. Contains much of the contents of:
7101 * README-cvs: Remove.
7102 * bootstrap: Sync from gnulib.
7103 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
7104 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
7105
71062007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
7107
7108 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
7109 Setzer.
7110 (Java Differences): Fix some typos.
7111 * THANKS: Add Sebastian Setzer.
7112
71132007-03-07 Paolo Bonzini <bonzini@gnu.org>
7114
7115 * data/java.m4 (b4_single_class_if): Remove.
7116 (b4_abstract_if): Look at "%define abstract".
7117 (b4_lexer_if): New.
7118 (b4_union_name): Rename...
7119 (b4_yystype): ... to this. Map to "%define stype".
7120 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
7121 b4_maybe_throws): Fix quoting.
7122 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
7123 * data/lalr1.java (Lexer interface): Always define.
7124 (Lexer interface within parser class): Remove.
7125 (YYLexer class): New, used when "%code lexer" is present.
7126 (constructor): When "%code lexer" is used, pass %lex-param
7127 to the lexer constructor.
7128 (yylex, yyparse): Remove %lex-param from method invocations
7129 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
7130
7131 * doc/bison.texinfo (Java Bison Interface): Mention "%define
7132 abstract". Rename "%define union_name" to "%define stype".
7133 Rename method names according to previous patch.
7134 (Java Scanner Interface): Describe "%code lexer" instead of
7135 "%pure-parser" and "%define single_class".
7136 (Java Differences): Mention "%code lexer".
7137
7138 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
7139 Include scanner here, using macros from tests/local.at.
7140 (AT_DATA_CALC_Y): Remove final argument.
7141 (_AT_CHECK_JAVA_CALC): Likewise.
7142 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
7143 of %locations and %error-verbose.
7144 (main): Test with and without %lex-param.
7145 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
7146 (AT_BISON_OPTION_POPDEFS): Pop it.
7147
71482007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7149
7150 DJGPP spefic issue. Inhibit the use of disallowed characters for
7151 file name genertion on Win98, WinXP, etc. These are |<>":?*\
7152 and concern testsuite case 46.
7153 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
7154 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
7155 * djgpp/config.bat: Inhibit the use of disallowed characters.
7156
71572007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
7158
7159 Miscellaneous %define and %code cleanup.
7160 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
7161 values are interpreted.
7162 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
7163 documentation a little more.
7164 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
7165 muscle_percent_define_insert, muscle_percent_code_grow): New
7166 functions/macros.
7167 * src/muscle_tab.h (muscle_percent_define_insert,
7168 muscle_percent_code_grow): Prototype.
7169 * src/parse-gram.y (prologue_declaration): Use
7170 muscle_percent_define_insert and muscle_percent_code_grow when parsing
7171 %define and %code directives.
7172
7173 Make it easy to share %define boolean variables between the front-end
7174 and back-end. Though not used yet, this will be useful in the future.
7175 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
7176 Bison uses of names rather than just skeleton uses of names.
7177 (b4_percent_define_get, b4_percent_define_ifdef): Rename
7178 b4_percent_define_skeleton_variables(VARIABLE) to
7179 b4_percent_define_bison_variables(VARIABLE).
7180 (b4_percent_code_get, b4_percent_code_ifdef): Rename
7181 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
7182 b4_percent_code_bison_qualifiers(QUALIFIER).
7183 (b4_check_user_names_wrap): Update for renames.
7184 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
7185 muscle_percent_define_default): New functions mimicking
7186 b4_percent_define_flag_if and b4_percent_define_default.
7187
7188 For %define variables, report locations for invalid values and
7189 redefinitions.
7190 * data/bison.m4 (b4_percent_define_flag_if): Read
7191 b4_percent_define_loc(VARIABLE) to report the location of an invalid
7192 value for VARIABLE.
7193 (b4_percent_define_default): Save a special location in
7194 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
7195 must later be reported as invalid.
7196 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
7197 functions.
7198 (muscle_percent_define_insert): Record the location of VARIABLE in
7199 muscle percent_define_loc(VARIABLE), and use it to report the previous
7200 location for a redefinition.
7201 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
7202 (muscle_percent_define_default): Update like b4_percent_define_default.
7203 (muscle_grow_user_name_list): Rename to...
7204 (muscle_user_name_list_grow): ... this for consistency and use
7205 muscle_location_grow.
7206 * src/muscle_tab.h (muscle_location_grow): Prototype.
7207 * tests/input.at (%define errors): Update expected output.
7208 * tests/skeletons.at (%define boolean variables: invalid skeleton
7209 defaults): New test case.
7210
72112007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
7212
7213 * src/print.c (lookahead_set, state_default_rule): Remove.
7214 (print_reductions): Replace state_default_rule invocation with
7215 equivalent use of yydefact, which was computed in token_actions in
7216 tables.c.
7217 (print_results): Don't allocate lookahead_set.
7218
72192007-02-27 Paolo Bonzini <bonzini@gnu.org>
7220
7221 * data/lalr1.java: Prefix all private members with yy.
7222
72232007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
7224
7225 Use YYFPRINTF instead of fprintf where appropriate. Reported by
7226 Sebastien Fricker at
7227 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
7228 * THANKS: Add Sebastien Fricker.
7229 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
7230 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
7231 accept a variable number of arguments.
7232
72332007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
7234
7235 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
7236
72372007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7238
7239 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
7240 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
7241 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
7242
72432007-02-11 Paul Eggert <eggert@cs.ucla.edu>
7244
7245 Undo my 2007-02-07 change, switching back to the c-strcase module
7246 introduced in the 2007-02-03 change. Bruno Haible reported that
7247 the 2007-02-07 change would be dangerous in Turkish if we add a
7248 language whose name contains "i", since "i" is not lowercase "I"
7249 in Turkish.
7250 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
7251 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
7252 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
7253 * m4/.cvsignore: Remove strcase.m4.
7254 * src/getargs.c: Revert 2007-02-07 change, as follows.
7255 Include c-strcase.h.
7256 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
7257
72582007-02-11 Bruno Haible <bruno@clisp.org>
7259
7260 Enable the Java related testsuite tests when the only Java compiler
7261 found is a gcj < 4.3. Discussed at
7262 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
7263 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
7264
72652007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
7266
7267 * data/Makefile.am: Update copyright date.
7268 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
7269 yypstate_new returns NULL.
7270 (yypstate_new): Return NULL if malloc does.
7271 * src/reader.c (packgram): Move translation of rule actions from the
7272 beginning of packgram to...
7273 (check_and_convert_grammar): ... here right before packgram is invoked
7274 so it's easier to write more complete comments, and remove redundant
7275 code.
7276
72772007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
7278
7279 As in semantic actions, make @$ in %initial-action, %destructor, and
7280 %printer imply %locations.
7281 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
7282 scanning @$.
7283 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
7284 (@$ in %initial-action implies %locations,
7285 @$ in %destructor implies %locations,
7286 @$ in %printer implies %locations): ... these new test cases.
7287
72882007-02-07 Paul Eggert <eggert@cs.ucla.edu>
7289
7290 Undo most of the 2007-02-03 change, switching to the strcase module
7291 now that gnulib strcase has been fixed.
7292 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
7293 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
7294 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
7295 * m4/.cvsignore: Add strcase.m4.
7296 * src/getargs.c: Revert 2007-02-03 change, as follows.
7297 Don't include c-strcase.h.
7298 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
7299 strcasecmp has "unspecified behavior" outside the POSIX locale,
7300 but it works fine in practice if at least one argument is ASCII,
7301 as is the case in Bison.
7302
73032007-02-07 Paolo Bonzini <bonzini@gnu.org>
7304
7305 * tests/java.at: Skip tests if only one of javac/java is present.
7306 Reported by Joel E. Denny.
7307 * tests/atlocal.in: Adjust copyright years.
7308
73092007-02-05 Paolo Bonzini <bonzini@gnu.org>
7310
7311 * data/lalr1.java (Stack): Work around old verifiers that disallow
7312 access to the private fields of an inner class, from the outer class.
7313 We can make Stack's fields public because user code doesn't have access
7314 to the instance of Stack used by parse(). Reported by Paul Eggert.
7315
73162007-02-03 Paul Eggert <eggert@cs.ucla.edu>
7317
7318 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
7319 the right spot for these files?
7320 * bootstrap.conf (gnulib_modules): Add c-strcase.
7321 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
7322 c-strncasecmp.c.
7323 * src/getargs.c: Include c-strcase.h.
7324 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
7325 to avoid unspecified behavior.
7326
73272007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
7328
7329 * doc/bison.texinfo (Decl Summary): Correct typo.
7330
73312007-01-30 Paolo Bonzini <bonzini@gnu.org>
7332
7333 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
7334 Complain if the value does not match empty, "true" or "false".
7335 * data/c++.m4: Adjust default definitions of %define variables.
7336 * data/java.m4: Adjust default definitions of %define variables.
7337 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
7338 to above behavior.
7339 * tests/input.at (Boolean %define variables): Test new behavior.
7340
73412007-01-29 Paolo Bonzini <bonzini@gnu.org>
7342
7343 * NEWS: Mention java.
7344 * TODO: Remove things that are done.
7345 * bootstrap.conf: Add javacomp-script and javaexec-script.
7346 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
7347
7348 * data/Makefile.am: Add new files.
7349 * data/java-skel.m4: New.
7350 * data/java.m4: New.
7351 * data/lalr1.java: New.
7352
7353 * doc/bison.texinfo: Put "A Complete C++ Example" under
7354 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
7355 under Other Languages.
7356
7357 * src/getargs.c (valid_languages): Add Java.
7358 * src/getargs.h (struct bison_language): Update size of string fields.
7359
7360 * tests/Makefile.am: Add java.at.
7361 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
7362 * tests/java.at: New.
7363 * tests/testsuite.at: Include it.
7364
73652007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
7366
7367 Clean up.
7368 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
7369 at_directive_argv arguments so these no longer have to be global
7370 variables. Also, update the implementation for the following changes.
7371 (fail_for_at_directive_too_many_args,
7372 fail_for_at_directive_too_few_args): Add at_directive_name argument.
7373 (at_directive_name): Remove as at_directive_argv[0] will be used for
7374 this now.
7375 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
7376 for the directive name.
7377 (at_directive_argc, at_directive_argv): Make these local within
7378 skel_lex instead of global.
7379 (INITIAL): Update directive start action for above changes.
7380 (SC_AT_DIRECTIVE_ARG): Rename to...
7381 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
7382 (SC_AT_DIRECTIVE_SKIP_WS): Update.
7383 (scan_skel): Move yylex_destroy to...
7384 (skel_scanner_free): ... here.
7385 * tests/skeletons.at (installed skeleton file name): Rename to...
7386 (installed skeleton file names): ... this.
7387
73882007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
7389
7390 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
7391 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
7392 Summary" not "Directives".
7393 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
7394 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
7395 since the former is now the more complete one.
7396 (Prologue Alternatives): Likewise and do the same for %defines.
7397 (Table of Symbols): Add summary of %code, add summary of %define, and
7398 move full %code documentation to...
7399 (Decl Summary): ... here for consistency with other entries in these
7400 sections.
7401 Move %define entry in order to keep this list alphabetized.
7402 Reword %define entry a little to put less emphasis on the skeleton
7403 concept, which most users shouldn't have to think about.
7404
74052007-01-26 Paul Eggert <eggert@cs.ucla.edu>
7406
7407 Adjust to recent gnulib changes.
7408 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
7409 Add string.h, string_.h, unistd_.h, wchar_.h.
7410 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
7411 * src/system.h: Don't include <stpcpy.h>; this is now done by
7412 <string.h>.
7413
74142007-01-23 Paolo Bonzini <bonzini@gnu.org>
7415
7416 Simplify implementation of unqualified %code, implement macros for
7417 uniform treatment of boolean %define flags. Document %define.
7418 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
7419 b4_percent_code_ifdef): New.
7420 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
7421 * data/c++.m4: Define default value for global_tokens_and_yystype.
7422 * data/glr.cc: Likewise.
7423 * data/location.cc: Use b4_percent_define_flag_if.
7424
7425 * doc/bison.texinfo (Decl Summary): Document %define.
7426
7427 * src/parse-gram.y (Unqualified %code): Change muscle name to
7428 b4_percent_code().
7429 (content.opt): Default to empty.
7430
74312007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
7432
7433 Implement support for relative and absolute skeleton file names.
7434 Discussed starting at
7435 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
7436 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
7437 (Bison Options): Document in --skeleton entry.
7438 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
7439 full_skeleton can't necessarily hold all of pkgdatadir.
7440 If the specified skeleton file name contains a `/', don't prepend
7441 pkgdatadir.
7442 * src/parse-gram.y (prologue_declaration): If the specified skeleton
7443 file name contains a `/', prepend the grammar file directory.
7444 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
7445 * skeletons.at: New file.
7446 (relative skeleton file names): New test case.
7447 (installed skeleton file names): New test case.
7448 * tests/testsuite.at: Include skeletons.at.
7449
7450 * bootstrap: Update copyright to 2007.
7451
74522007-01-17 Paolo Bonzini <bonzini@gnu.org>
7453
7454 * bootstrap: Remove occurrences of .#bootmp from the files.
7455
74562007-01-17 Akim Demaille <akim@epita.fr>
7457
7458 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
7459 nonterminals.
7460 Use per-type %printer.
7461
74622007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
7463
7464 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
7465 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
7466 djgpp/config.site, src/files.c, src/files.h, src/main.c,
7467 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
7468 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
7469 tests/glr-regression.at, tests/input.at, tests/local.at,
7470 tests/output.at, tests/torture.at: Update copyright to 2007.
7471
74722007-01-16 Akim Demaille <akim@epita.fr>
7473
7474 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
7475 error code.
7476 (Calc++ Scanner): Exit with failure if we can't open the input
7477 file.
7478 Accept "-" standing for stdin.
7479 (Calc++ Top Level): Print the result only if the parsing was
7480 successful.
7481
74822007-01-16 Akim Demaille <akim@epita.fr>
7483
7484 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
7485
74862007-01-15 Paolo Bonzini <bonzini@gnu.org>
7487 and Joel E. Denny <jdenny@ces.clemson.edu>
7488
7489 Clean up %define and %code implementation in M4 some. Most
7490 importantly, rename all related macros to be in the b4_percent_define
7491 and b4_percent_code namespaces. Also, complete support for `.' in
7492 %define variable names and %code qualifiers.
7493 * data/bison.m4 (b4_check_user_names): Check for special
7494 "SKELETON-NAMESPACE(name)" macros instead of using two nested
7495 m4_foreach loops.
7496 (b4_get_percent_define, b4_get_percent_code): Rename to...
7497 (b4_percent_define_get, b4_percent_code_get): ... these.
7498 Extend documentation with examples.
7499 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
7500 b4_percent_define_skeleton_variables and
7501 b4_percent_code_skeleton_qualifiers.
7502 Expect any value for the %define variable `foo' to be stored in the
7503 macro named `b4_percent_define(foo)'; expect any %code blocks for the
7504 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
7505 expect any unqualified %code blocks to be stored in a macro named
7506 `b4_percent_code_unqualified'.
7507 Use m4_indir so that %define variable names and %code qualifiers can
7508 contain `.', which is allowed by the grammar parser.
7509 (b4_percent_define_default): New macro to set a default value for a
7510 %define variable.
7511 (m4_wrap): Update wrapped code, and fix some underquoting.
7512 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
7513 Expect grammar uses of %define variables and %code qualifiers to be
7514 defined in b4_percent_define_user_variables and
7515 b4_percent_code_user_qualifiers.
7516 * data/c++.m4: Use b4_percent_define_default rather than
7517 m4_define_default. Fix some underquoting. Skeleton usage of %define
7518 variable define_location_comparison now implies skeleton usage of
7519 %define variable filename_type.
7520 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
7521 data/push.c, data/yacc.c: Update macro names.
7522 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
7523 muscle names.
7524
75252007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7526
7527 DJGPP specific issues.
7528
7529 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
7530 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
7531
75322007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
7533
7534 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
7535 run parsers in all tests so that Valgrind is invoked during
7536 maintainer-check-valgrind.
7537 (Duplicate representation of merged trees): Free all semantic values.
7538 (Duplicated user destructor for lookahead): Likewise.
7539
75402007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
7541
7542 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
7543 command-line prefix.
7544 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
7545 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
7546 miss Valgrind messages.
7547 (Exploding the Stack Size with Malloc): Likewise.
7548
75492007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
7550
7551 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
7552 locals. Reported by Juan Manuel Guerrero at
7553 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
7554 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
7555 Fix some indentation also.
7556 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
7557 explaining this issue.
7558
75592007-01-09 Paolo Bonzini <bonzini@gnu.org>
7560 and Joel E. Denny <jdenny@ces.clemson.edu>
7561
7562 Simplify union and prologue handling, and escape union and lex/parse
7563 params with digraphs.
7564 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
7565 values to the empty string since these are no longer guaranteed
7566 initialized by the front-end.
7567 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
7568 braces around b4_user_stype since this is no longer done by the
7569 front-end.
7570 * src/files.c, src/files.h (pre_prologue_obstack,
7571 post_prologue_obstack): Remove.
7572 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
7573 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
7574 with digraphs. This fixes lex params and parse params.
7575 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
7576 * src/output.c (prepare): Remove muscle insertion of the prologues.
7577 (output): Remove freeing of pre_prologue_obstack and
7578 post_prologue_obstack.
7579 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
7580 than prologue_augment for prologue parsing so you don't need prologue
7581 obstacks.
7582 (grammar_declaration): For %union RHS, use `braceless' instead of
7583 "{...}" so that braces are already stripped and code is escaped with
7584 digraphs.
7585 * src/reader.c (prologue_augment): Remove.
7586 (reader): Remove initialization of pre_prologue_obstack and
7587 post_prologue_obstack.
7588 * src/reader.h (prologue_augment): Remove.
7589
7590 * data/c.m4: Remove stray parenthesis.
7591
75922007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
7593
7594 Remove quotes from variables names in %define directives and from
7595 qualifiers in %code directives, and restrict the characters that are
7596 allowed in them to M4-friendly ones. For %define, continue to support
7597 the quoted form as a deprecated feature. Discussed starting at
7598 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
7599 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
7600 %code.
7601 * doc/bison.texinfo (Prologue Alternatives): Update.
7602 (Decl Summary): In %defines entry, update mention of `%code requires'
7603 and `%code provides'.
7604 (C++ Location Values): Update %define uses.
7605 (Calc++ Parser Interface): Likewise.
7606 (Calc++ Parser): Likewise, and update `%code requires' uses.
7607 (Table of Symbols): Update %code documentation.
7608 * src/parse-gram.y (prologue_declaration): For %define variables, use
7609 `variable' instead of `STRING'.
7610 (grammar_declaration): For %code qualifiers, use `ID' instead of
7611 `STRING'.
7612 (variable): New nonterminal that takes an `ID' or a `STRING'.
7613 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
7614 and %define uses.
7615 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
7616 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
7617 (%define errors): Update %define uses.
7618
76192007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
7620
7621 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
7622 instead of muscle_insert for %define values so that M4-special
7623 characters are replaced with digraphs.
7624 * tests/input.at (%define errors): Extend to check weird values.
7625
76262007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
7627
7628 Instead of having skeletons declare all valid %define variables and
7629 %code qualifiers, provide macros that retrieve the associated values
7630 and build these lists automatically. Thus Bison will now warn when a
7631 variable or qualifier is not used by the skeleton in the current
7632 invocation regardless of whether it might sometimes be used by that
7633 skeleton in other invocations. Also, move all %define value macros to
7634 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
7635 form, which is replaced by %code.
7636 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
7637 (b4_check_user_names): ... this, and change the series of valid name
7638 arguments to a single list argument for names used in the skeleton
7639 similar to the existing list argument for names used in the grammar.
7640 Warn instead of complaining.
7641 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
7642 values and %code code, to format %code code properly, and to build
7643 lists of all %define variables and %code qualifiers used in the
7644 skeleton: b4_skeleton_percent_define_variables and
7645 b4_skeleton_percent_code_qualifiers.
7646 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
7647 Remove, and...
7648 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
7649 the skeleton names lists can finish building first. In place of
7650 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
7651 expect the lists b4_user_percent_define_variables and
7652 b4_user_percent_code_qualifiers.
7653 * data/c++.m4: Where setting default values for b4_parser_class_name,
7654 b4_location_type, b4_filename_type, b4_namespace, and
7655 b4_define_location_comparison, update their names to the
7656 b4_percent_define_ namespace.
7657 * data/glr.c: Don't use b4_check_percent_define_variables and
7658 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
7659 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
7660 (b4_parser_class_name, b4_namespace): Define these using
7661 b4_get_percent_define for parser_class_name and namespace.
7662 * data/location.cc: Use b4_get_percent_define.
7663 * data/push.c: Don't use b4_check_percent_define_variables and
7664 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
7665 * data/yacc.c: Likewise, and don't call m4_exit in
7666 b4_use_push_for_pull_if or m4_wrap code will never execute.
7667 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
7668 Rename to...
7669 (muscle_grow_user_name_list): ... this for consistency with the
7670 terminology used in bison.m4.
7671 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
7672 %define variable names, and rename muscle used_percent_define_variables
7673 to user_percent_define_variables.
7674 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
7675 user_percent_code_qualifiers.
7676 (content): Remove.
7677 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
7678 {CODE} form is no longer accepted.
7679 * tests/input.at (Reject bad %code qualifiers): Rename to...
7680 (Reject unused %code qualifiers): ... this, and update test output.
7681 (%define error): Update test output.
7682
76832007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
7684
7685 Check for unrecognized %define variables similar to checking for
7686 unrecognized %code qualifiers. Check for redefined %define variables.
7687 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
7688 generalizes...
7689 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
7690 (b4_check_percent_define_variables): New, also wraps it.
7691 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
7692 variables using b4_check_percent_define_variables.
7693 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
7694 all those exercised in the test suite and all those listed in the
7695 `Default values' section of c++.m4. Are there others?
7696 * data/push.c, data/yacc.c: Declare no valid %define variables.
7697 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
7698 similar to muscle_find, but it works even when the muscle stores a
7699 const value.
7700 (muscle_grow_used_name_list): New function for constructing the used
7701 name list muscles that b4_check_for_unrecognized_names requires.
7702 * src/parse-gram.y (prologue_declaration): Warn if a variable is
7703 %define'd more than once. Define the b4_used_percent_define_variables
7704 muscle with muscle_grow_used_name_list.
7705 (grammar_declaration): Abbreviate %code code with
7706 muscle_grow_used_name_list.
7707 * tests/input.at (%define errors): New.
7708
77092007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7710
7711 Provide warn_at, complain_at, and fatal_at function callbacks to the
7712 skeletons, and use this for %code qualifier complaints.
7713 * data/bison.m4 (b4_error_at): New, invoked by...
7714 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
7715 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
7716 @fatal_at(...@) directives.
7717 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
7718 qualifiers in b4_used_percent_code_qualifiers and to use
7719 b4_complain_at.
7720 * src/location.c, src/location.h (boundary_set_from_string): New global
7721 function.
7722 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
7723 function.
7724 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
7725 to b4_used_percent_code_qualifiers.
7726 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
7727 function.
7728 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
7729 (lineno): Rename to...
7730 (out_lineno): ... this so I don't misunderstand it again.
7731 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
7732 here; these newlines are in the input but not the output file.
7733 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
7734 (at_directive_perform): ... this new static function, and add handling
7735 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
7736 directives.
7737 * tests/input.at (Reject bad %code qualifiers): Update test output with
7738 locations and extend.
7739
7740 * tests/output.at (Output file name: [, Output file name: ]): Remove
7741 bogus comment about these tests failing.
7742
77432007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7744
7745 Clean up b4_check_percent_code_qualifiers a little.
7746 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
7747 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
7748 documentation and add examples.
7749 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
7750 qualifiers here.
7751
77522007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
7753
7754 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
7755 unreliable -- especially when they're hidden inside another macro.
7756 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
7757 data/c.m4: Remove m4_divert(-1).
7758 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
7759 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
7760 m4_divert_push(0) and m4_divert_pop(0).
7761 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
7762 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
7763 pushed and popped by m4sugar, should be first on the stack.
7764
7765 Provide warn, complain, and fatal function callbacks to the skeletons.
7766 This provides more flexibility than m4_fatal, improves the error
7767 message format, and captures messages for translation. Discussed
7768 starting at
7769 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
7770 * data/bison.m4 (b4_error): New, invoked by...
7771 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
7772 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
7773 directives. Because these M4 macros might be called when the current
7774 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
7775 the previous removal of uses of m4_divert, which caused trouble.
7776 (b4_check_percent_code_qualifiers): Use b4_complain instead of
7777 m4_fatal to report unrecognized %code qualifiers.
7778 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
7779 push parser requests.
7780 * data/glr.c: Use b4_complain instead of m4_fatal to report
7781 non-deterministic push parser requests.
7782 Update @output usage to @output(...@) form.
7783 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
7784 report missing %defines. Update @output usage to @output(...@) form.
7785 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
7786 @output(...@) form.
7787 * src/main.c (main): Invoke skel_scanner_free.
7788 * src/scan-skel.h (skel_scanner_free): Prototype new function.
7789 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
7790 obstack_for_string from flex-scanner.h.
7791 (YY_DECL): Use to declare skel_lex static.
7792 (decode_at_digraphs): Remove; now handled in the new
7793 SC_AT_DIRECTIVE_ARG start condition.
7794 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
7795 functions.
7796 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
7797 at_directive_argv): New static globals.
7798 (INITIAL): Use fail_for_invalid_at.
7799 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
7800 recognize the start of a generalized `@directive(...@)' form and
7801 start...
7802 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
7803 directive args (using the new obstack_for_string), to decode the
7804 contained @ diagraphs, and to perform the directive. It recognizes
7805 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
7806 @output(...@).
7807 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
7808 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
7809 `@,'.
7810 (scan_skel): Initialize obstack_for_string on the first call.
7811 (skel_scanner_free): New function to free obstack_for_string.
7812 * tests/input.at (Reject bad %code qualifiers): Update test output.
7813
78142007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
7815
7816 Consolidate the 4 prologue alternative directives (%code, %requires,
7817 %provides, and %code-top) into a single %code directive with an
7818 optional qualifier field. Discussed at
7819 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
7820 * NEWS (2.3a+): Rewrite the existing entry for the prologue
7821 alternatives.
7822 * doc/bison.texinfo (Prologue Alternatives): Update.
7823 (Decl Summary): Update to %code "requires" and %code "provides".
7824 (Calc++ Parser): Update to %code "requires".
7825 (Table of Symbols): Remove entries for %requires, %provides, and
7826 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
7827 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
7828 are replaced by b4_percent_code_provides and b4_percent_code_requires,
7829 which are skeleton-specific.
7830 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
7831 declare what %code qualifiers it supports and to complain if any other
7832 qualifiers were used in the grammar.
7833 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
7834 and b4_user_code([b4_percent_code_provides]) in place of
7835 b4_user_requires and b4_user_provides.
7836 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
7837 Add b4_user_code([b4_percent_code_top]) and
7838 b4_user_code([b4_percent_code]).
7839 Invoke b4_check_percent_code_qualifiers.
7840 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
7841 PERCENT_REQUIRES): Remove.
7842 (grammar_declaration): Remove RHS's for %code-top, %provides, and
7843 %requires. Rewrite the %code RHS as the unqualified form defining the
7844 muscle b4_percent_code. Add another RHS for the qualified %code form,
7845 which defines muscles of the form b4_percent_code_QUALIFIER and the
7846 b4_used_percent_code_qualifiers muscle.
7847 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
7848 PERCENT_REQUIRES): Remove.
7849 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
7850 %code "requires" and %code "provides".
7851 * tests/input.at (Reject bad %code qualifiers): New.
7852
78532007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
7854
7855 Use the new code_props interface for destructors and printers.
7856 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
7857 printer_location members, and change the type of the destructor and
7858 printer members to code_props.
7859 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
7860 symbol_printer_get, semantic_type_destructor_set,
7861 semantic_type_printer_set, default_tagged_destructor_set,
7862 default_tagless_destructor_set, default_tagged_printer_set,
7863 default_tagless_printer_set): Use code_props in arguments and return
7864 types in place of char const * and location.
7865 (symbol_destructor_location_get, symbol_printer_location_get): Remove
7866 since the locations are now contained in the return of
7867 symbol_destructor_get and symbol_printer_get.
7868 * src/output.c (symbol_destructors_output, symbol_printers_output):
7869 Replace with...
7870 (symbol_code_props_output): ... this to eliminate duplicate code.
7871 (output_skeleton): Update to use symbol_code_props_output.
7872 * src/reader.c (symbol_should_be_used): Update use of
7873 symbol_destructor_get.
7874 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
7875 Update uses of the various _destructor_set and _printer_set functions.
7876 * src/symtab.c: (default_tagged_destructor_location,
7877 default_tagless_destructor_location, default_tagged_printer_location,
7878 default_tagless_printer_location): Remove since we...
7879 (default_tagged_destructor, default_tagless_destructor,
7880 default_tagged_printer, default_tagless_printer): ... change the type
7881 of these to code_props.
7882 (symbol_new, semantic_type_new, symbol_destructor_set,
7883 semantic_type_destructor_set, symbol_destructor_get,
7884 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
7885 symbol_check_alias_consistency, default_tagged_destructor_set,
7886 default_tagless_destructor_set, default_tagged_printer_set,
7887 default_tagless_printer_set): Update.
7888 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
7889 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
7890 code_props members.
7891 (symbol_print): Use SYMBOL_CODE_PRINT.
7892
78932007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
7894
7895 Use the new code_props interface for rule actions.
7896 * src/symlist.h (symbol_list): Replace action, action_location, and
7897 used members with a code_props action_props member.
7898 * src/reader.c (symbol_should_be_used, grammar_rule_check,
7899 grammar_midrule_action, grammar_current_rule_merge_set,
7900 grammar_current_rule_symbol_append, packgram): Update.
7901 * src/scan-code.h (translate_rule_action): Remove, no longer used.
7902 * src/scan-code.l (handle_action_dollar): Update.
7903 (translate_rule_action): Remove, no longer used.
7904 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
7905
79062007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7907
7908 Use the new code_props interface in parse-gram.y.
7909 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
7910 Update all uses of translate_* functions to use the new code_props
7911 interface and to use gram_scanner_last_string_free and
7912 code_scanner_last_string_free where possible.
7913 (grammar_declaration): symbol_list_destructor_set and
7914 symbol_list_printer_set now perform the translation, so don't do it
7915 here. Use gram_scanner_last_string_free where possible.
7916 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
7917 translate_code): Remove, no longer used.
7918 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
7919 symbol_list_printer_set): Perform code translation here rather than
7920 depending on the caller to do so.
7921
7922 * src/symlist.h (struct symbol_list): Correct some documentation typos.
7923 * src/scan-gram.h (gram_last_string): Remove declaration.
7924 * src/scan-gram.l (last_string): Declare it static.
7925
79262007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7927
7928 Encapsulate code properties and related functionality for the various
7929 destructors, printers, and actions into a code_props structure and
7930 interface. This patch merely implements code_props in scan-code.h and
7931 scan-code.l. Future patches will rewrite other modules to use it.
7932 Discussed starting at
7933 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
7934 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
7935 consistently initialize const structs that have an empty location
7936 field.
7937 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
7938 to ensure consistency.
7939 * src/scan-code.h (code_props): New structure.
7940 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
7941 function, macro, and const global variable for initializing a
7942 code_props with no code.
7943 (code_props_plain_init, code_props_symbol_action_init,
7944 code_props_rule_action_init, code_props_translate_code): The rest of
7945 the new code_props functional interface. Among other things, the init
7946 functions set the code_props kind field so that
7947 code_props_translate_code will know whether to behave like
7948 translate_symbol_action, translate_rule_action, or translate_code.
7949 These old translate functions must remain until all other modules are
7950 updated to use the new code_props interface.
7951 (code_scanner_last_string_free): New function similar to
7952 gram_scanner_last_string_free.
7953 (code_scanner_free): Add documentation.
7954 * src/scan-code.l: Implement the new interface.
7955 (code_lex): Make it static, add a code_props* argument, and remove the
7956 rule argument.
7957 (last_string): New static global similar to the one in scan-gram.l.
7958 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
7959 instead of rule.
7960 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
7961 code_props since Bison may one day use this information for destructors
7962 and printers.
7963 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
7964 (handle_action_dollar): Use symbol_list_n_get and set used flag
7965 directly since symbol_list_n_used_set is removed.
7966 (translate_action): Add a code_props* argument and remove the rule,
7967 action, and location arguments. Pass the code_props* on to code_lex.
7968 (translate_rule_action, translate_symbol_action, translate_code):
7969 Rewrite as wrappers around the new code_props interface.
7970 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
7971 it would eventually need to break the encapsulation of code_props.
7972
79732007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
7974
7975 * etc/.cvsignore: New.
7976
79772007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
7978
7979 Add maintainer-push-check to run maintainer-check using push parsing in
7980 place of pull parsing where available.
7981 * Makefile.am (maintainer-push-check): New.
7982 * data/bison.m4 (b4_use_push_for_pull_if): New.
7983 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
7984 appropriately based on their existing values.
7985 (yypush_parse): Don't print push-parser-specific diagnostics if push
7986 parsing is being used in place of pull parsing.
7987 * data/yacc.c: If push parsing should replace pull parsing, redirect to
7988 push.c.
7989 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
7990 variable, and insert b4_use_push_for_pull_flag into muscles.
7991 * tests/Makefile.am (maintainer-push-check): New.
7992
79932006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
7994
7995 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
7996 (whether successful or failed) so that yypush_parse can be invoked
7997 again to start a new parse using the same yypstate.
7998 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
7999 check multiple yypull_parse invocations on the same yypstate. For pull
8000 mode, extend to check multiple yyparse invocations.
8001 (Exploding the Stack Size with Alloca): Extend to try with
8002 %push-pull-parser.
8003 (Exploding the Stack Size with Malloc): Likewise.
8004
8005 * tests/calc.at (Simple LALR Calculator): Don't specify
8006 %skeleton "push.c" since %push-pull-parser implies that now.
8007 * tests/headers.at (export YYLTYPE): Don't check for the push
8008 declarations. Otherwise, this test case can't be used to see if push
8009 mode can truly emulate pull mode.
8010 * tests/input.at (Torturing the Scanner): Likewise.
8011 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
8012 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
8013 AT_YACC_IF, which now includes the case of push mode since %skeleton
8014 need not be used for push mode. This will be more intuitive once
8015 push.c is renamed to yacc.c.
8016
80172006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
8018
8019 For push mode, convert yyparse from a macro to a function, invoke yylex
8020 instead of passing a yylexp argument to yypull_parse, and don't
8021 generate yypull_parse or yyparse unless %push-pull-parser is declared.
8022 Discussed starting at
8023 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
8024 * data/bison.m4 (b4_pull_if): New.
8025 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
8026 * data/push.c: Improve M4 quoting a little.
8027 (b4_generate_macro_args, b4_parenthesize): Remove.
8028 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
8029 any time a pull parser is requested.
8030 Don't #define this as a wrapper around yypull_parse. Instead, when
8031 both push and pull are requested, make it a function that does that
8032 same thing.
8033 (yypull_parse): If there's a b4_prefix, #define this to
8034 b4_prefix[pull_parse] when both push and pull are requested.
8035 Don't define this as a function unless both push and pull are
8036 requested.
8037 Remove the yylexp argument and hard-code yylex invocation instead.
8038 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
8039 %push-parser.
8040 * src/getargs.c (pull_parser): New global initialized to true.
8041 * getargs.h (pull_parser): extern it.
8042 * src/output.c (prepare): Insert pull_flag muscle.
8043 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
8044 (prologue_declaration): Set both push_parser and pull_parser = true for
8045 %push-pull-parser. Set push_parser = true and pull_parser = false for
8046 %push-parser.
8047 * src/scan-gram.l: Don't accept %push_parser as an alternative to
8048 %push-parser since there's no backward-compatibility concern here.
8049 Scan %push-pull-parser.
8050 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
8051 instead of %push-parser.
8052 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
8053 prototype it in the module that calls yyparse.
8054 * tests/input.at (Torturing the Scanner): Likewise.
8055 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
8056
80572006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
8058
8059 Update etc/bench.pl. Optimize push mode a little (the yyn change
8060 deserves most of the credit).
8061 * Makefile.am (SUBDIRS): Add etc subdirectory.
8062 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
8063 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
8064 yytoken, yyval, and yyloc declarations to...
8065 (yyparse or yypush_parse): ... here to improve performance. For
8066 yypush_parse invocations after the first, be sure to assign yyn its old
8067 value again.
8068 (yypstate_new): Don't bother initializing the yyresult field since the
8069 initial value isn't used.
8070 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
8071 remove the #define that, in push mode, set it to yyps->NAME.
8072 * etc/Makefile.am: New.
8073 * etc/bench.pl: Remove and build it instead from...
8074 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
8075 "tests/bison" from the build directory by default rather than just
8076 invoking "bison" from $PATH.
8077 (calc_grammar): Update push parser code: don't declare yylval globally,
8078 don't define yyparse_wrapper, and don't #define yyparse.
8079 (bench_grammar): Update to check all working combinations of yacc.c,
8080 push.c, impure, pure, pull, and push.
8081
80822006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
8083
8084 For push mode, add pull wrappers around yypush_parse.
8085 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
8086 (yypull_parse): New function wrapping yypush_parse.
8087 (yyparse): New #define wrapping yypull_parse.
8088 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
8089 is declared.
8090 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
8091 prototype yylex in the module that calls yyparse, and don't prototype
8092 yyparse there. Otherwise, the yyparse expansion won't compile.
8093 * tests/input.at (Torturing the Scanner): Likewise.
8094
80952006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
8096
8097 Enable push parsers to operate in impure mode. Thus, %push-parser no
8098 longer implies %pure-parser. The point of this change is to move
8099 towards being able to test the push parser code by running the entire
8100 test suite as if %push-parser had been declared.
8101 * data/push.c (yypush_parse): For impure mode, remove the
8102 yypushed_char, yypushed_val, and yypushed_loc arguments.
8103 Instead, declare these as local variables initialized to the global
8104 yychar, yylval, and yylloc.
8105 For the first yypush_parse invocation only, restore the initial values
8106 of these global variables when it's time to read a token since they
8107 have been overwritten.
8108 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
8109 %push-parser.
8110 * tests/calc.at (Simple LALR(1) Calculator): Always declare
8111 %pure-parser along with %push-parser since this test case was designed
8112 for pure push parsers.
8113 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
8114 (AT_YACC_OR_PUSH_IF): New.
8115 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
8116 add a note that it's still wrong for some cases (as it has been for a
8117 while).
8118 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
8119 %push-parser no longer implies %pure-parser.
8120
81212006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
8122
8123 Remove some unnecessary differences between the pull parser code and
8124 the push parser code. This patch enables yynerrs in push mode.
8125 * data/push.c: Reformat M4 a little.
8126 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
8127 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
8128 because push mode is on. Instead, if pure mode is on, move yynerrs
8129 to...
8130 (b4_declare_parser_state_variables): ... here.
8131 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
8132 to yyps->NAME so it can be used in yypush_parse.
8133 (yypush_parse): Don't omit uses of yynerrs in push mode.
8134
81352006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
8136
8137 Fix bug such that the first pushed token's value and location are
8138 sometimes overwritten (sometimes by %initial-action) before being used.
8139 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
8140 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
8141 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
8142 more closely mimic the pull parser logic.
8143 Don't copy the pushed token to yychar, yylval, and yylloc until it's
8144 time to read a token, which is after any initialization of yylval and
8145 yylloc.
8146 (gottoken): Rename label to...
8147 (yyread_pushed_token): ... for clarity and to avoid infringing on the
8148 user namespace.
8149
81502006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
8151
8152 Rearrange initialization of the parser state variables so that the
8153 skeleton doesn't have to have a copy for pull mode and another for push
8154 mode. This patch also fixes at least a bug such that yylloc was not
8155 initialized (with b4_location_initial_line and
8156 b4_location_initial_column) upon calling yypush_parse. However, that
8157 initialization now overwrites the first token's location;
8158 %initial-action assigning @$ already did the same thing, and both bugs
8159 will be fixed in a later patch.
8160 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
8161 (b4_declare_parser_state_variables): Remove initialization of yytoken,
8162 yyss, yyvs, yyls, and yystacksize.
8163 (yypstate_new): Remove initialization of some yypstate fields: yystate,
8164 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
8165 yylsp.
8166 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
8167 yyps->NAME so it can be used in yypush_parse.
8168 (yyparse or yypush_parse): For yypush_parse, don't print the
8169 "Starting parse" diagnostic for invocations after the first.
8170 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
8171 yypush_parse, only do it for the first invocation.
8172 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
8173 initialization to occur in yypush_parse but only on the first
8174 invocation.
8175
81762006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
8177
8178 * data/push.c: Add CPP guards around push parser declarations in both
8179 the header and the code file.
8180 In the code file, move the push parser declarations to the same place
8181 they appear in the header file.
8182 Clean up the M4 some, especially the inconsistent underquoting in
8183 some b4_c_function_def and b4_c_function_decl uses.
8184
81852006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
8186
8187 Encapsulate the push parser state variables into an M4 macro so the
8188 push skeleton doesn't have to list them again for pull mode's yyparse.
8189 For push mode, remove yypush_parse's local equivalents of these
8190 variables to eliminate unnecessary copying between the two sets at
8191 run-time. This patch also fixes at least a bug related to multiple
8192 %initial-action invocations in push mode.
8193 * data/push.c (b4_declare_parser_variables): Rename to...
8194 (b4_declare_scanner_communication_variables): ... this for clarity and
8195 update both uses.
8196 (b4_declare_yyparse_variables): Remove and move its contents to the one
8197 spot where it was invoked.
8198 (b4_declare_parser_state_variables): New macro containing the parser
8199 state variables required by push mode.
8200 (struct yypstate): Replace all fields but yynew with
8201 b4_declare_parser_state_variables.
8202 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
8203 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
8204 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
8205 (yyparse or yypush_parse): For yyparse in pull mode, replace local
8206 parser state variable declarations with
8207 b4_declare_parser_state_variables.
8208 Don't initialize parser state variables when calling yypush_parse since
8209 yypstate_new already does that.
8210 Invoke the user's initial action only upon the first yypush_parse
8211 invocation.
8212 Remove all code that copies between the local parser state variables
8213 and the yypstate.
8214
82152006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
8216
8217 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
8218 prevent a name collision in a future patch where these names will
8219 sometimes be #define'd.
8220 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
8221 since it no longer has the same name as the existing argument.
8222 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
8223
82242006-12-19 Paolo Bonzini <bonzini@gnu.org>
8225 and Joel E. Denny <jdenny@ces.clemson.edu>
8226
8227 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
8228 that the argument is case-insensitive, and there's no `=' here.
8229 For the %skeleton entry, mention that %language is better.
8230 (Bison Options): Likewise for --language and --skeleton. Move the
8231 --skeleton entry so that the `Tuning the parser' section is sorted
8232 alphabetically on long options.
8233 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
8234 %language directive in detail here; cross-reference the %language
8235 documentation instead.
8236 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
8237 `%require "2.3b"' so that the example is always up-to-date.
8238 (Table of Symbols): Add entries for %language and %skeleton.
8239 * examples/extexi (normalize): Instead of replacing every %require
8240 argument with the current Bison version, just substitute for
8241 `@value{VERSION}'. This guarantees that we're testing what actually
8242 appears in the documentation.
8243 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
8244 rather than `@VERSION@'.
8245
82462006-12-18 Paul Eggert <eggert@cs.ucla.edu>
8247
8248 * NEWS: Reword the %language news a bit, and put it earlier.
8249
8250 * src/getargs.c (skeleton_arg): Last arg is now location const *.
8251 Rewrite to simplify the logic.
8252 (language_argmatch): Likewise.
8253 (program_name): We now own this var.
8254 * src/getargs.h (struct bison_language): Use char[] rather than
8255 const char *.
8256
8257 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
8258 Java is supported.
8259 * src/complain.c (program_name): Remove decl; no longer needed.
8260 * src/main.c (program_name): Remove; now belongs to getargs.
8261
82622006-12-18 Paolo Bonzini <bonzini@gnu.org>
8263
8264 * NEWS: Document %language.
8265
8266 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
8267
8268 * data/c-skel.m4, data/c++-skel.m4: New files.
8269 * data/glr.c: Complain on push parsers.
8270
8271 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
8272 over %skeleton.
8273 (Decl Summary): Document %language and %skeleton.
8274 (Command line): Document -L.
8275
8276 * examples/extexi: Rewrite %require directive.
8277 * examples/calc++/Makefile.am: Pass VERSION to extexi.
8278
8279 * src/files.c (compute_exts_from_gc): Look in language structure
8280 for .y extension.
8281 (compute_file_name_parts): Check whether .tab should be added.
8282 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
8283 (language, skeleton_arg, language_argmatch): New.
8284 (long_options): Add --language.
8285 (getargs): Use skeleton_arg, add -L/--language.
8286 * src/getargs.h: Include location.h.
8287 (struct bison_language, language, skeleton_arg, language_argmatch): New.
8288 * src/output.c (prepare): Pick default skeleton from struct language.
8289 Don't dispatch C skeletons here.
8290 * src/parse-gram.y (PERCENT_LANGUAGE): New.
8291 (prologue_declaration): Add "%language" rule, use skeleton_arg.
8292 * src/scan-gram.l ("%language"): New rule.
8293
8294 * tests/calc.at: Test %skeleton and %language.
8295 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
8296 (AT_GLR_IF): Look for %skeleton "glr.cc".
8297 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
8298 (AT_YACC_IF): Reject %language.
8299
83002006-12-18 Paul Eggert <eggert@cs.ucla.edu>
8301
8302 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
8303 since it wasn't used; only the typedef name 'semantic_type' is needed.
8304 Also, omit trailing white space.
8305
8306 * bootstrap: Sync from coreutils.
8307 (gnulib_extra_files): Add build-aux/announce.gen.
8308 (slurp): Adjust .gitignore files like .cvsignore files.
8309 * build-aux/announce-gen: Remove from CVS, since bootstrap
8310 now creates this.
8311
83122006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
8313
8314 Make %push-parser imply %pure-parser. This fixes several bugs; see
8315 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
8316 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
8317 pure_parser = true.
8318 * data/push.c: Don't bother testing b4_push_if when deciding whether
8319 to expand b4_declare_parser_variables globally.
8320 (yypush_parse): Likewise in here.
8321
8322 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
8323 (yy_reduce_print): Reformat M4 for readability.
8324
83252006-12-15 Bob Rossi <bob@brasko.net>
8326 and Joel Denny <jdenny@ces.clemson.edu>
8327
8328 * data/push.c (yypstate): Add typedef, and update all uses of
8329 struct yypstate to just yypstate.
8330 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
8331
83322006-12-14 Bob Rossi <bob@brasko.net>
8333
8334 * data/push.c (yypush_parse): Declare prototype regardless of
8335 %locations option.
8336
83372006-12-14 Bob Rossi <bob@brasko.net>
8338
8339 * data/push.c (yyparse): Remove the prototype and the #define when in
8340 push-parser mode.
8341
83422006-12-13 Bob Rossi <bob@brasko.net>
8343
8344 * data/push.c (yypstate_init): Rename to...
8345 (yypstate_new): ... this and use b4_c_function_def.
8346 (yypstate_delete): New.
8347 (yypush_parse): Change parameters yynval and yynlloc to be const.
8348 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
8349 yypstate_delete functions.
8350
83512006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
8352
8353 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
8354 strange test case titles. Reported by Bob Rossi.
8355
83562006-12-13 Paul Eggert <eggert@cs.ucla.edu>
8357
8358 * TODO: Add pointer to Sylvain Schmitz's work on static detection
8359 of potential ambiguities in GLR grammers.
8360
83612006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
8362
8363 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
8364 `bison ', use m4_index instead of m4_substr since chopping up a string
8365 containing M4-special characters causes problems here.
8366
8367 Fix a couple of bugs related to special characters in user-specified
8368 file names, and make it easier for skeletons to compute output file
8369 names with the same file name prefix as Bison-computed output file
8370 names.
8371 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
8372 b4_parser_file_name and b4_spec_defines_file instead of
8373 @output_parser_name@ and @output_header_name@, which are now redundant.
8374 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
8375 b4_parser_file_name, b4_spec_defines_file, and the new
8376 @basename(FILENAME@) instead of @output_parser_name@ and
8377 @output_header_name@, which inappropriately escaped the file names as
8378 C string literals.
8379 * src/files.c (all_but_ext): Remove static qualifier.
8380 (compute_output_file_names): Move `free (all_but_ext)' to...
8381 (output_file_names_free): ... here since all_but_ext is needed later.
8382 * src/files.h (all_but_ext): Extern.
8383 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
8384 exactly what MUSCLE_INSERT_STRING used to do.
8385 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
8386 characters are escaped properly.
8387 * src/output.c (prepare): Define muscle file_name_all_but_ext as
8388 all_but_ext.
8389 For pkgdatadir muscle, maintain previous functionality by using
8390 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
8391 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
8392 digraphs would never be expanded. Hopefully no one has M4-special
8393 characters in his Bison installation path.
8394 * src/scan-skel.l: Don't parse @output_header_name@ and
8395 @output_parser_name@ anymore since they're now redundant.
8396 In @output, use decode_at_digraphs.
8397 Parse a new @basename command that invokes last_component.
8398 (decode_at_digraphs): New.
8399 (BASE_QPUTS): Remove unused.
8400 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
8401 (Output file name): New tests.
8402
84032006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
8404
8405 Warn about output files that are generated by the skeletons and that
8406 conflict with other output files.
8407 * data/glr.c: Don't generate the header file here when glr.cc does.
8408 * src/files.c (file_names, file_names_count): New static globals.
8409 (compute_output_file_names): Invoke output_file_name_check for files
8410 not generated by the skeletons and remove existing checks.
8411 (output_file_name_check): New function that warns about conflicting
8412 output file names.
8413 (output_file_names_free): Free file_names.
8414 * src/files.h (output_file_name_check): Declare.
8415 * src/scan-skel.l: Invoke output_file_name_check for files generated by
8416 the skeletons.
8417 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
8418 (Conflicting output files): New tests.
8419
84202006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8421
8422 * doc/bison.texinfo: Fix a couple of typos.
8423
84242006-12-08 Bob Rossi <bob@brasko.net>
8425
8426 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
8427 Rename to...
8428 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
8429 update all uses.
8430 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
8431 (yypush_parse): Rename yypvars argument to yyps and remove redundant
8432 local pv.
8433 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
8434 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
8435
84362006-12-07 Bob Rossi <bob@brasko.net>
8437 and Joel Denny <jdenny@ces.clemson.edu>
8438
8439 * data/push.c (yypvarsinit): Change return type from void* to struct
8440 yypvars*. No longer cast to void* on return.
8441 (struct yypvars): Remove yylen since it need not be remembered between
8442 yypushparse invocations.
8443 (yypushparse): Don't copy between yylen and pv->yylen.
8444
84452006-12-05 Bob Rossi <bob@brasko.net>
8446
8447 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
8448 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
8449 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
8450 (struct yypvars): Remove b4_declare_parser_variables.
8451 (yypvarsinit): Remove init code for removed variables.
8452 (global scope): Do not declare b4_declare_parser_variables if
8453 push or pure mode.
8454 (yypushparse): Add b4_declare_parser_variables.
8455 Init new local variables, and remove init code for removed
8456 yypvars variables.
8457 (yyparse): Delete.
8458 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
8459 and yyparse for other modes.
8460 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
8461 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
8462 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
8463 (AT_PURE_LEX_IF): True if pure or push parser.
8464
84652006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
8466
8467 Document Yacc prologue alternatives and default %destructor's and
8468 %printer's as experimental. Don't mention Java yet. Discussed at
8469 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
8470 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
8471 (2.3a): Annotate this entry to say the old forms of these features were
8472 also experimental.
8473 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
8474 Table of Symbols): Say they're experimental. Comment out any mention
8475 of Java (we'll want this back eventually).
8476
84772006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
8478
8479 Support a file name argument to %defines. Deprecate `=' in
8480 %file-prefix, %name-prefix, and %output. Discussed at
8481 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
8482 * NEWS (2.3a+): Mention.
8483 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
8484 form of %defines, and remove `=' from entries for %file-prefix,
8485 %name-prefix, and %output.
8486 * src/parse-gram.y (prologue_declaration): Implement.
8487 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
8488 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
8489 all but one occurrence of %name-prefix.
8490 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
8491 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
8492 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
8493 occurrence of each of %file-prefix and %output. Add check for %defines
8494 with argument.
8495 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
8496 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
8497 Remove the `=' from %output.
8498
84992006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
8500
8501 Don't escape $ in test case titles since Autoconf 2.61 now does that
8502 correctly.
8503 * tests/actions.at (Default %printer and %destructor are not for error
8504 or $undefined): Here.
8505 (Default %printer and %destructor are not for $accept): Here.
8506 * tests/input.at (Invalid $n and @n): Here.
8507
85082006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
8509
8510 Rename <!> to <>. Discussed starting at
8511 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
8512 * NEWS (2.3a+): Update.
8513 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
8514 Update.
8515 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
8516 * src/scan-gram.l (INITIAL): Implement.
8517 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
8518 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
8519 comment.
8520 * tests/actions.at (Default tagless %printer and %destructor,
8521 Default tagged and per-type %printer and %destructor,
8522 Default %printer and %destructor are not for error or $undefined,
8523 Default %printer and %destructor are not for $accept,
8524 Default %printer and %destructor for mid-rule values): Update.
8525 * tests/input.at (Default %printer and %destructor redeclared,
8526 Unused values with default %destructor): Update.
8527
85282006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
8529
8530 Don't let %prec take a nonterminal.
8531 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
8532 token.
8533 * tests/input.at (%prec takes a token): New test checking that %prec
8534 won't take a nonterminal.
8535
85362006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
8537
8538 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
8539 it was double-quoted.
8540 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
8541 grammar is maintained with Bison's highest standards.
8542 * src/getargs.c: Fix some typos in Doxygen comments.
8543
85442006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
8545
8546 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
8547 later. Reported by Paul Eggert in
8548 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
8549 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
8550 * src/scan-code.l (translate_action): Don't bother invoking
8551 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
8552 (code_scanner_free): Instead of invoking
8553 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
8554 which frees more.
8555 * src/scan-gram.l (gram_scanner_free): Likewise.
8556 * src/scan-skel.l (scan_skel): Likewise.
8557
85582006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
8559
8560 * src/files.c (tr): Change return type to void.
8561 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
8562 has been called previously for the same key.
8563 (muscle_find): Return storage instead of value so that
8564 --enable-gcc-warnings doesn't produce warnings that the return discards
8565 const. aver that the value and storage are the same since storage
8566 could potentially be NULL when value is not.
8567 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
8568 same as 0.
8569
85702006-11-08 Paul Eggert <eggert@cs.ucla.edu>
8571
8572 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
8573 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
8574 us a slightly cleaner distribution, and also works.
8575 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
8576 gnulib changes.
8577
85782006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
8579 and Paul Eggert <eggert@cs.ucla.edu>
8580
8581 Don't let Bison leak memory except when it complains.
8582 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
8583 (spec_defines_file, dir_prefix): Now char *, not const char *,
8584 since they are freed.
8585 * src/files.c: Likewise.
8586 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
8587 Likewise.
8588 (tr): Now operates in-place. All uses changed.
8589 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
8590 values.
8591 (compute_file_name_parts, compute_output_file_names): Don't store
8592 read-only data in variables that will be freed.
8593 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
8594 src_extension, and header_extension.
8595 (output_file_names_free): New public function to free
8596 spec_verbose_file, spec_graph_file, spec_defines_file,
8597 parser_file_name, and dir_prefix.
8598 * src/getargs.c (getargs): Don't store read-only data in variables that
8599 will be freed.
8600 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
8601 (which previously existed but was unused), and quotearg_free.
8602 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
8603 * src/muscle_tab.c: Likewise.
8604 (muscle_entry): Make the value char const *,
8605 and add a new storage member that is char * and can be freed.
8606 (muscle_entry_free): New private function.
8607 (muscle_init): Use it instead of free.
8608 (muscle_insert, muscle_grow): Update and use new storage member.
8609 (muscle_code_grow): Free the string passed to muscle_grow
8610 since it's not needed anymore.
8611 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
8612 add a new `char *code' member.
8613 ("{...}"): Declare semantic type as code.
8614 * src/scan-code.h (translate_rule_action):
8615 (translate_symbol_action, translate_code, translate_action): Return
8616 `char const *' rather than `char *' since external code should not free
8617 these strings.
8618 * src/scan-code.l: Likewise.
8619 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
8620 which is "{...}" in the parser.
8621 * tests/Makefile.am (maintainer-check-valgrind): Set
8622 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
8623 Valgrind.
8624 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
8625 complain.
8626 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
8627 expecting a non-zero exit status sets --leak-check=summary and
8628 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
8629 this case, and we don't want to hear about it.
8630
86312006-11-08 Paul Eggert <eggert@cs.ucla.edu>
8632
8633 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
8634 instead of from the template, to simplify configuration a bit.
8635 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
8636 and m4/wint_t.m4, as they are needed with the latest gnulib.
8637
86382006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
8639
8640 Disable unset/unused mid-rule value warnings by default, and recognize
8641 --warnings=midrule-values to enable them. Discussed starting at
8642 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
8643 * NEWS (2.3a+): Mention.
8644 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
8645 warnings): Add entry for midrule-values subargument.
8646 * src/reader.c (symbol_should_be_used): Don't return true just because
8647 the value is a set/used mid-rule value unless
8648 --warnings=midrule-values was specified.
8649 * tests/input.at (Unused values, Unused values before symbol
8650 declarations): Run tests with and without --warnings=midrule-values.
8651
8652 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
8653 than LIST_FREE directly.
8654
86552006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
8656
8657 Finish implementing --warnings=error, which should not be implied by
8658 --warnings=all (or by its synonyms -W and --warnings without
8659 subarguments).
8660 * src/complain.c (set_warning_issued): New function to report that
8661 warnings are being treated as errors and to record an error if so.
8662 Invoke...
8663 (warn_at, warn): ... here.
8664 * src/getargs.c (warnings_args, warnings_types): Reorder so that
8665 "error - warnings are errors" does not appear above "all - all of the
8666 above".
8667 (getargs): For -W and --warnings without subarguments, don't let
8668 FLAGS_ARGMATCH set warnings_error in warnings_flag.
8669 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
8670
86712006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
8672
8673 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
8674 empty subargument list. For example: `bison --warnings= parser.y'.
8675
86762006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
8677
8678 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
8679 the parser header file so that gcc doesn't warn.
8680
86812006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
8682
8683 Split the default %destructor/%printer into two kinds: <*> and <!>.
8684 Discussed starting at
8685 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
8686 * NEWS (2.3a+): Mention.
8687 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
8688 previous change today related to mid-rules.
8689 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
8690 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
8691 (TYPE_TAG_ANY): Add as <*>.
8692 (TYPE_TAG_NONE): Add as <!>.
8693 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
8694 for <*> and <!>.
8695 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
8696 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
8697 * src/symlist.c (symbol_list_default_new): Split into tagged and
8698 tagless versions.
8699 (symbol_list_destructor_set, symbol_list_printer_set): Split
8700 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
8701 SYMLIST_DEFAULT_TAGLESS.
8702 * src/symlist.h: Update symbol_list_default*_new prototypes.
8703 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
8704 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
8705 * src/symtab.c (default_destructor, default_destructor_location,
8706 default_printer, default_printer_location): Split each into tagged and
8707 tagless versions.
8708 (symbol_destructor_get, symbol_destructor_location_get,
8709 symbol_printer_get, symbol_printer_location_get): Implement tagged
8710 default and tagless default cases.
8711 (default_destructor_set, default_printer_set): Split each into tagged
8712 and tagless versions.
8713 * src/symtab.h: Update prototypes.
8714 * tests/actions.at (Default %printer and %destructor): Rename to...
8715 (Default tagless %printer and %destructor): ... this, and extend.
8716 (Per-type %printer and %destructor): Rename to...
8717 (Default tagged and per-type %printer and %destructor): ... this, and
8718 extend.
8719 (Default %printer and %destructor for user-defined end token): Extend.
8720 (Default %printer and %destructor are not for error or $undefined):
8721 Update.
8722 (Default %printer and %destructor are not for $accept): Update.
8723 (Default %printer and %destructor for mid-rule values): Extend.
8724 * tests/input.at (Default %printer and %destructor redeclared): Extend.
8725 (Unused values with default %destructor): Extend.
8726
87272006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
8728
8729 Don't apply the default %destructor/%printer to an unreferenced midrule
8730 value. Mentioned at
8731 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
8732 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
8733 like $@n instead of just @n so that the default %destructor/%printer
8734 logic doesn't see them as user-defined symbols.
8735 (symbol_is_dummy): Check for both forms of the name.
8736 * src/reader.c (packgram): Remove the `$' from each midrule symbol
8737 name for which the midrule value is referenced in any action.
8738 * tests/actions.at (Default %printer and %destructor for mid-rule
8739 values): New test.
8740 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
8741 for change to dummy symbol names.
8742
87432006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
8744
8745 Warn about unset midrule $$ if the corresponding $n is used.
8746 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
8747 $n usage.
8748 (packgram): Before invoking grammar_rule_check on any rule, make sure
8749 all actions have already been scanned in order to set `used' flags.
8750 Otherwise, checking that a midrule's $$ is set will not always work
8751 properly because the midrule check must forward-reference the midrule's
8752 parent rule.
8753 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
8754 warning.
8755
87562006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
8757
8758 More improvements to the documentation of the prologue alternatives:
8759 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
8760 Bison manual.
8761 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
8762 some text to clarify the relative importance of the new directives and
8763 to show how these directives may be viewed as code labels.
8764
87652006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
8766
8767 Similar to the recently removed %before-header, add %code-top as the
8768 alternative to the pre-prologue. Mentioned at
8769 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
8770 Also, let the prologue alternatives appear in the grammar section.
8771 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
8772 (prologue_declaration): Move the existing prologue alternatives to...
8773 (grammar_declaration): ... here and add %code-top.
8774 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
8775
8776 Clean up and extend documentation for the prologue alternatives.
8777 * NEWS (2.3a+): Describe prologue alternatives.
8778 * doc/bison.texinfo (Prologue): Move discussion of prologue
8779 alternatives to...
8780 (Prologue Alternatives): ... this new section, and extend it to discuss
8781 all 4 directives in detail.
8782 (Table of Symbols): Clean up discussion of prologue alternatives and
8783 add %code-top.
8784
87852006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8786
8787 DJGPP specific issues.
8788
8789 * djgpp/config.bat: config.hin has been moved to lib. Adjust
8790 config.bat accordingly.
8791 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
8792 * djgpp/config.site: Likewise.
8793
87942006-10-16 Paolo Bonzini <bonzini@gnu.org>
8795
8796 Replace %*-header with %provides, %requires, %code. See discussion at
8797 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
8798
8799 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
8800 (b4_user_start_header): Remove.
8801 * data/glr.c: Use new macros instead of b4_*start_header
8802 and b4_*end_header.
8803 * data/glr.cc: Likewise.
8804 * data/lalr1.cc: Likewise.
8805 * data/push.c: Likewise.
8806 * data/yacc.c: Likewise.
8807
8808 * doc/bison.texinfo: Remove %before-header, rename
8809 %{start,end,after}-header to %requires, %provides, %code.
8810
8811 * src/parse-gram.y: Likewise (also rename token names accordingly).
8812 * src/scan-gram.l: Likewise.
8813 * tests/actions.at: Likewise.
8814
88152006-10-14 Paul Eggert <eggert@cs.ucla.edu>
8816
8817 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
8818 Problem reported by Joel E. Denny.
8819
88202006-10-14 Jim Meyering <jim@meyering.net>
8821
8822 (Sync from coreutils.)
8823 Work also when the working directory (with e.g. coreutils sources)
8824 is version controlled with git, rather than CVS.
8825 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
8826 rather than CVS.
8827 In messages and comments, say e.g., "checked-out sources",
8828 rather than "CVS sources".
8829 (version_controlled_file): New function. Work for git as well as
8830 for CVS. Don't use grep's -q option.
8831 (slurp): Call it here, in place of CVS-specific code.
8832
88332006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
8834
8835 Fix testsuite for ./configure --enable-gcc-warnings:
8836 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
8837 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
8838 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
8839 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
8840 * test/regression.at (Diagnostic that expects two alternatives):
8841 Likewise.
8842
88432006-10-12 Paul Eggert <eggert@cs.ucla.edu>
8844
8845 * bootstrap.conf (gnulib_modules): Add config-h.
8846 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
8847 worry about HAVE_CONFIG_H.
8848 * lib/abitset.c: Likewise.
8849 * lib/bitset.c: Likewise.
8850 * lib/bitset_stats.c: Likewise.
8851 * lib/bitsetv-print.c: Likewise.
8852 * lib/bitsetv.c: Likewise.
8853 * lib/ebitset.c: Likewise.
8854 * lib/get-errno.c: Likewise.
8855 * lib/lbitset.c: Likewise.
8856 * lib/subpipe.c: Likewise.
8857 * lib/timevar.c: Likewise.
8858 * lib/vbitset.c: Likewise.
8859 * lib/bitset.c: Include "bitset.h" first, to test interface.
8860 * lib/bitset_stats.c: Include "bitset_stats.h" first.
8861 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
8862 * lib/bitsetv.c: Include "bitsetv.h" first.
8863 * lib/get-errno.c: Include "get-errno.h" first.
8864 * m4/.cvsignore: Add config-h.m4.
8865 * tests/actions.at (Default %printer and %destructor for ...):
8866 Adjust expected line numbers in output to reflect removal of #if
8867 HAVE_CONFIG_H lines.
8868 * tests/glr-regression.at (Missed %merge type warnings when ...):
8869 Likewise.
8870 * tests/regression.at (Braced code in declaration in rules section):
8871 Likewise.
8872 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
8873 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
8874 Include <config.h> unconditionally.
8875
8876 * bootstrap: Sync from coreutils, as follows:
8877
8878 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
8879
8880 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
8881 variable was sometimes used without being initialized. This
8882 messed up the installation of the INSTALL file in some cases.
8883
8884 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
8885
8886 * bootstrap (usage, main program, symlink_to_gnulib): Add option
8887 --copy. Inspired by a suggestion from Bruno Haible.
8888
8889 2006-10-03 Jim Meyering <jim@meyering.net>
8890
8891 * bootstrap: Undo last change to this file, since now gnulib-tool
8892 sticks with the automake default in generating dependencies.
8893
88942006-10-12 Paul Eggert <eggert@cs.ucla.edu>
8895
8896 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
8897 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
8898
8899 * doc/bison.1: Add copyright notice.
8900
8901 * data/glr.c: Don't include <stdarg.h>; not used.
8902
8903 * NEWS: The -g and --graph options now output graphs in Graphviz
8904 DOT format, not VCG format.
8905 * doc/bison.1: Likewise.
8906 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
8907 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
8908 of this change in
8909 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
8910 * TODO: Remove Graphviz entry.
8911 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
8912 remove vcg.c, vcg.h, vcg_defaults.h.
8913 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
8914 * src/graphviz.c, src/graphviz.h: New files.
8915 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
8916 * src/files.h: Make comment more generic.
8917 * src/main.c (main): Likewise.
8918 * src/print_graph.h: Likewise.
8919 * src/getargs.c (usage): Make usage description more generic.
8920 * src/print_graph.c: Include graphviz.h rather than vcg.h.
8921 (static_graph, fgraph): Remove. All uses changed to pass
8922 arguments instead of sharing a static var.
8923 (print_core, print_actions, print_state, print_graph):
8924 Output graphviz format rather than VCG format.
8925 * tests/.cvsignore: Remove *.vcg; add *.dot.
8926 * tests/output.at: Expect *.dot files, not *.vcg files.
8927
8928 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
8929 accommodates the 2006-10-08 change.
8930
89312006-10-11 Bob Rossi <bob@brasko.net>
8932
8933 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
8934 (b4_yyssa, b4_yyerror_range): New macros.
8935 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
8936 (yypvarsinit): Remove init of removed fields.
8937 (yypushparse): Remove use of removed fields; use new macros instead.
8938
89392006-10-11 Paul Eggert <eggert@cs.ucla.edu>
8940
8941 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
8942 in a push parser. Reindent slightly to match yacc.c better.
8943
89442006-10-11 Bob Rossi <bob@brasko.net>
8945
8946 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
8947 yymsg_alloc fields.
8948 (yypvarsinit, yypushparse): Remove init of removed fields.
8949 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
8950
89512006-10-09 Paul Eggert <eggert@cs.ucla.edu>
8952
8953 * THANKS: Add Paolo Bonzini and Bob Rossi.
8954
89552006-10-08 Paolo Bonzini <bonzini@gnu.org>
8956
8957 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
8958 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
8959 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
8960 b4_define_user_cde and uses): Remove.
8961 (b4_comment, b4_prefix, b4_sync_start): New.
8962 * data/bison.m4: New file, with most of the content removed from c.m4.
8963 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
8964 * src/output.c (output_skeleton): Pass bison.m4.
8965 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
8966 only if specified.
8967
89682006-10-05 Paul Eggert <eggert@cs.ucla.edu>
8969
8970 Fix test failure reported by Tom Lane in
8971 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
8972 and try to make such failures easier to catch in the future.
8973 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
8974 that's now the caller's responsibility.
8975 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
8976 Set yychar = YYEOF if it's negative.
8977 * tests/actions.at (yylex): Abort if asked to read past EOF.
8978 * tests/conflicts.at (yylex): Likewise.
8979 * tests/cxx-type.at (yylex): Likewise.
8980 * tests/glr-regression.at (yylex): Likewise.
8981 * tests/input.at (yylex): Likewise.
8982 * tests/regression.at (yylex): Likewise.
8983 * tests/torture.at (yylex): Likewise.
8984
89852006-10-01 Paul Eggert <eggert@cs.ucla.edu>
8986
8987 Fix problems with translating English-language diagnostics.
8988 * bootstrap: Fix bug introduced in recent bootstrap changes, with
8989 respect to bison-runtime pot generation. The YY_ stuff
8990 wasn't being captured.
8991 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
8992 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
8993 * runtime-po/POTFILES.in: Add data/push.c.
8994
89952006-09-29 Paul Eggert <eggert@cs.ucla.edu>
8996
8997 Merge bootstrap changes from coreutils.
8998
8999 2006-09-28 Jim Meyering <jim@meyering.net>
9000
9001 Automatically generated dependencies are important even
9002 when all of the sources in a directory come from gnulib.
9003 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
9004 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
9005
9006 2006-09-23 Jim Meyering <jim@meyering.net>
9007
9008 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
9009
9010 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
9011
9012 * bootstrap: Add support for --force.
9013 (usage): New function. Describe usage less tersely.
9014 (CVS_only_file): New var.
9015
90162006-09-21 Paul Eggert <eggert@cs.ucla.edu>
9017
9018 * data/push.c (YYPUSH_MORE): Make it an enum instead.
9019 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
9020 Adjust white space and comments to match GNU style better.
9021
90222006-09-20 Bob Rossi <bob@brasko.net>
9023
9024 * data/push.c (yyresult_get): Remove function.
9025 (YYPUSH_MORE): Add #define.
9026 (yypushparse): Modify return value.
9027
90282006-09-20 Paul Eggert <eggert@cs.ucla.edu>
9029
9030 * stamp-h.in: Remove; no longer needed.
9031 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
9032 Remove config.h, config.hin, intl (no longer created).
9033 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
9034 stamp-h1.
9035
9036 Sync bootstrap from coreutils, as follows:
9037
9038 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
9039
9040 * bootstrap (symlink_to_gnulib): New function.
9041 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
9042 to copies-of-gnulib.
9043 (cp_mark_as_generated, slurp, gnulib_files):
9044 Avoid making a copy if it's the same as the old version.
9045 (gnulib_files): Add support for this variable (used by Bison).
9046
90472006-09-20 Paul Eggert <eggert@cs.ucla.edu>
9048
9049 * src/getargs.c (usage): Rework to use conventions similar to
9050 coreutils, to make translation a bit easier and the code a bit
9051 smaller. Problem reported by Tim Van Holder.
9052
90532006-09-15 Paul Eggert <eggert@cs.ucla.edu>
9054
9055 Use some of gnulib's new modules, taken from coreutils.
9056
9057 * bootstrap: Sync from coreutils, except add support for gnulib_files.
9058 * bootstrap.conf: New file.
9059 (gnulib_modules): Add configmake, inttypes, unistd.
9060 (XGETTEXT_OPTIONS): Add complain, complain_at,
9061 fatal, fatal_at, warn, warn_at, unexpected_end.
9062 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
9063 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
9064 (gl_EARLY): Add.
9065 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
9066 (gl_INIT): Add
9067 (GNULIB_AUTOCONF_SNIPPET): Remove.
9068 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
9069 the pickiest.
9070 * lib/.cvsignore: Add inttypes_.h.
9071 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
9072 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
9073 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
9074 no-longer-necessary initializations.
9075 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
9076 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
9077 use the unistd module.
9078 * src/system.h: Likewise.
9079 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
9080 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
9081 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
9082 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
9083 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
9084 * src/system.h: Include inttypes.h unconditionally, now that we
9085 use the inttypes module. Don't bother to include stdint.h, since
9086 inttypes.h now does that for us.
9087 (LOCALEDIR): Remove, now that we use the configmake module.
9088 * src/getargs.c: Include configmake.h.
9089 * src/main.c: Likewise.
9090 * src/output.c: Likewise.
9091 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
9092 not from $abs_top_builddir, since config.h moved.
9093
9094
9095 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
9096 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
9097
9098 * src/parse-gram.y (symbol_declaration): Don't put statements
9099 before declarations; it's not portable to C89.
9100 * src/scan-code.l (handle_action_at): Likewise.
9101
9102 * src/scan-code.l: Always initialize braces_level; the old code
9103 left it uninitialized and therefore had undefined behavior.
9104
9105 Don't attempt to redefine 'assert', since it runs afoul of
9106 systems where standard headers (mistakenly) include <assert.h>.
9107 Instead, define and use our own alternative, called 'aver'.
9108 * src/reader.c: Don't include assert.h, since we no longer
9109 use assert.
9110 * src/scan-code.l: Likewise.
9111 * src/system.h (assert): Remove, replacing with....
9112 (aver): New function, taking a bool arg. All uses changed.
9113 * src/tables.c (pack_vector): Ensure that aver arg is bool,
9114 not merely an integer.
9115
91162006-09-15 Bob Rossi <bob@brasko.net>
9117
9118 Add support for push parsing. Based on the original work of
9119 Odd Arild Olsen <oao@fibula.no>.
9120 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
9121 * data/c.m4 (YYPUSH): New.
9122 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
9123 * data/push.c: New file.
9124 * src/getargs.c (push_parser): New var.
9125 * src/getargs.h (push_parser): New declaration.
9126 * src/output.c (prepare): Add macro insertion of `push_flag'.
9127 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
9128 (prologue_declaration): Parse %push-parser.
9129 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
9130 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
9131 list of removed lines from the traces observed.
9132 (AT_CHECK_CALC_LALR): Added push parser tests.
9133
91342006-09-13 Paul Eggert <eggert@cs.ucla.edu>
9135
9136 * NEWS: Version 2.3a.
9137 * configure.ac (AC_INIT): Likewise.
9138
9139 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
9140 "#define YYSTYPE int" that caused "make maintainer-check" to fail
9141 due to header ordering dependencies. I don't know why the #define
9142 was there.
9143
9144 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
9145 runtime cost when YYDEBUG is not defined, and so that some tests
9146 that used to fail now work. Problem and initial suggestion by
9147 Paolo Bonzini.
9148 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
9149 * data/glr.cc (b4_parser_class_name):
9150 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
9151 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
9152 (yydebug_) [YYDEBUG]: New member.
9153 (yycdebug_): Now defined only if YYDEBUG.
9154 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
9155 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
9156 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
9157 if YYYDEBUG.
9158 (debug_stream, set_debug_stream, debug_level, set_debug_level):
9159 Define only if YYDEBUG.
9160 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
9161 set_debug_level.
9162 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
9163 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
9164 AT_CHECK_CALC_GLR_CC that are working now.
9165
91662006-09-12 Paul Eggert <eggert@cs.ucla.edu>
9167
9168 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
9169 We don't need them in glr.cc, and glr.c defines them.
9170 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
9171 assumes that defining it to anything is the same as defining
9172 it to 1. Problem reported by Paolo Bonzini.
9173
91742006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
9175
9176 * data/c.m4 (b4_null, b4_case): Define.
9177 * src/output.c (prepare_symbols): Use b4_null.
9178 (user_actions_output): Use b4_case.
9179
91802006-09-11 Paul Eggert <eggert@cs.ucla.edu>
9181
9182 * data/glr.c (b4_shared_declarations): Put start-header first,
9183 before any #includes that we generate, so that feature-test
9184 macros work. Problem reported by Michael Deutschmann in
9185 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
9186 * data/lalr1.cc: Likewise.
9187 * doc/bison.texinfo (Prologue): Document that feature-test macros
9188 should be defined before any Bison declarations.
9189 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
9190 that depend on location.hh after, not before, Bison decls, since
9191 we now include location.hh after the first user prologue.
9192
9193 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
9194 Sander Brandenburg in
9195 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
9196 Also, fix minor white space and comment issues.
9197 (Prologue): Mention that it's better to define feature-test macros
9198 before Bison declarations. Problem reported by Michael Deutschmann.
9199
9200 * README-cvs: Fix typo: "&" should be "&&". Problem reported
9201 by Jim Meyering.
9202 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
9203 This adjusts to recent gnulib changes.
9204
92052006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
9206
9207 Finish implementation of per-type %destructor/%printer. Discussed
9208 starting at
9209 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
9210 and
9211 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
9212 * NEWS (2.3+): Add a description of this feature to the default
9213 %destructor/%printer description.
9214 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
9215 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
9216 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
9217 list node contains a semantic type.
9218 * src/symtab.c, src/symtab.h: Extend with a table that associates
9219 semantic types with their %destructor's and %printer's.
9220 (semantic_type_from_uniqstr, semantic_type_get,
9221 semantic_type_destructor_set, semantic_type_printer_set): New functions
9222 composing the public interface of that table.
9223 (symbol_destructor_get, symbol_destructor_location_get,
9224 symbol_printer_get, symbol_printer_location_get): If there's no
9225 per-symbol %destructor/%printer, look up the per-type before trying
9226 the default.
9227 * tests/actions.at (Per-type %printer and %destructor): New test case.
9228 * tests/input.at (Default %printer and %destructor redeclared):
9229 Extend to check that multiple occurrences of %symbol-default in a
9230 single %destructor/%printer declaration is an error.
9231 (Per-type %printer and %destructor redeclared, Unused values with
9232 per-type %destructor): New test cases.
9233
92342006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
9235
9236 Require default %destructor/%printer to be declared using
9237 %symbol-default instead of an empty symbol list, and start working on
9238 new per-type %destructor/%printer. Discussed at
9239 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
9240 * NEWS (2.3+): Add %symbol-default to example.
9241 * bison.texinfo (Freeing Discarded Symbols): Likewise.
9242 (Table of Symbols): Add entry for %symbol-default.
9243 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
9244 (generic_symlist, generic_symlist_item): New nonterminals for creating
9245 a list in which each item is a symbol, semantic type, or
9246 %symbol-default.
9247 (grammar_declaration): Use generic_symlist in %destructor and %printer
9248 declarations instead of symbols.1 or an empty list.
9249 (symbol_declaration, precedence_declaration, symbols.1): Update actions
9250 for changes to symbol_list.
9251 * src/reader.c: Update for changes to symbol_list.
9252 * src/scan-code.l: Likewise.
9253 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
9254 * src/symlist.c, src/symlist.h: Extend such that a list node may
9255 represent a semantic type or a %symbol-default in addition to just an
9256 ordinary symbol. Add switched functions for setting %destructor's and
9257 %printer's.
9258 * tests/actions.at, tests/input.at: Add %symbol-default to all default
9259 %destructor/%printer declarations.
9260
92612006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
9262
9263 Whether the default %destructor/%printer applies to a particular symbol
9264 isn't a question of whether the user *declares* that symbol (in %token,
9265 for example). It's a question of whether the user by any means
9266 *defines* the symbol at all (by simply using a char token, for
9267 example). $end is defined by Bison whereas any other token with token
9268 number 0 is defined by the user. The error token is always defined by
9269 Bison regardless of whether the user declares it with %token, but we
9270 may one day let the user define error as a nonterminal instead.
9271 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
9272 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
9273 the meaning of "user-defined".
9274 * tests/actions.at (Default %printer and %destructor for user-declared
9275 end token): Rename to...
9276 (Default %printer and %destructor for user-defined end token): ...
9277 this.
9278
9279 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
9280 computation of whether to apply the default, don't maintain a list of
9281 every Bison-defined symbol. Instead, just check for a first character
9282 of '$', which a user symbol cannot have, and check for the error token.
9283
92842006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
9285
9286 Don't apply the default %destructor or %printer to the error token,
9287 $undefined, or $accept. This change fits the general rule that the
9288 default %destructor and %printer are only for user-declared symbols,
9289 and it solves several difficulties that are described in the new test
9290 cases listed below.
9291 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
9292 * tests/actions.at (Default %printer and %destructor are not for error
9293 or $undefined, Default %printer and %destructor are not for $accept):
9294 New test cases.
9295
92962006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
9297
9298 Allow %start after the first rule.
9299 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
9300 when parsing the first rule.
9301 (check_and_convert_grammar): Search for it here after all grammar
9302 declarations have been parsed. Skip midrules, which have dummy LHS
9303 nonterminals.
9304 * src/symtab.c (symbol_is_dummy): New function.
9305 * src/symtab.h (symbol_is_dummy): Declare it.
9306 * tests/input.at (%start after first rule): New test.
9307
93082006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
9309
9310 Redo some of the previous commit: add back the ability to use
9311 non-aliased/undeclared string literals since it might be useful to
9312 those declaring %token-table.
9313 * src/reader.c (check_and_convert_grammar): Undo changes in previous
9314 commit: don't worry about complaints from symbols_pack.
9315 * src/symtab.c (symbol_new, symbol_class_set,
9316 symbol_check_alias_consistency): Undo changes in previous commit: count
9317 each string literal as a new symbol and token, assign it a symbol
9318 number, and don't complain about non-aliased string literals.
9319 (symbols_pack): Since symbol_make_alias still does not decrement symbol
9320 and token counts but does still set aliased tokens to the same number,
9321 symbol_pack_processor now leaves empty slots in the symbols array.
9322 Remove those slots.
9323 * tests/regression.at (Undeclared string literal): Remove test case
9324 added in previous commit since non-aliased string literals are allowed
9325 again.
9326 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
9327 remove unnecessary string literal declarations.
9328 * tests/sets.at (Firsts): Likewise.
9329
93302006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
9331
9332 Don't allow an undeclared string literal, but allow a string literal to
9333 be used before its declaration.
9334 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
9335 symbols_pack complained.
9336 * src/symtab.c (symbol_new): Don't count a string literal as a new
9337 symbol.
9338 (symbol_class_set): Don't count a string literal as a new token, and
9339 don't assign it a symbol number since symbol_make_alias does that.
9340 (symbol_make_alias): It's not necessary to decrement the symbol and
9341 token counts anymore. Don't assume that an alias declaration occurs
9342 before any uses of the identifier or string, and thus don't assert that
9343 one of them has the highest symbol number so far.
9344 (symbol_check_alias_consistency): Complain if there's a string literal
9345 that wasn't declared as an alias.
9346 (symbols_pack): Bail if symbol_check_alias_consistency failed since
9347 symbol_pack asserts that every token has been assigned a symbol number
9348 although undeclared string literals have not.
9349 * tests/regression.at (String alias declared after use, Undeclared
9350 string literal): New test cases.
9351 (Characters Escapes, Web2c Actions): Declare string literals as
9352 aliases.
9353 * tests/sets.at (Firsts): Likewise.
9354
93552006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
9356
9357 In the grammar scanner, STRING_FINISH unclosed constructs and return
9358 them to the parser in order to improve error messages.
9359 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
9360 SC_BRACED_CODE, SC_PROLOGUE): Implement.
9361 * tests/input.at (Unclosed constructs): New test case.
9362 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
9363 seen.
9364
9365 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
9366 unused global.
9367
93682006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
9369
9370 Handle string aliases for character tokens correctly.
9371 * src/symtab.c (symbol_user_token_number_set): If the token has an
9372 alias, check and set its alias's user token number instead of its own,
9373 which is set to indicate the alias. Previously, every occurrence of
9374 the character token in the grammar overwrote that alias indicator with
9375 the character code.
9376 * tests/input.at (String aliases for character tokens): New test.
9377
93782006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
9379
9380 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
9381
93822006-08-11 Paul Eggert <eggert@cs.ucla.edu>
9383
9384 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
9385 to prevent failures when building on older platforms.
9386 Check for autopoint failure.
9387 Set XGETTEXT_OPTIONS to values that check for C format strings,
9388 so that translators are warned about them (this also helps
9389 prevent core dumps).
9390
9391 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
9392 function, since it simplifies our code a bit.
9393
9394 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
9395 rather than -W, so we don't get bogus warnings about sign comparisons.
9396 Add -Wpointer-arith, since that warning is useful (it reports code
9397 that does not conform to C89 and that some compilers reject).
9398 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
9399 since it's no longer needed.
9400
94012006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
9402
9403 Clean up scanners a bit.
9404 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
9405 definitions so gcc won't warn when obstack_for_string is unused.
9406 * src/scan-code.l: config.h and system.h are already #include'd by
9407 scan-code-c.c, so get rid of them here.
9408 * src/scan-gram.l: Likewise.
9409 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
9410 definitions rather than duplicating the rest of it.
9411 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
9412
94132006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
9414
9415 Suppress signed/unsigned comparison warnings for yycheck.
9416 * data/c.m4 (b4_safest_int_type): New macro.
9417 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
9418 a signed int type, cast it to b4_safest_int_type first.
9419 * data/yacc.c: Likewise.
9420 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
9421 also overwritten.
9422
94232006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
9424
9425 * doc/bison.texinfo: Fix some typos.
9426
94272006-08-02 Paul Eggert <eggert@cs.ucla.edu>
9428
9429 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
9430 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
9431
9432 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
9433 the latest gnulib does this a different way.
9434 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
9435 translation was patched, so stop omitting it.
9436
94372006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
9438
9439 Enable declaration of default %printer/%destructor. Make the parser
9440 use these for all user-declared grammar symbols for which the user does
9441 not declare a specific %printer/%destructor. Thus, the parser uses it
9442 for token 0 if the user declares it but not if Bison generates it as
9443 $end. Discussed starting at
9444 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
9445 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
9446 and
9447 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
9448 * NEWS (2.3+): Mention.
9449 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
9450 declare a %destructor for a mid-rule's semantic value. It's just
9451 impossible to declare one specific to it.
9452 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
9453 code. Describe default %destructor form.
9454 * src/parse-gram.y (grammar_declaration): Parse default
9455 %printer/%destructor declarations.
9456 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
9457 and symbol_destructor_location_get rather than accessing the destructor
9458 and destructor_location members of struct symbol.
9459 (symbol_printers_output): Likewise but for %printer's.
9460 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
9461 again.
9462 * src/symtab.c (default_destructor, default_destructor_location,
9463 default_printer, default_printer_location): New static global
9464 variables to record the default %destructor and %printer.
9465 (symbol_destructor_get, symbol_destructor_location_get,
9466 symbol_printer_get, symbol_printer_location_get): New functions to
9467 compute the appropriate %destructor and %printer for a symbol.
9468 (default_destructor_set, default_printer_set): New functions to set the
9469 default %destructor and %printer.
9470 * src/symtab.h: Prototype all those new functions.
9471 * tests/actions.at (Default %printer and %destructor): New test to
9472 check that the right %printer and %destructor are called, that they're
9473 not called for $end, and that $$ and @$ work correctly.
9474 (Default %printer and %destructor for user-declared end token): New
9475 test to check that the default %printer and %destructor are called for
9476 a user-declared end token.
9477 * tests/input.at (Default %printer and %destructor redeclared, Unused
9478 values with default %destructor): New tests to check related grammar
9479 warnings and errors.
9480
94812006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
9482
9483 Clean up handling of %destructor for the end token (token 0).
9484 Discussed starting at
9485 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
9486 and
9487 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
9488
9489 Make the skeletons consistent in how they pop the end token and invoke
9490 its %destructor.
9491 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
9492 state, which has token number 0, since this would invoke the
9493 %destructor for the end token.
9494 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
9495 until after shifting the end token, or else it won't be popped.
9496 * data/yacc.c (yyparse): Likewise.
9497
9498 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
9499 it's the end token. Upon termination, destroy an unshifted lookahead
9500 even when it's the end token.
9501 * data/lalr1.cc (yy::parser::parse): Likewise.
9502 * data/yacc.c (yyparse): Likewise.
9503
9504 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
9505 value warnings for the end token when the user gives the end token a
9506 %destructor.
9507
9508 * tests/actions.at (Printers and Destructors): Test all the above.
9509
95102006-07-24 Paul Eggert <eggert@cs.ucla.edu>
9511
9512 Update to latest gnulib and gettext versions.
9513 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
9514 Add fopen-safer.
9515 (gnulib_files): Add m4/warning.m4. Don't worry about files
9516 overwritten by autopoint.
9517 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
9518 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
9519 rejects them.
9520 Don't use autoreconf; instead, invoke autopoint etc. by hand,
9521 so that we can remove the intl files at a better time.
9522 (intl_files_to_remove): Remove aclocal.m4, since it gets
9523 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
9524 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
9525 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
9526 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
9527 Remove datarootdir hack; no longer needed.
9528 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
9529 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
9530 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
9531 strdup.h.
9532 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
9533 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
9534
95352006-07-20 Paul Eggert <eggert@cs.ucla.edu>
9536
9537 * bootstrap: Adjust to today's change to gnulib-tool by invoking
9538 it with --assume-autoconf='latest-stable'.
9539
95402006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
9541
9542 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
9543 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
9544 YYSTYPE' and `{'.
9545 * src/muscle_tab.h (muscle_grow): Replace the header comments with
9546 those from muscle_tab.c since the old ones are misleading.
9547
95482006-07-13 Akim Demaille <akim@epita.fr>
9549
9550 Support %define "KEY" {VALUE}.
9551 * src/scan-code.h, src/scan-code.l (translate_action)
9552 (translate_rule_action, translate_symbol_action, translate_code):
9553 Return char *, not const char *.
9554 * src/parse-gram.y (declaration): Rename as...
9555 (prologue_declaration): this.
9556 (string_content): Remove this nonterminal, use STRING.
9557 (braceless, content, content.opt): New nonterminal.
9558 Use them.
9559 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
9560 as value.
9561 * src/scan-gram.l (getargs.h): Don't include it.
9562
95632006-07-12 Paul Eggert <eggert@cs.ucla.edu>
9564
9565 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
9566 rather than a for-loop that declares a local bool variable. This
9567 should work around a compatibility problem with a Cray x1e C++
9568 compiler reported by Hung Nguyen in
9569 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
9570 The for-loop was introduced in the 2004-11-17 change but I don't
9571 know why it was needed.
9572
95732006-07-12 Akim Demaille <akim@epita.fr>
9574
9575 * data/c.m4: Comment changes.
9576
95772006-07-10 Akim Demaille <akim@lrde.epita.fr>
9578
9579 * src/complain.c (error_message, ERROR_MESSAGE): New.
9580 To factor...
9581 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
9582 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
9583
95842006-07-09 Paul Eggert <eggert@cs.ucla.edu>
9585
9586 * NEWS: Instead of %union, you can define and use your own union type
9587 YYSTYPE if your grammar contains at least one <type> tag.
9588 Your YYSTYPE need not be a macro; it can be a typedef.
9589 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
9590 (Union Decl, Decl Summary): Document this.
9591 * data/glr.c (YYSTYPE): Implement this.
9592 * data/glr.cc (YYSTYPE): Likewise.
9593 * data/lalr1.cc (YYSTYPE): Likewise.
9594 * data/yacc.c (YYSTYPE): Likewise.
9595 * src/output.c (prepare): Output tag_seen_flag.
9596 * src/parse-gram.y (declaration, grammar_declaration):
9597 Use 'union_seen' rather than 'typed' to determine whether
9598 %union has been seen, since grammars can now be typed without
9599 %union.
9600 (symbol_declaration, type.opt, symbol_def):
9601 Keep track of whether a tag has been seen.
9602 * src/reader.c (union_seen, tag_seen): New vars.
9603 (typed): remove.
9604 * src/reader.h (union_seen, tag_seen, typed): Likewise.
9605 * src/scan-code.l (untyped_var_seen): New variable.
9606 (handle_action_dollar): Adjust to above changes.
9607 (handle_action_dollar, handle_action_at):
9608 Improve overflow checking for outlandish numbers.
9609 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
9610 avoid new diagnostics generated by above changes.
9611 * tests/regression.at (YYSTYPE typedef): Add test to check
9612 for type tags without %union.
9613
9614 * src/symlist.c (symbol_list_length): Return int, not unsigned
9615 int, since callers expect int. This may need to get revisited
9616 once we have proper integer overflow checking.
9617
9618 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
9619 object is now static.
9620
9621 * src/getargs.c (flags_argmatch): Return void, not int,
9622 to pacify ./configure --enable-gcc-warnings.
9623
9624 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
9625 since last_string is already defined to FLEX_PREFIX (last_string).
9626
96272006-07-09 Akim Demaille <akim@lrde.epita.fr>
9628
9629 Implement --warnings/-W.
9630 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
9631 replaced by...
9632 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
9633 Adjust callers.
9634 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
9635 (warnings_args, warnings_types): New.
9636 (getargs, short_options, long_options): Accept -W/--warnings.
9637 Sort the options by alphabetical order, upper case letter right
9638 before its lower case.
9639
96402006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
9641
9642 Change %merge result type clash warnings to errors. Discussed at
9643 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
9644 * src/reader.c (record_merge_function_type): Use complain_at.
9645 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
9646 declared later): Update test case results.
9647
96482006-07-09 Akim Demaille <akim@lrde.epita.fr>
9649
9650 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
9651 to be in alphabetical order.
9652 (trace_args): Spelling fixes.
9653
96542006-07-09 Paul Eggert <eggert@cs.ucla.edu>
9655
9656 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
9657 so they don't collide with user-defined macros.
9658 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
9659 this was never guaranteed, and now that we're using gnulib stdint,
9660 which defines int_fast16_t to long int, the problem is exposed.
9661
96622006-07-08 Paul Eggert <eggert@cs.ucla.edu>
9663
9664 * data/c.m4 (b4_basename): Simplify a bit, since we don't
9665 need the full POSIX semantics (and weren't implementing them
9666 anyway).
9667
9668 Adjust to Autoconf 2.60 and today's gnulib.
9669 * bootstrap (gnulib_modules): Add stdint.
9670 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
9671 no longer copies it.
9672 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
9673 since stdint needs the former and wcwidth (which is now required
9674 by mbswidth) needs the latter.
9675 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
9676 work around a compatibility glitch between gettext 0.14.6 and
9677 Autoconf 2.60.
9678 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
9679 Do not check for uintptr_t, since new stdint module does the right
9680 thing.
9681 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
9682 Add stdint.h, stdint_.h, wcwidth.h.
9683 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
9684 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
9685 stdint.m4, wchar_t.m4, wcwidth.m4.
9686 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
9687 usual order for ../lib/*.h files.
9688 (file_name_split): Use last_component, not base_name, to adjust
9689 to gnulib changes.
9690 * src/parse-gram.h: Include <strverscmp.h> in the usual order
9691 for ../lib/*.h files.
9692 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
9693 Define unconditionally, since we now assume the stdint module.
9694 * src/scan-skel.l: Include <dirname.h>.
9695 (BASE_QPUTS): Use last_component, not base_name.
9696 * src/system.h: Include <unlocked-io.h> in the usual order
9697 for ../lib/*.h files. Include <stdint.h> unconditionally,
9698 since we now use the stdint module.
9699 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
9700 HAVE_UINTPTR_T, since we now use the stdint module.
9701 (base_name): Remove decl, since files now include <dirname.h>
9702 to get the decl.
9703
97042006-07-08 Akim Demaille <akim@lrde.epita.fr>
9705
9706 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
9707 New, default to 1.
9708 * data/yacc.c, data/glr.c, data/location.cc: Use them.
9709 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
9710 default.
9711 * tests/calc.at: Adjust.
9712
97132006-07-08 Akim Demaille <akim@lrde.epita.fr>
9714
9715 * data/c.m4 (b4_basename): New.
9716 (b4_syncline): Also output the location of its invocation (from
9717 the skeleton).
9718 (b4_user_action, b4_define_user_action, b4_user_actions)
9719 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
9720 (b4_user_stype): New.
9721 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
9722
97232006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
9724
9725 In the grammar file, the first column is 1 not 0 on the first line as
9726 on every other line.
9727 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
9728 * tests/input.at (Torturing the Scanner): Update output.
9729
9730 * src/scan-gram.l (scanner_cursor): Declare it static.
9731
97322006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
9733
9734 In warnings, say "previous declaration" rather than "first
9735 declaration".
9736 * src/symtab.c (redeclaration): Do that here.
9737 * src/reader.c (record_merge_function_type): In the case of a result
9738 type clash, report the previous declaration rather than the very first
9739 one in the grammar file.
9740 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
9741 declared later): Add a third declaration to check this behavior.
9742 * tests/input.at (Incompatible Aliases): Update output.
9743
97442006-06-27 Akim Demaille <akim@epita.fr>
9745
9746 * doc/Doxyfile.in: New.
9747 * doc/Makefile.am: Use it.
9748 * src/lalr.h, src/symtab.h: Initial doxygenation.
9749
97502006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
9751
9752 Don't miss %merge result type warnings just because the LHS types are
9753 declared after the %merge. This continues the effort of the previous
9754 patch.
9755 * src/reader.c (get_merge_function): Don't set the merger type yet.
9756 (record_merge_function_type): New function for setting the merger type
9757 and checking for clashes.
9758 (grammar_current_rule_merge_set): Set the location of the %merge for
9759 the current rule.
9760 (packgram): Invoke record_merge_function_type for each rule now that
9761 all symbol type declarations have been parsed.
9762 * src/reader.h (merger_list.type_declaration_location): New member
9763 storing the location of the first %merge from which the type for this
9764 merging function was derived.
9765 * src/symlist.h (symbol_list.merger_declaration_location): New member
9766 storing the location of a rule's %merge, if any.
9767 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
9768 declared later): New test to catch the error fixed by the above patch.
9769
97702006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
9771
9772 Get action warnings (grammar_rule_check) right even when symbol
9773 declarations appear after the rules. Discussed at
9774 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
9775 and
9776 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
9777 Don't mistake the type of $$ in a midrule to be that of its parent
9778 rule's $$.
9779 * src/reader.c (grammar_current_rule_end): Don't invoke
9780 grammar_rule_check yet since not all symbol declarations may have been
9781 parsed yet.
9782 (grammar_midrule_action): Likewise.
9783 Don't record whether the midrule's $$ has been used yet since actions
9784 haven't been translated yet.
9785 Record the midrule's parent rule and its RHS index within the parent
9786 rule.
9787 (grammar_current_rule_action_append): Don't translate the action yet
9788 since not all symbol declarations may have been parsed yet and, thus,
9789 warnings about types for $$, $n, @$, and @n can't be reported yet.
9790 (packgram): Translate the action and invoke grammar_rule_check now that
9791 all symbol declarations have been parsed.
9792 * src/scan-code.l (handle_action_dollar): Now that this is invoked
9793 after parsing the entire grammar file, the symbol list here in the case
9794 of a midrule is actually the midrule's empty RHS, so reference its
9795 parent rule's RHS where necessary.
9796 On the other hand, now that you can already know it's a midrule, you
9797 aren't forced to think $$ has the same type as its parent rule's $$.
9798 (handle_action_at): In the case of a midrule, reference the parent rule
9799 where necessary.
9800 * src/symlist.c (symbol_list_new): Initialize new midrule-related
9801 members.
9802 (symbol_list_length): Now that this is invoked after all rules have
9803 been parsed, a NULL symbol (rather than a NULL symbol list node)
9804 terminates a rule. symbol_list_print already does this correctly.
9805 * src/symlist.h (symbol_list.midrule_parent_rule,
9806 symbol_list.midrule_parent_rhs_index): New members so that midrules can
9807 remember their relationships with their parents.
9808 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
9809 fixed by the above patch.
9810 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
9811 implementing...
9812 (Unused values): ... this old test case and...
9813 (Unused values before symbol declarations): ... this new test case.
9814 This one is the same as `Unused values' except that all symbol
9815 declarations appear after the rules in order to catch the rest of the
9816 errors fixed by the above patch.
9817
98182006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
9819
9820 More cleanup.
9821 * src/reader.c (current_rule): Declare it static since it's no longer
9822 used outside this file.
9823 (grammar_current_rule_action_append): Remove redundant arguments from
9824 translate_rule_action invocation.
9825 * src/reader.h (current_rule): Remove this unused extern.
9826 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
9827 * src/scan-code.l (translate_rule_action): Likewise.
9828
98292006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
9830
9831 Clean up yesterday's patch.
9832 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
9833 to...
9834 * src/reader.c (grammar_current_rule_action_append): ... here for
9835 consistency with grammar_current_rule_symbol_append.
9836 * tests/regression.at (Braced code in declaration in rules section):
9837 Make yyerror and yylex static as usual.
9838
98392006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
9840
9841 Fix bug that mistakes braced code in a declaration in the rules section
9842 to be a rule action. Mentioned at
9843 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
9844 * src/scan-gram.l: Move midrule action detection from the start of the
9845 scanning of any braced code to...
9846 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
9847 action. For readability, use $2 and @2 rather than the equivalent
9848 global variables.
9849 * tests/regression.at (Braced code in declaration in rules section):
9850 New test to catch the error fixed by the above patch.
9851
9852 Work on code readability some.
9853 * src/scan-code.l (current_rule): Get rid of this misleading and
9854 redundant declaration: it's actually extern'ed in reader.h.
9855 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
9856 translate_action): Add a rule argument and use it instead of the global
9857 current_rule.
9858 (translate_rule_action): This already receives current_rule through an
9859 argument, so pass it on to translate_action instead of assigning
9860 current_rule to current_rule.
9861 (translate_symbol_action, translate_code): Pass rule = NULL to
9862 translate_action.
9863
98642006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
9865
9866 Rename %before-definitions to %start-header and %after-definitions to
9867 %end-header. Don't use these declarations to separate pre-prologue
9868 blocks from post-prologue blocks. Add new order-independent
9869 declarations %before-header and %after-header as alternatives to the
9870 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
9871 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
9872 * NEWS (2.3+): Update for these changes.
9873 * data/glr.c (b4_before_definitions): Update to...
9874 (b4_start_header): ... this.
9875 (b4_after_definitions): Update to...
9876 (b4_end_header): ... this.
9877 * data/glr.cc: Likewise.
9878 * data/lalr1.cc: Likewise.
9879 * data/yacc.c: Likewise.
9880 * doc/bison.texinfo (The prologue): Update names, and replace remaining
9881 prologue blocks with %*-header declarations.
9882 (Calc++ Parser): Likewise.
9883 (Decl Summary): Update names.
9884 (Table of Symbols): Update description.
9885 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
9886 (PERCENT_END_HEADER): ... this.
9887 (PERCENT_BEFORE_DEFINITIONS): Update to...
9888 (PERCENT_START_HEADER): ... this.
9889 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
9890 (declaration): Update token names and m4 macro names.
9891 When parsing %end-header and %start-header, invoke translate_code
9892 before muscle_code_grow, and no longer set global booleans to remember
9893 whether these declarations have been seen.
9894 Parse new %after-header and %before-header.
9895 * src/reader.c (before_definitions, after_definitions): Remove.
9896 (prologue_augment): Accept a new bool argument to specify whether to
9897 augment the pre-prologue or post-prologue.
9898 * src/reader.h (before_definitions, after_definitions): Remove these
9899 extern's.
9900 (prologue_augment): Add new bool argument.
9901 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
9902 (PERCENT_END_HEADER): ... this.
9903 (PERCENT_BEFORE_DEFINITIONS): Update to...
9904 (PERCENT_START_HEADER): ... this.
9905 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
9906 * tests/actions.at (Printers and Destructors): Update names.
9907
99082006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
9909
9910 Add comparison operators for C++ location classes. Discussed at
9911 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
9912 * data/c++.m4 (b4_define_location_comparison): New boolean %define
9913 declaration indicating whether filename_type has an operator==. If
9914 filename_type is `std::string', it defaults to `1', `0' otherwise.
9915 * data/location.cc: Iff b4_define_location_comparison is `1', add
9916 operator== and operator!= for class position and for class location.
9917
9918 Some minor fixes.
9919 * src/scan-action.l: Remove unused file.
9920 * src/symtab.c (symbol_printer_set): Use printer_location not
9921 destructor_location.
9922 * src/symtab.h (struct symbol): Replace incorrect source comment for
9923 printer members.
9924 * tests/input.at (Incompatible Aliases): Update output with correct
9925 printer location.
9926
99272006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
9928
9929 Don't put the pre-prologue in the header file. For the yacc.c code
9930 file and the glr.c header and code files, move the pre-prologue before
9931 the token definitions. Add new %before-definitions and
9932 %after-definitions to declare code that will go in both the header file
9933 and code file. Discussed at
9934 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
9935 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
9936 and
9937 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
9938 * NEWS (2.3+): Describe these changes.
9939 * data/glr.c (b4_pre_prologue): Move from within to before...
9940 (b4_shared_declarations): ... this.
9941 Add new b4_before_definitions before b4_token_enums.
9942 Add new b4_after_definitions at the end.
9943 * data/glr.cc (b4_pre_prologue): Replace with...
9944 (b4_before_definitions): ... this in the header file.
9945 (b4_after_definitions): New near the end of the header file.
9946 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
9947 code file right before including the header file.
9948 (b4_before_definitions): New in the previous position of
9949 b4_pre_prologue in the header file.
9950 (b4_after_definitions): New near the end of the header file.
9951 * data/yacc.c: Clean up some m4 quoting especially in the header file.
9952 (b4_token_enums_defines): In the code file, move to right before
9953 YYSTYPE for consistency with the header file.
9954 (b4_before_definitions): New right before b4_token_enums_defines in
9955 both the header and code file.
9956 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
9957 header and code file.
9958 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
9959 of prologues for %union dependencies.
9960 (Decl Summary): In %defines description, mention the effect of
9961 %before-definitions and %after-definitions on the header file.
9962 (Calc++ Parser): Forward declare driver in a %before-definitions rather
9963 than in the pre-prologue so that make check succeeds.
9964 (Table of Symbols): Add entries for %before-definitions and
9965 %after-definitions.
9966 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
9967 %before-definitions.
9968 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
9969 (declaration): Parse those declarations and append to
9970 b4_before_definitions and b4_after_definitions, respectively.
9971 * src/reader.c (before_definitions, after_definitions): New bools to
9972 track whether those declarations have been seen.
9973 (prologue_augment): Add to the post-prologue if %union,
9974 %before-definitions, or %after-definitions has been seen.
9975 * src/reader.h (before_definitions, after_definitions): New extern's.
9976 * src/scan-gram.l: Scan the new declarations.
9977 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
9978 prologue block in a %before-definitions or a %after-definitions based
9979 on whether the %union is declared.
9980 * tests/regression.at (Early token definitions with --yacc, Early token
9981 definitions without --yacc): Move tests for token definitions into the
9982 post-prologue since token names are no longer defined in the
9983 pre-prologue.
9984
99852006-06-20 Akim Demaille <akim@epita.fr>
9986
9987 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
9988 (symbol_get): Use it.
9989 * src/parse-gram.y: Use it.
9990
99912006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
9992
9993 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
9994 build succeeds when configured with --enable-gcc-warnings.
9995
99962006-06-19 Paul Eggert <eggert@cs.ucla.edu>
9997
9998 * src/parse-gram.y (char_name): New function.
9999 (CHAR, STRING, string_content): For %printer, properly escape.
10000 (ID): Prefer fputs to fprintf.
10001 (id): Reindent to be consistent with other rules.
10002 Properly quote char.
10003
10004 The Translation Project changed its way of publishing translations
10005 to maintainers. I haven't received any responses to my request
10006 for supporting the old way, or for documenting the new way. I
10007 have modified 'bootstrap' to use screen scraping
10008 (in this case, HTML scraping). This is unreliable and inelegant,
10009 but I don't see any better way. Yuck.
10010 * bootstrap (TP_URL, WGET_COMMAND): New vars.
10011 (get_translations): New function, which uses HTML scraping to
10012 deduce locations of latest translations.
10013 Use this function to grab both bison and bison-runtime .po files.
10014 Don't bother priming the pump for the runtime-po domain any more,
10015 as it's now translated better than bison is.
10016
100172006-06-19 Akim Demaille <akim@epita.fr>
10018
10019 * src/scan-gram.l: No longer "parse" things after `%union' until
10020 `{'. Rather, return a single "%union" token.
10021 No longer make symbols: return strings, and leave the conversion
10022 to symbols to the parser.
10023 (SC_PRE_CODE, token_type): Remove.
10024 * src/parse-gram.y (%union): New field `character'.
10025 Sort tokens.
10026 (CHAR): New token.
10027 (ID, ID_COLON): Now that the scanner no longer makes them
10028 identifiers, adjust all uses to invoke symbol_get.
10029 (id_colon): New, wraps the conversion from string to symbol.
10030 (%union): Accept a possible union_name.
10031 (symbol): Now can be a char.
10032 * data/c.m4 (b4_union_name): Leave a default value.
10033 * data/glr.c, data/yacc.c: Use it.
10034
100352006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
10036
10037 For associating token numbers with token names for "yacc.c", don't use
10038 #define statements unless `--yacc' is specified; always use enum
10039 yytokentype. Most important discussions start at:
10040 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
10041 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
10042 and
10043 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
10044 * NEWS (2.3+): Mention.
10045 * data/c.m4 (b4_yacc_if): New.
10046 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
10047 token #define's.
10048 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
10049 on token name definitions.
10050 * src/getargs.c (usage): Capitalize `Yacc' in English.
10051 * src/output.c (prepare): Define b4_yacc_flag.
10052 * tests/regression.at (Early token definitions): Test that tokens names
10053 are defined before the pre-prologue not just before the post-prologue.
10054 Remove this test case and copy to...
10055 (Early token definitions with --yacc): ... this to test #define's.
10056 (Early token definitions without --yacc): ... and this to test enums.
10057
100582006-06-11 Paul Eggert <eggert@cs.ucla.edu>
10059
10060 * NEWS: Reword the post-2.3 change to not be so optimistic about
10061 removing the old "look-ahead" spelling.
10062 Update previous look-ahead/lookahead change reports.
10063 * REFERENCES: look-ahead -> lookahead (since that's
10064 what he actually wrote).
10065 * doc/refcard.tex: look ahead -> lookahead,
10066 look-ahead -> lookahead
10067
100682006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
10069
10070 For consistency, use `lookahead' instead of `look-ahead' or
10071 `look_ahead'. Discussed starting at
10072 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
10073 and then at
10074 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
10075 * NEWS: For the next release, note the change to `--report'.
10076 * TODO, doc/bison.1: Update English.
10077 * doc/bison.texinfo: Update English.
10078 (Understanding Your Parser, Bison Options): Document as
10079 `--report=lookahead' rather than `--report=look-ahead'.
10080 * src/conflicts.c: Update English in comments.
10081 (lookahead_set): Rename from look_ahead_set.
10082 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
10083 (resolve_sr_conflict): Rename local look_ahead_tokens to
10084 lookahead_tokens, and update other uses.
10085 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
10086 count_rr_conflicts, conflicts_free): Update uses.
10087 * src/getargs.c (report_args): Move "lookahead" before alternate
10088 spellings.
10089 (report_types): Update uses.
10090 (usage): For `--report' usage description, state `lookahead' spelling
10091 rather than `look-ahead'.
10092 * src/getargs.h (report.report_lookahead_tokens): Rename from
10093 report_look_ahead_tokens.
10094 * src/lalr.c: Update English in comments.
10095 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
10096 (state_lookahead_tokens_count): Rename from
10097 state_look_ahead_tokens_count.
10098 Rename local n_look_ahead_tokens to n_lookahead_tokens.
10099 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
10100 Rename local n_look_ahead_tokens to n_lookahead_tokens.
10101 Update other uses.
10102 Update English in output.
10103 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
10104 * src/print.c: Update English in comments.
10105 (lookahead_set): Rename from look_ahead_set.
10106 (print_reduction): Rename argument lookahead_token from
10107 look_ahead_token.
10108 (print_core, state_default_rule, print_reductions, print_results):
10109 Update uses.
10110 * src/print_graph.c: Update English in comments.
10111 (print_core): Update uses.
10112 * src/state.c: Update English in comments.
10113 (reductions_new): Update uses.
10114 (state_rule_lookahead_tokens_print): Rename from
10115 state_rule_look_ahead_tokens_print, and update other uses.
10116 * src/state.h: Update English in comments.
10117 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
10118 (state_rule_lookahead_tokens_print): Rename from
10119 state_rule_look_ahead_tokens_print.
10120 * src/tables.c: Update English in comments.
10121 (conflict_row, action_row): Update uses.
10122 * tests/glr-regression.at
10123 (Incorrect lookahead during deterministic GLR,
10124 Incorrect lookahead during nondeterministic GLR): Rename
10125 print_look_ahead to print_lookahead.
10126 * tests/torture.at: Update English in comments.
10127 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
10128 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
10129 (Many lookahead tokens): Update uses.
10130 * data/glr.c: Update English in comments.
10131 * lalr1.cc: Likewise.
10132 * yacc.c: Likewise.
10133 * src/conflicts.h: Likewise.
10134 * src/lalr.h: Likewise.
10135 * src/main.c: Likewise.
10136 * src/output.c: Likewise.
10137 * src/parse-gram.c: Likewise.
10138 * src/tables.h: Likewise.
10139 * tests/calc.at: Likewise.
10140
101412006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
10142
10143 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
10144
101452006-06-07 Paul Eggert <eggert@cs.ucla.edu>
10146
10147 * TODO: Add request from Nelson H. F. Beebe to be able to install
10148 Bison without installing the yacc script.
10149
101502006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
10151
10152 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
10153 and yytext if they're already #define'd.
10154 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
10155 * src/scan-code-c.c: ... here.
10156 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
10157 <config.h>.
10158
101592006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
10160
10161 Get Bison to build again when configured with --enable-gcc-warnings.
10162 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
10163 missing #include's.
10164 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
10165 loc argument as it shadows a global.
10166 * src/scan-gram.l: Remove stray comma that prevents boundary_set
10167 invocation.
10168
10169 * src/.cvsignore: Add scan-code.c.
10170
101712006-06-07 Akim Demaille <akim@epita.fr>
10172
10173 * src/scan-gram.l: Move the "add a trailing ; to actions" code
10174 to...
10175 * src/scan-code.l: here.
10176 * tests/input.at (Torturing the Scanner): Fix another location
10177 error.
10178
101792006-06-07 Akim Demaille <akim@epita.fr>
10180
10181 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
10182
101832006-06-06 Akim Demaille <akim@epita.fr>
10184
10185 Extract the parsing of user actions from the grammar scanner.
10186 As a consequence, the relation between the grammar scanner and
10187 parser is much simpler. We can also split "composite tokens" back
10188 into simple tokens.
10189 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
10190 * src/scan-gram.l (add_column_width, adjust_location): Move to and
10191 rename as...
10192 * src/location.h, src/location.c (add_column_width)
10193 (location_compute): these.
10194 Fix the column count: the initial column is 0.
10195 (location_print): Be robust to ending column being 0.
10196 * src/location.h (boundary_set): New.
10197 * src/main.c: Adjust to scanner_free being renamed as
10198 gram_scanner_free.
10199 * src/output.c: Include scan-code.h.
10200 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
10201 Use boundary_set.
10202 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
10203 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
10204 which is now, again, a separate token.
10205 Adjust all dependencies.
10206 Whereever actions with $ and @ are used, use translate_code.
10207 (action): Remove this nonterminal which is now useless.
10208 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
10209 (grammar_current_rule_action_append): Use translate_code.
10210 (packgram): Bound check ruleno, itemno, and rule_length.
10211 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
10212 (last_string, last_braced_code_loc, max_left_semantic_context)
10213 (scanner_initialize, scanner_free, scanner_last_string_free)
10214 (gram_out, gram_lineno, YY_DECL_): Move to...
10215 * src/scan-gram.h: this new file.
10216 (YY_DECL): Rename as...
10217 (GRAM_DECL): this.
10218 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
10219 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
10220 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
10221 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
10222 Move these declarations, and...
10223 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
10224 these to...
10225 * src/flex-scanner.h: this new file.
10226 * src/scan-gram.l (rule_length, rule_length_overflow)
10227 (increment_rule_length): Remove.
10228 (last_braced_code_loc): Rename as...
10229 (gram_last_braced_code_loc): this.
10230 Adjust to the changes of the parser.
10231 Move all the handling of $ and @ into...
10232 * src/scan-code.l: here.
10233 * src/scan-gram.l (handle_dollar, handle_at): Remove.
10234 (handle_action_dollar, handle_action_at): Move to...
10235 * src/scan-code.l: here.
10236 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
10237 scan-code.h, scan-code-c.c, scan-gram.h.
10238 (EXTRA_bison_SOURCES): Add scan-code.l.
10239 (BUILT_SOURCES): Add scan-code.c.
10240 (yacc): Be robust to white spaces.
10241
10242 * tests/conflicts.at, tests/input.at, tests/reduce.at,
10243 * tests/regression.at: Adjust the column numbers.
10244 * tests/regression.at: Adjust the error message.
10245
102462006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
10247
10248 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
10249 Use Akim's wording from
10250 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
10251
102522006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
10253
10254 Between Bison releases, manually append `+' to the previous Bison
10255 release number, and use that as a signal to automatically print the
10256 ChangeLog's CVS Id keyword from --version. Discussed starting at
10257 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
10258 * ChangeLog: Add Id header.
10259 * configure.ac (AC_INIT): Append `+' to `2.3'.
10260 * src/.cvsignore: Add revision.c.
10261 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
10262 (BUILT_SOURCES): Add revision.c.
10263 (revision.c): New target rule. This file defines a new global variable
10264 named revision. It initializes it with either the Id from ChangeLog
10265 or, if VERSION doesn't contain `+', with the empty string.
10266 * src/getargs.c (version): Print the value of revision.
10267 * src/revision.h: Extern revision.
10268
102692006-06-05 Paul Eggert <eggert@cs.ucla.edu>
10270
10271 * NEWS: Version 2.3.
10272 * configure.ac (AC_INIT): Likewise.
10273
102742006-05-30 Paul Eggert <eggert@cs.ucla.edu>
10275
10276 * data/glr.c (YYRECOVERING): Define to be a function-like macro
10277 with no arguments, not as an object-like macro. This is for
10278 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
10279 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
10280 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
10281 Document this.
10282
102832006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
10284
10285 * src/getargs.c (usage): Back out yesterday's modification of the
10286 --help output so that we don't have to wait for translation before
10287 releasing 2.3.
10288
102892006-05-29 Paul Eggert <eggert@cs.ucla.edu>
10290
10291 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
10292 Problem reported by Akim Demaille.
10293
102942006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
10295
10296 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
10297
102982006-05-26 Paul Eggert <eggert@cs.ucla.edu>
10299
10300 * data/yacc.c (yy_reduce_print): Omit trailing white space in
10301 generated source code. Problem reported by Frans Englich in
10302 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
10303
103042006-05-22 Paul Eggert <eggert@cs.ucla.edu>
10305
10306 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
10307 shell, not within 'make', so that 'make' by an ordinary builder
10308 (using GNU make) does not worry about configuring gzip. This also
10309 works around a bug reported independently by Keith Thompson and by
10310 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
10311 stderr rather than stdout, messing up the build logs.
10312
103132006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
10314
10315 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
10316 to make sure that YYID will never be unused. This fixes a 'make
10317 maintainer-check' failure caused by the recent changes to the 'Trivial
10318 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
10319 not used.
10320 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
10321
103222006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
10323
10324 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
10325 state before an empty RHS is always resolved here. Only the location
10326 of that state is guaranteed to be resolved, and that's enough. This
10327 fixes the remaining bug reported by Derek M. Jones in
10328 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
10329 * tests/glr-regression.at (Uninitialized location when reporting
10330 ambiguity): Test the above case.
10331 Also, the embedded comments in this test case claim it checks the case
10332 of an empty RHS that has inherited the initial location. However, the
10333 corresponding LHS was already resolved, so yyresolveLocations didn't
10334 actually have reason to modify it. Fix this by forcing
10335 nondeterministic operation at the beginning of the parse.
10336
103372006-05-20 Paul Eggert <eggert@cs.ucla.edu>
10338
10339 * data/c.m4 (b4_yy_symbol_print_generate):
10340 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
10341 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
10342 of the bugs reported today by Derek M Jones in
10343 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
10344 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
10345 defined to be a type name without parens or brackets.
10346 (Location Type): Similarly for YYLTYPE.
10347 * tests/regression.at (Trivial grammars): Put in a test for this
10348 bug that will be caught by 'make maintainer-check' (though not,
10349 alas, by 'make check' unless your compiler is picky).
10350
103512006-05-19 Paul Eggert <eggert@cs.ucla.edu>
10352
10353 * NEWS: Version 2.2.
10354 * configure.ac (AC_INIT): Likewise.
10355
103562006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
10357
10358 * data/glr.c (yyreportTree): Make room in yystates for the state
10359 preceding the RHS. This fixes the segmentation fault reported by Derek
10360 M. Jones in
10361 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
10362 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
10363 to the user. Reported for yyreportTree by Derek M. Jones later in the
10364 same thread.
10365 * THANKS: Add Derek M. Jones.
10366 Update my email address.
10367 Fix typo in Steve Murphy's name.
10368
103692006-05-14 Paul Eggert <eggert@cs.ucla.edu>
10370
10371 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
10372 checking against YYLAST that caused the parser to miss a potential
10373 alternative in its diagnostic.
10374 Problem reported by Maria Jose Moron Fernandez in
10375 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
10376 * data/lalr1.cc (yysyntax_error_): Likewise.
10377 * data/yacc.c (yysyntax_error): Likewise.
10378 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
10379 tokens, in case we run into an older C compiler.
10380 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
10381 Use them to check for the off-by-one error fixed above.
10382
10383 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
10384 YYSIZE_T, not size_t.
10385 * tests/regression.at (Trivial grammars): New test, to catch
10386 the error fixed by the above patch.
10387
103882006-05-14 Akim Demaille <akim@lrde.epita.fr>
10389
10390 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
10391 scheme.
10392 Reported by Steve Murphy.
10393
103942006-05-14 Akim Demaille <akim@lrde.epita.fr>
10395
10396 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
10397 * data/glr.cc: b4_location_flag is now b4_locations_flag.
10398
103992006-05-14 Akim Demaille <akim@lrde.epita.fr>
10400
10401 Implement --trace=m4.
10402 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
10403 * src/output.c (output_skeleton): When set, pass -dV to m4.
10404
10405 Factor the handling of flags in m4.
10406 * src/output.c (prepare): Rename the muscle names debug, defines,
10407 error_verbose to debug_flag, defines_flag, error_verbose_flag.
10408 * data/c.m4: Adjust.
10409 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
10410 Use b4_define_flag_if to define other b4_FLAG_if macros.
10411 (b4_location_if): As a consequence, rename as...
10412 (b4_locations_if): this, for consistency.
10413 Adjust all the skeletons.
10414
104152006-05-14 Akim Demaille <akim@lrde.epita.fr>
10416
10417 * etc/bench.pm: Shorten bench names.
10418
104192006-05-14 Akim Demaille <akim@lrde.epita.fr>
10420
10421 * src/output.h, src/output.c (error_verbose): Move to...
10422 * src/getargs.h, src/getargs.c: here.
10423 Sort the flags.
10424 Adjust dependencies.
10425
104262006-05-13 Paul Eggert <eggert@cs.ucla.edu>
10427
10428 * data/c.m4 (b4_copyright): Put the special exception for Bison
10429 skeletons here, so we don't have to put it in each skeleton. All
10430 uses changed. Suggested by Akim Demaille. Also, wrap the
10431 copyright notice, in case it is longer than 80 columns. Replace
10432 comma by newline after title.
10433
104342006-05-11 Paul Eggert <eggert@cs.ucla.edu>
10435
10436 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
10437 incompatibility, not a bug. Mention that it wasn't fixed as of
10438 flex 2.5.33.
10439
104402006-05-11 Akim Demaille <akim@lrde.epita.fr>
10441
10442 * examples/extexi: Enforce the precedence of concatenation over
10443 >>.
10444 Reported by Tommy Nordgren.
10445
104462006-05-11 Akim Demaille <akim@lrde.epita.fr>
10447
10448 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
10449 with the member "token".
10450 Reported by Martin Nylin.
10451
104522006-05-08 Paul Eggert <eggert@cs.ucla.edu>
10453
10454 * data/glr.c: Switch to Bison 2.2 special-exception language in
10455 the copyright notice. Use more-regular format for titles and
10456 copyright notices.
10457 * data/glr.cc: Likewise.
10458 * data/location.cc: Likewise.
10459 * data/yacc.cc: Likewise.
10460 * doc/bison.texinfo (Conditions): Document this.
10461 * NEWS: likewise. Upgrade version to 2.2.
10462
104632006-04-27 Akim Demaille <akim@lrde.epita.fr>
10464
10465 * data/glr.cc: Remove dead code.
10466
104672006-04-25 Paul Eggert <eggert@cs.ucla.edu>
10468
10469 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
10470 that variable and the line breaks the bootstrap. Problem reported
10471 by Juan M. Guerrero.
10472
104732006-04-24 Akim Demaille <akim@lrde.epita.fr>
10474
10475 * doc/bison.texinfo (Multiple start-symbols): New.
10476
104772006-04-24 Akim Demaille <akim@lrde.epita.fr>
10478
10479 * etc/README, etc/bench.pl: New.
10480
104812006-04-03 Akim Demaille <akim@lrde.epita.fr>
10482
10483 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
10484 rule.
10485 Reported by Mickael Labau.
10486 * tests/input.at (Torturing the Scanner): Test it.
10487
104882006-03-16 Paul Eggert <eggert@cs.ucla.edu>
10489
10490 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
10491 Problem reported by Bob Rossi.
10492
104932006-03-13 Paul Eggert <eggert@cs.ucla.edu>
10494
10495 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
10496 and didn't really work.
10497 For the index, use @ifnotinfo, not @iftex.
10498 Minor cleanups of spacing and terminology.
10499
105002006-03-12 Akim Demaille <akim@lrde.epita.fr>
10501
10502 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
10503 of AT_NAME_PREFIX when %name-prefix is not used.
10504
105052006-03-12 Akim Demaille <akim@lrde.epita.fr>
10506
10507 Apply --prefix to C++ skeletons too: they change the namespace.
10508 The test suite already exercize these cases.
10509 * data/c++.m4 (b4_namespace): New.
10510 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
10511 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
10512 * data/yacc.c, data/glr.c: Remove a useless `[]'.
10513 * doc/bison.texinfo: Document it.
10514 (Option Cross Key): Use @multitable in all formats. It looks
10515 nicer, even in TeX outputs.
10516 (Rules): Use the same code whatever the output type is.
10517 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
10518 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
10519 * tests/calc.at: Use it, instead of hard coding `yy'.
10520
105212006-03-10 Akim Demaille <akim@lrde.epita.fr>
10522
10523 * TODO: Remove dead items.
10524
105252006-03-10 Akim Demaille <akim@lrde.epita.fr>
10526
10527 * doc/FAQ: Remove, merged into...
10528 * doc/bison.texinfo (FAQ): this.
10529 * doc/Makefile.am (EXTRA_DIST): Adjust.
10530
105312006-03-10 Akim Demaille <akim@lrde.epita.fr>
10532
10533 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
10534 even if empty.
10535 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
10536 * doc/bison.texinfo (Calc++ Scanner): Use it.
10537
105382006-03-09 Paul Eggert <eggert@cs.ucla.edu>
10539
10540 Fix two nits reported by twlevo, plus one more that I discovered.
10541
10542 * src/assoc.h (assoc_to_string): Give a name to the arg, as
10543 this is the usual Bison style.
10544 * src/location.h (location_print): Likewise.
10545
10546 * src/reader.h (token_name): Likewise.
10547
105482006-03-08 Paul Eggert <eggert@cs.ucla.edu>
10549
10550 Fix some nits reported by twlevo.
10551 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
10552 and "POSIX". Use more-modern syntax for URLs. Mention C++
10553 and ask for Java. Don't hardwire OS version numbers. Add
10554 copyright notice.
10555 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
10556 * src/conflicts.c (solved_conflicts_obstack): Now static.
10557
105582006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
10559
10560 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
10561 page. Say "you can use it" not "you may use it" as on the web page;
10562 we're describing capabilities not granting permission.
10563
105642006-03-06 Paul Eggert <eggert@cs.ucla.edu>
10565
10566 * data/glr.c (yyresolveLocations): Rename local variables to avoid
10567 shadowing warnings. Use usual patter for iterating through RHS.
10568 * tests/glr-regression.at
10569 (Uninitialized location when reporting ambiguity):
10570 Modify yylex so that it uses its argument, rather than trying
10571 to rely on ARGSUSED (which doesn't work for gcc with warnings).
10572 const char -> char const.
10573
10574 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
10575 Don't use tabs inside commands; it messes up 'ps'.
10576 Problem reported by twlevo.
10577
105782006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
10579
10580 * tests/glr-regression.at (Uninitialized location when reporting
10581 ambiguity): New test case.
10582 * data/glr.c (yyresolveLocations): New function, which uses
10583 YYLLOC_DEFAULT.
10584 (yyresolveValue): Invoke yyresolveLocations before reporting an
10585 ambiguity.
10586 * doc/bison.texinfo (Default Action for Locations): Note
10587 YYLLOC_DEFAULT's usage for ambiguity locations.
10588 (GLR Semantic Actions): Cross-reference those notes.
10589
105902006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
10591
10592 * tests/glr-regression.at (Leaked semantic values when reporting
10593 ambiguity): Remove unnecessary union and type declarations.
10594 (Leaked lookahead after nondeterministic parse syntax error): New test
10595 case.
10596 * data/glr.c (yyparse): Check for zero stacks remaining before
10597 attempting to shift the lookahead so that you don't lose it.
10598
105992006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
10600
10601 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
10602 * tests/glr-regression.at (Leaked semantic values when reporting
10603 ambiguity): New test case.
10604 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
10605 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
10606 now unnecessary yystackp parameter.
10607 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
10608 destructors can be called.
10609
10610 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
10611 in existing testcases.
10612
106132006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
10614
10615 Don't leak semantic values for parent RHS when a user action cuts the
10616 parser, and clean up related code a bit.
10617 * tests/glr-regression.at (Leaked merged semantic value if user action
10618 cuts parse): Rename to...
10619 (Leaked semantic values if user action cuts parse): ... this. Add check
10620 for leaked parent RHS values.
10621 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
10622 between an unresolved state (non-empty chain of semantic options) and
10623 an incomplete one (signaled by an empty chain).
10624 (yyresolveStates): Document the interface. Move all manipulation of a
10625 successfully or unsuccessfully resolved yyGLRState to...
10626 (yyresolveValue): ... here so that yyresolveValue always leaves a
10627 yyGLRState with consistent data and thus is easier to understand.
10628 Remove the yyvalp and yylocp parameters since they are always just
10629 taken from the yys parameter. When reporting a discarded merged value
10630 in debugging output, note that it is incompletely merged. Document the
10631 interface.
10632 (yyresolveAction): If resolving any of the RHS states fails, destroy
10633 them all rather than leaking them. Thus, as long as user actions are
10634 written to clean up the RHS correctly, yyresolveAction always cleans up
10635 the RHS of a semantic option. Document the interface.
10636
106372006-02-27 Paul Eggert <eggert@cs.ucla.edu>
10638
10639 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
10640 led to a segmentation fault in GNU Pascal. Problem reported
10641 by Waldek Hebisch.
10642
106432006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
10644
10645 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
10646 mid-rule action inside a nonterminal symbol in order to declare a
10647 destructor for its semantic value.
10648
106492006-02-16 Paul Eggert <eggert@cs.ucla.edu>
10650
10651 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
10652 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
10653 __cplusplus && ! defined _STDLIB_H && !
10654 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
10655 defined free))]: Include <stdlib.h> rather than rolling our own
10656 declarations of malloc and free, to avoid problems with
10657 incompatible declarations (using 'throw') C++'s stdlib.h. This
10658 should fix Debian bug 340012
10659 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
10660 reported by Guillaume Melquiond.
10661
106622006-02-13 Paul Eggert <eggert@cs.ucla.edu>
10663
10664 * NEWS: Clarify symbols versus types in unused-value warnings.
10665
10666 * configure.ac (AC_INIT): Bump version number.
10667
106682006-02-13 Paul Eggert <eggert@cs.ucla.edu>
10669
10670 * NEWS: Version 2.1a.
10671 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
10672 since C99 requires this.
10673
106742006-02-11 Paul Eggert <eggert@cs.ucla.edu>
10675
10676 * m4/c-working.m4: New file.
10677 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
10678
106792006-02-10 Paul Eggert <eggert@cs.ucla.edu>
10680
10681 * Makefile.maint: Merge from coreutils.
10682
106832006-02-09 Paul Eggert <eggert@cs.ucla.edu>
10684
10685 More portability fixes for problems summarized by Nelson H. F. Beebe.
10686
10687 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
10688 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
10689 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
10690 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
10691 messes up because C++ code is compiled in 32-bit mode but linked
10692 in 64-bit mode.
10693
106942006-02-08 Paul Eggert <eggert@cs.ucla.edu>
10695
10696 More portability fixes for problems summarized by Nelson H. F. Beebe.
10697
10698 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
10699 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
10700
10701 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
10702 nodist_PROGRAMS, since we don't need to actually compile the
10703 example if we're just doing a plain 'make'. This avoids bothering
10704 the installer unnecessarily about problems due to weird C++
10705 compilers.
10706
107072006-02-06 Paul Eggert <eggert@cs.ucla.edu>
10708
10709 More portability fixes for problems summarized by Nelson H. F. Beebe.
10710
10711 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
10712 than #include "...", and compile with -I'.'. The old method was
10713 not portable, according to Posix and the C standard, and it does
10714 not work with Sun C 5.7, where previous #line directives affect
10715 the working directory used in later #include "..." directives.
10716
107172006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10718
10719 Various DJGGP specific issues in /djgpp
10720
107212006-02-02 Paul Eggert <eggert@cs.ucla.edu>
10722
10723 More portability fixes for problems summarized by Nelson H. F. Beebe.
10724
10725 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
10726 '#include <map>' works and that you can apply ++ to iterators.
10727
107282006-02-01 Paul Eggert <eggert@cs.ucla.edu>
10729
10730 Work around portability problems summarized by Nelson H. F. Beebe in
10731 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
10732
10733 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
10734 that '#include <string>' works.
10735
10736 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
10737 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
10738 "warning: sorry: semantics of inline function static data `const
10739 unsigned char translate_table[262]' are wrong (you'll wind up with
10740 multiple copies)".
10741
10742 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
10743 or, xor to not_, and_, or_, and xor_, respectively. This works
10744 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
10745 random system header somewhere that includes the equivalent of
10746 <iso646.h>.
10747
10748 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
10749 -E" works; it apparently doesn't work with PathScale EKO Compiler
10750 Suite Version 2.0.
10751
107522006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
10753
10754 During deterministic GLR operation, user actions should be able to
10755 influence the parse by changing yychar. To make this easier to fix and
10756 to make glr.c easier to evolve in general, don't maintain yytoken in
10757 parallel with yychar; just compute yytoken when needed.
10758 * tests/glr-regression.at (Incorrect lookahead during deterministic
10759 GLR): Check that setting yychar in a user action has the intended
10760 effect.
10761 * data/glr.c (yyGLRStack): Remove yytokenp member.
10762 (yyclearin): Don't set *yytokenp.
10763 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
10764 yychar rather than *yytokenp to determine the current lookahead.
10765 Compute yytoken locally when needed.
10766 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
10767 point to.
10768
10769 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
10770 after `--report' documentation.
10771
107722006-01-30 Paul Eggert <eggert@cs.ucla.edu>
10773
10774 * src/parse-gram.y (grammar_declaration): Location of printer
10775 symbol is @1, not list->location. Bug reported by twlevo.
10776 * tests/input.at (Incompatible Aliases): Adjust to above change.
10777
107782006-01-29 Paul Eggert <eggert@cs.ucla.edu>
10779
10780 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
10781 all the test at once. This makes the output easier to read in the
10782 normal case.
10783
10784 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
10785 got from <http://bro-ids.org/download.html>. The bug is that
10786 when two actions appeared in succession, the second one was
10787 scanned before the first one was added to the grammar rule
10788 as a midrule action. Bison then output the incorrect warning
10789 "parse.y:905.17-906.36: warning: unused value: $3".
10790 * src/parse-gram.y (BRACED_CODE, action): These are no longer
10791 associated with a value.
10792 (rhs): Don't invoke grammar_current_rule_action_append.
10793 (action): Invoke it here instead.
10794 * src/reader.c (grammar_midrule_action): Now extern.
10795 (grammar_current_rule_action_append): Don't invoke
10796 grammar_midrule_action; that is now the scanner's job.
10797 * src/reader.h (last_string, last_braced_code_loc):
10798 (grammar_midrule_action): New decls.
10799 * src/scan-gram.l (last_string): Now extern, sigh.
10800 (last_braced_code_loc): New extern variable.
10801 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
10802 rule already has an action.
10803 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
10804 * tests/input.at (AT_CHECK_UNUSED_VALUES):
10805 Add some tests to check that the above changes fixed the bug.
10806
108072006-01-27 Paul Eggert <eggert@cs.ucla.edu>
10808
10809 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
10810 All used changed. Check whether the symbol has a destructor,
10811 not whether it is typed.
10812 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
10813 that the values are still reported as unused. All line numbers
10814 adjusted.
10815
108162006-01-23 Paul Eggert <eggert@cs.ucla.edu>
10817
10818 Work around a bug in bro 0.8, which underparenthesizes its
10819 definition of YYLLOC_DEFAULT.
10820 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
10821 their arguments.
10822 * data/lalr1.cc: Likewise.
10823 * data/yacc.cc: Likewise.
10824
108252006-01-22 Paul Eggert <eggert@cs.ucla.edu>
10826
10827 Work around a bug in Pike 7.0, and give the Pike folks a
10828 better way to override the usual int widths.
10829 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
10830 user can override the types.
10831 (short): #undef, to work around a bug in Pike 7.0.
10832 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
10833 (union yyalloc.yyss): Use yytype_int16 rather than short.
10834 All uses changed.
10835 (yysigned_char): Remove.
10836 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
10837 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
10838 * tests/regression.at (Web2c Actions): Adjust to above changes.
10839
10840 * src/reader.c (check_and_convert_grammar): New function.
10841 (reader): Close the input file even if something went wrong during
10842 parsing. Minor file descriptor leak reported by twlevo.
10843
10844 * src/assoc.c (assoc_to_string): Use a default: abort (); case
10845 to pacify gcc -Wswitch-default.
10846 * src/scan-gram.l (adjust_location): Use a default: break; case
10847 to pacify gcc -Wswitch-default.
10848 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
10849 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
10850 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
10851 Move these decls to scan-skel.l, since they don't need to be
10852 visible elsewhere.
10853 * src/scan-skel.l: Accept the above decls.
10854 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
10855 is used.
10856
108572006-01-21 Paul Eggert <eggert@cs.ucla.edu>
10858
10859 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
10860 since we don't want to insist on a version number at the start
10861 of the changelog every time.
10862 * Makefile.maint: Sync from coreutils a bit better.
10863 (sc_trailing_blank): Renamed from sc_trailing_space.
10864 All uses changed.
10865 (sc_no_if_have_config_h, sc_require_config_h):
10866 (sc_prohibit_assert_without_use): New rules.
10867 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
10868 (sc_dd_max_sym_length): Fix leading spaces in rule.
10869 (sc_system_h_headers): Prefix with @.
10870 (sc_useless_cpp_parens, m4-check): Output line numbers.
10871 (changelog-check): Allow version only in head.
10872 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
10873 satisfy new Makefile.maint rule.
10874 * data/glr.c: Likewise.
10875 * data/glr.cc: Likewise.
10876 * data/lalr1.cc: Likewise.
10877 * data/yacc.c: Likewise.
10878 * lib/ebitsetv.c: Likewise.
10879 * lib/lbitset.c: Likewise.
10880 * lib/subpipe.c: Likewise.
10881 * lib/timevar.c: Likewise.
10882 * src/system.h: Likewise.
10883 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
10884 * djgpp/Makefile.maint: Add copyright notice.
10885 * djgpp/README.in: Likewise.
10886 * djgpp/config.bat: Likewise.
10887 * djgpp/config.site: Likewise.
10888 * djgpp/config_h.sed: Likewise.
10889 * djgpp/djunpack.bat: Likewise.
10890 * djgpp/config.sed: Fix copyright notice to match standard format.
10891 * djgpp/subpipe.h: Likewise.
10892 * lib/bitsetv-print.c: Likewise.
10893 * lib/bitsetv.c: Likewise.
10894 * lib/subpipe.h: Likewise.
10895 * lib/timevar.c: Likewise.
10896 * lib/timevar.h: Likewise.
10897 * djgpp/subpipe.c: Use standard recipe for config.h.
10898 * lib/abitset.c: Likewise.
10899 * lib/bitset.c: Likewise.
10900 * lib/bitset_stats.c: Likewise.
10901 * lib/bitsetv-print.c: Likewise.
10902 * lib/bitsetv.c: Likewise.
10903 * lib/ebitsetv.c: Likewise.
10904 * lib/get-errno.c: Likewise.
10905 * lib/lbitset.c: Likewise.
10906 * lib/subpipe.c: Likewise.
10907 * lib/timevar.c: Likewise.
10908 * lib/vbitset.c: Likewise.
10909 * tests/local.at: Likewise.
10910 * src/scan-gram.l: Don't include verify.h, since system.h does
10911 that for us.
10912 * .x-sc_require_config_h: New file.
10913 * .x-sc_unmarked_diagnostics: New file.
10914
109152006-01-20 Paul Eggert <eggert@cs.ucla.edu>
10916
10917 Be a bit more systematic about using 'abort'.
10918 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
10919 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
10920 Put 'default: abort ();' before some other case, to satisfy older
10921 pedantic compilers.
10922 * lib/bitset_stats.c (bitset_stats_init): Likewise.
10923 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
10924 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
10925 * src/conflicts.c (resolve_sr_conflict): Likewise.
10926 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
10927 (get_decision_str, get_orientation_str, get_node_alignment_str):
10928 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
10929 (get_linestyle_str, get_arrowstyle_str): Likewise.
10930 * src/conflicts.c (resolve_sr_conflict):
10931 Use a default case rather than one for the one remaining enum
10932 value, to catch invalid enum values as well.
10933 * src/lalr.c (set_goto_map, map_goto):
10934 Prefer "assert (FOO);" to "if (!FOO) abort ();".
10935 * src/nullable.c (nullable_compute, token_definitions_output):
10936 Likewise.
10937 * src/reader.c (packgram, reader): Likewise.
10938 * src/state.c (transitions_to, state_new, state_reduction_find):
10939 Likewise.
10940 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
10941 (symbol_pack): Likewise.
10942 * src/tables.c (conflict_row, pack_vector): Likewise.
10943 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
10944 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
10945 * src/system.h: Don't include <assert.h>.
10946 (assert): New macro.
10947
10948 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
10949 (Destructor Decl, Parser Function, Pure Calling):
10950 Describe rules for braces inside C code more carefully.
10951
109522006-01-19 Paul Eggert <eggert@cs.ucla.edu>
10953
10954 Fix some porting glitches found by Nelson H. F. Beebe.
10955 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
10956 compilers that don't understand that abort () does not return.
10957 * src/state.c (transitions_to): Likewise.
10958 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
10959 that '#include <cstdlib>' works.
10960 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
10961 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
10962 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
10963 for the benefit of some pre-C99 compilers.
10964
10965 * bootstrap: Undo changes to gnulib files that autoreconf made.
10966
10967 Minor fixups to get 'make maintainer-check' to work.
10968 * configure.ac: Don't use -Wnested-externs, as it's incompatible
10969 with the new verify.h implementation.
10970 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
10971 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
10972 * data/yacc.c (YYUSE): Likewise.
10973 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
10974 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
10975 * src/parse-gram.y (declaration): Don't pass a string constant
10976 to a function that expects char *, since GCC might complain
10977 about the constant value.
10978 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
10979 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
10980 before #defining them.
10981 * tests/glr-regression.at
10982 (Incorrectly initialized location for empty right-hand side in GLR):
10983 In yyerror, use the msg arg.
10984 (Corrupted semantic options if user action cuts parse):
10985 (Incorrect lookahead during deterministic GLR):
10986 (Incorrect lookahead during nondeterministic GLR):
10987 Don't name a local var 'index'; it shadows string.h's 'index'.
10988
109892006-01-19 Akim Demaille <akim@epita.fr>
10990
10991 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
10992 location, not just parts of it.
10993
109942006-01-18 Paul Eggert <eggert@cs.ucla.edu>
10995
10996 * NEWS: Document the fact that multiple %unions are now allowed.
10997 * doc/bison.texinfo (Union Decl): Likewise.
10998 * TODO: This feature is now implemented, so remove it from
10999 the wishlist.
11000
11001 * Makefile.maint: Merge with coreutils Makefile.maint.
11002 (CVS_LIST): Use build-aux version if available.
11003 (VERSION_REGEXP): New macro.
11004 (syntax-check-rules): Add sc_no_if_have_config_h,
11005 sc_prohibit_assert_without_use, sc_require_config_h,
11006 sc_useless_cpp_parens.
11007 (sc_obsolete_symbols): Check for O_NDELAY.
11008 (sc_dd_max_sym_length): Track coreutils.
11009 (sc_unmarked_diagnostics): Look in all files, not just *.c.
11010 (sc_useless_cpp_parens): New rule.
11011 (news-date-check): Look for version or today's date.
11012 (changelog-check): Don't require version number near head.
11013 (copyright-check): Use current year instead of hardwiring 2005.
11014 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
11015 (announcement): Add --gpg-key-ID.
11016
11017 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
11018 with "file system".
11019
11020 Avoid undefined behavior that addressed just before the start of an
11021 array. Problem reported by twlevo.
11022 * src/reader.c (packgram): Prepend a new sentinel before ritem.
11023 * src/lalr.c (build_relations): Rely on new sentinel.
11024 * src/gram.c (gram_free): Adjust to new sentinel.
11025
110262006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
11027
11028 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
11029 yylookaheadNeeds. All uses updated.
11030 (yysplitStack): Rename local yynewLookaheadStatuses to
11031 yynewLookaheadNeeds.
11032 * data/glr-regression.at (Incorrect lookahead during nondeterministic
11033 GLR): In comments, change `lookahead status' to `lookahead need'.
11034
110352006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
11036
11037 * data/glr.c (yysplitStack): A little stylistic rewrite.
11038
110392006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
11040
11041 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
11042
110432006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
11044
11045 * doc/bison.texinfo: Fix some typos.
11046 (GLR Semantic Actions): New subsection discussing special
11047 considerations because GLR semantic actions might be deferred.
11048 (Actions): Mention look-ahead usage of yylval.
11049 (Actions and Locations): Mention look-ahead usage of yylloc.
11050 (Special Features for Use in Actions): Add YYEOF entry and mention it
11051 in the yychar entry.
11052 In the yychar entry, remove mention of the local yychar case (pure
11053 parser) since this is irrelevant information when writing semantic
11054 actions and since it's already discussed in `Table of Symbols' where
11055 yychar is otherwise described as an external variable.
11056 In the yychar entry, don't call it the `current' look-ahead since it
11057 isn't when semantic actions are deferred.
11058 In the yychar and yyclearin entries, add note about deferred semantic
11059 actions.
11060 Add yylloc and yylval entries discussing look-ahead usage.
11061 (Look-Ahead Tokens): When discussing yychar, don't call it the
11062 `current' look-ahead, and do mention yylval and yylloc.
11063 (Error Recovery): Cross-reference `Action Features' when mentioning
11064 yyclearin.
11065 (Table of Symbols): In the yychar entry, don't call it the `current'
11066 look-ahead.
11067 In the yylloc and yylval entries, mention look-ahead usage.
11068
110692006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
11070
11071 * tests/glr-regression.at: Update copyright year to 2006.
11072
110732006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
11074
11075 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
11076 use during nondeterministic operation to track which stacks have
11077 actually needed the current lookahead.
11078 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
11079 Allocate, deallocate, resize, and otherwise shuffle space for
11080 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
11081 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
11082 appropriately during nondeterministic operation.
11083 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
11084 members to store the current lookahead to be used by the deferred
11085 user action.
11086 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
11087 from which the RHS is taken. Set the lookahead members of the new
11088 yySemanticOption according to the lookahead status for stack yyk.
11089 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
11090 yyaddDeferredAction.
11091 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
11092 members of yySemanticOption before invoking yyuserAction, and then set
11093 them back to their current values afterward.
11094 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
11095 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
11096 * tests/glr-regression.at: Remove `.' from the ends of recent test case
11097 titles for consistency.
11098 (Leaked merged semantic value if user action cuts parse): In order to
11099 suppress lint warnings, use arguments in merge function, and assign
11100 char value < 128 in main.
11101 (Incorrect lookahead during deterministic GLR): New test case.
11102 (Incorrect lookahead during nondeterministic GLR): New test case.
11103
111042006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
11105
11106 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
11107 !yyvaluep as signal that no semantic value is available to print.
11108 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
11109 to print a semantic value.
11110
111112006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
11112
11113 * tests/glr-regression.at: For consistency with my newer test cases,
11114 don't thank myself.
11115
111162006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
11117
11118 * data/glr.c (yyresolveValue): When merging semantic options, if at
11119 least one user action succeeds but a later one cuts the parse, then
11120 destroy the semantic value before returning rather than leaking it.
11121 (yyresolveStates): If a user action cuts the parse and thus
11122 yyresolveValue fails, ignore the (unset) semantic value rather than
11123 corrupting the yyGLRState, and empty the semantic options list since
11124 the user actions should have called all necessary destructors.
11125 Simplify code with YYCHK.
11126 * tests/glr-regression.at (Corrupted semantic options if user action
11127 cuts parse): New test case.
11128 (Undesirable destructors if user action cuts parse): New test case.
11129 Before applying any of this patch, this test case never actually failed
11130 for me... but only because the corrupted semantic options usually
11131 masked this bug.
11132 (Leaked merged semantic value if user action cuts parse): New test
11133 case.
11134
111352006-01-05 Akim Demaille <akim@epita.fr>
11136
11137 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
11138
111392006-01-04 Paul Eggert <eggert@cs.ucla.edu>
11140
11141 * data/c.m4 (b4_c_modern): New macro, with a new provision for
11142 _MSC_VER. Problem reported by Cenzato Marco.
11143 (b4_c_function_def): Use it.
11144 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
11145 b4_c_modern.
11146 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
11147 than rolling our own.
11148
111492006-01-04 Akim Demaille <akim@epita.fr>
11150
11151 Also warn about non-used mid-rule values.
11152 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
11153 member.
11154 (symbol_list_new): Adjust.
11155 * src/reader.c (symbol_typed_p): New.
11156 (grammar_rule_check): Use it.
11157 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
11158 Check its rule.
11159 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
11160 Use it.
11161 * tests/actions.at (Exotic Dollars): Adjust.
11162
111632006-01-04 Akim Demaille <akim@epita.fr>
11164
11165 * src/reader.c (grammar_midrule_action): If $$ is set in a
11166 mid-rule, move the `used' bit to its lhs.
11167 * tests/input.at (Unused values): New.
11168 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
11169
111702006-01-03 Paul Eggert <eggert@cs.ucla.edu>
11171
11172 * doc/bison.texinfo (Bison Options): Say more accurately what
11173 --yacc does.
11174 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
11175 about declarations in the grammar when in Yacc mode, as POSIX does
11176 not require a diagnostic when the grammar uses extensions.
11177
11178 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
11179
11180 Warn about dubious constructions like "%token T T".
11181 Reported by twlevo.
11182 * src/symtab.h (struct symbol.declared): New member.
11183 * src/symtab.c (symbol_new): Initialize it to false.
11184 (symbol_class_set): New arg DECLARING, specifying whether
11185 this is a declaration that we want to warn about, if there
11186 is more than one of them. All uses changed.
11187
11188 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
11189 Allow multiple %union directives, whose contents concatenate.
11190 * src/parse-gram.y (grammar_declaration): Likewise.
11191 Use muscle_code_grow, so that we don't need stype_line any more.
11192 All uses changed.
11193
11194 * src/muscle_tab.c (muscle_grow): Fix comment.
11195
11196 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
11197 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
11198 Update copyright year to 2006.
11199
112002006-01-03 Akim Demaille <akim@epita.fr>
11201
11202 Have glr.cc pass (some of) the calc.at tests.
11203 * data/glr.cc (b4_parse_param_orig): New.
11204 (b4_parse_param): Improve its definition, and bound it more
11205 clearly in the skeleton.
11206 (b4_epilogue): Append, instead of prepending, in order to keep
11207 #line consistency.
11208 Simplify the generation of auxiliary functions: locations and
11209 purity are mandated.
11210 (b4_global_tokens_and_yystype): Honor it.
11211 * data/location.cc (c++.m4): Don't include it.
11212 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
11213 and AT_SKEL_CC_IF.
11214 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
11215 AT_LALR1_CC_IF.
11216 Be sure to initialize the first position's filename.
11217 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
11218 mandated anyway.
11219 (AT_CHECK_CALC_GLR_CC): New.
11220 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
11221
112222006-01-02 Akim Demaille <akim@epita.fr>
11223
11224 * src/output.c (output_skeleton): Don't hard wire the inclusion of
11225 c.m4.
11226 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
11227 * data/glr.cc: Do not include stack.hh.
11228
112292006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
11230
11231 * data/glr.c: Reformat whitespace with tabs.
11232 (b4_lpure_formals): Remove this unused m4 macro.
11233 * tests/cxx-type.at: Reformat whitespace with tabs.
11234 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
11235 since it's a member. Rename type to isNterm for clarity.
11236
112372005-12-29 Akim <akim@sulaco.local>
11238
11239 Let glr.cc catch up with symbol_value_print.
11240 * data/glr.cc (b4_yysymprint_generate): Replace by...
11241 (b4_yy_symbol_print_generate): this.
11242 (yy_symbol_print, yy_symbol_value_print): Declare them.
11243
112442005-12-28 Paul Eggert <eggert@cs.ucla.edu>
11245
11246 * src/location.h (boundary): Note that a line or column equal
11247 to INT_MAX indicates an overflow.
11248 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
11249 (rule_length_overflow, increment_rule_length, add_column_width):
11250 New functions.
11251 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
11252 (<SC_BRACED_CODE>"}"):
11253 Use increment_rule_length rather than incrementing it by hand.
11254 (adjust_location, handle_syncline): Diagnose overflow.
11255 (handle_action_dollar, handle_action_at):
11256 Fix bug with monstrosities like $-2147483648.
11257 Remove now-unnecessary checks.
11258 (scan_integer): Verify assumptions and remove now-unnecessary checks.
11259 (convert_ucn_to_byte): Verify assumptions.
11260 (handle_syncline): New arg LOC. All callers changed.
11261 Don't store through a value derived from char const * pointer.
11262
11263 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
11264 GCC warnings.
11265
112662005-12-27 Paul Eggert <eggert@cs.ucla.edu>
11267
11268 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
11269 Remove unnecessary forward static decls.
11270
112712005-12-27 Akim Demaille <akim@epita.fr>
11272
11273 * src/reader.c (grammar_current_rule_check): Also check that $$
11274 is used.
11275 Take the rule to check as argument, hence rename as...
11276 (grammar_rule_check): this.
11277 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
11278 Rename as...
11279 (grammar_rule_begin, grammar_rule_end): these, for consistency.
11280 (grammar_midrule_action, grammar_symbol_append): Now static.
11281 * tests/torture.at (input): Don't rely on the default action
11282 being always performed.
11283 * tests/calc.at: "Set" $$ even when the action is "cut" with
11284 YYERROR or other.
11285 * tests/actions.at (Exotic Dollars): Instead of using unused
11286 values, check that the warning is issued.
11287
112882005-12-22 Paul Eggert <eggert@cs.ucla.edu>
11289
11290 * NEWS: Improve wording for unused-value warnings.
11291
112922005-12-22 Akim Demaille <akim@epita.fr>
11293
11294 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
11295 (b4_yysymprint_generate): Rename as...
11296 (b4_yy_symbol_print_generate): this.
11297 Generate yy_symbol_print instead of yysymprint.
11298 Generate also yy_symbol_value_print, and use it.
11299
113002005-12-22 Akim Demaille <akim@epita.fr>
11301
11302 * NEWS: Warn about unused values.
11303 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
11304 a `used' member.
11305 (symbol_list_n_get, symbol_list_n_used_set): New.
11306 (symbol_list_n_type_name_get): Use symbol_list_n_get.
11307 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
11308 * src/reader.c (grammar_current_rule_check): Check that values are
11309 used.
11310 * src/symtab.c (symbol_print): Accept 0.
11311 * tests/existing.at: Remove the type information.
11312 Empty the actions.
11313 Remove useless actions (beware of mid-rule actions: perl -000
11314 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
11315 * tests/actions.at (Exotic Dollars): Use unused values.
11316 * tests/calc.at: Likewise.
11317 * tests/glr-regression.at (No users destructors if stack 0 deleted):
11318 Likewise.
11319
11320 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
11321 rule_useful_p.
11322
113232005-12-21 Paul Eggert <eggert@cs.ucla.edu>
11324
11325 Undo 2005-12-01 tentative license wording change. The wording is
11326 still being reviewed by the lawyers, and we don't want to wait for
11327 them before publishing a test release. For now, revert to the
11328 previous wording.
11329 * NEWS: Undo 2005-12-01 change.
11330 * data/glr.c: Revert to previous license wording.
11331 * data/glr.cc: Likewise.
11332 * data/lalr1.cc: Likewise.
11333 * data/location.cc: Likewise.
11334 * data/yacc.c: Likewise.
11335
11336 * NEWS: Reword %destructor vs YYABORT etc.
11337 * data/glr.c: Use American spacing, for consistency.
11338 * data/glr.cc: Likewise.
11339 * data/lalr1.cc: Likewise.
11340 * data/yacc.c: Likewise.
11341 * data/yacc.c: Reformat comments slightly.
11342 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
11343 for consistency. Fix some spelling errors and reword recently-included
11344 text slightly.
11345 * tests/cxx-type.at: Cast results of malloc, for C++.
11346
113472005-12-21 Joel E. Denny <address@hidden>
11348
11349 * tests/cxx-type.at: Construct a tree, count the parents of shared
11350 nodes, and free each node once and only once. Previously, the memory
11351 for semantic values was leaked instead.
11352
113532005-12-21 Joel E. Denny <address@hidden>
11354
11355 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
11356 (yylval, yylloc): If pure, #define to yystackp->yyval and
11357 yystackp->yyloc similar to yychar and yynerrs.
11358 (yyparse): If pure, remove local yylval and yylloc. Add local
11359 yystackp to accommodate pure definitions of yylval and yylloc.
11360 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
11361 yylvalp and yyllocp to &yylval and &yylloc.
11362 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
11363 namespace. Previously, nerrs and char were missing, but lval and lloc
11364 weren't necessary.
11365 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
11366 yylvalp and yyllocp parameters since, if pure, these are now always
11367 accessible through yystackp. If not pure, they are still accessible
11368 globally.
11369 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
11370 `if (YYID (N))' to pacify lint.
11371
113722005-12-21 Akim Demaille <akim@epita.fr>
11373
11374 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
11375 destroy the RHS symbols of a rule.
11376 * data/yacc.c (yylen): Initialize to 0.
11377 Keep its value to the number of items to possibly shift.
11378 In particular, a regular successful parse that ends on YYFINAL by
11379 a (internal) YYACCEPT must not have yylen != 0.
11380 (yyerrorlab, yyreturn): Pop the RHS.
11381 Reorder a bit to emphasize the `shifting' bits of code.
11382 (YYPOPSTACK): Now accept a number of items to pop.
11383 * data/lalr1.cc: Likewise.
11384 * data/glr.c: Formatting changes.
11385 Use goto instead of fall through.
11386 * doc/bison.texinfo (Destructor Decl): Complete.
11387
113882005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
11389
11390 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
11391 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
11392 * djgpp/config.bat: Replace every occurence of the file name
11393 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
11394 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
11395 * djgpp/config.sed: Replace every occurence of the file name
11396 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
11397 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
11398 * djgpp/djunpack.bat: DJGPP specific file.
11399 * djgpp/fnchange.lst: DJGPP specific file.
11400 * djgpp/README.in: Add new information about how to unpack the bison
11401 source on MSDOS and other systems which have 8.3 file name restrictions
11402 using djunpack.bat and fnchange.lst.
11403
114042005-12-12 Paul Eggert <eggert@cs.ucla.edu>
11405
11406 * bootstrap (build_cvs_prefix): Remove; unused.
11407 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
11408 when getting gnulib.
11409
114102005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
11411
11412 * data/glr.c: Reorder typedef declarations for structs to match order
11413 of struct declarations.
11414 Rename yystack everywhere to yystackp except in yyparse where it's not
11415 a pointer.
11416 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
11417 consistency.
11418 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
11419 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
11420 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
11421 lint.
11422
114232005-12-09 Paul Eggert <eggert@cs.ucla.edu>
11424
11425 * tests/sets.at (Accept): Fix typos in regular expression used to
11426 sed out the final state number.
11427
11428 Work around portability problem on Solaris 10: flex-generated
11429 files include <stdio.h> before <config.h>, which messes up
11430 because the latter defines __EXTENSIONS__. Address the problem
11431 by creating two new little files that include <config.h> first,
11432 then include the flex-generated files. Rewrite everyone else
11433 to include <config.h> first, as well.
11434 * lib/timevar.c: Always include "config.h".
11435 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
11436 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
11437 (EXTRA_bison_SOURCES): New macro.
11438 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
11439 * src/system.h: Don't include config.h.
11440 * src/LR0.c: Include <config.h> first.
11441 * src/assoc.c: Likewise.
11442 * src/closure.c: Likewise.
11443 * src/complain.c: Likewise.
11444 * src/conflicts.c: Likewise.
11445 * src/derives.c: Likewise.
11446 * src/files.c: Likewise.
11447 * src/getargs.c: Likewise.
11448 * src/gram.c: Likewise.
11449 * src/lalr.c: Likewise.
11450 * src/location.c: Likewise.
11451 * src/main.c: Likewise.
11452 * src/muscle_tab.c: Likewise.
11453 * src/nullable.c: Likewise.
11454 * src/output.c: Likewise.
11455 * src/parse-gram.y: Likewise.
11456 * src/print.c: Likewise.
11457 * src/print_graph.c: Likewise.
11458 * src/reader.c: Likewise.
11459 * src/reduce.c: Likewise.
11460 * src/relation.c: Likewise.
11461 * src/state.c: Likewise.
11462 * src/symlist.c: Likewise.
11463 * src/symtab.c: Likewise.
11464 * src/tables.c: Likewise.
11465 * src/uniqstr.c: Likewise.
11466 * src/vcg.c: Likewise.
11467
11468 * src/parse-gram.y: Fix minor problems uncovered by lint.
11469 (current_lhs, current_lhs_location): Now static.
11470 (current_assoc): Remove unused variable.
11471
11472 Cleanups so that Bison-generated parsers have less lint.
11473 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
11474 Prepend /*ARGSUSED*/, for lint's sake.
11475 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
11476 definition if 'lint' is defined.
11477 (YYID): New macro (or function, if lint).
11478 All uses of /*CONSTCOND*/0 replaced by YYID(0).
11479 * data/yacc.c: Likewise.
11480 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
11481 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
11482 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
11483 is C++ only.
11484 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
11485 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
11486 Use YYID(0) rather than 0, for lint.
11487 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
11488 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
11489
114902005-12-07 Paul Eggert <eggert@cs.ucla.edu>
11491
11492 * tests/glr-regression.at
11493 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
11494 Close memory leak reported by twlevo.
11495
114962005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
11497
11498 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
11499 all stacks.
11500 (yyparse): Iterate another stack in order to call user destructors.
11501 * tests/glr-regression.at (No users destructors if stack 0 deleted):
11502 New test case.
11503 (Duplicated user destructor for lookahead): This test now is expected
11504 to succeed.
11505
115062005-12-01 Paul Eggert <eggert@cs.ucla.edu>
11507
11508 * NEWS: Document the following change.
11509 * data/yacc.c: Say "parser skeleton" rather than "file", since
11510 it's no longer just a file.
11511 * data/glr.c: Grant a special exception for C GLR parsers, that
11512 reads like the already-existing exception for C LALR(1) parsers.
11513 * data/glr.cc: Likewise.
11514 * data/lalr1.cc: Likewise.
11515 * data/location.cc: Likewise.
11516 * data/yacc.c: Reword the "written by" statement to clarify that
11517 it was the parser skeleton, not the entire output file.
11518 * data/glr.c: Written by Paul Hilfinger.
11519 * data/glr.cc: Written by Akim Demaille.
11520 * data/lalr1.cc: Likewise.
11521
115222005-11-18 Paul Eggert <eggert@cs.ucla.edu>
11523
11524 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
11525 Fix typos in previous change that broke 'make check'.
11526 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
11527 supported in C.
11528 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
11529 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
11530 We can revert this once things settle down.
11531
11532 * src/conflicts.c (conflicts_print): Don't print file name twice
11533 when %expect fails because there were no conflicts.
11534 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
11535 change.
11536 * tests/conflicts.at (%expect not enough, %expect too much):
11537 (%expect with reduce conflicts): Adjust to new behavior.
11538
115392005-11-18 Akim Demaille <akim@epita.fr>
11540
11541 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
11542 errors.
11543 * NEWS: Document this.
11544 * doc/bison.texinfo (Expect Decl): Likewise.
11545
115462005-11-16 Akim Demaille <akim@epita.fr>
11547
11548 Generalize the display of semantic values and locations in traces.
11549 * data/glr.c (yy_reduce_print): Fix indices (again).
11550 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
11551 literal integers.
11552 * data/lalr1.cc (yyreduce_print): Rename as...
11553 (yy_reduce_print): this.
11554 Display values and locations.
11555 * data/yacc.c (yy_reduce_print): Likewise.
11556 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
11557 (yysymprint): Move higher to be visible from yy_reduce_print).
11558 (yyparse): Adjust.
11559 * tests/calc.at: Adjust the expected length of the traces.
11560
115612005-11-14 Akim Demaille <akim@epita.fr>
11562
11563 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
11564 from 1 to N, while values and location start at 0.
11565 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
11566
115672005-11-14 Akim Demaille <akim@epita.fr>
11568
11569 * data/glr.c (yy_reduce_print): Fix the $ number.
11570
115712005-11-14 Akim Demaille <akim@epita.fr>
11572
11573 "Use" parse parameters.
11574 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
11575 * data/glr.c, data/glr.cc: Use them.
11576 * data/glr.c (YYUSE): Have a C++ definition that supports
11577 non-pointer types.
11578
115792005-11-14 Akim Demaille <akim@epita.fr>
11580
11581 * data/glr.c (yyexpandGLRStack): Declare only if defined.
11582
115832005-11-14 Akim Demaille <akim@epita.fr>
11584
11585 * data/glr.cc: New.
11586 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
11587
115882005-11-12 Akim Demaille <akim@epita.fr>
11589
11590 Let position and location be PODs.
11591 * data/location.cc (position::initialize, location::initialize): New.
11592 (position::position, location::location): Define only if
11593 b4_location_constructors is defined.
11594 * data/lalr1.cc (b4_location_constructors): Define it for backward
11595 compatibility.
11596 * doc/bison.texinfo (Initial Action Decl): Use initialize.
11597
115982005-11-12 Akim Demaille <akim@epita.fr>
11599
11600 * data/lalr1.cc: Move the body of the ctor and dtor into the
11601 parser file (instead of the header).
11602 Wrap the implementations in a "namespace yy".
11603
116042005-11-12 Akim Demaille <akim@epita.fr>
11605
11606 Have glr.c include its header file when created.
11607 * data/glr.c (b4_shared_declarations): New.
11608 Output them verbatim in the parser if !%defines, otherwise
11609 output then in the header file, and include it instead.
11610
116112005-11-11 Akim Demaille <akim@epita.fr>
11612
11613 * data/glr.c: Comment changes.
11614
116152005-11-11 Akim Demaille <akim@epita.fr>
11616
11617 When yydebug, report semantic and location values for reductions.
11618 * data/glr.c (yy_reduce_print): Report the semantic values and the
11619 locations.
11620 (YY_REDUCE_PRINT): Adjust.
11621 (yyglrReduce): Use them.
11622 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
11623 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
11624 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
11625 traces.
11626
116272005-11-10 Akim Demaille <akim@epita.fr>
11628
11629 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
11630 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
11631 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
11632
116332005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
11634
11635 * m4/cxx.m4, examples/Makefile.am: Don't build
11636 examples/calc++ if no C++ compiler is available. (trivial change)
11637
116382005-11-09 Akim Demaille <akim@epita.fr>
11639
11640 * src/scan-skel.l: Use a couple of asserts.
11641
116422005-11-03 Akim Demaille <akim@epita.fr>
11643
11644 In some (weird) cases, the final state number is incorrect.
11645 Reported by Alexandre Duret-Lutz.
11646 * src/LR0.c (state_list_append): Remove the computation of
11647 final_state.
11648 (save_reductions): Do it here.
11649 (get_state): Alpha conversion.
11650 (generate_states): Use a for loop.
11651 * src/gram.h (item_number_is_rule_number)
11652 (item_number_is_symbol_number): New.
11653 * src/state.c: Use assert.
11654 * src/system.h: Include assert.h.
11655 * tests/sets.at (Accept): New.
11656
116572005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
11658
11659 * data/glr.c (yyfill): Adjust comment.
11660 (yyresolveAction): Initialize default location properly
11661 for empty right-hand sides.
11662 (yydoAction): Ditto.
11663 Add comment explaining apparently dead code.
11664 * tests/glr-regression.at
11665 (Incorrectly initialized location for empty right-hand side in GLR):
11666 New test.
11667
116682005-10-30 Paul Eggert <eggert@cs.ucla.edu>
11669
11670 * bootstrap (cleanup_gnulib): New function. Use it to clean up
11671 gnulib when interrupted. This fixes some race conditions and
11672 works around some portability problems (one noted by Paul
11673 Hilfinger).
11674
116752005-10-22 Akim <akim@epita.fr>
11676
11677 * Makefile.cfg: Adjust to config -> build-aux.
11678 Reported by twledo.
11679
116802005-10-21 Akim Demaille <akim@epita.fr>
11681
11682 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
11683 the %parse-params.
11684 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
11685 * data/yacc.c (b4_Pure_if): Rename as...
11686 (b4_yacc_pure_if): this.
11687 (YY_SYMBOL_PRINT, yyparse): Adjust.
11688 * doc/bison.texinfo: Formatting changes.
11689
116902005-10-21 Akim Demaille <akim@epita.fr>
11691
11692 Finish the transition config -> build-aux.
11693 * configure.ac, Makefile.am: Use build-aux.
11694 * config/prev-version, config/announce-gen, config/Makefile.am:
11695 Move to...
11696 * build-aux/prev-version, build-aux/announce-gen,
11697 * build-aux/Makefile.am: here.
11698
116992005-10-14 Akim Demaille <akim@epita.fr>
11700
11701 * examples/calc++/test: Use set -x only when VERBOSE.
11702
117032005-10-13 Paul Eggert <eggert@cs.ucla.edu>
11704
11705 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
11706 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
11707
117082005-10-13 Akim Demaille <akim@epita.fr>
11709
11710 * src/scan-skel.l: Output the base name parts of the parser and
11711 header file names.
11712 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
11713 additional checks.
11714 Use this to exercise C++ outputs in subdirs.
11715 Reported by Oleg Smolsky.
11716
117172005-10-12 Paul Eggert <eggert@cs.ucla.edu>
11718
11719 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
11720 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
11721 Problem reported by John P. Hartmann.
11722 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
11723 already defined it.
11724
117252005-10-12 Akim Demaille <akim@epita.fr>
11726
11727 * src/parse-gram.y (version_check): Exit 63 to please missing
11728 (stands for "version mismatch).
11729 * tests/input.at, doc/bison.texinfo: Adjust.
11730
117312005-10-10 Paul Eggert <eggert@cs.ucla.edu>
11732
11733 Work around portability problems with Visual Age C compiler
11734 (xlc and xlC_r) reported by John P. Hartmann.
11735 * data/location.cc (initial_column, initial_line): Remove.
11736 All uses replaced by 0 and 1.
11737 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
11738 that xlc complains about.
11739 * src/scan-skel.l (skel_wrap): Likewise.
11740 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
11741 as __STDC__.
11742 * data/yacc.c (YYMODERN_C): New macro, which also looks at
11743 __STDC_VERSION__. Use it everywhere instead of looking at
11744 __STDC__ and __cplusplus.
11745
117462005-10-10 Akim Demaille <akim@epita.fr>
11747
11748 * examples/calc++/test: Be quiet unless VERBOSE.
11749
117502005-10-05 Paul Eggert <eggert@cs.ucla.edu>
11751
11752 * data/c.m4 (yydestruct, yysymprint):
11753 Use YYUSE instead of casting to void.
11754 * data/glr.c (YYUSE): New macro.
11755 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
11756 Use it instead of rolling our own.
11757 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
11758 (YYCHK1):
11759 Use /*CONSTCOND*/ to suppress lint warnings.
11760 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
11761 (YY_STACK_PRINT): Use 'false' not '0'.
11762 (YYUSE): New macro.
11763 (yysymprint_, yydestruct_): Use it instead of rolling our own.
11764 * data/yacc.c (YYUSE): New macro.
11765 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
11766 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
11767 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
11768
11769
11770 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
11771 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
11772
117732005-10-04 Paul Eggert <eggert@cs.ucla.edu>
11774
11775 Undo the parts of the unlocked-I/O change that substituted
11776 putc or puts for printf. This might hurt performance a bit,
11777 but some people prefer the printf style.
11778 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
11779 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
11780 All uses replaced by YYFPRINTF and YYDPRINTF.
11781 * data/yacc.c: Likewise.
11782 * lib/bitset.c (bitset_print): Likewise.
11783 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
11784 putc and puts.
11785 * lib/lbitset.c (debug_lbitset): Likewise.
11786 * src/closure.c (print_firsts, print_fderives): Likewise.
11787 * src/gram.c (grammar_dump): Likewise.
11788 * src/lalr.c (look_ahead_tokens_print): Likewise.
11789 * src/output.c (escaped_output): Likewise.
11790 (user_actions_output): Break apart two printfs.
11791 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
11792 * src/reduce.c (reduce_print): Likewise.
11793 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
11794 * src/system.h: Include unlocked-io.h rathe than stdio.h.
11795
11796 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
11797 Use assignments rather than casts-to-void to suppress
11798 unused-variable warnings. This pacifies 'lint'.
11799 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
11800 unused-variable warnings.
11801
118022005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
11803
11804 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
11805
118062005-10-02 Paul Eggert <eggert@cs.ucla.edu>
11807
11808 Use unlocked I/O for a minor performance improvement on hosts like
11809 GNU/Linux and Solaris that support unlocked I/O. The basic idea
11810 is to use the gnlib unlocked-io module, and to prefer putc and
11811 puts to printf when either will work (since the latter doesn't
11812 come in an unlocked flavor).
11813 * bootstrap (gnulib_modules): Add unlocked-io.
11814 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
11815 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
11816 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
11817 and similarly for puts and putc and printf.
11818 * data/yacc.c: Likewise.
11819 * lib/bitset.c (bitset_print): Likewise.
11820 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
11821 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
11822 to printf.
11823 * lib/lbitset.c (debug_lbitset): Likewise.
11824 * src/closure.c (print_firsts, print_fderives): Likewise.
11825 * src/gram.c (grammar_dump): Likewise.
11826 * src/lalr.c (look_ahead_tokens_print): Likewise.
11827 * src/output.c (escaped_output): Likewise.
11828 (user_actions_output): Coalesce two printfs.
11829 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
11830 * src/reduce.c (reduce_print): Likewise.
11831 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
11832 * src/system.h: Include unlocked-io.h rather than stdio.h.
11833
11834 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
11835 this confuses xgettext.
11836
118372005-10-02 Akim Demaille <akim@epita.fr>
11838
11839 * bootstrap (gnulib_modules): Add strverscmp.
11840 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
11841 * m4/.cvsignore: Add strverscmp.m4.
11842 * src/parse-gram.y (%require): New token, new rule.
11843 (version_check): New.
11844 * src/scan-gram.l (%require): Adjust.
11845 * tests/input.at (AT_REQUIRE): New.
11846 Use it.
11847 * doc/bison.texinfo (Require Decl): New.
11848 (Calc++ Parser): Use %require.
11849
118502005-10-02 Akim Demaille <akim@epita.fr>
11851
11852 * data/location.cc: New.
11853
118542005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
11855 Akim Demaille <akim@epita.fr>
11856
11857 Make sure -odir/foo.cc creates dir/location.hh etc.
11858 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
11859 (spec_file_prefix, spec_verbose_file, spec_graph_file)
11860 (spec_defines_file): Now const.
11861 (dir_prefix): New.
11862 (short_base_name): Remove.
11863 * src/files.c: Adjust.
11864 (dirname.h): Include.
11865 (base_name): Don't prototype it.
11866 (finput): Remove, duplicates gram_in.
11867 (full_base_name, short_base_name): Replace by...
11868 (all_but_ext, all_but_tab_ext): these.
11869 (compute_base_names): Rename as...
11870 (compute_file_name_parts): this.
11871 Update to compute the new variables, including dir_prefix.
11872 Adjust dependencies.
11873 * src/output.c (prepare): Output them.
11874 * src/reader.c: Adjust to use gram_in, not finput.
11875 * src/scan-skel.l (@dir_prefix@): New.
11876
118772005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
11878
11879 * lib/subpipe.c: New function end_of_output_subpipe() added
11880 to allow support for non-posix systems. This is a no-op function
11881 for posix systems.
11882
11883 * lib/subpipe.h: New function end_of_output_subpipe() added
11884 to allow support for non-posix systems. This is a no-op function
11885 for posix systems.
11886
11887 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
11888 handle the lack of pipe/fork functionality on non-posix systems.
11889
11890 * djgpp/Makefile.maint: DJGPP specific file.
11891
11892 * djgpp/README.in: DJGPP specific file.
11893
11894 * djgpp/config.bat: DJGPP specific configuration file.
11895
11896 * djgpp/config.sed: DJGPP specific configuration file.
11897
11898 * djgpp/config.site: DJGPP specific configuration file.
11899
11900 * djgpp/config_h.sed: DJGPP specific configuration file.
11901
11902 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
11903
11904 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
11905
119062005-10-02 Akim Demaille <akim@epita.fr>
11907
11908 * data/location.cc: New, extract from...
11909 * data/lalr1.cc: here.
11910 (location.hh): Include it after the user prologue, in case the
11911 filename type is defined by the user.
11912 Forward declation location and position before the pre-prologue.
11913 (yyresult_): Rename as...
11914 (yyresult): this, it's a local variable, not an attribute.
11915 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
11916
119172005-10-01 Akim Demaille <akim@epita.fr>
11918
11919 * examples/extexi: Restore the #line generation.
11920
119212005-09-30 Akim Demaille <akim@epita.fr>,
11922 Alexandre Duret-Lutz <adl@gnu.org>
11923
11924 Move the token type and YYSTYPE in the parser class.
11925 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
11926 (parser::token): New, from the moved free definition of tokens.
11927 (parser::semantic_value): Now a full definition instead of an
11928 indirection to YYSTYPE.
11929 (b4_post_prologue): No longer included in the header file, but
11930 in the implementation file.
11931 * doc/bison.texi (C+ Language Interface): Update.
11932 * src/parse-gram.y: Support unary %define.
11933 * tests/actions.at: Define global_tokens_and_yystype for backward
11934 compatibility until we update the tests.
11935 * tests/calc.at: Idem.
11936 (first_line, first_column, last_line, last_column): Define for lalr1.cc
11937 to simplify the code.
11938
119392005-09-29 Paul Eggert <eggert@cs.ucla.edu>
11940
11941 Port to SunOS 4.1.4, which lacks strtoul and strerror.
11942 Ah, the good old days! Problem reported by Peter Klein.
11943 * bootstrap (gnulib_modules): Add strerror, strtoul.
11944 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
11945 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
11946
119472005-09-29 Akim Demaille <akim@epita.fr>
11948
11949 * data/c.m4 (b4_error_verbose_if): New.
11950 * data/lalr1.cc: Use it.
11951 (YYERROR_VERBOSE_IF): Remove.
11952 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
11953 parser members, replaced by...
11954 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
11955 local variables.
11956 (yysyntax_error_): Takes the state number as argument.
11957 (yyreduce_print_): Use the argument yyrule, not the former
11958 attribute yyn_.
11959
119602005-09-26 Paul Eggert <eggert@cs.ucla.edu>
11961
11962 * bootstrap (gnulib_modules): Add verify.
11963 * lib/.cvsignore: Add verify.h.
11964 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
11965 * src/system.h (verify): Remove.
11966 Include verify.h instead.
11967 * src/tables.c (tables_generate): Use new API for 'verify'.
11968
119692005-09-21 Paul Eggert <eggert@cs.ucla.edu>
11970
11971 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
11972 local variables whose names begin with 'yy'.
11973 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
11974 Trivial changes from Joel E. Denny.
11975
11976 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
11977 it itself.
11978 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
11979 don't use alloca any more.
11980
11981 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
11982 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
11983 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
11984 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
11985 to match yacc.c, to test more hosts.
11986
119872005-09-20 Paul Eggert <eggert@cs.ucla.edu>
11988
11989 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
11990 doesn't affect behavior.
11991 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
11992 Solaris, AIX, MSC.
11993 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
11994 This works a bit better with glibc, if user code has already included
11995 stdlib.h.
11996 * doc/bison.texinfo (Bison Parser): Document that users can't
11997 arbitrarily use malloc and free for other purposes. Document
11998 that <alloca.h> and <malloc.h> might be included.
11999 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
12000 user must declare alloca.
12001
12002 * HACKING (release): Forwarn the Translation Project about
12003 stable releses.
12004
120052005-09-20 Akim Demaille <akim@epita.fr>
12006
12007 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
12008
120092005-09-19 Paul Eggert <eggert@cs.ucla.edu>
12010
12011 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
12012 (YYSTACK_ALLOC_MAXIMUM): Use it.
12013 (yysyntax_error): New function.
12014 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
12015 multiple syntax errors are reported, and alloca is being used.
12016 Instead, reallocate buffers twice as big each time, so that
12017 we waste at most half the allocated memory. Start with a small
12018 (128-byte) buffer that will suffice in most cases anyway.
12019 Use yysyntax_error to do most of the work.
12020
12021 * doc/bison.texinfo (Error Reporting, Table of Symbols):
12022 yynerrs is the number of errors reported, not the number of
12023 errors encountered.
12024
12025 * tests/glr-regression.at (Duplicated user destructor for lookahead):
12026 Mark it as expected to fail.
12027 Cast result of malloc; problem reported by twlevo@xs4all.nl.
12028 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
12029 Don't start user-code symbols with "yy", to avoid name space problems.
12030
120312005-09-19 Akim Demaille <akim@epita.fr>
12032
12033 Remove the traits, failed experiment.
12034 It never proved useful, and anyway because of the current
12035 definition, it was not possible to have several specialization of
12036 this traits, making it useless.
12037 * data/lalr1.cc (yy:traits): Remove.
12038 Inline its definitions in the parser class.
12039
120402005-09-19 Akim Demaille <akim@epita.fr>
12041
12042 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
12043 least Mac OSX with a /usr/local install of gettext.
12044
120452005-09-19 Akim Demaille <akim@epita.fr>
12046
12047 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
12048 and yytoken for similarity with the other skeletons.
12049
120502005-09-19 Akim Demaille <akim@epita.fr>
12051
12052 * NEWS, configure.ac: update version number to 2.1a.
12053
120542005-09-16 Paul Eggert <eggert@cs.ucla.edu>
12055
12056 * NEWS: Version 2.1.
12057
12058 * NEWS: Remove notice of yytname change, since it was never in an
12059 official release.
12060 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
12061 diagnostic.
12062 * src/output.c (prepare): Likewise.
12063 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
12064 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
12065 is not defined. This is an awful hack, but it's enough for now.
12066 All callers changed.
12067 * tests/glr-regression-at (make_value): Args are const pointers now,
12068 to avoid GCC warning.
12069 (Duplicated user destructor for lookahead): New test. Currently
12070 skipped. It fails on my host but I'm not sure it'll always fail.
12071
120722005-09-16 Akim Demaille <akim@epita.fr>
12073
12074 * src/symtab.h (struct symbol): Declare the printer and destructor
12075 as const, to avoid accidental calls to free.
12076 (symbol_destructor_set, symbol_printer_set): Adjust.
12077 * src/symtab.c: Adjust.
12078
120792005-09-16 Akim Demaille <akim@epita.fr>
12080
12081 * data/c.m4 (b4_token_enums): New.
12082 (b4_token_defines): Rename as...
12083 (b4_token_enums_defines): this.
12084 (b4_token_defines): New, output only the #defines.
12085 * data/yacc.c, data/glr.c: Adjust.
12086 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
12087 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
12088 as default values.
12089
120902005-09-16 Akim Demaille <akim@epita.fr>
12091
12092 * data/lalr1.cc (yylex_): Remove, inline its code.
12093 (yyreport_syntax_error_): Remove, replaced by...
12094 (yysyntax_error_): this which returns a string and leaves to the
12095 caller the call to the users' error function.
12096 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
12097 Move from members of the parser object...
12098 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
12099 to local variables of the parse function.
12100
121012005-09-16 Akim Demaille <akim@epita.fr>
12102
12103 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
12104 since it's in Bison's name space.
12105
121062005-09-15 Paul Eggert <eggert@cs.ucla.edu>
12107
12108 * data/glr.c (yyresolveValue): Add default case to pacify
12109 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
12110
12111 * NEWS: Document when yyparse started to return 2.
12112 * doc/bison.texinfo (Parser Function): Document when yyparse
12113 returns 2.
12114
12115 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
12116 (b4_filename_type): Renamed back from b4_file_name_type. All uses
12117 changed.
12118 (class position): file_name -> filename (reverting). All uses changed.
12119
121202005-09-14 Paul Eggert <eggert@cs.ucla.edu>
12121
12122 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
12123 do anything if $@ exists. This reverts part of the 2005-07-07
12124 patch.
12125
121262005-09-11 Paul Eggert <eggert@cs.ucla.edu>
12127
12128 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
12129 contains obsolete information and isn't worth distributing as a
12130 separate file anyway.
12131 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
12132 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
12133 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
12134 (yyparse): Abort if user code uses longjmp to throw an unexpected
12135 value.
12136
121372005-09-09 Paul Eggert <eggert@cs.ucla.edu>
12138
12139 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
12140 Suggested by twlevo@xs4all.nl.
12141
12142 * data/glr.c (YYCHK1): Do not assume YYE is in range.
12143 This avoids a diagnostic from gcc -Wswitch-enum.
12144 Problem reported by twlevo@xs4all.nl.
12145
12146 * doc/bison.texinfo: Don't use "filename", as per GNU coding
12147 standards. Use "file name" or "file" or "name", depending on
12148 the context.
12149 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
12150 not to hack/foo.tab.c.
12151 (Calc++ Top Level): 2nd arg of main is not const.
12152 * data/glr.c: b4_filename -> b4_file_name.
12153 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
12154 All uses changed.
12155 (class position): filename -> file_name. All uses changed.
12156 * data/yacc.c: b4_filename -> b4_file_name.
12157 * lib/bitset.h: filename -> file_name in local vars.
12158 * lib/bitset_stats.c: Likewise.
12159 * src/files.c: Likewise.
12160 * src/scan-skel.l ("@output ".*\n): Likewise.
12161 * src/files.c (file_name_split): Renamed from filename_split.
12162 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
12163
121642005-09-08 Paul Eggert <eggert@cs.ucla.edu>
12165
12166 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
12167 to accommodate latest gnulib.
12168
12169 * tests/glr-regression.at (Duplicate representation of merged trees):
12170 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
12171
12172 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
12173 needed.
12174
121752005-08-26 Paul Eggert <eggert@cs.ucla.edu>
12176
12177 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
12178 All uses changed. Invoke user destructor after an error during a
12179 split parse (trivial change from Joel E. Denny).
12180
12181 * tests/glr-regression.at
12182 (User destructor after an error during a split parse): New test case.
12183 Problem reported by Joel E. Denny in:
12184 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
12185
121862005-08-25 Paul Eggert <eggert@cs.ucla.edu>
12187
12188 * README-cvs: Give URLs for recommended tools.
12189 Mention Gzip version problem, and bootstrapping issues.
12190 Remove troubleshooting section, as it's somewhat obsolete.
12191
12192 * bootstrap (no_cache): New var, to accommodate different wget
12193 variants. Use it instead of '-C off'. Problem reported by
12194 twlevo@xs4all.nl.
12195
12196 * data/glr.c (yydestroyStackItem): New function.
12197 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
12198 debugging information. Problem reported by Joel E. Denny.
12199
122002005-08-25 Akim Demaille <akim@epita.fr>
12201
12202 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
12203
122042005-08-24 Paul Eggert <eggert@cs.ucla.edu>
12205
12206 * data/glr.c (yyrecoverSyntaxError, yyreturn):
12207 Don't invoke destructor on unresolved entries.
12208 * tests/glr-regression.at
12209 (User destructor for unresolved GLR semantic value): New test case.
12210 Problem reported by Joel E. Denny in:
12211 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
12212
122132005-08-21 Paul Eggert <eggert@cs.ucla.edu>
12214
12215 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
12216 Add strnlen.c.
12217 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
12218 lib-prefix.m4, po.m4.
12219
12220 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
12221 in yydestruct diagnostic, since it might not be an error.
12222 Problem reported by Joel Denny near end of
12223 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
12224 * data/lalr1.cc (yyerturn): Likewise.
12225 * data/yacc.c (yyreturn): Likewise.
12226 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
12227
12228 * src/files.c: Remove obsolete FIXME comment.
12229
12230 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
12231 with the other templates, and to fix bogus run-on messages such
12232 as the one reported at the end of
12233 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
12234 All callers changed to avoid the newline.
12235 (yyprocessOneStack): Output two lines rather than one, to accommodate
12236 the above change. This changes the debug output format slightly.
12237
12238 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
12239 reported by Joel E. Denny in
12240 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
12241 (trivial change).
12242 * tests/glr-regression.at (Duplicate representation of merged trees):
12243 New test, from Joel E. Denny in:
12244 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
12245 * THANKS: Add Joel E. Denny.
12246
12247 * configure.ac (AC_INIT): Bump to 2.0c.
12248
122492005-07-24 Paul Eggert <eggert@cs.ucla.edu>
12250
12251 * NEWS: Version 2.0b.
12252
12253 * Makefile.am (SUBDIRS): Put examples before tests, so that
12254 "make check" doesn't finish with "All 1 tests passed".
12255
12256 * tests/regression.at (Token definitions): Don't rely on
12257 AT_PARSER_CHECK for data that contains backslashes. It currently
12258 uses 'echo', and 'echo' isn't portable if its argument contains
12259 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
12260 that the byte '\0xff' is not printable in the C locale; it is,
12261 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
12262 not printable, so use '\0x81' to test.
12263
12264 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
12265 version of GCC, since the macro is used with non-GCC compilers.
12266
12267 Fix core dump reported by Pablo De Napoli in
12268 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
12269 * tests/regression.at (Invalid inputs with {}): New test.
12270 * src/parse-gram.y (token_name): Translate type before using
12271 it as an index.
12272
12273 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
12274 the user's name space. All uses changed to __attribute__
12275 ((__unused__)).
12276 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
12277 Add __attribute__ ((__noreturn__)).
12278
12279 * etc/clcommit: Remove. We weren't using it, and it failed
12280 "make maintainer-distcheck".
12281 * Makefile.maint: Merge from coreutils.
12282 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
12283 (syntax-check-rules): Change list of rules as described below.
12284 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
12285 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
12286 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
12287 (sc_trailing_space): New rules.
12288 (sc_xalloc_h_in_src): Remove.
12289 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
12290 (sc_space_tab, sc_error_exit_success, sc_changelog):
12291 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
12292 (makefile-check, po-check, author_mark_check):
12293 (makefile_path_separator_check, copyright-check):
12294 Use grep -n, to make it easier to find violations.
12295 Use CVS_LIST and CVS_LIST_EXCEPT.
12296 (header_regexp, h_re): Remove.
12297 (dd_c): New macro.
12298 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
12299 (my-distcheck): Use more-modern GCC flags.
12300 (signatures, %.asc): Remove.
12301 (rel-files, announcement): Remove signatures.
12302 Restore old updating code, even though we don't use it, so
12303 that we're the same as coreutils.
12304 (alpha, beta, major): Depend on news-date-check.
12305 Make the upload commands.
12306
12307 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
12308 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
12309 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
12310 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
12311 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
12312 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
12313 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
12314 * tests/sets.at: Likewise.
12315
12316 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
12317 we comment out the Autoconf version number.
12318 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
12319 it's error-prone and "make maintainer-distcheck" rejects it.
12320
12321 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
12322 Indent calls to "error" to pacify "make maintainer-distcheck",
12323 when the calls are not intended to be translated.
12324 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
12325
12326 * src/Makefile.am (DEFS): Use +=, to pacify
12327 "make maintainer-distcheck".
12328 (bison_SOURCES): Add scan-skel.h.
12329 (sc_tight_scope): New rule, from coreutils.
12330
12331 * src/files.c (src_extension, header_extension):
12332 Now static, not extern.
12333 * src/getargs.c (short_options): Likewise.
12334 * src/muscle_tab.c (muscle_table): Likewise.
12335 * src/parse-gram.y (current_class, current_type, current_prec):
12336 Likewise.
12337 * src/reader.c (grammar_end, previous_rule_end): Likewise.
12338 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
12339 * src/main.c (main): Cast bindtextdomain and textdomain calls to
12340 void, to avoid warning when NLS is disabled.
12341 * src/output.c: Include scan-skel.h.
12342 (scan_skel): Remove decl, since scan-skel.h does this.
12343 (output_skeleton):
12344 Indent calls to "error" to pacify "make maintainer-distcheck".
12345 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
12346 * src/reader.h (gram_end, gram_lineno): New decls to pacify
12347 "make maintainer-distcheck".
12348 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
12349 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
12350 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
12351 (skel_lex_destroy, scan_skel): Move these decls to...
12352 * src/scan-skel.h: New file.
12353 * src/uniqstr.c (uniqstr_assert):
12354 Indent calls to "error" to pacify "make maintainer-distcheck".
12355
12356 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
12357 not @VAR@.
12358
12359 * tests/torture.at: Revamp to avoid misuse of atoi that
12360 "make maintainer-distcheck" complained about.
12361
12362 * examples/extexi (message): Don't print a message more than once,
12363 and omit line-number decoration that makes Emacs compile think
12364 that informative messages are worth worrying about.
12365
123662005-07-22 Paul Eggert <eggert@cs.ucla.edu>
12367
12368 * configure.ac: Update version number.
12369
12370 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
12371 accidentally.
12372 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
12373 autogenerated by the maintainer.
12374 * examples/calc++/.cvsignore: Add *.yy.
12375
12376 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
12377 * lib/bitset_stats.c (bitset_stats_init): Likewise.
12378 * lib/bitsetv.c (bitsetv_alloc): Likewise.
12379
12380 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
12381
12382 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
12383 from maintainer-distcheck about casting the argument of 'free'.
12384
12385 * NEWS: Mention recent yytname changes.
12386 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
12387
12388 * bootstrap: For translations that have not yet been upgraded to
12389 the new runtime-po domain, prime the pump by extracting the
12390 relevant strings from the obsolete translations. This code can be
12391 removed once the bison-runtime domain has been translated by each
12392 team.
12393
12394 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
12395 now that token names are already quoted.
12396
12397 Fix problem reported by Anthony Heading.
12398 * data/glr.c (YYTOKEN_TABLE): New macro.
12399 (yytname): Define if YYTOKEN_TABLE.
12400 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
12401 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
12402 (YYERROR_VERBOSE): Define the same way the other skeletons do.
12403 * src/output.c (prepare_symbols): Output token_table_flag.
12404
124052005-07-21 Paul Eggert <eggert@cs.ucla.edu>
12406
12407 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
12408 again if the first call fails.
12409
12410 * data/glr.c (yytnamerr): New function.
12411 (yyreportSyntaxError): Use it to dequote most string literals.
12412 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
12413 with other skeletons. All uses changed.
12414 (yytnameerr_): New function.
12415 (yyreport_syntax_error): Use it to dequote most string literals.
12416 * data/yacc.c (yytnamerr): New function.
12417 (yyerrlab): Use it to decode most string literals.
12418 * doc/bison.texinfo (Decl Summary, Calling Convention):
12419 Clarify quoting convention of yytname.
12420 * src/output.c (prepare_symbols): Quote all names. This undoes
12421 the 2005-04-17 change, which is now accomplished (mostly) via
12422 changes in the parsers as described above.
12423 * tests/regression.at (Token definitions, Web2c Actions):
12424 Undo most 2005-04-17 change here, too.
12425
124262005-07-20 Paul Eggert <eggert@cs.ucla.edu>
12427
12428 Fix more problems reported by twlevo@xs4all.nl.
12429 * tests/cxx-type.at: Don't pipe output of ./types through sed to
12430 remove trailing spaces. This loses the exit status of ./types,
12431 and isn't needed since ./types shouldn't be emitting trailing
12432 spaces.
12433 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
12434 as the stack isn't valid in that case.
12435
12436 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
12437 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
12438 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
12439 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
12440 is used.
12441 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
12442 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
12443 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
12444 Likewise.
12445
12446 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
12447 overly-picky compilers that reject 'char *foo = "bar";'.
12448
12449 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
12450 to FILE * parameter, not to stderr. This fixes a typo introduced
12451 in the 2005-07-12 change.
12452
12453 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
12454 warnings from GCC 4.
12455
12456 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
12457 (yyglrShiftDefer, yysplitStack):
12458 Remove unused parameters b4_pure_formals. All uses changed.
12459 (yyglrShift): Remove unused parameters b4_user_formals.
12460 All uses changed.
12461 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
12462
124632005-07-18 Paul Eggert <eggert@cs.ucla.edu>
12464
12465 Destructor cleanups and regularization among the three skeletons.
12466 * NEWS: Document the behavior changes.
12467 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
12468 stack before failing, as the cleanup code will do it for us now.
12469 * data/lalr1.cc (yyerrlab): Likewise.
12470 * data/glr.c (yyparse): Pop everything off the stack before
12471 freeing it, so that destructors get called properly.
12472 * data/lalr1.cc (yyreturn): Likewise.
12473 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
12474 This is more consistent.
12475 * doc/bison.texinfo (Destructor Decl): Mention more reasons
12476 why destructors might be called. 1.875 -> 2.1.
12477 (Destructor Decl, Decl Summary, Table of Symbols):
12478 Some English-language cleanups for %destructor.
12479 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
12480 Add output line for destructor of start symbol.
12481 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
12482 because of that same extra output line.
12483
12484 * NEWS: Document minor wording changes in diagnostics of
12485 Bison-generated parsers.
12486 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
12487 Remove unused formals. All uses changed.
12488 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
12489 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
12490 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
12491 Rename yyoverflowab to yyexhaustedlab.
12492 When memory exhaustion occurs during syntax-error reporting,
12493 report it separately rather than in a single diagnostic; this
12494 eases translation.
12495 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
12496 (Memory Exhausted): Renamed from Parser Stack Overflow.
12497 Revamp wording slightly to prefer "memory exhaustion".
12498 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
12499
12500 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
12501
12502 Add i18n support to the GLR skeleton. Partially fix the C++
12503 skeleton; a C++ expert needs to finish this. Remove debugging
12504 msgids; there's little point to having them translated, since they
12505 can be understood only by someone who can read the
12506 (English-language) source code.
12507
12508 Generate runtime-po/bison-runtime.pot automatically, so that we
12509 don't have to worry about garbage getting in that file. We'll
12510 make sure after the next official release that old msgids don't
12511 get lost. See
12512 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
12513
12514 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
12515 Now auto-generated.
12516 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
12517 Fix typos in explanations of the runtime file.
12518 * bootstrap: Change gettext keyword from YYI18N to YY_.
12519 Use standard Makefile.in.in in runtime-po, since we'll arrange
12520 for backward-compatible bison-runtime.po files in a different way.
12521 * data/glr.c (YY_): New macro, from yacc.c.
12522 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
12523 Translate messages intended for users.
12524 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
12525 the wording in the other skeletons. We don't know that the memory
12526 is virtual.
12527 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
12528 Use same method that yacc.c uses.
12529 Don't translate debugging messages.
12530 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
12531 it doesn't work (yet), and requires C++ expertise to fix.
12532 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
12533 Move defn to a more logical place, to be consistent with other
12534 skeletons.
12535 Don't translate debugging messages.
12536 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
12537 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
12538 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
12539 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
12540
12541 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
12542 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
12543 void, not int.
12544 * tests/glr-regression.at (Badly Collapsed GLR States):
12545 Likewise.
12546 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
12547 yylex should return 0 at EOF rather than aborting.
12548
12549 Improve tests for stack overflow in GLR parser.
12550 Problem reported by twlevo@xs4all.nl.
12551 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
12552 All uses removed.
12553 (yyStackOverflow): Just longjmp, but with value 2 so that caller
12554 can handle the problem.
12555 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
12556 (yyparse): New local variable yyresult to record the result.
12557 Use result of setjmp to set it, rather than storing itinto
12558 struct.
12559 (yyDone): Remove label.
12560 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
12561 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
12562 if YYABORT is used).
12563 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
12564 yyparse status; put status > 1 into diagnostic.
12565 Check that status==2 works.
12566 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
12567 Use exit status 3 for failure to open (which shouldn't happen).
12568
125692005-07-17 Paul Eggert <eggert@cs.ucla.edu>
12570
12571 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
12572 1 on syntax error; just let yyparse do its thing.
12573 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
12574 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
12575 (Exploding the Stack Size with Alloca):
12576 (Exploding the Stack Size with Malloc):
12577 Expect exit status 2, not 1, since the parser is supposed to blow
12578 its stack. Problem reported by twlevo@xs4all.nl.
12579
12580 * data/glr.c (yyparse): Don't assume that the initial calls
12581 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
12582 Print a stack-overflow message and fail instead.
12583 Initialize the line-number information before creating the stack,
12584 so that the stack-overflow message can report line zero safely.
12585
125862005-07-14 Paul Eggert <eggert@cs.ucla.edu>
12587
12588 Fix problems reported by twlevo@xs4all.nl.
12589 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
12590 (yyuserMerge): Provide a default case if b4_mergers is empty.
12591 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
12592 * tests/glr-regression.at
12593 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
12594 Add casts to pacify C++ compilers.
12595 * tests/glr-regression.at (Improper merging of GLR delayed action
12596 sets): Declare yylex before using it.
12597 * tests/Makefile.am (maintainer-check-g++): Fix a stray
12598 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
12599 test for valgrind; valgrind is independent of g++.
12600 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
12601 for compatibility with POSIX 1003.1-2001 (if running coreutils).
12602 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
12603 Use a destructor, so that we can expand the stack. Change
12604 YYSTYPE to char * so that we can free it. Cast result of malloc.
12605
126062005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12607
12608 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
12609 a valgrind failure. Problem reported by twlevo@xs4all.nl.
12610
126112005-07-13 Paul Eggert <eggert@cs.ucla.edu>
12612
12613 * PACKAGING: New file, suggested by Bruno Haible and taken from
12614 similar wording in gettext's PACKAGING file.
12615 * NEWS: Mention PACKAGING.
12616 * Makefile.am (EXTRA_DIST): Add PACKAGING.
12617
126182005-07-12 Paul Eggert <eggert@cs.ucla.edu>
12619
12620 * NEWS: Document recent i18n improvements.
12621 * bootstrap: Get runtime translations into runtime-po.
12622 Create runtime-po files automatically, if possible.
12623 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
12624 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
12625 does not infringe on the user's name space.
12626 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
12627 * doc/bison.texinfo (Internationalization): Revamp the English
12628 and Texinfo syntax a bit, to try to make it clearer.
12629 (Bison Options, Option Cross Key): Mention --print-localedir.
12630 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
12631 YYENABLE_NLS. Quote a bit more.
12632 * runtime-po/.cvsignore: New file.
12633 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
12634 * runtime-po/Rules-quot: Remove; now created by bootstrap.
12635 * runtime-po/quot.sed: Likewise.
12636 * runtime-po/boldquot.sed: Likewise.
12637 * runtime-po/en@quot.header: Likewise.
12638 * runtime-po/en@boldquot.header: Likewise.
12639 * runtime-po/insert-header.sin: Likewise.
12640 * runtime-po/remove-potcdate.sin: Likewise.
12641 * runtime-po/Makevars: Likewise.
12642 * runtime-po/LINGUAS: Likewise.
12643 * runtime-po/de.po: Likewise; we will rely on the translation project
12644 to maintain this, so "bootstrap" should get it.
12645 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
12646 its value.
12647 * src/main.c (main): Bind the bison-runtime domain, too.
12648
126492005-07-12 Bruno Haible <bruno@clisp.org>
12650
12651 * data/yacc.c: Include <libintl.h> when NLS is enabled.
12652 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
12653 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
12654 * runtime-po: New directory.
12655 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
12656 $(DOMAIN).pot-update rule, so that old messages are never dropped.
12657 * runtime-po/Rules-quot: New file, copied from po/.
12658 * runtime-po/quot.sed: Likewise.
12659 * runtime-po/boldquot.sed: Likewise.
12660 * runtime-po/en@quot.header: Likewise.
12661 * runtime-po/en@boldquot.header: Likewise.
12662 * runtime-po/insert-header.sin: Likewise.
12663 * runtime-po/remove-potcdate.sin: Likewise.
12664 * runtime-po/Makevars: New file.
12665 * runtime-po/POTFILES.in: New file.
12666 * runtime-po/LINGUAS: New file.
12667 * runtime-po/bison-runtime.pot: New file.
12668 * runtime-po/de.po: New file.
12669 * m4/bison.m4: New file.
12670 * Makefile.am (SUBDIRS): Add runtime-po.
12671 (aclocaldir, aclocal_DATA): New variables.
12672 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
12673 Define aclocaldir.
12674 * src/getargs.c (usage): Document --print-localedir option.
12675 (PRINT_LOCALEDIR_OPTION): New enum item.
12676 (long_options): Add --print-localedir option.
12677 (getargs): Handle --print-localedir option.
12678 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
12679 (Internationalization): New section.
12680
126812005-07-12 Akim Demaille <akim@epita.fr>
12682
12683 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
12684 for consistency with the rest of the code.
12685 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
12686 Add separators.
12687
126882005-07-12 Akim Demaille <akim@epita.fr>
12689
12690 * src/parse-gram.y: Use %printer instead of YYPRINT.
12691
126922005-07-12 Akim Demaille <akim@epita.fr>
12693
12694 * src/symtab.h, src/symtab.c (symbol_print): New.
12695 * src/symlist.h, src/symlist.c (symbol_list_print): New.
12696 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
12697
126982005-07-12 Akim Demaille <akim@epita.fr>
12699
12700 * data/glr.c (b4_syncline): Fix (swap) the definitions of
12701 b4_at_dollar and b4_dollar_dollar.
12702
127032005-07-11 Paul Eggert <eggert@cs.ucla.edu>
12704
12705 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
12706 and Pennello's paper.
12707
127082005-07-09 Paul Eggert <eggert@cs.ucla.edu>
12709
12710 * data/yacc.c (yyparse): Undo previous patch. Instead,
12711 set yylsp[0] and yyvsp[0] only if the initial action
12712 sets yylloc and yylval, respectively.
12713
12714 * data/yacc.c (yyparse): In the initial action, set
12715 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
12716 This avoids the use of undefined variables if the initial
12717 action does not set yylloc and/or yylval.
12718
127192005-07-07 Paul Eggert <eggert@cs.ucla.edu>
12720
12721 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
12722 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
12723 Remove from CVS. These files are automatically generated.
12724 * examples/extexi: Clarify that this file is now part of Bison,
12725 not GNU M4, and that it works with any POSIX-compatible Awk.
12726 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
12727 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
12728 so that we also get calc++-parser.yy. Geneate it.
12729 Use $(AWK), not gawk, since any conforming Awk will do.
12730 Put comment before action, since older 'make' can't handle comment
12731 in action.
12732 $(BUILT_SOURCES): List all built sources, not just some of them.
12733 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
12734 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
12735 $($(calc_sources_generated)): Remove unnecessary test for existence
12736 of target. (This had a shell syntax error anyway; a stray "x".)
12737 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
12738 calc++-parser.yy.
12739 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
12740
12741 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
12742 implied by the other modules.
12743
127442005-07-06 Akim Demaille <akim@epita.fr>
12745
12746 Bind examples/calc++ to the package.
12747 * examples/calc++/Makefile: Remove, replaced by...
12748 * examples/calc++/Makefile.am: ... this new file.
12749 * examples/calc++/test: Remove input.
12750 * examples/calc++/compile: Remove.
12751 * examples/Makefile.am: New.
12752 * configure.ac, Makefile.am: Adjust.
12753 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
12754
127552005-07-05 Paul Eggert <eggert@cs.ucla.edu>
12756
12757 * data/glr.c (yyFail): Drastically simplify; since the format argument
12758 never had any % directives, we can simply pass it to yyerror.
12759 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
12760 be modified later, as that is the usual style in glr.c.
12761 Problems reported by Paul Hilfinger.
12762
12763 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
12764 and size overflow errors.
12765 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
12766 in case the user prolog sets feature-test macros like _GNU_SOURCE.
12767 (YYSIZEMAX): New macro.
12768 (yystpcpy): New function, taken from yacc.c.
12769 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
12770 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
12771 so that we don't have to maintain their signatures.
12772 (yyFail): Check for buffer overflow, by using vsnprintf rather
12773 than vsprintf. Allocate a bigger buffer if possible.
12774 Report an error if buffer allocation fails.
12775 (yyStackOverflow): New function.
12776 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
12777 the initialization was successful. It might fail if storage was
12778 exhausted.
12779 (yyexpandGLRStack): Add more checks for storage allocation failure.
12780 Use yyStackOverflow to report failures.
12781 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
12782 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
12783 Don't assume stack number fits in int.
12784 (yysplitStack): Check for storage allocation failure.
12785 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
12786 can print diagnostics on storage allocation failure. All callers
12787 changed.
12788 (yyresolveValue): Use yybool for boolean.
12789 (yyreportSyntaxError): Check for size-calculation overflow.
12790 This code is taken from yacc.c.
12791 (yyparse): Check for storage allocation errors when allocating
12792 the initial stack.
12793
127942005-07-05 Akim Demaille <akim@epita.fr>
12795
12796 Extract calc++ from the documentation.
12797 * doc/bison.texinfo (Calc++): Add the extraction marks.
12798 * examples/extexi: New, from the aborted GNU Programming 2E.
12799 Separate the different paragraph of a file with empty lines.
12800 * examples/Makefile: Use it to extract the whole calc++ example.
12801
128022005-06-24 Akim Demaille <akim@epita.fr>
12803
12804 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
12805 class typedefs.
12806
128072005-06-22 Akim Demaille <akim@epita.fr>
12808
12809 * doc/bison.texinfo (C++ Language Interface): First stab.
12810 (C++ Parsers): Remove.
12811
128122005-06-22 Akim Demaille <akim@epita.fr>
12813
12814 * data/lalr1.cc (yylex_): Honor %lex-param.
12815
128162005-06-22 Akim Demaille <akim@epita.fr>
12817
12818 Start a set of simple examples.
12819 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
12820 * examples/calc++/calc++-driver.hh,
12821 * examples/calc++/calc++-parser.yy,
12822 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
12823 * examples/calc++/compile, examples/calc++/test: New.
12824
128252005-06-09 Paul Eggert <eggert@cs.ucla.edu>
12826
12827 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
12828 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
12829 which stems from the 2005-05-27 patch.
12830
128312005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
12832
12833 * data/glr.c: Modify treatment of unused parameters to permit use
12834 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
12835
128362005-05-30 Paul Eggert <eggert@cs.ucla.edu>
12837
12838 Fix infringement on user name space reported by Janos Zoltan Szabo.
12839 * data/yacc.c (yyparse): strlen -> yystrlen.
12840
128412005-05-30 Akim Demaille <akim@epita.fr>
12842
12843 * data/lalr1.cc (_): New.
12844 Translate the various messages.
12845
128462005-05-27 Paul Eggert <eggert@cs.ucla.edu>
12847
12848 Fix infringement on user name space reported by Bruno Haible.
12849 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
12850 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
12851 the user's name space.
12852 (alloca): Include <stdlib.h> to get it, if it's not built in.
12853 (YYMALLOC, YYFREE): Define only if needed.
12854 (malloc, free): Declare, but only if needed, as this infringes on
12855 the user name space.
12856
128572005-05-25 Paul Eggert <eggert@cs.ucla.edu>
12858
12859 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
12860 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
12861 with %d format.
12862 * lib/ebitset.c (min, max): Undef before defining.
12863 * lib/vbitset.c (min, max): Likewise.
12864 * lib/subpipe.c (create_subpipe): Save local variables in case
12865 vfork clobbers them.
12866
128672005-05-24 Bruno Haible <bruno@clisp.org>
12868
12869 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
12870 error message syntax used by gcc-4.0.
12871
128722005-05-23 Paul Eggert <eggert@cs.ucla.edu>
12873
12874 * README: Mention m4 1.4.3. Remove obsolete advice about
12875 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
12876
12877 * bootstrap: Remove workaround for problem I encountered with
12878 gettext 0.14.1; it seems to be fixed now.
12879
128802005-05-22 Paul Eggert <eggert@cs.ucla.edu>
12881
12882 * NEWS: Version 2.0a.
12883
12884 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
12885 the previous change.
12886
12887 Various maintainer cleanups.
12888 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
12889 conftest*, for benefit of CVS commands run at the same time as
12890 "configure". Add build-aux, since "bootstrap" now creates it and
12891 its subfiles.
12892 * Makefile.cfg (move_if_change): Remove.
12893 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
12894 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
12895 (po_repo, do-po-update, po-update, wget_files, get-targets):
12896 (config.guess-url_prefix, config.sub-url_prefix):
12897 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
12898 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
12899 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
12900 Remove.
12901 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
12902 this is now the recommended name.
12903 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
12904 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
12905 ylwrap. These files now go into build-aux.
12906 * config/move-if-change: Remove.
12907 * config/prev-version.txt: Bump from 1.75 to 2.0.
12908
12909 * bootstrap: Add stdio-safer, unistd-safer modules.
12910 Remove m4/glibc2.m4 (introduced by latest gnulib, but
12911 we don't need it).
12912 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
12913 fopen-safer.c, stdio-safer.h, unistd-safer.h.
12914 * lib/subpipe.c: Include "unistd-safer.h".
12915 (create_subpipe): Make sure all the newly-created
12916 file descriptors are > 2, so that diagnostics don't
12917 get sent down them (which might cause Bison to hang, in theory).
12918 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
12919 * src/files.c (xfopen): Use fopen_safer, not fopen.
12920
12921 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
12922 yesterday's yacc.c fix.
12923
129242005-05-21 Paul Eggert <eggert@cs.ucla.edu>
12925
12926 * data/glr.c, data/lalr1.cc: Update copyright date.
12927
12928 Fix a destructor bug reported by Wolfgang Spraul in
12929 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
12930 * data/yacc.c (yyabortlab): Don't call destructor, and
12931 don't set yychar to EMPTY.
12932 (yyoverflowlab): Don't call destructor.
12933 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
12934 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
12935 since we no longer output the message "discarding lookahead token
12936 end of input ()".
12937
129382005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12939
12940 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
12941 fix a small glitch in debugging output.
12942 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
12943 after YY_SYMBOL_PRINT where needed.
12944
12945 (struct yyGLRState): Add some comments.
12946 (struct yySemanticOption): Add some comments.
12947 (union yyGLRStackItem): Add comment.
12948
12949 (yymergeOptionSets): Correct this to properly perform the union,
12950 avoiding infinite reported by Michael Rosien.
12951 Update comment.
12952
12953 * tests/glr-regression.at: Add test for GLR merging error reported
12954 by M. Rosien.
12955
129562005-05-13 Paul Eggert <eggert@cs.ucla.edu>
12957
12958 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
12959 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
12960 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
12961 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
12962 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
12963 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
12964 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
12965 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
12966 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
12967 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
12968 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
12969 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
12970 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
12971 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
12972 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
12973 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
12974 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
12975 src/derives.h, src/files.c, src/files.h, src/getargs.c,
12976 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
12977 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
12978 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
12979 src/output.h, src/parse-gram.c, src/parse-gram.h,
12980 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
12981 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
12982 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
12983 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
12984 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
12985 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
12986 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
12987 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
12988 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
12989 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
12990 tests/reduce.at, tests/regression.at, tests/sets.at,
12991 tests/synclines.at, tests/testsuite.at, tests/torture.at:
12992 Update FSF postal mail address.
12993
129942005-05-11 Paul Eggert <eggert@cs.ucla.edu>
12995
12996 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
12997 Problem reported by Ralf Menzel.
12998
129992005-05-01 Paul Eggert <eggert@cs.ucla.edu>
13000
13001 * tests/actions.at: Test that stack overflow invokes destructors.
13002 From Marcus Holland-Moritz.
13003 * data/yacc.c (yyerrlab): Move the code that destroys the stack
13004 from here....
13005 (yyreturn): to here. That way, destructors are called properly
13006 even if the stack overflows, or the user calls YYACCEPT or
13007 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
13008 (yyoverflowlab): Destroy the lookahead.
13009
130102005-04-24 Paul Eggert <eggert@cs.ucla.edu>
13011
13012 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
13013
130142005-04-17 Paul Eggert <eggert@cs.ucla.edu>
13015
13016 * NEWS: Bison-generated C parsers no longer quote literal strings
13017 associated with tokens.
13018 * src/output.c (prepare_symbols): Don't escape strings,
13019 since users don't want to see C escapes.
13020 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
13021 in diagnostics.
13022 * tests/input.at (Torturing the Scanner): Likewise.
13023 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
13024
130252005-04-16 Paul Eggert <eggert@cs.ucla.edu>
13026
13027 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
13028 the data size is known to be too small and we can't increase it.
13029 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
13030
130312005-04-15 Paul Eggert <eggert@cs.ucla.edu>
13032
13033 * src/parse-gram.y: Include quotearg.h.
13034 (string_as_id): Quote $1 before using it as a key, since the
13035 lexer no longer quotes it for us.
13036 (string_content): Don't strip quotes, since lexer no longer
13037 quotes it for us.
13038 * src/scan-gram.l: Include quotearg.h.
13039 ("\""): Omit quote.
13040 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
13041 a key, since the rest of the lexer doesn't quote it.
13042 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
13043 * tests/regression.at (Token definitions): Check for backslashes
13044 in token strings.
13045
13046 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
13047 (YYSIZE_T): Define to unsigned long int when using an older compiler.
13048 (yyparse): Revamp code to generate long syntax error message, to
13049 make it easier to translate, and to avoid problems with arithmetic
13050 overflow. Change "virtual memory" to "memory" in diagnostic, since
13051 we don't know whether the memory is virtual.
13052
130532005-04-13 Paul Eggert <eggert@cs.ucla.edu>
13054
13055 * NEWS: Bison-generated C parsers now use the _ macro to
13056 translate strings.
13057 * data/yacc.c (_) [!defined _]: New macro.
13058 All English strings wrapped inside this macro.
13059 * doc/bison.texinfo (Bison Parser): Document _.
13060 * po/POTFILES.in: Include src/parse-gram.c, since it now
13061 includes translateable strings that parse-gram.y doesn't.
13062
130632005-04-12 Paul Eggert <eggert@cs.ucla.edu>
13064
13065 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
13066 reverting the 2004-10-11 change to this function.
13067 (symbol_check_alias_consistency): Don't call symbol_type_set
13068 if the type name is already correct.
13069 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
13070
130712005-03-25 Paul Eggert <eggert@cs.ucla.edu>
13072
13073 * tests/regression.at (Token definitions): Don't use a token named
13074 c, as that generates a "#define c ..." that runs afoul of buggy
13075 stdlib.h that uses the identifier c as a member of struct
13076 drand48_data. Problem reported by Horst Wente.
13077
130782005-03-21 Paul Eggert <eggert@cs.ucla.edu>
13079
13080 * bootstrap: Change translation URL from
13081 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
13082 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
13083 redirection glitches. Problem reported by twlevo@xs4all.nl.
13084
130852005-03-20 Paul Eggert <eggert@cs.ucla.edu>
13086
13087 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
13088 after operands; POSIX says this isn't portable for the c99 command.
13089
130902005-03-18 Paul Eggert <eggert@cs.ucla.edu>
13091
13092 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
13093 immediately if a data overrun has occurred; this may help us track
13094 down what may be a spurious failure on MacOS.
13095
130962005-03-17 Paul Eggert <eggert@cs.ucla.edu>
13097
13098 Respond to problems reported by twlevo@xs4all.nl.
13099
13100 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
13101
13102 * src/vcg.h: Comment fix.
13103 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
13104 (G_CMAX): Change to -1 instead of INT_MAX.
13105
13106 * data/yacc.c (yyparse): Omit spaces before #line.
13107
131082005-03-15 Paul Eggert <eggert@cs.ucla.edu>
13109
13110 * src/tables.c (state_number_to_vector_number): Put it inside an
13111 "#if 0", since it's not currently used. Problem reported by
13112 Roland McGrath.
13113
131142005-03-06 Paul Eggert <eggert@cs.ucla.edu>
13115
13116 * src/output.c (escaped_output): Renamed from
13117 escaped_file_name_output, since we now use it for symbol tags as
13118 well. All uses changed.
13119 (symbol_destructors_output, symbol_printers_output):
13120 Escape symbol tags too.
13121 Problem reported by Matyas Forstner in
13122 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
13123
13124 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
13125 not needed.
13126 * src/output.c (user_actions_output, token_definitions_output,
13127 symbol_destructors_output, symbol_printers_output): Likewise.
13128 * src/reader.c (prologue_augment): Likewise.
13129 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
13130
13131 * src/vcg.c (output_edge): Don't quote linestyle arg.
13132 Problem reported by twlevo@xs4all.nl.
13133
131342005-02-28 Paul Eggert <eggert@cs.ucla.edu>
13135
13136 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
13137 example, reported by Derek M Jones. Also, make the example even
13138 more outrageous, to better illustrate how bad the problem is.
13139
131402005-02-24 Paul Eggert <eggert@cs.ucla.edu>
13141
13142 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
13143 putsym. Typo reported by Sebastian Piping.
13144
131452005-02-23 Paul Eggert <eggert@cs.ucla.edu>
13146
13147 * doc/bison.texinfo (Language and Grammar): some -> same
13148 (Epilogue): int he -> in the
13149 Typos reported by Sebastian Piping via Justin Pence.
13150
131512005-02-07 Paul Eggert <eggert@cs.ucla.edu>
13152
13153 * tests/glr-regression.at (Improper handling of embedded actions
13154 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
13155 embedded actions and $-N in GLR parsers", work around an Autoconf bug
13156 with dollar signs in test names.
13157 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
13158 for a similar reason.
13159
131602005-01-28 Paul Eggert <eggert@cs.ucla.edu>
13161
13162 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
13163 wants to redefine G_VIEW.
13164
131652005-01-27 Paul Eggert <eggert@cs.ucla.edu>
13166
13167 * src/vcg.c (get_view_str): Remove case for normal_view.
13168 Problem reported by twlevo@xs4all.nl.
13169
131702005-01-24 Paul Eggert <eggert@cs.ucla.edu>
13171
13172 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
13173 Problem reported by twlevo@xs4all.nl.
13174
13175 * doc/bison.texinfo: Change @dircategory from "GNU programming
13176 tools" to "Software development". Requested by Richard Stallman
13177 via Karl Berry.
13178
131792005-01-23 Paul Eggert <eggert@cs.ucla.edu>
13180
13181 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
13182 Problem reported by twlevo@xs4all.nl.
13183
131842005-01-21 Paul Eggert <eggert@cs.ucla.edu>
13185
13186 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
13187 keyword; it's not needed with modern compilers, and it doesn't
13188 affect correctness with older compilers. Suggested by
13189 twlevo@xs4all.nl.
13190
131912005-01-17 Paul Eggert <eggert@cs.ucla.edu>
13192
13193 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
13194 gcc -Wswitch-default.
13195 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
13196 * data/yacc.c (yyparse): Likewise.
13197
131982005-01-12 Paul Eggert <eggert@cs.ucla.edu>
13199
13200 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
13201 already. Let config.h define any nonstandard values.
13202
132032005-01-10 Paul Eggert <eggert@cs.ucla.edu>
13204
13205 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
13206 for the benefit of slower hosts. Problem reported by
13207 Nelson H. F. Beebe.
13208
132092005-01-07 Paul Eggert <eggert@cs.ucla.edu>
13210
13211 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
13212 being defined and not used.
13213 * data/lalr1.cc (yyparse): Likewise.
13214 Use "if (false)" rather than "if (0)".
13215
132162005-01-05 Paul Eggert <eggert@cs.ucla.edu>
13217
13218 * TODO: Mention that we should allow NUL bytes in tokens.
13219
132202005-01-02 Paul Eggert <eggert@cs.ucla.edu>
13221
13222 * src/scan-skel.l (<<EOF>>): Don't close standard output.
13223 Problem reported by Hans Aberg.
13224
132252005-01-01 Paul Eggert <eggert@cs.ucla.edu>
13226
13227 * src/getargs.c (version): Happy new year; update overall
13228 program copyright date from 2004 to 2005.
13229
13230 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
13231 Problem reported by Hans Aberg.
13232 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
13233 (Output file names.): Add a test for the case when standard output
13234 is closed.
13235
132362004-12-26 Paul Eggert <eggert@cs.ucla.edu>
13237
13238 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
13239 to fix an oversight in the Bison 2.0 manual.
13240
132412004-12-25 Paul Eggert <eggert@cs.ucla.edu>
13242
13243 * NEWS: Version 2.0. Reformat the existing news items since
13244 1.875, so that related items are grouped together.
13245 * configure.ac (AC_INIT): Bump version to 2.0.
13246 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
13247
13248 * tests/torture.at (Exploding the Stack Size with Alloca): Set
13249 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
13250 otherwise, we're not testing alloca. Unfortunately there's no
13251 simple way to consult HAVE_ALLOCA here.
13252
13253 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
13254 for yymsg, too.
13255
13256 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
13257 hand. This avoids a warning about comparing int to size_t when
13258 GCC warnings are enabled.
13259
132602004-12-22 Paul Eggert <eggert@cs.ucla.edu>
13261
13262 * NEWS: Bison-generated parsers no longer default to using the
13263 alloca function (when available) to extend the parser stack, due
13264 to widespread problems in unchecked stack-overflow detection.
13265 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
13266 responsibility to set it to a positive value. This lets the user
13267 specify a value that is not a preprocessor constant.
13268 * data/yacc.c (YYMAXDEPTH): Likewise.
13269 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
13270 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
13271 to be a compile-time constant. However, explain the constraints on it.
13272 Also, explain the constraints on YYINITDEPTH.
13273 (Table of Symbols): Explain that alloca is no longer the default.
13274 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
13275 to 1.
13276
13277 * doc/bison.texinfo (Location Default Action): Mention that n must
13278 be zero when k is zero. Suggested by Frank Heckenbach.
13279
132802004-12-22 Akim Demaille <akim@epita.fr>
13281
13282 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
13283 (parser::state_type, parser::semantic_type, parser::location_type):
13284 Private, not public.
13285 (parser::parse): Return ints, not bool.
13286 Returning a bool introduces a problem: 0 corresponds to false, and
13287 it seems weird to return false on success. Returning true changes
13288 the conventions for yyparse.
13289 Alternatively we could return void and send an exception.
13290 There is no clear consensus (yet?).
13291 (state_stack, semantic_stack, location_stack): Rename as...
13292 (state_stack_type, semantic_stack_type, location_stack_type): these.
13293 Private, not public.
13294 * tests/c++.at: New.
13295 * tests/testsuite.at, tests/Makefile.am: Adjust.
13296
132972004-12-21 Akim Demaille <akim@epita.fr>
13298
13299 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
13300
133012004-12-21 Akim Demaille <akim@epita.fr>
13302
13303 Don't impose std::string for filenames.
13304
13305 * data/lalr1.cc (b4_filename_type): New.
13306 (position::filename): Use it.
13307 (parser.hh): Move the inclusion of stack.hh and location.hh below
13308 the user code, so that needed headers for the filename type can be
13309 included first.
13310 Forward declare them before the user code.
13311 * tests/Makefile.am (check-local, installcheck-local): Pass
13312 TESTSUITEFLAGS to the TESTSUITE.
13313
133142004-12-20 Akim Demaille <akim@epita.fr>
13315
13316 Use more STL like names: my_class instead of MyClass.
13317
13318 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
13319 (SemanticStack, SemanticType, StateStack, StateType)
13320 (TokenNumberType, Stack, Slice, Traits, Parser::location)
13321 (Parser::value): Rename as...
13322 (location_stack, location_type, rhs_number_type, semantic_stack)
13323 (semantic_type, state_stack, state_type, token_number_type, stack)
13324 (slice, traits, parser::yylloc, parser::yylval): these.
13325
13326 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
13327
133282004-12-19 Paul Eggert <eggert@cs.ucla.edu>
13329
13330 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
13331 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
13332
133332004-12-17 Paul Eggert <eggert@cs.ucla.edu>
13334
13335 Remove uses of 'short int' and 'unsigned short int'. This raises
13336 some arbitrary limits. It uses more memory but nowadays that's
13337 not much of an issue.
13338
13339 This change does not affect the generated parsers; that's a different
13340 task, as some users will want to conserve memory there.
13341
13342 Ideally we should use size_t to represent all object counts, and
13343 something like ptrdiff_t to represent signed differences of object
13344 counts; but that will require more code-cleanup than I have the
13345 time to do right now.
13346
13347 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
13348 Use size_t, not int or short int, to count objects.
13349 * src/closure.c (nritemset, closure): Likewise.
13350 * src/closure.h (nritemset, closure): Likewise.
13351 * src/nullable.c (nullable_compute): Likewise.
13352 * src/print.c (print_core): Likewise.
13353 * src/print_graph.c (print_core): Likewise.
13354 * src/state.c (state_compare, state_hash): Likewise.
13355 * src/state.h (struct state): Likewise.
13356 * src/tables.c (default_goto, goto_actions): Likewise.
13357
13358 * src/gram.h (rule_number, rule): Use int, not short int.
13359 * src/output.c (prepare_rules): Likewise.
13360 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
13361 errs, reductions): Likewise.
13362 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
13363 Likewise.
13364 * src/tables.c (vector_number, tally, action_number,
13365 ACTION_NUMBER_MINIMUM): Likewise.
13366 * src/output.c (muscle_insert_short_int_table): Remove.
13367
133682004-12-17 Akim Demaille <akim@epita.fr>
13369
13370 * data/lalr1.cc: Extensive Doxygenation.
13371 (error_): Rename as...
13372 (error): this, since it is visible to the user.
13373 Adjust callers.
13374 (Parser::message): Now an automatic variable from...
13375 (Parser::yyreport_syntax_error_): here.
13376 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
13377 Parser::error.
13378 * tests/input.at: Escape $.
13379
133802004-12-16 Paul Eggert <eggert@cs.ucla.edu>
13381
13382 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
13383 Parenthesize rhs to avoid obscure problems with mistakes like
13384 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
13385 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
13386 b4_rhs_location): Likewise.
13387 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
13388 b4_rhs_location): Likewise.
13389
133902004-12-16 Akim Demaille <akim@epita.fr>
13391
13392 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
13393 yacc.c: be sure to stay within yycheck_.
13394 * tests/actions.at: Re-enable C++ tests.
13395
133962004-12-16 Akim Demaille <akim@epita.fr>
13397
13398 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
13399 real.
13400
134012004-12-16 Akim Demaille <akim@epita.fr>
13402
13403 Use #define to handle the %name-prefix.
13404
13405 * data/glr.c, data/yacc.c: Comment changes.
13406 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
13407 so that one can refer to yylex in the parser file, and have it
13408 renamed, as is the case with other skeletons.
13409
134102004-12-16 Akim Demaille <akim@epita.fr>
13411
13412 Move lalr1.cc internals into yy*.
13413
13414 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
13415 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
13416 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
13417 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
13418 (empty_, final_, terror_, errcode_, ntokens_)
13419 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
13420 (looka_, ilooka_, error_range_, nerrs_):
13421 Rename as...
13422 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
13423 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
13424 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
13425 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
13426 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
13427 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
13428 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
13429 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
13430 these.
13431
134322004-12-15 Paul Eggert <eggert@cs.ucla.edu>
13433
13434 Fix some problems reported by twlevo at xs4all.
13435 * src/symtab.c (symbol_new): Report an error if the input grammar
13436 contains too many symbols. This is better than calling abort() later.
13437 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
13438 (struct node, struct graph):
13439 Rename member expand to stretch. All uses changed.
13440 (struct graph): Remove member layoutalgorithm. All uses removed.
13441 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
13442 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
13443 All uses changed.
13444 (N_STRETCH): Rename from N_EXPAND. All uses changed.
13445
134462004-12-15 Akim Demaille <akim@epita.fr>
13447
13448 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
13449 Add more Doxygen comments.
13450 (symprint_, stack_print_, reduce_print_, destruct_, pop)
13451 (report_syntax_error_, translate_): Rename as...
13452 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
13453 (yypop_, yyreport_syntax_error_, yytranslate_): this.
13454
134552004-12-15 Akim Demaille <akim@epita.fr>
13456
13457 * data/lalr1.cc (lex_): Rename as...
13458 (yylex_): this.
13459 Move the trace here.
13460 Take the %name-prefix into account.
13461 Reported by Alexandre Duret-Lutz.
13462
134632004-12-15 Akim Demaille <akim@epita.fr>
13464
13465 Simplify the C++ parser constructor.
13466
13467 * data/lalr1.cc (debug_): Rename as...
13468 (yydebug_): so that the parser's internals are always in the yy*
13469 pseudo namespace.
13470 Adjust uses.
13471 (b4_parse_param_decl): Remove the leading comma as it is now only
13472 called as unique argument list.
13473 (Parser::Parser): Remove the constructor accepting a location and
13474 an initial debugging level.
13475 Remove from the other ctor the argument for the debugging level.
13476 (debug_level_type, debug_level, set_debug_level): New.
13477
13478 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
13479 constructor calls.
13480
134812004-12-15 Akim Demaille <akim@epita.fr>
13482
13483 Remove b4_root related material: failure experiment
13484 (which goal was to allow to derive from a class).
13485
13486 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
13487 definitions and uses.
13488
134892004-12-14 Paul Eggert <eggert@cs.ucla.edu>
13490
13491 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
13492 not 2, since it's not portable to subtract 1 from the start of an
13493 array. The new item 0 is never set or used. All uses changed.
13494
13495 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
13496 the default definition of YYLLOC_DEFAULT. Problem reported
13497 by Frank Heckenbach.
13498
134992004-12-12 Paul Eggert <eggert@cs.ucla.edu>
13500
13501 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
13502 the normal case and one for the error case. Just use the
13503 first one uniformly. Problem reported by Frank Heckenbach.
13504 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
13505 use exactly the same macro in both places.
13506 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
13507 so that the normal-case YYRHSLOC works for the error case too.
13508 All uses changed.
13509 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
13510 (YYLLOC_DEFAULT): Use the same macro as glr.c.
13511 * doc/bison.texinfo (Location Default Action): Don't claim that
13512 we have an array of locations. Use the same macro for both glr
13513 and lalr parsers. Mention YYRHSLOC. Mention what happens when
13514 the index is 0.
13515
135162004-12-10 Paul Eggert <eggert@cs.ucla.edu>
13517
13518 * HACKING: Update email addresses to send announcements to.
13519
13520 * configure.ac (AC_INIT): Bump version to 1.875f.
13521
135222004-12-10 Paul Eggert <eggert@cs.ucla.edu>
13523
13524 * NEWS: Version 1.875e.
13525 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
13526
13527 * src/scan-skel.l: Include "complain.h", for "fatal".
13528
13529 * src/relation.h (relation_print, relation_digraph):
13530 Relation sizes are of type relation_node, not size_t (this is
13531 merely a doc fix, since the two types are equivalent).
13532 (relation_transpose): Relation sizes are of type relation_node,
13533 not int.
13534 * src/relation.c: Likewise.
13535 (top, infinity): Now of type relation_node, not int.
13536 (traverse, relation_transpose): Use relation_node, not int.
13537
13538 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
13539 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
13540 (yyparse): Remove unused local introduced in 2004-10-25 patch.
13541
13542 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
13543 specifying whether the test should be skipped. Use it tp
13544 specify that the [%defines %skeleton "lalr1.cc"] tests currently
13545 fail on some hosts, and should be skipped.
13546
135472004-12-08 Paul Eggert <eggert@cs.ucla.edu>
13548
13549 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
13550 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
13551 unless otherwise specified below.
13552
13553 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
13554 to allocate kernel_base, kernel_items, kernel_size, since
13555 they needn't be initialized to 0.
13556 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
13557 * src/closure.c (new_closure): Likewise, for itemset.
13558 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
13559 * src/lalr.c (set_goto_map): Likewise, for temp_map.
13560 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
13561 (build_relations): Likewise for edge, states1, includes.
13562 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
13563 * src/reader.c (packgram): Likewise, for ritem, rules.
13564 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
13565 * src/relation.c (relation_digraph): Likewise for VERTICES.
13566 (relation_transpose): Likewise for new_R, end_R.
13567 * src/symtab.c (symbols_token_translations_init): Likewise for
13568 token_translations.
13569 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
13570 (token_actions): Likewise for yydefact, actrow, conflrow,
13571 conflict_list.
13572 (save_column): Likewise for froms[symno], tos[symno].
13573 (goto_actions): Likewise for state_count.
13574 (pack_table): Likewise for base, pos, check.
13575 (tables_generate): Likewise for width.
13576
13577 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
13578 for initial core. Just have a separate core, so we needn't worry
13579 about whether kernel_size and kernel_base are initialized.
13580
13581 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
13582 kernel_size, kernel_items): Remove unnecessary initialization.
13583 * src/conflicts.c (conflicts): Likewise.
13584 * src/derives.c (derives): Likewise.
13585 * src/muscle_tablc (muscle_insert): Likewise.
13586 * src/relation.c (relation_digraph): Likewise.
13587 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
13588 conflrow, conflict_table, conflict_list, table, check):
13589 Likewise.
13590
13591 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
13592 This is because all callers pass unsigned int.
13593 * src/closure.h (new_closure): Likewise.
13594
13595 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
13596 (build_relations): Initialize includes[i] in all cases.
13597 * src/reader.c (packgram): Always initialize rules[ruleno].prec
13598 and rules[ruleno].precsym. Initialize members in order.
13599 * src/relation.c (relation_transpose): Always initialize new_R[i]
13600 and end_R[i].
13601 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
13602
13603 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
13604 conflict_list[0] was always 0, but now it isn't initialized.
13605
13606 * src/table.c (table_grow): When conflict_table grew, the grown
13607 area wasn't cleared. Fix this.
13608
13609 * lib/.cvsignore: Add strdup.c, strdup.h.
13610 * m4/.cvsignore: Add strdup.m4.
13611
136122004-12-07 Paul Eggert <eggert@cs.ucla.edu>
13613
13614 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
13615 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
13616 GOTO_NUMBER_MAXIMUM, since we occasionally compute
13617 ngotos + 1 without checking for overflow.
13618 (build_relations): Use END_NODE, not -1, to denote end of edges.
13619 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
13620 build_relations): Use goto_number, not int, for goto numbers.
13621 * src/tables.c (save_column, default_goto): Likewise.
13622
136232004-11-23 Akim Demaille <akim@epita.fr>
13624
13625 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
13626 of #defining from yystype.
13627 Don't typedef yystype, C++ does not need it.
13628 This lets it possible to forward declare it as union.
13629
136302004-11-23 Paul Eggert <eggert@cs.ucla.edu>
13631
13632 * bootstrap (gnulib_modules): Add extensions.
13633 Problem reported by Jim Meyering.
13634
136352004-11-22 Paul Eggert <eggert@cs.ucla.edu>
13636
13637 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
13638 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
13639 src/system.h, src/tables.c: XFREE -> free, to accommodate
13640 recent change to gnulib xalloc.h.
13641 Problem reported by Jim Meyering.
13642
136432004-11-17 Akim Demaille <akim@epita.fr>
13644
13645 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
13646
136472004-11-17 Akim Demaille <akim@epita.fr>,
13648 Alexandre Duret-Lutz <adl@gnu.org>
13649
13650 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
13651 changes.
13652 (YYCDEBUG): Adjust.
13653 Use it instead of cdebug_.
13654 (Parser::debug_stream, Parser::set_debug_stream): New.
13655 (Parser::symprint_): Define cdebug_ for temporary backward
13656 compatibility.
13657 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
13658 debug_stream ().
13659
136602004-11-17 Akim Demaille <akim@epita.fr>
13661
13662 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
13663 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
13664 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
13665 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
13666
136672004-10-27 Paul Eggert <eggert@cs.ucla.edu>
13668
13669 * data/glr.c (yyloc_default): Remove; not used.
13670 Problem reported by Frank Heckenbach.
13671
136722004-10-25 Akim Demaille <akim@epita.fr>
13673
13674 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
13675 Introduce another definition to address simple location arrays.
13676 (yyGLRStack): New member: yyerror_range.
13677 (yyrecoverSyntaxError, yyparse): Update it.
13678 (yyrecoverSyntaxError): Use it when shifting the error token to
13679 have an accurate range, equivalent to the one computed by both
13680 yacc.c and lalr1.cc.
13681 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
13682 that column numbers start at column 0, as per GNU Coding
13683 Standards, the others tests, and the doc.
13684 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
13685 Adjust to the above change (first column is 0).
13686 And adjust the location of the "<error>", now covering the whole
13687 line.
13688
136892004-10-22 Akim Demaille <akim@epita.fr>
13690 and Paul Eggert <eggert@cs.ucla.edu>
13691
13692 Remove some arbitrary limits on goto numbers and relations.
13693 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
13694 initial values, since they're never used.
13695 (set_goto_map): ngotos is now unsigned, so test for overflow
13696 by seeing whether it wraps around to zero.
13697 * src/lalr.h (goto_number): Now size_t, not short int.
13698 (GOTO_NUMBER_MAXIMUM): Remove.
13699 * src/relation.c (relation_print, traverse, relation_transpose):
13700 Check for END_NODE rather than looking at sign.
13701 * src/relation.h (END_NODE): New macro.
13702 (relation_node): Now size_t, not short int.
13703
137042004-10-22 Paul Eggert <eggert@cs.ucla.edu>
13705
13706 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
13707 keyword, not an identifier. Problem reported by Baron Schwartz in
13708 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
13709
137102004-10-11 Akim Demaille <akim@epita.fr>
13711
13712 * src/symtab.c (symbol_check_alias_consistency): Also check
13713 type names, destructors, and printers.
13714 Reported by Alexandre Duret-Lutz.
13715 Recode the handling of associativity and precedence in terms
13716 of symbol_precedence_set.
13717 Accept no redeclaration at all, not even equal to the previous
13718 value.
13719 (redeclaration): New.
13720 Use it to factor redeclaration complaints.
13721 (symbol_make_alias): Don't set the type of the alias, let
13722 symbol_check_alias_consistency do it as for other features.
13723 * src/symtab.h (symbol): Add new member prec_location, and
13724 type_location.
13725 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
13726 * tests/input.at (Incompatible Aliases): New.
13727
137282004-10-09 Paul Eggert <eggert@cs.ucla.edu>
13729
13730 .cvsignore fixes to accommodate gnulib changes,
13731 and the practice of naming build directories "_build".
13732 * .cvsignore: Add "_*". Sort.
13733 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
13734 * m4/.cvsignore: Add "*_gl.m4".
13735
137362004-10-06 Akim Demaille <akim@epita.fr>
13737
13738 * src/parse-gram.y (add_param): Fix the truncation of trailing
13739 spaces.
13740
137412004-10-05 Akim Demaille <akim@epita.fr>
13742
13743 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
13744 whether the reducion was empty or not. This leaves room to
13745 improve the use of YYLLOC_DEFAULT in such a case.
13746 lalr1.cc is still experimental, so changing this is acceptable.
13747 And finally, there are probably not many users who changed the
13748 handling of locations in GLR, so changing is admissible too.
13749
13750 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
13751 empty reduction, set @$ to an empty location ending the previously
13752 stacked symbol.
13753 Adjust uses to make sure the code is triggered on empty
13754 reductions.
13755 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
13756 expected output: empty reductions have empty locations.
13757
137582004-09-29 Akim Demaille <akim@epita.fr>
13759
13760 * data/lalr1.cc: Move towards a more standard C++ coding style
13761 for templates: Class < T > -> Class<T>.
13762
137632004-09-29 Akim Demaille <akim@epita.fr>
13764
13765 * data/lalr1.cc: Reinstall the former ctor, for sake of
13766 compatibility, but warn it will be removed.
13767 Move towards a more standard C++ coding style (i.e., type *var ->
13768 type* var).
13769
137702004-09-27 Paul Eggert <eggert@cs.ucla.edu>
13771
13772 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
13773 since it's less likely to work if NULs are involved in the future.
13774
137752004-09-27 Akim Demaille <akim@epita.fr>
13776
13777 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
13778
137792004-09-27 Akim Demaille <akim@epita.fr>
13780
13781 * data/lalr1.cc (b4_parse_param_decl_1): New.
13782 (b4_parse_param_decl): Use it to have different names between attribute
13783 and argument names.
13784 (b4_cc_constructor_call): Likewise.
13785
137862004-09-24 Akim Demaille <akim@epita.fr>
13787
13788 * src/parse-gram.y (add_param): Strip the leading and trailing
13789 blanks from a formal argument declaration.
13790 (YY_LOCATION_PRINT): New.
13791
137922004-09-24 Akim Demaille <akim@epita.fr>
13793
13794 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
13795 after the location.
13796
137972004-09-24 Akim Demaille <akim@epita.fr>
13798
13799 * doc/bison.texinfo (Table of Symbols): Sort.
13800
138012004-09-21 Akim Demaille <akim@epita.fr>
13802
13803 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
13804 the useless parentheses.
13805 Suggested by Paul Eggert.
13806
138072004-09-20 Akim Demaille <akim@epita.fr>
13808
13809 Let the initial-action act on the look-ahead, and use it for the
13810 "initial push" (corresponding to an hypothetical beginning-of-file).
13811 And let lalr1.cc honor %initial-action.
13812
13813 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
13814 example.
13815 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
13816 (Parser::Parser): Remove the ctor that used to initialize it.
13817 (Parser::parse): Like in the other skeletons, issue the "starting
13818 parse" message before any action.
13819 Honor %initial-action.
13820 Initialize the stacks with the lookahead.
13821 * data/yacc.c: Let $$ and @$ in %initial-action designate the
13822 look-ahead.
13823 Push them in the stacks.
13824 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
13825
138262004-09-20 Akim Demaille <akim@epita.fr>
13827
13828 * doc/bison.texinfo (Initial Action Decl): New.
13829
138302004-09-20 Akim Demaille <akim@epita.fr>
13831
13832 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
13833 clearer criterion to define it.
13834 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
13835 When reducing on an empty RHS, use the latest stacked location as
13836 location.
13837 yylloc is not always available.
13838 * data/glr.c: Likewise.
13839 Also, honor initial-actions.
13840
138412004-09-20 Akim Demaille <akim@epita.fr>
13842
13843 * data/yacc.c (YY_LOCATION_PRINT): New.
13844 Define when we know YYLTYPE's structure, i.e., when the default
13845 YYLLOC_DEFAULT is used.
13846 * data/c.m4 (b4_yysymprint_generate): Use it.
13847 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
13848 value of the result.
13849 (error_start_): Replace with...
13850 (error_range_): this location array.
13851 This allows to replace code relying on the implementation of
13852 locations by portable code.
13853 * data/yacc.c (yylerrsp): Replace with...
13854 (yyerror_range): this.
13855 Every time a token is popped, update yyerror_range[0], to have an
13856 accurate location for the error token.
13857 * data/glr.c (YY_LOCATION_PRINT): New.
13858 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
13859 deference a pointer.
13860 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
13861 report the location in %printers.
13862
13863 * src/scan-skel.l: Instead of abort, report error messages to ease
13864 understanding skeleton scanning failures.
13865
138662004-09-16 Akim Demaille <akim@epita.fr>
13867
13868 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
13869 (iterator, const_iterator): these, to be more in the C++ spirit.
13870 Also, return reverse iterators so that when displaying the stack
13871 we display its bottom first.
13872 (Parser::stack_print_, Parser::reduce_print_): Match the messages
13873 from yacc.c.
13874 We should probably use vector here though.
13875
138762004-09-16 Akim Demaille <akim@epita.fr>
13877
13878 Have more complete shift traces.
13879
13880 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
13881 to report Shifts instead of ad hoc YYDPRINTF invocations,
13882 including for the error token.
13883 * data/lalr1.cc (symprint_): Output the location.
13884 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
13885 output the location within the %printer.
13886 Activate GLR tests, at least to make sure they compile properly.
13887 They still don't pass though.
13888 * tests/calc.at: Adjust expect verbose output, since now "Entering
13889 state..." is on a different line than the "Shifting" message.
13890
138912004-09-08 Akim Demaille <akim@epita.fr>
13892
13893 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
13894 Bison directive from the Bison file to the invocation of this
13895 macro, so that these directives are passed to
13896 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
13897 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
13898 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
13899 the extra Bison directives instead of the whole series.
13900 Change the grammar so that there are recoverable errors, and
13901 unrecoverable errors. Now we can have the parser give up before
13902 consuming the whole input. As a result we now can observe that
13903 the lookahead is freed when needed.
13904 Change the parser source to parse argv[1] instead of a hard coded
13905 string.
13906 Simplify yylex, and give a value and location to EOF.
13907 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
13908 passed directives already coded in the file.
13909 Add some tests to check the location of "error".
13910 For some tests, the C++ parser is correct, and not yacc.c.
13911 For other tests, they provide different, but unsatisfying, values,
13912 so keep the C++ value so that at least one parser is "correct"
13913 according to the test suite.
13914 (Actions after errors): Remove, this is subsumed by the
13915 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
13916
139172004-09-06 Akim Demaille <akim@epita.fr>
13918
13919 * data/lalr1.cc: Adjust the indentation of the labels.
13920 (Parser::pop): New.
13921 Use it.
13922
139232004-09-06 Akim Demaille <akim@epita.fr>
13924
13925 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
13926 argument, an informative message.
13927 Call YY_SYMBOL_PRINT.
13928 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
13929 * data/lalr1.cc (destruct_): Likewise.
13930 In addition, no longer depend on b4_yysymprint_generate and
13931 b4_yydestruct_generate to generate these functions, do it "by
13932 hand".
13933
139342004-09-03 Akim Demaille <akim@epita.fr>
13935
13936 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
13937 invoked, yydestruct the lookahead.
13938 * tests/calc.at (Calculator $1): Update the expected lengths of
13939 traces: there is an added line for the discarded lookahead.
13940 * doc/bison.texinfo (Destructor Decl): Some rewording.
13941 Define "discarded" symbols.
13942
139432004-09-02 Akim Demaille <akim@epita.fr>
13944
13945 * data/lalr1.cc (translate_, destruct_): No reason to be static.
13946
139472004-09-02 Akim Demaille <akim@epita.fr>
13948
13949 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
13950 (YYDSYMPRINTF): Rename as...
13951 (YY_SYMBOL_PRINT): this.
13952 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
13953 two.
13954 Use it instead of direct symprint_ calls.
13955 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
13956 one.
13957
139582004-09-02 Akim Demaille <akim@epita.fr>
13959
13960 * data/lalr1.cc (b4_yysymprint_generate): New.
13961 (symprint_): New member function, defined when YYDEBUG.
13962 Use it consistently instead of token/nterm debugging output by
13963 hand.
13964 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
13965 %printer calls to use cdebug_ when using lalr1.cc.
13966
139672004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
13968
13969 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
13970 with #ifdef YYDEBUG.
13971
139722004-08-26 Akim Demaille <akim@epita.fr>
13973
13974 * doc/bison.texinfo (Implementing Loops): Rename as...
13975 (Implementing Gotos/Loops): this.
13976
139772004-08-13 Paul Eggert <eggert@cs.ucla.edu>
13978
13979 Adjust to latest gnulib.
13980 * bootstrap (gnulib_modules): Add xalloc-die.
13981 Set LC_ALL=C so that file names sort consistently.
13982 Prefer the gnulib copies of gettext.m4, glibc21.m4,
13983 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
13984 uintmax_t.m4, ulonglong.m4.
13985 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
13986 po.m4 since we are now using _gl.m4 instead.
13987
139882004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
13989
13990 * src/scan-action.l: Remove. Scanning of semantic actions is
13991 handled in scan-gram.l.
13992
139932004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
13994
13995 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
13996
13997 * src/location.h (struct): The file member is a uniqstr.
13998 (equal_boundaries): Use UNIQSTR_EQ for comparison.
13999
140002004-07-22 Paul Eggert <eggert@cs.ucla.edu>
14001
14002 Fix bug with non-%union parsers that have printers or destructors,
14003 which led to a Bison core dump. Reported by Peter Fales in
14004 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
14005
14006 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
14007 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
14008 not to our own type.
14009 * src/output.c (symbol_destructors_output, symbol_printers_output):
14010 Don't assume %union.
14011 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
14012 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
14013 UNION-FLAG. All callers changed.
14014 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
14015 Use type char, not unsigned int, when declaring an array of char;
14016 this lets us remove a cast.
14017 (Printers and Destructors): Add non-%union test cases.
14018
140192004-06-21 Paul Eggert <eggert@cs.ucla.edu>
14020
14021 * doc/bison.texinfo: Minor editorial changes, mostly to the new
14022 GLR writeups. E.g., avoid frenchspacing and the future tense,
14023 change "lookahead" to "look-ahead", and change "wrt" to "with
14024 respect to".
14025
140262004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
14027
14028 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
14029 New sections, split off from the GLR Parsers section. Put the new
14030 Simple GLR Parser near the start of the GLR section, for clarity.
14031 Rewrite connective text.
14032
140332004-06-21 Frank Heckenbach <frank@g-n-u.de>
14034
14035 * doc/bison.texinfo (Simple GLR Parsers): New section.
14036
140372004-06-21 Paul Eggert <eggert@cs.ucla.edu>
14038
14039 * NEWS, TODO, doc/bison.texinfo:
14040 Use "look-ahead" instead of "lookahead", to be consistent.
14041 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
14042 while we're fixing "look-ahead".
14043 * src/conflicts.c (shift_set): Renamed from shiftset.
14044 (look_ahead_set): Renamed from lookaheadset.
14045 * src/print.c: Likewise.
14046 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
14047 name for "lookahead".
14048 (report_types, usage): Likewise.
14049 * src/getargs.h (report_look_ahead_tokens): Renamed from
14050 report_lookaheads.
14051 * src/lalr.c (compute_look_ahead_tokens): Renamed from
14052 compute_lookaheads.
14053 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
14054 (look_ahead_tokens_print): Renamed from lookaheads_print.
14055 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
14056 state_rule_lookaheads_print.
14057 * src/state.h: Likewise.
14058 (reductions.look_ahead_tokens): Renamed from lookaheads.
14059 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
14060 AT_DATA_LOOKAHEADS_GRAMMAR.
14061
140622004-06-03 Paul Eggert <eggert@cs.ucla.edu>
14063
14064 * README: Update location of patched M4 distribution.
14065
140662004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
14067
14068 Don't assume the C++ compiler takes the same arguments as the C compiler
14069 (trivial change).
14070 * configure.ac (O0CXXFLAGS): New var.
14071 * tests/atlocal.in (CXXFLAGS): Use it.
14072
140732004-05-29 Paul Eggert <eggert@cs.ucla.edu>
14074
14075 Fix some "make check" problems with C++ reported by
14076 Albert Chin-A-Young for Tru64 C++ in this thread:
14077 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
14078
14079 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
14080 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
14081 Output to a .cc file for C++, not to a .c file.
14082 * tests/calc.at (AT_CHECK_CALC): Likewise.
14083 * tests/regression.at (AT_CHECK_DANCER): Likewise.
14084 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
14085
140862004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
14087
14088 * tests/calc.at, tests/actions.at: Workaround for SGI
14089 C++ compiler. (trivial change)
14090
140912004-05-27 Paul Eggert <eggert@cs.ucla.edu>
14092
14093 Spent a few hours checking out which prerequisite versions the
14094 current sources actually require. I went all the way back to
14095 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
14096 a seemingly endless set of combinations of versions more recent
14097 than that. The bottom line is that the current sources require
14098 fairly recent versions of the build tools, and it'll be some work
14099 to change this.
14100 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
14101 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
14102 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
14103 Add comments explaining why those particular versions are
14104 currently needed.
14105
14106 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
14107 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
14108 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
14109
14110 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
14111 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
14112
141132004-05-26 Paul Eggert <eggert@cs.ucla.edu>
14114
14115 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
14116 0.11.5. Suggested by Bruno Haible.
14117 * bootstrap: Remove gettext version checking.
14118
14119 * doc/bison.texinfo (Decl Summary): Also mention that %union
14120 can depend on prerequisite types. Problem reported by Tim
14121 Van Holder.
14122
141232004-05-25 Paul Eggert <eggert@cs.ucla.edu>
14124
14125 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
14126 * README-alpha: Don't tell people not to package this.
14127
14128 * bootstrap: Don't assume $(...) works; use `...` instead.
14129 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
14130 gettext better.
14131
14132 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
14133 put into the -d output file, and mention what to do if YYSTYPE is
14134 defined as a macro.
14135
141362004-05-24 Paul Eggert <eggert@cs.ucla.edu>
14137
14138 Undo change made earlier today: it caused autopoint to not bring
14139 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
14140 autopoint's.
14141
14142 * bootstrap: Check that gettext version matches what's in
14143 configure.ac. Warn users to ignore robots.txt ERROR 404.
14144 * bootstrap: Undo today's earlier change (logged below).
14145 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
14146
14147 The gettext version checking is causing more trouble than it's
14148 curing; remove it. Problem reported by Paul Hilfinger.
14149
14150 * bootstrap: Issue a warning that one can expect a message
14151 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
14152 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
14153
141542004-05-23 Paul Eggert <eggert@cs.ucla.edu>
14155
14156 Ensure that the C++ compiler used for testing actually works on a
14157 simple test program; if not, skip the C++-related tests. Problem
14158 reported by Vin Shelton in:
14159 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
14160
14161 * m4/cxx.m4: New file.
14162 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
14163 * tests/atlocal.in (BISON_CXX_WORKS): Add.
14164 * tests/local.at (AT_COMPILE_CXX): Use it.
14165
141662004-05-21 Paul Eggert <eggert@cs.ucla.edu>
14167
14168 * data/glr.c (yylloc): Output this macro even if locations are not
14169 being generated, as the GLR parser needs it even in that case.
14170 Problem reported by Troy A. Johnson
14171 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
14172
14173 * configure.ac (AC_INIT): Update to 1.875e.
14174
141752004-05-21 Paul Eggert <eggert@cs.ucla.edu>
14176
14177 * NEWS: Version 1.875d.
14178 * configure.ac (AC_INIT): Likewise.
14179 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
14180
14181 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
14182 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
14183 lalr1.cc runs afoul of the first, and the last two are no longer
14184 supported by GCC 3.4.0.
14185 * README: Mention GNU m4 1.4 or later; mention m4 patches.
14186 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
14187
141882004-05-06 Paul Eggert <eggert@cs.ucla.edu>
14189
14190 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
14191 unsigned int, for compatibility with latest gnulib hash module.
14192 * src/state.c (state_hash, state_hasher): Likewise.
14193 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
14194 * src/uniqstr.c (hash_uniqstr): Likewise.
14195
141962004-05-03 Paul Eggert <eggert@cs.ucla.edu>
14197
14198 * NEWS: Unescaped newlines are no longer allowed in char & strings.
14199
14200 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
14201 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
14202 character and string literals.
14203 (unexpected_end): New function.
14204 (unexpected_eof): Use it.
14205 (unexpected_newline): New function.
14206 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
14207 actions.
14208
14209 * NEWS: Document %expect-rr.
14210
14211 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
14212 Fix typo by replacing $1 with $option.
14213 Remove more 'intl'-related files.
14214 Don't DEFUN AM_INTL_SUBDIR twice.
14215
14216 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
14217 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
14218 strtoul.c.
14219 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
14220 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
14221 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
14222 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
14223 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
14224 * src/.cvsignore: Add *.output.
14225
14226 * src/parse-gram.y: Put copyright notice inside %{ %} so it
14227 gets copied to the output file.
14228
142292004-04-28 Paul Eggert <eggert@twinsun.com>
14230
14231 Get files from the gnulib and po repositories, instead of relying
14232 on them being in our CVS. Upgrade to latest versions of gnulib
14233 and Automake.
14234
14235 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
14236 * bootstrap: Bootstrap from gnulib and po repositories.
14237 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
14238 * README-cvs: Document these changes. Remove version numbers from
14239 mentions of build tools, since they change so often. Mention Flex.
14240
14241 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
14242 (gl_USE_SYSTEM_EXTENSIONS): Add.
14243 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
14244 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
14245 does this for us.
14246 (AC_ISC_POSIX): Remove; we no longer support this
14247 ancient OS, as it gets in the way of latest Autoconf & gnulib.
14248 (AC_HEADER_STDC): Remove: we now assume C89 or better.
14249 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
14250 Do not check for C89 headers, except for locale.h which is used
14251 by the Yacc library and must port to K&R hosts.
14252 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
14253 Do not check for C89 functions, except for setlocale which is
14254 used by the Yacc library.
14255 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
14256 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
14257 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
14258 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
14259 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
14260 AM_GNU_GETTEXT): Remove; now done by:
14261 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
14262 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
14263 for us.
14264
14265 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
14266 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
14267 Define to empty, as gnulib.mk will do the rest for us.
14268 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
14269 for us.
14270 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
14271 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
14272
14273 * src/files.c: Include gnulib's xstrndup.h.
14274
14275 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
14276 (REALLOC): Use xnrealloc, for likewise.
14277 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
14278 (strnlen, memrchr): Remove decls; functions no longer used.
14279 Include <stpcpy.h>.
14280
14281 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
14282 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
14283 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
14284 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
14285 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
14286 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
14287 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
14288 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
14289 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
14290 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
14291 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
14292 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
14293 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
14294 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
14295 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
14296 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
14297 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
14298 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
14299 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
14300 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
14301 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
14302 Remove, as these files are now generated automatically
14303 by bootstrap or automake.
14304
14305 * po/ChangeLog: Remove: all but one entry was a duplicate
14306 of this file, and I moved that 2000-11-02 entry here.
14307
14308 * config/.cvsignore: Add Makefile, depcomp, install-sh.
14309 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
14310 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
14311 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
14312 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
14313 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
14314 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
14315 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
14316 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
14317 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
14318 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
14319 xstrndup.h.
14320 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
14321 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
14322 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
14323 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
14324 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
14325 * src/.cvsignore: Remove *_.c.
14326
14327
14328 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
14329 support it. (The latest stable gzip doesn't.)
14330
143312004-04-27 Paul Eggert <eggert@twinsun.com>
14332
14333 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
14334 case, as stos_ is now used by destructors due to the 2004-02-09
14335 change.
14336
14337 Remove more K&R C support.
14338 * lib/libiberty.y (PARAMS): Remove. All uses removed.
14339 * lib/subpipe.c (errno): Remove decl.
14340 Include <stdlib.h> unconditionally.
14341 (EXIT_FAILURE): Remove macro.
14342 * src/complain.c (vfprintf, strerror): Remove.
14343 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
14344 unconditionally.
14345 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
14346 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
14347 (strchr, strspn, memchr): Remove decls.
14348 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
14349 unconditionally. Do not declare perror.
14350 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
14351 unconditionally.
14352
14353 * src/complain.c (_): Remove useless defn, as system.h defines this.
14354
14355 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
14356 with latest obstack.h.
14357 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
14358 to procedure types, as obstack.h now does that for us.
14359 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
14360
14361 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
14362 so that this include file can stand alone.
14363 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
14364 does this now. Include subpipe.h first after config.h, to
14365 test whether it can stand alone.
14366
14367 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
14368 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
14369 unused declaration.
14370
14371 * tests/synclines.at (%union synch line): Put a dummy member in
14372 the union, because empty unions aren't allowed in C. Caught
14373 by GCC 3.4.0.
14374
143752004-04-13 Jim Meyering <jim@meyering.net>
14376
14377 * src/conflicts.c (conflicts_print): Correct format string typo:
14378 use `%%' to produce literal `%'. (trivial change)
14379
143802004-03-30 Paul Eggert <eggert@twinsun.com>
14381
14382 * src/getargs.c (version): Update copyright year to 2004.
14383
14384 * data/c.m4 (b4_int_type): Use 'short int' rather than
14385 'short', and similarly for 'long', 'unsigned', etc.
14386 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
14387 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
14388 yy_yypstack, yydumpstack): Likewise.
14389 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
14390 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
14391 Likewise.
14392 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
14393 yy_stack_print, yyparse): Likewise.
14394 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
14395 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
14396 * lib/bitset.c (bitset_print): Likewise.
14397 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
14398 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
14399 * lib/bitsetv.c (bitsetv_dump): Likewise.
14400 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
14401 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
14402 Likewise.
14403 * src/LR0.c (allocate_itemsets): Likewise.
14404 * src/gram.h (rule_number, rule): Likewise.
14405 * src/lalr.h (goto_number): Likewise.
14406 * src/nullable.c (nullable_compute): Likewise.
14407 * src/output.c (prepare_rules): Likewise.
14408 * src/relation.c (relation_print, relation_digraph): Likewise.
14409 * src/relation.h (relation_node): Likewise.
14410 * src/state.h (state_number, transitions, errs, reductions,
14411 struct state): Likewise.
14412 * src/symtab.h (symbol_number, struct symbol): Likewise.
14413 * src/tables.c (vector_number, tally, action_number,
14414 default_goto, goto_actions): Likewise.
14415 * tests/existing.at (GNU Cim Grammar): Likewise.
14416 * tests/regression.at (Web2c Actions): Likewise.
14417
14418 * src/output.c (muscle_insert_short_int_table): Renamed from
14419 muscle_insert_short_table. All uses changed.
14420
144212004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
14422
14423 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
14424 (declaration): Replace expected_conflicts with expected_sr_conflicts.
14425 Add %expect-rr rule.
14426
14427 * src/scan-gram.l: Recognize %expect-rr.
14428
14429 * src/conflicts.h (expected_sr_conflicts): Rename from
14430 expected_conflicts.
14431 (expected_rr_conflicts): Declare.
14432
14433 * src/conflicts.c (expected_sr_conflicts): Rename from
14434 expected_conflicts.
14435 (expected_rr_conflicts): Define.
14436 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
14437 for GLR parsers.
14438 Use expected_sr_conflicts in place of expected_conflicts.
14439 Warn if expected_rr_conflicts used in non-GLR parser.
14440
14441 * doc/bison.texinfo: Add documentation for %expect-rr.
14442
144432004-03-08 Paul Eggert <eggert@gnu.org>
14444
14445 Add support for hex token numbers. Suggested by Odd Arild Olsen in
14446 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
14447
14448 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
14449 in lalr1.cc.
14450 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
14451 * src/scan-gram.l (scan_integer): New function.
14452 ({int}): Use it.
14453 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
14454 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
14455 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
14456 Say "long int", not "long", for uniformity with GNU style.
14457
144582004-02-25 Paul Eggert <eggert@twinsun.com>
14459
14460 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
14461 compilers. This fixes a problem with Intel's C++ compiler being
14462 chatty, reported by Guido Trentalancia in
14463 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
14464
144652004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
14466
14467 Support %destructor and merge error locations in lalr1.cc.
14468
14469 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
14470 (Parser::stos_): Define unconditionally.
14471 (Parser::destruct_): New method. Generate its body with
14472 b4_yydestruct_generate.
14473 (Parser::error_start_): New attribute.
14474 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
14475 token which are discarded.
14476 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
14477 error_start_ when erroneous token are discarded.
14478 (Parser::parse) <yyerrlab1>: Compute the location of the error
14479 token so that it covers all the discarded tokens.
14480 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
14481 it can be called with `%skeleton "lalr1.cc"', and do that.
14482
144832004-02-02 Paul Eggert <eggert@twinsun.com>
14484
14485 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
14486 $(top_srcdir)/lib and ../lib. This fixes a bug reported
14487 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
14488 There's no need to mention top_builddir since Automake does that
14489 for us.
14490 (INCLUDES): Remove, as Automake says it's obsolescent.
14491 Contents migrated into AM_CPPFLAGS as described above.
14492 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
14493
144942004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
14495
14496 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
14497 (yyreportSyntaxError): Handle case where lookahead token is
14498 YYEMPTY.
14499
145002004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14501
14502 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
14503 resulting parsers are compilable with C++.
14504
145052003-12-23 Paul Eggert <eggert@twinsun.com>
14506
14507 * config/depcomp, config/install-sh: Sync with Automake 1.8.
14508 * src/output.c (output_skeleton): Rename local var.
14509 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
14510 Bison tokens, as this runs afoul of the 2003-10-07 change that
14511 disallowed NUL bytes in character constants or string literals.
14512
14513 * tests/local.at: Require Autoconf 2.59's Autotest.
14514 * tests/testsuite.at: Don't include local.at, since we now assume
14515 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
14516 including it.
14517 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
14518 multiple inclusion warnings.
14519
145202003-12-02 Akim Demaille <akim@epita.fr>
14521
14522 * doc/bison.texinfo (How Can I Reset the Parser): More about start
14523 conditions.
14524 From Bruno Haible.
14525
145262003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
14527
14528 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
14529
145302003-10-07 Paul Eggert <eggert@twinsun.com>
14531
14532 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
14533 if testsuite doesn't exist.
14534
14535 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
14536 literals, unfortunately.
14537 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
14538 Complain about NUL bytes in character constants or string literals.
14539
145402003-10-05 Paul Eggert <eggert@twinsun.com>
14541
14542 * NEWS: Don't document %no-default-prec, as it's still
14543 too experimental.
14544 * doc/bison.texinfo: Document %no-default-prec only if
14545 the defaultprec flag is set. Normally it's not.
14546
145472003-10-04 Paul Eggert <eggert@twinsun.com>
14548
14549 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
14550 non-modifiable lvalue, instead of a modifiable one.
14551 * doc/bison.texinfo (Actions): Document that $$ can
14552 be assigned to. Do not claim that $$ and $N are
14553 array element references: user code should not rely on this.
14554
145552003-10-01 Paul Eggert <eggert@twinsun.com>
14556
14557 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
14558 (grammar_declaration): Use it.
14559 * src/scan-gram.l: New token %no-default-prec.
14560 * tests/conflicts.at: Revamp tests to use %no-default-prec.
14561 * NEWS, doc/bison.texinfo: Document the above.
14562
145632003-10-01 Akim Demaille <akim@epita.fr>
14564
14565 VCG no longer supports long_straight_phase.
14566
14567 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
14568 * src/print_graph.c (print_graph): Adjust.
14569
145702003-09-30 Frank Heckenbach <frank@g-n-u.de>
14571 and Paul Eggert <eggert@twinsun.com>
14572
14573 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
14574 Table of Symbols): Document %default-prec.
14575 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
14576 (grammar_declaration): Set default_prec on %default-prec.
14577 * src/scan-gram.l (%default-prec): New token.
14578 * src/reader.h (default_prec): New flag.
14579 * src/reader.c: Likewise.
14580 (packgram): Handle it.
14581 * tests/conflicts.at (%default-prec without %prec,
14582 %default-prec with %prec, %default-prec 1): New tests.
14583
145842003-09-30 Paul Eggert <eggert@twinsun.com>
14585
14586 * tests/testsuite.at: Include local.at, not input.at, fixing
14587 a typo in the 2003-08-25 patch.
14588
145892003-08-27 Akim Demaille <akim@epita.fr>
14590
14591 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
14592 GCC warnings.
14593
145942003-08-26 Akim Demaille <akim@epita.fr>
14595
14596 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
14597 "<\#" to avoid magic from Gnus when posting parts of this script.
14598
145992003-08-26 Akim Demaille <akim@epita.fr>
14600
14601 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
14602 (Parser::parse): here.
14603 Adjust: nerrs and errstatus is now replaced by...
14604 (Parser::nerrs_, Parser::errstatus_): New.
14605
146062003-08-25 Akim Demaille <akim@epita.fr>
14607
14608 * config/announce-gen, Makefile.cfg: New.
14609 * Makefile.am: Adjust.
14610 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
14611 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
14612
146132003-08-25 Akim Demaille <akim@epita.fr>
14614
14615 When reducing initial empty rules, Bison parser read an initial
14616 location that is not defined. This results in garbage, and that
14617 affects Bison's own parser. Therefore we need (i) to extend Bison
14618 to support a means to initialize this location, and (ii) to use
14619 this CVS Bison to fix CVS Bison's parser.
14620
14621 * src/reader.h, reader.c (epilogue_augment): Remove, replace
14622 with...
14623 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
14624 * src/parse-gram.y: Adjust.
14625 (%initial-action): New.
14626 (%error-verbose): Since we require CVS Bison, there is no reason
14627 not to use it.
14628 * src/scan-gram.l: Adjust.
14629 * src/Makefile.am (YACC): New, to make sure we use our own parser.
14630 * data/yacc.c (yyparse): Use b4_initial_action.
14631
146322003-08-25 Akim Demaille <akim@epita.fr>
14633
14634 * doc/bison.texinfo: Don't promote stdout for error messages.
14635
146362003-08-25 Akim Demaille <akim@epita.fr>
14637
14638 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
14639 From Alexandre Duret-Lutz.
14640
146412003-08-25 Akim Demaille <akim@epita.fr>
14642
14643 Version 1.875c.
14644
146452003-08-25 Akim Demaille <akim@epita.fr>
14646
14647 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
14648 Use them.
14649
146502003-08-25 Akim Demaille <akim@epita.fr>
14651
14652 * data/lalr1.cc (Parser::reduce_print_): New.
14653 Use it.
14654
146552003-08-25 Akim Demaille <akim@epita.fr>
14656
14657 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
14658 error recovery loops. This patch is based on
14659 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
14660 Also, augment the similarity between lalr1.cc and yacc.c.
14661 Note: the locations of error recovery rules are not correct yet.
14662
14663 * data/lalr1.cc: Comment changes to augment the similarity between
14664 lalr1.cc and yacc.c.
14665 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
14666 (yyerrlab1): Remove, but where it used to be (now the bottom part of
14667 yyerrlab), when hitting EOF, pop the whole stack here instead of
14668 merely falling thru the default error handling mechanism.
14669 (yyerrorlab): New label, with the old contents of YYERROR,
14670 plus the following change: pop the stack of rhs corresponding
14671 to the production that invoked YYERROR. That is how Yacc
14672 behaves (required by POSIX).
14673 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
14674 fail.
14675
146762003-08-25 Akim Demaille <akim@epita.fr>
14677
14678 Tune local.at so that people can "autom4te -l autotest calc.at -o
14679 calc" for instance, to extract a sub test suite.
14680
14681 * tests/testsuite.at: Move the initialization, Autotest version
14682 requirement, and AT_TESTED invocation into...
14683 * tests/local.at: here.
14684 * tests/testsuite.at: Include it for compatibility with Autoconf
14685 2.57.
14686 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
14687 be ignore.
14688
146892003-08-04 Paul Eggert <eggert@twinsun.com>
14690
14691 Rework code slightly to avoid gcc -Wtraditional warnings.
14692 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
14693 The returned value is now stored in *YY0. All callers changed.
14694 * src/output.c (merge_output): Adjust to the above change.
14695
146962003-07-26 Paul Eggert <eggert@twinsun.com>
14697
14698 * data/glr.c (YYASSERT): New macro.
14699 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
14700 yyresolveStates, yyprocessOneStack):
14701 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
14702 Derived from a suggestion by Frank Heckenbach.
14703
147042003-07-25 Paul Eggert <eggert@twinsun.com>
14705
14706 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
14707 for portability to K&R C (after ansi2knr, presumably). See
14708 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
14709 by Frank Heckenbach, though I have omitted the structure-initialization
14710 part of his glr-knr.diff patch since I recall that the Portable
14711 C Compiler didn't require that change.
14712
14713 Let the user specify how to allocate and free memory.
14714 Derived from a suggestion by Frank Heckenbach in
14715 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
14716 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
14717 All uses of free, malloc, realloc changed to use these macros,
14718 and unnecessary casts removed.
14719 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
14720
147212003-07-06 Matthias Mann <MatthiasMann@gmx.de>
14722
14723 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
14724 use s.empty() rather than s == "" to test for empty string; see
14725 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
14726 (trivial change)
14727
147282003-06-25 Akim Demaille <akim@epita.fr>
14729
14730 * config/depcomp, config/install-sh: Update from masters.
14731
147322003-06-20 Paul Eggert <eggert@twinsun.com>
14733
14734 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
14735 and return properly parenthesized result.
14736 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
14737 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
14738 Remove unnecessary parentheses from uses.
14739 * doc/bison.texinfo (Location Default Action): Describe the
14740 conventions for parentheses.
14741
147422003-06-19 Paul Eggert <eggert@twinsun.com>
14743
14744 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
14745 yyreportTree): Do not assume that size_t is the same width as int,
14746 when printing sizes. Print sizes using an unsigned format.
14747 Problem reported by Frank Heckenbach in
14748 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
14749
14750 Port to Forte Developer 7 C compiler.
14751 * data/glr.c (struct YYLTYPE): If locations are not being used,
14752 declare a single dummy member, as empty structs do not conform
14753 to the C standard.
14754 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
14755 the Forte Developer 7 C compiler complains that end-of-loop
14756 code is not reached.
14757
147582003-06-17 Paul Eggert <eggert@twinsun.com>
14759
14760 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
14761 avoid warnings from picky compilers about redefinition of PARAMS.
14762
147632003-06-17 Paul Eggert <eggert@twinsun.com>
14764
14765 Version 1.875b.
14766
14767 * NEWS: Document 1.875b.
14768
14769 * lib/bbitset.h: Do not include config.h; that's the includer's job.
14770 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
14771 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
14772 Don't use 'index' in comments, as it's a builtin fn on some hosts.
14773 * lib/bitset_stats.c: Include gettext.h unconditionally, as
14774 per recent gettext manual's suggestion.
14775 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
14776 Use prototypes, not old-style definitions.
14777 * lib/lbitset.c (lbitset_unused_clear): Likewise.
14778 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
14779 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
14780 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
14781 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
14782 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
14783 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
14784 vbitset_or_and_cmp, vbitset_copy): Likewise.
14785
14786 * lib/libiberty.h: Do not include config.h; that's the includer's job.
14787 Do not include <stdlib.h>.
14788 (PARAMS): Define unconditionally for C89.
14789 (ATTRIBUTE_NORETURN): Remove.
14790 (ATTRIBUTE_UNUSED): Define unconditionally.
14791
14792 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
14793 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
14794 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
14795 * lib/vbitset.c, lib/vbitset.h: New files.
14796 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
14797 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
14798 from libbitset.
14799
14800 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
14801 `How Can I Reset @code{yyparse}', since texinfo does not allow
14802 arbitrary @ in node names.
14803
14804 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
14805 shouldn't be needed according to the gettext 0.12.1 documentation
14806 but which seem to be needed anyway: codeset.m4 glibc21.m4
14807 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
14808 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
14809 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
14810
14811 * lib/.cvsignore: Add stdbool.h.
14812 * m4/.cvsignore: Add nls.m4, po.m4.
14813
14814 Upgrade to CVS gnulib.
14815 * stdbool_.h: File renamed from stdbool.h.in.
14816 * configure.ac (AM_STDBOOL_H): Invoke this instead of
14817 AC_HEADER_STDBOOL.
14818 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
14819 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
14820 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
14821 (MOSTLYCLEANFILES): New var.
14822 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
14823 (stdbool.h): New rule.
14824 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
14825 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
14826 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
14827 m4/quote.m4: Upgrade to today's gnulib.
14828
14829 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
14830 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
14831 the tests right now.
14832 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
14833 yyerror are declared before use; C99 requires this.
14834
148352003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14836
14837 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
14838 first.
14839 (yyrecoverSyntaxError): Correct the logic for setting and testing
14840 yyerrState.
14841 Correct comment on handling EOF.
14842 Allow states with only a default reduction, rather than failing
14843 (I can't quite reconstruct why these were not allowed before).
14844
14845 Fixes to avoid problem that $-N rules in GLR parsers can cause
14846 buffer overruns, corrupting state.
14847
14848 * src/output.c (prepare_rules): Output max_left_semantic_context
14849 definition.
14850 * src/reader.h (max_left_semantic_context): New variable declaration.
14851 * src/scan-gram.l (max_left_semantic_context): Define.
14852 (handle_action_dollar): Update max_left_semantic_context.
14853 * data/glr.c (YYMAXLEFT): New definition.
14854 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
14855 (yyresolveAction): Ditto.
14856
14857 Fixes to problems with location handling in GLR parsers reported by
14858 Frank Heckenbach (2003/06/05).
14859
14860 * data/glr.c (YYLTYPE): Make trivial if locations not used.
14861 (YYRHSLOC): Add parentheses, and define only if locations used.
14862 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
14863 locations not used.
14864 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
14865 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
14866
14867 * tests/cxx-type.at: Exercise location information; update tests
14868 to differentiate output with and without locations.
14869 Remove forward declarations of yylex and yyerror---caused errors
14870 because default YYLTYPE not yet defined.
14871 Change semantic actions to compute strings, rather than printing
14872 them directly (to test proper passing of semantics values). Change
14873 output to prefix notation and update test data and expected results.
14874 (yylex): Track locations.
14875 (stmtMerge): Return value rather than printing, and include arguments
14876 in value.
14877
148782003-06-03 Paul Eggert <eggert@twinsun.com>
14879
14880 Avoid warnings generated by GCC 2.95.4 when Bison is
14881 configured with --enable-gcc-warnings.
14882 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
14883 yy::]b4_parser_class_name[::translate_,
14884 yy::Stack::operator[] (unsigned),
14885 yy::Stack::operator[] (unsigned) const,
14886 yy::Slice::operator[] (unsigned),
14887 yy::Slice::operator[] (unsigned) const):
14888 Rename local vars to avoid warnings.
14889 * tests/glr-regression.at (Improper handling of embedded actions
14890 and $-N in GLR parsers): Remove unused local variable from yylex.
14891 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
14892 (void) as arg when not pure, since we now assume C89 when building
14893 Bison. Pacify GCC by using parameter.
14894
148952003-06-02 Paul Eggert <eggert@twinsun.com>
14896
14897 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
14898 yy::Location::lines, yy::Location::columns): Rename arguments
14899 to avoid shadowing; this removes a warning generated by GCC 3.3.
14900
149012003-06-01 Paul Eggert <eggert@twinsun.com>
14902
14903 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
14904 to g++, as GCC 3.3 complains if you do it.
14905 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
14906 everything that WARNING_CFLAGS has, except omit warnings
14907 not suitable for C++.
14908 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
14909 * tests/atlocal.in (CXXFLAGS): New var.
14910 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
14911
14912 Fix a GLR parser bug I reported in February; see
14913 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
14914 The problem was that GLR parsers did not conform to the C standard,
14915 because actions like { $1 = $2 + $3; } expanded to expressions
14916 that invoked YYFILL in separate subexpressions, and YYFILL assigned
14917 to a local variable. The C standard says that expressions
14918 like (var = f ()) + (var = f ()) have undefined behavior.
14919 Another problem was that GCC sometimes issues warnings that
14920 yyfill and its parameters are unused.
14921
14922 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
14923 as possibly unused.
14924 (yyfill): New function.
14925 (YYFILL): Use it.
14926 (yyuserAction): Change type of yynormal to bool, so that it matches
14927 the new yyfill signature. Mark it as possibly unused.
14928
14929
14930 Follow up on a bug I reported in February, where a Bison-generated
14931 parser can loop. Provide a test case and a fix for yacc.c. I
14932 don't have a fix for lalr1.cc or for glr.c, unfortunately.
14933 The original bug report is in:
14934 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
14935
14936 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
14937 macro's size was becoming unwieldy.
14938 (yyerrlab): Do not discard an empty lookahead symbol, as this
14939 might destroy garbage.
14940 (yyerrorlab): New label, with the old contents of YYERROR,
14941 plus the following change: pop the stack of rhs corresponding
14942 to the production that invoked YYERROR. That is how Yacc
14943 behaves, and POSIX requires this behavior.
14944 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
14945 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
14946 Define 'alarm' to do nothing if unistd.h is not available.
14947 Add a new rule "exp: '-' error;" to test the above change to
14948 data/yacc.c. Use 'alarm' to abort any test taking longer than
14949 10 seconds, as it's probably looping.
14950 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
14951 Also, the new yacc.c generates two fewer diagnostics for an
14952 existing test.
14953
149542003-05-24 Paul Eggert <eggert@twinsun.com>
14955
14956 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
14957 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
14958 This fixes a problem reported by John Bowman when the Compaq/HP
14959 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
14960 -ansi -Wall -gall).
14961 * data/yacc.c (union yyalloc): Likewise.
14962 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
14963
14964 Switch from 'int' to 'bool' where that makes sense.
14965
14966 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
14967 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
14968 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
14969 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
14970 Return or accept bool, not int. All callers changed.
14971 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
14972 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
14973 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
14974 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
14975 bitset_or_and_cmp_): Likewise.
14976 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
14977 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
14978 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
14979 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
14980 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
14981 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
14982 bitset_stats_or_and_cmp): Likewise.
14983 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
14984 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
14985 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
14986 ebitset_xor_cmp): Likewise.
14987 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
14988 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
14989 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
14990 lbitset_xor_cmp): Likewise.
14991 * lib/bbitset.h: Include <stdbool.h>.
14992 (struct bitset_vtable): The following members now return bool, not
14993 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
14994 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
14995 or_and_cmp).
14996 * src/conflicts.c (count_rr_conflicts): Likewise.
14997 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
14998 All uses changed.
14999 * lib/ebitset.c (ebitset_obstack_init): Likewise.
15000 * lib/lbitset.c (lbitset_obstack_init): Likewise.
15001 * src/getargs.c (debug_flag, defines_flag, locations_flag,
15002 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
15003 graph_flag): Likewise.
15004 * src/getargs.h (debug_flag, defines_flag, locations_flag,
15005 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
15006 graph_flag): Likewise.
15007 * src/output.c (error_verbose): Likewise.
15008 * src/output.h (error_verbose): Likewise.
15009 * src/reader.c (start_flag, typed): Likewise.
15010 * src/reader.h (typed): Likewise.
15011 * src/getargs.c (LOCATIONS_OPTION): New constant.
15012 (long_options, getargs): Use it.
15013 * src/lalr.c (build_relations): Use bool, not int.
15014 * src/nullable.c (nullable_compute): Likewise.
15015 * src/print.c (print_reductions): Likewise.
15016 * src/tables.c (action_row, pack_vector): Likewise.
15017 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
15018 * src/output.c (prepare): Use it.
15019 * src/output.c (token_definitions_output,
15020 symbol_destructors_output, symbol_destructors_output): Use string,
15021 not boolean integer, to keep track of whether to output separator.
15022 * src/print_graph.c (print_core): Likewise.
15023 * src/state.c (state_rule_lookaheads_print): Likewise.
15024
15025 * config/install-sh: Sync from automake 1.7.5.
15026
150272003-05-14 Paul Eggert <eggert@twinsun.com>
15028
15029 * src/parse-gram.y (rules_or_grammar_declaration): Require a
15030 semicolon after a grammar declaration, in the interest of possible
15031 future changes to the Bison input language.
15032 Do not allow a stray semicolon at the start of the grammar.
15033 (rhses.1): Allow one or more semicolons after any rule, including
15034 just before "|" as required by POSIX.
15035 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
15036 grammar.
15037
150382003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
15039
15040 %parse-param support for lalr1.cc.
15041
15042 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
15043 b4_cc_constructor_calls, b4_cc_constructor_call,
15044 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
15045 definitions.
15046 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
15047 parse-param arguments.
15048 (yy::b4_parser_class_name): Declare instance variables to
15049 hold parse-param arguments.
15050 * tests/calc.at: s/value/semantic_value/ because value clashes
15051 with a member of yy::b4_parser_class_name. Adjust C++ code
15052 to handle %parse-param. Enable %parse-param test in C++.
15053
150542003-05-12 Paul Eggert <eggert@twinsun.com>
15055
15056 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
15057 English a bit. Fix fclose typo. Change "const char" to "char
15058 const", and use ANSI C rather than K&R for "main". Suggest
15059 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
15060 and suggest yy_switch_to_buffer.
15061
150622003-05-05 Paul Eggert <eggert@twinsun.com>
15063
15064 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
15065 C89. This avoids a diagnostic on compilers that define __STDC__
15066 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
15067 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
15068
150692003-05-03 Paul Eggert <eggert@twinsun.com>
15070
15071 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
15072 Do not overrun array bounds.
15073 This should fix a bug reported today by Olatunji Oluwabukunmi in
15074 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
15075
150762003-04-29 Akim Demaille <akim@epita.fr>
15077
15078 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
15079 * src/getargs.c, src/getargs.h: here, as bool, not int.
15080 (nondeterministic_parser): New.
15081 * src/parse-gram.y, src/scan-gram.l: Support
15082 %nondeterministic-parser.
15083 * src/output.c (prepare): Use nondeterministic_parser instead
15084 of glr_parser where appropriate.
15085 * src/tables.c (conflict_row, action_row, save_row)
15086 (token_actions, token_actions, pack_vector): Ditto.
15087
150882003-04-29 Akim Demaille <akim@epita.fr>
15089
15090 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
15091
150922003-04-29 Akim Demaille <akim@epita.fr>
15093
15094 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
15095 with %pure-parser and %locations to exercise the patch from Yakov
15096 Markovitch below.
15097
150982003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
15099
15100 * data/yacc.c: (b4_lex_param): Corrected for the case where
15101 %lex-param is provided and %pure-parser isn't.
15102
151032003-04-27 Paul Eggert <eggert@twinsun.com>
15104
15105 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
15106 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
15107 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
15108 if it is not defined.
15109 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
15110
151112003-04-26 Paul Eggert <eggert@twinsun.com>
15112
15113 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
15114 Declare to be of type suitable for the ninf value itself, not of
15115 type suitable for the corresponding table, since the latter might
15116 be unsigned but the ninf value might be negative. This fixes a
15117 bug reported by Alexandre Duret-Lutz in
15118 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
15119
15120 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
15121 invokes it. We shouldn't invoke it twice because it will attempt
15122 to put error.o in the archive twice. This fixes a glitch reported
15123 by Martin Mokrejs in
15124 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
15125
151262003-04-21 Paul Eggert <eggert@twinsun.com>
15127
15128 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
15129 to gnulib.
15130
151312003-04-21 Yakov Markovitch <Markovitch@iso.ru>
15132
15133 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
15134 Fix obvious typo that results in uncompilable GLR parsers
15135 when both %pure-parser and %locations are used. (trivial change)
15136
151372003-04-17 Paul Eggert <eggert@twinsun.com>
15138
15139 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
15140 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
15141 Do not insert the expected token via unput, as this runs afoul
15142 of a POSIX-compatibility bug in flex 2.5.31.
15143 All uses changed to BEGIN the parent state,
15144 since we no longer insert the expected token via unput.
15145 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
15146 that is no longer emitted after the above change.
15147
15148 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
15149 the first one. This change is from Paul Hilfinger, and it fixes
15150 regression reported by Werner Lemberg in
15151 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
15152
15153 (resolve_sr_conflict): Don't invoke state_errs_set
15154 unless one or more tokens have been explicitly made errors.
15155 Otherwise, the above change causes Bison to abort.
15156
15157 * tests/existing.at (GNU pic Grammar): New test case, taken from
15158 Lemberg's email.
15159
151602003-03-31 Akim Demaille <akim@epita.fr>
15161
15162 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
15163
151642003-03-31 Akim Demaille <akim@epita.fr>
15165
15166 * src/output.c (prepare_symbols): Avoid trailing spaces in the
15167 output.
15168
151692003-03-31 Akim Demaille <akim@epita.fr>
15170
15171 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
15172 From Paul Hilfinger.
15173
151742003-03-29 Akim Demaille <akim@epita.fr>
15175
15176 * m4/error.m4: Do not put under dynamic conditions some code which
15177 expansion is under static control.
15178
151792003-03-29 Akim Demaille <akim@epita.fr>
15180
15181 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
15182
151832003-03-29 Akim Demaille <akim@epita.fr>
15184
15185 * doc/bison.texinfo (Strings are Destroyed): New.
15186
151872003-03-13 Paul Eggert <eggert@twinsun.com>
15188
15189 * .cvsignore: Add configure.lineno.
15190 * src/.cvsignore: Add yacc.
15191 * tests/.cvsignore: Add testsuite.log.
15192 * doc/fdl.texi: Sync with latest FSF version.
15193
151942003-03-12 Paul Eggert <eggert@twinsun.com>
15195
15196 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
15197 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
15198 cursor, instead of leaving it undefined. This fixes a bug
15199 reported by Tim Van Holder in
15200 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
15201 * tests/input.at (Torturing the Scanner): Test the scanner on
15202 an empty input file, which was Tim Van Holder's test case.
15203
15204 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
15205 <sys/resource.h> can be included, include sys/time.h and
15206 sys/times.h first, if available. This works around the SunOS
15207 4.1.4 porting bug reported by Bruce Becker in
15208 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
15209
15210 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
15211 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
15212 AC_HEADER_SYS_WAIT.
15213
15214 Merge changes from gnulib. This was prompted because the CVS
15215 snapshot didn't build on Solaris 7 due to strnlen problems.
15216
15217 These changes need to be merged back into gnulib:
15218 * lib/hash.c: Include <stdbool.h> unconditionally.
15219 * m4/onceonly.m4 (m4_quote): New macro.
15220 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
15221 Quote AC_FOREACH variable-expansions properly.
15222 The 2003-01-03 obstack.h change also needs merging.
15223 {end of changes requiring merging}
15224
15225 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
15226 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
15227 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
15228 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
15229 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
15230 New files, imported from gnulib.
15231 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
15232 above.
15233
15234 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
15235 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
15236 gnulib sources.
15237
15238 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
15239 Add.
15240 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
15241 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
15242 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
15243 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
15244 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
15245 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
15246 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
15247 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
15248 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
15249 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
15250 (jm_PREREQ_ARGMATCH): Remove.
15251 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
15252 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
15253
15254 * src/system.h: Include <stdbool.h> unconditionally.
15255
15256 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
15257 assuming at least C89 in the bitset code for some time now.
15258
152592003-03-03 Akim Demaille <akim@epita.fr>
15260
15261 * ro.po: New.
15262
152632003-03-02 Akim Demaille <akim@epita.fr>
15264
15265 * doc/bison.texinfo (Table of Symbols): Reactivate the
15266 documentation for %lex-param, and %parse-param.
15267
152682003-03-02 Akim Demaille <akim@epita.fr>
15269
15270 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
15271 generate verbose error messages.
15272 Use the number of tokens as an upper bound in yytname, as it
15273 cannot be a non terminal.
15274
152752003-03-02 Akim Demaille <akim@epita.fr>
15276
15277 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
15278 message.
15279
152802003-03-02 Akim Demaille <akim@epita.fr>
15281
15282 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
15283 Use them to exercise yycheck overrun.
15284 Based on Andrew Suffield's grammar.
15285
152862003-03-02 Akim Demaille <akim@epita.fr>
15287
15288 Create tests/local.at for Bison generic testing macros.
15289
15290 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
15291 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
15292 This new file.
15293 * tests/calc.at (AT_CHECK_CALC): Adjust.
15294 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
15295 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
15296 * tests/local.at: here.
15297 (AT_COMPILE_CXX): Tags the tests using it as c++.
15298 Ignore the test if CXX is not functional.
15299
153002003-03-01 Paul Eggert <eggert@twinsun.com>
15301
15302 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
15303 not loc->end, since loc->end might contain garbage and this leads
15304 to undefined behavior on some platforms.
15305 (id_loc, token_start): Use (IF_LINTed) initial values that do not
15306 depend on *loc, so that the reader doesn't give the the false
15307 impression that *loc is initialized.
15308 (<INITIAL>"%%"): Do not bother setting code_start, since its value
15309 does not survive the return.
15310
153112003-03-01 Akim Demaille <akim@epita.fr>
15312
15313 * src/scan-gram.l (code_start): Always initialize it when entering
15314 into yylex, as SC_EPILOGUE is activated *before* the corresponding
15315 yylex invocation. An alternative would be making it static, but
15316 then it starts with the second %%'s beginning, instead of its end.
15317
153182003-02-28 Paul Eggert <eggert@twinsun.com>
15319
15320 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
15321 around a UnixWare 7.1.1 porting bug reported by John Hughes in
15322 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
15323
153242003-02-26 Paul Eggert <eggert@twinsun.com>
15325
15326 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
15327 Remove Sequent/Pyramid discussion (nobody uses them any more).
15328 Merge VMS and MS-DOS discussion; these ports may well be dead
15329 but let's keep mentioning them for now. Put <> around email
15330 addresses. Add copyright notice.
15331
153322003-02-24 Paul Eggert <eggert@twinsun.com>
15333
15334 * data/glr.c (yy_reduce_print): yylineno -> yylno,
15335 to avoid collision with flex use of yylineno.
15336 Problem reported by Bruce Lilly in
15337 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
15338 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
15339 * data/yacc.c (yy_reduce_print): Likewise.
15340
15341 * config/depcomp: Sync with Automake 1.7.3.
15342
153432003-02-21 Akim Demaille <akim@epita.fr>
15344
15345 * data/lalr1.cc: Use temporary variables instead of casts to
15346 change integer types.
15347 Suggested by Paul Eggert.
15348
153492003-02-21 Akim Demaille <akim@epita.fr>
15350
15351 * doc/bison.texinfo: Use "location" consistently to refer to @n,
15352 to avoid confusions with lalr1.cc's notion of Position.
15353 Suggested by Paul Eggert.
15354
153552003-02-20 Akim Demaille <akim@epita.fr>
15356
15357 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
15358 before initial_columns.
15359 (location.hh): Use consistent variable names when defining the
15360 operator<<.
15361 Use "last" so that we subtract from Positions, not from unsigned.
15362
153632003-02-20 Akim Demaille <akim@epita.fr>
15364
15365 * data/lalr1.cc (position.hh): New subfile, including the extended
15366 and Doxygen'ed documentation of class Position.
15367 (location.hh): Use it.
15368 Document a` la Doxygen.
15369 With the help of Benoit Perrot.
15370
153712003-02-20 Akim Demaille <akim@epita.fr>
15372
15373 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
15374 AT_YACC_IF.
15375 Redefine AT_YYERROR_SEES_LOC_IF using it.
15376 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
15377 not defined.
15378 Don't use the location in yy::Parser::error_ and
15379 yy::Parser::print_ when not %locations.
15380 Activate more lalr1.cc tests.
15381
153822003-02-19 Akim Demaille <akim@epita.fr>
15383
15384 * data/lalr1.cc: When displaying a line number, be sure to make it
15385 an int.
15386
153872003-02-19 Akim Demaille <akim@epita.fr>
15388
15389 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
15390 Remove, useless.
15391 (YYABORT, YYACCEPT, YYERROR): New.
15392 * tests/calc.at: Renable the lalr1.cc test.
15393
153942003-02-19 Akim Demaille <akim@epita.fr>
15395
15396 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
15397 error recovery, mixing with/without pops and discarding of the
15398 lookahead.
15399 Exercise YYERROR.
15400 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
15401
154022003-02-17 Paul Eggert <eggert@twinsun.com>
15403
15404 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
15405 * tests/testsuite.at (AT_COMPILE): Use them.
15406 This fixes the testsuite problem reported by Robert Lentz in
15407 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
15408
154092003-02-12 Paul Eggert <eggert@twinsun.com>
15410
15411 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
15412 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
15413 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
15414 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
15415 Check for malloc failure, for consistency with yacc.c.
15416 (yytname_size): Remove, for consistency with yacc.c.
15417
15418 The bug still remains in data/lalr1.cc, as I didn't have time
15419 to fix it there.
15420
154212003-02-06 Akim Demaille <akim@epita.fr>
15422
15423 * configure.ac (GXX): Rename as...
15424 (CXX): this, to keep the original Autoconf semantics.
15425 Require 2.57.
15426 * data/lalr1.cc: Fix b4_copyright invocations.
15427 If YYDEBUG is not defined, don't depend upon name_ being defined.
15428 (location.hh): Include string and iostream.
15429 (Position::filename): New member.
15430 (Position::Position ()): New.
15431 (operator<< (Position)): New.
15432 (operator- (Position, int)): New.
15433 (Location::first, Location::last): Rename as...
15434 (Location::begin, Location::end): these, to mock the conventional
15435 iterator names.
15436 (operator<< (Location)): New.
15437 * tests/atlocal.in (CXX): New.
15438 * tests/testsuite.at (AT_COMPILE_CXX): New.
15439 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
15440 locations in a more synthetic way.
15441 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
15442 lalr1.cc is used.
15443 Adjust the C locations to match those from Emacs: first column is
15444 column 0.
15445 Change all the expected results.
15446 Conform to the GCS: simplify the locations when applicable.
15447 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
15448 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
15449 these CPP macros with the m4 macros new defined by...
15450 (AT_CHECK_PUSHDEFS): this, i.e.:
15451 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
15452 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
15453 New macros.
15454 (AT_CHECK_POPDEFS): Undefine them.
15455 (AT_CHECK_CALC_LALR1_CC): New.
15456 Use it for the first lalr1.cc test.
15457
154582003-02-04 Akim Demaille <akim@epita.fr>
15459
15460 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
15461 Location as is defined.
15462
154632003-02-04 Akim Demaille <akim@epita.fr>
15464
15465 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
15466 name_ being defined.
15467
154682003-02-03 Paul Eggert <eggert@twinsun.com>
15469
15470 * src/gram.h (start_symbol): Remove unused decl.
15471
15472 Use more-consistent naming conventions for local vars.
15473
15474 * src/derives.c (derives_compute): Change type of local var from
15475 int to rule_number.
15476 * src/gram.c (grammar_rules_partial_print): Likewise.
15477 * src/print.c (print_core): Likewise.
15478 * src/reduce.c (reduce_grammar_tables): Likewise.
15479
15480 * src/gram.c (grammar_dump): Change name of item_number *
15481 local var from r to rp.
15482 * src/nullable.c (nullable_compute): Likewise.
15483
15484 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
15485
15486 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
15487 for symbol or symbol_number var.
15488 * src/reader.c (grammar_start_symbol_set): Likewise.
15489 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
15490 Likewise.
15491 * src/state.c (transitions_to): Likewise.
15492 * src/state.h: Likewise.
15493 * src/tables.c (symbol_number_to_vector_number): Likewise.
15494
15495 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
15496 char * var.
15497
15498 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
15499 var.
15500
15501 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
15502 var.
15503
15504 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
15505 Use str, not s, for char * var. Use ch, not c, for character var.
15506 Use size for size var.
15507
15508 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
15509 char * var.
15510 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
15511 uniqstr var.
15512 * src/uniqstr.h: Likewise.
15513
15514 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
15515 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
15516 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
15517 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
15518 param to have same name as that of enum, so that we don't use
15519 "s" to stand for a non-state.
15520
155212003-02-02 Akim Demaille <akim@epita.fr>
15522
15523 * src/scan-skel.l: Scan more than one inert character per yylex
15524 invocation.
15525
155262003-02-01 Paul Eggert <eggert@twinsun.com>
15527
15528 Version 1.875a.
15529
15530 * po/LINGUAS: Add ms.
15531
155322003-01-30 Akim Demaille <akim@epita.fr>
15533
15534 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
15535
155362003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15537
15538 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
15539 of $1.
15540
15541 Changes in response to error report by S. Eken: GLR mode does not
15542 handle negative $ indices or $ indices in embedded rules correctly.
15543 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
15544
15545 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
15546 (b4_rhs_location): Ditto.
15547 (yyfill): New function to copy from stack tree into array
15548 incrementally.
15549 (yyuserAction): Modify to allow incremental move of semantic values
15550 to rhs array when in GLR mode.
15551 Define YYFILL to use in user-defined actions to fill semantic array
15552 as needed.
15553 Remove dummy use of yystack, as there is now a guaranteed use.
15554 (yydoAction): Modify to allow incremental move of semantic values
15555 to rhs array when in GLR mode.
15556 (yyresolveAction): Ditto.
15557 (yyglrShiftDefer): Update comment.
15558 (yyresolveStates): Use X == NULL for pointers, not !X.
15559 (yyglrReduce): Ditto.
15560 (yydoAction): Ditto
15561
15562 * tests/glr-regr1.at: Rename to ...
15563 * tests/glr-regression.at: Add new regression test for the problems
15564 described above (adapted from S. Eken).
15565 Update copyright notice.
15566 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
15567 * tests/Makefile.am: Ditto.
15568
155692003-01-28 Paul Eggert <eggert@twinsun.com>
15570
15571 * data/lalr1.cc: Do not use @output_header_name@ unless
15572 b4_defines_flag is set. This fixes two bugs reported by
15573 Tim Van Holder in
15574 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
15575 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
15576
155772003-01-21 Paul Eggert <eggert@twinsun.com>
15578
15579 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
15580 we don't need to worry about yyerrlab1 being reported as an
15581 "unused label" by non-GCC C compilers. The downside is that if
15582 locations are used then a couple of statements are duplicated each
15583 time YYERROR is invoked, but the upside is that the warnings
15584 should vanish.
15585 (yyerrlab1): Move code to YERROR.
15586 (yyerrlab2): Remove. Change uses back to yyerrlab1.
15587 This reverts some of the 2002-12-27 change.
15588
155892003-01-17 Paul Eggert <eggert@twinsun.com>
15590
15591 * src/output.c (symbol_printers_output): Fix typo that led
15592 to core dump. Problem reported by Antonio Rus in
15593 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
15594
155952003-01-13 Akim Demaille <akim@epita.fr>,
15596 Quoc Peyrot <chojin@lrde.epita.fr>,
15597 Robert Anisko <anisko_r@lrde.epita.fr>
15598
15599 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
15600 when the stacks contain one element, as the loop would otherwise
15601 free the last state, and then use the top state (the one we just
15602 popped). This means that the initial elements will not be freed
15603 explicitly, as is the case in yacc.c; it is not a problem, as
15604 these elements have fake values.
15605
156062003-01-11 Paul Eggert <eggert@twinsun.com>
15607
15608 * NEWS: %expect-violations are now just warnings, reverting
15609 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
15610 bootstrapping problem reported by Matthias Klose; see
15611 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
15612 * src/conflicts.c (conflicts_print): Likewise.
15613 * tests/conflicts.at (%expect not enough, %expect too much,
15614 %expect with reduce conflicts): Likewise.
15615 * doc/bison.texinfo (Expect Decl): Document this. Also mention
15616 that the warning is enabled if the number of conflicts changes
15617 (not necessarily increases).
15618
15619 * src/getargs.c (version): Update copyright year.
15620
156212003-01-09 Akim Demaille <akim@epita.fr>
15622
15623 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
15624
156252003-01-08 Paul Eggert <eggert@twinsun.com>
15626
15627 * Makefile.maint (WGETFLAGS):
15628 New macro, containing "-C off" to disable proxy caches.
15629 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
15630 (rel-check): Use $(WGET) instead of wget.
15631
156322003-01-06 Paul Eggert <eggert@twinsun.com>
15633
15634 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
15635 the GLR paper of Scott, Johnstone and Hussain.
15636
156372003-01-04 Paul Eggert <eggert@twinsun.com>
15638
15639 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
15640 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
15641 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
15642 (EXTRA_LIBRARIES): New var, for liby.a.
15643 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
15644 (EXTRA_SCRIPTS): New var, for yacc.
15645
15646 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
15647 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
15648 Problem reported by Nelson H. F. Beebe.
15649
156502003-01-03 Paul Eggert <eggert@twinsun.com>
15651
15652 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
15653 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
15654 when compiling Bison 1.875's `bitset bset = obstack_alloc
15655 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
15656
15657 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
15658 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
15659 grow to a huge size with typical invocation.
15660
15661 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
15662 Use the pattern recommended by Autoconf 2.57, except also protect
15663 against double-definition.
15664 * src/system.h: Likewise.
15665 Portability issues reported by Nelson H. F. Beebe.
15666
15667 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
15668 All uses changed. Provide a definition in both C and C++.
15669 (yytrue, yyfalse): Define even if defined (__cplusplus).
15670
15671 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
15672 Reported by Nelson H. F. Beebe.
15673
15674 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
15675
156762003-01-02 Paul Eggert <eggert@twinsun.com>
15677
15678 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
15679 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
15680 Bug reported by Nelson H. F. Beebe.
15681
156822003-01-01 Paul Eggert <eggert@twinsun.com>
15683
15684 * Version 1.875.
15685
156862002-12-30 Paul Eggert <eggert@twinsun.com>
15687
15688 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
15689 Moved here from...
15690 (<INITIAL>","): Here. This causes stray "," to be treated
15691 more uniformly.
15692
15693 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
15694 last brace in braced code when not in Yacc mode, for compatibility
15695 with Bison 1.35. This resurrects the 2001-12-15 patch to
15696 src/reader.c.
15697
15698 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
15699 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
15700
157012002-12-28 Paul Eggert <eggert@twinsun.com>
15702
15703 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
15704 that of SYM's type. This fixes Debian bug 168069, reported by
15705 Thomas Olsson.
15706
157072002-12-28 Paul Eggert <eggert@twinsun.com>
15708
15709 Version 1.75f.
15710
15711 Switch back to the Yacc style of conflict reports, undoing some
15712 of the 2002-07-30 change.
15713 * doc/bison.texinfo (Understanding): Use Yacc style for
15714 conflict reports. Also, use new way of locating rules.
15715 * src/conflicts.c (conflict_report):
15716 Renamed from conflict_report_yacc, removing the old
15717 'conflict_report'. Translate the entire conflict report at once,
15718 so that we don't assume that "," has the same interpretation in
15719 all languages.
15720 (conflicts_output): Use Yacc-style conflict report for each state,
15721 instead of our more-complicated style.
15722 (conflicts_print): Use Yacc-style conflict report, except print
15723 the input file name when not emulating Yacc.
15724 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
15725 Conflicted Reduction, %expect not enough, %expect too much,
15726 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
15727 * tests/existing.at (GNU Cim Grammar): Likewise.
15728 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
15729
15730 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
15731 fatal): Don't invoke fflush; it's not needed and it might even be
15732 harmful for stdout, as stdout might not be open.
15733 * src/reduce.c (reduce_print): Likewise.
15734
157352002-12-27 Paul Eggert <eggert@twinsun.com>
15736
15737 Fix a bug where error locations were not being recorded correctly.
15738 This problem was originally reported by Paul Hilfinger in
15739 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
15740
15741 * data/yacc.c (yyparse): New local var yylerrsp, to record the
15742 top of the location stack's error locations.
15743 (yyerrlab): Set it. When discarding a token, push its location
15744 onto yylerrsp so that we don't lose track of the error's end.
15745 (yyerrlab1): Now is only the target of YYERROR, so that we can
15746 properly record the location of the action that failed. For GCC
15747 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
15748 GCC warning about yyerrlab1 being unused if YYERROR is unused.
15749 (yyerrlab2): New label, which yyerrlab now falls through to.
15750 Compute the error's location by applying YYLLOC_DEFAULT to
15751 the locations of all the symbols that went into the error.
15752 * doc/bison.texinfo (Location Default Action): Mention that
15753 YYLLOC_DEFAULT is also invoked for syntax errors.
15754 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
15755 Error locations include the locations of all the tokens that were
15756 discarded, not just the last token.
15757
157582002-12-26 Paul Eggert <eggert@twinsun.com>
15759
15760 * src/files.c: Include quote.h.
15761 (compute_output_file_names): Warn if we detect conflicting
15762 outputs to the same file. This should catch the misunderstanding
15763 exemplified by Debian Bug 165349, reported by Bruce Stephens..
15764
15765 * src/conflicts.c (conflicts_print): If the user specifies
15766 "%expect N", report an error if there are any reduce/reduce
15767 conflicts. This is what the manual says should happen.
15768 This fixes Debian bug 130890, reported by Anthony DeRobertis.
15769 * tests/conflicts.at (%expect with reduce conflicts): New test.
15770
15771 Don't use m4_include on relative file names, as it doesn't work as
15772 desired if there happens to be a file with that name under ".".
15773
15774 * m4sugar/version.m4: Remove; it was included but it wasn't used.
15775 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
15776 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
15777 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
15778 * src/output.c (output_skeleton): Use full path names when
15779 specifying a file to include; don't rely on include path, as
15780 it's unreliable when the working file contains a file with
15781 that name.
15782
157832002-12-25 Paul Eggert <eggert@twinsun.com>
15784
15785 Remove obsolete references to bison.simple and bison.hairy.
15786 Problem mentioned by Aubin Mahe in
15787 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
15788 * data/glr.c: Comment fix.
15789 * doc/bison.1: Remove references. Also, mention "yacc".
15790
15791 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
15792 with -g option.
15793
15794 * src/parse-gram.y (declaration): Use enum "report_states" rather
15795 than its numeric value 1.
15796
15797 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
15798 opening a new one. This fixes Debian bug 165349, reported by
15799 Bruce Stephens.
15800
158012002-12-24 Paul Eggert <eggert@twinsun.com>
15802
15803 Version 1.75e.
15804
15805 * Makefile.maint (cvs-update): Don't assume that the shell
15806 supports $(...), as Solaris sh doesn't.
15807
15808 * src/parse-gram.y (lloc_default): Remove test for empty
15809 nonterminals at the end, since it didn't change the result.
15810
158112002-12-24 Paul Eggert <eggert@twinsun.com>
15812
15813 If the user does not define YYSTYPE as a macro, Bison now declares it
15814 using typedef instead of defining it as a macro. POSIX requires this.
15815 For consistency, YYLTYPE is also declared instead of defined.
15816
15817 %union directives can now have a tag before the `{', e.g., the
15818 directive `%union foo {...}' now generates the C code
15819 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
15820 The default union tag is `YYSTYPE', for compatibility with Solaris 9
15821 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
15822 instead of `yyltype'.
15823
15824 `yystype' and `yyltype' are now obsolescent macros instead of being
15825 typedefs or tags; they are no longer documented and will be
15826 withdrawn in a future release.
15827
15828 * data/glr.c (b4_location_type): Remove.
15829 (YYSTYPE): Renamed from yystype.
15830 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
15831 (struct YYLTYPE): Renamed from struct yyltype.
15832 (YYLTYPE): Renamed from yyltype.
15833 (yyltype, yystype): New (and obsolescent) macros,
15834 for backward compatibility.
15835 * data/yacc.c: Likewise.
15836
15837 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
15838 does not specify a union tag. This is for compatibility with
15839 Solaris 9 yacc.
15840
15841 * src/parse-gram.y (add_param): 2nd arg is now char * not char
15842 const *, since it is now modified by stripping surrounding { }.
15843 (current_braced_code): Remove.
15844 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
15845 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
15846 trailing " {...}". Now of type <chars>.
15847 (grammar_declaration): Adjust to bundled tokens.
15848 (code_content): Remove; stripping is now done by add_param.
15849 (print_token_value): Print contents of bundled tokens.
15850 (token_name): New function.
15851
15852 * src/reader.h (braced_code, current_braced_code): Remove.
15853 (token_name): New decl.
15854
15855 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
15856 token_type, not braced_code code_kind. All uses changed.
15857 (SC_PRE_CODE): New state, for scanning after a keyword that
15858 has (or usually has) an immediately-following braced code.
15859 (token_type): New local var, to keep track of which token type
15860 to return when scanning braced code.
15861 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
15862 <INITIAL>"%parse-param", <INITIAL>"%printer",
15863 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
15864 instead of returning a token type immediately.
15865 (<INITIAL>"{"): Set token type.
15866 (<SC_BRACED_CODE>"}"): Use it.
15867 (handle_action_dollar, handle_action_at): Now returns bool
15868 indicating success. Fail if ! current_rule; this prevents a core dump.
15869 (handle_symbol_code_dollar, handle_symbol_code_at):
15870 Remove; merge body into caller.
15871 (handle_dollar, handle_at): Complain in invalid contexts.
15872
15873 * NEWS, doc/bison.texinfo: Document the above.
15874 * NEWS: Fix years and program names in copyright notice.
15875
158762002-12-17 Paul Eggert <eggert@twinsun.com>
15877
15878 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
15879 Reporting, Table of Symbols): Omit mentions of %lex-param and
15880 %parse-param from the documentation for now.
15881
158822002-12-15 Paul Eggert <eggert@twinsun.com>
15883
15884 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
15885 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
15886 lookahead symbol, and which sets yychar in parser actions) and it
15887 disagreed with the Bison documentation. Bug
15888 reported by Andrew Walrond.
15889
15890 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
15891 as the caller now does that.
15892 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
15893 (YYEMPTY): Parenthesize right hand side, since others use it.
15894 (yyparse): Don't assume that our generated code is the only code
15895 that sets yychar.
15896
158972002-12-13 Paul Eggert <eggert@twinsun.com>
15898
15899 Version 1.75d.
15900
15901 POSIX requires a "yacc" command.
15902 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
15903 (MOSTLYCLEANFILES): Add yacc.
15904 (yacc): New rule.
15905 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
15906 as an alias for bison y.
15907
15908 * po/LINGUAS: Add da.
15909
15910 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
15911 problem with latest <getopt.h>.
15912 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
15913
15914 * doc/fdl.texi: Upgrade to 1.2.
15915 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
15916 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
15917 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
15918 gnulib.
15919 * config/install-sh: Sync with autotools.
15920
15921 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
15922 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
15923 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
15924 locations are requested.
15925 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
15926 locations are requested.
15927
159282002-12-12 Paul Eggert <eggert@twinsun.com>
15929
15930 Remove unportable casts and storage allocation tricks.
15931 While we're at it, remove almost all casts, since they
15932 usually aren't needed and are a sign of trouble.
15933
15934 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
15935
15936 * src/derives.c (derives_compute): Do not subtract NTOKENS from
15937 the pointer DSET returned by malloc; this isn't portable.
15938 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
15939 Similarly for DERIVES.
15940 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
15941 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
15942 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
15943
15944 * src/derives.c (derives_compute): Do not bother invoking
15945 int_of_rule_number, since rule numbers are integers.
15946
15947 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
15948 rather than XMALLOC (char, N).
15949
15950 * src/files.c (filename_split): Rewrite to avoid cast.
15951
15952 * src/gram.h (symbol_number_as_item_number,
15953 item_number_as_symbol_number, rule_number_as_item_number,
15954 item_number_as_rule_number):
15955 Now inline functions rather than macros, to avoid casts.
15956 * src/state.h (state_number_as_int): Likewise.
15957 * src/tables.c (state_number_to_vector_number,
15958 symbol_number_to_vector_number): Likewise.
15959
15960 * src/gram.h (int_of_rule_number): Remove; no longer used.
15961
15962 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
15963 since the resulting storage is always stored into.
15964
15965 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
15966 where it's needed.
15967
15968 * src/muscle_tab.c (muscle_m4_output):
15969 Now inline. Return bool, not int.
15970 * src/state.c (state_compare): Likewise.
15971 * src/symtab.c (symbol_check_defined,
15972 symbol_check_alias_consistency, symbol_pack, symbol_translation,
15973 hash_compare_symbol, hash_symbol):
15974 Likewise.
15975 * src/uniqstr.c (uniqstr_print): Likewise.
15976 * src/muscle_tab.c (muscle_m4_output_processor):
15977 New function, to avoid casts.
15978 * src/state.c (state_comparator, stage_hasher): Likewise.
15979 * src/symtab.c (symbol_check_defined_processor,
15980 symbol_check_alias_consistency_processor, symbol_pack_processor,
15981 symbol_translation_processor, hash_symbol_comparator,
15982 hash_symbol_hasher): Likewise.
15983 * src/uniqstr.c (uniqstr_print_processor): Likewise.
15984 * src/muscle_tab.c (muscles_m4_output):
15985 Use new functions instead of casting old functions unportably.
15986 * src/state.c (state_hash_new): Likewise.
15987 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
15988 symbols_token_translations_init):
15989 Likewise.
15990 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
15991
15992 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
15993 var instead of casting to long, to avoid casts.
15994 (prepare_states): Use MALLOC rather than alloca, so that we don't
15995 have to worry about alloca.
15996 * src/state.c (state_hash_lookup): Likewise.
15997
15998 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
15999 local var instead of casting to unsigned char, to avoid casts.
16000
16001 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
16002 STATE_ALLOC): Remove.
16003 (transitions_new, errs_new, reductions_new, state_new): Use malloc
16004 rather than calloc, and use offsetof to avoid allocating slightly
16005 too much storage.
16006 (state_new): Initialize all members.
16007
16008 * src/state.c (state_hash): Use unsigned accumulator, not signed.
16009
16010 * src/symtab.c (symbol_free): Remove; unused.
16011 (symbol_get): Remove cast in lhs of assignment.
16012 (symbols_do): Now static. Accept generic arguments, not
16013 hashing-related ones.
16014
16015 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
16016 (symbol_processor): Remove.
16017 (symbols_do): Remove decl; now static.
16018
16019 * src/system.h (alloca): Remove; decl no longer needed.
16020 (<stddef.h>): Include, for offsetof.
16021 (<inttypes.>, <stdint.h>): Include if available.
16022 (uintptr_t): New type, if system lacks it.
16023 (CALLOC, MALLOC, REALLOC): New macros.
16024 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
16025 new macros.
16026
16027 * src/tables.c (table_size): Now int, to pacify GCC.
16028 (table_grow, table_ninf_remap): Use signed table size.
16029 (save_row): Don't bother initializing locals when not needed.
16030 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
16031 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
16032
16033 * src/vcg.h: Correct misspellings.
16034
16035 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
16036
16037
16038 * src/getargs.c (getargs): Don't assume EOF == -1.
16039
160402002-12-09 Paul Eggert <eggert@twinsun.com>
16041
16042 Change identifier spellings to avoid collisions with names
16043 that are reserved by POSIX.
16044
16045 Don't use names ending in _t, since POSIX reserves them.
16046 For consistency, remove _e and _s endings -- they're weren't
16047 needed to remove ambiguity. All uses changed.
16048 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
16049 turn was just renamed from struniq_t.
16050 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
16051 which in turn was just renamed from struniq_processor_t.
16052 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
16053 in turn was renamed from hash_compare_struniq_t.
16054 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
16055 (state_list): Renamed from state_list_t.
16056 * src/assoc.h (assoc): Renamed from assoc_t.
16057 * src/conflicts.c (enum conflict_resolution): Renamed from
16058 enum conflict_resolution_e.
16059 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
16060 (rule_list): Renamed from rule_list_t.
16061 * src/getargs.h (enum trace): Renamed from enum trace_e.
16062 (enum report): Renamed from enum report_e.
16063 * src/gram.h (item_number): Renamed from item_number_t.
16064 (rule_number): Renamed from rule_number_t.
16065 (struct rule_s): Remove the "rule_s" part; not used.
16066 (rule): Renamed from rule_t.
16067 (rule_filter): Renamed from rule_filter_t.
16068 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
16069 (goto_list): Renamed from goto_list_t.
16070 * src/lalr.h (goto_number): Renamed from goto_number_t.
16071 * src/location.h (location): Renamed from location_t.
16072 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
16073 and moved here from:
16074 * src/muscle_tab.h (muscle_entry_t): here.
16075 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
16076 (rule_list): Renamed from rule_list_t.
16077 * src/print_graph.c (static_graph): Renamed from graph.
16078 * src/reader.h (braced_code): Renamed from braced_code_t.
16079 Remove brace_code_e tag.
16080 * src/relation.h (relation_node): Renamed from relation_node_t.
16081 (relation_nodes): Renamed from relation_nodes_t.
16082 (relation): Renamed from relation_t.
16083 * src/state.h (state_number): Renamed from state_number_t.
16084 (struct state): Renamed from struct state_s.
16085 (state): Renamed from state_t.
16086 (transitions): Renamed from transitions_t. Unused (and
16087 misspelled) transtion_s tag removed.
16088 (errs): Renamed from errs_t. Unused errs_s tag removed.
16089 (reductions): Renamed from reductions_t. Unused tag
16090 reductions_s removed.
16091 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
16092 (struct symbol_list): Renamed from struct symbol_list_s.
16093 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
16094 (struct symbol): Renamed from struct symbol_s.
16095 (symbol): Renamed from symbol_t.
16096 * src/tables.c (vector_number): Renamed from vector_number_t.
16097 (action_number): Renamed from action_t.
16098 * src/tables.h (base_number): Renamed from base_t.
16099 * src/vcg.h (enum color): Renamed from enum color_e.
16100 (enum textmode): Renamed from enum textmode_e.
16101 (enum shape): Renamed from enum shape_e.
16102 (struct colorentry): Renamed from struct colorentry_s.
16103 (struct classname): Renamed from struct classname_s.
16104 (struct infoname): Renamed from struct infoname_s.
16105 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
16106 (enum decision): Renamed from enum decision_e.
16107 (enum orientation): Renamed from enum orientation_e.
16108 (enum alignment): Renamed from enum alignment_e.
16109 (enum arrow_mode): Renamed from enum arrow_mode_e.
16110 (enum crossing_type): Renamed from enum crossing_type_e.
16111 (enum view): Renamed from enum view_e.
16112 (struct node): Renamed from struct node_s.
16113 (node): Renamed from node_t.
16114 (enum linestyle): Renamed from enum linestyle_e.
16115 (enum arrowstyle): Renamed from enum arrowstyle_e.
16116 (struct edge): Renamed from struct edge.
16117 (edge): Renamed from edge_t.
16118 (struct graph): Renamed from struct graph_s.
16119 (graph): Renamed from graph_t.
16120 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
16121 Rename value_t -> value.
16122 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
16123 value_t_as_yystype -> value_as_yystype.
16124
16125 Don't include <errno.h> in the mainstream code, since it
16126 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
16127 * lib/get-errno.c, lib/get-errno.h: New files.
16128 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
16129 get-errno.c.
16130 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
16131 * src/output.c (output_skeleton): Likewise.
16132 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
16133 instead of errno.
16134 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
16135 Likewise.
16136 (handle_action_dollar, handle_action_at): Likewise.
16137 * src/system.h: Do not include <errno.h>.
16138 (TAB_EXT): Renamed from EXT_TAB.
16139 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
16140
16141 Avoid str[a-z]*, since <string.h> reserves that name space.
16142 Change all instances of "struniq" in names to "uniqstr", and
16143 likewise for "STRUNIQ" and "UNIQSTR".
16144 * src/uniqstr.c: Renamed from src/struniq.c.
16145 * src/uniqstr.h: Renamed from src/struniq.h.
16146 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
16147 * src/files.c (strsuffix): Remove; unused.
16148 (concat2): Renamed from stringappend. Now static.
16149 * src/files.h (strsuffix, stringappend): Remove; unused.
16150 * src/parse-gram.y (<chars>): Renamed from <string>.
16151 (<uniqstr>): Renamed from <struniq>.
16152 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
16153 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
16154 (struct graph_s.expand): Renamed from struct graph_s.stretch.
16155 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
16156 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
16157 (N_EXPAND): Renamed from N_STRETCH.
16158
16159 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
16160 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
16161 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
16162 Remove; unused.
16163 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
16164 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
16165 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
16166 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
16167 (BASE_MAXIMUM): Renamed from BASE_MAX.
16168 (BASE_MINIMUM): Renamed from BASE_MIN.
16169 (ACTION_MAX): Remove; unused.
16170 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
16171 Unnecessary casts removed from above defines.
16172
16173
16174 Fix misspelling in names.
16175 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
16176 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
16177 G_NODE_ALIGNEMENT.
16178
16179
16180 * lib/timevar.c (timevar_report): Renamed from time_report,
16181 for consistency with other names.
16182 * lib/timevar.h (timevar_report): New decl.
16183 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
16184
16185
16186 Sort include-file uses.
16187
16188 Reorder all include files under src to be in the order "system.h".
16189 then the ../lib include files in angle brackets (alphabetized),
16190 then the . include files in double-quotes (alphabetized). Fix
16191 dependency breakages encountered in this process, as follows:
16192 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
16193 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
16194 * src/state.h: Include "symtab.h".
16195
161962002-12-08 Paul Eggert <eggert@twinsun.com>
16197
16198 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
16199 since this causes problems when __file__ contains character
16200 sequences like "@" that are treated specially by src/scan-skel.l.
16201 Instead, just use the file's basename. This fixes the bug
16202 reported by Martin Mokrejs in
16203 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
16204
162052002-12-06 Paul Eggert <eggert@twinsun.com>
16206
16207 Add support for rules that do not have trailing semicolons, as
16208 POSIX requires. Improve the quality of locations in Bison
16209 diagnostics.
16210
16211 * src/location.c: Include <quotearg.h>.
16212 (empty_location): Now const.
16213 (location_print): New function. Follow the recommendation of the
16214 GNU Coding Standards for locations that span file boundaries.
16215 * src/location.h: Do not include <quotearg.h>; no longer needed.
16216 (boundary): New type.
16217 (location_t): Use it. This allows locations to span file boundaries.
16218 All member uses changed: file -> start.file or end.file (as needed),
16219 first_line -> start.line, first_column -> start.column,
16220 last_line -> end.line, last_column -> end.column.
16221 (equal_boundaries): New function.
16222 (LOCATION_RESET, LOCATION_STEP): Remove.
16223 (LOCATION_PRINT): Remove. All callers changed to use location_print.
16224 (empty_location): Now const.
16225 (location_print): New decl.
16226 * src/parse-gram.y (lloc_default): New function, which handles
16227 empty locations more accurately.
16228 (YYLLOC_DEFAULT): Use it.
16229 (%token COLON): Remove.
16230 (%token ID_COLON): New token.
16231 (rules): Use it.
16232 (declarations, rules): Remove trailing semicolon.
16233 (declaration, rules_or_grammar_declaration):
16234 Allow empty (";") declaration.
16235 (symbol_def): Remove empty actions; no longer needed.
16236 (rules_or_grammar_declaration): Remove trailing semicolon.
16237 (semi_colon.opt): Remove.
16238 * src/reader.h: Include location.h.
16239 (scanner_cursor): New decl.
16240 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
16241 rolling our own.
16242 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
16243 of *loc.
16244 (STEP): Remove. No longer needed, now that adjust_location does
16245 the work. All uses removed.
16246 (scanner_cursor): New var.
16247 (adjust_location): Renamed from extend_location. It now sets
16248 *loc and adjusts the scanner cursor. All uses changed.
16249 Don't bother testing for CR.
16250 (handle_syncline): Remove location arg; now updates scanner cursor.
16251 All callers changed.
16252 (unexpected_end_of_file): Now accepts start boundary of token or
16253 comment, not location. All callers changed. Update scanner cursor,
16254 not the location.
16255 (SC_AFTER_IDENTIFIER): New state.
16256 (context_state): Renamed from c_context. All uses changed.
16257 (id_loc, code_start, token_start): New local vars.
16258 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
16259 processing of Yacc white space and equivalents here.
16260 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
16261 instead of returning ID immediately, since we need to search for
16262 a subsequent colon.
16263 (<INITIAL>"'", "\""): Save token_start.
16264 (<INITIAL>"%{", "{", "%%"): Save code_start.
16265 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
16266 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
16267 BEGIN context_state at end, not INITIAL.
16268 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
16269 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
16270 Return correct token start.
16271 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
16272 the start of a character, string or multiline comment is found.
16273 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
16274 Reduction): Adjust reported locations to match the more-precise
16275 results now expected.
16276 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
16277 * tests/reduce.at (Useless Rules, Reduced Automaton,
16278 Underivable Rules): Likewise.
16279 * tests/regression.at (Invalid inputs): No longer `expecting ";"
16280 or "|"' now that so many other tokens are allowed by the new grammar.
16281
16282 * src/complain.h (current_file): Remove duplicate decl;
16283 current_file is now owned by files.h.
16284 * src/complain.c, src/scan-gram.l: Include files.h.
16285
162862002-12-06 Paul Eggert <eggert@twinsun.com>
16287
16288 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
16289 promotes to int; it might be unsigned int.
16290 * data/yacc.c (yy_reduce_print): Likewise.
16291
16292 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
16293 be #defined in the prologue, not in the Bison declarations.
16294 This fixes Debian Bug 102878, reported by Shaul Karl.
16295
162962002-12-02 Paul Eggert <eggert@twinsun.com>
16297
16298 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
16299 * lib/strtoul.c: New file, from gnulib.
16300 This fixes a porting bug reported by Peter Klein in
16301 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
16302
163032002-11-30 Paul Eggert <eggert@twinsun.com>
16304
16305 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
16306 and put only a forward declaration in the prologue. This is for
16307 consistency with the other scanner helper functions.
16308
16309 Type clashes now generate warnings, not errors, since it
16310 appears that POSIX may allow some grammars with type clashes.
16311 * src/reader.c (grammar_current_rule_check): Warn about
16312 type clashes instead of complaining.
16313 * tests/input.at (Type Clashes): Expect warnings, not complaints.
16314
16315 Add Yacc library, since POSIX requires it.
16316 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
16317 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
16318 * lib/main.c, lib/yyerror.c: New files.
16319
16320 gram_error can be static; it need not be extern.
16321 * src/reader.h (gram_error): Remove decl.
16322 * src/parse-gram.y (gram_error): Now static. Add static decl.
16323 (print_token_value): Omit parameter names from forward decl,
16324 for consistency.
16325
163262002-11-29 Paul Eggert <eggert@twinsun.com>
16327
16328 * doc/bison.texinfo: Emphasize that yylex and yyerror must
16329 be declared before being used. E.g., one should typically
16330 declare them in the prologue. Use GNU coding style in examples.
16331 Put "const" consistently after the type it modifies. Mention
16332 that C99 supports "inline". Mention that yyerror traditionally
16333 returns "int".
16334
16335 %parse-param and %lex-param now take just one argument, the
16336 declaration; the argument name is deduced from the declaration.
16337
16338 * doc/bison.texinfo (Parser Function, Pure Calling, Error
16339 Reporting, Table of Symbols): Document this.
16340 * src/parse-gram.y (add_param): New function.
16341 (COMMA): Remove.
16342 (declaration): Implement new rule for %parse-param and %lex-param.
16343 * src/scan-gram.l: "," now elicits a warning, rather than being
16344 a token; this is more compatible with byacc.
16345 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
16346
163472002-11-27 Paul Eggert <eggert@twinsun.com>
16348
16349 Rename identifiers to avoid real and potential collisions.
16350
16351 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
16352 to avoid collision with lex macro described by Bruce Lilly in
16353 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
16354 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
16355 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
16356 * src/parse-gram.y (print_token_value): Renamed from yyprint.
16357 All uses changed.
16358 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
16359 The name "yycontrol" violates the name space rules, and this stuff
16360 wasn't being used anyway.
16361 (input): Remove action; this stuff wasn't being used.
16362 (gram_error): Rename local variable yylloc -> loc.
16363 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
16364 (YY_DECL): Don't use "yy" at start of local variables.
16365 All uses changed, e.g., yylloc -> loc.
16366 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
16367 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
16368 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
16369 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
16370
16371 * src/parse-gram.y (gram_error): loc is now const *.
16372 * src/reader.h (gram_error): Likewise.
16373
163742002-11-24 Paul Eggert <eggert@twinsun.com>
16375
16376 Version 1.75c.
16377
16378 * tests/actions.at (Actions after errors): Use an output format
16379 more similar to that of the Printers and Destructors test.
16380 Test the position of the ';' token too.
16381 (Printers and Destructors): Likewise.
16382 (Printers and Destructors: %glr-parser): Remove for now, to avoid
16383 unnecessarily alarming people when the test fails.
16384
16385 * data/yacc.c (yyerrlab1): Move this label down, so that the
16386 parser does not discard the lookahead token if the user code
16387 invokes YYERROR. This change is required for POSIX conformance.
16388
16389 * lib/error.c: Sync with gnulib.
16390
163912002-11-22 Paul Eggert <eggert@twinsun.com>
16392
16393 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
16394 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
16395 * lib/xmalloc.c: Likewise.
16396
163972002-11-20 Paul Eggert <eggert@twinsun.com>
16398
16399 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
16400
164012002-11-20 Paul Eggert <eggert@twinsun.com>
16402
16403 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
16404 should use `if (! x) abort ();' rather than `assert (x);', and
16405 anyway it's one less thing to worry about configuring.
16406
16407 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
16408 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
16409 and replace all instances of assert with abort.
16410 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
16411 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
16412
16413 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
16414 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
16415 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
16416 hash_find_entry, hash_rehash, hash_insert): Likewise.
16417 * src/conflicts.c (resolve_sr_conflict): Likewise.
16418 * src/lalr.c (set_goto_map, map_goto): Likewise.
16419 * src/nullable.c (nullable_compute): Likewise.
16420 * src/output.c (prepare_rules, token_definitions_output): Likewise.
16421 * src/reader.c (packgram, reader): Likewise.
16422 * src/state.c (state_new, state_free, state_transitions_set,
16423 state_reduction_find): Likewise.
16424 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
16425 symbol_pack): Likewise.
16426 * src/tables.c (conflict_row, pack_vector): Likewise.
16427 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
16428 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
16429 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
16430 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
16431
16432 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
16433 (ARGMATCH_CONSTRAINT): New macro.
16434 (ARGMATCH_ASSERT): Use it.
16435
16436 * src/system.h (verify): New macro.
16437 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
16438 rather than assert.
16439 * src/tables.c (tables_generate): Likewise.
16440
16441 * src/struniq.c (struniq_assert): Now returns void, and aborts
16442 if the assertion is false.
16443 (struniq_assert_p): Remove.
16444 * src/struniq.h: Likewise.
16445
164462002-11-18 Paul Eggert <eggert@twinsun.com>
16447
16448 * data/glr.c (yygetLRActions): Replace `yyindex' with
16449 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
16450 This fixes the regression with Sun ONE Studio 7 cc that I reported in
16451 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
16452
164532002-11-18 Akim Demaille <akim@epita.fr>
16454
16455 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
16456 space.
16457 From Tim Van Holder.
16458
164592002-11-17 Paul Eggert <eggert@twinsun.com>
16460
16461 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
16462 to "SyntaxError" for consistency with my 2002-11-15 change.
16463
16464 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
16465 not define to {}, since this breaks the common use of `YYDPRINTF
16466 ((...));' if a single statement is desired (e.g. before `else').
16467 Work around GCC warnings by surrounding corresponding calls with
16468 {} if needed.
16469 (yyhasResolvedValue): Remove unused function.
16470 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
16471 loop body.
16472 (yyreportSyntaxError): Renamed from yyreportParseError.
16473 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
16474 All uses changed.
16475 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
16476 extern when possible. Remove unused initializations.
16477
164782002-11-16 Akim Demaille <akim@epita.fr>
16479
16480 Augment the similarity between GLR and LALR traces.
16481
16482 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
16483 (YY_REDUCE_PRINT): New.
16484 (yyparse): Use them.
16485 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
16486 YYDPRINT here.
16487 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
16488 state reached after the reduction/recovery, since...
16489 (yyparse, yyprocessOneStack): Report the state we are entering in.
16490
164912002-11-16 Akim Demaille <akim@epita.fr>
16492
16493 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
16494 Add support for --trace=skeleton.
16495 * src/scan-skel.l: %option debug.
16496 Scan strings of non-@ or \n instead of character by character.
16497 (scan_skel): Handle trace_skeleton.
16498 (QPUTS): New.
16499 (@output_parser_name@, @output_header_name@): ``Restore'' their
16500 support (used to be M4 macros).
16501 * data/yacc.c: Quote larger chunks, a la glr.c.
16502 * data/lalr1.cc: Likewise.
16503 The header guards are no longer available, so use some other
16504 string than `YYLSP_NEEDED'.
16505
165062002-11-16 Akim Demaille <akim@epita.fr>
16507
16508 Make the ``Printers and Destructors'' test more verbose, taking
16509 `yacc.c''s behavior as (possibly wrong) reference.
16510
16511 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
16512 instead of fprint on stdout.
16513 Set and report the last_line of the symbols.
16514 Consistently display values and locations.
16515
165162002-11-16 Paul Eggert <eggert@twinsun.com>
16517
16518 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
16519
165202002-11-15 Paul Eggert <eggert@twinsun.com>
16521
16522 * tests/actions.at (Actions after errors): New test case.
16523
16524 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
16525 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
16526 tests/action.at, tests/calc.at, tests/conflicts.at,
16527 tests/cxx-type.at, tests/regression.at:
16528 "parse error" -> "syntax error" for POSIX compatibility.
16529 "parsing stack overflow..." -> "parser stack overflow" so
16530 that code matches Bison documentation.
16531
165322002-11-15 Akim Demaille <akim@epita.fr>
16533
16534 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
16535 take two BRACED_CODE, not two string_content.
16536 Free the scanner's obstack when we are done.
16537 (code_content): New.
16538 * tests/calc.at: Adjust.
16539 * doc/bison.texinfo: Adjust.
16540 Also, make sure to include the `,' for these declarations.
16541
165422002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
16543
16544 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
16545 definition; avoids potential autoreconf problems.
16546
165472002-11-15 Akim Demaille <akim@epita.fr>
16548
16549 Always check the value returned by yyparse.
16550
16551 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
16552 returned by yyparse.
16553 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
16554 Adjust calls.
16555 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
16556 returned by yyparse.
16557
165582002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16559
16560 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
16561 on input.at test.
16562
165632002-11-14 Paul Eggert <eggert@twinsun.com>
16564
16565 * src/output.c (output_skeleton): Call xfopen instead of
16566 duplicating xfopen's body.
16567
16568 Fix bugs reported by Nelson H. F. Beebe in
16569 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
16570
16571 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
16572 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
16573 Group compiler. Instead, use "$CC -E bar.c". Include the .h
16574 file twice in the grammar, as an extra check.
16575
16576 * tests/input.at (Torturing the Scanner): Surround the
16577 backslash-newline tests with "#if 0", to make it less likely that
16578 we'll run into compiler bugs. Bring back solitary \ inside
16579 comment, but add a closing comment to work around HP C bug. Don't
16580 test backslash-newline in C character constant.
16581
165822002-11-14 Akim Demaille <akim@epita.fr>
16583
16584 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
16585 status of the compiler.
16586 Calling `exit 1' is no longer needed.
16587 Reported by Nelson H. F. Beebe.
16588
165892002-11-14 Akim Demaille <akim@epita.fr>
16590
16591 * tests/atlocal.in (CPPFLAGS): We have config.h.
16592 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
16593 New.
16594 * tests/actions.at, tests/calc.at, tests/conflicts.at,
16595 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
16596 * tests/regression.at, tests/torture.at: Use them for all the
16597 grammars that are to be compiled.
16598 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
16599 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
16600 * doc/bison.texinfo (GLR Parsers): Document `inline'.
16601
166022002-11-14 Akim Demaille <akim@epita.fr>
16603
16604 * doc/bison.texinfo: Various formatting changes (alignments in
16605 samples, additional @group/@end group, GCS in samples.
16606 Use @deffn instead of simple @table to define the directives,
16607 macros, variables etc.
16608
166092002-11-13 Paul Eggert <eggert@twinsun.com>
16610
16611 Fix some bugs reported by Albert Chin-A-Young in
16612 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
16613
16614 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
16615 -o c"; the HP C compiler chatters during compilation.
16616 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
16617 * tests/headers.at (export YYLTYPE): Likewise.
16618
16619 * tests/input.at (Torturing the Scanner): Remove lines containing
16620 solitary backslashes, as they tickle a bug in the HP C compiler.
16621
16622 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
16623 comments, since they're not portable. Use GNU coding style.
16624
166252002-11-13 Akim Demaille <akim@epita.fr>
16626
16627 * data/yacc.c: Leave bigger chunks of quoted text.
16628 (YYDSYMPRINTF): New.
16629 Use it to report symbol activities.
16630 * data/glr.c (YYDSYMPRINTF): New.
16631 Use it.
16632
166332002-11-12 Paul Eggert <eggert@twinsun.com>
16634
16635 Version 1.75b.
16636
16637 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
16638 (yyglrReduce): Return yyok, not 0.
16639 This should avoid the enumerated-type warnings reported
16640 by Nelson H. F. Beebe in
16641 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
16642
16643 * lib/bbitset.h (BITSET_INLINE): Remove.
16644 * lib/bitset.h [! BITSET_INLINE]: Remove.
16645 (bitset_set, bitset_reset, bitset_test): Rename local vars
16646 to avoid shadowing warnings by GCC.
16647
16648 * data/glr.c (inline): Remove #define. It's the user's
16649 responsibility to #define it away, just like 'const'.
16650 This fixes one of the bugs reported by Nelson H. F. Beebe in
16651 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
16652
16653 * Makefile.maint (po-check): Scan .l and .y files instead of the
16654 .c and the .h files that they generate. This fixes the bug
16655 reported by Tim Van Holder in:
16656 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
16657 Look for N_ as well as for _. Try to avoid matching #define for
16658 N_ and _.
16659 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
16660 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
16661 * src/scan-gram.l: Revamp regular expressions so that " and '
16662 do not confuse xgettext.
16663
16664 * src/struniq.h (struniq_new): Do not declare the return type
16665 to be 'const'; this violates the C standard.
16666 * src/struniq.c (struniq_new): Likewise.
16667
166682002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
16669
16670 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
16671 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
16672 linker.
16673
166742002-11-12 Akim Demaille <akim@epita.fr>
16675
16676 * Makefile.maint: Sync with Autoconf:
16677 (local_updates): New.
16678
166792002-11-12 Akim Demaille <akim@epita.fr>
16680
16681 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
16682
166832002-11-12 Akim Demaille <akim@epita.fr>
16684
16685 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
16686 locations.
16687
166882002-11-12 Akim Demaille <akim@epita.fr>
16689
16690 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
16691 not yyvalue.
16692
166932002-11-12 Akim Demaille <akim@epita.fr>
16694
16695 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
16696 Use it to test the GLR parser.
16697
166982002-11-12 Akim Demaille <akim@epita.fr>
16699
16700 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
16701 defines it.
16702 * data/glr.c (yystos): New.
16703 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
16704 (YYDSYMPRINT): New.
16705 (yyval): Don't define it, it is handled via M4.
16706 (yyrecoverParseError): Free verbosely the discarded symbols.
16707 * data/yacc.c (yysymprint): Remove, rather...
16708 (b4_yysymprint_generate): invoke.
16709 * data/c.m4 (b4_yysymprint_generate): New.
16710 Accept pointers as arguments, as opposed to the version from
16711 yacc.c.
16712 (b4_yydestruct_generate): Likewise.
16713 * tests/cations.at (Printers and Destructors): Use Bison directives
16714 instead of CPP macros.
16715 Don't rely on internal details.
16716
167172002-11-12 Akim Demaille <akim@epita.fr>
16718
16719 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
16720 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
16721 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
16722 it against YYEMPTY and so forth), work on yytoken (i.e., set
16723 it to YYEMPTY etc.).
16724 (yydestruct): Replace with a b4_yydestruct_generate invocation.
16725 (b4_symbol_actions): Remove.
16726 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
16727 for 0, end-of-input.
16728
167292002-11-12 Akim Demaille <akim@epita.fr>
16730
16731 * doc/bison.texinfo (Destructor Decl): New.
16732
167332002-11-12 Akim Demaille <akim@epita.fr>
16734
16735 * src/tables.c (tables_generate): Use free for pointers that
16736 cannot be NULL, not XFREE.
16737 (pack_vector): Use assert, not fatal, for bound violations.
16738 * src/state.c (state_new): Likewise.
16739 * src/reader.c (reader): Likewise.
16740 * src/lalr.c (set_goto_map): Likewise.
16741 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
16742 the file name.
16743
167442002-11-12 Akim Demaille <akim@epita.fr>
16745
16746 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
16747 Restore.
16748 * src/scan-gram.l (last_string): Is global to the file, not to
16749 yylex.
16750 * src/parse-gram.y (input): Don't append the epilogue here,
16751 (epilogue.opt): do it here, and free the scanner's obstack.
16752 * src/reader.c (epilogue_set): Rename as...
16753 (epilogue_augment): this.
16754 * data/c.m4 (b4_epilogue): Defaults to empty.
16755
167562002-11-12 Akim Demaille <akim@epita.fr>
16757
16758 * src/getargs.c (long_options): Remove duplicates.
16759 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
16760 Remove.
16761 * doc/bison.rnh: Remove.
16762 * doc/bison.texinfo (VMS Invocation): Remove.
16763
167642002-11-12 Akim Demaille <akim@epita.fr>
16765
16766 * src/struniq.h, src/struniq.c (struniq_t): Is const.
16767 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
16768
16769 Use struniq for symbols.
16770
16771 * src/symtab.h (symbol_t): The tag member is a struniq.
16772 (symbol_type_set): Adjust.
16773 * src/symtab.c (symbol_new): Takes a struniq.
16774 (symbol_free): Don't free the tag member.
16775 (hash_compare_symbol_t, hash_symbol_t): Rename as...
16776 (hash_compare_symbol, hash_symbol): these.
16777 Use the fact that tags as struniqs.
16778 (symbol_get): Use struniq_new.
16779 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
16780 Returns a strniq.
16781 * src/reader.h (merger_list, grammar_currentmerge_set): The name
16782 and type members are struniqs.
16783 * src/reader.c (get_merge_function)
16784 (grammar_current_rule_merge_set): Adjust.
16785 (TYPE, current_type): Are struniq.
16786
16787 Use struniq for file names.
16788
16789 * src/files.h, src/files.c (infile): Split into...
16790 (grammar_file, current_file): these.
16791 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
16792 * src/reduce.c (reduce_print): Likewise.
16793 * src/getargs.c (getargs): Likewise.
16794 * src/complain.h, src/complain.c: Likewise.
16795 * src/main.c (main): Call struniqs_new early enough to use it for
16796 file names.
16797 Don't free the input file name.
16798
167992002-11-12 Akim Demaille <akim@epita.fr>
16800
16801 * src/symtab.c (symbol_free): Remove dead deactivated code:
16802 type_name are properly removed.
16803 Don't use XFREE to free items that cannot be NULL.
16804 * src/struniq.h, src/struniq.c: New.
16805 * src/main.c (main): Initialize/free struniqs.
16806 * src/parse-gram.y (%union): Add astruniq member.
16807 (yyprint): Adjust.
16808 * src/scan-gram.l (<{tag}>): Return a struniq.
16809 Free the obstack bit that used to store it.
16810 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
16811
168122002-11-11 Paul Eggert <eggert@twinsun.com>
16813
16814 Revamp to fix many (but not all) of the C- and M4-related quoting
16815 problems. Among other things, this fixes the Bison bug reported
16816 by Jan Hubicka when processing the Bash grammar; see:
16817 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
16818
16819 Use new @ escapes consistently. Represent brackets with @{ and @}
16820 rather than @<:@ and @:>@, since this works a bit better with dumb
16821 editors like vi. Represent @ with @@, since @ is now consistently
16822 an escape. Use @oline@ and @ofile@ rather than __oline__ and
16823 __ofile__, to avoid unexpected expansions. Similarly, use @output
16824 rather than #output.
16825
16826 * data/c.m4 (b4_copyright): Omit file name from comment, since
16827 the file name could contain "*/".
16828 (b4_synclines_flag): Don't quote the 2nd argument; it should already
16829 be quoted. All uses changed.
16830
16831 * data/glr.c: Use new @ escapes consistently.
16832 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
16833 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
16834 Remove, since they couldn't handle arbitrary characters in file
16835 names.
16836 * data/lalr1.cc: Likewise.
16837 * data/yacc.c: Likewise.
16838
16839 * src/files.c (output_infix): Remove; all uses removed.
16840 * src/files.h: Likewise.
16841
16842 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
16843 mishandled funny characters in file names, and anyway it isn't
16844 needed any more.
16845 * data/yacc.c: Likewise.
16846 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
16847
16848 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
16849 * data/yacc.c: Likewise.
16850
16851 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
16852 strings now.
16853 (muscle_init): Quote filename as a C string.
16854 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
16855 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
16856 * src/output.c (escaped_file_name_output): New function.
16857 (prepare_symbols): Quote tokens for M4.
16858 (prepare): Don't insert output_infix, output_prefix,
16859 output_parser_name, output_header_name; this is now down by scan-skel.
16860 Insert skeleton as a C string.
16861
16862 * src/output.c (user_actions_output, symbol_destructors_output,
16863 symbol_printers_output): Quote filenames for C and M4.
16864 * src/reader.c (prologue_augment, epilogue_set): Likewise.
16865
16866 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
16867 escapes other than \\ and \'; this simplifies the code.
16868 (<SC_STRING>): Likewise, for \\ and \".
16869 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
16870 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
16871 Use new escapes @{ and @} for [ and ].
16872
16873 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
16874 them with auto vars.
16875 Switch to new escape scheme, where @ is the escape character uniformly.
16876 Abort if a stray escape character is found. Avoid unbounded input
16877 buffer when parsing non-escaped text.
16878
16879 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
16880 __oline__, #output, $@, and @{ do not have unintended meanings.
16881
168822002-11-09 Paul Eggert <eggert@twinsun.com>
16883
16884 Fix the test failure due to GCC warnings described in
16885 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
16886 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
16887 evaluate to 0 if it's impossible for NINF to be in the respective
16888 table.
16889 (yygetLRActions, yyrecoverParseError): Use them.
16890
16891 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
16892 counted in the token inserted at end of file. Now takes
16893 location_t *, not location_t, so that the location can be
16894 adjusted. All uses changed.
16895
16896 * tests/regression.at (Invalid inputs): Adjust wording in
16897 diagnostic to match the new behavior.
16898
16899 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
16900 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
16901 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
16902 abort ();'. This reduces the runtime of the "Many lookaheads"
16903 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
16904 GCC 3.2.
16905
169062002-11-07 Paul Eggert <eggert@twinsun.com>
16907
16908 * src/parse-gram.y (CHARACTER): Remove unused token.
16909 All uses removed.
16910
16911 * src/scan-gram.l: Remove stack option. We no longer use the
16912 stack, since the stack was never deeper than 1; instead, use the
16913 new auto var c_context to record the stacked value.
16914
16915 Remove nounput option. At an unexpected end of file, we now unput
16916 the minimal input necessary to end cleanly; this simplifies the
16917 code.
16918
16919 Avoid unbounded token sizes where this is easy.
16920
16921 (unexpected_end_of_file): New function.
16922 Use it to systematize the error message on unexpected EOF.
16923 (last-string): Now auto, not static.
16924 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
16925 (scanner_last_string_free): Remove; not used.
16926 (percent_percent_count): Move decl to just before use.
16927 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
16928 not the (never otherwised-used) CHARACTER.
16929
169302002-11-07 Akim Demaille <akim@epita.fr>
16931
16932 Let yyerror always receive the msg as last argument, so that
16933 yyerror can be variadic.
16934
16935 * data/yacc.c (b4_yyerror_args): New.
16936 Use it when calling yyerror.
16937 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
16938 Use it when calling yyerror.
16939 * doc/bison.texinfo (Error Reporting): Adjust.
16940 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
16941 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
16942
169432002-11-06 Akim Demaille <akim@epita.fr>
16944
16945 #line should have quoted strings.
16946 Ideally, this should be done by m4_quotearg.
16947
16948 * src/scan-skel.l: Include quotearg.h.
16949 Quote __ofile__.
16950 * src/output.c (symbol_printers_output)
16951 (symbol_destructors_output): Quote the file name.
16952
169532002-11-06 Akim Demaille <akim@epita.fr>
16954
16955 * tests/regression.at (Invalid inputs): Adjust to the recent
16956 messages.
16957
169582002-11-06 Akim Demaille <akim@epita.fr>
16959
16960 Restore --no-lines.
16961 Reported by Jim Kent.
16962
16963 * data/c.m4 (b4_syncline): New.
16964 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
16965 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
16966 * src/output.c (user_actions_output): Likewise.
16967 (prepare): Define 'b4_synclines_flag'.
16968 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
16969
169702002-11-06 Akim Demaille <akim@epita.fr>
16971
16972 * src/main.c (main): Free `infile'.
16973 * src/scan-gram.l (handle_syncline): New.
16974 Recognize `#line'.
16975 * src/output.c (user_actions_output, symbol_destructors_output)
16976 (symbol_printers_output): Use the location's file name, not
16977 infile.
16978 * src/reader.c (prologue_augment, epilogue_set): Likewise.
16979
169802002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16981
16982 * src/tables.c (matching_state): Don't allow states to match if
16983 either has GLR conflict entries.
16984
169852002-11-05 Paul Eggert <eggert@twinsun.com>
16986
16987 * src/scan-gram.l: Use more accurate diagnostics, e.g.
16988 "integer out of range" rather than "invalid value".
16989 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
16990 accordingly.
16991
16992 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
16993 Also, remove one static variable in the scanner.
16994
16995 * src/scan-gram.l (braces_level): Now auto, not static.
16996 Initialize to zero if the compiler is being picky.
16997 (INITIAL): Clear braces_level instead of incrementing it.
16998 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
16999 as POSIX 1003.1-2001 requires.
17000 * src/system.h (IF_LINT): New macro, taken from coreutils.
17001 * configure.ac: Define "lint" if --enable-gcc-warnings.
17002
170032002-11-05 Akim Demaille <akim@epita.fr>
17004
17005 * src/scan-gram.l: When it starts with `%', complain about the
17006 whole directive, not just that `invalid character: %'.
17007
170082002-11-04 Akim Demaille <akim@epita.fr>
17009
17010 * Makefile.maint: Update from Autoconf.
17011 (update, cvs-update, po-update, do-po-update): New.
17012
170132002-11-04 Akim Demaille <akim@epita.fr>
17014
17015 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
17016 and yyerror.
17017 Have yyerror `use' its arguments.
17018 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
17019 returns true when location & yacc & pure & parse-param.
17020 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
17021
170222002-11-04 Akim Demaille <akim@epita.fr>
17023
17024 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
17025 clashes.
17026 * src/scan-gram.l: Use [\'] instead of ['] to pacify
17027 font-lock-mode.
17028 Use complain_at.
17029 Use quote, not quote_n since LOCATION_PRINT no longer uses the
17030 slot 0.
17031
170322002-11-03 Paul Eggert <eggert@twinsun.com>
17033
17034 * src/reader.c (get_merge_function, grammar_current_rule_check):
17035 Use consistent diagnostics for reporting type name clashes.
17036 Quote the types with <>, for consistency with Yacc.
17037 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
17038
170392002-11-03 Akim Demaille <akim@epita.fr>
17040
17041 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
17042 New.
17043 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
17044 (b4_parse_param): Remove.
17045 Use b4_identification.
17046 Propagate b4_pure_args where needed to pass them to yyerror.
17047 * data/glr.m4 (b4_parse_param): Remove.
17048 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
17049 (b4_lpure_formals): New.
17050 Use b4_identification.
17051 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
17052 b4_user_formals and b4_user_args.
17053 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
17054 (yyreportAmbiguity): When using a pure parser, also need
17055 the location, and the parse-params.
17056 Adjust callers.
17057 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
17058 When using a pure parser, also need the parse-params.
17059 Adjust callers.
17060 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
17061 (%pure-parser + %parse-param) LALR and GLR parsers.
17062 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
17063 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
17064 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
17065 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
17066 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
17067 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
17068 * doc/bison.texinfo: Untabify the whole file.
17069 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
17070 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
17071 (Error Reporting): Adjust to these new directives.
17072 Document %error-verbose, deprecate YYERROR_VERBOSE.
17073
170742002-11-03 Akim Demaille <akim@epita.fr>
17075
17076 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
17077 AT_CHECK_CALC_GLR invocations to use % directives, instead of
17078 command line options.
17079 * tests/cxx-type.at: Formatting changes.
17080
170812002-11-03 Paul Eggert <eggert@twinsun.com>
17082
17083 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
17084 to count columns correctly, and to check for invalid inputs.
17085
17086 Use mbsnwidth to count columns correctly. Account for tabs, too.
17087 Include mbswidth.h.
17088 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
17089 (extend_location): New function.
17090 (YY_LINES): Remove.
17091
17092 Handle CRLF in C code rather than in Lex code.
17093 (YY_INPUT): New macro.
17094 (no_cr_read): New function.
17095
17096 Scan UCNs, even though we don't fully handle them yet.
17097 (convert_ucn_to_byte): New function.
17098
17099 Handle backslash-newline correctly in C code.
17100 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
17101 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
17102 all uses changed.
17103 (tag, splice): New EREs. Do not allow NUL or newline in tags.
17104 Use {splice} wherever C allows backslash-newline.
17105 YY_STEP after space, newline, vertical-tab.
17106 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
17107
17108 (letter, id): Don't assume ASCII; e.g., spell out a-z.
17109
17110 ({int}, handle_action_dollar, handle_action_at): Check for integer
17111 overflow.
17112
17113 (YY_STEP): Omit trailing semicolon, so that it's more like C.
17114
17115 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
17116 as well as \000. Check for UCHAR_MAX, not 255.
17117 Allow \x with an arbitrary positive number of digits, as in C.
17118 Check for overflow here.
17119 Allow \? and UCNs, for compatibility with C.
17120
17121 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
17122 with quote slot used by complain_at.
17123
17124 * tests/input.at: Add tests for backslash-newline, m4 quotes
17125 in symbols, long literals, and funny escapes in strings.
17126
17127 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
17128 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
17129 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
17130 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
17131 * m4/mbswidth.m4: New file, from GNU coreutils.
17132
17133 * doc/bison.texinfo (Grammar Outline): Document // comments.
17134 (Symbols): Document that trigraphs have no special meaning in Bison,
17135 nor is backslash-newline allowed.
17136 (Actions): Document that trigraphs have no special meaning.
17137
17138 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
17139 no longer used.
17140
171412002-11-02 Paul Eggert <eggert@twinsun.com>
17142
17143 * src/reader.c: Don't include quote.h; not needed.
17144 (get_merge_function): Reword warning to be consistent with
17145 type clash diagnostic in grammar_current_rule_check.
17146
17147 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
17148 bug in trigraph handling.
17149
17150 * src/output.c (prepare_symbols): When printing token names,
17151 escape "[" as "@<:@" and likewise for "]".
17152
17153 * src/system.h (errno): Remove declaration, as we are now
17154 assuming C89 or better, and C89 guarantees errno.
17155
171562002-10-30 Paul Eggert <eggert@twinsun.com>
17157
17158 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
17159 Check for close failures.
17160 * src/files.h (xfclose): Return void, not int, since it always
17161 returned zero.
17162 * src/files.c (xfclose): Likewise. Report I/O error if ferror
17163 indicates one.
17164 * src/output.c (output_skeleton): Use xfclose rather than fclose
17165 and ferror. xfclose now checks ferror.
17166
17167 * data/glr.c (YYLEFTMOST_STATE): Remove.
17168 (yyreportTree): Use a stack-based leftmost state. This avoids
17169 our continuing battles with bogus warnings about initializers.
17170
171712002-10-30 Akim Demaille <akim@epita.fr>
17172
17173 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
17174 #if.
17175
171762002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17177
17178 * tests/glr-regr1.at: New test for reported regressions.
17179 * tests/testsuite.at: Add glr-regr1.at test.
17180 * tests/Makefile.am: Add glr-regr1.at test.
17181
171822002-10-24 Paul Eggert <eggert@twinsun.com>
17183
17184 Version 1.75a.
17185
17186 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
17187 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
17188 we use malloc. Don't assume 'A' through 'Z' are contiguous.
17189 Don't assume strdup exists; POSIX says its an XSI extension.
17190 Check for buffer overflow on input.
17191
171922002-10-24 Akim Demaille <akim@epita.fr>
17193
17194 * src/output.c (output_skeleton): Don't disable M4sugar comments
17195 too soon: it results in comments being expanded.
17196 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
17197 first output.
17198
171992002-10-24 Akim Demaille <akim@epita.fr>
17200
17201 * data/yacc.c (m4_int_type): New.
17202 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
17203 char' as only yacc.c wants K&R portability.
17204 * data/glr.c (yysigned_char): Remove.
17205 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
17206 Reported by Quoc Peyrot.
17207
172082002-10-23 Paul Eggert <eggert@twinsun.com>
17209
17210 * src/main.c (main): With --trace=time, report times even if a
17211 non-fatal error occurs. Formerly, the times were reported in some
17212 such cases but not in others.
17213 * src/reader.c (reader): Just return if a complaint has been issued,
17214 instead of exiting, so that 'main' can report times.
17215
172162002-10-22 Akim Demaille <akim@epita.fr>
17217
17218 * src/system.h: Include sys/types.
17219 Reported by Bert Deknuydt.
17220
172212002-10-23 Paul Eggert <eggert@twinsun.com>
17222
17223 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
17224 Suggested by Art Haas.
17225
172262002-10-22 Paul Eggert <eggert@twinsun.com>
17227
17228 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
17229 decl; not needed any more.
17230 * src/main.c (main): Use return to exit, undoing yesterday's change.
17231 The last OS that we could find where this wouldn't work is
17232 SunOS 3.5, and that's too old to worry about now.
17233
17234 * data/glr.c (struct yyltype): Define members even when not
17235 doing locations. This is more consistent with yacc.c, and it
17236 works around the following bug reports:
17237 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
17238 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
17239
17240 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
17241 @acronym consistently. Standardize on "Yacc" instead of "YACC",
17242 "Algol" instead of "ALGOL". Give a bit more history about BNF.
17243
172442002-10-22 Akim Demaille <akim@epita.fr>
17245
17246 * data/README: New.
17247
172482002-10-21 Paul Eggert <eggert@twinsun.com>
17249
17250 Be consistent about 'bool'; the old code used an enum in one
17251 module and an int in another, and this violates the C standard.
17252 * m4/stdbool.m4: New file, from coreutils 4.5.3.
17253 * configure.ac (AC_HEADER_STDBOOL): Add.
17254 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
17255 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
17256 * src/symtab.c (hash_compare_symbol_t): Likewise.
17257 * src/system.h (bool, false, true): Use a definition consistent
17258 with ../lib/hash.c. All uses changed.
17259
17260 * src/complain.c (warning_issued): Renamed from warn_message_count,
17261 so that we needn't worry about integer overflow (!).
17262 Now of type bool. All uses changed.
17263 (complaint_issued): Renamed from complain_message_count; likewise.
17264
17265 * src/main.c (main): Use exit to exit with failure.
17266
17267 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
17268 rather than 1 and 0.
17269 * src/main.c (main): Likewise.
17270 * src/getargs.c (getargs): Likewise.
17271 * src/reader.c (reader): Likewise.
17272
17273 * src/getarg.c (getargs): Remove duplicate code for
17274 "Try `bison --help'".
17275
17276 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
17277 What was that "2" for?
17278
17279 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
17280 * src/getargs.c (usage): Likewise.
17281
17282 * src/getargs.c (getargs): When there are too few operands, report
17283 the last one. When there are too many, report the first extra
17284 one. This is how diffutils does it.
17285
172862002-10-20 Paul Eggert <eggert@twinsun.com>
17287
17288 Remove K&R vestiges.
17289 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
17290 * src/complain.c (VA_START): Remove. Assume prototypes.
17291 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
17292 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
17293 fatal): Assume prototypes.
17294 * src/complain.h: Assume prototypes.
17295 * src/system.h (PARAMS): Remove.
17296 Include <limits.h> unconditionally, since it's guaranteeed even
17297 for a freestanding C89 compiler.
17298 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
17299 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
17300
173012002-10-20 Akim Demaille <akim@epita.fr>
17302
17303 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
17304 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
17305 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
17306 (yyresolveStates, yyresolveAction, yyresolveStack)
17307 (yyprocessOneStack): Use them.
17308 (yy_reduce_print): New.
17309 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
17310
173112002-10-20 Akim Demaille <akim@epita.fr>
17312
17313 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
17314 arguments and output `void'.
17315 (b4_c_function): Rename as...
17316 (b4_c_function_def): this.
17317 (b4_c_function_decl, b4_c_ansi_function_def)
17318 (b4_c_ansi_function_decl): New.
17319 Change the interpretation of the arguments: before `int, foo', now
17320 `int foo, foo'.
17321 * data/yacc.c (yyparse): Prototype and define thanks to these.
17322 Adjust b4_c_function_def uses.
17323 * data/glr.c (yyparse): Likewise, but ANSI only.
17324
173252002-10-20 Akim Demaille <akim@epita.fr>
17326
17327 * src/output.c (prepare): Move the definition of `tokens_number',
17328 `nterms_number', `undef_token_number', `user_token_number_max'
17329 to...
17330 (prepare_tokens): Here.
17331 (prepare_tokens): Rename as...
17332 (prepare_symbols): this.
17333 (prepare): Move the definition of `rules_number' to...
17334 (prepare_rules): here.
17335 (prepare): Move the definition of `last', `final_state_number',
17336 `states_number' to...
17337 (prepare_states): here.
17338 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
17339
173402002-10-20 Akim Demaille <akim@epita.fr>
17341
17342 * src/tables.h, src/tables.c, src/output.c: Comment changes.
17343
173442002-10-20 Akim Demaille <akim@epita.fr>
17345
17346 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
17347 * data/c.m4: here.
17348
173492002-10-20 Akim Demaille <akim@epita.fr>
17350
17351 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
17352 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
17353 `pair'.
17354 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
17355 `name' to...
17356 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
17357 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
17358 These.
17359
173602002-10-19 Paul Eggert <eggert@twinsun.com>
17361
17362 Do not create a temporary file, as that involves security and
17363 cleanup headaches. Instead, use a pair of pipes.
17364 Derived from a suggestion by Florian Krohm.
17365 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
17366 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
17367 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
17368 (BISON_PREREQ_SUBPIPE): Add.
17369 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
17370 Add subpipe.h, subpipe.c.
17371 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
17372 * po/POTFILES.in: Add lib/subpipe.c.
17373 * src/output.c: Include "subpipe.h".
17374 (m4_invoke): Remove decl.
17375 (scan_skel): New decl.
17376 (output_skeleton): Use pipe rather than temporary file for m4 input.
17377 Check that m4sugar.m4 is readable, to avoid deadlock.
17378 Check for pipe I/O error.
17379 * src/scan-skel.l (readpipe): Remove decl.
17380 (scan_skel): New function, to be used in place of m4_invoke.
17381 Read from stream rather than file.
17382
17383 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
17384 float, as this generates a warning on Solaris 8 + GCC 3.2 with
17385 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
17386 this generates a more-accurate value anyway.
17387
17388 * lib/timevar.c (timervar_accumulate): Rename locals to
17389 avoid confusion with similarly-named more-global.
17390 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
17391
17392 * src/output.c (prepare): Use xstrdup to convert char const *
17393 to char *, to avoid GCC warning.
17394
173952002-10-19 Akim Demaille <akim@epita.fr>
17396
17397 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
17398 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
17399 Use them to have `calc.y' ready for %pure-parser.
17400 * data/yacc.c (YYLEX): Pass a yylex return type to
17401 b4_c_function_call.
17402
174032002-10-19 Akim Demaille <akim@epita.fr>
17404
17405 Prototype support of %lex-param and %parse-param.
17406
17407 * src/parse-gram.y: Add the definition of the %lex-param and
17408 %parse-param tokens, plus their rules.
17409 Drop the `_' version of %glr-parser.
17410 Add the "," token.
17411 * src/scan-gram.l (INITIAL): Scan them.
17412 * src/muscle_tab.c: Comment changes.
17413 (muscle_insert, muscle_find): Rename `pair' as `probe'.
17414 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
17415 (muscle_entry_s): The `value' member is no longer const.
17416 Adjust all dependencies.
17417 * src/muscle_tab.c (muscle_init): Adjust: use
17418 MUSCLE_INSERT_STRING.
17419 Initialize the obstack earlier.
17420 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
17421 (muscle_pair_list_grow): New.
17422 * data/c.m4 (b4_c_function_call, b4_c_args): New.
17423 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
17424 * tests/calc.at: Use %locations, not --locations.
17425 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
17426
174272002-10-19 Akim Demaille <akim@epita.fr>
17428
17429 * src/getargs.c (usage): Take status as argument and exit
17430 accordingly.
17431 Report the traditional `Try ... --help' message when status != 0.
17432 (usage, version): Don't take a FILE * as arg, it is pointless.
17433 (getargs): When there is an incorrect number of arguments, make it
17434 an error, and report it GNUlically thanks to `usage ()'.
17435
174362002-10-18 Paul Eggert <eggert@twinsun.com>
17437
17438 * data/glr.c (yyreportParseError): Don't assume that sprintf
17439 yields the length of the printed string, as this is not true
17440 on SunOS 4.1.4. Reported by Peter Klein.
17441
17442 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
17443 * tests/conflicts.at (%nonassoc and eof): Likewise.
17444 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
17445
174462002-10-17 Akim Demaille <akim@epita.fr>
17447
17448 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
17449 * src/getargs.c (trace_types, trace_args): Adjust.
17450 * src/reader.c (grammar_current_rule_prec_set)
17451 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
17452 Standardize error messages.
17453 And s/@prec/%prec/!
17454 (reader): Use trace_flag to enable scanner/parser debugging,
17455 instead of an adhoc scheme.
17456 * src/scan-gram.l: Remove trailing debugging code.
17457
174582002-10-16 Paul Eggert <eggert@twinsun.com>
17459
17460 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
17461 MUSCLE_TAB_H.
17462
17463 * NEWS: Officially drop support for building Bison with K&R C,
17464 since it didn't work anyway and it's not worth worrying about.
17465 * Makefile.maint (wget_files): Remove ansi2knr.c.
17466 (ansi2knr.c-url_prefix): Remove.
17467 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
17468 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
17469 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
17470
174712002-10-15 Paul Eggert <eggert@twinsun.com>
17472
17473 Stop using the "enum_" trick for K&R-style function definitions;
17474 it confused me, and I was the author! Instead, assume that people
17475 who want to use K&R C compilers (when using these modules in GCC,
17476 perhaps?) will run ansi2knr.
17477
17478 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
17479 All uses of "enum_" changed to "enum ".
17480 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
17481 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
17482
17483 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
17484 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
17485 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
17486 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
17487 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
17488 abitset_not, abitset_ones, abitset_or, abitset_or_and,
17489 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
17490 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
17491 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
17492 Use function prototypes; this removes the need for declaring
17493 static functions simply to provide their prototypes.
17494 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
17495 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
17496 bitset_count_, bitset_create, bitset_dump, bitset_first,
17497 bitset_free, bitset_init, bitset_last, bitset_next,
17498 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
17499 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
17500 bitset_print, bitset_release_memory, bitset_toggle_,
17501 bitset_type_choose, bitset_type_get, bitset_type_name_get,
17502 debug_bitset): Likewise.
17503 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
17504 * lib/bitset_stats.c (bitset_log_histogram_print,
17505 bitset_percent_histogram_print, bitset_stats_and,
17506 bitset_stats_and_cmp, bitset_stats_and_or,
17507 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
17508 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
17509 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
17510 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
17511 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
17512 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
17513 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
17514 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
17515 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
17516 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
17517 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
17518 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
17519 bitset_stats_zero): Likewise.
17520 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
17521 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
17522 bitsetv_dump, debug_bitsetv): Likewise.
17523 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
17524 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
17525 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
17526 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
17527 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
17528 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
17529 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
17530 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
17531 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
17532 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
17533 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
17534 Likewise.
17535 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
17536 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
17537 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
17538 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
17539 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
17540 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
17541 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
17542 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
17543 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
17544 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
17545 lbitset_xor_cmp, lbitset_zero): Likewise.
17546
175472002-10-14 Akim Demaille <akim@epita.fr>
17548
17549 Version 1.75.
17550
175512002-10-14 Akim Demaille <akim@epita.fr>
17552
17553 * tests/Makefile.am (maintainer-check-posix): New.
17554
175552002-10-14 Akim Demaille <akim@epita.fr>
17556
17557 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
17558 member.
17559
175602002-10-14 Akim Demaille <akim@epita.fr>
17561
17562 * src/tables.c (table_ninf_remap): base -> tab.
17563 Reported by Matt Rosing.
17564
175652002-10-14 Paul Eggert <eggert@twinsun.com>
17566
17567 * tests/action.at, tests/calc.at, tests/conflicts.at,
17568 tests/cxx-type.at, tests/headers.at, tests/input.at,
17569 tests/regression.at, tests/synclines.at, tests/torture.at:
17570 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
17571 so that the tests still work even if POSIXLY_CORRECT is set.
17572 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
17573
17574 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
17575 for portability to K&R hosts. Fix typo: signed char is guaranteed
17576 only to 127, not to 128.
17577 * data/glr.c (yysigned_char): New type.
17578 * data/yacc.c (yysigned_char): Likewise.
17579 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
17580
175812002-10-13 Paul Eggert <eggert@twinsun.com>
17582
17583 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
17584 true due to limited range of data type" warning from GCC.
17585
17586 * data/c.m4 (b4_token_defines): Protect against double-inclusion
17587 by wrapping enum yytokentype's definition inside #ifndef
17588 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
17589
175902002-10-13 Akim Demaille <akim@epita.fr>
17591
17592 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
17593 Un yy- yyrhs to avoid the name clash with the global YYRHS.
17594
175952002-10-13 Akim Demaille <akim@epita.fr>
17596
17597 * Makefile.maint: Update from Autoconf 2.54.
17598 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
17599
176002002-10-13 Akim Demaille <akim@epita.fr>
17601
17602 * src/print.c (print_state): Separate the list of solved conflicts
17603 from the other items.
17604 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
17605
176062002-10-13 Akim Demaille <akim@epita.fr>
17607
17608 Let nondeterministic skeletons be usable with deterministic
17609 tables.
17610
17611 With the patch, GAWK compiled by GCC without -O2 passes its test
17612 suite using a GLR parser driven by LALR tables. It fails with -O2
17613 because `struct stat' gives two different answers on my machine:
17614 88 (definition of an auto var) and later 96 (memset on this var).
17615 Hence the stack is badly corrumpted. The headers inclusion is to
17616 blame: if I move the awk.h inclusion before GLR's system header
17617 inclusion, the two struct stat have the same size.
17618
17619 * src/tables.c (pack_table): Always create conflict_table.
17620 (token_actions): Always create conflict_list.
17621 * data/glr.c (YYFLAG): Remove, unused.
17622
176232002-10-13 Akim Demaille <akim@epita.fr>
17624
17625 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
17626 (O0FLAGS): New.
17627 (VALGRIND, GXX): New.
17628 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
17629 * tests/bison.in: Run $PREBISON a pre-command.
17630 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
17631 (maintainer-check-g++): New.
17632 * Makefile.am (maintainer-check): New.
17633
176342002-10-13 Akim Demaille <akim@epita.fr>
17635
17636 * data/glr.c: Formatting changes.
17637 Tweak some trace messages to match yacc.c's.
17638
176392002-10-13 Akim Demaille <akim@epita.fr>
17640
17641 GLR parsers sometimes raise parse errors instead of performing the
17642 default reduction.
17643 Reported by Charles-Henry de Boysson.
17644
17645 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
17646 check the length of the traces when %glr.
17647 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
17648 GLR's traces.
17649 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
17650 Test GLR parsers.
17651 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
17652 (yyltype): Remove the yy prefix from the member names.
17653 (yytable): Complete its comment.
17654 (yygetLRActions): Map error action number from YYTABLE from
17655 YYTABLE_NINF to 0.
17656 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
17657 (which was a bug: it should have been YYTABEL_NINF, and yet it was
17658 not satisfying as we could compare an YYACTION computed from
17659 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
17660 only value for error actions.
17661 (yyreportParseError): In verbose parse error messages, don't issue
17662 `error' in the list of expected tokens.
17663 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
17664 next action to perform to match glr.c's decoding.
17665 (yytable): Complete its comment.
17666
176672002-10-13 Paul Eggert <eggert@twinsun.com>
17668
17669 Fix problem reported by Henrik Grubbstroem in
17670 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
17671 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
17672 because the Bison parser reads the second action before reducing
17673 the first one.
17674 * src/scan-gram.l (rule_length): New static var.
17675 Use it to keep track of the rule length in the scanner, since
17676 we can't expect the parser to be in lock-step sync with the scanner.
17677 (handle_action_dollar, handle_action_at): Use this var.
17678 * tests/actions.at (Exotic Dollars): Test for the problem.
17679
176802002-10-12 Paul Eggert <eggert@twinsun.com>
17681
17682 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
17683 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
17684 Include <sys/time.h> when checking for clock_t and struct tms.
17685 Use same include order as source.
17686 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
17687 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
17688
17689 * lib/timevar.c: Update copyright date and clarify comments.
17690 (get_time) [IN_GCC]: Keep the GCC version for reference.
17691
17692 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
17693 GCC version as of today, then merge Bison's changes.
17694 Change "GCC" to "Bison" in copyright notice. timevar.def's
17695 author is Akim, so change that too.
17696
17697 * src/reader.c (grammar_current_rule_check):
17698 Don't worry about the default action if $$ is untyped.
17699 Prevents bogus warnings reported by Jim Gifford in
17700 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
17701
17702 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
17703 * data/glr.c, data/lalr1.cc, data/yacc.c:
17704 Output token definitions before the first part of user declarations.
17705 Fixes compatibility problem reported by Jim Gifford for kbd in
17706 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
17707
177082002-10-11 Paul Eggert <eggert@twinsun.com>
17709
17710 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
17711 (yyparse): here. This undoes some of the 2002-07-25 change.
17712 Compatibility problem reported by Ralf S. Engelschall with
17713 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
17714
177152002-10-11 Akim Demaille <akim@epita.fr>
17716
17717 * tests/regression.at Characters Escapes): New.
17718 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
17719 characters.
17720 Reported by Jan Nieuwenhuizen.
17721
177222002-10-11 Akim Demaille <akim@epita.fr>
17723
17724 * po/id.po: New.
17725
177262002-10-10 Paul Eggert <eggert@twinsun.com>
17727
17728 Portability fixes for bitsets; this also avoids several GCC
17729 warnings.
17730
17731 * lib/abitset.c: Include <stddef.h>, for offsetof.
17732 * lib/lbitset.c: Likewise.
17733
17734 * lib/abitset.c (abitset_bytes): Return a size that is aligned
17735 properly for vectors of objects. Do not assume that adding a
17736 header size to a multiple of a word size yields a value that is
17737 properly aligned for the whole union.
17738 * lib/bitsetv.c (bitsetv_alloc): Likewise.
17739
17740 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
17741 unique names for structures.
17742 * lib/ebitset.c (ebitset_bytes): Likewise.
17743 * lib/lbitset.c (lbitset_bytes): Likewise.
17744
17745 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
17746 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
17747 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
17748 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
17749 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
17750 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
17751 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
17752 to improve the type-checking that GCC can do.
17753 * lib/bitset.c (bitset_op4_cmp): Likewise.
17754 * lib/bitset_stats.c (bitset_stats_count,
17755 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
17756 bitset_stats_copy, bitset_stats_disjoint_p,
17757 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
17758 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
17759 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
17760 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
17761 bitset_stats_and_or_cmp, bitset_stats_andn_or,
17762 bitset_stats_andn_or_cmp, bitset_stats_or_and,
17763 bitset_stats_or_and_cmp): Likewise.
17764 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
17765 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
17766 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
17767 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
17768
17769 * lib/abitset.h: Include bitset.h, not bbitset.h.
17770 * lib/ebitset.h: Likewise.
17771 * lib/lbitset.h: Likewise.
17772
17773 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
17774 All instances of parameters of type enum bitset_opts are now of
17775 type enum_bitset_opts, to conform to the C Standard, and similarly
17776 for enum_bitset_type.
17777 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
17778 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
17779
17780 Do not use "struct bitset_struct" to mean different things in
17781 different modules. Not only is this confusing, it violates
17782 the C Standard, which requires that structure types in different
17783 modules must be compatible if one is to be passed to the other.
17784 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
17785 All instances of "struct bitset_struct *" replaced with "bitset".
17786 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
17787 (union bitset_union, struct abitset_struct, struct ebitset_struct,
17788 struct lbitset_struct, struct bitset_stats_struct): New types.
17789 All uses of struct bitset_struct changed to union bitset_union,
17790 etc.
17791 * lib/abitset.c (struct abitset_struct, abitset,
17792 struct bitset_struct): Remove.
17793 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
17794 struct bitset_struct): Remove.
17795 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
17796 bitset_struct): Remove.
17797 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
17798 Likewise.
17799
17800 Do not call a function of type T using a call that assumes the
17801 function is of a different type U. Standard C requires that a
17802 function must be called with a type that is compatible with its
17803 definition.
17804 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
17805 New decls.
17806 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
17807 New functions.
17808 * lib/ebitset.c (PFV): Remove.
17809 * lib/lbitset.c (PFV): Likewise.
17810 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
17811 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
17812 decls.
17813 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
17814 (ebitset_vtable): Use them.
17815 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
17816 lbitset_xor): New functions.
17817 (lbitset_vtable): Use them.
17818
17819 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
17820 Declare.
17821
17822 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
17823 GCC warning.
17824 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
17825 Use offsetof, for simplicity.
17826
178272002-10-06 Paul Eggert <eggert@twinsun.com>
17828
17829 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
17830 the same width as int. This reapplies a hunk of the 2002-08-12 patch
17831 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
17832 which was inadvertently undone by the 2002-09-30 patch.
17833 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
17834 the same width as int.
17835
178362002-10-04 Paul Eggert <eggert@twinsun.com>
17837
17838 Version 1.50.
17839
17840 * configure.ac (AC_INIT), NEWS: Increment version number.
17841
17842 * doc/bison.texinfo: Minor spelling, grammar, and white space
17843 fixes.
17844 (Symbols): Mention that any negative value returned from yylex
17845 signifies end-of-input. Warn about negative chars. Mention
17846 the portable Standard C character set.
17847
17848 The GNU coding standard says CFLAGS and YFLAGS are reserved
17849 for the installer to set.
17850 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
17851 * src/Makefile.am (AM_CFLAGS): Likewise.
17852 (AM_YFLAGS): Renamed from YFLAGS.
17853
17854 Fix some MAX and MIN problems.
17855 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
17856 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
17857 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
17858 * src/reader.c (reader): Use it.
17859
17860 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
17861 POSIX 1003.1-2001 has removed fgrep.
17862
178632002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
17864
17865 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
17866 interpreted as signed.
17867 * lib/ebitset.c (ebitset_list): Fix bug.
17868
178692002-10-01 Paul Eggert <eggert@twinsun.com>
17870
17871 More fixes for 64-bit hosts and large bitsets.
17872
17873 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
17874 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
17875 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
17876 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
17877 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
17878 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
17879 bitset_count_): Likewise.
17880 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
17881 bitset_first, bitset_last): Likewise.
17882 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
17883 bitset_stats_list_reverse, bitset_stats_size,
17884 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
17885 Likewise.
17886 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
17887 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
17888 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
17889 bitsetv_reflexive_transitive_closure): Likewise.
17890 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
17891 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
17892 Likewise.
17893 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
17894 Likewise.
17895
17896 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
17897 Use size_t, not unsigned int, to count bytes.
17898 * lib/abitset.h (abitset_bytes): Likewise.
17899 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
17900 Likewise.
17901 * lib/bitset.h (bitset_bytes): Likewise.
17902 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
17903 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
17904 * lib/bitsetv.c (bitsetv_alloc): Likewise.
17905 * lib/ebitset.c (ebitset_bytes): Likewise.
17906 * lib/ebitset.h (ebitset_bytes): Likewise.
17907 * lib/lbitset.c (lbitset_bytes): Likewise.
17908 * lib/lbitset.h (lbitset_bytes): Likewise.
17909
17910 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
17911 abitset_subset_p, abitset_disjoint_p, abitset_and,
17912 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
17913 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
17914 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
17915 abitset_or_and, abitset_or_and_cmp):
17916 Use bitset_windex instead of unsigned int.
17917 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
17918 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
17919 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
17920 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
17921 Likewise.
17922 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
17923
17924 * lib/bitset.c (bitset_print):
17925 Use proper printf formats for widths of integer types.
17926 * lib/bitset_stats.c (bitset_percent_histogram_print,
17927 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
17928 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
17929 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
17930 * lib/lbitset.c (lbitset_bytes): Likewise.
17931
17932 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
17933 BITSET_SIZE_MAX): New macros.
17934 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
17935 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
17936 to BITSET_WINDEX_MAX.
17937
17938 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
17939 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
17940 since we now return the bitset_bindex type (not int).
17941
17942 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
17943 when computing sizes.
17944 * lib/ebitset.c (ebitset_elts_grow): Likewise.
17945
17946 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
17947 and avoid cast to unsigned.
17948
179492002-09-30 Akim Demaille <akim@epita.fr>
17950
17951 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
17952 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
17953 Updates from Michael Hayes.
17954
179552002-09-30 Art Haas <ahaas@neosoft.com>
17956
17957 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
17958 invocations.
17959 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
17960 defined.
17961
179622002-09-27 Akim Demaille <akim@epita.fr>
17963
17964 Version 1.49c.
17965
179662002-09-27 Akim Demaille <akim@epita.fr>
17967
17968 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
17969 (Because of AC_LIBSOURCE).
17970
179712002-09-27 Akim Demaille <akim@epita.fr>
17972
17973 Playing with Autoscan.
17974
17975 * configure.ac: Remove the old LIBOBJ tweaks.
17976 (AC_REPLACE_FUNCS): Add strrchr and strtol.
17977 * lib/strrchr.c: New.
17978 * lib/strtol.c: New, from the Coreutils 4.5.1.
17979
179802002-09-27 Akim Demaille <akim@epita.fr>
17981
17982 Playing with Autoscan.
17983
17984 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
17985 * lib/Makefile.am (libbison_a_SOURCES): No longer include
17986 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
17987 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
17988 Coreutils 4.5.1.
17989
179902002-09-24 Akim Demaille <akim@epita.fr>
17991
17992 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
17993 (Frequently Asked Questions, Parser Stack Overflow): New.
17994
179952002-09-13 Akim Demaille <akim@epita.fr>
17996
17997 Playing with autoscan.
17998
17999 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
18000 * src/files.c (skeleton_find): Remove, unused.
18001 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
18002 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
18003
180042002-09-13 Akim Demaille <akim@epita.fr>
18005
18006 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
18007 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
18008
180092002-09-13 Akim Demaille <akim@epita.fr>
18010
18011 * configure.ac: Require 2.54.
18012 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
18013 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
18014 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
18015 Remove, provided by Autoconf macros.
18016
180172002-09-12 Akim Demaille <akim@epita.fr>
18018
18019 * m4/prereq.m4: Update, from Coreutils 4.5.1.
18020
180212002-09-12 Akim Demaille <akim@epita.fr>
18022
18023 * m4/prereq.m4: Update, from Fileutils 4.1.5.
18024 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
18025 Reported by Martin Mokrejs.
18026
180272002-09-10 Akim Demaille <akim@epita.fr>
18028
18029 * src/parse-gram.y: Associate a human readable string to each
18030 token type.
18031 * tests/regression.at (Invalid inputs): Adjust.
18032
180332002-09-10 Gary V. Vaughan <gary@gnu.org>
18034
18035 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
18036 with an Autoconf-2.5x style configure.ac.
18037
180382002-09-06 Paul Eggert <eggert@twinsun.com>
18039
18040 * doc/bison.texinfo (Conditions): Make explicit that the GPL
18041 exception applies only to yacc.c. This is a modification of a
18042 patch originally suggested by Akim Demaille.
18043
180442002-09-06 Akim Demaille <akim@epita.fr>
18045
18046 * data/c.m4 (b4_copyright): Move the GPL exception comment from
18047 here to...
18048 * data/yacc.c: here.
18049
18050 * data/lalr1.cc (struct yyltype): Don't define it, since we use
18051 LocationType.
18052 (b4_ltype): Default to yy::Location from location.hh.
18053
180542002-09-04 Jim Meyering <jim@meyering.net>
18055
18056 * data/yacc.c: Guard the declaration of yytoknum also with
18057 `#ifdef YYPRINT', so it is declared only when used.
18058
180592002-09-04 Akim Demaille <akim@epita.fr>
18060
18061 * configure.in: Rename as...
18062 * configure.ac: this.
18063 Bump to 1.49c.
18064
180652002-09-04 Akim Demaille <akim@epita.fr>
18066
18067 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
18068 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
18069 translate maintainer only messages.
18070
180712002-08-12 Paul Eggert <eggert@twinsun.com>
18072
18073 Version 1.49b.
18074
18075 * Makefile.am (SUBDIRS): Remove intl.
18076 (DISTCLEANFILES): Remove.
18077 * NEWS: Mention that GNU M4 is now required. Clarify what is
18078 meant by "larger grammars". Mention the pt_BR translation.
18079 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
18080 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
18081 Bump version from 0.11.2 to 0.11.5.
18082 (BISON_PREREQ_STAGE): Remove.
18083 (AM_GNU_GETTEXT): Use external gettext.
18084 (AC_OUTPUT): Remove intl/Makefile.
18085
18086 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
18087
18088 * data/glr.c: Include string.h, for strlen.
18089 (yyreportParseError): Use size_t for yysize.
18090 (yy_yypstack): No longer nested inside yypstates, as nested
18091 functions are not portable. Do not assume size_t is the
18092 same width as int.
18093 (yypstates): Do not assume that ptrdiff_t is the same width
18094 as int, and similarly for yyposn and YYINDEX.
18095
18096 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
18097
18098 * lib/Makefile.am (INCLUDES): Do not include from the intl
18099 directory, which has been removed.
18100 * src/Makefile.am (INCLUDES): Likewise.
18101
18102 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
18103 (bitsets_sources, additional_bitsets_sources, timevars_sources):
18104 New vars.
18105
18106 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
18107 * tests/Makefile.am (EXTRA_DIST): Likewise.
18108
18109 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
18110 Do not assume that bitset_windex is the same width as unsigned.
18111
18112 * lib/abitset.c (abitset_unused_clear): Do not assume that
18113 bitset_word is the same width as int.
18114 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
18115 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
18116 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
18117 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
18118 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
18119
18120 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
18121 portability to one's complement hosts!).
18122 * lib/ebitset.c (ebitset_op1): Likewise.
18123 * lib/lbitset.c (lbitset_op1): Likewise.
18124
18125 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
18126 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
18127 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
18128 Sync with fileutils.
18129 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
18130 lib/gettext.h: Sync with diffutils.
18131
18132 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
18133 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
18134
18135 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
18136 PROTOTYPES to check for prototypes, and "defined __STDC__" to
18137 check for void *.
18138
18139 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
18140 size_t; the old version tried to do this but casted improperly.
18141 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
18142 (bitset_test): Now returns int, not unsigned long.
18143
18144 * lib/bitset_stats.c: Include "gettext.h".
18145 (_): New macro.
18146 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
18147 name locals "index", as it generates unnecessary warnings on some
18148 hosts that have an "index" function.
18149
18150 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
18151 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
18152 they need translation.
18153 * src/LR0.c (state_list_append, new_itemsets, get_state,
18154 append_states, generate_states): Likewise.
18155 * src/assoc.c (assoc_to_string): Likewise.
18156 * src/closure.c (print_closure, set_firsts, closure): Likewise.
18157 * src/gram.c (grammar_dump): Likewise.
18158 * src/injections.c (injections_compute): Likewise.
18159 * src/lalr.c (lookaheads_print): Likewise.
18160 * src/relation.c (relation_transpose): Likewise.
18161 * src/scan-gram.l: Likewise.
18162 * src/tables.c (table_grow, pack_vector): Likewise.
18163
18164 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
18165 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
18166 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
18167 * m4/mbstate_t.m4: Sync with fileutils.
18168 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
18169
18170 * po/LINGUAS: Add pt_BR.
18171 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
18172 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
18173 lib/timevar.c.
18174 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
18175 manual recommends.
18176 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
18177
18178 * src/complain.c (strerror_r): Remove decl; not needed.
18179 (strerror): Use same pattern as ../lib/error.c.
18180
18181 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
18182
18183 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
18184
18185 * src/main.c (main): Cast result of bindtextdomain and textdomain
18186 to void, to avoid a GCC warning when --disable-nls is in effect.
18187
18188 * src/scan-gram.l: Use strings rather than escapes when possible,
18189 to minimize the number of warnings from xgettext.
18190 (handle_action_dollar, handle_action_at): Don't use isdigit,
18191 as it mishandles negative chars and it may not work as expected
18192 outside the C locale.
18193
18194 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
18195 this is a GCC extension and is not portable to other compilers.
18196
18197 * src/system.h (alloca): Use same pattern as ../lib/error.c.
18198 Do not include <ctype.h>; no longer needed.
18199 Do not include <malloc.h>; no longer needed (and generates
18200 warnings on OpenBSD 3.0).
18201
18202 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
18203 it's not portable.
18204
18205 * tests/regression.at: Do not use 'cc -c input.c -o input';
18206 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
18207
18208 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
18209 exit status as failure, not just exit status 1. Sun C exits
18210 with status 2 sometimes.
18211
18212 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
18213 Use it for the two large tests.
18214
182152002-08-02 Akim Demaille <akim@epita.fr>
18216
18217 * src/conflicts.c (conflicts_output): Don't output rules never
18218 reduced here, since anyway that computation doesn't work.
18219 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
18220 (rule_useless_p, rule_never_reduced_p): New.
18221 (grammar_rules_partial_print): Use a filter instead of a range.
18222 Display the title only if needed.
18223 (grammar_rules_print): Adjust.
18224 (grammar_rules_never_reduced_report): New.
18225 * src/tables.c (action_row): Move the computation of rules never
18226 reduced to...
18227 (token_actions): here.
18228 * src/main.c (main): Make the parser before making the report, so
18229 that rules never reduced are computed.
18230 Call grammar_rules_never_reduced_report.
18231 * src/print.c (print_results): Report rules never reduced.
18232 * tests/conflicts.at, tests/reduce.at: Adjust.
18233
182342002-08-01 Akim Demaille <akim@epita.fr>
18235
18236 Instead of attaching lookaheads and duplicating the rules being
18237 reduced by a state, attach the lookaheads to the reductions.
18238
18239 * src/state.h (state_t): Remove the `lookaheads',
18240 `lookaheads_rule' member.
18241 (reductions_t): Add a `lookaheads' member.
18242 Use a regular array for the `rules'.
18243 * src/state.c (reductions_new): Initialize the lookaheads member
18244 to 0.
18245 (state_rule_lookaheads_print): Adjust.
18246 * src/state.h, src/state.c (state_reductions_find): New.
18247 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
18248 (count_rr_conflicts): Adjust.
18249 * src/lalr.c (LArule): Remove.
18250 (add_lookback_edge): Adjust.
18251 (state_lookaheads_count): New.
18252 (states_lookaheads_initialize): Merge into...
18253 (initialize_LA): this.
18254 (lalr_free): Adjust.
18255 * src/main.c (main): Don't free nullable and derives too early: it
18256 is used by --verbose.
18257 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
18258
182592002-08-01 Akim Demaille <akim@epita.fr>
18260
18261 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
18262 `rule_number_t**'.
18263 (set_derives, free_derives): Rename as...
18264 (derives_compute, derives_free): this.
18265 Adjust all dependencies.
18266 * src/nullable.c (set_nullable, free_nullable): Rename as...
18267 (nullable_compute, nullable_free): these.
18268 (rule_list_t): Store rule_t *, not rule_number_t.
18269 * src/state.c (state_rule_lookaheads_print): Directly compare rule
18270 pointers, instead of their numbers.
18271 * src/main.c (main): Call nullable_free, and derives_free earlier,
18272 as they were lo longer used.
18273
182742002-08-01 Akim Demaille <akim@epita.fr>
18275
18276 * lib/timevar.c (get_time): Include children time.
18277 * src/lalr.h (LA, LArule): Don't export them: used with the
18278 state_t.
18279 * src/lalr.c (LA, LArule): Static.
18280 * src/lalr.h, src/lalr.c (lalr_free): New.
18281 * src/main.c (main): Call it.
18282 * src/tables.c (pack_vector): Check whether loc is >= to the
18283 table_size, not >.
18284 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
18285 (tables_generate): do it, since that's also it which allocates
18286 them.
18287 Don't free LA and LArule, main does.
18288
182892002-07-31 Akim Demaille <akim@epita.fr>
18290
18291 Separate parser tables computation and output.
18292
18293 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
18294 (conflict_list, conflict_list_cnt, table, check, table_ninf)
18295 (yydefgoto, yydefact, high): Move to...
18296 * src/tables.h, src/tables.c: here.
18297 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
18298 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
18299 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
18300 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
18301 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
18302 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
18303 (action_row, save_row, token_actions, save_column, default_goto)
18304 (goto_actions, sort_actions, matching_state, pack_vector)
18305 (table_ninf_remap, pack_table, prepare_actions): Move to...
18306 * src/tables.c: here.
18307 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
18308 * src/output.c (token_actions, output_base, output_conflicts)
18309 (output_check): Merge into...
18310 (prepare_actions): this.
18311 (actions_output): Rename as...
18312 (user_actions_output): this.
18313 * src/main.c (main): Call tables_generate and tables_free.
18314
183152002-07-31 Akim Demaille <akim@epita.fr>
18316
18317 Steal GCC's --time-report support.
18318
18319 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
18320 stolen/adjusted from GCC.
18321 * m4/stage.m4: Remove time related checks.
18322 * m4/timevar.m4: New.
18323 * configure.in: Adjust.
18324 * src/system.h: Adjust to using timevar.h.
18325 * src/getargs.h, src/getargs.c: Support trace_time for
18326 --trace=time.
18327 * src/main.c (stage): Remove.
18328 (main): Replace `stage' invocations with timevar calls.
18329 * src/output.c: Insert pertinent timevar calls.
18330
183312002-07-31 Akim Demaille <akim@epita.fr>
18332
18333 Let --trace have arguments.
18334
18335 * src/getargs.h (enum trace_e): New.
18336 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
18337 (long_options, short_options): --trace/-T takes an optional
18338 argument.
18339 Change all the uses of trace_flag to reflect the new flags.
18340 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
18341
18342 Strengthen `stage' portability.
18343
18344 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
18345 * configure.in: Use it.
18346 Don't check for malloc.h and sys/times.h.
18347 * src/system.h: Include them when appropriate.
18348 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
18349 times and struct tms are available.
18350
183512002-07-30 Akim Demaille <akim@epita.fr>
18352
18353 In verbose parse error message, don't report `error' as an
18354 expected token.
18355 * tests/actions.at (Printers and Destructors): Adjust.
18356 * tests/calc.at (Calculator $1): Adjust.
18357 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
18358 error message, do not report the parser accepts the error token in
18359 that state.
18360
183612002-07-30 Akim Demaille <akim@epita.fr>
18362
18363 Normalize conflict related messages.
18364
18365 * src/complain.h, src/complain.c (warn, complain): New.
18366 * src/conflicts.c (conflicts_print): Use them.
18367 (conflict_report_yacc): New, extracted from...
18368 (conflicts_print): here.
18369 * tests/conflicts.at, tests/existing.at: Adjust.
18370
183712002-07-30 Akim Demaille <akim@epita.fr>
18372
18373 Report rules which are never reduced by the parser: those hidden
18374 by conflicts.
18375
18376 * src/LR0.c (save_reductions): Don't make the final state too
18377 different: save its reduction (accept) instead of having a state
18378 without any action (no shift or goto, no reduce).
18379 Note: the final state is now a ``regular'' state, i.e., the
18380 parsers now contain `reduce 0' as default reduction.
18381 Nevertheless, since they decide to `accept' when yystate =
18382 final_state, they still will not reduce rule 0.
18383 * src/print.c (print_actions, print_reduction): Adjust.
18384 * src/output.c (action_row): Track reduced rules.
18385 (token_actions): Report rules never reduced.
18386 * tests/conflicts.at, tests/regression.at: Adjust.
18387
183882002-07-30 Akim Demaille <akim@epita.fr>
18389
18390 `stage' was accidently included in a previous patch.
18391 Initiate its autoconfiscation.
18392
18393 * configure.in: Look for malloc.h and sys/times.h.
18394 * src/main.c (stage): Adjust.
18395 Report only when trace_flag.
18396
183972002-07-29 Akim Demaille <akim@epita.fr>
18398
18399 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
18400 state_number_t.
18401 (errs_t): symbol_t*, not symbol_number_t.
18402 (reductions_t): rule_t*, not rule_number_t.
18403 (FOR_EACH_SHIFT): New.
18404 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
18405 * src/print.c, src/print_graph.c: Adjust.
18406
184072002-07-29 Akim Demaille <akim@epita.fr>
18408
18409 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
18410
18411 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
18412 (endtoken, accept): these.
18413 * src/reader.c (reader): Set endtoken's default tag to "$end".
18414 Set undeftoken's tag to "$undefined" instead of "$undefined.".
18415 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
18416 Adjust.
18417
184182002-07-29 Akim Demaille <akim@epita.fr>
18419
18420 * src/reduce.c (reduce_grammar): When the language is empty,
18421 complain about the start symbol, not the axiom.
18422 Use its location.
18423 * tests/reduce.at (Empty Language): New.
18424
184252002-07-26 Akim Demaille <akim@epita.fr>
18426
18427 * src/reader.h, src/reader.c (gram_error): ... can't get
18428 yycontrol without making too strong assumptions on the parser
18429 itself.
18430 * src/output.c (prepare_tokens): Use the real 0th value of
18431 token_translations instead of `0'.
18432 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
18433 visible here.
18434 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
18435 for the time being: %locations ought to provide it to yyerror.
18436
184372002-07-25 Akim Demaille <akim@epita.fr>
18438
18439 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
18440 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
18441 * tests/regression.at (Web2c Actions): Adjust.
18442
184432002-07-25 Akim Demaille <akim@epita.fr>
18444
18445 Stop storing rules from 1 to nrules + 1.
18446
18447 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
18448 * src/nullable.c, src/output.c, src/print.c, src/reader.c
18449 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
18450 Iterate from 0 to nrules.
18451 Use rule_number_as_item_number and item_number_as_rule_number.
18452 Adjust to `derive' now containing possibly 0.
18453 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
18454 Handle the `- 1' part in rule numbers from/to item numbers.
18455 * src/conflicts.c (log_resolution): Fix the message which reversed
18456 shift and reduce.
18457 * src/output.c (action_row): Initialize default_rule to -1.
18458 (token_actions): Adjust.
18459 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
18460 expected output.
18461 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
18462
184632002-07-25 Akim Demaille <akim@epita.fr>
18464
18465 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
18466 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
18467 (b4_c_knr_arg_decl): New.
18468 * data/yacc.c: Use it to define yysymprint, yydestruct, and
18469 yyreport_parse_error.
18470
184712002-07-25 Akim Demaille <akim@epita.fr>
18472
18473 * data/yacc.c (yyreport_parse_error): New, extracted from...
18474 (yyparse): here.
18475 (yydestruct, yysymprint): Move above yyparse.
18476 Be K&R compliant.
18477
184782002-07-25 Akim Demaille <akim@epita.fr>
18479
18480 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
18481 replace...
18482 (b4_sint_type, b4_uint_type): these.
18483 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
18484 * tests/regression.at (Web2c Actions): Adjust.
18485
184862002-07-25 Akim Demaille <akim@epita.fr>
18487
18488 * src/gram.h (TIEM_NUMBER_MAX): New.
18489 (item_number_of_rule_number, rule_number_of_item_number): Rename
18490 as...
18491 (rule_number_as_item_number, item_number_as_rule_number): these.
18492 Adjust dependencies.
18493 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
18494 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
18495 (symbol_number_to_vector_number): New.
18496 (order): Of vector_number_t* type.
18497 (base_t, BASE_MAX, BASE_MIN): New.
18498 (froms, tos, width, pos, check): Of base_t type.
18499 (action_number_t, ACTION_MIN, ACTION_MAX): New.
18500 (actrow): Of action_number_t type.
18501 (conflrow): Of unsigned int type.
18502 (table_ninf, base_ninf): New.
18503 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
18504 (muscle_insert_int_table, muscle_insert_base_table)
18505 (muscle_insert_rule_number_table): New.
18506 (prepare_tokens): Output `toknum' as int_table.
18507 (action_row): Returns a rule_number_t.
18508 Use ACTION_MIN, not SHRT_MIN.
18509 (token_actions): yydefact is rule_number_t*.
18510 (table_ninf_remap): New.
18511 (pack_table): Use it for `base' and `table'.
18512 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
18513 replaced with...
18514 (YYPACT_NINF, YYTABLE_NINF): these.
18515 (yypact, yytable): Compute their types instead of hard-coded
18516 `short'.
18517 * tests/regression.at (Web2c Actions): Adjust.
18518
185192002-07-19 Akim Demaille <akim@epita.fr>
18520
18521 * src/scan-gram.l (id): Can start with an underscore.
18522
185232002-07-16 Akim Demaille <akim@epita.fr>
18524
18525 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
18526 Adjust all former `associativity' dependencies.
18527 * src/symtab.c (symbol_new): Default associativity is `undef', not
18528 `right'.
18529 (symbol_check_alias_consistence): Adjust.
18530
185312002-07-09 Akim Demaille <akim@epita.fr>
18532
18533 * doc/bison.texinfo: Properly set the ``header'' part.
18534 Use @dircategory ``GNU programming tools'' as per Texinfo's
18535 documentation.
18536 Use @copying.
18537
185382002-07-09 Akim Demaille <akim@epita.fr>
18539
18540 * lib/quotearg.h: Protect against multiple inclusions.
18541 * src/location.h (location_t): Add a `file' member.
18542 (LOCATION_RESET, LOCATION_PRINT): Adjust.
18543 * src/complain.c (warn_at, complain_at, fatal_at): Drop
18544 `error_one_per_line' support.
18545
185462002-07-09 Akim Demaille <akim@epita.fr>
18547
18548 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
18549 * src/reader.c (lineno): Remove.
18550 Adjust all dependencies.
18551 (get_merge_function): Take a location and use complain_at.
18552 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
18553 * tests/regression.at (Invalid inputs, Mixing %token styles):
18554 Adjust.
18555
185562002-07-09 Akim Demaille <akim@epita.fr>
18557
18558 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
18559 recovery rule, and forbid extensions when --yacc.
18560 (gram_error): Use complain_at.
18561 * src/reader.c (reader): Exit if there were parse errors.
18562
185632002-07-09 Akim Demaille <akim@epita.fr>
18564
18565 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
18566 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
18567 Reported by R Blake <blakers@mac.com>.
18568
185692002-07-09 Akim Demaille <akim@epita.fr>
18570
18571 * data/yacc.c: Output the copyright notive in the header.
18572
185732002-07-03 Akim Demaille <akim@epita.fr>
18574
18575 * src/output.c (froms, tos): Are state_number_t.
18576 (save_column): sp, sp1, and sp2 are state_number_t.
18577 (prepare): Rename `final' as `final_state_number', `nnts' as
18578 `nterms_number', `nrules' as `rules_number', `nstates' as
18579 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
18580 unused.
18581 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
18582 * data/lalr1.cc (nsym_): Remove, unused.
18583
185842002-07-03 Akim Demaille <akim@epita.fr>
18585
18586 * src/lalr.h, src/lalr.c (goto_number_t): New.
18587 * src/lalr.c (goto_list_t): New.
18588 Propagate them.
18589 * src/nullable.c (rule_list_t): New.
18590 Propagate.
18591 * src/types.h: Remove.
18592
185932002-07-03 Akim Demaille <akim@epita.fr>
18594
18595 * src/closure.c (print_fderives): Use rule_rhs_print.
18596 * src/derives.c (print_derives): Use rule_rhs_print.
18597 (rule_list_t): New, replaces `shorts'.
18598 (set_derives): Add comments.
18599 * tests/sets.at (Nullable, Firsts): Adjust.
18600
186012002-07-03 Akim Demaille <akim@epita.fr>
18602
18603 * src/output.c (prepare_actions): Free `tally' and `width'.
18604 (prepare_actions): Allocate and free `order'.
18605 * src/symtab.c (symbols_free): Free `symbols'.
18606 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
18607 * src/output.c (m4_invoke): Move to...
18608 * src/scan-skel.l: here.
18609 (<<EOF>>): Close yyout, and free its name.
18610
186112002-07-03 Akim Demaille <akim@epita.fr>
18612
18613 Fix some memory leaks, and fix a bug: state 0 was examined twice.
18614
18615 * src/LR0.c (new_state): Merge into...
18616 (state_list_append): this.
18617 (new_states): Merge into...
18618 (generate_states): here.
18619 (set_states): Don't ensure a proper `errs' state member here, do it...
18620 * src/conflicts.c (conflicts_solve): here.
18621 * src/state.h, src/state.c: Comment changes.
18622 (state_t): Rename member `shifts' as `transitions'.
18623 Adjust all dependencies.
18624 (errs_new): For consistency, also take the values as argument.
18625 (errs_dup): Remove.
18626 (state_errs_set): New.
18627 (state_reductions_set, state_transitions_set): Assert that no
18628 previous value was assigned.
18629 (state_free): New.
18630 (states_free): Use it.
18631 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
18632 temporary storage: use `errs' and `nerrs' as elsewhere.
18633 (set_conflicts): Allocate and free this `errs'.
18634
186352002-07-02 Akim Demaille <akim@epita.fr>
18636
18637 * lib/libiberty.h: New.
18638 * lib: Update the bitset implementation from upstream.
18639 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
18640 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
18641 * src/main.c: Adjust bitset stats calls.
18642
186432002-07-01 Paul Eggert <eggert@twinsun.com>
18644
18645 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
18646 char, so that negative chars don't collide with $.
18647
186482002-06-30 Akim Demaille <akim@epita.fr>
18649
18650 Have the GLR tests be `warning' checked, and fix the warnings.
18651
18652 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
18653 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
18654 (yyremoveDeletes): `yyi' and `yyj' are size_t.
18655 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
18656 (yyaddDeferredAction): static.
18657 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
18658 (yyreportParseError): yyprefix is const.
18659 yytokenp is used only when verbose.
18660 (yy__GNUC__): Replace with __GNUC__.
18661 (yypdumpstack): yyi is size_t.
18662 (yypreference): Un-yy local variables and arguments, to avoid
18663 clashes with `yyr1'. Anyway, we are not in the user name space.
18664 (yytname_size): be an int, as is compared with ints.
18665 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
18666 Use them.
18667 * tests/cxx-gram.at: Use quotation to protect $1.
18668 Use AT_COMPILE to enable warnings hunts.
18669 Prototype yylex and yyerror.
18670 `Use' argc.
18671 Include `string.h', not `strings.h'.
18672 Produce and prototype stmtMerge only when used.
18673 yylex takes a location.
18674
186752002-06-30 Akim Demaille <akim@epita.fr>
18676
18677 We spend a lot of time in quotearg, in particular when --verbose.
18678
18679 * src/symtab.c (symbol_get): Store a quoted version of the key.
18680 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
18681 Adjust all callers.
18682
186832002-06-30 Akim Demaille <akim@epita.fr>
18684
18685 * src/state.h (reductions_t): Rename member `nreds' as num.
18686 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
18687 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
18688
186892002-06-30 Akim Demaille <akim@epita.fr>
18690
18691 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
18692 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
18693 (shifts_to): Rename as...
18694 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
18695 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
18696 (TRANSITION_IS_DISABLED, transitions_to): these.
18697
186982002-06-30 Akim Demaille <akim@epita.fr>
18699
18700 * src/print.c (print_shifts, print_gotos): Merge into...
18701 (print_transitions): this.
18702 (print_transitions, print_errs, print_reductions): Align the
18703 lookaheads columns.
18704 (print_core, print_transitions, print_errs, print_state,
18705 print_grammar): Output empty lines separator before, not after.
18706 (state_default_rule_compute): Rename as...
18707 (state_default_rule): this.
18708 * tests/conflicts.at (Defaulted Conflicted Reduction),
18709 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
18710 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
18711
187122002-06-30 Akim Demaille <akim@epita.fr>
18713
18714 Display items as we display rules.
18715
18716 * src/gram.h, src/gram.c (rule_lhs_print): New.
18717 * src/gram.c (grammar_rules_partial_print): Use it.
18718 * src/print.c (print_core): Likewise.
18719 * tests/conflicts.at (Defaulted Conflicted Reduction),
18720 (Unresolved SR Conflicts): Adjust.
18721 (Unresolved SR Conflicts): Adjust and rename as...
18722 (Resolved SR Conflicts): this, as was meant.
18723 * tests/regression.at (Web2c Report): Adjust.
18724
187252002-06-30 Akim Demaille <akim@epita.fr>
18726
18727 * src/print.c (state_default_rule_compute): New, extracted from...
18728 (print_reductions): here.
18729 Pessimize, but clarify the code.
18730 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
18731
187322002-06-30 Akim Demaille <akim@epita.fr>
18733
18734 * src/output.c (action_row): Let default_rule be always a rule
18735 number.
18736
187372002-06-30 Akim Demaille <akim@epita.fr>
18738
18739 * src/closure.c (print_firsts, print_fderives, closure):
18740 Use BITSET_EXECUTE.
18741 * src/lalr.c (lookaheads_print): Likewise.
18742 * src/state.c (state_rule_lookaheads_print): Likewise.
18743 * src/print_graph.c (print_core): Likewise.
18744 * src/print.c (print_reductions): Likewise.
18745 * src/output.c (action_row): Likewise.
18746 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
18747
187482002-06-30 Akim Demaille <akim@epita.fr>
18749
18750 * src/print_graph.c: Use report_flag.
18751
187522002-06-30 Akim Demaille <akim@epita.fr>
18753
18754 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
18755 to...
18756 * src/relation.h, src/relation.c (traverse, relation_digraph)
18757 (relation_print, relation_transpose): New.
18758
187592002-06-30 Akim Demaille <akim@epita.fr>
18760
18761 * src/state.h, src/state.c (shifts_to): New.
18762 * src/lalr.c (build_relations): Use it.
18763
187642002-06-30 Akim Demaille <akim@epita.fr>
18765
18766 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
18767 (item_number_of_rule_number, rule_number_of_item_number): New.
18768 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
18769 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
18770 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
18771 Propagate their use.
18772 Much remains to be done, in particular wrt `shorts' from types.h.
18773
187742002-06-30 Akim Demaille <akim@epita.fr>
18775
18776 * src/symtab.c (symbol_new): Initialize the `printer' member.
18777
187782002-06-30 Akim Demaille <akim@epita.fr>
18779
18780 * src/LR0.c (save_reductions): Remove, replaced by...
18781 * src/state.h, src/state.c (state_reductions_set): New.
18782 (reductions, errs): Rename as...
18783 (reductions_t, errs_t): these.
18784 Adjust all dependencies.
18785
187862002-06-30 Akim Demaille <akim@epita.fr>
18787
18788 * src/LR0.c (state_list_t, state_list_append): New.
18789 (first_state, last_state): Now symbol_list_t.
18790 (this_state): Remove.
18791 (new_itemsets, append_states, save_reductions): Take a state_t as
18792 argument.
18793 (set_states, generate_states): Adjust.
18794 (save_shifts): Remove, replaced by...
18795 * src/state.h, src/state.c (state_shifts_set): New.
18796 (shifts): Rename as...
18797 (shifts_t): this.
18798 Adjust all dependencies.
18799 * src/state.h (state_t): Remove the `next' member.
18800
188012002-06-30 Akim Demaille <akim@epita.fr>
18802
18803 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
18804 escaped in slot 0.
18805
188062002-06-30 Akim Demaille <akim@epita.fr>
18807
18808 Use hash.h for the state hash table.
18809
18810 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
18811 (allocate_storage): Use state_hash_new.
18812 (free_storage): Use state_hash_free.
18813 (new_state, get_state): Adjust.
18814 * src/lalr.h, src/lalr.c (states): Move to...
18815 * src/states.h (state_t): Remove the `link' member, no longer
18816 used.
18817 * src/states.h, src/states.c: here.
18818 (state_hash_new, state_hash_free, state_hash_lookup)
18819 (state_hash_insert, states_free): New.
18820 * src/states.c (state_table, state_compare, state_hash): New.
18821 * src/output.c (output_actions): Do not free states now, since we
18822 still need to know the final_state number in `prepare', called
18823 afterwards. Do it...
18824 * src/main.c (main): here: call states_free after `output'.
18825
188262002-06-30 Akim Demaille <akim@epita.fr>
18827
18828 * src/state.h, src/state.c (state_new): New, extracted from...
18829 * src/LR0.c (new_state): here.
18830 * src/state.h (STATE_ALLOC): Move to...
18831 * src/state.c: here.
18832 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
18833 * src/state.h, src/state.c: here.
18834
188352002-06-30 Akim Demaille <akim@epita.fr>
18836
18837 * src/reader.c (gensym): Rename as...
18838 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
18839 (getsym): Rename as...
18840 (symbol_get): this.
18841
188422002-06-30 Akim Demaille <akim@epita.fr>
18843
18844 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
18845 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
18846 * src/output.c, src/print.c, src/print_graph.c: Propagate.
18847 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
18848
188492002-06-30 Akim Demaille <akim@epita.fr>
18850
18851 Make the test suite pass with warnings checked.
18852
18853 * tests/actions.at (Printers and Destructors): Improve.
18854 Avoid unsigned vs. signed issues.
18855 * tests/calc.at: Don't exercise the scanner here, do it...
18856 * tests/input.at (Torturing the Scanner): here.
18857
188582002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18859
18860 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
18861 reorganize first lines parallel to yacc.c.
18862
188632002-06-28 Akim Demaille <akim@epita.fr>
18864
18865 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
18866 (b4_token_enum, b4_token_defines): New, factored from...
18867 * data/lalr1.cc, data/yacc.c, glr.c: here.
18868
188692002-06-28 Akim Demaille <akim@epita.fr>
18870
18871 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
18872 unused variables.
18873 * src/output.c (merger_output): static.
18874
188752002-06-28 Akim Demaille <akim@epita.fr>
18876
18877 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
18878 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
18879 pacify GCC.
18880 * src/output.c (save_row): Initialize all the variables to pacify GCC.
18881
188822002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18883
18884 Accumulated changelog for new GLR parsing features.
18885
18886 * src/conflicts.c (count_total_conflicts): Change name to
18887 conflicts_total_count.
18888 * src/conflicts.h: Ditto.
18889 * src/output.c (token_actions): Use the new name.
18890 (output_conflicts): Change conflp => conflict_list_heads, and
18891 confl => conflict_list for better readability.
18892 * data/glr.c: Use the new names.
18893 * NEWS: Add self to GLR announcement.
18894
18895 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
18896
18897 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
18898 Akim Demaille.
18899
18900 * data/bison.glr: Change name to glr.c
18901 * data/glr.c: Renamed from bison.glr.
18902 * data/Makefile.am: Add glr.c
18903
18904 * src/getargs.c:
18905
18906 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
18907 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
18908
18909 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18910
18911 * data/bison.glr: Be sure to restore the
18912 current #line when returning to the skeleton contents after having
18913 exposed the input file's #line.
18914
18915 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18916
18917 * data/bison.glr: Bring up to date with changes to bison.simple.
18918
18919 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18920
18921 * data/bison.glr: Correct definitions that use b4_prefix.
18922 Various reformatting.
18923 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
18924 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
18925 yytokenp argument; now part of stack.
18926 (yychar): Define to behave as documented.
18927 (yyclearin): Ditto.
18928
18929 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18930
18931 * src/reader.h: Add declaration for free_merger_functions.
18932
18933 * src/reader.c (merge_functions): New variable.
18934 (get_merge_function): New function.
18935 (free_merger_functions): New function.
18936 (readgram): Check for %prec that is not followed by a symbol.
18937 Handle %dprec and %merge declarations.
18938 (packgram): Initialize dprec and merger fields in rules array.
18939
18940 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
18941 conflict_list_cnt, conflict_list_free): New variables.
18942 (table_grow): Also grow conflict_table.
18943 (prepare_rules): Output dprec and merger tables.
18944 (conflict_row): New function.
18945 (action_row): Output conflict lists for GLR parser. Don't use
18946 default reduction in conflicted states for GLR parser so that there
18947 are spaces for the conflict lists.
18948 (save_row): Also save conflict information.
18949 (token_actions): Allocate conflict list.
18950 (merger_output): New function.
18951 (pack_vector): Pack conflict table, too.
18952 (output_conflicts): New function to output yyconflp and yyconfl.
18953 (output_check): Allocate conflict_tos.
18954 (output_actions): Output conflict tables, also.
18955 (output_skeleton): Output b4_mergers definition.
18956 (prepare): Output b4_max_rhs_length definition.
18957 Use 'bison.glr' as default skeleton for GLR parsers.
18958
18959 * src/gram.c (glr_parser): New flag.
18960 (grammar_free): Call free_merger_functions.
18961
18962 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
18963 all pairs of conflicting reductions, rather than just all tokens
18964 causing conflicts. Needed to size conflict tables.
18965 (conflicts_output): Modify call to count_rr_conflicts for new
18966 interface.
18967 (conflicts_print): Ditto.
18968 (count_total_conflicts): New function.
18969
18970 * src/reader.h (merger_list): New type.
18971 (merge_functions): New variable.
18972
18973 * src/lex.h (tok_dprec, tok_merge): New token types.
18974
18975 * src/gram.h (rule_s): Add dprec and merger fields.
18976 (glr_parser): New flag.
18977
18978 * src/conflicts.h (count_total_conflicts): New function.
18979
18980 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
18981
18982 * doc/bison.texinfo (Generalized LR Parsing): New section.
18983 (GLR Parsers): New section.
18984 (Language and Grammar): Mention GLR parsing.
18985 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
18986 Correct typo ("tge" -> "the").
18987
18988 * data/bison.glr: New skeleton for GLR parsing.
18989
18990 * tests/cxx-gram.at: New tests for GLR parsing.
18991
18992 * tests/testsuite.at: Include cxx-gram.at.
18993
18994 * tests/Makefile.am: Add cxx-gram.at.
18995
18996 * src/parse-gram.y:
18997
18998 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
18999
19000 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
19001
190022002-06-27 Akim Demaille <akim@epita.fr>
19003
19004 * src/options.h, src/options.c: Remove.
19005 * src/getargs.c (short_options, long_options): New.
19006
190072002-06-27 Akim Demaille <akim@epita.fr>
19008
19009 * data/bison.simple, data/bison.c++: Rename as...
19010 * data/yacc.c, data/lalr1.cc: these.
19011 * doc/bison.texinfo (Environment Variables): Remove.
19012
190132002-06-25 Raja R Harinath <harinath@cs.umn.edu>
19014
19015 * src/getargs.c (report_argmatch): Initialize strtok().
19016
190172002-06-20 Akim Demaille <akim@epita.fr>
19018
19019 * data/bison.simple (b4_symbol_actions): New, replaces...
19020 (b4_symbol_destructor, b4_symbol_printer): these.
19021 (yysymprint): Be sure to call YYPRINT only for tokens, and using
19022 user token numbers.
19023
190242002-06-20 Akim Demaille <akim@epita.fr>
19025
19026 * data/bison.simple (yydestructor): Rename as...
19027 (yydestruct): this.
19028
190292002-06-20 Akim Demaille <akim@epita.fr>
19030
19031 * src/symtab.h, src/symtab.c (symbol_type_set)
19032 (symbol_destructor_set, symbol_precedence_set): The location is
19033 the last argument.
19034 Adjust all callers.
19035
190362002-06-20 Akim Demaille <akim@epita.fr>
19037
19038 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
19039 internals.
19040 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
19041 Takes a location.
19042 * src/symtab.h, src/symtab.c (symbol_class_set)
19043 (symbol_user_token_number_set): Likewise.
19044 Adjust all callers.
19045 Promote complain_at.
19046 * tests/input.at (Type Clashes): Adjust.
19047
190482002-06-20 Akim Demaille <akim@epita.fr>
19049
19050 * data/bison.simple (YYLEX): Fix the declaration when
19051 %pure-parser.
19052
190532002-06-20 Akim Demaille <akim@epita.fr>
19054
19055 * data/bison.simple (yysymprint): Don't print the token number,
19056 just its name.
19057 * tests/actions.at (Destructors): Rename as...
19058 (Printers and Destructors): this.
19059 Also exercise %printer.
19060
190612002-06-20 Akim Demaille <akim@epita.fr>
19062
19063 * data/bison.simple (YYDSYMPRINT): New.
19064 Use it to remove many of the #if YYDEBUG/if (yydebug).
19065
190662002-06-20 Akim Demaille <akim@epita.fr>
19067
19068 * src/symtab.h, src/symtab.c (symbol_t): printer and
19069 printer_location are new members.
19070 (symbol_printer_set): New.
19071 * src/parse-gram.y (PERCENT_PRINTER): New token.
19072 Handle its associated rule.
19073 * src/scan-gram.l: Adjust.
19074 (handle_destructor_at, handle_destructor_dollar): Rename as...
19075 (handle_symbol_code_at, handle_symbol_code_dollar): these.
19076 * src/output.c (symbol_printers_output): New.
19077 (output_skeleton): Call it.
19078 * data/bison.simple (yysymprint): New. Cannot be named yyprint
19079 since there are already many grammar files with a user `yyprint'.
19080 Replace the calls to YYPRINT to calls to yysymprint.
19081 * tests/calc.at: Adjust.
19082 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
19083 taking advantage of parser very internal details (stack size!).
19084
190852002-06-20 Akim Demaille <akim@epita.fr>
19086
19087 * src/scan-gram.l: Complete the scanner with the missing patterns
19088 to pacify Flex.
19089 Use `quote' and `symbol_tag_get' where appropriate.
19090
190912002-06-19 Akim Demaille <akim@epita.fr>
19092
19093 * tests/actions.at (Destructors): Augment to test locations.
19094 * data/bison.simple (yydestructor): Pass it the current location
19095 if locations are enabled.
19096 Prototype only when __STDC__ or C++.
19097 Change the argument names to move into the yy name space: there is
19098 user code here.
19099
191002002-06-19 Akim Demaille <akim@epita.fr>
19101
19102 * data/bison.simple (b4_pure_if): New.
19103 Use it instead of #ifdef YYPURE.
19104
191052002-06-19 Akim Demaille <akim@epita.fr>
19106
19107 * data/bison.simple (b4_location_if): New.
19108 Use it instead of #ifdef YYLSP_NEEDED.
19109
191102002-06-19 Akim Demaille <akim@epita.fr>
19111
19112 Prepare @$ in %destructor, but currently don't bind it in the
19113 skeleton, as %location use is not cleaned up yet.
19114
19115 * src/scan-gram.l (handle_dollar, handle_destructor_at)
19116 (handle_action_at): New.
19117 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
19118 a braced_code_t and a location as additional arguments.
19119 (handle_destructor_dollar): Instead of requiring `b4_eval', just
19120 unquote one when outputting `b4_dollar_dollar'.
19121 Adjust callers.
19122 * data/bison.simple (b4_eval): Remove.
19123 (b4_symbol_destructor): Adjust.
19124 * tests/input.at (Invalid @n): Adjust.
19125
191262002-06-19 Zack Weinberg <zack@codesourcery.com>
19127
19128 * doc/bison.texinfo: Document ability to have multiple
19129 prologue sections.
19130
191312002-06-18 Akim Demaille <akim@epita.fr>
19132
19133 * src/files.c (compute_base_names): When computing the output file
19134 names from the input file name, strip the directory part.
19135
191362002-06-18 Akim Demaille <akim@epita.fr>
19137
19138 * data/bison.simple.new: Comment changes.
19139 Reported by Andreas Schwab.
19140
191412002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
19142
19143 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
19144 there are no `label `yyoverflowlab' defined but not used' warnings
19145 when yyoverflow is defined.
19146
191472002-06-18 Akim Demaille <akim@epita.fr>
19148
19149 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
19150 new member.
19151 (symbol_destructor_set): Adjust.
19152 * src/output.c (symbol_destructors_output): Output the destructor
19153 locations.
19154 Output the symbol name.
19155 * data/bison.simple (b4_symbol_destructor): Adjust.
19156
191572002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
19158 and Akim Demaille <akim@epita.fr>
19159
19160 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
19161 what's left on the stack when the error recovery hits EOF.
19162 * tests/actions.at (Destructors): Complete to exercise this case.
19163
191642002-06-17 Akim Demaille <akim@epita.fr>
19165
19166 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
19167 arguments is really empty, not only equal to `[]'.
19168 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
19169 member.
19170 (symbol_destructor_set): New.
19171 * src/output.c (symbol_destructors_output): New.
19172 * src/reader.h (brace_code_t, current_braced_code): New.
19173 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
19174 (handle_dollar): Rename as...
19175 (handle_action_dollar): this.
19176 (handle_destructor_dollar): New.
19177 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
19178 (grammar_declaration): Use it.
19179 * data/bison.simple (yystos): Is always defined.
19180 (yydestructor): New.
19181 * tests/actions.at (Destructors): New.
19182 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
19183
191842002-06-17 Akim Demaille <akim@epita.fr>
19185
19186 * src/symlist.h, src/symlist.c (symbol_list_length): New.
19187 * src/scan-gram.l (handle_dollar, handle_at): Compute the
19188 rule_length only when needed.
19189 * src/output.c (actions_output, token_definitions_output): Output
19190 the full M4 block.
19191 * src/symtab.c: Don't access directly to the symbol tag, use
19192 symbol_tag_get.
19193 * src/parse-gram.y: Use symbol_list_free.
19194
191952002-06-17 Akim Demaille <akim@epita.fr>
19196
19197 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
19198 (symbol_list_prepend, get_type_name): Move to...
19199 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
19200 (symbol_list_prepend, symbol_list_n_type_name_get): here.
19201 Adjust all callers.
19202 (symbol_list_free): New.
19203 * src/scan-gram.l (handle_dollar): Takes a location.
19204 * tests/input.at (Invalid $n): Adjust.
19205
192062002-06-17 Akim Demaille <akim@epita.fr>
19207
19208 * src/reader.h, src/reader.c (symbol_list_new): Export it.
19209 (symbol_list_prepend): New.
19210 * src/parse-gram.y (%union): `list' is a new member.
19211 (symbols.1): New, replaces...
19212 (terms_to_prec.1, nterms_to_type.1): these.
19213 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
19214 Take a location as additional argument.
19215 Adjust all callers.
19216
192172002-06-15 Akim Demaille <akim@epita.fr>
19218
19219 * src/parse-gram.y: Move %token in the declaration section so that
19220 we don't depend upon CVS Bison.
19221
192222002-06-15 Akim Demaille <akim@epita.fr>
19223
19224 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
19225 * src/print.c (print_core): Use it.
19226
192272002-06-15 Akim Demaille <akim@epita.fr>
19228
19229 * src/conflicts.c (log_resolution): Accept the rule involved in
19230 the sr conflicts instead of the lookahead number that points to
19231 that rule.
19232 (flush_reduce): Accept the current lookahead vector as argument,
19233 instead of the index in LA.
19234 (resolve_sr_conflict): Accept the current number of lookahead
19235 bitset to consider for the STATE, instead of the index in LA.
19236 (set_conflicts): Adjust.
19237 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
19238
192392002-06-15 Akim Demaille <akim@epita.fr>
19240
19241 * src/state.h (state_t): Replace the `lookaheadsp' member, a
19242 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
19243 Adjust all dependencies.
19244 * src/lalr.c (initialize_lookaheads): Split into...
19245 (states_lookaheads_count, states_lookaheads_initialize): these.
19246 (lalr): Adjust.
19247
192482002-06-15 Akim Demaille <akim@epita.fr>
19249
19250 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
19251 out of...
19252 (grammar_rules_print): here.
19253 * src/reduce.c (reduce_output): Use it.
19254 * tests/reduce.at (Useless Rules, Reduced Automaton)
19255 (Underivable Rules): Adjust.
19256
192572002-06-15 Akim Demaille <akim@epita.fr>
19258
19259 Copy BYacc's nice way to report the grammar.
19260
19261 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
19262 New.
19263 Don't print the rules' location, it is confusing and useless.
19264 (rule_print): Use grammar_rhs_print.
19265 * src/print.c (print_grammar): Use grammar_rules_print.
19266
192672002-06-15 Akim Demaille <akim@epita.fr>
19268
19269 Complete and rationalize `useless thing' warnings.
19270
19271 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
19272 (symbol_tag_print): New.
19273 Use them everywhere in place of accessing directly the tag member.
19274 * src/gram.h, src/gram.c (rule_print): New.
19275 Use it where a rule used to be printed `by hand'.
19276 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
19277 (reduce_grammar_tables): Report the useless rules.
19278 (reduce_print): Useless things are a warning, not an error.
19279 Report it as such.
19280 * tests/reduce.at (Useless Nonterminals, Useless Rules):
19281 (Reduced Automaton, Underivable Rules): Adjust.
19282 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
19283 * tests/conflicts.at (Unresolved SR Conflicts)
19284 (Solved SR Conflicts): Adjust.
19285
192862002-06-15 Akim Demaille <akim@epita.fr>
19287
19288 Let symbols have a location.
19289
19290 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
19291 (getsym): Adjust.
19292 Adjust all callers.
19293 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
19294 Use location_t, not int.
19295 * src/symtab.c (symbol_check_defined): Take advantage of the
19296 location.
19297 * tests/regression.at (Invalid inputs): Adjust.
19298
192992002-06-15 Akim Demaille <akim@epita.fr>
19300
19301 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
19302 (input): Don't try to initialize yylloc here, do it in the
19303 scanner.
19304 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
19305 * src/gram.h (rule_t): Change line and action_line into location
19306 and action_location, of location_t type.
19307 Adjust all dependencies.
19308 * src/location.h, src/location.c (empty_location): New.
19309 * src/reader.h, src/reader.c (grammar_start_symbol_set)
19310 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
19311 (grammar_current_rule_symbol_append)
19312 (grammar_current_rule_action_append): Expect a location as argument.
19313 * src/reader.c (grammar_midrule_action): Adjust to attach an
19314 action's location as dummy symbol location.
19315 * src/symtab.h, src/symtab.c (startsymbol_location): New.
19316 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
19317 the line numbers.
19318
193192002-06-14 Akim Demaille <akim@epita.fr>
19320
19321 Grammar declarations may be found in the grammar section.
19322
19323 * src/parse-gram.y (rules_or_grammar_declaration): New.
19324 (declarations): Each declaration may end with a semicolon, not
19325 just...
19326 (grammar_declaration): `"%union"'.
19327 (grammar): Branch to rules_or_grammar_declaration.
19328
193292002-06-14 Akim Demaille <akim@epita.fr>
19330
19331 * src/main.c (main): Invoke scanner_free.
19332
193332002-06-14 Akim Demaille <akim@epita.fr>
19334
19335 * src/output.c (m4_invoke): Extracted from...
19336 (output_skeleton): here.
19337 Free tempfile.
19338
193392002-06-14 Akim Demaille <akim@epita.fr>
19340
19341 * src/parse-gram.y (directives, directive, gram)
19342 (grammar_directives, precedence_directives, precedence_directive):
19343 Rename as...
19344 (declarations, declaration, grammar, grammar_declaration)
19345 (precedence_declaration, precedence_declarator): these.
19346 (symbol_declaration): New.
19347
193482002-06-14 Akim Demaille <akim@epita.fr>
19349
19350 * src/files.c (action_obstack): Remove, unused.
19351 (output_obstack): Remove it, and all its dependencies, as it is no
19352 longer needed.
19353 * src/reader.c (epilogue_set): Build the epilogue in the
19354 muscle_obstack.
19355 * src/output.h, src/output.c (muscle_obstack): Move to...
19356 * src/muscle_tab.h, src/muscle_tab.h: here.
19357 (muscle_init): Initialize muscle_obstack.
19358 (muscle_free): New.
19359 * src/main.c (main): Call it.
19360
193612002-06-14 Akim Demaille <akim@epita.fr>
19362
19363 * src/location.h: New, extracted from...
19364 * src/reader.h: here.
19365 * src/Makefile.am (noinst_HEADERS): Merge into
19366 (bison_SOURCES): this.
19367 Add location.h.
19368 * src/parse-gram.y: Use location_t instead of Bison's.
19369 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
19370 Use location_t instead of ints.
19371
193722002-06-14 Akim Demaille <akim@epita.fr>
19373
19374 * data/bison.simple, data/bison.c++: Be sure to restore the
19375 current #line when returning to the skeleton contents after having
19376 exposed the input file's #line.
19377
193782002-06-12 Akim Demaille <akim@epita.fr>
19379
19380 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
19381 eager.
19382 * tests/actions.at (Exotic Dollars): New.
19383
193842002-06-12 Akim Demaille <akim@epita.fr>
19385
19386 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
19387 ['"/] too eagerly.
19388 * tests/input.at (Torturing the Scanner): New.
19389
193902002-06-11 Akim Demaille <akim@epita.fr>
19391
19392 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
19393 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
19394 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
19395 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
19396 * src/reader.c (reader): Use it.
19397
193982002-06-11 Akim Demaille <akim@epita.fr>
19399
19400 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
19401 Adjust all callers.
19402 (scanner_last_string_free): New.
19403
194042002-06-11 Akim Demaille <akim@epita.fr>
19405
19406 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
19407 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
19408 (last_string, YY_OBS_FREE): New.
19409 Use them when returning an ID.
19410
194112002-06-11 Akim Demaille <akim@epita.fr>
19412
19413 Have Bison grammars parsed by a Bison grammar.
19414
19415 * src/reader.c, src/reader.h (prologue_augment): New.
19416 * src/reader.c (copy_definition): Remove.
19417
19418 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
19419 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
19420 (grammar_current_rule_prec_set, grammar_current_rule_check)
19421 (grammar_current_rule_symbol_append)
19422 (grammar_current_rule_action_append): Export.
19423 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
19424 (symbol_list_action_append): Remove.
19425 Hook the routines from reader.
19426 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
19427 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
19428
19429 * src/reader.c (read_declarations): Remove, unused.
19430
19431 * src/parse-gram.y: Handle the epilogue.
19432 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
19433 (grammar_start_symbol_set): this.
19434 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
19435 * src/reader.c (readgram): Remove, unused.
19436 (reader): Adjust to insert eoftoken and axiom where appropriate.
19437
19438 * src/reader.c (copy_dollar): Replace with...
19439 * src/scan-gram.h (handle_dollar): this.
19440 * src/parse-gram.y: Remove `%thong'.
19441
19442 * src/reader.c (copy_at): Replace with...
19443 * src/scan-gram.h (handle_at): this.
19444
19445 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
19446 New.
19447
19448 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
19449 time being.
19450
19451 * src/reader.h, src/reader.c (grammar_rule_end): New.
19452
19453 * src/parse.y (current_type, current_class): New.
19454 Implement `%nterm', `%token' support.
19455 Merge `%term' into `%token'.
19456 (string_as_id): New.
19457 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
19458 type name.
19459
19460 * src/parse-gram.y: Be sure to handle properly the beginning of
19461 rules.
19462
19463 * src/parse-gram.y: Handle %type.
19464 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
19465
19466 * src/parse-gram.y: More directives support.
19467 * src/options.c: No longer handle source directives.
19468
19469 * src/parse-gram.y: Fix %output.
19470
19471 * src/parse-gram.y: Handle %union.
19472 Use the prologue locations.
19473 * src/reader.c (parse_union_decl): Remove.
19474
19475 * src/reader.h, src/reader.c (epilogue_set): New.
19476 * src/parse-gram.y: Use it.
19477
19478 * data/bison.simple, data/bison.c++: b4_stype is now either not
19479 defined, then default to int, or to the contents of %union,
19480 without `union' itself.
19481 Adjust.
19482 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
19483
19484 * src/output.c (actions_output): Don't output braces, as they are
19485 already handled by the scanner.
19486
19487 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
19488 characters to themselves.
19489
19490 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
19491 that the epilogue has a proper #line.
19492
19493 * src/parse-gram.y: Handle precedence/associativity.
19494
19495 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
19496 a terminal.
19497 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
19498 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
19499 at all to define terminals that cannot be emitted.
19500
19501 * src/scan-gram.l: Escape M4 characters.
19502
19503 * src/scan-gram.l: Working properly with escapes in user
19504 strings/characters.
19505
19506 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
19507 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
19508 grammar.
19509 Use more modest sizes, as for the time being the parser does not
19510 release memory, and therefore the process swallows a huge amount
19511 of memory.
19512
19513 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
19514 stricter %token grammar.
19515
19516 * src/symtab.h (associativity): Add `undef_assoc'.
19517 (symbol_precedence_set): Do nothing when passed an undef_assoc.
19518 * src/symtab.c (symbol_check_alias_consistence): Adjust.
19519
19520 * tests/regression.at (Invalid %directive): Remove, as it is now
19521 meaningless.
19522 (Invalid inputs): Adjust to the new error messages.
19523 (Token definitions): The new grammar doesn't allow too many
19524 eccentricities.
19525
19526 * src/lex.h, src/lex.c: Remove.
19527 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
19528 (copy_character, copy_string2, copy_string, copy_identifier)
19529 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
19530 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
19531 (parse_action): Remove.
19532 * po/POTFILES.in: Adjust.
19533
195342002-06-11 Akim Demaille <akim@epita.fr>
19535
19536 * src/reader.c (parse_action): Don't store directly into the
19537 rule's action member: return the action as a string.
19538 Don't require `rule_length' as an argument: compute it.
19539 (grammar_current_rule_symbol_append)
19540 (grammar_current_rule_action_append): New, eved out from
19541 (readgram): here.
19542 Remove `action_flag', `rulelength', unused now.
19543
195442002-06-11 Akim Demaille <akim@epita.fr>
19545
19546 * src/reader.c (grammar_current_rule_prec_set).
19547 (grammar_current_rule_check): New, eved out from...
19548 (readgram): here.
19549 Remove `xaction', `first_rhs': useless.
19550 * tests/input.at (Type clashes): New.
19551 * tests/existing.at (GNU Cim Grammar): Adjust.
19552
195532002-06-11 Akim Demaille <akim@epita.fr>
19554
19555 * src/reader.c (grammar_midrule_action): New, Eved out from
19556 (readgram): here.
19557
195582002-06-11 Akim Demaille <akim@epita.fr>
19559
19560 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
19561 New.
19562 (readgram): Use them as replacement of inlined code, crule and
19563 crule1.
19564
195652002-06-11 Akim Demaille <akim@epita.fr>
19566
19567 * src/reader.c (grammar_end, grammar_symbol_append): New.
19568 (readgram): Use them.
19569 Make the use of `p' as local as possible.
19570
195712002-06-10 Akim Demaille <akim@epita.fr>
19572
19573 GCJ's parser requires the tokens to be defined before the prologue.
19574
19575 * data/bison.simple: Output the token definition before the user's
19576 prologue.
19577 * tests/regression.at (Braces parsing, Duplicate string)
19578 (Mixing %token styles): Check the output from bison.
19579 (Early token definitions): New.
19580
195812002-06-10 Akim Demaille <akim@epita.fr>
19582
19583 * src/symtab.c (symbol_user_token_number_set): Don't complain when
19584 assigning twice the same user number to a token, so that we can
19585 use it in...
19586 * src/lex.c (lex): here.
19587 Also use `symbol_class_set' instead of hand written code.
19588 * src/reader.c (parse_assoc_decl): Likewise.
19589
195902002-06-10 Akim Demaille <akim@epita.fr>
19591
19592 * src/symtab.c, src/symtab.c (symbol_class_set)
19593 (symbol_user_token_number_set): New.
19594 * src/reader.c (parse_token_decl): Use them.
19595 Use a switch instead of ifs.
19596 Use a single argument.
19597
195982002-06-10 Akim Demaille <akim@epita.fr>
19599
19600 Remove `%thong' support as it is undocumented, unused, duplicates
19601 `%token's job, and creates useless e-mail traffic with people who
19602 want to know what it is, why it is undocumented, unused, and
19603 duplicates `%token's job.
19604
19605 * src/reader.c (parse_thong_decl): Remove.
19606 * src/options.c (option_table): Remove "thong".
19607 * src/lex.h (tok_thong): Remove.
19608
196092002-06-10 Akim Demaille <akim@epita.fr>
19610
19611 * src/symtab.c, src/symtab.c (symbol_type_set)
19612 (symbol_precedence_set): New.
19613 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
19614 (value_components_used): Remove, unused.
19615
196162002-06-09 Akim Demaille <akim@epita.fr>
19617
19618 Move symbols handling code out of the reader.
19619
19620 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
19621 (axiom): Move to...
19622 * src/symtab.h, src/symtab.c: here.
19623
19624 * src/gram.c (start_symbol): Remove: use startsymbol->number.
19625 * src/reader.c (startval): Rename as...
19626 * src/symtab.h, src/symtab.c (startsymbol): this.
19627 * src/reader.c: Adjust.
19628
19629 * src/reader.c (symbol_check_defined, symbol_make_alias)
19630 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
19631 (token_translations_init)
19632 Move to...
19633 * src/symtab.c: here.
19634 * src/reader.c (packsymbols): Move to...
19635 * src/symtab.h, src/symtab.c (symbols_pack): here.
19636 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
19637 argument.
19638
196392002-06-03 Akim Demaille <akim@epita.fr>
19640
19641 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
19642 then statements.
19643
196442002-06-03 Akim Demaille <akim@epita.fr>
19645
19646 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
19647 structs with non literals.
19648 * src/scan-skel.l: never-interactive.
19649 * src/conflicts.c (enum conflict_resolution_e): No trailing
19650 comma.
19651 * src/getargs.c (usage): Split long literal strings.
19652 Reported by Hans Aberg.
19653
196542002-05-28 Akim Demaille <akim@epita.fr>
19655
19656 * data/bison.c++: Use C++ ostreams.
19657 (cdebug_): New member.
19658
196592002-05-28 Akim Demaille <akim@epita.fr>
19660
19661 * src/output.c (output_skeleton): Be sure to allocate enough room
19662 for `/' _and_ for `\0' in full_skeleton.
19663
196642002-05-28 Akim Demaille <akim@epita.fr>
19665
19666 * data/bison.c++: Catch up with bison.simple:
19667 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19668 and Paul Eggert <eggert@twinsun.com>: `error' handing.
19669 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
19670 and popping traces.
19671
196722002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19673
19674 * src/output.c (output_skeleton): Put an explicit path in front of
19675 the skeleton file name, rather than relying on the -I directory,
19676 to partially alleviate effects of having a skeleton file lying around
19677 in the current directory.
19678
196792002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19680
19681 * src/conflicts.c (log_resolution): Correct typo:
19682 obstack_printf should be obstack_fgrow1.
19683
196842002-05-26 Akim Demaille <akim@epita.fr>
19685
19686 * src/state.h (state_t): `solved_conflicts' is a new member.
19687 * src/LR0.c (new_state): Set it to 0.
19688 * src/conflicts.h, src/conflicts.c (print_conflicts)
19689 (free_conflicts, solve_conflicts): Rename as...
19690 (conflicts_print, conflicts_free, conflicts_solve): these.
19691 Adjust callers.
19692 * src/conflicts.c (enum conflict_resolution_e)
19693 (solved_conflicts_obstack): New, used by...
19694 (log_resolution): this.
19695 Adjust to attach the conflict resolution to each state.
19696 Complete the description with the precedence/associativity
19697 information.
19698 (resolve_sr_conflict): Adjust.
19699 * src/print.c (print_state): Output its solved_conflicts.
19700 * tests/conflicts.at (Unresolved SR Conflicts)
19701 (Solved SR Conflicts): Exercise --report=all.
19702
197032002-05-26 Akim Demaille <akim@epita.fr>
19704
19705 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
19706 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
19707 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
19708 (token_number_t, item_number_as_token_number)
19709 (token_number_as_item_number, muscle_insert_token_number_table):
19710 Rename as...
19711 (symbol_number_t, item_number_as_symbol_number)
19712 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
19713 these, since it is more appropriate.
19714
197152002-05-26 Akim Demaille <akim@epita.fr>
19716
19717 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
19718 `Error:' lines.
19719 * data/bison.simple (yystos) [YYDEBUG]: New.
19720 (yyparse) [YYDEBUG]: Display the symbols which are popped during
19721 error recovery.
19722 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
19723
197242002-05-25 Akim Demaille <akim@epita.fr>
19725
19726 * doc/bison.texinfo (Debugging): Split into...
19727 (Tracing): this new section, its former contents, and...
19728 (Understanding): this new section.
19729 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
19730 by...
19731 (report_flag): this.
19732 Adjust all dependencies.
19733 (report_args, report_types, report_argmatch): New.
19734 (usage, getargs): Report/support -r, --report.
19735 * src/options.h
19736 (struct option_table_struct): Rename as..,
19737 (struct option_table_s): this.
19738 Rename the `set_flag' member to `flag' to match with getopt_long's
19739 struct.
19740 * src/options.c (option_table): Split verbose into an entry for
19741 %verbose, and another for --verbose.
19742 Support --report/-r, so remove -r from the obsolete --raw.
19743 * src/print.c: Attach full item sets and lookaheads reports to
19744 report_flag instead of trace_flag.
19745 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
19746
197472002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19748 and Paul Eggert <eggert@twinsun.com>
19749
19750 * data/bison.simple (yyparse): Correct error handling to conform to
19751 POSIX and yacc. Specifically, after syntax error is discovered,
19752 do not reduce further before shifting the error token.
19753 Clean up the code a bit by removing the labels yyerrdefault,
19754 yyerrhandle, yyerrpop.
19755 * NEWS: Document the above.
19756
197572002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19758
19759 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
19760 type; it isn't always big enough, since it doesn't necessarily
19761 include non-terminals.
19762 (yytranslate): Expand definition of yy_token_number_type, so that
19763 the latter can be removed.
19764 (yy_token_number_type): Remove, only one use.
19765 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
19766 don't use TokenNumberType as element type.
19767
19768 * tests/regression.at: Modify expected output to agree with change
19769 to yyr1 and yytranslate.
19770
197712002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
19772
19773 * src/reader.c (parse_action): Use copy_character instead of
19774 obstack_1grow.
19775
197762002-05-13 Akim Demaille <akim@epita.fr>
19777
19778 * tests/regression.at (Token definitions): Prototype yylex and
19779 yyerror.
19780
197812002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19782
19783 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
19784 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
19785 32-bit arithmetic.
19786 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
19787
197882002-05-07 Akim Demaille <akim@epita.fr>
19789
19790 * tests/synclines.at: Be sure to prototype yylex and yyerror to
19791 avoid GCC warnings.
19792
197932002-05-07 Akim Demaille <akim@epita.fr>
19794
19795 Kill GCC warnings.
19796
19797 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
19798 over the RHS of each rule.
19799 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
19800 * src/state.h (state_t): Member `nitems' is unsigned short.
19801 * src/LR0.c (get_state): Adjust.
19802 * src/reader.c (packgram): Likewise.
19803 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
19804 `Type'.
19805 (muscle_insert_int_table): Remove, unused.
19806 (prepare_rules): Remove `max'.
19807
198082002-05-06 Akim Demaille <akim@epita.fr>
19809
19810 * src/closure.c (print_firsts): Display of the symbol tags.
19811 (bitmatrix_print): Move to...
19812 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
19813 here.
19814 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
19815
198162002-05-06 Akim Demaille <akim@epita.fr>
19817
19818 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
19819 hash_do_for_each.
19820
198212002-05-06 Akim Demaille <akim@epita.fr>
19822
19823 * src/LR0.c (new_state, get_state): Instead of using the global
19824 `kernel_size' and `kernel_base', have two new arguments:
19825 `core_size' and `core'.
19826 Adjust callers.
19827
198282002-05-06 Akim Demaille <akim@epita.fr>
19829
19830 * src/reader.c (packgram): No longer end `ritem' with a 0
19831 sentinel: it is not used.
19832
198332002-05-05 Akim Demaille <akim@epita.fr>
19834
19835 New experimental feature: display the lookaheads in the report and
19836 graph.
19837
19838 * src/print (print_core): When --trace-flag, display the rules
19839 lookaheads.
19840 * src/print_graph.c (print_core): Likewise.
19841 Swap the arguments.
19842 Adjust caller.
19843
198442002-05-05 Akim Demaille <akim@epita.fr>
19845
19846 * tests/torture.at (Many lookaheads): New test.
19847
198482002-05-05 Akim Demaille <akim@epita.fr>
19849
19850 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
19851 (GENERATE_MUSCLE_INSERT_TABLE): this.
19852 (output_int_table, output_unsigned_int_table, output_short_table)
19853 (output_token_number_table, output_item_number_table): Replace with...
19854 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
19855 (muscle_insert_short_table, muscle_insert_token_number_table)
19856 (muscle_insert_item_number_table): these.
19857 Adjust all callers.
19858 (prepare_tokens): Don't free `translations', since...
19859 * src/reader.h, src/reader.c (grammar_free): do it.
19860 Move to...
19861 * src/gram.h, src/gram.c (grammar_free): here.
19862 * data/bison.simple, data/bison.c++: b4_token_number_max is now
19863 b4_translate_max.
19864
198652002-05-05 Akim Demaille <akim@epita.fr>
19866
19867 * src/output.c (output_unsigned_int_table): New.
19868 (prepare_rules): `i' is unsigned.
19869 `prhs', `rline', `r2' are unsigned int.
19870 Rename muscle `rhs_number_max' as `rhs_max'.
19871 Output muscles `prhs_max', `rline_max', and `r2_max'.
19872 Free rline and r1.
19873 * data/bison.simple, data/bison.c++: Adjust to use these muscles
19874 to compute types instead of constant types.
19875 * tests/regression.at (Web2c Actions): Adjust.
19876
198772002-05-04 Akim Demaille <akim@epita.fr>
19878
19879 * src/symtab.h (SALIAS, SUNDEF): Rename as...
19880 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
19881 Adjust dependencies.
19882 * src/output.c (token_definitions_output): Be sure not to output a
19883 `#define 'a'' when fed with `%token 'a' "a"'.
19884 * tests/regression.at (Token definitions): New.
19885
198862002-05-03 Paul Eggert <eggert@twinsun.com>
19887
19888 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
19889 for K&R C.
19890
198912002-05-03 gettextize <bug-gnu-gettext@gnu.org>
19892
19893 * Makefile.am (SUBDIRS): Remove intl.
19894 (EXTRA_DIST): Add config/config.rpath.
19895
198962002-05-03 Akim Demaille <akim@epita.fr>
19897
19898 * data/bison.simple (m4_if): Don't output empty enums.
19899 And actually, output valid enum definitions :(.
19900
199012002-05-03 Akim Demaille <akim@epita.fr>
19902
19903 * configure.bat: Remove, completely obsolete.
19904 * Makefile.am (EXTRA_DIST): Adjust.
19905 Don't distribute config.rpath...
19906 * config/Makefile.am (EXTRA_DIST): Do it.
19907
199082002-05-03 Akim Demaille <akim@epita.fr>
19909
19910 * configure.in (GETTEXT_VERSION): New.
19911 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
19912
199132002-05-03 Akim Demaille <akim@epita.fr>
19914
19915 * data/bison.simple (b4_token_enum): New.
19916 (b4_token_defines): Use it to output tokens both as #define and
19917 enums.
19918 Suggested by Paul Eggert.
19919 * src/output.c (token_definitions_output): Don't output spurious
19920 white spaces.
19921
199222002-05-03 Akim Demaille <akim@epita.fr>
19923
19924 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
19925
199262002-05-02 Robert Anisko <robert@lrde.epita.fr>
19927
19928 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
19929 Update the stack class, give a try to deque as the default container.
19930
199312002-05-02 Akim Demaille <akim@epita.fr>
19932
19933 * data/bison.simple (yyparse): Do not implement @$ = @1.
19934 (YYLLOC_DEFAULT): Adjust to do it.
19935 * doc/bison.texinfo (Location Default Action): Fix.
19936
199372002-05-02 Akim Demaille <akim@epita.fr>
19938
19939 * src/reader.c (parse_braces): Merge into...
19940 (parse_action): this.
19941
199422002-05-02 Akim Demaille <akim@epita.fr>
19943
19944 * configure.in (ALL_LINGUAS): Remove.
19945 * po/LINGUAS, hr.po: New.
19946
199472002-05-02 Akim Demaille <akim@epita.fr>
19948
19949 Remove the so called hairy (semantic) parsers.
19950
19951 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
19952 * src/gram.h, src/gram.c (semantic_parser): Remove.
19953 (rule_t): Remove the guard and guard_line members.
19954 * src/lex.h (token_t): remove tok_guard.
19955 * src/options.c (option_table): Remove %guard and %semantic_parser
19956 support.
19957 * src/output.c, src/output.h (guards_output): Remove.
19958 (prepare): Adjust.
19959 (token_definitions_output): Don't output the `T'
19960 tokens (???).
19961 (output_skeleton): Don't output the guards.
19962 * src/files.c, src/files.c (attrsfile): Remove.
19963 * src/reader.c (symbol_list): Remove the guard and guard_line
19964 members.
19965 Adjust dependencies.
19966 (parse_guard): Remove.
19967 * data/bison.hairy: Remove.
19968 * doc/bison.texinfo (Environment Variables): Remove occurrences of
19969 BISON_HAIRY.
19970
199712002-05-02 Akim Demaille <akim@epita.fr>
19972
19973 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
19974 (parse_guard): Rename the formal argument `stack_offset' as
19975 `rule_length', which is more readable.
19976 Adjust callers.
19977 (copy_at, copy_dollar): Instead of outputting the hard coded
19978 values of $$, $n and so forth, output invocation to b4_lhs_value,
19979 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
19980 Note: this patch partially drops `semantic-parser' support: it
19981 always does `rule_length - n', where semantic parsers ought to
19982 always use `-n'.
19983 * data/bison.simple, data/bison.c++ (b4_lhs_value)
19984 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
19985
199862002-05-02 Akim Demaille <akim@epita.fr>
19987
19988 * configure.in (AC_INIT): Bump to 1.49b.
19989 (AM_INIT_AUTOMAKE): Short invocation.
19990
199912002-05-02 Akim Demaille <akim@epita.fr>
19992
19993 Version 1.49a.
19994
199952002-05-01 Akim Demaille <akim@epita.fr>
19996
19997 * src/skeleton.h: Remove.
19998
199992002-05-01 Akim Demaille <akim@epita.fr>
20000
20001 * src/skeleton.h: Fix the #endif.
20002 Reported by Magnus Fromreide.
20003
200042002-04-26 Paul Eggert <eggert@twinsun.com>
20005
20006 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
20007 Define if we define YYSTYPE and YYLTYPE, respectively.
20008 (YYCOPY): Fix [] quoting problem in the non-GCC case.
20009
200102002-04-25 Robert Anisko <robert@lrde.epita.fr>
20011
20012 * src/scan-skel.l: Postprocess quadrigraphs.
20013
20014 * src/reader.c (copy_character): New function, used to output
20015 single characters while replacing `[' and `]' with quadrigraphs, to
20016 avoid troubles with M4 quotes.
20017 (copy_comment): Output characters with copy_character.
20018 (read_additionnal_code): Likewise.
20019 (copy_string2): Likewise.
20020 (copy_definition): Likewise.
20021
20022 * tests/calc.at: Exercise M4 quoting.
20023
200242002-04-25 Akim Demaille <akim@epita.fr>
20025
20026 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
20027 between `!' and the command.
20028 Reported by Paul Eggert.
20029
200302002-04-24 Robert Anisko <robert@lrde.epita.fr>
20031
20032 * tests/calc.at: Exercise prologue splitting.
20033
20034 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
20035 `b4_post_prologue' instead of `b4_prologue'.
20036
20037 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
20038 muscles.
20039 (output): Free pre_prologue_obstack and post_prologue_obstack.
20040 * src/files.h, src/files.c (attrs_obstack): Remove.
20041 (pre_prologue_obstack, post_prologue_obstack): New.
20042 * src/reader.c (copy_definition): Add a parameter to specify the
20043 obstack to fill, instead of using attrs_obstack unconditionally.
20044 (read_declarations): Pass pre_prologue_obstack to copy_definition if
20045 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
20046
200472002-04-23 Paul Eggert <eggert@twinsun.com>
20048
20049 * data/bison.simple: Remove unnecessary commentary and white
20050 space differences from 1_29-branch.
20051 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
20052
20053 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
20054 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
20055 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
20056 constructors or destructors.
20057
20058 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
20059
200602002-04-23 Akim Demaille <akim@epita.fr>
20061
20062 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
20063 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
20064 location with columns.
20065 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
20066 All reported by Paul Eggert.
20067
200682002-04-22 Akim Demaille <akim@epita.fr>
20069
20070 * src/reduce.c (dump_grammar): Move to...
20071 * src/gram.h, src/gram.c (grammar_dump): here.
20072 Be sure to separate long item numbers.
20073 Don't read the members of a rule's prec if its nil.
20074
200752002-04-22 Akim Demaille <akim@epita.fr>
20076
20077 * src/output.c (table_size, table_grow): New.
20078 (MAXTABLE): Remove, replace uses with table_size.
20079 (pack_vector): Instead of dying when the table is too big, grow it.
20080
200812002-04-22 Akim Demaille <akim@epita.fr>
20082
20083 * data/bison.simple (yyr1): Its type is that of a token number.
20084 * data/bison.c++ (r1_): Likewise.
20085 * tests/regression.at (Web2c Actions): Adjust.
20086
200872002-04-22 Akim Demaille <akim@epita.fr>
20088
20089 * src/reader.c (token_translations_init): 256 is now the default
20090 value for the error token, i.e., it will be assigned another
20091 number if the user assigned 256 to one of her tokens.
20092 (reader): Don't force 256 to error.
20093 * doc/bison.texinfo (Symbols): Adjust.
20094 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
20095 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
20096 etc. instead of 10, 20, 30 (which was used to `jump' over error
20097 (256) and undefined (2)).
20098
200992002-04-22 Akim Demaille <akim@epita.fr>
20100
20101 Propagate more token_number_t.
20102
20103 * src/gram.h (token_number_as_item_number)
20104 (item_number_as_token_number): New.
20105 * src/output.c (GENERATE_OUTPUT_TABLE): New.
20106 Use it to create output_item_number_table and
20107 output_token_number_table.
20108 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
20109 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
20110 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
20111 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
20112
201132002-04-22 Akim Demaille <akim@epita.fr>
20114
20115 * src/output.h, src/output.c (get_lines_number): Remove.
20116
201172002-04-19 Akim Demaille <akim@epita.fr>
20118
20119 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
20120 as Lex/Flex'.
20121 (Debugging): More details about enabling the debugging features.
20122 (Table of Symbols): Describe $$, $n, @$, and @n.
20123 Suggested by Tim Josling.
20124
201252002-04-19 Akim Demaille <akim@epita.fr>
20126
20127 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
20128
201292002-04-10 Akim Demaille <akim@epita.fr>
20130
20131 * src/system.h: Rely on HAVE_LIMITS_H.
20132 Suggested by Paul Eggert.
20133
201342002-04-09 Akim Demaille <akim@epita.fr>
20135
20136 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
20137 full stderr, and strip it according to the bison options, instead
20138 of composing the error message from different bits.
20139 This makes it easier to check for several error messages.
20140 Adjust all the invocations.
20141 Add an invocation exercising the error token.
20142 Add an invocation demonstrating a stupid error message.
20143 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
20144 Adjust the tests.
20145 Error message are for stderr, not stdout.
20146
201472002-04-09 Akim Demaille <akim@epita.fr>
20148
20149 * src/gram.h, src/gram.c (error_token_number): Remove, use
20150 errtoken->number.
20151 * src/reader.c (reader): Don't specify the user token number (2)
20152 for $undefined, as it uselessly prevents using it.
20153 * src/gram.h (token_number_t): Move to...
20154 * src/symtab.h: here.
20155 (state_t.number): Is a token_number_t.
20156 * src/print.c, src/reader.c: Use undeftoken->number instead of
20157 hard coded 2.
20158 (Even though this 2 is not the same as above: the number of the
20159 undeftoken remains being 2, it is its user token number which
20160 might not be 2).
20161 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
20162 `user_token_number_max'.
20163 Output `undef_token_number'.
20164 * data/bison.simple, data/bison.c++: Use them.
20165 Be sure to map invalid yylex return values to
20166 `undef_token_number'. This saves us from gratuitous SEGV.
20167
20168 * tests/conflicts.at (Solved SR Conflicts)
20169 (Unresolved SR Conflicts): Adjust.
20170 * tests/regression.at (Web2c Actions): Adjust.
20171
201722002-04-08 Akim Demaille <akim@epita.fr>
20173
20174 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
20175 Adding #line.
20176 Remove the duplicate `typedefs'.
20177 (RhsNumberType): Fix the declaration and various other typos.
20178 Use __ofile__.
20179 * data/bison.simple: Use __ofile__.
20180 * src/scan-skel.l: Handle __ofile__.
20181
201822002-04-08 Akim Demaille <akim@epita.fr>
20183
20184 * src/gram.h (item_number_t): New, the type of item numbers in
20185 RITEM. Note that it must be able to code symbol numbers as
20186 positive number, and the negation of rule numbers as negative
20187 numbers.
20188 Adjust all dependencies (pretty many).
20189 * src/reduce.c (rule): Remove this `short *' pointer: use
20190 item_number_t.
20191 * src/system.h (MINSHORT, MAXSHORT): Remove.
20192 Include `limits.h'.
20193 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
20194 (shortcpy): Remove.
20195 (MAXTABLE): Move to...
20196 * src/output.c (MAXTABLE): here.
20197 (prepare_rules): Use output_int_table to output rhs.
20198 * data/bison.simple, data/bison.c++: Adjust.
20199 * tests/torture.at (Big triangle): Move the limit from 254 to
20200 500.
20201 * tests/regression.at (Web2c Actions): Ajust.
20202
20203 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
20204 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
20205 passes, but produces negative #line number, once fixed, GCC is
20206 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
20207 C), it passes.
20208 * src/state.h (state_h): Code input lines on ints, not shorts.
20209
202102002-04-08 Akim Demaille <akim@epita.fr>
20211
20212 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
20213 and then the grammar.
20214
202152002-04-08 Akim Demaille <akim@epita.fr>
20216
20217 * src/system.h: No longer using strndup.
20218
202192002-04-07 Akim Demaille <akim@epita.fr>
20220
20221 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
20222 * src/output.c (output_table_data): Return the longest number.
20223 (prepare_tokens): Output `token_number_max').
20224 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
20225 New.
20226 Use them to define yy_token_number_type/TokenNumberType.
20227 Use this type for yytranslate.
20228 * tests/torture.at (Big triangle): Push the limit from 124 to
20229 253.
20230 * tests/regression.at (Web2c Actions): Adjust.
20231
202322002-04-07 Akim Demaille <akim@epita.fr>
20233
20234 * tests/torture.at (Big triangle): New.
20235 (GNU AWK Grammar, GNU Cim Grammar): Move to...
20236 * tests/existing.at: here.
20237
202382002-04-07 Akim Demaille <akim@epita.fr>
20239
20240 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
20241 nritems.
20242 Adjust dependencies.
20243
202442002-04-07 Akim Demaille <akim@epita.fr>
20245
20246 * src/reader.c: Normalize increments to prefix form.
20247
202482002-04-07 Akim Demaille <akim@epita.fr>
20249
20250 * src/reader.c, symtab.c: Remove debugging code.
20251
202522002-04-07 Akim Demaille <akim@epita.fr>
20253
20254 Rename all the `bucket's as `symbol_t'.
20255
20256 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
20257 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
20258 * src/symtab.c, src/symtab.h (bucket): Rename as...
20259 (symbol_t): this.
20260 (symbol_list_new, bucket_check_defined, bucket_make_alias)
20261 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
20262 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
20263 (buckets_new, buckets_free, buckets_do): Rename as...
20264 (symbol_list_new, symbol_check_defined, symbol_make_alias)
20265 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
20266 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
20267 (symbols_new, symbols_free, symbols_do): these.
20268
202692002-04-07 Akim Demaille <akim@epita.fr>
20270
20271 Use lib/hash for the symbol table.
20272
20273 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
20274 EOF.
20275 * src/lex.c (lex): Set the `number' member of new terminals.
20276 * src/reader.c (bucket_check_defined, bucket_make_alias)
20277 (bucket_check_alias_consistence, bucket_translation): New.
20278 (reader, grammar_free, readgram, token_translations_init)
20279 (packsymbols): Adjust.
20280 (reader): Number the predefined tokens.
20281 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
20282 for predefined tokens.
20283 * src/symtab.h (bucket): Remove all the hash table related
20284 members.
20285 * src/symtab.c (symtab): Replace by...
20286 (bucket_table): this.
20287 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
20288 (buckets_new, buckets_do): New.
20289
202902002-04-07 Akim Demaille <akim@epita.fr>
20291
20292 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
20293 (start_symbol, max_user_token_number, semantic_parser)
20294 (error_token_number): Initialize.
20295 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
20296 Initialize.
20297 (reader): Don't.
20298 (errtoken, eoftoken, undeftoken, axiom): Extern.
20299
203002002-04-07 Akim Demaille <akim@epita.fr>
20301
20302 * src/gram.h (rule_s): prec and precsym are now pointers
20303 to the bucket giving the priority/associativity.
20304 Member `associativity' removed: useless.
20305 * src/reduce.c, src/conflicts.c: Adjust.
20306
203072002-04-07 Akim Demaille <akim@epita.fr>
20308
20309 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
20310 Properly escape the symbols' TAG when outputting them.
20311
203122002-04-07 Akim Demaille <akim@epita.fr>
20313
20314 * src/lalr.h (LA): Is a bitsetv, not bitset*.
20315
203162002-04-07 Akim Demaille <akim@epita.fr>
20317
20318 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
20319 (LArule): this, which is an array to rule_t*.
20320 * src/print.c, src/conflicts.c: Adjust.
20321
203222002-04-07 Akim Demaille <akim@epita.fr>
20323
20324 * src/gram.h (rule_t): Rename `number' as `user_number'.
20325 `number' is a new member.
20326 Adjust dependencies.
20327 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
20328
203292002-04-07 Akim Demaille <akim@epita.fr>
20330
20331 As a result of the previous patch, it is no longer needed
20332 to reorder ritem itself.
20333
20334 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
20335
203362002-04-07 Akim Demaille <akim@epita.fr>
20337
20338 Be sure never to walk through RITEMS, but use only data related to
20339 the rules themselves. RITEMS should be banished.
20340
20341 * src/output.c (output_token_translations): Rename as...
20342 (prepare_tokens): this.
20343 In addition to `translate', prepare the muscles `tname' and
20344 `toknum', which were handled by...
20345 (output_rule_data): this.
20346 Remove, and move the remainder of its outputs into...
20347 (prepare_rules): this new routines, which also merges content from
20348 (output_gram): this.
20349 (prepare_rules): Be sure never to walk through RITEMS.
20350 (output_stos): Rename as...
20351 (prepare_stos): this.
20352 (output): Always invoke prepare_states, after all, just don't use it
20353 in the output if you don't need it.
20354
203552002-04-07 Akim Demaille <akim@epita.fr>
20356
20357 * src/LR0.c (new_state): Display `nstates' as the name of the
20358 newly created state.
20359 Adjust to initialize first_state and last_state if needed.
20360 Be sure to distinguish the initial from the final state.
20361 (new_states): Create the itemset of the initial state, and use
20362 new_state.
20363 * src/closure.c (closure): Now that the initial state has its
20364 items properly set, there is no need for a special case when
20365 creating `ruleset'.
20366
20367 As a result, now the rule 0, reducing to $axiom, is visible in the
20368 outputs. Adjust the test suite.
20369
20370 * tests/conflicts.at (Solved SR Conflicts)
20371 (Unresolved SR Conflicts): Adjust.
20372 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
20373 * tests/conflicts.at (S/R in initial): New.
20374
203752002-04-07 Akim Demaille <akim@epita.fr>
20376
20377 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
20378 the RHS of the rules.
20379 * src/output.c (output_gram): Likewise.
20380
203812002-04-07 Akim Demaille <akim@epita.fr>
20382
20383 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
20384 bucket.
20385 Adjust all dependencies.
20386 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
20387 `number' of the buckets too.
20388 * src/gram.h: Include `symtab.h'.
20389 (associativity): Move to...
20390 * src/symtab.h: here.
20391 No longer include `gram.h'.
20392
203932002-04-07 Akim Demaille <akim@epita.fr>
20394
20395 * src/gram.h, src/gram.c (rules_rhs_length): New.
20396 (ritem_longest_rhs): Use it.
20397 * src/gram.h (rule_t): `number' is a new member.
20398 * src/reader.c (packgram): Set it.
20399 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
20400 the end of `rules', and count them out of `nrules'.
20401 (reduce_output, dump_grammar): Adjust.
20402 * src/print.c (print_grammar): It is no longer needed to check for
20403 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
20404 * tests/reduce.at (Reduced Automaton): New test.
20405
204062002-04-07 Akim Demaille <akim@epita.fr>
20407
20408 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
20409 lacking `+ 1' to nrules, Bison reported as useless a token if it
20410 was used solely to set the precedence of the last rule...
20411
204122002-04-07 Akim Demaille <akim@epita.fr>
20413
20414 * data/bison.c++, data/bison.simple: Don't output the current file
20415 name in #line, to avoid useless diffs between two identical
20416 outputs under different names.
20417
204182002-04-07 Akim Demaille <akim@epita.fr>
20419
20420 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
20421 Normalize loops to using `< nrules + 1', not `<= nrules'.
20422
204232002-04-07 Akim Demaille <akim@epita.fr>
20424
20425 * TODO: Update.
20426
204272002-04-07 Akim Demaille <akim@epita.fr>
20428
20429 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
20430 bucket.value as bucket.number.
20431
204322002-04-07 Akim Demaille <akim@epita.fr>
20433
20434 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
20435 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
20436 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
20437 RHS, instead of being an index in RITEMS.
20438
204392002-04-04 Paul Eggert <eggert@twinsun.com>
20440
20441 * doc/bison.texinfo: Update copyright date.
20442 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
20443 (Symbols): Warn about running Bison in one character set,
20444 but compiling and/or running in an incompatible one.
20445 Warn about character code 256, too.
20446
204472002-04-03 Paul Eggert <eggert@twinsun.com>
20448
20449 * src/bison.data (YYSTACK_ALLOC): Depend on whether
20450 YYERROR_VERBOSE is nonzero, not whether it is defined.
20451
20452 Merge changes from bison-1_29-branch.
20453
204542002-03-20 Paul Eggert <eggert@twinsun.com>
20455
20456 Merge fixes from Debian bison_1.34-1.diff.
20457
20458 * configure.in (AC_PREREQ): 2.53.
20459
204602002-03-20 Akim Demaille <akim@epita.fr>
20461
20462 * src/conflicts.c (log_resolution): Argument `resolution' is const.
20463
204642002-03-19 Paul Eggert <eggert@twinsun.com>
20465
20466 * src/bison.simple (YYCOPY): New macro.
20467 (YYSTACK_RELOCATE): Use it.
20468 Remove Type arg; no longer needed. All callers changed.
20469 (yymemcpy): Remove; no longer needed.
20470
20471 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
20472 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
20473
204742002-03-19 Akim Demaille <akim@epita.fr>
20475
20476 Test and fix the #line outputs.
20477
20478 * tests/atlocal.at (GCC): New.
20479 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
20480 (Prologue synch line, %union synch line, Postprologue synch line)
20481 (Action synch line, Epilogue synch line): New tests.
20482 * src/reader.c (parse_union_decl): Define the muscle stype_line.
20483 * data/bison.simple, data/bison.c++: Use it.
20484
204852002-03-19 Akim Demaille <akim@epita.fr>
20486
20487 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
20488 (Solved SR Conflicts, %expect not enough, %expect right)
20489 (%expect too much): Move to...
20490 * tests/conflicts.at: this new file.
20491
204922002-03-19 Akim Demaille <akim@epita.fr>
20493
20494 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
20495 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
20496 that we can move to enums for instance.
20497 * src/output.c (token_definitions_output): Output a list of
20498 `token-name, token-number' instead of the #define.
20499 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
20500
205012002-03-14 Akim Demaille <akim@epita.fr>
20502
20503 Use Gettext 0.11.1.
20504
205052002-03-09 Robert Anisko <robert@lrde.epita.fr>
20506
20507 * data/bison.c++: Make the user able to add members to the generated
20508 parser by subclassing.
20509
205102002-03-05 Robert Anisko <robert@lrde.epita.fr>
20511
20512 * src/reader.c (read_additionnal_code): `c' should be an integer, not
20513 a character.
20514 Reported by Nicolas Tisserand and Nicolas Burrus.
20515
205162002-03-04 Robert Anisko <robert@lrde.epita.fr>
20517
20518 * src/reader.c: Warn about lacking semi-colons, do not complain.
20519
205202002-03-04 Robert Anisko <robert@lrde.epita.fr>
20521
20522 * data/bison.c++: Remove a debug line.
20523
205242002-03-04 Robert Anisko <robert@lrde.epita.fr>
20525
20526 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
20527 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
20528 provide a default implementation.
20529
205302002-03-04 Akim Demaille <akim@epita.fr>
20531
20532 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
20533 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
20534 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
20535 * tests/semantic.at (Parsing Guards): Similarly.
20536 * src/reader.at (readgram): Complain if the last rule is not ended
20537 with a semi-colon.
20538
205392002-03-04 Akim Demaille <akim@epita.fr>
20540
20541 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
20542 * src/closure.c: here.
20543 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
20544 RTC.
20545 * src/warshall.h, src/warshall.c: Remove.
20546 * tests/sets.at (Broken Closure): Adjust.
20547
205482002-03-04 Akim Demaille <akim@epita.fr>
20549
20550 * src/output.c (output_skeleton): tempdir is const.
20551 bytes_read is unused.
20552
205532002-03-04 Akim Demaille <akim@epita.fr>
20554
20555 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
20556 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
20557 Update.
20558 From Michael Hayes.
20559
205602002-03-04 Akim Demaille <akim@epita.fr>
20561
20562 * src/closure.c (closure): `r' is unused.
20563
205642002-03-04 Akim Demaille <akim@epita.fr>
20565
20566 * tests/sets.at (Broken Closure): Add the ending `;'.
20567 * src/reader.at (readgram): Complain if a rule is not ended with a
20568 semi-colon.
20569
205702002-03-04 Akim Demaille <akim@epita.fr>
20571
20572 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
20573 (count_sr_conflicts): Use bitset_count.
20574 * src/reduce.c (inaccessable_symbols): Ditto.
20575 (bits_size): Remove.
20576 * src/warshall.h, src/warshall.c: Convert to bitsetv.
20577
205782002-03-04 Akim Demaille <akim@epita.fr>
20579
20580 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
20581 * src/reduce.c: Remove the `bitset_zero's following the
20582 `bitset_create's, as now it is performed by the latter.
20583
205842002-03-04 Akim Demaille <akim@epita.fr>
20585
20586 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
20587 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
20588 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
20589 latest sources from Michael.
20590
205912002-03-04 Akim Demaille <akim@epita.fr>
20592
20593 * src/output.c (output): Don't free the grammar.
20594 * src/reader.c (grammar_free): New.
20595 * src/main.c (main): Call it and don't free symtab here.
20596
205972002-03-04 Akim Demaille <akim@epita.fr>
20598
20599 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
20600 before returning.
20601 Reported by Benoit Perrot.
20602
206032002-03-04 Akim Demaille <akim@epita.fr>
20604
20605 Use bitset operations when possible, not loops over bits.
20606
20607 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
20608 bitset_or.
20609 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
20610 * src/reduce.c (useless_nonterminals): Formatting changes.
20611 * src/warshall.c (TC): Use bitset_or.
20612
206132002-03-04 Akim Demaille <akim@epita.fr>
20614
20615 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
20616 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
20617 Ditto.
20618
206192002-03-04 Akim Demaille <akim@epita.fr>
20620
20621 * src/lalr.c (F): Now a bitset*.
20622 Adjust all dependencies.
20623
206242002-03-04 Akim Demaille <akim@epita.fr>
20625
20626 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
20627 Adjust all dependencies.
20628
206292002-03-04 Akim Demaille <akim@epita.fr>
20630
20631 * src/L0.c, src/LR0.h (nstates): Be size_t.
20632 Adjust comparisons (signed vs unsigned).
20633 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
20634 bitset*.
20635 Adjust all dependencies.
20636
206372002-03-04 Akim Demaille <akim@epita.fr>
20638
20639 * src/closure.c (firsts): Now, also a bitset.
20640 Adjust all dependencies.
20641 (varsetsize): Remove, now unused.
20642 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
20643
206442002-03-04 Akim Demaille <akim@epita.fr>
20645
20646 * src/print.c: Convert to use bitset.h, not hand coded iterations
20647 over ints.
20648
206492002-03-04 Akim Demaille <akim@epita.fr>
20650
20651 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
20652
206532002-03-04 Akim Demaille <akim@epita.fr>
20654
20655 * src/closure.c (ruleset): Be a bitset.
20656 (rulesetsize): Remove.
20657
206582002-03-04 Akim Demaille <akim@epita.fr>
20659
20660 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
20661 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
20662 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
20663 * src/closure.c (fderives): Be an array of bitsets.
20664
206652002-02-28 Robert Anisko <robert@lrde.epita.fr>
20666
20667 * data/bison.c++: Merge the two generated headers. Insert a copyright
20668 notice in each output file.
20669
206702002-02-28 Akim Demaille <akim@epita.fr>
20671
20672 * data/bison.c++: Copy the prologue of bison.simple to fetch
20673 useful M4 definitions, such as b4_header_guard.
20674
206752002-02-25 Akim Demaille <akim@epita.fr>
20676
20677 * src/getargs.c (version): Give the name of the authors, and use a
20678 translator friendly scheme for the bgr
20679 copyright notice.
20680
206812002-02-25 Akim Demaille <akim@epita.fr>
20682
20683 * src/output.c (header_output): Remove, now handled completely via
20684 M4.
20685
206862002-02-25 Akim Demaille <akim@epita.fr>
20687
20688 * m4/m4.m4: New, from CVS Autoconf.
20689 * configure.in: Invoke it.
20690 * src/output.c (output_skeleton): Use its result instead of the
20691 hard coded name.
20692
206932002-02-25 Akim Demaille <akim@epita.fr>
20694
20695 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
20696 Fileutils 4.1.5.
20697 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
20698 * src/output.c (output_skeleton): Use mkstemp to create a real
20699 temporary file.
20700 Move the filling of `skeleton' and its muscle to...
20701 (prepare): here.
20702 (output): Move the definition of the prologue muscle to...
20703 (prepare): here.
20704 * src/system.h (DEFAULT_TMPDIR): New.
20705
207062002-02-14 Paul Eggert <eggert@twinsun.com>
20707
20708 Remove the support for C++ namespace cleanliness; it was
20709 causing more problems than it was curing, since it didn't work
20710 properly on some nonstandard C++ compilers. This can wait
20711 for a proper C++ parser.
20712
20713 * NEWS: Document this.
20714 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
20715 of C++, as it's treated like C now.
20716 * src/bison.simple (YYSTD): Remove.
20717 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
20718 Treat C++ just like Standard C instead of trying to support
20719 namespace cleanliness.
20720
207212002-02-14 Akim Demaille <akim@epita.fr>
20722
20723 * tests/regression.at (else): Adjust to Andreas' change.
20724
207252002-02-14 Akim Demaille <akim@epita.fr>
20726
20727 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
20728
207292002-02-13 Andreas Schwab <schwab@suse.de>
20730
20731 * src/output.c (output_rule_data): Don't output NULL, it might
20732 not be defined yet.
20733
207342002-02-11 Robert Anisko <robert@lrde.epita.fr>
20735
20736 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
20737 (Copyright notice): Update.
20738
207392002-02-11 Akim Demaille <akim@epita.fr>
20740
20741 * tests/regression.at (%nonassoc and eof): Don't include
20742 nonportable headers.
20743
207442002-02-08 Robert Anisko <robert@lrde.epita.fr>
20745
20746 * data/bison.c++: Correct error recovery. Make the user able to
20747 initialize the starting location.
20748
207492002-02-07 Akim Demaille <akim@epita.fr>
20750
20751 * tests/input.at: New.
20752
207532002-02-07 Robert Anisko <robert@lrde.epita.fr>
20754
20755 * data/bison.c++: Replace some direct m4 expansions by constants. Be
20756 more consistent when naming methods and variables. Put preprocessor
20757 directives around tables only needed for debugging.
20758
207592002-02-07 Robert Anisko <robert@lrde.epita.fr>
20760
20761 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
20762 C++ parsers.
20763 (yy::b4_name::parse): Use print_.
20764
207652002-02-07 Robert Anisko <robert@lrde.epita.fr>
20766
20767 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
20768
207692002-02-07 Robert Anisko <robert@lrde.epita.fr>
20770
20771 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
20772 C++ parsers.
20773 (yy::b4_name::parse): Build verbose error messages, and use error_.
20774
207752002-02-06 Robert Anisko <robert@lrde.epita.fr>
20776
20777 * data/bison.c++: Fix m4 quoting in comments.
20778
207792002-02-06 Robert Anisko <robert@lrde.epita.fr>
20780
20781 * data/bison.c++: Adjust the parser code. Fix some muscles that were
20782 not expanded by m4.
20783
207842002-02-05 Akim Demaille <akim@epita.fr>
20785
20786 * data/bison.c++: Adjust to the M4 back end.
20787 More is certainly needed.
20788
207892002-02-05 Akim Demaille <akim@epita.fr>
20790
20791 Give a try to M4 as a back end.
20792
20793 * lib/readpipe.c: New, from wdiff.
20794 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
20795 BISON_HAIRY.
20796 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
20797 specific values. Now it is m4 that performs the lookup.
20798 * src/parse-skel.y: Remove.
20799 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
20800 * src/output.c (actions_output, guards_output)
20801 (token_definitions_output): No longer keeps track of the output
20802 line number, hence remove the second argument.
20803 (guards_output): Check against the guard member of a rule, not the
20804 action member.
20805 Adjust callers.
20806 (output_skeleton): Don't look for the skeleton location, let m4 do
20807 that.
20808 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
20809 file will be used.
20810 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
20811 (prepare): Given that for the time being changesyntax is not
20812 usable in M4, rename the muscles using `-' to `_'.
20813 Define `defines_flag', `output_parser_name' and `output_header_name'.
20814 * src/output.h (actions_output, guards_output)
20815 (token_definitions_output): Adjust prototypes.
20816 * src/scan-skel.l: Instead of scanning the skeletons, it now
20817 processes the output of m4: `__oline__' and `#output'.
20818 * data/bison.simple: Adjust to be used by M4(sugar).
20819 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
20820 to date.
20821 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
20822 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
20823 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
20824 shamelessly stolen from CVS Autoconf.
20825
208262002-02-05 Akim Demaille <akim@epita.fr>
20827
20828 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
20829 * configure.in: Check for the declarations of free and malloc.
20830 * src/muscle_tab.c: Adjust.
20831
208322002-02-05 Akim Demaille <akim@epita.fr>
20833
20834 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
20835 which have no values.
20836
208372002-02-05 Akim Demaille <akim@epita.fr>
20838
20839 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
20840 * data/: here.
20841
208422002-01-29 Paul Eggert <eggert@twinsun.com>
20843
20844 * src/bison.simple (YYSIZE_T): Do not define merely because
20845 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
20846 On some platforms, <alloca.h> does not declare YYSTD (size_t).
20847
208482002-01-27 Akim Demaille <akim@epita.fr>
20849
20850 Fix `%nonassoc and eof'.
20851
20852 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
20853 which were not properly copied! Replace
20854 memcpy (res->errs, src->errs, src->nerrs);
20855 with
20856 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
20857 !!!
20858 * tests/regression.at (%nonassoc and eof): Adjust to newest
20859 Autotest: `.' is not in the PATH.
20860
208612002-01-27 Akim Demaille <akim@epita.fr>
20862
20863 * tests/sets.at (AT_EXTRACT_SETS): New.
20864 (Nullable): Use it.
20865 (Firsts): New.
20866
208672002-01-26 Akim Demaille <akim@epita.fr>
20868
20869 * tests/actions.at, tests/calc.at, tests/headers.at,
20870 * tests/torture.at: Adjust to the newest Autotest which no longer
20871 forces `.' in the PATH.
20872
208732002-01-25 Akim Demaille <akim@epita.fr>
20874
20875 * tests/regression.at (%nonassoc and eof): New.
20876 Suggested by Robert Anisko.
20877
208782002-01-24 Akim Demaille <akim@epita.fr>
20879
20880 Bison dumps core when trying to complain about broken input files.
20881 Reported by Cris van Pelt.
20882
20883 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
20884 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
20885 into...
20886 (Invalid inputs): Strengthen: exercise parse_percent_token.
20887
208882002-01-24 Robert Anisko <robert.anisko@epita.fr>
20889
20890 * src/Makefile.am: Add bison.c++.
20891 * src/bison.c++: New skeleton.
20892
208932002-01-21 Paolo Bonzini <bonzini@gnu.org>
20894
20895 * po/it.po: New.
20896
208972002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
20898
20899 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
20900
209012002-01-20 Marc Autret <marc@gnu.org>
20902
20903 * src/files.c (compute_output_file_names): Fix
20904
209052002-01-20 Marc Autret <marc@gnu.org>
20906
20907 * tests/output.at: New test.
20908 * src/files.c (compute_base_names): Don't map extensions when
20909 the YACC flag is set, use defaults.
20910 Reported by Evgeny Stambulchik.
20911
209122002-01-20 Marc Autret <marc@gnu.org>
20913
20914 * src/system.h: Need to define __attribute__ away for non-GCC
20915 compilers as well (i.e., the vendor C compiler).
20916 Suggested by Albert Chin-A-Young.
20917
209182002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
20919
20920 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
20921 canonical definition.
20922 * src/system.h: Use the canonical definition for PARAMS (avoids
20923 a conflict with the macro from lib/hash.h).
20924
209252002-01-11 Akim Demaille <akim@epita.fr>
20926
20927 * configure.in: Use AC_FUNC_STRNLEN.
20928 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
20929
209302002-01-09 Akim Demaille <akim@epita.fr>
20931
20932 * src/files.c, src/files.h (output_infix): New.
20933 (tab_extension): Remove.
20934 (compute_base_names): Compute the former, drop the latter.
20935 * src/output.c (prepare): Insert the muscles `output-infix', and
20936 `output-suffix'.
20937 * src/parse-skel.y (string, string.1): New.
20938 (section.header): Use it.
20939 (section.yacc): Remove.
20940 (prefix): Remove too.
20941 * src/scan-skel.l: Adjust.
20942 * src/bison.simple, src/bison.hairy: Adjust.
20943
209442002-01-09 Akim Demaille <akim@epita.fr>
20945
20946 * configure.in (WERROR_CFLAGS): Compute it.
20947 * src/Makefile.am (CFLAGS): Pass it.
20948 * tests/atlocal.in (CFLAGS): Idem.
20949 * src/files.c: Fix a few warnings.
20950 (get_extension_index): Remove, unused.
20951
209522002-01-08 Akim Demaille <akim@epita.fr>
20953
20954 * src/getargs.c (AS_FILE_NAME): New.
20955 (getargs): Use it to convert DOSish file names.
20956 * src/files.c (base_name): Rename as full_base_name to avoid
20957 clashes with `base_name ()'.
20958 (filename_split): New.
20959 (compute_base_names): N-th rewrite, using filename_split.
20960
209612002-01-08 Akim Demaille <akim@epita.fr>
20962
20963 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
20964 New, stolen from the Fileutils 4.1.
20965 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
20966 * configure.in: Check for the presence of memrchr, and of its
20967 prototype.
20968
209692002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
20970
20971 * lib/hash.h (__P): Added definition for this macro.
20972 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
20973 BUILT_SOURCES, to ensure they are generated first.
20974 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
20975 %error-verbose to allow bootstrapping with bison 1.30x.
20976
209772002-01-06 Akim Demaille <akim@epita.fr>
20978
20979 * src/reader.c (parse_braces): Don't fetch the next char, the
20980 convention is to fetch on entry.
20981 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
20982 'switch' without a following semicolon.
20983 * tests/regression.at (braces parsing): New.
20984
209852002-01-06 Akim Demaille <akim@epita.fr>
20986
20987 Bison is dead wrong in its RR conflict reports.
20988
20989 * tests/torture.at (GNU Cim Grammar): New.
20990 * src/conflicts.c (count_rr_conflicts): Fix.
20991
209922002-01-06 Akim Demaille <akim@epita.fr>
20993
20994 Creating package.m4 from configure.ac causes too many problems.
20995
20996 * tests/Makefile.am (package.m4): Create it by hand,
20997 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
20998
209992002-01-06 Akim Demaille <akim@epita.fr>
21000
21001 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
21002 skeleton.h.
21003
210042002-01-04 Paul Eggert <eggert@twinsun.com>
21005
21006 * doc/bison.texinfo (Debugging):
21007 Remove YYSTDERR; it's no longer defined or used.
21008 Also, s/cstdio.h/cstdio/.
21009
210102002-01-03 Akim Demaille <akim@epita.fr>
21011
21012 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
21013
210142002-01-03 Akim Demaille <akim@epita.fr>
21015
21016 * src/parse-skel.y (process_skeleton): Don't bind the parser's
21017 tracing code to --trace, wait for a better --trace option, with
21018 args.
21019
210202002-01-03 Akim Demaille <akim@epita.fr>
21021
21022 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
21023 The ISO C++ standard is extremely clear about it: stderr is
21024 considered a macro, not a regular symbol (see table 94 `Header
21025 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
21026 Therefore std:: does not apply to it. It still does with fprintf.
21027 Also, s/cstdio.h/cstdio/.
21028
210292002-01-03 Akim Demaille <akim@epita.fr>
21030
21031 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
21032 for non system headers.
21033
210342002-01-02 Akim Demaille <akim@epita.fr>
21035
21036 Equip the skeleton chain with location tracking, runtime trace,
21037 pure parser and scanner.
21038
21039 * src/parse-skel.y: Request a pure parser, locations, and prefix
21040 renaming.
21041 (%union): Having several members with the same type does not help
21042 type mismatches, simplify.
21043 (YYPRINT, yyprint): New.
21044 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
21045 (skel_error): this.
21046 Handle locations.
21047 * src/scan-skel.l: Adjust to these changes.
21048 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
21049 (LOCATION_PRINT, skel_control_t): New.
21050
210512001-12-30 Akim Demaille <akim@epita.fr>
21052
21053 * src/parse-skel.y: Get rid of the shift/reduce conflict:
21054 replace `gb' with BLANKS.
21055 * src/scan-skel.l: Adjust.
21056
210572001-12-30 Akim Demaille <akim@epita.fr>
21058
21059 * src/system.h: We don't need nor want bcopy.
21060 Throw away MS-DOS crap: we don't need getpid.
21061 * configure.in: We don't need strndup. It was even causing
21062 problems: because Flex includes the headers *before* us,
21063 _GNU_SOURCE is not defined by config.h, and therefore strndup was
21064 not visible.
21065 * lib/xstrndup.c: New.
21066 * src/scan-skel.l: Use it.
21067 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
21068 * src/parse-skel.y: Use %directives instead of #defines.
21069
210702001-12-30 Akim Demaille <akim@epita.fr>
21071
21072 * src/skeleton.h: New.
21073 * src/output.c (output_parser, output_master_parser): Remove, dead
21074 code.
21075 * src/output.h (get_lines_number, actions_output, guards_output)
21076 (token_definitions_output): Prototype them.
21077 * src/parse-skel.y: Add the license notice.
21078 Include output.h and skeleton.h.
21079 (process_skeleton): Returns void, and takes a single parameter.
21080 * src/scan-skel.l: Add the license notice.
21081 Include skeleton.h.
21082 Don't use %option yylineno: it seems that then Flex imagines
21083 REJECT has been used, and therefore it won't reallocate its
21084 buffers (which makes no other sense to me than a bug). It results
21085 in warnings for `unused: yy_flex_realloc'.
21086
210872001-12-30 Robert Anisko <robert.anisko@epita.fr>
21088
21089 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
21090 (MUSCLE_INSERT_PREFIX): ...to there.
21091 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
21092 (MUSCLE_INSERT_PREFIX): Move from here...
21093
21094 * src/bison.hairy: Add a section directive. Put braces around muscle
21095 names. This parser skeleton is still broken, but Bison should not
21096 choke on a bad muscle 'syntax'.
21097 * src/bison.simple: Add a section directive. Put braces around muscle
21098 names.
21099
21100 * src/files.h (strsuffix, stringappend): Add declarations.
21101 (tab_extension): Add declaration.
21102 (short_base_name): Add declaration.
21103
21104 * src/files.c (strsuffix, stringappend): No longer static. These
21105 functions are used in the skeleton parser.
21106 (tab_extension): New.
21107 (compute_base_names): Use the computations done in this function
21108 to guess if the generated parsers should have '.tab' in their
21109 names.
21110 (short_base_name): No longer static.
21111
21112 * src/output.c (output_skeleton): New.
21113 (output): Disable call to output_master_parser, and give a try to
21114 a new skeleton handling system.
21115 (guards_output, actions_output): No longer static.
21116 (token_definitions_output, get_lines_number): No longer static.
21117
21118 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
21119
21120 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
21121 parse-skel.y.
21122
21123 * src/parse-skel.y: New file.
21124 * src/scan-skel.l: New file.
21125
211262001-12-29 Akim Demaille <akim@epita.fr>
21127
21128 %name-prefix is broken.
21129
21130 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
21131 Adjust all dependencies.
21132 * tests/headers.at (export YYLTYPE): Strengthen this test: use
21133 %name-prefix.
21134
21135 Renaming yylval but not yylloc is not consistent. Now we do.
21136
21137 * src/bison.simple: Prefix yylloc if used.
21138 * doc/bison.texinfo (Decl Summary): Document that.
21139
211402001-12-29 Akim Demaille <akim@epita.fr>
21141
21142 * doc/bison.texinfo: Promote `%long-directive' over
21143 `%long_directive'.
21144 Remove all references to fixed-output-files, yacc is enough.
21145
211462001-12-29 Akim Demaille <akim@epita.fr>
21147
21148 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
21149 user prologue. These are defaults.
21150 * tests/actions.at (Mid-rule actions): Make sure the user can
21151 define YYDEBUG and YYERROR_VERBOSE.
21152
211532001-12-29 Akim Demaille <akim@epita.fr>
21154
21155 * src/output.c (header_output): Don't forget to export YYLTYPE and
21156 yylloc.
21157 * tests/headers.at (export YYLTYPE): New, make sure it does.
21158 * tests/regression.at (%union and --defines, Invalid CPP headers):
21159 Move to...
21160 * tests/headers.at: here.
21161
211622001-12-29 Akim Demaille <akim@epita.fr>
21163
21164 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
21165
211662001-12-29 Akim Demaille <akim@epita.fr>
21167
21168 * tests/actions.at (Mid-rule actions): Output on a single line
21169 instead of several.
21170
211712001-12-29 Akim Demaille <akim@epita.fr>
21172
21173 * doc/bison.texinfo: Formatting changes.
21174
211752001-12-29 Akim Demaille <akim@epita.fr>
21176
21177 Don't store the token defs in a muscle, just be ready to output it
21178 on command. Now possible via `symbols'. Fixes a memory leak.
21179
21180 * src/output.c (token_definitions_output): New.
21181 (output_parser, header_output): Use it.
21182 * src/reader.c (symbols_save): Remove.
21183
211842001-12-29 Akim Demaille <akim@epita.fr>
21185
21186 * src/bison.simple: Do not provide a default for YYSTYPE and
21187 YYLTYPE before the user's prologue. Otherwise it's hardly... a
21188 default.
21189
211902001-12-29 Akim Demaille <akim@epita.fr>
21191
21192 Mid-rule actions are simply... ignored!
21193
21194 * src/reader.c (readgram): Be sure to attach mid-rule actions to
21195 the empty-rule associated to the dummy symbol, not to the host
21196 rule.
21197 * tests/actions.at (Mid-rule actions): New.
21198
211992001-12-29 Akim Demaille <akim@epita.fr>
21200
21201 Memory leak.
21202
21203 * src/reader.c (reader): Free grammar.
21204
212052001-12-29 Akim Demaille <akim@epita.fr>
21206
21207 Memory leak.
21208
21209 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
21210 since it allocates it for each state, although only one is needed.
21211 (allocate_storage): Do it here.
21212
212132001-12-29 Akim Demaille <akim@epita.fr>
21214
21215 * src/options.h, src/options.c (create_long_option_table): Rename
21216 as...
21217 (long_option_table_new): this, with a clearer prototype.
21218 (percent_table): Remove, unused,
21219 * src/getargs.c (getargs): Adjust.
21220
212212001-12-29 Akim Demaille <akim@epita.fr>
21222
21223 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
21224 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
21225 as states.
21226
212272001-12-29 Akim Demaille <akim@epita.fr>
21228
21229 * src/lalr.c (build_relations): Rename `states' as `states1'.
21230 Sorry, I don't understand exactly what it is, no better name...
21231
212322001-12-29 Akim Demaille <akim@epita.fr>
21233
21234 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
21235 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
21236 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
21237 as rules.
21238
212392001-12-29 Akim Demaille <akim@epita.fr>
21240
21241 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
21242 ago.
21243
212442001-12-29 Akim Demaille <akim@epita.fr>
21245
21246 * src/reader.c, src/reader.h (user_toknums): Remove.
21247 Adjust all users to use symbols[i]->user_token_number.
21248
212492001-12-29 Akim Demaille <akim@epita.fr>
21250
21251 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
21252 Adjust all users to use symbols[i]->prec or ->assoc.
21253
212542001-12-29 Akim Demaille <akim@epita.fr>
21255
21256 * src/reader.c, src/reader.h (tags): Remove.
21257 Adjust all users to use symbols[i]->tag.
21258
212592001-12-29 Akim Demaille <akim@epita.fr>
21260
21261 * src/gram.h, src/gram.c (symbols): New, similar to state_table
21262 and rule_table.
21263 * src/reader.c (packsymbols): Fill this table.
21264 Drop sprec.
21265 * src/conflicts.c (resolve_sr_conflict): Adjust.
21266 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
21267 single table.
21268 Use symbols[i]->tag instead of tags[i].
21269
212702001-12-29 Akim Demaille <akim@epita.fr>
21271
21272 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
21273 In addition, put a comment in there, to replace...
21274 * tests/regression.at (%union and C comments): Remove.
21275
212762001-12-29 Akim Demaille <akim@epita.fr>
21277
21278 * tests/regression.at (Web2c Actions): Blindly move the actual
21279 output as expected output. The contents *seem* right to me, but I
21280 can't pretend reading perfectly parser tables... Nonetheless, all
21281 the other tests pass correctly, the table look OK, even though the
21282 presence of `$axiom' is to be noted: AFAICS it is useless (but
21283 harmless).
21284
212852001-12-29 Akim Demaille <akim@epita.fr>
21286
21287 * src/reader.c (readgram): Don't add the rule 0 if there were no
21288 rules read. In other words, add it _after_ having performed
21289 grammar sanity checks.
21290 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
21291
212922001-12-29 Akim Demaille <akim@epita.fr>
21293
21294 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
21295 visible, and some states have now a different number.
21296
212972001-12-29 Akim Demaille <akim@epita.fr>
21298
21299 * src/reader.c (readgram): Bind the initial rule's lineno to that
21300 of the first rule.
21301 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
21302 (Solved SR Conflicts): Adjust rule 0's line number.
21303
213042001-12-29 Akim Demaille <akim@epita.fr>
21305
21306 Fix the `GAWK Grammar' failure.
21307
21308 * src/LR0.c (final_state): Initialize to -1 so that we do compute
21309 the reductions of the first state which was mistakenly confused
21310 with the final state because precisely final_state was initialized
21311 to 0.
21312 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
21313 now noticed by Bison.
21314 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
21315 have a reduction on $default.
21316
213172001-12-29 Akim Demaille <akim@epita.fr>
21318
21319 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
21320 rule line numbers.
21321 * src/closure.c (print_closure): Likewise.
21322 * src/derives.c (print_derives): Likewise.
21323 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
21324 now.
21325
213262001-12-29 Akim Demaille <akim@epita.fr>
21327
21328 * src/lalr.c (lookaheads_print): New.
21329 (lalr): Call it when --trace-flag.
21330 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
21331 are dumped.
21332
213332001-12-29 Akim Demaille <akim@epita.fr>
21334
21335 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
21336 when walking through ritem, even via rule->rhs.
21337 * src/reduce.c (dump_grammar, useful_production, reduce_output)
21338 (useful_production, useless_nonterminals): Likewise.
21339 (reduce_grammar_tables): Likewise, plus update nritems.
21340 * src/nullable.c (set_nullable): Likewise.
21341 * src/lalr.c (build_relations): Likewise.
21342 * tests/sets.at (Nullable): Adjust.
21343 Fortunately, now, the $axiom is no longer nullable.
21344
213452001-12-29 Akim Demaille <akim@epita.fr>
21346
21347 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
21348 the 0-sentinel.
21349 * src/gram.c (ritem_longest_rhs): Likewise.
21350 * src/reduce.c (nonterminals_reduce): Likewise.
21351 * src/print_graph.c (print_graph): Likewise.
21352 * src/output.c (output_rule_data): Likewise.
21353 * src/nullable.c (set_nullable): Likewise.
21354
213552001-12-29 Akim Demaille <akim@epita.fr>
21356
21357 * src/output.c: Comment changes.
21358
213592001-12-27 Paul Eggert <eggert@twinsun.com>
21360
21361 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
21362 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
21363 Sparc, as they were causing more porting problems than the
21364 (minor) performance improvement was worth.
21365
21366 Also, catch up with 1.31's YYSTD.
21367
213682001-12-27 Akim Demaille <akim@epita.fr>
21369
21370 * src/output.c (output_gram): Rely on nritems, not the
21371 0-sentinel. See below.
21372 Use -1 as separator, not 0.
21373 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
21374 Rely on -1 as separator in yyrhs, instead of 0.
21375 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
21376 twice `Now at end of input', therefore there are two lines less to
21377 expect.
21378
213792001-12-27 Akim Demaille <akim@epita.fr>
21380
21381 * tests/regression.at (Unresolved SR Conflicts):
21382 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
21383 below.
21384
213852001-12-27 Akim Demaille <akim@epita.fr>
21386
21387 * src/LR0.c (new_state): Recognize the final state by the fact it
21388 is reached by eoftoken.
21389 (insert_start_shifting_state, insert_eof_shifting_state)
21390 (insert_accepting_state, augment_automaton): Remove, since now
21391 these states are automatically computed from the initial state.
21392 (generate_states): Adjust.
21393 * src/print.c: When reporting a rule number to the user, substract
21394 1, so that the axiom rule is rule 0, and the first user rule is 1.
21395 * src/reduce.c: Likewise.
21396 * src/print_graph.c (print_core): For the time being, just as for
21397 the report, depend upon --trace-flags to dump the full set of
21398 items.
21399 * src/reader.c (readgram): Once the grammar read, insert the rule
21400 0: `$axiom: START-SYMBOL $'.
21401 * tests/set.at: Adjust: rule 0 is now displayed, and since the
21402 number of the states has changed (the final state is no longer
21403 necessarily the last), catch up.
21404
214052001-12-27 Akim Demaille <akim@epita.fr>
21406
21407 Try to make the use of the eoftoken valid. Given that its value
21408 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
21409 is used instead of > 0 where appropriate, (ii), depend upon nritems
21410 instead of the 0-sentinel.
21411
21412 * src/gram.h, src/gram.c (nritems): New.
21413 Expected to be duplication of nitems, but for the time being...
21414 * src/reader.c (packgram): Assert nritems and nitems are equal.
21415 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
21416 * src/closure.c (print_closure, print_fderives): Likewise.
21417 * src/gram.c (ritem_print): Likewise.
21418 * src/print.c (print_core, print_grammar): Likewise.
21419 * src/print_graph.c: Likewise.
21420
214212001-12-27 Akim Demaille <akim@epita.fr>
21422
21423 * src/main.c (main): If there are complains after grammar
21424 reductions, then output the report anyway if requested, then die.
21425 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
21426 * src/reader.c (eoftoken): New.
21427 (parse_token_decl): If the token being defined has value `0', it
21428 is the eoftoken.
21429 (packsymbols): No longer hack `tags' to insert `$' by hand.
21430 Be sure to preserve the value of the eoftoken.
21431 (reader): Make sure eoftoken is defined.
21432 Initialize nsyms to 0: now eoftoken is created just like the others.
21433 * src/print.c (print_grammar): Don't special case the eof token.
21434 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
21435 lie anyway, albeit pleasant.
21436 * tests/calc.at: Exercise error messages with eoftoken.
21437 Change the grammar so that empty input is invalid.
21438 Adjust expectations.
21439 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
21440
214412001-12-27 Akim Demaille <akim@epita.fr>
21442
21443 * configure.in: Check the protos of strchr ans strspn.
21444 Replace strchr if needed.
21445 * src/system.h: Provide the protos of strchr, strspn and memchr if
21446 missing.
21447 * lib/strchr.c: New.
21448 * src/reader.c (symbols_save): Use strchr.
21449
214502001-12-27 Akim Demaille <akim@epita.fr>
21451
21452 * src/print.c, src/print_graph.c (escape): New.
21453 Use it to quote the TAGS outputs.
21454 * src/print_graph.c (print_state): Now errors are in red, and
21455 reductions in green.
21456 Prefer high to wide: output the state number on a line of its own.
21457
214582001-12-27 Akim Demaille <akim@epita.fr>
21459
21460 * src/state.h, src/state.c (reductions_new): New.
21461 * src/LR0.c (set_state_table): Let all the states have a
21462 `reductions', even if reduced to 0.
21463 (save_reductions): Adjust.
21464 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
21465 * src/print.c (print_reductions, print_actions): Adjust.
21466 * src/output.c (action_row): Adjust.
21467
214682001-12-27 Akim Demaille <akim@epita.fr>
21469
21470 * src/state.h, src/state.c (errs_new, errs_dup): New.
21471 * src/LR0.c (set_state_table): Let all the states have an errs,
21472 even if reduced to 0.
21473 * src/print.c (print_errs, print_reductions): Adjust.
21474 * src/output.c (output_actions, action_row): Adjust.
21475 * src/conflicts.c (resolve_sr_conflict): Adjust.
21476
214772001-12-27 Akim Demaille <akim@epita.fr>
21478
21479 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
21480
214812001-12-27 Akim Demaille <akim@epita.fr>
21482
21483 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
21484 * src/print.c: here.
21485 (lookaheadset, shiftset): New, used as additional storage by
21486 print_reductions.
21487 (print_results): Adjust.
21488 (print_shifts, print_gotos, print_errs): New, extracted from...
21489 (print_actions): here.
21490 * src/print_graph.c (print_actions): Remove dead code.
21491
214922001-12-27 Akim Demaille <akim@epita.fr>
21493
21494 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
21495 `$n' and `@n'.
21496
214972001-12-27 Akim Demaille <akim@epita.fr>
21498
21499 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
21500 (build_relations): Adjust.
21501
215022001-12-27 Akim Demaille <akim@epita.fr>
21503
21504 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
21505 duplication.
21506
215072001-12-27 Akim Demaille <akim@epita.fr>
21508
21509 * src/reader.c (packgram): Catch nitems overflows.
21510
215112001-12-27 Akim Demaille <akim@epita.fr>
21512
21513 * src/files.c, src/files.h (guard_obstack): Remove.
21514 * src/output.c (output): Adjust.
21515 * src/reader.c (parse_braces): New, factoring...
21516 (copy_action, copy_guard): these two which are renamed as...
21517 (parse_action, parse_guard): these.
21518 As a voluntary consequence, using braces around guards is now
21519 mandatory.
21520
215212001-12-27 Akim Demaille <akim@epita.fr>
21522
21523 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
21524 * src/reader.c (symbol_list): `guard' and `guard_line' are new
21525 members.
21526 (symbol_list_new): Adjust.
21527 (copy_action): action_line is the first line, not the last.
21528 (copy_guard): Just as for actions, store the `action' only, not
21529 the switch/case/break flesh.
21530 Don't parse the user action that might follow the guard, let...
21531 (readgram): do it, i.e., now, there can be an action after a
21532 guard.
21533 In other words the guard is just explicitly optional.
21534 (packgram): Adjust.
21535 * src/output.c (guards_output): New.
21536 (output_parser): Call it when needed.
21537 (output): Also free the guard and attrs obstacks.
21538 * src/files.c, src/files.h (obstack_save): Remove.
21539 (output_files): Remove.
21540 As a result, if one needs the former `.act' file, using an
21541 appropriate skeleton which requires actions and guards is now
21542 required.
21543 * src/main.c (main): Adjust.
21544 * tests/semantic.at: New.
21545 * tests/regression.at: Use `input.y' as input file name.
21546 Avoid 8+3 problems by requiring input.c when the test needs the
21547 parser.
21548
215492001-12-27 Akim Demaille <akim@epita.fr>
21550
21551 * src/reader.c (symbol_list_new): Be sure to initialize all the
21552 fields.
21553
215542001-12-27 Akim Demaille <akim@epita.fr>
21555
21556 All the hacks using a final pseudo state are now useless.
21557
21558 * src/LR0.c (set_state_table): state_table holds exactly nstates.
21559 * src/lalr.c (nLA): New.
21560 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
21561 instead of lookaheadsp from the pseudo state (nstate + 1).
21562
215632001-12-27 Akim Demaille <akim@epita.fr>
21564
21565 * src/output.c (action_row, token_actions): Use a state_t instead
21566 of a integer, and nlookaheads instead of the following state's
21567 lookaheadsp.
21568
215692001-12-27 Akim Demaille <akim@epita.fr>
21570
21571 * src/conflicts.c (log_resolution, flush_shift)
21572 (resolve_sr_conflict, set_conflicts, solve_conflicts)
21573 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
21574 (conflicts_print, print_reductions): Use a state_t instead of an
21575 integer when referring to a state.
21576 As much as possible, depend upon nlookaheads, instead of the
21577 `lookaheadsp' member of the following state (since lookaheads of
21578 successive states are successive, the difference between state n + 1
21579 and n served as the number of lookaheads for state n).
21580 * src/lalr.c (add_lookback_edge): Likewise.
21581 * src/print.c (print_core, print_actions, print_state)
21582 (print_results): Likewise.
21583 * src/print_graph.c (print_core, print_actions, print_state)
21584 (print_graph): Likewise.
21585 * src/conflicts.h: Adjust.
21586
215872001-12-27 Akim Demaille <akim@epita.fr>
21588
21589 * src/bison.hairy: Formatting/comment changes.
21590 ANSIfy.
21591 Remove `register' indications.
21592 Add plenty of `static'.
21593
215942001-12-27 Akim Demaille <akim@epita.fr>
21595
21596 * src/output.c (prepare): Drop the muscle `ntbase' which
21597 duplicates ntokens.
21598 * src/bison.simple: Formatting/comment changes.
21599 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
21600 is an undocumented synonym.
21601
216022001-12-22 Akim Demaille <akim@epita.fr>
21603
21604 * src/output.c (output_table_data): Change the prototype to use
21605 `int' for array ranges: some invocations do pass an int, not a
21606 short.
21607 Reported by Wayne Green.
21608
216092001-12-22 Akim Demaille <akim@epita.fr>
21610
21611 Some actions of web2c.y are improperly triggered.
21612 Reported by Mike Castle.
21613
21614 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
21615 * tests/regression.at (Web2c): Rename as...
21616 (Web2c Report): this.
21617 (Web2c Actions): New.
21618
216192001-12-22 Akim Demaille <akim@epita.fr>
21620
21621 Reductions in web2c.y are improperly reported.
21622 Reported by Mike Castle.
21623
21624 * src/conflicts.c (print_reductions): Fix.
21625 * tests/regression.at (Web2c): New.
21626
216272001-12-18 Akim Demaille <akim@epita.fr>
21628
21629 Some host fail on `assert (!"foo")', which expands to
21630 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
21631 Reported by Nelson Beebee.
21632
21633 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
21634 `#define it_succeeded 0' and `assert (it_succeeded)'.
21635
216362001-12-17 Marc Autret <autret_m@epita.fr>
21637
21638 * src/bison.simple: Don't hard code the skeleton line and filename.
21639 * src/output.c (output_parser): Rename 'line' as 'output_line'.
21640 New line counter 'skeleton_line' (skeleton-line muscle).
21641
216422001-12-17 Paul Eggert <eggert@twinsun.com>
21643
21644 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
21645 YYDEBUG must be defined to a nonzero value.
21646
21647 * src/bison.simple (yytname): Do not assume that the user defines
21648 YYDEBUG to a properly parenthesized expression.
21649
216502001-12-17 Akim Demaille <akim@epita.fr>
21651
21652 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
21653 nlookaheads is a new member.
21654 Adjust all users.
21655 * src/lalr.h (nlookaheads): Remove this orphan declaration.
21656 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
21657 state.
21658
216592001-12-17 Akim Demaille <akim@epita.fr>
21660
21661 * src/files.h, src/files.c (open_files, close_files): Remove.
21662 * src/main.c (main): Don't open/close files, nor invoke lex_free,
21663 let...
21664 * src/reader.c (reader): Do it.
21665
216662001-12-17 Akim Demaille <akim@epita.fr>
21667
21668 * src/conflicts.c (print_reductions): Formatting changes.
21669
216702001-12-17 Akim Demaille <akim@epita.fr>
21671
21672 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
21673 (flush_reduce): New.
21674 (resolve_sr_conflict): Adjust.
21675
216762001-12-17 Akim Demaille <akim@epita.fr>
21677
21678 * src/output.c (output_obstack): Be static and rename as...
21679 (format_obstack): this, to avoid any confusion with files.c's
21680 output_obstack.
21681 * src/reader.h (muscle_obstack): Move to...
21682 * src/output.h: here, since it's defined in output.c.
21683
216842001-12-17 Akim Demaille <akim@epita.fr>
21685
21686 * src/output.c (action_row, save_column, default_goto)
21687 (sort_actions, matching_state, pack_vector): Better variable
21688 locality.
21689
216902001-12-17 Akim Demaille <akim@epita.fr>
21691
21692 * src/output.c: Various formatting changes.
21693
216942001-12-17 Akim Demaille <akim@epita.fr>
21695
21696 * src/files.c (output_files): Free the output_obstack.
21697 * src/main.c (main): Call print and print_graph conditionally.
21698 * src/print.c (print): Work unconditionally.
21699 * src/print_graph.c (print_graph): Work unconditionally.
21700 * src/conflicts.c (log_resolution): Output only if verbose_flag.
21701
217022001-12-16 Marc Autret <autret_m@epita.fr>
21703
21704 * src/output.c (actions_output): Fix. When we use %no-lines,
21705 there is one less line per action.
21706
217072001-12-16 Marc Autret <autret_m@epita.fr>
21708
21709 * src/bison.simple: Remove a useless #line directive.
21710 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
21711 * src/output.c (get_lines_number): New.
21712 (output_parser): Adjust, now takes care about the lines of a
21713 output muscles.
21714 Fix line numbering.
21715 (actions_output): Computes the number of lines taken by actions.
21716 (output_master_parser): Insert new skeleton which is the name of
21717 the output parser file name.
21718
217192001-12-15 Marc Autret <autret_m@epita.fr>
21720
21721 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
21722
217232001-12-15 Marc Autret <autret_m@epita.fr>
21724
21725 * src/output.c (output_gram): Keep track of the hairy one.
21726
217272001-12-15 Akim Demaille <akim@epita.fr>
21728
21729 Make `make distcheck' work.
21730
21731 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
21732 system.h which uses libgettext.h.
21733
217342001-12-15 Akim Demaille <akim@epita.fr>
21735
21736 * src/nullable.c (set_nullable): Useless rules must be skipped,
21737 otherwise, since we range over their symbols, we might look at a
21738 nonterminal which no longer ``exists'', i.e., it is not counted in
21739 `nvars', hence we overflow our arrays.
21740
217412001-12-15 Akim Demaille <akim@epita.fr>
21742
21743 The header can also be produced directly, without any obstack!
21744 Yahoo!
21745
21746 * src/files.c, src/files.h (defines_obstack): Remove.
21747 (compute_header_macro): Global.
21748 (defines_obstack_save): Remove.
21749 * src/reader.c (parse_union_decl): No longer output to
21750 defines_obstack: its content can be found in the `stype' muscle
21751 anyway.
21752 (output_token_translations): Merge into...
21753 (symbols_output): this.
21754 Rename as...
21755 (symbols_save): this.
21756 (reader): Adjust.
21757 * src/output.c (header_output): New.
21758 (output): Call it.
21759
217602001-12-15 Akim Demaille <akim@epita.fr>
21761
21762 * src/reader.c (parse_union_decl): Instead of handling two obstack
21763 simultaneously, use one to define the `stype' muscle, and use the
21764 value of the latter to fill defines_obstack.
21765 (copy_comment): Remove.
21766 (copy_comment2): Work for a single obstack.
21767 Rename as...
21768 (copy_comment): this.
21769
217702001-12-15 Akim Demaille <akim@epita.fr>
21771
21772 * src/lex.c, src/lex.h (xgetc): No longer static.
21773 * src/reader.c (parse_union_decl): Revamp.
21774
217752001-12-15 Akim Demaille <akim@epita.fr>
21776
21777 Still making progress in separating Bison into (i) input, (ii)
21778 process, (iii) output: now we can directly output the parser file
21779 without using table_obstack at all.
21780
21781 * src/files.c, src/files.h (table_obstack): Bye bye.
21782 (parser_file_name): New.
21783 * src/files.c (compute_output_file_names): Compute it.
21784 * src/output.c (actions_output, output_parser)
21785 (output_master_parser): To a file instead of an obstack.
21786
217872001-12-15 Akim Demaille <akim@epita.fr>
21788
21789 Attach actions to rules, instead of pre-outputting them to
21790 actions_obstack.
21791
21792 * src/gram.h (rule_t): action and action_line are new members.
21793 * src/reader.c (symbol_list): Likewise.
21794 (copy_action): Save the actions within the rule.
21795 (packgram): Save them in rule_table.
21796 * src/output.c (actions_output): New.
21797 (output_parser): Use it on `%%actions'.
21798 (output_rule_data): Don't free rule_table.
21799 (output): Do it.
21800 (prepare): Don't save the `action' muscle.
21801 * src/bison.simple: s/%%action/%%actions/.
21802
218032001-12-15 Akim Demaille <akim@epita.fr>
21804
21805 * src/reader.c (copy_action): When --yacc, don't append a `;'
21806 to the user action: let it fail if lacking.
21807 Suggested by Arnold Robbins and Tom Tromey.
21808
218092001-12-14 Akim Demaille <akim@epita.fr>
21810
21811 * src/lex.c (literalchar): Simply return the char you decoded, non
21812 longer mess around with obstacks and int pointers.
21813 Adjust all callers.
21814
218152001-12-14 Akim Demaille <akim@epita.fr>
21816
21817 * src/lex.c (literalchar): Don't escape the special characters,
21818 just decode them, and keep them as char (before, eol was output as
21819 the 2 char string `\n' etc.).
21820 * src/output.c (output_rule_data): Use quotearg to output the
21821 token strings.
21822
218232001-12-13 Paul Eggert <eggert@twinsun.com>
21824
21825 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
21826 Do not infringe on the global user namespace when using C++.
21827 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
21828 All uses of `fprintf' and `stderr' changed.
21829
21830 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
21831
218322001-12-13 Akim Demaille <akim@epita.fr>
21833
21834 The computation of nullable is broken: it doesn't handle empty
21835 RHS's properly.
21836
21837 * tests/torture.at (GNU AWK Grammar): New.
21838 * tests/sets.at (Nullable): New.
21839 * src/nullable.c (set_nullable): Instead of blindly looping over
21840 `ritems', loop over the rules, and then over their rhs's.
21841
21842 Work around Autotest bugs.
21843
21844 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
21845 frame, because Autotest understand lines starting with a `+' as
21846 traces from the shell. Then, they are not processed properly.
21847 Admittedly an Autotest bug, but we don't have time to wait for
21848 Autotest to catch up.
21849 * tests/regression.at (Broken Closure): Adjust to the new table
21850 frames.
21851 Move to...
21852 * tests/sets.at: here.
21853
218542001-12-13 Akim Demaille <akim@epita.fr>
21855
21856 * src/closure.c (closure): Use nrules instead of playing tricks
21857 with BITS_PER_WORD.
21858
218592001-12-13 Akim Demaille <akim@epita.fr>
21860
21861 * src/print.c (print_actions): Output the handling of `$' as the
21862 traces do: shifting the token EOF. Before EOF was treated as a
21863 nonterminal.
21864 * tests/regression.at: Adjust some tests.
21865 * src/print_graph.c (print_core): Complete the set of items via
21866 closure. The next-to-final and final states are still unsatisfying,
21867 but that's to be addressed elsewhere.
21868 No longer output the rule numbers, but do output the state number.
21869 A single loop for the shifts + gotos is enough, but picked a
21870 distinct color for each.
21871 (print_graph): Initialize and finalize closure.
21872
218732001-12-13 Akim Demaille <akim@epita.fr>
21874
21875 * src/reader.c (readgram): Remove dead code, an strip useless
21876 braces.
21877 (get_type): Remove, unused.
21878
218792001-12-12 Akim Demaille <akim@epita.fr>
21880
21881 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
21882 on that of lib/error.c.
21883
218842001-12-12 Akim Demaille <akim@epita.fr>
21885
21886 Some hosts don't like `/' in includes.
21887
21888 * src/system.h: Include libgettext.h without qualifying the path.
21889 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
21890 $(top_srcdir).
21891
218922001-12-11 Marc Autret <autret_m@epita.fr>
21893
21894 * src/output.c (output_parser): Remove useless muscle.
21895
218962001-12-11 Marc Autret <autret_m@epita.fr>
21897
21898 * src/bison.simple: Remove #line just before %%epilogue. It
21899 is now handled in ...
21900 * src/reader.c (read_additionnal_code): Add the output of a
21901 #line for the epilogue.
21902
219032001-12-10 Marc Autret <autret_m@epita.fr>
21904
21905 * src/reader.c (copy_definition): Re-use CPP-outed code which
21906 replace precedent remove.
21907 * src/bison.simple: Remove #line before %%prologue because
21908 %%input-line is wrong at this time.
21909
219102001-12-10 Marc Autret <autret_m@epita.fr>
21911
21912 * src/reader.c (symbols_output): Clean up.
21913 * src/output.c (output_gram, output): Clean up.
21914
219152001-12-10 Akim Demaille <akim@epita.fr>
21916
21917 * src/lalr.c (initialize_lookaheads): New. Extracted from...
21918 * src/LR0.c (set_state_table): here.
21919 * src/lalr.c (lalr): Call it.
21920
219212001-12-10 Akim Demaille <akim@epita.fr>
21922
21923 * src/state.h (shifts): Remove the `number' member: shifts are
21924 attached to state, hence no longer need to be labelled with a
21925 state number.
21926
219272001-12-10 Akim Demaille <akim@epita.fr>
21928
21929 Now that states have a complete set of members, the linked list of
21930 shifts is useless: just fill directly the state's shifts member.
21931
21932 * src/state.h (shifts): Remove the `next' member.
21933 * src/LR0.c (first_state, last_state): Remove.
21934 Adjust the callers.
21935 (augment_automaton): Don't look for the shifts that must be added
21936 a shift on EOF: it is those of the state we looked for! But now,
21937 since shifts are attached, it is no longer needed to looking
21938 merely by its id: its number.
21939
219402001-12-10 Akim Demaille <akim@epita.fr>
21941
21942 * src/LR0.c (augment_automaton): Better variable locality.
21943 Remove an impossible branch: if there is a state corresponding to
21944 the start symbol being shifted, then there is shift for the start
21945 symbol from the initial state.
21946
219472001-12-10 Akim Demaille <akim@epita.fr>
21948
21949 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
21950 only when appropriate: when insert_start_shifting_state' is not
21951 invoked.
21952 * tests/regression.at (Rule Line Numbers): Adjust.
21953
219542001-12-10 Akim Demaille <akim@epita.fr>
21955
21956 * src/LR0.c (augment_automaton): Now that all states have shifts,
21957 merge the two cases addition shifts to the initial state.
21958
219592001-12-10 Akim Demaille <akim@epita.fr>
21960
21961 * src/lalr.c (set_state_table): Move to...
21962 * src/LR0.c: here.
21963 * src/lalr.c (lalr): Don't call it...
21964 * src/LR0.c (generate_states): do it.
21965 * src/LR0.h (first_state): Remove, only the table is used.
21966
219672001-12-10 Akim Demaille <akim@epita.fr>
21968
21969 * src/LR0.h (first_shift, first_reduction): Remove.
21970 * src/lalr.c: Don't use first_shift: find shifts through the
21971 states.
21972
219732001-12-10 Akim Demaille <akim@epita.fr>
21974
21975 * src/LR0.c: Attach shifts to states as soon as they are
21976 computed.
21977 * src/lalr.c (set_state_table): Instead of assigning shifts to
21978 state, just assert that the mapping was properly done.
21979
219802001-12-10 Akim Demaille <akim@epita.fr>
21981
21982 * src/LR0.c (insert_start_shift): Rename as...
21983 (insert_start_shifting_state): this.
21984 (insert_eof_shifting_state, insert_accepting_state): New.
21985 (augment_automaton): Adjust.
21986 Better locality of the variables.
21987 When looking if the start_symbol is shifted from the initial
21988 state, using `while (... symbol != start_symbol ...)' sounds
21989 better than `while (... symbol < start_symbol ...)': If fail
21990 to see how the order between symbols could be relevant!
21991
219922001-12-10 Akim Demaille <akim@epita.fr>
21993
21994 * src/getargs.h: Don't declare `spec_name_prefix' and
21995 `spec_file_prefix', declared by src/files.h.
21996 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
21997 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
21998 * src/output.c (prepare): Adjust.
21999 * src/reader.c (symbols_output): Likewise.
22000 * src/vmsgetargs.c: Vaguely adjust, but who cares?
22001
220022001-12-10 Akim Demaille <akim@epita.fr>
22003
22004 * src/muscle_tab.c (muscle_init): NULL is a better default than
22005 `"0"'.
22006
220072001-12-10 Akim Demaille <akim@epita.fr>
22008
22009 * src/reader.c (reader): Calling symbols_output once is enough.
22010
220112001-12-10 Akim Demaille <akim@epita.fr>
22012
22013 Now that states have a complete set of members, the linked list of
22014 reductions is useless: just fill directly the state's reductions
22015 member.
22016
22017 * src/state.h (struct reductions): Remove member `number' and
22018 `next'.
22019 * src/LR0.c (first_reduction, last_reduction): Remove.
22020 (save_reductions): Don't link the new reductions, store them in
22021 this_state.
22022 * src/lalr.c (set_state_table): No need to attach reductions to
22023 states, it's already done.
22024 * src/output.c (output_actions): No longer free the shifts, then
22025 the reductions, then the states: free all the states and their
22026 members.
22027
220282001-12-10 Akim Demaille <akim@epita.fr>
22029
22030 * src/options.c (OPTN, DRTV, BOTH): New.
22031 (option_table): Use them.
22032
22033 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
22034 the job of system.h.
22035 * src/options.c: Don't include stdio.h and xalloc.h for the same
22036 reasons.
22037
220382001-12-10 Akim Demaille <akim@epita.fr>
22039
22040 * src/output.c (output, prepare): Make sure the values of the
22041 muscles `action' and `prologue' are 0-terminated.
22042
220432001-12-10 Akim Demaille <akim@epita.fr>
22044
22045 Clean up GCC warnings.
22046
22047 * src/reader.c (copy_action): `buf' is not used.
22048 (parse_skel_decl): Be static.
22049 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
22050 * src/options.h (create_long_option_table): Have a real prototype.
22051 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
22052 (hash_delete_at): Return const void *.
22053 Adjust casts to preserve the const.
22054
220552001-12-10 Akim Demaille <akim@epita.fr>
22056
22057 * configure.in: Require 2.52g.
22058 M4 is not needed, but AUTOM4TE is.
22059 * m4/m4.m4: Remove.
22060 * tests/Makefile.am: Adjust.
22061
220622001-12-10 Akim Demaille <akim@epita.fr>
22063
22064 One structure for states is enough, even though theoretically
22065 there are LR(0) states and LALR(1) states.
22066
22067 * src/lalr.h (state_t): Remove.
22068 (state_table): Be state_t **, not state_t *.
22069 * src/state.h (core, CORE_ALLOC): Rename as...
22070 (state_t, STATE_ALLOC): this.
22071 Add the LALR(1) members: shifts, reductions, errs.
22072 * src/LR0.c (state_table): Rename as...
22073 (state_hash): this, to avoid name clashes with the global
22074 `state_table'.
22075 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
22076 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
22077
220782001-12-10 Akim Demaille <akim@epita.fr>
22079
22080 Bison dumps core on bash.y.
22081 Reported by Pascal Bart.
22082
22083 * src/warshall.c (bitmatrix_print): New.
22084 (TC): Use it.
22085 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
22086 j must be the outer loop.
22087 * tests/regression.at (Broken Closure): New.
22088
220892001-12-05 Akim Demaille <akim@epita.fr>
22090
22091 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
22092 its argument.
22093 Reported by Peter Hamorsky.
22094
220952001-12-05 Akim Demaille <akim@epita.fr>
22096
22097 * src/conflicts.c (err_table): Remove.
22098 (resolve_sr_conflict): Adjust.
22099 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
22100 Rename as...
22101 (state_t.reductions, state_t.shifts): this.
22102
221032001-12-05 Akim Demaille <akim@epita.fr>
22104
22105 * src/reduce.c (reduce_grammar_tables): No longer disable the
22106 removal of useless rules via CPP but via `if (0)', so that the
22107 compiler still check the code is valid.
22108 For instance, it should have noticed `rline' no longer exists: use
22109 the `line' member of rule_t.
22110 * src/gram.c (dummy, rline): Remove, unused.
22111
221122001-12-05 Akim Demaille <akim@epita.fr>
22113
22114 * src/output.c (pack_vector): Use assert, not berror.
22115 * src/main.c (berror): Remove, unused.
22116
221172001-12-05 Akim Demaille <akim@epita.fr>
22118
22119 New experimental feature: if --verbose --trace output all the
22120 items of a state, not only its kernel.
22121
22122 * src/print.c (print_core): If `trace_flag', then invoke closure
22123 before outputting the items of the state (print_core is no longer
22124 a correct name them).
22125 (print_results): Invoke new_closure/free_closure if needed.
22126
221272001-12-05 Akim Demaille <akim@epita.fr>
22128
22129 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
22130 * src/closure.c, src/closure.h (itemsetsize): Rename as...
22131 (nitemset): for consistency with the rest of the project.
22132
221332001-12-05 Akim Demaille <akim@epita.fr>
22134
22135 * src/closure.c (print_closure): Improve.
22136 (closure): Use it for printing input and output.
22137
221382001-12-05 Akim Demaille <akim@epita.fr>
22139
22140 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
22141 indexed by nonterminals.
22142
221432001-12-05 Akim Demaille <akim@epita.fr>
22144
22145 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
22146 what it was!).
22147 * src/warshall.h: Remove accidental duplication of the content.
22148
221492001-12-05 Akim Demaille <akim@epita.fr>
22150
22151 * src/closure.c (set_fderives): De-obfuscate.
22152
221532001-12-05 Akim Demaille <akim@epita.fr>
22154
22155 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
22156
221572001-12-05 Akim Demaille <akim@epita.fr>
22158
22159 * src/closure.c (set_firsts): De-obfuscate.
22160
221612001-12-05 Akim Demaille <akim@epita.fr>
22162
22163 * src/output.c (action_row): De-obfuscate
22164 using the good o' techniques: arrays not pointers, variable
22165 locality, BITISSET, RESETBIT etc.
22166
221672001-12-05 Akim Demaille <akim@epita.fr>
22168
22169 Pessimize the code to simplify it: from now on, all the states
22170 have a valid SHIFTS, which NSHIFTS is possibly 0.
22171
22172 * src/LR0.c (shifts_new): Be global and move to..
22173 * src/state.c, src/state.h: here.
22174 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
22175 * src/print_graph: Adjust.
22176
221772001-12-05 Akim Demaille <akim@epita.fr>
22178
22179 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
22180 * src/conflicts.c: Use it.
22181 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
22182 incorrectly ``simplified''.
22183
221842001-12-05 Akim Demaille <akim@epita.fr>
22185
22186 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
22187 using the good o' techniques: arrays not pointers, variable
22188 locality, BITISSET, RESETBIT etc.
22189
221902001-12-05 Akim Demaille <akim@epita.fr>
22191
22192 * src/state.h (SHIFT_SYMBOL): New.
22193 * src/conflicts.c: Use it to deobfuscate.
22194
221952001-12-05 Akim Demaille <akim@epita.fr>
22196
22197 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
22198 (print_reductions): De-obfuscate using the good o' techniques:
22199 arrays not pointers, variable locality, BITISSET.
22200
222012001-12-05 Akim Demaille <akim@epita.fr>
22202
22203 * src/conflicts.c (print_reductions): Arrays, not pointers.
22204 Use BITISSET.
22205
222062001-12-05 Akim Demaille <akim@epita.fr>
22207
22208 * src/conflicts.c (print_reductions): Pessimize, but clarify.
22209
222102001-12-05 Akim Demaille <akim@epita.fr>
22211
22212 * src/conflicts.c (print_reductions): Improve variable locality.
22213
222142001-12-05 Akim Demaille <akim@epita.fr>
22215
22216 * src/conflicts.c (print_reductions): Pessimize, but clarify.
22217
222182001-12-05 Akim Demaille <akim@epita.fr>
22219
22220 * src/conflicts.c (print_reductions): Improve variable locality.
22221
222222001-12-05 Akim Demaille <akim@epita.fr>
22223
22224 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
22225 * src/lalr.c: Use them.
22226
222272001-12-05 Akim Demaille <akim@epita.fr>
22228
22229 * src/LR0.c (augment_automaton): Formatting changes.
22230 Better variable locality.
22231
222322001-12-05 Akim Demaille <akim@epita.fr>
22233
22234 * src/lalr.c (matrix_print): New.
22235 (transpose): Use it.
22236 Use arrays instead of pointers.
22237
222382001-12-05 Akim Demaille <akim@epita.fr>
22239
22240 * src/lalr.c (maxrhs): Move to...
22241 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
22242 * src/lalr.c (build_relations): Adjust.
22243
222442001-12-05 Akim Demaille <akim@epita.fr>
22245
22246 * src/lalr.c (transpose): Free the memory allocated to the
22247 argument, as it is replaced by the results by the unique caller.
22248 (build_relations): Merely invoke transpose: it handles the memory
22249 deallocation.
22250 Improve variable locality.
22251 Avoid variables used as mere abbreviations.
22252 (compute_lookaheads): Use arrays instead of pointers.
22253
222542001-12-05 Akim Demaille <akim@epita.fr>
22255
22256 * src/lalr.c (initialize_F): Improve variable locality.
22257 Avoid variables used as mere abbreviations.
22258
222592001-12-05 Akim Demaille <akim@epita.fr>
22260
22261 * src/derives.c (print_derives): Display the ruleno.
22262 * src/lalr.c (initialize_F, transpose): Better variable locality
22263 to improve readability.
22264 Avoid variables used as mere abbreviations.
22265
222662001-12-05 Akim Demaille <akim@epita.fr>
22267
22268 * src/lalr.c (traverse): Use arrays instead of pointers.
22269
222702001-12-05 Akim Demaille <akim@epita.fr>
22271
22272 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
22273 the handling of squeue.
22274 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
22275
222762001-12-05 Akim Demaille <akim@epita.fr>
22277
22278 Because useless nonterminals are now kept alive (instead of being
22279 `destroyed'), we now sometimes examine them, and store information
22280 related to them. Hence we need to know their number, and adjust
22281 memory allocations.
22282
22283 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
22284 static.
22285 * src/LR0.c (allocate_itemsets): The memory allocated to
22286 `symbol_count' was used for two different purpose: once to count
22287 the number of occurrences of each symbol, and later reassigned to
22288 `shift_symbol', containing the symbol that can be shifted from a
22289 given state.
22290 Deobfuscate, i.e., allocate, use and free `symbol_count' here
22291 only, and...
22292 (new_itemsets): Allocate `shift_symbol' here.
22293 (allocate_itemsets): symbol_count includes useless nonterminals.
22294 Make room for them.
22295 (free_storage): Use `free', not `XFREE', for pointers that cannot
22296 be null.
22297
222982001-12-05 Akim Demaille <akim@epita.fr>
22299
22300 * src/nullable.c (set_nullable): Deobfuscate the handling of
22301 ritem.
22302 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
22303
223042001-12-05 Akim Demaille <akim@epita.fr>
22305
22306 * src/gram.c, src/gram.h (ritem_print): New.
22307 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
22308 (This useless function was defined only to work around VMS linkers
22309 that can't handle compilation units with variables only).
22310 * src/reduce.c (dump_grammar): Use it to trace the construction of
22311 ritem.
22312
223132001-12-04 Paul Eggert <eggert@twinsun.com>
22314
22315 * src/bison.simple (union yyalloc): Change member names
22316 to be the same as the stack names.
22317 (yyparse): yyptr is now union yyalloc *, not char *.
22318 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
22319 and may generate better code on some machines.
22320 (yystpcpy): Use prototype if __STDC__ is defined, not just
22321 if __cplusplus is defined.
22322
223232001-11-30 Akim Demaille <akim@epita.fr>
22324
22325 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
22326 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
22327 Gettext doesn't compile cleanly, and dies with -Werror.
22328 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
22329 Include WARNING_CFLAGS here.
22330 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
22331 before being defined.
22332
223332001-11-27 Paul Eggert <eggert@twinsun.com>
22334
22335 * lib/quotearg.h (quotearg_n, quotearg_n_style):
22336 First arg is int, not unsigned.
22337 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
22338 (SIZE_MAX, UINT_MAX): New macros.
22339 (quotearg_n_options): Abort if N is negative.
22340 Avoid overflow check on hosts where size_t is 64 bits and int
22341 is 32 bits, as overflow is impossible there.
22342 Fix off-by-one typo that caused unnecessary reallocation.
22343
223442001-11-29 Paul Eggert <eggert@twinsun.com>
22345
22346 Name space cleanup in generated parser.
22347
22348 * doc/bison.texinfo (Bison Parser): Discuss system headers
22349 and their effect on the user name space.
22350
22351 * src/bison.simple:
22352 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
22353 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
22354 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
22355
22356 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
22357 on user names when possible.
22358
22359 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
22360 Simplify test for whather <alloca.h> exists.
22361
22362 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
22363
22364 (<stdio.h>): Include if YYDEBUG.
22365
22366 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
22367 ! defined (yyoverflow) && ! defined (yymemcpy).
22368
22369 (yymemcpy, yyparse): Rename local variables as needed so that
22370 they all begin with 'yy'.
22371
22372 (yystrlen, yystpcpy): New functions.
22373
22374 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
22375 All uses changed.
22376
22377 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
22378 instead of relying on string.h functions. Use YYSTACK_ALLOC
22379 and YYSTACK_FREE instead of malloc and free.
22380
223812001-11-30 Akim Demaille <akim@epita.fr>
22382
22383 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
22384 before their first uses.
22385 (YYBISON, YYPURE): Move to the top of the output.
22386
223872001-11-30 Akim Demaille <akim@epita.fr>
22388
22389 * tests/reduce.at (Useless Nonterminals): Fix.
22390
223912001-11-30 Akim Demaille <akim@epita.fr>
22392
22393 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
22394 if body instead of `;' to pacify GCC's warnings.
22395
223962001-11-30 Akim Demaille <akim@epita.fr>
22397
22398 Instead of mapping the LHS of unused rules to -1, keep the LHS
22399 valid, but flag the rules as invalid.
22400
22401 * src/gram.h (rule_t): `useful' is a new member.
22402 * src/print.c (print_grammar): Adjust.
22403 * src/derives.c (set_derives): Likewise.
22404 * src/reader.c (packgram, reduce_output): Likewise.
22405 * src/reduce.c (reduce_grammar_tables): Likewise.
22406 * tests/reduce.at (Underivable Rules, Useless Rules): New.
22407
224082001-11-30 Akim Demaille <akim@epita.fr>
22409
22410 * src/reduce.c (reduce_output): Formatting changes.
22411 * src/print.c (print_results, print_grammar): Likewise.
22412 * tests/regression.at (Rule Line Numbers)
22413 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
22414
224152001-11-30 Akim Demaille <akim@epita.fr>
22416
22417 * src/reduce.c (nonterminals_reduce): Instead of throwing away
22418 useless nonterminals, move them at the end of the symbol arrays.
22419 (reduce_output): Adjust.
22420 * tests/reduce.at (Useless Nonterminals): Adjust.
22421
224222001-11-30 Akim Demaille <akim@epita.fr>
22423
22424 * src/reduce.c: Various comment/formatting changes.
22425 (nonterminals_reduce): New, extracted from...
22426 (reduce_grammar_tables): here.
22427 (reduce_grammar): Call nonterminals_reduce.
22428
224292001-11-29 Paul Eggert <eggert@twinsun.com>
22430
22431 * src/bison.simple (YYSTACK_REALLOC): Remove.
22432 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
22433 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
22434 New macros.
22435 (union yyalloc): New type.
22436 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
22437 an arbitrary restriction on hosts where size_t is wider than int.
22438
22439 (yyparse): Don't dump core if alloca or malloc fails; instead, report
22440 a parser stack overflow. Allocate just one block of memory for all
22441 three stacks, instead of allocating three blocks; this typically is
22442 faster and reduces fragmentation.
22443
22444 Do not limit the number of items in the stack to a value that fits
22445 in 'int', as this is an arbitrary limit on hosts with 64-bit
22446 size_t and 32-bit int.
22447
224482001-11-29 Marc Autret <autret_m@epita.fr>
22449
22450 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
22451 of defining YYERROR_VERBOSE.
22452 [AT_DATA]: $4 is now out of C declarations in the prologue.
22453
224542001-11-28 Marc Autret <autret_m@epita.fr>
22455
22456 * src/reader.c (parse_dquoted_param): New.
22457 (parse_skel_decl): Use it.
22458 * src/lex.h: Add its prototype.
22459 * src/lex.c (literalchar): Become not static.
22460
224612001-11-28 Marc Autret <autret_m@epita.fr>
22462
22463 * src/output.h: And put its extern declaration here.
22464 * src/output.c (error_verbose): Define here.
22465 (prepare): Echo name modification.
22466 * src/getargs.h: Clean its extern declaration.
22467 * src/getargs.c (error_verbose_flag): Remove.
22468 (getargs): Remove case 'e'.
22469 * src/options.c (option_table): 'error-verbose' is now seen as simple
22470 percent option.
22471 Include output.h.
22472
22473 * src/reader.c (read_declarations): Remove case tok_include.
22474 (parse_include_decl): Remove.
22475 * src/lex.h (token_t): Remove tok_include.
22476 * src/options.c (option_table): 'include' is now a simple command line
22477 option.
22478
224792001-11-28 Marc Autret <autret_m@epita.fr>
22480
22481 * src/bison.simple: Adjust muscle names.
22482 * src/muscle_tab.c (muscle_init): Also rename the muscles.
22483 * src/output.c (prepare): s/_/-/ for the muscles names.
22484 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
22485
224862001-11-28 Marc Autret <autret_m@epita.fr>
22487
22488 * src/bison.simple: Fix debug.
22489 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
22490
224912001-11-28 Akim Demaille <akim@epita.fr>
22492
22493 * src/LR0.c (shifts_new): New.
22494 (save_shifts, insert_start_shift, augment_automaton): Use it.
22495
224962001-11-28 Akim Demaille <akim@epita.fr>
22497
22498 * src/closure.c (closure): `b' and `ruleno' denote the same value:
22499 keep ruleno only.
22500
225012001-11-28 Akim Demaille <akim@epita.fr>
22502
22503 * src/closure.c (closure): Instead of looping over word in array
22504 then bits in words, loop over bits in array.
22505
225062001-11-28 Akim Demaille <akim@epita.fr>
22507
22508 * src/closure.c (closure): No longer optimize the special case
22509 where all the bits of `ruleset[r]' are set to 0, to make the code
22510 clearer.
22511
225122001-11-28 Akim Demaille <akim@epita.fr>
22513
22514 * src/closure.c (closure): `r' and `c' are new variables, used to
22515 de-obfuscate accesses to RULESET and CORE.
22516
225172001-11-28 Akim Demaille <akim@epita.fr>
22518
22519 * src/reduce.c (reduce_print): Use ngettext.
22520 (dump_grammar): Improve the trace accuracy.
22521
225222001-11-28 Akim Demaille <akim@epita.fr>
22523
22524 * src/reduce.c (dump_grammar): Don't translate trace messages.
22525
225262001-11-28 Akim Demaille <akim@epita.fr>
22527
22528 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
22529 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
22530 as all tags are free'ed afterwards.
22531 From Enrico Scholz.
22532
225332001-11-27 Paul Eggert <eggert@twinsun.com>
22534
22535 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
22536 use alloca when we didn't want to, and vice versa.
22537
225382001-11-27 Marc Autret <autret_m@epita.fr>
22539
22540 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
22541 initialization.
22542 * src/output.c (prepare): Remove its update.
22543
225442001-11-27 Marc Autret <autret_m@epita.fr>
22545
22546 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
22547 Use %error-verbose.
22548
225492001-11-27 Marc Autret <autret_m@epita.fr>
22550
22551 * src/bison.simple: Remove YYERROR_VERBOSE using.
22552 Use %%error_verbose.
22553 (yyparse): Likewise.
22554 * src/output.c (prepare): Give its final value.
22555 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
22556 * src/getargs.h: Add its extern declaration.
22557 * src/getargs.c (error_verbose_flag): New int.
22558 (getargs): Update to catch new case.
22559 * src/options.c (option_table): 'error-verbose' is a new option.
22560 (shortopts): Update.
22561
225622001-11-27 Akim Demaille <akim@epita.fr>
22563
22564 * src/system.h: Use intl/libgettext.h.
22565 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
22566
225672001-11-27 Akim Demaille <akim@epita.fr>
22568
22569 * tests/torture.at (Exploding the Stack Size with Malloc):
22570 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
22571
225722001-11-27 Akim Demaille <akim@epita.fr>
22573
22574 * src/files.c: Include error.h.
22575 Reported by Hans Aberg.
22576
225772001-11-26 Marc Autret <autret_m@epita.fr>
22578
22579 * src/reader.c (parse_include_decl): New, not yet implemented.
22580 (read_declarations): Add case tok_include.
22581 * src/getargs.h (include): Add its extern definition.
22582 * src/getargs.c (include): New const char *.
22583 (getargs): Add case '-I'.
22584 * src/options.c (option_table): Add include as command line and
22585 percent option.
22586 * src/lex.h (token_t): Add tok_include.
22587
225882001-11-26 Akim Demaille <akim@epita.fr>
22589
22590 * src/reader.c (readgram): Make sure rules for mid-rule actions
22591 have a lineno equal to that of their host rule.
22592 Reported by Hans Aberg.
22593 * tests/regression.at (Rule Line Numbers): New.
22594
225952001-11-26 Akim Demaille <akim@epita.fr>
22596
22597 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
22598 size_ts.
22599
226002001-11-26 Akim Demaille <akim@epita.fr>
22601
22602 * src/complain.c, src/complain.h (error): Remove, provided by
22603 lib/error.[ch].
22604
226052001-11-26 Akim Demaille <akim@epita.fr>
22606
22607 * src/reader.c (read_declarations): Don't abort on tok_illegal,
22608 issue an error message.
22609 * tests/regression.at (Invalid %directive): New.
22610 Reported by Hans Aberg.
22611
226122001-11-26 Akim Demaille <akim@epita.fr>
22613
22614 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
22615 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
22616
226172001-11-26 Akim Demaille <akim@epita.fr>
22618
22619 * src/conflicts.c (conflicts_print): Don't complain at all when
22620 there are no reduce/reduce conflicts, and as many shift/reduce
22621 conflicts as expected.
22622 * tests/regression.at (%expect right): Adjust.
22623
226242001-11-23 Akim Demaille <akim@epita.fr>
22625
22626 * lib/alloca.c: Update, from fileutils.
22627
226282001-11-23 Akim Demaille <akim@epita.fr>
22629
22630 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
22631
226322001-11-23 Akim Demaille <akim@epita.fr>
22633
22634 * src/system.h: Include alloca.h.
22635 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
22636
226372001-11-23 Akim Demaille <akim@epita.fr>
22638
22639 * src/print_graph.c (print_actions): Remove `rule', unused.
22640 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
22641 pacify GCC's signed < unsigned warnings.
22642 * src/closure.c (itemsetsize): Likewise.
22643 * src/reader.c (symbol_list_new): Static.
22644
226452001-11-23 Akim Demaille <akim@epita.fr>
22646
22647 Attaching lineno to buckets is stupid, since only one copy of each
22648 symbol is kept, only the line of the first occurrence is kept too.
22649
22650 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
22651 * src/reader.c (rline_allocated): Remove, unused.
22652 (symbol_list): Have a `line' member.
22653 (symbol_list_new): New.
22654 (readgram): Use it.
22655 * src/print.c (print_grammar): Output the rule line numbers.
22656 * tests/regression.at (Solved SR Conflicts)
22657 (Unresolved SR Conflicts): Adjust.
22658 Reported by Hans Aberg.
22659
226602001-11-22 Marc Autret <autret_m@epita.fr>
22661
22662 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
22663
226642001-11-22 Marc Autret <autret_m@epita.fr>
22665
22666 * src/muscle_tab.c (muscle_init): Remove initialization of
22667 skeleton muscle.
22668 * src/output.c (output_master_parser): Do it here.
22669
226702001-11-20 Akim Demaille <akim@epita.fr>
22671
22672 * po/sv.po: New.
22673 * configure.in (ALL_LINGUAS): Adjust.
22674 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
22675 longer contains strings to translate.
22676
226772001-11-19 Akim Demaille <akim@epita.fr>
22678
22679 * src/conflicts.c (conflicts_print): Add a missing \n.
22680
226812001-11-19 Akim Demaille <akim@epita.fr>
22682
22683 * src/nullable.c (nullable_print): New.
22684 (set_nullable): Call it when tracing.
22685 Better locality of variables.
22686
226872001-11-19 Akim Demaille <akim@epita.fr>
22688
22689 * src/print.c (print_actions): Better locality of variables.
22690
226912001-11-19 Akim Demaille <akim@epita.fr>
22692
22693 * src/derives.c (print_derives): Fix and enrich.
22694 * src/closure.c (print_fderives): Likewise.
22695
226962001-11-19 Akim Demaille <akim@epita.fr>
22697
22698 * src/closure.c (itemsetend): Remove, replaced with...
22699 (itemsetsize): new.
22700
227012001-11-19 Akim Demaille <akim@epita.fr>
22702
22703 * src/LR0.c (kernel_end): Remove, replaced with...
22704 (kernel_size): new.
22705
227062001-11-19 Akim Demaille <akim@epita.fr>
22707
22708 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
22709 to clarify.
22710
227112001-11-19 Akim Demaille <akim@epita.fr>
22712
22713 * src/closure.c (closure): Use arrays instead of pointers to clarify.
22714
227152001-11-19 Akim Demaille <akim@epita.fr>
22716
22717 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
22718 trace messages.
22719 * src/LR0.c: Likewise.
22720 (allocate_itemsets): Use arrays instead of pointers to clarify.
22721
227222001-11-19 Akim Demaille <akim@epita.fr>
22723
22724 * src/getargs.c (statistics_flag): Replace with...
22725 (trace_flag): New.
22726 (longopts): Accept --trace instead of --statistics.
22727 * src/getargs.h, src/options.c: Adjust.
22728 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
22729 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
22730
227312001-11-19 Akim Demaille <akim@epita.fr>
22732
22733 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
22734 pointers to clarify the code.
22735 (save_reductions, save_shifts): Factor common parts of alternatives.
22736
227372001-11-19 Akim Demaille <akim@epita.fr>
22738
22739 * src/LR0.c (new_state, get_state): Complete TRACE code.
22740 * src/closure.c: Include `reader.h' to get `tags', needed by the
22741 trace code.
22742 Rename the conditional DEBUG as TRACE.
22743 Output consistently TRACEs to stderr, not stdout.
22744 * src/derives.c: Likewise.
22745 * src/reduce.c: (inaccessable_symbols): Using if is better style
22746 than goto.
22747 Use `#if TRACE' instead of `#if 0' for tracing code.
22748
227492001-11-19 Akim Demaille <akim@epita.fr>
22750
22751 * src/system.h (LIST_FREE, shortcpy): New.
22752 * src/LR0.c: Use them.
22753 * src/output.c (free_itemsets, free_reductions, free_shifts):
22754 Remove, replaced by LIST_FREE.
22755
227562001-11-19 Akim Demaille <akim@epita.fr>
22757
22758 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
22759 (REDUCTIONS_ALLOC): New.
22760 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
22761 allocation.
22762
227632001-11-19 Akim Demaille <akim@epita.fr>
22764
22765 * src/LR0.c (new_state): Complete trace code.
22766 * src/nullable.c (set_nullable): Don't translate traces.
22767
227682001-11-19 Akim Demaille <akim@epita.fr>
22769
22770 * src/print_graph.c (print_core): Better locality of variables.
22771 * src/print.c (print_core): Likewise.
22772
227732001-11-19 Akim Demaille <akim@epita.fr>
22774
22775 * src/vcg.c: You do the output, so you are responsible of the
22776 handling of VCG syntax, in particular: use quotearg.
22777 * src/print_graph.c: Don't.
22778 (print_actions): Don't output the actions as part of the nodes,
22779 since that's the job of the edges.
22780 (print_state): Don't output by hand: fill the node description,
22781 and ask for its output.
22782
227832001-11-19 Akim Demaille <akim@epita.fr>
22784
22785 * src/bison.simple (yyparse): When verbosely reporting an error,
22786 no longer put additional quotes around token names.
22787 * tests/calc.at: Adjust.
22788
227892001-11-19 Akim Demaille <akim@epita.fr>
22790
22791 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
22792 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
22793 * src/output.c: Adjust.
22794
227952001-11-19 Akim Demaille <akim@epita.fr>
22796
22797 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
22798 (rule_t): this.
22799 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
22800
228012001-11-19 Akim Demaille <akim@epita.fr>
22802
22803 * src/gram.h (rule_t): New.
22804 (rule_table): New.
22805 (rrhs, rlhs): Remove, part of state_t.
22806 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
22807 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
22808 * src/reader.c, src/reduce.c: Adjust.
22809
228102001-11-19 Akim Demaille <akim@epita.fr>
22811
22812 * src/reader.c (symbols_output): New, extracted from...
22813 (packsymbols): Here.
22814 (reader): Call it.
22815
228162001-11-19 Akim Demaille <akim@epita.fr>
22817
22818 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
22819 (maxrhs): this new function.
22820
228212001-11-19 Akim Demaille <akim@epita.fr>
22822
22823 * src/lalr.c (F): New macro to access the variable F.
22824 Adjust.
22825
228262001-11-19 Akim Demaille <akim@epita.fr>
22827
22828 * src/lalr.h (LA): New macro to access the variable LA.
22829 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22830 * src/lalr.c: Adjust.
22831
228322001-11-19 Akim Demaille <akim@epita.fr>
22833
22834 * src/lalr.c (initialize_LA): Only initialize LA. Let...
22835 (set_state_table): handle the `lookaheads' members.
22836
228372001-11-19 Akim Demaille <akim@epita.fr>
22838
22839 * src/lalr.h (lookaheads): Removed array, whose contents is now
22840 a member of...
22841 (state_t): this structure.
22842 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22843 Adjust.
22844
228452001-11-19 Akim Demaille <akim@epita.fr>
22846
22847 * src/lalr.h (consistent): Removed array, whose contents is now
22848 a member of...
22849 (state_t): this structure.
22850 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22851 Adjust.
22852
228532001-11-19 Akim Demaille <akim@epita.fr>
22854
22855 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
22856 contents are now members of...
22857 (state_t): this structure.
22858 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22859 Adjust.
22860
228612001-11-19 Akim Demaille <akim@epita.fr>
22862
22863 * src/lalr.h (state_t): New.
22864 (state_table): Be a state_t * instead of a core **.
22865 (accessing_symbol): Remove, part of state_t.
22866 * src/lalr.c: Adjust.
22867 (set_accessing_symbol): Merge into...
22868 (set_state_table): this.
22869 * src/print_graph.c, src/conflicts.c: Adjust.
22870
228712001-11-14 Akim Demaille <akim@epita.fr>
22872
22873 * tests/calc.at, tests/output.at, tests/regression.at,
22874 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
22875 now the tests are run in private dirs, therefore AC_CLEANUP and
22876 family can be simplified to 0-ary.
22877 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
22878 use abs. path to find config.h.
22879 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
22880 stderr, there can be way too much random noise.
22881 Instead pass -Werror to GCC and rely on the exit status.
22882 Reported by Wolfram Wagner.
22883
228842001-11-14 Akim Demaille <akim@epita.fr>
22885
22886 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
22887 defined only if yyoverflow is defined, to avoid `warning: unused
22888 variable `yyvs1''.
22889 Reported by The Test Suite.
22890
228912001-11-14 Akim Demaille <akim@epita.fr>
22892
22893 * src/print.c: Include reduce.h.
22894 Reported by Hans Aberg.
22895
228962001-11-14 Akim Demaille <akim@epita.fr>
22897
22898 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
22899 Revert a previous patch: these are really const.
22900 * src/conflicts.c (conflict_report): Additional useless pair of
22901 braces to pacify GCC's warnings for `if () if () {} else {}'.
22902 * src/lex.c (parse_percent_token): Replace equal_offset with
22903 arg_offset.
22904 arg is const.
22905 Be sure to strdup `arg' when used, since there is no reason for
22906 token_buffer not to change.
22907
229082001-11-14 Akim Demaille <akim@epita.fr>
22909
22910 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
22911 definition.
22912 * src/main.c (main): Use them.
22913 Suggested by Hans Aberg.
22914
229152001-11-12 Akim Demaille <akim@epita.fr>
22916
22917 * src/system.h (ngettext): Now that we use ngettext, be sure to
22918 provide a default definition when NLS are not used.
22919
229202001-11-12 Akim Demaille <akim@epita.fr>
22921
22922 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
22923 Use @kbd to denote user input.
22924 (Language and Grammar): ANSIfy the example.
22925 Adjust its layout for info/notinfo.
22926 (Location Tracking Calc): Output error messages to stderr.
22927 Output locations in a more GNUtically correct way.
22928 Fix a couple of Englishos.
22929 Adjust @group/@end group pairs.
22930
229312001-11-12 Akim Demaille <akim@epita.fr>
22932
22933 %expect was not functioning at all.
22934
22935 * src/conflicts.c (expected_conflicts): Set to -1.
22936 (conflict_report): Use ngettext.
22937 (conflicts_print): Check %expect and make its violation an error.
22938 * doc/bison.texinfo (Expect Decl): Adjust.
22939 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
22940 * tests/regression.at (%expect not enough, %expect right)
22941 (%expect too much): New.
22942
229432001-11-12 Akim Demaille <akim@epita.fr>
22944
22945 * tests/regression.at (Conflicts): Rename as...
22946 (Unresolved SR Conflicts): this.
22947 (Solved SR Conflicts): New.
22948
229492001-11-12 Akim Demaille <akim@epita.fr>
22950
22951 * src/reduce.c (print_results): Rename as...
22952 (reduce_output): This.
22953 Output to OUT, passed as argument, instead of output_obstack.
22954 (dump_grammar): Likewise.
22955 (reduce_free): New.
22956 Also free V1.
22957 (reduce_grammar): No longer call reduce_output, since...
22958 * src/print.c (print_results): do it.
22959 * src/main.c (main): Call reduce_free;
22960
229612001-11-12 Akim Demaille <akim@epita.fr>
22962
22963 * src/conflicts.c (print_reductions): Accept OUT as argument.
22964 Output to it, not to output_obstack.
22965 * src/print.c (print_actions): Adjust.
22966
229672001-11-12 Akim Demaille <akim@epita.fr>
22968
22969 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
22970 the result instead of using...
22971 (src_total, rrc_total, src_count, rrc_count): Remove.
22972 (any_conflicts): Remove.
22973 (print_conflicts): Split into...
22974 (conflicts_print, conflicts_output): New.
22975 * src/conflicts.h: Adjust.
22976 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
22977 * src/print.c (print_grammar): Issue `\n' between two rules.
22978 * tests/regression.at (Conflicts): New.
22979 Reported by Tom Lane.
22980
229812001-11-12 Akim Demaille <akim@epita.fr>
22982
22983 * tests/regression.at (Invalid input): Remove, duplicate with
22984 ``Invalid input: 1''.
22985
229862001-11-12 Akim Demaille <akim@epita.fr>
22987
22988 * tests/torture.at (AT_DATA_STACK_TORTURE)
22989 (Exploding the Stack Size with Alloca)
22990 (Exploding the Stack Size with Malloc): New.
22991
229922001-11-12 Akim Demaille <akim@epita.fr>
22993
22994 * src/bison.simple (YYSTACK_REALLOC): New.
22995 (yyparse) [!yyoverflow]: Use it and free the old stack.
22996 Reported by Per Allansson.
22997
229982001-11-12 Pascal Bart <pascal.bart@epita.fr>
22999
23000 * src/bison.simple: Define type yystype instead of YYSTYPE, and
23001 define CPP macro, which substitute YYSTYPE by yystype.
23002 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
23003 with yyltype/YYLTYPE. This allows inclusion of the generated
23004 header within the parser if the compiler, such as GGC, accepts
23005 multiple equivalent #defines.
23006 From Akim.
23007
230082001-11-05 Akim Demaille <akim@epita.fr>
23009
23010 * src/reader.c (symbols_output): New, extracted from...
23011 (packsymbols): here.
23012 (reader): Adjust.
23013
230142001-11-05 Akim Demaille <akim@epita.fr>
23015
23016 * src/lex.c (parse_percent_token): s/quotearg/quote/.
23017
230182001-11-05 Akim Demaille <akim@epita.fr>
23019
23020 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
23021 pattern.
23022
230232001-11-05 Akim Demaille <akim@epita.fr>
23024
23025 * src/options.h (struct option_table_struct): set_flags is void*.
23026 * src/options.c (longopts): Support `--output' and `%output'.
23027 (usage): Adjust.
23028 * src/lex.h (tok_setopt): Remove, replaced with...
23029 (tok_intopt, tok_stropt): these new guys.
23030 * src/lex.c (getopt.h): Not needed.
23031 (token_buffer, unlexed_token_buffer): Not const.
23032 (percent_table): Promote `-' over `_' in directive names.
23033 Active `%name-prefix', `file-prefix', and `output'.
23034 (parse_percent_token): Accept possible arguments to directives.
23035 Promote `-' over `_' in directive names.
23036
230372001-11-04 Akim Demaille <akim@epita.fr>
23038
23039 * doc/bison.texinfo (Decl Summary): Split the list into
23040 `directives for grammars' and `directives for bison'.
23041 Sort'em.
23042 Add description of `%name-prefix', `file-prefix', and `output'.
23043 Promote `-' over `_' in directive names.
23044 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
23045 Simplify the description of `--name-prefix'.
23046 Promote `-' over `_' in directive names.
23047 Promote `--output' over `--output-file'.
23048 Fix the description of `--defines'.
23049 * tests/output.at: Exercise %file-prefix and %output.
23050
230512001-11-02 Akim Demaille <akim@epita.fr>
23052
23053 * doc/refcard.tex: Update.
23054
230552001-11-02 Akim Demaille <akim@epita.fr>
23056
23057 * src/symtab.h (SUNDEF): New.
23058 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
23059 stand for `uninitialized', instead of 0.
23060 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
23061 * src/lex.c (lex): Adjust.
23062
23063 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
23064 Number it 0.
23065 Let yylex return it instead of a plain 0.
23066 Reported by Dick Streefland.
23067
230682001-11-02 Akim Demaille <akim@epita.fr>
23069
23070 * tests/regression.at (Mixing %token styles): New test.
23071
230722001-11-02 Akim Demaille <akim@epita.fr>
23073
23074 * src/reader.c (parse_thong_decl): Formatting changes.
23075 (token_translations_init): New, extracted from...
23076 (packsymbols): Here.
23077 Adjust.
23078
230792001-11-01 Akim Demaille <akim@epita.fr>
23080
23081 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
23082 Check that `9foo.y' produces correct cpp guards.
23083 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
23084 guards.
23085 Reported by Wwp.
23086
230872001-11-01 Akim Demaille <akim@epita.fr>
23088
23089 * tests/regression.at (Invalid input: 2): New.
23090 * src/lex.c (unlexed_token_buffer): New.
23091 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
23092 too.
23093 Reported by Wwp.
23094
230952001-11-01 Akim Demaille <akim@epita.fr>
23096
23097 * tests/calc.at: Catch up with 1.30.
23098 * configure.in: Bump to 1.49a.
23099 Adjust to newer Autotest.
23100
231012001-10-19 Pascal Bart <pascal.bart@epita.fr>
23102
23103 * src/conflicts.c: Move global variables rrc_total and src_total ...
23104 (print_conflicts): here.
23105 * src/output.c (output): Free global variable user_toknums.
23106 * src/lex.c (token_obstack): Become static.
23107
231082001-10-18 Akim Demaille <akim@epita.fr>
23109
23110 * tests/atlocal.in (GCC): Add.
23111 * tests/calc.at: s/m4_match/m4_bmatch/.
23112 s/m4_patsubst/m4_bpatsubst/.
23113 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
23114 * configure.in: AC_SUBST(GCC).
23115
231162001-10-14 Marc Autret <autret_m@epita.fr>
23117
23118 * src/options.c (create_long_option_table): Fix.
23119
231202001-10-10 Akim Demaille <akim@epita.fr>
23121
23122 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
23123
231242001-10-04 Akim Demaille <akim@epita.fr>
23125
23126 * src/reader.c (parse_union_decl): Push the caracters in
23127 union_obstack, not attrs_obstack.
23128
231292001-10-04 Akim Demaille <akim@epita.fr>
23130
23131 Merge in the branch 1.29.
23132
23133 * src/reader.c (packsymbols): Use a temporary obstack for
23134 `%%tokendef', since output_stack is already used elsewhere.
23135
23136 2001-10-02 Akim Demaille <akim@epita.fr>
23137
23138 Bump 1.29d.
23139
23140 2001-10-02 Akim Demaille <akim@epita.fr>
23141
23142 Version 1.29c.
23143
23144 2001-10-02 Akim Demaille <akim@epita.fr>
23145
23146 * tests/regression.at (Invalid CPP headers): New.
23147 From Alexander Belopolsky.
23148 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
23149
23150 2001-10-02 Akim Demaille <akim@epita.fr>
23151
23152 * tests/regression.at (Invalid input): New.
23153 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
23154 Reported by Shura.
23155
23156 2001-10-02 Akim Demaille <akim@epita.fr>
23157
23158 * tests/calc.at: Now that --debug works, the tests must be adjusted.
23159
23160 2001-10-02 Akim Demaille <akim@epita.fr>
23161
23162 * src/output.c (output_parser): Assert `skeleton'.
23163 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
23164 systems.
23165 From Shura.
23166
23167 2001-10-01 Marc Autret <autret_m@epita.fr>
23168
23169 * src/lex.h: Echo modifications.
23170 * src/lex.c (unlex): Parameter is now token_t.
23171 From Hans Aberg.
23172
23173 2001-10-01 Marc Autret <autret_m@epita.fr>
23174
23175 * src/main.c: Include lex.h.
23176 From Hans Aberg.
23177
23178 2001-09-29 Akim Demaille <akim@epita.fr>
23179
23180 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
23181
23182 2001-09-28 Akim Demaille <akim@epita.fr>
23183
23184 * tests/testsuite.at: Update to newer Autotest.
23185 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
23186
23187 2001-09-27 Akim Demaille <akim@epita.fr>
23188
23189 Position independent wrapper.
23190
23191 * tests/bison: Remove.
23192 * tests/bison.in: New.
23193 * configure.in: Adjust.
23194
23195 2001-09-27 Paul Eggert <eggert@twinsun.com>
23196
23197 Port quotearg fixes from tar 1.13.24.
23198
23199 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
23200 tm to be declared.
23201 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
23202 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
23203
23204 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
23205 * m4/mbrtowc.m4: New file.
23206 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
23207 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
23208
23209 2001-09-27 Akim Demaille <akim@epita.fr>
23210
23211 Bump to 1.29c.
23212
23213 2001-09-27 Akim Demaille <akim@epita.fr>
23214
23215 Version 1.29b.
23216
23217 2001-09-25 Akim Demaille <akim@epita.fr>
23218
23219 * src/system.h: Include `xalloc.h'.
23220 Remove it from the C files.
23221 * src/files.c (output_files): Free the obstacks.
23222 * src/lex.c (init_lex): Rename as...
23223 (lex_init): this.
23224 (lex_free): New.
23225 * src/main.c (main): Use it.
23226
23227 2001-09-24 Marc Autret <autret_m@epita.fr>
23228
23229 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
23230 to output informations in fout (FILE*).
23231 (open_graph, close_graph): Likewise.
23232 (output_graph, output_edge, output_node): Likewise.
23233 * src/vcg.h: Update function prototypes.
23234 * src/print_graph.c (print_graph): Open output graph file.
23235 (print_actions): Adjust.
23236 * src/files.h: Remove extern declaration.
23237 * src/files.c: Remove graph_obstack declaration.
23238 (open_files): Remove graph_obstack initialization.
23239 (output_files): Remove graph_obstack saving.
23240
23241 2001-09-24 Marc Autret <autret_m@epita.fr>
23242
23243 * src/files.c (compute_output_file_names): Fix.
23244
23245 2001-09-24 Marc Autret <autret_m@epita.fr>,
23246 Akim Demaille <akim@epita.fr>
23247
23248 * src/reader.c (reader): Remove call to free_symtab ().
23249 * src/main.c (main): Call it here.
23250 Include symtab.h.
23251 * src/conflicts.c (initialize_conflicts): Rename as...
23252 (solve_conflicts): this.
23253 * src/print.c (print_core, print_actions, print_state)
23254 (print_grammar): Dump to a file instead a `output_obstack'.
23255 (print_results): Dump `output_obstack', and then proceed with the
23256 FILE *.
23257 * src/files.c (compute_output_file_names, close_files): New.
23258 (output_files): Adjust.
23259 * src/main.c (main): Adjust.
23260
23261 2001-09-23 Marc Autret <autret_m@epita.fr>
23262
23263 * src/files.c (compute_header_macro): Computes header macro name
23264 from spec_defines_file when given.
23265
23266 2001-09-23 Marc Autret <autret_m@epita.fr>
23267
23268 * src/files.c (output_files): Add default extensions.
23269
23270 2001-09-22 Akim Demaille <akim@epita.fr>
23271
23272 * src/conflicts.c (finalize_conflicts): Rename as...
23273 (free_conflicts): this.
23274
23275 2001-09-22 Akim Demaille <akim@epita.fr>
23276
23277 * src/gram.c (gram_free): Rename back as...
23278 (dummy): this.
23279 (output_token_translations): Free `token_translations'.
23280 * src/symtab.c (free_symtab): Free the tag field.
23281
23282 2001-09-22 Akim Demaille <akim@epita.fr>
23283
23284 Remove `translations' as it is always set to true.
23285
23286 * src/gram.h: Adjust.
23287 * src/reader.c (packsymbols, parse_token_decl): Adjust
23288 * src/print.c (print_grammar): Adjust.
23289 * src/output.c (output_token_translations): Adjust.
23290 * src/lex.c (lex): Adjust.
23291 * src/gram.c: Be sure the set pointers to NULL.
23292 (dummy): Rename as...
23293 (gram_free): this.
23294
23295 2001-09-22 Akim Demaille <akim@epita.fr>
23296
23297 * configure.in: Invoke AM_LIB_DMALLOC.
23298 * src/system.h: Use dmalloc.
23299 * src/LR0.c: Be sure to have pointers initialized to NULL.
23300 (allocate_itemsets): Allocate kernel_items only if needed.
23301
23302 2001-09-22 Akim Demaille <akim@epita.fr>
23303
23304 * configure.in: Bump to 1.29b.
23305 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
23306 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
23307 need xmalloc.c in calc.y.
23308 From Pascal Bart.
23309
23310 2001-09-21 Akim Demaille <akim@epita.fr>
23311
23312 Version 1.29a.
23313 * Makefile.maint, config/config.guess, config/config.sub,
23314 * config/missing: Update from masters.
23315 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
23316 upon package.m4.
23317 * configure.in (ALL_LINGUAS): Add `tr'.
23318
23319 2001-09-21 Akim Demaille <akim@epita.fr>
23320
23321 * tests/Makefile.am (package.m4): Move to...
23322 ($(srcdir)/$(TESTSUITE)): here.
23323
23324 2001-09-20 Akim Demaille <akim@epita.fr>
23325
23326 * src/complain.c: No longer try to be standalone: use system.h.
23327 Don't assume __STDC__ is defined to 1. Just test if it is defined.
23328 * src/complain.h: Likewise.
23329 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
23330 Remove the unused variable `n'.
23331 From Albert Chin-A-Young.
23332
23333 2001-09-18 Marc Autret <autret_m@epita.fr>
23334
23335 * doc/bison.1: Update.
23336 * doc/bison.texinfo (Bison Options): Update --defines and --graph
23337 descriptions.
23338 (Option Cross Key): Update.
23339 Add --graph.
23340
23341 2001-09-18 Marc Autret <autret_m@epita.fr>
23342
23343 * tests/regression.at: New test (comment in %union).
23344
23345 2001-09-18 Marc Autret <autret_m@epita.fr>
23346
23347 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
23348 do that.
23349 Reported by Keith Browne.
23350
23351 2001-09-18 Marc Autret <autret_m@epita.fr>
23352
23353 * tests/output.at: Add tests for --defines and --graph.
23354
23355 2001-09-18 Marc Autret <autret_m@epita.fr>
23356
23357 * tests/output.at: Removes tests of %{header,src}_extension features.
23358
23359 2001-09-18 Akim Demaille <akim@epita.fr>
23360
23361 * tests/Makefile.am (package.m4): New.
23362 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
23363 (_AT_CHECK_CALC_ERROR): Likewise.
23364 Factor the `, ' part of verbose error messages.
23365
23366 2001-09-18 Marc Autret <autret_m@epita.fr>
23367
23368 * src/getargs.c (longopts): Declare --defines and --graph as options
23369 with optional arguments.
23370 * src/files.h: Add extern declarations.
23371 * src/files.c (spec_graph_file, spec_defines_file): New.
23372 (output_files): Update.
23373 Remove CPP-outed code.
23374
23375 2001-09-18 Marc Autret <autret_m@epita.fr>
23376
23377 Turn off %{source,header}_extension feature.
23378
23379 * src/files.c (compute_exts_from_gf): Update.
23380 (compute_exts_from_src): Update.
23381 (output_files): CPP-out useless code.
23382 * src/files.h: Remove {header,source}_extension extern declarations.
23383 * src/reader.c (parse_dquoted_param): CPP-out.
23384 (parse_header_extension_decl): Remove.
23385 (parse_source_extension_decl): Remove.
23386 (read_declarations): Remove cases tok_{hdrext,srcext}.
23387 * src/lex.c (percent_table): Remove {header,source}_extension entries.
23388 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
23389
23390 2001-09-10 Akim Demaille <akim@epita.fr>
23391
23392 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
23393 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
23394 (AT_CHECK_OUTPUT): this.
23395 Merely check ls' exit status, its output is useless.
23396
23397 2001-09-10 Akim Demaille <akim@epita.fr>
23398
23399 * tests/calc.at: Use m4_match.
23400 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
23401
23402 2001-09-10 Marc Autret <autret_m@epita.fr>,
23403 Akim Demaille <akim@epita.fr>
23404
23405 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
23406 enum color_e.
23407 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
23408 to `normal'.
23409 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
23410 * src/lex.h: Adjust prototype.
23411 (token_t): Add `tok_undef'.
23412 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
23413 (parse_percent_token): Now returns token_t.
23414 Add default statement in switch.
23415 (lex): Separate `c' as an input variable, from the token_t result
23416 part.
23417 (unlexed): Is a token_t.
23418
23419 2001-09-10 Akim Demaille <akim@epita.fr>
23420
23421 * configure.in: Bump to 1.29a.
23422
23423 2001-09-07 Akim Demaille <akim@epita.fr>
23424
23425 Version 1.29.
23426
23427 2001-08-30 Akim Demaille <akim@epita.fr>
23428
23429 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
23430 * m4/atconfig.m4: Remove.
23431 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
23432 * tests/bison: New.
23433 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
23434 m4_if, m4_patsubst, and m4_regexp.
23435 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
23436 `input' file instead of echo.
23437
23438 2001-08-29 Akim Demaille <akim@epita.fr>
23439
23440 Bump to 1.28e.
23441
23442 2001-08-29 Akim Demaille <akim@epita.fr>
23443
23444 Version 1.28d.
23445
23446 2001-08-29 Paul Eggert <eggert@twinsun.com>
23447
23448 * src/bison.simple (yyparse): Don't take the address of an
23449 item before the start of an array, as that doesn't conform to
23450 the C Standard.
23451
23452 2001-08-29 Robert Anisko <anisko_r@epita.fr>
23453
23454 * doc/bison.texinfo (Location Tracking Calc): New node.
23455
23456 2001-08-29 Paul Eggert <eggert@twinsun.com>
23457
23458 * src/output.c (output): Do not define const, as this now
23459 causes more problems than it cures.
23460
23461 2001-08-29 Akim Demaille <akim@epita.fr>
23462
23463 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
23464 the nodes.
23465 Be sure to tag the `detailmenu'.
23466
23467 2001-08-29 Akim Demaille <akim@epita.fr>
23468
23469 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
23470 download in a tmp dir.
23471
23472 2001-08-28 Marc Autret <autret_m@epita.fr>
23473
23474 * config/depcomp: New file.
23475
23476 2001-08-28 Marc Autret <autret_m@epita.fr>
23477
23478 * doc/bison.1 (mandoc): Adjust.
23479 From Juan Manuel Guerrero.
23480
23481 2001-08-28 Marc Autret <autret_m@epita.fr>
23482
23483 * src/print_graph.c (print_state): Fix.
23484
23485 2001-08-27 Marc Autret <autret_m@epita.fr>
23486
23487 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
23488 char * members.
23489 Echo modifications to the functions prototypes.
23490 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
23491
23492 2001-08-27 Marc Autret <autret_m@epita.fr>
23493
23494 * src/vcg.c: Include `xalloc.h'.
23495 (add_colorentry): New.
23496 (add_classname): New.
23497 (add_infoname): New.
23498 * src/vcg.h: Add new prototypes.
23499
23500 2001-08-27 Akim Demaille <akim@epita.fr>
23501
23502 * Makefile.maint: Sync. again with CVS Autoconf.
23503
23504 2001-08-27 Akim Demaille <akim@epita.fr>
23505
23506 * Makefile.maint: Formatting changes.
23507 (po-update, cvs-update, update): New targets.
23508 (AMTAR): Remove.
23509
23510 2001-08-27 Akim Demaille <akim@epita.fr>
23511
23512 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
23513 * Makefile.maint: Sync. with CVS Autoconf.
23514
23515 2001-08-27 Marc Autret <autret_m@epita.fr>
23516
23517 * src/vcg.h (struct infoname_s): New.
23518 (struct colorentry_s): New.
23519 (graph_s): New fields {vertical,horizontal}_order in structure.
23520 Add `infoname' field.
23521 Add `colorentry' field;
23522 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
23523 (G_HORIZONTAL_ORDER): New.
23524 (G_INFONAME): New.
23525 (G_COLORENTRY): New.
23526 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
23527 Add output of `infoname'.
23528 Add output of `colorentry'.
23529
23530 2001-08-27 Marc Autret <autret_m@epita.fr>
23531
23532 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
23533 This one shadowed a global parameter.
23534
23535 2001-08-24 Marc Autret <autret_m@epita.fr>
23536
23537 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
23538 instead of `unsigned'.
23539 (print_state): Do not call obstack_object_size () in obstack_grow ()
23540 to avoid macro variables shadowing.
23541
23542 2001-08-23 Marc Autret <autret_m@epita.fr>
23543
23544 * src/lex.c (percent_table): Typo: s/naem/name/.
23545 Add graph option.
23546 Normalize new options declarations.
23547
23548 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
23549
23550 * tests/suite.at: Exercise %header_extension and %source_extension.
23551
23552 2001-08-16 Marc Autret <autret_m@epita.fr>
23553
23554 * src/reader.c (parse_dquoted_param): New.
23555 (parse_header_extension_decl): Use it.
23556 (parse_source_extension_decl): Likewise.
23557
23558 2001-08-16 Marc Autret <autret_m@epita.fr>
23559
23560 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
23561 (get_xxxx_str): Use assert () instead of complain ().
23562 Remove return invokations in default cases.
23563 (get_decision_str): Modify default behaviour. Remove second argument.
23564 Echo modifications on calls.
23565 (output_graph): Fix.
23566
23567 2001-08-16 Marc Autret <autret_m@epita.fr>
23568
23569 * src/getargs.c (usage): Update with ``-g, --graph''.
23570
23571 2001-08-16 Marc Autret <autret_m@epita.fr>
23572
23573 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
23574 (Option Cross Key): Likewise.
23575 * doc/bison.1: Update.
23576
235772001-09-25 Pascal Bart <pascal.bart@epita.fr>
23578
23579 * src/output.c (output_master_parser): Don't finish action_obstack.
23580 (output_parser): Don't care about the muscle action, here.
23581 (prepare): Copy the action_obstack in the action muscle.
23582 (output): Free action_obstack.
23583
235842001-09-23 Pascal Bart <pascal.bart@epita.fr>
23585
23586 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
23587 will contain `%union' declaration.
23588 (parse_union_decl): Delete #line directive output.
23589 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
23590 informations about %union.
23591 (parse_union_decl): Copy the union_obstack in the muscle stype.
23592 * src/bison.simple: Add new #line directive.
23593 Add typdef %%stype YYSTYPE.
23594
235952001-09-23 Pascal Bart <pascal.bart@epita.fr>
23596
23597 * src/bison.simple: Add new `#line' directive.
23598
235992001-09-22 Pascal Bart <pascal.bart@epita.fr>
23600
23601 * src/bison.simple: New `#line' directive.
23602 * src/output.c (output_parser): Support new dynamic muscle input_line.
23603
236042001-09-22 Marc Autret <autret_m@epita.fr>
23605
23606 * src/output.c (output_master_parser): New.
23607 (output_parser): Be more re-entrant.
23608
236092001-09-21 Marc Autret <autret_m@epita.fr>
23610
23611 * src/reader.c (copy_definition, parse_union_decl): Update and use
23612 `linef' muscle.
23613 (copy_action): Likewise.
23614 Use obstack_1grow ().
23615 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
23616
236172001-09-21 Marc Autret <autret_m@epita.fr>
23618
23619 * src/options.c (option_table): Adjust.
23620 * src/lex.c (parse_percent_token): Fix.
23621
236222001-09-20 Pascal Bart <pascal.bart@epita.fr>
23623
23624 * src/options.c (symtab.h): Include it, need by lex.h.
23625
236262001-09-20 Pascal Bart <pascal.bart@epita.fr>
23627
23628 * src/lex.c (parse_percent_token): Change type of variable `tx', which
23629 is now an option_table_struct*.
23630 (option_strcmp): New function option_strcmp.
23631 (parse_percent_token): Call option_strcmp.
23632 * src/getargs.c (xalloc.h, options.h): Include it.
23633 (getargs): Call create_long_option_table.
23634 (getargs): Free longopts at the end of the function.
23635 (shortopts): Move in options.c.
23636 * src/options.c (create_long_option_table): New function. Convert
23637 information from option_table to option structure.
23638 * src/reader.c (options.h): Include it.
23639
23640 * src/Makefile.am: Adjust.
23641 * src/options.c (option_table): Create from longopts and percent_table.
23642 * src/getargs.c (longopts): Delete.
23643 * src/lex.c (struct percent_table_struct): Delete.
23644 (percent_table): Delete.
23645 (options.h): Include it.
23646 * src/options.c: Create.
23647 * src/options.h: Create.
23648 Declare enum opt_access_e.
23649 Define struct option_table_struct.
23650
236512001-09-20 Marc Autret <autret_m@epita.fr>
23652
23653 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
23654 sections of Bison.
23655
236562001-09-19 Pascal Bart <pascal.bart@epita.fr>
23657
23658 * src/bison.simple: s/%%filename/%%skeleton.
23659 * src/muscle_tab.c (getargs.h): Include it.
23660 (muscle_init): Insert new muscle skeleton.
23661
236622001-09-18 Pascal Bart <pascal.bart@epita.fr>
23663
23664 * src/output.c (output_parser): Delete unused variable actions_dumped.
23665
236662001-09-07 Pascal Bart <pascal.bart@epita.fr>
23667
23668 * src/output.c (output): Delete call to reader_output_yylsp.
23669 * src/reader.c (reader): Likewise.
23670 * src/reader.h: Delete declaration of reader_output_yylsp.
23671
236722001-09-02 Marc Autret <autret_m@epita.fr>
23673
23674 * src/reader.c: Include muscle_tab.h.
23675 (parse_union_decl): Update.
23676 (parse_macro_decl): Rename parse_muscle_decl.
23677 Update to use renamed functions and variable.
23678 (read_declarations, copy_action, read_additionnal_code, : Updated
23679 with correct variables and functions names.
23680 (packsymbols, reader): Likewise.
23681
23682 * src/reader.h (muscle_obstack): Extern declaration update.
23683
23684 * src/output.c: Include muscle_tab.h
23685 In all functions using macro_insert, change by using muscle_insert ().
23686 (macro_obstack): Rename muscle_obstack.
23687 Echo modifications in the whole file.
23688 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
23689 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
23690 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
23691
23692 * src/muscle_tab.h: Update double inclusion macros.
23693 (macro_entry_s): Rename muscle_entry_s.
23694 Update prototypes.
23695
23696 * src/muscle_tab.c: Include muscle_tab.h.
23697 Rename macro_tabble to muscle_table.
23698 (mhash1, mhash2, mcmp): Use muscle_entry.
23699 (macro_init): Rename muscle_init. Update.
23700 (macro_insert): Rename muscle_insert. Update.
23701 (macro_find): Rename muscle_find. Update.
23702
23703 * src/main.c: Include muscle_tab.h.
23704 (main): Call muscle_init ().
23705 * src/Makefile.am (bison_SOURCES): Echo modifications.
23706
237072001-09-02 Marc Autret <autret_m@epita.fr>
23708
23709 Now the files macro_tab.[ch] are named muscle_tab.[ch].
23710
23711 * src/muscle_tab.c, src/muscle_tab.h: Add files.
23712
237132001-09-02 Marc Autret <autret_m@epita.fr>
23714
23715 * src/macrotab.c, src/macrotab.h: Remove.
23716
237172001-09-01 Pascal Bart <pascal.bart@epita.fr>
23718
23719 * src/reader.c (copy_guard): Use muscle to specify the `#line'
23720 filename.
23721
237222001-09-01 Marc Autret <autret_m@epita.fr>
23723
23724 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
23725 to an explicit value to activate the feature. We do it here.
23726
237272001-08-31 Pascal Bart <pascal.bart@epita.fr>
23728
23729 * src/output.c (prepare): Delete the `filename' muscule insertion.
23730 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
23731 (parse_union_decl): Likewise.
23732 * src/macrotab.c (macro_init): Initialize filename by infile.
23733
237342001-08-31 Marc Autret <autret_m@epita.fr>
23735
23736 * src/bison.simple (YYLSP_NEEDED): New definition.
23737 * src/output.c (prepare): Add macro insertion of `locations_flag'
23738
237392001-08-31 Pascal Bart <pascal.bart@epita.fr>
23740
23741 * src/output.c (prepare): Delete insertion of previous muscles,
23742 and insert the `prefix' muscles.
23743 * src/macrotab.c (macro_init): Likewise.
23744 (macro_init): Initialization prefix directive by `yy'.
23745 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
23746 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
23747 yylval, yydebug, yyerror, yynerrs and yyparse.
23748 New directive `#define' to substitute yydebug, ... with option
23749 name_prefix.
23750
237512001-08-31 Pascal Bart <pascal.bart@epita.fr>
23752
23753 * src/main.c (main): Standardize.
23754 * src/output.c (output_table_data, output_parser): Likewise.
23755 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
23756
237572001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
23758
23759 * src/reader.c (read_additionnal_code): Rename %%user_code to
23760 %%epilogue.
23761 * src/output.c (output): Rename %%declarations to %%prologue.
23762 * src/bison.simple: Echo modifications.
23763
237642001-08-31 Marc Autret <autret_m@epita.fr>
23765
23766 * src/reader.c (readgram): CleanUp.
23767 (output_token_defines): Likewise.
23768 (packsymbols): Likewise.
23769 (reader): Likewise.
23770 * src/output.c (output): CPP-out useless code.
23771
237722001-08-31 Pascal Bart <pascal.bart@epita.fr>
23773
23774 * src/reader.c (reader): Delete obsolete call to function
23775 output_trailers and output_headers.
23776 * src/output.h: Remove obsolete functions prototypes of output_headers
23777 and output_trailers.
23778
237792001-08-30 Pascal Bart <pascal.bart@epita.fr>
23780
23781 * src/main.c: Include macrotab.h.
23782 * src/macrotab.h (macro_entry_s): Constify fields.
23783 Adjust functions prototypes.
23784 * src/macrotab.c (macro_insert): Constify key and value.
23785 (macro_find): Constify key.
23786 (macro_insert): Include 'xalloc.h'
23787 (macro_insert): Use XMALLOC.
23788 (macro_find): Constify return value.
23789 * src/output.c (output_table_data): Rename table to table_data.
23790 (output_parser): Constify macro_key, macro_value.
23791
237922001-08-30 Marc Autret <autret_m@epita.fr>
23793
23794 * src/reader.c (parse_skel_decl): New.
23795 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
23796 * src/lex.h (token_t): New token `tok_skel'.
23797 * src/lex.c (percent_table): Add skeleton option entry.
23798 Standardize.
23799
238002001-08-29 Marc Autret <autret_m@epita.fr>
23801
23802 * src/bison.simple: Add %%user_code directive at the end.
23803 * src/reader.c (read_additionnal_code): New.
23804 (reader): Use it.
23805 * src/output.c (output_program): Remove.
23806 (output): Update.
23807
238082001-08-28 Marc Autret <autret_m@epita.fr>
23809
23810 * src/output.c (output_actions): Clean up.
23811 (output_gram): CPP-out useless code.
23812 * src/reader.c (reader): Clean up, CPP-out useless code.
23813
238142001-08-28 Pascal Bart <pascal.bart@epita.fr>
23815
23816 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
23817 directive.
23818 * src/bison.simple: Add `%%definitions'.
23819
238202001-08-28 Marc Autret <autret_m@epita.fr>
23821
23822 * config/depcomp: New file.
23823
238242001-08-27 Paul Eggert <eggert@twinsun.com>
23825
23826 * src/bison.simple (yyparse): Don't take the address of an
23827 item before the start of an array, as that doesn't conform to
23828 the C Standard.
23829
238302001-08-27 Robert Anisko <robert.anisko@epita.fr>
23831
23832 * src/output.c (output): Remove the initialization of the macro
23833 obstack. It was done too late here.
23834
23835 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
23836 completely wrong.
23837 (reader): Initialize the macro obstack here, since we need it to grow
23838 '%define' directives.
23839
23840 * src/reader.h: Declare the macro obstack as extern.
23841
238422001-08-27 Robert Anisko <robert.anisko@epita.fr>
23843
23844 * src/output.c (output_parser): Fix. Store single '%' characters in
23845 the output obstack instead of throwing them away.
23846
238472001-08-27 Akim Demaille <akim@epita.fr>
23848
23849 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
23850
238512001-08-25 Robert Anisko <robert.anisko@epita.fr>
23852
23853 * lib/Makefile.am: Adjust.
23854
238552001-08-25 Robert Anisko <robert.anisko@epita.fr>
23856
23857 * src/bison.simple: Update and add '%%' directives.
23858
238592001-08-25 Robert Anisko <robert.anisko@epita.fr>
23860
23861 * src/reader.c (reader): Remove calls to 'output_headers' and
23862 'output_trailers'. Remove some C output.
23863 (readgram): Disable a piece of code that was writing a default
23864 definition for 'YYSTYPE'.
23865 (reader_output_yylsp): Remove.
23866 (packsymbols): Output token defintions to a macro.
23867 (copy_definition): Disable C output.
23868
23869 * src/reader.c (parse_macro_decl): New function used to parse macro
23870 declarations.
23871 (copy_string2): Put the body of copy_string into this new function.
23872 Add a parameter to let the caller choose whether he wants to copy the
23873 string delimiters or not.
23874 (copy_string): Be a simple call to copy_string2 with the last argument
23875 bound to true.
23876 (read_declarations): Add case for macro definition.
23877 (copy_identifier): New.
23878 (parse_macro_decl): Read macro identifiers using copy_identifier
23879 rather than lex.
23880
238812001-08-25 Robert Anisko <robert.anisko@epita.fr>
23882
23883 * src/output.c (prepare): Add prefixed names.
23884 (output_parser): Output semantic actions.
23885 (output_parser): Fix bug on '%%line' directives.
23886
23887 * src/output.c (output_headers): Remove. The C code printed by this
23888 function should now be in the skeletons.
23889 (output_trailers): Remove.
23890 (output): Disable call to 'reader_output_yylsp'.
23891 (output_rule_data): Do not output tables to the table obstack.
23892
23893 * src/output.c: Remove some C dedicated output.
23894 Improve the use of macro and output obstacks.
23895 (output_defines): Remove.
23896
23897 * src/output.c (output_token_translations): Associate 'translate'
23898 table with a macro. No output to the table obstack.
23899 (output_gram): Same for 'rhs' and 'prhs'.
23900 (output_stos): Same for 'stos'.
23901 (output_rule_data): Same for 'r1' and 'r2'.
23902 (token_actions): Same for 'defact'.
23903 (goto_actions): Same for 'defgoto'.
23904 (output_base): Same for 'pact' and 'pgoto'.
23905 (output_table): Same for 'table'.
23906 (output_check): Same for 'check'.
23907
23908 * src/output.c (output_table_data): New function.
23909 (output_short_table): Remove.
23910 (output_short_or_char_table): Remove.
23911
23912 * src/output.c (output_parser): Replace most of the skeleton copy code
23913 with something new. Skeletons are now processed character by character
23914 rather than line by line, and Bison looks for '%%' macros. This is the
23915 first step in making Bison's output process (a lot) more flexible.
23916 (output_parser): Use the macro table.
23917
239182001-08-25 Robert Anisko <robert.anisko@epita.fr>
23919
23920 * src/main.c (main): Initialize the macro table.
23921
239222001-08-25 Robert Anisko <robert.anisko@epita.fr>
23923
23924 * src/lex.c (percent_table): Add tok_define.
23925 * src/lex.h: Add tok_define.
23926
239272001-08-25 Robert Anisko <robert.anisko@epita.fr>
23928
23929 * src/macrotab.c: New file.
23930 * src/macrotab.h: New file.
23931 * src/Makefile.am: Update.
23932
239332001-08-25 Robert Anisko <robert.anisko@epita.fr>
23934
23935 * lib/hash.c: New file.
23936 * lib/hash.h: New file.
23937 * lib/Makefile.am: Update.
23938
239392001-08-15 Akim Demaille <akim@epita.fr>
23940
23941 Version 1.28c.
23942
239432001-08-15 Marc Autret <autret_m@epita.fr>
23944
23945 * src/reader.c (readgram): Indent output macro YYSTYPE.
23946 (packsymbols): Likewise.
23947 (output_token_defines): Likewise.
23948 * src/files.c: Standardize.
23949 (compute_header_macro): New.
23950 (defines_obstack_save): New. Use compute_header_macro.
23951 (output_files): Update. Use defines_obstack_save.
23952
239532001-08-15 Akim Demaille <akim@epita.fr>
23954
23955 * doc/bison.texinfo (Table of Symbols): Document
23956 YYSTACK_USE_ALLOCA.
23957
239582001-08-15 Akim Demaille <akim@epita.fr>
23959
23960 * missing: Update from CVS Automake.
23961 * config/config.guess, config/config.sub, config/texinfo.tex:
23962 Update from gnu.org.
23963
239642001-08-15 Akim Demaille <akim@epita.fr>
23965
23966 * Makefile.maint: Sync with CVS Autoconf.
23967
239682001-08-14 Pascal Bart <pascal.bart@epita.fr>
23969
23970 * doc/bison.texinfo: Include GNU Free Documentation License from
23971 `fdl.texi'.
23972 * doc/fdl.texi: Add to package.
23973
239742001-08-14 Marc Autret <autret_m@epita.fr>
23975
23976 Turn on %{source,header}_extension features.
23977
23978 * src/lex.c (percent_table): Un-CPP out header_extension and
23979 source_extension.
23980 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
23981 (compute_exts_from_src): Remove conditions. It restores priorities
23982 between options.
23983
239842001-08-14 Marc Autret <autret_m@epita.fr>
23985
23986 * src/files.c (compute_base_names): Add extensions computing when
23987 `--file-prefix' used.
23988 Standardize function calls.
23989
239902001-08-13 Marc Autret <autret_m@epita.fr>
23991
23992 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
23993 defining it (defined but null disables alloca).
23994
239952001-08-13 Marc Autret <autret_m@epita.fr>
23996
23997 * src/bison.simple (_yy_memcpy): CPP reformat.
23998
239992001-08-13 Pascal Bart <pascal.bart@epita.fr>
24000
24001 * tests/atconfig.in (CPPFLAGS): Fix.
24002
240032001-08-10 Pascal Bart <pascal.bart@epita.fr>
24004
24005 * doc/bison.texinfo: Include GNU General Public License from
24006 `gpl.texi'.
24007 * doc/gpl.texi: Add to package.
24008
240092001-08-10 Marc Autret <autret_m@epita.fr>
24010
24011 * src/print_graph.h: Fix.
24012 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
24013
240142001-08-10 Akim Demaille <akim@epita.fr>
24015
24016 * src/system.h: Provide default declarations for stpcpy, strndup,
24017 and strnlen.
24018
240192001-08-10 Robert Anisko <anisko_r@epita.fr>
24020
24021 * doc/bison.texinfo (Locations): Update @$ stuff.
24022
240232001-08-09 Robert Anisko <anisko_r@epita.fr>
24024
24025 * src/bison.simple (YYLLOC_DEFAULT): Update.
24026 (yyparse): Adjust.
24027
240282001-08-08 Marc Autret <autret_m@epita.fr>
24029
24030 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
24031 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
24032 Reported by Fabrice Bauzac.
24033
240342001-08-08 Marc Autret <autret_m@epita.fr>
24035
24036 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
24037 * src/vcg.c (output_node): Fix.
24038 * src/vcg.h: Cleanup.
24039 * src/print_graph.c: Add comments.
24040 (node_output_size): New global variable. Simplify the formatting of
24041 the VCG graph output.
24042 (print_actions): Unused code is now used. It notifies the final state
24043 and no action states in the VCG graph. It also give the reduce actions.
24044 The `shift and goto' edges are red and the `go to state' edges are
24045 blue.
24046 Get the current node name and node_obstack by argument.
24047 (node_obstack): New variable.
24048 (print_state): Manage node_obstack.
24049 (print_core): Use node_obstack given by argument.
24050 A node is not only computed here but in print_actions also.
24051 (print_graph): CPP out useless code instead of commenting it.
24052
240532001-08-07 Pascal Bart <pascal.bart@epita.fr>
24054
24055 * tests/atconfig.in (CPPFLAGS): Fix.
24056
240572001-08-07 Akim Demaille <akim@epita.fr>
24058
24059 * src/print_graph.c (quote): New.
24060 (print_core): Use it.
24061
240622001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
24063
24064 * src/vcg.c (complain.h): Include it.
24065 Unepitaize `return' invocations.
24066 [NDEBUG] (main): Remove.
24067 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
24068 * src/files.c (open_files): Initialize graph_obstack.
24069 * src/print_graph.c (print_actions): CPP out useless code.
24070 (print_core): Don't output the last `\n' in labels.
24071 Use `quote'.
24072 * src/files.c (output_files): Output the VCG file.
24073 * src/main.c (main): Invoke print_graph ();
24074
240752001-08-06 Marc Autret <autret_m@epita.fr>
24076
24077 Automaton VCG graph output.
24078 Using option ``-g'' or long option ``--graph'', you can generate
24079 a gram_filename.vcg file containing a VCG description of the LALR (1)
24080 automaton of your grammar.
24081
24082 * src/main.c: Call to print_graph() function.
24083 * src/getargs.h: Update.
24084 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
24085 (graph_flag): New flag.
24086 (longopts): Update.
24087 (getargs): Add case `g'.
24088 * src/files.c (graph_obstack): New obstack struct.
24089 (open_files): Initialize new obstack.
24090 (output_files): Saves graph_obstack if required.
24091 * src/files.h (graph_obstack): New extern declaration.
24092 * src/Makefile.am: Add new source files.
24093
240942001-08-06 Marc Autret <autret_m@epita.fr>
24095
24096 * src/print_graph.c, src/print_graph.h (graph): New.
24097 * src/vcg.h: New file.
24098 * src/vcg.c: New file, VCG graph handling.
24099
241002001-08-06 Marc Autret <autret_m@epita.fr>
24101
24102 Add of %source_extension and %header_extension which specify
24103 the source or/and the header output file extension.
24104
24105 * src/files.c (compute_base_names): Remove initialisation of
24106 src_extension and header_extension.
24107 (compute_exts_from_gf): Update.
24108 (compute_exts_from_src): Update.
24109 (output_files): Update.
24110 * src/reader.c (parse_header_extension_decl): New.
24111 (parse_source_extension_decl): New.
24112 (read_declarations): New case statements for the new tokens.
24113 * src/lex.c (percent_table): Add entries for %source_extension
24114 and %header_extension.
24115 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
24116
241172001-08-06 Marc Autret <autret_m@epita.fr>
24118
24119 * configure.in: Bump to 1.28c.
24120 * doc/bison.texinfo: Texinfo thingies.
24121
241222001-08-04 Pascal Bart <pascal.bart@epita.fr>
24123
24124 * tests/atconfig.in (CPPFLAGS): Add.
24125 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
24126
241272001-08-03 Akim Demaille <akim@epita.fr>
24128
24129 Version 1.28b.
24130
241312001-08-03 Akim Demaille <akim@epita.fr>
24132
24133 * tests/Makefile.am (check-local): Ship testsuite.
24134 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
24135 Include `string.h'.
24136
241372001-08-03 Akim Demaille <akim@epita.fr>
24138
24139 * configure.in: Try using -Wformat when compiling.
24140
241412001-08-03 Akim Demaille <akim@epita.fr>
24142
24143 * configure.in: Bump to 1.28b.
24144
241452001-08-03 Akim Demaille <akim@epita.fr>
24146
24147 * src/complain.c: Adjust strerror_r portability issues.
24148
241492001-08-03 Akim Demaille <akim@epita.fr>
24150
24151 Version 1.28a.
24152
241532001-08-03 Akim Demaille <akim@epita.fr>
24154
24155 * src/getargs.c, src/getarg.h (skeleton)): Constify.
24156 * src/lex.c (literalchar): Avoid name clashes on `buf'.
24157 * src/getargs.c: Include complain.h.
24158 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
24159 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
24160
241612001-08-03 Akim Demaille <akim@epita.fr>
24162
24163 * src/reader.c (readgram): Display hidden chars in error messages.
24164
241652001-08-03 Akim Demaille <akim@epita.fr>
24166
24167 Update to gettext 0.10.39.
24168
241692001-08-03 Akim Demaille <akim@epita.fr>
24170
24171 * lib/strspn.c: New.
24172
241732001-08-01 Marc Autret <autret_m@epita.fr>
24174
24175 * doc/bison.texinfo: Update.
24176 * doc/bison.1 (mandoc): Update.
24177 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
24178 * src/files.c: Support output files extensions computing.
24179 (src_extension): New static variable.
24180 (header_extension): New static variable.
24181 (tr): New function.
24182 (get_extension_index): New function, gets the index of an extension
24183 filename in a string.
24184 (compute_exts_from_gf): New function, computes extensions from the
24185 grammar file extension.
24186 (compute_exts_from_src): New functions, computes extensions from the
24187 C source file extension, file given by ``-o'' option.
24188 (compute_base_names): Update.
24189 (output_files): Update.
24190
241912001-08-01 Robert Anisko <anisko_r@epita.fr>
24192
24193 * doc/bison.texi: Document @$.
24194 (Locations): New section.
24195
241962001-07-18 Akim Demaille <akim@epita.fr>
24197
24198 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
24199 * config/prev-version.txt, config/move-if-change: New.
24200 * Makefile.am: Adjust.
24201
242022001-07-08 Pascal Bart <pascal.bart@epita.fr>
24203
24204 * src/bison.simple (yyparse): Suppress warning `comparaison
24205 between signed and unsigned'.
24206
242072001-07-05 Pascal Bart <pascal.bart@epita.fr>
24208
24209 * src/getargs.h (raw_flag): Remove.
24210 * src/getargs.c: Die on `-r'/`--raw'.
24211 * src/lex.c (parse_percent_token): Die on `%raw'.
24212 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
24213 * tests/calc.at: Suppress test with option `--raw'.
24214
242152001-07-14 Akim Demaille <akim@epita.fr>
24216
24217 * config/: New.
24218 * configure.in: Require Autoconf 2.50.
24219 Update to gettext 0.10.38.
24220
242212001-03-16 Akim Demaille <akim@epita.fr>
24222
24223 * doc/bison.texinfo: ANSIfy the examples.
24224
242252001-03-16 Akim Demaille <akim@epita.fr>
24226
24227 * getargs.c (skeleton): New variable.
24228 (longopts): --skeleton is a new option.
24229 (shortopts, getargs): -S is a new option.
24230 * getargs.h: Declare skeleton.
24231 * output.c (output_parser): Use it.
24232
242332001-03-16 Akim Demaille <akim@epita.fr>
24234
24235 * m4/strerror_r.m4: New.
24236 * m4/error.m4: Run AC_FUNC_STRERROR_R.
24237 * lib/error.h, lib/error.c: Update.
24238
242392001-03-16 Akim Demaille <akim@epita.fr>
24240
24241 * src/getargs.c (longopts): Clean up.
24242
242432001-02-21 Akim Demaille <akim@epita.fr>
24244
24245 * src/reader.c (gensym): `gensym_count' is your own.
24246 Use a static buf to create the symbol name, as token_buffer is no
24247 longer a buffer.
24248
242492001-02-08 Akim Demaille <akim@epita.fr>
24250
24251 * src/conflicts.c (conflict_report): Be sure not to append to res
24252 between two calls, which could happen if both first sprintf were
24253 skipped, but not the first cp += strlen.
24254
242552001-02-08 Akim Demaille <akim@epita.fr>
24256
24257 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
24258 New, from fileutils 4.0.37.
24259 * configure.in: Require Autoconf 2.49c. I took some time before
24260 making this decision. This is the only way out for portability
24261 issues in Bison, it would mean way too much duplicate effort to
24262 import in Bison features implemented in 2.49c since 2.13.
24263 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
24264
242652001-02-02 Akim Demaille <akim@epita.fr>
24266
24267 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
24268 * lib/xalloc.h, lib/xmalloc.c: Update.
24269
242702001-01-19 Akim Demaille <akim@epita.fr>
24271
24272 Get rid of the ad hoc handling of token_buffer in the scanner: use
24273 the obstacks.
24274
24275 * src/lex.c (token_obstack): New.
24276 (init_lex): Initialize it. No longer call...
24277 (grow_token_buffer): this. Remove it.
24278 Adjust all the places which used it to use the obstack.
24279
242802001-01-19 Akim Demaille <akim@epita.fr>
24281
24282 * src/lex.h: Rename all the tokens:
24283 s/\bENDFILE\b/tok_eof/g;
24284 s/\bIDENTIFIER\b/tok_identifier/g;
24285 etc.
24286 Let them be enums, not #define, to ease debugging.
24287 Adjust all the code.
24288
242892001-01-18 Akim Demaille <akim@epita.fr>
24290
24291 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
24292 * src/lex.c (maxtoken, grow_token_buffer): Static.
24293
242942001-01-18 Akim Demaille <akim@epita.fr>
24295
24296 Since we now use obstacks, more % directives can be enabled.
24297
24298 * src/lex.c (percent_table): Also accept `%yacc',
24299 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
24300 `%debug'.
24301 Handle the actions for `%semantic_parser' and `%pure_parser' here,
24302 instead of returning a token.
24303 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
24304 * src/reader.c (read_declarations): Adjust.
24305 * src/files.c (open_files): Don't call `compute_base_names', don't
24306 compute `attrsfile' since they depend upon data which might be
24307 *in* the input file now.
24308 (output_files): Do it here.
24309 * src/output.c (output_headers): Document the fact that this patch
24310 introduces a guaranteed SEGV for semantic parsers.
24311 * doc/bison.texinfo: Document them.
24312 * tests/suite.at: Exercise these %options.
24313
243142000-12-20 Akim Demaille <akim@epita.fr>
24315
24316 Also handle the output file (--verbose) with obstacks.
24317
24318 * files.c (foutput): Remove.
24319 (output_obstack): New.
24320 Adjust all dependencies.
24321 * src/conflicts.c: Return a string.
24322 * src/system.h (obstack_grow_string): Rename as...
24323 (obstack_sgrow): this. Be ready to work with non literals.
24324 (obstack_fgrow4): New.
24325
243262000-12-20 Akim Demaille <akim@epita.fr>
24327
24328 * src/files.c (open_files): Fix the computation of short_base_name
24329 in the case of `-o foo.tab.c'.
24330
243312000-12-20 Akim Demaille <akim@epita.fr>
24332
24333 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
24334 (copy_dollar): Now that everything uses obstacks, get rid of the
24335 FILE * parameters.
24336
243372000-12-20 Akim Demaille <akim@epita.fr>
24338
24339 * src/files.c (open_files): Actually the `.output' file is based
24340 on the short_base_name, not base_name.
24341 * tests/suite.at (Checking output file names): Adjust.
24342
243432000-12-20 Akim Demaille <akim@epita.fr>
24344
24345 * src/bison.s1: Remove, we now use directly...
24346 * src/bison.simple: this.
24347 * src/Makefile.am: Use pkgdata instead of data.
24348
243492000-12-20 Akim Demaille <akim@epita.fr>
24350
24351 * src/files.c (guard_obstack): New.
24352 (open_files): Initialize it.
24353 (output_files): Dump it...
24354 * src/files.h: Export it.
24355 * src/reader.c (copy_guard): Use it.
24356
243572000-12-19 Akim Demaille <akim@epita.fr>
24358
24359 * src/files.c (outfile, defsfile, actfile): Removed as global
24360 vars.
24361 (open_files): Don't compute them.
24362 (output_files): Adjust.
24363 (base_name, short_base_name): Be global.
24364 Adjust dependencies.
24365
243662000-12-19 Akim Demaille <akim@epita.fr>
24367
24368 * src/files.c (strsuffix): New.
24369 (stringappend): Be just like strcat but allocate.
24370 (base_names): Eve out from open_files.
24371 Try to simplify the rather hairy computation of base_name and
24372 short_base_name.
24373 (open_files): Use it.
24374 * tests/suite.at (Checking output file names): New test.
24375
243762000-12-19 Akim Demaille <akim@epita.fr>
24377
24378 * src/system.h (obstack_grow_literal_string): Rename as...
24379 (obstack_grow_string): this.
24380 * src/output.c (output_parser): Recognize `%% actions' instead of
24381 `$'.
24382 * src/bison.s1: s/$/%% actions/.
24383 * src/bison.hairy: Likewise.
24384
243852000-12-19 Akim Demaille <akim@epita.fr>
24386
24387 * src/output.c (output_parser): Compute the `#line' lines when
24388 there are.
24389 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
24390 Suggested by Hans Aberg.
24391
243922000-12-19 Akim Demaille <akim@epita.fr>
24393
24394 Let the handling of the skeleton files be local to the procedures
24395 that use it.
24396
24397 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
24398 longer static.
24399 (fparser, open_extra_files): Remove.
24400 (open_files, output_files): Don't take care of fparser.
24401 * src/files.h: Adjust.
24402 * src/output.c (output_parser): Open and close the file to the
24403 skeleton.
24404 * src/reader.c (read_declarations): When %semantic_parser, open
24405 fguard.
24406
244072000-12-19 Akim Demaille <akim@epita.fr>
24408
24409 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
24410 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
24411
244122000-12-19 Akim Demaille <akim@epita.fr>
24413
24414 * src/files.c (open_files): Yipee! We no longer need all the code
24415 looking for `/tmp' since we have no tmp file.
24416
244172000-12-19 Akim Demaille <akim@epita.fr>
24418
24419 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
24420 New macros.
24421 * src/files.c (open_files): Less dependency on MSDOS etc.
24422
244232000-12-14 Akim Demaille <akim@epita.fr>
24424
24425 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
24426 Provide a default definition.
24427 Use it when executing the default @ action.
24428 * src/reader.c (reader_output_yylsp): No longer include
24429 `timestamp' and `text' in the default YYLTYPE.
24430
244312000-12-12 Akim Demaille <akim@epita.fr>
24432
24433 * src/reader.c (copy_definition, parse_union_decl, copy_action)
24434 (copy_guard): Quote the file names.
24435 Reported by Laurent Mascherpa.
24436
244372000-12-12 Akim Demaille <akim@epita.fr>
24438
24439 * src/output.c (output_headers, output_program, output): Be sure
24440 to escape special characters when outputting filenames.
24441 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
24442 (output_headers): Don't depend on them, Use ACTSTR.
24443
244442000-11-17 Akim Demaille <akim@epita.fr>
24445
24446 * lib/obstack.h: Formatting changes.
24447 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
24448 prevents type checking.
24449 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
24450 cast the value to (void *): assigning a `foo *' to a `void *'
24451 variable is valid.
24452 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
24453 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
24454 append characters.
24455
244562000-11-17 Akim Demaille <akim@epita.fr>
24457
24458 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
24459 as...
24460 (suite.m4, regression.m4, calc.m4): these.
24461 * tests/atgeneral.m4: Update from CVS Autoconf.
24462
244632000-11-17 Akim Demaille <akim@epita.fr>
24464
24465 * tests/regression.m4 (%union and --defines): New test,
24466 demonstrating a current bug in the obstack implementation.
24467
244682000-11-17 Akim Demaille <akim@epita.fr>
24469
24470 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
24471 macros.
24472 Use them to declare the variables which are global or local to
24473 `yyparse'.
24474
244752000-11-17 Akim Demaille <akim@epita.fr>
24476
24477 * acconfig.h: Remove, no longer used.
24478
244792000-11-07 Akim Demaille <akim@epita.fr>
24480
24481 * src: s/Copyright (C)/Copyright/g.
24482
244832000-11-07 Akim Demaille <akim@epita.fr>
24484
24485 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
24486 defining.
24487 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
24488
244892000-11-07 Akim Demaille <akim@epita.fr>
24490
24491 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
24492 Merge in a single CPP if/else.
24493
244942000-11-07 Akim Demaille <akim@epita.fr>
24495
24496 * src/output.c (output): Remove useless variables.
24497 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
24498 argument `data' for consistency with the prototypes.
24499 Qualify it `const'.
24500 (obstack_copy, obstack_copy0): Rename the second argument as
24501 `address' for consistency. Qualify it `const'.
24502 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
24503 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
24504 `const' their input argument (`data' or `address').
24505 Adjust the corresponding macros to include `const' in casts.
24506
245072000-11-03 Akim Demaille <akim@epita.fr>
24508
24509 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
24510 s/PFILE1/BISON_HAIRY/.
24511 Adjust dependencies.
24512
245132000-11-03 Akim Demaille <akim@epita.fr>
24514
24515 For some reason, this was not applied.
24516
24517 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
24518 `unlink': it's no longer used.
24519
245202000-11-03 Akim Demaille <akim@epita.fr>
24521
24522 * src/files.c (skeleton_find): New function, eved out of...
24523 (open_files, open_extra_files): here.
24524
245252000-11-03 Akim Demaille <akim@epita.fr>
24526
24527 Don't use `atexit'.
24528
24529 * src/files.c (obstack_save): New function.
24530 (done): Rename as...
24531 (output_files): this.
24532 Use `obstack_save'.
24533 * src/main.c (main): Don't use `atexit' to register `done', since
24534 it no longer has to remove tmp files, just call `output_files'
24535 when there are no errors.
24536
245372000-11-02 Akim Demaille <akim@epita.fr>
24538
24539 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
24540 `unlink': it's no longer used.
24541 * src/files.h: Formatting changes.
24542
245432000-11-02 Akim Demaille <akim@epita.fr>
24544
24545 Remove the last uses of mktemp and unlink/delete.
24546
24547 * src/files.c (fdefines, ftable): Removed.
24548 (defines_ostack, table_obstack): New.
24549 Adjust dependencies of the former into uses of the latter.
24550 * src/output.c (output_short_or_char_table, output_short_table):
24551 Convert to using obstacks.
24552 * src/reader.c (copy_comment2): Accept one FILE * and two
24553 obstacks.
24554 (output_token_defines, reader_output_yylsp): Use obstacks.
24555 * src/system.h (obstack_fgrow3): New.
24556 * po/POTFILES.in: Adjust.
24557
245582000-11-01 Akim Demaille <akim@epita.fr>
24559
24560 Change each use of `fattrs' into a use of `attrs_obstack'.
24561
24562 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
24563 * src/files.c (fattrs): Remove.
24564 (attrs_obstack): New.
24565 Adjust all dependencies.
24566 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
24567
245682000-11-01 Akim Demaille <akim@epita.fr>
24569
24570 Introduce obstacks.
24571 Change each use of `faction' into a use of `action_obstack'.
24572
24573 * lib/obstack.h, lib/obstack.c: New files.
24574 * src/files.c (faction): Remove.
24575 (action_obstack): New.
24576 Adjust all dependencies.
24577
245782000-10-20 Akim Demaille <akim@epita.fr>
24579
24580 * lib/quote.h (PARAMS): New macro. Use it.
24581
245822000-10-16 Akim Demaille <akim@epita.fr>
24583
24584 * src/output.c (output_short_or_char_table): New function.
24585 (output_short_table, output_token_translations): Use it.
24586 (goto_actions): Use output_short_table.
24587
245882000-10-16 Akim Demaille <akim@epita.fr>
24589
24590 * src/symtab.c (bucket_new): New function.
24591 (getsym): Use it.
24592
24593 * src/output.c (output_short_table): New argument to display the
24594 comment associated with the table.
24595 Adjust dependencies.
24596 (output_gram): Use it.
24597 (output_rule_data): Nicer output layout for YYTNAME.
24598
245992000-10-16 Akim Demaille <akim@epita.fr>
24600
24601 * src/lex.c (read_typename): New function.
24602 (lex): Use it.
24603 * src/reader.c (copy_dollar): Likewise.
24604
246052000-10-16 Akim Demaille <akim@epita.fr>
24606
24607 * src/reader.c (copy_comment2): Expect the input stream to be on
24608 the `/' which is suspected to open a comment, instead of being
24609 called after `//' or `/*' was read.
24610 (copy_comment, copy_definition, parse_union_decl, copy_action)
24611 (copy_guard): Adjust.
24612
246132000-10-16 Akim Demaille <akim@epita.fr>
24614
24615 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
24616 `read_signed_integer'.
24617
246182000-10-16 Akim Demaille <akim@epita.fr>
24619
24620 * src/reader.c (copy_dollar): New function.
24621 (copy_guard, copy_action): Use it.
24622
246232000-10-16 Akim Demaille <akim@epita.fr>
24624
24625 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
24626 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
24627 New files, from Fileutils 4.0.27.
24628 * src/main.c (printable_version): Remove.
24629 * src/lex.c, src/reader.c: Use `quote'.
24630
246312000-10-04 Akim Demaille <akim@epita.fr>
24632
24633 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
24634
246352000-10-04 Akim Demaille <akim@epita.fr>
24636
24637 * doc/bison.texinfo: Various typos spotted by Neil Booth.
24638
246392000-10-04 Akim Demaille <akim@epita.fr>
24640
24641 When a literal string is used to define two different tokens,
24642 `bison -v' segfaults.
24643 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
24644
24645 * tests/regression.m4: New file.
24646 Include the core of the sample provided by Piotr Gackiewicz.
24647 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
24648 properly.
24649
246502000-10-04 Akim Demaille <akim@epita.fr>
24651
24652 * src/reader.c (parse_expect_decl): Keep `count' within the size
24653 of `buffer'.
24654 From Neil Booth.
24655
246562000-10-02 Paul Eggert <eggert@twinsun.com>
24657
24658 * bison.s1 (yyparse): Assign the default value
24659 unconditionally, to avoid a GCC warning and make the parser a
24660 tad smaller.
24661
246622000-10-02 Akim Demaille <akim@epita.fr>
24663
24664 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
24665 options.
24666
246672000-10-02 Akim Demaille <akim@epita.fr>
24668
24669 * src/derives.c, src/print.c, src/reduce.c: To ease the
24670 translation, move some `\n' out of the translated strings.
24671
246722000-10-02 Akim Demaille <akim@epita.fr>
24673
24674 The location tracking mechanism is precious for parse error
24675 messages. Nevertheless, it is enabled only when `@n' is used in
24676 the grammar, which is a different issue (you can use it in error
24677 message, but not in the grammar per se). Therefore, there should
24678 be another means to enable it.
24679
24680 * src/getargs.c (getargs): Support `--locations'.
24681 (usage): Report it.
24682 * src/getargs.h (locationsflag): Export it.
24683 * src/lex.c (percent_table): Support `%locations'.
24684 * src/reader.c (yylsp_needed): Remove this variable, now replaced
24685 with `locationsflag'.
24686 * doc/bison.texinfo: Document `--locations' and `%locations'.
24687 Sort the options.
24688 * tests/calc.m4: Test it.
24689
24690 For regularity of the names, replace each
24691 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
24692 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
24693 In addition replace each `flag' with `_flag'.
24694
246952000-10-02 Akim Demaille <akim@epita.fr>
24696
24697 Also test parse error messages, including with YYERROR_VERBOSE.
24698
24699 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
24700 associative).
24701 Use it to check the computations.
24702 Use it to check `nonassoc' is honored.
24703 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
24704 `--yyerror-verbose'.
24705 (_AT_CHECK_CALC): Adjust to this option.
24706 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
24707
247082000-10-02 Akim Demaille <akim@epita.fr>
24709
24710 Test also `--verbose', `--defines' and `--name-prefix'. Testing
24711 the latter demonstrates a flaw in the handling of non debugging
24712 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
24713 was used in order to simplify:
24714
24715 #if YYDEBUG
24716 if (yydebug)
24717 {
24718 ...
24719 }
24720 #endif
24721
24722 into
24723
24724 if (yydebug)
24725 {
24726 ...
24727 }
24728
24729 unfortunately this leads to a CPP conflict when
24730 `--name-prefix=foo' is used since it produces `#define yydebug
24731 foodebug'.
24732
24733 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
24734 (YYDPRINTF): New macro.
24735 Spread its use.
24736 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
24737 the bison options.
24738 Also test `--verbose', `--defines' and `--name-prefix'.
24739
247402000-10-02 Akim Demaille <akim@epita.fr>
24741
24742 Improve the readability of the produced parsers.
24743
24744 * src/bison.s1: Formatting changes.
24745 Improve the comment related to the `$' mark.
24746 (yydefault): Don't fall through to `yyresume': `goto' there.
24747 * src/output.c (output_parser): When the `$' is met, skip the end
24748 of its line.
24749 New variable, `number_of_dollar_signs', to check there's exactly
24750 one `$' in the parser skeleton.
24751
247522000-10-02 Akim Demaille <akim@epita.fr>
24753
24754 * lib/xstrdup.c: New file, from the fileutils.
24755 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
24756 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
24757 instead of strlen + xmalloc + strcpy.
24758 * src/symtab.c (copys): Remove, use xstrdup instead.
24759
247602000-10-02 Akim Demaille <akim@epita.fr>
24761
24762 * src/gram.h (associativity): New enum type which replaces the
24763 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
24764 `right_assoc', `left_assoc' and `non_assoc'.
24765 Adjust all dependencies.
24766 * src/reader.c: Formatting changes.
24767 (LTYPESTR): Don't define it, use it as a literal in
24768 `reader_output_yylsp'.
24769 * src/symtab.h (symbol_class): New enum type which replaces the
24770 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
24771 `sunknown', `stoken and `snterm'.
24772
247732000-10-02 Akim Demaille <akim@epita.fr>
24774
24775 * src/getargs.c (fixed_outfiles): Rename as...
24776 (yaccflag): for consistency and accuracy.
24777 Adjust dependencies.
24778
247792000-10-02 Akim Demaille <akim@epita.fr>
24780
24781 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
24782 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
24783 difficult and introduced a lot of core dump. It turns out that
24784 Bison used an implementation of `xmalloc' based on `calloc', and
24785 at various places it does depend upon the initialization to 0. I
24786 have not tried to isolate the pertinent places, and all the former
24787 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
24788 someone should address this issue.
24789
24790 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
24791 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
24792 files.
24793 Adjust dependencies.
24794 * src/warshall.h: New file.
24795 Propagate.
24796
247972000-10-02 Akim Demaille <akim@epita.fr>
24798
24799 Various anti-`extern in *.c' changes.
24800
24801 * src/system.h: Include `assert.h'.
24802
248032000-10-02 Akim Demaille <akim@epita.fr>
24804
24805 * src/state.h (nstates, final_state, first_state, first_shift)
24806 (first_reduction): Move their exportation from here...
24807 * src/LR0.h: to here.
24808 Adjust dependencies.
24809 * src/getargs.c (statisticsflag): New variable.
24810 Add support for `--statistics'.
24811 Adjust dependencies.
24812
24813 Remove a lot of now useless `extern' statements in most files.
24814
248152000-10-02 Akim Demaille <akim@epita.fr>
24816
24817 * src/LR0.h: New file.
24818 Propagate its use.
24819
248202000-10-02 Akim Demaille <akim@epita.fr>
24821
24822 * src/print.h: New file.
24823 Propagate its use.
24824 * src/print.c: Formatting and ordering changes.
24825 (verbose, terse): Replace with...
24826 (print_results): this new function.
24827 Adjust dependencies.
24828
248292000-10-02 Akim Demaille <akim@epita.fr>
24830
24831 * src/conflicts.c (conflict_report): New function.
24832 (conflict_log, verbose_conflict_log): Replace with...
24833 (print_conflicts): this function.
24834 Adjust dependencies.
24835 * src/conflicts.h: New file.
24836 Propagate its inclusion.
24837
248382000-10-02 Akim Demaille <akim@epita.fr>
24839
24840 * src/nullable.h: New file.
24841 Propagate its inclusion.
24842 * src/nullable.c: Formatting changes.
24843
248442000-10-02 Akim Demaille <akim@epita.fr>
24845
24846 * src/reduce.h: New file.
24847 Propagate its inclusion.
24848 * src/reduce.c: Topological sort and other formatting changes.
24849 (bool, TRUE, FALSE): Move their definition to...
24850 * src/system.h: here.
24851
248522000-10-02 Akim Demaille <akim@epita.fr>
24853
24854 * src/files.c: Formatting changes.
24855 (tryopen, tryclose, openfiles): Rename as...
24856 (xfopen, xfclose, open_files): this.
24857 (stringappend): static.
24858 * src/files.h: Complete the list of exported symbols.
24859 Propagate its use.
24860
248612000-10-02 Akim Demaille <akim@epita.fr>
24862
24863 * src/reader.h: New file.
24864 Propagate its use instead of tedious list of `extern' and
24865 prototypes.
24866 * src/reader.c: Formatting changes, topological sort,
24867 s/register//.
24868
248692000-10-02 Akim Demaille <akim@epita.fr>
24870
24871 * src/lex.h: Prototype `lex.c' exported functions.
24872 * src/reader.c: Adjust.
24873 * src/lex.c: Formatting changes.
24874 (safegetc): Rename as...
24875 (xgetc): this.
24876
248772000-10-02 Akim Demaille <akim@epita.fr>
24878
24879 * src/lalr.h: New file.
24880 Propagate its inclusion instead of prototypes and `extern'.
24881 * src/lalr.c: Formatting changes, topological sorting etc.
24882
248832000-10-02 Akim Demaille <akim@epita.fr>
24884
24885 * src/output.c (token_actions): Introduce a temporary array,
24886 YYDEFACT, that makes it possible for this function to use
24887 output_short_table.
24888
248892000-10-02 Akim Demaille <akim@epita.fr>
24890
24891 `user_toknums' is output as a `short[]' in `output.c', while it is
24892 defined as a `int[]' in `reader.c'. For consistency with the
24893 other output tables, `user_toknums' is now defined as a table of
24894 shorts.
24895
24896 * src/reader.c (user_toknums): Be a short table instead of an int
24897 table.
24898 Adjust dependencies.
24899
24900 Factor the short table outputs.
24901
24902 * src/output.c (output_short_table): New function.
24903 * src/output.c (output_gram, output_stos, output_rule_data)
24904 (output_base, output_table, output_check): Use it.
24905
249062000-10-02 Akim Demaille <akim@epita.fr>
24907
24908 * src/output.c (output): Topological sort of the functions, in
24909 order to get rid of the `static' prototypes.
24910 No longer use `register'.
24911 * src/output.h: New file.
24912 Propagate its inclusion in files explicitly prototyping functions
24913 from output.c.
24914
249152000-09-21 Akim Demaille <akim@epita.fr>
24916
24917 * src/atgeneral.m4: Update from Autoconf.
24918
249192000-09-21 Akim Demaille <akim@epita.fr>
24920
24921 * src/closure.h: New file.
24922 * src/closure.c: Formatting changes, topological sort over the
24923 functions, use of closure.h.
24924 (initialize_closure, finalize_closure): Rename as...
24925 (new_closure, free_closure): these. Adjust dependencies.
24926 * src/LR0.c: Formatting changes, topological sort, use of
24927 cloture.h.
24928 (initialize_states): Rename as...
24929 (new_states): this.
24930 * src/Makefile.am (noinst_HEADERS): Adjust.
24931
249322000-09-20 Akim Demaille <akim@epita.fr>
24933
24934 * src/acconfig.h: Don't protect config.h against multiple
24935 inclusion.
24936 Don't define PARAMS.
24937 * src/system.h: Define PARAMS.
24938 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
24939 purpose of config.h. system.h must not try to fix wrong
24940 definitions in config.h.
24941
249422000-09-20 Akim Demaille <akim@epita.fr>
24943
24944 * src/derives.h: New file.
24945 * src/main.c, src/derives.h: Use it.
24946 Formatting changes.
24947 * src/Makefile.am (noinst_HEADERS): Adjust.
24948
249492000-09-20 Akim Demaille <akim@epita.fr>
24950
24951 * tests/atgeneral.m4: Update from Autoconf.
24952 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
24953 (AT_CHECK_CALC): New macros.
24954 Use these macros to test bison with options `', `--raw',
24955 `--debug', `--yacc', `--yacc --debug'.
24956
249572000-09-19 Akim Demaille <akim@epita.fr>
24958
24959 * src/output.c: Formatting changes.
24960 * src/machine.h: Remove, leaving its contents in...
24961 * src/system.h: here.
24962 Include stdio.h.
24963 Adjust all dependencies on stdio.h and machine.h.
24964 * src/getargs.h: New file.
24965 Let all `extern' declarations about getargs.c be replaced with
24966 inclusion of `getargs.h'.
24967 * src/Makefile.am (noinst_HEADERS): Adjust.
24968
24969 * tests/calc.m4 (yyin): Be initialized in main, not on the global
24970 scope.
24971 (yyerror): Returns void, not int.
24972 * doc/bison.texinfo: Formatting changes.
24973
249742000-09-19 Akim Demaille <akim@epita.fr>
24975
24976 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
24977 portable.
24978
249792000-09-18 Akim Demaille <akim@epita.fr>
24980
24981 * configure.in: Append WARNING_CFLAGS to CFLAGS.
24982 * src/Makefile.am (INCLUDES): Don't.
24983 Be ready to fetch headers in lib/.
24984
249852000-09-18 Akim Demaille <akim@epita.fr>
24986
24987 * doc/bison.texinfo: Update the copyright.
24988 ANSIfy and GNUify the examples.
24989 Remove the old menu.
24990
249912000-09-18 Akim Demaille <akim@epita.fr>
24992
24993 First set of tests: use the `calc' example from the documentation.
24994
24995 * src/bison.s1 (yyparse): Condition the code using `yytname' which
24996 is defined only when YYDEBUG is.
24997 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
24998 * src/files.c (tryopen, tryclose): Formatting changes.
24999 Move to the top and be static.
25000 * src/reader.c (read_signed_integer): Likewise.
25001 * tests/calc.m4: New file.
25002 * Makefile.am, suite.m4: Adjust.
25003 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
25004
250052000-09-18 Akim Demaille <akim@epita.fr>
25006
25007 Add support for an Autotest test suite for Bison.
25008
25009 * m4/m4.m4, m4/atconfig.m4: New files.
25010 * m4/Makefile.am (EXTRA_DIST): Adjust.
25011 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
25012 files.
25013 * src/getargs.c: Display a more standard --version message.
25014 * src/reader.c (reader): Formatting changes.
25015 No longer depend upon VERSION_STRING.
25016 * configure.in: No longer use `dnl'.
25017 Set up the test suite and the new directory `tests/.
25018 (VERSION_STRING): Remove.
25019
250202000-04-14 Akim Demaille <akim@epita.fr>
25021
25022 * src/reader.c (copy_comment2): New function, same as former
25023 `copy_comment', but outputs into two FILE *.
25024 (copy_comment): Use it.
25025 (parse_union_decl): Use it.
25026 (get_type, parse_start_decl): Use the same `invalid' message.
25027 (parse_start_decl, parse_union_decl): Use the same `multiple'
25028 message.
25029 (parse_union_decl, copy_guard, copy_action): Use the same
25030 `unmatched' message.
25031 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
25032
250332000-03-31 Akim Demaille <akim@epita.fr>
25034
25035 * src/files.c (tryopen, tryclose): Move to the top.
25036 Be static.
25037
250382000-03-31 Akim Demaille <akim@epita.fr>
25039
25040 * src/main.c (main): Don't call `done', exit does it.
25041
250422000-03-31 Akim Demaille <akim@epita.fr>
25043
25044 * allocate.c: s/return (foo)/return foo/.
25045 * lalr.c: Likewise.
25046 * LR0.c: Likewise.
25047 * output.c: Likewise.
25048 * reader.c: Likewise.
25049 * symtab.c: Likewise.
25050 * vmsgetargs.c: Likewise.
25051
250522000-03-31 Akim Demaille <akim@epita.fr>
25053
25054 Clean up the error reporting functions.
25055
25056 * src/report.c: New file.
25057 * src/report.h: Likewise.
25058 * src/Makefile.am: Adjust.
25059 * m4/error.m4: New file.
25060 * m4/Makefile.am: Adjust.
25061 * configure.in (jm_PREREQ_ERROR): Call it.
25062 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
25063 Remove.
25064 (fatal, fatals): Remove. All callers use complain.c::fatal.
25065 (warn, warni, warns, warnss, warnss): Remove. All callers use
25066 complain.c::complain.
25067 (toomany): Remove, use fatal instead.
25068 * src/files.c (done): No argument, use complain_message_count.
25069 * src/main.c (main): Register `done' to `atexit'.
25070
25071 * src/getargs.c (usage): More `fputs', less `fprintf'.
25072
250732000-03-28 Akim Demaille <akim@epita.fr>
25074
25075 * lib/: New directory.
25076 * Makefile.am (SUBDIRS): Adjust.
25077 * configure.in: Adjust.
25078 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
25079 useless.
25080 * src/alloca.c: Moved to lib/.
25081 * src/getopt.c: Likewise.
25082 * src/getopt1.c: Likewise.
25083 * src/getopt.h: Likewise.
25084 * src/ansi2knr.c: Likewise.
25085 * src/ansi2knr.1: Likewise.
25086 * src/Makefile.am: Adjust.
25087 * lib/Makefile.am: New file.
25088
250892000-03-28 Akim Demaille <akim@epita.fr>
25090
25091 * src/getargs.c (usage): Refresh the help message.
25092
250932000-03-17 Akim Demaille <akim@epita.fr>
25094
25095 * src/getopt1.c: Updated from textutils 2.0e
25096 * src/getopt.c: Likewise.
25097 * src/getopt.h: Likewise.
25098
250992000-03-17 Akim Demaille <akim@epita.fr>
25100
25101 * src/Makefile.am (bison.simple): Fix the awk program: quote only
25102 the file name, not the whole `#line LINE FILE'.
25103
251042000-03-17 Akim Demaille <akim@epita.fr>
25105
25106 On syntax errors, report the token on which we choked.
25107
25108 * src/bison.s1 (yyparse): In the label yyerrlab, when
25109 YYERROR_VERBOSE, add yychar in msg.
25110
251112000-03-17 Akim Demaille <akim@epita.fr>
25112
25113 * src/reader.c (copy_at): New function.
25114 (copy_guard): Use it.
25115 (copy_action): Use it.
25116
251172000-03-17 Akim Demaille <akim@epita.fr>
25118
25119 Be kind to translators, save some useless translations.
25120
25121 * src/main.c (banner): New function.
25122 (fatal_banner): Use it.
25123 (warn_banner): Use it.
25124
251252000-03-17 Akim Demaille <akim@epita.fr>
25126
25127 * src/reader.c (copy_definition): Use copy_string and
25128 copy_comment. Removed now unused `match', `ended',
25129 `cplus_comment'.
25130 (copy_comment, copy_string): Moved, to be visible from
25131 copy_definition.
25132
251332000-03-17 Akim Demaille <akim@epita.fr>
25134
25135 * src/reader.c (copy_string): Declare `static inline'. No
25136 problems with inline, since it is checked by configure.
25137 (copy_comment): Likewise.
25138
251392000-03-17 Akim Demaille <akim@epita.fr>
25140
25141 * src/reader.c (packsymbols): Formatting changes.
25142
251432000-03-17 Akim Demaille <akim@epita.fr>
25144
25145 * src/reader.c (copy_comment): New function, factored out from:
25146 (copy_action): Use it. Removed now unused `match', `ended',
25147 `cplus_comment'.
25148 (copy_guard): Likewise.
25149
251502000-03-17 Akim Demaille <akim@epita.fr>
25151
25152 * src/reader.c (copy_string): New function, factored out from:
25153 (copy_action): Use it.
25154 (copy_guard): Likewise.
25155
251562000-03-17 Akim Demaille <akim@epita.fr>
25157
25158 Change the handling of @s so that they behave exactly like $s.
25159 There is now a pseudo variable @$ (readble and writable), location
25160 of the lhs of the rule (by default ranging from the location of
25161 the first symbol of the rhs, to the location of the last symbol,
25162 or, if the rhs is empty, YYLLOC).
25163
25164 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
25165 yyval.
25166 (yyparse): When providing a default semantic action, provide a
25167 default location action.
25168 (after the $): No longer change `*YYLSP', just stack YYLOC the
25169 same way you stack YYVAL.
25170 * src/reader.c (read_declarations): Use warns.
25171 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
25172 (copy_action, case '@'): Likewise.
25173 Use a standard error message, to save useless work from
25174 translators.
25175
251762000-03-17 Akim Demaille <akim@epita.fr>
25177
25178 * src/bison.s1: Formatting and cosmetics changes.
25179 * src/reader.c: Likewise.
25180 Update the Copyright notice.
25181
251822000-03-17 Akim Demaille <akim@epita.fr>
25183
25184 * src/bison.s1 (#line): All set to `#line' only, since the
25185 Makefile now handles them.
25186
251872000-03-16 Akim Demaille <akim@epita.fr>
25188
25189 * src/output.c (output_rule_data): Output the documentation of
25190 some of the tables.
25191 (Copyright notice): Update.
25192 Formatting changes.
25193
251942000-03-16 Akim Demaille <akim@epita.fr>
25195
25196 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
25197 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
25198 One `#if YYDEBUG' remains, since it uses variables which are
25199 defined only if `YYDEBUG != 0'.
25200
252012000-03-16 Akim Demaille <akim@epita.fr>
25202
25203 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
25204 and related variables so that the similarities are highlighted.
25205
252062000-03-16 Akim Demaille <akim@epita.fr>
25207
25208 * src/bison.s1: Properly indent CPP directives.
25209
252102000-03-16 Akim Demaille <akim@epita.fr>
25211
25212 * src/bison.s1: Properly indent the `alloca' CPP section.
25213
252142000-03-16 Akim Demaille <akim@epita.fr>
25215
25216 Do not hard code values of directories in `configure.in'.
25217 Update the `configure' tool chain.
25218
25219 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
25220 src/makefile.am.
25221 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
25222 (AC_OUTPUT): Add m4/Makefile.
25223 Bump to bison 1.28a, 1.29 has never been released.
25224 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
25225 handled via src/Makefile.am.
25226 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
25227 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
25228 autoheader.
25229 * Makefile.am (SUBDIRS): Add m4.
25230 (ACLOCAL_AM_FLAGS): New variable.
25231 (AUTOMAKE_OPTIONS): Add check-news.
25232 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
25233 the proper line number and file name.
25234 (DEFS): Propagate the location of bison library files and of the
25235 locale files.
25236 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
25237 builddir.
25238 * acinclude.m4: Remove, replaced by the directory m4.
25239 * m4/Makefile.am (EXTRA_DIST): New variable.
25240 * m4/gettext.m4: New file, from the fileutils.
25241 * m4/lcmessage.m4: Likewise
25242 * m4/progtest.m4: Likewise.
25243 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
25244
252452000-03-10 Akim Demaille <akim@epita.fr>
25246
25247 * src/closure.c:
25248 Formatting changes of various comments.
25249 Respect the GNU coding standards at various places.
25250 Don't use `_()' when no translation is needed.
25251
252521999-12-13 Jesse Thilo <jthilo@gnu.org>
25253
25254 * src/files.c:
25255 OS/2 honors TMPDIR environment variable.
25256
252571999-12-13 Jesse Thilo <jthilo@gnu.org>
25258
25259 * doc/bison.texinfo: Tweaked spelling and grammar.
25260 Updated ISBN.
25261 Removed reference to price of printed copy.
25262 Mention BISON_SIMPLE and BISON_HAIRY.
25263
252641999-12-13 Jesse Thilo <jthilo@gnu.org>
25265
25266 * configure.in, NEWS:
25267 Bison 1.29 released.
25268
252691999-10-27 Jesse Thilo <jthilo@gnu.org>
25270
25271 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
25272 Added reference card.
25273
252741999-07-26 Jesse Thilo <jthilo@gnu.org>
25275
25276 * po/ru.po: Added Russian translation.
25277
252781999-07-26 Jesse Thilo <jthilo@gnu.org>
25279
25280 * configure.in: Added Russian translation.
25281
252821999-07-06 Jesse Thilo <jthilo@gnu.org>
25283
25284 * configure.in, NEWS, README:
25285 Released version 1.28.
25286
252871999-06-14 Jesse Thilo <jthilo@gnu.org>
25288
25289 * src/system.h:
25290 Squashed redefinition warning on some systems.
25291
25292 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
25293 Have configure build version string instead of relying on ANSI string
25294 concatentation.
25295
252961999-06-14 Jesse Thilo <jthilo@gnu.org>
25297
25298 * po/POTFILES.in: Got rid of version.c.
25299
253001999-06-14 Jesse Thilo <jthilo@gnu.org>
25301
25302 * acconfig.h, configure.in:
25303 Have configure build version string instead of relying on ANSI string
25304 concatentation.
25305
253061999-06-08 Jesse Thilo <jthilo@gnu.org>
25307
25308 * doc/bison.1:
25309 Dropped mention of `+' for long-named options.
25310
253111999-05-30 Jesse Thilo <jthilo@gnu.org>
25312
25313 * src/files.c: Added <unistd.h> for unlink().
25314
25315 * src/Makefile.am, src/system.h:
25316 I18n fixes.
25317
253181999-05-30 Jesse Thilo <jthilo@gnu.org>
25319
25320 * README: Added a FAQ list.
25321
25322 * configure.in, acconfig.h:
25323 I18n fixes.
25324
253251999-05-30 Jesse Thilo <jthilo@gnu.org>
25326
25327 * doc/FAQ, doc/Makefile.am:
25328 Added a FAQ list.
25329
253301999-05-19 Jesse Thilo <jthilo@gnu.org>
25331
25332 * src/alloc.h, src/symtab.h, src/version.c:
25333 Protected inclusion of "config.h" with HAVE_CONFIG_H.
25334
253351999-04-18 Jesse Thilo <jthilo@gnu.org>
25336
25337 * src/.cvsignore, src/Makefile.am:
25338 Reorganized: sources in `src', documentation in `doc'.
25339
25340 * src/lex.c (literalchar):
25341 fixed the code for escaping double quotes (thanks
25342 Jonathan Czisny.)
25343
253441999-04-18 Jesse Thilo <jthilo@gnu.org>
25345
25346 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
25347 Adjusted paths to reflect directory reorganization.
25348
253491999-04-18 Jesse Thilo <jthilo@gnu.org>
25350
25351 * doc/.cvsignore, doc/Makefile.am:
25352 Reorganized: sources in `src', documentation in `doc'.
25353
253541999-04-18 Jesse Thilo <jthilo@gnu.org>
25355
25356 * configure.in:
25357 Updated AC_INIT file to reflect directory reorganization.
25358
25359 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
25360 Reorganized: sources in `src', documentation in `doc'.
25361
253621999-04-13 Jesse Thilo <jthilo@gnu.org>
25363
25364 * src/allocate.c:
25365 Don't declare calloc() and realloc() if not necessary.
25366
253671999-04-13 Jesse Thilo <jthilo@gnu.org>
25368
25369 * configure.in, acconfig.h, acinclude.m4:
25370 Don't declare calloc() and realloc() if not necessary.
25371
253721999-03-23 Jesse Thilo <jthilo@gnu.org>
25373
25374 * po/.cvsignore: Added i18n support.
25375
253761999-03-23 Jesse Thilo <jthilo@gnu.org>
25377
25378 * acconfig.h, configure.in, Makefile.am:
25379 Added i18n support.
25380
253811999-03-22 Jesse Thilo <jthilo@gnu.org>
25382
25383 * src/bison.s1: Fixed #line numbers.
25384
253851999-03-15 Jesse Thilo <jthilo@gnu.org>
25386
25387 * po/es.po, po/fr.po, po/nl.po, po/de.po:
25388 Added PO files from Translation Project.
25389
253901999-03-03 Jesse Thilo <jthilo@gnu.org>
25391
25392 * Makefile.am:
25393 Added support for non-ANSI compilers (ansi2knr).
25394
253951999-02-16 Jesse Thilo <jthilo@gnu.org>
25396
25397 * configure.in: Bumped version number to 1.27.
25398
25399 * Makefile.am:
25400 Added `bison.simple' to list of files removed by `make distclean'.
25401
254021999-02-12 Jesse Thilo <jthilo@gnu.org>
25403
25404 * src/files.c, src/files.h:
25405 Defined locations of parser files in config.h instead of Makefile.
25406
254071999-02-12 Jesse Thilo <jthilo@gnu.org>
25408
25409 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
25410 Defined locations of parser files in config.h instead of Makefile.
25411
254121999-02-09 Jesse Thilo <jthilo@gnu.org>
25413
25414 * Makefile.am:
25415 Removed inappropriate use of $< macro.
25416
254171999-02-05 Jesse Thilo <jthilo@gnu.org>
25418
25419 * po/Makefile.in.in, po/POTFILES.in:
25420 Add `po' directory skeleton.
25421
254221999-01-27 Jesse Thilo <jthilo@gnu.org>
25423
25424 * README: Document help-bison list.
25425
25426 * configure.in: Add check for mkstemp().
25427
254281999-01-20 Jesse Thilo <jthilo@gnu.org>
25429
25430 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
25431 Hush a few compiler warnings.
25432
25433 * src/files.c:
25434 Add tryclose(), which verifies that fclose was successful.
25435 Hush a couple of compiler warnings.
25436
254371999-01-20 Jesse Thilo <jthilo@gnu.org>
25438
25439 * Makefile.am, OChangeLog:
25440 ChangeLog is now automatically generated. Include the old version as
25441 OChangeLog.
25442
254431999-01-14 Jesse Thilo <jthilo@gnu.org>
25444
25445 * 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:
25446 Update FSF address.
25447
254481999-01-14 Jesse Thilo <jthilo@gnu.org>
25449
25450 * doc/bison.texinfo: Fix formatting glitch.
25451
25452 * doc/bison.texinfo: Update FSF address.
25453
254541999-01-14 Jesse Thilo <jthilo@gnu.org>
25455
25456 * acconfig.h: Update FSF address.
25457
254581999-01-08 Jesse Thilo <jthilo@gnu.org>
25459
25460 * src/system.h:
25461 Don't define PACKAGE here, since config.h defines it.
25462
254631998-12-30 Jesse Thilo <jthilo@gnu.org>
25464
25465 * src/reader.c: Update copyright date.
25466
25467 * src/main.c:
25468 Ditch sprintf to statically-sized buffers in fatal/warn functions in
25469 favor of output directly to stderr (avoids buffer overruns).
25470
25471 * src/reader.c: Some checks for premature EOF.
25472
25473 * 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:
25474 Use prototypes if the compiler understands them.
25475
25476 * src/files.c: Honor TMPDIR on Unix hosts.
25477 Use prototypes if the compiler understands them.
25478
25479 * src/reader.c:
25480 Fix a couple of buffer overrun bugs.
25481 Use prototypes if the compiler understands them.
25482
25483 * src/system.h: Include unistd.h and ctype.h.
25484 Use #ifdef instead of #if for NLS symbols.
25485
254861998-12-30 Jesse Thilo <jthilo@gnu.org>
25487
25488 * doc/bison.texinfo:
25489 Delete comment "consider using @set for edition number, etc..." since
25490 we now are doing so.
25491
254921998-12-30 Jesse Thilo <jthilo@gnu.org>
25493
25494 * configure.in:
25495 Use prototypes if the compiler understands them.
25496
25497 * NEWS: Document 1.26 highlights.
25498
25499 * Makefile.am: Require Automake 1.3 or later.
25500
25501 * acconfig.h:
25502 Use prototypes if the compiler understands them.
25503
255041998-12-29 Jesse Thilo <jthilo@gnu.org>
25505
25506 * src/version.c:
25507 Use VERSION symbol from automake for version number.
25508
255091998-12-29 Jesse Thilo <jthilo@gnu.org>
25510
25511 * acconfig.h, configure.in, version.cin:
25512 Use VERSION symbol from automake for version number.
25513
255141998-11-28 Jesse Thilo <jthilo@gnu.org>
25515
25516 * Makefile.am:
25517 Distribute original version of simple parser (bison.s1), not built
25518 version (bison.simple).
25519
255201998-11-28 Jesse Thilo <jthilo@gnu.org>
25521
25522 * doc/bison.texinfo: Add info dir entry.
25523
25524 * doc/bison.texinfo:
25525 Let automake put version number into documentation.
25526
255271998-11-26 Jesse Thilo <jthilo@gnu.org>
25528
25529 * src/bison.cld, src/build.com, src/vmshlp.mar:
25530 Add non-RCS files from /gd/gnu/bison.
25531
255321998-11-26 Jesse Thilo <jthilo@gnu.org>
25533
25534 * doc/bison.1:
25535 Document the BISON_HAIRY and BISON_SIMPLE variables.
25536
255371998-11-25 Jesse Thilo <jthilo@gnu.org>
25538
25539 * src/version.c: Build version.c automatically.
25540
25541 * src/reader.c:
25542 Fix token numbering (used to start at 258, not 257).
25543
25544 * src/system.h: Include config.h.
25545
25546 * src/getargs.c: Update bug report address.
25547
25548 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
25549 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
25550
255511998-11-25 Jesse Thilo <jthilo@gnu.org>
25552
25553 * Makefile.am:
25554 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
25555
25556 * configure.in, version.cin:
25557 Build version.c automatically.
25558
25559 * AUTHORS: Add AUTHORS file.
25560
25561 * README: Update bug report address.
25562
25563 * bison.simple:
25564 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
25565
25566 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
25567 Add automake stuff.
25568
255691998-11-25 Jesse Thilo <jthilo@gnu.org>
25570
25571 * doc/bison.texinfo: Clean up some formatting.
25572
255731998-05-05 Richard Stallman <rms@gnu.org>
25574
25575 * doc/bison.texinfo:
25576 Explain better why to make a pure parser.
25577
255781998-01-05 Richard Stallman <rms@gnu.org>
25579
25580 * src/files.c (openfiles):
25581 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
25582 find a temporary directory, if possible. Do not unlink files while
25583 they are open.
25584
255851997-08-25 Richard Stallman <rms@gnu.org>
25586
25587 * src/reader.c (stack_offset;):
25588 Change some warni to warns.
25589
25590 * src/lex.c (literalchar): Use warns, not warni.
25591
255921997-06-28 Richard Stallman <rms@gnu.org>
25593
25594 * src/bison.s1: Add a Bison version comment.
25595
25596 * src/main.c (fatal, warn, berror):
25597 Use program_name.
25598
255991997-06-28 Richard Stallman <rms@gnu.org>
25600
25601 * Makefile.in (bison_version): New variable.
25602 (dist): Use that variable.
25603 (bison.s1): Substitute the Bison version into bison.simple.
25604
25605 * bison.simple: Add a Bison version comment.
25606
256071997-06-18 Richard Stallman <rms@gnu.org>
25608
25609 * src/main.c (fatal, warn, berror):
25610 Make error messages standard.
25611 (toomany): Improve error message text.
25612
25613 * 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:
25614 new.h renamed to alloc.h.
25615
256161997-06-18 Richard Stallman <rms@gnu.org>
25617
25618 * Makefile.in: new.h renamed to alloc.h.
25619
256201997-05-24 Richard Stallman <rms@gnu.org>
25621
25622 * src/lex.c (literalchar):
25623 Fix the code for escaping \, " and '.
25624
25625 (lex): Avoid trouble when there are many chars
25626 to discard in a char literal with just several chars in it.
25627
256281997-05-17 Richard Stallman <rms@gnu.org>
25629
25630 * src/bison.s1:
25631 Use malloc, if using alloca is troublesome.
25632 (YYSTACK_USE_ALLOCA): New flag macro.
25633 Define it for some systems and compilers.
25634 (YYSTACK_ALLOC): New macro.
25635 (yyparse): Use YYSTACK_ALLOC to allocate stack.
25636 If it was malloc'd, free it.
25637
256381997-05-17 Richard Stallman <rms@gnu.org>
25639
25640 * bison.simple:
25641 Use malloc, if using alloca is troublesome.
25642 (YYSTACK_USE_ALLOCA): New flag macro.
25643 Define it for some systems and compilers.
25644 (YYSTACK_ALLOC): New macro.
25645 (yyparse): Use YYSTACK_ALLOC to allocate stack.
25646 If it was malloc'd, free it.
25647
256481997-04-23 Richard Stallman <rms@gnu.org>
25649
25650 * src/bison.s1:
25651 (alloca) [__hpux]: Always define as __builtin_alloca.
25652
256531997-04-23 Richard Stallman <rms@gnu.org>
25654
25655 * bison.simple:
25656 (alloca) [__hpux]: Always define as __builtin_alloca.
25657
256581997-04-22 Richard Stallman <rms@gnu.org>
25659
25660 * src/bison.s1:
25661 [__hpux]: Include alloca.h (right for HPUX 10)
25662 instead of declaring alloca (right for HPUX 9).
25663
25664 * src/bison.s1 (__yy_memcpy):
25665 Declare arg `count' as unsigned int.
25666 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
25667
256681997-04-22 Richard Stallman <rms@gnu.org>
25669
25670 * bison.simple:
25671 [__hpux]: Include alloca.h (right for HPUX 10)
25672 instead of declaring alloca (right for HPUX 9).
25673
25674 * bison.simple (__yy_memcpy):
25675 Declare arg `count' as unsigned int.
25676 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
25677
256781997-01-03 Richard Stallman <rms@gnu.org>
25679
25680 * src/allocate.c: [__STDC__ or _MSC_VER]:
25681 Declare calloc and realloc to return void *.
25682
256831997-01-02 Richard Stallman <rms@gnu.org>
25684
25685 * src/system.h:
25686 [_MSC_VER]: Include stdlib.h and process.h.
25687 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
25688
25689 * src/main.c (main): Return FAILURE as a value.
25690 (printable_version): Declare arg as int, not char.
25691
256921997-01-02 Richard Stallman <rms@gnu.org>
25693
25694 * Makefile.in (dist):
25695 Explicitly check for symlinks, and copy them.
25696
256971996-12-19 Richard Stallman <rms@gnu.org>
25698
25699 * src/files.c:
25700 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
25701
257021996-12-18 Paul Eggert <eggert@gnu.org>
25703
25704 * src/bison.s1 (yyparse):
25705 If __GNUC__ and YYPARSE_PARAM are both defined,
25706 declare yyparse to have a void * argument.
25707
257081996-12-18 Paul Eggert <eggert@gnu.org>
25709
25710 * bison.simple (yyparse):
25711 If __GNUC__ and YYPARSE_PARAM are both defined,
25712 declare yyparse to have a void * argument.
25713
257141996-12-17 Richard Stallman <rms@gnu.org>
25715
25716 * src/reduce.c (nbits): Add some casts.
25717
257181996-08-12 Richard Stallman <rms@gnu.org>
25719
25720 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
25721
257221996-08-12 Richard Stallman <rms@gnu.org>
25723
25724 * bison.simple: Test _MSDOS as well as _MSDOS_.
25725
257261996-07-31 Richard Stallman <rms@gnu.org>
25727
25728 * src/bison.s1:
25729 [__sun && __i386]: Include alloca.h.
25730
257311996-07-31 Richard Stallman <rms@gnu.org>
25732
25733 * bison.simple:
25734 [__sun && __i386]: Include alloca.h.
25735
257361996-07-30 Richard Stallman <rms@gnu.org>
25737
25738 * src/bison.s1: Comment change.
25739
25740 * src/bison.s1: Test _MSDOS_, not MSDOS.
25741
257421996-07-30 Richard Stallman <rms@gnu.org>
25743
25744 * bison.simple: Comment change.
25745
25746 * bison.simple: Test _MSDOS_, not MSDOS.
25747
257481996-06-01 Richard Stallman <rms@gnu.org>
25749
25750 * 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:
25751 Insert `_' macro around many string constants.
25752
25753 * src/main.c:
25754 Insert `_' macro around many string constants.
25755
25756 (main): Call setlocale, bindtextdomain and textdomain.
25757
25758 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
25759 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
25760 [ENABLE_NLS]: Include libintl.h.
25761 [ENABLE_NLS] (gettext): Define.
25762 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
25763 (N_, PACKAGE, LOCALEDIR): New macros.
25764
257651996-06-01 Richard Stallman <rms@gnu.org>
25766
25767 * POTFILES.in: New file.
25768
25769 * Makefile.in (allocate.o):
25770 Define target explicitly.
25771
25772 * Makefile.in (CFLAGS): Set to @CFLAGS@.
25773 (LDFLAGS): Set to @LDFLAGS@.
25774 (configure): Run autoconf only if preceding `cd' succeeds.
25775 (bison.s1): Redirect output to temporary file then move the
25776 temporary to the target, rather than redirecting directly to bison.s1.
25777 (clean): Remove config.status and config.log.
25778 (distclean): Don't remove config.status here.
25779
257801996-05-12 Richard Stallman <rms@gnu.org>
25781
25782 * src/bison.s1:
25783 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
25784
257851996-05-12 Richard Stallman <rms@gnu.org>
25786
25787 * bison.simple:
25788 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
25789
257901996-05-11 Richard Stallman <rms@gnu.org>
25791
25792 * src/bison.s1 (__yy_memcpy):
25793 Really reorder the args, as was supposedly done on Feb 14 1995.
25794 (yyparse): Calls changed accordingly.
25795
257961996-05-11 Richard Stallman <rms@gnu.org>
25797
25798 * Makefile.in (dist): Don't use $(srcdir).
25799
25800 * bison.simple (__yy_memcpy):
25801 Really reorder the args, as was supposedly done on Feb 14 1995.
25802 (yyparse): Calls changed accordingly.
25803
258041996-01-27 Richard Stallman <rms@gnu.org>
25805
25806 * src/output.c (output_rule_data):
25807 Test YYERROR_VERBOSE in the conditional
25808 around the definition of ttyname.
25809
258101995-12-29 Richard Stallman <rms@gnu.org>
25811
25812 * src/bison.s1:
25813 Fix line numbers in #line commands.
25814
258151995-12-29 Richard Stallman <rms@gnu.org>
25816
25817 * bison.simple:
25818 Fix line numbers in #line commands.
25819
258201995-12-27 Richard Stallman <rms@gnu.org>
25821
25822 * src/bison.s1 (YYPARSE_PARAM_DECL):
25823 In C++, make it always null.
25824 (YYPARSE_PARAM_ARG): New macro.
25825 (yyparse): Use YYPARSE_PARAM_ARG.
25826
258271995-12-27 Richard Stallman <rms@gnu.org>
25828
25829 * bison.simple (YYPARSE_PARAM_DECL):
25830 In C++, make it always null.
25831 (YYPARSE_PARAM_ARG): New macro.
25832 (yyparse): Use YYPARSE_PARAM_ARG.
25833
258341995-11-29 Richard Stallman <rms@gnu.org>
25835
25836 * doc/bison.texinfo:
25837 Describe literal string tokens, %raw, %no_lines, %token_table.
25838
258391995-11-29 Daniel Hagerty <hag@gnu.org>
25840
25841 * doc/bison.texinfo: Fixed update date
25842
258431995-10-16 Richard Stallman <rms@gnu.org>
25844
25845 * src/version.c: Version 1.25.
25846
258471995-10-16 Richard Stallman <rms@gnu.org>
25848
25849 * NEWS: *** empty log message ***
25850
258511995-10-16 Richard Stallman <rms@gnu.org>
25852
25853 * doc/bison.1, doc/bison.rnh:
25854 Add new options.
25855
258561995-10-15 Richard Stallman <rms@gnu.org>
25857
25858 * src/vmsgetargs.c, src/getargs.c:
25859 Added -n, -k, and -raw switches.
25860 (noparserflag, toknumflag, rawtoknumflag): New variables.
25861
25862 * src/symtab.h (SALIAS):
25863 New #define for adding aliases to %token.
25864 (struct bucket): Added `alias' field.
25865
25866 * src/reduce.c (reduce_grammar):
25867 Revise error message.
25868 (print_notices): Remove final `.' from error message.
25869
25870 * src/reader.c (reader_output_yylsp):
25871 New function.
25872 (readgram): Use `#if 0' around code that accepted %command
25873 inside grammar rules: The documentation doesn't allow it,
25874 and it will fail since the %command processors scan for the next %.
25875 (parse_token_decl): Extended the %token
25876 declaration to allow a multi-character symbol as an alias.
25877 (parse_thong_decl): New function.
25878 (read_declarations): Added %thong declarations.
25879 (read_declarations): Handle NOOP to deal with allowing
25880 % declarations as another means to specify the flags.
25881 (readgram): Allow %prec prior to semantics embedded in a rule.
25882 (skip_to_char, read_declarations, copy_definition)
25883 (parse_token_decl, parse_start_decl, parse_type_decl)
25884 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
25885 (get_type_name, copy_guard, copy_action, readgram)
25886 (get_type, packsymbols): Revised most error messages.
25887 Changed `fatal' to `warnxxx' to avoid aborting for error.
25888 Revised and use multiple warnxxx functions to avoid using VARARGS1.
25889 (read_declarations): Improve the error message for
25890 an invalid character. Do not abort.
25891 (read_declarations, copy_guard, copy_action): Use
25892 printable_version to avoid unprintable characters in printed output.
25893 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
25894 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
25895 Allow the type of a non-terminal can be given
25896 more than once, as long as all specifications give the same type.
25897
25898 * src/output.c:
25899 (output_headers, output_trailers, output, output_gram)
25900 (output_rule_data): Implement noparserflag variable.
25901 Implement toknumflag variable.
25902 (output): Call reader_output_yylsp to output LTYPESTR.
25903
25904 * src/main.c (main):
25905 If reader sees an error, don't process the grammar.
25906 (fatals): Updated to not use VARARGS1.
25907 (printable_version, int_to_string, warn, warni, warns, warnss)
25908 (warnsss): New error reporting functions. Avoid abort for error.
25909
25910 * src/lex.h:
25911 Added THONG and NOOP for alias processing.
25912 Added SETOPT for the new code that allows setting options with %flags.
25913
25914 * src/lex.c:
25915 Include getopt.h. Add some extern decls.
25916 (safegetc): New function to deal with EOF gracefully.
25917 (literalchar); new function to deal with reading \ escapes.
25918 (lex): Use literalchar.
25919 (lex): Implemented "..." tokens.
25920 (literalchar, lex, parse_percent_token): Made tokenbuffer
25921 always contain the token. This includes growing the token
25922 buffer while reading an integer.
25923 (parse_percent_token): Replaced if-else statement with percent_table.
25924 (parse_percent_token): Added % declarations as another
25925 way to specify the flags -n, -l, and -r. Also added hooks for
25926 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
25927 major changes to files.c.
25928 (lex) Retain in the incoming stream a character following
25929 an incorrect '/'.
25930 (skip_white_space, lex): Revised most error messages
25931 and changed fatal to warn to avoid aborting.
25932 (percent_table): Added %thong declarations.
25933
25934 * src/gram.h: Comment changes.
25935
25936 * src/files.c (openfiles, open_extra_files, done):
25937 Add faction flag
25938 and actfile file. Handle noparserflag. Both for -n switch.
25939
25940 * src/conflicts.c (resolve_sr_conflict):
25941 Remove use of alloca.
25942
259431995-06-01 Jim Meyering <meyering@gnu.org>
25944
25945 * doc/bison.texinfo: *** empty log message ***
25946
259471995-05-06 Richard Stallman <rms@gnu.org>
25948
25949 * src/bison.s1: Comment change.
25950
259511995-05-06 Richard Stallman <rms@gnu.org>
25952
25953 * bison.simple: Comment change.
25954
259551995-05-03 Richard Stallman <rms@gnu.org>
25956
25957 * src/version.c: Version now 1.24.
25958
25959 * src/bison.s1: Change distribution terms.
25960
25961 * src/version.c: Version now 1.23.
25962
259631995-05-03 Richard Stallman <rms@gnu.org>
25964
25965 * doc/bison.texinfo:
25966 Rewrite "Conditions for Using Bison".
25967 Update version to 1.24.
25968
259691995-05-03 Richard Stallman <rms@gnu.org>
25970
25971 * bison.simple: Change distribution terms.
25972
259731995-02-23 Richard Stallman <rms@gnu.org>
25974
25975 * src/files.c: Test __VMS_POSIX as well as VMS.
25976
259771995-02-14 Jim Meyering <meyering@gnu.org>
25978
25979 * src/bison.s1 (__yy_memcpy):
25980 Renamed from __yy_bcopy to avoid
25981 confusion. Reverse FROM and TO arguments to be consistent with
25982 those of memcpy.
25983
259841995-02-14 Jim Meyering <meyering@gnu.org>
25985
25986 * bison.simple (__yy_memcpy):
25987 Renamed from __yy_bcopy to avoid
25988 confusion. Reverse FROM and TO arguments to be consistent with
25989 those of memcpy.
25990
259911994-11-10 David J. MacKenzie <djm@gnu.org>
25992
25993 * NEWS: reformat
25994
25995 * NEWS: New file.
25996
25997 * Makefile.in (DISTFILES): Include NEWS.
25998
25999 * Makefile.in (DISTFILES):
26000 Include install-sh, not install.sh.
26001
26002 * configure.in: Update to Autoconf v2 macro names.
26003
260041994-10-05 David J. MacKenzie <djm@gnu.org>
26005
26006 * Makefile.in: fix typo
26007
26008 * Makefile.in (prefix, exec_prefix):
26009 Let configure set them.
26010
260111994-09-28 David J. MacKenzie <djm@gnu.org>
26012
26013 * Makefile.in: Set datadir to $(prefix)/share.
26014
260151994-09-15 Richard Stallman <rms@gnu.org>
26016
26017 * src/bison.s1:
26018 Update copyright notice and GPL version.
26019
260201994-09-15 Richard Stallman <rms@gnu.org>
26021
26022 * bison.simple:
26023 Update copyright notice and GPL version.
26024
260251994-07-12 Richard Stallman <rms@gnu.org>
26026
26027 * src/reduce.c, src/reader.c:
26028 entered into RCS
26029
260301994-05-05 David J. MacKenzie <djm@gnu.org>
26031
26032 * Makefile.in: entered into RCS
26033
260341994-03-26 Richard Stallman <rms@gnu.org>
26035
26036 * src/bison.s1: entered into RCS
26037
260381994-03-26 Richard Stallman <rms@gnu.org>
26039
26040 * bison.simple: entered into RCS
26041
260421994-03-25 Richard Stallman <rms@gnu.org>
26043
26044 * src/main.c: entered into RCS
26045
260461994-03-24 Richard Stallman <rms@gnu.org>
26047
26048 * src/conflicts.c: entered into RCS
26049
260501994-01-02 Richard Stallman <rms@gnu.org>
26051
26052 * Makefile.in: *** empty log message ***
26053
260541993-11-21 Richard Stallman <rms@gnu.org>
26055
26056 * src/bison.s1: *** empty log message ***
26057
260581993-11-21 Richard Stallman <rms@gnu.org>
26059
26060 * doc/bison.texinfo: entered into RCS
26061
26062 * doc/bison.texinfo: *** empty log message ***
26063
260641993-11-21 Richard Stallman <rms@gnu.org>
26065
26066 * bison.simple: *** empty log message ***
26067
260681993-10-25 David J. MacKenzie <djm@gnu.org>
26069
26070 * doc/bison.texinfo: *** empty log message ***
26071
260721993-10-19 Richard Stallman <rms@gnu.org>
26073
26074 * src/bison.s1: *** empty log message ***
26075
260761993-10-19 Richard Stallman <rms@gnu.org>
26077
26078 * bison.simple: *** empty log message ***
26079
260801993-10-14 Richard Stallman <rms@gnu.org>
26081
26082 * src/bison.s1: *** empty log message ***
26083
260841993-10-14 Richard Stallman <rms@gnu.org>
26085
26086 * bison.simple: *** empty log message ***
26087
260881993-09-14 David J. MacKenzie <djm@gnu.org>
26089
26090 * doc/bison.texinfo: *** empty log message ***
26091
260921993-09-13 Noah Friedman <friedman@gnu.org>
26093
26094 * Makefile.in: *** empty log message ***
26095
260961993-09-10 Richard Stallman <rms@gnu.org>
26097
26098 * src/conflicts.c: *** empty log message ***
26099
26100 * src/system.h: entered into RCS
26101
261021993-09-10 Richard Stallman <rms@gnu.org>
26103
26104 * doc/bison.1: entered into RCS
26105
261061993-09-06 Noah Friedman <friedman@gnu.org>
26107
26108 * src/version.c: entered into RCS
26109
261101993-09-06 Noah Friedman <friedman@gnu.org>
26111
26112 * Makefile.in: *** empty log message ***
26113
261141993-07-30 David J. MacKenzie <djm@gnu.org>
26115
26116 * Makefile.in: *** empty log message ***
26117
261181993-07-24 Richard Stallman <rms@gnu.org>
26119
26120 * src/bison.s1: *** empty log message ***
26121
261221993-07-24 Richard Stallman <rms@gnu.org>
26123
26124 * bison.simple: *** empty log message ***
26125
261261993-07-08 David J. MacKenzie <djm@gnu.org>
26127
26128 * Makefile.in: *** empty log message ***
26129
261301993-07-04 Richard Stallman <rms@gnu.org>
26131
26132 * src/bison.s1: *** empty log message ***
26133
261341993-07-04 Richard Stallman <rms@gnu.org>
26135
26136 * bison.simple: *** empty log message ***
26137
261381993-06-26 David J. MacKenzie <djm@gnu.org>
26139
26140 * src/getargs.c: entered into RCS
26141
261421993-06-26 David J. MacKenzie <djm@gnu.org>
26143
26144 * doc/bison.texinfo: *** empty log message ***
26145
26146 * doc/bison.1: New file.
26147
261481993-06-25 Richard Stallman <rms@gnu.org>
26149
26150 * src/getargs.c: New file.
26151
261521993-06-16 Richard Stallman <rms@gnu.org>
26153
26154 * src/bison.s1: *** empty log message ***
26155
261561993-06-16 Richard Stallman <rms@gnu.org>
26157
26158 * bison.simple: *** empty log message ***
26159
261601993-06-03 Richard Stallman <rms@gnu.org>
26161
26162 * src/bison.s1: New file.
26163
261641993-06-03 Richard Stallman <rms@gnu.org>
26165
26166 * doc/bison.texinfo: *** empty log message ***
26167
261681993-06-03 Richard Stallman <rms@gnu.org>
26169
26170 * bison.simple: New file.
26171
261721993-05-19 Richard Stallman <rms@gnu.org>
26173
26174 * doc/bison.texinfo: New file.
26175
261761993-05-07 Noah Friedman <friedman@gnu.org>
26177
26178 * Makefile.in: *** empty log message ***
26179
261801993-04-28 Noah Friedman <friedman@gnu.org>
26181
26182 * src/reader.c: *** empty log message ***
26183
261841993-04-23 Noah Friedman <friedman@gnu.org>
26185
26186 * src/alloc.h: entered into RCS
26187
261881993-04-20 David J. MacKenzie <djm@gnu.org>
26189
26190 * src/version.c: *** empty log message ***
26191
26192 * src/files.c, src/allocate.c:
26193 entered into RCS
26194
26195 * src/reader.c: *** empty log message ***
26196
26197 * src/lex.c: entered into RCS
26198
26199 * src/conflicts.c: New file.
26200
26201 * src/symtab.c: entered into RCS
26202
26203 * src/alloc.h: New file.
26204
26205 * src/LR0.c: entered into RCS
26206
262071993-04-18 Noah Friedman <friedman@gnu.org>
26208
26209 * src/reader.c: New file.
26210
26211 * src/version.c: *** empty log message ***
26212
262131993-04-18 Noah Friedman <friedman@gnu.org>
26214
26215 * Makefile.in: *** empty log message ***
26216
262171993-04-17 Noah Friedman <friedman@gnu.org>
26218
26219 * Makefile.in: *** empty log message ***
26220
262211993-04-15 Richard Stallman <rms@gnu.org>
26222
26223 * src/main.c, src/files.c:
26224 New file.
26225
262261993-04-15 Noah Friedman <friedman@gnu.org>
26227
26228 * configure.in: entered into RCS
26229
26230 * configure.in: *** empty log message ***
26231
26232 * configure.in: New file.
26233
262341993-04-14 Richard Stallman <rms@gnu.org>
26235
26236 * Makefile.in: New file.
26237
262381993-04-13 Richard Stallman <rms@gnu.org>
26239
26240 * src/version.c: New file.
26241
262421993-03-25 Richard Stallman <rms@gnu.org>
26243
26244 * src/output.c: entered into RCS
26245
262461992-09-25 Richard Stallman <rms@gnu.org>
26247
26248 * configure.bat: entered into RCS
26249
262501992-06-22 Richard Stallman <rms@gnu.org>
26251
26252 * src/vmsgetargs.c: entered into RCS
26253
262541992-06-22 Richard Stallman <rms@gnu.org>
26255
26256 * doc/bison.rnh: entered into RCS
26257
262581992-04-20 David J. MacKenzie <djm@gnu.org>
26259
26260 * README: entered into RCS
26261
262621992-01-22 Richard Stallman <rms@gnu.org>
26263
26264 * src/machine.h: entered into RCS
26265
262661991-12-21 Richard Stallman <rms@gnu.org>
26267
26268 * src/lalr.c, src/closure.c:
26269 entered into RCS
26270
262711991-12-20 Richard Stallman <rms@gnu.org>
26272
26273 * src/state.h: entered into RCS
26274
262751991-12-18 Richard Stallman <rms@gnu.org>
26276
26277 * src/print.c, src/nullable.c, src/derives.c:
26278 entered into RCS
26279
262801991-11-03 David J. MacKenzie <djm@gnu.org>
26281
26282 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
26283 entered into RCS
26284
262851988-09-09 Richard Stallman <rms@gnu.org>
26286
26287 * src/bison.hairy: entered into RCS
26288
262891987-12-16 Richard Stallman <rms@gnu.org>
26290
26291 * REFERENCES: entered into RCS
26292
26293
26294 -----
26295
26296 Copyright (C) 1987-1988, 1991-2011 Free Software Foundation,
26297 Inc.
26298
26299 Copying and distribution of this file, with or without
26300 modification, are permitted provided the copyright notice and this
26301 notice are preserved.